From 484ce797a6bb40113bd8b519a75d40418a34bfa9 Mon Sep 17 00:00:00 2001
From: David Malcolm <dmalcolm@redhat.com>
Date: Wed, 8 Nov 2017 10:51:00 -0500
Subject: [PATCH 05/21] {not-for-upstream} test coverage for parser that's not
 for upstream

Test cases that are too big to be sane for upstream
(e.g. unreduced; keeping them around for testing as I hack on
location wrappers)
---
 cp-stdlib-error.ii                                 |     32 +
 .../NOT_FOR_UPSTREAM/BasicTargetTransformInfo.C    | 149204 ++++++++++++++++++
 .../g++.dg/wrappers/NOT_FOR_UPSTREAM/cp-stdlib.C   |    154 +
 .../wrappers/NOT_FOR_UPSTREAM/cxx11-ios_failure.ii |     14 +
 .../NOT_FOR_UPSTREAM/cxx11-ios_failure.orig.ii     |  24990 +++
 .../NOT_FOR_UPSTREAM/gimple-ssa-sprintf.ii         |     12 +
 .../g++.dg/wrappers/NOT_FOR_UPSTREAM/kdecore.C     | 129586 +++++++++++++++
 .../wrappers/NOT_FOR_UPSTREAM/pr83902-unreduced.C  |  13363 ++
 .../NOT_FOR_UPSTREAM/reduced-x86-tune-sched-bd.ii  |     20 +
 .../NOT_FOR_UPSTREAM/test-const-char-ptr.C         |      7 +
 .../g++.dg/wrappers/NOT_FOR_UPSTREAM/test-refs.C   |      6 +
 11 files changed, 317388 insertions(+)
 create mode 100644 cp-stdlib-error.ii
 create mode 100644 gcc/testsuite/g++.dg/wrappers/NOT_FOR_UPSTREAM/BasicTargetTransformInfo.C
 create mode 100644 gcc/testsuite/g++.dg/wrappers/NOT_FOR_UPSTREAM/cp-stdlib.C
 create mode 100644 gcc/testsuite/g++.dg/wrappers/NOT_FOR_UPSTREAM/cxx11-ios_failure.ii
 create mode 100644 gcc/testsuite/g++.dg/wrappers/NOT_FOR_UPSTREAM/cxx11-ios_failure.orig.ii
 create mode 100644 gcc/testsuite/g++.dg/wrappers/NOT_FOR_UPSTREAM/gimple-ssa-sprintf.ii
 create mode 100644 gcc/testsuite/g++.dg/wrappers/NOT_FOR_UPSTREAM/kdecore.C
 create mode 100644 gcc/testsuite/g++.dg/wrappers/NOT_FOR_UPSTREAM/pr83902-unreduced.C
 create mode 100644 gcc/testsuite/g++.dg/wrappers/NOT_FOR_UPSTREAM/reduced-x86-tune-sched-bd.ii
 create mode 100644 gcc/testsuite/g++.dg/wrappers/NOT_FOR_UPSTREAM/test-const-char-ptr.C
 create mode 100644 gcc/testsuite/g++.dg/wrappers/NOT_FOR_UPSTREAM/test-refs.C

diff --git a/cp-stdlib-error.ii b/cp-stdlib-error.ii
new file mode 100644
index 0000000..9a1d5d7
--- /dev/null
+++ b/cp-stdlib-error.ii
@@ -0,0 +1,32 @@
+template<typename _Tp>
+__addressof(_Tp& __r) noexcept
+{ return __builtin_addressof(__r); }
+
+class function<_Res(_ArgTypes...)>
+{
+  struct once_flag
+  {
+  };
+  template<typename _Callable, typename... _Args>
+  call_once
+  (
+	    once_flag& __once,
+	    _Callable&& __f,
+	    {
+	      auto __callable = [&] {
+    };
+    __addressof(__callable);
+  }
+    once_flag _M_once;
+    _M_set_delayed_result
+(
+ function<_Ptr_type()>
+ __res,
+ {
+   bool __did_set = false;
+   call_once
+     (
+      _M_once,
+      __addressof(__res),
+      __addressof(__did_set)
+      );
diff --git a/gcc/testsuite/g++.dg/wrappers/NOT_FOR_UPSTREAM/BasicTargetTransformInfo.C b/gcc/testsuite/g++.dg/wrappers/NOT_FOR_UPSTREAM/BasicTargetTransformInfo.C
new file mode 100644
index 0000000..e6b2101
--- /dev/null
+++ b/gcc/testsuite/g++.dg/wrappers/NOT_FOR_UPSTREAM/BasicTargetTransformInfo.C
@@ -0,0 +1,149204 @@
+// { dg-do compile { target c++11 } }
+// { dg-options "-Wno-deprecated-declarations -Wno-overflow -fsyntax-only" }
+
+namespace std
+{
+  typedef long unsigned int size_t;
+  typedef long int ptrdiff_t;
+
+
+  typedef decltype(nullptr) nullptr_t;
+
+}
+namespace std
+{
+  inline namespace __cxx11 __attribute__((__abi_tag__ ("cxx11"))) { }
+}
+namespace __gnu_cxx
+{
+  inline namespace __cxx11 __attribute__((__abi_tag__ ("cxx11"))) { }
+}
+namespace std
+{
+  inline namespace __gnu_cxx_ldbl128 { }
+}
+
+
+
+
+
+
+       
+extern "C++" {
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+  struct __true_type { };
+  struct __false_type { };
+
+  template<bool>
+    struct __truth_type
+    { typedef __false_type __type; };
+
+  template<>
+    struct __truth_type<true>
+    { typedef __true_type __type; };
+
+
+
+  template<class _Sp, class _Tp>
+    struct __traitor
+    {
+      enum { __value = bool(_Sp::__value) || bool(_Tp::__value) };
+      typedef typename __truth_type<__value>::__type __type;
+    };
+
+
+  template<typename, typename>
+    struct __are_same
+    {
+      enum { __value = 0 };
+      typedef __false_type __type;
+    };
+
+  template<typename _Tp>
+    struct __are_same<_Tp, _Tp>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+
+  template<typename _Tp>
+    struct __is_void
+    {
+      enum { __value = 0 };
+      typedef __false_type __type;
+    };
+
+  template<>
+    struct __is_void<void>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+
+
+
+  template<typename _Tp>
+    struct __is_integer
+    {
+      enum { __value = 0 };
+      typedef __false_type __type;
+    };
+
+
+
+
+
+  template<>
+    struct __is_integer<bool>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_integer<char>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_integer<signed char>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_integer<unsigned char>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+
+  template<>
+    struct __is_integer<wchar_t>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+
+
+  template<>
+    struct __is_integer<char16_t>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_integer<char32_t>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+
+  template<>
+    struct __is_integer<short>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_integer<unsigned short>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_integer<int>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_integer<unsigned int>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_integer<long>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_integer<unsigned long>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_integer<long long>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_integer<unsigned long long>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+  template<typename _Tp>
+    struct __is_floating
+    {
+      enum { __value = 0 };
+      typedef __false_type __type;
+    };
+
+
+  template<>
+    struct __is_floating<float>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_floating<double>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_floating<long double>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+
+
+
+  template<typename _Tp>
+    struct __is_pointer
+    {
+      enum { __value = 0 };
+      typedef __false_type __type;
+    };
+
+  template<typename _Tp>
+    struct __is_pointer<_Tp*>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+
+
+
+  template<typename _Tp>
+    struct __is_arithmetic
+    : public __traitor<__is_integer<_Tp>, __is_floating<_Tp> >
+    { };
+
+
+
+
+  template<typename _Tp>
+    struct __is_scalar
+    : public __traitor<__is_arithmetic<_Tp>, __is_pointer<_Tp> >
+    { };
+
+
+
+
+  template<typename _Tp>
+    struct __is_char
+    {
+      enum { __value = 0 };
+      typedef __false_type __type;
+    };
+
+  template<>
+    struct __is_char<char>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+
+  template<>
+    struct __is_char<wchar_t>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+
+  template<typename _Tp>
+    struct __is_byte
+    {
+      enum { __value = 0 };
+      typedef __false_type __type;
+    };
+
+  template<>
+    struct __is_byte<char>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_byte<signed char>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_byte<unsigned char>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+
+
+
+  template<typename _Tp>
+    struct __is_move_iterator
+    {
+      enum { __value = 0 };
+      typedef __false_type __type;
+    };
+
+
+
+  template<typename _Iterator>
+    inline _Iterator
+    __miter_base(_Iterator __it)
+    { return __it; }
+
+
+}
+}
+       
+
+
+
+
+extern "C++" {
+
+namespace __gnu_cxx __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+  template<bool, typename>
+    struct __enable_if
+    { };
+
+  template<typename _Tp>
+    struct __enable_if<true, _Tp>
+    { typedef _Tp __type; };
+
+
+
+  template<bool _Cond, typename _Iftrue, typename _Iffalse>
+    struct __conditional_type
+    { typedef _Iftrue __type; };
+
+  template<typename _Iftrue, typename _Iffalse>
+    struct __conditional_type<false, _Iftrue, _Iffalse>
+    { typedef _Iffalse __type; };
+
+
+
+  template<typename _Tp>
+    struct __add_unsigned
+    {
+    private:
+      typedef __enable_if<std::__is_integer<_Tp>::__value, _Tp> __if_type;
+
+    public:
+      typedef typename __if_type::__type __type;
+    };
+
+  template<>
+    struct __add_unsigned<char>
+    { typedef unsigned char __type; };
+
+  template<>
+    struct __add_unsigned<signed char>
+    { typedef unsigned char __type; };
+
+  template<>
+    struct __add_unsigned<short>
+    { typedef unsigned short __type; };
+
+  template<>
+    struct __add_unsigned<int>
+    { typedef unsigned int __type; };
+
+  template<>
+    struct __add_unsigned<long>
+    { typedef unsigned long __type; };
+
+  template<>
+    struct __add_unsigned<long long>
+    { typedef unsigned long long __type; };
+
+
+  template<>
+    struct __add_unsigned<bool>;
+
+  template<>
+    struct __add_unsigned<wchar_t>;
+
+
+
+  template<typename _Tp>
+    struct __remove_unsigned
+    {
+    private:
+      typedef __enable_if<std::__is_integer<_Tp>::__value, _Tp> __if_type;
+
+    public:
+      typedef typename __if_type::__type __type;
+    };
+
+  template<>
+    struct __remove_unsigned<char>
+    { typedef signed char __type; };
+
+  template<>
+    struct __remove_unsigned<unsigned char>
+    { typedef signed char __type; };
+
+  template<>
+    struct __remove_unsigned<unsigned short>
+    { typedef short __type; };
+
+  template<>
+    struct __remove_unsigned<unsigned int>
+    { typedef int __type; };
+
+  template<>
+    struct __remove_unsigned<unsigned long>
+    { typedef long __type; };
+
+  template<>
+    struct __remove_unsigned<unsigned long long>
+    { typedef long long __type; };
+
+
+  template<>
+    struct __remove_unsigned<bool>;
+
+  template<>
+    struct __remove_unsigned<wchar_t>;
+
+
+
+  template<typename _Type>
+    inline bool
+    __is_null_pointer(_Type* __ptr)
+    { return __ptr == 0; }
+
+  template<typename _Type>
+    inline bool
+    __is_null_pointer(_Type)
+    { return false; }
+
+
+  inline bool
+  __is_null_pointer(std::nullptr_t)
+  { return true; }
+
+
+
+  template<typename _Tp, bool = std::__is_integer<_Tp>::__value>
+    struct __promote
+    { typedef double __type; };
+
+
+
+
+  template<typename _Tp>
+    struct __promote<_Tp, false>
+    { };
+
+  template<>
+    struct __promote<long double>
+    { typedef long double __type; };
+
+  template<>
+    struct __promote<double>
+    { typedef double __type; };
+
+  template<>
+    struct __promote<float>
+    { typedef float __type; };
+
+  template<typename _Tp, typename _Up,
+           typename _Tp2 = typename __promote<_Tp>::__type,
+           typename _Up2 = typename __promote<_Up>::__type>
+    struct __promote_2
+    {
+      typedef __typeof__(_Tp2() + _Up2()) __type;
+    };
+
+  template<typename _Tp, typename _Up, typename _Vp,
+           typename _Tp2 = typename __promote<_Tp>::__type,
+           typename _Up2 = typename __promote<_Up>::__type,
+           typename _Vp2 = typename __promote<_Vp>::__type>
+    struct __promote_3
+    {
+      typedef __typeof__(_Tp2() + _Up2() + _Vp2()) __type;
+    };
+
+  template<typename _Tp, typename _Up, typename _Vp, typename _Wp,
+           typename _Tp2 = typename __promote<_Tp>::__type,
+           typename _Up2 = typename __promote<_Up>::__type,
+           typename _Vp2 = typename __promote<_Vp>::__type,
+           typename _Wp2 = typename __promote<_Wp>::__type>
+    struct __promote_4
+    {
+      typedef __typeof__(_Tp2() + _Up2() + _Vp2() + _Wp2()) __type;
+    };
+
+
+}
+}
+
+extern "C" {
+
+
+
+
+
+
+
+
+
+
+
+typedef float float_t;
+typedef double double_t;
+
+
+extern double acos (double __x) throw (); extern double __acos (double __x) throw ();
+
+extern double asin (double __x) throw (); extern double __asin (double __x) throw ();
+
+extern double atan (double __x) throw (); extern double __atan (double __x) throw ();
+
+extern double atan2 (double __y, double __x) throw (); extern double __atan2 (double __y, double __x) throw ();
+
+
+extern double cos (double __x) throw (); extern double __cos (double __x) throw ();
+
+extern double sin (double __x) throw (); extern double __sin (double __x) throw ();
+
+extern double tan (double __x) throw (); extern double __tan (double __x) throw ();
+
+
+
+
+extern double cosh (double __x) throw (); extern double __cosh (double __x) throw ();
+
+extern double sinh (double __x) throw (); extern double __sinh (double __x) throw ();
+
+extern double tanh (double __x) throw (); extern double __tanh (double __x) throw ();
+
+
+
+
+extern void sincos (double __x, double *__sinx, double *__cosx) throw (); extern void __sincos (double __x, double *__sinx, double *__cosx) throw ()
+                                                           ;
+
+
+
+
+
+extern double acosh (double __x) throw (); extern double __acosh (double __x) throw ();
+
+extern double asinh (double __x) throw (); extern double __asinh (double __x) throw ();
+
+extern double atanh (double __x) throw (); extern double __atanh (double __x) throw ();
+
+
+
+
+
+
+
+extern double exp (double __x) throw (); extern double __exp (double __x) throw ();
+
+
+extern double frexp (double __x, int *__exponent) throw (); extern double __frexp (double __x, int *__exponent) throw ();
+
+
+extern double ldexp (double __x, int __exponent) throw (); extern double __ldexp (double __x, int __exponent) throw ();
+
+
+extern double log (double __x) throw (); extern double __log (double __x) throw ();
+
+
+extern double log10 (double __x) throw (); extern double __log10 (double __x) throw ();
+
+
+extern double modf (double __x, double *__iptr) throw (); extern double __modf (double __x, double *__iptr) throw ()
+     __attribute__ ((__nonnull__ (2)));
+
+
+
+
+extern double exp10 (double __x) throw (); extern double __exp10 (double __x) throw ();
+
+extern double pow10 (double __x) throw (); extern double __pow10 (double __x) throw ();
+
+
+
+
+
+extern double expm1 (double __x) throw (); extern double __expm1 (double __x) throw ();
+
+
+extern double log1p (double __x) throw (); extern double __log1p (double __x) throw ();
+
+
+extern double logb (double __x) throw (); extern double __logb (double __x) throw ();
+
+
+
+
+
+
+extern double exp2 (double __x) throw (); extern double __exp2 (double __x) throw ();
+
+
+extern double log2 (double __x) throw (); extern double __log2 (double __x) throw ();
+
+
+
+
+
+
+
+
+extern double pow (double __x, double __y) throw (); extern double __pow (double __x, double __y) throw ();
+
+
+extern double sqrt (double __x) throw (); extern double __sqrt (double __x) throw ();
+
+
+
+
+
+extern double hypot (double __x, double __y) throw (); extern double __hypot (double __x, double __y) throw ();
+
+
+
+
+
+
+extern double cbrt (double __x) throw (); extern double __cbrt (double __x) throw ();
+
+
+
+
+
+
+
+
+extern double ceil (double __x) throw () __attribute__ ((__const__)); extern double __ceil (double __x) throw () __attribute__ ((__const__));
+
+
+extern double fabs (double __x) throw () __attribute__ ((__const__)); extern double __fabs (double __x) throw () __attribute__ ((__const__));
+
+
+extern double floor (double __x) throw () __attribute__ ((__const__)); extern double __floor (double __x) throw () __attribute__ ((__const__));
+
+
+extern double fmod (double __x, double __y) throw (); extern double __fmod (double __x, double __y) throw ();
+
+
+
+
+extern int __isinf (double __value) throw () __attribute__ ((__const__));
+
+
+extern int __finite (double __value) throw () __attribute__ ((__const__));
+
+
+
+
+
+extern int isinf (double __value) throw () __attribute__ ((__const__));
+
+
+extern int finite (double __value) throw () __attribute__ ((__const__));
+
+
+extern double drem (double __x, double __y) throw (); extern double __drem (double __x, double __y) throw ();
+
+
+
+extern double significand (double __x) throw (); extern double __significand (double __x) throw ();
+
+
+
+
+
+extern double copysign (double __x, double __y) throw () __attribute__ ((__const__)); extern double __copysign (double __x, double __y) throw () __attribute__ ((__const__));
+
+
+
+
+
+
+extern double nan (const char *__tagb) throw () __attribute__ ((__const__)); extern double __nan (const char *__tagb) throw () __attribute__ ((__const__));
+
+
+
+
+
+extern int __isnan (double __value) throw () __attribute__ ((__const__));
+
+
+
+extern int isnan (double __value) throw () __attribute__ ((__const__));
+
+
+extern double j0 (double) throw (); extern double __j0 (double) throw ();
+extern double j1 (double) throw (); extern double __j1 (double) throw ();
+extern double jn (int, double) throw (); extern double __jn (int, double) throw ();
+extern double y0 (double) throw (); extern double __y0 (double) throw ();
+extern double y1 (double) throw (); extern double __y1 (double) throw ();
+extern double yn (int, double) throw (); extern double __yn (int, double) throw ();
+
+
+
+
+
+
+extern double erf (double) throw (); extern double __erf (double) throw ();
+extern double erfc (double) throw (); extern double __erfc (double) throw ();
+extern double lgamma (double) throw (); extern double __lgamma (double) throw ();
+
+
+
+
+
+
+extern double tgamma (double) throw (); extern double __tgamma (double) throw ();
+
+
+
+
+
+extern double gamma (double) throw (); extern double __gamma (double) throw ();
+
+
+
+
+
+
+extern double lgamma_r (double, int *__signgamp) throw (); extern double __lgamma_r (double, int *__signgamp) throw ();
+
+
+
+
+
+
+
+extern double rint (double __x) throw (); extern double __rint (double __x) throw ();
+
+
+extern double nextafter (double __x, double __y) throw () __attribute__ ((__const__)); extern double __nextafter (double __x, double __y) throw () __attribute__ ((__const__));
+
+extern double nexttoward (double __x, long double __y) throw () __attribute__ ((__const__)); extern double __nexttoward (double __x, long double __y) throw () __attribute__ ((__const__));
+
+
+
+extern double remainder (double __x, double __y) throw (); extern double __remainder (double __x, double __y) throw ();
+
+
+
+extern double scalbn (double __x, int __n) throw (); extern double __scalbn (double __x, int __n) throw ();
+
+
+
+extern int ilogb (double __x) throw (); extern int __ilogb (double __x) throw ();
+
+
+
+
+extern double scalbln (double __x, long int __n) throw (); extern double __scalbln (double __x, long int __n) throw ();
+
+
+
+extern double nearbyint (double __x) throw (); extern double __nearbyint (double __x) throw ();
+
+
+
+extern double round (double __x) throw () __attribute__ ((__const__)); extern double __round (double __x) throw () __attribute__ ((__const__));
+
+
+
+extern double trunc (double __x) throw () __attribute__ ((__const__)); extern double __trunc (double __x) throw () __attribute__ ((__const__));
+
+
+
+
+extern double remquo (double __x, double __y, int *__quo) throw (); extern double __remquo (double __x, double __y, int *__quo) throw ();
+
+
+
+
+
+
+extern long int lrint (double __x) throw (); extern long int __lrint (double __x) throw ();
+extern long long int llrint (double __x) throw (); extern long long int __llrint (double __x) throw ();
+
+
+
+extern long int lround (double __x) throw (); extern long int __lround (double __x) throw ();
+extern long long int llround (double __x) throw (); extern long long int __llround (double __x) throw ();
+
+
+
+extern double fdim (double __x, double __y) throw (); extern double __fdim (double __x, double __y) throw ();
+
+
+extern double fmax (double __x, double __y) throw () __attribute__ ((__const__)); extern double __fmax (double __x, double __y) throw () __attribute__ ((__const__));
+
+
+extern double fmin (double __x, double __y) throw () __attribute__ ((__const__)); extern double __fmin (double __x, double __y) throw () __attribute__ ((__const__));
+
+
+
+extern int __fpclassify (double __value) throw ()
+     __attribute__ ((__const__));
+
+
+extern int __signbit (double __value) throw ()
+     __attribute__ ((__const__));
+
+
+
+extern double fma (double __x, double __y, double __z) throw (); extern double __fma (double __x, double __y, double __z) throw ();
+
+
+
+
+
+
+
+
+extern double scalb (double __x, double __n) throw (); extern double __scalb (double __x, double __n) throw ();
+
+
+extern float acosf (float __x) throw (); extern float __acosf (float __x) throw ();
+
+extern float asinf (float __x) throw (); extern float __asinf (float __x) throw ();
+
+extern float atanf (float __x) throw (); extern float __atanf (float __x) throw ();
+
+extern float atan2f (float __y, float __x) throw (); extern float __atan2f (float __y, float __x) throw ();
+
+
+extern float cosf (float __x) throw (); extern float __cosf (float __x) throw ();
+
+extern float sinf (float __x) throw (); extern float __sinf (float __x) throw ();
+
+extern float tanf (float __x) throw (); extern float __tanf (float __x) throw ();
+
+
+
+
+extern float coshf (float __x) throw (); extern float __coshf (float __x) throw ();
+
+extern float sinhf (float __x) throw (); extern float __sinhf (float __x) throw ();
+
+extern float tanhf (float __x) throw (); extern float __tanhf (float __x) throw ();
+
+
+
+
+extern void sincosf (float __x, float *__sinx, float *__cosx) throw (); extern void __sincosf (float __x, float *__sinx, float *__cosx) throw ()
+                                                           ;
+
+
+
+
+
+extern float acoshf (float __x) throw (); extern float __acoshf (float __x) throw ();
+
+extern float asinhf (float __x) throw (); extern float __asinhf (float __x) throw ();
+
+extern float atanhf (float __x) throw (); extern float __atanhf (float __x) throw ();
+
+
+
+
+
+
+
+extern float expf (float __x) throw (); extern float __expf (float __x) throw ();
+
+
+extern float frexpf (float __x, int *__exponent) throw (); extern float __frexpf (float __x, int *__exponent) throw ();
+
+
+extern float ldexpf (float __x, int __exponent) throw (); extern float __ldexpf (float __x, int __exponent) throw ();
+
+
+extern float logf (float __x) throw (); extern float __logf (float __x) throw ();
+
+
+extern float log10f (float __x) throw (); extern float __log10f (float __x) throw ();
+
+
+extern float modff (float __x, float *__iptr) throw (); extern float __modff (float __x, float *__iptr) throw ()
+     __attribute__ ((__nonnull__ (2)));
+
+
+
+
+extern float exp10f (float __x) throw (); extern float __exp10f (float __x) throw ();
+
+extern float pow10f (float __x) throw (); extern float __pow10f (float __x) throw ();
+
+
+
+
+
+extern float expm1f (float __x) throw (); extern float __expm1f (float __x) throw ();
+
+
+extern float log1pf (float __x) throw (); extern float __log1pf (float __x) throw ();
+
+
+extern float logbf (float __x) throw (); extern float __logbf (float __x) throw ();
+
+
+
+
+
+
+extern float exp2f (float __x) throw (); extern float __exp2f (float __x) throw ();
+
+
+extern float log2f (float __x) throw (); extern float __log2f (float __x) throw ();
+
+
+
+
+
+
+
+
+extern float powf (float __x, float __y) throw (); extern float __powf (float __x, float __y) throw ();
+
+
+extern float sqrtf (float __x) throw (); extern float __sqrtf (float __x) throw ();
+
+
+
+
+
+extern float hypotf (float __x, float __y) throw (); extern float __hypotf (float __x, float __y) throw ();
+
+
+
+
+
+
+extern float cbrtf (float __x) throw (); extern float __cbrtf (float __x) throw ();
+
+
+
+
+
+
+
+
+extern float ceilf (float __x) throw () __attribute__ ((__const__)); extern float __ceilf (float __x) throw () __attribute__ ((__const__));
+
+
+extern float fabsf (float __x) throw () __attribute__ ((__const__)); extern float __fabsf (float __x) throw () __attribute__ ((__const__));
+
+
+extern float floorf (float __x) throw () __attribute__ ((__const__)); extern float __floorf (float __x) throw () __attribute__ ((__const__));
+
+
+extern float fmodf (float __x, float __y) throw (); extern float __fmodf (float __x, float __y) throw ();
+
+
+
+
+extern int __isinff (float __value) throw () __attribute__ ((__const__));
+
+
+extern int __finitef (float __value) throw () __attribute__ ((__const__));
+
+
+
+
+
+extern int isinff (float __value) throw () __attribute__ ((__const__));
+
+
+extern int finitef (float __value) throw () __attribute__ ((__const__));
+
+
+extern float dremf (float __x, float __y) throw (); extern float __dremf (float __x, float __y) throw ();
+
+
+
+extern float significandf (float __x) throw (); extern float __significandf (float __x) throw ();
+
+
+
+
+
+extern float copysignf (float __x, float __y) throw () __attribute__ ((__const__)); extern float __copysignf (float __x, float __y) throw () __attribute__ ((__const__));
+
+
+
+
+
+
+extern float nanf (const char *__tagb) throw () __attribute__ ((__const__)); extern float __nanf (const char *__tagb) throw () __attribute__ ((__const__));
+
+
+
+
+
+extern int __isnanf (float __value) throw () __attribute__ ((__const__));
+
+
+
+extern int isnanf (float __value) throw () __attribute__ ((__const__));
+
+
+extern float j0f (float) throw (); extern float __j0f (float) throw ();
+extern float j1f (float) throw (); extern float __j1f (float) throw ();
+extern float jnf (int, float) throw (); extern float __jnf (int, float) throw ();
+extern float y0f (float) throw (); extern float __y0f (float) throw ();
+extern float y1f (float) throw (); extern float __y1f (float) throw ();
+extern float ynf (int, float) throw (); extern float __ynf (int, float) throw ();
+
+
+
+
+
+
+extern float erff (float) throw (); extern float __erff (float) throw ();
+extern float erfcf (float) throw (); extern float __erfcf (float) throw ();
+extern float lgammaf (float) throw (); extern float __lgammaf (float) throw ();
+
+
+
+
+
+
+extern float tgammaf (float) throw (); extern float __tgammaf (float) throw ();
+
+
+
+
+
+extern float gammaf (float) throw (); extern float __gammaf (float) throw ();
+
+
+
+
+
+
+extern float lgammaf_r (float, int *__signgamp) throw (); extern float __lgammaf_r (float, int *__signgamp) throw ();
+
+
+
+
+
+
+
+extern float rintf (float __x) throw (); extern float __rintf (float __x) throw ();
+
+
+extern float nextafterf (float __x, float __y) throw () __attribute__ ((__const__)); extern float __nextafterf (float __x, float __y) throw () __attribute__ ((__const__));
+
+extern float nexttowardf (float __x, long double __y) throw () __attribute__ ((__const__)); extern float __nexttowardf (float __x, long double __y) throw () __attribute__ ((__const__));
+
+
+
+extern float remainderf (float __x, float __y) throw (); extern float __remainderf (float __x, float __y) throw ();
+
+
+
+extern float scalbnf (float __x, int __n) throw (); extern float __scalbnf (float __x, int __n) throw ();
+
+
+
+extern int ilogbf (float __x) throw (); extern int __ilogbf (float __x) throw ();
+
+
+
+
+extern float scalblnf (float __x, long int __n) throw (); extern float __scalblnf (float __x, long int __n) throw ();
+
+
+
+extern float nearbyintf (float __x) throw (); extern float __nearbyintf (float __x) throw ();
+
+
+
+extern float roundf (float __x) throw () __attribute__ ((__const__)); extern float __roundf (float __x) throw () __attribute__ ((__const__));
+
+
+
+extern float truncf (float __x) throw () __attribute__ ((__const__)); extern float __truncf (float __x) throw () __attribute__ ((__const__));
+
+
+
+
+extern float remquof (float __x, float __y, int *__quo) throw (); extern float __remquof (float __x, float __y, int *__quo) throw ();
+
+
+
+
+
+
+extern long int lrintf (float __x) throw (); extern long int __lrintf (float __x) throw ();
+extern long long int llrintf (float __x) throw (); extern long long int __llrintf (float __x) throw ();
+
+
+
+extern long int lroundf (float __x) throw (); extern long int __lroundf (float __x) throw ();
+extern long long int llroundf (float __x) throw (); extern long long int __llroundf (float __x) throw ();
+
+
+
+extern float fdimf (float __x, float __y) throw (); extern float __fdimf (float __x, float __y) throw ();
+
+
+extern float fmaxf (float __x, float __y) throw () __attribute__ ((__const__)); extern float __fmaxf (float __x, float __y) throw () __attribute__ ((__const__));
+
+
+extern float fminf (float __x, float __y) throw () __attribute__ ((__const__)); extern float __fminf (float __x, float __y) throw () __attribute__ ((__const__));
+
+
+
+extern int __fpclassifyf (float __value) throw ()
+     __attribute__ ((__const__));
+
+
+extern int __signbitf (float __value) throw ()
+     __attribute__ ((__const__));
+
+
+
+extern float fmaf (float __x, float __y, float __z) throw (); extern float __fmaf (float __x, float __y, float __z) throw ();
+
+
+
+
+
+
+
+
+extern float scalbf (float __x, float __n) throw (); extern float __scalbf (float __x, float __n) throw ();
+
+
+extern long double acosl (long double __x) throw (); extern long double __acosl (long double __x) throw ();
+
+extern long double asinl (long double __x) throw (); extern long double __asinl (long double __x) throw ();
+
+extern long double atanl (long double __x) throw (); extern long double __atanl (long double __x) throw ();
+
+extern long double atan2l (long double __y, long double __x) throw (); extern long double __atan2l (long double __y, long double __x) throw ();
+
+
+extern long double cosl (long double __x) throw (); extern long double __cosl (long double __x) throw ();
+
+extern long double sinl (long double __x) throw (); extern long double __sinl (long double __x) throw ();
+
+extern long double tanl (long double __x) throw (); extern long double __tanl (long double __x) throw ();
+
+
+
+
+extern long double coshl (long double __x) throw (); extern long double __coshl (long double __x) throw ();
+
+extern long double sinhl (long double __x) throw (); extern long double __sinhl (long double __x) throw ();
+
+extern long double tanhl (long double __x) throw (); extern long double __tanhl (long double __x) throw ();
+
+
+
+
+extern void sincosl (long double __x, long double *__sinx, long double *__cosx) throw (); extern void __sincosl (long double __x, long double *__sinx, long double *__cosx) throw ()
+                                                           ;
+
+
+
+
+
+extern long double acoshl (long double __x) throw (); extern long double __acoshl (long double __x) throw ();
+
+extern long double asinhl (long double __x) throw (); extern long double __asinhl (long double __x) throw ();
+
+extern long double atanhl (long double __x) throw (); extern long double __atanhl (long double __x) throw ();
+
+
+
+
+
+
+
+extern long double expl (long double __x) throw (); extern long double __expl (long double __x) throw ();
+
+
+extern long double frexpl (long double __x, int *__exponent) throw (); extern long double __frexpl (long double __x, int *__exponent) throw ();
+
+
+extern long double ldexpl (long double __x, int __exponent) throw (); extern long double __ldexpl (long double __x, int __exponent) throw ();
+
+
+extern long double logl (long double __x) throw (); extern long double __logl (long double __x) throw ();
+
+
+extern long double log10l (long double __x) throw (); extern long double __log10l (long double __x) throw ();
+
+
+extern long double modfl (long double __x, long double *__iptr) throw (); extern long double __modfl (long double __x, long double *__iptr) throw ()
+     __attribute__ ((__nonnull__ (2)));
+
+
+
+
+extern long double exp10l (long double __x) throw (); extern long double __exp10l (long double __x) throw ();
+
+extern long double pow10l (long double __x) throw (); extern long double __pow10l (long double __x) throw ();
+
+
+
+
+
+extern long double expm1l (long double __x) throw (); extern long double __expm1l (long double __x) throw ();
+
+
+extern long double log1pl (long double __x) throw (); extern long double __log1pl (long double __x) throw ();
+
+
+extern long double logbl (long double __x) throw (); extern long double __logbl (long double __x) throw ();
+
+
+
+
+
+
+extern long double exp2l (long double __x) throw (); extern long double __exp2l (long double __x) throw ();
+
+
+extern long double log2l (long double __x) throw (); extern long double __log2l (long double __x) throw ();
+
+
+
+
+
+
+
+
+extern long double powl (long double __x, long double __y) throw (); extern long double __powl (long double __x, long double __y) throw ();
+
+
+extern long double sqrtl (long double __x) throw (); extern long double __sqrtl (long double __x) throw ();
+
+
+
+
+
+extern long double hypotl (long double __x, long double __y) throw (); extern long double __hypotl (long double __x, long double __y) throw ();
+
+
+
+
+
+
+extern long double cbrtl (long double __x) throw (); extern long double __cbrtl (long double __x) throw ();
+
+
+
+
+
+
+
+
+extern long double ceill (long double __x) throw () __attribute__ ((__const__)); extern long double __ceill (long double __x) throw () __attribute__ ((__const__));
+
+
+extern long double fabsl (long double __x) throw () __attribute__ ((__const__)); extern long double __fabsl (long double __x) throw () __attribute__ ((__const__));
+
+
+extern long double floorl (long double __x) throw () __attribute__ ((__const__)); extern long double __floorl (long double __x) throw () __attribute__ ((__const__));
+
+
+extern long double fmodl (long double __x, long double __y) throw (); extern long double __fmodl (long double __x, long double __y) throw ();
+
+
+
+
+extern int __isinfl (long double __value) throw () __attribute__ ((__const__));
+
+
+extern int __finitel (long double __value) throw () __attribute__ ((__const__));
+
+
+
+
+
+extern int isinfl (long double __value) throw () __attribute__ ((__const__));
+
+
+extern int finitel (long double __value) throw () __attribute__ ((__const__));
+
+
+extern long double dreml (long double __x, long double __y) throw (); extern long double __dreml (long double __x, long double __y) throw ();
+
+
+
+extern long double significandl (long double __x) throw (); extern long double __significandl (long double __x) throw ();
+
+
+
+
+
+extern long double copysignl (long double __x, long double __y) throw () __attribute__ ((__const__)); extern long double __copysignl (long double __x, long double __y) throw () __attribute__ ((__const__));
+
+
+
+
+
+
+extern long double nanl (const char *__tagb) throw () __attribute__ ((__const__)); extern long double __nanl (const char *__tagb) throw () __attribute__ ((__const__));
+
+
+
+
+
+extern int __isnanl (long double __value) throw () __attribute__ ((__const__));
+
+
+
+extern int isnanl (long double __value) throw () __attribute__ ((__const__));
+
+
+extern long double j0l (long double) throw (); extern long double __j0l (long double) throw ();
+extern long double j1l (long double) throw (); extern long double __j1l (long double) throw ();
+extern long double jnl (int, long double) throw (); extern long double __jnl (int, long double) throw ();
+extern long double y0l (long double) throw (); extern long double __y0l (long double) throw ();
+extern long double y1l (long double) throw (); extern long double __y1l (long double) throw ();
+extern long double ynl (int, long double) throw (); extern long double __ynl (int, long double) throw ();
+
+
+
+
+
+
+extern long double erfl (long double) throw (); extern long double __erfl (long double) throw ();
+extern long double erfcl (long double) throw (); extern long double __erfcl (long double) throw ();
+extern long double lgammal (long double) throw (); extern long double __lgammal (long double) throw ();
+
+
+
+
+
+
+extern long double tgammal (long double) throw (); extern long double __tgammal (long double) throw ();
+
+
+
+
+
+extern long double gammal (long double) throw (); extern long double __gammal (long double) throw ();
+
+
+
+
+
+
+extern long double lgammal_r (long double, int *__signgamp) throw (); extern long double __lgammal_r (long double, int *__signgamp) throw ();
+
+
+
+
+
+
+
+extern long double rintl (long double __x) throw (); extern long double __rintl (long double __x) throw ();
+
+
+extern long double nextafterl (long double __x, long double __y) throw () __attribute__ ((__const__)); extern long double __nextafterl (long double __x, long double __y) throw () __attribute__ ((__const__));
+
+extern long double nexttowardl (long double __x, long double __y) throw () __attribute__ ((__const__)); extern long double __nexttowardl (long double __x, long double __y) throw () __attribute__ ((__const__));
+
+
+
+extern long double remainderl (long double __x, long double __y) throw (); extern long double __remainderl (long double __x, long double __y) throw ();
+
+
+
+extern long double scalbnl (long double __x, int __n) throw (); extern long double __scalbnl (long double __x, int __n) throw ();
+
+
+
+extern int ilogbl (long double __x) throw (); extern int __ilogbl (long double __x) throw ();
+
+
+
+
+extern long double scalblnl (long double __x, long int __n) throw (); extern long double __scalblnl (long double __x, long int __n) throw ();
+
+
+
+extern long double nearbyintl (long double __x) throw (); extern long double __nearbyintl (long double __x) throw ();
+
+
+
+extern long double roundl (long double __x) throw () __attribute__ ((__const__)); extern long double __roundl (long double __x) throw () __attribute__ ((__const__));
+
+
+
+extern long double truncl (long double __x) throw () __attribute__ ((__const__)); extern long double __truncl (long double __x) throw () __attribute__ ((__const__));
+
+
+
+
+extern long double remquol (long double __x, long double __y, int *__quo) throw (); extern long double __remquol (long double __x, long double __y, int *__quo) throw ();
+
+
+
+
+
+
+extern long int lrintl (long double __x) throw (); extern long int __lrintl (long double __x) throw ();
+extern long long int llrintl (long double __x) throw (); extern long long int __llrintl (long double __x) throw ();
+
+
+
+extern long int lroundl (long double __x) throw (); extern long int __lroundl (long double __x) throw ();
+extern long long int llroundl (long double __x) throw (); extern long long int __llroundl (long double __x) throw ();
+
+
+
+extern long double fdiml (long double __x, long double __y) throw (); extern long double __fdiml (long double __x, long double __y) throw ();
+
+
+extern long double fmaxl (long double __x, long double __y) throw () __attribute__ ((__const__)); extern long double __fmaxl (long double __x, long double __y) throw () __attribute__ ((__const__));
+
+
+extern long double fminl (long double __x, long double __y) throw () __attribute__ ((__const__)); extern long double __fminl (long double __x, long double __y) throw () __attribute__ ((__const__));
+
+
+
+extern int __fpclassifyl (long double __value) throw ()
+     __attribute__ ((__const__));
+
+
+extern int __signbitl (long double __value) throw ()
+     __attribute__ ((__const__));
+
+
+
+extern long double fmal (long double __x, long double __y, long double __z) throw (); extern long double __fmal (long double __x, long double __y, long double __z) throw ();
+
+
+
+
+
+
+
+
+extern long double scalbl (long double __x, long double __n) throw (); extern long double __scalbl (long double __x, long double __n) throw ();
+extern int signgam;
+enum
+  {
+    FP_NAN =
+
+      0,
+    FP_INFINITE =
+
+      1,
+    FP_ZERO =
+
+      2,
+    FP_SUBNORMAL =
+
+      3,
+    FP_NORMAL =
+
+      4
+  };
+typedef enum
+{
+  _IEEE_ = -1,
+  _SVID_,
+  _XOPEN_,
+  _POSIX_,
+  _ISOC_
+} _LIB_VERSION_TYPE;
+
+
+
+
+extern _LIB_VERSION_TYPE _LIB_VERSION;
+struct __exception
+
+
+
+  {
+    int type;
+    char *name;
+    double arg1;
+    double arg2;
+    double retval;
+  };
+
+
+extern int matherr (struct __exception *__exc) throw ();
+extern __inline __attribute__ ((__gnu_inline__)) int
+__attribute__ ((__leaf__)) __signbitf (float __x) throw ()
+{
+
+  return __builtin_signbitf (__x);
+
+
+
+
+}
+extern __inline __attribute__ ((__gnu_inline__)) int
+__attribute__ ((__leaf__)) __signbit (double __x) throw ()
+{
+
+  return __builtin_signbit (__x);
+
+
+
+
+}
+
+extern __inline __attribute__ ((__gnu_inline__)) int
+__attribute__ ((__leaf__)) __signbitl (long double __x) throw ()
+{
+  return __signbit ((double) __x);
+}
+}
+
+       
+
+
+
+
+typedef long unsigned int size_t;
+
+extern "C" {
+
+
+
+
+
+
+
+
+typedef unsigned char __u_char;
+typedef unsigned short int __u_short;
+typedef unsigned int __u_int;
+typedef unsigned long int __u_long;
+
+
+typedef signed char __int8_t;
+typedef unsigned char __uint8_t;
+typedef signed short int __int16_t;
+typedef unsigned short int __uint16_t;
+typedef signed int __int32_t;
+typedef unsigned int __uint32_t;
+
+typedef signed long int __int64_t;
+typedef unsigned long int __uint64_t;
+
+
+
+
+
+
+
+typedef long int __quad_t;
+typedef unsigned long int __u_quad_t;
+
+
+typedef unsigned long int __dev_t;
+typedef unsigned int __uid_t;
+typedef unsigned int __gid_t;
+typedef unsigned long int __ino_t;
+typedef unsigned long int __ino64_t;
+typedef unsigned int __mode_t;
+typedef unsigned long int __nlink_t;
+typedef long int __off_t;
+typedef long int __off64_t;
+typedef int __pid_t;
+typedef struct { int __val[2]; } __fsid_t;
+typedef long int __clock_t;
+typedef unsigned long int __rlim_t;
+typedef unsigned long int __rlim64_t;
+typedef unsigned int __id_t;
+typedef long int __time_t;
+typedef unsigned int __useconds_t;
+typedef long int __suseconds_t;
+
+typedef int __daddr_t;
+typedef int __key_t;
+
+
+typedef int __clockid_t;
+
+
+typedef void * __timer_t;
+
+
+typedef long int __blksize_t;
+
+
+
+
+typedef long int __blkcnt_t;
+typedef long int __blkcnt64_t;
+
+
+typedef unsigned long int __fsblkcnt_t;
+typedef unsigned long int __fsblkcnt64_t;
+
+
+typedef unsigned long int __fsfilcnt_t;
+typedef unsigned long int __fsfilcnt64_t;
+
+
+typedef long int __fsword_t;
+
+typedef long int __ssize_t;
+
+
+typedef long int __syscall_slong_t;
+
+typedef unsigned long int __syscall_ulong_t;
+
+
+
+typedef __off64_t __loff_t;
+typedef __quad_t *__qaddr_t;
+typedef char *__caddr_t;
+
+
+typedef long int __intptr_t;
+
+
+typedef unsigned int __socklen_t;
+
+
+
+
+
+
+static __inline unsigned int
+__bswap_32 (unsigned int __bsx)
+{
+  return __builtin_bswap32 (__bsx);
+}
+static __inline __uint64_t
+__bswap_64 (__uint64_t __bsx)
+{
+  return __builtin_bswap64 (__bsx);
+}
+
+union wait
+  {
+    int w_status;
+    struct
+      {
+
+ unsigned int __w_termsig:7;
+ unsigned int __w_coredump:1;
+ unsigned int __w_retcode:8;
+ unsigned int:16;
+
+
+
+
+
+
+
+      } __wait_terminated;
+    struct
+      {
+
+ unsigned int __w_stopval:8;
+ unsigned int __w_stopsig:8;
+ unsigned int:16;
+
+
+
+
+
+
+      } __wait_stopped;
+  };
+
+
+typedef struct
+  {
+    int quot;
+    int rem;
+  } div_t;
+
+
+
+typedef struct
+  {
+    long int quot;
+    long int rem;
+  } ldiv_t;
+
+
+
+
+
+
+
+__extension__ typedef struct
+  {
+    long long int quot;
+    long long int rem;
+  } lldiv_t;
+
+
+extern size_t __ctype_get_mb_cur_max (void) throw () ;
+
+
+
+
+extern double atof (const char *__nptr)
+     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
+
+extern int atoi (const char *__nptr)
+     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
+
+extern long int atol (const char *__nptr)
+     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
+
+
+
+
+
+__extension__ extern long long int atoll (const char *__nptr)
+     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
+
+
+
+
+
+extern double strtod (const char *__restrict __nptr,
+        char **__restrict __endptr)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+
+
+extern float strtof (const char *__restrict __nptr,
+       char **__restrict __endptr) throw () __attribute__ ((__nonnull__ (1)));
+
+extern long double strtold (const char *__restrict __nptr,
+       char **__restrict __endptr)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+
+
+extern long int strtol (const char *__restrict __nptr,
+   char **__restrict __endptr, int __base)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+extern unsigned long int strtoul (const char *__restrict __nptr,
+      char **__restrict __endptr, int __base)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+
+__extension__
+extern long long int strtoq (const char *__restrict __nptr,
+        char **__restrict __endptr, int __base)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+__extension__
+extern unsigned long long int strtouq (const char *__restrict __nptr,
+           char **__restrict __endptr, int __base)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+
+
+__extension__
+extern long long int strtoll (const char *__restrict __nptr,
+         char **__restrict __endptr, int __base)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+__extension__
+extern unsigned long long int strtoull (const char *__restrict __nptr,
+     char **__restrict __endptr, int __base)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+typedef struct __locale_struct
+{
+
+  struct __locale_data *__locales[13];
+
+
+  const unsigned short int *__ctype_b;
+  const int *__ctype_tolower;
+  const int *__ctype_toupper;
+
+
+  const char *__names[13];
+} *__locale_t;
+
+
+typedef __locale_t locale_t;
+
+
+
+extern long int strtol_l (const char *__restrict __nptr,
+     char **__restrict __endptr, int __base,
+     __locale_t __loc) throw () __attribute__ ((__nonnull__ (1, 4)));
+
+extern unsigned long int strtoul_l (const char *__restrict __nptr,
+        char **__restrict __endptr,
+        int __base, __locale_t __loc)
+     throw () __attribute__ ((__nonnull__ (1, 4)));
+
+__extension__
+extern long long int strtoll_l (const char *__restrict __nptr,
+    char **__restrict __endptr, int __base,
+    __locale_t __loc)
+     throw () __attribute__ ((__nonnull__ (1, 4)));
+
+__extension__
+extern unsigned long long int strtoull_l (const char *__restrict __nptr,
+       char **__restrict __endptr,
+       int __base, __locale_t __loc)
+     throw () __attribute__ ((__nonnull__ (1, 4)));
+
+extern double strtod_l (const char *__restrict __nptr,
+   char **__restrict __endptr, __locale_t __loc)
+     throw () __attribute__ ((__nonnull__ (1, 3)));
+
+extern float strtof_l (const char *__restrict __nptr,
+         char **__restrict __endptr, __locale_t __loc)
+     throw () __attribute__ ((__nonnull__ (1, 3)));
+
+extern long double strtold_l (const char *__restrict __nptr,
+         char **__restrict __endptr,
+         __locale_t __loc)
+     throw () __attribute__ ((__nonnull__ (1, 3)));
+
+
+
+
+
+extern __inline __attribute__ ((__gnu_inline__)) int
+__attribute__ ((__leaf__)) atoi (const char *__nptr) throw ()
+{
+  return (int) strtol (__nptr, (char **) __null, 10);
+}
+extern __inline __attribute__ ((__gnu_inline__)) long int
+__attribute__ ((__leaf__)) atol (const char *__nptr) throw ()
+{
+  return strtol (__nptr, (char **) __null, 10);
+}
+
+
+
+
+__extension__ extern __inline __attribute__ ((__gnu_inline__)) long long int
+__attribute__ ((__leaf__)) atoll (const char *__nptr) throw ()
+{
+  return strtoll (__nptr, (char **) __null, 10);
+}
+
+extern char *l64a (long int __n) throw () ;
+
+
+extern long int a64l (const char *__s)
+     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
+
+
+
+
+extern "C" {
+
+
+
+
+
+typedef __u_char u_char;
+typedef __u_short u_short;
+typedef __u_int u_int;
+typedef __u_long u_long;
+typedef __quad_t quad_t;
+typedef __u_quad_t u_quad_t;
+typedef __fsid_t fsid_t;
+
+
+
+
+typedef __loff_t loff_t;
+
+
+
+typedef __ino_t ino_t;
+
+
+
+
+
+
+typedef __ino64_t ino64_t;
+
+
+
+
+typedef __dev_t dev_t;
+
+
+
+
+typedef __gid_t gid_t;
+
+
+
+
+typedef __mode_t mode_t;
+
+
+
+
+typedef __nlink_t nlink_t;
+
+
+
+
+typedef __uid_t uid_t;
+
+
+
+
+
+typedef __off_t off_t;
+
+
+
+
+
+
+typedef __off64_t off64_t;
+
+
+
+
+typedef __pid_t pid_t;
+
+
+
+
+
+typedef __id_t id_t;
+
+
+
+
+typedef __ssize_t ssize_t;
+
+
+
+
+
+typedef __daddr_t daddr_t;
+typedef __caddr_t caddr_t;
+
+
+
+
+
+typedef __key_t key_t;
+
+
+typedef __clock_t clock_t;
+
+
+
+
+
+typedef __time_t time_t;
+
+
+
+typedef __clockid_t clockid_t;
+typedef __timer_t timer_t;
+
+
+
+typedef __useconds_t useconds_t;
+
+
+
+typedef __suseconds_t suseconds_t;
+
+
+
+
+
+
+
+
+typedef unsigned long int ulong;
+typedef unsigned short int ushort;
+typedef unsigned int uint;
+typedef int int8_t __attribute__ ((__mode__ (__QI__)));
+typedef int int16_t __attribute__ ((__mode__ (__HI__)));
+typedef int int32_t __attribute__ ((__mode__ (__SI__)));
+typedef int int64_t __attribute__ ((__mode__ (__DI__)));
+
+
+typedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__)));
+typedef unsigned int u_int16_t __attribute__ ((__mode__ (__HI__)));
+typedef unsigned int u_int32_t __attribute__ ((__mode__ (__SI__)));
+typedef unsigned int u_int64_t __attribute__ ((__mode__ (__DI__)));
+
+typedef int register_t __attribute__ ((__mode__ (__word__)));
+
+
+typedef int __sig_atomic_t;
+
+
+
+
+typedef struct
+  {
+    unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
+  } __sigset_t;
+
+
+
+typedef __sigset_t sigset_t;
+
+
+
+
+
+struct timespec
+  {
+    __time_t tv_sec;
+    __syscall_slong_t tv_nsec;
+  };
+
+struct timeval
+  {
+    __time_t tv_sec;
+    __suseconds_t tv_usec;
+  };
+typedef long int __fd_mask;
+typedef struct
+  {
+
+
+
+    __fd_mask fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];
+
+
+
+
+
+  } fd_set;
+
+
+
+
+
+
+typedef __fd_mask fd_mask;
+extern "C" {
+extern int select (int __nfds, fd_set *__restrict __readfds,
+     fd_set *__restrict __writefds,
+     fd_set *__restrict __exceptfds,
+     struct timeval *__restrict __timeout);
+extern int pselect (int __nfds, fd_set *__restrict __readfds,
+      fd_set *__restrict __writefds,
+      fd_set *__restrict __exceptfds,
+      const struct timespec *__restrict __timeout,
+      const __sigset_t *__restrict __sigmask);
+}
+
+
+extern "C" {
+
+__extension__
+extern unsigned int gnu_dev_major (unsigned long long int __dev)
+     throw () __attribute__ ((__const__));
+__extension__
+extern unsigned int gnu_dev_minor (unsigned long long int __dev)
+     throw () __attribute__ ((__const__));
+__extension__
+extern unsigned long long int gnu_dev_makedev (unsigned int __major,
+            unsigned int __minor)
+     throw () __attribute__ ((__const__));
+
+
+__extension__ extern __inline __attribute__ ((__gnu_inline__)) __attribute__ ((__const__)) unsigned int
+__attribute__ ((__leaf__)) gnu_dev_major (unsigned long long int __dev) throw ()
+{
+  return ((__dev >> 8) & 0xfff) | ((unsigned int) (__dev >> 32) & ~0xfff);
+}
+
+__extension__ extern __inline __attribute__ ((__gnu_inline__)) __attribute__ ((__const__)) unsigned int
+__attribute__ ((__leaf__)) gnu_dev_minor (unsigned long long int __dev) throw ()
+{
+  return (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff);
+}
+
+__extension__ extern __inline __attribute__ ((__gnu_inline__)) __attribute__ ((__const__)) unsigned long long int
+__attribute__ ((__leaf__)) gnu_dev_makedev (unsigned int __major, unsigned int __minor) throw ()
+{
+  return ((__minor & 0xff) | ((__major & 0xfff) << 8)
+   | (((unsigned long long int) (__minor & ~0xff)) << 12)
+   | (((unsigned long long int) (__major & ~0xfff)) << 32));
+}
+
+}
+
+
+
+
+
+typedef __blksize_t blksize_t;
+
+
+
+
+
+
+typedef __blkcnt_t blkcnt_t;
+
+
+
+typedef __fsblkcnt_t fsblkcnt_t;
+
+
+
+typedef __fsfilcnt_t fsfilcnt_t;
+typedef __blkcnt64_t blkcnt64_t;
+typedef __fsblkcnt64_t fsblkcnt64_t;
+typedef __fsfilcnt64_t fsfilcnt64_t;
+
+
+
+
+
+typedef unsigned long int pthread_t;
+
+
+union pthread_attr_t
+{
+  char __size[56];
+  long int __align;
+};
+
+typedef union pthread_attr_t pthread_attr_t;
+
+
+
+
+
+typedef struct __pthread_internal_list
+{
+  struct __pthread_internal_list *__prev;
+  struct __pthread_internal_list *__next;
+} __pthread_list_t;
+typedef union
+{
+  struct __pthread_mutex_s
+  {
+    int __lock;
+    unsigned int __count;
+    int __owner;
+
+    unsigned int __nusers;
+
+
+
+    int __kind;
+
+    short __spins;
+    short __elision;
+    __pthread_list_t __list;
+  } __data;
+  char __size[40];
+  long int __align;
+} pthread_mutex_t;
+
+typedef union
+{
+  char __size[4];
+  int __align;
+} pthread_mutexattr_t;
+
+
+
+
+typedef union
+{
+  struct
+  {
+    int __lock;
+    unsigned int __futex;
+    __extension__ unsigned long long int __total_seq;
+    __extension__ unsigned long long int __wakeup_seq;
+    __extension__ unsigned long long int __woken_seq;
+    void *__mutex;
+    unsigned int __nwaiters;
+    unsigned int __broadcast_seq;
+  } __data;
+  char __size[48];
+  __extension__ long long int __align;
+} pthread_cond_t;
+
+typedef union
+{
+  char __size[4];
+  int __align;
+} pthread_condattr_t;
+
+
+
+typedef unsigned int pthread_key_t;
+
+
+
+typedef int pthread_once_t;
+
+
+
+
+
+typedef union
+{
+
+  struct
+  {
+    int __lock;
+    unsigned int __nr_readers;
+    unsigned int __readers_wakeup;
+    unsigned int __writer_wakeup;
+    unsigned int __nr_readers_queued;
+    unsigned int __nr_writers_queued;
+    int __writer;
+    int __shared;
+    unsigned long int __pad1;
+    unsigned long int __pad2;
+
+
+    unsigned int __flags;
+  } __data;
+  char __size[56];
+  long int __align;
+} pthread_rwlock_t;
+
+typedef union
+{
+  char __size[8];
+  long int __align;
+} pthread_rwlockattr_t;
+
+
+
+
+
+typedef volatile int pthread_spinlock_t;
+
+
+
+
+typedef union
+{
+  char __size[32];
+  long int __align;
+} pthread_barrier_t;
+
+typedef union
+{
+  char __size[4];
+  int __align;
+} pthread_barrierattr_t;
+
+
+}
+
+
+
+
+
+
+extern long int random (void) throw ();
+
+
+extern void srandom (unsigned int __seed) throw ();
+
+
+
+
+
+extern char *initstate (unsigned int __seed, char *__statebuf,
+   size_t __statelen) throw () __attribute__ ((__nonnull__ (2)));
+
+
+
+extern char *setstate (char *__statebuf) throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+
+
+
+
+struct random_data
+  {
+    int32_t *fptr;
+    int32_t *rptr;
+    int32_t *state;
+    int rand_type;
+    int rand_deg;
+    int rand_sep;
+    int32_t *end_ptr;
+  };
+
+extern int random_r (struct random_data *__restrict __buf,
+       int32_t *__restrict __result) throw () __attribute__ ((__nonnull__ (1, 2)));
+
+extern int srandom_r (unsigned int __seed, struct random_data *__buf)
+     throw () __attribute__ ((__nonnull__ (2)));
+
+extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
+   size_t __statelen,
+   struct random_data *__restrict __buf)
+     throw () __attribute__ ((__nonnull__ (2, 4)));
+
+extern int setstate_r (char *__restrict __statebuf,
+         struct random_data *__restrict __buf)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+
+
+
+
+extern int rand (void) throw ();
+
+extern void srand (unsigned int __seed) throw ();
+
+
+
+
+extern int rand_r (unsigned int *__seed) throw ();
+
+
+
+
+
+
+
+extern double drand48 (void) throw ();
+extern double erand48 (unsigned short int __xsubi[3]) throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern long int lrand48 (void) throw ();
+extern long int nrand48 (unsigned short int __xsubi[3])
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern long int mrand48 (void) throw ();
+extern long int jrand48 (unsigned short int __xsubi[3])
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern void srand48 (long int __seedval) throw ();
+extern unsigned short int *seed48 (unsigned short int __seed16v[3])
+     throw () __attribute__ ((__nonnull__ (1)));
+extern void lcong48 (unsigned short int __param[7]) throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+
+
+struct drand48_data
+  {
+    unsigned short int __x[3];
+    unsigned short int __old_x[3];
+    unsigned short int __c;
+    unsigned short int __init;
+    unsigned long long int __a;
+  };
+
+
+extern int drand48_r (struct drand48_data *__restrict __buffer,
+        double *__restrict __result) throw () __attribute__ ((__nonnull__ (1, 2)));
+extern int erand48_r (unsigned short int __xsubi[3],
+        struct drand48_data *__restrict __buffer,
+        double *__restrict __result) throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern int lrand48_r (struct drand48_data *__restrict __buffer,
+        long int *__restrict __result)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+extern int nrand48_r (unsigned short int __xsubi[3],
+        struct drand48_data *__restrict __buffer,
+        long int *__restrict __result)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern int mrand48_r (struct drand48_data *__restrict __buffer,
+        long int *__restrict __result)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+extern int jrand48_r (unsigned short int __xsubi[3],
+        struct drand48_data *__restrict __buffer,
+        long int *__restrict __result)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
+     throw () __attribute__ ((__nonnull__ (2)));
+
+extern int seed48_r (unsigned short int __seed16v[3],
+       struct drand48_data *__buffer) throw () __attribute__ ((__nonnull__ (1, 2)));
+
+extern int lcong48_r (unsigned short int __param[7],
+        struct drand48_data *__buffer)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+
+
+
+
+
+
+
+extern void *malloc (size_t __size) throw () __attribute__ ((__malloc__)) ;
+
+extern void *calloc (size_t __nmemb, size_t __size)
+     throw () __attribute__ ((__malloc__)) ;
+
+
+
+
+
+
+
+
+
+
+extern void *realloc (void *__ptr, size_t __size)
+     throw () __attribute__ ((__warn_unused_result__));
+
+extern void free (void *__ptr) throw ();
+
+
+
+
+extern void cfree (void *__ptr) throw ();
+
+
+
+
+extern "C" {
+
+
+
+
+
+extern void *alloca (size_t __size) throw ();
+
+
+
+
+
+}
+
+
+
+
+
+extern void *valloc (size_t __size) throw () __attribute__ ((__malloc__)) ;
+
+
+
+
+extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
+     throw () __attribute__ ((__nonnull__ (1))) ;
+
+
+
+
+extern void *aligned_alloc (size_t __alignment, size_t __size)
+     throw () __attribute__ ((__malloc__, __alloc_size__ (2)));
+
+
+
+
+extern void abort (void) throw () __attribute__ ((__noreturn__));
+
+
+
+extern int atexit (void (*__func) (void)) throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+
+extern "C++" int at_quick_exit (void (*__func) (void))
+     throw () __asm ("at_quick_exit") __attribute__ ((__nonnull__ (1)));
+
+
+
+
+
+
+
+
+
+extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+
+
+
+extern void exit (int __status) throw () __attribute__ ((__noreturn__));
+
+
+
+
+
+extern void quick_exit (int __status) throw () __attribute__ ((__noreturn__));
+
+
+
+
+
+
+
+extern void _Exit (int __status) throw () __attribute__ ((__noreturn__));
+
+
+
+
+
+
+extern char *getenv (const char *__name) throw () __attribute__ ((__nonnull__ (1))) ;
+
+
+
+
+
+extern char *secure_getenv (const char *__name)
+     throw () __attribute__ ((__nonnull__ (1))) ;
+
+
+
+
+
+
+extern int putenv (char *__string) throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+
+
+extern int setenv (const char *__name, const char *__value, int __replace)
+     throw () __attribute__ ((__nonnull__ (2)));
+
+
+extern int unsetenv (const char *__name) throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+
+
+
+extern int clearenv (void) throw ();
+extern char *mktemp (char *__template) throw () __attribute__ ((__nonnull__ (1)));
+extern int mkstemp (char *__template) __attribute__ ((__nonnull__ (1))) ;
+extern int mkstemp64 (char *__template) __attribute__ ((__nonnull__ (1))) ;
+extern int mkstemps (char *__template, int __suffixlen) __attribute__ ((__nonnull__ (1))) ;
+extern int mkstemps64 (char *__template, int __suffixlen)
+     __attribute__ ((__nonnull__ (1))) ;
+extern char *mkdtemp (char *__template) throw () __attribute__ ((__nonnull__ (1))) ;
+extern int mkostemp (char *__template, int __flags) __attribute__ ((__nonnull__ (1))) ;
+extern int mkostemp64 (char *__template, int __flags) __attribute__ ((__nonnull__ (1))) ;
+extern int mkostemps (char *__template, int __suffixlen, int __flags)
+     __attribute__ ((__nonnull__ (1))) ;
+extern int mkostemps64 (char *__template, int __suffixlen, int __flags)
+     __attribute__ ((__nonnull__ (1))) ;
+
+
+
+
+
+
+
+
+
+extern int system (const char *__command) ;
+
+
+
+
+
+
+extern char *canonicalize_file_name (const char *__name)
+     throw () __attribute__ ((__nonnull__ (1))) ;
+extern char *realpath (const char *__restrict __name,
+         char *__restrict __resolved) throw () ;
+
+
+
+
+
+
+typedef int (*__compar_fn_t) (const void *, const void *);
+
+
+typedef __compar_fn_t comparison_fn_t;
+
+
+
+typedef int (*__compar_d_fn_t) (const void *, const void *, void *);
+
+
+
+
+
+extern void *bsearch (const void *__key, const void *__base,
+        size_t __nmemb, size_t __size, __compar_fn_t __compar)
+     __attribute__ ((__nonnull__ (1, 2, 5))) ;
+
+
+
+extern void qsort (void *__base, size_t __nmemb, size_t __size,
+     __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));
+
+extern void qsort_r (void *__base, size_t __nmemb, size_t __size,
+       __compar_d_fn_t __compar, void *__arg)
+  __attribute__ ((__nonnull__ (1, 4)));
+
+
+
+
+extern int abs (int __x) throw () __attribute__ ((__const__)) ;
+extern long int labs (long int __x) throw () __attribute__ ((__const__)) ;
+
+
+
+__extension__ extern long long int llabs (long long int __x)
+     throw () __attribute__ ((__const__)) ;
+
+
+
+
+
+
+
+extern div_t div (int __numer, int __denom)
+     throw () __attribute__ ((__const__)) ;
+extern ldiv_t ldiv (long int __numer, long int __denom)
+     throw () __attribute__ ((__const__)) ;
+
+
+
+
+__extension__ extern lldiv_t lldiv (long long int __numer,
+        long long int __denom)
+     throw () __attribute__ ((__const__)) ;
+
+extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
+     int *__restrict __sign) throw () __attribute__ ((__nonnull__ (3, 4))) ;
+
+
+
+
+extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
+     int *__restrict __sign) throw () __attribute__ ((__nonnull__ (3, 4))) ;
+
+
+
+
+extern char *gcvt (double __value, int __ndigit, char *__buf)
+     throw () __attribute__ ((__nonnull__ (3))) ;
+
+
+
+
+extern char *qecvt (long double __value, int __ndigit,
+      int *__restrict __decpt, int *__restrict __sign)
+     throw () __attribute__ ((__nonnull__ (3, 4))) ;
+extern char *qfcvt (long double __value, int __ndigit,
+      int *__restrict __decpt, int *__restrict __sign)
+     throw () __attribute__ ((__nonnull__ (3, 4))) ;
+extern char *qgcvt (long double __value, int __ndigit, char *__buf)
+     throw () __attribute__ ((__nonnull__ (3))) ;
+
+
+
+
+extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
+     int *__restrict __sign, char *__restrict __buf,
+     size_t __len) throw () __attribute__ ((__nonnull__ (3, 4, 5)));
+extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
+     int *__restrict __sign, char *__restrict __buf,
+     size_t __len) throw () __attribute__ ((__nonnull__ (3, 4, 5)));
+
+extern int qecvt_r (long double __value, int __ndigit,
+      int *__restrict __decpt, int *__restrict __sign,
+      char *__restrict __buf, size_t __len)
+     throw () __attribute__ ((__nonnull__ (3, 4, 5)));
+extern int qfcvt_r (long double __value, int __ndigit,
+      int *__restrict __decpt, int *__restrict __sign,
+      char *__restrict __buf, size_t __len)
+     throw () __attribute__ ((__nonnull__ (3, 4, 5)));
+
+
+
+
+
+
+
+extern int mblen (const char *__s, size_t __n) throw () ;
+
+
+extern int mbtowc (wchar_t *__restrict __pwc,
+     const char *__restrict __s, size_t __n) throw () ;
+
+
+extern int wctomb (char *__s, wchar_t __wchar) throw () ;
+
+
+
+extern size_t mbstowcs (wchar_t *__restrict __pwcs,
+   const char *__restrict __s, size_t __n) throw ();
+
+extern size_t wcstombs (char *__restrict __s,
+   const wchar_t *__restrict __pwcs, size_t __n)
+     throw ();
+
+
+
+
+
+
+
+
+extern int rpmatch (const char *__response) throw () __attribute__ ((__nonnull__ (1))) ;
+extern int getsubopt (char **__restrict __optionp,
+        char *const *__restrict __tokens,
+        char **__restrict __valuep)
+     throw () __attribute__ ((__nonnull__ (1, 2, 3))) ;
+
+
+
+
+
+extern void setkey (const char *__key) throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+
+
+
+
+extern int posix_openpt (int __oflag) ;
+
+
+
+
+
+
+
+extern int grantpt (int __fd) throw ();
+
+
+
+extern int unlockpt (int __fd) throw ();
+
+
+
+
+extern char *ptsname (int __fd) throw () ;
+
+
+
+
+
+
+extern int ptsname_r (int __fd, char *__buf, size_t __buflen)
+     throw () __attribute__ ((__nonnull__ (2)));
+
+
+extern int getpt (void);
+
+
+
+
+
+
+extern int getloadavg (double __loadavg[], int __nelem)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+extern __inline __attribute__ ((__gnu_inline__)) double
+__attribute__ ((__leaf__)) atof (const char *__nptr) throw ()
+{
+  return strtod (__nptr, (char **) __null);
+}
+
+}
+
+
+
+
+
+
+
+extern "C++"
+{
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+  using ::abs;
+
+
+  inline long
+  abs(long __i) { return __builtin_labs(__i); }
+
+
+
+  inline long long
+  abs(long long __x) { return __builtin_llabs (__x); }
+
+
+
+
+
+
+
+  inline constexpr double
+  abs(double __x)
+  { return __builtin_fabs(__x); }
+
+  inline constexpr float
+  abs(float __x)
+  { return __builtin_fabsf(__x); }
+
+  inline constexpr long double
+  abs(long double __x)
+  { return __builtin_fabsl(__x); }
+
+}
+}
+extern "C++"
+{
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+  using ::acos;
+
+
+  inline constexpr float
+  acos(float __x)
+  { return __builtin_acosf(__x); }
+
+  inline constexpr long double
+  acos(long double __x)
+  { return __builtin_acosl(__x); }
+
+
+  template<typename _Tp>
+    inline constexpr
+    typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                    double>::__type
+    acos(_Tp __x)
+    { return __builtin_acos(__x); }
+
+  using ::asin;
+
+
+  inline constexpr float
+  asin(float __x)
+  { return __builtin_asinf(__x); }
+
+  inline constexpr long double
+  asin(long double __x)
+  { return __builtin_asinl(__x); }
+
+
+  template<typename _Tp>
+    inline constexpr
+    typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                    double>::__type
+    asin(_Tp __x)
+    { return __builtin_asin(__x); }
+
+  using ::atan;
+
+
+  inline constexpr float
+  atan(float __x)
+  { return __builtin_atanf(__x); }
+
+  inline constexpr long double
+  atan(long double __x)
+  { return __builtin_atanl(__x); }
+
+
+  template<typename _Tp>
+    inline constexpr
+    typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                    double>::__type
+    atan(_Tp __x)
+    { return __builtin_atan(__x); }
+
+  using ::atan2;
+
+
+  inline constexpr float
+  atan2(float __y, float __x)
+  { return __builtin_atan2f(__y, __x); }
+
+  inline constexpr long double
+  atan2(long double __y, long double __x)
+  { return __builtin_atan2l(__y, __x); }
+
+
+  template<typename _Tp, typename _Up>
+    inline constexpr
+    typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
+    atan2(_Tp __y, _Up __x)
+    {
+      typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+      return atan2(__type(__y), __type(__x));
+    }
+
+  using ::ceil;
+
+
+  inline constexpr float
+  ceil(float __x)
+  { return __builtin_ceilf(__x); }
+
+  inline constexpr long double
+  ceil(long double __x)
+  { return __builtin_ceill(__x); }
+
+
+  template<typename _Tp>
+    inline constexpr
+    typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                    double>::__type
+    ceil(_Tp __x)
+    { return __builtin_ceil(__x); }
+
+  using ::cos;
+
+
+  inline constexpr float
+  cos(float __x)
+  { return __builtin_cosf(__x); }
+
+  inline constexpr long double
+  cos(long double __x)
+  { return __builtin_cosl(__x); }
+
+
+  template<typename _Tp>
+    inline constexpr
+    typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                    double>::__type
+    cos(_Tp __x)
+    { return __builtin_cos(__x); }
+
+  using ::cosh;
+
+
+  inline constexpr float
+  cosh(float __x)
+  { return __builtin_coshf(__x); }
+
+  inline constexpr long double
+  cosh(long double __x)
+  { return __builtin_coshl(__x); }
+
+
+  template<typename _Tp>
+    inline constexpr
+    typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                    double>::__type
+    cosh(_Tp __x)
+    { return __builtin_cosh(__x); }
+
+  using ::exp;
+
+
+  inline constexpr float
+  exp(float __x)
+  { return __builtin_expf(__x); }
+
+  inline constexpr long double
+  exp(long double __x)
+  { return __builtin_expl(__x); }
+
+
+  template<typename _Tp>
+    inline constexpr
+    typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                    double>::__type
+    exp(_Tp __x)
+    { return __builtin_exp(__x); }
+
+  using ::fabs;
+
+
+  inline constexpr float
+  fabs(float __x)
+  { return __builtin_fabsf(__x); }
+
+  inline constexpr long double
+  fabs(long double __x)
+  { return __builtin_fabsl(__x); }
+
+
+  template<typename _Tp>
+    inline constexpr
+    typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                    double>::__type
+    fabs(_Tp __x)
+    { return __builtin_fabs(__x); }
+
+  using ::floor;
+
+
+  inline constexpr float
+  floor(float __x)
+  { return __builtin_floorf(__x); }
+
+  inline constexpr long double
+  floor(long double __x)
+  { return __builtin_floorl(__x); }
+
+
+  template<typename _Tp>
+    inline constexpr
+    typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                    double>::__type
+    floor(_Tp __x)
+    { return __builtin_floor(__x); }
+
+  using ::fmod;
+
+
+  inline constexpr float
+  fmod(float __x, float __y)
+  { return __builtin_fmodf(__x, __y); }
+
+  inline constexpr long double
+  fmod(long double __x, long double __y)
+  { return __builtin_fmodl(__x, __y); }
+
+
+  template<typename _Tp, typename _Up>
+    inline constexpr
+    typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
+    fmod(_Tp __x, _Up __y)
+    {
+      typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+      return fmod(__type(__x), __type(__y));
+    }
+
+  using ::frexp;
+
+
+  inline float
+  frexp(float __x, int* __exp)
+  { return __builtin_frexpf(__x, __exp); }
+
+  inline long double
+  frexp(long double __x, int* __exp)
+  { return __builtin_frexpl(__x, __exp); }
+
+
+  template<typename _Tp>
+    inline constexpr
+    typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                    double>::__type
+    frexp(_Tp __x, int* __exp)
+    { return __builtin_frexp(__x, __exp); }
+
+  using ::ldexp;
+
+
+  inline constexpr float
+  ldexp(float __x, int __exp)
+  { return __builtin_ldexpf(__x, __exp); }
+
+  inline constexpr long double
+  ldexp(long double __x, int __exp)
+  { return __builtin_ldexpl(__x, __exp); }
+
+
+  template<typename _Tp>
+    inline constexpr
+    typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                    double>::__type
+    ldexp(_Tp __x, int __exp)
+    { return __builtin_ldexp(__x, __exp); }
+
+  using ::log;
+
+
+  inline constexpr float
+  log(float __x)
+  { return __builtin_logf(__x); }
+
+  inline constexpr long double
+  log(long double __x)
+  { return __builtin_logl(__x); }
+
+
+  template<typename _Tp>
+    inline constexpr
+    typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                    double>::__type
+    log(_Tp __x)
+    { return __builtin_log(__x); }
+
+  using ::log10;
+
+
+  inline constexpr float
+  log10(float __x)
+  { return __builtin_log10f(__x); }
+
+  inline constexpr long double
+  log10(long double __x)
+  { return __builtin_log10l(__x); }
+
+
+  template<typename _Tp>
+    inline constexpr
+    typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                    double>::__type
+    log10(_Tp __x)
+    { return __builtin_log10(__x); }
+
+  using ::modf;
+
+
+  inline float
+  modf(float __x, float* __iptr)
+  { return __builtin_modff(__x, __iptr); }
+
+  inline long double
+  modf(long double __x, long double* __iptr)
+  { return __builtin_modfl(__x, __iptr); }
+
+
+  using ::pow;
+
+
+  inline constexpr float
+  pow(float __x, float __y)
+  { return __builtin_powf(__x, __y); }
+
+  inline constexpr long double
+  pow(long double __x, long double __y)
+  { return __builtin_powl(__x, __y); }
+  template<typename _Tp, typename _Up>
+    inline constexpr
+    typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
+    pow(_Tp __x, _Up __y)
+    {
+      typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+      return pow(__type(__x), __type(__y));
+    }
+
+  using ::sin;
+
+
+  inline constexpr float
+  sin(float __x)
+  { return __builtin_sinf(__x); }
+
+  inline constexpr long double
+  sin(long double __x)
+  { return __builtin_sinl(__x); }
+
+
+  template<typename _Tp>
+    inline constexpr
+    typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                    double>::__type
+    sin(_Tp __x)
+    { return __builtin_sin(__x); }
+
+  using ::sinh;
+
+
+  inline constexpr float
+  sinh(float __x)
+  { return __builtin_sinhf(__x); }
+
+  inline constexpr long double
+  sinh(long double __x)
+  { return __builtin_sinhl(__x); }
+
+
+  template<typename _Tp>
+    inline constexpr
+    typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                    double>::__type
+    sinh(_Tp __x)
+    { return __builtin_sinh(__x); }
+
+  using ::sqrt;
+
+
+  inline constexpr float
+  sqrt(float __x)
+  { return __builtin_sqrtf(__x); }
+
+  inline constexpr long double
+  sqrt(long double __x)
+  { return __builtin_sqrtl(__x); }
+
+
+  template<typename _Tp>
+    inline constexpr
+    typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                    double>::__type
+    sqrt(_Tp __x)
+    { return __builtin_sqrt(__x); }
+
+  using ::tan;
+
+
+  inline constexpr float
+  tan(float __x)
+  { return __builtin_tanf(__x); }
+
+  inline constexpr long double
+  tan(long double __x)
+  { return __builtin_tanl(__x); }
+
+
+  template<typename _Tp>
+    inline constexpr
+    typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                    double>::__type
+    tan(_Tp __x)
+    { return __builtin_tan(__x); }
+
+  using ::tanh;
+
+
+  inline constexpr float
+  tanh(float __x)
+  { return __builtin_tanhf(__x); }
+
+  inline constexpr long double
+  tanh(long double __x)
+  { return __builtin_tanhl(__x); }
+
+
+  template<typename _Tp>
+    inline constexpr
+    typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                    double>::__type
+    tanh(_Tp __x)
+    { return __builtin_tanh(__x); }
+  constexpr int
+  fpclassify(float __x)
+  { return __builtin_fpclassify(0, 1, 4,
+    3, 2, __x); }
+
+  constexpr int
+  fpclassify(double __x)
+  { return __builtin_fpclassify(0, 1, 4,
+    3, 2, __x); }
+
+  constexpr int
+  fpclassify(long double __x)
+  { return __builtin_fpclassify(0, 1, 4,
+    3, 2, __x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              int>::__type
+    fpclassify(_Tp __x)
+    { return __x != 0 ? 4 : 2; }
+
+
+
+  constexpr bool
+  isfinite(float __x)
+  { return __builtin_isfinite(__x); }
+
+  constexpr bool
+  isfinite(double __x)
+  { return __builtin_isfinite(__x); }
+
+  constexpr bool
+  isfinite(long double __x)
+  { return __builtin_isfinite(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              bool>::__type
+    isfinite(_Tp __x)
+    { return true; }
+
+
+
+  constexpr bool
+  isinf(float __x)
+  { return __builtin_isinf(__x); }
+
+
+
+  using ::isinf;
+
+
+
+
+
+
+  constexpr bool
+  isinf(long double __x)
+  { return __builtin_isinf(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              bool>::__type
+    isinf(_Tp __x)
+    { return false; }
+
+
+
+  constexpr bool
+  isnan(float __x)
+  { return __builtin_isnan(__x); }
+
+
+
+  using ::isnan;
+
+
+
+
+
+
+  constexpr bool
+  isnan(long double __x)
+  { return __builtin_isnan(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              bool>::__type
+    isnan(_Tp __x)
+    { return false; }
+
+
+
+  constexpr bool
+  isnormal(float __x)
+  { return __builtin_isnormal(__x); }
+
+  constexpr bool
+  isnormal(double __x)
+  { return __builtin_isnormal(__x); }
+
+  constexpr bool
+  isnormal(long double __x)
+  { return __builtin_isnormal(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              bool>::__type
+    isnormal(_Tp __x)
+    { return __x != 0 ? true : false; }
+
+
+
+
+  constexpr bool
+  signbit(float __x)
+  { return __builtin_signbit(__x); }
+
+  constexpr bool
+  signbit(double __x)
+  { return __builtin_signbit(__x); }
+
+  constexpr bool
+  signbit(long double __x)
+  { return __builtin_signbit(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              bool>::__type
+    signbit(_Tp __x)
+    { return __x < 0 ? true : false; }
+
+
+
+  constexpr bool
+  isgreater(float __x, float __y)
+  { return __builtin_isgreater(__x, __y); }
+
+  constexpr bool
+  isgreater(double __x, double __y)
+  { return __builtin_isgreater(__x, __y); }
+
+  constexpr bool
+  isgreater(long double __x, long double __y)
+  { return __builtin_isgreater(__x, __y); }
+
+
+
+  template<typename _Tp, typename _Up>
+    constexpr typename
+    __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value
+       && __is_arithmetic<_Up>::__value), bool>::__type
+    isgreater(_Tp __x, _Up __y)
+    {
+      typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+      return __builtin_isgreater(__type(__x), __type(__y));
+    }
+
+
+
+  constexpr bool
+  isgreaterequal(float __x, float __y)
+  { return __builtin_isgreaterequal(__x, __y); }
+
+  constexpr bool
+  isgreaterequal(double __x, double __y)
+  { return __builtin_isgreaterequal(__x, __y); }
+
+  constexpr bool
+  isgreaterequal(long double __x, long double __y)
+  { return __builtin_isgreaterequal(__x, __y); }
+
+
+
+  template<typename _Tp, typename _Up>
+    constexpr typename
+    __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value
+       && __is_arithmetic<_Up>::__value), bool>::__type
+    isgreaterequal(_Tp __x, _Up __y)
+    {
+      typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+      return __builtin_isgreaterequal(__type(__x), __type(__y));
+    }
+
+
+
+  constexpr bool
+  isless(float __x, float __y)
+  { return __builtin_isless(__x, __y); }
+
+  constexpr bool
+  isless(double __x, double __y)
+  { return __builtin_isless(__x, __y); }
+
+  constexpr bool
+  isless(long double __x, long double __y)
+  { return __builtin_isless(__x, __y); }
+
+
+
+  template<typename _Tp, typename _Up>
+    constexpr typename
+    __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value
+       && __is_arithmetic<_Up>::__value), bool>::__type
+    isless(_Tp __x, _Up __y)
+    {
+      typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+      return __builtin_isless(__type(__x), __type(__y));
+    }
+
+
+
+  constexpr bool
+  islessequal(float __x, float __y)
+  { return __builtin_islessequal(__x, __y); }
+
+  constexpr bool
+  islessequal(double __x, double __y)
+  { return __builtin_islessequal(__x, __y); }
+
+  constexpr bool
+  islessequal(long double __x, long double __y)
+  { return __builtin_islessequal(__x, __y); }
+
+
+
+  template<typename _Tp, typename _Up>
+    constexpr typename
+    __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value
+       && __is_arithmetic<_Up>::__value), bool>::__type
+    islessequal(_Tp __x, _Up __y)
+    {
+      typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+      return __builtin_islessequal(__type(__x), __type(__y));
+    }
+
+
+
+  constexpr bool
+  islessgreater(float __x, float __y)
+  { return __builtin_islessgreater(__x, __y); }
+
+  constexpr bool
+  islessgreater(double __x, double __y)
+  { return __builtin_islessgreater(__x, __y); }
+
+  constexpr bool
+  islessgreater(long double __x, long double __y)
+  { return __builtin_islessgreater(__x, __y); }
+
+
+
+  template<typename _Tp, typename _Up>
+    constexpr typename
+    __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value
+       && __is_arithmetic<_Up>::__value), bool>::__type
+    islessgreater(_Tp __x, _Up __y)
+    {
+      typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+      return __builtin_islessgreater(__type(__x), __type(__y));
+    }
+
+
+
+  constexpr bool
+  isunordered(float __x, float __y)
+  { return __builtin_isunordered(__x, __y); }
+
+  constexpr bool
+  isunordered(double __x, double __y)
+  { return __builtin_isunordered(__x, __y); }
+
+  constexpr bool
+  isunordered(long double __x, long double __y)
+  { return __builtin_isunordered(__x, __y); }
+
+
+
+  template<typename _Tp, typename _Up>
+    constexpr typename
+    __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value
+       && __is_arithmetic<_Up>::__value), bool>::__type
+    isunordered(_Tp __x, _Up __y)
+    {
+      typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+      return __builtin_isunordered(__type(__x), __type(__y));
+    }
+  using ::double_t;
+  using ::float_t;
+
+
+  using ::acosh;
+  using ::acoshf;
+  using ::acoshl;
+
+  using ::asinh;
+  using ::asinhf;
+  using ::asinhl;
+
+  using ::atanh;
+  using ::atanhf;
+  using ::atanhl;
+
+  using ::cbrt;
+  using ::cbrtf;
+  using ::cbrtl;
+
+  using ::copysign;
+  using ::copysignf;
+  using ::copysignl;
+
+  using ::erf;
+  using ::erff;
+  using ::erfl;
+
+  using ::erfc;
+  using ::erfcf;
+  using ::erfcl;
+
+  using ::exp2;
+  using ::exp2f;
+  using ::exp2l;
+
+  using ::expm1;
+  using ::expm1f;
+  using ::expm1l;
+
+  using ::fdim;
+  using ::fdimf;
+  using ::fdiml;
+
+  using ::fma;
+  using ::fmaf;
+  using ::fmal;
+
+  using ::fmax;
+  using ::fmaxf;
+  using ::fmaxl;
+
+  using ::fmin;
+  using ::fminf;
+  using ::fminl;
+
+  using ::hypot;
+  using ::hypotf;
+  using ::hypotl;
+
+  using ::ilogb;
+  using ::ilogbf;
+  using ::ilogbl;
+
+  using ::lgamma;
+  using ::lgammaf;
+  using ::lgammal;
+
+
+  using ::llrint;
+  using ::llrintf;
+  using ::llrintl;
+
+  using ::llround;
+  using ::llroundf;
+  using ::llroundl;
+
+
+  using ::log1p;
+  using ::log1pf;
+  using ::log1pl;
+
+  using ::log2;
+  using ::log2f;
+  using ::log2l;
+
+  using ::logb;
+  using ::logbf;
+  using ::logbl;
+
+  using ::lrint;
+  using ::lrintf;
+  using ::lrintl;
+
+  using ::lround;
+  using ::lroundf;
+  using ::lroundl;
+
+  using ::nan;
+  using ::nanf;
+  using ::nanl;
+
+  using ::nearbyint;
+  using ::nearbyintf;
+  using ::nearbyintl;
+
+  using ::nextafter;
+  using ::nextafterf;
+  using ::nextafterl;
+
+  using ::nexttoward;
+  using ::nexttowardf;
+  using ::nexttowardl;
+
+  using ::remainder;
+  using ::remainderf;
+  using ::remainderl;
+
+  using ::remquo;
+  using ::remquof;
+  using ::remquol;
+
+  using ::rint;
+  using ::rintf;
+  using ::rintl;
+
+  using ::round;
+  using ::roundf;
+  using ::roundl;
+
+  using ::scalbln;
+  using ::scalblnf;
+  using ::scalblnl;
+
+  using ::scalbn;
+  using ::scalbnf;
+  using ::scalbnl;
+
+  using ::tgamma;
+  using ::tgammaf;
+  using ::tgammal;
+
+  using ::trunc;
+  using ::truncf;
+  using ::truncl;
+
+
+
+  constexpr float
+  acosh(float __x)
+  { return __builtin_acoshf(__x); }
+
+  constexpr long double
+  acosh(long double __x)
+  { return __builtin_acoshl(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              double>::__type
+    acosh(_Tp __x)
+    { return __builtin_acosh(__x); }
+
+
+
+  constexpr float
+  asinh(float __x)
+  { return __builtin_asinhf(__x); }
+
+  constexpr long double
+  asinh(long double __x)
+  { return __builtin_asinhl(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              double>::__type
+    asinh(_Tp __x)
+    { return __builtin_asinh(__x); }
+
+
+
+  constexpr float
+  atanh(float __x)
+  { return __builtin_atanhf(__x); }
+
+  constexpr long double
+  atanh(long double __x)
+  { return __builtin_atanhl(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              double>::__type
+    atanh(_Tp __x)
+    { return __builtin_atanh(__x); }
+
+
+
+  constexpr float
+  cbrt(float __x)
+  { return __builtin_cbrtf(__x); }
+
+  constexpr long double
+  cbrt(long double __x)
+  { return __builtin_cbrtl(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              double>::__type
+    cbrt(_Tp __x)
+    { return __builtin_cbrt(__x); }
+
+
+
+  constexpr float
+  copysign(float __x, float __y)
+  { return __builtin_copysignf(__x, __y); }
+
+  constexpr long double
+  copysign(long double __x, long double __y)
+  { return __builtin_copysignl(__x, __y); }
+
+
+
+  template<typename _Tp, typename _Up>
+    constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
+    copysign(_Tp __x, _Up __y)
+    {
+      typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+      return copysign(__type(__x), __type(__y));
+    }
+
+
+
+  constexpr float
+  erf(float __x)
+  { return __builtin_erff(__x); }
+
+  constexpr long double
+  erf(long double __x)
+  { return __builtin_erfl(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              double>::__type
+    erf(_Tp __x)
+    { return __builtin_erf(__x); }
+
+
+
+  constexpr float
+  erfc(float __x)
+  { return __builtin_erfcf(__x); }
+
+  constexpr long double
+  erfc(long double __x)
+  { return __builtin_erfcl(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              double>::__type
+    erfc(_Tp __x)
+    { return __builtin_erfc(__x); }
+
+
+
+  constexpr float
+  exp2(float __x)
+  { return __builtin_exp2f(__x); }
+
+  constexpr long double
+  exp2(long double __x)
+  { return __builtin_exp2l(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              double>::__type
+    exp2(_Tp __x)
+    { return __builtin_exp2(__x); }
+
+
+
+  constexpr float
+  expm1(float __x)
+  { return __builtin_expm1f(__x); }
+
+  constexpr long double
+  expm1(long double __x)
+  { return __builtin_expm1l(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              double>::__type
+    expm1(_Tp __x)
+    { return __builtin_expm1(__x); }
+
+
+
+  constexpr float
+  fdim(float __x, float __y)
+  { return __builtin_fdimf(__x, __y); }
+
+  constexpr long double
+  fdim(long double __x, long double __y)
+  { return __builtin_fdiml(__x, __y); }
+
+
+
+  template<typename _Tp, typename _Up>
+    constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
+    fdim(_Tp __x, _Up __y)
+    {
+      typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+      return fdim(__type(__x), __type(__y));
+    }
+
+
+
+  constexpr float
+  fma(float __x, float __y, float __z)
+  { return __builtin_fmaf(__x, __y, __z); }
+
+  constexpr long double
+  fma(long double __x, long double __y, long double __z)
+  { return __builtin_fmal(__x, __y, __z); }
+
+
+
+  template<typename _Tp, typename _Up, typename _Vp>
+    constexpr typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type
+    fma(_Tp __x, _Up __y, _Vp __z)
+    {
+      typedef typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type __type;
+      return fma(__type(__x), __type(__y), __type(__z));
+    }
+
+
+
+  constexpr float
+  fmax(float __x, float __y)
+  { return __builtin_fmaxf(__x, __y); }
+
+  constexpr long double
+  fmax(long double __x, long double __y)
+  { return __builtin_fmaxl(__x, __y); }
+
+
+
+  template<typename _Tp, typename _Up>
+    constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
+    fmax(_Tp __x, _Up __y)
+    {
+      typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+      return fmax(__type(__x), __type(__y));
+    }
+
+
+
+  constexpr float
+  fmin(float __x, float __y)
+  { return __builtin_fminf(__x, __y); }
+
+  constexpr long double
+  fmin(long double __x, long double __y)
+  { return __builtin_fminl(__x, __y); }
+
+
+
+  template<typename _Tp, typename _Up>
+    constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
+    fmin(_Tp __x, _Up __y)
+    {
+      typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+      return fmin(__type(__x), __type(__y));
+    }
+
+
+
+  constexpr float
+  hypot(float __x, float __y)
+  { return __builtin_hypotf(__x, __y); }
+
+  constexpr long double
+  hypot(long double __x, long double __y)
+  { return __builtin_hypotl(__x, __y); }
+
+
+
+  template<typename _Tp, typename _Up>
+    constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
+    hypot(_Tp __x, _Up __y)
+    {
+      typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+      return hypot(__type(__x), __type(__y));
+    }
+
+
+
+  constexpr int
+  ilogb(float __x)
+  { return __builtin_ilogbf(__x); }
+
+  constexpr int
+  ilogb(long double __x)
+  { return __builtin_ilogbl(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr
+    typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                    int>::__type
+    ilogb(_Tp __x)
+    { return __builtin_ilogb(__x); }
+
+
+
+  constexpr float
+  lgamma(float __x)
+  { return __builtin_lgammaf(__x); }
+
+  constexpr long double
+  lgamma(long double __x)
+  { return __builtin_lgammal(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              double>::__type
+    lgamma(_Tp __x)
+    { return __builtin_lgamma(__x); }
+
+
+
+  constexpr long long
+  llrint(float __x)
+  { return __builtin_llrintf(__x); }
+
+  constexpr long long
+  llrint(long double __x)
+  { return __builtin_llrintl(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              long long>::__type
+    llrint(_Tp __x)
+    { return __builtin_llrint(__x); }
+
+
+
+  constexpr long long
+  llround(float __x)
+  { return __builtin_llroundf(__x); }
+
+  constexpr long long
+  llround(long double __x)
+  { return __builtin_llroundl(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              long long>::__type
+    llround(_Tp __x)
+    { return __builtin_llround(__x); }
+
+
+
+  constexpr float
+  log1p(float __x)
+  { return __builtin_log1pf(__x); }
+
+  constexpr long double
+  log1p(long double __x)
+  { return __builtin_log1pl(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              double>::__type
+    log1p(_Tp __x)
+    { return __builtin_log1p(__x); }
+
+
+
+
+  constexpr float
+  log2(float __x)
+  { return __builtin_log2f(__x); }
+
+  constexpr long double
+  log2(long double __x)
+  { return __builtin_log2l(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              double>::__type
+    log2(_Tp __x)
+    { return __builtin_log2(__x); }
+
+
+
+  constexpr float
+  logb(float __x)
+  { return __builtin_logbf(__x); }
+
+  constexpr long double
+  logb(long double __x)
+  { return __builtin_logbl(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              double>::__type
+    logb(_Tp __x)
+    { return __builtin_logb(__x); }
+
+
+
+  constexpr long
+  lrint(float __x)
+  { return __builtin_lrintf(__x); }
+
+  constexpr long
+  lrint(long double __x)
+  { return __builtin_lrintl(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              long>::__type
+    lrint(_Tp __x)
+    { return __builtin_lrint(__x); }
+
+
+
+  constexpr long
+  lround(float __x)
+  { return __builtin_lroundf(__x); }
+
+  constexpr long
+  lround(long double __x)
+  { return __builtin_lroundl(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              long>::__type
+    lround(_Tp __x)
+    { return __builtin_lround(__x); }
+
+
+
+  constexpr float
+  nearbyint(float __x)
+  { return __builtin_nearbyintf(__x); }
+
+  constexpr long double
+  nearbyint(long double __x)
+  { return __builtin_nearbyintl(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              double>::__type
+    nearbyint(_Tp __x)
+    { return __builtin_nearbyint(__x); }
+
+
+
+  constexpr float
+  nextafter(float __x, float __y)
+  { return __builtin_nextafterf(__x, __y); }
+
+  constexpr long double
+  nextafter(long double __x, long double __y)
+  { return __builtin_nextafterl(__x, __y); }
+
+
+
+  template<typename _Tp, typename _Up>
+    constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
+    nextafter(_Tp __x, _Up __y)
+    {
+      typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+      return nextafter(__type(__x), __type(__y));
+    }
+
+
+
+  constexpr float
+  nexttoward(float __x, long double __y)
+  { return __builtin_nexttowardf(__x, __y); }
+
+  constexpr long double
+  nexttoward(long double __x, long double __y)
+  { return __builtin_nexttowardl(__x, __y); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              double>::__type
+    nexttoward(_Tp __x, long double __y)
+    { return __builtin_nexttoward(__x, __y); }
+
+
+
+  constexpr float
+  remainder(float __x, float __y)
+  { return __builtin_remainderf(__x, __y); }
+
+  constexpr long double
+  remainder(long double __x, long double __y)
+  { return __builtin_remainderl(__x, __y); }
+
+
+
+  template<typename _Tp, typename _Up>
+    constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
+    remainder(_Tp __x, _Up __y)
+    {
+      typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+      return remainder(__type(__x), __type(__y));
+    }
+
+
+
+  inline float
+  remquo(float __x, float __y, int* __pquo)
+  { return __builtin_remquof(__x, __y, __pquo); }
+
+  inline long double
+  remquo(long double __x, long double __y, int* __pquo)
+  { return __builtin_remquol(__x, __y, __pquo); }
+
+
+
+  template<typename _Tp, typename _Up>
+    inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
+    remquo(_Tp __x, _Up __y, int* __pquo)
+    {
+      typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+      return remquo(__type(__x), __type(__y), __pquo);
+    }
+
+
+
+  constexpr float
+  rint(float __x)
+  { return __builtin_rintf(__x); }
+
+  constexpr long double
+  rint(long double __x)
+  { return __builtin_rintl(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              double>::__type
+    rint(_Tp __x)
+    { return __builtin_rint(__x); }
+
+
+
+  constexpr float
+  round(float __x)
+  { return __builtin_roundf(__x); }
+
+  constexpr long double
+  round(long double __x)
+  { return __builtin_roundl(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              double>::__type
+    round(_Tp __x)
+    { return __builtin_round(__x); }
+
+
+
+  constexpr float
+  scalbln(float __x, long __ex)
+  { return __builtin_scalblnf(__x, __ex); }
+
+  constexpr long double
+  scalbln(long double __x, long __ex)
+  { return __builtin_scalblnl(__x, __ex); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              double>::__type
+    scalbln(_Tp __x, long __ex)
+    { return __builtin_scalbln(__x, __ex); }
+
+
+
+  constexpr float
+  scalbn(float __x, int __ex)
+  { return __builtin_scalbnf(__x, __ex); }
+
+  constexpr long double
+  scalbn(long double __x, int __ex)
+  { return __builtin_scalbnl(__x, __ex); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              double>::__type
+    scalbn(_Tp __x, int __ex)
+    { return __builtin_scalbn(__x, __ex); }
+
+
+
+  constexpr float
+  tgamma(float __x)
+  { return __builtin_tgammaf(__x); }
+
+  constexpr long double
+  tgamma(long double __x)
+  { return __builtin_tgammal(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              double>::__type
+    tgamma(_Tp __x)
+    { return __builtin_tgamma(__x); }
+
+
+
+  constexpr float
+  trunc(float __x)
+  { return __builtin_truncf(__x); }
+
+  constexpr long double
+  trunc(long double __x)
+  { return __builtin_truncl(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              double>::__type
+    trunc(_Tp __x)
+    { return __builtin_trunc(__x); }
+
+}
+
+
+
+
+
+}
+
+
+
+
+
+       
+
+
+
+
+
+       
+typedef unsigned char uint8_t;
+typedef unsigned short int uint16_t;
+
+typedef unsigned int uint32_t;
+
+
+
+typedef unsigned long int uint64_t;
+typedef signed char int_least8_t;
+typedef short int int_least16_t;
+typedef int int_least32_t;
+
+typedef long int int_least64_t;
+
+
+
+
+
+
+typedef unsigned char uint_least8_t;
+typedef unsigned short int uint_least16_t;
+typedef unsigned int uint_least32_t;
+
+typedef unsigned long int uint_least64_t;
+typedef signed char int_fast8_t;
+
+typedef long int int_fast16_t;
+typedef long int int_fast32_t;
+typedef long int int_fast64_t;
+typedef unsigned char uint_fast8_t;
+
+typedef unsigned long int uint_fast16_t;
+typedef unsigned long int uint_fast32_t;
+typedef unsigned long int uint_fast64_t;
+typedef long int intptr_t;
+
+
+typedef unsigned long int uintptr_t;
+typedef long int intmax_t;
+typedef unsigned long int uintmax_t;
+
+
+
+
+namespace std
+{
+  using ::int8_t;
+  using ::int16_t;
+  using ::int32_t;
+  using ::int64_t;
+
+  using ::int_fast8_t;
+  using ::int_fast16_t;
+  using ::int_fast32_t;
+  using ::int_fast64_t;
+
+  using ::int_least8_t;
+  using ::int_least16_t;
+  using ::int_least32_t;
+  using ::int_least64_t;
+
+  using ::intmax_t;
+  using ::intptr_t;
+
+  using ::uint8_t;
+  using ::uint16_t;
+  using ::uint32_t;
+  using ::uint64_t;
+
+  using ::uint_fast8_t;
+  using ::uint_fast16_t;
+  using ::uint_fast32_t;
+  using ::uint_fast64_t;
+
+  using ::uint_least8_t;
+  using ::uint_least16_t;
+  using ::uint_least32_t;
+  using ::uint_least64_t;
+
+  using ::uintmax_t;
+  using ::uintptr_t;
+}
+
+
+
+
+
+
+
+extern "C" {
+
+
+
+
+typedef struct
+  {
+    long int quot;
+    long int rem;
+  } imaxdiv_t;
+extern intmax_t imaxabs (intmax_t __n) throw () __attribute__ ((__const__));
+
+
+extern imaxdiv_t imaxdiv (intmax_t __numer, intmax_t __denom)
+      throw () __attribute__ ((__const__));
+
+
+extern intmax_t strtoimax (const char *__restrict __nptr,
+      char **__restrict __endptr, int __base) throw ();
+
+
+extern uintmax_t strtoumax (const char *__restrict __nptr,
+       char ** __restrict __endptr, int __base) throw ();
+
+
+extern intmax_t wcstoimax (const wchar_t *__restrict __nptr,
+      wchar_t **__restrict __endptr, int __base)
+     throw ();
+
+
+extern uintmax_t wcstoumax (const wchar_t *__restrict __nptr,
+       wchar_t ** __restrict __endptr, int __base)
+     throw ();
+
+
+
+
+
+extern long int __strtol_internal (const char *__restrict __nptr,
+       char **__restrict __endptr,
+       int __base, int __group)
+  throw () __attribute__ ((__nonnull__ (1))) ;
+
+extern __inline __attribute__ ((__gnu_inline__)) intmax_t
+__attribute__ ((__leaf__)) strtoimax (const char *__restrict nptr, char **__restrict endptr, int base) throw ()
+
+{
+  return __strtol_internal (nptr, endptr, base, 0);
+}
+
+extern unsigned long int __strtoul_internal (const char *__restrict __nptr,
+          char ** __restrict __endptr,
+          int __base, int __group)
+  throw () __attribute__ ((__nonnull__ (1))) ;
+
+extern __inline __attribute__ ((__gnu_inline__)) uintmax_t
+__attribute__ ((__leaf__)) strtoumax (const char *__restrict nptr, char **__restrict endptr, int base) throw ()
+
+{
+  return __strtoul_internal (nptr, endptr, base, 0);
+}
+
+extern long int __wcstol_internal (const wchar_t * __restrict __nptr,
+       wchar_t **__restrict __endptr,
+       int __base, int __group)
+  throw () __attribute__ ((__nonnull__ (1))) ;
+
+extern __inline __attribute__ ((__gnu_inline__)) intmax_t
+__attribute__ ((__leaf__)) wcstoimax (const wchar_t *__restrict nptr, wchar_t **__restrict endptr, int base) throw ()
+
+{
+  return __wcstol_internal (nptr, endptr, base, 0);
+}
+
+extern unsigned long int __wcstoul_internal (const wchar_t *
+          __restrict __nptr,
+          wchar_t **
+          __restrict __endptr,
+          int __base, int __group)
+  throw () __attribute__ ((__nonnull__ (1))) ;
+
+extern __inline __attribute__ ((__gnu_inline__)) uintmax_t
+__attribute__ ((__leaf__)) wcstoumax (const wchar_t *__restrict nptr, wchar_t **__restrict endptr, int base) throw ()
+
+{
+  return __wcstoul_internal (nptr, endptr, base, 0);
+}
+}
+namespace std
+{
+
+  using ::imaxdiv_t;
+
+
+  using ::imaxabs;
+  using ::imaxdiv;
+
+
+
+
+
+  using ::strtoimax;
+  using ::strtoumax;
+
+
+  using ::wcstoimax;
+  using ::wcstoumax;
+
+}
+       
+
+
+
+
+
+
+
+typedef long int ptrdiff_t;
+typedef struct {
+  long long __max_align_ll __attribute__((__aligned__(__alignof__(long long))));
+  long double __max_align_ld __attribute__((__aligned__(__alignof__(long double))));
+} max_align_t;
+
+
+
+
+
+
+  typedef decltype(nullptr) nullptr_t;
+
+
+namespace std
+{
+
+  using ::max_align_t;
+}
+
+
+
+
+
+namespace llvm {
+namespace sys {
+
+
+
+inline uint16_t SwapByteOrder_16(uint16_t value) {
+
+
+
+
+
+  uint16_t Hi = value << 8;
+  uint16_t Lo = value >> 8;
+  return Hi | Lo;
+
+}
+
+
+
+inline uint32_t SwapByteOrder_32(uint32_t value) {
+
+  return __builtin_bswap32(value);
+}
+
+
+
+inline uint64_t SwapByteOrder_64(uint64_t value) {
+
+  return __builtin_bswap64(value);
+
+
+
+
+
+
+
+}
+
+inline unsigned char getSwappedBytes(unsigned char C) { return C; }
+inline signed char getSwappedBytes(signed char C) { return C; }
+inline char getSwappedBytes(char C) { return C; }
+
+inline unsigned short getSwappedBytes(unsigned short C) { return SwapByteOrder_16(C); }
+inline signed short getSwappedBytes( signed short C) { return SwapByteOrder_16(C); }
+
+inline unsigned int getSwappedBytes(unsigned int C) { return SwapByteOrder_32(C); }
+inline signed int getSwappedBytes( signed int C) { return SwapByteOrder_32(C); }
+
+
+
+
+
+inline unsigned long getSwappedBytes(unsigned long C) { return SwapByteOrder_64(C); }
+inline signed long getSwappedBytes( signed long C) { return SwapByteOrder_64(C); }
+
+
+
+
+inline unsigned long long getSwappedBytes(unsigned long long C) {
+  return SwapByteOrder_64(C);
+}
+inline signed long long getSwappedBytes(signed long long C) {
+  return SwapByteOrder_64(C);
+}
+
+inline float getSwappedBytes(float C) {
+  union {
+    uint32_t i;
+    float f;
+  } in, out;
+  in.f = C;
+  out.i = SwapByteOrder_32(in.i);
+  return out.f;
+}
+
+inline double getSwappedBytes(double C) {
+  union {
+    uint64_t i;
+    double d;
+  } in, out;
+  in.d = C;
+  out.i = SwapByteOrder_64(in.i);
+  return out.d;
+}
+
+template<typename T>
+inline void swapByteOrder(T &Value) {
+  Value = getSwappedBytes(Value);
+}
+
+}
+}
+       
+
+       
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+  namespace rel_ops
+  {
+    template <class _Tp>
+      inline bool
+      operator!=(const _Tp& __x, const _Tp& __y)
+      { return !(__x == __y); }
+    template <class _Tp>
+      inline bool
+      operator>(const _Tp& __x, const _Tp& __y)
+      { return __y < __x; }
+    template <class _Tp>
+      inline bool
+      operator<=(const _Tp& __x, const _Tp& __y)
+      { return !(__y < __x); }
+    template <class _Tp>
+      inline bool
+      operator>=(const _Tp& __x, const _Tp& __y)
+      { return !(__x < __y); }
+  }
+
+
+}
+       
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+
+
+
+
+  template<typename _Tp>
+    inline constexpr _Tp*
+    __addressof(_Tp& __r) noexcept
+    { return __builtin_addressof(__r); }
+
+
+
+
+}
+
+       
+namespace std
+{
+  typedef short unsigned int uint_least16_t;
+  typedef unsigned int uint_least32_t;
+}
+
+
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+  template<typename _Tp, _Tp __v>
+    struct integral_constant
+    {
+      static constexpr _Tp value = __v;
+      typedef _Tp value_type;
+      typedef integral_constant<_Tp, __v> type;
+      constexpr operator value_type() const noexcept { return value; }
+
+
+
+
+
+
+    };
+
+  template<typename _Tp, _Tp __v>
+    constexpr _Tp integral_constant<_Tp, __v>::value;
+
+
+  typedef integral_constant<bool, true> true_type;
+
+
+  typedef integral_constant<bool, false> false_type;
+
+  template<bool __v>
+    using __bool_constant = integral_constant<bool, __v>;
+  template<bool, typename, typename>
+    struct conditional;
+
+  template<typename...>
+    struct __or_;
+
+  template<>
+    struct __or_<>
+    : public false_type
+    { };
+
+  template<typename _B1>
+    struct __or_<_B1>
+    : public _B1
+    { };
+
+  template<typename _B1, typename _B2>
+    struct __or_<_B1, _B2>
+    : public conditional<_B1::value, _B1, _B2>::type
+    { };
+
+  template<typename _B1, typename _B2, typename _B3, typename... _Bn>
+    struct __or_<_B1, _B2, _B3, _Bn...>
+    : public conditional<_B1::value, _B1, __or_<_B2, _B3, _Bn...>>::type
+    { };
+
+  template<typename...>
+    struct __and_;
+
+  template<>
+    struct __and_<>
+    : public true_type
+    { };
+
+  template<typename _B1>
+    struct __and_<_B1>
+    : public _B1
+    { };
+
+  template<typename _B1, typename _B2>
+    struct __and_<_B1, _B2>
+    : public conditional<_B1::value, _B2, _B1>::type
+    { };
+
+  template<typename _B1, typename _B2, typename _B3, typename... _Bn>
+    struct __and_<_B1, _B2, _B3, _Bn...>
+    : public conditional<_B1::value, __and_<_B2, _B3, _Bn...>, _B1>::type
+    { };
+
+  template<typename _Pp>
+    struct __not_
+    : public __bool_constant<!bool(_Pp::value)>
+    { };
+  template<typename _Tp>
+    struct __success_type
+    { typedef _Tp type; };
+
+  struct __failure_type
+  { };
+
+
+
+  template<typename>
+    struct remove_cv;
+
+  template<typename>
+    struct __is_void_helper
+    : public false_type { };
+
+  template<>
+    struct __is_void_helper<void>
+    : public true_type { };
+
+
+  template<typename _Tp>
+    struct is_void
+    : public __is_void_helper<typename remove_cv<_Tp>::type>::type
+    { };
+
+  template<typename>
+    struct __is_integral_helper
+    : public false_type { };
+
+  template<>
+    struct __is_integral_helper<bool>
+    : public true_type { };
+
+  template<>
+    struct __is_integral_helper<char>
+    : public true_type { };
+
+  template<>
+    struct __is_integral_helper<signed char>
+    : public true_type { };
+
+  template<>
+    struct __is_integral_helper<unsigned char>
+    : public true_type { };
+
+
+  template<>
+    struct __is_integral_helper<wchar_t>
+    : public true_type { };
+
+
+  template<>
+    struct __is_integral_helper<char16_t>
+    : public true_type { };
+
+  template<>
+    struct __is_integral_helper<char32_t>
+    : public true_type { };
+
+  template<>
+    struct __is_integral_helper<short>
+    : public true_type { };
+
+  template<>
+    struct __is_integral_helper<unsigned short>
+    : public true_type { };
+
+  template<>
+    struct __is_integral_helper<int>
+    : public true_type { };
+
+  template<>
+    struct __is_integral_helper<unsigned int>
+    : public true_type { };
+
+  template<>
+    struct __is_integral_helper<long>
+    : public true_type { };
+
+  template<>
+    struct __is_integral_helper<unsigned long>
+    : public true_type { };
+
+  template<>
+    struct __is_integral_helper<long long>
+    : public true_type { };
+
+  template<>
+    struct __is_integral_helper<unsigned long long>
+    : public true_type { };
+  template<typename _Tp>
+    struct is_integral
+    : public __is_integral_helper<typename remove_cv<_Tp>::type>::type
+    { };
+
+  template<typename>
+    struct __is_floating_point_helper
+    : public false_type { };
+
+  template<>
+    struct __is_floating_point_helper<float>
+    : public true_type { };
+
+  template<>
+    struct __is_floating_point_helper<double>
+    : public true_type { };
+
+  template<>
+    struct __is_floating_point_helper<long double>
+    : public true_type { };
+  template<typename _Tp>
+    struct is_floating_point
+    : public __is_floating_point_helper<typename remove_cv<_Tp>::type>::type
+    { };
+
+
+  template<typename>
+    struct is_array
+    : public false_type { };
+
+  template<typename _Tp, std::size_t _Size>
+    struct is_array<_Tp[_Size]>
+    : public true_type { };
+
+  template<typename _Tp>
+    struct is_array<_Tp[]>
+    : public true_type { };
+
+  template<typename>
+    struct __is_pointer_helper
+    : public false_type { };
+
+  template<typename _Tp>
+    struct __is_pointer_helper<_Tp*>
+    : public true_type { };
+
+
+  template<typename _Tp>
+    struct is_pointer
+    : public __is_pointer_helper<typename remove_cv<_Tp>::type>::type
+    { };
+
+
+  template<typename>
+    struct is_lvalue_reference
+    : public false_type { };
+
+  template<typename _Tp>
+    struct is_lvalue_reference<_Tp&>
+    : public true_type { };
+
+
+  template<typename>
+    struct is_rvalue_reference
+    : public false_type { };
+
+  template<typename _Tp>
+    struct is_rvalue_reference<_Tp&&>
+    : public true_type { };
+
+  template<typename>
+    struct is_function;
+
+  template<typename>
+    struct __is_member_object_pointer_helper
+    : public false_type { };
+
+  template<typename _Tp, typename _Cp>
+    struct __is_member_object_pointer_helper<_Tp _Cp::*>
+    : public integral_constant<bool, !is_function<_Tp>::value> { };
+
+
+  template<typename _Tp>
+    struct is_member_object_pointer
+    : public __is_member_object_pointer_helper<
+    typename remove_cv<_Tp>::type>::type
+    { };
+
+  template<typename>
+    struct __is_member_function_pointer_helper
+    : public false_type { };
+
+  template<typename _Tp, typename _Cp>
+    struct __is_member_function_pointer_helper<_Tp _Cp::*>
+    : public integral_constant<bool, is_function<_Tp>::value> { };
+
+
+  template<typename _Tp>
+    struct is_member_function_pointer
+    : public __is_member_function_pointer_helper<
+    typename remove_cv<_Tp>::type>::type
+    { };
+
+
+  template<typename _Tp>
+    struct is_enum
+    : public integral_constant<bool, __is_enum(_Tp)>
+    { };
+
+
+  template<typename _Tp>
+    struct is_union
+    : public integral_constant<bool, __is_union(_Tp)>
+    { };
+
+
+  template<typename _Tp>
+    struct is_class
+    : public integral_constant<bool, __is_class(_Tp)>
+    { };
+
+
+  template<typename>
+    struct is_function
+    : public false_type { };
+
+  template<typename _Res, typename... _ArgTypes >
+    struct is_function<_Res(_ArgTypes...) >
+    : public true_type { };
+
+  template<typename _Res, typename... _ArgTypes >
+    struct is_function<_Res(_ArgTypes...) & >
+    : public true_type { };
+
+  template<typename _Res, typename... _ArgTypes >
+    struct is_function<_Res(_ArgTypes...) && >
+    : public true_type { };
+
+  template<typename _Res, typename... _ArgTypes >
+    struct is_function<_Res(_ArgTypes......) >
+    : public true_type { };
+
+  template<typename _Res, typename... _ArgTypes >
+    struct is_function<_Res(_ArgTypes......) & >
+    : public true_type { };
+
+  template<typename _Res, typename... _ArgTypes >
+    struct is_function<_Res(_ArgTypes......) && >
+    : public true_type { };
+
+  template<typename _Res, typename... _ArgTypes >
+    struct is_function<_Res(_ArgTypes...) const >
+    : public true_type { };
+
+  template<typename _Res, typename... _ArgTypes >
+    struct is_function<_Res(_ArgTypes...) const & >
+    : public true_type { };
+
+  template<typename _Res, typename... _ArgTypes >
+    struct is_function<_Res(_ArgTypes...) const && >
+    : public true_type { };
+
+  template<typename _Res, typename... _ArgTypes >
+    struct is_function<_Res(_ArgTypes......) const >
+    : public true_type { };
+
+  template<typename _Res, typename... _ArgTypes >
+    struct is_function<_Res(_ArgTypes......) const & >
+    : public true_type { };
+
+  template<typename _Res, typename... _ArgTypes >
+    struct is_function<_Res(_ArgTypes......) const && >
+    : public true_type { };
+
+  template<typename _Res, typename... _ArgTypes >
+    struct is_function<_Res(_ArgTypes...) volatile >
+    : public true_type { };
+
+  template<typename _Res, typename... _ArgTypes >
+    struct is_function<_Res(_ArgTypes...) volatile & >
+    : public true_type { };
+
+  template<typename _Res, typename... _ArgTypes >
+    struct is_function<_Res(_ArgTypes...) volatile && >
+    : public true_type { };
+
+  template<typename _Res, typename... _ArgTypes >
+    struct is_function<_Res(_ArgTypes......) volatile >
+    : public true_type { };
+
+  template<typename _Res, typename... _ArgTypes >
+    struct is_function<_Res(_ArgTypes......) volatile & >
+    : public true_type { };
+
+  template<typename _Res, typename... _ArgTypes >
+    struct is_function<_Res(_ArgTypes......) volatile && >
+    : public true_type { };
+
+  template<typename _Res, typename... _ArgTypes >
+    struct is_function<_Res(_ArgTypes...) const volatile >
+    : public true_type { };
+
+  template<typename _Res, typename... _ArgTypes >
+    struct is_function<_Res(_ArgTypes...) const volatile & >
+    : public true_type { };
+
+  template<typename _Res, typename... _ArgTypes >
+    struct is_function<_Res(_ArgTypes...) const volatile && >
+    : public true_type { };
+
+  template<typename _Res, typename... _ArgTypes >
+    struct is_function<_Res(_ArgTypes......) const volatile >
+    : public true_type { };
+
+  template<typename _Res, typename... _ArgTypes >
+    struct is_function<_Res(_ArgTypes......) const volatile & >
+    : public true_type { };
+
+  template<typename _Res, typename... _ArgTypes >
+    struct is_function<_Res(_ArgTypes......) const volatile && >
+    : public true_type { };
+
+
+
+  template<typename>
+    struct __is_null_pointer_helper
+    : public false_type { };
+
+  template<>
+    struct __is_null_pointer_helper<std::nullptr_t>
+    : public true_type { };
+
+
+  template<typename _Tp>
+    struct is_null_pointer
+    : public __is_null_pointer_helper<typename remove_cv<_Tp>::type>::type
+    { };
+
+
+  template<typename _Tp>
+    struct __is_nullptr_t
+    : public is_null_pointer<_Tp>
+    { };
+
+
+
+
+  template<typename _Tp>
+    struct is_reference
+    : public __or_<is_lvalue_reference<_Tp>,
+                   is_rvalue_reference<_Tp>>::type
+    { };
+
+
+  template<typename _Tp>
+    struct is_arithmetic
+    : public __or_<is_integral<_Tp>, is_floating_point<_Tp>>::type
+    { };
+
+
+  template<typename _Tp>
+    struct is_fundamental
+    : public __or_<is_arithmetic<_Tp>, is_void<_Tp>,
+     is_null_pointer<_Tp>>::type
+    { };
+
+
+  template<typename _Tp>
+    struct is_object
+    : public __not_<__or_<is_function<_Tp>, is_reference<_Tp>,
+                          is_void<_Tp>>>::type
+    { };
+
+  template<typename>
+    struct is_member_pointer;
+
+
+  template<typename _Tp>
+    struct is_scalar
+    : public __or_<is_arithmetic<_Tp>, is_enum<_Tp>, is_pointer<_Tp>,
+                   is_member_pointer<_Tp>, is_null_pointer<_Tp>>::type
+    { };
+
+
+  template<typename _Tp>
+    struct is_compound
+    : public integral_constant<bool, !is_fundamental<_Tp>::value> { };
+
+  template<typename _Tp>
+    struct __is_member_pointer_helper
+    : public false_type { };
+
+  template<typename _Tp, typename _Cp>
+    struct __is_member_pointer_helper<_Tp _Cp::*>
+    : public true_type { };
+
+
+  template<typename _Tp>
+    struct is_member_pointer
+    : public __is_member_pointer_helper<typename remove_cv<_Tp>::type>::type
+    { };
+
+
+
+  template<typename _Tp>
+    struct __is_referenceable
+    : public __or_<is_object<_Tp>, is_reference<_Tp>>::type
+    { };
+
+  template<typename _Res, typename... _Args >
+    struct __is_referenceable<_Res(_Args...) >
+    : public true_type
+    { };
+
+  template<typename _Res, typename... _Args >
+    struct __is_referenceable<_Res(_Args......) >
+    : public true_type
+    { };
+
+
+
+
+  template<typename>
+    struct is_const
+    : public false_type { };
+
+  template<typename _Tp>
+    struct is_const<_Tp const>
+    : public true_type { };
+
+
+  template<typename>
+    struct is_volatile
+    : public false_type { };
+
+  template<typename _Tp>
+    struct is_volatile<_Tp volatile>
+    : public true_type { };
+
+
+  template<typename _Tp>
+    struct is_trivial
+    : public integral_constant<bool, __is_trivial(_Tp)>
+    { };
+
+
+  template<typename _Tp>
+    struct is_trivially_copyable
+    : public integral_constant<bool, __is_trivially_copyable(_Tp)>
+    { };
+
+
+  template<typename _Tp>
+    struct is_standard_layout
+    : public integral_constant<bool, __is_standard_layout(_Tp)>
+    { };
+
+
+
+  template<typename _Tp>
+    struct is_pod
+    : public integral_constant<bool, __is_pod(_Tp)>
+    { };
+
+
+  template<typename _Tp>
+    struct is_literal_type
+    : public integral_constant<bool, __is_literal_type(_Tp)>
+    { };
+
+
+  template<typename _Tp>
+    struct is_empty
+    : public integral_constant<bool, __is_empty(_Tp)>
+    { };
+
+
+  template<typename _Tp>
+    struct is_polymorphic
+    : public integral_constant<bool, __is_polymorphic(_Tp)>
+    { };
+  template<typename _Tp>
+    struct is_abstract
+    : public integral_constant<bool, __is_abstract(_Tp)>
+    { };
+
+  template<typename _Tp,
+    bool = is_arithmetic<_Tp>::value>
+    struct __is_signed_helper
+    : public false_type { };
+
+  template<typename _Tp>
+    struct __is_signed_helper<_Tp, true>
+    : public integral_constant<bool, _Tp(-1) < _Tp(0)>
+    { };
+
+
+  template<typename _Tp>
+    struct is_signed
+    : public __is_signed_helper<_Tp>::type
+    { };
+
+
+  template<typename _Tp>
+    struct is_unsigned
+    : public __and_<is_arithmetic<_Tp>, __not_<is_signed<_Tp>>>
+    { };
+  template<typename _Tp, typename _Up = _Tp&&>
+    _Up
+    __declval(int);
+
+  template<typename _Tp>
+    _Tp
+    __declval(long);
+
+  template<typename _Tp>
+    auto declval() noexcept -> decltype(__declval<_Tp>(0));
+
+  template<typename, unsigned = 0>
+    struct extent;
+
+  template<typename>
+    struct remove_all_extents;
+
+  template<typename _Tp>
+    struct __is_array_known_bounds
+    : public integral_constant<bool, (extent<_Tp>::value > 0)>
+    { };
+
+  template<typename _Tp>
+    struct __is_array_unknown_bounds
+    : public __and_<is_array<_Tp>, __not_<extent<_Tp>>>
+    { };
+
+
+
+
+
+
+  struct __do_is_destructible_impl
+  {
+    template<typename _Tp, typename = decltype(declval<_Tp&>().~_Tp())>
+      static true_type __test(int);
+
+    template<typename>
+      static false_type __test(...);
+  };
+
+  template<typename _Tp>
+    struct __is_destructible_impl
+    : public __do_is_destructible_impl
+    {
+      typedef decltype(__test<_Tp>(0)) type;
+    };
+
+  template<typename _Tp,
+           bool = __or_<is_void<_Tp>,
+                        __is_array_unknown_bounds<_Tp>,
+                        is_function<_Tp>>::value,
+           bool = __or_<is_reference<_Tp>, is_scalar<_Tp>>::value>
+    struct __is_destructible_safe;
+
+  template<typename _Tp>
+    struct __is_destructible_safe<_Tp, false, false>
+    : public __is_destructible_impl<typename
+               remove_all_extents<_Tp>::type>::type
+    { };
+
+  template<typename _Tp>
+    struct __is_destructible_safe<_Tp, true, false>
+    : public false_type { };
+
+  template<typename _Tp>
+    struct __is_destructible_safe<_Tp, false, true>
+    : public true_type { };
+
+
+  template<typename _Tp>
+    struct is_destructible
+    : public __is_destructible_safe<_Tp>::type
+    { };
+
+
+
+
+
+  struct __do_is_nt_destructible_impl
+  {
+    template<typename _Tp>
+      static integral_constant<bool, noexcept(declval<_Tp&>().~_Tp())>
+        __test(int);
+
+    template<typename>
+      static false_type __test(...);
+  };
+
+  template<typename _Tp>
+    struct __is_nt_destructible_impl
+    : public __do_is_nt_destructible_impl
+    {
+      typedef decltype(__test<_Tp>(0)) type;
+    };
+
+  template<typename _Tp,
+           bool = __or_<is_void<_Tp>,
+                        __is_array_unknown_bounds<_Tp>,
+                        is_function<_Tp>>::value,
+           bool = __or_<is_reference<_Tp>, is_scalar<_Tp>>::value>
+    struct __is_nt_destructible_safe;
+
+  template<typename _Tp>
+    struct __is_nt_destructible_safe<_Tp, false, false>
+    : public __is_nt_destructible_impl<typename
+               remove_all_extents<_Tp>::type>::type
+    { };
+
+  template<typename _Tp>
+    struct __is_nt_destructible_safe<_Tp, true, false>
+    : public false_type { };
+
+  template<typename _Tp>
+    struct __is_nt_destructible_safe<_Tp, false, true>
+    : public true_type { };
+
+
+  template<typename _Tp>
+    struct is_nothrow_destructible
+    : public __is_nt_destructible_safe<_Tp>::type
+    { };
+
+  struct __do_is_default_constructible_impl
+  {
+    template<typename _Tp, typename = decltype(_Tp())>
+      static true_type __test(int);
+
+    template<typename>
+      static false_type __test(...);
+  };
+
+  template<typename _Tp>
+    struct __is_default_constructible_impl
+    : public __do_is_default_constructible_impl
+    {
+      typedef decltype(__test<_Tp>(0)) type;
+    };
+
+  template<typename _Tp>
+    struct __is_default_constructible_atom
+    : public __and_<__not_<is_void<_Tp>>,
+                    __is_default_constructible_impl<_Tp>>
+    { };
+
+  template<typename _Tp, bool = is_array<_Tp>::value>
+    struct __is_default_constructible_safe;
+
+
+
+
+
+
+  template<typename _Tp>
+    struct __is_default_constructible_safe<_Tp, true>
+    : public __and_<__is_array_known_bounds<_Tp>,
+      __is_default_constructible_atom<typename
+                      remove_all_extents<_Tp>::type>>
+    { };
+
+  template<typename _Tp>
+    struct __is_default_constructible_safe<_Tp, false>
+    : public __is_default_constructible_atom<_Tp>::type
+    { };
+
+
+  template<typename _Tp>
+    struct is_default_constructible
+    : public __is_default_constructible_safe<_Tp>::type
+    { };
+
+
+  template<typename _Tp, typename... _Args>
+    struct is_constructible
+      : public __bool_constant<__is_constructible(_Tp, _Args...)>
+    { };
+
+  template<typename _Tp, bool = __is_referenceable<_Tp>::value>
+    struct __is_copy_constructible_impl;
+
+  template<typename _Tp>
+    struct __is_copy_constructible_impl<_Tp, false>
+    : public false_type { };
+
+  template<typename _Tp>
+    struct __is_copy_constructible_impl<_Tp, true>
+    : public is_constructible<_Tp, const _Tp&>
+    { };
+
+
+  template<typename _Tp>
+    struct is_copy_constructible
+    : public __is_copy_constructible_impl<_Tp>
+    { };
+
+  template<typename _Tp, bool = __is_referenceable<_Tp>::value>
+    struct __is_move_constructible_impl;
+
+  template<typename _Tp>
+    struct __is_move_constructible_impl<_Tp, false>
+    : public false_type { };
+
+  template<typename _Tp>
+    struct __is_move_constructible_impl<_Tp, true>
+    : public is_constructible<_Tp, _Tp&&>
+    { };
+
+
+  template<typename _Tp>
+    struct is_move_constructible
+    : public __is_move_constructible_impl<_Tp>
+    { };
+
+  template<typename _Tp>
+    struct __is_nt_default_constructible_atom
+    : public integral_constant<bool, noexcept(_Tp())>
+    { };
+
+  template<typename _Tp, bool = is_array<_Tp>::value>
+    struct __is_nt_default_constructible_impl;
+
+  template<typename _Tp>
+    struct __is_nt_default_constructible_impl<_Tp, true>
+    : public __and_<__is_array_known_bounds<_Tp>,
+      __is_nt_default_constructible_atom<typename
+                      remove_all_extents<_Tp>::type>>
+    { };
+
+  template<typename _Tp>
+    struct __is_nt_default_constructible_impl<_Tp, false>
+    : public __is_nt_default_constructible_atom<_Tp>
+    { };
+
+
+  template<typename _Tp>
+    struct is_nothrow_default_constructible
+    : public __and_<is_default_constructible<_Tp>,
+                    __is_nt_default_constructible_impl<_Tp>>
+    { };
+
+  template<typename _Tp, typename... _Args>
+    struct __is_nt_constructible_impl
+    : public integral_constant<bool, noexcept(_Tp(declval<_Args>()...))>
+    { };
+
+  template<typename _Tp, typename _Arg>
+    struct __is_nt_constructible_impl<_Tp, _Arg>
+    : public integral_constant<bool,
+                               noexcept(static_cast<_Tp>(declval<_Arg>()))>
+    { };
+
+  template<typename _Tp>
+    struct __is_nt_constructible_impl<_Tp>
+    : public is_nothrow_default_constructible<_Tp>
+    { };
+
+
+  template<typename _Tp, typename... _Args>
+    struct is_nothrow_constructible
+    : public __and_<is_constructible<_Tp, _Args...>,
+      __is_nt_constructible_impl<_Tp, _Args...>>
+    { };
+
+  template<typename _Tp, bool = __is_referenceable<_Tp>::value>
+    struct __is_nothrow_copy_constructible_impl;
+
+  template<typename _Tp>
+    struct __is_nothrow_copy_constructible_impl<_Tp, false>
+    : public false_type { };
+
+  template<typename _Tp>
+    struct __is_nothrow_copy_constructible_impl<_Tp, true>
+    : public is_nothrow_constructible<_Tp, const _Tp&>
+    { };
+
+
+  template<typename _Tp>
+    struct is_nothrow_copy_constructible
+    : public __is_nothrow_copy_constructible_impl<_Tp>
+    { };
+
+  template<typename _Tp, bool = __is_referenceable<_Tp>::value>
+    struct __is_nothrow_move_constructible_impl;
+
+  template<typename _Tp>
+    struct __is_nothrow_move_constructible_impl<_Tp, false>
+    : public false_type { };
+
+  template<typename _Tp>
+    struct __is_nothrow_move_constructible_impl<_Tp, true>
+    : public is_nothrow_constructible<_Tp, _Tp&&>
+    { };
+
+
+  template<typename _Tp>
+    struct is_nothrow_move_constructible
+    : public __is_nothrow_move_constructible_impl<_Tp>
+    { };
+
+
+  template<typename _Tp, typename _Up>
+    struct is_assignable
+      : public __bool_constant<__is_assignable(_Tp, _Up)>
+    { };
+
+  template<typename _Tp, bool = __is_referenceable<_Tp>::value>
+    struct __is_copy_assignable_impl;
+
+  template<typename _Tp>
+    struct __is_copy_assignable_impl<_Tp, false>
+    : public false_type { };
+
+  template<typename _Tp>
+    struct __is_copy_assignable_impl<_Tp, true>
+    : public is_assignable<_Tp&, const _Tp&>
+    { };
+
+
+  template<typename _Tp>
+    struct is_copy_assignable
+    : public __is_copy_assignable_impl<_Tp>
+    { };
+
+  template<typename _Tp, bool = __is_referenceable<_Tp>::value>
+    struct __is_move_assignable_impl;
+
+  template<typename _Tp>
+    struct __is_move_assignable_impl<_Tp, false>
+    : public false_type { };
+
+  template<typename _Tp>
+    struct __is_move_assignable_impl<_Tp, true>
+    : public is_assignable<_Tp&, _Tp&&>
+    { };
+
+
+  template<typename _Tp>
+    struct is_move_assignable
+    : public __is_move_assignable_impl<_Tp>
+    { };
+
+  template<typename _Tp, typename _Up>
+    struct __is_nt_assignable_impl
+    : public integral_constant<bool, noexcept(declval<_Tp>() = declval<_Up>())>
+    { };
+
+
+  template<typename _Tp, typename _Up>
+    struct is_nothrow_assignable
+    : public __and_<is_assignable<_Tp, _Up>,
+      __is_nt_assignable_impl<_Tp, _Up>>
+    { };
+
+  template<typename _Tp, bool = __is_referenceable<_Tp>::value>
+    struct __is_nt_copy_assignable_impl;
+
+  template<typename _Tp>
+    struct __is_nt_copy_assignable_impl<_Tp, false>
+    : public false_type { };
+
+  template<typename _Tp>
+    struct __is_nt_copy_assignable_impl<_Tp, true>
+    : public is_nothrow_assignable<_Tp&, const _Tp&>
+    { };
+
+
+  template<typename _Tp>
+    struct is_nothrow_copy_assignable
+    : public __is_nt_copy_assignable_impl<_Tp>
+    { };
+
+  template<typename _Tp, bool = __is_referenceable<_Tp>::value>
+    struct __is_nt_move_assignable_impl;
+
+  template<typename _Tp>
+    struct __is_nt_move_assignable_impl<_Tp, false>
+    : public false_type { };
+
+  template<typename _Tp>
+    struct __is_nt_move_assignable_impl<_Tp, true>
+    : public is_nothrow_assignable<_Tp&, _Tp&&>
+    { };
+
+
+  template<typename _Tp>
+    struct is_nothrow_move_assignable
+    : public __is_nt_move_assignable_impl<_Tp>
+    { };
+
+
+  template<typename _Tp, typename... _Args>
+    struct is_trivially_constructible
+    : public __bool_constant<__is_trivially_constructible(_Tp, _Args...)>
+    { };
+
+
+  template<typename _Tp>
+    struct is_trivially_default_constructible
+    : public is_trivially_constructible<_Tp>::type
+    { };
+
+  struct __do_is_implicitly_default_constructible_impl
+  {
+    template <typename _Tp>
+    static void __helper(const _Tp&);
+
+    template <typename _Tp>
+    static true_type __test(const _Tp&,
+                            decltype(__helper<const _Tp&>({}))* = 0);
+
+    static false_type __test(...);
+  };
+
+  template<typename _Tp>
+    struct __is_implicitly_default_constructible_impl
+      : public __do_is_implicitly_default_constructible_impl
+  {
+    typedef decltype(__test(declval<_Tp>())) type;
+  };
+
+  template<typename _Tp>
+    struct __is_implicitly_default_constructible_safe
+      : public __is_implicitly_default_constructible_impl<_Tp>::type
+  { };
+
+  template <typename _Tp>
+    struct __is_implicitly_default_constructible
+      : public __and_<is_default_constructible<_Tp>,
+                      __is_implicitly_default_constructible_safe<_Tp>>
+  { };
+
+
+
+  template<typename _Tp, bool = __is_referenceable<_Tp>::value>
+    struct __is_trivially_copy_constructible_impl;
+
+  template<typename _Tp>
+    struct __is_trivially_copy_constructible_impl<_Tp, false>
+    : public false_type { };
+
+  template<typename _Tp>
+    struct __is_trivially_copy_constructible_impl<_Tp, true>
+    : public __and_<is_copy_constructible<_Tp>,
+      integral_constant<bool,
+   __is_trivially_constructible(_Tp, const _Tp&)>>
+    { };
+
+  template<typename _Tp>
+    struct is_trivially_copy_constructible
+    : public __is_trivially_copy_constructible_impl<_Tp>
+    { };
+
+
+
+  template<typename _Tp, bool = __is_referenceable<_Tp>::value>
+    struct __is_trivially_move_constructible_impl;
+
+  template<typename _Tp>
+    struct __is_trivially_move_constructible_impl<_Tp, false>
+    : public false_type { };
+
+  template<typename _Tp>
+    struct __is_trivially_move_constructible_impl<_Tp, true>
+    : public __and_<is_move_constructible<_Tp>,
+      integral_constant<bool,
+   __is_trivially_constructible(_Tp, _Tp&&)>>
+    { };
+
+  template<typename _Tp>
+    struct is_trivially_move_constructible
+    : public __is_trivially_move_constructible_impl<_Tp>
+    { };
+
+
+  template<typename _Tp, typename _Up>
+    struct is_trivially_assignable
+    : public __bool_constant<__is_trivially_assignable(_Tp, _Up)>
+    { };
+
+
+
+  template<typename _Tp, bool = __is_referenceable<_Tp>::value>
+    struct __is_trivially_copy_assignable_impl;
+
+  template<typename _Tp>
+    struct __is_trivially_copy_assignable_impl<_Tp, false>
+    : public false_type { };
+
+  template<typename _Tp>
+    struct __is_trivially_copy_assignable_impl<_Tp, true>
+    : public __and_<is_copy_assignable<_Tp>,
+      integral_constant<bool,
+   __is_trivially_assignable(_Tp&, const _Tp&)>>
+    { };
+
+  template<typename _Tp>
+    struct is_trivially_copy_assignable
+    : public __is_trivially_copy_assignable_impl<_Tp>
+    { };
+
+
+
+  template<typename _Tp, bool = __is_referenceable<_Tp>::value>
+    struct __is_trivially_move_assignable_impl;
+
+  template<typename _Tp>
+    struct __is_trivially_move_assignable_impl<_Tp, false>
+    : public false_type { };
+
+  template<typename _Tp>
+    struct __is_trivially_move_assignable_impl<_Tp, true>
+    : public __and_<is_move_assignable<_Tp>,
+      integral_constant<bool,
+   __is_trivially_assignable(_Tp&, _Tp&&)>>
+    { };
+
+  template<typename _Tp>
+    struct is_trivially_move_assignable
+    : public __is_trivially_move_assignable_impl<_Tp>
+    { };
+
+
+  template<typename _Tp>
+    struct is_trivially_destructible
+    : public __and_<is_destructible<_Tp>, integral_constant<bool,
+         __has_trivial_destructor(_Tp)>>
+    { };
+
+
+
+  template<typename _Tp>
+    struct has_virtual_destructor
+    : public integral_constant<bool, __has_virtual_destructor(_Tp)>
+    { };
+
+
+
+
+
+  template<typename _Tp>
+    struct alignment_of
+    : public integral_constant<std::size_t, __alignof__(_Tp)> { };
+
+
+  template<typename>
+    struct rank
+    : public integral_constant<std::size_t, 0> { };
+
+  template<typename _Tp, std::size_t _Size>
+    struct rank<_Tp[_Size]>
+    : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
+
+  template<typename _Tp>
+    struct rank<_Tp[]>
+    : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
+
+
+  template<typename, unsigned _Uint>
+    struct extent
+    : public integral_constant<std::size_t, 0> { };
+
+  template<typename _Tp, unsigned _Uint, std::size_t _Size>
+    struct extent<_Tp[_Size], _Uint>
+    : public integral_constant<std::size_t,
+          _Uint == 0 ? _Size : extent<_Tp,
+          _Uint - 1>::value>
+    { };
+
+  template<typename _Tp, unsigned _Uint>
+    struct extent<_Tp[], _Uint>
+    : public integral_constant<std::size_t,
+          _Uint == 0 ? 0 : extent<_Tp,
+             _Uint - 1>::value>
+    { };
+
+
+
+
+
+  template<typename, typename>
+    struct is_same
+    : public false_type { };
+
+  template<typename _Tp>
+    struct is_same<_Tp, _Tp>
+    : public true_type { };
+
+
+  template<typename _Base, typename _Derived>
+    struct is_base_of
+    : public integral_constant<bool, __is_base_of(_Base, _Derived)>
+    { };
+
+  template<typename _From, typename _To,
+           bool = __or_<is_void<_From>, is_function<_To>,
+                        is_array<_To>>::value>
+    struct __is_convertible_helper
+    { typedef typename is_void<_To>::type type; };
+
+  template<typename _From, typename _To>
+    class __is_convertible_helper<_From, _To, false>
+    {
+       template<typename _To1>
+ static void __test_aux(_To1);
+
+      template<typename _From1, typename _To1,
+        typename = decltype(__test_aux<_To1>(std::declval<_From1>()))>
+ static true_type
+ __test(int);
+
+      template<typename, typename>
+ static false_type
+ __test(...);
+
+    public:
+      typedef decltype(__test<_From, _To>(0)) type;
+    };
+
+
+
+  template<typename _From, typename _To>
+    struct is_convertible
+    : public __is_convertible_helper<_From, _To>::type
+    { };
+
+
+
+
+
+  template<typename _Tp>
+    struct remove_const
+    { typedef _Tp type; };
+
+  template<typename _Tp>
+    struct remove_const<_Tp const>
+    { typedef _Tp type; };
+
+
+  template<typename _Tp>
+    struct remove_volatile
+    { typedef _Tp type; };
+
+  template<typename _Tp>
+    struct remove_volatile<_Tp volatile>
+    { typedef _Tp type; };
+
+
+  template<typename _Tp>
+    struct remove_cv
+    {
+      typedef typename
+      remove_const<typename remove_volatile<_Tp>::type>::type type;
+    };
+
+
+  template<typename _Tp>
+    struct add_const
+    { typedef _Tp const type; };
+
+
+  template<typename _Tp>
+    struct add_volatile
+    { typedef _Tp volatile type; };
+
+
+  template<typename _Tp>
+    struct add_cv
+    {
+      typedef typename
+      add_const<typename add_volatile<_Tp>::type>::type type;
+    };
+  template<typename _Tp>
+    struct remove_reference
+    { typedef _Tp type; };
+
+  template<typename _Tp>
+    struct remove_reference<_Tp&>
+    { typedef _Tp type; };
+
+  template<typename _Tp>
+    struct remove_reference<_Tp&&>
+    { typedef _Tp type; };
+
+  template<typename _Tp, bool = __is_referenceable<_Tp>::value>
+    struct __add_lvalue_reference_helper
+    { typedef _Tp type; };
+
+  template<typename _Tp>
+    struct __add_lvalue_reference_helper<_Tp, true>
+    { typedef _Tp& type; };
+
+
+  template<typename _Tp>
+    struct add_lvalue_reference
+    : public __add_lvalue_reference_helper<_Tp>
+    { };
+
+  template<typename _Tp, bool = __is_referenceable<_Tp>::value>
+    struct __add_rvalue_reference_helper
+    { typedef _Tp type; };
+
+  template<typename _Tp>
+    struct __add_rvalue_reference_helper<_Tp, true>
+    { typedef _Tp&& type; };
+
+
+  template<typename _Tp>
+    struct add_rvalue_reference
+    : public __add_rvalue_reference_helper<_Tp>
+    { };
+  template<typename _Unqualified, bool _IsConst, bool _IsVol>
+    struct __cv_selector;
+
+  template<typename _Unqualified>
+    struct __cv_selector<_Unqualified, false, false>
+    { typedef _Unqualified __type; };
+
+  template<typename _Unqualified>
+    struct __cv_selector<_Unqualified, false, true>
+    { typedef volatile _Unqualified __type; };
+
+  template<typename _Unqualified>
+    struct __cv_selector<_Unqualified, true, false>
+    { typedef const _Unqualified __type; };
+
+  template<typename _Unqualified>
+    struct __cv_selector<_Unqualified, true, true>
+    { typedef const volatile _Unqualified __type; };
+
+  template<typename _Qualified, typename _Unqualified,
+    bool _IsConst = is_const<_Qualified>::value,
+    bool _IsVol = is_volatile<_Qualified>::value>
+    class __match_cv_qualifiers
+    {
+      typedef __cv_selector<_Unqualified, _IsConst, _IsVol> __match;
+
+    public:
+      typedef typename __match::__type __type;
+    };
+
+
+  template<typename _Tp>
+    struct __make_unsigned
+    { typedef _Tp __type; };
+
+  template<>
+    struct __make_unsigned<char>
+    { typedef unsigned char __type; };
+
+  template<>
+    struct __make_unsigned<signed char>
+    { typedef unsigned char __type; };
+
+  template<>
+    struct __make_unsigned<short>
+    { typedef unsigned short __type; };
+
+  template<>
+    struct __make_unsigned<int>
+    { typedef unsigned int __type; };
+
+  template<>
+    struct __make_unsigned<long>
+    { typedef unsigned long __type; };
+
+  template<>
+    struct __make_unsigned<long long>
+    { typedef unsigned long long __type; };
+
+
+  template<>
+    struct __make_unsigned<wchar_t> : __make_unsigned<int>
+    { };
+  template<typename _Tp,
+    bool _IsInt = is_integral<_Tp>::value,
+    bool _IsEnum = is_enum<_Tp>::value>
+    class __make_unsigned_selector;
+
+  template<typename _Tp>
+    class __make_unsigned_selector<_Tp, true, false>
+    {
+      typedef __make_unsigned<typename remove_cv<_Tp>::type> __unsignedt;
+      typedef typename __unsignedt::__type __unsigned_type;
+      typedef __match_cv_qualifiers<_Tp, __unsigned_type> __cv_unsigned;
+
+    public:
+      typedef typename __cv_unsigned::__type __type;
+    };
+
+  template<typename _Tp>
+    class __make_unsigned_selector<_Tp, false, true>
+    {
+
+      typedef unsigned char __smallest;
+      static const bool __b0 = sizeof(_Tp) <= sizeof(__smallest);
+      static const bool __b1 = sizeof(_Tp) <= sizeof(unsigned short);
+      static const bool __b2 = sizeof(_Tp) <= sizeof(unsigned int);
+      static const bool __b3 = sizeof(_Tp) <= sizeof(unsigned long);
+      typedef conditional<__b3, unsigned long, unsigned long long> __cond3;
+      typedef typename __cond3::type __cond3_type;
+      typedef conditional<__b2, unsigned int, __cond3_type> __cond2;
+      typedef typename __cond2::type __cond2_type;
+      typedef conditional<__b1, unsigned short, __cond2_type> __cond1;
+      typedef typename __cond1::type __cond1_type;
+
+      typedef typename conditional<__b0, __smallest, __cond1_type>::type
+ __unsigned_type;
+      typedef __match_cv_qualifiers<_Tp, __unsigned_type> __cv_unsigned;
+
+    public:
+      typedef typename __cv_unsigned::__type __type;
+    };
+
+
+
+
+
+  template<typename _Tp>
+    struct make_unsigned
+    { typedef typename __make_unsigned_selector<_Tp>::__type type; };
+
+
+  template<>
+    struct make_unsigned<bool>;
+
+
+
+  template<typename _Tp>
+    struct __make_signed
+    { typedef _Tp __type; };
+
+  template<>
+    struct __make_signed<char>
+    { typedef signed char __type; };
+
+  template<>
+    struct __make_signed<unsigned char>
+    { typedef signed char __type; };
+
+  template<>
+    struct __make_signed<unsigned short>
+    { typedef signed short __type; };
+
+  template<>
+    struct __make_signed<unsigned int>
+    { typedef signed int __type; };
+
+  template<>
+    struct __make_signed<unsigned long>
+    { typedef signed long __type; };
+
+  template<>
+    struct __make_signed<unsigned long long>
+    { typedef signed long long __type; };
+  template<>
+    struct __make_signed<char16_t> : __make_signed<uint_least16_t>
+    { };
+  template<>
+    struct __make_signed<char32_t> : __make_signed<uint_least32_t>
+    { };
+  template<typename _Tp,
+    bool _IsInt = is_integral<_Tp>::value,
+    bool _IsEnum = is_enum<_Tp>::value>
+    class __make_signed_selector;
+
+  template<typename _Tp>
+    class __make_signed_selector<_Tp, true, false>
+    {
+      typedef __make_signed<typename remove_cv<_Tp>::type> __signedt;
+      typedef typename __signedt::__type __signed_type;
+      typedef __match_cv_qualifiers<_Tp, __signed_type> __cv_signed;
+
+    public:
+      typedef typename __cv_signed::__type __type;
+    };
+
+  template<typename _Tp>
+    class __make_signed_selector<_Tp, false, true>
+    {
+      typedef typename __make_unsigned_selector<_Tp>::__type __unsigned_type;
+
+    public:
+      typedef typename __make_signed_selector<__unsigned_type>::__type __type;
+    };
+
+
+
+
+
+  template<typename _Tp>
+    struct make_signed
+    { typedef typename __make_signed_selector<_Tp>::__type type; };
+
+
+  template<>
+    struct make_signed<bool>;
+  template<typename _Tp>
+    struct remove_extent
+    { typedef _Tp type; };
+
+  template<typename _Tp, std::size_t _Size>
+    struct remove_extent<_Tp[_Size]>
+    { typedef _Tp type; };
+
+  template<typename _Tp>
+    struct remove_extent<_Tp[]>
+    { typedef _Tp type; };
+
+
+  template<typename _Tp>
+    struct remove_all_extents
+    { typedef _Tp type; };
+
+  template<typename _Tp, std::size_t _Size>
+    struct remove_all_extents<_Tp[_Size]>
+    { typedef typename remove_all_extents<_Tp>::type type; };
+
+  template<typename _Tp>
+    struct remove_all_extents<_Tp[]>
+    { typedef typename remove_all_extents<_Tp>::type type; };
+  template<typename _Tp, typename>
+    struct __remove_pointer_helper
+    { typedef _Tp type; };
+
+  template<typename _Tp, typename _Up>
+    struct __remove_pointer_helper<_Tp, _Up*>
+    { typedef _Up type; };
+
+
+  template<typename _Tp>
+    struct remove_pointer
+    : public __remove_pointer_helper<_Tp, typename remove_cv<_Tp>::type>
+    { };
+
+
+  template<typename _Tp, bool = __or_<__is_referenceable<_Tp>,
+          is_void<_Tp>>::value>
+    struct __add_pointer_helper
+    { typedef _Tp type; };
+
+  template<typename _Tp>
+    struct __add_pointer_helper<_Tp, true>
+    { typedef typename remove_reference<_Tp>::type* type; };
+
+  template<typename _Tp>
+    struct add_pointer
+    : public __add_pointer_helper<_Tp>
+    { };
+  template<std::size_t _Len>
+    struct __aligned_storage_msa
+    {
+      union __type
+      {
+ unsigned char __data[_Len];
+ struct __attribute__((__aligned__)) { } __align;
+      };
+    };
+  template<std::size_t _Len, std::size_t _Align =
+    __alignof__(typename __aligned_storage_msa<_Len>::__type)>
+    struct aligned_storage
+    {
+      union type
+      {
+ unsigned char __data[_Len];
+ struct __attribute__((__aligned__((_Align)))) { } __align;
+      };
+    };
+
+  template <typename... _Types>
+    struct __strictest_alignment
+    {
+      static const size_t _S_alignment = 0;
+      static const size_t _S_size = 0;
+    };
+
+  template <typename _Tp, typename... _Types>
+    struct __strictest_alignment<_Tp, _Types...>
+    {
+      static const size_t _S_alignment =
+        alignof(_Tp) > __strictest_alignment<_Types...>::_S_alignment
+ ? alignof(_Tp) : __strictest_alignment<_Types...>::_S_alignment;
+      static const size_t _S_size =
+        sizeof(_Tp) > __strictest_alignment<_Types...>::_S_size
+ ? sizeof(_Tp) : __strictest_alignment<_Types...>::_S_size;
+    };
+  template <size_t _Len, typename... _Types>
+    struct aligned_union
+    {
+    private:
+      static_assert(sizeof...(_Types) != 0, "At least one type is required");
+
+      using __strictest = __strictest_alignment<_Types...>;
+      static const size_t _S_len = _Len > __strictest::_S_size
+ ? _Len : __strictest::_S_size;
+    public:
+
+      static const size_t alignment_value = __strictest::_S_alignment;
+
+      typedef typename aligned_storage<_S_len, alignment_value>::type type;
+    };
+
+  template <size_t _Len, typename... _Types>
+    const size_t aligned_union<_Len, _Types...>::alignment_value;
+
+
+
+  template<typename _Up,
+    bool _IsArray = is_array<_Up>::value,
+    bool _IsFunction = is_function<_Up>::value>
+    struct __decay_selector;
+
+
+  template<typename _Up>
+    struct __decay_selector<_Up, false, false>
+    { typedef typename remove_cv<_Up>::type __type; };
+
+  template<typename _Up>
+    struct __decay_selector<_Up, true, false>
+    { typedef typename remove_extent<_Up>::type* __type; };
+
+  template<typename _Up>
+    struct __decay_selector<_Up, false, true>
+    { typedef typename add_pointer<_Up>::type __type; };
+
+
+  template<typename _Tp>
+    class decay
+    {
+      typedef typename remove_reference<_Tp>::type __remove_type;
+
+    public:
+      typedef typename __decay_selector<__remove_type>::__type type;
+    };
+
+  template<typename _Tp>
+    class reference_wrapper;
+
+
+  template<typename _Tp>
+    struct __strip_reference_wrapper
+    {
+      typedef _Tp __type;
+    };
+
+  template<typename _Tp>
+    struct __strip_reference_wrapper<reference_wrapper<_Tp> >
+    {
+      typedef _Tp& __type;
+    };
+
+  template<typename _Tp>
+    struct __decay_and_strip
+    {
+      typedef typename __strip_reference_wrapper<
+ typename decay<_Tp>::type>::__type __type;
+    };
+
+
+
+
+  template<bool, typename _Tp = void>
+    struct enable_if
+    { };
+
+
+  template<typename _Tp>
+    struct enable_if<true, _Tp>
+    { typedef _Tp type; };
+
+  template<typename... _Cond>
+    using _Require = typename enable_if<__and_<_Cond...>::value>::type;
+
+
+
+  template<bool _Cond, typename _Iftrue, typename _Iffalse>
+    struct conditional
+    { typedef _Iftrue type; };
+
+
+  template<typename _Iftrue, typename _Iffalse>
+    struct conditional<false, _Iftrue, _Iffalse>
+    { typedef _Iffalse type; };
+
+
+  template<typename... _Tp>
+    struct common_type;
+
+
+
+  struct __do_common_type_impl
+  {
+    template<typename _Tp, typename _Up>
+      static __success_type<typename decay<decltype
+       (true ? std::declval<_Tp>()
+        : std::declval<_Up>())>::type> _S_test(int);
+
+    template<typename, typename>
+      static __failure_type _S_test(...);
+  };
+
+  template<typename _Tp, typename _Up>
+    struct __common_type_impl
+    : private __do_common_type_impl
+    {
+      typedef decltype(_S_test<_Tp, _Up>(0)) type;
+    };
+
+  struct __do_member_type_wrapper
+  {
+    template<typename _Tp>
+      static __success_type<typename _Tp::type> _S_test(int);
+
+    template<typename>
+      static __failure_type _S_test(...);
+  };
+
+  template<typename _Tp>
+    struct __member_type_wrapper
+    : private __do_member_type_wrapper
+    {
+      typedef decltype(_S_test<_Tp>(0)) type;
+    };
+
+  template<typename _CTp, typename... _Args>
+    struct __expanded_common_type_wrapper
+    {
+      typedef common_type<typename _CTp::type, _Args...> type;
+    };
+
+  template<typename... _Args>
+    struct __expanded_common_type_wrapper<__failure_type, _Args...>
+    { typedef __failure_type type; };
+
+  template<typename _Tp>
+    struct common_type<_Tp>
+    { typedef typename decay<_Tp>::type type; };
+
+  template<typename _Tp, typename _Up>
+    struct common_type<_Tp, _Up>
+    : public __common_type_impl<_Tp, _Up>::type
+    { };
+
+  template<typename _Tp, typename _Up, typename... _Vp>
+    struct common_type<_Tp, _Up, _Vp...>
+    : public __expanded_common_type_wrapper<typename __member_type_wrapper<
+               common_type<_Tp, _Up>>::type, _Vp...>::type
+    { };
+
+
+  template<typename _Tp>
+    struct underlying_type
+    {
+      typedef __underlying_type(_Tp) type;
+    };
+
+  template<typename _Tp>
+    struct __declval_protector
+    {
+      static const bool __stop = false;
+    };
+
+  template<typename _Tp>
+    auto declval() noexcept -> decltype(__declval<_Tp>(0))
+    {
+      static_assert(__declval_protector<_Tp>::__stop,
+      "declval() must not be used!");
+      return __declval<_Tp>(0);
+    }
+
+
+  template<typename _Signature>
+    class result_of;
+
+
+
+
+
+  struct __invoke_memfun_ref { };
+  struct __invoke_memfun_deref { };
+  struct __invoke_memobj_ref { };
+  struct __invoke_memobj_deref { };
+  struct __invoke_other { };
+
+
+  template<typename _Tp, typename _Tag>
+    struct __result_of_success : __success_type<_Tp>
+    { using __invoke_type = _Tag; };
+
+
+  struct __result_of_memfun_ref_impl
+  {
+    template<typename _Fp, typename _Tp1, typename... _Args>
+      static __result_of_success<decltype(
+      (std::declval<_Tp1>().*std::declval<_Fp>())(std::declval<_Args>()...)
+      ), __invoke_memfun_ref> _S_test(int);
+
+    template<typename...>
+      static __failure_type _S_test(...);
+  };
+
+  template<typename _MemPtr, typename _Arg, typename... _Args>
+    struct __result_of_memfun_ref
+    : private __result_of_memfun_ref_impl
+    {
+      typedef decltype(_S_test<_MemPtr, _Arg, _Args...>(0)) type;
+    };
+
+
+  struct __result_of_memfun_deref_impl
+  {
+    template<typename _Fp, typename _Tp1, typename... _Args>
+      static __result_of_success<decltype(
+      ((*std::declval<_Tp1>()).*std::declval<_Fp>())(std::declval<_Args>()...)
+      ), __invoke_memfun_deref> _S_test(int);
+
+    template<typename...>
+      static __failure_type _S_test(...);
+  };
+
+  template<typename _MemPtr, typename _Arg, typename... _Args>
+    struct __result_of_memfun_deref
+    : private __result_of_memfun_deref_impl
+    {
+      typedef decltype(_S_test<_MemPtr, _Arg, _Args...>(0)) type;
+    };
+
+
+  struct __result_of_memobj_ref_impl
+  {
+    template<typename _Fp, typename _Tp1>
+      static __result_of_success<decltype(
+      std::declval<_Tp1>().*std::declval<_Fp>()
+      ), __invoke_memobj_ref> _S_test(int);
+
+    template<typename, typename>
+      static __failure_type _S_test(...);
+  };
+
+  template<typename _MemPtr, typename _Arg>
+    struct __result_of_memobj_ref
+    : private __result_of_memobj_ref_impl
+    {
+      typedef decltype(_S_test<_MemPtr, _Arg>(0)) type;
+    };
+
+
+  struct __result_of_memobj_deref_impl
+  {
+    template<typename _Fp, typename _Tp1>
+      static __result_of_success<decltype(
+      (*std::declval<_Tp1>()).*std::declval<_Fp>()
+      ), __invoke_memobj_deref> _S_test(int);
+
+    template<typename, typename>
+      static __failure_type _S_test(...);
+  };
+
+  template<typename _MemPtr, typename _Arg>
+    struct __result_of_memobj_deref
+    : private __result_of_memobj_deref_impl
+    {
+      typedef decltype(_S_test<_MemPtr, _Arg>(0)) type;
+    };
+
+  template<typename _MemPtr, typename _Arg>
+    struct __result_of_memobj;
+
+  template<typename _Res, typename _Class, typename _Arg>
+    struct __result_of_memobj<_Res _Class::*, _Arg>
+    {
+      typedef typename remove_cv<typename remove_reference<
+        _Arg>::type>::type _Argval;
+      typedef _Res _Class::* _MemPtr;
+      typedef typename conditional<__or_<is_same<_Argval, _Class>,
+        is_base_of<_Class, _Argval>>::value,
+        __result_of_memobj_ref<_MemPtr, _Arg>,
+        __result_of_memobj_deref<_MemPtr, _Arg>
+      >::type::type type;
+    };
+
+  template<typename _MemPtr, typename _Arg, typename... _Args>
+    struct __result_of_memfun;
+
+  template<typename _Res, typename _Class, typename _Arg, typename... _Args>
+    struct __result_of_memfun<_Res _Class::*, _Arg, _Args...>
+    {
+      typedef typename remove_cv<typename remove_reference<
+        _Arg>::type>::type _Argval;
+      typedef _Res _Class::* _MemPtr;
+      typedef typename conditional<__or_<is_same<_Argval, _Class>,
+        is_base_of<_Class, _Argval>>::value,
+        __result_of_memfun_ref<_MemPtr, _Arg, _Args...>,
+        __result_of_memfun_deref<_MemPtr, _Arg, _Args...>
+      >::type::type type;
+    };
+
+
+
+
+
+
+  template<typename _Tp, typename _Up = typename decay<_Tp>::type>
+    struct __inv_unwrap
+    {
+      using type = _Tp;
+    };
+
+  template<typename _Tp, typename _Up>
+    struct __inv_unwrap<_Tp, reference_wrapper<_Up>>
+    {
+      using type = _Up&;
+    };
+
+  template<bool, bool, typename _Functor, typename... _ArgTypes>
+    struct __result_of_impl
+    {
+      typedef __failure_type type;
+    };
+
+  template<typename _MemPtr, typename _Arg>
+    struct __result_of_impl<true, false, _MemPtr, _Arg>
+    : public __result_of_memobj<typename decay<_MemPtr>::type,
+    typename __inv_unwrap<_Arg>::type>
+    { };
+
+  template<typename _MemPtr, typename _Arg, typename... _Args>
+    struct __result_of_impl<false, true, _MemPtr, _Arg, _Args...>
+    : public __result_of_memfun<typename decay<_MemPtr>::type,
+    typename __inv_unwrap<_Arg>::type, _Args...>
+    { };
+
+
+  struct __result_of_other_impl
+  {
+    template<typename _Fn, typename... _Args>
+      static __result_of_success<decltype(
+      std::declval<_Fn>()(std::declval<_Args>()...)
+      ), __invoke_other> _S_test(int);
+
+    template<typename...>
+      static __failure_type _S_test(...);
+  };
+
+  template<typename _Functor, typename... _ArgTypes>
+    struct __result_of_impl<false, false, _Functor, _ArgTypes...>
+    : private __result_of_other_impl
+    {
+      typedef decltype(_S_test<_Functor, _ArgTypes...>(0)) type;
+    };
+
+
+  template<typename _Functor, typename... _ArgTypes>
+    struct __invoke_result
+    : public __result_of_impl<
+        is_member_object_pointer<
+          typename remove_reference<_Functor>::type
+        >::value,
+        is_member_function_pointer<
+          typename remove_reference<_Functor>::type
+        >::value,
+ _Functor, _ArgTypes...
+      >::type
+    { };
+
+  template<typename _Functor, typename... _ArgTypes>
+    struct result_of<_Functor(_ArgTypes...)>
+    : public __invoke_result<_Functor, _ArgTypes...>
+    { };
+  template<typename...> using __void_t = void;
+  template<typename _Default, typename _AlwaysVoid,
+    template<typename...> class _Op, typename... _Args>
+    struct __detector
+    {
+      using value_t = false_type;
+      using type = _Default;
+    };
+
+
+  template<typename _Default, template<typename...> class _Op,
+     typename... _Args>
+    struct __detector<_Default, __void_t<_Op<_Args...>>, _Op, _Args...>
+    {
+      using value_t = true_type;
+      using type = _Op<_Args...>;
+    };
+
+
+  template<typename _Default, template<typename...> class _Op,
+    typename... _Args>
+    using __detected_or = __detector<_Default, void, _Op, _Args...>;
+
+
+  template<typename _Default, template<typename...> class _Op,
+    typename... _Args>
+    using __detected_or_t
+      = typename __detected_or<_Default, _Op, _Args...>::type;
+  template <typename _Tp>
+    struct __is_swappable;
+
+  template <typename _Tp>
+    struct __is_nothrow_swappable;
+
+  template<typename... _Elements>
+    class tuple;
+
+  template<typename>
+    struct __is_tuple_like_impl : false_type
+    { };
+
+  template<typename... _Tps>
+    struct __is_tuple_like_impl<tuple<_Tps...>> : true_type
+    { };
+
+
+  template<typename _Tp>
+    struct __is_tuple_like
+    : public __is_tuple_like_impl<typename remove_cv<
+      typename remove_reference<_Tp>::type>::type>::type
+    { };
+
+  template<typename _Tp>
+    inline
+    typename enable_if<__and_<__not_<__is_tuple_like<_Tp>>,
+         is_move_constructible<_Tp>,
+         is_move_assignable<_Tp>>::value>::type
+    swap(_Tp&, _Tp&)
+    noexcept(__and_<is_nothrow_move_constructible<_Tp>,
+             is_nothrow_move_assignable<_Tp>>::value);
+
+  template<typename _Tp, size_t _Nm>
+    inline
+    typename enable_if<__is_swappable<_Tp>::value>::type
+    swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
+    noexcept(__is_nothrow_swappable<_Tp>::value);
+
+  namespace __swappable_details {
+    using std::swap;
+
+    struct __do_is_swappable_impl
+    {
+      template<typename _Tp, typename
+               = decltype(swap(std::declval<_Tp&>(), std::declval<_Tp&>()))>
+        static true_type __test(int);
+
+      template<typename>
+        static false_type __test(...);
+    };
+
+    struct __do_is_nothrow_swappable_impl
+    {
+      template<typename _Tp>
+        static __bool_constant<
+          noexcept(swap(std::declval<_Tp&>(), std::declval<_Tp&>()))
+        > __test(int);
+
+      template<typename>
+        static false_type __test(...);
+    };
+
+  }
+
+  template<typename _Tp>
+    struct __is_swappable_impl
+    : public __swappable_details::__do_is_swappable_impl
+    {
+      typedef decltype(__test<_Tp>(0)) type;
+    };
+
+  template<typename _Tp>
+    struct __is_nothrow_swappable_impl
+    : public __swappable_details::__do_is_nothrow_swappable_impl
+    {
+      typedef decltype(__test<_Tp>(0)) type;
+    };
+
+  template<typename _Tp>
+    struct __is_swappable
+    : public __is_swappable_impl<_Tp>::type
+    { };
+
+  template<typename _Tp>
+    struct __is_nothrow_swappable
+    : public __is_nothrow_swappable_impl<_Tp>::type
+    { };
+  template<typename _Result, typename _Ret, typename = void>
+    struct __is_invocable_impl : false_type { };
+
+  template<typename _Result, typename _Ret>
+    struct __is_invocable_impl<_Result, _Ret, __void_t<typename _Result::type>>
+    : __or_<is_void<_Ret>, is_convertible<typename _Result::type, _Ret>>::type
+    { };
+
+  template<typename _Fn, typename... _ArgTypes>
+    struct __is_invocable
+    : __is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, void>::type
+    { };
+
+  template<typename _Fn, typename _Tp, typename... _Args>
+    constexpr bool __call_is_nt(__invoke_memfun_ref)
+    {
+      using _Up = typename __inv_unwrap<_Tp>::type;
+      return noexcept((std::declval<_Up>().*std::declval<_Fn>())(
+     std::declval<_Args>()...));
+    }
+
+  template<typename _Fn, typename _Tp, typename... _Args>
+    constexpr bool __call_is_nt(__invoke_memfun_deref)
+    {
+      return noexcept(((*std::declval<_Tp>()).*std::declval<_Fn>())(
+     std::declval<_Args>()...));
+    }
+
+  template<typename _Fn, typename _Tp>
+    constexpr bool __call_is_nt(__invoke_memobj_ref)
+    {
+      using _Up = typename __inv_unwrap<_Tp>::type;
+      return noexcept(std::declval<_Up>().*std::declval<_Fn>());
+    }
+
+  template<typename _Fn, typename _Tp>
+    constexpr bool __call_is_nt(__invoke_memobj_deref)
+    {
+      return noexcept((*std::declval<_Tp>()).*std::declval<_Fn>());
+    }
+
+  template<typename _Fn, typename... _Args>
+    constexpr bool __call_is_nt(__invoke_other)
+    {
+      return noexcept(std::declval<_Fn>()(std::declval<_Args>()...));
+    }
+
+  template<typename _Result, typename _Fn, typename... _Args>
+    struct __call_is_nothrow
+    : __bool_constant<
+ std::__call_is_nt<_Fn, _Args...>(typename _Result::__invoke_type{})
+      >
+    { };
+
+  template<typename _Fn, typename... _Args>
+    using __call_is_nothrow_
+      = __call_is_nothrow<__invoke_result<_Fn, _Args...>, _Fn, _Args...>;
+
+
+  template<typename _Fn, typename... _Args>
+    struct __is_nothrow_invocable
+    : __and_<__is_invocable<_Fn, _Args...>,
+             __call_is_nothrow_<_Fn, _Args...>>::type
+    { };
+
+  struct __nonesuch {
+    __nonesuch() = delete;
+    ~__nonesuch() = delete;
+    __nonesuch(__nonesuch const&) = delete;
+    void operator=(__nonesuch const&) = delete;
+  };
+
+}
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+  template<typename _Tp>
+    constexpr _Tp&&
+    forward(typename std::remove_reference<_Tp>::type& __t) noexcept
+    { return static_cast<_Tp&&>(__t); }
+
+
+
+
+
+
+
+  template<typename _Tp>
+    constexpr _Tp&&
+    forward(typename std::remove_reference<_Tp>::type&& __t) noexcept
+    {
+      static_assert(!std::is_lvalue_reference<_Tp>::value, "template argument"
+      " substituting _Tp is an lvalue reference type");
+      return static_cast<_Tp&&>(__t);
+    }
+
+
+
+
+
+
+  template<typename _Tp>
+    constexpr typename std::remove_reference<_Tp>::type&&
+    move(_Tp&& __t) noexcept
+    { return static_cast<typename std::remove_reference<_Tp>::type&&>(__t); }
+
+
+  template<typename _Tp>
+    struct __move_if_noexcept_cond
+    : public __and_<__not_<is_nothrow_move_constructible<_Tp>>,
+                    is_copy_constructible<_Tp>>::type { };
+  template<typename _Tp>
+    constexpr typename
+    conditional<__move_if_noexcept_cond<_Tp>::value, const _Tp&, _Tp&&>::type
+    move_if_noexcept(_Tp& __x) noexcept
+    { return std::move(__x); }
+  template<typename _Tp>
+    inline _Tp*
+    addressof(_Tp& __r) noexcept
+    { return std::__addressof(__r); }
+
+
+
+  template<typename _Tp>
+    const _Tp* addressof(const _Tp&&) = delete;
+
+
+  template <typename _Tp, typename _Up = _Tp>
+    inline _Tp
+    __exchange(_Tp& __obj, _Up&& __new_val)
+    {
+      _Tp __old_val = std::move(__obj);
+      __obj = std::forward<_Up>(__new_val);
+      return __old_val;
+    }
+  template<typename _Tp>
+    inline
+
+    typename enable_if<__and_<__not_<__is_tuple_like<_Tp>>,
+         is_move_constructible<_Tp>,
+         is_move_assignable<_Tp>>::value>::type
+    swap(_Tp& __a, _Tp& __b)
+    noexcept(__and_<is_nothrow_move_constructible<_Tp>,
+             is_nothrow_move_assignable<_Tp>>::value)
+
+
+
+
+    {
+
+     
+
+      _Tp __tmp = std::move(__a);
+      __a = std::move(__b);
+      __b = std::move(__tmp);
+    }
+
+
+
+
+  template<typename _Tp, size_t _Nm>
+    inline
+
+    typename enable_if<__is_swappable<_Tp>::value>::type
+    swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
+    noexcept(__is_nothrow_swappable<_Tp>::value)
+
+
+
+
+    {
+      for (size_t __n = 0; __n < _Nm; ++__n)
+ swap(__a[__n], __b[__n]);
+    }
+
+
+
+}
+
+
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+  struct piecewise_construct_t { explicit piecewise_construct_t() = default; };
+
+
+  constexpr piecewise_construct_t piecewise_construct =
+    piecewise_construct_t();
+
+
+  template<typename...>
+    class tuple;
+
+  template<std::size_t...>
+    struct _Index_tuple;
+
+
+
+
+
+
+  template <bool, typename _T1, typename _T2>
+    struct _PCC
+    {
+      template <typename _U1, typename _U2>
+      static constexpr bool _ConstructiblePair()
+      {
+ return __and_<is_constructible<_T1, const _U1&>,
+        is_constructible<_T2, const _U2&>>::value;
+      }
+
+      template <typename _U1, typename _U2>
+      static constexpr bool _ImplicitlyConvertiblePair()
+      {
+ return __and_<is_convertible<const _U1&, _T1>,
+        is_convertible<const _U2&, _T2>>::value;
+      }
+
+      template <typename _U1, typename _U2>
+      static constexpr bool _MoveConstructiblePair()
+      {
+ return __and_<is_constructible<_T1, _U1&&>,
+        is_constructible<_T2, _U2&&>>::value;
+      }
+
+      template <typename _U1, typename _U2>
+      static constexpr bool _ImplicitlyMoveConvertiblePair()
+      {
+ return __and_<is_convertible<_U1&&, _T1>,
+        is_convertible<_U2&&, _T2>>::value;
+      }
+
+      template <bool __implicit, typename _U1, typename _U2>
+      static constexpr bool _CopyMovePair()
+      {
+ using __do_converts = __and_<is_convertible<const _U1&, _T1>,
+      is_convertible<_U2&&, _T2>>;
+ using __converts = typename conditional<__implicit,
+           __do_converts,
+           __not_<__do_converts>>::type;
+ return __and_<is_constructible<_T1, const _U1&>,
+        is_constructible<_T2, _U2&&>,
+        __converts
+        >::value;
+      }
+
+      template <bool __implicit, typename _U1, typename _U2>
+      static constexpr bool _MoveCopyPair()
+      {
+ using __do_converts = __and_<is_convertible<_U1&&, _T1>,
+      is_convertible<const _U2&, _T2>>;
+ using __converts = typename conditional<__implicit,
+           __do_converts,
+           __not_<__do_converts>>::type;
+ return __and_<is_constructible<_T1, _U1&&>,
+        is_constructible<_T2, const _U2&&>,
+        __converts
+        >::value;
+      }
+  };
+
+  template <typename _T1, typename _T2>
+    struct _PCC<false, _T1, _T2>
+    {
+      template <typename _U1, typename _U2>
+      static constexpr bool _ConstructiblePair()
+      {
+ return false;
+      }
+
+      template <typename _U1, typename _U2>
+      static constexpr bool _ImplicitlyConvertiblePair()
+      {
+ return false;
+      }
+
+      template <typename _U1, typename _U2>
+      static constexpr bool _MoveConstructiblePair()
+      {
+ return false;
+      }
+
+      template <typename _U1, typename _U2>
+      static constexpr bool _ImplicitlyMoveConvertiblePair()
+      {
+ return false;
+      }
+  };
+
+
+
+
+  struct __nonesuch_no_braces : std::__nonesuch {
+    explicit __nonesuch_no_braces(const __nonesuch&) = delete;
+  };
+  template<typename _T1, typename _T2>
+    struct pair
+    {
+      typedef _T1 first_type;
+      typedef _T2 second_type;
+
+      _T1 first;
+      _T2 second;
+
+
+
+
+
+
+      template <typename _U1 = _T1,
+                typename _U2 = _T2,
+                typename enable_if<__and_<
+                                     __is_implicitly_default_constructible<_U1>,
+                                     __is_implicitly_default_constructible<_U2>>
+                                   ::value, bool>::type = true>
+
+      constexpr pair()
+      : first(), second() { }
+
+
+      template <typename _U1 = _T1,
+                typename _U2 = _T2,
+                typename enable_if<__and_<
+                       is_default_constructible<_U1>,
+                       is_default_constructible<_U2>,
+                       __not_<
+                         __and_<__is_implicitly_default_constructible<_U1>,
+                                __is_implicitly_default_constructible<_U2>>>>
+                                   ::value, bool>::type = false>
+      explicit constexpr pair()
+      : first(), second() { }
+      using _PCCP = _PCC<true, _T1, _T2>;
+
+      template<typename _U1 = _T1, typename _U2=_T2, typename
+        enable_if<_PCCP::template
+      _ConstructiblePair<_U1, _U2>()
+                  && _PCCP::template
+      _ImplicitlyConvertiblePair<_U1, _U2>(),
+                         bool>::type=true>
+      constexpr pair(const _T1& __a, const _T2& __b)
+      : first(__a), second(__b) { }
+
+       template<typename _U1 = _T1, typename _U2=_T2, typename
+  enable_if<_PCCP::template
+       _ConstructiblePair<_U1, _U2>()
+                   && !_PCCP::template
+       _ImplicitlyConvertiblePair<_U1, _U2>(),
+                         bool>::type=false>
+      explicit constexpr pair(const _T1& __a, const _T2& __b)
+      : first(__a), second(__b) { }
+      template <typename _U1, typename _U2>
+        using _PCCFP = _PCC<!is_same<_T1, _U1>::value
+       || !is_same<_T2, _U2>::value,
+       _T1, _T2>;
+
+      template<typename _U1, typename _U2, typename
+        enable_if<_PCCFP<_U1, _U2>::template
+      _ConstructiblePair<_U1, _U2>()
+                  && _PCCFP<_U1, _U2>::template
+      _ImplicitlyConvertiblePair<_U1, _U2>(),
+     bool>::type=true>
+        constexpr pair(const pair<_U1, _U2>& __p)
+        : first(__p.first), second(__p.second) { }
+
+      template<typename _U1, typename _U2, typename
+        enable_if<_PCCFP<_U1, _U2>::template
+      _ConstructiblePair<_U1, _U2>()
+    && !_PCCFP<_U1, _U2>::template
+      _ImplicitlyConvertiblePair<_U1, _U2>(),
+                         bool>::type=false>
+ explicit constexpr pair(const pair<_U1, _U2>& __p)
+ : first(__p.first), second(__p.second) { }
+
+      constexpr pair(const pair&) = default;
+      constexpr pair(pair&&) = default;
+
+
+      template<typename _U1, typename
+        enable_if<_PCCP::template
+      _MoveCopyPair<true, _U1, _T2>(),
+                         bool>::type=true>
+       constexpr pair(_U1&& __x, const _T2& __y)
+       : first(std::forward<_U1>(__x)), second(__y) { }
+
+      template<typename _U1, typename
+        enable_if<_PCCP::template
+      _MoveCopyPair<false, _U1, _T2>(),
+                         bool>::type=false>
+       explicit constexpr pair(_U1&& __x, const _T2& __y)
+       : first(std::forward<_U1>(__x)), second(__y) { }
+
+      template<typename _U2, typename
+        enable_if<_PCCP::template
+      _CopyMovePair<true, _T1, _U2>(),
+                         bool>::type=true>
+       constexpr pair(const _T1& __x, _U2&& __y)
+       : first(__x), second(std::forward<_U2>(__y)) { }
+
+      template<typename _U2, typename
+        enable_if<_PCCP::template
+      _CopyMovePair<false, _T1, _U2>(),
+                         bool>::type=false>
+       explicit pair(const _T1& __x, _U2&& __y)
+       : first(__x), second(std::forward<_U2>(__y)) { }
+
+      template<typename _U1, typename _U2, typename
+        enable_if<_PCCP::template
+      _MoveConstructiblePair<_U1, _U2>()
+     && _PCCP::template
+      _ImplicitlyMoveConvertiblePair<_U1, _U2>(),
+                         bool>::type=true>
+ constexpr pair(_U1&& __x, _U2&& __y)
+ : first(std::forward<_U1>(__x)), second(std::forward<_U2>(__y)) { }
+
+      template<typename _U1, typename _U2, typename
+        enable_if<_PCCP::template
+      _MoveConstructiblePair<_U1, _U2>()
+     && !_PCCP::template
+      _ImplicitlyMoveConvertiblePair<_U1, _U2>(),
+                         bool>::type=false>
+ explicit constexpr pair(_U1&& __x, _U2&& __y)
+ : first(std::forward<_U1>(__x)), second(std::forward<_U2>(__y)) { }
+
+
+      template<typename _U1, typename _U2, typename
+        enable_if<_PCCFP<_U1, _U2>::template
+      _MoveConstructiblePair<_U1, _U2>()
+     && _PCCFP<_U1, _U2>::template
+      _ImplicitlyMoveConvertiblePair<_U1, _U2>(),
+                         bool>::type=true>
+ constexpr pair(pair<_U1, _U2>&& __p)
+ : first(std::forward<_U1>(__p.first)),
+   second(std::forward<_U2>(__p.second)) { }
+
+      template<typename _U1, typename _U2, typename
+        enable_if<_PCCFP<_U1, _U2>::template
+      _MoveConstructiblePair<_U1, _U2>()
+     && !_PCCFP<_U1, _U2>::template
+      _ImplicitlyMoveConvertiblePair<_U1, _U2>(),
+                         bool>::type=false>
+ explicit constexpr pair(pair<_U1, _U2>&& __p)
+ : first(std::forward<_U1>(__p.first)),
+   second(std::forward<_U2>(__p.second)) { }
+
+      template<typename... _Args1, typename... _Args2>
+        pair(piecewise_construct_t, tuple<_Args1...>, tuple<_Args2...>);
+
+      pair&
+      operator=(typename conditional<
+  __and_<is_copy_assignable<_T1>,
+         is_copy_assignable<_T2>>::value,
+  const pair&, const __nonesuch_no_braces&>::type __p)
+      {
+ first = __p.first;
+ second = __p.second;
+ return *this;
+      }
+
+      pair&
+      operator=(typename conditional<
+  __not_<__and_<is_copy_assignable<_T1>,
+                is_copy_assignable<_T2>>>::value,
+  const pair&, const __nonesuch_no_braces&>::type __p) = delete;
+
+      pair&
+      operator=(typename conditional<
+  __and_<is_move_assignable<_T1>,
+         is_move_assignable<_T2>>::value,
+  pair&&, __nonesuch_no_braces&&>::type __p)
+      noexcept(__and_<is_nothrow_move_assignable<_T1>,
+               is_nothrow_move_assignable<_T2>>::value)
+      {
+ first = std::forward<first_type>(__p.first);
+ second = std::forward<second_type>(__p.second);
+ return *this;
+      }
+
+      template<typename _U1, typename _U2>
+      typename enable_if<__and_<is_assignable<_T1&, const _U1&>,
+    is_assignable<_T2&, const _U2&>>::value,
+    pair&>::type
+ operator=(const pair<_U1, _U2>& __p)
+ {
+   first = __p.first;
+   second = __p.second;
+   return *this;
+ }
+
+      template<typename _U1, typename _U2>
+      typename enable_if<__and_<is_assignable<_T1&, _U1&&>,
+    is_assignable<_T2&, _U2&&>>::value,
+    pair&>::type
+ operator=(pair<_U1, _U2>&& __p)
+ {
+   first = std::forward<_U1>(__p.first);
+   second = std::forward<_U2>(__p.second);
+   return *this;
+ }
+
+      void
+      swap(pair& __p)
+      noexcept(__and_<__is_nothrow_swappable<_T1>,
+                      __is_nothrow_swappable<_T2>>::value)
+      {
+ using std::swap;
+ swap(first, __p.first);
+ swap(second, __p.second);
+      }
+
+    private:
+      template<typename... _Args1, std::size_t... _Indexes1,
+               typename... _Args2, std::size_t... _Indexes2>
+        pair(tuple<_Args1...>&, tuple<_Args2...>&,
+             _Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>);
+
+    };
+
+
+
+
+
+
+  template<typename _T1, typename _T2>
+    inline constexpr bool
+    operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
+    { return __x.first == __y.first && __x.second == __y.second; }
+
+
+  template<typename _T1, typename _T2>
+    inline constexpr bool
+    operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
+    { return __x.first < __y.first
+      || (!(__y.first < __x.first) && __x.second < __y.second); }
+
+
+  template<typename _T1, typename _T2>
+    inline constexpr bool
+    operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
+    { return !(__x == __y); }
+
+
+  template<typename _T1, typename _T2>
+    inline constexpr bool
+    operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
+    { return __y < __x; }
+
+
+  template<typename _T1, typename _T2>
+    inline constexpr bool
+    operator<=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
+    { return !(__y < __x); }
+
+
+  template<typename _T1, typename _T2>
+    inline constexpr bool
+    operator>=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
+    { return !(__x < __y); }
+
+
+
+
+
+  template<typename _T1, typename _T2>
+    inline
+
+
+
+
+
+    void
+
+    swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y)
+    noexcept(noexcept(__x.swap(__y)))
+    { __x.swap(__y); }
+  template<typename _T1, typename _T2>
+    constexpr pair<typename __decay_and_strip<_T1>::__type,
+                   typename __decay_and_strip<_T2>::__type>
+    make_pair(_T1&& __x, _T2&& __y)
+    {
+      typedef typename __decay_and_strip<_T1>::__type __ds_type1;
+      typedef typename __decay_and_strip<_T2>::__type __ds_type2;
+      typedef pair<__ds_type1, __ds_type2> __pair_type;
+      return __pair_type(std::forward<_T1>(__x), std::forward<_T2>(__y));
+    }
+
+}
+
+
+
+
+
+       
+
+
+
+
+
+
+
+
+namespace std
+{
+
+  template<class _E>
+    class initializer_list
+    {
+    public:
+      typedef _E value_type;
+      typedef const _E& reference;
+      typedef const _E& const_reference;
+      typedef size_t size_type;
+      typedef const _E* iterator;
+      typedef const _E* const_iterator;
+
+    private:
+      iterator _M_array;
+      size_type _M_len;
+
+
+      constexpr initializer_list(const_iterator __a, size_type __l)
+      : _M_array(__a), _M_len(__l) { }
+
+    public:
+      constexpr initializer_list() noexcept
+      : _M_array(0), _M_len(0) { }
+
+
+      constexpr size_type
+      size() const noexcept { return _M_len; }
+
+
+      constexpr const_iterator
+      begin() const noexcept { return _M_array; }
+
+
+      constexpr const_iterator
+      end() const noexcept { return begin() + size(); }
+    };
+
+
+
+
+
+
+  template<class _Tp>
+    constexpr const _Tp*
+    begin(initializer_list<_Tp> __ils) noexcept
+    { return __ils.begin(); }
+
+
+
+
+
+
+  template<class _Tp>
+    constexpr const _Tp*
+    end(initializer_list<_Tp> __ils) noexcept
+    { return __ils.end(); }
+}
+
+
+
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+  template<typename _Tp>
+    struct tuple_size;
+
+
+
+
+
+  template<typename _Tp,
+    typename _Up = typename remove_cv<_Tp>::type,
+    typename = typename enable_if<is_same<_Tp, _Up>::value>::type,
+    size_t = tuple_size<_Tp>::value>
+    using __enable_if_has_tuple_size = _Tp;
+
+  template<typename _Tp>
+    struct tuple_size<const __enable_if_has_tuple_size<_Tp>>
+    : public tuple_size<_Tp> { };
+
+  template<typename _Tp>
+    struct tuple_size<volatile __enable_if_has_tuple_size<_Tp>>
+    : public tuple_size<_Tp> { };
+
+  template<typename _Tp>
+    struct tuple_size<const volatile __enable_if_has_tuple_size<_Tp>>
+    : public tuple_size<_Tp> { };
+
+
+  template<std::size_t __i, typename _Tp>
+    struct tuple_element;
+
+
+  template<std::size_t __i, typename _Tp>
+    using __tuple_element_t = typename tuple_element<__i, _Tp>::type;
+
+  template<std::size_t __i, typename _Tp>
+    struct tuple_element<__i, const _Tp>
+    {
+      typedef typename add_const<__tuple_element_t<__i, _Tp>>::type type;
+    };
+
+  template<std::size_t __i, typename _Tp>
+    struct tuple_element<__i, volatile _Tp>
+    {
+      typedef typename add_volatile<__tuple_element_t<__i, _Tp>>::type type;
+    };
+
+  template<std::size_t __i, typename _Tp>
+    struct tuple_element<__i, const volatile _Tp>
+    {
+      typedef typename add_cv<__tuple_element_t<__i, _Tp>>::type type;
+    };
+  template<typename _T1, typename _T2>
+    struct __is_tuple_like_impl<std::pair<_T1, _T2>> : true_type
+    { };
+
+
+  template<class _Tp1, class _Tp2>
+    struct tuple_size<std::pair<_Tp1, _Tp2>>
+    : public integral_constant<std::size_t, 2> { };
+
+
+  template<class _Tp1, class _Tp2>
+    struct tuple_element<0, std::pair<_Tp1, _Tp2>>
+    { typedef _Tp1 type; };
+
+
+  template<class _Tp1, class _Tp2>
+    struct tuple_element<1, std::pair<_Tp1, _Tp2>>
+    { typedef _Tp2 type; };
+
+  template<std::size_t _Int>
+    struct __pair_get;
+
+  template<>
+    struct __pair_get<0>
+    {
+      template<typename _Tp1, typename _Tp2>
+        static constexpr _Tp1&
+        __get(std::pair<_Tp1, _Tp2>& __pair) noexcept
+        { return __pair.first; }
+
+      template<typename _Tp1, typename _Tp2>
+        static constexpr _Tp1&&
+        __move_get(std::pair<_Tp1, _Tp2>&& __pair) noexcept
+        { return std::forward<_Tp1>(__pair.first); }
+
+      template<typename _Tp1, typename _Tp2>
+        static constexpr const _Tp1&
+        __const_get(const std::pair<_Tp1, _Tp2>& __pair) noexcept
+        { return __pair.first; }
+
+      template<typename _Tp1, typename _Tp2>
+        static constexpr const _Tp1&&
+        __const_move_get(const std::pair<_Tp1, _Tp2>&& __pair) noexcept
+        { return std::forward<const _Tp1>(__pair.first); }
+    };
+
+  template<>
+    struct __pair_get<1>
+    {
+      template<typename _Tp1, typename _Tp2>
+        static constexpr _Tp2&
+        __get(std::pair<_Tp1, _Tp2>& __pair) noexcept
+        { return __pair.second; }
+
+      template<typename _Tp1, typename _Tp2>
+        static constexpr _Tp2&&
+        __move_get(std::pair<_Tp1, _Tp2>&& __pair) noexcept
+        { return std::forward<_Tp2>(__pair.second); }
+
+      template<typename _Tp1, typename _Tp2>
+        static constexpr const _Tp2&
+        __const_get(const std::pair<_Tp1, _Tp2>& __pair) noexcept
+        { return __pair.second; }
+
+      template<typename _Tp1, typename _Tp2>
+        static constexpr const _Tp2&&
+        __const_move_get(const std::pair<_Tp1, _Tp2>&& __pair) noexcept
+        { return std::forward<const _Tp2>(__pair.second); }
+    };
+
+  template<std::size_t _Int, class _Tp1, class _Tp2>
+    constexpr typename tuple_element<_Int, std::pair<_Tp1, _Tp2>>::type&
+    get(std::pair<_Tp1, _Tp2>& __in) noexcept
+    { return __pair_get<_Int>::__get(__in); }
+
+  template<std::size_t _Int, class _Tp1, class _Tp2>
+    constexpr typename tuple_element<_Int, std::pair<_Tp1, _Tp2>>::type&&
+    get(std::pair<_Tp1, _Tp2>&& __in) noexcept
+    { return __pair_get<_Int>::__move_get(std::move(__in)); }
+
+  template<std::size_t _Int, class _Tp1, class _Tp2>
+    constexpr const typename tuple_element<_Int, std::pair<_Tp1, _Tp2>>::type&
+    get(const std::pair<_Tp1, _Tp2>& __in) noexcept
+    { return __pair_get<_Int>::__const_get(__in); }
+
+  template<std::size_t _Int, class _Tp1, class _Tp2>
+    constexpr const typename tuple_element<_Int, std::pair<_Tp1, _Tp2>>::type&&
+    get(const std::pair<_Tp1, _Tp2>&& __in) noexcept
+    { return __pair_get<_Int>::__const_move_get(std::move(__in)); }
+  template<size_t... _Indexes> struct _Index_tuple { };
+  template<size_t _Num>
+    struct _Build_index_tuple
+    {
+
+
+
+
+
+
+      using __type = _Index_tuple<__integer_pack(_Num)...>;
+
+    };
+
+}
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+  void
+  __throw_bad_exception(void) __attribute__((__noreturn__));
+
+
+  void
+  __throw_bad_alloc(void) __attribute__((__noreturn__));
+
+
+  void
+  __throw_bad_cast(void) __attribute__((__noreturn__));
+
+  void
+  __throw_bad_typeid(void) __attribute__((__noreturn__));
+
+
+  void
+  __throw_logic_error(const char*) __attribute__((__noreturn__));
+
+  void
+  __throw_domain_error(const char*) __attribute__((__noreturn__));
+
+  void
+  __throw_invalid_argument(const char*) __attribute__((__noreturn__));
+
+  void
+  __throw_length_error(const char*) __attribute__((__noreturn__));
+
+  void
+  __throw_out_of_range(const char*) __attribute__((__noreturn__));
+
+  void
+  __throw_out_of_range_fmt(const char*, ...) __attribute__((__noreturn__))
+    __attribute__((__format__(__gnu_printf__, 1, 2)));
+
+  void
+  __throw_runtime_error(const char*) __attribute__((__noreturn__));
+
+  void
+  __throw_range_error(const char*) __attribute__((__noreturn__));
+
+  void
+  __throw_overflow_error(const char*) __attribute__((__noreturn__));
+
+  void
+  __throw_underflow_error(const char*) __attribute__((__noreturn__));
+
+
+  void
+  __throw_ios_failure(const char*) __attribute__((__noreturn__));
+
+  void
+  __throw_system_error(int) __attribute__((__noreturn__));
+
+  void
+  __throw_future_error(int) __attribute__((__noreturn__));
+
+
+  void
+  __throw_bad_function_call() __attribute__((__noreturn__));
+
+
+}
+
+
+       
+
+
+
+
+namespace __gnu_cxx __attribute__ ((__visibility__ ("default")))
+{
+
+  template<typename _Value>
+    struct __numeric_traits_integer
+    {
+
+      static const _Value __min = (((_Value)(-1) < 0) ? (_Value)1 << (sizeof(_Value) * 8 - ((_Value)(-1) < 0)) : (_Value)0);
+      static const _Value __max = (((_Value)(-1) < 0) ? (((((_Value)1 << ((sizeof(_Value) * 8 - ((_Value)(-1) < 0)) - 1)) - 1) << 1) + 1) : ~(_Value)0);
+
+
+
+      static const bool __is_signed = ((_Value)(-1) < 0);
+      static const int __digits = (sizeof(_Value) * 8 - ((_Value)(-1) < 0));
+    };
+
+  template<typename _Value>
+    const _Value __numeric_traits_integer<_Value>::__min;
+
+  template<typename _Value>
+    const _Value __numeric_traits_integer<_Value>::__max;
+
+  template<typename _Value>
+    const bool __numeric_traits_integer<_Value>::__is_signed;
+
+  template<typename _Value>
+    const int __numeric_traits_integer<_Value>::__digits;
+  template<typename _Value>
+    struct __numeric_traits_floating
+    {
+
+      static const int __max_digits10 = (2 + (std::__are_same<_Value, float>::__value ? 24 : std::__are_same<_Value, double>::__value ? 53 : 106) * 643L / 2136);
+
+
+      static const bool __is_signed = true;
+      static const int __digits10 = (std::__are_same<_Value, float>::__value ? 6 : std::__are_same<_Value, double>::__value ? 15 : 31);
+      static const int __max_exponent10 = (std::__are_same<_Value, float>::__value ? 38 : std::__are_same<_Value, double>::__value ? 308 : 308);
+    };
+
+  template<typename _Value>
+    const int __numeric_traits_floating<_Value>::__max_digits10;
+
+  template<typename _Value>
+    const bool __numeric_traits_floating<_Value>::__is_signed;
+
+  template<typename _Value>
+    const int __numeric_traits_floating<_Value>::__digits10;
+
+  template<typename _Value>
+    const int __numeric_traits_floating<_Value>::__max_exponent10;
+
+  template<typename _Value>
+    struct __numeric_traits
+    : public __conditional_type<std::__is_integer<_Value>::__value,
+    __numeric_traits_integer<_Value>,
+    __numeric_traits_floating<_Value> >::__type
+    { };
+
+
+}
+
+       
+
+
+
+
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+  struct input_iterator_tag { };
+
+
+  struct output_iterator_tag { };
+
+
+  struct forward_iterator_tag : public input_iterator_tag { };
+
+
+
+  struct bidirectional_iterator_tag : public forward_iterator_tag { };
+
+
+
+  struct random_access_iterator_tag : public bidirectional_iterator_tag { };
+  template<typename _Category, typename _Tp, typename _Distance = ptrdiff_t,
+           typename _Pointer = _Tp*, typename _Reference = _Tp&>
+    struct iterator
+    {
+
+      typedef _Category iterator_category;
+
+      typedef _Tp value_type;
+
+      typedef _Distance difference_type;
+
+      typedef _Pointer pointer;
+
+      typedef _Reference reference;
+    };
+  template<typename _Iterator, typename = __void_t<>>
+    struct __iterator_traits { };
+
+  template<typename _Iterator>
+    struct __iterator_traits<_Iterator,
+        __void_t<typename _Iterator::iterator_category,
+          typename _Iterator::value_type,
+          typename _Iterator::difference_type,
+          typename _Iterator::pointer,
+          typename _Iterator::reference>>
+    {
+      typedef typename _Iterator::iterator_category iterator_category;
+      typedef typename _Iterator::value_type value_type;
+      typedef typename _Iterator::difference_type difference_type;
+      typedef typename _Iterator::pointer pointer;
+      typedef typename _Iterator::reference reference;
+    };
+
+  template<typename _Iterator>
+    struct iterator_traits
+    : public __iterator_traits<_Iterator> { };
+  template<typename _Tp>
+    struct iterator_traits<_Tp*>
+    {
+      typedef random_access_iterator_tag iterator_category;
+      typedef _Tp value_type;
+      typedef ptrdiff_t difference_type;
+      typedef _Tp* pointer;
+      typedef _Tp& reference;
+    };
+
+
+  template<typename _Tp>
+    struct iterator_traits<const _Tp*>
+    {
+      typedef random_access_iterator_tag iterator_category;
+      typedef _Tp value_type;
+      typedef ptrdiff_t difference_type;
+      typedef const _Tp* pointer;
+      typedef const _Tp& reference;
+    };
+
+
+
+
+
+  template<typename _Iter>
+    inline constexpr
+    typename iterator_traits<_Iter>::iterator_category
+    __iterator_category(const _Iter&)
+    { return typename iterator_traits<_Iter>::iterator_category(); }
+  template<typename _InIter>
+    using _RequireInputIter = typename
+      enable_if<is_convertible<typename
+  iterator_traits<_InIter>::iterator_category,
+          input_iterator_tag>::value>::type;
+
+
+
+}
+       
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+
+  template <typename> struct _List_iterator;
+  template <typename> struct _List_const_iterator;
+
+
+  template<typename _InputIterator>
+    inline
+    typename iterator_traits<_InputIterator>::difference_type
+    __distance(_InputIterator __first, _InputIterator __last,
+               input_iterator_tag)
+    {
+
+     
+
+      typename iterator_traits<_InputIterator>::difference_type __n = 0;
+      while (__first != __last)
+ {
+   ++__first;
+   ++__n;
+ }
+      return __n;
+    }
+
+  template<typename _RandomAccessIterator>
+    inline
+    typename iterator_traits<_RandomAccessIterator>::difference_type
+    __distance(_RandomAccessIterator __first, _RandomAccessIterator __last,
+               random_access_iterator_tag)
+    {
+
+     
+
+      return __last - __first;
+    }
+
+
+
+  template<typename _Tp>
+    ptrdiff_t
+    __distance(std::_List_iterator<_Tp>,
+        std::_List_iterator<_Tp>,
+        input_iterator_tag);
+
+  template<typename _Tp>
+    ptrdiff_t
+    __distance(std::_List_const_iterator<_Tp>,
+        std::_List_const_iterator<_Tp>,
+        input_iterator_tag);
+  template<typename _InputIterator>
+    inline
+    typename iterator_traits<_InputIterator>::difference_type
+    distance(_InputIterator __first, _InputIterator __last)
+    {
+
+      return std::__distance(__first, __last,
+        std::__iterator_category(__first));
+    }
+
+  template<typename _InputIterator, typename _Distance>
+    inline void
+    __advance(_InputIterator& __i, _Distance __n, input_iterator_tag)
+    {
+
+     
+      ;
+      while (__n--)
+ ++__i;
+    }
+
+  template<typename _BidirectionalIterator, typename _Distance>
+    inline void
+    __advance(_BidirectionalIterator& __i, _Distance __n,
+       bidirectional_iterator_tag)
+    {
+
+     
+
+      if (__n > 0)
+        while (__n--)
+   ++__i;
+      else
+        while (__n++)
+   --__i;
+    }
+
+  template<typename _RandomAccessIterator, typename _Distance>
+    inline void
+    __advance(_RandomAccessIterator& __i, _Distance __n,
+              random_access_iterator_tag)
+    {
+
+     
+
+      if (__builtin_constant_p(__n) && __n == 1)
+ ++__i;
+      else if (__builtin_constant_p(__n) && __n == -1)
+ --__i;
+      else
+ __i += __n;
+    }
+  template<typename _InputIterator, typename _Distance>
+    inline void
+    advance(_InputIterator& __i, _Distance __n)
+    {
+
+      typename iterator_traits<_InputIterator>::difference_type __d = __n;
+      std::__advance(__i, __d, std::__iterator_category(__i));
+    }
+
+
+
+  template<typename _InputIterator>
+    inline _InputIterator
+    next(_InputIterator __x, typename
+  iterator_traits<_InputIterator>::difference_type __n = 1)
+    {
+
+     
+      std::advance(__x, __n);
+      return __x;
+    }
+
+  template<typename _BidirectionalIterator>
+    inline _BidirectionalIterator
+    prev(_BidirectionalIterator __x, typename
+  iterator_traits<_BidirectionalIterator>::difference_type __n = 1)
+    {
+
+     
+
+      std::advance(__x, -__n);
+      return __x;
+    }
+
+
+
+
+}
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+  class __undefined;
+
+
+  template<typename _Tp>
+    struct __get_first_arg
+    { using type = __undefined; };
+
+  template<template<typename, typename...> class _Template, typename _Tp,
+           typename... _Types>
+    struct __get_first_arg<_Template<_Tp, _Types...>>
+    { using type = _Tp; };
+
+  template<typename _Tp>
+    using __get_first_arg_t = typename __get_first_arg<_Tp>::type;
+
+
+  template<typename _Tp, typename _Up>
+    struct __replace_first_arg
+    { };
+
+  template<template<typename, typename...> class _Template, typename _Up,
+           typename _Tp, typename... _Types>
+    struct __replace_first_arg<_Template<_Tp, _Types...>, _Up>
+    { using type = _Template<_Up, _Types...>; };
+
+  template<typename _Tp, typename _Up>
+    using __replace_first_arg_t = typename __replace_first_arg<_Tp, _Up>::type;
+
+  template<typename _Tp>
+    using __make_not_void
+      = typename conditional<is_void<_Tp>::value, __undefined, _Tp>::type;
+
+
+
+
+
+  template<typename _Ptr>
+    struct pointer_traits
+    {
+    private:
+      template<typename _Tp>
+ using __element_type = typename _Tp::element_type;
+
+      template<typename _Tp>
+ using __difference_type = typename _Tp::difference_type;
+
+      template<typename _Tp, typename _Up, typename = void>
+ struct __rebind : __replace_first_arg<_Tp, _Up> { };
+
+      template<typename _Tp, typename _Up>
+ struct __rebind<_Tp, _Up, __void_t<typename _Tp::template rebind<_Up>>>
+ { using type = typename _Tp::template rebind<_Up>; };
+
+    public:
+
+      using pointer = _Ptr;
+
+
+      using element_type
+ = __detected_or_t<__get_first_arg_t<_Ptr>, __element_type, _Ptr>;
+
+
+      using difference_type
+ = __detected_or_t<ptrdiff_t, __difference_type, _Ptr>;
+
+
+      template<typename _Up>
+        using rebind = typename __rebind<_Ptr, _Up>::type;
+
+      static _Ptr
+      pointer_to(__make_not_void<element_type>& __e)
+      { return _Ptr::pointer_to(__e); }
+
+      static_assert(!is_same<element_type, __undefined>::value,
+   "pointer type defines element_type or is like SomePointer<T, Args>");
+    };
+
+
+
+
+
+  template<typename _Tp>
+    struct pointer_traits<_Tp*>
+    {
+
+      typedef _Tp* pointer;
+
+      typedef _Tp element_type;
+
+      typedef ptrdiff_t difference_type;
+
+      template<typename _Up>
+        using rebind = _Up*;
+
+
+
+
+
+
+      static pointer
+      pointer_to(__make_not_void<element_type>& __r) noexcept
+      { return std::addressof(__r); }
+    };
+
+
+  template<typename _Ptr, typename _Tp>
+    using __ptr_rebind = typename pointer_traits<_Ptr>::template rebind<_Tp>;
+
+  template<typename _Tp>
+    constexpr _Tp*
+    __to_address(_Tp* __ptr) noexcept
+    {
+      static_assert(!std::is_function<_Tp>::value, "not a function pointer");
+      return __ptr;
+    }
+
+
+  template<typename _Ptr>
+    constexpr typename std::pointer_traits<_Ptr>::element_type*
+    __to_address(const _Ptr& __ptr)
+    { return std::__to_address(__ptr.operator->()); }
+
+}
+
+
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+  template<typename _Iterator>
+    class reverse_iterator
+    : public iterator<typename iterator_traits<_Iterator>::iterator_category,
+        typename iterator_traits<_Iterator>::value_type,
+        typename iterator_traits<_Iterator>::difference_type,
+        typename iterator_traits<_Iterator>::pointer,
+                      typename iterator_traits<_Iterator>::reference>
+    {
+    protected:
+      _Iterator current;
+
+      typedef iterator_traits<_Iterator> __traits_type;
+
+    public:
+      typedef _Iterator iterator_type;
+      typedef typename __traits_type::difference_type difference_type;
+      typedef typename __traits_type::pointer pointer;
+      typedef typename __traits_type::reference reference;
+
+
+
+
+
+
+
+     
+      reverse_iterator() : current() { }
+
+
+
+
+      explicit
+      reverse_iterator(iterator_type __x) : current(__x) { }
+
+
+
+
+     
+      reverse_iterator(const reverse_iterator& __x)
+      : current(__x.current) { }
+
+
+
+
+
+      template<typename _Iter>
+
+        reverse_iterator(const reverse_iterator<_Iter>& __x)
+ : current(__x.base()) { }
+
+
+
+
+      iterator_type
+      base() const
+      { return current; }
+      reference
+      operator*() const
+      {
+ _Iterator __tmp = current;
+ return *--__tmp;
+      }
+
+
+
+
+
+
+      pointer
+      operator->() const
+      { return &(operator*()); }
+
+
+
+
+
+
+      reverse_iterator&
+      operator++()
+      {
+ --current;
+ return *this;
+      }
+
+
+
+
+
+
+      reverse_iterator
+      operator++(int)
+      {
+ reverse_iterator __tmp = *this;
+ --current;
+ return __tmp;
+      }
+
+
+
+
+
+
+      reverse_iterator&
+      operator--()
+      {
+ ++current;
+ return *this;
+      }
+
+
+
+
+
+
+      reverse_iterator
+      operator--(int)
+      {
+ reverse_iterator __tmp = *this;
+ ++current;
+ return __tmp;
+      }
+
+
+
+
+
+
+      reverse_iterator
+      operator+(difference_type __n) const
+      { return reverse_iterator(current - __n); }
+
+
+
+
+
+
+
+      reverse_iterator&
+      operator+=(difference_type __n)
+      {
+ current -= __n;
+ return *this;
+      }
+
+
+
+
+
+
+      reverse_iterator
+      operator-(difference_type __n) const
+      { return reverse_iterator(current + __n); }
+
+
+
+
+
+
+
+      reverse_iterator&
+      operator-=(difference_type __n)
+      {
+ current += __n;
+ return *this;
+      }
+
+
+
+
+
+
+      reference
+      operator[](difference_type __n) const
+      { return *(*this + __n); }
+    };
+  template<typename _Iterator>
+    inline bool
+    operator==(const reverse_iterator<_Iterator>& __x,
+        const reverse_iterator<_Iterator>& __y)
+    { return __x.base() == __y.base(); }
+
+  template<typename _Iterator>
+    inline bool
+    operator<(const reverse_iterator<_Iterator>& __x,
+       const reverse_iterator<_Iterator>& __y)
+    { return __y.base() < __x.base(); }
+
+  template<typename _Iterator>
+    inline bool
+    operator!=(const reverse_iterator<_Iterator>& __x,
+        const reverse_iterator<_Iterator>& __y)
+    { return !(__x == __y); }
+
+  template<typename _Iterator>
+    inline bool
+    operator>(const reverse_iterator<_Iterator>& __x,
+       const reverse_iterator<_Iterator>& __y)
+    { return __y < __x; }
+
+  template<typename _Iterator>
+    inline bool
+    operator<=(const reverse_iterator<_Iterator>& __x,
+        const reverse_iterator<_Iterator>& __y)
+    { return !(__y < __x); }
+
+  template<typename _Iterator>
+    inline bool
+    operator>=(const reverse_iterator<_Iterator>& __x,
+        const reverse_iterator<_Iterator>& __y)
+    { return !(__x < __y); }
+
+
+
+  template<typename _IteratorL, typename _IteratorR>
+    inline bool
+    operator==(const reverse_iterator<_IteratorL>& __x,
+        const reverse_iterator<_IteratorR>& __y)
+    { return __x.base() == __y.base(); }
+
+  template<typename _IteratorL, typename _IteratorR>
+    inline bool
+    operator<(const reverse_iterator<_IteratorL>& __x,
+       const reverse_iterator<_IteratorR>& __y)
+    { return __y.base() < __x.base(); }
+
+  template<typename _IteratorL, typename _IteratorR>
+    inline bool
+    operator!=(const reverse_iterator<_IteratorL>& __x,
+        const reverse_iterator<_IteratorR>& __y)
+    { return !(__x == __y); }
+
+  template<typename _IteratorL, typename _IteratorR>
+    inline bool
+    operator>(const reverse_iterator<_IteratorL>& __x,
+       const reverse_iterator<_IteratorR>& __y)
+    { return __y < __x; }
+
+  template<typename _IteratorL, typename _IteratorR>
+    inline bool
+    operator<=(const reverse_iterator<_IteratorL>& __x,
+        const reverse_iterator<_IteratorR>& __y)
+    { return !(__y < __x); }
+
+  template<typename _IteratorL, typename _IteratorR>
+    inline bool
+    operator>=(const reverse_iterator<_IteratorL>& __x,
+        const reverse_iterator<_IteratorR>& __y)
+    { return !(__x < __y); }
+  template<typename _IteratorL, typename _IteratorR>
+    inline auto
+    operator-(const reverse_iterator<_IteratorL>& __x,
+       const reverse_iterator<_IteratorR>& __y)
+    -> decltype(__y.base() - __x.base())
+    { return __y.base() - __x.base(); }
+
+
+  template<typename _Iterator>
+    inline reverse_iterator<_Iterator>
+    operator+(typename reverse_iterator<_Iterator>::difference_type __n,
+       const reverse_iterator<_Iterator>& __x)
+    { return reverse_iterator<_Iterator>(__x.base() - __n); }
+
+
+
+  template<typename _Iterator>
+    inline reverse_iterator<_Iterator>
+    __make_reverse_iterator(_Iterator __i)
+    { return reverse_iterator<_Iterator>(__i); }
+  template<typename _Iterator>
+    auto
+    __niter_base(reverse_iterator<_Iterator> __it)
+    -> decltype(__make_reverse_iterator(__niter_base(__it.base())))
+    { return __make_reverse_iterator(__niter_base(__it.base())); }
+
+  template<typename _Iterator>
+    struct __is_move_iterator<reverse_iterator<_Iterator> >
+      : __is_move_iterator<_Iterator>
+    { };
+
+  template<typename _Iterator>
+    auto
+    __miter_base(reverse_iterator<_Iterator> __it)
+    -> decltype(__make_reverse_iterator(__miter_base(__it.base())))
+    { return __make_reverse_iterator(__miter_base(__it.base())); }
+  template<typename _Container>
+    class back_insert_iterator
+    : public iterator<output_iterator_tag, void, void, void, void>
+    {
+    protected:
+      _Container* container;
+
+    public:
+
+      typedef _Container container_type;
+
+
+      explicit
+      back_insert_iterator(_Container& __x)
+      : container(std::__addressof(__x)) { }
+      back_insert_iterator&
+      operator=(const typename _Container::value_type& __value)
+      {
+ container->push_back(__value);
+ return *this;
+      }
+
+      back_insert_iterator&
+      operator=(typename _Container::value_type&& __value)
+      {
+ container->push_back(std::move(__value));
+ return *this;
+      }
+
+
+
+      back_insert_iterator&
+      operator*()
+      { return *this; }
+
+
+      back_insert_iterator&
+      operator++()
+      { return *this; }
+
+
+      back_insert_iterator
+      operator++(int)
+      { return *this; }
+    };
+  template<typename _Container>
+    inline back_insert_iterator<_Container>
+    back_inserter(_Container& __x)
+    { return back_insert_iterator<_Container>(__x); }
+  template<typename _Container>
+    class front_insert_iterator
+    : public iterator<output_iterator_tag, void, void, void, void>
+    {
+    protected:
+      _Container* container;
+
+    public:
+
+      typedef _Container container_type;
+
+
+      explicit front_insert_iterator(_Container& __x)
+      : container(std::__addressof(__x)) { }
+      front_insert_iterator&
+      operator=(const typename _Container::value_type& __value)
+      {
+ container->push_front(__value);
+ return *this;
+      }
+
+      front_insert_iterator&
+      operator=(typename _Container::value_type&& __value)
+      {
+ container->push_front(std::move(__value));
+ return *this;
+      }
+
+
+
+      front_insert_iterator&
+      operator*()
+      { return *this; }
+
+
+      front_insert_iterator&
+      operator++()
+      { return *this; }
+
+
+      front_insert_iterator
+      operator++(int)
+      { return *this; }
+    };
+  template<typename _Container>
+    inline front_insert_iterator<_Container>
+    front_inserter(_Container& __x)
+    { return front_insert_iterator<_Container>(__x); }
+  template<typename _Container>
+    class insert_iterator
+    : public iterator<output_iterator_tag, void, void, void, void>
+    {
+    protected:
+      _Container* container;
+      typename _Container::iterator iter;
+
+    public:
+
+      typedef _Container container_type;
+
+
+
+
+
+      insert_iterator(_Container& __x, typename _Container::iterator __i)
+      : container(std::__addressof(__x)), iter(__i) {}
+      insert_iterator&
+      operator=(const typename _Container::value_type& __value)
+      {
+ iter = container->insert(iter, __value);
+ ++iter;
+ return *this;
+      }
+
+      insert_iterator&
+      operator=(typename _Container::value_type&& __value)
+      {
+ iter = container->insert(iter, std::move(__value));
+ ++iter;
+ return *this;
+      }
+
+
+
+      insert_iterator&
+      operator*()
+      { return *this; }
+
+
+      insert_iterator&
+      operator++()
+      { return *this; }
+
+
+      insert_iterator&
+      operator++(int)
+      { return *this; }
+    };
+  template<typename _Container, typename _Iterator>
+    inline insert_iterator<_Container>
+    inserter(_Container& __x, _Iterator __i)
+    {
+      return insert_iterator<_Container>(__x,
+      typename _Container::iterator(__i));
+    }
+
+
+
+
+}
+
+namespace __gnu_cxx __attribute__ ((__visibility__ ("default")))
+{
+
+  using std::iterator_traits;
+  using std::iterator;
+  template<typename _Iterator, typename _Container>
+    class __normal_iterator
+    {
+    protected:
+      _Iterator _M_current;
+
+      typedef iterator_traits<_Iterator> __traits_type;
+
+    public:
+      typedef _Iterator iterator_type;
+      typedef typename __traits_type::iterator_category iterator_category;
+      typedef typename __traits_type::value_type value_type;
+      typedef typename __traits_type::difference_type difference_type;
+      typedef typename __traits_type::reference reference;
+      typedef typename __traits_type::pointer pointer;
+
+      constexpr __normal_iterator() noexcept
+      : _M_current(_Iterator()) { }
+
+      explicit
+      __normal_iterator(const _Iterator& __i) noexcept
+      : _M_current(__i) { }
+
+
+      template<typename _Iter>
+        __normal_iterator(const __normal_iterator<_Iter,
+     typename __enable_if<
+              (std::__are_same<_Iter, typename _Container::pointer>::__value),
+        _Container>::__type>& __i) noexcept
+        : _M_current(__i.base()) { }
+
+
+      reference
+      operator*() const noexcept
+      { return *_M_current; }
+
+      pointer
+      operator->() const noexcept
+      { return _M_current; }
+
+      __normal_iterator&
+      operator++() noexcept
+      {
+ ++_M_current;
+ return *this;
+      }
+
+      __normal_iterator
+      operator++(int) noexcept
+      { return __normal_iterator(_M_current++); }
+
+
+      __normal_iterator&
+      operator--() noexcept
+      {
+ --_M_current;
+ return *this;
+      }
+
+      __normal_iterator
+      operator--(int) noexcept
+      { return __normal_iterator(_M_current--); }
+
+
+      reference
+      operator[](difference_type __n) const noexcept
+      { return _M_current[__n]; }
+
+      __normal_iterator&
+      operator+=(difference_type __n) noexcept
+      { _M_current += __n; return *this; }
+
+      __normal_iterator
+      operator+(difference_type __n) const noexcept
+      { return __normal_iterator(_M_current + __n); }
+
+      __normal_iterator&
+      operator-=(difference_type __n) noexcept
+      { _M_current -= __n; return *this; }
+
+      __normal_iterator
+      operator-(difference_type __n) const noexcept
+      { return __normal_iterator(_M_current - __n); }
+
+      const _Iterator&
+      base() const noexcept
+      { return _M_current; }
+    };
+  template<typename _IteratorL, typename _IteratorR, typename _Container>
+    inline bool
+    operator==(const __normal_iterator<_IteratorL, _Container>& __lhs,
+        const __normal_iterator<_IteratorR, _Container>& __rhs)
+    noexcept
+    { return __lhs.base() == __rhs.base(); }
+
+  template<typename _Iterator, typename _Container>
+    inline bool
+    operator==(const __normal_iterator<_Iterator, _Container>& __lhs,
+        const __normal_iterator<_Iterator, _Container>& __rhs)
+    noexcept
+    { return __lhs.base() == __rhs.base(); }
+
+  template<typename _IteratorL, typename _IteratorR, typename _Container>
+    inline bool
+    operator!=(const __normal_iterator<_IteratorL, _Container>& __lhs,
+        const __normal_iterator<_IteratorR, _Container>& __rhs)
+    noexcept
+    { return __lhs.base() != __rhs.base(); }
+
+  template<typename _Iterator, typename _Container>
+    inline bool
+    operator!=(const __normal_iterator<_Iterator, _Container>& __lhs,
+        const __normal_iterator<_Iterator, _Container>& __rhs)
+    noexcept
+    { return __lhs.base() != __rhs.base(); }
+
+
+  template<typename _IteratorL, typename _IteratorR, typename _Container>
+    inline bool
+    operator<(const __normal_iterator<_IteratorL, _Container>& __lhs,
+       const __normal_iterator<_IteratorR, _Container>& __rhs)
+    noexcept
+    { return __lhs.base() < __rhs.base(); }
+
+  template<typename _Iterator, typename _Container>
+    inline bool
+    operator<(const __normal_iterator<_Iterator, _Container>& __lhs,
+       const __normal_iterator<_Iterator, _Container>& __rhs)
+    noexcept
+    { return __lhs.base() < __rhs.base(); }
+
+  template<typename _IteratorL, typename _IteratorR, typename _Container>
+    inline bool
+    operator>(const __normal_iterator<_IteratorL, _Container>& __lhs,
+       const __normal_iterator<_IteratorR, _Container>& __rhs)
+    noexcept
+    { return __lhs.base() > __rhs.base(); }
+
+  template<typename _Iterator, typename _Container>
+    inline bool
+    operator>(const __normal_iterator<_Iterator, _Container>& __lhs,
+       const __normal_iterator<_Iterator, _Container>& __rhs)
+    noexcept
+    { return __lhs.base() > __rhs.base(); }
+
+  template<typename _IteratorL, typename _IteratorR, typename _Container>
+    inline bool
+    operator<=(const __normal_iterator<_IteratorL, _Container>& __lhs,
+        const __normal_iterator<_IteratorR, _Container>& __rhs)
+    noexcept
+    { return __lhs.base() <= __rhs.base(); }
+
+  template<typename _Iterator, typename _Container>
+    inline bool
+    operator<=(const __normal_iterator<_Iterator, _Container>& __lhs,
+        const __normal_iterator<_Iterator, _Container>& __rhs)
+    noexcept
+    { return __lhs.base() <= __rhs.base(); }
+
+  template<typename _IteratorL, typename _IteratorR, typename _Container>
+    inline bool
+    operator>=(const __normal_iterator<_IteratorL, _Container>& __lhs,
+        const __normal_iterator<_IteratorR, _Container>& __rhs)
+    noexcept
+    { return __lhs.base() >= __rhs.base(); }
+
+  template<typename _Iterator, typename _Container>
+    inline bool
+    operator>=(const __normal_iterator<_Iterator, _Container>& __lhs,
+        const __normal_iterator<_Iterator, _Container>& __rhs)
+    noexcept
+    { return __lhs.base() >= __rhs.base(); }
+
+
+
+
+
+  template<typename _IteratorL, typename _IteratorR, typename _Container>
+
+
+    inline auto
+    operator-(const __normal_iterator<_IteratorL, _Container>& __lhs,
+       const __normal_iterator<_IteratorR, _Container>& __rhs) noexcept
+    -> decltype(__lhs.base() - __rhs.base())
+
+
+
+
+
+    { return __lhs.base() - __rhs.base(); }
+
+  template<typename _Iterator, typename _Container>
+    inline typename __normal_iterator<_Iterator, _Container>::difference_type
+    operator-(const __normal_iterator<_Iterator, _Container>& __lhs,
+       const __normal_iterator<_Iterator, _Container>& __rhs)
+    noexcept
+    { return __lhs.base() - __rhs.base(); }
+
+  template<typename _Iterator, typename _Container>
+    inline __normal_iterator<_Iterator, _Container>
+    operator+(typename __normal_iterator<_Iterator, _Container>::difference_type
+       __n, const __normal_iterator<_Iterator, _Container>& __i)
+    noexcept
+    { return __normal_iterator<_Iterator, _Container>(__i.base() + __n); }
+
+
+}
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+  template<typename _Iterator, typename _Container>
+    _Iterator
+    __niter_base(__gnu_cxx::__normal_iterator<_Iterator, _Container> __it)
+    { return __it.base(); }
+  template<typename _Iterator>
+    class move_iterator
+    {
+    protected:
+      _Iterator _M_current;
+
+      typedef iterator_traits<_Iterator> __traits_type;
+      typedef typename __traits_type::reference __base_ref;
+
+    public:
+      typedef _Iterator iterator_type;
+      typedef typename __traits_type::iterator_category iterator_category;
+      typedef typename __traits_type::value_type value_type;
+      typedef typename __traits_type::difference_type difference_type;
+
+      typedef _Iterator pointer;
+
+
+      typedef typename conditional<is_reference<__base_ref>::value,
+    typename remove_reference<__base_ref>::type&&,
+    __base_ref>::type reference;
+
+     
+      move_iterator()
+      : _M_current() { }
+
+      explicit
+      move_iterator(iterator_type __i)
+      : _M_current(__i) { }
+
+      template<typename _Iter>
+
+ move_iterator(const move_iterator<_Iter>& __i)
+ : _M_current(__i.base()) { }
+
+      iterator_type
+      base() const
+      { return _M_current; }
+
+      reference
+      operator*() const
+      { return static_cast<reference>(*_M_current); }
+
+      pointer
+      operator->() const
+      { return _M_current; }
+
+      move_iterator&
+      operator++()
+      {
+ ++_M_current;
+ return *this;
+      }
+
+      move_iterator
+      operator++(int)
+      {
+ move_iterator __tmp = *this;
+ ++_M_current;
+ return __tmp;
+      }
+
+      move_iterator&
+      operator--()
+      {
+ --_M_current;
+ return *this;
+      }
+
+      move_iterator
+      operator--(int)
+      {
+ move_iterator __tmp = *this;
+ --_M_current;
+ return __tmp;
+      }
+
+      move_iterator
+      operator+(difference_type __n) const
+      { return move_iterator(_M_current + __n); }
+
+      move_iterator&
+      operator+=(difference_type __n)
+      {
+ _M_current += __n;
+ return *this;
+      }
+
+      move_iterator
+      operator-(difference_type __n) const
+      { return move_iterator(_M_current - __n); }
+
+      move_iterator&
+      operator-=(difference_type __n)
+      {
+ _M_current -= __n;
+ return *this;
+      }
+
+      reference
+      operator[](difference_type __n) const
+      { return std::move(_M_current[__n]); }
+    };
+
+
+
+
+  template<typename _IteratorL, typename _IteratorR>
+    inline bool
+    operator==(const move_iterator<_IteratorL>& __x,
+        const move_iterator<_IteratorR>& __y)
+    { return __x.base() == __y.base(); }
+
+  template<typename _Iterator>
+    inline bool
+    operator==(const move_iterator<_Iterator>& __x,
+        const move_iterator<_Iterator>& __y)
+    { return __x.base() == __y.base(); }
+
+  template<typename _IteratorL, typename _IteratorR>
+    inline bool
+    operator!=(const move_iterator<_IteratorL>& __x,
+        const move_iterator<_IteratorR>& __y)
+    { return !(__x == __y); }
+
+  template<typename _Iterator>
+    inline bool
+    operator!=(const move_iterator<_Iterator>& __x,
+        const move_iterator<_Iterator>& __y)
+    { return !(__x == __y); }
+
+  template<typename _IteratorL, typename _IteratorR>
+    inline bool
+    operator<(const move_iterator<_IteratorL>& __x,
+       const move_iterator<_IteratorR>& __y)
+    { return __x.base() < __y.base(); }
+
+  template<typename _Iterator>
+    inline bool
+    operator<(const move_iterator<_Iterator>& __x,
+       const move_iterator<_Iterator>& __y)
+    { return __x.base() < __y.base(); }
+
+  template<typename _IteratorL, typename _IteratorR>
+    inline bool
+    operator<=(const move_iterator<_IteratorL>& __x,
+        const move_iterator<_IteratorR>& __y)
+    { return !(__y < __x); }
+
+  template<typename _Iterator>
+    inline bool
+    operator<=(const move_iterator<_Iterator>& __x,
+        const move_iterator<_Iterator>& __y)
+    { return !(__y < __x); }
+
+  template<typename _IteratorL, typename _IteratorR>
+    inline bool
+    operator>(const move_iterator<_IteratorL>& __x,
+       const move_iterator<_IteratorR>& __y)
+    { return __y < __x; }
+
+  template<typename _Iterator>
+    inline bool
+    operator>(const move_iterator<_Iterator>& __x,
+       const move_iterator<_Iterator>& __y)
+    { return __y < __x; }
+
+  template<typename _IteratorL, typename _IteratorR>
+    inline bool
+    operator>=(const move_iterator<_IteratorL>& __x,
+        const move_iterator<_IteratorR>& __y)
+    { return !(__x < __y); }
+
+  template<typename _Iterator>
+    inline bool
+    operator>=(const move_iterator<_Iterator>& __x,
+        const move_iterator<_Iterator>& __y)
+    { return !(__x < __y); }
+
+
+  template<typename _IteratorL, typename _IteratorR>
+    inline auto
+    operator-(const move_iterator<_IteratorL>& __x,
+       const move_iterator<_IteratorR>& __y)
+    -> decltype(__x.base() - __y.base())
+    { return __x.base() - __y.base(); }
+
+  template<typename _Iterator>
+    inline move_iterator<_Iterator>
+    operator+(typename move_iterator<_Iterator>::difference_type __n,
+       const move_iterator<_Iterator>& __x)
+    { return __x + __n; }
+
+  template<typename _Iterator>
+    inline move_iterator<_Iterator>
+    make_move_iterator(_Iterator __i)
+    { return move_iterator<_Iterator>(__i); }
+
+  template<typename _Iterator, typename _ReturnType
+    = typename conditional<__move_if_noexcept_cond
+      <typename iterator_traits<_Iterator>::value_type>::value,
+                _Iterator, move_iterator<_Iterator>>::type>
+    inline _ReturnType
+    __make_move_if_noexcept_iterator(_Iterator __i)
+    { return _ReturnType(__i); }
+
+
+
+  template<typename _Tp, typename _ReturnType
+    = typename conditional<__move_if_noexcept_cond<_Tp>::value,
+      const _Tp*, move_iterator<_Tp*>>::type>
+    inline _ReturnType
+    __make_move_if_noexcept_iterator(_Tp* __i)
+    { return _ReturnType(__i); }
+
+
+
+  template<typename _Iterator>
+    auto
+    __niter_base(move_iterator<_Iterator> __it)
+    -> decltype(make_move_iterator(__niter_base(__it.base())))
+    { return make_move_iterator(__niter_base(__it.base())); }
+
+  template<typename _Iterator>
+    struct __is_move_iterator<move_iterator<_Iterator> >
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<typename _Iterator>
+    auto
+    __miter_base(move_iterator<_Iterator> __it)
+    -> decltype(__miter_base(__it.base()))
+    { return __miter_base(__it.base()); }
+
+}
+
+namespace std
+{
+  namespace __debug { }
+}
+
+
+
+
+namespace __gnu_debug
+{
+  using namespace std::__debug;
+}
+
+namespace __gnu_cxx
+{
+namespace __ops
+{
+  struct _Iter_less_iter
+  {
+    template<typename _Iterator1, typename _Iterator2>
+     
+      bool
+      operator()(_Iterator1 __it1, _Iterator2 __it2) const
+      { return *__it1 < *__it2; }
+  };
+
+ 
+  inline _Iter_less_iter
+  __iter_less_iter()
+  { return _Iter_less_iter(); }
+
+  struct _Iter_less_val
+  {
+
+    constexpr _Iter_less_val() = default;
+
+
+
+
+    explicit
+    _Iter_less_val(_Iter_less_iter) { }
+
+    template<typename _Iterator, typename _Value>
+      bool
+      operator()(_Iterator __it, _Value& __val) const
+      { return *__it < __val; }
+  };
+
+  inline _Iter_less_val
+  __iter_less_val()
+  { return _Iter_less_val(); }
+
+  inline _Iter_less_val
+  __iter_comp_val(_Iter_less_iter)
+  { return _Iter_less_val(); }
+
+  struct _Val_less_iter
+  {
+
+    constexpr _Val_less_iter() = default;
+
+
+
+
+    explicit
+    _Val_less_iter(_Iter_less_iter) { }
+
+    template<typename _Value, typename _Iterator>
+      bool
+      operator()(_Value& __val, _Iterator __it) const
+      { return __val < *__it; }
+  };
+
+  inline _Val_less_iter
+  __val_less_iter()
+  { return _Val_less_iter(); }
+
+  inline _Val_less_iter
+  __val_comp_iter(_Iter_less_iter)
+  { return _Val_less_iter(); }
+
+  struct _Iter_equal_to_iter
+  {
+    template<typename _Iterator1, typename _Iterator2>
+      bool
+      operator()(_Iterator1 __it1, _Iterator2 __it2) const
+      { return *__it1 == *__it2; }
+  };
+
+  inline _Iter_equal_to_iter
+  __iter_equal_to_iter()
+  { return _Iter_equal_to_iter(); }
+
+  struct _Iter_equal_to_val
+  {
+    template<typename _Iterator, typename _Value>
+      bool
+      operator()(_Iterator __it, _Value& __val) const
+      { return *__it == __val; }
+  };
+
+  inline _Iter_equal_to_val
+  __iter_equal_to_val()
+  { return _Iter_equal_to_val(); }
+
+  inline _Iter_equal_to_val
+  __iter_comp_val(_Iter_equal_to_iter)
+  { return _Iter_equal_to_val(); }
+
+  template<typename _Compare>
+    struct _Iter_comp_iter
+    {
+      _Compare _M_comp;
+
+      explicit
+      _Iter_comp_iter(_Compare __comp)
+ : _M_comp(std::move(__comp))
+      { }
+
+      template<typename _Iterator1, typename _Iterator2>
+       
+        bool
+        operator()(_Iterator1 __it1, _Iterator2 __it2)
+        { return bool(_M_comp(*__it1, *__it2)); }
+    };
+
+  template<typename _Compare>
+   
+    inline _Iter_comp_iter<_Compare>
+    __iter_comp_iter(_Compare __comp)
+    { return _Iter_comp_iter<_Compare>(std::move(__comp)); }
+
+  template<typename _Compare>
+    struct _Iter_comp_val
+    {
+      _Compare _M_comp;
+
+      explicit
+      _Iter_comp_val(_Compare __comp)
+ : _M_comp(std::move(__comp))
+      { }
+
+      explicit
+      _Iter_comp_val(const _Iter_comp_iter<_Compare>& __comp)
+ : _M_comp(__comp._M_comp)
+      { }
+
+
+      explicit
+      _Iter_comp_val(_Iter_comp_iter<_Compare>&& __comp)
+ : _M_comp(std::move(__comp._M_comp))
+      { }
+
+
+      template<typename _Iterator, typename _Value>
+ bool
+ operator()(_Iterator __it, _Value& __val)
+ { return bool(_M_comp(*__it, __val)); }
+    };
+
+  template<typename _Compare>
+   inline _Iter_comp_val<_Compare>
+    __iter_comp_val(_Compare __comp)
+    { return _Iter_comp_val<_Compare>(std::move(__comp)); }
+
+  template<typename _Compare>
+    inline _Iter_comp_val<_Compare>
+    __iter_comp_val(_Iter_comp_iter<_Compare> __comp)
+    { return _Iter_comp_val<_Compare>(std::move(__comp)); }
+
+  template<typename _Compare>
+    struct _Val_comp_iter
+    {
+      _Compare _M_comp;
+
+      explicit
+      _Val_comp_iter(_Compare __comp)
+ : _M_comp(std::move(__comp))
+      { }
+
+      explicit
+      _Val_comp_iter(const _Iter_comp_iter<_Compare>& __comp)
+ : _M_comp(__comp._M_comp)
+      { }
+
+
+      explicit
+      _Val_comp_iter(_Iter_comp_iter<_Compare>&& __comp)
+ : _M_comp(std::move(__comp._M_comp))
+      { }
+
+
+      template<typename _Value, typename _Iterator>
+ bool
+ operator()(_Value& __val, _Iterator __it)
+ { return bool(_M_comp(__val, *__it)); }
+    };
+
+  template<typename _Compare>
+    inline _Val_comp_iter<_Compare>
+    __val_comp_iter(_Compare __comp)
+    { return _Val_comp_iter<_Compare>(std::move(__comp)); }
+
+  template<typename _Compare>
+    inline _Val_comp_iter<_Compare>
+    __val_comp_iter(_Iter_comp_iter<_Compare> __comp)
+    { return _Val_comp_iter<_Compare>(std::move(__comp)); }
+
+  template<typename _Value>
+    struct _Iter_equals_val
+    {
+      _Value& _M_value;
+
+      explicit
+      _Iter_equals_val(_Value& __value)
+ : _M_value(__value)
+      { }
+
+      template<typename _Iterator>
+ bool
+ operator()(_Iterator __it)
+ { return *__it == _M_value; }
+    };
+
+  template<typename _Value>
+    inline _Iter_equals_val<_Value>
+    __iter_equals_val(_Value& __val)
+    { return _Iter_equals_val<_Value>(__val); }
+
+  template<typename _Iterator1>
+    struct _Iter_equals_iter
+    {
+      _Iterator1 _M_it1;
+
+      explicit
+      _Iter_equals_iter(_Iterator1 __it1)
+ : _M_it1(__it1)
+      { }
+
+      template<typename _Iterator2>
+ bool
+ operator()(_Iterator2 __it2)
+ { return *__it2 == *_M_it1; }
+    };
+
+  template<typename _Iterator>
+    inline _Iter_equals_iter<_Iterator>
+    __iter_comp_iter(_Iter_equal_to_iter, _Iterator __it)
+    { return _Iter_equals_iter<_Iterator>(__it); }
+
+  template<typename _Predicate>
+    struct _Iter_pred
+    {
+      _Predicate _M_pred;
+
+      explicit
+      _Iter_pred(_Predicate __pred)
+ : _M_pred(std::move(__pred))
+      { }
+
+      template<typename _Iterator>
+ bool
+ operator()(_Iterator __it)
+ { return bool(_M_pred(*__it)); }
+    };
+
+  template<typename _Predicate>
+    inline _Iter_pred<_Predicate>
+    __pred_iter(_Predicate __pred)
+    { return _Iter_pred<_Predicate>(std::move(__pred)); }
+
+  template<typename _Compare, typename _Value>
+    struct _Iter_comp_to_val
+    {
+      _Compare _M_comp;
+      _Value& _M_value;
+
+      _Iter_comp_to_val(_Compare __comp, _Value& __value)
+ : _M_comp(std::move(__comp)), _M_value(__value)
+      { }
+
+      template<typename _Iterator>
+ bool
+ operator()(_Iterator __it)
+ { return bool(_M_comp(*__it, _M_value)); }
+    };
+
+  template<typename _Compare, typename _Value>
+    _Iter_comp_to_val<_Compare, _Value>
+    __iter_comp_val(_Compare __comp, _Value &__val)
+    {
+      return _Iter_comp_to_val<_Compare, _Value>(std::move(__comp), __val);
+    }
+
+  template<typename _Compare, typename _Iterator1>
+    struct _Iter_comp_to_iter
+    {
+      _Compare _M_comp;
+      _Iterator1 _M_it1;
+
+      _Iter_comp_to_iter(_Compare __comp, _Iterator1 __it1)
+ : _M_comp(std::move(__comp)), _M_it1(__it1)
+      { }
+
+      template<typename _Iterator2>
+ bool
+ operator()(_Iterator2 __it2)
+ { return bool(_M_comp(*__it2, *_M_it1)); }
+    };
+
+  template<typename _Compare, typename _Iterator>
+    inline _Iter_comp_to_iter<_Compare, _Iterator>
+    __iter_comp_iter(_Iter_comp_iter<_Compare> __comp, _Iterator __it)
+    {
+      return _Iter_comp_to_iter<_Compare, _Iterator>(
+   std::move(__comp._M_comp), __it);
+    }
+
+  template<typename _Predicate>
+    struct _Iter_negate
+    {
+      _Predicate _M_pred;
+
+      explicit
+      _Iter_negate(_Predicate __pred)
+ : _M_pred(std::move(__pred))
+      { }
+
+      template<typename _Iterator>
+ bool
+ operator()(_Iterator __it)
+ { return !bool(_M_pred(*__it)); }
+    };
+
+  template<typename _Predicate>
+    inline _Iter_negate<_Predicate>
+    __negate(_Iter_pred<_Predicate> __pred)
+    { return _Iter_negate<_Predicate>(std::move(__pred._M_pred)); }
+
+}
+}
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+  template<typename _ForwardIterator1, typename _ForwardIterator2>
+    inline void
+    iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b)
+    {
+
+     
+
+     
+      swap(*__a, *__b);
+
+    }
+  template<typename _ForwardIterator1, typename _ForwardIterator2>
+    _ForwardIterator2
+    swap_ranges(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
+  _ForwardIterator2 __first2)
+    {
+
+     
+
+     
+
+      ;
+
+      for (; __first1 != __last1; ++__first1, (void)++__first2)
+ std::iter_swap(__first1, __first2);
+      return __first2;
+    }
+  template<typename _Tp>
+   
+    inline const _Tp&
+    min(const _Tp& __a, const _Tp& __b)
+    {
+
+     
+
+      if (__b < __a)
+ return __b;
+      return __a;
+    }
+  template<typename _Tp>
+   
+    inline const _Tp&
+    max(const _Tp& __a, const _Tp& __b)
+    {
+
+     
+
+      if (__a < __b)
+ return __b;
+      return __a;
+    }
+  template<typename _Tp, typename _Compare>
+   
+    inline const _Tp&
+    min(const _Tp& __a, const _Tp& __b, _Compare __comp)
+    {
+
+      if (__comp(__b, __a))
+ return __b;
+      return __a;
+    }
+  template<typename _Tp, typename _Compare>
+   
+    inline const _Tp&
+    max(const _Tp& __a, const _Tp& __b, _Compare __comp)
+    {
+
+      if (__comp(__a, __b))
+ return __b;
+      return __a;
+    }
+
+
+
+  template<typename _Iterator>
+    inline _Iterator
+    __niter_base(_Iterator __it)
+    { return __it; }
+
+
+
+
+
+
+
+  template<bool, bool, typename>
+    struct __copy_move
+    {
+      template<typename _II, typename _OI>
+ static _OI
+ __copy_m(_II __first, _II __last, _OI __result)
+ {
+   for (; __first != __last; ++__result, (void)++__first)
+     *__result = *__first;
+   return __result;
+ }
+    };
+
+
+  template<typename _Category>
+    struct __copy_move<true, false, _Category>
+    {
+      template<typename _II, typename _OI>
+ static _OI
+ __copy_m(_II __first, _II __last, _OI __result)
+ {
+   for (; __first != __last; ++__result, (void)++__first)
+     *__result = std::move(*__first);
+   return __result;
+ }
+    };
+
+
+  template<>
+    struct __copy_move<false, false, random_access_iterator_tag>
+    {
+      template<typename _II, typename _OI>
+ static _OI
+ __copy_m(_II __first, _II __last, _OI __result)
+ {
+   typedef typename iterator_traits<_II>::difference_type _Distance;
+   for(_Distance __n = __last - __first; __n > 0; --__n)
+     {
+       *__result = *__first;
+       ++__first;
+       ++__result;
+     }
+   return __result;
+ }
+    };
+
+
+  template<>
+    struct __copy_move<true, false, random_access_iterator_tag>
+    {
+      template<typename _II, typename _OI>
+ static _OI
+ __copy_m(_II __first, _II __last, _OI __result)
+ {
+   typedef typename iterator_traits<_II>::difference_type _Distance;
+   for(_Distance __n = __last - __first; __n > 0; --__n)
+     {
+       *__result = std::move(*__first);
+       ++__first;
+       ++__result;
+     }
+   return __result;
+ }
+    };
+
+
+  template<bool _IsMove>
+    struct __copy_move<_IsMove, true, random_access_iterator_tag>
+    {
+      template<typename _Tp>
+ static _Tp*
+ __copy_m(const _Tp* __first, const _Tp* __last, _Tp* __result)
+ {
+
+   using __assignable = conditional<_IsMove,
+        is_move_assignable<_Tp>,
+        is_copy_assignable<_Tp>>;
+
+   static_assert( __assignable::type::value, "type is not assignable" );
+
+   const ptrdiff_t _Num = __last - __first;
+   if (_Num)
+     __builtin_memmove(__result, __first, sizeof(_Tp) * _Num);
+   return __result + _Num;
+ }
+    };
+
+  template<bool _IsMove, typename _II, typename _OI>
+    inline _OI
+    __copy_move_a(_II __first, _II __last, _OI __result)
+    {
+      typedef typename iterator_traits<_II>::value_type _ValueTypeI;
+      typedef typename iterator_traits<_OI>::value_type _ValueTypeO;
+      typedef typename iterator_traits<_II>::iterator_category _Category;
+      const bool __simple = (__is_trivial(_ValueTypeI)
+        && __is_pointer<_II>::__value
+        && __is_pointer<_OI>::__value
+        && __are_same<_ValueTypeI, _ValueTypeO>::__value);
+
+      return std::__copy_move<_IsMove, __simple,
+         _Category>::__copy_m(__first, __last, __result);
+    }
+
+
+
+  template<typename _CharT>
+    struct char_traits;
+
+  template<typename _CharT, typename _Traits>
+    class istreambuf_iterator;
+
+  template<typename _CharT, typename _Traits>
+    class ostreambuf_iterator;
+
+  template<bool _IsMove, typename _CharT>
+    typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
+      ostreambuf_iterator<_CharT, char_traits<_CharT> > >::__type
+    __copy_move_a2(_CharT*, _CharT*,
+     ostreambuf_iterator<_CharT, char_traits<_CharT> >);
+
+  template<bool _IsMove, typename _CharT>
+    typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
+      ostreambuf_iterator<_CharT, char_traits<_CharT> > >::__type
+    __copy_move_a2(const _CharT*, const _CharT*,
+     ostreambuf_iterator<_CharT, char_traits<_CharT> >);
+
+  template<bool _IsMove, typename _CharT>
+    typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
+        _CharT*>::__type
+    __copy_move_a2(istreambuf_iterator<_CharT, char_traits<_CharT> >,
+     istreambuf_iterator<_CharT, char_traits<_CharT> >, _CharT*);
+
+  template<bool _IsMove, typename _II, typename _OI>
+    inline _OI
+    __copy_move_a2(_II __first, _II __last, _OI __result)
+    {
+      return _OI(std::__copy_move_a<_IsMove>(std::__niter_base(__first),
+          std::__niter_base(__last),
+          std::__niter_base(__result)));
+    }
+  template<typename _II, typename _OI>
+    inline _OI
+    copy(_II __first, _II __last, _OI __result)
+    {
+
+     
+     
+
+      ;
+
+      return (std::__copy_move_a2<__is_move_iterator<_II>::__value>
+       (std::__miter_base(__first), std::__miter_base(__last),
+        __result));
+    }
+  template<typename _II, typename _OI>
+    inline _OI
+    move(_II __first, _II __last, _OI __result)
+    {
+
+     
+     
+
+      ;
+
+      return std::__copy_move_a2<true>(std::__miter_base(__first),
+           std::__miter_base(__last), __result);
+    }
+
+
+
+
+
+
+  template<bool, bool, typename>
+    struct __copy_move_backward
+    {
+      template<typename _BI1, typename _BI2>
+ static _BI2
+ __copy_move_b(_BI1 __first, _BI1 __last, _BI2 __result)
+ {
+   while (__first != __last)
+     *--__result = *--__last;
+   return __result;
+ }
+    };
+
+
+  template<typename _Category>
+    struct __copy_move_backward<true, false, _Category>
+    {
+      template<typename _BI1, typename _BI2>
+ static _BI2
+ __copy_move_b(_BI1 __first, _BI1 __last, _BI2 __result)
+ {
+   while (__first != __last)
+     *--__result = std::move(*--__last);
+   return __result;
+ }
+    };
+
+
+  template<>
+    struct __copy_move_backward<false, false, random_access_iterator_tag>
+    {
+      template<typename _BI1, typename _BI2>
+ static _BI2
+ __copy_move_b(_BI1 __first, _BI1 __last, _BI2 __result)
+ {
+   typename iterator_traits<_BI1>::difference_type __n;
+   for (__n = __last - __first; __n > 0; --__n)
+     *--__result = *--__last;
+   return __result;
+ }
+    };
+
+
+  template<>
+    struct __copy_move_backward<true, false, random_access_iterator_tag>
+    {
+      template<typename _BI1, typename _BI2>
+ static _BI2
+ __copy_move_b(_BI1 __first, _BI1 __last, _BI2 __result)
+ {
+   typename iterator_traits<_BI1>::difference_type __n;
+   for (__n = __last - __first; __n > 0; --__n)
+     *--__result = std::move(*--__last);
+   return __result;
+ }
+    };
+
+
+  template<bool _IsMove>
+    struct __copy_move_backward<_IsMove, true, random_access_iterator_tag>
+    {
+      template<typename _Tp>
+ static _Tp*
+ __copy_move_b(const _Tp* __first, const _Tp* __last, _Tp* __result)
+ {
+
+   using __assignable = conditional<_IsMove,
+        is_move_assignable<_Tp>,
+        is_copy_assignable<_Tp>>;
+
+   static_assert( __assignable::type::value, "type is not assignable" );
+
+   const ptrdiff_t _Num = __last - __first;
+   if (_Num)
+     __builtin_memmove(__result - _Num, __first, sizeof(_Tp) * _Num);
+   return __result - _Num;
+ }
+    };
+
+  template<bool _IsMove, typename _BI1, typename _BI2>
+    inline _BI2
+    __copy_move_backward_a(_BI1 __first, _BI1 __last, _BI2 __result)
+    {
+      typedef typename iterator_traits<_BI1>::value_type _ValueType1;
+      typedef typename iterator_traits<_BI2>::value_type _ValueType2;
+      typedef typename iterator_traits<_BI1>::iterator_category _Category;
+      const bool __simple = (__is_trivial(_ValueType1)
+        && __is_pointer<_BI1>::__value
+        && __is_pointer<_BI2>::__value
+        && __are_same<_ValueType1, _ValueType2>::__value);
+
+      return std::__copy_move_backward<_IsMove, __simple,
+           _Category>::__copy_move_b(__first,
+         __last,
+         __result);
+    }
+
+  template<bool _IsMove, typename _BI1, typename _BI2>
+    inline _BI2
+    __copy_move_backward_a2(_BI1 __first, _BI1 __last, _BI2 __result)
+    {
+      return _BI2(std::__copy_move_backward_a<_IsMove>
+    (std::__niter_base(__first), std::__niter_base(__last),
+     std::__niter_base(__result)));
+    }
+  template<typename _BI1, typename _BI2>
+    inline _BI2
+    copy_backward(_BI1 __first, _BI1 __last, _BI2 __result)
+    {
+
+     
+     
+     
+
+
+      ;
+
+      return (std::__copy_move_backward_a2<__is_move_iterator<_BI1>::__value>
+       (std::__miter_base(__first), std::__miter_base(__last),
+        __result));
+    }
+  template<typename _BI1, typename _BI2>
+    inline _BI2
+    move_backward(_BI1 __first, _BI1 __last, _BI2 __result)
+    {
+
+     
+     
+     
+
+
+      ;
+
+      return std::__copy_move_backward_a2<true>(std::__miter_base(__first),
+      std::__miter_base(__last),
+      __result);
+    }
+
+
+
+
+
+
+  template<typename _ForwardIterator, typename _Tp>
+    inline typename
+    __gnu_cxx::__enable_if<!__is_scalar<_Tp>::__value, void>::__type
+    __fill_a(_ForwardIterator __first, _ForwardIterator __last,
+       const _Tp& __value)
+    {
+      for (; __first != __last; ++__first)
+ *__first = __value;
+    }
+
+  template<typename _ForwardIterator, typename _Tp>
+    inline typename
+    __gnu_cxx::__enable_if<__is_scalar<_Tp>::__value, void>::__type
+    __fill_a(_ForwardIterator __first, _ForwardIterator __last,
+      const _Tp& __value)
+    {
+      const _Tp __tmp = __value;
+      for (; __first != __last; ++__first)
+ *__first = __tmp;
+    }
+
+
+  template<typename _Tp>
+    inline typename
+    __gnu_cxx::__enable_if<__is_byte<_Tp>::__value, void>::__type
+    __fill_a(_Tp* __first, _Tp* __last, const _Tp& __c)
+    {
+      const _Tp __tmp = __c;
+      if (const size_t __len = __last - __first)
+ __builtin_memset(__first, static_cast<unsigned char>(__tmp), __len);
+    }
+  template<typename _ForwardIterator, typename _Tp>
+    inline void
+    fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value)
+    {
+
+     
+
+      ;
+
+      std::__fill_a(std::__niter_base(__first), std::__niter_base(__last),
+      __value);
+    }
+
+  template<typename _OutputIterator, typename _Size, typename _Tp>
+    inline typename
+    __gnu_cxx::__enable_if<!__is_scalar<_Tp>::__value, _OutputIterator>::__type
+    __fill_n_a(_OutputIterator __first, _Size __n, const _Tp& __value)
+    {
+      for (__decltype(__n + 0) __niter = __n;
+    __niter > 0; --__niter, (void) ++__first)
+ *__first = __value;
+      return __first;
+    }
+
+  template<typename _OutputIterator, typename _Size, typename _Tp>
+    inline typename
+    __gnu_cxx::__enable_if<__is_scalar<_Tp>::__value, _OutputIterator>::__type
+    __fill_n_a(_OutputIterator __first, _Size __n, const _Tp& __value)
+    {
+      const _Tp __tmp = __value;
+      for (__decltype(__n + 0) __niter = __n;
+    __niter > 0; --__niter, (void) ++__first)
+ *__first = __tmp;
+      return __first;
+    }
+
+  template<typename _Size, typename _Tp>
+    inline typename
+    __gnu_cxx::__enable_if<__is_byte<_Tp>::__value, _Tp*>::__type
+    __fill_n_a(_Tp* __first, _Size __n, const _Tp& __c)
+    {
+      std::__fill_a(__first, __first + __n, __c);
+      return __first + __n;
+    }
+  template<typename _OI, typename _Size, typename _Tp>
+    inline _OI
+    fill_n(_OI __first, _Size __n, const _Tp& __value)
+    {
+
+     
+
+      return _OI(std::__fill_n_a(std::__niter_base(__first), __n, __value));
+    }
+
+  template<bool _BoolType>
+    struct __equal
+    {
+      template<typename _II1, typename _II2>
+ static bool
+ equal(_II1 __first1, _II1 __last1, _II2 __first2)
+ {
+   for (; __first1 != __last1; ++__first1, (void) ++__first2)
+     if (!(*__first1 == *__first2))
+       return false;
+   return true;
+ }
+    };
+
+  template<>
+    struct __equal<true>
+    {
+      template<typename _Tp>
+ static bool
+ equal(const _Tp* __first1, const _Tp* __last1, const _Tp* __first2)
+ {
+   if (const size_t __len = (__last1 - __first1))
+     return !__builtin_memcmp(__first1, __first2, sizeof(_Tp) * __len);
+   return true;
+ }
+    };
+
+  template<typename _II1, typename _II2>
+    inline bool
+    __equal_aux(_II1 __first1, _II1 __last1, _II2 __first2)
+    {
+      typedef typename iterator_traits<_II1>::value_type _ValueType1;
+      typedef typename iterator_traits<_II2>::value_type _ValueType2;
+      const bool __simple = ((__is_integer<_ValueType1>::__value
+         || __is_pointer<_ValueType1>::__value)
+        && __is_pointer<_II1>::__value
+        && __is_pointer<_II2>::__value
+        && __are_same<_ValueType1, _ValueType2>::__value);
+
+      return std::__equal<__simple>::equal(__first1, __last1, __first2);
+    }
+
+  template<typename, typename>
+    struct __lc_rai
+    {
+      template<typename _II1, typename _II2>
+ static _II1
+ __newlast1(_II1, _II1 __last1, _II2, _II2)
+ { return __last1; }
+
+      template<typename _II>
+ static bool
+ __cnd2(_II __first, _II __last)
+ { return __first != __last; }
+    };
+
+  template<>
+    struct __lc_rai<random_access_iterator_tag, random_access_iterator_tag>
+    {
+      template<typename _RAI1, typename _RAI2>
+ static _RAI1
+ __newlast1(_RAI1 __first1, _RAI1 __last1,
+     _RAI2 __first2, _RAI2 __last2)
+ {
+   const typename iterator_traits<_RAI1>::difference_type
+     __diff1 = __last1 - __first1;
+   const typename iterator_traits<_RAI2>::difference_type
+     __diff2 = __last2 - __first2;
+   return __diff2 < __diff1 ? __first1 + __diff2 : __last1;
+ }
+
+      template<typename _RAI>
+ static bool
+ __cnd2(_RAI, _RAI)
+ { return true; }
+    };
+
+  template<typename _II1, typename _II2, typename _Compare>
+    bool
+    __lexicographical_compare_impl(_II1 __first1, _II1 __last1,
+       _II2 __first2, _II2 __last2,
+       _Compare __comp)
+    {
+      typedef typename iterator_traits<_II1>::iterator_category _Category1;
+      typedef typename iterator_traits<_II2>::iterator_category _Category2;
+      typedef std::__lc_rai<_Category1, _Category2> __rai_type;
+
+      __last1 = __rai_type::__newlast1(__first1, __last1, __first2, __last2);
+      for (; __first1 != __last1 && __rai_type::__cnd2(__first2, __last2);
+    ++__first1, (void)++__first2)
+ {
+   if (__comp(__first1, __first2))
+     return true;
+   if (__comp(__first2, __first1))
+     return false;
+ }
+      return __first1 == __last1 && __first2 != __last2;
+    }
+
+  template<bool _BoolType>
+    struct __lexicographical_compare
+    {
+      template<typename _II1, typename _II2>
+ static bool __lc(_II1, _II1, _II2, _II2);
+    };
+
+  template<bool _BoolType>
+    template<typename _II1, typename _II2>
+      bool
+      __lexicographical_compare<_BoolType>::
+      __lc(_II1 __first1, _II1 __last1, _II2 __first2, _II2 __last2)
+      {
+ return std::__lexicographical_compare_impl(__first1, __last1,
+         __first2, __last2,
+     __gnu_cxx::__ops::__iter_less_iter());
+      }
+
+  template<>
+    struct __lexicographical_compare<true>
+    {
+      template<typename _Tp, typename _Up>
+ static bool
+ __lc(const _Tp* __first1, const _Tp* __last1,
+      const _Up* __first2, const _Up* __last2)
+ {
+   const size_t __len1 = __last1 - __first1;
+   const size_t __len2 = __last2 - __first2;
+   if (const size_t __len = std::min(__len1, __len2))
+     if (int __result = __builtin_memcmp(__first1, __first2, __len))
+       return __result < 0;
+   return __len1 < __len2;
+ }
+    };
+
+  template<typename _II1, typename _II2>
+    inline bool
+    __lexicographical_compare_aux(_II1 __first1, _II1 __last1,
+      _II2 __first2, _II2 __last2)
+    {
+      typedef typename iterator_traits<_II1>::value_type _ValueType1;
+      typedef typename iterator_traits<_II2>::value_type _ValueType2;
+      const bool __simple =
+ (__is_byte<_ValueType1>::__value && __is_byte<_ValueType2>::__value
+  && !__gnu_cxx::__numeric_traits<_ValueType1>::__is_signed
+  && !__gnu_cxx::__numeric_traits<_ValueType2>::__is_signed
+  && __is_pointer<_II1>::__value
+  && __is_pointer<_II2>::__value);
+
+      return std::__lexicographical_compare<__simple>::__lc(__first1, __last1,
+           __first2, __last2);
+    }
+
+  template<typename _ForwardIterator, typename _Tp, typename _Compare>
+    _ForwardIterator
+    __lower_bound(_ForwardIterator __first, _ForwardIterator __last,
+    const _Tp& __val, _Compare __comp)
+    {
+      typedef typename iterator_traits<_ForwardIterator>::difference_type
+ _DistanceType;
+
+      _DistanceType __len = std::distance(__first, __last);
+
+      while (__len > 0)
+ {
+   _DistanceType __half = __len >> 1;
+   _ForwardIterator __middle = __first;
+   std::advance(__middle, __half);
+   if (__comp(__middle, __val))
+     {
+       __first = __middle;
+       ++__first;
+       __len = __len - __half - 1;
+     }
+   else
+     __len = __half;
+ }
+      return __first;
+    }
+  template<typename _ForwardIterator, typename _Tp>
+    inline _ForwardIterator
+    lower_bound(_ForwardIterator __first, _ForwardIterator __last,
+  const _Tp& __val)
+    {
+
+     
+     
+
+      ;
+
+      return std::__lower_bound(__first, __last, __val,
+    __gnu_cxx::__ops::__iter_less_val());
+    }
+
+
+
+  inline constexpr int
+  __lg(int __n)
+  { return sizeof(int) * 8 - 1 - __builtin_clz(__n); }
+
+  inline constexpr unsigned
+  __lg(unsigned __n)
+  { return sizeof(int) * 8 - 1 - __builtin_clz(__n); }
+
+  inline constexpr long
+  __lg(long __n)
+  { return sizeof(long) * 8 - 1 - __builtin_clzl(__n); }
+
+  inline constexpr unsigned long
+  __lg(unsigned long __n)
+  { return sizeof(long) * 8 - 1 - __builtin_clzl(__n); }
+
+  inline constexpr long long
+  __lg(long long __n)
+  { return sizeof(long long) * 8 - 1 - __builtin_clzll(__n); }
+
+  inline constexpr unsigned long long
+  __lg(unsigned long long __n)
+  { return sizeof(long long) * 8 - 1 - __builtin_clzll(__n); }
+
+
+  template<typename _II1, typename _II2>
+    inline bool
+    equal(_II1 __first1, _II1 __last1, _II2 __first2)
+    {
+
+     
+     
+     
+
+
+      ;
+
+      return std::__equal_aux(std::__niter_base(__first1),
+         std::__niter_base(__last1),
+         std::__niter_base(__first2));
+    }
+  template<typename _IIter1, typename _IIter2, typename _BinaryPredicate>
+    inline bool
+    equal(_IIter1 __first1, _IIter1 __last1,
+   _IIter2 __first2, _BinaryPredicate __binary_pred)
+    {
+
+     
+     
+      ;
+
+      for (; __first1 != __last1; ++__first1, (void)++__first2)
+ if (!bool(__binary_pred(*__first1, *__first2)))
+   return false;
+      return true;
+    }
+
+
+
+  template<typename _II1, typename _II2>
+    inline bool
+    __equal4(_II1 __first1, _II1 __last1, _II2 __first2, _II2 __last2)
+    {
+      using _RATag = random_access_iterator_tag;
+      using _Cat1 = typename iterator_traits<_II1>::iterator_category;
+      using _Cat2 = typename iterator_traits<_II2>::iterator_category;
+      using _RAIters = __and_<is_same<_Cat1, _RATag>, is_same<_Cat2, _RATag>>;
+      if (_RAIters())
+ {
+   auto __d1 = std::distance(__first1, __last1);
+   auto __d2 = std::distance(__first2, __last2);
+   if (__d1 != __d2)
+     return false;
+   return std::equal(__first1, __last1, __first2);
+ }
+
+      for (; __first1 != __last1 && __first2 != __last2;
+   ++__first1, (void)++__first2)
+ if (!(*__first1 == *__first2))
+   return false;
+      return __first1 == __last1 && __first2 == __last2;
+    }
+
+
+  template<typename _II1, typename _II2, typename _BinaryPredicate>
+    inline bool
+    __equal4(_II1 __first1, _II1 __last1, _II2 __first2, _II2 __last2,
+      _BinaryPredicate __binary_pred)
+    {
+      using _RATag = random_access_iterator_tag;
+      using _Cat1 = typename iterator_traits<_II1>::iterator_category;
+      using _Cat2 = typename iterator_traits<_II2>::iterator_category;
+      using _RAIters = __and_<is_same<_Cat1, _RATag>, is_same<_Cat2, _RATag>>;
+      if (_RAIters())
+ {
+   auto __d1 = std::distance(__first1, __last1);
+   auto __d2 = std::distance(__first2, __last2);
+   if (__d1 != __d2)
+     return false;
+   return std::equal(__first1, __last1, __first2,
+           __binary_pred);
+ }
+
+      for (; __first1 != __last1 && __first2 != __last2;
+   ++__first1, (void)++__first2)
+ if (!bool(__binary_pred(*__first1, *__first2)))
+   return false;
+      return __first1 == __last1 && __first2 == __last2;
+    }
+  template<typename _II1, typename _II2>
+    inline bool
+    lexicographical_compare(_II1 __first1, _II1 __last1,
+       _II2 __first2, _II2 __last2)
+    {
+
+
+
+
+
+     
+     
+     
+     
+      ;
+      ;
+
+      return std::__lexicographical_compare_aux(std::__niter_base(__first1),
+      std::__niter_base(__last1),
+      std::__niter_base(__first2),
+      std::__niter_base(__last2));
+    }
+  template<typename _II1, typename _II2, typename _Compare>
+    inline bool
+    lexicographical_compare(_II1 __first1, _II1 __last1,
+       _II2 __first2, _II2 __last2, _Compare __comp)
+    {
+
+     
+     
+      ;
+      ;
+
+      return std::__lexicographical_compare_impl
+ (__first1, __last1, __first2, __last2,
+  __gnu_cxx::__ops::__iter_comp_iter(__comp));
+    }
+
+  template<typename _InputIterator1, typename _InputIterator2,
+    typename _BinaryPredicate>
+    pair<_InputIterator1, _InputIterator2>
+    __mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
+        _InputIterator2 __first2, _BinaryPredicate __binary_pred)
+    {
+      while (__first1 != __last1 && __binary_pred(__first1, __first2))
+ {
+   ++__first1;
+   ++__first2;
+ }
+      return pair<_InputIterator1, _InputIterator2>(__first1, __first2);
+    }
+  template<typename _InputIterator1, typename _InputIterator2>
+    inline pair<_InputIterator1, _InputIterator2>
+    mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
+      _InputIterator2 __first2)
+    {
+
+     
+     
+     
+
+
+      ;
+
+      return std::__mismatch(__first1, __last1, __first2,
+        __gnu_cxx::__ops::__iter_equal_to_iter());
+    }
+  template<typename _InputIterator1, typename _InputIterator2,
+    typename _BinaryPredicate>
+    inline pair<_InputIterator1, _InputIterator2>
+    mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
+      _InputIterator2 __first2, _BinaryPredicate __binary_pred)
+    {
+
+     
+     
+      ;
+
+      return std::__mismatch(__first1, __last1, __first2,
+ __gnu_cxx::__ops::__iter_comp_iter(__binary_pred));
+    }
+
+
+}
+       
+extern "C++"
+{
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+  using ::div_t;
+  using ::ldiv_t;
+
+  using ::abort;
+  using ::atexit;
+
+
+  using ::at_quick_exit;
+
+
+  using ::atof;
+  using ::atoi;
+  using ::atol;
+  using ::bsearch;
+  using ::calloc;
+  using ::div;
+  using ::exit;
+  using ::free;
+  using ::getenv;
+  using ::labs;
+  using ::ldiv;
+  using ::malloc;
+
+  using ::mblen;
+  using ::mbstowcs;
+  using ::mbtowc;
+
+  using ::qsort;
+
+
+  using ::quick_exit;
+
+
+  using ::rand;
+  using ::realloc;
+  using ::srand;
+  using ::strtod;
+  using ::strtol;
+  using ::strtoul;
+  using ::system;
+
+  using ::wcstombs;
+  using ::wctomb;
+
+
+
+  inline ldiv_t
+  div(long __i, long __j) { return ldiv(__i, __j); }
+
+
+
+
+}
+namespace __gnu_cxx __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+  using ::lldiv_t;
+
+
+
+
+
+  using ::_Exit;
+
+
+
+  using ::llabs;
+
+  inline lldiv_t
+  div(long long __n, long long __d)
+  { lldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; }
+
+  using ::lldiv;
+  using ::atoll;
+  using ::strtoll;
+  using ::strtoull;
+
+  using ::strtof;
+  using ::strtold;
+
+
+}
+
+namespace std
+{
+
+  using ::__gnu_cxx::lldiv_t;
+
+  using ::__gnu_cxx::_Exit;
+
+  using ::__gnu_cxx::llabs;
+  using ::__gnu_cxx::div;
+  using ::__gnu_cxx::lldiv;
+
+  using ::__gnu_cxx::atoll;
+  using ::__gnu_cxx::strtof;
+  using ::__gnu_cxx::strtoll;
+  using ::__gnu_cxx::strtoull;
+  using ::__gnu_cxx::strtold;
+}
+
+
+
+}
+       
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+  template<typename _IIter, typename _Predicate>
+    bool
+    all_of(_IIter, _IIter, _Predicate);
+
+  template<typename _IIter, typename _Predicate>
+    bool
+    any_of(_IIter, _IIter, _Predicate);
+
+
+  template<typename _FIter, typename _Tp>
+    bool
+    binary_search(_FIter, _FIter, const _Tp&);
+
+  template<typename _FIter, typename _Tp, typename _Compare>
+    bool
+    binary_search(_FIter, _FIter, const _Tp&, _Compare);
+  template<typename _IIter, typename _OIter>
+    _OIter
+    copy(_IIter, _IIter, _OIter);
+
+  template<typename _BIter1, typename _BIter2>
+    _BIter2
+    copy_backward(_BIter1, _BIter1, _BIter2);
+
+
+  template<typename _IIter, typename _OIter, typename _Predicate>
+    _OIter
+    copy_if(_IIter, _IIter, _OIter, _Predicate);
+
+  template<typename _IIter, typename _Size, typename _OIter>
+    _OIter
+    copy_n(_IIter, _Size, _OIter);
+
+
+
+
+
+  template<typename _FIter, typename _Tp>
+    pair<_FIter, _FIter>
+    equal_range(_FIter, _FIter, const _Tp&);
+
+  template<typename _FIter, typename _Tp, typename _Compare>
+    pair<_FIter, _FIter>
+    equal_range(_FIter, _FIter, const _Tp&, _Compare);
+
+  template<typename _FIter, typename _Tp>
+    void
+    fill(_FIter, _FIter, const _Tp&);
+
+  template<typename _OIter, typename _Size, typename _Tp>
+    _OIter
+    fill_n(_OIter, _Size, const _Tp&);
+
+
+
+  template<typename _FIter1, typename _FIter2>
+    _FIter1
+    find_end(_FIter1, _FIter1, _FIter2, _FIter2);
+
+  template<typename _FIter1, typename _FIter2, typename _BinaryPredicate>
+    _FIter1
+    find_end(_FIter1, _FIter1, _FIter2, _FIter2, _BinaryPredicate);
+
+
+
+
+
+  template<typename _IIter, typename _Predicate>
+    _IIter
+    find_if_not(_IIter, _IIter, _Predicate);
+
+
+
+
+
+
+  template<typename _IIter1, typename _IIter2>
+    bool
+    includes(_IIter1, _IIter1, _IIter2, _IIter2);
+
+  template<typename _IIter1, typename _IIter2, typename _Compare>
+    bool
+    includes(_IIter1, _IIter1, _IIter2, _IIter2, _Compare);
+
+  template<typename _BIter>
+    void
+    inplace_merge(_BIter, _BIter, _BIter);
+
+  template<typename _BIter, typename _Compare>
+    void
+    inplace_merge(_BIter, _BIter, _BIter, _Compare);
+
+
+  template<typename _RAIter>
+    bool
+    is_heap(_RAIter, _RAIter);
+
+  template<typename _RAIter, typename _Compare>
+    bool
+    is_heap(_RAIter, _RAIter, _Compare);
+
+  template<typename _RAIter>
+    _RAIter
+    is_heap_until(_RAIter, _RAIter);
+
+  template<typename _RAIter, typename _Compare>
+    _RAIter
+    is_heap_until(_RAIter, _RAIter, _Compare);
+
+  template<typename _IIter, typename _Predicate>
+    bool
+    is_partitioned(_IIter, _IIter, _Predicate);
+
+  template<typename _FIter1, typename _FIter2>
+    bool
+    is_permutation(_FIter1, _FIter1, _FIter2);
+
+  template<typename _FIter1, typename _FIter2,
+    typename _BinaryPredicate>
+    bool
+    is_permutation(_FIter1, _FIter1, _FIter2, _BinaryPredicate);
+
+  template<typename _FIter>
+    bool
+    is_sorted(_FIter, _FIter);
+
+  template<typename _FIter, typename _Compare>
+    bool
+    is_sorted(_FIter, _FIter, _Compare);
+
+  template<typename _FIter>
+    _FIter
+    is_sorted_until(_FIter, _FIter);
+
+  template<typename _FIter, typename _Compare>
+    _FIter
+    is_sorted_until(_FIter, _FIter, _Compare);
+
+
+  template<typename _FIter1, typename _FIter2>
+    void
+    iter_swap(_FIter1, _FIter2);
+
+  template<typename _FIter, typename _Tp>
+    _FIter
+    lower_bound(_FIter, _FIter, const _Tp&);
+
+  template<typename _FIter, typename _Tp, typename _Compare>
+    _FIter
+    lower_bound(_FIter, _FIter, const _Tp&, _Compare);
+
+  template<typename _RAIter>
+    void
+    make_heap(_RAIter, _RAIter);
+
+  template<typename _RAIter, typename _Compare>
+    void
+    make_heap(_RAIter, _RAIter, _Compare);
+
+  template<typename _Tp>
+   
+    const _Tp&
+    max(const _Tp&, const _Tp&);
+
+  template<typename _Tp, typename _Compare>
+   
+    const _Tp&
+    max(const _Tp&, const _Tp&, _Compare);
+
+
+
+
+  template<typename _Tp>
+   
+    const _Tp&
+    min(const _Tp&, const _Tp&);
+
+  template<typename _Tp, typename _Compare>
+   
+    const _Tp&
+    min(const _Tp&, const _Tp&, _Compare);
+
+
+
+
+  template<typename _Tp>
+   
+    pair<const _Tp&, const _Tp&>
+    minmax(const _Tp&, const _Tp&);
+
+  template<typename _Tp, typename _Compare>
+   
+    pair<const _Tp&, const _Tp&>
+    minmax(const _Tp&, const _Tp&, _Compare);
+
+  template<typename _FIter>
+   
+    pair<_FIter, _FIter>
+    minmax_element(_FIter, _FIter);
+
+  template<typename _FIter, typename _Compare>
+   
+    pair<_FIter, _FIter>
+    minmax_element(_FIter, _FIter, _Compare);
+
+  template<typename _Tp>
+   
+    _Tp
+    min(initializer_list<_Tp>);
+
+  template<typename _Tp, typename _Compare>
+   
+    _Tp
+    min(initializer_list<_Tp>, _Compare);
+
+  template<typename _Tp>
+   
+    _Tp
+    max(initializer_list<_Tp>);
+
+  template<typename _Tp, typename _Compare>
+   
+    _Tp
+    max(initializer_list<_Tp>, _Compare);
+
+  template<typename _Tp>
+   
+    pair<_Tp, _Tp>
+    minmax(initializer_list<_Tp>);
+
+  template<typename _Tp, typename _Compare>
+   
+    pair<_Tp, _Tp>
+    minmax(initializer_list<_Tp>, _Compare);
+
+
+
+
+  template<typename _BIter>
+    bool
+    next_permutation(_BIter, _BIter);
+
+  template<typename _BIter, typename _Compare>
+    bool
+    next_permutation(_BIter, _BIter, _Compare);
+
+
+  template<typename _IIter, typename _Predicate>
+    bool
+    none_of(_IIter, _IIter, _Predicate);
+
+
+
+
+
+  template<typename _IIter, typename _RAIter>
+    _RAIter
+    partial_sort_copy(_IIter, _IIter, _RAIter, _RAIter);
+
+  template<typename _IIter, typename _RAIter, typename _Compare>
+    _RAIter
+    partial_sort_copy(_IIter, _IIter, _RAIter, _RAIter, _Compare);
+
+
+
+
+  template<typename _IIter, typename _OIter1,
+    typename _OIter2, typename _Predicate>
+    pair<_OIter1, _OIter2>
+    partition_copy(_IIter, _IIter, _OIter1, _OIter2, _Predicate);
+
+  template<typename _FIter, typename _Predicate>
+    _FIter
+    partition_point(_FIter, _FIter, _Predicate);
+
+
+  template<typename _RAIter>
+    void
+    pop_heap(_RAIter, _RAIter);
+
+  template<typename _RAIter, typename _Compare>
+    void
+    pop_heap(_RAIter, _RAIter, _Compare);
+
+  template<typename _BIter>
+    bool
+    prev_permutation(_BIter, _BIter);
+
+  template<typename _BIter, typename _Compare>
+    bool
+    prev_permutation(_BIter, _BIter, _Compare);
+
+  template<typename _RAIter>
+    void
+    push_heap(_RAIter, _RAIter);
+
+  template<typename _RAIter, typename _Compare>
+    void
+    push_heap(_RAIter, _RAIter, _Compare);
+
+
+
+  template<typename _FIter, typename _Tp>
+    _FIter
+    remove(_FIter, _FIter, const _Tp&);
+
+  template<typename _FIter, typename _Predicate>
+    _FIter
+    remove_if(_FIter, _FIter, _Predicate);
+
+  template<typename _IIter, typename _OIter, typename _Tp>
+    _OIter
+    remove_copy(_IIter, _IIter, _OIter, const _Tp&);
+
+  template<typename _IIter, typename _OIter, typename _Predicate>
+    _OIter
+    remove_copy_if(_IIter, _IIter, _OIter, _Predicate);
+
+
+
+  template<typename _IIter, typename _OIter, typename _Tp>
+    _OIter
+    replace_copy(_IIter, _IIter, _OIter, const _Tp&, const _Tp&);
+
+  template<typename _Iter, typename _OIter, typename _Predicate, typename _Tp>
+    _OIter
+    replace_copy_if(_Iter, _Iter, _OIter, _Predicate, const _Tp&);
+
+
+
+  template<typename _BIter>
+    void
+    reverse(_BIter, _BIter);
+
+  template<typename _BIter, typename _OIter>
+    _OIter
+    reverse_copy(_BIter, _BIter, _OIter);
+
+  inline namespace _V2
+  {
+    template<typename _FIter>
+      _FIter
+      rotate(_FIter, _FIter, _FIter);
+  }
+
+  template<typename _FIter, typename _OIter>
+    _OIter
+    rotate_copy(_FIter, _FIter, _FIter, _OIter);
+  template<typename _RAIter, typename _UGenerator>
+    void
+    shuffle(_RAIter, _RAIter, _UGenerator&&);
+
+
+  template<typename _RAIter>
+    void
+    sort_heap(_RAIter, _RAIter);
+
+  template<typename _RAIter, typename _Compare>
+    void
+    sort_heap(_RAIter, _RAIter, _Compare);
+
+  template<typename _BIter, typename _Predicate>
+    _BIter
+    stable_partition(_BIter, _BIter, _Predicate);
+  template<typename _FIter1, typename _FIter2>
+    _FIter2
+    swap_ranges(_FIter1, _FIter1, _FIter2);
+
+
+
+  template<typename _FIter>
+    _FIter
+    unique(_FIter, _FIter);
+
+  template<typename _FIter, typename _BinaryPredicate>
+    _FIter
+    unique(_FIter, _FIter, _BinaryPredicate);
+
+
+
+  template<typename _FIter, typename _Tp>
+    _FIter
+    upper_bound(_FIter, _FIter, const _Tp&);
+
+  template<typename _FIter, typename _Tp, typename _Compare>
+    _FIter
+    upper_bound(_FIter, _FIter, const _Tp&, _Compare);
+
+
+
+  template<typename _FIter>
+    _FIter
+    adjacent_find(_FIter, _FIter);
+
+  template<typename _FIter, typename _BinaryPredicate>
+    _FIter
+    adjacent_find(_FIter, _FIter, _BinaryPredicate);
+
+  template<typename _IIter, typename _Tp>
+    typename iterator_traits<_IIter>::difference_type
+    count(_IIter, _IIter, const _Tp&);
+
+  template<typename _IIter, typename _Predicate>
+    typename iterator_traits<_IIter>::difference_type
+    count_if(_IIter, _IIter, _Predicate);
+
+  template<typename _IIter1, typename _IIter2>
+    bool
+    equal(_IIter1, _IIter1, _IIter2);
+
+  template<typename _IIter1, typename _IIter2, typename _BinaryPredicate>
+    bool
+    equal(_IIter1, _IIter1, _IIter2, _BinaryPredicate);
+
+  template<typename _IIter, typename _Tp>
+    _IIter
+    find(_IIter, _IIter, const _Tp&);
+
+  template<typename _FIter1, typename _FIter2>
+    _FIter1
+    find_first_of(_FIter1, _FIter1, _FIter2, _FIter2);
+
+  template<typename _FIter1, typename _FIter2, typename _BinaryPredicate>
+    _FIter1
+    find_first_of(_FIter1, _FIter1, _FIter2, _FIter2, _BinaryPredicate);
+
+  template<typename _IIter, typename _Predicate>
+    _IIter
+    find_if(_IIter, _IIter, _Predicate);
+
+  template<typename _IIter, typename _Funct>
+    _Funct
+    for_each(_IIter, _IIter, _Funct);
+
+  template<typename _FIter, typename _Generator>
+    void
+    generate(_FIter, _FIter, _Generator);
+
+  template<typename _OIter, typename _Size, typename _Generator>
+    _OIter
+    generate_n(_OIter, _Size, _Generator);
+
+  template<typename _IIter1, typename _IIter2>
+    bool
+    lexicographical_compare(_IIter1, _IIter1, _IIter2, _IIter2);
+
+  template<typename _IIter1, typename _IIter2, typename _Compare>
+    bool
+    lexicographical_compare(_IIter1, _IIter1, _IIter2, _IIter2, _Compare);
+
+  template<typename _FIter>
+   
+    _FIter
+    max_element(_FIter, _FIter);
+
+  template<typename _FIter, typename _Compare>
+   
+    _FIter
+    max_element(_FIter, _FIter, _Compare);
+
+  template<typename _IIter1, typename _IIter2, typename _OIter>
+    _OIter
+    merge(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
+
+  template<typename _IIter1, typename _IIter2, typename _OIter,
+    typename _Compare>
+    _OIter
+    merge(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare);
+
+  template<typename _FIter>
+   
+    _FIter
+    min_element(_FIter, _FIter);
+
+  template<typename _FIter, typename _Compare>
+   
+    _FIter
+    min_element(_FIter, _FIter, _Compare);
+
+  template<typename _IIter1, typename _IIter2>
+    pair<_IIter1, _IIter2>
+    mismatch(_IIter1, _IIter1, _IIter2);
+
+  template<typename _IIter1, typename _IIter2, typename _BinaryPredicate>
+    pair<_IIter1, _IIter2>
+    mismatch(_IIter1, _IIter1, _IIter2, _BinaryPredicate);
+
+  template<typename _RAIter>
+    void
+    nth_element(_RAIter, _RAIter, _RAIter);
+
+  template<typename _RAIter, typename _Compare>
+    void
+    nth_element(_RAIter, _RAIter, _RAIter, _Compare);
+
+  template<typename _RAIter>
+    void
+    partial_sort(_RAIter, _RAIter, _RAIter);
+
+  template<typename _RAIter, typename _Compare>
+    void
+    partial_sort(_RAIter, _RAIter, _RAIter, _Compare);
+
+  template<typename _BIter, typename _Predicate>
+    _BIter
+    partition(_BIter, _BIter, _Predicate);
+
+  template<typename _RAIter>
+    void
+    random_shuffle(_RAIter, _RAIter);
+
+  template<typename _RAIter, typename _Generator>
+    void
+    random_shuffle(_RAIter, _RAIter,
+
+     _Generator&&);
+
+
+
+
+  template<typename _FIter, typename _Tp>
+    void
+    replace(_FIter, _FIter, const _Tp&, const _Tp&);
+
+  template<typename _FIter, typename _Predicate, typename _Tp>
+    void
+    replace_if(_FIter, _FIter, _Predicate, const _Tp&);
+
+  template<typename _FIter1, typename _FIter2>
+    _FIter1
+    search(_FIter1, _FIter1, _FIter2, _FIter2);
+
+  template<typename _FIter1, typename _FIter2, typename _BinaryPredicate>
+    _FIter1
+    search(_FIter1, _FIter1, _FIter2, _FIter2, _BinaryPredicate);
+
+  template<typename _FIter, typename _Size, typename _Tp>
+    _FIter
+    search_n(_FIter, _FIter, _Size, const _Tp&);
+
+  template<typename _FIter, typename _Size, typename _Tp,
+    typename _BinaryPredicate>
+    _FIter
+    search_n(_FIter, _FIter, _Size, const _Tp&, _BinaryPredicate);
+
+  template<typename _IIter1, typename _IIter2, typename _OIter>
+    _OIter
+    set_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
+
+  template<typename _IIter1, typename _IIter2, typename _OIter,
+    typename _Compare>
+    _OIter
+    set_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare);
+
+  template<typename _IIter1, typename _IIter2, typename _OIter>
+    _OIter
+    set_intersection(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
+
+  template<typename _IIter1, typename _IIter2, typename _OIter,
+    typename _Compare>
+    _OIter
+    set_intersection(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare);
+
+  template<typename _IIter1, typename _IIter2, typename _OIter>
+    _OIter
+    set_symmetric_difference(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
+
+  template<typename _IIter1, typename _IIter2, typename _OIter,
+    typename _Compare>
+    _OIter
+    set_symmetric_difference(_IIter1, _IIter1, _IIter2, _IIter2,
+        _OIter, _Compare);
+
+  template<typename _IIter1, typename _IIter2, typename _OIter>
+    _OIter
+    set_union(_IIter1, _IIter1, _IIter2, _IIter2, _OIter);
+
+  template<typename _IIter1, typename _IIter2, typename _OIter,
+    typename _Compare>
+    _OIter
+    set_union(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare);
+
+  template<typename _RAIter>
+    void
+    sort(_RAIter, _RAIter);
+
+  template<typename _RAIter, typename _Compare>
+    void
+    sort(_RAIter, _RAIter, _Compare);
+
+  template<typename _RAIter>
+    void
+    stable_sort(_RAIter, _RAIter);
+
+  template<typename _RAIter, typename _Compare>
+    void
+    stable_sort(_RAIter, _RAIter, _Compare);
+
+  template<typename _IIter, typename _OIter, typename _UnaryOperation>
+    _OIter
+    transform(_IIter, _IIter, _OIter, _UnaryOperation);
+
+  template<typename _IIter1, typename _IIter2, typename _OIter,
+    typename _BinaryOperation>
+    _OIter
+    transform(_IIter1, _IIter1, _IIter2, _OIter, _BinaryOperation);
+
+  template<typename _IIter, typename _OIter>
+    _OIter
+    unique_copy(_IIter, _IIter, _OIter);
+
+  template<typename _IIter, typename _OIter, typename _BinaryPredicate>
+    _OIter
+    unique_copy(_IIter, _IIter, _OIter, _BinaryPredicate);
+
+
+
+}
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+
+
+
+
+  template<typename _RandomAccessIterator, typename _Distance,
+    typename _Compare>
+    _Distance
+    __is_heap_until(_RandomAccessIterator __first, _Distance __n,
+      _Compare& __comp)
+    {
+      _Distance __parent = 0;
+      for (_Distance __child = 1; __child < __n; ++__child)
+ {
+   if (__comp(__first + __parent, __first + __child))
+     return __child;
+   if ((__child & 1) == 0)
+     ++__parent;
+ }
+      return __n;
+    }
+
+
+
+  template<typename _RandomAccessIterator, typename _Distance>
+    inline bool
+    __is_heap(_RandomAccessIterator __first, _Distance __n)
+    {
+      __gnu_cxx::__ops::_Iter_less_iter __comp;
+      return std::__is_heap_until(__first, __n, __comp) == __n;
+    }
+
+  template<typename _RandomAccessIterator, typename _Compare,
+    typename _Distance>
+    inline bool
+    __is_heap(_RandomAccessIterator __first, _Compare __comp, _Distance __n)
+    {
+      typedef __decltype(__comp) _Cmp;
+      __gnu_cxx::__ops::_Iter_comp_iter<_Cmp> __cmp(std::move(__comp));
+      return std::__is_heap_until(__first, __n, __cmp) == __n;
+    }
+
+  template<typename _RandomAccessIterator>
+    inline bool
+    __is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
+    { return std::__is_heap(__first, std::distance(__first, __last)); }
+
+  template<typename _RandomAccessIterator, typename _Compare>
+    inline bool
+    __is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
+       _Compare __comp)
+    {
+      return std::__is_heap(__first, std::move(__comp),
+       std::distance(__first, __last));
+    }
+
+
+
+
+  template<typename _RandomAccessIterator, typename _Distance, typename _Tp,
+    typename _Compare>
+    void
+    __push_heap(_RandomAccessIterator __first,
+  _Distance __holeIndex, _Distance __topIndex, _Tp __value,
+  _Compare& __comp)
+    {
+      _Distance __parent = (__holeIndex - 1) / 2;
+      while (__holeIndex > __topIndex && __comp(__first + __parent, __value))
+ {
+   *(__first + __holeIndex) = std::move(*(__first + __parent));
+   __holeIndex = __parent;
+   __parent = (__holeIndex - 1) / 2;
+ }
+      *(__first + __holeIndex) = std::move(__value);
+    }
+  template<typename _RandomAccessIterator>
+    inline void
+    push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
+    {
+      typedef typename iterator_traits<_RandomAccessIterator>::value_type
+   _ValueType;
+      typedef typename iterator_traits<_RandomAccessIterator>::difference_type
+   _DistanceType;
+
+
+     
+
+     
+      ;
+      ;
+      ;
+
+      __gnu_cxx::__ops::_Iter_less_val __comp;
+      _ValueType __value = std::move(*(__last - 1));
+      std::__push_heap(__first, _DistanceType((__last - __first) - 1),
+         _DistanceType(0), std::move(__value), __comp);
+    }
+  template<typename _RandomAccessIterator, typename _Compare>
+    inline void
+    push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
+       _Compare __comp)
+    {
+      typedef typename iterator_traits<_RandomAccessIterator>::value_type
+   _ValueType;
+      typedef typename iterator_traits<_RandomAccessIterator>::difference_type
+   _DistanceType;
+
+
+     
+
+      ;
+      ;
+      ;
+
+      __decltype(__gnu_cxx::__ops::__iter_comp_val(std::move(__comp)))
+ __cmp(std::move(__comp));
+      _ValueType __value = std::move(*(__last - 1));
+      std::__push_heap(__first, _DistanceType((__last - __first) - 1),
+         _DistanceType(0), std::move(__value), __cmp);
+    }
+
+  template<typename _RandomAccessIterator, typename _Distance,
+    typename _Tp, typename _Compare>
+    void
+    __adjust_heap(_RandomAccessIterator __first, _Distance __holeIndex,
+    _Distance __len, _Tp __value, _Compare __comp)
+    {
+      const _Distance __topIndex = __holeIndex;
+      _Distance __secondChild = __holeIndex;
+      while (__secondChild < (__len - 1) / 2)
+ {
+   __secondChild = 2 * (__secondChild + 1);
+   if (__comp(__first + __secondChild,
+       __first + (__secondChild - 1)))
+     __secondChild--;
+   *(__first + __holeIndex) = std::move(*(__first + __secondChild));
+   __holeIndex = __secondChild;
+ }
+      if ((__len & 1) == 0 && __secondChild == (__len - 2) / 2)
+ {
+   __secondChild = 2 * (__secondChild + 1);
+   *(__first + __holeIndex) = std::move(*(__first + (__secondChild - 1)))
+                                  ;
+   __holeIndex = __secondChild - 1;
+ }
+      __decltype(__gnu_cxx::__ops::__iter_comp_val(std::move(__comp)))
+ __cmp(std::move(__comp));
+      std::__push_heap(__first, __holeIndex, __topIndex,
+         std::move(__value), __cmp);
+    }
+
+  template<typename _RandomAccessIterator, typename _Compare>
+    inline void
+    __pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
+        _RandomAccessIterator __result, _Compare& __comp)
+    {
+      typedef typename iterator_traits<_RandomAccessIterator>::value_type
+ _ValueType;
+      typedef typename iterator_traits<_RandomAccessIterator>::difference_type
+ _DistanceType;
+
+      _ValueType __value = std::move(*__result);
+      *__result = std::move(*__first);
+      std::__adjust_heap(__first, _DistanceType(0),
+    _DistanceType(__last - __first),
+    std::move(__value), __comp);
+    }
+  template<typename _RandomAccessIterator>
+    inline void
+    pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
+    {
+
+     
+
+     
+
+      ;
+      ;
+      ;
+      ;
+
+      if (__last - __first > 1)
+ {
+   --__last;
+   __gnu_cxx::__ops::_Iter_less_iter __comp;
+   std::__pop_heap(__first, __last, __last, __comp);
+ }
+    }
+  template<typename _RandomAccessIterator, typename _Compare>
+    inline void
+    pop_heap(_RandomAccessIterator __first,
+      _RandomAccessIterator __last, _Compare __comp)
+    {
+
+     
+
+      ;
+      ;
+      ;
+      ;
+
+      if (__last - __first > 1)
+ {
+   typedef __decltype(__comp) _Cmp;
+   __gnu_cxx::__ops::_Iter_comp_iter<_Cmp> __cmp(std::move(__comp));
+   --__last;
+   std::__pop_heap(__first, __last, __last, __cmp);
+ }
+    }
+
+  template<typename _RandomAccessIterator, typename _Compare>
+    void
+    __make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
+  _Compare& __comp)
+    {
+      typedef typename iterator_traits<_RandomAccessIterator>::value_type
+   _ValueType;
+      typedef typename iterator_traits<_RandomAccessIterator>::difference_type
+   _DistanceType;
+
+      if (__last - __first < 2)
+ return;
+
+      const _DistanceType __len = __last - __first;
+      _DistanceType __parent = (__len - 2) / 2;
+      while (true)
+ {
+   _ValueType __value = std::move(*(__first + __parent));
+   std::__adjust_heap(__first, __parent, __len, std::move(__value),
+        __comp);
+   if (__parent == 0)
+     return;
+   __parent--;
+ }
+    }
+  template<typename _RandomAccessIterator>
+    inline void
+    make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
+    {
+
+     
+
+     
+
+      ;
+      ;
+
+      __gnu_cxx::__ops::_Iter_less_iter __comp;
+      std::__make_heap(__first, __last, __comp);
+    }
+  template<typename _RandomAccessIterator, typename _Compare>
+    inline void
+    make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
+       _Compare __comp)
+    {
+
+     
+
+      ;
+      ;
+
+      typedef __decltype(__comp) _Cmp;
+      __gnu_cxx::__ops::_Iter_comp_iter<_Cmp> __cmp(std::move(__comp));
+      std::__make_heap(__first, __last, __cmp);
+    }
+
+  template<typename _RandomAccessIterator, typename _Compare>
+    void
+    __sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
+  _Compare& __comp)
+    {
+      while (__last - __first > 1)
+ {
+   --__last;
+   std::__pop_heap(__first, __last, __last, __comp);
+ }
+    }
+  template<typename _RandomAccessIterator>
+    inline void
+    sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
+    {
+
+     
+
+     
+
+      ;
+      ;
+      ;
+
+      __gnu_cxx::__ops::_Iter_less_iter __comp;
+      std::__sort_heap(__first, __last, __comp);
+    }
+  template<typename _RandomAccessIterator, typename _Compare>
+    inline void
+    sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
+       _Compare __comp)
+    {
+
+     
+
+      ;
+      ;
+      ;
+
+      typedef __decltype(__comp) _Cmp;
+      __gnu_cxx::__ops::_Iter_comp_iter<_Cmp> __cmp(std::move(__comp));
+      std::__sort_heap(__first, __last, __cmp);
+    }
+  template<typename _RandomAccessIterator>
+    inline _RandomAccessIterator
+    is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last)
+    {
+
+     
+
+     
+
+      ;
+      ;
+
+      __gnu_cxx::__ops::_Iter_less_iter __comp;
+      return __first +
+ std::__is_heap_until(__first, std::distance(__first, __last), __comp);
+    }
+  template<typename _RandomAccessIterator, typename _Compare>
+    inline _RandomAccessIterator
+    is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last,
+    _Compare __comp)
+    {
+
+     
+
+      ;
+      ;
+
+      typedef __decltype(__comp) _Cmp;
+      __gnu_cxx::__ops::_Iter_comp_iter<_Cmp> __cmp(std::move(__comp));
+      return __first
+ + std::__is_heap_until(__first, std::distance(__first, __last), __cmp);
+    }
+  template<typename _RandomAccessIterator>
+    inline bool
+    is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
+    { return std::is_heap_until(__first, __last) == __last; }
+  template<typename _RandomAccessIterator, typename _Compare>
+    inline bool
+    is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
+     _Compare __comp)
+    {
+
+     
+
+      ;
+      ;
+
+      const auto __dist = std::distance(__first, __last);
+      typedef __decltype(__comp) _Cmp;
+      __gnu_cxx::__ops::_Iter_comp_iter<_Cmp> __cmp(std::move(__comp));
+      return std::__is_heap_until(__first, __dist, __cmp) == __dist;
+    }
+
+
+
+}
+       
+
+
+       
+
+
+
+       
+
+
+
+
+extern "C++" {
+
+namespace std
+{
+  class exception
+  {
+  public:
+    exception() noexcept { }
+    virtual ~exception() noexcept;
+
+
+
+    virtual const char*
+    what() const noexcept;
+  };
+
+}
+
+}
+
+
+extern "C++" {
+
+namespace std
+{
+
+
+  class bad_exception : public exception
+  {
+  public:
+    bad_exception() noexcept { }
+
+
+
+    virtual ~bad_exception() noexcept;
+
+
+    virtual const char*
+    what() const noexcept;
+  };
+
+
+  typedef void (*terminate_handler) ();
+
+
+  typedef void (*unexpected_handler) ();
+
+
+  terminate_handler set_terminate(terminate_handler) noexcept;
+
+
+
+  terminate_handler get_terminate() noexcept;
+
+
+
+
+  void terminate() noexcept __attribute__ ((__noreturn__));
+
+
+  unexpected_handler set_unexpected(unexpected_handler) noexcept;
+
+
+
+  unexpected_handler get_unexpected() noexcept;
+
+
+
+
+  void unexpected() __attribute__ ((__noreturn__));
+ 
+  bool uncaught_exception() noexcept __attribute__ ((__pure__));
+}
+
+namespace __gnu_cxx
+{
+
+  void __verbose_terminate_handler();
+
+
+}
+
+}
+
+
+
+
+
+
+       
+
+
+namespace std
+{
+  class type_info;
+}
+
+namespace __cxxabiv1
+{
+  struct __cxa_refcounted_exception;
+
+  extern "C"
+    {
+
+      void*
+      __cxa_allocate_exception(size_t) noexcept;
+
+
+      __cxa_refcounted_exception*
+      __cxa_init_primary_exception(void *object, std::type_info *tinfo,
+                void ( *dest) (void *)) noexcept;
+
+    }
+}
+
+
+
+       
+
+
+
+       
+
+
+
+namespace std
+{
+
+
+
+
+
+
+
+  size_t
+  _Hash_bytes(const void* __ptr, size_t __len, size_t __seed);
+
+
+
+
+
+  size_t
+  _Fnv_hash_bytes(const void* __ptr, size_t __len, size_t __seed);
+
+
+}
+
+
+
+extern "C++" {
+
+namespace __cxxabiv1
+{
+  class __class_type_info;
+}
+namespace std
+{
+
+
+
+
+
+
+  class type_info
+  {
+  public:
+
+
+
+
+    virtual ~type_info();
+
+
+
+    const char* name() const noexcept
+    { return __name[0] == '*' ? __name + 1 : __name; }
+    bool before(const type_info& __arg) const noexcept
+    { return (__name[0] == '*' && __arg.__name[0] == '*')
+ ? __name < __arg.__name
+ : __builtin_strcmp (__name, __arg.__name) < 0; }
+
+    bool operator==(const type_info& __arg) const noexcept
+    {
+      return ((__name == __arg.__name)
+       || (__name[0] != '*' &&
+    __builtin_strcmp (__name, __arg.__name) == 0));
+    }
+    bool operator!=(const type_info& __arg) const noexcept
+    { return !operator==(__arg); }
+
+
+    size_t hash_code() const noexcept
+    {
+
+      return _Hash_bytes(name(), __builtin_strlen(name()),
+    static_cast<size_t>(0xc70f6907UL));
+
+
+
+    }
+
+
+
+    virtual bool __is_pointer_p() const;
+
+
+    virtual bool __is_function_p() const;
+
+
+
+
+
+
+
+    virtual bool __do_catch(const type_info *__thr_type, void **__thr_obj,
+       unsigned __outer) const;
+
+
+    virtual bool __do_upcast(const __cxxabiv1::__class_type_info *__target,
+        void **__obj_ptr) const;
+
+  protected:
+    const char *__name;
+
+    explicit type_info(const char *__n): __name(__n) { }
+
+  private:
+
+    type_info& operator=(const type_info&);
+    type_info(const type_info&);
+  };
+
+
+
+
+
+
+
+  class bad_cast : public exception
+  {
+  public:
+    bad_cast() noexcept { }
+
+
+
+    virtual ~bad_cast() noexcept;
+
+
+    virtual const char* what() const noexcept;
+  };
+
+
+
+
+
+  class bad_typeid : public exception
+  {
+  public:
+    bad_typeid () noexcept { }
+
+
+
+    virtual ~bad_typeid() noexcept;
+
+
+    virtual const char* what() const noexcept;
+  };
+}
+
+}
+
+
+extern "C++" {
+
+namespace std
+{
+  class type_info;
+
+
+
+
+
+  namespace __exception_ptr
+  {
+    class exception_ptr;
+  }
+
+  using __exception_ptr::exception_ptr;
+
+
+
+
+
+  exception_ptr current_exception() noexcept;
+
+  template<typename _Ex>
+  exception_ptr make_exception_ptr(_Ex) noexcept;
+
+
+  void rethrow_exception(exception_ptr) __attribute__ ((__noreturn__));
+
+  namespace __exception_ptr
+  {
+    using std::rethrow_exception;
+
+
+
+
+
+    class exception_ptr
+    {
+      void* _M_exception_object;
+
+      explicit exception_ptr(void* __e) noexcept;
+
+      void _M_addref() noexcept;
+      void _M_release() noexcept;
+
+      void *_M_get() const noexcept __attribute__ ((__pure__));
+
+      friend exception_ptr std::current_exception() noexcept;
+      friend void std::rethrow_exception(exception_ptr);
+      template<typename _Ex>
+      friend exception_ptr std::make_exception_ptr(_Ex) noexcept;
+
+    public:
+      exception_ptr() noexcept;
+
+      exception_ptr(const exception_ptr&) noexcept;
+
+
+      exception_ptr(nullptr_t) noexcept
+      : _M_exception_object(0)
+      { }
+
+      exception_ptr(exception_ptr&& __o) noexcept
+      : _M_exception_object(__o._M_exception_object)
+      { __o._M_exception_object = 0; }
+      exception_ptr&
+      operator=(const exception_ptr&) noexcept;
+
+
+      exception_ptr&
+      operator=(exception_ptr&& __o) noexcept
+      {
+        exception_ptr(static_cast<exception_ptr&&>(__o)).swap(*this);
+        return *this;
+      }
+
+
+      ~exception_ptr() noexcept;
+
+      void
+      swap(exception_ptr&) noexcept;
+      explicit operator bool() const
+      { return _M_exception_object; }
+
+
+      friend bool
+      operator==(const exception_ptr&, const exception_ptr&)
+ noexcept __attribute__ ((__pure__));
+
+      const class std::type_info*
+      __cxa_exception_type() const noexcept
+ __attribute__ ((__pure__));
+    };
+
+    bool
+    operator==(const exception_ptr&, const exception_ptr&)
+      noexcept __attribute__ ((__pure__));
+
+    bool
+    operator!=(const exception_ptr&, const exception_ptr&)
+      noexcept __attribute__ ((__pure__));
+
+    inline void
+    swap(exception_ptr& __lhs, exception_ptr& __rhs)
+    { __lhs.swap(__rhs); }
+
+    template<typename _Ex>
+      inline void
+      __dest_thunk(void* __x)
+      { static_cast<_Ex*>(__x)->~_Ex(); }
+
+  }
+
+
+  template<typename _Ex>
+    exception_ptr
+    make_exception_ptr(_Ex __ex) noexcept
+    {
+      return exception_ptr();
+
+    }
+
+
+}
+
+}
+
+extern "C++" {
+
+namespace std
+{
+
+
+
+
+
+
+  class nested_exception
+  {
+    exception_ptr _M_ptr;
+
+  public:
+    nested_exception() noexcept : _M_ptr(current_exception()) { }
+
+    nested_exception(const nested_exception&) noexcept = default;
+
+    nested_exception& operator=(const nested_exception&) noexcept = default;
+
+    virtual ~nested_exception() noexcept;
+
+    [[noreturn]]
+    void
+    rethrow_nested() const
+    {
+      if (_M_ptr)
+ rethrow_exception(_M_ptr);
+      std::terminate();
+    }
+
+    exception_ptr
+    nested_ptr() const noexcept
+    { return _M_ptr; }
+  };
+
+  template<typename _Except>
+    struct _Nested_exception : public _Except, public nested_exception
+    {
+      explicit _Nested_exception(const _Except& __ex)
+      : _Except(__ex)
+      { }
+
+      explicit _Nested_exception(_Except&& __ex)
+      : _Except(static_cast<_Except&&>(__ex))
+      { }
+    };
+
+
+
+
+  template<typename _Tp>
+    [[noreturn]]
+    inline void
+    __throw_with_nested_impl(_Tp&& __t, true_type)
+    {
+      using _Up = typename remove_reference<_Tp>::type;
+      throw _Nested_exception<_Up>{std::forward<_Tp>(__t)};
+    }
+
+  template<typename _Tp>
+    [[noreturn]]
+    inline void
+    __throw_with_nested_impl(_Tp&& __t, false_type)
+    { throw std::forward<_Tp>(__t); }
+
+
+
+  template<typename _Tp>
+    [[noreturn]]
+    inline void
+    throw_with_nested(_Tp&& __t)
+    {
+      using _Up = typename decay<_Tp>::type;
+      using _CopyConstructible
+ = __and_<is_copy_constructible<_Up>, is_move_constructible<_Up>>;
+      static_assert(_CopyConstructible::value,
+   "throw_with_nested argument must be CopyConstructible");
+      using __nest = __and_<is_class<_Up>, __bool_constant<!__is_final(_Up)>,
+       __not_<is_base_of<nested_exception, _Up>>>;
+      std::__throw_with_nested_impl(std::forward<_Tp>(__t), __nest{});
+    }
+
+
+  template<typename _Tp>
+    using __rethrow_if_nested_cond = typename enable_if<
+      __and_<is_polymorphic<_Tp>,
+      __or_<__not_<is_base_of<nested_exception, _Tp>>,
+     is_convertible<_Tp*, nested_exception*>>>::value
+    >::type;
+
+
+  template<typename _Ex>
+    inline __rethrow_if_nested_cond<_Ex>
+    __rethrow_if_nested_impl(const _Ex* __ptr)
+    {
+      if (auto __ne_ptr = dynamic_cast<const nested_exception*>(__ptr))
+ __ne_ptr->rethrow_nested();
+    }
+
+
+  inline void
+  __rethrow_if_nested_impl(const void*)
+  { }
+
+
+  template<typename _Ex>
+    inline void
+    rethrow_if_nested(const _Ex& __ex)
+    { std::__rethrow_if_nested_impl(std::__addressof(__ex)); }
+
+
+}
+
+}
+
+
+
+
+
+extern "C++" {
+
+namespace std
+{
+
+
+
+
+
+
+  class bad_alloc : public exception
+  {
+  public:
+    bad_alloc() throw() { }
+
+
+
+    virtual ~bad_alloc() throw();
+
+
+    virtual const char* what() const throw();
+  };
+
+
+  class bad_array_new_length : public bad_alloc
+  {
+  public:
+    bad_array_new_length() throw() { }
+
+
+
+    virtual ~bad_array_new_length() throw();
+
+
+    virtual const char* what() const throw();
+  };
+
+
+
+
+
+
+  struct nothrow_t
+  {
+
+    explicit nothrow_t() = default;
+
+  };
+
+  extern const nothrow_t nothrow;
+
+
+
+  typedef void (*new_handler)();
+
+
+
+  new_handler set_new_handler(new_handler) throw();
+
+
+
+  new_handler get_new_handler() noexcept;
+
+}
+void* operator new(std::size_t)
+  __attribute__((__externally_visible__));
+void* operator new[](std::size_t)
+  __attribute__((__externally_visible__));
+void operator delete(void*) noexcept
+  __attribute__((__externally_visible__));
+void operator delete[](void*) noexcept
+  __attribute__((__externally_visible__));
+
+
+
+
+
+
+void* operator new(std::size_t, const std::nothrow_t&) noexcept
+  __attribute__((__externally_visible__));
+void* operator new[](std::size_t, const std::nothrow_t&) noexcept
+  __attribute__((__externally_visible__));
+void operator delete(void*, const std::nothrow_t&) noexcept
+  __attribute__((__externally_visible__));
+void operator delete[](void*, const std::nothrow_t&) noexcept
+  __attribute__((__externally_visible__));
+inline void* operator new(std::size_t, void* __p) noexcept
+{ return __p; }
+inline void* operator new[](std::size_t, void* __p) noexcept
+{ return __p; }
+
+
+inline void operator delete (void*, void*) noexcept { }
+inline void operator delete[](void*, void*) noexcept { }
+
+}
+
+       
+
+
+
+       
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+  template<typename>
+    class allocator;
+
+  template<>
+    class allocator<void>;
+
+
+  template<typename, typename>
+    struct uses_allocator;
+
+
+
+
+}
+
+
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+  struct __allocator_traits_base
+  {
+    template<typename _Tp, typename _Up, typename = void>
+      struct __rebind : __replace_first_arg<_Tp, _Up> { };
+
+    template<typename _Tp, typename _Up>
+      struct __rebind<_Tp, _Up,
+        __void_t<typename _Tp::template rebind<_Up>::other>>
+      { using type = typename _Tp::template rebind<_Up>::other; };
+
+  protected:
+    template<typename _Tp>
+      using __pointer = typename _Tp::pointer;
+    template<typename _Tp>
+      using __c_pointer = typename _Tp::const_pointer;
+    template<typename _Tp>
+      using __v_pointer = typename _Tp::void_pointer;
+    template<typename _Tp>
+      using __cv_pointer = typename _Tp::const_void_pointer;
+    template<typename _Tp>
+      using __pocca = typename _Tp::propagate_on_container_copy_assignment;
+    template<typename _Tp>
+      using __pocma = typename _Tp::propagate_on_container_move_assignment;
+    template<typename _Tp>
+      using __pocs = typename _Tp::propagate_on_container_swap;
+    template<typename _Tp>
+      using __equal = typename _Tp::is_always_equal;
+  };
+
+  template<typename _Alloc, typename _Up>
+    using __alloc_rebind
+      = typename __allocator_traits_base::template __rebind<_Alloc, _Up>::type;
+
+
+
+
+
+  template<typename _Alloc>
+    struct allocator_traits : __allocator_traits_base
+    {
+
+      typedef _Alloc allocator_type;
+
+      typedef typename _Alloc::value_type value_type;
+
+
+
+
+
+
+      using pointer = __detected_or_t<value_type*, __pointer, _Alloc>;
+
+    private:
+
+      template<template<typename> class _Func, typename _Tp, typename = void>
+ struct _Ptr
+ {
+   using type = typename pointer_traits<pointer>::template rebind<_Tp>;
+ };
+
+      template<template<typename> class _Func, typename _Tp>
+ struct _Ptr<_Func, _Tp, __void_t<_Func<_Alloc>>>
+ {
+   using type = _Func<_Alloc>;
+ };
+
+
+      template<typename _A2, typename _PtrT, typename = void>
+ struct _Diff
+ { using type = typename pointer_traits<_PtrT>::difference_type; };
+
+      template<typename _A2, typename _PtrT>
+ struct _Diff<_A2, _PtrT, __void_t<typename _A2::difference_type>>
+ { using type = typename _A2::difference_type; };
+
+
+      template<typename _A2, typename _DiffT, typename = void>
+ struct _Size : make_unsigned<_DiffT> { };
+
+      template<typename _A2, typename _DiffT>
+ struct _Size<_A2, _DiffT, __void_t<typename _A2::size_type>>
+ { using type = typename _A2::size_type; };
+
+    public:
+
+
+
+
+
+
+      using const_pointer = typename _Ptr<__c_pointer, const value_type>::type;
+
+
+
+
+
+
+
+      using void_pointer = typename _Ptr<__v_pointer, void>::type;
+
+
+
+
+
+
+
+      using const_void_pointer = typename _Ptr<__cv_pointer, const void>::type;
+
+
+
+
+
+
+
+      using difference_type = typename _Diff<_Alloc, pointer>::type;
+
+
+
+
+
+
+
+      using size_type = typename _Size<_Alloc, difference_type>::type;
+
+
+
+
+
+
+
+      using propagate_on_container_copy_assignment
+ = __detected_or_t<false_type, __pocca, _Alloc>;
+
+
+
+
+
+
+
+      using propagate_on_container_move_assignment
+ = __detected_or_t<false_type, __pocma, _Alloc>;
+
+
+
+
+
+
+
+      using propagate_on_container_swap
+ = __detected_or_t<false_type, __pocs, _Alloc>;
+
+
+
+
+
+
+
+      using is_always_equal
+ = __detected_or_t<typename is_empty<_Alloc>::type, __equal, _Alloc>;
+
+      template<typename _Tp>
+ using rebind_alloc = __alloc_rebind<_Alloc, _Tp>;
+      template<typename _Tp>
+ using rebind_traits = allocator_traits<rebind_alloc<_Tp>>;
+
+    private:
+      template<typename _Alloc2>
+ static auto
+ _S_allocate(_Alloc2& __a, size_type __n, const_void_pointer __hint, int)
+ -> decltype(__a.allocate(__n, __hint))
+ { return __a.allocate(__n, __hint); }
+
+      template<typename _Alloc2>
+ static pointer
+ _S_allocate(_Alloc2& __a, size_type __n, const_void_pointer, ...)
+ { return __a.allocate(__n); }
+
+      template<typename _Tp, typename... _Args>
+ struct __construct_helper
+ {
+   template<typename _Alloc2,
+     typename = decltype(std::declval<_Alloc2*>()->construct(
+    std::declval<_Tp*>(), std::declval<_Args>()...))>
+     static true_type __test(int);
+
+   template<typename>
+     static false_type __test(...);
+
+   using type = decltype(__test<_Alloc>(0));
+ };
+
+      template<typename _Tp, typename... _Args>
+ using __has_construct
+   = typename __construct_helper<_Tp, _Args...>::type;
+
+      template<typename _Tp, typename... _Args>
+ static _Require<__has_construct<_Tp, _Args...>>
+ _S_construct(_Alloc& __a, _Tp* __p, _Args&&... __args)
+ { __a.construct(__p, std::forward<_Args>(__args)...); }
+
+      template<typename _Tp, typename... _Args>
+ static
+ _Require<__and_<__not_<__has_construct<_Tp, _Args...>>,
+          is_constructible<_Tp, _Args...>>>
+ _S_construct(_Alloc&, _Tp* __p, _Args&&... __args)
+ { ::new((void*)__p) _Tp(std::forward<_Args>(__args)...); }
+
+      template<typename _Alloc2, typename _Tp>
+ static auto
+ _S_destroy(_Alloc2& __a, _Tp* __p, int)
+ -> decltype(__a.destroy(__p))
+ { __a.destroy(__p); }
+
+      template<typename _Alloc2, typename _Tp>
+ static void
+ _S_destroy(_Alloc2&, _Tp* __p, ...)
+ { __p->~_Tp(); }
+
+      template<typename _Alloc2>
+ static auto
+ _S_max_size(_Alloc2& __a, int)
+ -> decltype(__a.max_size())
+ { return __a.max_size(); }
+
+      template<typename _Alloc2>
+ static size_type
+ _S_max_size(_Alloc2&, ...)
+ {
+
+
+   return __gnu_cxx::__numeric_traits<size_type>::__max
+     / sizeof(value_type);
+ }
+
+      template<typename _Alloc2>
+ static auto
+ _S_select(_Alloc2& __a, int)
+ -> decltype(__a.select_on_container_copy_construction())
+ { return __a.select_on_container_copy_construction(); }
+
+      template<typename _Alloc2>
+ static _Alloc2
+ _S_select(_Alloc2& __a, ...)
+ { return __a; }
+
+    public:
+      static pointer
+      allocate(_Alloc& __a, size_type __n)
+      { return __a.allocate(__n); }
+      static pointer
+      allocate(_Alloc& __a, size_type __n, const_void_pointer __hint)
+      { return _S_allocate(__a, __n, __hint, 0); }
+      static void
+      deallocate(_Alloc& __a, pointer __p, size_type __n)
+      { __a.deallocate(__p, __n); }
+      template<typename _Tp, typename... _Args>
+ static auto construct(_Alloc& __a, _Tp* __p, _Args&&... __args)
+ -> decltype(_S_construct(__a, __p, std::forward<_Args>(__args)...))
+ { _S_construct(__a, __p, std::forward<_Args>(__args)...); }
+      template<typename _Tp>
+ static void destroy(_Alloc& __a, _Tp* __p)
+ { _S_destroy(__a, __p, 0); }
+      static size_type max_size(const _Alloc& __a) noexcept
+      { return _S_max_size(__a, 0); }
+      static _Alloc
+      select_on_container_copy_construction(const _Alloc& __rhs)
+      { return _S_select(__rhs, 0); }
+    };
+
+
+  template<typename _Tp>
+    struct allocator_traits<allocator<_Tp>>
+    {
+
+      using allocator_type = allocator<_Tp>;
+
+      using value_type = _Tp;
+
+
+      using pointer = _Tp*;
+
+
+      using const_pointer = const _Tp*;
+
+
+      using void_pointer = void*;
+
+
+      using const_void_pointer = const void*;
+
+
+      using difference_type = std::ptrdiff_t;
+
+
+      using size_type = std::size_t;
+
+
+      using propagate_on_container_copy_assignment = false_type;
+
+
+      using propagate_on_container_move_assignment = true_type;
+
+
+      using propagate_on_container_swap = false_type;
+
+
+      using is_always_equal = true_type;
+
+      template<typename _Up>
+ using rebind_alloc = allocator<_Up>;
+
+      template<typename _Up>
+ using rebind_traits = allocator_traits<allocator<_Up>>;
+      static pointer
+      allocate(allocator_type& __a, size_type __n)
+      { return __a.allocate(__n); }
+      static pointer
+      allocate(allocator_type& __a, size_type __n, const_void_pointer __hint)
+      { return __a.allocate(__n, __hint); }
+      static void
+      deallocate(allocator_type& __a, pointer __p, size_type __n)
+      { __a.deallocate(__p, __n); }
+      template<typename _Up, typename... _Args>
+ static void
+ construct(allocator_type& __a, _Up* __p, _Args&&... __args)
+ { __a.construct(__p, std::forward<_Args>(__args)...); }
+      template<typename _Up>
+ static void
+ destroy(allocator_type& __a, _Up* __p)
+ { __a.destroy(__p); }
+
+
+
+
+
+
+      static size_type
+      max_size(const allocator_type& __a) noexcept
+      { return __a.max_size(); }
+
+
+
+
+
+
+      static allocator_type
+      select_on_container_copy_construction(const allocator_type& __rhs)
+      { return __rhs; }
+    };
+
+
+  template<typename _Alloc>
+    inline void
+    __do_alloc_on_copy(_Alloc& __one, const _Alloc& __two, true_type)
+    { __one = __two; }
+
+  template<typename _Alloc>
+    inline void
+    __do_alloc_on_copy(_Alloc&, const _Alloc&, false_type)
+    { }
+
+  template<typename _Alloc>
+    inline void __alloc_on_copy(_Alloc& __one, const _Alloc& __two)
+    {
+      typedef allocator_traits<_Alloc> __traits;
+      typedef typename __traits::propagate_on_container_copy_assignment __pocca;
+      __do_alloc_on_copy(__one, __two, __pocca());
+    }
+
+  template<typename _Alloc>
+    inline _Alloc __alloc_on_copy(const _Alloc& __a)
+    {
+      typedef allocator_traits<_Alloc> __traits;
+      return __traits::select_on_container_copy_construction(__a);
+    }
+
+  template<typename _Alloc>
+    inline void __do_alloc_on_move(_Alloc& __one, _Alloc& __two, true_type)
+    { __one = std::move(__two); }
+
+  template<typename _Alloc>
+    inline void __do_alloc_on_move(_Alloc&, _Alloc&, false_type)
+    { }
+
+  template<typename _Alloc>
+    inline void __alloc_on_move(_Alloc& __one, _Alloc& __two)
+    {
+      typedef allocator_traits<_Alloc> __traits;
+      typedef typename __traits::propagate_on_container_move_assignment __pocma;
+      __do_alloc_on_move(__one, __two, __pocma());
+    }
+
+  template<typename _Alloc>
+    inline void __do_alloc_on_swap(_Alloc& __one, _Alloc& __two, true_type)
+    {
+      using std::swap;
+      swap(__one, __two);
+    }
+
+  template<typename _Alloc>
+    inline void __do_alloc_on_swap(_Alloc&, _Alloc&, false_type)
+    { }
+
+  template<typename _Alloc>
+    inline void __alloc_on_swap(_Alloc& __one, _Alloc& __two)
+    {
+      typedef allocator_traits<_Alloc> __traits;
+      typedef typename __traits::propagate_on_container_swap __pocs;
+      __do_alloc_on_swap(__one, __two, __pocs());
+    }
+
+  template<typename _Alloc>
+    class __is_copy_insertable_impl
+    {
+      typedef allocator_traits<_Alloc> _Traits;
+
+      template<typename _Up, typename
+        = decltype(_Traits::construct(std::declval<_Alloc&>(),
+          std::declval<_Up*>(),
+          std::declval<const _Up&>()))>
+ static true_type
+ _M_select(int);
+
+      template<typename _Up>
+ static false_type
+ _M_select(...);
+
+    public:
+      typedef decltype(_M_select<typename _Alloc::value_type>(0)) type;
+    };
+
+
+  template<typename _Alloc>
+    struct __is_copy_insertable
+    : __is_copy_insertable_impl<_Alloc>::type
+    { };
+
+
+  template<typename _Tp>
+    struct __is_copy_insertable<allocator<_Tp>>
+    : is_copy_constructible<_Tp>
+    { };
+
+
+
+  template<typename _Alloc, typename = void>
+    struct __is_allocator : false_type { };
+
+  template<typename _Alloc>
+    struct __is_allocator<_Alloc,
+      __void_t<typename _Alloc::value_type,
+        decltype(std::declval<_Alloc&>().allocate(size_t{}))>>
+    : true_type { };
+
+  template<typename _Alloc>
+    using _RequireAllocator
+      = typename enable_if<__is_allocator<_Alloc>::value, _Alloc>::type;
+
+
+
+}
+
+
+
+
+namespace __gnu_cxx __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+
+
+
+template<typename _Alloc, typename = typename _Alloc::value_type>
+  struct __alloc_traits
+
+  : std::allocator_traits<_Alloc>
+
+  {
+    typedef _Alloc allocator_type;
+
+    typedef std::allocator_traits<_Alloc> _Base_type;
+    typedef typename _Base_type::value_type value_type;
+    typedef typename _Base_type::pointer pointer;
+    typedef typename _Base_type::const_pointer const_pointer;
+    typedef typename _Base_type::size_type size_type;
+    typedef typename _Base_type::difference_type difference_type;
+
+    typedef value_type& reference;
+    typedef const value_type& const_reference;
+    using _Base_type::allocate;
+    using _Base_type::deallocate;
+    using _Base_type::construct;
+    using _Base_type::destroy;
+    using _Base_type::max_size;
+
+  private:
+    template<typename _Ptr>
+      using __is_custom_pointer
+ = std::__and_<std::is_same<pointer, _Ptr>,
+        std::__not_<std::is_pointer<_Ptr>>>;
+
+  public:
+
+    template<typename _Ptr, typename... _Args>
+      static typename std::enable_if<__is_custom_pointer<_Ptr>::value>::type
+      construct(_Alloc& __a, _Ptr __p, _Args&&... __args)
+      {
+ _Base_type::construct(__a, std::__to_address(__p),
+         std::forward<_Args>(__args)...);
+      }
+
+
+    template<typename _Ptr>
+      static typename std::enable_if<__is_custom_pointer<_Ptr>::value>::type
+      destroy(_Alloc& __a, _Ptr __p)
+      { _Base_type::destroy(__a, std::__to_address(__p)); }
+
+    static _Alloc _S_select_on_copy(const _Alloc& __a)
+    { return _Base_type::select_on_container_copy_construction(__a); }
+
+    static void _S_on_swap(_Alloc& __a, _Alloc& __b)
+    { std::__alloc_on_swap(__a, __b); }
+
+    static constexpr bool _S_propagate_on_copy_assign()
+    { return _Base_type::propagate_on_container_copy_assignment::value; }
+
+    static constexpr bool _S_propagate_on_move_assign()
+    { return _Base_type::propagate_on_container_move_assignment::value; }
+
+    static constexpr bool _S_propagate_on_swap()
+    { return _Base_type::propagate_on_container_swap::value; }
+
+    static constexpr bool _S_always_equal()
+    { return _Base_type::is_always_equal::value; }
+
+    static constexpr bool _S_nothrow_move()
+    { return _S_propagate_on_move_assign() || _S_always_equal(); }
+
+    template<typename _Tp>
+      struct rebind
+      { typedef typename _Base_type::template rebind_alloc<_Tp> other; };
+  };
+
+
+}
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+
+
+
+
+  template<typename _T1, typename... _Args>
+    inline void
+    _Construct(_T1* __p, _Args&&... __args)
+    { ::new(static_cast<void*>(__p)) _T1(std::forward<_Args>(__args)...); }
+  template<typename _T1>
+    inline void
+    _Construct_novalue(_T1* __p)
+    { ::new(static_cast<void*>(__p)) _T1; }
+
+
+
+
+  template<typename _Tp>
+    inline void
+    _Destroy(_Tp* __pointer)
+    { __pointer->~_Tp(); }
+
+  template<bool>
+    struct _Destroy_aux
+    {
+      template<typename _ForwardIterator>
+        static void
+        __destroy(_ForwardIterator __first, _ForwardIterator __last)
+ {
+   for (; __first != __last; ++__first)
+     std::_Destroy(std::__addressof(*__first));
+ }
+    };
+
+  template<>
+    struct _Destroy_aux<true>
+    {
+      template<typename _ForwardIterator>
+        static void
+        __destroy(_ForwardIterator, _ForwardIterator) { }
+    };
+
+
+
+
+
+
+  template<typename _ForwardIterator>
+    inline void
+    _Destroy(_ForwardIterator __first, _ForwardIterator __last)
+    {
+      typedef typename iterator_traits<_ForwardIterator>::value_type
+                       _Value_type;
+
+
+      static_assert(is_destructible<_Value_type>::value,
+      "value type is destructible");
+
+      std::_Destroy_aux<__has_trivial_destructor(_Value_type)>::
+ __destroy(__first, __last);
+    }
+
+  template<bool>
+    struct _Destroy_n_aux
+    {
+      template<typename _ForwardIterator, typename _Size>
+        static _ForwardIterator
+        __destroy_n(_ForwardIterator __first, _Size __count)
+ {
+   for (; __count > 0; (void)++__first, --__count)
+     std::_Destroy(std::__addressof(*__first));
+   return __first;
+ }
+    };
+
+  template<>
+    struct _Destroy_n_aux<true>
+    {
+      template<typename _ForwardIterator, typename _Size>
+        static _ForwardIterator
+        __destroy_n(_ForwardIterator __first, _Size __count)
+ {
+   std::advance(__first, __count);
+   return __first;
+ }
+    };
+
+
+
+
+
+
+  template<typename _ForwardIterator, typename _Size>
+    inline _ForwardIterator
+    _Destroy_n(_ForwardIterator __first, _Size __count)
+    {
+      typedef typename iterator_traits<_ForwardIterator>::value_type
+                       _Value_type;
+
+
+      static_assert(is_destructible<_Value_type>::value,
+      "value type is destructible");
+
+      return std::_Destroy_n_aux<__has_trivial_destructor(_Value_type)>::
+ __destroy_n(__first, __count);
+    }
+
+
+
+
+
+
+
+  template<typename _ForwardIterator, typename _Allocator>
+    void
+    _Destroy(_ForwardIterator __first, _ForwardIterator __last,
+      _Allocator& __alloc)
+    {
+      typedef __gnu_cxx::__alloc_traits<_Allocator> __traits;
+      for (; __first != __last; ++__first)
+ __traits::destroy(__alloc, std::__addressof(*__first));
+    }
+
+  template<typename _ForwardIterator, typename _Tp>
+    inline void
+    _Destroy(_ForwardIterator __first, _ForwardIterator __last,
+      allocator<_Tp>&)
+    {
+      _Destroy(__first, __last);
+    }
+
+}
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+  template<typename _Tp>
+    pair<_Tp*, ptrdiff_t>
+    get_temporary_buffer(ptrdiff_t __len) noexcept
+    {
+      const ptrdiff_t __max =
+ __gnu_cxx::__numeric_traits<ptrdiff_t>::__max / sizeof(_Tp);
+      if (__len > __max)
+ __len = __max;
+
+      while (__len > 0)
+ {
+   _Tp* __tmp = static_cast<_Tp*>(::operator new(__len * sizeof(_Tp),
+       std::nothrow));
+   if (__tmp != 0)
+     return std::pair<_Tp*, ptrdiff_t>(__tmp, __len);
+   __len /= 2;
+ }
+      return std::pair<_Tp*, ptrdiff_t>(static_cast<_Tp*>(0), 0);
+    }
+  template<typename _Tp>
+    inline void
+    return_temporary_buffer(_Tp* __p)
+    { ::operator delete(__p, std::nothrow); }
+
+
+
+
+
+
+
+  template<typename _ForwardIterator, typename _Tp>
+    class _Temporary_buffer
+    {
+
+     
+
+    public:
+      typedef _Tp value_type;
+      typedef value_type* pointer;
+      typedef pointer iterator;
+      typedef ptrdiff_t size_type;
+
+    protected:
+      size_type _M_original_len;
+      size_type _M_len;
+      pointer _M_buffer;
+
+    public:
+
+      size_type
+      size() const
+      { return _M_len; }
+
+
+      size_type
+      requested_size() const
+      { return _M_original_len; }
+
+
+      iterator
+      begin()
+      { return _M_buffer; }
+
+
+      iterator
+      end()
+      { return _M_buffer + _M_len; }
+
+
+
+
+
+      _Temporary_buffer(_ForwardIterator __first, _ForwardIterator __last);
+
+      ~_Temporary_buffer()
+      {
+ std::_Destroy(_M_buffer, _M_buffer + _M_len);
+ std::return_temporary_buffer(_M_buffer);
+      }
+
+    private:
+
+      _Temporary_buffer(const _Temporary_buffer&);
+
+      void
+      operator=(const _Temporary_buffer&);
+    };
+
+
+  template<bool>
+    struct __uninitialized_construct_buf_dispatch
+    {
+      template<typename _Pointer, typename _ForwardIterator>
+        static void
+        __ucr(_Pointer __first, _Pointer __last,
+       _ForwardIterator __seed)
+        {
+   if(__first == __last)
+     return;
+
+   _Pointer __cur = __first;
+   if (true)
+     {
+       std::_Construct(std::__addressof(*__first),
+         std::move(*__seed));
+       _Pointer __prev = __cur;
+       ++__cur;
+       for(; __cur != __last; ++__cur, ++__prev)
+  std::_Construct(std::__addressof(*__cur),
+    std::move(*__prev));
+       *__seed = std::move(*__prev);
+     }
+   if (false)
+     {
+       std::_Destroy(__first, __cur);
+       ;
+     }
+ }
+    };
+
+  template<>
+    struct __uninitialized_construct_buf_dispatch<true>
+    {
+      template<typename _Pointer, typename _ForwardIterator>
+        static void
+        __ucr(_Pointer, _Pointer, _ForwardIterator) { }
+    };
+  template<typename _Pointer, typename _ForwardIterator>
+    inline void
+    __uninitialized_construct_buf(_Pointer __first, _Pointer __last,
+      _ForwardIterator __seed)
+    {
+      typedef typename std::iterator_traits<_Pointer>::value_type
+ _ValueType;
+
+      std::__uninitialized_construct_buf_dispatch<
+        __has_trivial_constructor(_ValueType)>::
+   __ucr(__first, __last, __seed);
+    }
+
+  template<typename _ForwardIterator, typename _Tp>
+    _Temporary_buffer<_ForwardIterator, _Tp>::
+    _Temporary_buffer(_ForwardIterator __first, _ForwardIterator __last)
+    : _M_original_len(std::distance(__first, __last)),
+      _M_len(0), _M_buffer(0)
+    {
+      if (true)
+ {
+   std::pair<pointer, size_type> __p(std::get_temporary_buffer<
+         value_type>(_M_original_len));
+   _M_buffer = __p.first;
+   _M_len = __p.second;
+   if (_M_buffer)
+     std::__uninitialized_construct_buf(_M_buffer, _M_buffer + _M_len,
+            __first);
+ }
+      if (false)
+ {
+   std::return_temporary_buffer(_M_buffer);
+   _M_buffer = 0;
+   _M_len = 0;
+   ;
+ }
+    }
+
+
+}
+
+
+
+       
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+
+
+
+
+  enum float_round_style
+  {
+    round_indeterminate = -1,
+    round_toward_zero = 0,
+    round_to_nearest = 1,
+    round_toward_infinity = 2,
+    round_toward_neg_infinity = 3
+  };
+
+
+
+
+
+
+
+  enum float_denorm_style
+  {
+
+    denorm_indeterminate = -1,
+
+    denorm_absent = 0,
+
+    denorm_present = 1
+  };
+  struct __numeric_limits_base
+  {
+
+
+    static constexpr bool is_specialized = false;
+
+
+
+
+    static constexpr int digits = 0;
+
+
+    static constexpr int digits10 = 0;
+
+
+
+
+    static constexpr int max_digits10 = 0;
+
+
+
+    static constexpr bool is_signed = false;
+
+
+    static constexpr bool is_integer = false;
+
+
+
+
+    static constexpr bool is_exact = false;
+
+
+
+    static constexpr int radix = 0;
+
+
+
+    static constexpr int min_exponent = 0;
+
+
+
+    static constexpr int min_exponent10 = 0;
+
+
+
+
+    static constexpr int max_exponent = 0;
+
+
+
+    static constexpr int max_exponent10 = 0;
+
+
+    static constexpr bool has_infinity = false;
+
+
+
+    static constexpr bool has_quiet_NaN = false;
+
+
+
+    static constexpr bool has_signaling_NaN = false;
+
+
+    static constexpr float_denorm_style has_denorm = denorm_absent;
+
+
+
+    static constexpr bool has_denorm_loss = false;
+
+
+
+    static constexpr bool is_iec559 = false;
+
+
+
+
+    static constexpr bool is_bounded = false;
+    static constexpr bool is_modulo = false;
+
+
+    static constexpr bool traps = false;
+
+
+    static constexpr bool tinyness_before = false;
+
+
+
+
+    static constexpr float_round_style round_style =
+          round_toward_zero;
+  };
+  template<typename _Tp>
+    struct numeric_limits : public __numeric_limits_base
+    {
+
+
+      static constexpr _Tp
+      min() noexcept { return _Tp(); }
+
+
+      static constexpr _Tp
+      max() noexcept { return _Tp(); }
+
+
+
+
+      static constexpr _Tp
+      lowest() noexcept { return _Tp(); }
+
+
+
+
+      static constexpr _Tp
+      epsilon() noexcept { return _Tp(); }
+
+
+      static constexpr _Tp
+      round_error() noexcept { return _Tp(); }
+
+
+      static constexpr _Tp
+      infinity() noexcept { return _Tp(); }
+
+
+
+      static constexpr _Tp
+      quiet_NaN() noexcept { return _Tp(); }
+
+
+
+      static constexpr _Tp
+      signaling_NaN() noexcept { return _Tp(); }
+
+
+
+
+      static constexpr _Tp
+      denorm_min() noexcept { return _Tp(); }
+    };
+
+
+
+
+  template<typename _Tp>
+    struct numeric_limits<const _Tp>
+    : public numeric_limits<_Tp> { };
+
+  template<typename _Tp>
+    struct numeric_limits<volatile _Tp>
+    : public numeric_limits<_Tp> { };
+
+  template<typename _Tp>
+    struct numeric_limits<const volatile _Tp>
+    : public numeric_limits<_Tp> { };
+  template<>
+    struct numeric_limits<bool>
+    {
+      static constexpr bool is_specialized = true;
+
+      static constexpr bool
+      min() noexcept { return false; }
+
+      static constexpr bool
+      max() noexcept { return true; }
+
+
+      static constexpr bool
+      lowest() noexcept { return min(); }
+
+      static constexpr int digits = 1;
+      static constexpr int digits10 = 0;
+
+      static constexpr int max_digits10 = 0;
+
+      static constexpr bool is_signed = false;
+      static constexpr bool is_integer = true;
+      static constexpr bool is_exact = true;
+      static constexpr int radix = 2;
+
+      static constexpr bool
+      epsilon() noexcept { return false; }
+
+      static constexpr bool
+      round_error() noexcept { return false; }
+
+      static constexpr int min_exponent = 0;
+      static constexpr int min_exponent10 = 0;
+      static constexpr int max_exponent = 0;
+      static constexpr int max_exponent10 = 0;
+
+      static constexpr bool has_infinity = false;
+      static constexpr bool has_quiet_NaN = false;
+      static constexpr bool has_signaling_NaN = false;
+      static constexpr float_denorm_style has_denorm
+       = denorm_absent;
+      static constexpr bool has_denorm_loss = false;
+
+      static constexpr bool
+      infinity() noexcept { return false; }
+
+      static constexpr bool
+      quiet_NaN() noexcept { return false; }
+
+      static constexpr bool
+      signaling_NaN() noexcept { return false; }
+
+      static constexpr bool
+      denorm_min() noexcept { return false; }
+
+      static constexpr bool is_iec559 = false;
+      static constexpr bool is_bounded = true;
+      static constexpr bool is_modulo = false;
+
+
+
+
+      static constexpr bool traps = false;
+      static constexpr bool tinyness_before = false;
+      static constexpr float_round_style round_style
+       = round_toward_zero;
+    };
+
+
+  template<>
+    struct numeric_limits<char>
+    {
+      static constexpr bool is_specialized = true;
+
+      static constexpr char
+      min() noexcept { return (((char)(-1) < 0) ? -(((char)(-1) < 0) ? (((((char)1 << ((sizeof(char) * 8 - ((char)(-1) < 0)) - 1)) - 1) << 1) + 1) : ~(char)0) - 1 : (char)0); }
+
+      static constexpr char
+      max() noexcept { return (((char)(-1) < 0) ? (((((char)1 << ((sizeof(char) * 8 - ((char)(-1) < 0)) - 1)) - 1) << 1) + 1) : ~(char)0); }
+
+
+      static constexpr char
+      lowest() noexcept { return min(); }
+
+
+      static constexpr int digits = (sizeof(char) * 8 - ((char)(-1) < 0));
+      static constexpr int digits10 = ((sizeof(char) * 8 - ((char)(-1) < 0)) * 643L / 2136);
+
+      static constexpr int max_digits10 = 0;
+
+      static constexpr bool is_signed = ((char)(-1) < 0);
+      static constexpr bool is_integer = true;
+      static constexpr bool is_exact = true;
+      static constexpr int radix = 2;
+
+      static constexpr char
+      epsilon() noexcept { return 0; }
+
+      static constexpr char
+      round_error() noexcept { return 0; }
+
+      static constexpr int min_exponent = 0;
+      static constexpr int min_exponent10 = 0;
+      static constexpr int max_exponent = 0;
+      static constexpr int max_exponent10 = 0;
+
+      static constexpr bool has_infinity = false;
+      static constexpr bool has_quiet_NaN = false;
+      static constexpr bool has_signaling_NaN = false;
+      static constexpr float_denorm_style has_denorm
+       = denorm_absent;
+      static constexpr bool has_denorm_loss = false;
+
+      static constexpr
+      char infinity() noexcept { return char(); }
+
+      static constexpr char
+      quiet_NaN() noexcept { return char(); }
+
+      static constexpr char
+      signaling_NaN() noexcept { return char(); }
+
+      static constexpr char
+      denorm_min() noexcept { return static_cast<char>(0); }
+
+      static constexpr bool is_iec559 = false;
+      static constexpr bool is_bounded = true;
+      static constexpr bool is_modulo = !is_signed;
+
+      static constexpr bool traps = false;
+      static constexpr bool tinyness_before = false;
+      static constexpr float_round_style round_style
+       = round_toward_zero;
+    };
+
+
+  template<>
+    struct numeric_limits<signed char>
+    {
+      static constexpr bool is_specialized = true;
+
+      static constexpr signed char
+      min() noexcept { return -0x7f - 1; }
+
+      static constexpr signed char
+      max() noexcept { return 0x7f; }
+
+
+      static constexpr signed char
+      lowest() noexcept { return min(); }
+
+
+      static constexpr int digits = (sizeof(signed char) * 8 - ((signed char)(-1) < 0));
+      static constexpr int digits10
+       = ((sizeof(signed char) * 8 - ((signed char)(-1) < 0)) * 643L / 2136);
+
+      static constexpr int max_digits10 = 0;
+
+      static constexpr bool is_signed = true;
+      static constexpr bool is_integer = true;
+      static constexpr bool is_exact = true;
+      static constexpr int radix = 2;
+
+      static constexpr signed char
+      epsilon() noexcept { return 0; }
+
+      static constexpr signed char
+      round_error() noexcept { return 0; }
+
+      static constexpr int min_exponent = 0;
+      static constexpr int min_exponent10 = 0;
+      static constexpr int max_exponent = 0;
+      static constexpr int max_exponent10 = 0;
+
+      static constexpr bool has_infinity = false;
+      static constexpr bool has_quiet_NaN = false;
+      static constexpr bool has_signaling_NaN = false;
+      static constexpr float_denorm_style has_denorm
+       = denorm_absent;
+      static constexpr bool has_denorm_loss = false;
+
+      static constexpr signed char
+      infinity() noexcept { return static_cast<signed char>(0); }
+
+      static constexpr signed char
+      quiet_NaN() noexcept { return static_cast<signed char>(0); }
+
+      static constexpr signed char
+      signaling_NaN() noexcept
+      { return static_cast<signed char>(0); }
+
+      static constexpr signed char
+      denorm_min() noexcept
+      { return static_cast<signed char>(0); }
+
+      static constexpr bool is_iec559 = false;
+      static constexpr bool is_bounded = true;
+      static constexpr bool is_modulo = false;
+
+      static constexpr bool traps = false;
+      static constexpr bool tinyness_before = false;
+      static constexpr float_round_style round_style
+       = round_toward_zero;
+    };
+
+
+  template<>
+    struct numeric_limits<unsigned char>
+    {
+      static constexpr bool is_specialized = true;
+
+      static constexpr unsigned char
+      min() noexcept { return 0; }
+
+      static constexpr unsigned char
+      max() noexcept { return 0x7f * 2U + 1; }
+
+
+      static constexpr unsigned char
+      lowest() noexcept { return min(); }
+
+
+      static constexpr int digits
+       = (sizeof(unsigned char) * 8 - ((unsigned char)(-1) < 0));
+      static constexpr int digits10
+       = ((sizeof(unsigned char) * 8 - ((unsigned char)(-1) < 0)) * 643L / 2136);
+
+      static constexpr int max_digits10 = 0;
+
+      static constexpr bool is_signed = false;
+      static constexpr bool is_integer = true;
+      static constexpr bool is_exact = true;
+      static constexpr int radix = 2;
+
+      static constexpr unsigned char
+      epsilon() noexcept { return 0; }
+
+      static constexpr unsigned char
+      round_error() noexcept { return 0; }
+
+      static constexpr int min_exponent = 0;
+      static constexpr int min_exponent10 = 0;
+      static constexpr int max_exponent = 0;
+      static constexpr int max_exponent10 = 0;
+
+      static constexpr bool has_infinity = false;
+      static constexpr bool has_quiet_NaN = false;
+      static constexpr bool has_signaling_NaN = false;
+      static constexpr float_denorm_style has_denorm
+       = denorm_absent;
+      static constexpr bool has_denorm_loss = false;
+
+      static constexpr unsigned char
+      infinity() noexcept
+      { return static_cast<unsigned char>(0); }
+
+      static constexpr unsigned char
+      quiet_NaN() noexcept
+      { return static_cast<unsigned char>(0); }
+
+      static constexpr unsigned char
+      signaling_NaN() noexcept
+      { return static_cast<unsigned char>(0); }
+
+      static constexpr unsigned char
+      denorm_min() noexcept
+      { return static_cast<unsigned char>(0); }
+
+      static constexpr bool is_iec559 = false;
+      static constexpr bool is_bounded = true;
+      static constexpr bool is_modulo = true;
+
+      static constexpr bool traps = false;
+      static constexpr bool tinyness_before = false;
+      static constexpr float_round_style round_style
+       = round_toward_zero;
+    };
+
+
+  template<>
+    struct numeric_limits<wchar_t>
+    {
+      static constexpr bool is_specialized = true;
+
+      static constexpr wchar_t
+      min() noexcept { return (((wchar_t)(-1) < 0) ? -(((wchar_t)(-1) < 0) ? (((((wchar_t)1 << ((sizeof(wchar_t) * 8 - ((wchar_t)(-1) < 0)) - 1)) - 1) << 1) + 1) : ~(wchar_t)0) - 1 : (wchar_t)0); }
+
+      static constexpr wchar_t
+      max() noexcept { return (((wchar_t)(-1) < 0) ? (((((wchar_t)1 << ((sizeof(wchar_t) * 8 - ((wchar_t)(-1) < 0)) - 1)) - 1) << 1) + 1) : ~(wchar_t)0); }
+
+
+      static constexpr wchar_t
+      lowest() noexcept { return min(); }
+
+
+      static constexpr int digits = (sizeof(wchar_t) * 8 - ((wchar_t)(-1) < 0));
+      static constexpr int digits10
+       = ((sizeof(wchar_t) * 8 - ((wchar_t)(-1) < 0)) * 643L / 2136);
+
+      static constexpr int max_digits10 = 0;
+
+      static constexpr bool is_signed = ((wchar_t)(-1) < 0);
+      static constexpr bool is_integer = true;
+      static constexpr bool is_exact = true;
+      static constexpr int radix = 2;
+
+      static constexpr wchar_t
+      epsilon() noexcept { return 0; }
+
+      static constexpr wchar_t
+      round_error() noexcept { return 0; }
+
+      static constexpr int min_exponent = 0;
+      static constexpr int min_exponent10 = 0;
+      static constexpr int max_exponent = 0;
+      static constexpr int max_exponent10 = 0;
+
+      static constexpr bool has_infinity = false;
+      static constexpr bool has_quiet_NaN = false;
+      static constexpr bool has_signaling_NaN = false;
+      static constexpr float_denorm_style has_denorm
+       = denorm_absent;
+      static constexpr bool has_denorm_loss = false;
+
+      static constexpr wchar_t
+      infinity() noexcept { return wchar_t(); }
+
+      static constexpr wchar_t
+      quiet_NaN() noexcept { return wchar_t(); }
+
+      static constexpr wchar_t
+      signaling_NaN() noexcept { return wchar_t(); }
+
+      static constexpr wchar_t
+      denorm_min() noexcept { return wchar_t(); }
+
+      static constexpr bool is_iec559 = false;
+      static constexpr bool is_bounded = true;
+      static constexpr bool is_modulo = !is_signed;
+
+      static constexpr bool traps = false;
+      static constexpr bool tinyness_before = false;
+      static constexpr float_round_style round_style
+       = round_toward_zero;
+    };
+
+
+
+  template<>
+    struct numeric_limits<char16_t>
+    {
+      static constexpr bool is_specialized = true;
+
+      static constexpr char16_t
+      min() noexcept { return (((char16_t)(-1) < 0) ? -(((char16_t)(-1) < 0) ? (((((char16_t)1 << ((sizeof(char16_t) * 8 - ((char16_t)(-1) < 0)) - 1)) - 1) << 1) + 1) : ~(char16_t)0) - 1 : (char16_t)0); }
+
+      static constexpr char16_t
+      max() noexcept { return (((char16_t)(-1) < 0) ? (((((char16_t)1 << ((sizeof(char16_t) * 8 - ((char16_t)(-1) < 0)) - 1)) - 1) << 1) + 1) : ~(char16_t)0); }
+
+      static constexpr char16_t
+      lowest() noexcept { return min(); }
+
+      static constexpr int digits = (sizeof(char16_t) * 8 - ((char16_t)(-1) < 0));
+      static constexpr int digits10 = ((sizeof(char16_t) * 8 - ((char16_t)(-1) < 0)) * 643L / 2136);
+      static constexpr int max_digits10 = 0;
+      static constexpr bool is_signed = ((char16_t)(-1) < 0);
+      static constexpr bool is_integer = true;
+      static constexpr bool is_exact = true;
+      static constexpr int radix = 2;
+
+      static constexpr char16_t
+      epsilon() noexcept { return 0; }
+
+      static constexpr char16_t
+      round_error() noexcept { return 0; }
+
+      static constexpr int min_exponent = 0;
+      static constexpr int min_exponent10 = 0;
+      static constexpr int max_exponent = 0;
+      static constexpr int max_exponent10 = 0;
+
+      static constexpr bool has_infinity = false;
+      static constexpr bool has_quiet_NaN = false;
+      static constexpr bool has_signaling_NaN = false;
+      static constexpr float_denorm_style has_denorm = denorm_absent;
+      static constexpr bool has_denorm_loss = false;
+
+      static constexpr char16_t
+      infinity() noexcept { return char16_t(); }
+
+      static constexpr char16_t
+      quiet_NaN() noexcept { return char16_t(); }
+
+      static constexpr char16_t
+      signaling_NaN() noexcept { return char16_t(); }
+
+      static constexpr char16_t
+      denorm_min() noexcept { return char16_t(); }
+
+      static constexpr bool is_iec559 = false;
+      static constexpr bool is_bounded = true;
+      static constexpr bool is_modulo = !is_signed;
+
+      static constexpr bool traps = false;
+      static constexpr bool tinyness_before = false;
+      static constexpr float_round_style round_style = round_toward_zero;
+    };
+
+
+  template<>
+    struct numeric_limits<char32_t>
+    {
+      static constexpr bool is_specialized = true;
+
+      static constexpr char32_t
+      min() noexcept { return (((char32_t)(-1) < 0) ? -(((char32_t)(-1) < 0) ? (((((char32_t)1 << ((sizeof(char32_t) * 8 - ((char32_t)(-1) < 0)) - 1)) - 1) << 1) + 1) : ~(char32_t)0) - 1 : (char32_t)0); }
+
+      static constexpr char32_t
+      max() noexcept { return (((char32_t)(-1) < 0) ? (((((char32_t)1 << ((sizeof(char32_t) * 8 - ((char32_t)(-1) < 0)) - 1)) - 1) << 1) + 1) : ~(char32_t)0); }
+
+      static constexpr char32_t
+      lowest() noexcept { return min(); }
+
+      static constexpr int digits = (sizeof(char32_t) * 8 - ((char32_t)(-1) < 0));
+      static constexpr int digits10 = ((sizeof(char32_t) * 8 - ((char32_t)(-1) < 0)) * 643L / 2136);
+      static constexpr int max_digits10 = 0;
+      static constexpr bool is_signed = ((char32_t)(-1) < 0);
+      static constexpr bool is_integer = true;
+      static constexpr bool is_exact = true;
+      static constexpr int radix = 2;
+
+      static constexpr char32_t
+      epsilon() noexcept { return 0; }
+
+      static constexpr char32_t
+      round_error() noexcept { return 0; }
+
+      static constexpr int min_exponent = 0;
+      static constexpr int min_exponent10 = 0;
+      static constexpr int max_exponent = 0;
+      static constexpr int max_exponent10 = 0;
+
+      static constexpr bool has_infinity = false;
+      static constexpr bool has_quiet_NaN = false;
+      static constexpr bool has_signaling_NaN = false;
+      static constexpr float_denorm_style has_denorm = denorm_absent;
+      static constexpr bool has_denorm_loss = false;
+
+      static constexpr char32_t
+      infinity() noexcept { return char32_t(); }
+
+      static constexpr char32_t
+      quiet_NaN() noexcept { return char32_t(); }
+
+      static constexpr char32_t
+      signaling_NaN() noexcept { return char32_t(); }
+
+      static constexpr char32_t
+      denorm_min() noexcept { return char32_t(); }
+
+      static constexpr bool is_iec559 = false;
+      static constexpr bool is_bounded = true;
+      static constexpr bool is_modulo = !is_signed;
+
+      static constexpr bool traps = false;
+      static constexpr bool tinyness_before = false;
+      static constexpr float_round_style round_style = round_toward_zero;
+    };
+
+
+
+  template<>
+    struct numeric_limits<short>
+    {
+      static constexpr bool is_specialized = true;
+
+      static constexpr short
+      min() noexcept { return -0x7fff - 1; }
+
+      static constexpr short
+      max() noexcept { return 0x7fff; }
+
+
+      static constexpr short
+      lowest() noexcept { return min(); }
+
+
+      static constexpr int digits = (sizeof(short) * 8 - ((short)(-1) < 0));
+      static constexpr int digits10 = ((sizeof(short) * 8 - ((short)(-1) < 0)) * 643L / 2136);
+
+      static constexpr int max_digits10 = 0;
+
+      static constexpr bool is_signed = true;
+      static constexpr bool is_integer = true;
+      static constexpr bool is_exact = true;
+      static constexpr int radix = 2;
+
+      static constexpr short
+      epsilon() noexcept { return 0; }
+
+      static constexpr short
+      round_error() noexcept { return 0; }
+
+      static constexpr int min_exponent = 0;
+      static constexpr int min_exponent10 = 0;
+      static constexpr int max_exponent = 0;
+      static constexpr int max_exponent10 = 0;
+
+      static constexpr bool has_infinity = false;
+      static constexpr bool has_quiet_NaN = false;
+      static constexpr bool has_signaling_NaN = false;
+      static constexpr float_denorm_style has_denorm
+       = denorm_absent;
+      static constexpr bool has_denorm_loss = false;
+
+      static constexpr short
+      infinity() noexcept { return short(); }
+
+      static constexpr short
+      quiet_NaN() noexcept { return short(); }
+
+      static constexpr short
+      signaling_NaN() noexcept { return short(); }
+
+      static constexpr short
+      denorm_min() noexcept { return short(); }
+
+      static constexpr bool is_iec559 = false;
+      static constexpr bool is_bounded = true;
+      static constexpr bool is_modulo = false;
+
+      static constexpr bool traps = false;
+      static constexpr bool tinyness_before = false;
+      static constexpr float_round_style round_style
+       = round_toward_zero;
+    };
+
+
+  template<>
+    struct numeric_limits<unsigned short>
+    {
+      static constexpr bool is_specialized = true;
+
+      static constexpr unsigned short
+      min() noexcept { return 0; }
+
+      static constexpr unsigned short
+      max() noexcept { return 0x7fff * 2U + 1; }
+
+
+      static constexpr unsigned short
+      lowest() noexcept { return min(); }
+
+
+      static constexpr int digits
+       = (sizeof(unsigned short) * 8 - ((unsigned short)(-1) < 0));
+      static constexpr int digits10
+       = ((sizeof(unsigned short) * 8 - ((unsigned short)(-1) < 0)) * 643L / 2136);
+
+      static constexpr int max_digits10 = 0;
+
+      static constexpr bool is_signed = false;
+      static constexpr bool is_integer = true;
+      static constexpr bool is_exact = true;
+      static constexpr int radix = 2;
+
+      static constexpr unsigned short
+      epsilon() noexcept { return 0; }
+
+      static constexpr unsigned short
+      round_error() noexcept { return 0; }
+
+      static constexpr int min_exponent = 0;
+      static constexpr int min_exponent10 = 0;
+      static constexpr int max_exponent = 0;
+      static constexpr int max_exponent10 = 0;
+
+      static constexpr bool has_infinity = false;
+      static constexpr bool has_quiet_NaN = false;
+      static constexpr bool has_signaling_NaN = false;
+      static constexpr float_denorm_style has_denorm
+       = denorm_absent;
+      static constexpr bool has_denorm_loss = false;
+
+      static constexpr unsigned short
+      infinity() noexcept
+      { return static_cast<unsigned short>(0); }
+
+      static constexpr unsigned short
+      quiet_NaN() noexcept
+      { return static_cast<unsigned short>(0); }
+
+      static constexpr unsigned short
+      signaling_NaN() noexcept
+      { return static_cast<unsigned short>(0); }
+
+      static constexpr unsigned short
+      denorm_min() noexcept
+      { return static_cast<unsigned short>(0); }
+
+      static constexpr bool is_iec559 = false;
+      static constexpr bool is_bounded = true;
+      static constexpr bool is_modulo = true;
+
+      static constexpr bool traps = false;
+      static constexpr bool tinyness_before = false;
+      static constexpr float_round_style round_style
+       = round_toward_zero;
+    };
+
+
+  template<>
+    struct numeric_limits<int>
+    {
+      static constexpr bool is_specialized = true;
+
+      static constexpr int
+      min() noexcept { return -0x7fffffff - 1; }
+
+      static constexpr int
+      max() noexcept { return 0x7fffffff; }
+
+
+      static constexpr int
+      lowest() noexcept { return min(); }
+
+
+      static constexpr int digits = (sizeof(int) * 8 - ((int)(-1) < 0));
+      static constexpr int digits10 = ((sizeof(int) * 8 - ((int)(-1) < 0)) * 643L / 2136);
+
+      static constexpr int max_digits10 = 0;
+
+      static constexpr bool is_signed = true;
+      static constexpr bool is_integer = true;
+      static constexpr bool is_exact = true;
+      static constexpr int radix = 2;
+
+      static constexpr int
+      epsilon() noexcept { return 0; }
+
+      static constexpr int
+      round_error() noexcept { return 0; }
+
+      static constexpr int min_exponent = 0;
+      static constexpr int min_exponent10 = 0;
+      static constexpr int max_exponent = 0;
+      static constexpr int max_exponent10 = 0;
+
+      static constexpr bool has_infinity = false;
+      static constexpr bool has_quiet_NaN = false;
+      static constexpr bool has_signaling_NaN = false;
+      static constexpr float_denorm_style has_denorm
+       = denorm_absent;
+      static constexpr bool has_denorm_loss = false;
+
+      static constexpr int
+      infinity() noexcept { return static_cast<int>(0); }
+
+      static constexpr int
+      quiet_NaN() noexcept { return static_cast<int>(0); }
+
+      static constexpr int
+      signaling_NaN() noexcept { return static_cast<int>(0); }
+
+      static constexpr int
+      denorm_min() noexcept { return static_cast<int>(0); }
+
+      static constexpr bool is_iec559 = false;
+      static constexpr bool is_bounded = true;
+      static constexpr bool is_modulo = false;
+
+      static constexpr bool traps = false;
+      static constexpr bool tinyness_before = false;
+      static constexpr float_round_style round_style
+       = round_toward_zero;
+    };
+
+
+  template<>
+    struct numeric_limits<unsigned int>
+    {
+      static constexpr bool is_specialized = true;
+
+      static constexpr unsigned int
+      min() noexcept { return 0; }
+
+      static constexpr unsigned int
+      max() noexcept { return 0x7fffffff * 2U + 1; }
+
+
+      static constexpr unsigned int
+      lowest() noexcept { return min(); }
+
+
+      static constexpr int digits
+       = (sizeof(unsigned int) * 8 - ((unsigned int)(-1) < 0));
+      static constexpr int digits10
+       = ((sizeof(unsigned int) * 8 - ((unsigned int)(-1) < 0)) * 643L / 2136);
+
+      static constexpr int max_digits10 = 0;
+
+      static constexpr bool is_signed = false;
+      static constexpr bool is_integer = true;
+      static constexpr bool is_exact = true;
+      static constexpr int radix = 2;
+
+      static constexpr unsigned int
+      epsilon() noexcept { return 0; }
+
+      static constexpr unsigned int
+      round_error() noexcept { return 0; }
+
+      static constexpr int min_exponent = 0;
+      static constexpr int min_exponent10 = 0;
+      static constexpr int max_exponent = 0;
+      static constexpr int max_exponent10 = 0;
+
+      static constexpr bool has_infinity = false;
+      static constexpr bool has_quiet_NaN = false;
+      static constexpr bool has_signaling_NaN = false;
+      static constexpr float_denorm_style has_denorm
+       = denorm_absent;
+      static constexpr bool has_denorm_loss = false;
+
+      static constexpr unsigned int
+      infinity() noexcept { return static_cast<unsigned int>(0); }
+
+      static constexpr unsigned int
+      quiet_NaN() noexcept
+      { return static_cast<unsigned int>(0); }
+
+      static constexpr unsigned int
+      signaling_NaN() noexcept
+      { return static_cast<unsigned int>(0); }
+
+      static constexpr unsigned int
+      denorm_min() noexcept
+      { return static_cast<unsigned int>(0); }
+
+      static constexpr bool is_iec559 = false;
+      static constexpr bool is_bounded = true;
+      static constexpr bool is_modulo = true;
+
+      static constexpr bool traps = false;
+      static constexpr bool tinyness_before = false;
+      static constexpr float_round_style round_style
+       = round_toward_zero;
+    };
+
+
+  template<>
+    struct numeric_limits<long>
+    {
+      static constexpr bool is_specialized = true;
+
+      static constexpr long
+      min() noexcept { return -0x7fffffffffffffffL - 1; }
+
+      static constexpr long
+      max() noexcept { return 0x7fffffffffffffffL; }
+
+
+      static constexpr long
+      lowest() noexcept { return min(); }
+
+
+      static constexpr int digits = (sizeof(long) * 8 - ((long)(-1) < 0));
+      static constexpr int digits10 = ((sizeof(long) * 8 - ((long)(-1) < 0)) * 643L / 2136);
+
+      static constexpr int max_digits10 = 0;
+
+      static constexpr bool is_signed = true;
+      static constexpr bool is_integer = true;
+      static constexpr bool is_exact = true;
+      static constexpr int radix = 2;
+
+      static constexpr long
+      epsilon() noexcept { return 0; }
+
+      static constexpr long
+      round_error() noexcept { return 0; }
+
+      static constexpr int min_exponent = 0;
+      static constexpr int min_exponent10 = 0;
+      static constexpr int max_exponent = 0;
+      static constexpr int max_exponent10 = 0;
+
+      static constexpr bool has_infinity = false;
+      static constexpr bool has_quiet_NaN = false;
+      static constexpr bool has_signaling_NaN = false;
+      static constexpr float_denorm_style has_denorm
+       = denorm_absent;
+      static constexpr bool has_denorm_loss = false;
+
+      static constexpr long
+      infinity() noexcept { return static_cast<long>(0); }
+
+      static constexpr long
+      quiet_NaN() noexcept { return static_cast<long>(0); }
+
+      static constexpr long
+      signaling_NaN() noexcept { return static_cast<long>(0); }
+
+      static constexpr long
+      denorm_min() noexcept { return static_cast<long>(0); }
+
+      static constexpr bool is_iec559 = false;
+      static constexpr bool is_bounded = true;
+      static constexpr bool is_modulo = false;
+
+      static constexpr bool traps = false;
+      static constexpr bool tinyness_before = false;
+      static constexpr float_round_style round_style
+       = round_toward_zero;
+    };
+
+
+  template<>
+    struct numeric_limits<unsigned long>
+    {
+      static constexpr bool is_specialized = true;
+
+      static constexpr unsigned long
+      min() noexcept { return 0; }
+
+      static constexpr unsigned long
+      max() noexcept { return 0x7fffffffffffffffL * 2UL + 1; }
+
+
+      static constexpr unsigned long
+      lowest() noexcept { return min(); }
+
+
+      static constexpr int digits
+       = (sizeof(unsigned long) * 8 - ((unsigned long)(-1) < 0));
+      static constexpr int digits10
+       = ((sizeof(unsigned long) * 8 - ((unsigned long)(-1) < 0)) * 643L / 2136);
+
+      static constexpr int max_digits10 = 0;
+
+      static constexpr bool is_signed = false;
+      static constexpr bool is_integer = true;
+      static constexpr bool is_exact = true;
+      static constexpr int radix = 2;
+
+      static constexpr unsigned long
+      epsilon() noexcept { return 0; }
+
+      static constexpr unsigned long
+      round_error() noexcept { return 0; }
+
+      static constexpr int min_exponent = 0;
+      static constexpr int min_exponent10 = 0;
+      static constexpr int max_exponent = 0;
+      static constexpr int max_exponent10 = 0;
+
+      static constexpr bool has_infinity = false;
+      static constexpr bool has_quiet_NaN = false;
+      static constexpr bool has_signaling_NaN = false;
+      static constexpr float_denorm_style has_denorm
+       = denorm_absent;
+      static constexpr bool has_denorm_loss = false;
+
+      static constexpr unsigned long
+      infinity() noexcept
+      { return static_cast<unsigned long>(0); }
+
+      static constexpr unsigned long
+      quiet_NaN() noexcept
+      { return static_cast<unsigned long>(0); }
+
+      static constexpr unsigned long
+      signaling_NaN() noexcept
+      { return static_cast<unsigned long>(0); }
+
+      static constexpr unsigned long
+      denorm_min() noexcept
+      { return static_cast<unsigned long>(0); }
+
+      static constexpr bool is_iec559 = false;
+      static constexpr bool is_bounded = true;
+      static constexpr bool is_modulo = true;
+
+      static constexpr bool traps = false;
+      static constexpr bool tinyness_before = false;
+      static constexpr float_round_style round_style
+       = round_toward_zero;
+    };
+
+
+  template<>
+    struct numeric_limits<long long>
+    {
+      static constexpr bool is_specialized = true;
+
+      static constexpr long long
+      min() noexcept { return -0x7fffffffffffffffLL - 1; }
+
+      static constexpr long long
+      max() noexcept { return 0x7fffffffffffffffLL; }
+
+
+      static constexpr long long
+      lowest() noexcept { return min(); }
+
+
+      static constexpr int digits
+       = (sizeof(long long) * 8 - ((long long)(-1) < 0));
+      static constexpr int digits10
+       = ((sizeof(long long) * 8 - ((long long)(-1) < 0)) * 643L / 2136);
+
+      static constexpr int max_digits10 = 0;
+
+      static constexpr bool is_signed = true;
+      static constexpr bool is_integer = true;
+      static constexpr bool is_exact = true;
+      static constexpr int radix = 2;
+
+      static constexpr long long
+      epsilon() noexcept { return 0; }
+
+      static constexpr long long
+      round_error() noexcept { return 0; }
+
+      static constexpr int min_exponent = 0;
+      static constexpr int min_exponent10 = 0;
+      static constexpr int max_exponent = 0;
+      static constexpr int max_exponent10 = 0;
+
+      static constexpr bool has_infinity = false;
+      static constexpr bool has_quiet_NaN = false;
+      static constexpr bool has_signaling_NaN = false;
+      static constexpr float_denorm_style has_denorm
+       = denorm_absent;
+      static constexpr bool has_denorm_loss = false;
+
+      static constexpr long long
+      infinity() noexcept { return static_cast<long long>(0); }
+
+      static constexpr long long
+      quiet_NaN() noexcept { return static_cast<long long>(0); }
+
+      static constexpr long long
+      signaling_NaN() noexcept
+      { return static_cast<long long>(0); }
+
+      static constexpr long long
+      denorm_min() noexcept { return static_cast<long long>(0); }
+
+      static constexpr bool is_iec559 = false;
+      static constexpr bool is_bounded = true;
+      static constexpr bool is_modulo = false;
+
+      static constexpr bool traps = false;
+      static constexpr bool tinyness_before = false;
+      static constexpr float_round_style round_style
+       = round_toward_zero;
+    };
+
+
+  template<>
+    struct numeric_limits<unsigned long long>
+    {
+      static constexpr bool is_specialized = true;
+
+      static constexpr unsigned long long
+      min() noexcept { return 0; }
+
+      static constexpr unsigned long long
+      max() noexcept { return 0x7fffffffffffffffLL * 2ULL + 1; }
+
+
+      static constexpr unsigned long long
+      lowest() noexcept { return min(); }
+
+
+      static constexpr int digits
+       = (sizeof(unsigned long long) * 8 - ((unsigned long long)(-1) < 0));
+      static constexpr int digits10
+       = ((sizeof(unsigned long long) * 8 - ((unsigned long long)(-1) < 0)) * 643L / 2136);
+
+      static constexpr int max_digits10 = 0;
+
+      static constexpr bool is_signed = false;
+      static constexpr bool is_integer = true;
+      static constexpr bool is_exact = true;
+      static constexpr int radix = 2;
+
+      static constexpr unsigned long long
+      epsilon() noexcept { return 0; }
+
+      static constexpr unsigned long long
+      round_error() noexcept { return 0; }
+
+      static constexpr int min_exponent = 0;
+      static constexpr int min_exponent10 = 0;
+      static constexpr int max_exponent = 0;
+      static constexpr int max_exponent10 = 0;
+
+      static constexpr bool has_infinity = false;
+      static constexpr bool has_quiet_NaN = false;
+      static constexpr bool has_signaling_NaN = false;
+      static constexpr float_denorm_style has_denorm
+       = denorm_absent;
+      static constexpr bool has_denorm_loss = false;
+
+      static constexpr unsigned long long
+      infinity() noexcept
+      { return static_cast<unsigned long long>(0); }
+
+      static constexpr unsigned long long
+      quiet_NaN() noexcept
+      { return static_cast<unsigned long long>(0); }
+
+      static constexpr unsigned long long
+      signaling_NaN() noexcept
+      { return static_cast<unsigned long long>(0); }
+
+      static constexpr unsigned long long
+      denorm_min() noexcept
+      { return static_cast<unsigned long long>(0); }
+
+      static constexpr bool is_iec559 = false;
+      static constexpr bool is_bounded = true;
+      static constexpr bool is_modulo = true;
+
+      static constexpr bool traps = false;
+      static constexpr bool tinyness_before = false;
+      static constexpr float_round_style round_style
+       = round_toward_zero;
+    };
+  template<>
+    struct numeric_limits<float>
+    {
+      static constexpr bool is_specialized = true;
+
+      static constexpr float
+      min() noexcept { return 1.17549435082228750796873653722224568e-38F; }
+
+      static constexpr float
+      max() noexcept { return 3.40282346638528859811704183484516925e+38F; }
+
+
+      static constexpr float
+      lowest() noexcept { return -3.40282346638528859811704183484516925e+38F; }
+
+
+      static constexpr int digits = 24;
+      static constexpr int digits10 = 6;
+
+      static constexpr int max_digits10
+  = (2 + (24) * 643L / 2136);
+
+      static constexpr bool is_signed = true;
+      static constexpr bool is_integer = false;
+      static constexpr bool is_exact = false;
+      static constexpr int radix = 2;
+
+      static constexpr float
+      epsilon() noexcept { return 1.19209289550781250000000000000000000e-7F; }
+
+      static constexpr float
+      round_error() noexcept { return 0.5F; }
+
+      static constexpr int min_exponent = (-125);
+      static constexpr int min_exponent10 = (-37);
+      static constexpr int max_exponent = 128;
+      static constexpr int max_exponent10 = 38;
+
+      static constexpr bool has_infinity = 1;
+      static constexpr bool has_quiet_NaN = 1;
+      static constexpr bool has_signaling_NaN = has_quiet_NaN;
+      static constexpr float_denorm_style has_denorm
+ = bool(1) ? denorm_present : denorm_absent;
+      static constexpr bool has_denorm_loss
+       = false;
+
+      static constexpr float
+      infinity() noexcept { return __builtin_huge_valf(); }
+
+      static constexpr float
+      quiet_NaN() noexcept { return __builtin_nanf(""); }
+
+      static constexpr float
+      signaling_NaN() noexcept { return __builtin_nansf(""); }
+
+      static constexpr float
+      denorm_min() noexcept { return 1.40129846432481707092372958328991613e-45F; }
+
+      static constexpr bool is_iec559
+ = has_infinity && has_quiet_NaN && has_denorm == denorm_present;
+      static constexpr bool is_bounded = true;
+      static constexpr bool is_modulo = false;
+
+      static constexpr bool traps = false;
+      static constexpr bool tinyness_before
+       = false;
+      static constexpr float_round_style round_style
+       = round_to_nearest;
+    };
+
+
+
+
+
+
+  template<>
+    struct numeric_limits<double>
+    {
+      static constexpr bool is_specialized = true;
+
+      static constexpr double
+      min() noexcept { return double(2.22507385850720138309023271733240406e-308L); }
+
+      static constexpr double
+      max() noexcept { return double(1.79769313486231570814527423731704357e+308L); }
+
+
+      static constexpr double
+      lowest() noexcept { return -double(1.79769313486231570814527423731704357e+308L); }
+
+
+      static constexpr int digits = 53;
+      static constexpr int digits10 = 15;
+
+      static constexpr int max_digits10
+  = (2 + (53) * 643L / 2136);
+
+      static constexpr bool is_signed = true;
+      static constexpr bool is_integer = false;
+      static constexpr bool is_exact = false;
+      static constexpr int radix = 2;
+
+      static constexpr double
+      epsilon() noexcept { return double(2.22044604925031308084726333618164062e-16L); }
+
+      static constexpr double
+      round_error() noexcept { return 0.5; }
+
+      static constexpr int min_exponent = (-1021);
+      static constexpr int min_exponent10 = (-307);
+      static constexpr int max_exponent = 1024;
+      static constexpr int max_exponent10 = 308;
+
+      static constexpr bool has_infinity = 1;
+      static constexpr bool has_quiet_NaN = 1;
+      static constexpr bool has_signaling_NaN = has_quiet_NaN;
+      static constexpr float_denorm_style has_denorm
+ = bool(1) ? denorm_present : denorm_absent;
+      static constexpr bool has_denorm_loss
+        = false;
+
+      static constexpr double
+      infinity() noexcept { return __builtin_huge_val(); }
+
+      static constexpr double
+      quiet_NaN() noexcept { return __builtin_nan(""); }
+
+      static constexpr double
+      signaling_NaN() noexcept { return __builtin_nans(""); }
+
+      static constexpr double
+      denorm_min() noexcept { return double(4.94065645841246544176568792868221372e-324L); }
+
+      static constexpr bool is_iec559
+ = has_infinity && has_quiet_NaN && has_denorm == denorm_present;
+      static constexpr bool is_bounded = true;
+      static constexpr bool is_modulo = false;
+
+      static constexpr bool traps = false;
+      static constexpr bool tinyness_before
+       = false;
+      static constexpr float_round_style round_style
+       = round_to_nearest;
+    };
+
+
+
+
+
+
+  template<>
+    struct numeric_limits<long double>
+    {
+      static constexpr bool is_specialized = true;
+
+      static constexpr long double
+      min() noexcept { return 2.00416836000897277799610805135016205e-292L; }
+
+      static constexpr long double
+      max() noexcept { return 1.79769313486231580793728971405301199e+308L; }
+
+
+      static constexpr long double
+      lowest() noexcept { return -1.79769313486231580793728971405301199e+308L; }
+
+
+      static constexpr int digits = 106;
+      static constexpr int digits10 = 31;
+
+      static constexpr int max_digits10
+  = (2 + (106) * 643L / 2136);
+
+      static constexpr bool is_signed = true;
+      static constexpr bool is_integer = false;
+      static constexpr bool is_exact = false;
+      static constexpr int radix = 2;
+
+      static constexpr long double
+      epsilon() noexcept { return 4.94065645841246544176568792868221372e-324L; }
+
+      static constexpr long double
+      round_error() noexcept { return 0.5L; }
+
+      static constexpr int min_exponent = (-968);
+      static constexpr int min_exponent10 = (-291);
+      static constexpr int max_exponent = 1024;
+      static constexpr int max_exponent10 = 308;
+
+      static constexpr bool has_infinity = 1;
+      static constexpr bool has_quiet_NaN = 1;
+      static constexpr bool has_signaling_NaN = has_quiet_NaN;
+      static constexpr float_denorm_style has_denorm
+ = bool(1) ? denorm_present : denorm_absent;
+      static constexpr bool has_denorm_loss
+ = false;
+
+      static constexpr long double
+      infinity() noexcept { return __builtin_huge_vall(); }
+
+      static constexpr long double
+      quiet_NaN() noexcept { return __builtin_nanl(""); }
+
+      static constexpr long double
+      signaling_NaN() noexcept { return __builtin_nansl(""); }
+
+      static constexpr long double
+      denorm_min() noexcept { return 4.94065645841246544176568792868221372e-324L; }
+
+      static constexpr bool is_iec559
+ = has_infinity && has_quiet_NaN && has_denorm == denorm_present;
+      static constexpr bool is_bounded = true;
+      static constexpr bool is_modulo = false;
+
+      static constexpr bool traps = false;
+      static constexpr bool tinyness_before =
+      false;
+      static constexpr float_round_style round_style =
+            round_to_nearest;
+    };
+
+
+
+
+
+
+}
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+  namespace __detail
+  {
+
+    template<typename _Tp>
+      inline bool
+      _Power_of_2(_Tp __x)
+      {
+ return ((__x - 1) & __x) == 0;
+      }
+  }
+
+
+
+
+
+
+  template<typename _IntType = int>
+    class uniform_int_distribution
+    {
+      static_assert(std::is_integral<_IntType>::value,
+      "template argument must be an integral type");
+
+    public:
+
+      typedef _IntType result_type;
+
+      struct param_type
+      {
+ typedef uniform_int_distribution<_IntType> distribution_type;
+
+ explicit
+ param_type(_IntType __a = 0,
+     _IntType __b = std::numeric_limits<_IntType>::max())
+ : _M_a(__a), _M_b(__b)
+ {
+   ;
+ }
+
+ result_type
+ a() const
+ { return _M_a; }
+
+ result_type
+ b() const
+ { return _M_b; }
+
+ friend bool
+ operator==(const param_type& __p1, const param_type& __p2)
+ { return __p1._M_a == __p2._M_a && __p1._M_b == __p2._M_b; }
+
+ friend bool
+ operator!=(const param_type& __p1, const param_type& __p2)
+ { return !(__p1 == __p2); }
+
+      private:
+ _IntType _M_a;
+ _IntType _M_b;
+      };
+
+    public:
+
+
+
+      explicit
+      uniform_int_distribution(_IntType __a = 0,
+      _IntType __b = std::numeric_limits<_IntType>::max())
+      : _M_param(__a, __b)
+      { }
+
+      explicit
+      uniform_int_distribution(const param_type& __p)
+      : _M_param(__p)
+      { }
+
+
+
+
+
+
+      void
+      reset() { }
+
+      result_type
+      a() const
+      { return _M_param.a(); }
+
+      result_type
+      b() const
+      { return _M_param.b(); }
+
+
+
+
+      param_type
+      param() const
+      { return _M_param; }
+
+
+
+
+
+      void
+      param(const param_type& __param)
+      { _M_param = __param; }
+
+
+
+
+      result_type
+      min() const
+      { return this->a(); }
+
+
+
+
+      result_type
+      max() const
+      { return this->b(); }
+
+
+
+
+      template<typename _UniformRandomNumberGenerator>
+ result_type
+ operator()(_UniformRandomNumberGenerator& __urng)
+        { return this->operator()(__urng, _M_param); }
+
+      template<typename _UniformRandomNumberGenerator>
+ result_type
+ operator()(_UniformRandomNumberGenerator& __urng,
+     const param_type& __p);
+
+      template<typename _ForwardIterator,
+        typename _UniformRandomNumberGenerator>
+ void
+ __generate(_ForwardIterator __f, _ForwardIterator __t,
+     _UniformRandomNumberGenerator& __urng)
+ { this->__generate(__f, __t, __urng, _M_param); }
+
+      template<typename _ForwardIterator,
+        typename _UniformRandomNumberGenerator>
+ void
+ __generate(_ForwardIterator __f, _ForwardIterator __t,
+     _UniformRandomNumberGenerator& __urng,
+     const param_type& __p)
+ { this->__generate_impl(__f, __t, __urng, __p); }
+
+      template<typename _UniformRandomNumberGenerator>
+ void
+ __generate(result_type* __f, result_type* __t,
+     _UniformRandomNumberGenerator& __urng,
+     const param_type& __p)
+ { this->__generate_impl(__f, __t, __urng, __p); }
+
+
+
+
+
+      friend bool
+      operator==(const uniform_int_distribution& __d1,
+   const uniform_int_distribution& __d2)
+      { return __d1._M_param == __d2._M_param; }
+
+    private:
+      template<typename _ForwardIterator,
+        typename _UniformRandomNumberGenerator>
+ void
+ __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
+   _UniformRandomNumberGenerator& __urng,
+   const param_type& __p);
+
+      param_type _M_param;
+    };
+
+  template<typename _IntType>
+    template<typename _UniformRandomNumberGenerator>
+      typename uniform_int_distribution<_IntType>::result_type
+      uniform_int_distribution<_IntType>::
+      operator()(_UniformRandomNumberGenerator& __urng,
+   const param_type& __param)
+      {
+ typedef typename _UniformRandomNumberGenerator::result_type
+   _Gresult_type;
+ typedef typename std::make_unsigned<result_type>::type __utype;
+ typedef typename std::common_type<_Gresult_type, __utype>::type
+   __uctype;
+
+ const __uctype __urngmin = __urng.min();
+ const __uctype __urngmax = __urng.max();
+ const __uctype __urngrange = __urngmax - __urngmin;
+ const __uctype __urange
+   = __uctype(__param.b()) - __uctype(__param.a());
+
+ __uctype __ret;
+
+ if (__urngrange > __urange)
+   {
+
+     const __uctype __uerange = __urange + 1;
+     const __uctype __scaling = __urngrange / __uerange;
+     const __uctype __past = __uerange * __scaling;
+     do
+       __ret = __uctype(__urng()) - __urngmin;
+     while (__ret >= __past);
+     __ret /= __scaling;
+   }
+ else if (__urngrange < __urange)
+   {
+     __uctype __tmp;
+     do
+       {
+  const __uctype __uerngrange = __urngrange + 1;
+  __tmp = (__uerngrange * operator()
+    (__urng, param_type(0, __urange / __uerngrange)));
+  __ret = __tmp + (__uctype(__urng()) - __urngmin);
+       }
+     while (__ret > __urange || __ret < __tmp);
+   }
+ else
+   __ret = __uctype(__urng()) - __urngmin;
+
+ return __ret + __param.a();
+      }
+
+
+  template<typename _IntType>
+    template<typename _ForwardIterator,
+      typename _UniformRandomNumberGenerator>
+      void
+      uniform_int_distribution<_IntType>::
+      __generate_impl(_ForwardIterator __f, _ForwardIterator __t,
+        _UniformRandomNumberGenerator& __urng,
+        const param_type& __param)
+      {
+
+ typedef typename _UniformRandomNumberGenerator::result_type
+   _Gresult_type;
+ typedef typename std::make_unsigned<result_type>::type __utype;
+ typedef typename std::common_type<_Gresult_type, __utype>::type
+   __uctype;
+
+ const __uctype __urngmin = __urng.min();
+ const __uctype __urngmax = __urng.max();
+ const __uctype __urngrange = __urngmax - __urngmin;
+ const __uctype __urange
+   = __uctype(__param.b()) - __uctype(__param.a());
+
+ __uctype __ret;
+
+ if (__urngrange > __urange)
+   {
+     if (__detail::_Power_of_2(__urngrange + 1)
+  && __detail::_Power_of_2(__urange + 1))
+       {
+  while (__f != __t)
+    {
+      __ret = __uctype(__urng()) - __urngmin;
+      *__f++ = (__ret & __urange) + __param.a();
+    }
+       }
+     else
+       {
+
+  const __uctype __uerange = __urange + 1;
+  const __uctype __scaling = __urngrange / __uerange;
+  const __uctype __past = __uerange * __scaling;
+  while (__f != __t)
+    {
+      do
+        __ret = __uctype(__urng()) - __urngmin;
+      while (__ret >= __past);
+      *__f++ = __ret / __scaling + __param.a();
+    }
+       }
+   }
+ else if (__urngrange < __urange)
+   {
+     __uctype __tmp;
+     while (__f != __t)
+       {
+  do
+    {
+      const __uctype __uerngrange = __urngrange + 1;
+      __tmp = (__uerngrange * operator()
+        (__urng, param_type(0, __urange / __uerngrange)));
+      __ret = __tmp + (__uctype(__urng()) - __urngmin);
+    }
+  while (__ret > __urange || __ret < __tmp);
+  *__f++ = __ret;
+       }
+   }
+ else
+   while (__f != __t)
+     *__f++ = __uctype(__urng()) - __urngmin + __param.a();
+      }
+
+
+
+
+}
+
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+  template<typename _Iterator, typename _Compare>
+    void
+    __move_median_to_first(_Iterator __result,_Iterator __a, _Iterator __b,
+      _Iterator __c, _Compare __comp)
+    {
+      if (__comp(__a, __b))
+ {
+   if (__comp(__b, __c))
+     std::iter_swap(__result, __b);
+   else if (__comp(__a, __c))
+     std::iter_swap(__result, __c);
+   else
+     std::iter_swap(__result, __a);
+ }
+      else if (__comp(__a, __c))
+ std::iter_swap(__result, __a);
+      else if (__comp(__b, __c))
+ std::iter_swap(__result, __c);
+      else
+ std::iter_swap(__result, __b);
+    }
+
+
+  template<typename _InputIterator, typename _Predicate>
+    inline _InputIterator
+    __find_if(_InputIterator __first, _InputIterator __last,
+       _Predicate __pred, input_iterator_tag)
+    {
+      while (__first != __last && !__pred(__first))
+ ++__first;
+      return __first;
+    }
+
+
+  template<typename _RandomAccessIterator, typename _Predicate>
+    _RandomAccessIterator
+    __find_if(_RandomAccessIterator __first, _RandomAccessIterator __last,
+       _Predicate __pred, random_access_iterator_tag)
+    {
+      typename iterator_traits<_RandomAccessIterator>::difference_type
+ __trip_count = (__last - __first) >> 2;
+
+      for (; __trip_count > 0; --__trip_count)
+ {
+   if (__pred(__first))
+     return __first;
+   ++__first;
+
+   if (__pred(__first))
+     return __first;
+   ++__first;
+
+   if (__pred(__first))
+     return __first;
+   ++__first;
+
+   if (__pred(__first))
+     return __first;
+   ++__first;
+ }
+
+      switch (__last - __first)
+ {
+ case 3:
+   if (__pred(__first))
+     return __first;
+   ++__first;
+ case 2:
+   if (__pred(__first))
+     return __first;
+   ++__first;
+ case 1:
+   if (__pred(__first))
+     return __first;
+   ++__first;
+ case 0:
+ default:
+   return __last;
+ }
+    }
+
+  template<typename _Iterator, typename _Predicate>
+    inline _Iterator
+    __find_if(_Iterator __first, _Iterator __last, _Predicate __pred)
+    {
+      return __find_if(__first, __last, __pred,
+         std::__iterator_category(__first));
+    }
+
+
+  template<typename _InputIterator, typename _Predicate>
+    inline _InputIterator
+    __find_if_not(_InputIterator __first, _InputIterator __last,
+    _Predicate __pred)
+    {
+      return std::__find_if(__first, __last,
+       __gnu_cxx::__ops::__negate(__pred),
+       std::__iterator_category(__first));
+    }
+
+
+
+
+  template<typename _InputIterator, typename _Predicate, typename _Distance>
+    _InputIterator
+    __find_if_not_n(_InputIterator __first, _Distance& __len, _Predicate __pred)
+    {
+      for (; __len; --__len, (void) ++__first)
+ if (!__pred(__first))
+   break;
+      return __first;
+    }
+  template<typename _ForwardIterator1, typename _ForwardIterator2,
+    typename _BinaryPredicate>
+    _ForwardIterator1
+    __search(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
+      _ForwardIterator2 __first2, _ForwardIterator2 __last2,
+      _BinaryPredicate __predicate)
+    {
+
+      if (__first1 == __last1 || __first2 == __last2)
+ return __first1;
+
+
+      _ForwardIterator2 __p1(__first2);
+      if (++__p1 == __last2)
+ return std::__find_if(__first1, __last1,
+  __gnu_cxx::__ops::__iter_comp_iter(__predicate, __first2));
+
+
+      _ForwardIterator2 __p;
+      _ForwardIterator1 __current = __first1;
+
+      for (;;)
+ {
+   __first1 =
+     std::__find_if(__first1, __last1,
+  __gnu_cxx::__ops::__iter_comp_iter(__predicate, __first2));
+
+   if (__first1 == __last1)
+     return __last1;
+
+   __p = __p1;
+   __current = __first1;
+   if (++__current == __last1)
+     return __last1;
+
+   while (__predicate(__current, __p))
+     {
+       if (++__p == __last2)
+  return __first1;
+       if (++__current == __last1)
+  return __last1;
+     }
+   ++__first1;
+ }
+      return __first1;
+    }
+
+
+
+
+
+
+  template<typename _ForwardIterator, typename _Integer,
+    typename _UnaryPredicate>
+    _ForwardIterator
+    __search_n_aux(_ForwardIterator __first, _ForwardIterator __last,
+     _Integer __count, _UnaryPredicate __unary_pred,
+     std::forward_iterator_tag)
+    {
+      __first = std::__find_if(__first, __last, __unary_pred);
+      while (__first != __last)
+ {
+   typename iterator_traits<_ForwardIterator>::difference_type
+     __n = __count;
+   _ForwardIterator __i = __first;
+   ++__i;
+   while (__i != __last && __n != 1 && __unary_pred(__i))
+     {
+       ++__i;
+       --__n;
+     }
+   if (__n == 1)
+     return __first;
+   if (__i == __last)
+     return __last;
+   __first = std::__find_if(++__i, __last, __unary_pred);
+ }
+      return __last;
+    }
+
+
+
+
+
+  template<typename _RandomAccessIter, typename _Integer,
+    typename _UnaryPredicate>
+    _RandomAccessIter
+    __search_n_aux(_RandomAccessIter __first, _RandomAccessIter __last,
+     _Integer __count, _UnaryPredicate __unary_pred,
+     std::random_access_iterator_tag)
+    {
+      typedef typename std::iterator_traits<_RandomAccessIter>::difference_type
+ _DistanceType;
+
+      _DistanceType __tailSize = __last - __first;
+      _DistanceType __remainder = __count;
+
+      while (__remainder <= __tailSize)
+ {
+   __first += __remainder;
+   __tailSize -= __remainder;
+
+
+   _RandomAccessIter __backTrack = __first;
+   while (__unary_pred(--__backTrack))
+     {
+       if (--__remainder == 0)
+  return (__first - __count);
+     }
+   __remainder = __count + 1 - (__first - __backTrack);
+ }
+      return __last;
+    }
+
+  template<typename _ForwardIterator, typename _Integer,
+    typename _UnaryPredicate>
+    _ForwardIterator
+    __search_n(_ForwardIterator __first, _ForwardIterator __last,
+        _Integer __count,
+        _UnaryPredicate __unary_pred)
+    {
+      if (__count <= 0)
+ return __first;
+
+      if (__count == 1)
+ return std::__find_if(__first, __last, __unary_pred);
+
+      return std::__search_n_aux(__first, __last, __count, __unary_pred,
+     std::__iterator_category(__first));
+    }
+
+
+  template<typename _ForwardIterator1, typename _ForwardIterator2,
+    typename _BinaryPredicate>
+    _ForwardIterator1
+    __find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
+        _ForwardIterator2 __first2, _ForwardIterator2 __last2,
+        forward_iterator_tag, forward_iterator_tag,
+        _BinaryPredicate __comp)
+    {
+      if (__first2 == __last2)
+ return __last1;
+
+      _ForwardIterator1 __result = __last1;
+      while (1)
+ {
+   _ForwardIterator1 __new_result
+     = std::__search(__first1, __last1, __first2, __last2, __comp);
+   if (__new_result == __last1)
+     return __result;
+   else
+     {
+       __result = __new_result;
+       __first1 = __new_result;
+       ++__first1;
+     }
+ }
+    }
+
+
+  template<typename _BidirectionalIterator1, typename _BidirectionalIterator2,
+    typename _BinaryPredicate>
+    _BidirectionalIterator1
+    __find_end(_BidirectionalIterator1 __first1,
+        _BidirectionalIterator1 __last1,
+        _BidirectionalIterator2 __first2,
+        _BidirectionalIterator2 __last2,
+        bidirectional_iterator_tag, bidirectional_iterator_tag,
+        _BinaryPredicate __comp)
+    {
+
+     
+
+     
+
+
+      typedef reverse_iterator<_BidirectionalIterator1> _RevIterator1;
+      typedef reverse_iterator<_BidirectionalIterator2> _RevIterator2;
+
+      _RevIterator1 __rlast1(__first1);
+      _RevIterator2 __rlast2(__first2);
+      _RevIterator1 __rresult = std::__search(_RevIterator1(__last1), __rlast1,
+           _RevIterator2(__last2), __rlast2,
+           __comp);
+
+      if (__rresult == __rlast1)
+ return __last1;
+      else
+ {
+   _BidirectionalIterator1 __result = __rresult.base();
+   std::advance(__result, -std::distance(__first2, __last2));
+   return __result;
+ }
+    }
+  template<typename _ForwardIterator1, typename _ForwardIterator2>
+    inline _ForwardIterator1
+    find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
+      _ForwardIterator2 __first2, _ForwardIterator2 __last2)
+    {
+
+     
+     
+     
+
+
+      ;
+      ;
+
+      return std::__find_end(__first1, __last1, __first2, __last2,
+        std::__iterator_category(__first1),
+        std::__iterator_category(__first2),
+        __gnu_cxx::__ops::__iter_equal_to_iter());
+    }
+  template<typename _ForwardIterator1, typename _ForwardIterator2,
+    typename _BinaryPredicate>
+    inline _ForwardIterator1
+    find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
+      _ForwardIterator2 __first2, _ForwardIterator2 __last2,
+      _BinaryPredicate __comp)
+    {
+
+     
+     
+     
+
+
+      ;
+      ;
+
+      return std::__find_end(__first1, __last1, __first2, __last2,
+        std::__iterator_category(__first1),
+        std::__iterator_category(__first2),
+        __gnu_cxx::__ops::__iter_comp_iter(__comp));
+    }
+  template<typename _InputIterator, typename _Predicate>
+    inline bool
+    all_of(_InputIterator __first, _InputIterator __last, _Predicate __pred)
+    { return __last == std::find_if_not(__first, __last, __pred); }
+  template<typename _InputIterator, typename _Predicate>
+    inline bool
+    none_of(_InputIterator __first, _InputIterator __last, _Predicate __pred)
+    { return __last == std::find_if(__first, __last, __pred); }
+  template<typename _InputIterator, typename _Predicate>
+    inline bool
+    any_of(_InputIterator __first, _InputIterator __last, _Predicate __pred)
+    { return !std::none_of(__first, __last, __pred); }
+  template<typename _InputIterator, typename _Predicate>
+    inline _InputIterator
+    find_if_not(_InputIterator __first, _InputIterator __last,
+  _Predicate __pred)
+    {
+
+     
+     
+
+      ;
+      return std::__find_if_not(__first, __last,
+    __gnu_cxx::__ops::__pred_iter(__pred));
+    }
+  template<typename _InputIterator, typename _Predicate>
+    inline bool
+    is_partitioned(_InputIterator __first, _InputIterator __last,
+     _Predicate __pred)
+    {
+      __first = std::find_if_not(__first, __last, __pred);
+      if (__first == __last)
+ return true;
+      ++__first;
+      return std::none_of(__first, __last, __pred);
+    }
+  template<typename _ForwardIterator, typename _Predicate>
+    _ForwardIterator
+    partition_point(_ForwardIterator __first, _ForwardIterator __last,
+      _Predicate __pred)
+    {
+
+     
+     
+
+
+
+      ;
+
+      typedef typename iterator_traits<_ForwardIterator>::difference_type
+ _DistanceType;
+
+      _DistanceType __len = std::distance(__first, __last);
+      _DistanceType __half;
+      _ForwardIterator __middle;
+
+      while (__len > 0)
+ {
+   __half = __len >> 1;
+   __middle = __first;
+   std::advance(__middle, __half);
+   if (__pred(*__middle))
+     {
+       __first = __middle;
+       ++__first;
+       __len = __len - __half - 1;
+     }
+   else
+     __len = __half;
+ }
+      return __first;
+    }
+
+
+  template<typename _InputIterator, typename _OutputIterator,
+    typename _Predicate>
+    _OutputIterator
+    __remove_copy_if(_InputIterator __first, _InputIterator __last,
+       _OutputIterator __result, _Predicate __pred)
+    {
+      for (; __first != __last; ++__first)
+ if (!__pred(__first))
+   {
+     *__result = *__first;
+     ++__result;
+   }
+      return __result;
+    }
+  template<typename _InputIterator, typename _OutputIterator, typename _Tp>
+    inline _OutputIterator
+    remove_copy(_InputIterator __first, _InputIterator __last,
+  _OutputIterator __result, const _Tp& __value)
+    {
+
+     
+     
+
+     
+
+      ;
+
+      return std::__remove_copy_if(__first, __last, __result,
+ __gnu_cxx::__ops::__iter_equals_val(__value));
+    }
+  template<typename _InputIterator, typename _OutputIterator,
+    typename _Predicate>
+    inline _OutputIterator
+    remove_copy_if(_InputIterator __first, _InputIterator __last,
+     _OutputIterator __result, _Predicate __pred)
+    {
+
+     
+     
+
+     
+
+      ;
+
+      return std::__remove_copy_if(__first, __last, __result,
+       __gnu_cxx::__ops::__pred_iter(__pred));
+    }
+  template<typename _InputIterator, typename _OutputIterator,
+    typename _Predicate>
+    _OutputIterator
+    copy_if(_InputIterator __first, _InputIterator __last,
+     _OutputIterator __result, _Predicate __pred)
+    {
+
+     
+     
+
+     
+
+      ;
+
+      for (; __first != __last; ++__first)
+ if (__pred(*__first))
+   {
+     *__result = *__first;
+     ++__result;
+   }
+      return __result;
+    }
+
+  template<typename _InputIterator, typename _Size, typename _OutputIterator>
+    _OutputIterator
+    __copy_n(_InputIterator __first, _Size __n,
+      _OutputIterator __result, input_iterator_tag)
+    {
+      if (__n > 0)
+ {
+   while (true)
+     {
+       *__result = *__first;
+       ++__result;
+       if (--__n > 0)
+  ++__first;
+       else
+  break;
+     }
+ }
+      return __result;
+    }
+
+  template<typename _RandomAccessIterator, typename _Size,
+    typename _OutputIterator>
+    inline _OutputIterator
+    __copy_n(_RandomAccessIterator __first, _Size __n,
+      _OutputIterator __result, random_access_iterator_tag)
+    { return std::copy(__first, __first + __n, __result); }
+  template<typename _InputIterator, typename _Size, typename _OutputIterator>
+    inline _OutputIterator
+    copy_n(_InputIterator __first, _Size __n, _OutputIterator __result)
+    {
+
+     
+     
+
+
+      return std::__copy_n(__first, __n, __result,
+      std::__iterator_category(__first));
+    }
+  template<typename _InputIterator, typename _OutputIterator1,
+    typename _OutputIterator2, typename _Predicate>
+    pair<_OutputIterator1, _OutputIterator2>
+    partition_copy(_InputIterator __first, _InputIterator __last,
+     _OutputIterator1 __out_true, _OutputIterator2 __out_false,
+     _Predicate __pred)
+    {
+
+     
+     
+
+     
+
+     
+
+      ;
+
+      for (; __first != __last; ++__first)
+ if (__pred(*__first))
+   {
+     *__out_true = *__first;
+     ++__out_true;
+   }
+ else
+   {
+     *__out_false = *__first;
+     ++__out_false;
+   }
+
+      return pair<_OutputIterator1, _OutputIterator2>(__out_true, __out_false);
+    }
+
+
+  template<typename _ForwardIterator, typename _Predicate>
+    _ForwardIterator
+    __remove_if(_ForwardIterator __first, _ForwardIterator __last,
+  _Predicate __pred)
+    {
+      __first = std::__find_if(__first, __last, __pred);
+      if (__first == __last)
+ return __first;
+      _ForwardIterator __result = __first;
+      ++__first;
+      for (; __first != __last; ++__first)
+ if (!__pred(__first))
+   {
+     *__result = std::move(*__first);
+     ++__result;
+   }
+      return __result;
+    }
+  template<typename _ForwardIterator, typename _Tp>
+    inline _ForwardIterator
+    remove(_ForwardIterator __first, _ForwardIterator __last,
+    const _Tp& __value)
+    {
+
+     
+
+     
+
+      ;
+
+      return std::__remove_if(__first, __last,
+  __gnu_cxx::__ops::__iter_equals_val(__value));
+    }
+  template<typename _ForwardIterator, typename _Predicate>
+    inline _ForwardIterator
+    remove_if(_ForwardIterator __first, _ForwardIterator __last,
+       _Predicate __pred)
+    {
+
+     
+
+     
+
+      ;
+
+      return std::__remove_if(__first, __last,
+         __gnu_cxx::__ops::__pred_iter(__pred));
+    }
+
+  template<typename _ForwardIterator, typename _BinaryPredicate>
+    _ForwardIterator
+    __adjacent_find(_ForwardIterator __first, _ForwardIterator __last,
+      _BinaryPredicate __binary_pred)
+    {
+      if (__first == __last)
+ return __last;
+      _ForwardIterator __next = __first;
+      while (++__next != __last)
+ {
+   if (__binary_pred(__first, __next))
+     return __first;
+   __first = __next;
+ }
+      return __last;
+    }
+
+  template<typename _ForwardIterator, typename _BinaryPredicate>
+    _ForwardIterator
+    __unique(_ForwardIterator __first, _ForwardIterator __last,
+      _BinaryPredicate __binary_pred)
+    {
+
+      __first = std::__adjacent_find(__first, __last, __binary_pred);
+      if (__first == __last)
+ return __last;
+
+
+      _ForwardIterator __dest = __first;
+      ++__first;
+      while (++__first != __last)
+ if (!__binary_pred(__dest, __first))
+   *++__dest = std::move(*__first);
+      return ++__dest;
+    }
+  template<typename _ForwardIterator>
+    inline _ForwardIterator
+    unique(_ForwardIterator __first, _ForwardIterator __last)
+    {
+
+     
+
+     
+
+      ;
+
+      return std::__unique(__first, __last,
+      __gnu_cxx::__ops::__iter_equal_to_iter());
+    }
+  template<typename _ForwardIterator, typename _BinaryPredicate>
+    inline _ForwardIterator
+    unique(_ForwardIterator __first, _ForwardIterator __last,
+    _BinaryPredicate __binary_pred)
+    {
+
+     
+
+     
+
+
+      ;
+
+      return std::__unique(__first, __last,
+      __gnu_cxx::__ops::__iter_comp_iter(__binary_pred));
+    }
+
+
+
+
+
+
+
+  template<typename _ForwardIterator, typename _OutputIterator,
+    typename _BinaryPredicate>
+    _OutputIterator
+    __unique_copy(_ForwardIterator __first, _ForwardIterator __last,
+    _OutputIterator __result, _BinaryPredicate __binary_pred,
+    forward_iterator_tag, output_iterator_tag)
+    {
+
+     
+
+
+
+      _ForwardIterator __next = __first;
+      *__result = *__first;
+      while (++__next != __last)
+ if (!__binary_pred(__first, __next))
+   {
+     __first = __next;
+     *++__result = *__first;
+   }
+      return ++__result;
+    }
+
+
+
+
+
+
+
+  template<typename _InputIterator, typename _OutputIterator,
+    typename _BinaryPredicate>
+    _OutputIterator
+    __unique_copy(_InputIterator __first, _InputIterator __last,
+    _OutputIterator __result, _BinaryPredicate __binary_pred,
+    input_iterator_tag, output_iterator_tag)
+    {
+
+     
+
+
+
+      typename iterator_traits<_InputIterator>::value_type __value = *__first;
+      __decltype(__gnu_cxx::__ops::__iter_comp_val(__binary_pred))
+ __rebound_pred
+ = __gnu_cxx::__ops::__iter_comp_val(__binary_pred);
+      *__result = __value;
+      while (++__first != __last)
+ if (!__rebound_pred(__first, __value))
+   {
+     __value = *__first;
+     *++__result = __value;
+   }
+      return ++__result;
+    }
+
+
+
+
+
+
+
+  template<typename _InputIterator, typename _ForwardIterator,
+    typename _BinaryPredicate>
+    _ForwardIterator
+    __unique_copy(_InputIterator __first, _InputIterator __last,
+    _ForwardIterator __result, _BinaryPredicate __binary_pred,
+    input_iterator_tag, forward_iterator_tag)
+    {
+
+     
+
+
+      *__result = *__first;
+      while (++__first != __last)
+ if (!__binary_pred(__result, __first))
+   *++__result = *__first;
+      return ++__result;
+    }
+
+
+
+
+
+
+  template<typename _BidirectionalIterator>
+    void
+    __reverse(_BidirectionalIterator __first, _BidirectionalIterator __last,
+       bidirectional_iterator_tag)
+    {
+      while (true)
+ if (__first == __last || __first == --__last)
+   return;
+ else
+   {
+     std::iter_swap(__first, __last);
+     ++__first;
+   }
+    }
+
+
+
+
+
+
+  template<typename _RandomAccessIterator>
+    void
+    __reverse(_RandomAccessIterator __first, _RandomAccessIterator __last,
+       random_access_iterator_tag)
+    {
+      if (__first == __last)
+ return;
+      --__last;
+      while (__first < __last)
+ {
+   std::iter_swap(__first, __last);
+   ++__first;
+   --__last;
+ }
+    }
+  template<typename _BidirectionalIterator>
+    inline void
+    reverse(_BidirectionalIterator __first, _BidirectionalIterator __last)
+    {
+
+     
+
+      ;
+      std::__reverse(__first, __last, std::__iterator_category(__first));
+    }
+  template<typename _BidirectionalIterator, typename _OutputIterator>
+    _OutputIterator
+    reverse_copy(_BidirectionalIterator __first, _BidirectionalIterator __last,
+   _OutputIterator __result)
+    {
+
+     
+
+     
+
+      ;
+
+      while (__first != __last)
+ {
+   --__last;
+   *__result = *__last;
+   ++__result;
+ }
+      return __result;
+    }
+
+
+
+
+
+  template<typename _EuclideanRingElement>
+    _EuclideanRingElement
+    __gcd(_EuclideanRingElement __m, _EuclideanRingElement __n)
+    {
+      while (__n != 0)
+ {
+   _EuclideanRingElement __t = __m % __n;
+   __m = __n;
+   __n = __t;
+ }
+      return __m;
+    }
+
+  inline namespace _V2
+  {
+
+
+  template<typename _ForwardIterator>
+    _ForwardIterator
+    __rotate(_ForwardIterator __first,
+      _ForwardIterator __middle,
+      _ForwardIterator __last,
+      forward_iterator_tag)
+    {
+      if (__first == __middle)
+ return __last;
+      else if (__last == __middle)
+ return __first;
+
+      _ForwardIterator __first2 = __middle;
+      do
+ {
+   std::iter_swap(__first, __first2);
+   ++__first;
+   ++__first2;
+   if (__first == __middle)
+     __middle = __first2;
+ }
+      while (__first2 != __last);
+
+      _ForwardIterator __ret = __first;
+
+      __first2 = __middle;
+
+      while (__first2 != __last)
+ {
+   std::iter_swap(__first, __first2);
+   ++__first;
+   ++__first2;
+   if (__first == __middle)
+     __middle = __first2;
+   else if (__first2 == __last)
+     __first2 = __middle;
+ }
+      return __ret;
+    }
+
+
+  template<typename _BidirectionalIterator>
+    _BidirectionalIterator
+    __rotate(_BidirectionalIterator __first,
+      _BidirectionalIterator __middle,
+      _BidirectionalIterator __last,
+       bidirectional_iterator_tag)
+    {
+
+     
+
+
+      if (__first == __middle)
+ return __last;
+      else if (__last == __middle)
+ return __first;
+
+      std::__reverse(__first, __middle, bidirectional_iterator_tag());
+      std::__reverse(__middle, __last, bidirectional_iterator_tag());
+
+      while (__first != __middle && __middle != __last)
+ {
+   std::iter_swap(__first, --__last);
+   ++__first;
+ }
+
+      if (__first == __middle)
+ {
+   std::__reverse(__middle, __last, bidirectional_iterator_tag());
+   return __last;
+ }
+      else
+ {
+   std::__reverse(__first, __middle, bidirectional_iterator_tag());
+   return __first;
+ }
+    }
+
+
+  template<typename _RandomAccessIterator>
+    _RandomAccessIterator
+    __rotate(_RandomAccessIterator __first,
+      _RandomAccessIterator __middle,
+      _RandomAccessIterator __last,
+      random_access_iterator_tag)
+    {
+
+     
+
+
+      if (__first == __middle)
+ return __last;
+      else if (__last == __middle)
+ return __first;
+
+      typedef typename iterator_traits<_RandomAccessIterator>::difference_type
+ _Distance;
+      typedef typename iterator_traits<_RandomAccessIterator>::value_type
+ _ValueType;
+
+      _Distance __n = __last - __first;
+      _Distance __k = __middle - __first;
+
+      if (__k == __n - __k)
+ {
+   std::swap_ranges(__first, __middle, __middle);
+   return __middle;
+ }
+
+      _RandomAccessIterator __p = __first;
+      _RandomAccessIterator __ret = __first + (__last - __middle);
+
+      for (;;)
+ {
+   if (__k < __n - __k)
+     {
+       if (__is_pod(_ValueType) && __k == 1)
+  {
+    _ValueType __t = std::move(*__p);
+    std::move(__p + 1, __p + __n, __p);
+    *(__p + __n - 1) = std::move(__t);
+    return __ret;
+  }
+       _RandomAccessIterator __q = __p + __k;
+       for (_Distance __i = 0; __i < __n - __k; ++ __i)
+  {
+    std::iter_swap(__p, __q);
+    ++__p;
+    ++__q;
+  }
+       __n %= __k;
+       if (__n == 0)
+  return __ret;
+       std::swap(__n, __k);
+       __k = __n - __k;
+     }
+   else
+     {
+       __k = __n - __k;
+       if (__is_pod(_ValueType) && __k == 1)
+  {
+    _ValueType __t = std::move(*(__p + __n - 1));
+    std::move_backward(__p, __p + __n - 1, __p + __n);
+    *__p = std::move(__t);
+    return __ret;
+  }
+       _RandomAccessIterator __q = __p + __n;
+       __p = __q - __k;
+       for (_Distance __i = 0; __i < __n - __k; ++ __i)
+  {
+    --__p;
+    --__q;
+    std::iter_swap(__p, __q);
+  }
+       __n %= __k;
+       if (__n == 0)
+  return __ret;
+       std::swap(__n, __k);
+     }
+ }
+    }
+  template<typename _ForwardIterator>
+    inline _ForwardIterator
+    rotate(_ForwardIterator __first, _ForwardIterator __middle,
+    _ForwardIterator __last)
+    {
+
+     
+
+      ;
+      ;
+
+      return std::__rotate(__first, __middle, __last,
+      std::__iterator_category(__first));
+    }
+
+  }
+  template<typename _ForwardIterator, typename _OutputIterator>
+    inline _OutputIterator
+    rotate_copy(_ForwardIterator __first, _ForwardIterator __middle,
+  _ForwardIterator __last, _OutputIterator __result)
+    {
+
+     
+     
+
+      ;
+      ;
+
+      return std::copy(__first, __middle,
+         std::copy(__middle, __last, __result));
+    }
+
+
+  template<typename _ForwardIterator, typename _Predicate>
+    _ForwardIterator
+    __partition(_ForwardIterator __first, _ForwardIterator __last,
+  _Predicate __pred, forward_iterator_tag)
+    {
+      if (__first == __last)
+ return __first;
+
+      while (__pred(*__first))
+ if (++__first == __last)
+   return __first;
+
+      _ForwardIterator __next = __first;
+
+      while (++__next != __last)
+ if (__pred(*__next))
+   {
+     std::iter_swap(__first, __next);
+     ++__first;
+   }
+
+      return __first;
+    }
+
+
+  template<typename _BidirectionalIterator, typename _Predicate>
+    _BidirectionalIterator
+    __partition(_BidirectionalIterator __first, _BidirectionalIterator __last,
+  _Predicate __pred, bidirectional_iterator_tag)
+    {
+      while (true)
+ {
+   while (true)
+     if (__first == __last)
+       return __first;
+     else if (__pred(*__first))
+       ++__first;
+     else
+       break;
+   --__last;
+   while (true)
+     if (__first == __last)
+       return __first;
+     else if (!bool(__pred(*__last)))
+       --__last;
+     else
+       break;
+   std::iter_swap(__first, __last);
+   ++__first;
+ }
+    }
+  template<typename _ForwardIterator, typename _Pointer, typename _Predicate,
+    typename _Distance>
+    _ForwardIterator
+    __stable_partition_adaptive(_ForwardIterator __first,
+    _ForwardIterator __last,
+    _Predicate __pred, _Distance __len,
+    _Pointer __buffer,
+    _Distance __buffer_size)
+    {
+      if (__len == 1)
+ return __first;
+
+      if (__len <= __buffer_size)
+ {
+   _ForwardIterator __result1 = __first;
+   _Pointer __result2 = __buffer;
+
+
+
+
+   *__result2 = std::move(*__first);
+   ++__result2;
+   ++__first;
+   for (; __first != __last; ++__first)
+     if (__pred(__first))
+       {
+  *__result1 = std::move(*__first);
+  ++__result1;
+       }
+     else
+       {
+  *__result2 = std::move(*__first);
+  ++__result2;
+       }
+
+   std::move(__buffer, __result2, __result1);
+   return __result1;
+ }
+
+      _ForwardIterator __middle = __first;
+      std::advance(__middle, __len / 2);
+      _ForwardIterator __left_split =
+ std::__stable_partition_adaptive(__first, __middle, __pred,
+      __len / 2, __buffer,
+      __buffer_size);
+
+
+
+      _Distance __right_len = __len - __len / 2;
+      _ForwardIterator __right_split =
+ std::__find_if_not_n(__middle, __right_len, __pred);
+
+      if (__right_len)
+ __right_split =
+   std::__stable_partition_adaptive(__right_split, __last, __pred,
+        __right_len,
+        __buffer, __buffer_size);
+
+      std::rotate(__left_split, __middle, __right_split);
+      std::advance(__left_split, std::distance(__middle, __right_split));
+      return __left_split;
+    }
+
+  template<typename _ForwardIterator, typename _Predicate>
+    _ForwardIterator
+    __stable_partition(_ForwardIterator __first, _ForwardIterator __last,
+         _Predicate __pred)
+    {
+      __first = std::__find_if_not(__first, __last, __pred);
+
+      if (__first == __last)
+ return __first;
+
+      typedef typename iterator_traits<_ForwardIterator>::value_type
+ _ValueType;
+      typedef typename iterator_traits<_ForwardIterator>::difference_type
+ _DistanceType;
+
+      _Temporary_buffer<_ForwardIterator, _ValueType> __buf(__first, __last);
+      return
+ std::__stable_partition_adaptive(__first, __last, __pred,
+      _DistanceType(__buf.requested_size()),
+      __buf.begin(),
+      _DistanceType(__buf.size()));
+    }
+  template<typename _ForwardIterator, typename _Predicate>
+    inline _ForwardIterator
+    stable_partition(_ForwardIterator __first, _ForwardIterator __last,
+       _Predicate __pred)
+    {
+
+     
+
+     
+
+      ;
+
+      return std::__stable_partition(__first, __last,
+         __gnu_cxx::__ops::__pred_iter(__pred));
+    }
+
+
+  template<typename _RandomAccessIterator, typename _Compare>
+    void
+    __heap_select(_RandomAccessIterator __first,
+    _RandomAccessIterator __middle,
+    _RandomAccessIterator __last, _Compare __comp)
+    {
+      std::__make_heap(__first, __middle, __comp);
+      for (_RandomAccessIterator __i = __middle; __i < __last; ++__i)
+ if (__comp(__i, __first))
+   std::__pop_heap(__first, __middle, __i, __comp);
+    }
+
+
+
+  template<typename _InputIterator, typename _RandomAccessIterator,
+    typename _Compare>
+    _RandomAccessIterator
+    __partial_sort_copy(_InputIterator __first, _InputIterator __last,
+   _RandomAccessIterator __result_first,
+   _RandomAccessIterator __result_last,
+   _Compare __comp)
+    {
+      typedef typename iterator_traits<_InputIterator>::value_type
+ _InputValueType;
+      typedef iterator_traits<_RandomAccessIterator> _RItTraits;
+      typedef typename _RItTraits::difference_type _DistanceType;
+
+      if (__result_first == __result_last)
+ return __result_last;
+      _RandomAccessIterator __result_real_last = __result_first;
+      while (__first != __last && __result_real_last != __result_last)
+ {
+   *__result_real_last = *__first;
+   ++__result_real_last;
+   ++__first;
+ }
+
+      std::__make_heap(__result_first, __result_real_last, __comp);
+      while (__first != __last)
+ {
+   if (__comp(__first, __result_first))
+     std::__adjust_heap(__result_first, _DistanceType(0),
+          _DistanceType(__result_real_last
+          - __result_first),
+          _InputValueType(*__first), __comp);
+   ++__first;
+ }
+      std::__sort_heap(__result_first, __result_real_last, __comp);
+      return __result_real_last;
+    }
+  template<typename _InputIterator, typename _RandomAccessIterator>
+    inline _RandomAccessIterator
+    partial_sort_copy(_InputIterator __first, _InputIterator __last,
+        _RandomAccessIterator __result_first,
+        _RandomAccessIterator __result_last)
+    {
+     
+     
+
+     
+
+     
+      ;
+      ;
+      ;
+
+      return std::__partial_sort_copy(__first, __last,
+          __result_first, __result_last,
+          __gnu_cxx::__ops::__iter_less_iter());
+    }
+  template<typename _InputIterator, typename _RandomAccessIterator,
+    typename _Compare>
+    inline _RandomAccessIterator
+    partial_sort_copy(_InputIterator __first, _InputIterator __last,
+        _RandomAccessIterator __result_first,
+        _RandomAccessIterator __result_last,
+        _Compare __comp)
+    {
+     
+     
+
+     
+
+     
+
+     
+
+      ;
+      ;
+      ;
+
+      return std::__partial_sort_copy(__first, __last,
+          __result_first, __result_last,
+    __gnu_cxx::__ops::__iter_comp_iter(__comp));
+    }
+
+
+  template<typename _RandomAccessIterator, typename _Compare>
+    void
+    __unguarded_linear_insert(_RandomAccessIterator __last,
+         _Compare __comp)
+    {
+      typename iterator_traits<_RandomAccessIterator>::value_type
+ __val = std::move(*__last);
+      _RandomAccessIterator __next = __last;
+      --__next;
+      while (__comp(__val, __next))
+ {
+   *__last = std::move(*__next);
+   __last = __next;
+   --__next;
+ }
+      *__last = std::move(__val);
+    }
+
+
+  template<typename _RandomAccessIterator, typename _Compare>
+    void
+    __insertion_sort(_RandomAccessIterator __first,
+       _RandomAccessIterator __last, _Compare __comp)
+    {
+      if (__first == __last) return;
+
+      for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i)
+ {
+   if (__comp(__i, __first))
+     {
+       typename iterator_traits<_RandomAccessIterator>::value_type
+  __val = std::move(*__i);
+       std::move_backward(__first, __i, __i + 1);
+       *__first = std::move(__val);
+     }
+   else
+     std::__unguarded_linear_insert(__i,
+    __gnu_cxx::__ops::__val_comp_iter(__comp));
+ }
+    }
+
+
+  template<typename _RandomAccessIterator, typename _Compare>
+    inline void
+    __unguarded_insertion_sort(_RandomAccessIterator __first,
+          _RandomAccessIterator __last, _Compare __comp)
+    {
+      for (_RandomAccessIterator __i = __first; __i != __last; ++__i)
+ std::__unguarded_linear_insert(__i,
+    __gnu_cxx::__ops::__val_comp_iter(__comp));
+    }
+
+
+
+
+
+  enum { _S_threshold = 16 };
+
+
+  template<typename _RandomAccessIterator, typename _Compare>
+    void
+    __final_insertion_sort(_RandomAccessIterator __first,
+      _RandomAccessIterator __last, _Compare __comp)
+    {
+      if (__last - __first > int(_S_threshold))
+ {
+   std::__insertion_sort(__first, __first + int(_S_threshold), __comp);
+   std::__unguarded_insertion_sort(__first + int(_S_threshold), __last,
+       __comp);
+ }
+      else
+ std::__insertion_sort(__first, __last, __comp);
+    }
+
+
+  template<typename _RandomAccessIterator, typename _Compare>
+    _RandomAccessIterator
+    __unguarded_partition(_RandomAccessIterator __first,
+     _RandomAccessIterator __last,
+     _RandomAccessIterator __pivot, _Compare __comp)
+    {
+      while (true)
+ {
+   while (__comp(__first, __pivot))
+     ++__first;
+   --__last;
+   while (__comp(__pivot, __last))
+     --__last;
+   if (!(__first < __last))
+     return __first;
+   std::iter_swap(__first, __last);
+   ++__first;
+ }
+    }
+
+
+  template<typename _RandomAccessIterator, typename _Compare>
+    inline _RandomAccessIterator
+    __unguarded_partition_pivot(_RandomAccessIterator __first,
+    _RandomAccessIterator __last, _Compare __comp)
+    {
+      _RandomAccessIterator __mid = __first + (__last - __first) / 2;
+      std::__move_median_to_first(__first, __first + 1, __mid, __last - 1,
+      __comp);
+      return std::__unguarded_partition(__first + 1, __last, __first, __comp);
+    }
+
+  template<typename _RandomAccessIterator, typename _Compare>
+    inline void
+    __partial_sort(_RandomAccessIterator __first,
+     _RandomAccessIterator __middle,
+     _RandomAccessIterator __last,
+     _Compare __comp)
+    {
+      std::__heap_select(__first, __middle, __last, __comp);
+      std::__sort_heap(__first, __middle, __comp);
+    }
+
+
+  template<typename _RandomAccessIterator, typename _Size, typename _Compare>
+    void
+    __introsort_loop(_RandomAccessIterator __first,
+       _RandomAccessIterator __last,
+       _Size __depth_limit, _Compare __comp)
+    {
+      while (__last - __first > int(_S_threshold))
+ {
+   if (__depth_limit == 0)
+     {
+       std::__partial_sort(__first, __last, __last, __comp);
+       return;
+     }
+   --__depth_limit;
+   _RandomAccessIterator __cut =
+     std::__unguarded_partition_pivot(__first, __last, __comp);
+   std::__introsort_loop(__cut, __last, __depth_limit, __comp);
+   __last = __cut;
+ }
+    }
+
+
+
+  template<typename _RandomAccessIterator, typename _Compare>
+    inline void
+    __sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
+    _Compare __comp)
+    {
+      if (__first != __last)
+ {
+   std::__introsort_loop(__first, __last,
+    std::__lg(__last - __first) * 2,
+    __comp);
+   std::__final_insertion_sort(__first, __last, __comp);
+ }
+    }
+
+  template<typename _RandomAccessIterator, typename _Size, typename _Compare>
+    void
+    __introselect(_RandomAccessIterator __first, _RandomAccessIterator __nth,
+    _RandomAccessIterator __last, _Size __depth_limit,
+    _Compare __comp)
+    {
+      while (__last - __first > 3)
+ {
+   if (__depth_limit == 0)
+     {
+       std::__heap_select(__first, __nth + 1, __last, __comp);
+
+       std::iter_swap(__first, __nth);
+       return;
+     }
+   --__depth_limit;
+   _RandomAccessIterator __cut =
+     std::__unguarded_partition_pivot(__first, __last, __comp);
+   if (__cut <= __nth)
+     __first = __cut;
+   else
+     __last = __cut;
+ }
+      std::__insertion_sort(__first, __last, __comp);
+    }
+  template<typename _ForwardIterator, typename _Tp, typename _Compare>
+    inline _ForwardIterator
+    lower_bound(_ForwardIterator __first, _ForwardIterator __last,
+  const _Tp& __val, _Compare __comp)
+    {
+
+     
+     
+
+     
+                    ;
+
+      return std::__lower_bound(__first, __last, __val,
+    __gnu_cxx::__ops::__iter_comp_val(__comp));
+    }
+
+  template<typename _ForwardIterator, typename _Tp, typename _Compare>
+    _ForwardIterator
+    __upper_bound(_ForwardIterator __first, _ForwardIterator __last,
+    const _Tp& __val, _Compare __comp)
+    {
+      typedef typename iterator_traits<_ForwardIterator>::difference_type
+ _DistanceType;
+
+      _DistanceType __len = std::distance(__first, __last);
+
+      while (__len > 0)
+ {
+   _DistanceType __half = __len >> 1;
+   _ForwardIterator __middle = __first;
+   std::advance(__middle, __half);
+   if (__comp(__val, __middle))
+     __len = __half;
+   else
+     {
+       __first = __middle;
+       ++__first;
+       __len = __len - __half - 1;
+     }
+ }
+      return __first;
+    }
+  template<typename _ForwardIterator, typename _Tp>
+    inline _ForwardIterator
+    upper_bound(_ForwardIterator __first, _ForwardIterator __last,
+  const _Tp& __val)
+    {
+
+     
+     
+
+      ;
+
+      return std::__upper_bound(__first, __last, __val,
+    __gnu_cxx::__ops::__val_less_iter());
+    }
+  template<typename _ForwardIterator, typename _Tp, typename _Compare>
+    inline _ForwardIterator
+    upper_bound(_ForwardIterator __first, _ForwardIterator __last,
+  const _Tp& __val, _Compare __comp)
+    {
+
+     
+     
+
+     
+                    ;
+
+      return std::__upper_bound(__first, __last, __val,
+    __gnu_cxx::__ops::__val_comp_iter(__comp));
+    }
+
+  template<typename _ForwardIterator, typename _Tp,
+    typename _CompareItTp, typename _CompareTpIt>
+    pair<_ForwardIterator, _ForwardIterator>
+    __equal_range(_ForwardIterator __first, _ForwardIterator __last,
+    const _Tp& __val,
+    _CompareItTp __comp_it_val, _CompareTpIt __comp_val_it)
+    {
+      typedef typename iterator_traits<_ForwardIterator>::difference_type
+ _DistanceType;
+
+      _DistanceType __len = std::distance(__first, __last);
+
+      while (__len > 0)
+ {
+   _DistanceType __half = __len >> 1;
+   _ForwardIterator __middle = __first;
+   std::advance(__middle, __half);
+   if (__comp_it_val(__middle, __val))
+     {
+       __first = __middle;
+       ++__first;
+       __len = __len - __half - 1;
+     }
+   else if (__comp_val_it(__val, __middle))
+     __len = __half;
+   else
+     {
+       _ForwardIterator __left
+  = std::__lower_bound(__first, __middle, __val, __comp_it_val);
+       std::advance(__first, __len);
+       _ForwardIterator __right
+  = std::__upper_bound(++__middle, __first, __val, __comp_val_it);
+       return pair<_ForwardIterator, _ForwardIterator>(__left, __right);
+     }
+ }
+      return pair<_ForwardIterator, _ForwardIterator>(__first, __first);
+    }
+  template<typename _ForwardIterator, typename _Tp>
+    inline pair<_ForwardIterator, _ForwardIterator>
+    equal_range(_ForwardIterator __first, _ForwardIterator __last,
+  const _Tp& __val)
+    {
+
+     
+     
+
+     
+
+      ;
+      ;
+
+      return std::__equal_range(__first, __last, __val,
+    __gnu_cxx::__ops::__iter_less_val(),
+    __gnu_cxx::__ops::__val_less_iter());
+    }
+  template<typename _ForwardIterator, typename _Tp, typename _Compare>
+    inline pair<_ForwardIterator, _ForwardIterator>
+    equal_range(_ForwardIterator __first, _ForwardIterator __last,
+  const _Tp& __val, _Compare __comp)
+    {
+
+     
+     
+
+     
+
+     
+                    ;
+     
+                    ;
+
+      return std::__equal_range(__first, __last, __val,
+    __gnu_cxx::__ops::__iter_comp_val(__comp),
+    __gnu_cxx::__ops::__val_comp_iter(__comp));
+    }
+  template<typename _ForwardIterator, typename _Tp>
+    bool
+    binary_search(_ForwardIterator __first, _ForwardIterator __last,
+    const _Tp& __val)
+    {
+
+     
+     
+
+      ;
+      ;
+
+      _ForwardIterator __i
+ = std::__lower_bound(__first, __last, __val,
+        __gnu_cxx::__ops::__iter_less_val());
+      return __i != __last && !(__val < *__i);
+    }
+  template<typename _ForwardIterator, typename _Tp, typename _Compare>
+    bool
+    binary_search(_ForwardIterator __first, _ForwardIterator __last,
+    const _Tp& __val, _Compare __comp)
+    {
+
+     
+     
+
+     
+                    ;
+     
+                    ;
+
+      _ForwardIterator __i
+ = std::__lower_bound(__first, __last, __val,
+        __gnu_cxx::__ops::__iter_comp_val(__comp));
+      return __i != __last && !bool(__comp(__val, *__i));
+    }
+
+
+
+
+  template<typename _InputIterator1, typename _InputIterator2,
+    typename _OutputIterator, typename _Compare>
+    void
+    __move_merge_adaptive(_InputIterator1 __first1, _InputIterator1 __last1,
+     _InputIterator2 __first2, _InputIterator2 __last2,
+     _OutputIterator __result, _Compare __comp)
+    {
+      while (__first1 != __last1 && __first2 != __last2)
+ {
+   if (__comp(__first2, __first1))
+     {
+       *__result = std::move(*__first2);
+       ++__first2;
+     }
+   else
+     {
+       *__result = std::move(*__first1);
+       ++__first1;
+     }
+   ++__result;
+ }
+      if (__first1 != __last1)
+ std::move(__first1, __last1, __result);
+    }
+
+
+  template<typename _BidirectionalIterator1, typename _BidirectionalIterator2,
+    typename _BidirectionalIterator3, typename _Compare>
+    void
+    __move_merge_adaptive_backward(_BidirectionalIterator1 __first1,
+       _BidirectionalIterator1 __last1,
+       _BidirectionalIterator2 __first2,
+       _BidirectionalIterator2 __last2,
+       _BidirectionalIterator3 __result,
+       _Compare __comp)
+    {
+      if (__first1 == __last1)
+ {
+   std::move_backward(__first2, __last2, __result);
+   return;
+ }
+      else if (__first2 == __last2)
+ return;
+
+      --__last1;
+      --__last2;
+      while (true)
+ {
+   if (__comp(__last2, __last1))
+     {
+       *--__result = std::move(*__last1);
+       if (__first1 == __last1)
+  {
+    std::move_backward(__first2, ++__last2, __result);
+    return;
+  }
+       --__last1;
+     }
+   else
+     {
+       *--__result = std::move(*__last2);
+       if (__first2 == __last2)
+  return;
+       --__last2;
+     }
+ }
+    }
+
+
+  template<typename _BidirectionalIterator1, typename _BidirectionalIterator2,
+    typename _Distance>
+    _BidirectionalIterator1
+    __rotate_adaptive(_BidirectionalIterator1 __first,
+        _BidirectionalIterator1 __middle,
+        _BidirectionalIterator1 __last,
+        _Distance __len1, _Distance __len2,
+        _BidirectionalIterator2 __buffer,
+        _Distance __buffer_size)
+    {
+      _BidirectionalIterator2 __buffer_end;
+      if (__len1 > __len2 && __len2 <= __buffer_size)
+ {
+   if (__len2)
+     {
+       __buffer_end = std::move(__middle, __last, __buffer);
+       std::move_backward(__first, __middle, __last);
+       return std::move(__buffer, __buffer_end, __first);
+     }
+   else
+     return __first;
+ }
+      else if (__len1 <= __buffer_size)
+ {
+   if (__len1)
+     {
+       __buffer_end = std::move(__first, __middle, __buffer);
+       std::move(__middle, __last, __first);
+       return std::move_backward(__buffer, __buffer_end, __last);
+     }
+   else
+     return __last;
+ }
+      else
+ {
+   std::rotate(__first, __middle, __last);
+   std::advance(__first, std::distance(__middle, __last));
+   return __first;
+ }
+    }
+
+
+  template<typename _BidirectionalIterator, typename _Distance,
+    typename _Pointer, typename _Compare>
+    void
+    __merge_adaptive(_BidirectionalIterator __first,
+       _BidirectionalIterator __middle,
+       _BidirectionalIterator __last,
+       _Distance __len1, _Distance __len2,
+       _Pointer __buffer, _Distance __buffer_size,
+       _Compare __comp)
+    {
+      if (__len1 <= __len2 && __len1 <= __buffer_size)
+ {
+   _Pointer __buffer_end = std::move(__first, __middle, __buffer);
+   std::__move_merge_adaptive(__buffer, __buffer_end, __middle, __last,
+         __first, __comp);
+ }
+      else if (__len2 <= __buffer_size)
+ {
+   _Pointer __buffer_end = std::move(__middle, __last, __buffer);
+   std::__move_merge_adaptive_backward(__first, __middle, __buffer,
+           __buffer_end, __last, __comp);
+ }
+      else
+ {
+   _BidirectionalIterator __first_cut = __first;
+   _BidirectionalIterator __second_cut = __middle;
+   _Distance __len11 = 0;
+   _Distance __len22 = 0;
+   if (__len1 > __len2)
+     {
+       __len11 = __len1 / 2;
+       std::advance(__first_cut, __len11);
+       __second_cut
+  = std::__lower_bound(__middle, __last, *__first_cut,
+         __gnu_cxx::__ops::__iter_comp_val(__comp));
+       __len22 = std::distance(__middle, __second_cut);
+     }
+   else
+     {
+       __len22 = __len2 / 2;
+       std::advance(__second_cut, __len22);
+       __first_cut
+  = std::__upper_bound(__first, __middle, *__second_cut,
+         __gnu_cxx::__ops::__val_comp_iter(__comp));
+       __len11 = std::distance(__first, __first_cut);
+     }
+
+   _BidirectionalIterator __new_middle
+     = std::__rotate_adaptive(__first_cut, __middle, __second_cut,
+         __len1 - __len11, __len22, __buffer,
+         __buffer_size);
+   std::__merge_adaptive(__first, __first_cut, __new_middle, __len11,
+    __len22, __buffer, __buffer_size, __comp);
+   std::__merge_adaptive(__new_middle, __second_cut, __last,
+    __len1 - __len11,
+    __len2 - __len22, __buffer,
+    __buffer_size, __comp);
+ }
+    }
+
+
+  template<typename _BidirectionalIterator, typename _Distance,
+    typename _Compare>
+    void
+    __merge_without_buffer(_BidirectionalIterator __first,
+      _BidirectionalIterator __middle,
+      _BidirectionalIterator __last,
+      _Distance __len1, _Distance __len2,
+      _Compare __comp)
+    {
+      if (__len1 == 0 || __len2 == 0)
+ return;
+
+      if (__len1 + __len2 == 2)
+ {
+   if (__comp(__middle, __first))
+     std::iter_swap(__first, __middle);
+   return;
+ }
+
+      _BidirectionalIterator __first_cut = __first;
+      _BidirectionalIterator __second_cut = __middle;
+      _Distance __len11 = 0;
+      _Distance __len22 = 0;
+      if (__len1 > __len2)
+ {
+   __len11 = __len1 / 2;
+   std::advance(__first_cut, __len11);
+   __second_cut
+     = std::__lower_bound(__middle, __last, *__first_cut,
+     __gnu_cxx::__ops::__iter_comp_val(__comp));
+   __len22 = std::distance(__middle, __second_cut);
+ }
+      else
+ {
+   __len22 = __len2 / 2;
+   std::advance(__second_cut, __len22);
+   __first_cut
+     = std::__upper_bound(__first, __middle, *__second_cut,
+     __gnu_cxx::__ops::__val_comp_iter(__comp));
+   __len11 = std::distance(__first, __first_cut);
+ }
+
+      std::rotate(__first_cut, __middle, __second_cut);
+      _BidirectionalIterator __new_middle = __first_cut;
+      std::advance(__new_middle, std::distance(__middle, __second_cut));
+      std::__merge_without_buffer(__first, __first_cut, __new_middle,
+      __len11, __len22, __comp);
+      std::__merge_without_buffer(__new_middle, __second_cut, __last,
+      __len1 - __len11, __len2 - __len22, __comp);
+    }
+
+  template<typename _BidirectionalIterator, typename _Compare>
+    void
+    __inplace_merge(_BidirectionalIterator __first,
+      _BidirectionalIterator __middle,
+      _BidirectionalIterator __last,
+      _Compare __comp)
+    {
+      typedef typename iterator_traits<_BidirectionalIterator>::value_type
+   _ValueType;
+      typedef typename iterator_traits<_BidirectionalIterator>::difference_type
+   _DistanceType;
+
+      if (__first == __middle || __middle == __last)
+ return;
+
+      const _DistanceType __len1 = std::distance(__first, __middle);
+      const _DistanceType __len2 = std::distance(__middle, __last);
+
+      typedef _Temporary_buffer<_BidirectionalIterator, _ValueType> _TmpBuf;
+      _TmpBuf __buf(__first, __last);
+
+      if (__buf.begin() == 0)
+ std::__merge_without_buffer
+   (__first, __middle, __last, __len1, __len2, __comp);
+      else
+ std::__merge_adaptive
+   (__first, __middle, __last, __len1, __len2, __buf.begin(),
+    _DistanceType(__buf.size()), __comp);
+    }
+  template<typename _BidirectionalIterator>
+    inline void
+    inplace_merge(_BidirectionalIterator __first,
+    _BidirectionalIterator __middle,
+    _BidirectionalIterator __last)
+    {
+
+     
+
+     
+
+      ;
+      ;
+      ;
+
+      std::__inplace_merge(__first, __middle, __last,
+      __gnu_cxx::__ops::__iter_less_iter());
+    }
+  template<typename _BidirectionalIterator, typename _Compare>
+    inline void
+    inplace_merge(_BidirectionalIterator __first,
+    _BidirectionalIterator __middle,
+    _BidirectionalIterator __last,
+    _Compare __comp)
+    {
+
+     
+
+     
+
+
+      ;
+      ;
+      ;
+
+      std::__inplace_merge(__first, __middle, __last,
+      __gnu_cxx::__ops::__iter_comp_iter(__comp));
+    }
+
+
+
+  template<typename _InputIterator, typename _OutputIterator,
+    typename _Compare>
+    _OutputIterator
+    __move_merge(_InputIterator __first1, _InputIterator __last1,
+   _InputIterator __first2, _InputIterator __last2,
+   _OutputIterator __result, _Compare __comp)
+    {
+      while (__first1 != __last1 && __first2 != __last2)
+ {
+   if (__comp(__first2, __first1))
+     {
+       *__result = std::move(*__first2);
+       ++__first2;
+     }
+   else
+     {
+       *__result = std::move(*__first1);
+       ++__first1;
+     }
+   ++__result;
+ }
+      return std::move(__first2, __last2, std::move(__first1, __last1, __result))
+
+                  ;
+    }
+
+  template<typename _RandomAccessIterator1, typename _RandomAccessIterator2,
+    typename _Distance, typename _Compare>
+    void
+    __merge_sort_loop(_RandomAccessIterator1 __first,
+        _RandomAccessIterator1 __last,
+        _RandomAccessIterator2 __result, _Distance __step_size,
+        _Compare __comp)
+    {
+      const _Distance __two_step = 2 * __step_size;
+
+      while (__last - __first >= __two_step)
+ {
+   __result = std::__move_merge(__first, __first + __step_size,
+           __first + __step_size,
+           __first + __two_step,
+           __result, __comp);
+   __first += __two_step;
+ }
+      __step_size = std::min(_Distance(__last - __first), __step_size);
+
+      std::__move_merge(__first, __first + __step_size,
+   __first + __step_size, __last, __result, __comp);
+    }
+
+  template<typename _RandomAccessIterator, typename _Distance,
+    typename _Compare>
+    void
+    __chunk_insertion_sort(_RandomAccessIterator __first,
+      _RandomAccessIterator __last,
+      _Distance __chunk_size, _Compare __comp)
+    {
+      while (__last - __first >= __chunk_size)
+ {
+   std::__insertion_sort(__first, __first + __chunk_size, __comp);
+   __first += __chunk_size;
+ }
+      std::__insertion_sort(__first, __last, __comp);
+    }
+
+  enum { _S_chunk_size = 7 };
+
+  template<typename _RandomAccessIterator, typename _Pointer, typename _Compare>
+    void
+    __merge_sort_with_buffer(_RandomAccessIterator __first,
+        _RandomAccessIterator __last,
+        _Pointer __buffer, _Compare __comp)
+    {
+      typedef typename iterator_traits<_RandomAccessIterator>::difference_type
+ _Distance;
+
+      const _Distance __len = __last - __first;
+      const _Pointer __buffer_last = __buffer + __len;
+
+      _Distance __step_size = _S_chunk_size;
+      std::__chunk_insertion_sort(__first, __last, __step_size, __comp);
+
+      while (__step_size < __len)
+ {
+   std::__merge_sort_loop(__first, __last, __buffer,
+     __step_size, __comp);
+   __step_size *= 2;
+   std::__merge_sort_loop(__buffer, __buffer_last, __first,
+     __step_size, __comp);
+   __step_size *= 2;
+ }
+    }
+
+  template<typename _RandomAccessIterator, typename _Pointer,
+    typename _Distance, typename _Compare>
+    void
+    __stable_sort_adaptive(_RandomAccessIterator __first,
+      _RandomAccessIterator __last,
+      _Pointer __buffer, _Distance __buffer_size,
+      _Compare __comp)
+    {
+      const _Distance __len = (__last - __first + 1) / 2;
+      const _RandomAccessIterator __middle = __first + __len;
+      if (__len > __buffer_size)
+ {
+   std::__stable_sort_adaptive(__first, __middle, __buffer,
+          __buffer_size, __comp);
+   std::__stable_sort_adaptive(__middle, __last, __buffer,
+          __buffer_size, __comp);
+ }
+      else
+ {
+   std::__merge_sort_with_buffer(__first, __middle, __buffer, __comp);
+   std::__merge_sort_with_buffer(__middle, __last, __buffer, __comp);
+ }
+      std::__merge_adaptive(__first, __middle, __last,
+       _Distance(__middle - __first),
+       _Distance(__last - __middle),
+       __buffer, __buffer_size,
+       __comp);
+    }
+
+
+  template<typename _RandomAccessIterator, typename _Compare>
+    void
+    __inplace_stable_sort(_RandomAccessIterator __first,
+     _RandomAccessIterator __last, _Compare __comp)
+    {
+      if (__last - __first < 15)
+ {
+   std::__insertion_sort(__first, __last, __comp);
+   return;
+ }
+      _RandomAccessIterator __middle = __first + (__last - __first) / 2;
+      std::__inplace_stable_sort(__first, __middle, __comp);
+      std::__inplace_stable_sort(__middle, __last, __comp);
+      std::__merge_without_buffer(__first, __middle, __last,
+      __middle - __first,
+      __last - __middle,
+      __comp);
+    }
+  template<typename _InputIterator1, typename _InputIterator2,
+    typename _Compare>
+    bool
+    __includes(_InputIterator1 __first1, _InputIterator1 __last1,
+        _InputIterator2 __first2, _InputIterator2 __last2,
+        _Compare __comp)
+    {
+      while (__first1 != __last1 && __first2 != __last2)
+ if (__comp(__first2, __first1))
+   return false;
+ else if (__comp(__first1, __first2))
+   ++__first1;
+ else
+   {
+     ++__first1;
+     ++__first2;
+   }
+
+      return __first2 == __last2;
+    }
+  template<typename _InputIterator1, typename _InputIterator2>
+    inline bool
+    includes(_InputIterator1 __first1, _InputIterator1 __last1,
+      _InputIterator2 __first2, _InputIterator2 __last2)
+    {
+
+     
+     
+     
+
+
+     
+
+
+      ;
+      ;
+      ;
+      ;
+
+      return std::__includes(__first1, __last1, __first2, __last2,
+        __gnu_cxx::__ops::__iter_less_iter());
+    }
+  template<typename _InputIterator1, typename _InputIterator2,
+    typename _Compare>
+    inline bool
+    includes(_InputIterator1 __first1, _InputIterator1 __last1,
+      _InputIterator2 __first2, _InputIterator2 __last2,
+      _Compare __comp)
+    {
+
+     
+     
+     
+
+
+     
+
+
+      ;
+      ;
+      ;
+      ;
+
+      return std::__includes(__first1, __last1, __first2, __last2,
+        __gnu_cxx::__ops::__iter_comp_iter(__comp));
+    }
+  template<typename _BidirectionalIterator, typename _Compare>
+    bool
+    __next_permutation(_BidirectionalIterator __first,
+         _BidirectionalIterator __last, _Compare __comp)
+    {
+      if (__first == __last)
+ return false;
+      _BidirectionalIterator __i = __first;
+      ++__i;
+      if (__i == __last)
+ return false;
+      __i = __last;
+      --__i;
+
+      for(;;)
+ {
+   _BidirectionalIterator __ii = __i;
+   --__i;
+   if (__comp(__i, __ii))
+     {
+       _BidirectionalIterator __j = __last;
+       while (!__comp(__i, --__j))
+  {}
+       std::iter_swap(__i, __j);
+       std::__reverse(__ii, __last,
+        std::__iterator_category(__first));
+       return true;
+     }
+   if (__i == __first)
+     {
+       std::__reverse(__first, __last,
+        std::__iterator_category(__first));
+       return false;
+     }
+ }
+    }
+  template<typename _BidirectionalIterator>
+    inline bool
+    next_permutation(_BidirectionalIterator __first,
+       _BidirectionalIterator __last)
+    {
+
+     
+
+     
+
+      ;
+      ;
+
+      return std::__next_permutation
+ (__first, __last, __gnu_cxx::__ops::__iter_less_iter());
+    }
+  template<typename _BidirectionalIterator, typename _Compare>
+    inline bool
+    next_permutation(_BidirectionalIterator __first,
+       _BidirectionalIterator __last, _Compare __comp)
+    {
+
+     
+
+     
+
+
+      ;
+      ;
+
+      return std::__next_permutation
+ (__first, __last, __gnu_cxx::__ops::__iter_comp_iter(__comp));
+    }
+
+  template<typename _BidirectionalIterator, typename _Compare>
+    bool
+    __prev_permutation(_BidirectionalIterator __first,
+         _BidirectionalIterator __last, _Compare __comp)
+    {
+      if (__first == __last)
+ return false;
+      _BidirectionalIterator __i = __first;
+      ++__i;
+      if (__i == __last)
+ return false;
+      __i = __last;
+      --__i;
+
+      for(;;)
+ {
+   _BidirectionalIterator __ii = __i;
+   --__i;
+   if (__comp(__ii, __i))
+     {
+       _BidirectionalIterator __j = __last;
+       while (!__comp(--__j, __i))
+  {}
+       std::iter_swap(__i, __j);
+       std::__reverse(__ii, __last,
+        std::__iterator_category(__first));
+       return true;
+     }
+   if (__i == __first)
+     {
+       std::__reverse(__first, __last,
+        std::__iterator_category(__first));
+       return false;
+     }
+ }
+    }
+  template<typename _BidirectionalIterator>
+    inline bool
+    prev_permutation(_BidirectionalIterator __first,
+       _BidirectionalIterator __last)
+    {
+
+     
+
+     
+
+      ;
+      ;
+
+      return std::__prev_permutation(__first, __last,
+         __gnu_cxx::__ops::__iter_less_iter());
+    }
+  template<typename _BidirectionalIterator, typename _Compare>
+    inline bool
+    prev_permutation(_BidirectionalIterator __first,
+       _BidirectionalIterator __last, _Compare __comp)
+    {
+
+     
+
+     
+
+
+      ;
+      ;
+
+      return std::__prev_permutation(__first, __last,
+    __gnu_cxx::__ops::__iter_comp_iter(__comp));
+    }
+
+
+
+
+  template<typename _InputIterator, typename _OutputIterator,
+    typename _Predicate, typename _Tp>
+    _OutputIterator
+    __replace_copy_if(_InputIterator __first, _InputIterator __last,
+        _OutputIterator __result,
+        _Predicate __pred, const _Tp& __new_value)
+    {
+      for (; __first != __last; ++__first, (void)++__result)
+ if (__pred(__first))
+   *__result = __new_value;
+ else
+   *__result = *__first;
+      return __result;
+    }
+  template<typename _InputIterator, typename _OutputIterator, typename _Tp>
+    inline _OutputIterator
+    replace_copy(_InputIterator __first, _InputIterator __last,
+   _OutputIterator __result,
+   const _Tp& __old_value, const _Tp& __new_value)
+    {
+
+     
+     
+
+     
+
+      ;
+
+      return std::__replace_copy_if(__first, __last, __result,
+   __gnu_cxx::__ops::__iter_equals_val(__old_value),
+           __new_value);
+    }
+  template<typename _InputIterator, typename _OutputIterator,
+    typename _Predicate, typename _Tp>
+    inline _OutputIterator
+    replace_copy_if(_InputIterator __first, _InputIterator __last,
+      _OutputIterator __result,
+      _Predicate __pred, const _Tp& __new_value)
+    {
+
+     
+     
+
+     
+
+      ;
+
+      return std::__replace_copy_if(__first, __last, __result,
+    __gnu_cxx::__ops::__pred_iter(__pred),
+           __new_value);
+    }
+
+  template<typename _InputIterator, typename _Predicate>
+    typename iterator_traits<_InputIterator>::difference_type
+    __count_if(_InputIterator __first, _InputIterator __last, _Predicate __pred)
+    {
+      typename iterator_traits<_InputIterator>::difference_type __n = 0;
+      for (; __first != __last; ++__first)
+ if (__pred(__first))
+   ++__n;
+      return __n;
+    }
+  template<typename _ForwardIterator>
+    inline bool
+    is_sorted(_ForwardIterator __first, _ForwardIterator __last)
+    { return std::is_sorted_until(__first, __last) == __last; }
+  template<typename _ForwardIterator, typename _Compare>
+    inline bool
+    is_sorted(_ForwardIterator __first, _ForwardIterator __last,
+       _Compare __comp)
+    { return std::is_sorted_until(__first, __last, __comp) == __last; }
+
+  template<typename _ForwardIterator, typename _Compare>
+    _ForwardIterator
+    __is_sorted_until(_ForwardIterator __first, _ForwardIterator __last,
+        _Compare __comp)
+    {
+      if (__first == __last)
+ return __last;
+
+      _ForwardIterator __next = __first;
+      for (++__next; __next != __last; __first = __next, (void)++__next)
+ if (__comp(__next, __first))
+   return __next;
+      return __next;
+    }
+  template<typename _ForwardIterator>
+    inline _ForwardIterator
+    is_sorted_until(_ForwardIterator __first, _ForwardIterator __last)
+    {
+
+     
+     
+
+      ;
+      ;
+
+      return std::__is_sorted_until(__first, __last,
+        __gnu_cxx::__ops::__iter_less_iter());
+    }
+  template<typename _ForwardIterator, typename _Compare>
+    inline _ForwardIterator
+    is_sorted_until(_ForwardIterator __first, _ForwardIterator __last,
+      _Compare __comp)
+    {
+
+     
+     
+
+
+      ;
+      ;
+
+      return std::__is_sorted_until(__first, __last,
+        __gnu_cxx::__ops::__iter_comp_iter(__comp));
+    }
+  template<typename _Tp>
+   
+    inline pair<const _Tp&, const _Tp&>
+    minmax(const _Tp& __a, const _Tp& __b)
+    {
+
+     
+
+      return __b < __a ? pair<const _Tp&, const _Tp&>(__b, __a)
+         : pair<const _Tp&, const _Tp&>(__a, __b);
+    }
+  template<typename _Tp, typename _Compare>
+   
+    inline pair<const _Tp&, const _Tp&>
+    minmax(const _Tp& __a, const _Tp& __b, _Compare __comp)
+    {
+      return __comp(__b, __a) ? pair<const _Tp&, const _Tp&>(__b, __a)
+         : pair<const _Tp&, const _Tp&>(__a, __b);
+    }
+
+  template<typename _ForwardIterator, typename _Compare>
+   
+    pair<_ForwardIterator, _ForwardIterator>
+    __minmax_element(_ForwardIterator __first, _ForwardIterator __last,
+       _Compare __comp)
+    {
+      _ForwardIterator __next = __first;
+      if (__first == __last
+   || ++__next == __last)
+ return std::make_pair(__first, __first);
+
+      _ForwardIterator __min{}, __max{};
+      if (__comp(__next, __first))
+ {
+   __min = __next;
+   __max = __first;
+ }
+      else
+ {
+   __min = __first;
+   __max = __next;
+ }
+
+      __first = __next;
+      ++__first;
+
+      while (__first != __last)
+ {
+   __next = __first;
+   if (++__next == __last)
+     {
+       if (__comp(__first, __min))
+  __min = __first;
+       else if (!__comp(__first, __max))
+  __max = __first;
+       break;
+     }
+
+   if (__comp(__next, __first))
+     {
+       if (__comp(__next, __min))
+  __min = __next;
+       if (!__comp(__first, __max))
+  __max = __first;
+     }
+   else
+     {
+       if (__comp(__first, __min))
+  __min = __first;
+       if (!__comp(__next, __max))
+  __max = __next;
+     }
+
+   __first = __next;
+   ++__first;
+ }
+
+      return std::make_pair(__min, __max);
+    }
+  template<typename _ForwardIterator>
+   
+    inline pair<_ForwardIterator, _ForwardIterator>
+    minmax_element(_ForwardIterator __first, _ForwardIterator __last)
+    {
+
+     
+     
+
+      ;
+      ;
+
+      return std::__minmax_element(__first, __last,
+       __gnu_cxx::__ops::__iter_less_iter());
+    }
+  template<typename _ForwardIterator, typename _Compare>
+   
+    inline pair<_ForwardIterator, _ForwardIterator>
+    minmax_element(_ForwardIterator __first, _ForwardIterator __last,
+     _Compare __comp)
+    {
+
+     
+     
+
+
+      ;
+      ;
+
+      return std::__minmax_element(__first, __last,
+       __gnu_cxx::__ops::__iter_comp_iter(__comp));
+    }
+
+
+  template<typename _Tp>
+   
+    inline _Tp
+    min(initializer_list<_Tp> __l)
+    { return *std::min_element(__l.begin(), __l.end()); }
+
+  template<typename _Tp, typename _Compare>
+   
+    inline _Tp
+    min(initializer_list<_Tp> __l, _Compare __comp)
+    { return *std::min_element(__l.begin(), __l.end(), __comp); }
+
+  template<typename _Tp>
+   
+    inline _Tp
+    max(initializer_list<_Tp> __l)
+    { return *std::max_element(__l.begin(), __l.end()); }
+
+  template<typename _Tp, typename _Compare>
+   
+    inline _Tp
+    max(initializer_list<_Tp> __l, _Compare __comp)
+    { return *std::max_element(__l.begin(), __l.end(), __comp); }
+
+  template<typename _Tp>
+   
+    inline pair<_Tp, _Tp>
+    minmax(initializer_list<_Tp> __l)
+    {
+      pair<const _Tp*, const _Tp*> __p =
+ std::minmax_element(__l.begin(), __l.end());
+      return std::make_pair(*__p.first, *__p.second);
+    }
+
+  template<typename _Tp, typename _Compare>
+   
+    inline pair<_Tp, _Tp>
+    minmax(initializer_list<_Tp> __l, _Compare __comp)
+    {
+      pair<const _Tp*, const _Tp*> __p =
+ std::minmax_element(__l.begin(), __l.end(), __comp);
+      return std::make_pair(*__p.first, *__p.second);
+    }
+
+  template<typename _ForwardIterator1, typename _ForwardIterator2,
+    typename _BinaryPredicate>
+    bool
+    __is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
+       _ForwardIterator2 __first2, _BinaryPredicate __pred)
+    {
+
+
+      for (; __first1 != __last1; ++__first1, (void)++__first2)
+ if (!__pred(__first1, __first2))
+   break;
+
+      if (__first1 == __last1)
+ return true;
+
+
+
+      _ForwardIterator2 __last2 = __first2;
+      std::advance(__last2, std::distance(__first1, __last1));
+      for (_ForwardIterator1 __scan = __first1; __scan != __last1; ++__scan)
+ {
+   if (__scan != std::__find_if(__first1, __scan,
+     __gnu_cxx::__ops::__iter_comp_iter(__pred, __scan)))
+     continue;
+
+   auto __matches
+     = std::__count_if(__first2, __last2,
+   __gnu_cxx::__ops::__iter_comp_iter(__pred, __scan));
+   if (0 == __matches ||
+       std::__count_if(__scan, __last1,
+   __gnu_cxx::__ops::__iter_comp_iter(__pred, __scan))
+       != __matches)
+     return false;
+ }
+      return true;
+    }
+  template<typename _ForwardIterator1, typename _ForwardIterator2>
+    inline bool
+    is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
+     _ForwardIterator2 __first2)
+    {
+
+     
+     
+     
+
+
+      ;
+
+      return std::__is_permutation(__first1, __last1, __first2,
+       __gnu_cxx::__ops::__iter_equal_to_iter());
+    }
+  template<typename _ForwardIterator1, typename _ForwardIterator2,
+    typename _BinaryPredicate>
+    inline bool
+    is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
+     _ForwardIterator2 __first2, _BinaryPredicate __pred)
+    {
+
+     
+     
+     
+
+
+      ;
+
+      return std::__is_permutation(__first1, __last1, __first2,
+       __gnu_cxx::__ops::__iter_comp_iter(__pred));
+    }
+  template<typename _IntType, typename _UniformRandomBitGenerator>
+    pair<_IntType, _IntType>
+    __gen_two_uniform_ints(_IntType __b0, _IntType __b1,
+      _UniformRandomBitGenerator&& __g)
+    {
+      _IntType __x
+ = uniform_int_distribution<_IntType>{0, (__b0 * __b1) - 1}(__g);
+      return std::make_pair(__x / __b1, __x % __b1);
+    }
+  template<typename _RandomAccessIterator,
+    typename _UniformRandomNumberGenerator>
+    void
+    shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last,
+     _UniformRandomNumberGenerator&& __g)
+    {
+
+     
+
+      ;
+
+      if (__first == __last)
+ return;
+
+      typedef typename iterator_traits<_RandomAccessIterator>::difference_type
+ _DistanceType;
+
+      typedef typename std::make_unsigned<_DistanceType>::type __ud_type;
+      typedef typename std::uniform_int_distribution<__ud_type> __distr_type;
+      typedef typename __distr_type::param_type __p_type;
+
+      typedef typename remove_reference<_UniformRandomNumberGenerator>::type
+ _Gen;
+      typedef typename common_type<typename _Gen::result_type, __ud_type>::type
+ __uc_type;
+
+      const __uc_type __urngrange = __g.max() - __g.min();
+      const __uc_type __urange = __uc_type(__last - __first);
+
+      if (__urngrange / __urange >= __urange)
+
+      {
+ _RandomAccessIterator __i = __first + 1;
+
+
+
+
+
+ if ((__urange % 2) == 0)
+ {
+   __distr_type __d{0, 1};
+   std::iter_swap(__i++, __first + __d(__g));
+ }
+
+
+
+
+
+ while (__i != __last)
+ {
+   const __uc_type __swap_range = __uc_type(__i - __first) + 1;
+
+   const pair<__uc_type, __uc_type> __pospos =
+     __gen_two_uniform_ints(__swap_range, __swap_range + 1, __g);
+
+   std::iter_swap(__i++, __first + __pospos.first);
+   std::iter_swap(__i++, __first + __pospos.second);
+ }
+
+ return;
+      }
+
+      __distr_type __d;
+
+      for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i)
+ std::iter_swap(__i, __first + __d(__g, __p_type(0, __i - __first)));
+    }
+
+
+
+
+
+  template<typename _InputIterator, typename _Function>
+    _Function
+    for_each(_InputIterator __first, _InputIterator __last, _Function __f)
+    {
+
+     
+      ;
+      for (; __first != __last; ++__first)
+ __f(*__first);
+      return __f;
+    }
+  template<typename _InputIterator, typename _Tp>
+    inline _InputIterator
+    find(_InputIterator __first, _InputIterator __last,
+  const _Tp& __val)
+    {
+
+     
+     
+
+      ;
+      return std::__find_if(__first, __last,
+       __gnu_cxx::__ops::__iter_equals_val(__val));
+    }
+  template<typename _InputIterator, typename _Predicate>
+    inline _InputIterator
+    find_if(_InputIterator __first, _InputIterator __last,
+     _Predicate __pred)
+    {
+
+     
+     
+
+      ;
+
+      return std::__find_if(__first, __last,
+       __gnu_cxx::__ops::__pred_iter(__pred));
+    }
+  template<typename _InputIterator, typename _ForwardIterator>
+    _InputIterator
+    find_first_of(_InputIterator __first1, _InputIterator __last1,
+    _ForwardIterator __first2, _ForwardIterator __last2)
+    {
+
+     
+     
+     
+
+
+      ;
+      ;
+
+      for (; __first1 != __last1; ++__first1)
+ for (_ForwardIterator __iter = __first2; __iter != __last2; ++__iter)
+   if (*__first1 == *__iter)
+     return __first1;
+      return __last1;
+    }
+  template<typename _InputIterator, typename _ForwardIterator,
+    typename _BinaryPredicate>
+    _InputIterator
+    find_first_of(_InputIterator __first1, _InputIterator __last1,
+    _ForwardIterator __first2, _ForwardIterator __last2,
+    _BinaryPredicate __comp)
+    {
+
+     
+     
+     
+
+
+      ;
+      ;
+
+      for (; __first1 != __last1; ++__first1)
+ for (_ForwardIterator __iter = __first2; __iter != __last2; ++__iter)
+   if (__comp(*__first1, *__iter))
+     return __first1;
+      return __last1;
+    }
+  template<typename _ForwardIterator>
+    inline _ForwardIterator
+    adjacent_find(_ForwardIterator __first, _ForwardIterator __last)
+    {
+
+     
+     
+
+      ;
+
+      return std::__adjacent_find(__first, __last,
+      __gnu_cxx::__ops::__iter_equal_to_iter());
+    }
+  template<typename _ForwardIterator, typename _BinaryPredicate>
+    inline _ForwardIterator
+    adjacent_find(_ForwardIterator __first, _ForwardIterator __last,
+    _BinaryPredicate __binary_pred)
+    {
+
+     
+     
+
+
+      ;
+
+      return std::__adjacent_find(__first, __last,
+   __gnu_cxx::__ops::__iter_comp_iter(__binary_pred));
+    }
+  template<typename _InputIterator, typename _Tp>
+    inline typename iterator_traits<_InputIterator>::difference_type
+    count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
+    {
+
+     
+     
+
+      ;
+
+      return std::__count_if(__first, __last,
+        __gnu_cxx::__ops::__iter_equals_val(__value));
+    }
+  template<typename _InputIterator, typename _Predicate>
+    inline typename iterator_traits<_InputIterator>::difference_type
+    count_if(_InputIterator __first, _InputIterator __last, _Predicate __pred)
+    {
+
+     
+     
+
+      ;
+
+      return std::__count_if(__first, __last,
+        __gnu_cxx::__ops::__pred_iter(__pred));
+    }
+  template<typename _ForwardIterator1, typename _ForwardIterator2>
+    inline _ForwardIterator1
+    search(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
+    _ForwardIterator2 __first2, _ForwardIterator2 __last2)
+    {
+
+     
+     
+     
+
+
+      ;
+      ;
+
+      return std::__search(__first1, __last1, __first2, __last2,
+      __gnu_cxx::__ops::__iter_equal_to_iter());
+    }
+  template<typename _ForwardIterator1, typename _ForwardIterator2,
+    typename _BinaryPredicate>
+    inline _ForwardIterator1
+    search(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
+    _ForwardIterator2 __first2, _ForwardIterator2 __last2,
+    _BinaryPredicate __predicate)
+    {
+
+     
+     
+     
+
+
+      ;
+      ;
+
+      return std::__search(__first1, __last1, __first2, __last2,
+      __gnu_cxx::__ops::__iter_comp_iter(__predicate));
+    }
+  template<typename _ForwardIterator, typename _Integer, typename _Tp>
+    inline _ForwardIterator
+    search_n(_ForwardIterator __first, _ForwardIterator __last,
+      _Integer __count, const _Tp& __val)
+    {
+
+     
+     
+
+      ;
+
+      return std::__search_n(__first, __last, __count,
+        __gnu_cxx::__ops::__iter_equals_val(__val));
+    }
+  template<typename _ForwardIterator, typename _Integer, typename _Tp,
+    typename _BinaryPredicate>
+    inline _ForwardIterator
+    search_n(_ForwardIterator __first, _ForwardIterator __last,
+      _Integer __count, const _Tp& __val,
+      _BinaryPredicate __binary_pred)
+    {
+
+     
+     
+
+      ;
+
+      return std::__search_n(__first, __last, __count,
+  __gnu_cxx::__ops::__iter_comp_val(__binary_pred, __val));
+    }
+  template<typename _InputIterator, typename _OutputIterator,
+    typename _UnaryOperation>
+    _OutputIterator
+    transform(_InputIterator __first, _InputIterator __last,
+       _OutputIterator __result, _UnaryOperation __unary_op)
+    {
+
+     
+     
+
+
+      ;
+
+      for (; __first != __last; ++__first, (void)++__result)
+ *__result = __unary_op(*__first);
+      return __result;
+    }
+  template<typename _InputIterator1, typename _InputIterator2,
+    typename _OutputIterator, typename _BinaryOperation>
+    _OutputIterator
+    transform(_InputIterator1 __first1, _InputIterator1 __last1,
+       _InputIterator2 __first2, _OutputIterator __result,
+       _BinaryOperation __binary_op)
+    {
+
+     
+     
+     
+
+
+      ;
+
+      for (; __first1 != __last1; ++__first1, (void)++__first2, ++__result)
+ *__result = __binary_op(*__first1, *__first2);
+      return __result;
+    }
+  template<typename _ForwardIterator, typename _Tp>
+    void
+    replace(_ForwardIterator __first, _ForwardIterator __last,
+     const _Tp& __old_value, const _Tp& __new_value)
+    {
+
+     
+
+     
+
+     
+
+      ;
+
+      for (; __first != __last; ++__first)
+ if (*__first == __old_value)
+   *__first = __new_value;
+    }
+  template<typename _ForwardIterator, typename _Predicate, typename _Tp>
+    void
+    replace_if(_ForwardIterator __first, _ForwardIterator __last,
+        _Predicate __pred, const _Tp& __new_value)
+    {
+
+     
+
+     
+
+     
+
+      ;
+
+      for (; __first != __last; ++__first)
+ if (__pred(*__first))
+   *__first = __new_value;
+    }
+  template<typename _ForwardIterator, typename _Generator>
+    void
+    generate(_ForwardIterator __first, _ForwardIterator __last,
+      _Generator __gen)
+    {
+
+     
+     
+
+      ;
+
+      for (; __first != __last; ++__first)
+ *__first = __gen();
+    }
+  template<typename _OutputIterator, typename _Size, typename _Generator>
+    _OutputIterator
+    generate_n(_OutputIterator __first, _Size __n, _Generator __gen)
+    {
+
+     
+
+
+
+      for (__decltype(__n + 0) __niter = __n;
+    __niter > 0; --__niter, (void) ++__first)
+ *__first = __gen();
+      return __first;
+    }
+  template<typename _InputIterator, typename _OutputIterator>
+    inline _OutputIterator
+    unique_copy(_InputIterator __first, _InputIterator __last,
+  _OutputIterator __result)
+    {
+
+     
+     
+
+     
+
+      ;
+
+      if (__first == __last)
+ return __result;
+      return std::__unique_copy(__first, __last, __result,
+    __gnu_cxx::__ops::__iter_equal_to_iter(),
+    std::__iterator_category(__first),
+    std::__iterator_category(__result));
+    }
+  template<typename _InputIterator, typename _OutputIterator,
+    typename _BinaryPredicate>
+    inline _OutputIterator
+    unique_copy(_InputIterator __first, _InputIterator __last,
+  _OutputIterator __result,
+  _BinaryPredicate __binary_pred)
+    {
+
+     
+     
+
+      ;
+
+      if (__first == __last)
+ return __result;
+      return std::__unique_copy(__first, __last, __result,
+   __gnu_cxx::__ops::__iter_comp_iter(__binary_pred),
+    std::__iterator_category(__first),
+    std::__iterator_category(__result));
+    }
+  template<typename _RandomAccessIterator>
+    inline void
+    random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last)
+    {
+
+     
+
+      ;
+
+      if (__first != __last)
+ for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i)
+   {
+
+     _RandomAccessIterator __j = __first
+     + std::rand() % ((__i - __first) + 1);
+     if (__i != __j)
+       std::iter_swap(__i, __j);
+   }
+    }
+  template<typename _RandomAccessIterator, typename _RandomNumberGenerator>
+    void
+    random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last,
+
+     _RandomNumberGenerator&& __rand)
+
+
+
+    {
+
+     
+
+      ;
+
+      if (__first == __last)
+ return;
+      for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i)
+ {
+   _RandomAccessIterator __j = __first + __rand((__i - __first) + 1);
+   if (__i != __j)
+     std::iter_swap(__i, __j);
+ }
+    }
+  template<typename _ForwardIterator, typename _Predicate>
+    inline _ForwardIterator
+    partition(_ForwardIterator __first, _ForwardIterator __last,
+       _Predicate __pred)
+    {
+
+     
+
+     
+
+      ;
+
+      return std::__partition(__first, __last, __pred,
+         std::__iterator_category(__first));
+    }
+  template<typename _RandomAccessIterator>
+    inline void
+    partial_sort(_RandomAccessIterator __first,
+   _RandomAccessIterator __middle,
+   _RandomAccessIterator __last)
+    {
+
+     
+
+     
+
+      ;
+      ;
+      ;
+
+      std::__partial_sort(__first, __middle, __last,
+     __gnu_cxx::__ops::__iter_less_iter());
+    }
+  template<typename _RandomAccessIterator, typename _Compare>
+    inline void
+    partial_sort(_RandomAccessIterator __first,
+   _RandomAccessIterator __middle,
+   _RandomAccessIterator __last,
+   _Compare __comp)
+    {
+
+     
+
+     
+
+
+      ;
+      ;
+      ;
+
+      std::__partial_sort(__first, __middle, __last,
+     __gnu_cxx::__ops::__iter_comp_iter(__comp));
+    }
+  template<typename _RandomAccessIterator>
+    inline void
+    nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth,
+  _RandomAccessIterator __last)
+    {
+
+     
+
+     
+
+      ;
+      ;
+      ;
+
+      if (__first == __last || __nth == __last)
+ return;
+
+      std::__introselect(__first, __nth, __last,
+    std::__lg(__last - __first) * 2,
+    __gnu_cxx::__ops::__iter_less_iter());
+    }
+  template<typename _RandomAccessIterator, typename _Compare>
+    inline void
+    nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth,
+  _RandomAccessIterator __last, _Compare __comp)
+    {
+
+     
+
+     
+
+
+      ;
+      ;
+      ;
+
+      if (__first == __last || __nth == __last)
+ return;
+
+      std::__introselect(__first, __nth, __last,
+    std::__lg(__last - __first) * 2,
+    __gnu_cxx::__ops::__iter_comp_iter(__comp));
+    }
+  template<typename _RandomAccessIterator>
+    inline void
+    sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
+    {
+
+     
+
+     
+
+      ;
+      ;
+
+      std::__sort(__first, __last, __gnu_cxx::__ops::__iter_less_iter());
+    }
+  template<typename _RandomAccessIterator, typename _Compare>
+    inline void
+    sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
+  _Compare __comp)
+    {
+
+     
+
+     
+
+
+      ;
+      ;
+
+      std::__sort(__first, __last, __gnu_cxx::__ops::__iter_comp_iter(__comp));
+    }
+
+  template<typename _InputIterator1, typename _InputIterator2,
+    typename _OutputIterator, typename _Compare>
+    _OutputIterator
+    __merge(_InputIterator1 __first1, _InputIterator1 __last1,
+     _InputIterator2 __first2, _InputIterator2 __last2,
+     _OutputIterator __result, _Compare __comp)
+    {
+      while (__first1 != __last1 && __first2 != __last2)
+ {
+   if (__comp(__first2, __first1))
+     {
+       *__result = *__first2;
+       ++__first2;
+     }
+   else
+     {
+       *__result = *__first1;
+       ++__first1;
+     }
+   ++__result;
+ }
+      return std::copy(__first2, __last2,
+         std::copy(__first1, __last1, __result));
+    }
+  template<typename _InputIterator1, typename _InputIterator2,
+    typename _OutputIterator>
+    inline _OutputIterator
+    merge(_InputIterator1 __first1, _InputIterator1 __last1,
+   _InputIterator2 __first2, _InputIterator2 __last2,
+   _OutputIterator __result)
+    {
+
+     
+     
+     
+
+     
+
+     
+
+
+      ;
+      ;
+      ;
+      ;
+
+      return std::__merge(__first1, __last1,
+         __first2, __last2, __result,
+         __gnu_cxx::__ops::__iter_less_iter());
+    }
+  template<typename _InputIterator1, typename _InputIterator2,
+    typename _OutputIterator, typename _Compare>
+    inline _OutputIterator
+    merge(_InputIterator1 __first1, _InputIterator1 __last1,
+   _InputIterator2 __first2, _InputIterator2 __last2,
+   _OutputIterator __result, _Compare __comp)
+    {
+
+     
+     
+     
+
+     
+
+     
+
+
+      ;
+      ;
+      ;
+      ;
+
+      return std::__merge(__first1, __last1,
+    __first2, __last2, __result,
+    __gnu_cxx::__ops::__iter_comp_iter(__comp));
+    }
+
+  template<typename _RandomAccessIterator, typename _Compare>
+    inline void
+    __stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
+    _Compare __comp)
+    {
+      typedef typename iterator_traits<_RandomAccessIterator>::value_type
+ _ValueType;
+      typedef typename iterator_traits<_RandomAccessIterator>::difference_type
+ _DistanceType;
+
+      typedef _Temporary_buffer<_RandomAccessIterator, _ValueType> _TmpBuf;
+      _TmpBuf __buf(__first, __last);
+
+      if (__buf.begin() == 0)
+ std::__inplace_stable_sort(__first, __last, __comp);
+      else
+ std::__stable_sort_adaptive(__first, __last, __buf.begin(),
+        _DistanceType(__buf.size()), __comp);
+    }
+  template<typename _RandomAccessIterator>
+    inline void
+    stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
+    {
+
+     
+
+     
+
+      ;
+      ;
+
+      std::__stable_sort(__first, __last,
+        __gnu_cxx::__ops::__iter_less_iter());
+    }
+  template<typename _RandomAccessIterator, typename _Compare>
+    inline void
+    stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
+  _Compare __comp)
+    {
+
+     
+
+     
+
+
+      ;
+      ;
+
+      std::__stable_sort(__first, __last,
+        __gnu_cxx::__ops::__iter_comp_iter(__comp));
+    }
+
+  template<typename _InputIterator1, typename _InputIterator2,
+    typename _OutputIterator,
+    typename _Compare>
+    _OutputIterator
+    __set_union(_InputIterator1 __first1, _InputIterator1 __last1,
+  _InputIterator2 __first2, _InputIterator2 __last2,
+  _OutputIterator __result, _Compare __comp)
+    {
+      while (__first1 != __last1 && __first2 != __last2)
+ {
+   if (__comp(__first1, __first2))
+     {
+       *__result = *__first1;
+       ++__first1;
+     }
+   else if (__comp(__first2, __first1))
+     {
+       *__result = *__first2;
+       ++__first2;
+     }
+   else
+     {
+       *__result = *__first1;
+       ++__first1;
+       ++__first2;
+     }
+   ++__result;
+ }
+      return std::copy(__first2, __last2,
+         std::copy(__first1, __last1, __result));
+    }
+  template<typename _InputIterator1, typename _InputIterator2,
+    typename _OutputIterator>
+    inline _OutputIterator
+    set_union(_InputIterator1 __first1, _InputIterator1 __last1,
+       _InputIterator2 __first2, _InputIterator2 __last2,
+       _OutputIterator __result)
+    {
+
+     
+     
+     
+
+     
+
+     
+
+
+     
+
+
+      ;
+      ;
+      ;
+      ;
+
+      return std::__set_union(__first1, __last1,
+    __first2, __last2, __result,
+    __gnu_cxx::__ops::__iter_less_iter());
+    }
+  template<typename _InputIterator1, typename _InputIterator2,
+    typename _OutputIterator, typename _Compare>
+    inline _OutputIterator
+    set_union(_InputIterator1 __first1, _InputIterator1 __last1,
+       _InputIterator2 __first2, _InputIterator2 __last2,
+       _OutputIterator __result, _Compare __comp)
+    {
+
+     
+     
+     
+
+     
+
+     
+
+
+     
+
+
+      ;
+      ;
+      ;
+      ;
+
+      return std::__set_union(__first1, __last1,
+    __first2, __last2, __result,
+    __gnu_cxx::__ops::__iter_comp_iter(__comp));
+    }
+
+  template<typename _InputIterator1, typename _InputIterator2,
+    typename _OutputIterator,
+    typename _Compare>
+    _OutputIterator
+    __set_intersection(_InputIterator1 __first1, _InputIterator1 __last1,
+         _InputIterator2 __first2, _InputIterator2 __last2,
+         _OutputIterator __result, _Compare __comp)
+    {
+      while (__first1 != __last1 && __first2 != __last2)
+ if (__comp(__first1, __first2))
+   ++__first1;
+ else if (__comp(__first2, __first1))
+   ++__first2;
+ else
+   {
+     *__result = *__first1;
+     ++__first1;
+     ++__first2;
+     ++__result;
+   }
+      return __result;
+    }
+  template<typename _InputIterator1, typename _InputIterator2,
+    typename _OutputIterator>
+    inline _OutputIterator
+    set_intersection(_InputIterator1 __first1, _InputIterator1 __last1,
+       _InputIterator2 __first2, _InputIterator2 __last2,
+       _OutputIterator __result)
+    {
+
+     
+     
+     
+
+     
+
+
+     
+
+
+      ;
+      ;
+      ;
+      ;
+
+      return std::__set_intersection(__first1, __last1,
+         __first2, __last2, __result,
+         __gnu_cxx::__ops::__iter_less_iter());
+    }
+  template<typename _InputIterator1, typename _InputIterator2,
+    typename _OutputIterator, typename _Compare>
+    inline _OutputIterator
+    set_intersection(_InputIterator1 __first1, _InputIterator1 __last1,
+       _InputIterator2 __first2, _InputIterator2 __last2,
+       _OutputIterator __result, _Compare __comp)
+    {
+
+     
+     
+     
+
+     
+
+
+     
+
+
+      ;
+      ;
+      ;
+      ;
+
+      return std::__set_intersection(__first1, __last1,
+    __first2, __last2, __result,
+    __gnu_cxx::__ops::__iter_comp_iter(__comp));
+    }
+
+  template<typename _InputIterator1, typename _InputIterator2,
+    typename _OutputIterator,
+    typename _Compare>
+    _OutputIterator
+    __set_difference(_InputIterator1 __first1, _InputIterator1 __last1,
+       _InputIterator2 __first2, _InputIterator2 __last2,
+       _OutputIterator __result, _Compare __comp)
+    {
+      while (__first1 != __last1 && __first2 != __last2)
+ if (__comp(__first1, __first2))
+   {
+     *__result = *__first1;
+     ++__first1;
+     ++__result;
+   }
+ else if (__comp(__first2, __first1))
+   ++__first2;
+ else
+   {
+     ++__first1;
+     ++__first2;
+   }
+      return std::copy(__first1, __last1, __result);
+    }
+  template<typename _InputIterator1, typename _InputIterator2,
+    typename _OutputIterator>
+    inline _OutputIterator
+    set_difference(_InputIterator1 __first1, _InputIterator1 __last1,
+     _InputIterator2 __first2, _InputIterator2 __last2,
+     _OutputIterator __result)
+    {
+
+     
+     
+     
+
+     
+
+
+     
+
+
+      ;
+      ;
+      ;
+      ;
+
+      return std::__set_difference(__first1, __last1,
+       __first2, __last2, __result,
+       __gnu_cxx::__ops::__iter_less_iter());
+    }
+  template<typename _InputIterator1, typename _InputIterator2,
+    typename _OutputIterator, typename _Compare>
+    inline _OutputIterator
+    set_difference(_InputIterator1 __first1, _InputIterator1 __last1,
+     _InputIterator2 __first2, _InputIterator2 __last2,
+     _OutputIterator __result, _Compare __comp)
+    {
+
+     
+     
+     
+
+     
+
+
+     
+
+
+      ;
+      ;
+      ;
+      ;
+
+      return std::__set_difference(__first1, __last1,
+       __first2, __last2, __result,
+       __gnu_cxx::__ops::__iter_comp_iter(__comp));
+    }
+
+  template<typename _InputIterator1, typename _InputIterator2,
+    typename _OutputIterator,
+    typename _Compare>
+    _OutputIterator
+    __set_symmetric_difference(_InputIterator1 __first1,
+          _InputIterator1 __last1,
+          _InputIterator2 __first2,
+          _InputIterator2 __last2,
+          _OutputIterator __result,
+          _Compare __comp)
+    {
+      while (__first1 != __last1 && __first2 != __last2)
+ if (__comp(__first1, __first2))
+   {
+     *__result = *__first1;
+     ++__first1;
+     ++__result;
+   }
+ else if (__comp(__first2, __first1))
+   {
+     *__result = *__first2;
+     ++__first2;
+     ++__result;
+   }
+ else
+   {
+     ++__first1;
+     ++__first2;
+   }
+      return std::copy(__first2, __last2,
+         std::copy(__first1, __last1, __result));
+    }
+  template<typename _InputIterator1, typename _InputIterator2,
+    typename _OutputIterator>
+    inline _OutputIterator
+    set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1,
+        _InputIterator2 __first2, _InputIterator2 __last2,
+        _OutputIterator __result)
+    {
+
+     
+     
+     
+
+     
+
+     
+
+
+     
+
+
+      ;
+      ;
+      ;
+      ;
+
+      return std::__set_symmetric_difference(__first1, __last1,
+     __first2, __last2, __result,
+     __gnu_cxx::__ops::__iter_less_iter());
+    }
+  template<typename _InputIterator1, typename _InputIterator2,
+    typename _OutputIterator, typename _Compare>
+    inline _OutputIterator
+    set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1,
+        _InputIterator2 __first2, _InputIterator2 __last2,
+        _OutputIterator __result,
+        _Compare __comp)
+    {
+
+     
+     
+     
+
+     
+
+     
+
+
+     
+
+
+      ;
+      ;
+      ;
+      ;
+
+      return std::__set_symmetric_difference(__first1, __last1,
+    __first2, __last2, __result,
+    __gnu_cxx::__ops::__iter_comp_iter(__comp));
+    }
+
+  template<typename _ForwardIterator, typename _Compare>
+   
+    _ForwardIterator
+    __min_element(_ForwardIterator __first, _ForwardIterator __last,
+    _Compare __comp)
+    {
+      if (__first == __last)
+ return __first;
+      _ForwardIterator __result = __first;
+      while (++__first != __last)
+ if (__comp(__first, __result))
+   __result = __first;
+      return __result;
+    }
+  template<typename _ForwardIterator>
+   
+    _ForwardIterator
+    inline min_element(_ForwardIterator __first, _ForwardIterator __last)
+    {
+
+     
+     
+
+      ;
+      ;
+
+      return std::__min_element(__first, __last,
+    __gnu_cxx::__ops::__iter_less_iter());
+    }
+  template<typename _ForwardIterator, typename _Compare>
+   
+    inline _ForwardIterator
+    min_element(_ForwardIterator __first, _ForwardIterator __last,
+  _Compare __comp)
+    {
+
+     
+     
+
+
+      ;
+      ;
+
+      return std::__min_element(__first, __last,
+    __gnu_cxx::__ops::__iter_comp_iter(__comp));
+    }
+
+  template<typename _ForwardIterator, typename _Compare>
+   
+    _ForwardIterator
+    __max_element(_ForwardIterator __first, _ForwardIterator __last,
+    _Compare __comp)
+    {
+      if (__first == __last) return __first;
+      _ForwardIterator __result = __first;
+      while (++__first != __last)
+ if (__comp(__result, __first))
+   __result = __first;
+      return __result;
+    }
+  template<typename _ForwardIterator>
+   
+    inline _ForwardIterator
+    max_element(_ForwardIterator __first, _ForwardIterator __last)
+    {
+
+     
+     
+
+      ;
+      ;
+
+      return std::__max_element(__first, __last,
+    __gnu_cxx::__ops::__iter_less_iter());
+    }
+  template<typename _ForwardIterator, typename _Compare>
+   
+    inline _ForwardIterator
+    max_element(_ForwardIterator __first, _ForwardIterator __last,
+  _Compare __comp)
+    {
+
+     
+     
+
+
+      ;
+      ;
+
+      return std::__max_element(__first, __last,
+    __gnu_cxx::__ops::__iter_comp_iter(__comp));
+    }
+
+
+}
+       
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+       
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+       
+
+
+extern "C" {
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
+       size_t __n) throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern void *memmove (void *__dest, const void *__src, size_t __n)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+
+
+
+
+extern void *memccpy (void *__restrict __dest, const void *__restrict __src,
+        int __c, size_t __n)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+
+
+
+extern void *memset (void *__s, int __c, size_t __n) throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int memcmp (const void *__s1, const void *__s2, size_t __n)
+     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
+
+
+
+extern "C++"
+{
+extern void *memchr (void *__s, int __c, size_t __n)
+      throw () __asm ("memchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
+extern const void *memchr (const void *__s, int __c, size_t __n)
+      throw () __asm ("memchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
+
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) void *
+memchr (void *__s, int __c, size_t __n) throw ()
+{
+  return __builtin_memchr (__s, __c, __n);
+}
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) const void *
+memchr (const void *__s, int __c, size_t __n) throw ()
+{
+  return __builtin_memchr (__s, __c, __n);
+}
+
+}
+
+
+
+
+
+
+
+
+
+
+extern "C++" void *rawmemchr (void *__s, int __c)
+     throw () __asm ("rawmemchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
+extern "C++" const void *rawmemchr (const void *__s, int __c)
+     throw () __asm ("rawmemchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
+
+
+
+
+
+
+
+extern "C++" void *memrchr (void *__s, int __c, size_t __n)
+      throw () __asm ("memrchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
+extern "C++" const void *memrchr (const void *__s, int __c, size_t __n)
+      throw () __asm ("memrchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
+
+
+
+
+
+
+
+
+
+extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+extern char *strncpy (char *__restrict __dest,
+        const char *__restrict __src, size_t __n)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern char *strcat (char *__restrict __dest, const char *__restrict __src)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+extern char *strncat (char *__restrict __dest, const char *__restrict __src,
+        size_t __n) throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern int strcmp (const char *__s1, const char *__s2)
+     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
+
+extern int strncmp (const char *__s1, const char *__s2, size_t __n)
+     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern int strcoll (const char *__s1, const char *__s2)
+     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
+
+extern size_t strxfrm (char *__restrict __dest,
+         const char *__restrict __src, size_t __n)
+     throw () __attribute__ ((__nonnull__ (2)));
+
+extern int strcoll_l (const char *__s1, const char *__s2, __locale_t __l)
+     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));
+
+extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,
+    __locale_t __l) throw () __attribute__ ((__nonnull__ (2, 4)));
+
+
+
+
+
+extern char *strdup (const char *__s)
+     throw () __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
+
+
+
+
+
+
+extern char *strndup (const char *__string, size_t __n)
+     throw () __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
+
+
+
+extern "C++"
+{
+extern char *strchr (char *__s, int __c)
+     throw () __asm ("strchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
+extern const char *strchr (const char *__s, int __c)
+     throw () __asm ("strchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
+
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) char *
+strchr (char *__s, int __c) throw ()
+{
+  return __builtin_strchr (__s, __c);
+}
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) const char *
+strchr (const char *__s, int __c) throw ()
+{
+  return __builtin_strchr (__s, __c);
+}
+
+}
+
+
+
+
+
+
+extern "C++"
+{
+extern char *strrchr (char *__s, int __c)
+     throw () __asm ("strrchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
+extern const char *strrchr (const char *__s, int __c)
+     throw () __asm ("strrchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
+
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) char *
+strrchr (char *__s, int __c) throw ()
+{
+  return __builtin_strrchr (__s, __c);
+}
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) const char *
+strrchr (const char *__s, int __c) throw ()
+{
+  return __builtin_strrchr (__s, __c);
+}
+
+}
+
+
+
+
+
+
+
+
+
+
+extern "C++" char *strchrnul (char *__s, int __c)
+     throw () __asm ("strchrnul") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
+extern "C++" const char *strchrnul (const char *__s, int __c)
+     throw () __asm ("strchrnul") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
+
+
+
+
+
+
+
+
+
+extern size_t strcspn (const char *__s, const char *__reject)
+     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern size_t strspn (const char *__s, const char *__accept)
+     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern "C++"
+{
+extern char *strpbrk (char *__s, const char *__accept)
+     throw () __asm ("strpbrk") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
+extern const char *strpbrk (const char *__s, const char *__accept)
+     throw () __asm ("strpbrk") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) char *
+strpbrk (char *__s, const char *__accept) throw ()
+{
+  return __builtin_strpbrk (__s, __accept);
+}
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) const char *
+strpbrk (const char *__s, const char *__accept) throw ()
+{
+  return __builtin_strpbrk (__s, __accept);
+}
+
+}
+
+
+
+
+
+
+extern "C++"
+{
+extern char *strstr (char *__haystack, const char *__needle)
+     throw () __asm ("strstr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
+extern const char *strstr (const char *__haystack, const char *__needle)
+     throw () __asm ("strstr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) char *
+strstr (char *__haystack, const char *__needle) throw ()
+{
+  return __builtin_strstr (__haystack, __needle);
+}
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) const char *
+strstr (const char *__haystack, const char *__needle) throw ()
+{
+  return __builtin_strstr (__haystack, __needle);
+}
+
+}
+
+
+
+
+
+
+
+extern char *strtok (char *__restrict __s, const char *__restrict __delim)
+     throw () __attribute__ ((__nonnull__ (2)));
+
+
+
+
+extern char *__strtok_r (char *__restrict __s,
+    const char *__restrict __delim,
+    char **__restrict __save_ptr)
+     throw () __attribute__ ((__nonnull__ (2, 3)));
+
+extern char *strtok_r (char *__restrict __s, const char *__restrict __delim,
+         char **__restrict __save_ptr)
+     throw () __attribute__ ((__nonnull__ (2, 3)));
+
+
+
+
+
+extern "C++" char *strcasestr (char *__haystack, const char *__needle)
+     throw () __asm ("strcasestr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
+extern "C++" const char *strcasestr (const char *__haystack,
+         const char *__needle)
+     throw () __asm ("strcasestr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
+extern void *memmem (const void *__haystack, size_t __haystacklen,
+       const void *__needle, size_t __needlelen)
+     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 3)));
+
+
+
+extern void *__mempcpy (void *__restrict __dest,
+   const void *__restrict __src, size_t __n)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+extern void *mempcpy (void *__restrict __dest,
+        const void *__restrict __src, size_t __n)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+
+
+
+extern size_t strlen (const char *__s)
+     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
+
+
+
+
+
+extern size_t strnlen (const char *__string, size_t __maxlen)
+     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
+
+
+
+
+
+extern char *strerror (int __errnum) throw ();
+
+extern char *strerror_r (int __errnum, char *__buf, size_t __buflen)
+     throw () __attribute__ ((__nonnull__ (2))) ;
+
+
+
+
+
+extern char *strerror_l (int __errnum, __locale_t __l) throw ();
+
+
+
+
+
+extern void __bzero (void *__s, size_t __n) throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+extern void bcopy (const void *__src, void *__dest, size_t __n)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern void bzero (void *__s, size_t __n) throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int bcmp (const void *__s1, const void *__s2, size_t __n)
+     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
+
+
+
+extern "C++"
+{
+extern char *index (char *__s, int __c)
+     throw () __asm ("index") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
+extern const char *index (const char *__s, int __c)
+     throw () __asm ("index") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
+
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) char *
+index (char *__s, int __c) throw ()
+{
+  return __builtin_index (__s, __c);
+}
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) const char *
+index (const char *__s, int __c) throw ()
+{
+  return __builtin_index (__s, __c);
+}
+
+}
+
+
+
+
+
+
+
+extern "C++"
+{
+extern char *rindex (char *__s, int __c)
+     throw () __asm ("rindex") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
+extern const char *rindex (const char *__s, int __c)
+     throw () __asm ("rindex") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
+
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) char *
+rindex (char *__s, int __c) throw ()
+{
+  return __builtin_rindex (__s, __c);
+}
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) const char *
+rindex (const char *__s, int __c) throw ()
+{
+  return __builtin_rindex (__s, __c);
+}
+
+}
+
+
+
+
+
+
+
+extern int ffs (int __i) throw () __attribute__ ((__const__));
+
+
+
+
+extern int ffsl (long int __l) throw () __attribute__ ((__const__));
+
+__extension__ extern int ffsll (long long int __ll)
+     throw () __attribute__ ((__const__));
+
+
+
+
+extern int strcasecmp (const char *__s1, const char *__s2)
+     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern int strncasecmp (const char *__s1, const char *__s2, size_t __n)
+     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
+
+
+
+
+
+extern int strcasecmp_l (const char *__s1, const char *__s2,
+    __locale_t __loc)
+     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));
+
+extern int strncasecmp_l (const char *__s1, const char *__s2,
+     size_t __n, __locale_t __loc)
+     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 4)));
+
+
+
+
+
+extern char *strsep (char **__restrict __stringp,
+       const char *__restrict __delim)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+
+
+extern char *strsignal (int __sig) throw ();
+
+
+extern char *__stpcpy (char *__restrict __dest, const char *__restrict __src)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+extern char *stpcpy (char *__restrict __dest, const char *__restrict __src)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+
+extern char *__stpncpy (char *__restrict __dest,
+   const char *__restrict __src, size_t __n)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+extern char *stpncpy (char *__restrict __dest,
+        const char *__restrict __src, size_t __n)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+
+
+extern int strverscmp (const char *__s1, const char *__s2)
+     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern char *strfry (char *__string) throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern void *memfrob (void *__s, size_t __n) throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+
+
+
+
+extern "C++" char *basename (char *__filename)
+     throw () __asm ("basename") __attribute__ ((__nonnull__ (1)));
+extern "C++" const char *basename (const char *__filename)
+     throw () __asm ("basename") __attribute__ ((__nonnull__ (1)));
+}
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+  using ::memchr;
+  using ::memcmp;
+  using ::memcpy;
+  using ::memmove;
+  using ::memset;
+  using ::strcat;
+  using ::strcmp;
+  using ::strcoll;
+  using ::strcpy;
+  using ::strcspn;
+  using ::strerror;
+  using ::strlen;
+  using ::strncat;
+  using ::strncmp;
+  using ::strncpy;
+  using ::strspn;
+  using ::strtok;
+  using ::strxfrm;
+  using ::strchr;
+  using ::strpbrk;
+  using ::strrchr;
+  using ::strstr;
+
+}
+
+namespace llvm {
+
+enum ZeroBehavior {
+
+  ZB_Undefined,
+
+  ZB_Max,
+
+  ZB_Width
+};
+
+namespace detail {
+template <typename T, std::size_t SizeOfT> struct TrailingZerosCounter {
+  static std::size_t count(T Val, ZeroBehavior) {
+    if (!Val)
+      return std::numeric_limits<T>::digits;
+    if (Val & 0x1)
+      return 0;
+
+
+    std::size_t ZeroBits = 0;
+    T Shift = std::numeric_limits<T>::digits >> 1;
+    T Mask = std::numeric_limits<T>::max() >> Shift;
+    while (Shift) {
+      if ((Val & Mask) == 0) {
+        Val >>= Shift;
+        ZeroBits |= Shift;
+      }
+      Shift >>= 1;
+      Mask >>= Shift;
+    }
+    return ZeroBits;
+  }
+};
+
+
+template <typename T> struct TrailingZerosCounter<T, 4> {
+  static std::size_t count(T Val, ZeroBehavior ZB) {
+    if (ZB != ZB_Undefined && Val == 0)
+      return 32;
+
+
+    return __builtin_ctz(Val);
+
+
+
+
+
+  }
+};
+
+
+template <typename T> struct TrailingZerosCounter<T, 8> {
+  static std::size_t count(T Val, ZeroBehavior ZB) {
+    if (ZB != ZB_Undefined && Val == 0)
+      return 64;
+
+
+    return __builtin_ctzll(Val);
+
+
+
+
+
+  }
+};
+
+
+}
+template <typename T>
+std::size_t countTrailingZeros(T Val, ZeroBehavior ZB = ZB_Width) {
+  static_assert(std::numeric_limits<T>::is_integer &&
+                    !std::numeric_limits<T>::is_signed,
+                "Only unsigned integral types are allowed.");
+  return llvm::detail::TrailingZerosCounter<T, sizeof(T)>::count(Val, ZB);
+}
+
+namespace detail {
+template <typename T, std::size_t SizeOfT> struct LeadingZerosCounter {
+  static std::size_t count(T Val, ZeroBehavior) {
+    if (!Val)
+      return std::numeric_limits<T>::digits;
+
+
+    std::size_t ZeroBits = 0;
+    for (T Shift = std::numeric_limits<T>::digits >> 1; Shift; Shift >>= 1) {
+      T Tmp = Val >> Shift;
+      if (Tmp)
+        Val = Tmp;
+      else
+        ZeroBits |= Shift;
+    }
+    return ZeroBits;
+  }
+};
+
+
+template <typename T> struct LeadingZerosCounter<T, 4> {
+  static std::size_t count(T Val, ZeroBehavior ZB) {
+    if (ZB != ZB_Undefined && Val == 0)
+      return 32;
+
+
+    return __builtin_clz(Val);
+
+
+
+
+
+  }
+};
+
+
+template <typename T> struct LeadingZerosCounter<T, 8> {
+  static std::size_t count(T Val, ZeroBehavior ZB) {
+    if (ZB != ZB_Undefined && Val == 0)
+      return 64;
+
+
+    return __builtin_clzll(Val);
+
+
+
+
+
+  }
+};
+
+
+}
+template <typename T>
+std::size_t countLeadingZeros(T Val, ZeroBehavior ZB = ZB_Width) {
+  static_assert(std::numeric_limits<T>::is_integer &&
+                    !std::numeric_limits<T>::is_signed,
+                "Only unsigned integral types are allowed.");
+  return llvm::detail::LeadingZerosCounter<T, sizeof(T)>::count(Val, ZB);
+}
+template <typename T> T findFirstSet(T Val, ZeroBehavior ZB = ZB_Max) {
+  if (ZB == ZB_Max && Val == 0)
+    return std::numeric_limits<T>::max();
+
+  return countTrailingZeros(Val, ZB_Undefined);
+}
+
+
+
+template <typename T> T maskTrailingOnes(unsigned N) {
+  static_assert(std::is_unsigned<T>::value, "Invalid type!");
+  const unsigned Bits = 8 * sizeof(T);
+  
+ ((
+ N <= Bits && "Invalid bit index"
+ ) ? static_cast<void> (0) : __assert_fail (
+ "N <= Bits && \"Invalid bit index\""
+ , "/home/trippels/llvm/llvm/include/llvm/Support/MathExtras.h", 207, __PRETTY_FUNCTION__))
+                                         ;
+  return N == 0 ? 0 : (T(-1) >> (Bits - N));
+}
+
+
+
+template <typename T> T maskLeadingOnes(unsigned N) {
+  return ~maskTrailingOnes<T>(8 * sizeof(T) - N);
+}
+
+
+
+template <typename T> T maskTrailingZeros(unsigned N) {
+  return maskLeadingOnes<T>(8 * sizeof(T) - N);
+}
+
+
+
+template <typename T> T maskLeadingZeros(unsigned N) {
+  return maskTrailingOnes<T>(8 * sizeof(T) - N);
+}
+template <typename T> T findLastSet(T Val, ZeroBehavior ZB = ZB_Max) {
+  if (ZB == ZB_Max && Val == 0)
+    return std::numeric_limits<T>::max();
+
+
+
+  return countLeadingZeros(Val, ZB_Undefined) ^
+         (std::numeric_limits<T>::digits - 1);
+}
+
+
+
+
+static const unsigned char BitReverseTable256[256] = {
+
+
+
+  0, 0 + 2 * 64, 0 + 1 * 64, 0 + 3 * 64, 0 + 2 * 16, 0 + 2 * 16 + 2 * 64, 0 + 2 * 16 + 1 * 64, 0 + 2 * 16 + 3 * 64, 0 + 1 * 16, 0 + 1 * 16 + 2 * 64, 0 + 1 * 16 + 1 * 64, 0 + 1 * 16 + 3 * 64, 0 + 3 * 16, 0 + 3 * 16 + 2 * 64, 0 + 3 * 16 + 1 * 64, 0 + 3 * 16 + 3 * 64, 0 + 2 * 4, 0 + 2 * 4 + 2 * 64, 0 + 2 * 4 + 1 * 64, 0 + 2 * 4 + 3 * 64, 0 + 2 * 4 + 2 * 16, 0 + 2 * 4 + 2 * 16 + 2 * 64, 0 + 2 * 4 + 2 * 16 + 1 * 64, 0 + 2 * 4 + 2 * 16 + 3 * 64, 0 + 2 * 4 + 1 * 16, 0 + 2 * 4 + 1 * 16 + 2 * 64, 0 + 2 * 4 + 1 * 16 + 1 * 64, 0 + 2 * 4 + 1 * 16 + 3 * 64, 0 + 2 * 4 + 3 * 16, 0 + 2 * 4 + 3 * 16 + 2 * 64, 0 + 2 * 4 + 3 * 16 + 1 * 64, 0 + 2 * 4 + 3 * 16 + 3 * 64, 0 + 1 * 4, 0 + 1 * 4 + 2 * 64, 0 + 1 * 4 + 1 * 64, 0 + 1 * 4 + 3 * 64, 0 + 1 * 4 + 2 * 16, 0 + 1 * 4 + 2 * 16 + 2 * 64, 0 + 1 * 4 + 2 * 16 + 1 * 64, 0 + 1 * 4 + 2 * 16 + 3 * 64, 0 + 1 * 4 + 1 * 16, 0 + 1 * 4 + 1 * 16 + 2 * 64, 0 + 1 * 4 + 1 * 16 + 1 * 64, 0 + 1 * 4 + 1 * 16 + 3 * 64, 0 + 1 * 4 + 3 * 16, 0 + 1 * 4 + 3 * 16 + 2 * 64, 0 + 1 * 4 + 3 * 16 + 1 * 64, 0 + 1 * 4 + 3 * 16 + 3 * 64, 0 + 3 * 4, 0 + 3 * 4 + 2 * 64, 0 + 3 * 4 + 1 * 64, 0 + 3 * 4 + 3 * 64, 0 + 3 * 4 + 2 * 16, 0 + 3 * 4 + 2 * 16 + 2 * 64, 0 + 3 * 4 + 2 * 16 + 1 * 64, 0 + 3 * 4 + 2 * 16 + 3 * 64, 0 + 3 * 4 + 1 * 16, 0 + 3 * 4 + 1 * 16 + 2 * 64, 0 + 3 * 4 + 1 * 16 + 1 * 64, 0 + 3 * 4 + 1 * 16 + 3 * 64, 0 + 3 * 4 + 3 * 16, 0 + 3 * 4 + 3 * 16 + 2 * 64, 0 + 3 * 4 + 3 * 16 + 1 * 64, 0 + 3 * 4 + 3 * 16 + 3 * 64, 2, 2 + 2 * 64, 2 + 1 * 64, 2 + 3 * 64, 2 + 2 * 16, 2 + 2 * 16 + 2 * 64, 2 + 2 * 16 + 1 * 64, 2 + 2 * 16 + 3 * 64, 2 + 1 * 16, 2 + 1 * 16 + 2 * 64, 2 + 1 * 16 + 1 * 64, 2 + 1 * 16 + 3 * 64, 2 + 3 * 16, 2 + 3 * 16 + 2 * 64, 2 + 3 * 16 + 1 * 64, 2 + 3 * 16 + 3 * 64, 2 + 2 * 4, 2 + 2 * 4 + 2 * 64, 2 + 2 * 4 + 1 * 64, 2 + 2 * 4 + 3 * 64, 2 + 2 * 4 + 2 * 16, 2 + 2 * 4 + 2 * 16 + 2 * 64, 2 + 2 * 4 + 2 * 16 + 1 * 64, 2 + 2 * 4 + 2 * 16 + 3 * 64, 2 + 2 * 4 + 1 * 16, 2 + 2 * 4 + 1 * 16 + 2 * 64, 2 + 2 * 4 + 1 * 16 + 1 * 64, 2 + 2 * 4 + 1 * 16 + 3 * 64, 2 + 2 * 4 + 3 * 16, 2 + 2 * 4 + 3 * 16 + 2 * 64, 2 + 2 * 4 + 3 * 16 + 1 * 64, 2 + 2 * 4 + 3 * 16 + 3 * 64, 2 + 1 * 4, 2 + 1 * 4 + 2 * 64, 2 + 1 * 4 + 1 * 64, 2 + 1 * 4 + 3 * 64, 2 + 1 * 4 + 2 * 16, 2 + 1 * 4 + 2 * 16 + 2 * 64, 2 + 1 * 4 + 2 * 16 + 1 * 64, 2 + 1 * 4 + 2 * 16 + 3 * 64, 2 + 1 * 4 + 1 * 16, 2 + 1 * 4 + 1 * 16 + 2 * 64, 2 + 1 * 4 + 1 * 16 + 1 * 64, 2 + 1 * 4 + 1 * 16 + 3 * 64, 2 + 1 * 4 + 3 * 16, 2 + 1 * 4 + 3 * 16 + 2 * 64, 2 + 1 * 4 + 3 * 16 + 1 * 64, 2 + 1 * 4 + 3 * 16 + 3 * 64, 2 + 3 * 4, 2 + 3 * 4 + 2 * 64, 2 + 3 * 4 + 1 * 64, 2 + 3 * 4 + 3 * 64, 2 + 3 * 4 + 2 * 16, 2 + 3 * 4 + 2 * 16 + 2 * 64, 2 + 3 * 4 + 2 * 16 + 1 * 64, 2 + 3 * 4 + 2 * 16 + 3 * 64, 2 + 3 * 4 + 1 * 16, 2 + 3 * 4 + 1 * 16 + 2 * 64, 2 + 3 * 4 + 1 * 16 + 1 * 64, 2 + 3 * 4 + 1 * 16 + 3 * 64, 2 + 3 * 4 + 3 * 16, 2 + 3 * 4 + 3 * 16 + 2 * 64, 2 + 3 * 4 + 3 * 16 + 1 * 64, 2 + 3 * 4 + 3 * 16 + 3 * 64, 1, 1 + 2 * 64, 1 + 1 * 64, 1 + 3 * 64, 1 + 2 * 16, 1 + 2 * 16 + 2 * 64, 1 + 2 * 16 + 1 * 64, 1 + 2 * 16 + 3 * 64, 1 + 1 * 16, 1 + 1 * 16 + 2 * 64, 1 + 1 * 16 + 1 * 64, 1 + 1 * 16 + 3 * 64, 1 + 3 * 16, 1 + 3 * 16 + 2 * 64, 1 + 3 * 16 + 1 * 64, 1 + 3 * 16 + 3 * 64, 1 + 2 * 4, 1 + 2 * 4 + 2 * 64, 1 + 2 * 4 + 1 * 64, 1 + 2 * 4 + 3 * 64, 1 + 2 * 4 + 2 * 16, 1 + 2 * 4 + 2 * 16 + 2 * 64, 1 + 2 * 4 + 2 * 16 + 1 * 64, 1 + 2 * 4 + 2 * 16 + 3 * 64, 1 + 2 * 4 + 1 * 16, 1 + 2 * 4 + 1 * 16 + 2 * 64, 1 + 2 * 4 + 1 * 16 + 1 * 64, 1 + 2 * 4 + 1 * 16 + 3 * 64, 1 + 2 * 4 + 3 * 16, 1 + 2 * 4 + 3 * 16 + 2 * 64, 1 + 2 * 4 + 3 * 16 + 1 * 64, 1 + 2 * 4 + 3 * 16 + 3 * 64, 1 + 1 * 4, 1 + 1 * 4 + 2 * 64, 1 + 1 * 4 + 1 * 64, 1 + 1 * 4 + 3 * 64, 1 + 1 * 4 + 2 * 16, 1 + 1 * 4 + 2 * 16 + 2 * 64, 1 + 1 * 4 + 2 * 16 + 1 * 64, 1 + 1 * 4 + 2 * 16 + 3 * 64, 1 + 1 * 4 + 1 * 16, 1 + 1 * 4 + 1 * 16 + 2 * 64, 1 + 1 * 4 + 1 * 16 + 1 * 64, 1 + 1 * 4 + 1 * 16 + 3 * 64, 1 + 1 * 4 + 3 * 16, 1 + 1 * 4 + 3 * 16 + 2 * 64, 1 + 1 * 4 + 3 * 16 + 1 * 64, 1 + 1 * 4 + 3 * 16 + 3 * 64, 1 + 3 * 4, 1 + 3 * 4 + 2 * 64, 1 + 3 * 4 + 1 * 64, 1 + 3 * 4 + 3 * 64, 1 + 3 * 4 + 2 * 16, 1 + 3 * 4 + 2 * 16 + 2 * 64, 1 + 3 * 4 + 2 * 16 + 1 * 64, 1 + 3 * 4 + 2 * 16 + 3 * 64, 1 + 3 * 4 + 1 * 16, 1 + 3 * 4 + 1 * 16 + 2 * 64, 1 + 3 * 4 + 1 * 16 + 1 * 64, 1 + 3 * 4 + 1 * 16 + 3 * 64, 1 + 3 * 4 + 3 * 16, 1 + 3 * 4 + 3 * 16 + 2 * 64, 1 + 3 * 4 + 3 * 16 + 1 * 64, 1 + 3 * 4 + 3 * 16 + 3 * 64, 3, 3 + 2 * 64, 3 + 1 * 64, 3 + 3 * 64, 3 + 2 * 16, 3 + 2 * 16 + 2 * 64, 3 + 2 * 16 + 1 * 64, 3 + 2 * 16 + 3 * 64, 3 + 1 * 16, 3 + 1 * 16 + 2 * 64, 3 + 1 * 16 + 1 * 64, 3 + 1 * 16 + 3 * 64, 3 + 3 * 16, 3 + 3 * 16 + 2 * 64, 3 + 3 * 16 + 1 * 64, 3 + 3 * 16 + 3 * 64, 3 + 2 * 4, 3 + 2 * 4 + 2 * 64, 3 + 2 * 4 + 1 * 64, 3 + 2 * 4 + 3 * 64, 3 + 2 * 4 + 2 * 16, 3 + 2 * 4 + 2 * 16 + 2 * 64, 3 + 2 * 4 + 2 * 16 + 1 * 64, 3 + 2 * 4 + 2 * 16 + 3 * 64, 3 + 2 * 4 + 1 * 16, 3 + 2 * 4 + 1 * 16 + 2 * 64, 3 + 2 * 4 + 1 * 16 + 1 * 64, 3 + 2 * 4 + 1 * 16 + 3 * 64, 3 + 2 * 4 + 3 * 16, 3 + 2 * 4 + 3 * 16 + 2 * 64, 3 + 2 * 4 + 3 * 16 + 1 * 64, 3 + 2 * 4 + 3 * 16 + 3 * 64, 3 + 1 * 4, 3 + 1 * 4 + 2 * 64, 3 + 1 * 4 + 1 * 64, 3 + 1 * 4 + 3 * 64, 3 + 1 * 4 + 2 * 16, 3 + 1 * 4 + 2 * 16 + 2 * 64, 3 + 1 * 4 + 2 * 16 + 1 * 64, 3 + 1 * 4 + 2 * 16 + 3 * 64, 3 + 1 * 4 + 1 * 16, 3 + 1 * 4 + 1 * 16 + 2 * 64, 3 + 1 * 4 + 1 * 16 + 1 * 64, 3 + 1 * 4 + 1 * 16 + 3 * 64, 3 + 1 * 4 + 3 * 16, 3 + 1 * 4 + 3 * 16 + 2 * 64, 3 + 1 * 4 + 3 * 16 + 1 * 64, 3 + 1 * 4 + 3 * 16 + 3 * 64, 3 + 3 * 4, 3 + 3 * 4 + 2 * 64, 3 + 3 * 4 + 1 * 64, 3 + 3 * 4 + 3 * 64, 3 + 3 * 4 + 2 * 16, 3 + 3 * 4 + 2 * 16 + 2 * 64, 3 + 3 * 4 + 2 * 16 + 1 * 64, 3 + 3 * 4 + 2 * 16 + 3 * 64, 3 + 3 * 4 + 1 * 16, 3 + 3 * 4 + 1 * 16 + 2 * 64, 3 + 3 * 4 + 1 * 16 + 1 * 64, 3 + 3 * 4 + 1 * 16 + 3 * 64, 3 + 3 * 4 + 3 * 16, 3 + 3 * 4 + 3 * 16 + 2 * 64, 3 + 3 * 4 + 3 * 16 + 1 * 64, 3 + 3 * 4 + 3 * 16 + 3 * 64
+
+
+
+};
+
+
+template <typename T>
+T reverseBits(T Val) {
+  unsigned char in[sizeof(Val)];
+  unsigned char out[sizeof(Val)];
+  std::memcpy(in, &Val, sizeof(Val));
+  for (unsigned i = 0; i < sizeof(Val); ++i)
+    out[(sizeof(Val) - i) - 1] = BitReverseTable256[in[i]];
+  std::memcpy(&Val, out, sizeof(Val));
+  return Val;
+}
+
+
+
+
+
+
+constexpr inline uint32_t Hi_32(uint64_t Value) {
+  return static_cast<uint32_t>(Value >> 32);
+}
+
+
+constexpr inline uint32_t Lo_32(uint64_t Value) {
+  return static_cast<uint32_t>(Value);
+}
+
+
+constexpr inline uint64_t Make_64(uint32_t High, uint32_t Low) {
+  return ((uint64_t)High << 32) | (uint64_t)Low;
+}
+
+
+template <unsigned N> constexpr inline bool isInt(int64_t x) {
+  return N >= 64 || (-(1L<<(N-1)) <= x && x < (1L<<(N-1)));
+}
+
+template <> constexpr inline bool isInt<8>(int64_t x) {
+  return static_cast<int8_t>(x) == x;
+}
+template <> constexpr inline bool isInt<16>(int64_t x) {
+  return static_cast<int16_t>(x) == x;
+}
+template <> constexpr inline bool isInt<32>(int64_t x) {
+  return static_cast<int32_t>(x) == x;
+}
+
+
+template <unsigned N, unsigned S>
+constexpr inline bool isShiftedInt(int64_t x) {
+  static_assert(
+      N > 0, "isShiftedInt<0> doesn't make sense (refers to a 0-bit number.");
+  static_assert(N + S <= 64, "isShiftedInt<N, S> with N + S > 64 is too wide.");
+  return isInt<N + S>(x) && (x % (1UL << S) == 0);
+}
+template <unsigned N>
+constexpr inline typename std::enable_if<(N < 64), bool>::type
+isUInt(uint64_t X) {
+  static_assert(N > 0, "isUInt<0> doesn't make sense");
+  return X < (1UL << (N));
+}
+template <unsigned N>
+constexpr inline typename std::enable_if<N >= 64, bool>::type
+isUInt(uint64_t X) {
+  return true;
+}
+
+
+template <> constexpr inline bool isUInt<8>(uint64_t x) {
+  return static_cast<uint8_t>(x) == x;
+}
+template <> constexpr inline bool isUInt<16>(uint64_t x) {
+  return static_cast<uint16_t>(x) == x;
+}
+template <> constexpr inline bool isUInt<32>(uint64_t x) {
+  return static_cast<uint32_t>(x) == x;
+}
+
+
+template <unsigned N, unsigned S>
+constexpr inline bool isShiftedUInt(uint64_t x) {
+  static_assert(
+      N > 0, "isShiftedUInt<0> doesn't make sense (refers to a 0-bit number)");
+  static_assert(N + S <= 64,
+                "isShiftedUInt<N, S> with N + S > 64 is too wide.");
+
+
+  return isUInt<N + S>(x) && (x % (1UL << S) == 0);
+}
+
+
+inline uint64_t maxUIntN(uint64_t N) {
+  
+ ((
+ N > 0 && N <= 64 && "integer width out of range"
+ ) ? static_cast<void> (0) : __assert_fail (
+ "N > 0 && N <= 64 && \"integer width out of range\""
+ , "/home/trippels/llvm/llvm/include/llvm/Support/MathExtras.h", 359, __PRETTY_FUNCTION__))
+                                                         ;
+
+
+
+
+
+  return 
+        (18446744073709551615UL) 
+                   >> (64 - N);
+}
+
+
+inline int64_t minIntN(int64_t N) {
+  
+ ((
+ N > 0 && N <= 64 && "integer width out of range"
+ ) ? static_cast<void> (0) : __assert_fail (
+ "N > 0 && N <= 64 && \"integer width out of range\""
+ , "/home/trippels/llvm/llvm/include/llvm/Support/MathExtras.h", 370, __PRETTY_FUNCTION__))
+                                                         ;
+
+  return -(1UL<<(N-1));
+}
+
+
+inline int64_t maxIntN(int64_t N) {
+  
+ ((
+ N > 0 && N <= 64 && "integer width out of range"
+ ) ? static_cast<void> (0) : __assert_fail (
+ "N > 0 && N <= 64 && \"integer width out of range\""
+ , "/home/trippels/llvm/llvm/include/llvm/Support/MathExtras.h", 377, __PRETTY_FUNCTION__))
+                                                         ;
+
+
+
+  return (1UL << (N - 1)) - 1;
+}
+
+
+inline bool isUIntN(unsigned N, uint64_t x) {
+  return N >= 64 || x <= maxUIntN(N);
+}
+
+
+inline bool isIntN(unsigned N, int64_t x) {
+  return N >= 64 || (minIntN(N) <= x && x <= maxIntN(N));
+}
+
+
+
+
+constexpr inline bool isMask_32(uint32_t Value) {
+  return Value && ((Value + 1) & Value) == 0;
+}
+
+
+
+constexpr inline bool isMask_64(uint64_t Value) {
+  return Value && ((Value + 1) & Value) == 0;
+}
+
+
+
+constexpr inline bool isShiftedMask_32(uint32_t Value) {
+  return Value && isMask_32((Value - 1) | Value);
+}
+
+
+
+constexpr inline bool isShiftedMask_64(uint64_t Value) {
+  return Value && isMask_64((Value - 1) | Value);
+}
+
+
+
+constexpr inline bool isPowerOf2_32(uint32_t Value) {
+  return Value && !(Value & (Value - 1));
+}
+
+
+constexpr inline bool isPowerOf2_64(uint64_t Value) {
+  return Value && !(Value & (Value - 1));
+}
+
+
+inline uint16_t ByteSwap_16(uint16_t Value) {
+  return sys::SwapByteOrder_16(Value);
+}
+
+
+inline uint32_t ByteSwap_32(uint32_t Value) {
+  return sys::SwapByteOrder_32(Value);
+}
+
+
+inline uint64_t ByteSwap_64(uint64_t Value) {
+  return sys::SwapByteOrder_64(Value);
+}
+template <typename T>
+std::size_t countLeadingOnes(T Value, ZeroBehavior ZB = ZB_Width) {
+  static_assert(std::numeric_limits<T>::is_integer &&
+                    !std::numeric_limits<T>::is_signed,
+                "Only unsigned integral types are allowed.");
+  return countLeadingZeros(~Value, ZB);
+}
+template <typename T>
+std::size_t countTrailingOnes(T Value, ZeroBehavior ZB = ZB_Width) {
+  static_assert(std::numeric_limits<T>::is_integer &&
+                    !std::numeric_limits<T>::is_signed,
+                "Only unsigned integral types are allowed.");
+  return countTrailingZeros(~Value, ZB);
+}
+
+namespace detail {
+template <typename T, std::size_t SizeOfT> struct PopulationCounter {
+  static unsigned count(T Value) {
+
+    static_assert(SizeOfT <= 4, "Not implemented!");
+
+    return __builtin_popcount(Value);
+
+
+
+
+
+
+  }
+};
+
+template <typename T> struct PopulationCounter<T, 8> {
+  static unsigned count(T Value) {
+
+    return __builtin_popcountll(Value);
+
+
+
+
+
+
+
+  }
+};
+}
+
+
+
+
+template <typename T>
+inline unsigned countPopulation(T Value) {
+  static_assert(std::numeric_limits<T>::is_integer &&
+                    !std::numeric_limits<T>::is_signed,
+                "Only unsigned integral types are allowed.");
+  return detail::PopulationCounter<T, sizeof(T)>::count(Value);
+}
+
+
+inline double Log2(double Value) {
+
+
+
+  return log2(Value);
+
+}
+
+
+
+
+inline unsigned Log2_32(uint32_t Value) {
+  return 31 - countLeadingZeros(Value);
+}
+
+
+
+inline unsigned Log2_64(uint64_t Value) {
+  return 63 - countLeadingZeros(Value);
+}
+
+
+
+
+inline unsigned Log2_32_Ceil(uint32_t Value) {
+  return 32 - countLeadingZeros(Value - 1);
+}
+
+
+
+inline unsigned Log2_64_Ceil(uint64_t Value) {
+  return 64 - countLeadingZeros(Value - 1);
+}
+
+
+inline uint64_t GreatestCommonDivisor64(uint64_t A, uint64_t B) {
+  while (B) {
+    uint64_t T = B;
+    B = A % B;
+    A = T;
+  }
+  return A;
+}
+
+
+inline double BitsToDouble(uint64_t Bits) {
+  double D;
+  static_assert(sizeof(uint64_t) == sizeof(double), "Unexpected type sizes");
+  memcpy(&D, &Bits, sizeof(Bits));
+  return D;
+}
+
+
+inline float BitsToFloat(uint32_t Bits) {
+  float F;
+  static_assert(sizeof(uint32_t) == sizeof(float), "Unexpected type sizes");
+  memcpy(&F, &Bits, sizeof(Bits));
+  return F;
+}
+
+
+
+
+inline uint64_t DoubleToBits(double Double) {
+  uint64_t Bits;
+  static_assert(sizeof(uint64_t) == sizeof(double), "Unexpected type sizes");
+  memcpy(&Bits, &Double, sizeof(Double));
+  return Bits;
+}
+
+
+
+
+inline uint32_t FloatToBits(float Float) {
+  uint32_t Bits;
+  static_assert(sizeof(uint32_t) == sizeof(float), "Unexpected type sizes");
+  memcpy(&Bits, &Float, sizeof(Float));
+  return Bits;
+}
+
+
+
+constexpr inline uint64_t MinAlign(uint64_t A, uint64_t B) {
+
+
+
+
+
+  return (A | B) & (1 + ~(A | B));
+}
+
+
+
+
+
+inline uintptr_t alignAddr(const void *Addr, size_t Alignment) {
+  
+ ((
+ Alignment && isPowerOf2_64((uint64_t)Alignment) && "Alignment is not a power of two!"
+ ) ? static_cast<void> (0) : __assert_fail (
+ "Alignment && isPowerOf2_64((uint64_t)Alignment) && \"Alignment is not a power of two!\""
+ ,
+                                           "/home/trippels/llvm/llvm/include/llvm/Support/MathExtras.h"
+  ,
+                                           617
+  , __PRETTY_FUNCTION__))
+                                            
+                                           ;
+
+  
+ ((
+ (uintptr_t)Addr + Alignment - 1 >= (uintptr_t)Addr
+ ) ? static_cast<void> (0) : __assert_fail (
+ "(uintptr_t)Addr + Alignment - 1 >= (uintptr_t)Addr"
+ , "/home/trippels/llvm/llvm/include/llvm/Support/MathExtras.h", 619, __PRETTY_FUNCTION__))
+                                                           ;
+
+  return (((uintptr_t)Addr + Alignment - 1) & ~(uintptr_t)(Alignment - 1));
+}
+
+
+
+inline size_t alignmentAdjustment(const void *Ptr, size_t Alignment) {
+  return alignAddr(Ptr, Alignment) - (uintptr_t)Ptr;
+}
+
+
+
+inline uint64_t NextPowerOf2(uint64_t A) {
+  A |= (A >> 1);
+  A |= (A >> 2);
+  A |= (A >> 4);
+  A |= (A >> 8);
+  A |= (A >> 16);
+  A |= (A >> 32);
+  return A + 1;
+}
+
+
+
+inline uint64_t PowerOf2Floor(uint64_t A) {
+  if (!A) return 0;
+  return 1ull << (63 - countLeadingZeros(A, ZB_Undefined));
+}
+
+
+
+inline uint64_t PowerOf2Ceil(uint64_t A) {
+  if (!A)
+    return 0;
+  return NextPowerOf2(A - 1);
+}
+inline uint64_t alignTo(uint64_t Value, uint64_t Align, uint64_t Skew = 0) {
+  
+ ((
+ Align != 0u && "Align can't be 0."
+ ) ? static_cast<void> (0) : __assert_fail (
+ "Align != 0u && \"Align can't be 0.\""
+ , "/home/trippels/llvm/llvm/include/llvm/Support/MathExtras.h", 678, __PRETTY_FUNCTION__))
+                                           ;
+  Skew %= Align;
+  return (Value + Align - 1 - Skew) / Align * Align + Skew;
+}
+
+
+
+template <uint64_t Align> constexpr inline uint64_t alignTo(uint64_t Value) {
+  static_assert(Align != 0u, "Align must be non-zero");
+  return (Value + Align - 1) / Align * Align;
+}
+
+
+inline uint64_t divideCeil(uint64_t Numerator, uint64_t Denominator) {
+  return alignTo(Numerator, Denominator) / Denominator;
+}
+
+
+
+
+
+template <uint64_t Align>
+struct AlignTo {
+  static_assert(Align != 0u, "Align must be non-zero");
+  template <uint64_t Value>
+  struct from_value {
+    static const uint64_t value = (Value + Align - 1) / Align * Align;
+  };
+};
+
+
+
+inline uint64_t alignDown(uint64_t Value, uint64_t Align, uint64_t Skew = 0) {
+  
+ ((
+ Align != 0u && "Align can't be 0."
+ ) ? static_cast<void> (0) : __assert_fail (
+ "Align != 0u && \"Align can't be 0.\""
+ , "/home/trippels/llvm/llvm/include/llvm/Support/MathExtras.h", 711, __PRETTY_FUNCTION__))
+                                           ;
+  Skew %= Align;
+  return (Value - Skew) / Align * Align + Skew;
+}
+
+
+
+
+inline uint64_t OffsetToAlignment(uint64_t Value, uint64_t Align) {
+  return alignTo(Value, Align) - Value;
+}
+
+
+
+template <unsigned B> constexpr inline int32_t SignExtend32(uint32_t X) {
+  static_assert(B > 0, "Bit width can't be 0.");
+  static_assert(B <= 32, "Bit width out of range.");
+  return int32_t(X << (32 - B)) >> (32 - B);
+}
+
+
+
+inline int32_t SignExtend32(uint32_t X, unsigned B) {
+  
+ ((
+ B > 0 && "Bit width can't be 0."
+ ) ? static_cast<void> (0) : __assert_fail (
+ "B > 0 && \"Bit width can't be 0.\""
+ , "/home/trippels/llvm/llvm/include/llvm/Support/MathExtras.h", 734, __PRETTY_FUNCTION__))
+                                         ;
+  
+ ((
+ B <= 32 && "Bit width out of range."
+ ) ? static_cast<void> (0) : __assert_fail (
+ "B <= 32 && \"Bit width out of range.\""
+ , "/home/trippels/llvm/llvm/include/llvm/Support/MathExtras.h", 735, __PRETTY_FUNCTION__))
+                                             ;
+  return int32_t(X << (32 - B)) >> (32 - B);
+}
+
+
+
+template <unsigned B> constexpr inline int64_t SignExtend64(uint64_t x) {
+  static_assert(B > 0, "Bit width can't be 0.");
+  static_assert(B <= 64, "Bit width out of range.");
+  return int64_t(x << (64 - B)) >> (64 - B);
+}
+
+
+
+inline int64_t SignExtend64(uint64_t X, unsigned B) {
+  
+ ((
+ B > 0 && "Bit width can't be 0."
+ ) ? static_cast<void> (0) : __assert_fail (
+ "B > 0 && \"Bit width can't be 0.\""
+ , "/home/trippels/llvm/llvm/include/llvm/Support/MathExtras.h", 750, __PRETTY_FUNCTION__))
+                                         ;
+  
+ ((
+ B <= 64 && "Bit width out of range."
+ ) ? static_cast<void> (0) : __assert_fail (
+ "B <= 64 && \"Bit width out of range.\""
+ , "/home/trippels/llvm/llvm/include/llvm/Support/MathExtras.h", 751, __PRETTY_FUNCTION__))
+                                             ;
+  return int64_t(X << (64 - B)) >> (64 - B);
+}
+
+
+
+template <typename T>
+typename std::enable_if<std::is_unsigned<T>::value, T>::type
+AbsoluteDifference(T X, T Y) {
+  return std::max(X, Y) - std::min(X, Y);
+}
+
+
+
+
+template <typename T>
+typename std::enable_if<std::is_unsigned<T>::value, T>::type
+SaturatingAdd(T X, T Y, bool *ResultOverflowed = nullptr) {
+  bool Dummy;
+  bool &Overflowed = ResultOverflowed ? *ResultOverflowed : Dummy;
+
+  T Z = X + Y;
+  Overflowed = (Z < X || Z < Y);
+  if (Overflowed)
+    return std::numeric_limits<T>::max();
+  else
+    return Z;
+}
+
+
+
+
+template <typename T>
+typename std::enable_if<std::is_unsigned<T>::value, T>::type
+SaturatingMultiply(T X, T Y, bool *ResultOverflowed = nullptr) {
+  bool Dummy;
+  bool &Overflowed = ResultOverflowed ? *ResultOverflowed : Dummy;
+
+
+
+
+
+
+  Overflowed = false;
+
+
+
+
+  int Log2Z = Log2_64(X) + Log2_64(Y);
+  const T Max = std::numeric_limits<T>::max();
+  int Log2Max = Log2_64(Max);
+  if (Log2Z < Log2Max) {
+    return X * Y;
+  }
+  if (Log2Z > Log2Max) {
+    Overflowed = true;
+    return Max;
+  }
+
+
+
+
+  T Z = (X >> 1) * Y;
+  if (Z & ~(Max >> 1)) {
+    Overflowed = true;
+    return Max;
+  }
+  Z <<= 1;
+  if (X & 1)
+    return SaturatingAdd(Z, Y, ResultOverflowed);
+
+  return Z;
+}
+
+
+
+
+
+template <typename T>
+typename std::enable_if<std::is_unsigned<T>::value, T>::type
+SaturatingMultiplyAdd(T X, T Y, T A, bool *ResultOverflowed = nullptr) {
+  bool Dummy;
+  bool &Overflowed = ResultOverflowed ? *ResultOverflowed : Dummy;
+
+  T Product = SaturatingMultiply(X, Y, &Overflowed);
+  if (Overflowed)
+    return Product;
+
+  return SaturatingAdd(A, Product, &Overflowed);
+}
+
+
+extern const float huge_valf;
+}
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+       
+
+
+       
+       
+
+
+       
+
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+
+
+
+
+
+  template<class _CharT>
+    struct char_traits;
+
+  template<> struct char_traits<char>;
+
+
+  template<> struct char_traits<wchar_t>;
+
+
+
+
+  template<> struct char_traits<char16_t>;
+  template<> struct char_traits<char32_t>;
+
+
+namespace __cxx11 {
+
+  template<typename _CharT, typename _Traits = char_traits<_CharT>,
+           typename _Alloc = allocator<_CharT> >
+    class basic_string;
+
+
+  typedef basic_string<char> string;
+
+
+
+  typedef basic_string<wchar_t> wstring;
+
+
+
+
+
+  typedef basic_string<char16_t> u16string;
+
+
+  typedef basic_string<char32_t> u32string;
+
+
+}
+
+
+
+
+}
+       
+
+
+       
+
+       
+
+
+
+
+struct _IO_FILE;
+
+
+
+typedef struct _IO_FILE FILE;
+
+
+
+
+
+typedef struct _IO_FILE __FILE;
+
+
+typedef __builtin_va_list __gnuc_va_list;
+typedef unsigned int wint_t;
+typedef struct
+{
+  int __count;
+  union
+  {
+
+    unsigned int __wch;
+
+
+
+    char __wchb[4];
+  } __value;
+} __mbstate_t;
+
+
+typedef __mbstate_t mbstate_t;
+
+
+
+
+
+
+extern "C" {
+
+
+
+
+struct tm;
+
+
+
+
+
+
+
+
+
+extern wchar_t *wcscpy (wchar_t *__restrict __dest,
+   const wchar_t *__restrict __src) throw ();
+
+extern wchar_t *wcsncpy (wchar_t *__restrict __dest,
+    const wchar_t *__restrict __src, size_t __n)
+     throw ();
+
+
+extern wchar_t *wcscat (wchar_t *__restrict __dest,
+   const wchar_t *__restrict __src) throw ();
+
+extern wchar_t *wcsncat (wchar_t *__restrict __dest,
+    const wchar_t *__restrict __src, size_t __n)
+     throw ();
+
+
+extern int wcscmp (const wchar_t *__s1, const wchar_t *__s2)
+     throw () __attribute__ ((__pure__));
+
+extern int wcsncmp (const wchar_t *__s1, const wchar_t *__s2, size_t __n)
+     throw () __attribute__ ((__pure__));
+
+
+
+
+extern int wcscasecmp (const wchar_t *__s1, const wchar_t *__s2) throw ();
+
+
+extern int wcsncasecmp (const wchar_t *__s1, const wchar_t *__s2,
+   size_t __n) throw ();
+
+
+
+
+
+extern int wcscasecmp_l (const wchar_t *__s1, const wchar_t *__s2,
+    __locale_t __loc) throw ();
+
+extern int wcsncasecmp_l (const wchar_t *__s1, const wchar_t *__s2,
+     size_t __n, __locale_t __loc) throw ();
+
+
+
+
+
+extern int wcscoll (const wchar_t *__s1, const wchar_t *__s2) throw ();
+
+
+
+extern size_t wcsxfrm (wchar_t *__restrict __s1,
+         const wchar_t *__restrict __s2, size_t __n) throw ();
+
+
+
+
+
+
+
+
+extern int wcscoll_l (const wchar_t *__s1, const wchar_t *__s2,
+        __locale_t __loc) throw ();
+
+
+
+
+extern size_t wcsxfrm_l (wchar_t *__s1, const wchar_t *__s2,
+    size_t __n, __locale_t __loc) throw ();
+
+
+extern wchar_t *wcsdup (const wchar_t *__s) throw () __attribute__ ((__malloc__));
+
+
+
+
+
+extern "C++" wchar_t *wcschr (wchar_t *__wcs, wchar_t __wc)
+     throw () __asm ("wcschr") __attribute__ ((__pure__));
+extern "C++" const wchar_t *wcschr (const wchar_t *__wcs, wchar_t __wc)
+     throw () __asm ("wcschr") __attribute__ ((__pure__));
+
+
+
+
+
+
+extern "C++" wchar_t *wcsrchr (wchar_t *__wcs, wchar_t __wc)
+     throw () __asm ("wcsrchr") __attribute__ ((__pure__));
+extern "C++" const wchar_t *wcsrchr (const wchar_t *__wcs, wchar_t __wc)
+     throw () __asm ("wcsrchr") __attribute__ ((__pure__));
+
+
+
+
+
+
+
+
+
+extern wchar_t *wcschrnul (const wchar_t *__s, wchar_t __wc)
+     throw () __attribute__ ((__pure__));
+
+
+
+
+
+extern size_t wcscspn (const wchar_t *__wcs, const wchar_t *__reject)
+     throw () __attribute__ ((__pure__));
+
+
+extern size_t wcsspn (const wchar_t *__wcs, const wchar_t *__accept)
+     throw () __attribute__ ((__pure__));
+
+
+extern "C++" wchar_t *wcspbrk (wchar_t *__wcs, const wchar_t *__accept)
+     throw () __asm ("wcspbrk") __attribute__ ((__pure__));
+extern "C++" const wchar_t *wcspbrk (const wchar_t *__wcs,
+         const wchar_t *__accept)
+     throw () __asm ("wcspbrk") __attribute__ ((__pure__));
+
+
+
+
+
+
+extern "C++" wchar_t *wcsstr (wchar_t *__haystack, const wchar_t *__needle)
+     throw () __asm ("wcsstr") __attribute__ ((__pure__));
+extern "C++" const wchar_t *wcsstr (const wchar_t *__haystack,
+        const wchar_t *__needle)
+     throw () __asm ("wcsstr") __attribute__ ((__pure__));
+
+
+
+
+
+
+extern wchar_t *wcstok (wchar_t *__restrict __s,
+   const wchar_t *__restrict __delim,
+   wchar_t **__restrict __ptr) throw ();
+
+
+extern size_t wcslen (const wchar_t *__s) throw () __attribute__ ((__pure__));
+
+
+
+
+
+extern "C++" wchar_t *wcswcs (wchar_t *__haystack, const wchar_t *__needle)
+     throw () __asm ("wcswcs") __attribute__ ((__pure__));
+extern "C++" const wchar_t *wcswcs (const wchar_t *__haystack,
+        const wchar_t *__needle)
+     throw () __asm ("wcswcs") __attribute__ ((__pure__));
+extern size_t wcsnlen (const wchar_t *__s, size_t __maxlen)
+     throw () __attribute__ ((__pure__));
+
+
+
+
+
+
+extern "C++" wchar_t *wmemchr (wchar_t *__s, wchar_t __c, size_t __n)
+     throw () __asm ("wmemchr") __attribute__ ((__pure__));
+extern "C++" const wchar_t *wmemchr (const wchar_t *__s, wchar_t __c,
+         size_t __n)
+     throw () __asm ("wmemchr") __attribute__ ((__pure__));
+
+
+
+
+
+
+extern int wmemcmp (const wchar_t *__s1, const wchar_t *__s2, size_t __n)
+     throw () __attribute__ ((__pure__));
+
+
+extern wchar_t *wmemcpy (wchar_t *__restrict __s1,
+    const wchar_t *__restrict __s2, size_t __n) throw ();
+
+
+
+extern wchar_t *wmemmove (wchar_t *__s1, const wchar_t *__s2, size_t __n)
+     throw ();
+
+
+extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) throw ();
+
+
+
+
+
+extern wchar_t *wmempcpy (wchar_t *__restrict __s1,
+     const wchar_t *__restrict __s2, size_t __n)
+     throw ();
+
+
+
+
+
+
+extern wint_t btowc (int __c) throw ();
+
+
+
+extern int wctob (wint_t __c) throw ();
+
+
+
+extern int mbsinit (const mbstate_t *__ps) throw () __attribute__ ((__pure__));
+
+
+
+extern size_t mbrtowc (wchar_t *__restrict __pwc,
+         const char *__restrict __s, size_t __n,
+         mbstate_t *__restrict __p) throw ();
+
+
+extern size_t wcrtomb (char *__restrict __s, wchar_t __wc,
+         mbstate_t *__restrict __ps) throw ();
+
+
+extern size_t __mbrlen (const char *__restrict __s, size_t __n,
+   mbstate_t *__restrict __ps) throw ();
+extern size_t mbrlen (const char *__restrict __s, size_t __n,
+        mbstate_t *__restrict __ps) throw ();
+
+
+
+
+
+
+
+
+extern wint_t __btowc_alias (int __c) __asm ("btowc");
+extern __inline __attribute__ ((__gnu_inline__)) wint_t
+__attribute__ ((__leaf__)) btowc (int __c) throw ()
+{ return (__builtin_constant_p (__c) && __c >= '\0' && __c <= '\x7f'
+   ? (wint_t) __c : __btowc_alias (__c)); }
+
+extern int __wctob_alias (wint_t __c) __asm ("wctob");
+extern __inline __attribute__ ((__gnu_inline__)) int
+__attribute__ ((__leaf__)) wctob (wint_t __wc) throw ()
+{ return (__builtin_constant_p (__wc) && __wc >= L'\0' && __wc <= L'\x7f'
+   ? (int) __wc : __wctob_alias (__wc)); }
+
+extern __inline __attribute__ ((__gnu_inline__)) size_t
+__attribute__ ((__leaf__)) mbrlen (const char *__restrict __s, size_t __n, mbstate_t *__restrict __ps) throw ()
+
+{ return (__ps != __null
+   ? mbrtowc (__null, __s, __n, __ps) : __mbrlen (__s, __n, __null)); }
+
+
+
+
+
+extern size_t mbsrtowcs (wchar_t *__restrict __dst,
+    const char **__restrict __src, size_t __len,
+    mbstate_t *__restrict __ps) throw ();
+
+
+
+extern size_t wcsrtombs (char *__restrict __dst,
+    const wchar_t **__restrict __src, size_t __len,
+    mbstate_t *__restrict __ps) throw ();
+
+
+
+
+
+
+extern size_t mbsnrtowcs (wchar_t *__restrict __dst,
+     const char **__restrict __src, size_t __nmc,
+     size_t __len, mbstate_t *__restrict __ps) throw ();
+
+
+
+extern size_t wcsnrtombs (char *__restrict __dst,
+     const wchar_t **__restrict __src,
+     size_t __nwc, size_t __len,
+     mbstate_t *__restrict __ps) throw ();
+
+
+
+
+
+
+extern int wcwidth (wchar_t __c) throw ();
+
+
+
+extern int wcswidth (const wchar_t *__s, size_t __n) throw ();
+
+
+
+
+
+
+extern double wcstod (const wchar_t *__restrict __nptr,
+        wchar_t **__restrict __endptr) throw ();
+
+
+
+
+
+extern float wcstof (const wchar_t *__restrict __nptr,
+       wchar_t **__restrict __endptr) throw ();
+extern long double wcstold (const wchar_t *__restrict __nptr,
+       wchar_t **__restrict __endptr) throw ();
+
+
+
+
+
+
+
+extern long int wcstol (const wchar_t *__restrict __nptr,
+   wchar_t **__restrict __endptr, int __base) throw ();
+
+
+
+extern unsigned long int wcstoul (const wchar_t *__restrict __nptr,
+      wchar_t **__restrict __endptr, int __base)
+     throw ();
+
+
+
+
+
+
+__extension__
+extern long long int wcstoll (const wchar_t *__restrict __nptr,
+         wchar_t **__restrict __endptr, int __base)
+     throw ();
+
+
+
+__extension__
+extern unsigned long long int wcstoull (const wchar_t *__restrict __nptr,
+     wchar_t **__restrict __endptr,
+     int __base) throw ();
+
+
+
+
+
+
+__extension__
+extern long long int wcstoq (const wchar_t *__restrict __nptr,
+        wchar_t **__restrict __endptr, int __base)
+     throw ();
+
+
+
+__extension__
+extern unsigned long long int wcstouq (const wchar_t *__restrict __nptr,
+           wchar_t **__restrict __endptr,
+           int __base) throw ();
+extern long int wcstol_l (const wchar_t *__restrict __nptr,
+     wchar_t **__restrict __endptr, int __base,
+     __locale_t __loc) throw ();
+
+extern unsigned long int wcstoul_l (const wchar_t *__restrict __nptr,
+        wchar_t **__restrict __endptr,
+        int __base, __locale_t __loc) throw ();
+
+__extension__
+extern long long int wcstoll_l (const wchar_t *__restrict __nptr,
+    wchar_t **__restrict __endptr,
+    int __base, __locale_t __loc) throw ();
+
+__extension__
+extern unsigned long long int wcstoull_l (const wchar_t *__restrict __nptr,
+       wchar_t **__restrict __endptr,
+       int __base, __locale_t __loc)
+     throw ();
+
+extern double wcstod_l (const wchar_t *__restrict __nptr,
+   wchar_t **__restrict __endptr, __locale_t __loc)
+     throw ();
+
+extern float wcstof_l (const wchar_t *__restrict __nptr,
+         wchar_t **__restrict __endptr, __locale_t __loc)
+     throw ();
+
+extern long double wcstold_l (const wchar_t *__restrict __nptr,
+         wchar_t **__restrict __endptr,
+         __locale_t __loc) throw ();
+
+
+
+
+
+
+extern wchar_t *wcpcpy (wchar_t *__restrict __dest,
+   const wchar_t *__restrict __src) throw ();
+
+
+
+extern wchar_t *wcpncpy (wchar_t *__restrict __dest,
+    const wchar_t *__restrict __src, size_t __n)
+     throw ();
+
+
+
+
+
+
+extern __FILE *open_wmemstream (wchar_t **__bufloc, size_t *__sizeloc) throw ();
+
+
+
+
+
+
+extern int fwide (__FILE *__fp, int __mode) throw ();
+
+
+
+
+
+
+extern int fwprintf (__FILE *__restrict __stream,
+       const wchar_t *__restrict __format, ...)
+                                                           ;
+
+
+
+
+extern int wprintf (const wchar_t *__restrict __format, ...)
+                                                           ;
+
+extern int swprintf (wchar_t *__restrict __s, size_t __n,
+       const wchar_t *__restrict __format, ...)
+     throw () ;
+
+
+
+
+
+extern int vfwprintf (__FILE *__restrict __s,
+        const wchar_t *__restrict __format,
+        __gnuc_va_list __arg)
+                                                           ;
+
+
+
+
+extern int vwprintf (const wchar_t *__restrict __format,
+       __gnuc_va_list __arg)
+                                                           ;
+
+
+extern int vswprintf (wchar_t *__restrict __s, size_t __n,
+        const wchar_t *__restrict __format,
+        __gnuc_va_list __arg)
+     throw () ;
+
+
+
+
+
+
+extern int fwscanf (__FILE *__restrict __stream,
+      const wchar_t *__restrict __format, ...)
+                                                          ;
+
+
+
+
+extern int wscanf (const wchar_t *__restrict __format, ...)
+                                                          ;
+
+extern int swscanf (const wchar_t *__restrict __s,
+      const wchar_t *__restrict __format, ...)
+     throw () ;
+
+
+
+
+
+
+
+
+
+extern int vfwscanf (__FILE *__restrict __s,
+       const wchar_t *__restrict __format,
+       __gnuc_va_list __arg)
+                                                          ;
+
+
+
+
+extern int vwscanf (const wchar_t *__restrict __format,
+      __gnuc_va_list __arg)
+                                                          ;
+
+extern int vswscanf (const wchar_t *__restrict __s,
+       const wchar_t *__restrict __format,
+       __gnuc_va_list __arg)
+     throw () ;
+
+
+
+
+
+
+
+
+
+extern wint_t fgetwc (__FILE *__stream);
+extern wint_t getwc (__FILE *__stream);
+
+
+
+
+
+extern wint_t getwchar (void);
+
+
+
+
+
+
+extern wint_t fputwc (wchar_t __wc, __FILE *__stream);
+extern wint_t putwc (wchar_t __wc, __FILE *__stream);
+
+
+
+
+
+extern wint_t putwchar (wchar_t __wc);
+
+
+
+
+
+
+
+extern wchar_t *fgetws (wchar_t *__restrict __ws, int __n,
+   __FILE *__restrict __stream);
+
+
+
+
+
+extern int fputws (const wchar_t *__restrict __ws,
+     __FILE *__restrict __stream);
+
+
+
+
+
+
+extern wint_t ungetwc (wint_t __wc, __FILE *__stream);
+
+extern wint_t getwc_unlocked (__FILE *__stream);
+extern wint_t getwchar_unlocked (void);
+
+
+
+
+
+
+
+extern wint_t fgetwc_unlocked (__FILE *__stream);
+
+
+
+
+
+
+
+extern wint_t fputwc_unlocked (wchar_t __wc, __FILE *__stream);
+extern wint_t putwc_unlocked (wchar_t __wc, __FILE *__stream);
+extern wint_t putwchar_unlocked (wchar_t __wc);
+extern wchar_t *fgetws_unlocked (wchar_t *__restrict __ws, int __n,
+     __FILE *__restrict __stream);
+
+
+
+
+
+
+
+extern int fputws_unlocked (const wchar_t *__restrict __ws,
+       __FILE *__restrict __stream);
+
+
+
+
+
+
+
+extern size_t wcsftime (wchar_t *__restrict __s, size_t __maxsize,
+   const wchar_t *__restrict __format,
+   const struct tm *__restrict __tp) throw ();
+
+
+
+
+
+
+
+extern size_t wcsftime_l (wchar_t *__restrict __s, size_t __maxsize,
+     const wchar_t *__restrict __format,
+     const struct tm *__restrict __tp,
+     __locale_t __loc) throw ();
+}
+namespace std
+{
+  using ::mbstate_t;
+}
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+  using ::wint_t;
+
+  using ::btowc;
+  using ::fgetwc;
+  using ::fgetws;
+  using ::fputwc;
+  using ::fputws;
+  using ::fwide;
+  using ::fwprintf;
+  using ::fwscanf;
+  using ::getwc;
+  using ::getwchar;
+  using ::mbrlen;
+  using ::mbrtowc;
+  using ::mbsinit;
+  using ::mbsrtowcs;
+  using ::putwc;
+  using ::putwchar;
+
+  using ::swprintf;
+
+  using ::swscanf;
+  using ::ungetwc;
+  using ::vfwprintf;
+
+  using ::vfwscanf;
+
+
+  using ::vswprintf;
+
+
+  using ::vswscanf;
+
+  using ::vwprintf;
+
+  using ::vwscanf;
+
+  using ::wcrtomb;
+  using ::wcscat;
+  using ::wcscmp;
+  using ::wcscoll;
+  using ::wcscpy;
+  using ::wcscspn;
+  using ::wcsftime;
+  using ::wcslen;
+  using ::wcsncat;
+  using ::wcsncmp;
+  using ::wcsncpy;
+  using ::wcsrtombs;
+  using ::wcsspn;
+  using ::wcstod;
+
+  using ::wcstof;
+
+  using ::wcstok;
+  using ::wcstol;
+  using ::wcstoul;
+  using ::wcsxfrm;
+  using ::wctob;
+  using ::wmemcmp;
+  using ::wmemcpy;
+  using ::wmemmove;
+  using ::wmemset;
+  using ::wprintf;
+  using ::wscanf;
+  using ::wcschr;
+  using ::wcspbrk;
+  using ::wcsrchr;
+  using ::wcsstr;
+  using ::wmemchr;
+
+}
+
+
+
+
+
+
+
+namespace __gnu_cxx
+{
+
+
+
+
+
+  using ::wcstold;
+  using ::wcstoll;
+  using ::wcstoull;
+
+}
+
+namespace std
+{
+  using ::__gnu_cxx::wcstold;
+  using ::__gnu_cxx::wcstoll;
+  using ::__gnu_cxx::wcstoull;
+}
+namespace std
+{
+
+  using std::wcstof;
+
+
+  using std::vfwscanf;
+
+
+  using std::vswscanf;
+
+
+  using std::vwscanf;
+
+
+
+  using std::wcstold;
+  using std::wcstoll;
+  using std::wcstoull;
+
+}
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+  typedef long streamoff;
+  typedef ptrdiff_t streamsize;
+  template<typename _StateT>
+    class fpos
+    {
+    private:
+      streamoff _M_off;
+      _StateT _M_state;
+
+    public:
+
+
+
+
+      fpos()
+      : _M_off(0), _M_state() { }
+      fpos(streamoff __off)
+      : _M_off(__off), _M_state() { }
+
+
+      operator streamoff() const { return _M_off; }
+
+
+      void
+      state(_StateT __st)
+      { _M_state = __st; }
+
+
+      _StateT
+      state() const
+      { return _M_state; }
+
+
+
+
+
+      fpos&
+      operator+=(streamoff __off)
+      {
+ _M_off += __off;
+ return *this;
+      }
+
+
+
+
+
+      fpos&
+      operator-=(streamoff __off)
+      {
+ _M_off -= __off;
+ return *this;
+      }
+
+
+
+
+
+
+
+      fpos
+      operator+(streamoff __off) const
+      {
+ fpos __pos(*this);
+ __pos += __off;
+ return __pos;
+      }
+
+
+
+
+
+
+
+      fpos
+      operator-(streamoff __off) const
+      {
+ fpos __pos(*this);
+ __pos -= __off;
+ return __pos;
+      }
+
+
+
+
+
+
+      streamoff
+      operator-(const fpos& __other) const
+      { return _M_off - __other._M_off; }
+    };
+
+
+
+
+
+
+  template<typename _StateT>
+    inline bool
+    operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
+    { return streamoff(__lhs) == streamoff(__rhs); }
+
+  template<typename _StateT>
+    inline bool
+    operator!=(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
+    { return streamoff(__lhs) != streamoff(__rhs); }
+
+
+
+
+
+  typedef fpos<mbstate_t> streampos;
+
+  typedef fpos<mbstate_t> wstreampos;
+
+
+
+  typedef fpos<mbstate_t> u16streampos;
+
+  typedef fpos<mbstate_t> u32streampos;
+
+
+
+}
+       
+
+
+
+
+
+
+
+
+
+namespace __gnu_cxx __attribute__ ((__visibility__ ("default")))
+{
+
+  template<typename _CharT>
+    struct _Char_types
+    {
+      typedef unsigned long int_type;
+      typedef std::streampos pos_type;
+      typedef std::streamoff off_type;
+      typedef std::mbstate_t state_type;
+    };
+  template<typename _CharT>
+    struct char_traits
+    {
+      typedef _CharT char_type;
+      typedef typename _Char_types<_CharT>::int_type int_type;
+      typedef typename _Char_types<_CharT>::pos_type pos_type;
+      typedef typename _Char_types<_CharT>::off_type off_type;
+      typedef typename _Char_types<_CharT>::state_type state_type;
+
+      static void
+      assign(char_type& __c1, const char_type& __c2)
+      { __c1 = __c2; }
+
+      static constexpr bool
+      eq(const char_type& __c1, const char_type& __c2)
+      { return __c1 == __c2; }
+
+      static constexpr bool
+      lt(const char_type& __c1, const char_type& __c2)
+      { return __c1 < __c2; }
+
+      static int
+      compare(const char_type* __s1, const char_type* __s2, std::size_t __n);
+
+      static std::size_t
+      length(const char_type* __s);
+
+      static const char_type*
+      find(const char_type* __s, std::size_t __n, const char_type& __a);
+
+      static char_type*
+      move(char_type* __s1, const char_type* __s2, std::size_t __n);
+
+      static char_type*
+      copy(char_type* __s1, const char_type* __s2, std::size_t __n);
+
+      static char_type*
+      assign(char_type* __s, std::size_t __n, char_type __a);
+
+      static constexpr char_type
+      to_char_type(const int_type& __c)
+      { return static_cast<char_type>(__c); }
+
+      static constexpr int_type
+      to_int_type(const char_type& __c)
+      { return static_cast<int_type>(__c); }
+
+      static constexpr bool
+      eq_int_type(const int_type& __c1, const int_type& __c2)
+      { return __c1 == __c2; }
+
+      static constexpr int_type
+      eof()
+      { return static_cast<int_type>(-1); }
+
+      static constexpr int_type
+      not_eof(const int_type& __c)
+      { return !eq_int_type(__c, eof()) ? __c : to_int_type(char_type()); }
+    };
+
+
+
+  template<typename _CharT>
+    int
+    char_traits<_CharT>::
+    compare(const char_type* __s1, const char_type* __s2, std::size_t __n)
+    {
+      for (std::size_t __i = 0; __i < __n; ++__i)
+ if (lt(__s1[__i], __s2[__i]))
+   return -1;
+ else if (lt(__s2[__i], __s1[__i]))
+   return 1;
+      return 0;
+    }
+
+  template<typename _CharT>
+    std::size_t
+    char_traits<_CharT>::
+    length(const char_type* __p)
+    {
+      std::size_t __i = 0;
+      while (!eq(__p[__i], char_type()))
+        ++__i;
+      return __i;
+    }
+
+  template<typename _CharT>
+    const typename char_traits<_CharT>::char_type*
+    char_traits<_CharT>::
+    find(const char_type* __s, std::size_t __n, const char_type& __a)
+    {
+      for (std::size_t __i = 0; __i < __n; ++__i)
+        if (eq(__s[__i], __a))
+          return __s + __i;
+      return 0;
+    }
+
+  template<typename _CharT>
+    typename char_traits<_CharT>::char_type*
+    char_traits<_CharT>::
+    move(char_type* __s1, const char_type* __s2, std::size_t __n)
+    {
+      return static_cast<_CharT*>(__builtin_memmove(__s1, __s2,
+          __n * sizeof(char_type)));
+    }
+
+  template<typename _CharT>
+    typename char_traits<_CharT>::char_type*
+    char_traits<_CharT>::
+    copy(char_type* __s1, const char_type* __s2, std::size_t __n)
+    {
+
+      std::copy(__s2, __s2 + __n, __s1);
+      return __s1;
+    }
+
+  template<typename _CharT>
+    typename char_traits<_CharT>::char_type*
+    char_traits<_CharT>::
+    assign(char_type* __s, std::size_t __n, char_type __a)
+    {
+
+      std::fill_n(__s, __n, __a);
+      return __s;
+    }
+
+
+}
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+  template<class _CharT>
+    struct char_traits : public __gnu_cxx::char_traits<_CharT>
+    { };
+
+
+
+  template<>
+    struct char_traits<char>
+    {
+      typedef char char_type;
+      typedef int int_type;
+      typedef streampos pos_type;
+      typedef streamoff off_type;
+      typedef mbstate_t state_type;
+
+      static void
+      assign(char_type& __c1, const char_type& __c2) noexcept
+      { __c1 = __c2; }
+
+      static constexpr bool
+      eq(const char_type& __c1, const char_type& __c2) noexcept
+      { return __c1 == __c2; }
+
+      static constexpr bool
+      lt(const char_type& __c1, const char_type& __c2) noexcept
+      {
+
+ return (static_cast<unsigned char>(__c1)
+  < static_cast<unsigned char>(__c2));
+      }
+
+      static int
+      compare(const char_type* __s1, const char_type* __s2, size_t __n)
+      {
+
+
+
+
+
+
+ if (__n == 0)
+   return 0;
+ return __builtin_memcmp(__s1, __s2, __n);
+      }
+
+      static size_t
+      length(const char_type* __s)
+      {
+
+
+
+
+ return __builtin_strlen(__s);
+      }
+
+      static const char_type*
+      find(const char_type* __s, size_t __n, const char_type& __a)
+      {
+
+
+
+
+
+
+ if (__n == 0)
+   return 0;
+ return static_cast<const char_type*>(__builtin_memchr(__s, __a, __n));
+      }
+
+      static char_type*
+      move(char_type* __s1, const char_type* __s2, size_t __n)
+      {
+ if (__n == 0)
+   return __s1;
+ return static_cast<char_type*>(__builtin_memmove(__s1, __s2, __n));
+      }
+
+      static char_type*
+      copy(char_type* __s1, const char_type* __s2, size_t __n)
+      {
+ if (__n == 0)
+   return __s1;
+ return static_cast<char_type*>(__builtin_memcpy(__s1, __s2, __n));
+      }
+
+      static char_type*
+      assign(char_type* __s, size_t __n, char_type __a)
+      {
+ if (__n == 0)
+   return __s;
+ return static_cast<char_type*>(__builtin_memset(__s, __a, __n));
+      }
+
+      static constexpr char_type
+      to_char_type(const int_type& __c) noexcept
+      { return static_cast<char_type>(__c); }
+
+
+
+      static constexpr int_type
+      to_int_type(const char_type& __c) noexcept
+      { return static_cast<int_type>(static_cast<unsigned char>(__c)); }
+
+      static constexpr bool
+      eq_int_type(const int_type& __c1, const int_type& __c2) noexcept
+      { return __c1 == __c2; }
+
+      static constexpr int_type
+      eof() noexcept
+      { return static_cast<int_type>(-1); }
+
+      static constexpr int_type
+      not_eof(const int_type& __c) noexcept
+      { return (__c == eof()) ? 0 : __c; }
+  };
+
+
+
+
+  template<>
+    struct char_traits<wchar_t>
+    {
+      typedef wchar_t char_type;
+      typedef wint_t int_type;
+      typedef streamoff off_type;
+      typedef wstreampos pos_type;
+      typedef mbstate_t state_type;
+
+      static void
+      assign(char_type& __c1, const char_type& __c2) noexcept
+      { __c1 = __c2; }
+
+      static constexpr bool
+      eq(const char_type& __c1, const char_type& __c2) noexcept
+      { return __c1 == __c2; }
+
+      static constexpr bool
+      lt(const char_type& __c1, const char_type& __c2) noexcept
+      { return __c1 < __c2; }
+
+      static int
+      compare(const char_type* __s1, const char_type* __s2, size_t __n)
+      {
+
+
+
+
+
+
+ if (__n == 0)
+   return 0;
+ else
+   return wmemcmp(__s1, __s2, __n);
+      }
+
+      static size_t
+      length(const char_type* __s)
+      {
+
+
+
+
+
+   return wcslen(__s);
+      }
+
+      static const char_type*
+      find(const char_type* __s, size_t __n, const char_type& __a)
+      {
+
+
+
+
+
+
+ if (__n == 0)
+   return 0;
+ else
+   return wmemchr(__s, __a, __n);
+      }
+
+      static char_type*
+      move(char_type* __s1, const char_type* __s2, size_t __n)
+      {
+ if (__n == 0)
+   return __s1;
+ return wmemmove(__s1, __s2, __n);
+      }
+
+      static char_type*
+      copy(char_type* __s1, const char_type* __s2, size_t __n)
+      {
+ if (__n == 0)
+   return __s1;
+ return wmemcpy(__s1, __s2, __n);
+      }
+
+      static char_type*
+      assign(char_type* __s, size_t __n, char_type __a)
+      {
+ if (__n == 0)
+   return __s;
+ return wmemset(__s, __a, __n);
+      }
+
+      static constexpr char_type
+      to_char_type(const int_type& __c) noexcept
+      { return char_type(__c); }
+
+      static constexpr int_type
+      to_int_type(const char_type& __c) noexcept
+      { return int_type(__c); }
+
+      static constexpr bool
+      eq_int_type(const int_type& __c1, const int_type& __c2) noexcept
+      { return __c1 == __c2; }
+
+      static constexpr int_type
+      eof() noexcept
+      { return static_cast<int_type>((0xffffffffu)); }
+
+      static constexpr int_type
+      not_eof(const int_type& __c) noexcept
+      { return eq_int_type(__c, eof()) ? 0 : __c; }
+  };
+
+
+
+}
+
+
+
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+  template<>
+    struct char_traits<char16_t>
+    {
+      typedef char16_t char_type;
+      typedef uint_least16_t int_type;
+      typedef streamoff off_type;
+      typedef u16streampos pos_type;
+      typedef mbstate_t state_type;
+
+      static void
+      assign(char_type& __c1, const char_type& __c2) noexcept
+      { __c1 = __c2; }
+
+      static constexpr bool
+      eq(const char_type& __c1, const char_type& __c2) noexcept
+      { return __c1 == __c2; }
+
+      static constexpr bool
+      lt(const char_type& __c1, const char_type& __c2) noexcept
+      { return __c1 < __c2; }
+
+      static int
+      compare(const char_type* __s1, const char_type* __s2, size_t __n)
+      {
+ for (size_t __i = 0; __i < __n; ++__i)
+   if (lt(__s1[__i], __s2[__i]))
+     return -1;
+   else if (lt(__s2[__i], __s1[__i]))
+     return 1;
+ return 0;
+      }
+
+      static size_t
+      length(const char_type* __s)
+      {
+ size_t __i = 0;
+ while (!eq(__s[__i], char_type()))
+   ++__i;
+ return __i;
+      }
+
+      static const char_type*
+      find(const char_type* __s, size_t __n, const char_type& __a)
+      {
+ for (size_t __i = 0; __i < __n; ++__i)
+   if (eq(__s[__i], __a))
+     return __s + __i;
+ return 0;
+      }
+
+      static char_type*
+      move(char_type* __s1, const char_type* __s2, size_t __n)
+      {
+ if (__n == 0)
+   return __s1;
+ return (static_cast<char_type*>
+  (__builtin_memmove(__s1, __s2, __n * sizeof(char_type))));
+      }
+
+      static char_type*
+      copy(char_type* __s1, const char_type* __s2, size_t __n)
+      {
+ if (__n == 0)
+   return __s1;
+ return (static_cast<char_type*>
+  (__builtin_memcpy(__s1, __s2, __n * sizeof(char_type))));
+      }
+
+      static char_type*
+      assign(char_type* __s, size_t __n, char_type __a)
+      {
+ for (size_t __i = 0; __i < __n; ++__i)
+   assign(__s[__i], __a);
+ return __s;
+      }
+
+      static constexpr char_type
+      to_char_type(const int_type& __c) noexcept
+      { return char_type(__c); }
+
+      static constexpr int_type
+      to_int_type(const char_type& __c) noexcept
+      { return __c == eof() ? int_type(0xfffd) : int_type(__c); }
+
+      static constexpr bool
+      eq_int_type(const int_type& __c1, const int_type& __c2) noexcept
+      { return __c1 == __c2; }
+
+      static constexpr int_type
+      eof() noexcept
+      { return static_cast<int_type>(-1); }
+
+      static constexpr int_type
+      not_eof(const int_type& __c) noexcept
+      { return eq_int_type(__c, eof()) ? 0 : __c; }
+    };
+
+  template<>
+    struct char_traits<char32_t>
+    {
+      typedef char32_t char_type;
+      typedef uint_least32_t int_type;
+      typedef streamoff off_type;
+      typedef u32streampos pos_type;
+      typedef mbstate_t state_type;
+
+      static void
+      assign(char_type& __c1, const char_type& __c2) noexcept
+      { __c1 = __c2; }
+
+      static constexpr bool
+      eq(const char_type& __c1, const char_type& __c2) noexcept
+      { return __c1 == __c2; }
+
+      static constexpr bool
+      lt(const char_type& __c1, const char_type& __c2) noexcept
+      { return __c1 < __c2; }
+
+      static int
+      compare(const char_type* __s1, const char_type* __s2, size_t __n)
+      {
+ for (size_t __i = 0; __i < __n; ++__i)
+   if (lt(__s1[__i], __s2[__i]))
+     return -1;
+   else if (lt(__s2[__i], __s1[__i]))
+     return 1;
+ return 0;
+      }
+
+      static size_t
+      length(const char_type* __s)
+      {
+ size_t __i = 0;
+ while (!eq(__s[__i], char_type()))
+   ++__i;
+ return __i;
+      }
+
+      static const char_type*
+      find(const char_type* __s, size_t __n, const char_type& __a)
+      {
+ for (size_t __i = 0; __i < __n; ++__i)
+   if (eq(__s[__i], __a))
+     return __s + __i;
+ return 0;
+      }
+
+      static char_type*
+      move(char_type* __s1, const char_type* __s2, size_t __n)
+      {
+ if (__n == 0)
+   return __s1;
+ return (static_cast<char_type*>
+  (__builtin_memmove(__s1, __s2, __n * sizeof(char_type))));
+      }
+
+      static char_type*
+      copy(char_type* __s1, const char_type* __s2, size_t __n)
+      {
+ if (__n == 0)
+   return __s1;
+ return (static_cast<char_type*>
+  (__builtin_memcpy(__s1, __s2, __n * sizeof(char_type))));
+      }
+
+      static char_type*
+      assign(char_type* __s, size_t __n, char_type __a)
+      {
+ for (size_t __i = 0; __i < __n; ++__i)
+   assign(__s[__i], __a);
+ return __s;
+      }
+
+      static constexpr char_type
+      to_char_type(const int_type& __c) noexcept
+      { return char_type(__c); }
+
+      static constexpr int_type
+      to_int_type(const char_type& __c) noexcept
+      { return int_type(__c); }
+
+      static constexpr bool
+      eq_int_type(const int_type& __c1, const int_type& __c2) noexcept
+      { return __c1 == __c2; }
+
+      static constexpr int_type
+      eof() noexcept
+      { return static_cast<int_type>(-1); }
+
+      static constexpr int_type
+      not_eof(const int_type& __c) noexcept
+      { return eq_int_type(__c, eof()) ? 0 : __c; }
+    };
+
+
+}
+namespace __gnu_cxx __attribute__ ((__visibility__ ("default")))
+{
+
+
+  using std::size_t;
+  using std::ptrdiff_t;
+  template<typename _Tp>
+    class new_allocator
+    {
+    public:
+      typedef size_t size_type;
+      typedef ptrdiff_t difference_type;
+      typedef _Tp* pointer;
+      typedef const _Tp* const_pointer;
+      typedef _Tp& reference;
+      typedef const _Tp& const_reference;
+      typedef _Tp value_type;
+
+      template<typename _Tp1>
+ struct rebind
+ { typedef new_allocator<_Tp1> other; };
+
+
+
+
+      typedef std::true_type propagate_on_container_move_assignment;
+
+
+      new_allocator() noexcept { }
+
+      new_allocator(const new_allocator&) noexcept { }
+
+      template<typename _Tp1>
+ new_allocator(const new_allocator<_Tp1>&) noexcept { }
+
+      ~new_allocator() noexcept { }
+
+      pointer
+      address(reference __x) const noexcept
+      { return std::__addressof(__x); }
+
+      const_pointer
+      address(const_reference __x) const noexcept
+      { return std::__addressof(__x); }
+
+
+
+      pointer
+      allocate(size_type __n, const void* = static_cast<const void*>(0))
+      {
+ if (__n > this->max_size())
+   std::__throw_bad_alloc();
+ return static_cast<_Tp*>(::operator new(__n * sizeof(_Tp)));
+      }
+
+
+      void
+      deallocate(pointer __p, size_type)
+      {
+
+
+
+
+
+
+
+ ::operator delete(__p);
+      }
+
+      size_type
+      max_size() const noexcept
+      { return size_t(-1) / sizeof(_Tp); }
+
+
+      template<typename _Up, typename... _Args>
+ void
+ construct(_Up* __p, _Args&&... __args)
+ { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
+
+      template<typename _Up>
+ void
+ destroy(_Up* __p) { __p->~_Up(); }
+    };
+
+  template<typename _Tp>
+    inline bool
+    operator==(const new_allocator<_Tp>&, const new_allocator<_Tp>&)
+    { return true; }
+
+  template<typename _Tp>
+    inline bool
+    operator!=(const new_allocator<_Tp>&, const new_allocator<_Tp>&)
+    { return false; }
+
+
+}
+
+
+namespace std
+{
+  template<typename _Tp>
+    using __allocator_base = __gnu_cxx::new_allocator<_Tp>;
+}
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+
+
+
+
+
+  template<>
+    class allocator<void>
+    {
+    public:
+      typedef size_t size_type;
+      typedef ptrdiff_t difference_type;
+      typedef void* pointer;
+      typedef const void* const_pointer;
+      typedef void value_type;
+
+      template<typename _Tp1>
+ struct rebind
+ { typedef allocator<_Tp1> other; };
+
+
+
+
+      typedef true_type propagate_on_container_move_assignment;
+
+      typedef true_type is_always_equal;
+
+      template<typename _Up, typename... _Args>
+ void
+ construct(_Up* __p, _Args&&... __args)
+ { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
+
+      template<typename _Up>
+ void
+ destroy(_Up* __p) { __p->~_Up(); }
+
+    };
+  template<typename _Tp>
+    class allocator : public __allocator_base<_Tp>
+    {
+   public:
+      typedef size_t size_type;
+      typedef ptrdiff_t difference_type;
+      typedef _Tp* pointer;
+      typedef const _Tp* const_pointer;
+      typedef _Tp& reference;
+      typedef const _Tp& const_reference;
+      typedef _Tp value_type;
+
+      template<typename _Tp1>
+ struct rebind
+ { typedef allocator<_Tp1> other; };
+
+
+
+
+      typedef true_type propagate_on_container_move_assignment;
+
+      typedef true_type is_always_equal;
+
+
+      allocator() throw() { }
+
+      allocator(const allocator& __a) throw()
+      : __allocator_base<_Tp>(__a) { }
+
+      template<typename _Tp1>
+ allocator(const allocator<_Tp1>&) throw() { }
+
+      ~allocator() throw() { }
+
+
+    };
+
+  template<typename _T1, typename _T2>
+    inline bool
+    operator==(const allocator<_T1>&, const allocator<_T2>&)
+    noexcept
+    { return true; }
+
+  template<typename _Tp>
+    inline bool
+    operator==(const allocator<_Tp>&, const allocator<_Tp>&)
+    noexcept
+    { return true; }
+
+  template<typename _T1, typename _T2>
+    inline bool
+    operator!=(const allocator<_T1>&, const allocator<_T2>&)
+    noexcept
+    { return false; }
+
+  template<typename _Tp>
+    inline bool
+    operator!=(const allocator<_Tp>&, const allocator<_Tp>&)
+    noexcept
+    { return false; }
+
+
+
+  template<typename _Tp>
+    class allocator<const _Tp>
+    {
+    public:
+      typedef _Tp value_type;
+      template<typename _Up> allocator(const allocator<_Up>&) { }
+    };
+
+  template<typename _Tp>
+    class allocator<volatile _Tp>
+    {
+    public:
+      typedef _Tp value_type;
+      template<typename _Up> allocator(const allocator<_Up>&) { }
+    };
+
+  template<typename _Tp>
+    class allocator<const volatile _Tp>
+    {
+    public:
+      typedef _Tp value_type;
+      template<typename _Up> allocator(const allocator<_Up>&) { }
+    };
+
+
+
+
+
+
+  extern template class allocator<char>;
+  extern template class allocator<wchar_t>;
+
+
+
+
+
+
+  template<typename _Alloc, bool = __is_empty(_Alloc)>
+    struct __alloc_swap
+    { static void _S_do_it(_Alloc&, _Alloc&) noexcept { } };
+
+  template<typename _Alloc>
+    struct __alloc_swap<_Alloc, false>
+    {
+      static void
+      _S_do_it(_Alloc& __one, _Alloc& __two) noexcept
+      {
+
+ if (__one != __two)
+   swap(__one, __two);
+      }
+    };
+
+
+  template<typename _Alloc, bool = __is_empty(_Alloc)>
+    struct __alloc_neq
+    {
+      static bool
+      _S_do_it(const _Alloc&, const _Alloc&)
+      { return false; }
+    };
+
+  template<typename _Alloc>
+    struct __alloc_neq<_Alloc, false>
+    {
+      static bool
+      _S_do_it(const _Alloc& __one, const _Alloc& __two)
+      { return __one != __two; }
+    };
+
+
+  template<typename _Tp, bool
+    = __or_<is_copy_constructible<typename _Tp::value_type>,
+            is_nothrow_move_constructible<typename _Tp::value_type>>::value>
+    struct __shrink_to_fit_aux
+    { static bool _S_do_it(_Tp&) noexcept { return false; } };
+
+  template<typename _Tp>
+    struct __shrink_to_fit_aux<_Tp, true>
+    {
+      static bool
+      _S_do_it(_Tp& __c) noexcept
+      {
+ return false;
+
+      }
+    };
+
+
+
+}
+
+       
+
+
+       
+
+       
+
+
+
+extern "C" {
+
+
+
+struct lconv
+{
+
+
+  char *decimal_point;
+  char *thousands_sep;
+
+
+
+
+
+  char *grouping;
+
+
+
+
+
+  char *int_curr_symbol;
+  char *currency_symbol;
+  char *mon_decimal_point;
+  char *mon_thousands_sep;
+  char *mon_grouping;
+  char *positive_sign;
+  char *negative_sign;
+  char int_frac_digits;
+  char frac_digits;
+
+  char p_cs_precedes;
+
+  char p_sep_by_space;
+
+  char n_cs_precedes;
+
+  char n_sep_by_space;
+
+
+
+
+
+
+  char p_sign_posn;
+  char n_sign_posn;
+
+
+  char int_p_cs_precedes;
+
+  char int_p_sep_by_space;
+
+  char int_n_cs_precedes;
+
+  char int_n_sep_by_space;
+
+
+
+
+
+
+  char int_p_sign_posn;
+  char int_n_sign_posn;
+};
+
+
+
+extern char *setlocale (int __category, const char *__locale) throw ();
+
+
+extern struct lconv *localeconv (void) throw ();
+
+
+extern __locale_t newlocale (int __category_mask, const char *__locale,
+        __locale_t __base) throw ();
+extern __locale_t duplocale (__locale_t __dataset) throw ();
+
+
+
+extern void freelocale (__locale_t __dataset) throw ();
+
+
+
+
+
+
+extern __locale_t uselocale (__locale_t __dataset) throw ();
+
+
+
+
+
+
+
+}
+namespace std
+{
+  using ::lconv;
+  using ::setlocale;
+  using ::localeconv;
+}
+
+
+
+
+
+
+namespace __gnu_cxx __attribute__ ((__visibility__ ("default")))
+{
+
+
+  extern "C" __typeof(uselocale) __uselocale;
+
+
+}
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+  typedef __locale_t __c_locale;
+
+
+
+
+
+  inline int
+  __convert_from_v(const __c_locale& __cloc __attribute__ ((__unused__)),
+     char* __out,
+     const int __size __attribute__ ((__unused__)),
+     const char* __fmt, ...)
+  {
+
+    __c_locale __old = __gnu_cxx::__uselocale(__cloc);
+    __builtin_va_list __args;
+    __builtin_va_start(__args, __fmt);
+
+
+    const int __ret = __builtin_vsnprintf(__out, __size, __fmt, __args);
+
+
+
+
+    __builtin_va_end(__args);
+
+
+    __gnu_cxx::__uselocale(__old);
+
+
+
+
+
+
+
+    return __ret;
+  }
+
+
+}
+       
+
+
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+  class ios_base;
+
+  template<typename _CharT, typename _Traits = char_traits<_CharT> >
+    class basic_ios;
+
+  template<typename _CharT, typename _Traits = char_traits<_CharT> >
+    class basic_streambuf;
+
+  template<typename _CharT, typename _Traits = char_traits<_CharT> >
+    class basic_istream;
+
+  template<typename _CharT, typename _Traits = char_traits<_CharT> >
+    class basic_ostream;
+
+  template<typename _CharT, typename _Traits = char_traits<_CharT> >
+    class basic_iostream;
+
+
+namespace __cxx11 {
+
+  template<typename _CharT, typename _Traits = char_traits<_CharT>,
+     typename _Alloc = allocator<_CharT> >
+    class basic_stringbuf;
+
+  template<typename _CharT, typename _Traits = char_traits<_CharT>,
+    typename _Alloc = allocator<_CharT> >
+    class basic_istringstream;
+
+  template<typename _CharT, typename _Traits = char_traits<_CharT>,
+    typename _Alloc = allocator<_CharT> >
+    class basic_ostringstream;
+
+  template<typename _CharT, typename _Traits = char_traits<_CharT>,
+    typename _Alloc = allocator<_CharT> >
+    class basic_stringstream;
+
+}
+
+  template<typename _CharT, typename _Traits = char_traits<_CharT> >
+    class basic_filebuf;
+
+  template<typename _CharT, typename _Traits = char_traits<_CharT> >
+    class basic_ifstream;
+
+  template<typename _CharT, typename _Traits = char_traits<_CharT> >
+    class basic_ofstream;
+
+  template<typename _CharT, typename _Traits = char_traits<_CharT> >
+    class basic_fstream;
+
+  template<typename _CharT, typename _Traits = char_traits<_CharT> >
+    class istreambuf_iterator;
+
+  template<typename _CharT, typename _Traits = char_traits<_CharT> >
+    class ostreambuf_iterator;
+
+
+
+  typedef basic_ios<char> ios;
+
+
+  typedef basic_streambuf<char> streambuf;
+
+
+  typedef basic_istream<char> istream;
+
+
+  typedef basic_ostream<char> ostream;
+
+
+  typedef basic_iostream<char> iostream;
+
+
+  typedef basic_stringbuf<char> stringbuf;
+
+
+  typedef basic_istringstream<char> istringstream;
+
+
+  typedef basic_ostringstream<char> ostringstream;
+
+
+  typedef basic_stringstream<char> stringstream;
+
+
+  typedef basic_filebuf<char> filebuf;
+
+
+  typedef basic_ifstream<char> ifstream;
+
+
+  typedef basic_ofstream<char> ofstream;
+
+
+  typedef basic_fstream<char> fstream;
+
+
+
+  typedef basic_ios<wchar_t> wios;
+
+
+  typedef basic_streambuf<wchar_t> wstreambuf;
+
+
+  typedef basic_istream<wchar_t> wistream;
+
+
+  typedef basic_ostream<wchar_t> wostream;
+
+
+  typedef basic_iostream<wchar_t> wiostream;
+
+
+  typedef basic_stringbuf<wchar_t> wstringbuf;
+
+
+  typedef basic_istringstream<wchar_t> wistringstream;
+
+
+  typedef basic_ostringstream<wchar_t> wostringstream;
+
+
+  typedef basic_stringstream<wchar_t> wstringstream;
+
+
+  typedef basic_filebuf<wchar_t> wfilebuf;
+
+
+  typedef basic_ifstream<wchar_t> wifstream;
+
+
+  typedef basic_ofstream<wchar_t> wofstream;
+
+
+  typedef basic_fstream<wchar_t> wfstream;
+
+
+
+
+}
+       
+
+
+extern "C" {
+enum
+{
+  _ISupper = ((0) < 8 ? ((1 << (0)) << 8) : ((1 << (0)) >> 8)),
+  _ISlower = ((1) < 8 ? ((1 << (1)) << 8) : ((1 << (1)) >> 8)),
+  _ISalpha = ((2) < 8 ? ((1 << (2)) << 8) : ((1 << (2)) >> 8)),
+  _ISdigit = ((3) < 8 ? ((1 << (3)) << 8) : ((1 << (3)) >> 8)),
+  _ISxdigit = ((4) < 8 ? ((1 << (4)) << 8) : ((1 << (4)) >> 8)),
+  _ISspace = ((5) < 8 ? ((1 << (5)) << 8) : ((1 << (5)) >> 8)),
+  _ISprint = ((6) < 8 ? ((1 << (6)) << 8) : ((1 << (6)) >> 8)),
+  _ISgraph = ((7) < 8 ? ((1 << (7)) << 8) : ((1 << (7)) >> 8)),
+  _ISblank = ((8) < 8 ? ((1 << (8)) << 8) : ((1 << (8)) >> 8)),
+  _IScntrl = ((9) < 8 ? ((1 << (9)) << 8) : ((1 << (9)) >> 8)),
+  _ISpunct = ((10) < 8 ? ((1 << (10)) << 8) : ((1 << (10)) >> 8)),
+  _ISalnum = ((11) < 8 ? ((1 << (11)) << 8) : ((1 << (11)) >> 8))
+};
+extern const unsigned short int **__ctype_b_loc (void)
+     throw () __attribute__ ((__const__));
+extern const __int32_t **__ctype_tolower_loc (void)
+     throw () __attribute__ ((__const__));
+extern const __int32_t **__ctype_toupper_loc (void)
+     throw () __attribute__ ((__const__));
+
+
+
+
+
+
+extern int isalnum (int) throw ();
+extern int isalpha (int) throw ();
+extern int iscntrl (int) throw ();
+extern int isdigit (int) throw ();
+extern int islower (int) throw ();
+extern int isgraph (int) throw ();
+extern int isprint (int) throw ();
+extern int ispunct (int) throw ();
+extern int isspace (int) throw ();
+extern int isupper (int) throw ();
+extern int isxdigit (int) throw ();
+
+
+
+extern int tolower (int __c) throw ();
+
+
+extern int toupper (int __c) throw ();
+
+
+
+
+
+
+
+
+extern int isblank (int) throw ();
+
+
+
+
+
+
+extern int isctype (int __c, int __mask) throw ();
+
+
+
+
+
+
+extern int isascii (int __c) throw ();
+
+
+
+extern int toascii (int __c) throw ();
+
+
+
+extern int _toupper (int) throw ();
+extern int _tolower (int) throw ();
+extern int isalnum_l (int, __locale_t) throw ();
+extern int isalpha_l (int, __locale_t) throw ();
+extern int iscntrl_l (int, __locale_t) throw ();
+extern int isdigit_l (int, __locale_t) throw ();
+extern int islower_l (int, __locale_t) throw ();
+extern int isgraph_l (int, __locale_t) throw ();
+extern int isprint_l (int, __locale_t) throw ();
+extern int ispunct_l (int, __locale_t) throw ();
+extern int isspace_l (int, __locale_t) throw ();
+extern int isupper_l (int, __locale_t) throw ();
+extern int isxdigit_l (int, __locale_t) throw ();
+
+extern int isblank_l (int, __locale_t) throw ();
+
+
+
+extern int __tolower_l (int __c, __locale_t __l) throw ();
+extern int tolower_l (int __c, __locale_t __l) throw ();
+
+
+extern int __toupper_l (int __c, __locale_t __l) throw ();
+extern int toupper_l (int __c, __locale_t __l) throw ();
+}
+namespace std
+{
+  using ::isalnum;
+  using ::isalpha;
+  using ::iscntrl;
+  using ::isdigit;
+  using ::isgraph;
+  using ::islower;
+  using ::isprint;
+  using ::ispunct;
+  using ::isspace;
+  using ::isupper;
+  using ::isxdigit;
+  using ::tolower;
+  using ::toupper;
+}
+
+
+
+
+
+
+
+namespace std
+{
+  using ::isblank;
+}
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+  class locale;
+
+  template<typename _Facet>
+    bool
+    has_facet(const locale&) throw();
+
+  template<typename _Facet>
+    const _Facet&
+    use_facet(const locale&);
+
+
+  template<typename _CharT>
+    bool
+    isspace(_CharT, const locale&);
+
+  template<typename _CharT>
+    bool
+    isprint(_CharT, const locale&);
+
+  template<typename _CharT>
+    bool
+    iscntrl(_CharT, const locale&);
+
+  template<typename _CharT>
+    bool
+    isupper(_CharT, const locale&);
+
+  template<typename _CharT>
+    bool
+    islower(_CharT, const locale&);
+
+  template<typename _CharT>
+    bool
+    isalpha(_CharT, const locale&);
+
+  template<typename _CharT>
+    bool
+    isdigit(_CharT, const locale&);
+
+  template<typename _CharT>
+    bool
+    ispunct(_CharT, const locale&);
+
+  template<typename _CharT>
+    bool
+    isxdigit(_CharT, const locale&);
+
+  template<typename _CharT>
+    bool
+    isalnum(_CharT, const locale&);
+
+  template<typename _CharT>
+    bool
+    isgraph(_CharT, const locale&);
+
+
+  template<typename _CharT>
+    bool
+    isblank(_CharT, const locale&);
+
+
+  template<typename _CharT>
+    _CharT
+    toupper(_CharT, const locale&);
+
+  template<typename _CharT>
+    _CharT
+    tolower(_CharT, const locale&);
+
+
+  class ctype_base;
+  template<typename _CharT>
+    class ctype;
+  template<> class ctype<char>;
+
+  template<> class ctype<wchar_t>;
+
+  template<typename _CharT>
+    class ctype_byname;
+
+
+  class codecvt_base;
+  template<typename _InternT, typename _ExternT, typename _StateT>
+    class codecvt;
+  template<> class codecvt<char, char, mbstate_t>;
+
+  template<> class codecvt<wchar_t, char, mbstate_t>;
+
+  template<typename _InternT, typename _ExternT, typename _StateT>
+    class codecvt_byname;
+
+
+namespace __gnu_cxx_ldbl128 {
+  template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> >
+    class num_get;
+  template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
+    class num_put;
+}
+namespace __cxx11 {
+  template<typename _CharT> class numpunct;
+  template<typename _CharT> class numpunct_byname;
+}
+
+namespace __cxx11 {
+
+  template<typename _CharT>
+    class collate;
+  template<typename _CharT>
+    class collate_byname;
+}
+
+
+  class time_base;
+namespace __cxx11 {
+  template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> >
+    class time_get;
+  template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> >
+    class time_get_byname;
+}
+  template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
+    class time_put;
+  template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
+    class time_put_byname;
+
+
+  class money_base;
+namespace __cxx11 {
+  template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> >
+    class money_get;
+  template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
+    class money_put;
+}
+namespace __cxx11 {
+  template<typename _CharT, bool _Intl = false>
+    class moneypunct;
+  template<typename _CharT, bool _Intl = false>
+    class moneypunct_byname;
+}
+
+
+  class messages_base;
+namespace __cxx11 {
+  template<typename _CharT>
+    class messages;
+  template<typename _CharT>
+    class messages_byname;
+}
+
+
+}
+       
+
+
+       
+
+
+
+namespace __cxxabiv1
+{
+
+
+
+
+
+
+
+  class __forced_unwind
+  {
+    virtual ~__forced_unwind() throw();
+
+
+    virtual void __pure_dummy() = 0;
+  };
+}
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+  template<typename _CharT, typename _Traits>
+    inline void
+    __ostream_write(basic_ostream<_CharT, _Traits>& __out,
+      const _CharT* __s, streamsize __n)
+    {
+      typedef basic_ostream<_CharT, _Traits> __ostream_type;
+      typedef typename __ostream_type::ios_base __ios_base;
+
+      const streamsize __put = __out.rdbuf()->sputn(__s, __n);
+      if (__put != __n)
+ __out.setstate(__ios_base::badbit);
+    }
+
+  template<typename _CharT, typename _Traits>
+    inline void
+    __ostream_fill(basic_ostream<_CharT, _Traits>& __out, streamsize __n)
+    {
+      typedef basic_ostream<_CharT, _Traits> __ostream_type;
+      typedef typename __ostream_type::ios_base __ios_base;
+
+      const _CharT __c = __out.fill();
+      for (; __n > 0; --__n)
+ {
+   const typename _Traits::int_type __put = __out.rdbuf()->sputc(__c);
+   if (_Traits::eq_int_type(__put, _Traits::eof()))
+     {
+       __out.setstate(__ios_base::badbit);
+       break;
+     }
+ }
+    }
+
+  template<typename _CharT, typename _Traits>
+    basic_ostream<_CharT, _Traits>&
+    __ostream_insert(basic_ostream<_CharT, _Traits>& __out,
+       const _CharT* __s, streamsize __n)
+    {
+      typedef basic_ostream<_CharT, _Traits> __ostream_type;
+      typedef typename __ostream_type::ios_base __ios_base;
+
+      typename __ostream_type::sentry __cerb(__out);
+      if (__cerb)
+ {
+   if (true)
+     {
+       const streamsize __w = __out.width();
+       if (__w > __n)
+  {
+    const bool __left = ((__out.flags()
+     & __ios_base::adjustfield)
+           == __ios_base::left);
+    if (!__left)
+      __ostream_fill(__out, __w - __n);
+    if (__out.good())
+      __ostream_write(__out, __s, __n);
+    if (__left && __out.good())
+      __ostream_fill(__out, __w - __n);
+  }
+       else
+  __ostream_write(__out, __s, __n);
+       __out.width(0);
+     }
+   if (false)
+     {
+       __out._M_setstate(__ios_base::badbit);
+       ;
+     }
+   if (false)
+     { __out._M_setstate(__ios_base::badbit); }
+ }
+      return __out;
+    }
+
+
+
+
+  extern template ostream& __ostream_insert(ostream&, const char*, streamsize);
+
+
+  extern template wostream& __ostream_insert(wostream&, const wchar_t*,
+          streamsize);
+
+
+
+
+}
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+  template<typename _Arg, typename _Result>
+    struct unary_function
+    {
+
+      typedef _Arg argument_type;
+
+
+      typedef _Result result_type;
+    };
+
+
+
+
+  template<typename _Arg1, typename _Arg2, typename _Result>
+    struct binary_function
+    {
+
+      typedef _Arg1 first_argument_type;
+
+
+      typedef _Arg2 second_argument_type;
+
+
+      typedef _Result result_type;
+    };
+  template<typename _Tp>
+    struct plus : public binary_function<_Tp, _Tp, _Tp>
+    {
+     
+      _Tp
+      operator()(const _Tp& __x, const _Tp& __y) const
+      { return __x + __y; }
+    };
+
+
+  template<typename _Tp>
+    struct minus : public binary_function<_Tp, _Tp, _Tp>
+    {
+     
+      _Tp
+      operator()(const _Tp& __x, const _Tp& __y) const
+      { return __x - __y; }
+    };
+
+
+  template<typename _Tp>
+    struct multiplies : public binary_function<_Tp, _Tp, _Tp>
+    {
+     
+      _Tp
+      operator()(const _Tp& __x, const _Tp& __y) const
+      { return __x * __y; }
+    };
+
+
+  template<typename _Tp>
+    struct divides : public binary_function<_Tp, _Tp, _Tp>
+    {
+     
+      _Tp
+      operator()(const _Tp& __x, const _Tp& __y) const
+      { return __x / __y; }
+    };
+
+
+  template<typename _Tp>
+    struct modulus : public binary_function<_Tp, _Tp, _Tp>
+    {
+     
+      _Tp
+      operator()(const _Tp& __x, const _Tp& __y) const
+      { return __x % __y; }
+    };
+
+
+  template<typename _Tp>
+    struct negate : public unary_function<_Tp, _Tp>
+    {
+     
+      _Tp
+      operator()(const _Tp& __x) const
+      { return -__x; }
+    };
+  template<typename _Tp>
+    struct equal_to : public binary_function<_Tp, _Tp, bool>
+    {
+     
+      bool
+      operator()(const _Tp& __x, const _Tp& __y) const
+      { return __x == __y; }
+    };
+
+
+  template<typename _Tp>
+    struct not_equal_to : public binary_function<_Tp, _Tp, bool>
+    {
+     
+      bool
+      operator()(const _Tp& __x, const _Tp& __y) const
+      { return __x != __y; }
+    };
+
+
+  template<typename _Tp>
+    struct greater : public binary_function<_Tp, _Tp, bool>
+    {
+     
+      bool
+      operator()(const _Tp& __x, const _Tp& __y) const
+      { return __x > __y; }
+    };
+
+
+  template<typename _Tp>
+    struct less : public binary_function<_Tp, _Tp, bool>
+    {
+     
+      bool
+      operator()(const _Tp& __x, const _Tp& __y) const
+      { return __x < __y; }
+    };
+
+
+  template<typename _Tp>
+    struct greater_equal : public binary_function<_Tp, _Tp, bool>
+    {
+     
+      bool
+      operator()(const _Tp& __x, const _Tp& __y) const
+      { return __x >= __y; }
+    };
+
+
+  template<typename _Tp>
+    struct less_equal : public binary_function<_Tp, _Tp, bool>
+    {
+     
+      bool
+      operator()(const _Tp& __x, const _Tp& __y) const
+      { return __x <= __y; }
+    };
+  template<typename _Tp>
+    struct logical_and : public binary_function<_Tp, _Tp, bool>
+    {
+     
+      bool
+      operator()(const _Tp& __x, const _Tp& __y) const
+      { return __x && __y; }
+    };
+
+
+  template<typename _Tp>
+    struct logical_or : public binary_function<_Tp, _Tp, bool>
+    {
+     
+      bool
+      operator()(const _Tp& __x, const _Tp& __y) const
+      { return __x || __y; }
+    };
+
+
+  template<typename _Tp>
+    struct logical_not : public unary_function<_Tp, bool>
+    {
+     
+      bool
+      operator()(const _Tp& __x) const
+      { return !__x; }
+    };
+  template<typename _Tp>
+    struct bit_and : public binary_function<_Tp, _Tp, _Tp>
+    {
+     
+      _Tp
+      operator()(const _Tp& __x, const _Tp& __y) const
+      { return __x & __y; }
+    };
+
+  template<typename _Tp>
+    struct bit_or : public binary_function<_Tp, _Tp, _Tp>
+    {
+     
+      _Tp
+      operator()(const _Tp& __x, const _Tp& __y) const
+      { return __x | __y; }
+    };
+
+  template<typename _Tp>
+    struct bit_xor : public binary_function<_Tp, _Tp, _Tp>
+    {
+     
+      _Tp
+      operator()(const _Tp& __x, const _Tp& __y) const
+      { return __x ^ __y; }
+    };
+
+  template<typename _Tp>
+    struct bit_not : public unary_function<_Tp, _Tp>
+    {
+   
+      _Tp
+      operator()(const _Tp& __x) const
+      { return ~__x; }
+    };
+  template<typename _Predicate>
+    class unary_negate
+    : public unary_function<typename _Predicate::argument_type, bool>
+    {
+    protected:
+      _Predicate _M_pred;
+
+    public:
+     
+      explicit
+      unary_negate(const _Predicate& __x) : _M_pred(__x) { }
+
+     
+      bool
+      operator()(const typename _Predicate::argument_type& __x) const
+      { return !_M_pred(__x); }
+    };
+
+
+  template<typename _Predicate>
+   
+    inline unary_negate<_Predicate>
+    not1(const _Predicate& __pred)
+    { return unary_negate<_Predicate>(__pred); }
+
+
+  template<typename _Predicate>
+    class binary_negate
+    : public binary_function<typename _Predicate::first_argument_type,
+        typename _Predicate::second_argument_type, bool>
+    {
+    protected:
+      _Predicate _M_pred;
+
+    public:
+     
+      explicit
+      binary_negate(const _Predicate& __x) : _M_pred(__x) { }
+
+     
+      bool
+      operator()(const typename _Predicate::first_argument_type& __x,
+   const typename _Predicate::second_argument_type& __y) const
+      { return !_M_pred(__x, __y); }
+    };
+
+
+  template<typename _Predicate>
+   
+    inline binary_negate<_Predicate>
+    not2(const _Predicate& __pred)
+    { return binary_negate<_Predicate>(__pred); }
+  template<typename _Arg, typename _Result>
+    class pointer_to_unary_function : public unary_function<_Arg, _Result>
+    {
+    protected:
+      _Result (*_M_ptr)(_Arg);
+
+    public:
+      pointer_to_unary_function() { }
+
+      explicit
+      pointer_to_unary_function(_Result (*__x)(_Arg))
+      : _M_ptr(__x) { }
+
+      _Result
+      operator()(_Arg __x) const
+      { return _M_ptr(__x); }
+    };
+
+
+  template<typename _Arg, typename _Result>
+    inline pointer_to_unary_function<_Arg, _Result>
+    ptr_fun(_Result (*__x)(_Arg))
+    { return pointer_to_unary_function<_Arg, _Result>(__x); }
+
+
+  template<typename _Arg1, typename _Arg2, typename _Result>
+    class pointer_to_binary_function
+    : public binary_function<_Arg1, _Arg2, _Result>
+    {
+    protected:
+      _Result (*_M_ptr)(_Arg1, _Arg2);
+
+    public:
+      pointer_to_binary_function() { }
+
+      explicit
+      pointer_to_binary_function(_Result (*__x)(_Arg1, _Arg2))
+      : _M_ptr(__x) { }
+
+      _Result
+      operator()(_Arg1 __x, _Arg2 __y) const
+      { return _M_ptr(__x, __y); }
+    };
+
+
+  template<typename _Arg1, typename _Arg2, typename _Result>
+    inline pointer_to_binary_function<_Arg1, _Arg2, _Result>
+    ptr_fun(_Result (*__x)(_Arg1, _Arg2))
+    { return pointer_to_binary_function<_Arg1, _Arg2, _Result>(__x); }
+
+
+  template<typename _Tp>
+    struct _Identity
+    : public unary_function<_Tp, _Tp>
+    {
+      _Tp&
+      operator()(_Tp& __x) const
+      { return __x; }
+
+      const _Tp&
+      operator()(const _Tp& __x) const
+      { return __x; }
+    };
+
+
+  template<typename _Tp> struct _Identity<const _Tp> : _Identity<_Tp> { };
+
+  template<typename _Pair>
+    struct _Select1st
+    : public unary_function<_Pair, typename _Pair::first_type>
+    {
+      typename _Pair::first_type&
+      operator()(_Pair& __x) const
+      { return __x.first; }
+
+      const typename _Pair::first_type&
+      operator()(const _Pair& __x) const
+      { return __x.first; }
+
+
+      template<typename _Pair2>
+        typename _Pair2::first_type&
+        operator()(_Pair2& __x) const
+        { return __x.first; }
+
+      template<typename _Pair2>
+        const typename _Pair2::first_type&
+        operator()(const _Pair2& __x) const
+        { return __x.first; }
+
+    };
+
+  template<typename _Pair>
+    struct _Select2nd
+    : public unary_function<_Pair, typename _Pair::second_type>
+    {
+      typename _Pair::second_type&
+      operator()(_Pair& __x) const
+      { return __x.second; }
+
+      const typename _Pair::second_type&
+      operator()(const _Pair& __x) const
+      { return __x.second; }
+    };
+  template<typename _Ret, typename _Tp>
+    class mem_fun_t : public unary_function<_Tp*, _Ret>
+    {
+    public:
+      explicit
+      mem_fun_t(_Ret (_Tp::*__pf)())
+      : _M_f(__pf) { }
+
+      _Ret
+      operator()(_Tp* __p) const
+      { return (__p->*_M_f)(); }
+
+    private:
+      _Ret (_Tp::*_M_f)();
+    };
+
+
+
+  template<typename _Ret, typename _Tp>
+    class const_mem_fun_t : public unary_function<const _Tp*, _Ret>
+    {
+    public:
+      explicit
+      const_mem_fun_t(_Ret (_Tp::*__pf)() const)
+      : _M_f(__pf) { }
+
+      _Ret
+      operator()(const _Tp* __p) const
+      { return (__p->*_M_f)(); }
+
+    private:
+      _Ret (_Tp::*_M_f)() const;
+    };
+
+
+
+  template<typename _Ret, typename _Tp>
+    class mem_fun_ref_t : public unary_function<_Tp, _Ret>
+    {
+    public:
+      explicit
+      mem_fun_ref_t(_Ret (_Tp::*__pf)())
+      : _M_f(__pf) { }
+
+      _Ret
+      operator()(_Tp& __r) const
+      { return (__r.*_M_f)(); }
+
+    private:
+      _Ret (_Tp::*_M_f)();
+  };
+
+
+
+  template<typename _Ret, typename _Tp>
+    class const_mem_fun_ref_t : public unary_function<_Tp, _Ret>
+    {
+    public:
+      explicit
+      const_mem_fun_ref_t(_Ret (_Tp::*__pf)() const)
+      : _M_f(__pf) { }
+
+      _Ret
+      operator()(const _Tp& __r) const
+      { return (__r.*_M_f)(); }
+
+    private:
+      _Ret (_Tp::*_M_f)() const;
+    };
+
+
+
+  template<typename _Ret, typename _Tp, typename _Arg>
+    class mem_fun1_t : public binary_function<_Tp*, _Arg, _Ret>
+    {
+    public:
+      explicit
+      mem_fun1_t(_Ret (_Tp::*__pf)(_Arg))
+      : _M_f(__pf) { }
+
+      _Ret
+      operator()(_Tp* __p, _Arg __x) const
+      { return (__p->*_M_f)(__x); }
+
+    private:
+      _Ret (_Tp::*_M_f)(_Arg);
+    };
+
+
+
+  template<typename _Ret, typename _Tp, typename _Arg>
+    class const_mem_fun1_t : public binary_function<const _Tp*, _Arg, _Ret>
+    {
+    public:
+      explicit
+      const_mem_fun1_t(_Ret (_Tp::*__pf)(_Arg) const)
+      : _M_f(__pf) { }
+
+      _Ret
+      operator()(const _Tp* __p, _Arg __x) const
+      { return (__p->*_M_f)(__x); }
+
+    private:
+      _Ret (_Tp::*_M_f)(_Arg) const;
+    };
+
+
+
+  template<typename _Ret, typename _Tp, typename _Arg>
+    class mem_fun1_ref_t : public binary_function<_Tp, _Arg, _Ret>
+    {
+    public:
+      explicit
+      mem_fun1_ref_t(_Ret (_Tp::*__pf)(_Arg))
+      : _M_f(__pf) { }
+
+      _Ret
+      operator()(_Tp& __r, _Arg __x) const
+      { return (__r.*_M_f)(__x); }
+
+    private:
+      _Ret (_Tp::*_M_f)(_Arg);
+    };
+
+
+
+  template<typename _Ret, typename _Tp, typename _Arg>
+    class const_mem_fun1_ref_t : public binary_function<_Tp, _Arg, _Ret>
+    {
+    public:
+      explicit
+      const_mem_fun1_ref_t(_Ret (_Tp::*__pf)(_Arg) const)
+      : _M_f(__pf) { }
+
+      _Ret
+      operator()(const _Tp& __r, _Arg __x) const
+      { return (__r.*_M_f)(__x); }
+
+    private:
+      _Ret (_Tp::*_M_f)(_Arg) const;
+    };
+
+
+
+  template<typename _Ret, typename _Tp>
+    inline mem_fun_t<_Ret, _Tp>
+    mem_fun(_Ret (_Tp::*__f)())
+    { return mem_fun_t<_Ret, _Tp>(__f); }
+
+  template<typename _Ret, typename _Tp>
+    inline const_mem_fun_t<_Ret, _Tp>
+    mem_fun(_Ret (_Tp::*__f)() const)
+    { return const_mem_fun_t<_Ret, _Tp>(__f); }
+
+  template<typename _Ret, typename _Tp>
+    inline mem_fun_ref_t<_Ret, _Tp>
+    mem_fun_ref(_Ret (_Tp::*__f)())
+    { return mem_fun_ref_t<_Ret, _Tp>(__f); }
+
+  template<typename _Ret, typename _Tp>
+    inline const_mem_fun_ref_t<_Ret, _Tp>
+    mem_fun_ref(_Ret (_Tp::*__f)() const)
+    { return const_mem_fun_ref_t<_Ret, _Tp>(__f); }
+
+  template<typename _Ret, typename _Tp, typename _Arg>
+    inline mem_fun1_t<_Ret, _Tp, _Arg>
+    mem_fun(_Ret (_Tp::*__f)(_Arg))
+    { return mem_fun1_t<_Ret, _Tp, _Arg>(__f); }
+
+  template<typename _Ret, typename _Tp, typename _Arg>
+    inline const_mem_fun1_t<_Ret, _Tp, _Arg>
+    mem_fun(_Ret (_Tp::*__f)(_Arg) const)
+    { return const_mem_fun1_t<_Ret, _Tp, _Arg>(__f); }
+
+  template<typename _Ret, typename _Tp, typename _Arg>
+    inline mem_fun1_ref_t<_Ret, _Tp, _Arg>
+    mem_fun_ref(_Ret (_Tp::*__f)(_Arg))
+    { return mem_fun1_ref_t<_Ret, _Tp, _Arg>(__f); }
+
+  template<typename _Ret, typename _Tp, typename _Arg>
+    inline const_mem_fun1_ref_t<_Ret, _Tp, _Arg>
+    mem_fun_ref(_Ret (_Tp::*__f)(_Arg) const)
+    { return const_mem_fun1_ref_t<_Ret, _Tp, _Arg>(__f); }
+
+
+
+
+}
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+  template<typename _Operation>
+    class binder1st
+    : public unary_function<typename _Operation::second_argument_type,
+       typename _Operation::result_type>
+    {
+    protected:
+      _Operation op;
+      typename _Operation::first_argument_type value;
+
+    public:
+      binder1st(const _Operation& __x,
+  const typename _Operation::first_argument_type& __y)
+      : op(__x), value(__y) { }
+
+      typename _Operation::result_type
+      operator()(const typename _Operation::second_argument_type& __x) const
+      { return op(value, __x); }
+
+
+
+      typename _Operation::result_type
+      operator()(typename _Operation::second_argument_type& __x) const
+      { return op(value, __x); }
+    } __attribute__ ((__deprecated__));
+
+
+  template<typename _Operation, typename _Tp>
+    inline binder1st<_Operation>
+    bind1st(const _Operation& __fn, const _Tp& __x)
+    {
+      typedef typename _Operation::first_argument_type _Arg1_type;
+      return binder1st<_Operation>(__fn, _Arg1_type(__x));
+    }
+
+
+  template<typename _Operation>
+    class binder2nd
+    : public unary_function<typename _Operation::first_argument_type,
+       typename _Operation::result_type>
+    {
+    protected:
+      _Operation op;
+      typename _Operation::second_argument_type value;
+
+    public:
+      binder2nd(const _Operation& __x,
+  const typename _Operation::second_argument_type& __y)
+      : op(__x), value(__y) { }
+
+      typename _Operation::result_type
+      operator()(const typename _Operation::first_argument_type& __x) const
+      { return op(__x, value); }
+
+
+
+      typename _Operation::result_type
+      operator()(typename _Operation::first_argument_type& __x) const
+      { return op(__x, value); }
+    } __attribute__ ((__deprecated__));
+
+
+  template<typename _Operation, typename _Tp>
+    inline binder2nd<_Operation>
+    bind2nd(const _Operation& __fn, const _Tp& __x)
+    {
+      typedef typename _Operation::second_argument_type _Arg2_type;
+      return binder2nd<_Operation>(__fn, _Arg2_type(__x));
+    }
+
+
+
+}
+
+
+
+       
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+
+
+
+
+  template<typename _Container>
+    inline auto
+    begin(_Container& __cont) -> decltype(__cont.begin())
+    { return __cont.begin(); }
+
+
+
+
+
+
+  template<typename _Container>
+    inline auto
+    begin(const _Container& __cont) -> decltype(__cont.begin())
+    { return __cont.begin(); }
+
+
+
+
+
+
+  template<typename _Container>
+    inline auto
+    end(_Container& __cont) -> decltype(__cont.end())
+    { return __cont.end(); }
+
+
+
+
+
+
+  template<typename _Container>
+    inline auto
+    end(const _Container& __cont) -> decltype(__cont.end())
+    { return __cont.end(); }
+
+
+
+
+
+  template<typename _Tp, size_t _Nm>
+    inline _Tp*
+    begin(_Tp (&__arr)[_Nm])
+    { return __arr; }
+
+
+
+
+
+
+  template<typename _Tp, size_t _Nm>
+    inline _Tp*
+    end(_Tp (&__arr)[_Nm])
+    { return __arr + _Nm; }
+
+}
+       
+
+       
+
+
+
+
+
+struct sched_param
+  {
+    int __sched_priority;
+  };
+
+extern "C" {
+
+
+
+extern int clone (int (*__fn) (void *__arg), void *__child_stack,
+    int __flags, void *__arg, ...) throw ();
+
+
+extern int unshare (int __flags) throw ();
+
+
+extern int sched_getcpu (void) throw ();
+
+
+extern int setns (int __fd, int __nstype) throw ();
+
+
+
+}
+
+
+
+
+
+
+
+struct __sched_param
+  {
+    int __sched_priority;
+  };
+typedef unsigned long int __cpu_mask;
+
+
+
+
+
+
+typedef struct
+{
+  __cpu_mask __bits[1024 / (8 * sizeof (__cpu_mask))];
+} cpu_set_t;
+extern "C" {
+
+extern int __sched_cpucount (size_t __setsize, const cpu_set_t *__setp)
+  throw ();
+extern cpu_set_t *__sched_cpualloc (size_t __count) throw () ;
+extern void __sched_cpufree (cpu_set_t *__set) throw ();
+
+}
+
+
+
+
+extern "C" {
+
+
+extern int sched_setparam (__pid_t __pid, const struct sched_param *__param)
+     throw ();
+
+
+extern int sched_getparam (__pid_t __pid, struct sched_param *__param) throw ();
+
+
+extern int sched_setscheduler (__pid_t __pid, int __policy,
+          const struct sched_param *__param) throw ();
+
+
+extern int sched_getscheduler (__pid_t __pid) throw ();
+
+
+extern int sched_yield (void) throw ();
+
+
+extern int sched_get_priority_max (int __algorithm) throw ();
+
+
+extern int sched_get_priority_min (int __algorithm) throw ();
+
+
+extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) throw ();
+extern int sched_setaffinity (__pid_t __pid, size_t __cpusetsize,
+         const cpu_set_t *__cpuset) throw ();
+
+
+extern int sched_getaffinity (__pid_t __pid, size_t __cpusetsize,
+         cpu_set_t *__cpuset) throw ();
+
+
+}
+extern "C" {
+
+
+
+
+
+
+
+
+
+
+struct timex
+{
+  unsigned int modes;
+  __syscall_slong_t offset;
+  __syscall_slong_t freq;
+  __syscall_slong_t maxerror;
+  __syscall_slong_t esterror;
+  int status;
+  __syscall_slong_t constant;
+  __syscall_slong_t precision;
+  __syscall_slong_t tolerance;
+  struct timeval time;
+  __syscall_slong_t tick;
+  __syscall_slong_t ppsfreq;
+  __syscall_slong_t jitter;
+  int shift;
+  __syscall_slong_t stabil;
+  __syscall_slong_t jitcnt;
+  __syscall_slong_t calcnt;
+  __syscall_slong_t errcnt;
+  __syscall_slong_t stbcnt;
+
+  int tai;
+
+
+  int :32; int :32; int :32; int :32;
+  int :32; int :32; int :32; int :32;
+  int :32; int :32; int :32;
+};
+
+extern "C" {
+
+
+extern int clock_adjtime (__clockid_t __clock_id, struct timex *__utx) throw ();
+
+}
+
+
+struct tm
+{
+  int tm_sec;
+  int tm_min;
+  int tm_hour;
+  int tm_mday;
+  int tm_mon;
+  int tm_year;
+  int tm_wday;
+  int tm_yday;
+  int tm_isdst;
+
+
+  long int tm_gmtoff;
+  const char *tm_zone;
+
+
+
+
+};
+
+
+
+
+
+
+
+
+struct itimerspec
+  {
+    struct timespec it_interval;
+    struct timespec it_value;
+  };
+
+
+struct sigevent;
+
+
+
+extern clock_t clock (void) throw ();
+
+
+extern time_t time (time_t *__timer) throw ();
+
+
+extern double difftime (time_t __time1, time_t __time0)
+     throw () __attribute__ ((__const__));
+
+
+extern time_t mktime (struct tm *__tp) throw ();
+
+
+
+
+
+extern size_t strftime (char *__restrict __s, size_t __maxsize,
+   const char *__restrict __format,
+   const struct tm *__restrict __tp) throw ();
+
+
+
+
+
+extern char *strptime (const char *__restrict __s,
+         const char *__restrict __fmt, struct tm *__tp)
+     throw ();
+
+
+
+
+
+
+
+extern size_t strftime_l (char *__restrict __s, size_t __maxsize,
+     const char *__restrict __format,
+     const struct tm *__restrict __tp,
+     __locale_t __loc) throw ();
+
+
+
+extern char *strptime_l (const char *__restrict __s,
+    const char *__restrict __fmt, struct tm *__tp,
+    __locale_t __loc) throw ();
+
+
+
+
+
+
+extern struct tm *gmtime (const time_t *__timer) throw ();
+
+
+
+extern struct tm *localtime (const time_t *__timer) throw ();
+
+
+
+
+
+extern struct tm *gmtime_r (const time_t *__restrict __timer,
+       struct tm *__restrict __tp) throw ();
+
+
+
+extern struct tm *localtime_r (const time_t *__restrict __timer,
+          struct tm *__restrict __tp) throw ();
+
+
+
+
+
+extern char *asctime (const struct tm *__tp) throw ();
+
+
+extern char *ctime (const time_t *__timer) throw ();
+
+
+
+
+
+
+
+extern char *asctime_r (const struct tm *__restrict __tp,
+   char *__restrict __buf) throw ();
+
+
+extern char *ctime_r (const time_t *__restrict __timer,
+        char *__restrict __buf) throw ();
+
+
+
+
+extern char *__tzname[2];
+extern int __daylight;
+extern long int __timezone;
+
+
+
+
+extern char *tzname[2];
+
+
+
+extern void tzset (void) throw ();
+
+
+
+extern int daylight;
+extern long int timezone;
+
+
+
+
+
+extern int stime (const time_t *__when) throw ();
+extern time_t timegm (struct tm *__tp) throw ();
+
+
+extern time_t timelocal (struct tm *__tp) throw ();
+
+
+extern int dysize (int __year) throw () __attribute__ ((__const__));
+extern int nanosleep (const struct timespec *__requested_time,
+        struct timespec *__remaining);
+
+
+
+extern int clock_getres (clockid_t __clock_id, struct timespec *__res) throw ();
+
+
+extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) throw ();
+
+
+extern int clock_settime (clockid_t __clock_id, const struct timespec *__tp)
+     throw ();
+
+
+
+
+
+
+extern int clock_nanosleep (clockid_t __clock_id, int __flags,
+       const struct timespec *__req,
+       struct timespec *__rem);
+
+
+extern int clock_getcpuclockid (pid_t __pid, clockid_t *__clock_id) throw ();
+
+
+
+
+extern int timer_create (clockid_t __clock_id,
+    struct sigevent *__restrict __evp,
+    timer_t *__restrict __timerid) throw ();
+
+
+extern int timer_delete (timer_t __timerid) throw ();
+
+
+extern int timer_settime (timer_t __timerid, int __flags,
+     const struct itimerspec *__restrict __value,
+     struct itimerspec *__restrict __ovalue) throw ();
+
+
+extern int timer_gettime (timer_t __timerid, struct itimerspec *__value)
+     throw ();
+
+
+extern int timer_getoverrun (timer_t __timerid) throw ();
+
+
+
+
+
+extern int timespec_get (struct timespec *__ts, int __base)
+     throw () __attribute__ ((__nonnull__ (1)));
+extern int getdate_err;
+extern struct tm *getdate (const char *__string);
+extern int getdate_r (const char *__restrict __string,
+        struct tm *__restrict __resbufp);
+
+
+}
+
+
+typedef long int __jmp_buf[64] __attribute__ ((__aligned__ (16)));
+
+
+
+enum
+{
+  PTHREAD_CREATE_JOINABLE,
+
+  PTHREAD_CREATE_DETACHED
+
+};
+
+
+
+enum
+{
+  PTHREAD_MUTEX_TIMED_NP,
+  PTHREAD_MUTEX_RECURSIVE_NP,
+  PTHREAD_MUTEX_ERRORCHECK_NP,
+  PTHREAD_MUTEX_ADAPTIVE_NP
+
+  ,
+  PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_TIMED_NP,
+  PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP,
+  PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP,
+  PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL
+
+
+
+  , PTHREAD_MUTEX_FAST_NP = PTHREAD_MUTEX_TIMED_NP
+
+};
+
+
+
+
+enum
+{
+  PTHREAD_MUTEX_STALLED,
+  PTHREAD_MUTEX_STALLED_NP = PTHREAD_MUTEX_STALLED,
+  PTHREAD_MUTEX_ROBUST,
+  PTHREAD_MUTEX_ROBUST_NP = PTHREAD_MUTEX_ROBUST
+};
+
+
+
+
+
+enum
+{
+  PTHREAD_PRIO_NONE,
+  PTHREAD_PRIO_INHERIT,
+  PTHREAD_PRIO_PROTECT
+};
+enum
+{
+  PTHREAD_RWLOCK_PREFER_READER_NP,
+  PTHREAD_RWLOCK_PREFER_WRITER_NP,
+  PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP,
+  PTHREAD_RWLOCK_DEFAULT_NP = PTHREAD_RWLOCK_PREFER_READER_NP
+};
+enum
+{
+  PTHREAD_INHERIT_SCHED,
+
+  PTHREAD_EXPLICIT_SCHED
+
+};
+
+
+
+enum
+{
+  PTHREAD_SCOPE_SYSTEM,
+
+  PTHREAD_SCOPE_PROCESS
+
+};
+
+
+
+enum
+{
+  PTHREAD_PROCESS_PRIVATE,
+
+  PTHREAD_PROCESS_SHARED
+
+};
+struct _pthread_cleanup_buffer
+{
+  void (*__routine) (void *);
+  void *__arg;
+  int __canceltype;
+  struct _pthread_cleanup_buffer *__prev;
+};
+
+
+enum
+{
+  PTHREAD_CANCEL_ENABLE,
+
+  PTHREAD_CANCEL_DISABLE
+
+};
+enum
+{
+  PTHREAD_CANCEL_DEFERRED,
+
+  PTHREAD_CANCEL_ASYNCHRONOUS
+
+};
+extern "C" {
+
+
+
+
+extern int pthread_create (pthread_t *__restrict __newthread,
+      const pthread_attr_t *__restrict __attr,
+      void *(*__start_routine) (void *),
+      void *__restrict __arg) throw () __attribute__ ((__nonnull__ (1, 3)));
+
+
+
+
+
+extern void pthread_exit (void *__retval) __attribute__ ((__noreturn__));
+
+
+
+
+
+
+
+extern int pthread_join (pthread_t __th, void **__thread_return);
+
+
+
+
+extern int pthread_tryjoin_np (pthread_t __th, void **__thread_return) throw ();
+
+
+
+
+
+
+
+extern int pthread_timedjoin_np (pthread_t __th, void **__thread_return,
+     const struct timespec *__abstime);
+
+
+
+
+
+
+extern int pthread_detach (pthread_t __th) throw ();
+
+
+
+extern pthread_t pthread_self (void) throw () __attribute__ ((__const__));
+
+
+extern int pthread_equal (pthread_t __thread1, pthread_t __thread2)
+  throw () __attribute__ ((__const__));
+
+
+
+
+
+
+
+extern int pthread_attr_init (pthread_attr_t *__attr) throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_attr_destroy (pthread_attr_t *__attr)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_attr_getdetachstate (const pthread_attr_t *__attr,
+     int *__detachstate)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern int pthread_attr_setdetachstate (pthread_attr_t *__attr,
+     int __detachstate)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+extern int pthread_attr_getguardsize (const pthread_attr_t *__attr,
+          size_t *__guardsize)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern int pthread_attr_setguardsize (pthread_attr_t *__attr,
+          size_t __guardsize)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+extern int pthread_attr_getschedparam (const pthread_attr_t *__restrict __attr,
+           struct sched_param *__restrict __param)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern int pthread_attr_setschedparam (pthread_attr_t *__restrict __attr,
+           const struct sched_param *__restrict
+           __param) throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern int pthread_attr_getschedpolicy (const pthread_attr_t *__restrict
+     __attr, int *__restrict __policy)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern int pthread_attr_setschedpolicy (pthread_attr_t *__attr, int __policy)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_attr_getinheritsched (const pthread_attr_t *__restrict
+      __attr, int *__restrict __inherit)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern int pthread_attr_setinheritsched (pthread_attr_t *__attr,
+      int __inherit)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+extern int pthread_attr_getscope (const pthread_attr_t *__restrict __attr,
+      int *__restrict __scope)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern int pthread_attr_setscope (pthread_attr_t *__attr, int __scope)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_attr_getstackaddr (const pthread_attr_t *__restrict
+          __attr, void **__restrict __stackaddr)
+     throw () __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__deprecated__));
+
+
+
+
+
+extern int pthread_attr_setstackaddr (pthread_attr_t *__attr,
+          void *__stackaddr)
+     throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__));
+
+
+extern int pthread_attr_getstacksize (const pthread_attr_t *__restrict
+          __attr, size_t *__restrict __stacksize)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+
+
+extern int pthread_attr_setstacksize (pthread_attr_t *__attr,
+          size_t __stacksize)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+extern int pthread_attr_getstack (const pthread_attr_t *__restrict __attr,
+      void **__restrict __stackaddr,
+      size_t *__restrict __stacksize)
+     throw () __attribute__ ((__nonnull__ (1, 2, 3)));
+
+
+
+
+extern int pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr,
+      size_t __stacksize) throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+
+
+extern int pthread_attr_setaffinity_np (pthread_attr_t *__attr,
+     size_t __cpusetsize,
+     const cpu_set_t *__cpuset)
+     throw () __attribute__ ((__nonnull__ (1, 3)));
+
+
+
+extern int pthread_attr_getaffinity_np (const pthread_attr_t *__attr,
+     size_t __cpusetsize,
+     cpu_set_t *__cpuset)
+     throw () __attribute__ ((__nonnull__ (1, 3)));
+
+
+
+
+
+extern int pthread_getattr_np (pthread_t __th, pthread_attr_t *__attr)
+     throw () __attribute__ ((__nonnull__ (2)));
+
+
+
+
+
+
+
+extern int pthread_setschedparam (pthread_t __target_thread, int __policy,
+      const struct sched_param *__param)
+     throw () __attribute__ ((__nonnull__ (3)));
+
+
+extern int pthread_getschedparam (pthread_t __target_thread,
+      int *__restrict __policy,
+      struct sched_param *__restrict __param)
+     throw () __attribute__ ((__nonnull__ (2, 3)));
+
+
+extern int pthread_setschedprio (pthread_t __target_thread, int __prio)
+     throw ();
+
+
+
+
+extern int pthread_getname_np (pthread_t __target_thread, char *__buf,
+          size_t __buflen)
+     throw () __attribute__ ((__nonnull__ (2)));
+
+
+extern int pthread_setname_np (pthread_t __target_thread, const char *__name)
+     throw () __attribute__ ((__nonnull__ (2)));
+
+
+
+
+
+extern int pthread_getconcurrency (void) throw ();
+
+
+extern int pthread_setconcurrency (int __level) throw ();
+
+
+
+
+
+
+
+extern int pthread_yield (void) throw ();
+
+
+
+
+extern int pthread_setaffinity_np (pthread_t __th, size_t __cpusetsize,
+       const cpu_set_t *__cpuset)
+     throw () __attribute__ ((__nonnull__ (3)));
+
+
+extern int pthread_getaffinity_np (pthread_t __th, size_t __cpusetsize,
+       cpu_set_t *__cpuset)
+     throw () __attribute__ ((__nonnull__ (3)));
+extern int pthread_once (pthread_once_t *__once_control,
+    void (*__init_routine) (void)) __attribute__ ((__nonnull__ (1, 2)));
+extern int pthread_setcancelstate (int __state, int *__oldstate);
+
+
+
+extern int pthread_setcanceltype (int __type, int *__oldtype);
+
+
+extern int pthread_cancel (pthread_t __th);
+
+
+
+
+extern void pthread_testcancel (void);
+
+
+
+
+typedef struct
+{
+  struct
+  {
+    __jmp_buf __cancel_jmp_buf;
+    int __mask_was_saved;
+  } __cancel_jmp_buf[1];
+  void *__pad[4];
+} __pthread_unwind_buf_t __attribute__ ((__aligned__));
+struct __pthread_cleanup_frame
+{
+  void (*__cancel_routine) (void *);
+  void *__cancel_arg;
+  int __do_it;
+  int __cancel_type;
+};
+extern void __pthread_register_cancel (__pthread_unwind_buf_t *__buf)
+     ;
+extern void __pthread_unregister_cancel (__pthread_unwind_buf_t *__buf)
+  ;
+extern void __pthread_register_cancel_defer (__pthread_unwind_buf_t *__buf)
+     ;
+extern void __pthread_unregister_cancel_restore (__pthread_unwind_buf_t *__buf)
+  ;
+
+
+
+extern void __pthread_unwind_next (__pthread_unwind_buf_t *__buf)
+     __attribute__ ((__noreturn__))
+
+     __attribute__ ((__weak__))
+
+     ;
+
+
+
+struct __jmp_buf_tag;
+extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) throw ();
+
+
+
+
+
+extern int pthread_mutex_init (pthread_mutex_t *__mutex,
+          const pthread_mutexattr_t *__mutexattr)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_mutex_destroy (pthread_mutex_t *__mutex)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_mutex_trylock (pthread_mutex_t *__mutex)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_mutex_lock (pthread_mutex_t *__mutex)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex,
+        const struct timespec *__restrict
+        __abstime) throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+
+extern int pthread_mutex_unlock (pthread_mutex_t *__mutex)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+extern int pthread_mutex_getprioceiling (const pthread_mutex_t *
+      __restrict __mutex,
+      int *__restrict __prioceiling)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+
+extern int pthread_mutex_setprioceiling (pthread_mutex_t *__restrict __mutex,
+      int __prioceiling,
+      int *__restrict __old_ceiling)
+     throw () __attribute__ ((__nonnull__ (1, 3)));
+
+
+
+
+extern int pthread_mutex_consistent (pthread_mutex_t *__mutex)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+extern int pthread_mutex_consistent_np (pthread_mutex_t *__mutex)
+     throw () __attribute__ ((__nonnull__ (1)));
+extern int pthread_mutexattr_init (pthread_mutexattr_t *__attr)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_mutexattr_destroy (pthread_mutexattr_t *__attr)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_mutexattr_getpshared (const pthread_mutexattr_t *
+      __restrict __attr,
+      int *__restrict __pshared)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern int pthread_mutexattr_setpshared (pthread_mutexattr_t *__attr,
+      int __pshared)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+extern int pthread_mutexattr_gettype (const pthread_mutexattr_t *__restrict
+          __attr, int *__restrict __kind)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+
+
+extern int pthread_mutexattr_settype (pthread_mutexattr_t *__attr, int __kind)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+extern int pthread_mutexattr_getprotocol (const pthread_mutexattr_t *
+       __restrict __attr,
+       int *__restrict __protocol)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+
+extern int pthread_mutexattr_setprotocol (pthread_mutexattr_t *__attr,
+       int __protocol)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_mutexattr_getprioceiling (const pthread_mutexattr_t *
+          __restrict __attr,
+          int *__restrict __prioceiling)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern int pthread_mutexattr_setprioceiling (pthread_mutexattr_t *__attr,
+          int __prioceiling)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+extern int pthread_mutexattr_getrobust (const pthread_mutexattr_t *__attr,
+     int *__robustness)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+extern int pthread_mutexattr_getrobust_np (const pthread_mutexattr_t *__attr,
+        int *__robustness)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+
+extern int pthread_mutexattr_setrobust (pthread_mutexattr_t *__attr,
+     int __robustness)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+extern int pthread_mutexattr_setrobust_np (pthread_mutexattr_t *__attr,
+        int __robustness)
+     throw () __attribute__ ((__nonnull__ (1)));
+extern int pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock,
+    const pthread_rwlockattr_t *__restrict
+    __attr) throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_rwlock_destroy (pthread_rwlock_t *__rwlock)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock)
+  throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock,
+           const struct timespec *__restrict
+           __abstime) throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+
+extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock,
+           const struct timespec *__restrict
+           __abstime) throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+
+extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+
+
+extern int pthread_rwlockattr_init (pthread_rwlockattr_t *__attr)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_rwlockattr_destroy (pthread_rwlockattr_t *__attr)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_rwlockattr_getpshared (const pthread_rwlockattr_t *
+       __restrict __attr,
+       int *__restrict __pshared)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *__attr,
+       int __pshared)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_rwlockattr_getkind_np (const pthread_rwlockattr_t *
+       __restrict __attr,
+       int *__restrict __pref)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern int pthread_rwlockattr_setkind_np (pthread_rwlockattr_t *__attr,
+       int __pref) throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+
+
+
+
+extern int pthread_cond_init (pthread_cond_t *__restrict __cond,
+         const pthread_condattr_t *__restrict __cond_attr)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_cond_destroy (pthread_cond_t *__cond)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_cond_signal (pthread_cond_t *__cond)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_cond_broadcast (pthread_cond_t *__cond)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+
+
+
+extern int pthread_cond_wait (pthread_cond_t *__restrict __cond,
+         pthread_mutex_t *__restrict __mutex)
+     __attribute__ ((__nonnull__ (1, 2)));
+extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond,
+       pthread_mutex_t *__restrict __mutex,
+       const struct timespec *__restrict __abstime)
+     __attribute__ ((__nonnull__ (1, 2, 3)));
+
+
+
+
+extern int pthread_condattr_init (pthread_condattr_t *__attr)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_condattr_destroy (pthread_condattr_t *__attr)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_condattr_getpshared (const pthread_condattr_t *
+     __restrict __attr,
+     int *__restrict __pshared)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern int pthread_condattr_setpshared (pthread_condattr_t *__attr,
+     int __pshared) throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+extern int pthread_condattr_getclock (const pthread_condattr_t *
+          __restrict __attr,
+          __clockid_t *__restrict __clock_id)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern int pthread_condattr_setclock (pthread_condattr_t *__attr,
+          __clockid_t __clock_id)
+     throw () __attribute__ ((__nonnull__ (1)));
+extern int pthread_spin_init (pthread_spinlock_t *__lock, int __pshared)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_spin_destroy (pthread_spinlock_t *__lock)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_spin_lock (pthread_spinlock_t *__lock)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_spin_trylock (pthread_spinlock_t *__lock)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_spin_unlock (pthread_spinlock_t *__lock)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+
+
+
+extern int pthread_barrier_init (pthread_barrier_t *__restrict __barrier,
+     const pthread_barrierattr_t *__restrict
+     __attr, unsigned int __count)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_barrier_destroy (pthread_barrier_t *__barrier)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_barrier_wait (pthread_barrier_t *__barrier)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+extern int pthread_barrierattr_init (pthread_barrierattr_t *__attr)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_barrierattr_destroy (pthread_barrierattr_t *__attr)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_barrierattr_getpshared (const pthread_barrierattr_t *
+        __restrict __attr,
+        int *__restrict __pshared)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern int pthread_barrierattr_setpshared (pthread_barrierattr_t *__attr,
+        int __pshared)
+     throw () __attribute__ ((__nonnull__ (1)));
+extern int pthread_key_create (pthread_key_t *__key,
+          void (*__destr_function) (void *))
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_key_delete (pthread_key_t __key) throw ();
+
+
+extern void *pthread_getspecific (pthread_key_t __key) throw ();
+
+
+extern int pthread_setspecific (pthread_key_t __key,
+    const void *__pointer) throw () ;
+
+
+
+
+extern int pthread_getcpuclockid (pthread_t __thread_id,
+      __clockid_t *__clock_id)
+     throw () __attribute__ ((__nonnull__ (2)));
+extern int pthread_atfork (void (*__prepare) (void),
+      void (*__parent) (void),
+      void (*__child) (void)) throw ();
+
+
+
+
+extern __inline __attribute__ ((__gnu_inline__)) int
+__attribute__ ((__leaf__)) pthread_equal (pthread_t __thread1, pthread_t __thread2) throw ()
+{
+  return __thread1 == __thread2;
+}
+
+
+}
+typedef pthread_t __gthread_t;
+typedef pthread_key_t __gthread_key_t;
+typedef pthread_once_t __gthread_once_t;
+typedef pthread_mutex_t __gthread_mutex_t;
+typedef pthread_mutex_t __gthread_recursive_mutex_t;
+typedef pthread_cond_t __gthread_cond_t;
+typedef struct timespec __gthread_time_t;
+static __typeof(pthread_once) __gthrw_pthread_once __attribute__ ((__weakref__("pthread_once")));
+static __typeof(pthread_getspecific) __gthrw_pthread_getspecific __attribute__ ((__weakref__("pthread_getspecific")));
+static __typeof(pthread_setspecific) __gthrw_pthread_setspecific __attribute__ ((__weakref__("pthread_setspecific")));
+
+static __typeof(pthread_create) __gthrw_pthread_create __attribute__ ((__weakref__("pthread_create")));
+static __typeof(pthread_join) __gthrw_pthread_join __attribute__ ((__weakref__("pthread_join")));
+static __typeof(pthread_equal) __gthrw_pthread_equal __attribute__ ((__weakref__("pthread_equal")));
+static __typeof(pthread_self) __gthrw_pthread_self __attribute__ ((__weakref__("pthread_self")));
+static __typeof(pthread_detach) __gthrw_pthread_detach __attribute__ ((__weakref__("pthread_detach")));
+
+static __typeof(pthread_cancel) __gthrw_pthread_cancel __attribute__ ((__weakref__("pthread_cancel")));
+
+static __typeof(sched_yield) __gthrw_sched_yield __attribute__ ((__weakref__("sched_yield")));
+
+static __typeof(pthread_mutex_lock) __gthrw_pthread_mutex_lock __attribute__ ((__weakref__("pthread_mutex_lock")));
+static __typeof(pthread_mutex_trylock) __gthrw_pthread_mutex_trylock __attribute__ ((__weakref__("pthread_mutex_trylock")));
+
+static __typeof(pthread_mutex_timedlock) __gthrw_pthread_mutex_timedlock __attribute__ ((__weakref__("pthread_mutex_timedlock")));
+
+static __typeof(pthread_mutex_unlock) __gthrw_pthread_mutex_unlock __attribute__ ((__weakref__("pthread_mutex_unlock")));
+static __typeof(pthread_mutex_init) __gthrw_pthread_mutex_init __attribute__ ((__weakref__("pthread_mutex_init")));
+static __typeof(pthread_mutex_destroy) __gthrw_pthread_mutex_destroy __attribute__ ((__weakref__("pthread_mutex_destroy")));
+
+static __typeof(pthread_cond_init) __gthrw_pthread_cond_init __attribute__ ((__weakref__("pthread_cond_init")));
+static __typeof(pthread_cond_broadcast) __gthrw_pthread_cond_broadcast __attribute__ ((__weakref__("pthread_cond_broadcast")));
+static __typeof(pthread_cond_signal) __gthrw_pthread_cond_signal __attribute__ ((__weakref__("pthread_cond_signal")));
+static __typeof(pthread_cond_wait) __gthrw_pthread_cond_wait __attribute__ ((__weakref__("pthread_cond_wait")));
+static __typeof(pthread_cond_timedwait) __gthrw_pthread_cond_timedwait __attribute__ ((__weakref__("pthread_cond_timedwait")));
+static __typeof(pthread_cond_destroy) __gthrw_pthread_cond_destroy __attribute__ ((__weakref__("pthread_cond_destroy")));
+
+static __typeof(pthread_key_create) __gthrw_pthread_key_create __attribute__ ((__weakref__("pthread_key_create")));
+static __typeof(pthread_key_delete) __gthrw_pthread_key_delete __attribute__ ((__weakref__("pthread_key_delete")));
+static __typeof(pthread_mutexattr_init) __gthrw_pthread_mutexattr_init __attribute__ ((__weakref__("pthread_mutexattr_init")));
+static __typeof(pthread_mutexattr_settype) __gthrw_pthread_mutexattr_settype __attribute__ ((__weakref__("pthread_mutexattr_settype")));
+static __typeof(pthread_mutexattr_destroy) __gthrw_pthread_mutexattr_destroy __attribute__ ((__weakref__("pthread_mutexattr_destroy")));
+static __typeof(pthread_key_create) __gthrw___pthread_key_create __attribute__ ((__weakref__("__pthread_key_create")));
+static inline int
+__gthread_active_p (void)
+{
+  static void *const __gthread_active_ptr
+    = __extension__ (void *) &__gthrw___pthread_key_create;
+  return __gthread_active_ptr != 0;
+}
+static inline int
+__gthread_create (__gthread_t *__threadid, void *(*__func) (void*),
+    void *__args)
+{
+  return __gthrw_pthread_create (__threadid, __null, __func, __args);
+}
+
+static inline int
+__gthread_join (__gthread_t __threadid, void **__value_ptr)
+{
+  return __gthrw_pthread_join (__threadid, __value_ptr);
+}
+
+static inline int
+__gthread_detach (__gthread_t __threadid)
+{
+  return __gthrw_pthread_detach (__threadid);
+}
+
+static inline int
+__gthread_equal (__gthread_t __t1, __gthread_t __t2)
+{
+  return __gthrw_pthread_equal (__t1, __t2);
+}
+
+static inline __gthread_t
+__gthread_self (void)
+{
+  return __gthrw_pthread_self ();
+}
+
+static inline int
+__gthread_yield (void)
+{
+  return __gthrw_sched_yield ();
+}
+
+static inline int
+__gthread_once (__gthread_once_t *__once, void (*__func) (void))
+{
+  if (__gthread_active_p ())
+    return __gthrw_pthread_once (__once, __func);
+  else
+    return -1;
+}
+
+static inline int
+__gthread_key_create (__gthread_key_t *__key, void (*__dtor) (void *))
+{
+  return __gthrw_pthread_key_create (__key, __dtor);
+}
+
+static inline int
+__gthread_key_delete (__gthread_key_t __key)
+{
+  return __gthrw_pthread_key_delete (__key);
+}
+
+static inline void *
+__gthread_getspecific (__gthread_key_t __key)
+{
+  return __gthrw_pthread_getspecific (__key);
+}
+
+static inline int
+__gthread_setspecific (__gthread_key_t __key, const void *__ptr)
+{
+  return __gthrw_pthread_setspecific (__key, __ptr);
+}
+
+static inline void
+__gthread_mutex_init_function (__gthread_mutex_t *__mutex)
+{
+  if (__gthread_active_p ())
+    __gthrw_pthread_mutex_init (__mutex, __null);
+}
+
+static inline int
+__gthread_mutex_destroy (__gthread_mutex_t *__mutex)
+{
+  if (__gthread_active_p ())
+    return __gthrw_pthread_mutex_destroy (__mutex);
+  else
+    return 0;
+}
+
+static inline int
+__gthread_mutex_lock (__gthread_mutex_t *__mutex)
+{
+  if (__gthread_active_p ())
+    return __gthrw_pthread_mutex_lock (__mutex);
+  else
+    return 0;
+}
+
+static inline int
+__gthread_mutex_trylock (__gthread_mutex_t *__mutex)
+{
+  if (__gthread_active_p ())
+    return __gthrw_pthread_mutex_trylock (__mutex);
+  else
+    return 0;
+}
+
+
+static inline int
+__gthread_mutex_timedlock (__gthread_mutex_t *__mutex,
+      const __gthread_time_t *__abs_timeout)
+{
+  if (__gthread_active_p ())
+    return __gthrw_pthread_mutex_timedlock (__mutex, __abs_timeout);
+  else
+    return 0;
+}
+
+
+static inline int
+__gthread_mutex_unlock (__gthread_mutex_t *__mutex)
+{
+  if (__gthread_active_p ())
+    return __gthrw_pthread_mutex_unlock (__mutex);
+  else
+    return 0;
+}
+static inline int
+__gthread_recursive_mutex_lock (__gthread_recursive_mutex_t *__mutex)
+{
+  return __gthread_mutex_lock (__mutex);
+}
+
+static inline int
+__gthread_recursive_mutex_trylock (__gthread_recursive_mutex_t *__mutex)
+{
+  return __gthread_mutex_trylock (__mutex);
+}
+
+
+static inline int
+__gthread_recursive_mutex_timedlock (__gthread_recursive_mutex_t *__mutex,
+         const __gthread_time_t *__abs_timeout)
+{
+  return __gthread_mutex_timedlock (__mutex, __abs_timeout);
+}
+
+
+static inline int
+__gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *__mutex)
+{
+  return __gthread_mutex_unlock (__mutex);
+}
+
+static inline int
+__gthread_recursive_mutex_destroy (__gthread_recursive_mutex_t *__mutex)
+{
+  return __gthread_mutex_destroy (__mutex);
+}
+static inline int
+__gthread_cond_broadcast (__gthread_cond_t *__cond)
+{
+  return __gthrw_pthread_cond_broadcast (__cond);
+}
+
+static inline int
+__gthread_cond_signal (__gthread_cond_t *__cond)
+{
+  return __gthrw_pthread_cond_signal (__cond);
+}
+
+static inline int
+__gthread_cond_wait (__gthread_cond_t *__cond, __gthread_mutex_t *__mutex)
+{
+  return __gthrw_pthread_cond_wait (__cond, __mutex);
+}
+
+static inline int
+__gthread_cond_timedwait (__gthread_cond_t *__cond, __gthread_mutex_t *__mutex,
+     const __gthread_time_t *__abs_timeout)
+{
+  return __gthrw_pthread_cond_timedwait (__cond, __mutex, __abs_timeout);
+}
+
+static inline int
+__gthread_cond_wait_recursive (__gthread_cond_t *__cond,
+          __gthread_recursive_mutex_t *__mutex)
+{
+  return __gthread_cond_wait (__cond, __mutex);
+}
+
+static inline int
+__gthread_cond_destroy (__gthread_cond_t* __cond)
+{
+  return __gthrw_pthread_cond_destroy (__cond);
+}
+
+
+typedef int _Atomic_word;
+
+namespace __gnu_cxx __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+
+
+
+
+  static inline _Atomic_word
+  __exchange_and_add(volatile _Atomic_word* __mem, int __val)
+  { return __atomic_fetch_add(__mem, __val, 4); }
+
+  static inline void
+  __atomic_add(volatile _Atomic_word* __mem, int __val)
+  { __atomic_fetch_add(__mem, __val, 4); }
+  static inline _Atomic_word
+  __exchange_and_add_single(_Atomic_word* __mem, int __val)
+  {
+    _Atomic_word __result = *__mem;
+    *__mem += __val;
+    return __result;
+  }
+
+  static inline void
+  __atomic_add_single(_Atomic_word* __mem, int __val)
+  { *__mem += __val; }
+
+  static inline _Atomic_word
+  __attribute__ ((__unused__))
+  __exchange_and_add_dispatch(_Atomic_word* __mem, int __val)
+  {
+
+    if (__gthread_active_p())
+      return __exchange_and_add(__mem, __val);
+    else
+      return __exchange_and_add_single(__mem, __val);
+
+
+
+  }
+
+  static inline void
+  __attribute__ ((__unused__))
+  __atomic_add_dispatch(_Atomic_word* __mem, int __val)
+  {
+
+    if (__gthread_active_p())
+      __atomic_add(__mem, __val);
+    else
+      __atomic_add_single(__mem, __val);
+
+
+
+  }
+
+
+}
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+namespace __cxx11 {
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    class basic_string
+    {
+      typedef typename __gnu_cxx::__alloc_traits<_Alloc>::template
+ rebind<_CharT>::other _Char_alloc_type;
+      typedef __gnu_cxx::__alloc_traits<_Char_alloc_type> _Alloc_traits;
+
+
+    public:
+      typedef _Traits traits_type;
+      typedef typename _Traits::char_type value_type;
+      typedef _Char_alloc_type allocator_type;
+      typedef typename _Alloc_traits::size_type size_type;
+      typedef typename _Alloc_traits::difference_type difference_type;
+      typedef typename _Alloc_traits::reference reference;
+      typedef typename _Alloc_traits::const_reference const_reference;
+      typedef typename _Alloc_traits::pointer pointer;
+      typedef typename _Alloc_traits::const_pointer const_pointer;
+      typedef __gnu_cxx::__normal_iterator<pointer, basic_string> iterator;
+      typedef __gnu_cxx::__normal_iterator<const_pointer, basic_string>
+       const_iterator;
+      typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+      typedef std::reverse_iterator<iterator> reverse_iterator;
+
+
+      static const size_type npos = static_cast<size_type>(-1);
+
+    private:
+
+
+
+
+      typedef const_iterator __const_iterator;
+      struct _Alloc_hider : allocator_type
+      {
+
+
+
+
+ _Alloc_hider(pointer __dat, const _Alloc& __a)
+ : allocator_type(__a), _M_p(__dat) { }
+
+ _Alloc_hider(pointer __dat, _Alloc&& __a = _Alloc())
+ : allocator_type(std::move(__a)), _M_p(__dat) { }
+
+
+ pointer _M_p;
+      };
+
+      _Alloc_hider _M_dataplus;
+      size_type _M_string_length;
+
+      enum { _S_local_capacity = 15 / sizeof(_CharT) };
+
+      union
+      {
+ _CharT _M_local_buf[_S_local_capacity + 1];
+ size_type _M_allocated_capacity;
+      };
+
+      void
+      _M_data(pointer __p)
+      { _M_dataplus._M_p = __p; }
+
+      void
+      _M_length(size_type __length)
+      { _M_string_length = __length; }
+
+      pointer
+      _M_data() const
+      { return _M_dataplus._M_p; }
+
+      pointer
+      _M_local_data()
+      {
+
+ return std::pointer_traits<pointer>::pointer_to(*_M_local_buf);
+
+
+
+      }
+
+      const_pointer
+      _M_local_data() const
+      {
+
+ return std::pointer_traits<const_pointer>::pointer_to(*_M_local_buf);
+
+
+
+      }
+
+      void
+      _M_capacity(size_type __capacity)
+      { _M_allocated_capacity = __capacity; }
+
+      void
+      _M_set_length(size_type __n)
+      {
+ _M_length(__n);
+ traits_type::assign(_M_data()[__n], _CharT());
+      }
+
+      bool
+      _M_is_local() const
+      { return _M_data() == _M_local_data(); }
+
+
+      pointer
+      _M_create(size_type&, size_type);
+
+      void
+      _M_dispose()
+      {
+ if (!_M_is_local())
+   _M_destroy(_M_allocated_capacity);
+      }
+
+      void
+      _M_destroy(size_type __size) throw()
+      { _Alloc_traits::deallocate(_M_get_allocator(), _M_data(), __size + 1); }
+
+
+
+      template<typename _InIterator>
+        void
+        _M_construct_aux(_InIterator __beg, _InIterator __end,
+    std::__false_type)
+ {
+          typedef typename iterator_traits<_InIterator>::iterator_category _Tag;
+          _M_construct(__beg, __end, _Tag());
+ }
+
+
+
+      template<typename _Integer>
+        void
+        _M_construct_aux(_Integer __beg, _Integer __end, std::__true_type)
+ { _M_construct_aux_2(static_cast<size_type>(__beg), __end); }
+
+      void
+      _M_construct_aux_2(size_type __req, _CharT __c)
+      { _M_construct(__req, __c); }
+
+      template<typename _InIterator>
+        void
+        _M_construct(_InIterator __beg, _InIterator __end)
+ {
+   typedef typename std::__is_integer<_InIterator>::__type _Integral;
+   _M_construct_aux(__beg, __end, _Integral());
+        }
+
+
+      template<typename _InIterator>
+        void
+        _M_construct(_InIterator __beg, _InIterator __end,
+       std::input_iterator_tag);
+
+
+
+      template<typename _FwdIterator>
+        void
+        _M_construct(_FwdIterator __beg, _FwdIterator __end,
+       std::forward_iterator_tag);
+
+      void
+      _M_construct(size_type __req, _CharT __c);
+
+      allocator_type&
+      _M_get_allocator()
+      { return _M_dataplus; }
+
+      const allocator_type&
+      _M_get_allocator() const
+      { return _M_dataplus; }
+
+    private:
+      size_type
+      _M_check(size_type __pos, const char* __s) const
+      {
+ if (__pos > this->size())
+   __throw_out_of_range_fmt(("%s: __pos (which is %zu) > " "this->size() (which is %zu)")
+                                         ,
+       __s, __pos, this->size());
+ return __pos;
+      }
+
+      void
+      _M_check_length(size_type __n1, size_type __n2, const char* __s) const
+      {
+ if (this->max_size() - (this->size() - __n1) < __n2)
+   __throw_length_error((__s));
+      }
+
+
+
+      size_type
+      _M_limit(size_type __pos, size_type __off) const noexcept
+      {
+ const bool __testoff = __off < this->size() - __pos;
+ return __testoff ? __off : this->size() - __pos;
+      }
+
+
+      bool
+      _M_disjunct(const _CharT* __s) const noexcept
+      {
+ return (less<const _CharT*>()(__s, _M_data())
+  || less<const _CharT*>()(_M_data() + this->size(), __s));
+      }
+
+
+
+      static void
+      _S_copy(_CharT* __d, const _CharT* __s, size_type __n)
+      {
+ if (__n == 1)
+   traits_type::assign(*__d, *__s);
+ else
+   traits_type::copy(__d, __s, __n);
+      }
+
+      static void
+      _S_move(_CharT* __d, const _CharT* __s, size_type __n)
+      {
+ if (__n == 1)
+   traits_type::assign(*__d, *__s);
+ else
+   traits_type::move(__d, __s, __n);
+      }
+
+      static void
+      _S_assign(_CharT* __d, size_type __n, _CharT __c)
+      {
+ if (__n == 1)
+   traits_type::assign(*__d, __c);
+ else
+   traits_type::assign(__d, __n, __c);
+      }
+
+
+
+      template<class _Iterator>
+        static void
+        _S_copy_chars(_CharT* __p, _Iterator __k1, _Iterator __k2)
+        {
+   for (; __k1 != __k2; ++__k1, (void)++__p)
+     traits_type::assign(*__p, *__k1);
+ }
+
+      static void
+      _S_copy_chars(_CharT* __p, iterator __k1, iterator __k2) noexcept
+      { _S_copy_chars(__p, __k1.base(), __k2.base()); }
+
+      static void
+      _S_copy_chars(_CharT* __p, const_iterator __k1, const_iterator __k2)
+      noexcept
+      { _S_copy_chars(__p, __k1.base(), __k2.base()); }
+
+      static void
+      _S_copy_chars(_CharT* __p, _CharT* __k1, _CharT* __k2) noexcept
+      { _S_copy(__p, __k1, __k2 - __k1); }
+
+      static void
+      _S_copy_chars(_CharT* __p, const _CharT* __k1, const _CharT* __k2)
+      noexcept
+      { _S_copy(__p, __k1, __k2 - __k1); }
+
+      static int
+      _S_compare(size_type __n1, size_type __n2) noexcept
+      {
+ const difference_type __d = difference_type(__n1 - __n2);
+
+ if (__d > __gnu_cxx::__numeric_traits<int>::__max)
+   return __gnu_cxx::__numeric_traits<int>::__max;
+ else if (__d < __gnu_cxx::__numeric_traits<int>::__min)
+   return __gnu_cxx::__numeric_traits<int>::__min;
+ else
+   return int(__d);
+      }
+
+      void
+      _M_assign(const basic_string&);
+
+      void
+      _M_mutate(size_type __pos, size_type __len1, const _CharT* __s,
+  size_type __len2);
+
+      void
+      _M_erase(size_type __pos, size_type __n);
+
+    public:
+
+
+
+
+
+
+
+      basic_string()
+      noexcept(is_nothrow_default_constructible<_Alloc>::value)
+      : _M_dataplus(_M_local_data())
+      { _M_set_length(0); }
+
+
+
+
+      explicit
+      basic_string(const _Alloc& __a) noexcept
+      : _M_dataplus(_M_local_data(), __a)
+      { _M_set_length(0); }
+
+
+
+
+
+      basic_string(const basic_string& __str)
+      : _M_dataplus(_M_local_data(),
+      _Alloc_traits::_S_select_on_copy(__str._M_get_allocator()))
+      { _M_construct(__str._M_data(), __str._M_data() + __str.length()); }
+      basic_string(const basic_string& __str, size_type __pos,
+     const _Alloc& __a = _Alloc())
+      : _M_dataplus(_M_local_data(), __a)
+      {
+ const _CharT* __start = __str._M_data()
+   + __str._M_check(__pos, "basic_string::basic_string");
+ _M_construct(__start, __start + __str._M_limit(__pos, npos));
+      }
+
+
+
+
+
+
+
+      basic_string(const basic_string& __str, size_type __pos,
+     size_type __n)
+      : _M_dataplus(_M_local_data())
+      {
+ const _CharT* __start = __str._M_data()
+   + __str._M_check(__pos, "basic_string::basic_string");
+ _M_construct(__start, __start + __str._M_limit(__pos, __n));
+      }
+      basic_string(const basic_string& __str, size_type __pos,
+     size_type __n, const _Alloc& __a)
+      : _M_dataplus(_M_local_data(), __a)
+      {
+ const _CharT* __start
+   = __str._M_data() + __str._M_check(__pos, "string::string");
+ _M_construct(__start, __start + __str._M_limit(__pos, __n));
+      }
+      basic_string(const _CharT* __s, size_type __n,
+     const _Alloc& __a = _Alloc())
+      : _M_dataplus(_M_local_data(), __a)
+      { _M_construct(__s, __s + __n); }
+
+
+
+
+
+
+      basic_string(const _CharT* __s, const _Alloc& __a = _Alloc())
+      : _M_dataplus(_M_local_data(), __a)
+      { _M_construct(__s, __s ? __s + traits_type::length(__s) : __s+npos); }
+
+
+
+
+
+
+
+      basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc())
+      : _M_dataplus(_M_local_data(), __a)
+      { _M_construct(__n, __c); }
+      basic_string(basic_string&& __str) noexcept
+      : _M_dataplus(_M_local_data(), std::move(__str._M_get_allocator()))
+      {
+ if (__str._M_is_local())
+   {
+     traits_type::copy(_M_local_buf, __str._M_local_buf,
+         _S_local_capacity + 1);
+   }
+ else
+   {
+     _M_data(__str._M_data());
+     _M_capacity(__str._M_allocated_capacity);
+   }
+
+
+
+
+ _M_length(__str.length());
+ __str._M_data(__str._M_local_data());
+ __str._M_set_length(0);
+      }
+
+
+
+
+
+
+      basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc())
+      : _M_dataplus(_M_local_data(), __a)
+      { _M_construct(__l.begin(), __l.end()); }
+
+      basic_string(const basic_string& __str, const _Alloc& __a)
+      : _M_dataplus(_M_local_data(), __a)
+      { _M_construct(__str.begin(), __str.end()); }
+
+      basic_string(basic_string&& __str, const _Alloc& __a)
+      noexcept(_Alloc_traits::_S_always_equal())
+      : _M_dataplus(_M_local_data(), __a)
+      {
+ if (__str._M_is_local())
+   {
+     traits_type::copy(_M_local_buf, __str._M_local_buf,
+         _S_local_capacity + 1);
+     _M_length(__str.length());
+     __str._M_set_length(0);
+   }
+ else if (_Alloc_traits::_S_always_equal()
+     || __str.get_allocator() == __a)
+   {
+     _M_data(__str._M_data());
+     _M_length(__str.length());
+     _M_capacity(__str._M_allocated_capacity);
+     __str._M_data(__str._M_local_buf);
+     __str._M_set_length(0);
+   }
+ else
+   _M_construct(__str.begin(), __str.end());
+      }
+      template<typename _InputIterator,
+        typename = std::_RequireInputIter<_InputIterator>>
+
+
+
+        basic_string(_InputIterator __beg, _InputIterator __end,
+       const _Alloc& __a = _Alloc())
+ : _M_dataplus(_M_local_data(), __a)
+ { _M_construct(__beg, __end); }
+      ~basic_string()
+      { _M_dispose(); }
+
+
+
+
+
+      basic_string&
+      operator=(const basic_string& __str)
+      {
+
+ if (_Alloc_traits::_S_propagate_on_copy_assign())
+   {
+     if (!_Alloc_traits::_S_always_equal() && !_M_is_local()
+  && _M_get_allocator() != __str._M_get_allocator())
+       {
+
+
+  if (__str.size() <= _S_local_capacity)
+    {
+      _M_destroy(_M_allocated_capacity);
+      _M_data(_M_local_data());
+      _M_set_length(0);
+    }
+  else
+    {
+      const auto __len = __str.size();
+      auto __alloc = __str._M_get_allocator();
+
+      auto __ptr = _Alloc_traits::allocate(__alloc, __len + 1);
+      _M_destroy(_M_allocated_capacity);
+      _M_data(__ptr);
+      _M_capacity(__len);
+      _M_set_length(__len);
+    }
+       }
+     std::__alloc_on_copy(_M_get_allocator(), __str._M_get_allocator());
+   }
+
+ return this->assign(__str);
+      }
+
+
+
+
+
+      basic_string&
+      operator=(const _CharT* __s)
+      { return this->assign(__s); }
+      basic_string&
+      operator=(_CharT __c)
+      {
+ this->assign(1, __c);
+ return *this;
+      }
+      basic_string&
+      operator=(basic_string&& __str)
+      noexcept(_Alloc_traits::_S_nothrow_move())
+      {
+ if (!_M_is_local() && _Alloc_traits::_S_propagate_on_move_assign()
+     && !_Alloc_traits::_S_always_equal()
+     && _M_get_allocator() != __str._M_get_allocator())
+   {
+
+     _M_destroy(_M_allocated_capacity);
+     _M_data(_M_local_data());
+     _M_set_length(0);
+   }
+
+ std::__alloc_on_move(_M_get_allocator(), __str._M_get_allocator());
+
+ if (!__str._M_is_local()
+     && (_Alloc_traits::_S_propagate_on_move_assign()
+       || _Alloc_traits::_S_always_equal()))
+   {
+     pointer __data = nullptr;
+     size_type __capacity;
+     if (!_M_is_local())
+       {
+  if (_Alloc_traits::_S_always_equal())
+    {
+      __data = _M_data();
+      __capacity = _M_allocated_capacity;
+    }
+  else
+    _M_destroy(_M_allocated_capacity);
+       }
+
+     _M_data(__str._M_data());
+     _M_length(__str.length());
+     _M_capacity(__str._M_allocated_capacity);
+     if (__data)
+       {
+  __str._M_data(__data);
+  __str._M_capacity(__capacity);
+       }
+     else
+       __str._M_data(__str._M_local_buf);
+   }
+ else
+     assign(__str);
+ __str.clear();
+ return *this;
+      }
+
+
+
+
+
+      basic_string&
+      operator=(initializer_list<_CharT> __l)
+      {
+ this->assign(__l.begin(), __l.size());
+ return *this;
+      }
+      iterator
+      begin() noexcept
+      { return iterator(_M_data()); }
+
+
+
+
+
+      const_iterator
+      begin() const noexcept
+      { return const_iterator(_M_data()); }
+
+
+
+
+
+      iterator
+      end() noexcept
+      { return iterator(_M_data() + this->size()); }
+
+
+
+
+
+      const_iterator
+      end() const noexcept
+      { return const_iterator(_M_data() + this->size()); }
+
+
+
+
+
+
+      reverse_iterator
+      rbegin() noexcept
+      { return reverse_iterator(this->end()); }
+
+
+
+
+
+
+      const_reverse_iterator
+      rbegin() const noexcept
+      { return const_reverse_iterator(this->end()); }
+
+
+
+
+
+
+      reverse_iterator
+      rend() noexcept
+      { return reverse_iterator(this->begin()); }
+
+
+
+
+
+
+      const_reverse_iterator
+      rend() const noexcept
+      { return const_reverse_iterator(this->begin()); }
+
+
+
+
+
+
+      const_iterator
+      cbegin() const noexcept
+      { return const_iterator(this->_M_data()); }
+
+
+
+
+
+      const_iterator
+      cend() const noexcept
+      { return const_iterator(this->_M_data() + this->size()); }
+
+
+
+
+
+
+      const_reverse_iterator
+      crbegin() const noexcept
+      { return const_reverse_iterator(this->end()); }
+
+
+
+
+
+
+      const_reverse_iterator
+      crend() const noexcept
+      { return const_reverse_iterator(this->begin()); }
+
+
+    public:
+
+
+
+      size_type
+      size() const noexcept
+      { return _M_string_length; }
+
+
+
+      size_type
+      length() const noexcept
+      { return _M_string_length; }
+
+
+      size_type
+      max_size() const noexcept
+      { return (_Alloc_traits::max_size(_M_get_allocator()) - 1) / 2; }
+      void
+      resize(size_type __n, _CharT __c);
+      void
+      resize(size_type __n)
+      { this->resize(__n, _CharT()); }
+
+
+
+      void
+      shrink_to_fit() noexcept
+      {
+      }
+
+
+
+
+
+
+      size_type
+      capacity() const noexcept
+      {
+ return _M_is_local() ? size_type(_S_local_capacity)
+                      : _M_allocated_capacity;
+      }
+      void
+      reserve(size_type __res_arg = 0);
+
+
+
+
+      void
+      clear() noexcept
+      { _M_set_length(0); }
+
+
+
+
+
+      bool
+      empty() const noexcept
+      { return this->size() == 0; }
+      const_reference
+      operator[] (size_type __pos) const noexcept
+      {
+ ;
+ return _M_data()[__pos];
+      }
+      reference
+      operator[](size_type __pos)
+      {
+
+
+ ;
+
+ ;
+ return _M_data()[__pos];
+      }
+      const_reference
+      at(size_type __n) const
+      {
+ if (__n >= this->size())
+   __throw_out_of_range_fmt(("basic_string::at: __n " "(which is %zu) >= this->size() " "(which is %zu)")
+
+                            ,
+       __n, this->size());
+ return _M_data()[__n];
+      }
+      reference
+      at(size_type __n)
+      {
+ if (__n >= size())
+   __throw_out_of_range_fmt(("basic_string::at: __n " "(which is %zu) >= this->size() " "(which is %zu)")
+
+                            ,
+       __n, this->size());
+ return _M_data()[__n];
+      }
+
+
+
+
+
+
+      reference
+      front() noexcept
+      {
+ ;
+ return operator[](0);
+      }
+
+
+
+
+
+      const_reference
+      front() const noexcept
+      {
+ ;
+ return operator[](0);
+      }
+
+
+
+
+
+      reference
+      back() noexcept
+      {
+ ;
+ return operator[](this->size() - 1);
+      }
+
+
+
+
+
+      const_reference
+      back() const noexcept
+      {
+ ;
+ return operator[](this->size() - 1);
+      }
+      basic_string&
+      operator+=(const basic_string& __str)
+      { return this->append(__str); }
+
+
+
+
+
+
+      basic_string&
+      operator+=(const _CharT* __s)
+      { return this->append(__s); }
+
+
+
+
+
+
+      basic_string&
+      operator+=(_CharT __c)
+      {
+ this->push_back(__c);
+ return *this;
+      }
+
+
+
+
+
+
+
+      basic_string&
+      operator+=(initializer_list<_CharT> __l)
+      { return this->append(__l.begin(), __l.size()); }
+      basic_string&
+      append(const basic_string& __str)
+      { return _M_append(__str._M_data(), __str.size()); }
+      basic_string&
+      append(const basic_string& __str, size_type __pos, size_type __n)
+      { return _M_append(__str._M_data()
+    + __str._M_check(__pos, "basic_string::append"),
+    __str._M_limit(__pos, __n)); }
+
+
+
+
+
+
+
+      basic_string&
+      append(const _CharT* __s, size_type __n)
+      {
+ ;
+ _M_check_length(size_type(0), __n, "basic_string::append");
+ return _M_append(__s, __n);
+      }
+
+
+
+
+
+
+      basic_string&
+      append(const _CharT* __s)
+      {
+ ;
+ const size_type __n = traits_type::length(__s);
+ _M_check_length(size_type(0), __n, "basic_string::append");
+ return _M_append(__s, __n);
+      }
+      basic_string&
+      append(size_type __n, _CharT __c)
+      { return _M_replace_aux(this->size(), size_type(0), __n, __c); }
+
+
+
+
+
+
+
+      basic_string&
+      append(initializer_list<_CharT> __l)
+      { return this->append(__l.begin(), __l.size()); }
+      template<class _InputIterator,
+        typename = std::_RequireInputIter<_InputIterator>>
+
+
+
+        basic_string&
+        append(_InputIterator __first, _InputIterator __last)
+        { return this->replace(end(), end(), __first, __last); }
+      void
+      push_back(_CharT __c)
+      {
+ const size_type __size = this->size();
+ if (__size + 1 > this->capacity())
+   this->_M_mutate(__size, size_type(0), 0, size_type(1));
+ traits_type::assign(this->_M_data()[__size], __c);
+ this->_M_set_length(__size + 1);
+      }
+
+
+
+
+
+
+      basic_string&
+      assign(const basic_string& __str)
+      {
+ this->_M_assign(__str);
+ return *this;
+      }
+      basic_string&
+      assign(basic_string&& __str)
+      noexcept(_Alloc_traits::_S_nothrow_move())
+      {
+
+
+ return *this = std::move(__str);
+      }
+      basic_string&
+      assign(const basic_string& __str, size_type __pos, size_type __n)
+      { return _M_replace(size_type(0), this->size(), __str._M_data()
+     + __str._M_check(__pos, "basic_string::assign"),
+     __str._M_limit(__pos, __n)); }
+      basic_string&
+      assign(const _CharT* __s, size_type __n)
+      {
+ ;
+ return _M_replace(size_type(0), this->size(), __s, __n);
+      }
+      basic_string&
+      assign(const _CharT* __s)
+      {
+ ;
+ return _M_replace(size_type(0), this->size(), __s,
+     traits_type::length(__s));
+      }
+      basic_string&
+      assign(size_type __n, _CharT __c)
+      { return _M_replace_aux(size_type(0), this->size(), __n, __c); }
+      template<class _InputIterator,
+        typename = std::_RequireInputIter<_InputIterator>>
+
+
+
+        basic_string&
+        assign(_InputIterator __first, _InputIterator __last)
+        { return this->replace(begin(), end(), __first, __last); }
+
+
+
+
+
+
+
+      basic_string&
+      assign(initializer_list<_CharT> __l)
+      { return this->assign(__l.begin(), __l.size()); }
+      iterator
+      insert(const_iterator __p, size_type __n, _CharT __c)
+      {
+ ;
+ const size_type __pos = __p - begin();
+ this->replace(__p, __p, __n, __c);
+ return iterator(this->_M_data() + __pos);
+      }
+      template<class _InputIterator,
+        typename = std::_RequireInputIter<_InputIterator>>
+ iterator
+        insert(const_iterator __p, _InputIterator __beg, _InputIterator __end)
+        {
+   ;
+   const size_type __pos = __p - begin();
+   this->replace(__p, __p, __beg, __end);
+   return iterator(this->_M_data() + __pos);
+ }
+      void
+      insert(iterator __p, initializer_list<_CharT> __l)
+      {
+ ;
+ this->insert(__p - begin(), __l.begin(), __l.size());
+      }
+      basic_string&
+      insert(size_type __pos1, const basic_string& __str)
+      { return this->replace(__pos1, size_type(0),
+        __str._M_data(), __str.size()); }
+      basic_string&
+      insert(size_type __pos1, const basic_string& __str,
+      size_type __pos2, size_type __n)
+      { return this->replace(__pos1, size_type(0), __str._M_data()
+        + __str._M_check(__pos2, "basic_string::insert"),
+        __str._M_limit(__pos2, __n)); }
+      basic_string&
+      insert(size_type __pos, const _CharT* __s, size_type __n)
+      { return this->replace(__pos, size_type(0), __s, __n); }
+      basic_string&
+      insert(size_type __pos, const _CharT* __s)
+      {
+ ;
+ return this->replace(__pos, size_type(0), __s,
+        traits_type::length(__s));
+      }
+      basic_string&
+      insert(size_type __pos, size_type __n, _CharT __c)
+      { return _M_replace_aux(_M_check(__pos, "basic_string::insert"),
+         size_type(0), __n, __c); }
+      iterator
+      insert(__const_iterator __p, _CharT __c)
+      {
+ ;
+ const size_type __pos = __p - begin();
+ _M_replace_aux(__pos, size_type(0), size_type(1), __c);
+ return iterator(_M_data() + __pos);
+      }
+      basic_string&
+      erase(size_type __pos = 0, size_type __n = npos)
+      {
+ _M_check(__pos, "basic_string::erase");
+ if (__n == npos)
+   this->_M_set_length(__pos);
+ else if (__n != 0)
+   this->_M_erase(__pos, _M_limit(__pos, __n));
+ return *this;
+      }
+      iterator
+      erase(__const_iterator __position)
+      {
+
+                           ;
+ const size_type __pos = __position - begin();
+ this->_M_erase(__pos, size_type(1));
+ return iterator(_M_data() + __pos);
+      }
+      iterator
+      erase(__const_iterator __first, __const_iterator __last)
+      {
+
+                        ;
+        const size_type __pos = __first - begin();
+ if (__last == end())
+   this->_M_set_length(__pos);
+ else
+   this->_M_erase(__pos, __last - __first);
+ return iterator(this->_M_data() + __pos);
+      }
+
+
+
+
+
+
+
+      void
+      pop_back() noexcept
+      {
+ ;
+ _M_erase(size() - 1, 1);
+      }
+      basic_string&
+      replace(size_type __pos, size_type __n, const basic_string& __str)
+      { return this->replace(__pos, __n, __str._M_data(), __str.size()); }
+      basic_string&
+      replace(size_type __pos1, size_type __n1, const basic_string& __str,
+       size_type __pos2, size_type __n2)
+      { return this->replace(__pos1, __n1, __str._M_data()
+        + __str._M_check(__pos2, "basic_string::replace"),
+        __str._M_limit(__pos2, __n2)); }
+      basic_string&
+      replace(size_type __pos, size_type __n1, const _CharT* __s,
+       size_type __n2)
+      {
+ ;
+ return _M_replace(_M_check(__pos, "basic_string::replace"),
+     _M_limit(__pos, __n1), __s, __n2);
+      }
+      basic_string&
+      replace(size_type __pos, size_type __n1, const _CharT* __s)
+      {
+ ;
+ return this->replace(__pos, __n1, __s, traits_type::length(__s));
+      }
+      basic_string&
+      replace(size_type __pos, size_type __n1, size_type __n2, _CharT __c)
+      { return _M_replace_aux(_M_check(__pos, "basic_string::replace"),
+         _M_limit(__pos, __n1), __n2, __c); }
+      basic_string&
+      replace(__const_iterator __i1, __const_iterator __i2,
+       const basic_string& __str)
+      { return this->replace(__i1, __i2, __str._M_data(), __str.size()); }
+      basic_string&
+      replace(__const_iterator __i1, __const_iterator __i2,
+       const _CharT* __s, size_type __n)
+      {
+
+                      ;
+ return this->replace(__i1 - begin(), __i2 - __i1, __s, __n);
+      }
+      basic_string&
+      replace(__const_iterator __i1, __const_iterator __i2, const _CharT* __s)
+      {
+ ;
+ return this->replace(__i1, __i2, __s, traits_type::length(__s));
+      }
+      basic_string&
+      replace(__const_iterator __i1, __const_iterator __i2, size_type __n,
+       _CharT __c)
+      {
+
+                      ;
+ return _M_replace_aux(__i1 - begin(), __i2 - __i1, __n, __c);
+      }
+      template<class _InputIterator,
+        typename = std::_RequireInputIter<_InputIterator>>
+        basic_string&
+        replace(const_iterator __i1, const_iterator __i2,
+  _InputIterator __k1, _InputIterator __k2)
+        {
+  
+                        ;
+   ;
+   return this->_M_replace_dispatch(__i1, __i2, __k1, __k2,
+        std::__false_type());
+ }
+      basic_string&
+      replace(__const_iterator __i1, __const_iterator __i2,
+       _CharT* __k1, _CharT* __k2)
+      {
+
+                      ;
+ ;
+ return this->replace(__i1 - begin(), __i2 - __i1,
+        __k1, __k2 - __k1);
+      }
+
+      basic_string&
+      replace(__const_iterator __i1, __const_iterator __i2,
+       const _CharT* __k1, const _CharT* __k2)
+      {
+
+                      ;
+ ;
+ return this->replace(__i1 - begin(), __i2 - __i1,
+        __k1, __k2 - __k1);
+      }
+
+      basic_string&
+      replace(__const_iterator __i1, __const_iterator __i2,
+       iterator __k1, iterator __k2)
+      {
+
+                      ;
+ ;
+ return this->replace(__i1 - begin(), __i2 - __i1,
+        __k1.base(), __k2 - __k1);
+      }
+
+      basic_string&
+      replace(__const_iterator __i1, __const_iterator __i2,
+       const_iterator __k1, const_iterator __k2)
+      {
+
+                      ;
+ ;
+ return this->replace(__i1 - begin(), __i2 - __i1,
+        __k1.base(), __k2 - __k1);
+      }
+      basic_string& replace(const_iterator __i1, const_iterator __i2,
+       initializer_list<_CharT> __l)
+      { return this->replace(__i1, __i2, __l.begin(), __l.size()); }
+    private:
+      template<class _Integer>
+ basic_string&
+ _M_replace_dispatch(const_iterator __i1, const_iterator __i2,
+       _Integer __n, _Integer __val, __true_type)
+        { return _M_replace_aux(__i1 - begin(), __i2 - __i1, __n, __val); }
+
+      template<class _InputIterator>
+ basic_string&
+ _M_replace_dispatch(const_iterator __i1, const_iterator __i2,
+       _InputIterator __k1, _InputIterator __k2,
+       __false_type);
+
+      basic_string&
+      _M_replace_aux(size_type __pos1, size_type __n1, size_type __n2,
+       _CharT __c);
+
+      basic_string&
+      _M_replace(size_type __pos, size_type __len1, const _CharT* __s,
+   const size_type __len2);
+
+      basic_string&
+      _M_append(const _CharT* __s, size_type __n);
+
+    public:
+      size_type
+      copy(_CharT* __s, size_type __n, size_type __pos = 0) const;
+      void
+      swap(basic_string& __s) noexcept;
+      const _CharT*
+      c_str() const noexcept
+      { return _M_data(); }
+      const _CharT*
+      data() const noexcept
+      { return _M_data(); }
+      allocator_type
+      get_allocator() const noexcept
+      { return _M_get_allocator(); }
+      size_type
+      find(const _CharT* __s, size_type __pos, size_type __n) const
+      noexcept;
+      size_type
+      find(const basic_string& __str, size_type __pos = 0) const
+      noexcept
+      { return this->find(__str.data(), __pos, __str.size()); }
+      size_type
+      find(const _CharT* __s, size_type __pos = 0) const noexcept
+      {
+ ;
+ return this->find(__s, __pos, traits_type::length(__s));
+      }
+      size_type
+      find(_CharT __c, size_type __pos = 0) const noexcept;
+      size_type
+      rfind(const basic_string& __str, size_type __pos = npos) const
+      noexcept
+      { return this->rfind(__str.data(), __pos, __str.size()); }
+      size_type
+      rfind(const _CharT* __s, size_type __pos, size_type __n) const
+      noexcept;
+      size_type
+      rfind(const _CharT* __s, size_type __pos = npos) const
+      {
+ ;
+ return this->rfind(__s, __pos, traits_type::length(__s));
+      }
+      size_type
+      rfind(_CharT __c, size_type __pos = npos) const noexcept;
+      size_type
+      find_first_of(const basic_string& __str, size_type __pos = 0) const
+      noexcept
+      { return this->find_first_of(__str.data(), __pos, __str.size()); }
+      size_type
+      find_first_of(const _CharT* __s, size_type __pos, size_type __n) const
+      noexcept;
+      size_type
+      find_first_of(const _CharT* __s, size_type __pos = 0) const
+      noexcept
+      {
+ ;
+ return this->find_first_of(__s, __pos, traits_type::length(__s));
+      }
+      size_type
+      find_first_of(_CharT __c, size_type __pos = 0) const noexcept
+      { return this->find(__c, __pos); }
+      size_type
+      find_last_of(const basic_string& __str, size_type __pos = npos) const
+      noexcept
+      { return this->find_last_of(__str.data(), __pos, __str.size()); }
+      size_type
+      find_last_of(const _CharT* __s, size_type __pos, size_type __n) const
+      noexcept;
+      size_type
+      find_last_of(const _CharT* __s, size_type __pos = npos) const
+      noexcept
+      {
+ ;
+ return this->find_last_of(__s, __pos, traits_type::length(__s));
+      }
+      size_type
+      find_last_of(_CharT __c, size_type __pos = npos) const noexcept
+      { return this->rfind(__c, __pos); }
+      size_type
+      find_first_not_of(const basic_string& __str, size_type __pos = 0) const
+      noexcept
+      { return this->find_first_not_of(__str.data(), __pos, __str.size()); }
+      size_type
+      find_first_not_of(const _CharT* __s, size_type __pos,
+   size_type __n) const noexcept;
+      size_type
+      find_first_not_of(const _CharT* __s, size_type __pos = 0) const
+      noexcept
+      {
+ ;
+ return this->find_first_not_of(__s, __pos, traits_type::length(__s));
+      }
+      size_type
+      find_first_not_of(_CharT __c, size_type __pos = 0) const
+      noexcept;
+      size_type
+      find_last_not_of(const basic_string& __str, size_type __pos = npos) const
+      noexcept
+      { return this->find_last_not_of(__str.data(), __pos, __str.size()); }
+      size_type
+      find_last_not_of(const _CharT* __s, size_type __pos,
+         size_type __n) const noexcept;
+      size_type
+      find_last_not_of(const _CharT* __s, size_type __pos = npos) const
+      noexcept
+      {
+ ;
+ return this->find_last_not_of(__s, __pos, traits_type::length(__s));
+      }
+      size_type
+      find_last_not_of(_CharT __c, size_type __pos = npos) const
+      noexcept;
+      basic_string
+      substr(size_type __pos = 0, size_type __n = npos) const
+      { return basic_string(*this,
+       _M_check(__pos, "basic_string::substr"), __n); }
+      int
+      compare(const basic_string& __str) const
+      {
+ const size_type __size = this->size();
+ const size_type __osize = __str.size();
+ const size_type __len = std::min(__size, __osize);
+
+ int __r = traits_type::compare(_M_data(), __str.data(), __len);
+ if (!__r)
+   __r = _S_compare(__size, __osize);
+ return __r;
+      }
+      int
+      compare(size_type __pos, size_type __n, const basic_string& __str) const;
+      int
+      compare(size_type __pos1, size_type __n1, const basic_string& __str,
+       size_type __pos2, size_type __n2) const;
+      int
+      compare(const _CharT* __s) const noexcept;
+      int
+      compare(size_type __pos, size_type __n1, const _CharT* __s) const;
+      int
+      compare(size_type __pos, size_type __n1, const _CharT* __s,
+       size_type __n2) const;
+
+
+      template<typename, typename, typename> friend class basic_stringbuf;
+    };
+}
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_string<_CharT, _Traits, _Alloc>
+    operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+       const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+    {
+      basic_string<_CharT, _Traits, _Alloc> __str(__lhs);
+      __str.append(__rhs);
+      return __str;
+    }
+
+
+
+
+
+
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_string<_CharT,_Traits,_Alloc>
+    operator+(const _CharT* __lhs,
+       const basic_string<_CharT,_Traits,_Alloc>& __rhs);
+
+
+
+
+
+
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_string<_CharT,_Traits,_Alloc>
+    operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs);
+
+
+
+
+
+
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline basic_string<_CharT, _Traits, _Alloc>
+    operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+       const _CharT* __rhs)
+    {
+      basic_string<_CharT, _Traits, _Alloc> __str(__lhs);
+      __str.append(__rhs);
+      return __str;
+    }
+
+
+
+
+
+
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline basic_string<_CharT, _Traits, _Alloc>
+    operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs)
+    {
+      typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
+      typedef typename __string_type::size_type __size_type;
+      __string_type __str(__lhs);
+      __str.append(__size_type(1), __rhs);
+      return __str;
+    }
+
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline basic_string<_CharT, _Traits, _Alloc>
+    operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
+       const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+    { return std::move(__lhs.append(__rhs)); }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline basic_string<_CharT, _Traits, _Alloc>
+    operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+       basic_string<_CharT, _Traits, _Alloc>&& __rhs)
+    { return std::move(__rhs.insert(0, __lhs)); }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline basic_string<_CharT, _Traits, _Alloc>
+    operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
+       basic_string<_CharT, _Traits, _Alloc>&& __rhs)
+    {
+      const auto __size = __lhs.size() + __rhs.size();
+      const bool __cond = (__size > __lhs.capacity()
+      && __size <= __rhs.capacity());
+      return __cond ? std::move(__rhs.insert(0, __lhs))
+             : std::move(__lhs.append(__rhs));
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline basic_string<_CharT, _Traits, _Alloc>
+    operator+(const _CharT* __lhs,
+       basic_string<_CharT, _Traits, _Alloc>&& __rhs)
+    { return std::move(__rhs.insert(0, __lhs)); }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline basic_string<_CharT, _Traits, _Alloc>
+    operator+(_CharT __lhs,
+       basic_string<_CharT, _Traits, _Alloc>&& __rhs)
+    { return std::move(__rhs.insert(0, 1, __lhs)); }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline basic_string<_CharT, _Traits, _Alloc>
+    operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
+       const _CharT* __rhs)
+    { return std::move(__lhs.append(__rhs)); }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline basic_string<_CharT, _Traits, _Alloc>
+    operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
+       _CharT __rhs)
+    { return std::move(__lhs.append(1, __rhs)); }
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+        const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+    noexcept
+    { return __lhs.compare(__rhs) == 0; }
+
+  template<typename _CharT>
+    inline
+    typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value, bool>::__type
+    operator==(const basic_string<_CharT>& __lhs,
+        const basic_string<_CharT>& __rhs) noexcept
+    { return (__lhs.size() == __rhs.size()
+       && !std::char_traits<_CharT>::compare(__lhs.data(), __rhs.data(),
+          __lhs.size())); }
+
+
+
+
+
+
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator==(const _CharT* __lhs,
+        const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+    { return __rhs.compare(__lhs) == 0; }
+
+
+
+
+
+
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+        const _CharT* __rhs)
+    { return __lhs.compare(__rhs) == 0; }
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+        const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+    noexcept
+    { return !(__lhs == __rhs); }
+
+
+
+
+
+
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator!=(const _CharT* __lhs,
+        const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+    { return !(__lhs == __rhs); }
+
+
+
+
+
+
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+        const _CharT* __rhs)
+    { return !(__lhs == __rhs); }
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+       const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+    noexcept
+    { return __lhs.compare(__rhs) < 0; }
+
+
+
+
+
+
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+       const _CharT* __rhs)
+    { return __lhs.compare(__rhs) < 0; }
+
+
+
+
+
+
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator<(const _CharT* __lhs,
+       const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+    { return __rhs.compare(__lhs) > 0; }
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+       const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+    noexcept
+    { return __lhs.compare(__rhs) > 0; }
+
+
+
+
+
+
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+       const _CharT* __rhs)
+    { return __lhs.compare(__rhs) > 0; }
+
+
+
+
+
+
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator>(const _CharT* __lhs,
+       const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+    { return __rhs.compare(__lhs) < 0; }
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator<=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+        const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+    noexcept
+    { return __lhs.compare(__rhs) <= 0; }
+
+
+
+
+
+
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator<=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+        const _CharT* __rhs)
+    { return __lhs.compare(__rhs) <= 0; }
+
+
+
+
+
+
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator<=(const _CharT* __lhs,
+        const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+    { return __rhs.compare(__lhs) >= 0; }
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator>=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+        const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+    noexcept
+    { return __lhs.compare(__rhs) >= 0; }
+
+
+
+
+
+
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator>=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+        const _CharT* __rhs)
+    { return __lhs.compare(__rhs) >= 0; }
+
+
+
+
+
+
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator>=(const _CharT* __lhs,
+      const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+    { return __rhs.compare(__lhs) <= 0; }
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline void
+    swap(basic_string<_CharT, _Traits, _Alloc>& __lhs,
+  basic_string<_CharT, _Traits, _Alloc>& __rhs)
+    noexcept(noexcept(__lhs.swap(__rhs)))
+    { __lhs.swap(__rhs); }
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_istream<_CharT, _Traits>&
+    operator>>(basic_istream<_CharT, _Traits>& __is,
+        basic_string<_CharT, _Traits, _Alloc>& __str);
+
+  template<>
+    basic_istream<char>&
+    operator>>(basic_istream<char>& __is, basic_string<char>& __str);
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline basic_ostream<_CharT, _Traits>&
+    operator<<(basic_ostream<_CharT, _Traits>& __os,
+        const basic_string<_CharT, _Traits, _Alloc>& __str)
+    {
+
+
+      return __ostream_insert(__os, __str.data(), __str.size());
+    }
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_istream<_CharT, _Traits>&
+    getline(basic_istream<_CharT, _Traits>& __is,
+     basic_string<_CharT, _Traits, _Alloc>& __str, _CharT __delim);
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline basic_istream<_CharT, _Traits>&
+    getline(basic_istream<_CharT, _Traits>& __is,
+     basic_string<_CharT, _Traits, _Alloc>& __str)
+    { return std::getline(__is, __str, __is.widen('\n')); }
+
+
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline basic_istream<_CharT, _Traits>&
+    getline(basic_istream<_CharT, _Traits>&& __is,
+     basic_string<_CharT, _Traits, _Alloc>& __str, _CharT __delim)
+    { return std::getline(__is, __str, __delim); }
+
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline basic_istream<_CharT, _Traits>&
+    getline(basic_istream<_CharT, _Traits>&& __is,
+     basic_string<_CharT, _Traits, _Alloc>& __str)
+    { return std::getline(__is, __str); }
+
+
+  template<>
+    basic_istream<char>&
+    getline(basic_istream<char>& __in, basic_string<char>& __str,
+     char __delim);
+
+
+  template<>
+    basic_istream<wchar_t>&
+    getline(basic_istream<wchar_t>& __in, basic_string<wchar_t>& __str,
+     wchar_t __delim);
+
+
+
+}
+
+
+
+       
+       
+       
+
+
+
+
+       
+
+
+extern "C" {
+
+
+
+
+
+
+
+typedef struct
+{
+  __off_t __pos;
+  __mbstate_t __state;
+} _G_fpos_t;
+typedef struct
+{
+  __off64_t __pos;
+  __mbstate_t __state;
+} _G_fpos64_t;
+struct _IO_jump_t; struct _IO_FILE;
+typedef void _IO_lock_t;
+
+
+
+
+
+struct _IO_marker {
+  struct _IO_marker *_next;
+  struct _IO_FILE *_sbuf;
+
+
+
+  int _pos;
+};
+
+
+enum __codecvt_result
+{
+  __codecvt_ok,
+  __codecvt_partial,
+  __codecvt_error,
+  __codecvt_noconv
+};
+struct _IO_FILE {
+  int _flags;
+
+
+
+
+  char* _IO_read_ptr;
+  char* _IO_read_end;
+  char* _IO_read_base;
+  char* _IO_write_base;
+  char* _IO_write_ptr;
+  char* _IO_write_end;
+  char* _IO_buf_base;
+  char* _IO_buf_end;
+
+  char *_IO_save_base;
+  char *_IO_backup_base;
+  char *_IO_save_end;
+
+  struct _IO_marker *_markers;
+
+  struct _IO_FILE *_chain;
+
+  int _fileno;
+
+
+
+  int _flags2;
+
+  __off_t _old_offset;
+
+
+
+  unsigned short _cur_column;
+  signed char _vtable_offset;
+  char _shortbuf[1];
+
+
+
+  _IO_lock_t *_lock;
+  __off64_t _offset;
+  void *__pad1;
+  void *__pad2;
+  void *__pad3;
+  void *__pad4;
+  size_t __pad5;
+
+  int _mode;
+
+  char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
+
+};
+
+
+
+
+
+struct _IO_FILE_plus;
+
+extern struct _IO_FILE_plus _IO_2_1_stdin_;
+extern struct _IO_FILE_plus _IO_2_1_stdout_;
+extern struct _IO_FILE_plus _IO_2_1_stderr_;
+typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes);
+
+
+
+
+
+
+
+typedef __ssize_t __io_write_fn (void *__cookie, const char *__buf,
+     size_t __n);
+
+
+
+
+
+
+
+typedef int __io_seek_fn (void *__cookie, __off64_t *__pos, int __w);
+
+
+typedef int __io_close_fn (void *__cookie);
+
+
+
+
+typedef __io_read_fn cookie_read_function_t;
+typedef __io_write_fn cookie_write_function_t;
+typedef __io_seek_fn cookie_seek_function_t;
+typedef __io_close_fn cookie_close_function_t;
+
+
+typedef struct
+{
+  __io_read_fn *read;
+  __io_write_fn *write;
+  __io_seek_fn *seek;
+  __io_close_fn *close;
+} _IO_cookie_io_functions_t;
+typedef _IO_cookie_io_functions_t cookie_io_functions_t;
+
+struct _IO_cookie_file;
+
+
+extern void _IO_cookie_init (struct _IO_cookie_file *__cfile, int __read_write,
+        void *__cookie, _IO_cookie_io_functions_t __fns);
+
+
+
+
+extern "C" {
+
+
+extern int __underflow (_IO_FILE *);
+extern int __uflow (_IO_FILE *);
+extern int __overflow (_IO_FILE *, int);
+extern int _IO_getc (_IO_FILE *__fp);
+extern int _IO_putc (int __c, _IO_FILE *__fp);
+extern int _IO_feof (_IO_FILE *__fp) throw ();
+extern int _IO_ferror (_IO_FILE *__fp) throw ();
+
+extern int _IO_peekc_locked (_IO_FILE *__fp);
+
+
+
+
+
+extern void _IO_flockfile (_IO_FILE *) throw ();
+extern void _IO_funlockfile (_IO_FILE *) throw ();
+extern int _IO_ftrylockfile (_IO_FILE *) throw ();
+extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict,
+   __gnuc_va_list, int *__restrict);
+extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict,
+    __gnuc_va_list);
+extern __ssize_t _IO_padn (_IO_FILE *, int, __ssize_t);
+extern size_t _IO_sgetn (_IO_FILE *, void *, size_t);
+
+extern __off64_t _IO_seekoff (_IO_FILE *, __off64_t, int, int);
+extern __off64_t _IO_seekpos (_IO_FILE *, __off64_t, int);
+
+extern void _IO_free_backup_area (_IO_FILE *) throw ();
+}
+
+
+
+
+typedef __gnuc_va_list va_list;
+
+
+typedef _G_fpos_t fpos_t;
+
+
+
+
+
+typedef _G_fpos64_t fpos64_t;
+
+
+
+extern struct _IO_FILE *stdin;
+extern struct _IO_FILE *stdout;
+extern struct _IO_FILE *stderr;
+
+
+
+
+
+
+
+extern int remove (const char *__filename) throw ();
+
+extern int rename (const char *__old, const char *__new) throw ();
+
+
+
+
+extern int renameat (int __oldfd, const char *__old, int __newfd,
+       const char *__new) throw ();
+
+
+
+
+
+
+
+
+extern FILE *tmpfile (void) ;
+extern FILE *tmpfile64 (void) ;
+
+
+
+extern char *tmpnam (char *__s) throw () ;
+
+
+
+
+
+extern char *tmpnam_r (char *__s) throw () ;
+extern char *tempnam (const char *__dir, const char *__pfx)
+     throw () __attribute__ ((__malloc__)) ;
+
+
+
+
+
+
+
+
+extern int fclose (FILE *__stream);
+
+
+
+
+extern int fflush (FILE *__stream);
+
+extern int fflush_unlocked (FILE *__stream);
+extern int fcloseall (void);
+
+
+
+
+
+
+
+
+
+extern FILE *fopen (const char *__restrict __filename,
+      const char *__restrict __modes) ;
+
+
+
+
+extern FILE *freopen (const char *__restrict __filename,
+        const char *__restrict __modes,
+        FILE *__restrict __stream) ;
+
+
+extern FILE *fopen64 (const char *__restrict __filename,
+        const char *__restrict __modes) ;
+extern FILE *freopen64 (const char *__restrict __filename,
+   const char *__restrict __modes,
+   FILE *__restrict __stream) ;
+
+
+
+
+extern FILE *fdopen (int __fd, const char *__modes) throw () ;
+
+
+
+
+
+extern FILE *fopencookie (void *__restrict __magic_cookie,
+     const char *__restrict __modes,
+     _IO_cookie_io_functions_t __io_funcs) throw () ;
+
+
+
+
+extern FILE *fmemopen (void *__s, size_t __len, const char *__modes)
+  throw () ;
+
+
+
+
+extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) throw () ;
+
+
+
+
+
+
+extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) throw ();
+
+
+
+extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
+      int __modes, size_t __n) throw ();
+
+
+
+
+
+extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
+         size_t __size) throw ();
+
+
+extern void setlinebuf (FILE *__stream) throw ();
+
+
+
+
+
+
+
+
+extern int fprintf (FILE *__restrict __stream,
+      const char *__restrict __format, ...);
+
+
+
+
+extern int printf (const char *__restrict __format, ...);
+
+extern int sprintf (char *__restrict __s,
+      const char *__restrict __format, ...) throw ();
+
+
+
+
+
+extern int vfprintf (FILE *__restrict __s, const char *__restrict __format,
+       __gnuc_va_list __arg);
+
+
+
+
+extern int vprintf (const char *__restrict __format, __gnuc_va_list __arg);
+
+extern int vsprintf (char *__restrict __s, const char *__restrict __format,
+       __gnuc_va_list __arg) throw ();
+
+
+
+
+
+extern int snprintf (char *__restrict __s, size_t __maxlen,
+       const char *__restrict __format, ...)
+     throw () __attribute__ ((__format__ (__printf__, 3, 4)));
+
+extern int vsnprintf (char *__restrict __s, size_t __maxlen,
+        const char *__restrict __format, __gnuc_va_list __arg)
+     throw () __attribute__ ((__format__ (__printf__, 3, 0)));
+
+
+
+
+
+
+extern int vasprintf (char **__restrict __ptr, const char *__restrict __f,
+        __gnuc_va_list __arg)
+     throw () __attribute__ ((__format__ (__printf__, 2, 0))) ;
+extern int __asprintf (char **__restrict __ptr,
+         const char *__restrict __fmt, ...)
+     throw () __attribute__ ((__format__ (__printf__, 2, 3))) ;
+extern int asprintf (char **__restrict __ptr,
+       const char *__restrict __fmt, ...)
+     throw () __attribute__ ((__format__ (__printf__, 2, 3))) ;
+
+
+
+
+extern int vdprintf (int __fd, const char *__restrict __fmt,
+       __gnuc_va_list __arg)
+     __attribute__ ((__format__ (__printf__, 2, 0)));
+extern int dprintf (int __fd, const char *__restrict __fmt, ...)
+     __attribute__ ((__format__ (__printf__, 2, 3)));
+
+
+
+
+
+
+
+
+extern int fscanf (FILE *__restrict __stream,
+     const char *__restrict __format, ...) ;
+
+
+
+
+extern int scanf (const char *__restrict __format, ...) ;
+
+extern int sscanf (const char *__restrict __s,
+     const char *__restrict __format, ...) throw ();
+
+
+
+
+
+
+
+
+extern int vfscanf (FILE *__restrict __s, const char *__restrict __format,
+      __gnuc_va_list __arg)
+     __attribute__ ((__format__ (__scanf__, 2, 0))) ;
+
+
+
+
+
+extern int vscanf (const char *__restrict __format, __gnuc_va_list __arg)
+     __attribute__ ((__format__ (__scanf__, 1, 0))) ;
+
+
+extern int vsscanf (const char *__restrict __s,
+      const char *__restrict __format, __gnuc_va_list __arg)
+     throw () __attribute__ ((__format__ (__scanf__, 2, 0)));
+
+
+
+
+
+
+
+
+
+extern int fgetc (FILE *__stream);
+extern int getc (FILE *__stream);
+
+
+
+
+
+extern int getchar (void);
+
+extern int getc_unlocked (FILE *__stream);
+extern int getchar_unlocked (void);
+extern int fgetc_unlocked (FILE *__stream);
+
+
+
+
+
+
+
+
+
+
+
+extern int fputc (int __c, FILE *__stream);
+extern int putc (int __c, FILE *__stream);
+
+
+
+
+
+extern int putchar (int __c);
+
+extern int fputc_unlocked (int __c, FILE *__stream);
+
+
+
+
+
+
+
+extern int putc_unlocked (int __c, FILE *__stream);
+extern int putchar_unlocked (int __c);
+
+
+
+
+
+
+extern int getw (FILE *__stream);
+
+
+extern int putw (int __w, FILE *__stream);
+
+
+
+
+
+
+
+
+extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
+     ;
+extern char *gets (char *__s) __attribute__ ((__deprecated__));
+
+
+extern char *fgets_unlocked (char *__restrict __s, int __n,
+        FILE *__restrict __stream) ;
+extern __ssize_t __getdelim (char **__restrict __lineptr,
+          size_t *__restrict __n, int __delimiter,
+          FILE *__restrict __stream) ;
+extern __ssize_t getdelim (char **__restrict __lineptr,
+        size_t *__restrict __n, int __delimiter,
+        FILE *__restrict __stream) ;
+
+
+
+
+
+
+
+extern __ssize_t getline (char **__restrict __lineptr,
+       size_t *__restrict __n,
+       FILE *__restrict __stream) ;
+
+
+
+
+
+
+
+
+extern int fputs (const char *__restrict __s, FILE *__restrict __stream);
+
+
+
+
+
+extern int puts (const char *__s);
+
+
+
+
+
+
+extern int ungetc (int __c, FILE *__stream);
+
+
+
+
+
+
+extern size_t fread (void *__restrict __ptr, size_t __size,
+       size_t __n, FILE *__restrict __stream) ;
+
+
+
+
+extern size_t fwrite (const void *__restrict __ptr, size_t __size,
+        size_t __n, FILE *__restrict __s);
+
+extern int fputs_unlocked (const char *__restrict __s,
+      FILE *__restrict __stream);
+extern size_t fread_unlocked (void *__restrict __ptr, size_t __size,
+         size_t __n, FILE *__restrict __stream) ;
+extern size_t fwrite_unlocked (const void *__restrict __ptr, size_t __size,
+          size_t __n, FILE *__restrict __stream);
+
+
+
+
+
+
+
+
+extern int fseek (FILE *__stream, long int __off, int __whence);
+
+
+
+
+extern long int ftell (FILE *__stream) ;
+
+
+
+
+extern void rewind (FILE *__stream);
+
+extern int fseeko (FILE *__stream, __off_t __off, int __whence);
+
+
+
+
+extern __off_t ftello (FILE *__stream) ;
+
+
+
+
+
+
+extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos);
+
+
+
+
+extern int fsetpos (FILE *__stream, const fpos_t *__pos);
+
+
+
+extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
+extern __off64_t ftello64 (FILE *__stream) ;
+extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos);
+extern int fsetpos64 (FILE *__stream, const fpos64_t *__pos);
+
+
+
+
+extern void clearerr (FILE *__stream) throw ();
+
+extern int feof (FILE *__stream) throw () ;
+
+extern int ferror (FILE *__stream) throw () ;
+
+
+
+
+extern void clearerr_unlocked (FILE *__stream) throw ();
+extern int feof_unlocked (FILE *__stream) throw () ;
+extern int ferror_unlocked (FILE *__stream) throw () ;
+
+
+
+
+
+
+
+
+extern void perror (const char *__s);
+
+
+
+
+
+
+extern int sys_nerr;
+extern const char *const sys_errlist[];
+
+
+extern int _sys_nerr;
+extern const char *const _sys_errlist[];
+
+
+
+
+extern int fileno (FILE *__stream) throw () ;
+
+
+
+
+extern int fileno_unlocked (FILE *__stream) throw () ;
+extern FILE *popen (const char *__command, const char *__modes) ;
+
+
+
+
+
+extern int pclose (FILE *__stream);
+
+
+
+
+
+extern char *ctermid (char *__s) throw ();
+
+
+
+
+
+extern char *cuserid (char *__s);
+
+
+
+
+struct obstack;
+
+
+extern int obstack_printf (struct obstack *__restrict __obstack,
+      const char *__restrict __format, ...)
+     throw () __attribute__ ((__format__ (__printf__, 2, 3)));
+extern int obstack_vprintf (struct obstack *__restrict __obstack,
+       const char *__restrict __format,
+       __gnuc_va_list __args)
+     throw () __attribute__ ((__format__ (__printf__, 2, 0)));
+
+
+
+
+
+
+
+extern void flockfile (FILE *__stream) throw ();
+
+
+
+extern int ftrylockfile (FILE *__stream) throw () ;
+
+
+extern void funlockfile (FILE *__stream) throw ();
+extern __inline __attribute__ ((__gnu_inline__)) int
+vprintf (const char *__restrict __fmt, __gnuc_va_list __arg)
+{
+  return vfprintf (stdout, __fmt, __arg);
+}
+
+
+
+extern __inline __attribute__ ((__gnu_inline__)) int
+getchar (void)
+{
+  return _IO_getc (stdin);
+}
+
+
+
+
+extern __inline __attribute__ ((__gnu_inline__)) int
+fgetc_unlocked (FILE *__fp)
+{
+  return (__builtin_expect (((__fp)->_IO_read_ptr >= (__fp)->_IO_read_end), 0) ? __uflow (__fp) : *(unsigned char *) (__fp)->_IO_read_ptr++);
+}
+
+
+
+
+
+extern __inline __attribute__ ((__gnu_inline__)) int
+getc_unlocked (FILE *__fp)
+{
+  return (__builtin_expect (((__fp)->_IO_read_ptr >= (__fp)->_IO_read_end), 0) ? __uflow (__fp) : *(unsigned char *) (__fp)->_IO_read_ptr++);
+}
+
+
+extern __inline __attribute__ ((__gnu_inline__)) int
+getchar_unlocked (void)
+{
+  return (__builtin_expect (((stdin)->_IO_read_ptr >= (stdin)->_IO_read_end), 0) ? __uflow (stdin) : *(unsigned char *) (stdin)->_IO_read_ptr++);
+}
+
+
+
+
+extern __inline __attribute__ ((__gnu_inline__)) int
+putchar (int __c)
+{
+  return _IO_putc (__c, stdout);
+}
+
+
+
+
+extern __inline __attribute__ ((__gnu_inline__)) int
+fputc_unlocked (int __c, FILE *__stream)
+{
+  return (__builtin_expect (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c)));
+}
+
+
+
+
+
+extern __inline __attribute__ ((__gnu_inline__)) int
+putc_unlocked (int __c, FILE *__stream)
+{
+  return (__builtin_expect (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c)));
+}
+
+
+extern __inline __attribute__ ((__gnu_inline__)) int
+putchar_unlocked (int __c)
+{
+  return (__builtin_expect (((stdout)->_IO_write_ptr >= (stdout)->_IO_write_end), 0) ? __overflow (stdout, (unsigned char) (__c)) : (unsigned char) (*(stdout)->_IO_write_ptr++ = (__c)));
+}
+
+
+
+
+
+extern __inline __attribute__ ((__gnu_inline__)) __ssize_t
+getline (char **__lineptr, size_t *__n, FILE *__stream)
+{
+  return __getdelim (__lineptr, __n, '\n', __stream);
+}
+
+
+
+
+
+extern __inline __attribute__ ((__gnu_inline__)) int
+__attribute__ ((__leaf__)) feof_unlocked (FILE *__stream) throw ()
+{
+  return (((__stream)->_flags & 0x10) != 0);
+}
+
+
+extern __inline __attribute__ ((__gnu_inline__)) int
+__attribute__ ((__leaf__)) ferror_unlocked (FILE *__stream) throw ()
+{
+  return (((__stream)->_flags & 0x20) != 0);
+}
+}
+namespace std
+{
+  using ::FILE;
+  using ::fpos_t;
+
+  using ::clearerr;
+  using ::fclose;
+  using ::feof;
+  using ::ferror;
+  using ::fflush;
+  using ::fgetc;
+  using ::fgetpos;
+  using ::fgets;
+  using ::fopen;
+  using ::fprintf;
+  using ::fputc;
+  using ::fputs;
+  using ::fread;
+  using ::freopen;
+  using ::fscanf;
+  using ::fseek;
+  using ::fsetpos;
+  using ::ftell;
+  using ::fwrite;
+  using ::getc;
+  using ::getchar;
+
+
+  using ::gets;
+
+  using ::perror;
+  using ::printf;
+  using ::putc;
+  using ::putchar;
+  using ::puts;
+  using ::remove;
+  using ::rename;
+  using ::rewind;
+  using ::scanf;
+  using ::setbuf;
+  using ::setvbuf;
+  using ::sprintf;
+  using ::sscanf;
+  using ::tmpfile;
+
+  using ::tmpnam;
+
+  using ::ungetc;
+  using ::vfprintf;
+  using ::vprintf;
+  using ::vsprintf;
+}
+namespace __gnu_cxx
+{
+  using ::snprintf;
+  using ::vfscanf;
+  using ::vscanf;
+  using ::vsnprintf;
+  using ::vsscanf;
+
+}
+
+namespace std
+{
+  using ::__gnu_cxx::snprintf;
+  using ::__gnu_cxx::vfscanf;
+  using ::__gnu_cxx::vscanf;
+  using ::__gnu_cxx::vsnprintf;
+  using ::__gnu_cxx::vsscanf;
+}
+       
+
+
+extern "C" {
+
+
+
+
+
+
+
+
+
+extern int *__errno_location (void) throw () __attribute__ ((__const__));
+extern char *program_invocation_name, *program_invocation_short_name;
+
+
+
+}
+typedef int error_t;
+
+namespace __gnu_cxx __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+  template<typename _TRet, typename _Ret = _TRet, typename _CharT,
+    typename... _Base>
+    _Ret
+    __stoa(_TRet (*__convf) (const _CharT*, _CharT**, _Base...),
+    const char* __name, const _CharT* __str, std::size_t* __idx,
+    _Base... __base)
+    {
+      _Ret __ret;
+
+      _CharT* __endptr;
+
+      struct _Save_errno {
+ _Save_errno() : _M_errno((*__errno_location ())) { (*__errno_location ()) = 0; }
+ ~_Save_errno() { if ((*__errno_location ()) == 0) (*__errno_location ()) = _M_errno; }
+ int _M_errno;
+      } const __save_errno;
+
+      struct _Range_chk {
+   static bool
+   _S_chk(_TRet, std::false_type) { return false; }
+
+   static bool
+   _S_chk(_TRet __val, std::true_type)
+   {
+     return __val < _TRet(__numeric_traits<int>::__min)
+       || __val > _TRet(__numeric_traits<int>::__max);
+   }
+      };
+
+      const _TRet __tmp = __convf(__str, &__endptr, __base...);
+
+      if (__endptr == __str)
+ std::__throw_invalid_argument(__name);
+      else if ((*__errno_location ()) == 34
+   || _Range_chk::_S_chk(__tmp, std::is_same<_Ret, int>{}))
+ std::__throw_out_of_range(__name);
+      else
+ __ret = __tmp;
+
+      if (__idx)
+ *__idx = __endptr - __str;
+
+      return __ret;
+    }
+
+
+  template<typename _String, typename _CharT = typename _String::value_type>
+    _String
+    __to_xstring(int (*__convf) (_CharT*, std::size_t, const _CharT*,
+     __builtin_va_list), std::size_t __n,
+   const _CharT* __fmt, ...)
+    {
+
+
+      _CharT* __s = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+         * __n));
+
+      __builtin_va_list __args;
+      __builtin_va_start(__args, __fmt);
+
+      const int __len = __convf(__s, __n, __fmt, __args);
+
+      __builtin_va_end(__args);
+
+      return _String(__s, __s + __len);
+    }
+
+
+}
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+namespace __cxx11 {
+
+
+
+  inline int
+  stoi(const string& __str, size_t* __idx = 0, int __base = 10)
+  { return __gnu_cxx::__stoa<long, int>(&std::strtol, "stoi", __str.c_str(),
+     __idx, __base); }
+
+  inline long
+  stol(const string& __str, size_t* __idx = 0, int __base = 10)
+  { return __gnu_cxx::__stoa(&std::strtol, "stol", __str.c_str(),
+        __idx, __base); }
+
+  inline unsigned long
+  stoul(const string& __str, size_t* __idx = 0, int __base = 10)
+  { return __gnu_cxx::__stoa(&std::strtoul, "stoul", __str.c_str(),
+        __idx, __base); }
+
+  inline long long
+  stoll(const string& __str, size_t* __idx = 0, int __base = 10)
+  { return __gnu_cxx::__stoa(&std::strtoll, "stoll", __str.c_str(),
+        __idx, __base); }
+
+  inline unsigned long long
+  stoull(const string& __str, size_t* __idx = 0, int __base = 10)
+  { return __gnu_cxx::__stoa(&std::strtoull, "stoull", __str.c_str(),
+        __idx, __base); }
+
+
+  inline float
+  stof(const string& __str, size_t* __idx = 0)
+  { return __gnu_cxx::__stoa(&std::strtof, "stof", __str.c_str(), __idx); }
+
+  inline double
+  stod(const string& __str, size_t* __idx = 0)
+  { return __gnu_cxx::__stoa(&std::strtod, "stod", __str.c_str(), __idx); }
+
+  inline long double
+  stold(const string& __str, size_t* __idx = 0)
+  { return __gnu_cxx::__stoa(&std::strtold, "stold", __str.c_str(), __idx); }
+
+
+
+
+
+
+  inline string
+  to_string(int __val)
+  { return __gnu_cxx::__to_xstring<string>(&std::vsnprintf, 4 * sizeof(int),
+        "%d", __val); }
+
+  inline string
+  to_string(unsigned __val)
+  { return __gnu_cxx::__to_xstring<string>(&std::vsnprintf,
+        4 * sizeof(unsigned),
+        "%u", __val); }
+
+  inline string
+  to_string(long __val)
+  { return __gnu_cxx::__to_xstring<string>(&std::vsnprintf, 4 * sizeof(long),
+        "%ld", __val); }
+
+  inline string
+  to_string(unsigned long __val)
+  { return __gnu_cxx::__to_xstring<string>(&std::vsnprintf,
+        4 * sizeof(unsigned long),
+        "%lu", __val); }
+
+  inline string
+  to_string(long long __val)
+  { return __gnu_cxx::__to_xstring<string>(&std::vsnprintf,
+        4 * sizeof(long long),
+        "%lld", __val); }
+
+  inline string
+  to_string(unsigned long long __val)
+  { return __gnu_cxx::__to_xstring<string>(&std::vsnprintf,
+        4 * sizeof(unsigned long long),
+        "%llu", __val); }
+
+  inline string
+  to_string(float __val)
+  {
+    const int __n =
+      __gnu_cxx::__numeric_traits<float>::__max_exponent10 + 20;
+    return __gnu_cxx::__to_xstring<string>(&std::vsnprintf, __n,
+        "%f", __val);
+  }
+
+  inline string
+  to_string(double __val)
+  {
+    const int __n =
+      __gnu_cxx::__numeric_traits<double>::__max_exponent10 + 20;
+    return __gnu_cxx::__to_xstring<string>(&std::vsnprintf, __n,
+        "%f", __val);
+  }
+
+  inline string
+  to_string(long double __val)
+  {
+    const int __n =
+      __gnu_cxx::__numeric_traits<long double>::__max_exponent10 + 20;
+    return __gnu_cxx::__to_xstring<string>(&std::vsnprintf, __n,
+        "%Lf", __val);
+  }
+
+
+
+  inline int
+  stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
+  { return __gnu_cxx::__stoa<long, int>(&std::wcstol, "stoi", __str.c_str(),
+     __idx, __base); }
+
+  inline long
+  stol(const wstring& __str, size_t* __idx = 0, int __base = 10)
+  { return __gnu_cxx::__stoa(&std::wcstol, "stol", __str.c_str(),
+        __idx, __base); }
+
+  inline unsigned long
+  stoul(const wstring& __str, size_t* __idx = 0, int __base = 10)
+  { return __gnu_cxx::__stoa(&std::wcstoul, "stoul", __str.c_str(),
+        __idx, __base); }
+
+  inline long long
+  stoll(const wstring& __str, size_t* __idx = 0, int __base = 10)
+  { return __gnu_cxx::__stoa(&std::wcstoll, "stoll", __str.c_str(),
+        __idx, __base); }
+
+  inline unsigned long long
+  stoull(const wstring& __str, size_t* __idx = 0, int __base = 10)
+  { return __gnu_cxx::__stoa(&std::wcstoull, "stoull", __str.c_str(),
+        __idx, __base); }
+
+
+  inline float
+  stof(const wstring& __str, size_t* __idx = 0)
+  { return __gnu_cxx::__stoa(&std::wcstof, "stof", __str.c_str(), __idx); }
+
+  inline double
+  stod(const wstring& __str, size_t* __idx = 0)
+  { return __gnu_cxx::__stoa(&std::wcstod, "stod", __str.c_str(), __idx); }
+
+  inline long double
+  stold(const wstring& __str, size_t* __idx = 0)
+  { return __gnu_cxx::__stoa(&std::wcstold, "stold", __str.c_str(), __idx); }
+
+
+
+  inline wstring
+  to_wstring(int __val)
+  { return __gnu_cxx::__to_xstring<wstring>(&std::vswprintf, 4 * sizeof(int),
+         L"%d", __val); }
+
+  inline wstring
+  to_wstring(unsigned __val)
+  { return __gnu_cxx::__to_xstring<wstring>(&std::vswprintf,
+         4 * sizeof(unsigned),
+         L"%u", __val); }
+
+  inline wstring
+  to_wstring(long __val)
+  { return __gnu_cxx::__to_xstring<wstring>(&std::vswprintf, 4 * sizeof(long),
+         L"%ld", __val); }
+
+  inline wstring
+  to_wstring(unsigned long __val)
+  { return __gnu_cxx::__to_xstring<wstring>(&std::vswprintf,
+         4 * sizeof(unsigned long),
+         L"%lu", __val); }
+
+  inline wstring
+  to_wstring(long long __val)
+  { return __gnu_cxx::__to_xstring<wstring>(&std::vswprintf,
+         4 * sizeof(long long),
+         L"%lld", __val); }
+
+  inline wstring
+  to_wstring(unsigned long long __val)
+  { return __gnu_cxx::__to_xstring<wstring>(&std::vswprintf,
+         4 * sizeof(unsigned long long),
+         L"%llu", __val); }
+
+  inline wstring
+  to_wstring(float __val)
+  {
+    const int __n =
+      __gnu_cxx::__numeric_traits<float>::__max_exponent10 + 20;
+    return __gnu_cxx::__to_xstring<wstring>(&std::vswprintf, __n,
+         L"%f", __val);
+  }
+
+  inline wstring
+  to_wstring(double __val)
+  {
+    const int __n =
+      __gnu_cxx::__numeric_traits<double>::__max_exponent10 + 20;
+    return __gnu_cxx::__to_xstring<wstring>(&std::vswprintf, __n,
+         L"%f", __val);
+  }
+
+  inline wstring
+  to_wstring(long double __val)
+  {
+    const int __n =
+      __gnu_cxx::__numeric_traits<long double>::__max_exponent10 + 20;
+    return __gnu_cxx::__to_xstring<wstring>(&std::vswprintf, __n,
+         L"%Lf", __val);
+  }
+
+
+
+}
+
+}
+
+
+
+
+
+       
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+  template<typename _Result, typename _Arg>
+    struct __hash_base
+    {
+      typedef _Result result_type ;
+      typedef _Arg argument_type ;
+    };
+
+
+  template<typename _Tp>
+    struct hash;
+
+  template<typename _Tp, typename = void>
+    struct __poison_hash
+    {
+      static constexpr bool __enable_hash_call = false;
+    private:
+
+      __poison_hash(__poison_hash&&);
+      ~__poison_hash();
+    };
+
+  template<typename _Tp>
+    struct __poison_hash<_Tp, __void_t<decltype(hash<_Tp>()(declval<_Tp>()))>>
+    {
+      static constexpr bool __enable_hash_call = true;
+    };
+
+
+  template<typename _Tp, bool = is_enum<_Tp>::value>
+    struct __hash_enum
+    {
+    private:
+
+      __hash_enum(__hash_enum&&);
+      ~__hash_enum();
+    };
+
+
+  template<typename _Tp>
+    struct __hash_enum<_Tp, true> : public __hash_base<size_t, _Tp>
+    {
+      size_t
+      operator()(_Tp __val) const noexcept
+      {
+       using __type = typename underlying_type<_Tp>::type;
+       return hash<__type>{}(static_cast<__type>(__val));
+      }
+    };
+
+
+
+  template<typename _Tp>
+    struct hash : __hash_enum<_Tp>
+    { };
+
+
+  template<typename _Tp>
+    struct hash<_Tp*> : public __hash_base<size_t, _Tp*>
+    {
+      size_t
+      operator()(_Tp* __p) const noexcept
+      { return reinterpret_cast<size_t>(__p); }
+    };
+  template<> struct hash<bool> : public __hash_base<size_t, bool> { size_t operator()(bool __val) const noexcept { return static_cast<size_t>(__val); } };
+
+
+  template<> struct hash<char> : public __hash_base<size_t, char> { size_t operator()(char __val) const noexcept { return static_cast<size_t>(__val); } };
+
+
+  template<> struct hash<signed char> : public __hash_base<size_t, signed char> { size_t operator()(signed char __val) const noexcept { return static_cast<size_t>(__val); } };
+
+
+  template<> struct hash<unsigned char> : public __hash_base<size_t, unsigned char> { size_t operator()(unsigned char __val) const noexcept { return static_cast<size_t>(__val); } };
+
+
+  template<> struct hash<wchar_t> : public __hash_base<size_t, wchar_t> { size_t operator()(wchar_t __val) const noexcept { return static_cast<size_t>(__val); } };
+
+
+  template<> struct hash<char16_t> : public __hash_base<size_t, char16_t> { size_t operator()(char16_t __val) const noexcept { return static_cast<size_t>(__val); } };
+
+
+  template<> struct hash<char32_t> : public __hash_base<size_t, char32_t> { size_t operator()(char32_t __val) const noexcept { return static_cast<size_t>(__val); } };
+
+
+  template<> struct hash<short> : public __hash_base<size_t, short> { size_t operator()(short __val) const noexcept { return static_cast<size_t>(__val); } };
+
+
+  template<> struct hash<int> : public __hash_base<size_t, int> { size_t operator()(int __val) const noexcept { return static_cast<size_t>(__val); } };
+
+
+  template<> struct hash<long> : public __hash_base<size_t, long> { size_t operator()(long __val) const noexcept { return static_cast<size_t>(__val); } };
+
+
+  template<> struct hash<long long> : public __hash_base<size_t, long long> { size_t operator()(long long __val) const noexcept { return static_cast<size_t>(__val); } };
+
+
+  template<> struct hash<unsigned short> : public __hash_base<size_t, unsigned short> { size_t operator()(unsigned short __val) const noexcept { return static_cast<size_t>(__val); } };
+
+
+  template<> struct hash<unsigned int> : public __hash_base<size_t, unsigned int> { size_t operator()(unsigned int __val) const noexcept { return static_cast<size_t>(__val); } };
+
+
+  template<> struct hash<unsigned long> : public __hash_base<size_t, unsigned long> { size_t operator()(unsigned long __val) const noexcept { return static_cast<size_t>(__val); } };
+
+
+  template<> struct hash<unsigned long long> : public __hash_base<size_t, unsigned long long> { size_t operator()(unsigned long long __val) const noexcept { return static_cast<size_t>(__val); } };
+  struct _Hash_impl
+  {
+    static size_t
+    hash(const void* __ptr, size_t __clength,
+  size_t __seed = static_cast<size_t>(0xc70f6907UL))
+    { return _Hash_bytes(__ptr, __clength, __seed); }
+
+    template<typename _Tp>
+      static size_t
+      hash(const _Tp& __val)
+      { return hash(&__val, sizeof(__val)); }
+
+    template<typename _Tp>
+      static size_t
+      __hash_combine(const _Tp& __val, size_t __hash)
+      { return hash(&__val, sizeof(__val), __hash); }
+  };
+
+
+  struct _Fnv_hash_impl
+  {
+    static size_t
+    hash(const void* __ptr, size_t __clength,
+  size_t __seed = static_cast<size_t>(2166136261UL))
+    { return _Fnv_hash_bytes(__ptr, __clength, __seed); }
+
+    template<typename _Tp>
+      static size_t
+      hash(const _Tp& __val)
+      { return hash(&__val, sizeof(__val)); }
+
+    template<typename _Tp>
+      static size_t
+      __hash_combine(const _Tp& __val, size_t __hash)
+      { return hash(&__val, sizeof(__val), __hash); }
+  };
+
+
+  template<>
+    struct hash<float> : public __hash_base<size_t, float>
+    {
+      size_t
+      operator()(float __val) const noexcept
+      {
+
+ return __val != 0.0f ? std::_Hash_impl::hash(__val) : 0;
+      }
+    };
+
+
+  template<>
+    struct hash<double> : public __hash_base<size_t, double>
+    {
+      size_t
+      operator()(double __val) const noexcept
+      {
+
+ return __val != 0.0 ? std::_Hash_impl::hash(__val) : 0;
+      }
+    };
+
+
+  template<>
+    struct hash<long double>
+    : public __hash_base<size_t, long double>
+    {
+      __attribute__ ((__pure__)) size_t
+      operator()(long double __val) const noexcept;
+    };
+
+
+
+
+
+
+
+  template<typename _Hash>
+    struct __is_fast_hash : public std::true_type
+    { };
+
+  template<>
+    struct __is_fast_hash<hash<long double>> : public std::false_type
+    { };
+
+
+}
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+
+
+
+  template<>
+    struct hash<string>
+    : public __hash_base<size_t, string>
+    {
+      size_t
+      operator()(const string& __s) const noexcept
+      { return std::_Hash_impl::hash(__s.data(), __s.length()); }
+    };
+
+  template<>
+    struct __is_fast_hash<hash<string>> : std::false_type
+    { };
+
+
+
+  template<>
+    struct hash<wstring>
+    : public __hash_base<size_t, wstring>
+    {
+      size_t
+      operator()(const wstring& __s) const noexcept
+      { return std::_Hash_impl::hash(__s.data(),
+                                     __s.length() * sizeof(wchar_t)); }
+    };
+
+  template<>
+    struct __is_fast_hash<hash<wstring>> : std::false_type
+    { };
+
+
+
+
+
+  template<>
+    struct hash<u16string>
+    : public __hash_base<size_t, u16string>
+    {
+      size_t
+      operator()(const u16string& __s) const noexcept
+      { return std::_Hash_impl::hash(__s.data(),
+                                     __s.length() * sizeof(char16_t)); }
+    };
+
+  template<>
+    struct __is_fast_hash<hash<u16string>> : std::false_type
+    { };
+
+
+  template<>
+    struct hash<u32string>
+    : public __hash_base<size_t, u32string>
+    {
+      size_t
+      operator()(const u32string& __s) const noexcept
+      { return std::_Hash_impl::hash(__s.data(),
+                                     __s.length() * sizeof(char32_t)); }
+    };
+
+  template<>
+    struct __is_fast_hash<hash<u32string>> : std::false_type
+    { };
+
+}
+       
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    const typename basic_string<_CharT, _Traits, _Alloc>::size_type
+    basic_string<_CharT, _Traits, _Alloc>::npos;
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    void
+    basic_string<_CharT, _Traits, _Alloc>::
+    swap(basic_string& __s) noexcept
+    {
+      if (this == &__s)
+ return;
+
+      _Alloc_traits::_S_on_swap(_M_get_allocator(), __s._M_get_allocator());
+
+      if (_M_is_local())
+ if (__s._M_is_local())
+   {
+     if (length() && __s.length())
+       {
+  _CharT __tmp_data[_S_local_capacity + 1];
+  traits_type::copy(__tmp_data, __s._M_local_buf,
+      _S_local_capacity + 1);
+  traits_type::copy(__s._M_local_buf, _M_local_buf,
+      _S_local_capacity + 1);
+  traits_type::copy(_M_local_buf, __tmp_data,
+      _S_local_capacity + 1);
+       }
+     else if (__s.length())
+       {
+  traits_type::copy(_M_local_buf, __s._M_local_buf,
+      _S_local_capacity + 1);
+  _M_length(__s.length());
+  __s._M_set_length(0);
+  return;
+       }
+     else if (length())
+       {
+  traits_type::copy(__s._M_local_buf, _M_local_buf,
+      _S_local_capacity + 1);
+  __s._M_length(length());
+  _M_set_length(0);
+  return;
+       }
+   }
+ else
+   {
+     const size_type __tmp_capacity = __s._M_allocated_capacity;
+     traits_type::copy(__s._M_local_buf, _M_local_buf,
+         _S_local_capacity + 1);
+     _M_data(__s._M_data());
+     __s._M_data(__s._M_local_buf);
+     _M_capacity(__tmp_capacity);
+   }
+      else
+ {
+   const size_type __tmp_capacity = _M_allocated_capacity;
+   if (__s._M_is_local())
+     {
+       traits_type::copy(_M_local_buf, __s._M_local_buf,
+    _S_local_capacity + 1);
+       __s._M_data(_M_data());
+       _M_data(_M_local_buf);
+     }
+   else
+     {
+       pointer __tmp_ptr = _M_data();
+       _M_data(__s._M_data());
+       __s._M_data(__tmp_ptr);
+       _M_capacity(__s._M_allocated_capacity);
+     }
+   __s._M_capacity(__tmp_capacity);
+ }
+
+      const size_type __tmp_length = length();
+      _M_length(__s.length());
+      __s._M_length(__tmp_length);
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    typename basic_string<_CharT, _Traits, _Alloc>::pointer
+    basic_string<_CharT, _Traits, _Alloc>::
+    _M_create(size_type& __capacity, size_type __old_capacity)
+    {
+
+
+      if (__capacity > max_size())
+ std::__throw_length_error(("basic_string::_M_create"));
+
+
+
+
+      if (__capacity > __old_capacity && __capacity < 2 * __old_capacity)
+ {
+   __capacity = 2 * __old_capacity;
+
+   if (__capacity > max_size())
+     __capacity = max_size();
+ }
+
+
+
+      return _Alloc_traits::allocate(_M_get_allocator(), __capacity + 1);
+    }
+
+
+
+
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    template<typename _InIterator>
+      void
+      basic_string<_CharT, _Traits, _Alloc>::
+      _M_construct(_InIterator __beg, _InIterator __end,
+     std::input_iterator_tag)
+      {
+ size_type __len = 0;
+ size_type __capacity = size_type(_S_local_capacity);
+
+ while (__beg != __end && __len < __capacity)
+   {
+     _M_data()[__len++] = *__beg;
+     ++__beg;
+   }
+
+ if (true)
+   {
+     while (__beg != __end)
+       {
+  if (__len == __capacity)
+    {
+
+      __capacity = __len + 1;
+      pointer __another = _M_create(__capacity, __len);
+      this->_S_copy(__another, _M_data(), __len);
+      _M_dispose();
+      _M_data(__another);
+      _M_capacity(__capacity);
+    }
+  _M_data()[__len++] = *__beg;
+  ++__beg;
+       }
+   }
+ if (false)
+   {
+     _M_dispose();
+     ;
+   }
+
+ _M_set_length(__len);
+      }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    template<typename _InIterator>
+      void
+      basic_string<_CharT, _Traits, _Alloc>::
+      _M_construct(_InIterator __beg, _InIterator __end,
+     std::forward_iterator_tag)
+      {
+
+ if (__gnu_cxx::__is_null_pointer(__beg) && __beg != __end)
+   std::__throw_logic_error(("basic_string::" "_M_construct null not valid")
+                                         );
+
+ size_type __dnew = static_cast<size_type>(std::distance(__beg, __end));
+
+ if (__dnew > size_type(_S_local_capacity))
+   {
+     _M_data(_M_create(__dnew, size_type(0)));
+     _M_capacity(__dnew);
+   }
+
+
+ if (true)
+   { this->_S_copy_chars(_M_data(), __beg, __end); }
+ if (false)
+   {
+     _M_dispose();
+     ;
+   }
+
+ _M_set_length(__dnew);
+      }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    void
+    basic_string<_CharT, _Traits, _Alloc>::
+    _M_construct(size_type __n, _CharT __c)
+    {
+      if (__n > size_type(_S_local_capacity))
+ {
+   _M_data(_M_create(__n, size_type(0)));
+   _M_capacity(__n);
+ }
+
+      if (__n)
+ this->_S_assign(_M_data(), __n, __c);
+
+      _M_set_length(__n);
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    void
+    basic_string<_CharT, _Traits, _Alloc>::
+    _M_assign(const basic_string& __str)
+    {
+      if (this != &__str)
+ {
+   const size_type __rsize = __str.length();
+   const size_type __capacity = capacity();
+
+   if (__rsize > __capacity)
+     {
+       size_type __new_capacity = __rsize;
+       pointer __tmp = _M_create(__new_capacity, __capacity);
+       _M_dispose();
+       _M_data(__tmp);
+       _M_capacity(__new_capacity);
+     }
+
+   if (__rsize)
+     this->_S_copy(_M_data(), __str._M_data(), __rsize);
+
+   _M_set_length(__rsize);
+ }
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    void
+    basic_string<_CharT, _Traits, _Alloc>::
+    reserve(size_type __res)
+    {
+
+      if (__res < length())
+ __res = length();
+
+      const size_type __capacity = capacity();
+      if (__res != __capacity)
+ {
+   if (__res > __capacity
+       || __res > size_type(_S_local_capacity))
+     {
+       pointer __tmp = _M_create(__res, __capacity);
+       this->_S_copy(__tmp, _M_data(), length() + 1);
+       _M_dispose();
+       _M_data(__tmp);
+       _M_capacity(__res);
+     }
+   else if (!_M_is_local())
+     {
+       this->_S_copy(_M_local_data(), _M_data(), length() + 1);
+       _M_destroy(__capacity);
+       _M_data(_M_local_data());
+     }
+ }
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    void
+    basic_string<_CharT, _Traits, _Alloc>::
+    _M_mutate(size_type __pos, size_type __len1, const _CharT* __s,
+       size_type __len2)
+    {
+      const size_type __how_much = length() - __pos - __len1;
+
+      size_type __new_capacity = length() + __len2 - __len1;
+      pointer __r = _M_create(__new_capacity, capacity());
+
+      if (__pos)
+ this->_S_copy(__r, _M_data(), __pos);
+      if (__s && __len2)
+ this->_S_copy(__r + __pos, __s, __len2);
+      if (__how_much)
+ this->_S_copy(__r + __pos + __len2,
+        _M_data() + __pos + __len1, __how_much);
+
+      _M_dispose();
+      _M_data(__r);
+      _M_capacity(__new_capacity);
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    void
+    basic_string<_CharT, _Traits, _Alloc>::
+    _M_erase(size_type __pos, size_type __n)
+    {
+      const size_type __how_much = length() - __pos - __n;
+
+      if (__how_much && __n)
+ this->_S_move(_M_data() + __pos, _M_data() + __pos + __n, __how_much);
+
+      _M_set_length(length() - __n);
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    void
+    basic_string<_CharT, _Traits, _Alloc>::
+    resize(size_type __n, _CharT __c)
+    {
+      const size_type __size = this->size();
+      if (__size < __n)
+ this->append(__n - __size, __c);
+      else if (__n < __size)
+ this->_M_set_length(__n);
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_string<_CharT, _Traits, _Alloc>&
+    basic_string<_CharT, _Traits, _Alloc>::
+    _M_append(const _CharT* __s, size_type __n)
+    {
+      const size_type __len = __n + this->size();
+
+      if (__len <= this->capacity())
+ {
+   if (__n)
+     this->_S_copy(this->_M_data() + this->size(), __s, __n);
+ }
+      else
+ this->_M_mutate(this->size(), size_type(0), __s, __n);
+
+      this->_M_set_length(__len);
+      return *this;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    template<typename _InputIterator>
+      basic_string<_CharT, _Traits, _Alloc>&
+      basic_string<_CharT, _Traits, _Alloc>::
+      _M_replace_dispatch(const_iterator __i1, const_iterator __i2,
+     _InputIterator __k1, _InputIterator __k2,
+     std::__false_type)
+      {
+ const basic_string __s(__k1, __k2);
+ const size_type __n1 = __i2 - __i1;
+ return _M_replace(__i1 - begin(), __n1, __s._M_data(),
+     __s.size());
+      }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_string<_CharT, _Traits, _Alloc>&
+    basic_string<_CharT, _Traits, _Alloc>::
+    _M_replace_aux(size_type __pos1, size_type __n1, size_type __n2,
+     _CharT __c)
+    {
+      _M_check_length(__n1, __n2, "basic_string::_M_replace_aux");
+
+      const size_type __old_size = this->size();
+      const size_type __new_size = __old_size + __n2 - __n1;
+
+      if (__new_size <= this->capacity())
+ {
+   pointer __p = this->_M_data() + __pos1;
+
+   const size_type __how_much = __old_size - __pos1 - __n1;
+   if (__how_much && __n1 != __n2)
+     this->_S_move(__p + __n2, __p + __n1, __how_much);
+ }
+      else
+ this->_M_mutate(__pos1, __n1, 0, __n2);
+
+      if (__n2)
+ this->_S_assign(this->_M_data() + __pos1, __n2, __c);
+
+      this->_M_set_length(__new_size);
+      return *this;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_string<_CharT, _Traits, _Alloc>&
+    basic_string<_CharT, _Traits, _Alloc>::
+    _M_replace(size_type __pos, size_type __len1, const _CharT* __s,
+        const size_type __len2)
+    {
+      _M_check_length(__len1, __len2, "basic_string::_M_replace");
+
+      const size_type __old_size = this->size();
+      const size_type __new_size = __old_size + __len2 - __len1;
+
+      if (__new_size <= this->capacity())
+ {
+   pointer __p = this->_M_data() + __pos;
+
+   const size_type __how_much = __old_size - __pos - __len1;
+   if (_M_disjunct(__s))
+     {
+       if (__how_much && __len1 != __len2)
+  this->_S_move(__p + __len2, __p + __len1, __how_much);
+       if (__len2)
+  this->_S_copy(__p, __s, __len2);
+     }
+   else
+     {
+
+       if (__len2 && __len2 <= __len1)
+  this->_S_move(__p, __s, __len2);
+       if (__how_much && __len1 != __len2)
+  this->_S_move(__p + __len2, __p + __len1, __how_much);
+       if (__len2 > __len1)
+  {
+    if (__s + __len2 <= __p + __len1)
+      this->_S_move(__p, __s, __len2);
+    else if (__s >= __p + __len1)
+      this->_S_copy(__p, __s + __len2 - __len1, __len2);
+    else
+      {
+        const size_type __nleft = (__p + __len1) - __s;
+        this->_S_move(__p, __s, __nleft);
+        this->_S_copy(__p + __nleft, __p + __len2,
+        __len2 - __nleft);
+      }
+  }
+     }
+ }
+      else
+ this->_M_mutate(__pos, __len1, __s, __len2);
+
+      this->_M_set_length(__new_size);
+      return *this;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    typename basic_string<_CharT, _Traits, _Alloc>::size_type
+    basic_string<_CharT, _Traits, _Alloc>::
+    copy(_CharT* __s, size_type __n, size_type __pos) const
+    {
+      _M_check(__pos, "basic_string::copy");
+      __n = _M_limit(__pos, __n);
+      ;
+      if (__n)
+ _S_copy(__s, _M_data() + __pos, __n);
+
+      return __n;
+    }
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_string<_CharT, _Traits, _Alloc>
+    operator+(const _CharT* __lhs,
+       const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+    {
+      ;
+      typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
+      typedef typename __string_type::size_type __size_type;
+      const __size_type __len = _Traits::length(__lhs);
+      __string_type __str;
+      __str.reserve(__len + __rhs.size());
+      __str.append(__lhs, __len);
+      __str.append(__rhs);
+      return __str;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_string<_CharT, _Traits, _Alloc>
+    operator+(_CharT __lhs, const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+    {
+      typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
+      typedef typename __string_type::size_type __size_type;
+      __string_type __str;
+      const __size_type __len = __rhs.size();
+      __str.reserve(__len + 1);
+      __str.append(__size_type(1), __lhs);
+      __str.append(__rhs);
+      return __str;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    typename basic_string<_CharT, _Traits, _Alloc>::size_type
+    basic_string<_CharT, _Traits, _Alloc>::
+    find(const _CharT* __s, size_type __pos, size_type __n) const
+    noexcept
+    {
+      ;
+      const size_type __size = this->size();
+
+      if (__n == 0)
+ return __pos <= __size ? __pos : npos;
+      if (__pos >= __size)
+ return npos;
+
+      const _CharT __elem0 = __s[0];
+      const _CharT* const __data = data();
+      const _CharT* __first = __data + __pos;
+      const _CharT* const __last = __data + __size;
+      size_type __len = __size - __pos;
+
+      while (__len >= __n)
+ {
+
+   __first = traits_type::find(__first, __len - __n + 1, __elem0);
+   if (!__first)
+     return npos;
+
+
+
+   if (traits_type::compare(__first, __s, __n) == 0)
+     return __first - __data;
+   __len = __last - ++__first;
+ }
+      return npos;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    typename basic_string<_CharT, _Traits, _Alloc>::size_type
+    basic_string<_CharT, _Traits, _Alloc>::
+    find(_CharT __c, size_type __pos) const noexcept
+    {
+      size_type __ret = npos;
+      const size_type __size = this->size();
+      if (__pos < __size)
+ {
+   const _CharT* __data = _M_data();
+   const size_type __n = __size - __pos;
+   const _CharT* __p = traits_type::find(__data + __pos, __n, __c);
+   if (__p)
+     __ret = __p - __data;
+ }
+      return __ret;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    typename basic_string<_CharT, _Traits, _Alloc>::size_type
+    basic_string<_CharT, _Traits, _Alloc>::
+    rfind(const _CharT* __s, size_type __pos, size_type __n) const
+    noexcept
+    {
+      ;
+      const size_type __size = this->size();
+      if (__n <= __size)
+ {
+   __pos = std::min(size_type(__size - __n), __pos);
+   const _CharT* __data = _M_data();
+   do
+     {
+       if (traits_type::compare(__data + __pos, __s, __n) == 0)
+  return __pos;
+     }
+   while (__pos-- > 0);
+ }
+      return npos;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    typename basic_string<_CharT, _Traits, _Alloc>::size_type
+    basic_string<_CharT, _Traits, _Alloc>::
+    rfind(_CharT __c, size_type __pos) const noexcept
+    {
+      size_type __size = this->size();
+      if (__size)
+ {
+   if (--__size > __pos)
+     __size = __pos;
+   for (++__size; __size-- > 0; )
+     if (traits_type::eq(_M_data()[__size], __c))
+       return __size;
+ }
+      return npos;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    typename basic_string<_CharT, _Traits, _Alloc>::size_type
+    basic_string<_CharT, _Traits, _Alloc>::
+    find_first_of(const _CharT* __s, size_type __pos, size_type __n) const
+    noexcept
+    {
+      ;
+      for (; __n && __pos < this->size(); ++__pos)
+ {
+   const _CharT* __p = traits_type::find(__s, __n, _M_data()[__pos]);
+   if (__p)
+     return __pos;
+ }
+      return npos;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    typename basic_string<_CharT, _Traits, _Alloc>::size_type
+    basic_string<_CharT, _Traits, _Alloc>::
+    find_last_of(const _CharT* __s, size_type __pos, size_type __n) const
+    noexcept
+    {
+      ;
+      size_type __size = this->size();
+      if (__size && __n)
+ {
+   if (--__size > __pos)
+     __size = __pos;
+   do
+     {
+       if (traits_type::find(__s, __n, _M_data()[__size]))
+  return __size;
+     }
+   while (__size-- != 0);
+ }
+      return npos;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    typename basic_string<_CharT, _Traits, _Alloc>::size_type
+    basic_string<_CharT, _Traits, _Alloc>::
+    find_first_not_of(const _CharT* __s, size_type __pos, size_type __n) const
+    noexcept
+    {
+      ;
+      for (; __pos < this->size(); ++__pos)
+ if (!traits_type::find(__s, __n, _M_data()[__pos]))
+   return __pos;
+      return npos;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    typename basic_string<_CharT, _Traits, _Alloc>::size_type
+    basic_string<_CharT, _Traits, _Alloc>::
+    find_first_not_of(_CharT __c, size_type __pos) const noexcept
+    {
+      for (; __pos < this->size(); ++__pos)
+ if (!traits_type::eq(_M_data()[__pos], __c))
+   return __pos;
+      return npos;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    typename basic_string<_CharT, _Traits, _Alloc>::size_type
+    basic_string<_CharT, _Traits, _Alloc>::
+    find_last_not_of(const _CharT* __s, size_type __pos, size_type __n) const
+    noexcept
+    {
+      ;
+      size_type __size = this->size();
+      if (__size)
+ {
+   if (--__size > __pos)
+     __size = __pos;
+   do
+     {
+       if (!traits_type::find(__s, __n, _M_data()[__size]))
+  return __size;
+     }
+   while (__size--);
+ }
+      return npos;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    typename basic_string<_CharT, _Traits, _Alloc>::size_type
+    basic_string<_CharT, _Traits, _Alloc>::
+    find_last_not_of(_CharT __c, size_type __pos) const noexcept
+    {
+      size_type __size = this->size();
+      if (__size)
+ {
+   if (--__size > __pos)
+     __size = __pos;
+   do
+     {
+       if (!traits_type::eq(_M_data()[__size], __c))
+  return __size;
+     }
+   while (__size--);
+ }
+      return npos;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    int
+    basic_string<_CharT, _Traits, _Alloc>::
+    compare(size_type __pos, size_type __n, const basic_string& __str) const
+    {
+      _M_check(__pos, "basic_string::compare");
+      __n = _M_limit(__pos, __n);
+      const size_type __osize = __str.size();
+      const size_type __len = std::min(__n, __osize);
+      int __r = traits_type::compare(_M_data() + __pos, __str.data(), __len);
+      if (!__r)
+ __r = _S_compare(__n, __osize);
+      return __r;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    int
+    basic_string<_CharT, _Traits, _Alloc>::
+    compare(size_type __pos1, size_type __n1, const basic_string& __str,
+     size_type __pos2, size_type __n2) const
+    {
+      _M_check(__pos1, "basic_string::compare");
+      __str._M_check(__pos2, "basic_string::compare");
+      __n1 = _M_limit(__pos1, __n1);
+      __n2 = __str._M_limit(__pos2, __n2);
+      const size_type __len = std::min(__n1, __n2);
+      int __r = traits_type::compare(_M_data() + __pos1,
+         __str.data() + __pos2, __len);
+      if (!__r)
+ __r = _S_compare(__n1, __n2);
+      return __r;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    int
+    basic_string<_CharT, _Traits, _Alloc>::
+    compare(const _CharT* __s) const noexcept
+    {
+      ;
+      const size_type __size = this->size();
+      const size_type __osize = traits_type::length(__s);
+      const size_type __len = std::min(__size, __osize);
+      int __r = traits_type::compare(_M_data(), __s, __len);
+      if (!__r)
+ __r = _S_compare(__size, __osize);
+      return __r;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    int
+    basic_string <_CharT, _Traits, _Alloc>::
+    compare(size_type __pos, size_type __n1, const _CharT* __s) const
+    {
+      ;
+      _M_check(__pos, "basic_string::compare");
+      __n1 = _M_limit(__pos, __n1);
+      const size_type __osize = traits_type::length(__s);
+      const size_type __len = std::min(__n1, __osize);
+      int __r = traits_type::compare(_M_data() + __pos, __s, __len);
+      if (!__r)
+ __r = _S_compare(__n1, __osize);
+      return __r;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    int
+    basic_string <_CharT, _Traits, _Alloc>::
+    compare(size_type __pos, size_type __n1, const _CharT* __s,
+     size_type __n2) const
+    {
+      ;
+      _M_check(__pos, "basic_string::compare");
+      __n1 = _M_limit(__pos, __n1);
+      const size_type __len = std::min(__n1, __n2);
+      int __r = traits_type::compare(_M_data() + __pos, __s, __len);
+      if (!__r)
+ __r = _S_compare(__n1, __n2);
+      return __r;
+    }
+
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_istream<_CharT, _Traits>&
+    operator>>(basic_istream<_CharT, _Traits>& __in,
+        basic_string<_CharT, _Traits, _Alloc>& __str)
+    {
+      typedef basic_istream<_CharT, _Traits> __istream_type;
+      typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
+      typedef typename __istream_type::ios_base __ios_base;
+      typedef typename __istream_type::int_type __int_type;
+      typedef typename __string_type::size_type __size_type;
+      typedef ctype<_CharT> __ctype_type;
+      typedef typename __ctype_type::ctype_base __ctype_base;
+
+      __size_type __extracted = 0;
+      typename __ios_base::iostate __err = __ios_base::goodbit;
+      typename __istream_type::sentry __cerb(__in, false);
+      if (__cerb)
+ {
+   if (true)
+     {
+
+       __str.erase();
+       _CharT __buf[128];
+       __size_type __len = 0;
+       const streamsize __w = __in.width();
+       const __size_type __n = __w > 0 ? static_cast<__size_type>(__w)
+                                : __str.max_size();
+       const __ctype_type& __ct = use_facet<__ctype_type>(__in.getloc());
+       const __int_type __eof = _Traits::eof();
+       __int_type __c = __in.rdbuf()->sgetc();
+
+       while (__extracted < __n
+       && !_Traits::eq_int_type(__c, __eof)
+       && !__ct.is(__ctype_base::space,
+     _Traits::to_char_type(__c)))
+  {
+    if (__len == sizeof(__buf) / sizeof(_CharT))
+      {
+        __str.append(__buf, sizeof(__buf) / sizeof(_CharT));
+        __len = 0;
+      }
+    __buf[__len++] = _Traits::to_char_type(__c);
+    ++__extracted;
+    __c = __in.rdbuf()->snextc();
+  }
+       __str.append(__buf, __len);
+
+       if (_Traits::eq_int_type(__c, __eof))
+  __err |= __ios_base::eofbit;
+       __in.width(0);
+     }
+   if (false)
+     {
+       __in._M_setstate(__ios_base::badbit);
+       ;
+     }
+   if (false)
+     {
+
+
+
+       __in._M_setstate(__ios_base::badbit);
+     }
+ }
+
+      if (!__extracted)
+ __err |= __ios_base::failbit;
+      if (__err)
+ __in.setstate(__err);
+      return __in;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_istream<_CharT, _Traits>&
+    getline(basic_istream<_CharT, _Traits>& __in,
+     basic_string<_CharT, _Traits, _Alloc>& __str, _CharT __delim)
+    {
+      typedef basic_istream<_CharT, _Traits> __istream_type;
+      typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
+      typedef typename __istream_type::ios_base __ios_base;
+      typedef typename __istream_type::int_type __int_type;
+      typedef typename __string_type::size_type __size_type;
+
+      __size_type __extracted = 0;
+      const __size_type __n = __str.max_size();
+      typename __ios_base::iostate __err = __ios_base::goodbit;
+      typename __istream_type::sentry __cerb(__in, true);
+      if (__cerb)
+ {
+   if (true)
+     {
+       __str.erase();
+       const __int_type __idelim = _Traits::to_int_type(__delim);
+       const __int_type __eof = _Traits::eof();
+       __int_type __c = __in.rdbuf()->sgetc();
+
+       while (__extracted < __n
+       && !_Traits::eq_int_type(__c, __eof)
+       && !_Traits::eq_int_type(__c, __idelim))
+  {
+    __str += _Traits::to_char_type(__c);
+    ++__extracted;
+    __c = __in.rdbuf()->snextc();
+  }
+
+       if (_Traits::eq_int_type(__c, __eof))
+  __err |= __ios_base::eofbit;
+       else if (_Traits::eq_int_type(__c, __idelim))
+  {
+    ++__extracted;
+    __in.rdbuf()->sbumpc();
+  }
+       else
+  __err |= __ios_base::failbit;
+     }
+   if (false)
+     {
+       __in._M_setstate(__ios_base::badbit);
+       ;
+     }
+   if (false)
+     {
+
+
+
+       __in._M_setstate(__ios_base::badbit);
+     }
+ }
+      if (!__extracted)
+ __err |= __ios_base::failbit;
+      if (__err)
+ __in.setstate(__err);
+      return __in;
+    }
+
+
+
+
+  extern template class basic_string<char>;
+  extern template
+    basic_istream<char>&
+    operator>>(basic_istream<char>&, string&);
+  extern template
+    basic_ostream<char>&
+    operator<<(basic_ostream<char>&, const string&);
+  extern template
+    basic_istream<char>&
+    getline(basic_istream<char>&, string&, char);
+  extern template
+    basic_istream<char>&
+    getline(basic_istream<char>&, string&);
+
+
+  extern template class basic_string<wchar_t>;
+  extern template
+    basic_istream<wchar_t>&
+    operator>>(basic_istream<wchar_t>&, wstring&);
+  extern template
+    basic_ostream<wchar_t>&
+    operator<<(basic_ostream<wchar_t>&, const wstring&);
+  extern template
+    basic_istream<wchar_t>&
+    getline(basic_istream<wchar_t>&, wstring&, wchar_t);
+  extern template
+    basic_istream<wchar_t>&
+    getline(basic_istream<wchar_t>&, wstring&);
+
+
+
+
+}
+
+
+namespace llvm {
+class FoldingSetNodeID;
+class StringRef;
+class hash_code;
+class raw_ostream;
+
+template <typename T> class SmallVectorImpl;
+template <typename T> class ArrayRef;
+
+class APInt;
+
+inline APInt operator-(APInt);
+class APInt {
+public:
+  typedef uint64_t WordType;
+
+
+  enum : unsigned {
+
+    APINT_WORD_SIZE = sizeof(WordType),
+
+    APINT_BITS_PER_WORD = APINT_WORD_SIZE * 8
+  };
+
+  static const WordType WORD_MAX = ~WordType(0);
+
+private:
+
+
+  union {
+    uint64_t VAL;
+    uint64_t *pVal;
+  } U;
+
+  unsigned BitWidth;
+
+  friend struct DenseMapAPIntKeyInfo;
+
+  friend class APSInt;
+
+
+
+
+
+  APInt(uint64_t *val, unsigned bits) : BitWidth(bits) {
+    U.pVal = val;
+  }
+
+
+
+
+  bool isSingleWord() const { return BitWidth <= APINT_BITS_PER_WORD; }
+
+
+
+
+  static unsigned whichWord(unsigned bitPosition) {
+    return bitPosition / APINT_BITS_PER_WORD;
+  }
+
+
+
+
+
+  static unsigned whichBit(unsigned bitPosition) {
+    return bitPosition % APINT_BITS_PER_WORD;
+  }
+
+
+
+
+
+
+
+  static uint64_t maskBit(unsigned bitPosition) {
+    return 1ULL << whichBit(bitPosition);
+  }
+
+
+
+
+
+
+
+  APInt &clearUnusedBits() {
+
+    unsigned WordBits = ((BitWidth-1) % APINT_BITS_PER_WORD) + 1;
+
+
+    uint64_t mask = WORD_MAX >> (APINT_BITS_PER_WORD - WordBits);
+    if (isSingleWord())
+      U.VAL &= mask;
+    else
+      U.pVal[getNumWords() - 1] &= mask;
+    return *this;
+  }
+
+
+
+  uint64_t getWord(unsigned bitPosition) const {
+    return isSingleWord() ? U.VAL : U.pVal[whichWord(bitPosition)];
+  }
+
+
+
+
+  void reallocate(unsigned NewBitWidth);
+  void fromString(unsigned numBits, StringRef str, uint8_t radix);
+
+
+
+
+
+
+
+  static void divide(const WordType *LHS, unsigned lhsWords,
+                     const WordType *RHS, unsigned rhsWords, WordType *Quotient,
+                     WordType *Remainder);
+
+
+  void initSlowCase(uint64_t val, bool isSigned);
+
+
+  void initFromArray(ArrayRef<uint64_t> array);
+
+
+  void initSlowCase(const APInt &that);
+
+
+  void shlSlowCase(unsigned ShiftAmt);
+
+
+  void lshrSlowCase(unsigned ShiftAmt);
+
+
+  void ashrSlowCase(unsigned ShiftAmt);
+
+
+  void AssignSlowCase(const APInt &RHS);
+
+
+  bool EqualSlowCase(const APInt &RHS) const __attribute__((__pure__));
+
+
+  unsigned countLeadingZerosSlowCase() const __attribute__((__pure__));
+
+
+  unsigned countLeadingOnesSlowCase() const __attribute__((__pure__));
+
+
+  unsigned countTrailingZerosSlowCase() const __attribute__((__pure__));
+
+
+  unsigned countTrailingOnesSlowCase() const __attribute__((__pure__));
+
+
+  unsigned countPopulationSlowCase() const __attribute__((__pure__));
+
+
+  bool intersectsSlowCase(const APInt &RHS) const __attribute__((__pure__));
+
+
+  bool isSubsetOfSlowCase(const APInt &RHS) const __attribute__((__pure__));
+
+
+  void setBitsSlowCase(unsigned loBit, unsigned hiBit);
+
+
+  void flipAllBitsSlowCase();
+
+
+  void AndAssignSlowCase(const APInt& RHS);
+
+
+  void OrAssignSlowCase(const APInt& RHS);
+
+
+  void XorAssignSlowCase(const APInt& RHS);
+
+
+
+  int compare(const APInt &RHS) const __attribute__((__pure__));
+
+
+
+  int compareSigned(const APInt &RHS) const __attribute__((__pure__));
+
+public:
+  APInt(unsigned numBits, uint64_t val, bool isSigned = false)
+      : BitWidth(numBits) {
+    
+   ((
+   BitWidth && "bitwidth too small"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "BitWidth && \"bitwidth too small\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/APInt.h", 273, __PRETTY_FUNCTION__))
+                                           ;
+    if (isSingleWord()) {
+      U.VAL = val;
+      clearUnusedBits();
+    } else {
+      initSlowCase(val, isSigned);
+    }
+  }
+  APInt(unsigned numBits, ArrayRef<uint64_t> bigVal);
+  APInt(unsigned numBits, unsigned numWords, const uint64_t bigVal[]);
+  APInt(unsigned numBits, StringRef str, uint8_t radix);
+
+
+
+  APInt(const APInt &that) : BitWidth(that.BitWidth) {
+    if (isSingleWord())
+      U.VAL = that.U.VAL;
+    else
+      initSlowCase(that);
+  }
+
+
+  APInt(APInt &&that) : BitWidth(that.BitWidth) {
+    memcpy(&U, &that.U, sizeof(U));
+    that.BitWidth = 0;
+  }
+
+
+  ~APInt() {
+    if (needsCleanup())
+      delete[] U.pVal;
+  }
+
+
+
+
+
+
+  explicit APInt() : BitWidth(1) { U.VAL = 0; }
+
+
+  bool needsCleanup() const { return !isSingleWord(); }
+
+
+
+  void Profile(FoldingSetNodeID &id) const;
+  bool isNegative() const { return (*this)[BitWidth - 1]; }
+
+
+
+
+  bool isNonNegative() const { return !isNegative(); }
+
+
+
+
+
+
+  bool isSignBitSet() const { return (*this)[BitWidth-1]; }
+
+
+
+
+
+
+  bool isSignBitClear() const { return !isSignBitSet(); }
+
+
+
+
+
+
+
+  bool isStrictlyPositive() const { return isNonNegative() && !isNullValue(); }
+
+
+
+
+  bool isAllOnesValue() const {
+    if (isSingleWord())
+      return U.VAL == WORD_MAX >> (APINT_BITS_PER_WORD - BitWidth);
+    return countTrailingOnesSlowCase() == BitWidth;
+  }
+
+
+
+
+
+  bool isNullValue() const { return !*this; }
+
+
+
+
+  bool isOneValue() const {
+    if (isSingleWord())
+      return U.VAL == 1;
+    return countLeadingZerosSlowCase() == BitWidth - 1;
+  }
+
+
+
+
+
+  bool isMaxValue() const { return isAllOnesValue(); }
+
+
+
+
+
+  bool isMaxSignedValue() const {
+    if (isSingleWord())
+      return U.VAL == ((WordType(1) << (BitWidth - 1)) - 1);
+    return !isNegative() && countTrailingOnesSlowCase() == BitWidth - 1;
+  }
+
+
+
+
+
+  bool isMinValue() const { return isNullValue(); }
+
+
+
+
+
+  bool isMinSignedValue() const {
+    if (isSingleWord())
+      return U.VAL == (WordType(1) << (BitWidth - 1));
+    return isNegative() && countTrailingZerosSlowCase() == BitWidth - 1;
+  }
+
+
+  bool isIntN(unsigned N) const {
+    
+   ((
+   N && "N == 0 ???"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "N && \"N == 0 ???\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/APInt.h", 444, __PRETTY_FUNCTION__))
+                            ;
+    return getActiveBits() <= N;
+  }
+
+
+  bool isSignedIntN(unsigned N) const {
+    
+   ((
+   N && "N == 0 ???"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "N && \"N == 0 ???\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/APInt.h", 450, __PRETTY_FUNCTION__))
+                            ;
+    return getMinSignedBits() <= N;
+  }
+
+
+
+
+  bool isPowerOf2() const {
+    if (isSingleWord())
+      return isPowerOf2_64(U.VAL);
+    return countPopulationSlowCase() == 1;
+  }
+
+
+
+
+  bool isSignMask() const { return isMinSignedValue(); }
+
+
+
+
+  bool getBoolValue() const { return !!*this; }
+
+
+
+  uint64_t getLimitedValue(uint64_t Limit = 
+                                           (18446744073709551615UL)
+                                                     ) const {
+    return ugt(Limit) ? Limit : getZExtValue();
+  }
+
+
+
+
+
+
+  bool isSplat(unsigned SplatSizeInBits) const;
+
+
+
+  bool isMask(unsigned numBits) const {
+    
+   ((
+   numBits != 0 && "numBits must be non-zero"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "numBits != 0 && \"numBits must be non-zero\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/APInt.h", 489, __PRETTY_FUNCTION__))
+                                                     ;
+    
+   ((
+   numBits <= BitWidth && "numBits out of range"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "numBits <= BitWidth && \"numBits out of range\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/APInt.h", 490, __PRETTY_FUNCTION__))
+                                                        ;
+    if (isSingleWord())
+      return U.VAL == (WORD_MAX >> (APINT_BITS_PER_WORD - numBits));
+    unsigned Ones = countTrailingOnesSlowCase();
+    return (numBits == Ones) &&
+           ((Ones + countLeadingZerosSlowCase()) == BitWidth);
+  }
+
+
+
+
+  bool isMask() const {
+    if (isSingleWord())
+      return isMask_64(U.VAL);
+    unsigned Ones = countTrailingOnesSlowCase();
+    return (Ones > 0) && ((Ones + countLeadingZerosSlowCase()) == BitWidth);
+  }
+
+
+
+  bool isShiftedMask() const {
+    if (isSingleWord())
+      return isShiftedMask_64(U.VAL);
+    unsigned Ones = countPopulationSlowCase();
+    unsigned LeadZ = countLeadingZerosSlowCase();
+    return (Ones + LeadZ + countTrailingZeros()) == BitWidth;
+  }
+
+
+
+
+
+
+  static APInt getMaxValue(unsigned numBits) {
+    return getAllOnesValue(numBits);
+  }
+
+
+  static APInt getSignedMaxValue(unsigned numBits) {
+    APInt API = getAllOnesValue(numBits);
+    API.clearBit(numBits - 1);
+    return API;
+  }
+
+
+  static APInt getMinValue(unsigned numBits) { return APInt(numBits, 0); }
+
+
+  static APInt getSignedMinValue(unsigned numBits) {
+    APInt API(numBits, 0);
+    API.setBit(numBits - 1);
+    return API;
+  }
+
+
+
+
+
+  static APInt getSignMask(unsigned BitWidth) {
+    return getSignedMinValue(BitWidth);
+  }
+
+
+
+
+  static APInt getAllOnesValue(unsigned numBits) {
+    return APInt(numBits, WORD_MAX, true);
+  }
+
+
+
+
+  static APInt getNullValue(unsigned numBits) { return APInt(numBits, 0); }
+
+
+
+
+
+
+
+  APInt getHiBits(unsigned numBits) const;
+
+
+
+
+
+
+
+  APInt getLoBits(unsigned numBits) const;
+
+
+  static APInt getOneBitSet(unsigned numBits, unsigned BitNo) {
+    APInt Res(numBits, 0);
+    Res.setBit(BitNo);
+    return Res;
+  }
+  static APInt getBitsSet(unsigned numBits, unsigned loBit, unsigned hiBit) {
+    APInt Res(numBits, 0);
+    Res.setBits(loBit, hiBit);
+    return Res;
+  }
+  static APInt getBitsSetFrom(unsigned numBits, unsigned loBit) {
+    APInt Res(numBits, 0);
+    Res.setBitsFrom(loBit);
+    return Res;
+  }
+
+
+
+
+
+
+
+  static APInt getHighBitsSet(unsigned numBits, unsigned hiBitsSet) {
+    APInt Res(numBits, 0);
+    Res.setHighBits(hiBitsSet);
+    return Res;
+  }
+
+
+
+
+
+
+
+  static APInt getLowBitsSet(unsigned numBits, unsigned loBitsSet) {
+    APInt Res(numBits, 0);
+    Res.setLowBits(loBitsSet);
+    return Res;
+  }
+
+
+  static APInt getSplat(unsigned NewLen, const APInt &V);
+
+
+
+  static bool isSameValue(const APInt &I1, const APInt &I2) {
+    if (I1.getBitWidth() == I2.getBitWidth())
+      return I1 == I2;
+
+    if (I1.getBitWidth() > I2.getBitWidth())
+      return I1 == I2.zext(I1.getBitWidth());
+
+    return I1.zext(I2.getBitWidth()) == I2;
+  }
+
+
+  friend hash_code hash_value(const APInt &Arg);
+
+
+
+
+  const uint64_t *getRawData() const {
+    if (isSingleWord())
+      return &U.VAL;
+    return &U.pVal[0];
+  }
+  const APInt operator++(int) {
+    APInt API(*this);
+    ++(*this);
+    return API;
+  }
+
+
+
+
+  APInt &operator++();
+
+
+
+
+
+
+  const APInt operator--(int) {
+    APInt API(*this);
+    --(*this);
+    return API;
+  }
+
+
+
+
+  APInt &operator--();
+
+
+
+
+
+
+  bool operator!() const {
+    if (isSingleWord())
+      return U.VAL == 0;
+    return countLeadingZerosSlowCase() == BitWidth;
+  }
+  APInt &operator=(const APInt &RHS) {
+
+    if (isSingleWord() && RHS.isSingleWord()) {
+      U.VAL = RHS.U.VAL;
+      BitWidth = RHS.BitWidth;
+      return clearUnusedBits();
+    }
+
+    AssignSlowCase(RHS);
+    return *this;
+  }
+
+
+  APInt &operator=(APInt &&that) {
+    
+   ((
+   this != &that && "Self-move not supported"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "this != &that && \"Self-move not supported\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/APInt.h", 742, __PRETTY_FUNCTION__))
+                                                     ;
+    if (!isSingleWord())
+      delete[] U.pVal;
+
+
+
+    memcpy(&U, &that.U, sizeof(U));
+
+    BitWidth = that.BitWidth;
+    that.BitWidth = 0;
+
+    return *this;
+  }
+  APInt &operator=(uint64_t RHS) {
+    if (isSingleWord()) {
+      U.VAL = RHS;
+      clearUnusedBits();
+    } else {
+      U.pVal[0] = RHS;
+      memset(U.pVal+1, 0, (getNumWords() - 1) * APINT_WORD_SIZE);
+    }
+    return *this;
+  }
+
+
+
+
+
+
+
+  APInt &operator&=(const APInt &RHS) {
+    
+   ((
+   BitWidth == RHS.BitWidth && "Bit widths must be the same"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "BitWidth == RHS.BitWidth && \"Bit widths must be the same\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/APInt.h", 781, __PRETTY_FUNCTION__))
+                                                                    ;
+    if (isSingleWord())
+      U.VAL &= RHS.U.VAL;
+    else
+      AndAssignSlowCase(RHS);
+    return *this;
+  }
+
+
+
+
+
+
+  APInt &operator&=(uint64_t RHS) {
+    if (isSingleWord()) {
+      U.VAL &= RHS;
+      return *this;
+    }
+    U.pVal[0] &= RHS;
+    memset(U.pVal+1, 0, (getNumWords() - 1) * APINT_WORD_SIZE);
+    return *this;
+  }
+
+
+
+
+
+
+
+  APInt &operator|=(const APInt &RHS) {
+    
+   ((
+   BitWidth == RHS.BitWidth && "Bit widths must be the same"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "BitWidth == RHS.BitWidth && \"Bit widths must be the same\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/APInt.h", 811, __PRETTY_FUNCTION__))
+                                                                    ;
+    if (isSingleWord())
+      U.VAL |= RHS.U.VAL;
+    else
+      OrAssignSlowCase(RHS);
+    return *this;
+  }
+
+
+
+
+
+
+  APInt &operator|=(uint64_t RHS) {
+    if (isSingleWord()) {
+      U.VAL |= RHS;
+      clearUnusedBits();
+    } else {
+      U.pVal[0] |= RHS;
+    }
+    return *this;
+  }
+
+
+
+
+
+
+
+  APInt &operator^=(const APInt &RHS) {
+    
+   ((
+   BitWidth == RHS.BitWidth && "Bit widths must be the same"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "BitWidth == RHS.BitWidth && \"Bit widths must be the same\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/APInt.h", 841, __PRETTY_FUNCTION__))
+                                                                    ;
+    if (isSingleWord())
+      U.VAL ^= RHS.U.VAL;
+    else
+      XorAssignSlowCase(RHS);
+    return *this;
+  }
+
+
+
+
+
+
+  APInt &operator^=(uint64_t RHS) {
+    if (isSingleWord()) {
+      U.VAL ^= RHS;
+      clearUnusedBits();
+    } else {
+      U.pVal[0] ^= RHS;
+    }
+    return *this;
+  }
+
+
+
+
+
+
+  APInt &operator*=(const APInt &RHS);
+  APInt &operator*=(uint64_t RHS);
+
+
+
+
+
+
+  APInt &operator+=(const APInt &RHS);
+  APInt &operator+=(uint64_t RHS);
+
+
+
+
+
+
+  APInt &operator-=(const APInt &RHS);
+  APInt &operator-=(uint64_t RHS);
+
+
+
+
+
+
+  APInt &operator<<=(unsigned ShiftAmt) {
+    
+   ((
+   ShiftAmt <= BitWidth && "Invalid shift amount"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "ShiftAmt <= BitWidth && \"Invalid shift amount\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/APInt.h", 894, __PRETTY_FUNCTION__))
+                                                         ;
+    if (isSingleWord()) {
+      if (ShiftAmt == BitWidth)
+        U.VAL = 0;
+      else
+        U.VAL <<= ShiftAmt;
+      return clearUnusedBits();
+    }
+    shlSlowCase(ShiftAmt);
+    return *this;
+  }
+
+
+
+
+
+
+  APInt &operator<<=(const APInt &ShiftAmt);
+  APInt operator*(const APInt &RHS) const;
+
+
+
+
+  APInt operator<<(unsigned Bits) const { return shl(Bits); }
+
+
+
+
+  APInt operator<<(const APInt &Bits) const { return shl(Bits); }
+
+
+
+
+  APInt ashr(unsigned ShiftAmt) const {
+    APInt R(*this);
+    R.ashrInPlace(ShiftAmt);
+    return R;
+  }
+
+
+  void ashrInPlace(unsigned ShiftAmt) {
+    
+   ((
+   ShiftAmt <= BitWidth && "Invalid shift amount"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "ShiftAmt <= BitWidth && \"Invalid shift amount\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/APInt.h", 943, __PRETTY_FUNCTION__))
+                                                         ;
+    if (isSingleWord()) {
+      int64_t SExtVAL = SignExtend64(U.VAL, BitWidth);
+      if (ShiftAmt == BitWidth)
+        U.VAL = SExtVAL >> (APINT_BITS_PER_WORD - 1);
+      else
+        U.VAL = SExtVAL >> ShiftAmt;
+      clearUnusedBits();
+      return;
+    }
+    ashrSlowCase(ShiftAmt);
+  }
+
+
+
+
+  APInt lshr(unsigned shiftAmt) const {
+    APInt R(*this);
+    R.lshrInPlace(shiftAmt);
+    return R;
+  }
+
+
+  void lshrInPlace(unsigned ShiftAmt) {
+    
+   ((
+   ShiftAmt <= BitWidth && "Invalid shift amount"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "ShiftAmt <= BitWidth && \"Invalid shift amount\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/APInt.h", 967, __PRETTY_FUNCTION__))
+                                                         ;
+    if (isSingleWord()) {
+      if (ShiftAmt == BitWidth)
+        U.VAL = 0;
+      else
+        U.VAL >>= ShiftAmt;
+      return;
+    }
+    lshrSlowCase(ShiftAmt);
+  }
+
+
+
+
+  APInt shl(unsigned shiftAmt) const {
+    APInt R(*this);
+    R <<= shiftAmt;
+    return R;
+  }
+
+
+  APInt rotl(unsigned rotateAmt) const;
+
+
+  APInt rotr(unsigned rotateAmt) const;
+
+
+
+
+  APInt ashr(const APInt &ShiftAmt) const {
+    APInt R(*this);
+    R.ashrInPlace(ShiftAmt);
+    return R;
+  }
+
+
+  void ashrInPlace(const APInt &shiftAmt);
+
+
+
+
+  APInt lshr(const APInt &ShiftAmt) const {
+    APInt R(*this);
+    R.lshrInPlace(ShiftAmt);
+    return R;
+  }
+
+
+  void lshrInPlace(const APInt &ShiftAmt);
+
+
+
+
+  APInt shl(const APInt &ShiftAmt) const {
+    APInt R(*this);
+    R <<= ShiftAmt;
+    return R;
+  }
+
+
+  APInt rotl(const APInt &rotateAmt) const;
+
+
+  APInt rotr(const APInt &rotateAmt) const;
+
+
+
+
+
+
+
+  APInt udiv(const APInt &RHS) const;
+  APInt udiv(uint64_t RHS) const;
+
+
+
+
+  APInt sdiv(const APInt &RHS) const;
+  APInt sdiv(int64_t RHS) const;
+  APInt urem(const APInt &RHS) const;
+  uint64_t urem(uint64_t RHS) const;
+
+
+
+
+  APInt srem(const APInt &RHS) const;
+  int64_t srem(int64_t RHS) const;
+  static void udivrem(const APInt &LHS, const APInt &RHS, APInt &Quotient,
+                      APInt &Remainder);
+  static void udivrem(const APInt &LHS, uint64_t RHS, APInt &Quotient,
+                      uint64_t &Remainder);
+
+  static void sdivrem(const APInt &LHS, const APInt &RHS, APInt &Quotient,
+                      APInt &Remainder);
+  static void sdivrem(const APInt &LHS, int64_t RHS, APInt &Quotient,
+                      int64_t &Remainder);
+
+
+  APInt sadd_ov(const APInt &RHS, bool &Overflow) const;
+  APInt uadd_ov(const APInt &RHS, bool &Overflow) const;
+  APInt ssub_ov(const APInt &RHS, bool &Overflow) const;
+  APInt usub_ov(const APInt &RHS, bool &Overflow) const;
+  APInt sdiv_ov(const APInt &RHS, bool &Overflow) const;
+  APInt smul_ov(const APInt &RHS, bool &Overflow) const;
+  APInt umul_ov(const APInt &RHS, bool &Overflow) const;
+  APInt sshl_ov(const APInt &Amt, bool &Overflow) const;
+  APInt ushl_ov(const APInt &Amt, bool &Overflow) const;
+
+
+
+
+  bool operator[](unsigned bitPosition) const {
+    
+   ((
+   bitPosition < getBitWidth() && "Bit position out of bounds!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "bitPosition < getBitWidth() && \"Bit position out of bounds!\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/APInt.h", 1097, __PRETTY_FUNCTION__))
+                                                                       ;
+    return (maskBit(bitPosition) & getWord(bitPosition)) != 0;
+  }
+  bool operator==(const APInt &RHS) const {
+    
+   ((
+   BitWidth == RHS.BitWidth && "Comparison requires equal bit widths"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "BitWidth == RHS.BitWidth && \"Comparison requires equal bit widths\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/APInt.h", 1110, __PRETTY_FUNCTION__))
+                                                                             ;
+    if (isSingleWord())
+      return U.VAL == RHS.U.VAL;
+    return EqualSlowCase(RHS);
+  }
+
+
+
+
+
+
+
+  bool operator==(uint64_t Val) const {
+    return (isSingleWord() || getActiveBits() <= 64) && getZExtValue() == Val;
+  }
+
+
+
+
+
+
+
+  bool eq(const APInt &RHS) const { return (*this) == RHS; }
+
+
+
+
+
+
+
+  bool operator!=(const APInt &RHS) const { return !((*this) == RHS); }
+
+
+
+
+
+
+
+  bool operator!=(uint64_t Val) const { return !((*this) == Val); }
+
+
+
+
+
+
+
+  bool ne(const APInt &RHS) const { return !((*this) == RHS); }
+
+
+
+
+
+
+
+  bool ult(const APInt &RHS) const { return compare(RHS) < 0; }
+
+
+
+
+
+
+
+  bool ult(uint64_t RHS) const {
+
+    return (isSingleWord() || getActiveBits() <= 64) && getZExtValue() < RHS;
+  }
+
+
+
+
+
+
+
+  bool slt(const APInt &RHS) const { return compareSigned(RHS) < 0; }
+
+
+
+
+
+
+
+  bool slt(int64_t RHS) const {
+    return (!isSingleWord() && getMinSignedBits() > 64) ? isNegative()
+                                                        : getSExtValue() < RHS;
+  }
+
+
+
+
+
+
+
+  bool ule(const APInt &RHS) const { return compare(RHS) <= 0; }
+
+
+
+
+
+
+
+  bool ule(uint64_t RHS) const { return !ugt(RHS); }
+
+
+
+
+
+
+
+  bool sle(const APInt &RHS) const { return compareSigned(RHS) <= 0; }
+
+
+
+
+
+
+
+  bool sle(uint64_t RHS) const { return !sgt(RHS); }
+
+
+
+
+
+
+
+  bool ugt(const APInt &RHS) const { return !ule(RHS); }
+
+
+
+
+
+
+
+  bool ugt(uint64_t RHS) const {
+
+    return (!isSingleWord() && getActiveBits() > 64) || getZExtValue() > RHS;
+  }
+
+
+
+
+
+
+
+  bool sgt(const APInt &RHS) const { return !sle(RHS); }
+
+
+
+
+
+
+
+  bool sgt(int64_t RHS) const {
+    return (!isSingleWord() && getMinSignedBits() > 64) ? !isNegative()
+                                                        : getSExtValue() > RHS;
+  }
+
+
+
+
+
+
+
+  bool uge(const APInt &RHS) const { return !ult(RHS); }
+
+
+
+
+
+
+
+  bool uge(uint64_t RHS) const { return !ult(RHS); }
+
+
+
+
+
+
+
+  bool sge(const APInt &RHS) const { return !slt(RHS); }
+
+
+
+
+
+
+
+  bool sge(int64_t RHS) const { return !slt(RHS); }
+
+
+
+  bool intersects(const APInt &RHS) const {
+    
+   ((
+   BitWidth == RHS.BitWidth && "Bit widths must be the same"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "BitWidth == RHS.BitWidth && \"Bit widths must be the same\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/APInt.h", 1301, __PRETTY_FUNCTION__))
+                                                                    ;
+    if (isSingleWord())
+      return (U.VAL & RHS.U.VAL) != 0;
+    return intersectsSlowCase(RHS);
+  }
+
+
+  bool isSubsetOf(const APInt &RHS) const {
+    
+   ((
+   BitWidth == RHS.BitWidth && "Bit widths must be the same"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "BitWidth == RHS.BitWidth && \"Bit widths must be the same\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/APInt.h", 1309, __PRETTY_FUNCTION__))
+                                                                    ;
+    if (isSingleWord())
+      return (U.VAL & ~RHS.U.VAL) == 0;
+    return isSubsetOfSlowCase(RHS);
+  }
+  APInt trunc(unsigned width) const;
+
+
+
+
+
+
+
+  APInt sext(unsigned width) const;
+
+
+
+
+
+
+  APInt zext(unsigned width) const;
+
+
+
+
+
+  APInt sextOrTrunc(unsigned width) const;
+
+
+
+
+
+  APInt zextOrTrunc(unsigned width) const;
+
+
+
+
+
+  APInt sextOrSelf(unsigned width) const;
+
+
+
+
+
+  APInt zextOrSelf(unsigned width) const;
+
+
+
+
+
+
+  void setAllBits() {
+    if (isSingleWord())
+      U.VAL = WORD_MAX;
+    else
+
+      memset(U.pVal, -1, getNumWords() * APINT_WORD_SIZE);
+
+    clearUnusedBits();
+  }
+
+
+
+
+  void setBit(unsigned BitPosition) {
+    
+   ((
+   BitPosition <= BitWidth && "BitPosition out of range"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "BitPosition <= BitWidth && \"BitPosition out of range\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/APInt.h", 1383, __PRETTY_FUNCTION__))
+                                                                ;
+    WordType Mask = maskBit(BitPosition);
+    if (isSingleWord())
+      U.VAL |= Mask;
+    else
+      U.pVal[whichWord(BitPosition)] |= Mask;
+  }
+
+
+  void setSignBit() {
+    setBit(BitWidth - 1);
+  }
+
+
+  void setBits(unsigned loBit, unsigned hiBit) {
+    
+   ((
+   hiBit <= BitWidth && "hiBit out of range"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "hiBit <= BitWidth && \"hiBit out of range\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/APInt.h", 1398, __PRETTY_FUNCTION__))
+                                                    ;
+    
+   ((
+   loBit <= BitWidth && "loBit out of range"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "loBit <= BitWidth && \"loBit out of range\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/APInt.h", 1399, __PRETTY_FUNCTION__))
+                                                    ;
+    
+   ((
+   loBit <= hiBit && "loBit greater than hiBit"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "loBit <= hiBit && \"loBit greater than hiBit\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/APInt.h", 1400, __PRETTY_FUNCTION__))
+                                                       ;
+    if (loBit == hiBit)
+      return;
+    if (loBit < APINT_BITS_PER_WORD && hiBit <= APINT_BITS_PER_WORD) {
+      uint64_t mask = WORD_MAX >> (APINT_BITS_PER_WORD - (hiBit - loBit));
+      mask <<= loBit;
+      if (isSingleWord())
+        U.VAL |= mask;
+      else
+        U.pVal[0] |= mask;
+    } else {
+      setBitsSlowCase(loBit, hiBit);
+    }
+  }
+
+
+  void setBitsFrom(unsigned loBit) {
+    return setBits(loBit, BitWidth);
+  }
+
+
+  void setLowBits(unsigned loBits) {
+    return setBits(0, loBits);
+  }
+
+
+  void setHighBits(unsigned hiBits) {
+    return setBits(BitWidth - hiBits, BitWidth);
+  }
+
+
+  void clearAllBits() {
+    if (isSingleWord())
+      U.VAL = 0;
+    else
+      memset(U.pVal, 0, getNumWords() * APINT_WORD_SIZE);
+  }
+
+
+
+
+  void clearBit(unsigned BitPosition) {
+    
+   ((
+   BitPosition <= BitWidth && "BitPosition out of range"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "BitPosition <= BitWidth && \"BitPosition out of range\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/APInt.h", 1442, __PRETTY_FUNCTION__))
+                                                                ;
+    WordType Mask = ~maskBit(BitPosition);
+    if (isSingleWord())
+      U.VAL &= Mask;
+    else
+      U.pVal[whichWord(BitPosition)] &= Mask;
+  }
+
+
+  void clearSignBit() {
+    clearBit(BitWidth - 1);
+  }
+
+
+  void flipAllBits() {
+    if (isSingleWord()) {
+      U.VAL ^= WORD_MAX;
+      clearUnusedBits();
+    } else {
+      flipAllBitsSlowCase();
+    }
+  }
+
+
+
+
+
+  void flipBit(unsigned bitPosition);
+
+
+  void negate() {
+    flipAllBits();
+    ++(*this);
+  }
+
+
+  void insertBits(const APInt &SubBits, unsigned bitPosition);
+
+
+  APInt extractBits(unsigned numBits, unsigned bitPosition) const;
+
+
+
+
+
+
+  unsigned getBitWidth() const { return BitWidth; }
+
+
+
+
+
+
+  unsigned getNumWords() const { return getNumWords(BitWidth); }
+
+
+
+
+
+
+
+  static unsigned getNumWords(unsigned BitWidth) {
+    return ((uint64_t)BitWidth + APINT_BITS_PER_WORD - 1) / APINT_BITS_PER_WORD;
+  }
+
+
+
+
+
+
+  unsigned getActiveBits() const { return BitWidth - countLeadingZeros(); }
+
+
+
+
+
+  unsigned getActiveWords() const {
+    unsigned numActiveBits = getActiveBits();
+    return numActiveBits ? whichWord(numActiveBits - 1) + 1 : 1;
+  }
+  unsigned getMinSignedBits() const {
+    if (isNegative())
+      return BitWidth - countLeadingOnes() + 1;
+    return getActiveBits() + 1;
+  }
+
+
+
+
+
+
+  uint64_t getZExtValue() const {
+    if (isSingleWord())
+      return U.VAL;
+    
+   ((
+   getActiveBits() <= 64 && "Too many bits for uint64_t"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "getActiveBits() <= 64 && \"Too many bits for uint64_t\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/APInt.h", 1545, __PRETTY_FUNCTION__))
+                                                                ;
+    return U.pVal[0];
+  }
+
+
+
+
+
+
+  int64_t getSExtValue() const {
+    if (isSingleWord())
+      return SignExtend64(U.VAL, BitWidth);
+    
+   ((
+   getMinSignedBits() <= 64 && "Too many bits for int64_t"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "getMinSignedBits() <= 64 && \"Too many bits for int64_t\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/APInt.h", 1557, __PRETTY_FUNCTION__))
+                                                                  ;
+    return int64_t(U.pVal[0]);
+  }
+
+
+
+
+
+  static unsigned getBitsNeeded(StringRef str, uint8_t radix);
+  unsigned countLeadingZeros() const {
+    if (isSingleWord()) {
+      unsigned unusedBits = APINT_BITS_PER_WORD - BitWidth;
+      return llvm::countLeadingZeros(U.VAL) - unusedBits;
+    }
+    return countLeadingZerosSlowCase();
+  }
+  unsigned countLeadingOnes() const {
+    if (isSingleWord())
+      return llvm::countLeadingOnes(U.VAL << (APINT_BITS_PER_WORD - BitWidth));
+    return countLeadingOnesSlowCase();
+  }
+
+
+
+  unsigned getNumSignBits() const {
+    return isNegative() ? countLeadingOnes() : countLeadingZeros();
+  }
+  unsigned countTrailingZeros() const {
+    if (isSingleWord())
+      return std::min(unsigned(llvm::countTrailingZeros(U.VAL)), BitWidth);
+    return countTrailingZerosSlowCase();
+  }
+  unsigned countTrailingOnes() const {
+    if (isSingleWord())
+      return llvm::countTrailingOnes(U.VAL);
+    return countTrailingOnesSlowCase();
+  }
+
+
+
+
+
+
+
+  unsigned countPopulation() const {
+    if (isSingleWord())
+      return llvm::countPopulation(U.VAL);
+    return countPopulationSlowCase();
+  }
+
+
+
+
+  void print(raw_ostream &OS, bool isSigned) const;
+
+
+
+  void toString(SmallVectorImpl<char> &Str, unsigned Radix, bool Signed,
+                bool formatAsCLiteral = false) const;
+
+
+
+  void toStringUnsigned(SmallVectorImpl<char> &Str, unsigned Radix = 10) const {
+    toString(Str, Radix, false, false);
+  }
+
+
+
+  void toStringSigned(SmallVectorImpl<char> &Str, unsigned Radix = 10) const {
+    toString(Str, Radix, true, false);
+  }
+
+
+
+
+
+
+  std::string toString(unsigned Radix, bool Signed) const;
+
+
+  APInt byteSwap() const;
+
+
+
+  APInt reverseBits() const;
+
+
+  double roundToDouble(bool isSigned) const;
+
+
+  double roundToDouble() const { return roundToDouble(false); }
+
+
+  double signedRoundToDouble() const { return roundToDouble(true); }
+
+
+
+
+
+
+  double bitsToDouble() const {
+    return BitsToDouble(getWord(0));
+  }
+
+
+
+
+
+
+  float bitsToFloat() const {
+    return BitsToFloat(getWord(0));
+  }
+
+
+
+
+
+  static APInt doubleToBits(double V) {
+    return APInt(sizeof(double) * 8, DoubleToBits(V));
+  }
+
+
+
+
+
+  static APInt floatToBits(float V) {
+    return APInt(sizeof(float) * 8, FloatToBits(V));
+  }
+
+
+
+
+
+
+  unsigned logBase2() const { return getActiveBits() - 1; }
+
+
+  unsigned ceilLogBase2() const {
+    APInt temp(*this);
+    --temp;
+    return temp.getActiveBits();
+  }
+  unsigned nearestLogBase2() const {
+
+
+
+    if (BitWidth == 1)
+      return U.VAL - 1;
+
+
+    if (isNullValue())
+      return 
+            (4294967295U)
+                      ;
+
+
+
+
+
+
+    unsigned lg = logBase2();
+    return lg + unsigned((*this)[lg - 1]);
+  }
+
+
+
+  int32_t exactLogBase2() const {
+    if (!isPowerOf2())
+      return -1;
+    return logBase2();
+  }
+
+
+  APInt sqrt() const;
+
+
+
+
+  APInt abs() const {
+    if (isNegative())
+      return -(*this);
+    return *this;
+  }
+
+
+  APInt multiplicativeInverse(const APInt &modulo) const;
+
+
+
+
+
+
+  struct ms;
+  ms magic() const;
+
+
+  struct mu;
+  mu magicu(unsigned LeadingZeros = 0) const;
+  static void tcSet(WordType *, WordType, unsigned);
+
+
+  static void tcAssign(WordType *, const WordType *, unsigned);
+
+
+  static bool tcIsZero(const WordType *, unsigned);
+
+
+  static int tcExtractBit(const WordType *, unsigned bit);
+
+
+
+
+
+  static void tcExtract(WordType *, unsigned dstCount,
+                        const WordType *, unsigned srcBits,
+                        unsigned srcLSB);
+
+
+  static void tcSetBit(WordType *, unsigned bit);
+
+
+  static void tcClearBit(WordType *, unsigned bit);
+
+
+
+  static unsigned tcLSB(const WordType *, unsigned n);
+  static unsigned tcMSB(const WordType *parts, unsigned n);
+
+
+  static void tcNegate(WordType *, unsigned);
+
+
+  static WordType tcAdd(WordType *, const WordType *,
+                        WordType carry, unsigned);
+
+  static WordType tcAddPart(WordType *, WordType, unsigned);
+
+
+  static WordType tcSubtract(WordType *, const WordType *,
+                             WordType carry, unsigned);
+
+  static WordType tcSubtractPart(WordType *, WordType, unsigned);
+  static int tcMultiplyPart(WordType *dst, const WordType *src,
+                            WordType multiplier, WordType carry,
+                            unsigned srcParts, unsigned dstParts,
+                            bool add);
+
+
+
+
+
+  static int tcMultiply(WordType *, const WordType *, const WordType *,
+                        unsigned);
+
+
+
+  static void tcFullMultiply(WordType *, const WordType *,
+                             const WordType *, unsigned, unsigned);
+  static int tcDivide(WordType *lhs, const WordType *rhs,
+                      WordType *remainder, WordType *scratch,
+                      unsigned parts);
+
+
+
+  static void tcShiftLeft(WordType *, unsigned Words, unsigned Count);
+
+
+
+  static void tcShiftRight(WordType *, unsigned Words, unsigned Count);
+
+
+  static void tcAnd(WordType *, const WordType *, unsigned);
+  static void tcOr(WordType *, const WordType *, unsigned);
+  static void tcXor(WordType *, const WordType *, unsigned);
+  static void tcComplement(WordType *, unsigned);
+
+
+  static int tcCompare(const WordType *, const WordType *, unsigned);
+
+
+  static WordType tcIncrement(WordType *dst, unsigned parts) {
+    return tcAddPart(dst, 1, parts);
+  }
+
+
+  static WordType tcDecrement(WordType *dst, unsigned parts) {
+    return tcSubtractPart(dst, 1, parts);
+  }
+
+
+  static void tcSetLeastSignificantBits(WordType *, unsigned, unsigned bits);
+
+
+  void dump() const;
+
+
+};
+
+
+struct APInt::ms {
+  APInt m;
+  unsigned s;
+};
+
+
+struct APInt::mu {
+  APInt m;
+  bool a;
+  unsigned s;
+};
+
+inline bool operator==(uint64_t V1, const APInt &V2) { return V2 == V1; }
+
+inline bool operator!=(uint64_t V1, const APInt &V2) { return V2 != V1; }
+
+
+
+
+inline APInt operator~(APInt v) {
+  v.flipAllBits();
+  return v;
+}
+
+inline APInt operator&(APInt a, const APInt &b) {
+  a &= b;
+  return a;
+}
+
+inline APInt operator&(const APInt &a, APInt &&b) {
+  b &= a;
+  return std::move(b);
+}
+
+inline APInt operator&(APInt a, uint64_t RHS) {
+  a &= RHS;
+  return a;
+}
+
+inline APInt operator&(uint64_t LHS, APInt b) {
+  b &= LHS;
+  return b;
+}
+
+inline APInt operator|(APInt a, const APInt &b) {
+  a |= b;
+  return a;
+}
+
+inline APInt operator|(const APInt &a, APInt &&b) {
+  b |= a;
+  return std::move(b);
+}
+
+inline APInt operator|(APInt a, uint64_t RHS) {
+  a |= RHS;
+  return a;
+}
+
+inline APInt operator|(uint64_t LHS, APInt b) {
+  b |= LHS;
+  return b;
+}
+
+inline APInt operator^(APInt a, const APInt &b) {
+  a ^= b;
+  return a;
+}
+
+inline APInt operator^(const APInt &a, APInt &&b) {
+  b ^= a;
+  return std::move(b);
+}
+
+inline APInt operator^(APInt a, uint64_t RHS) {
+  a ^= RHS;
+  return a;
+}
+
+inline APInt operator^(uint64_t LHS, APInt b) {
+  b ^= LHS;
+  return b;
+}
+
+inline raw_ostream &operator<<(raw_ostream &OS, const APInt &I) {
+  I.print(OS, true);
+  return OS;
+}
+
+inline APInt operator-(APInt v) {
+  v.negate();
+  return v;
+}
+
+inline APInt operator+(APInt a, const APInt &b) {
+  a += b;
+  return a;
+}
+
+inline APInt operator+(const APInt &a, APInt &&b) {
+  b += a;
+  return std::move(b);
+}
+
+inline APInt operator+(APInt a, uint64_t RHS) {
+  a += RHS;
+  return a;
+}
+
+inline APInt operator+(uint64_t LHS, APInt b) {
+  b += LHS;
+  return b;
+}
+
+inline APInt operator-(APInt a, const APInt &b) {
+  a -= b;
+  return a;
+}
+
+inline APInt operator-(const APInt &a, APInt &&b) {
+  b.negate();
+  b += a;
+  return std::move(b);
+}
+
+inline APInt operator-(APInt a, uint64_t RHS) {
+  a -= RHS;
+  return a;
+}
+
+inline APInt operator-(uint64_t LHS, APInt b) {
+  b.negate();
+  b += LHS;
+  return b;
+}
+
+inline APInt operator*(APInt a, uint64_t RHS) {
+  a *= RHS;
+  return a;
+}
+
+inline APInt operator*(uint64_t LHS, APInt b) {
+  b *= LHS;
+  return b;
+}
+
+
+namespace APIntOps {
+
+
+inline const APInt &smin(const APInt &A, const APInt &B) {
+  return A.slt(B) ? A : B;
+}
+
+
+inline const APInt &smax(const APInt &A, const APInt &B) {
+  return A.sgt(B) ? A : B;
+}
+
+
+inline const APInt &umin(const APInt &A, const APInt &B) {
+  return A.ult(B) ? A : B;
+}
+
+
+inline const APInt &umax(const APInt &A, const APInt &B) {
+  return A.ugt(B) ? A : B;
+}
+
+
+
+
+
+
+
+APInt GreatestCommonDivisor(APInt A, APInt B);
+
+
+
+
+inline double RoundAPIntToDouble(const APInt &APIVal) {
+  return APIVal.roundToDouble();
+}
+
+
+
+
+inline double RoundSignedAPIntToDouble(const APInt &APIVal) {
+  return APIVal.signedRoundToDouble();
+}
+
+
+inline float RoundAPIntToFloat(const APInt &APIVal) {
+  return float(RoundAPIntToDouble(APIVal));
+}
+
+
+
+
+inline float RoundSignedAPIntToFloat(const APInt &APIVal) {
+  return float(APIVal.signedRoundToDouble());
+}
+
+
+
+
+APInt RoundDoubleToAPInt(double Double, unsigned width);
+
+
+
+
+inline APInt RoundFloatToAPInt(float Float, unsigned width) {
+  return RoundDoubleToAPInt(double(Float), width);
+}
+
+}
+
+
+
+hash_code hash_value(const APInt &Arg);
+}
+namespace llvm {
+
+
+
+enum class NoneType { None = 1 };
+const NoneType None = NoneType::None;
+}
+namespace llvm {
+template<std::size_t Alignment, std::size_t Size>
+struct AlignedCharArray {
+  alignas(Alignment) char buffer[Size];
+};
+namespace detail {
+template <typename T1,
+          typename T2 = char, typename T3 = char, typename T4 = char,
+          typename T5 = char, typename T6 = char, typename T7 = char,
+          typename T8 = char, typename T9 = char, typename T10 = char>
+class AlignerImpl {
+  T1 t1; T2 t2; T3 t3; T4 t4; T5 t5; T6 t6; T7 t7; T8 t8; T9 t9; T10 t10;
+
+  AlignerImpl() = delete;
+};
+
+template <typename T1,
+          typename T2 = char, typename T3 = char, typename T4 = char,
+          typename T5 = char, typename T6 = char, typename T7 = char,
+          typename T8 = char, typename T9 = char, typename T10 = char>
+union SizerImpl {
+  char arr1[sizeof(T1)], arr2[sizeof(T2)], arr3[sizeof(T3)], arr4[sizeof(T4)],
+       arr5[sizeof(T5)], arr6[sizeof(T6)], arr7[sizeof(T7)], arr8[sizeof(T8)],
+       arr9[sizeof(T9)], arr10[sizeof(T10)];
+};
+}
+template <typename T1,
+          typename T2 = char, typename T3 = char, typename T4 = char,
+          typename T5 = char, typename T6 = char, typename T7 = char,
+          typename T8 = char, typename T9 = char, typename T10 = char>
+struct AlignedCharArrayUnion : llvm::AlignedCharArray<
+    alignof(llvm::detail::AlignerImpl<T1, T2, T3, T4, T5,
+                                      T6, T7, T8, T9, T10>),
+    sizeof(::llvm::detail::SizerImpl<T1, T2, T3, T4, T5,
+                                     T6, T7, T8, T9, T10>)> {
+};
+}
+
+namespace llvm {
+
+
+
+template <typename T>
+struct isPodLike {
+
+
+
+
+
+
+  static const bool value = std::is_trivially_copyable<T>::value;
+};
+
+
+template<typename T, typename U>
+struct isPodLike<std::pair<T, U>> {
+  static const bool value = isPodLike<T>::value && isPodLike<U>::value;
+};
+template <typename T> class is_integral_or_enum {
+  using UnderlyingT = typename std::remove_reference<T>::type;
+
+public:
+  static const bool value =
+      !std::is_class<UnderlyingT>::value &&
+      !std::is_pointer<UnderlyingT>::value &&
+      !std::is_floating_point<UnderlyingT>::value &&
+      (std::is_enum<UnderlyingT>::value ||
+       std::is_convertible<UnderlyingT, unsigned long long>::value);
+};
+
+
+template<typename T, typename Enable = void>
+struct add_lvalue_reference_if_not_pointer { using type = T &; };
+
+template <typename T>
+struct add_lvalue_reference_if_not_pointer<
+    T, typename std::enable_if<std::is_pointer<T>::value>::type> {
+  using type = T;
+};
+
+
+
+template<typename T, typename Enable = void>
+struct add_const_past_pointer { using type = const T; };
+
+template <typename T>
+struct add_const_past_pointer<
+    T, typename std::enable_if<std::is_pointer<T>::value>::type> {
+  using type = const typename std::remove_pointer<T>::type *;
+};
+
+template <typename T, typename Enable = void>
+struct const_pointer_or_const_ref {
+  using type = const T &;
+};
+template <typename T>
+struct const_pointer_or_const_ref<
+    T, typename std::enable_if<std::is_pointer<T>::value>::type> {
+  using type = typename add_const_past_pointer<T>::type;
+};
+
+}
+
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+namespace llvm {
+
+template <typename T> class Optional {
+  AlignedCharArrayUnion<T> storage;
+  bool hasVal = false;
+
+public:
+  using value_type = T;
+
+  Optional(NoneType) {}
+  explicit Optional() {}
+
+  Optional(const T &y) : hasVal(true) { new (storage.buffer) T(y); }
+
+  Optional(const Optional &O) : hasVal(O.hasVal) {
+    if (hasVal)
+      new (storage.buffer) T(*O);
+  }
+
+  Optional(T &&y) : hasVal(true) { new (storage.buffer) T(std::forward<T>(y)); }
+
+  Optional(Optional<T> &&O) : hasVal(O) {
+    if (O) {
+      new (storage.buffer) T(std::move(*O));
+      O.reset();
+    }
+  }
+
+  ~Optional() { reset(); }
+
+  Optional &operator=(T &&y) {
+    if (hasVal)
+      **this = std::move(y);
+    else {
+      new (storage.buffer) T(std::move(y));
+      hasVal = true;
+    }
+    return *this;
+  }
+
+  Optional &operator=(Optional &&O) {
+    if (!O)
+      reset();
+    else {
+      *this = std::move(*O);
+      O.reset();
+    }
+    return *this;
+  }
+
+
+  template <typename... ArgTypes> void emplace(ArgTypes &&... Args) {
+    reset();
+    hasVal = true;
+    new (storage.buffer) T(std::forward<ArgTypes>(Args)...);
+  }
+
+  static inline Optional create(const T *y) {
+    return y ? Optional(*y) : Optional();
+  }
+
+
+
+
+
+
+  Optional &operator=(const T &y) {
+    if (hasVal)
+      **this = y;
+    else {
+      new (storage.buffer) T(y);
+      hasVal = true;
+    }
+    return *this;
+  }
+
+  Optional &operator=(const Optional &O) {
+    if (!O)
+      reset();
+    else
+      *this = *O;
+    return *this;
+  }
+
+  void reset() {
+    if (hasVal) {
+      (**this).~T();
+      hasVal = false;
+    }
+  }
+
+  const T *getPointer() const {
+    
+   ((
+   hasVal
+   ) ? static_cast<void> (0) : __assert_fail (
+   "hasVal"
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/Optional.h", 120, __PRETTY_FUNCTION__))
+                 ;
+    return reinterpret_cast<const T *>(storage.buffer);
+  }
+  T *getPointer() {
+    
+   ((
+   hasVal
+   ) ? static_cast<void> (0) : __assert_fail (
+   "hasVal"
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/Optional.h", 124, __PRETTY_FUNCTION__))
+                 ;
+    return reinterpret_cast<T *>(storage.buffer);
+  }
+  const T &getValue() const & {
+    
+   ((
+   hasVal
+   ) ? static_cast<void> (0) : __assert_fail (
+   "hasVal"
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/Optional.h", 128, __PRETTY_FUNCTION__))
+                 ;
+    return *getPointer();
+  }
+  T &getValue() & {
+    
+   ((
+   hasVal
+   ) ? static_cast<void> (0) : __assert_fail (
+   "hasVal"
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/Optional.h", 132, __PRETTY_FUNCTION__))
+                 ;
+    return *getPointer();
+  }
+
+  explicit operator bool() const { return hasVal; }
+  bool hasValue() const { return hasVal; }
+  const T *operator->() const { return getPointer(); }
+  T *operator->() { return getPointer(); }
+  const T &operator*() const & {
+    
+   ((
+   hasVal
+   ) ? static_cast<void> (0) : __assert_fail (
+   "hasVal"
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/Optional.h", 141, __PRETTY_FUNCTION__))
+                 ;
+    return *getPointer();
+  }
+  T &operator*() & {
+    
+   ((
+   hasVal
+   ) ? static_cast<void> (0) : __assert_fail (
+   "hasVal"
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/Optional.h", 145, __PRETTY_FUNCTION__))
+                 ;
+    return *getPointer();
+  }
+
+  template <typename U>
+  constexpr T getValueOr(U &&value) const & {
+    return hasValue() ? getValue() : std::forward<U>(value);
+  }
+
+
+  T &&getValue() && {
+    
+   ((
+   hasVal
+   ) ? static_cast<void> (0) : __assert_fail (
+   "hasVal"
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/Optional.h", 156, __PRETTY_FUNCTION__))
+                 ;
+    return std::move(*getPointer());
+  }
+  T &&operator*() && {
+    
+   ((
+   hasVal
+   ) ? static_cast<void> (0) : __assert_fail (
+   "hasVal"
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/Optional.h", 160, __PRETTY_FUNCTION__))
+                 ;
+    return std::move(*getPointer());
+  }
+
+  template <typename U>
+  T getValueOr(U &&value) && {
+    return hasValue() ? std::move(getValue()) : std::forward<U>(value);
+  }
+
+};
+
+template <typename T> struct isPodLike<Optional<T>> {
+
+  static const bool value = isPodLike<T>::value;
+};
+
+template <typename T, typename U>
+bool operator==(const Optional<T> &X, const Optional<U> &Y) {
+  if (X && Y)
+    return *X == *Y;
+  return X.hasValue() == Y.hasValue();
+}
+
+template <typename T, typename U>
+bool operator!=(const Optional<T> &X, const Optional<U> &Y) {
+  return !(X == Y);
+}
+
+template <typename T, typename U>
+bool operator<(const Optional<T> &X, const Optional<U> &Y) {
+  if (X && Y)
+    return *X < *Y;
+  return X.hasValue() < Y.hasValue();
+}
+
+template <typename T, typename U>
+bool operator<=(const Optional<T> &X, const Optional<U> &Y) {
+  return !(Y < X);
+}
+
+template <typename T, typename U>
+bool operator>(const Optional<T> &X, const Optional<U> &Y) {
+  return Y < X;
+}
+
+template <typename T, typename U>
+bool operator>=(const Optional<T> &X, const Optional<U> &Y) {
+  return !(X < Y);
+}
+
+template<typename T>
+bool operator==(const Optional<T> &X, NoneType) {
+  return !X;
+}
+
+template<typename T>
+bool operator==(NoneType, const Optional<T> &X) {
+  return X == None;
+}
+
+template<typename T>
+bool operator!=(const Optional<T> &X, NoneType) {
+  return !(X == None);
+}
+
+template<typename T>
+bool operator!=(NoneType, const Optional<T> &X) {
+  return X != None;
+}
+
+template <typename T> bool operator<(const Optional<T> &X, NoneType) {
+  return false;
+}
+
+template <typename T> bool operator<(NoneType, const Optional<T> &X) {
+  return X.hasValue();
+}
+
+template <typename T> bool operator<=(const Optional<T> &X, NoneType) {
+  return !(None < X);
+}
+
+template <typename T> bool operator<=(NoneType, const Optional<T> &X) {
+  return !(X < None);
+}
+
+template <typename T> bool operator>(const Optional<T> &X, NoneType) {
+  return None < X;
+}
+
+template <typename T> bool operator>(NoneType, const Optional<T> &X) {
+  return X < None;
+}
+
+template <typename T> bool operator>=(const Optional<T> &X, NoneType) {
+  return None <= X;
+}
+
+template <typename T> bool operator>=(NoneType, const Optional<T> &X) {
+  return X <= None;
+}
+
+template <typename T> bool operator==(const Optional<T> &X, const T &Y) {
+  return X && *X == Y;
+}
+
+template <typename T> bool operator==(const T &X, const Optional<T> &Y) {
+  return Y && X == *Y;
+}
+
+template <typename T> bool operator!=(const Optional<T> &X, const T &Y) {
+  return !(X == Y);
+}
+
+template <typename T> bool operator!=(const T &X, const Optional<T> &Y) {
+  return !(X == Y);
+}
+
+template <typename T> bool operator<(const Optional<T> &X, const T &Y) {
+  return !X || *X < Y;
+}
+
+template <typename T> bool operator<(const T &X, const Optional<T> &Y) {
+  return Y && X < *Y;
+}
+
+template <typename T> bool operator<=(const Optional<T> &X, const T &Y) {
+  return !(Y < X);
+}
+
+template <typename T> bool operator<=(const T &X, const Optional<T> &Y) {
+  return !(Y < X);
+}
+
+template <typename T> bool operator>(const Optional<T> &X, const T &Y) {
+  return Y < X;
+}
+
+template <typename T> bool operator>(const T &X, const Optional<T> &Y) {
+  return Y < X;
+}
+
+template <typename T> bool operator>=(const Optional<T> &X, const T &Y) {
+  return !(X < Y);
+}
+
+template <typename T> bool operator>=(const T &X, const Optional<T> &Y) {
+  return !(X < Y);
+}
+
+}
+       
+
+
+
+
+
+       
+
+       
+
+
+
+
+
+       
+
+
+
+       
+
+
+
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+  class locale
+  {
+  public:
+
+
+    typedef int category;
+
+
+    class facet;
+    class id;
+    class _Impl;
+
+    friend class facet;
+    friend class _Impl;
+
+    template<typename _Facet>
+      friend bool
+      has_facet(const locale&) throw();
+
+    template<typename _Facet>
+      friend const _Facet&
+      use_facet(const locale&);
+
+    template<typename _Cache>
+      friend struct __use_cache;
+    static const category none = 0;
+    static const category ctype = 1L << 0;
+    static const category numeric = 1L << 1;
+    static const category collate = 1L << 2;
+    static const category time = 1L << 3;
+    static const category monetary = 1L << 4;
+    static const category messages = 1L << 5;
+    static const category all = (ctype | numeric | collate |
+        time | monetary | messages);
+    locale() throw();
+    locale(const locale& __other) throw();
+    explicit
+    locale(const char* __s);
+    locale(const locale& __base, const char* __s, category __cat);
+    explicit
+    locale(const std::string& __s) : locale(__s.c_str()) { }
+    locale(const locale& __base, const std::string& __s, category __cat)
+    : locale(__base, __s.c_str(), __cat) { }
+    locale(const locale& __base, const locale& __add, category __cat);
+    template<typename _Facet>
+      locale(const locale& __other, _Facet* __f);
+
+
+    ~locale() throw();
+    const locale&
+    operator=(const locale& __other) throw();
+    template<typename _Facet>
+      locale
+      combine(const locale& __other) const;
+
+
+
+
+
+
+    __attribute ((__abi_tag__ ("cxx11")))
+    string
+    name() const;
+    bool
+    operator==(const locale& __other) const throw();
+
+
+
+
+
+
+
+    bool
+    operator!=(const locale& __other) const throw()
+    { return !(this->operator==(__other)); }
+    template<typename _Char, typename _Traits, typename _Alloc>
+      bool
+      operator()(const basic_string<_Char, _Traits, _Alloc>& __s1,
+   const basic_string<_Char, _Traits, _Alloc>& __s2) const;
+    static locale
+    global(const locale& __loc);
+
+
+
+
+    static const locale&
+    classic();
+
+  private:
+
+    _Impl* _M_impl;
+
+
+    static _Impl* _S_classic;
+
+
+    static _Impl* _S_global;
+
+
+
+
+
+    static const char* const* const _S_categories;
+    enum { _S_categories_size = 6 + 6 };
+
+
+    static __gthread_once_t _S_once;
+
+
+    explicit
+    locale(_Impl*) throw();
+
+    static void
+    _S_initialize();
+
+    static void
+    _S_initialize_once() throw();
+
+    static category
+    _S_normalize_category(category);
+
+    void
+    _M_coalesce(const locale& __base, const locale& __add, category __cat);
+
+
+    static const id* const _S_twinned_facets[];
+
+  };
+  class locale::facet
+  {
+  private:
+    friend class locale;
+    friend class locale::_Impl;
+
+    mutable _Atomic_word _M_refcount;
+
+
+    static __c_locale _S_c_locale;
+
+
+    static const char _S_c_name[2];
+
+
+    static __gthread_once_t _S_once;
+
+
+    static void
+    _S_initialize_once();
+
+  protected:
+    explicit
+    facet(size_t __refs = 0) throw() : _M_refcount(__refs ? 1 : 0)
+    { }
+
+
+    virtual
+    ~facet();
+
+    static void
+    _S_create_c_locale(__c_locale& __cloc, const char* __s,
+         __c_locale __old = 0);
+
+    static __c_locale
+    _S_clone_c_locale(__c_locale& __cloc) throw();
+
+    static void
+    _S_destroy_c_locale(__c_locale& __cloc);
+
+    static __c_locale
+    _S_lc_ctype_c_locale(__c_locale __cloc, const char* __s);
+
+
+
+    static __c_locale
+    _S_get_c_locale();
+
+    __attribute__ ((__const__)) static const char*
+    _S_get_c_name() throw();
+    facet(const facet&) = delete;
+
+    facet&
+    operator=(const facet&) = delete;
+
+
+  private:
+    void
+    _M_add_reference() const throw()
+    { __gnu_cxx::__atomic_add_dispatch(&_M_refcount, 1); }
+
+    void
+    _M_remove_reference() const throw()
+    {
+
+      ;
+      if (__gnu_cxx::__exchange_and_add_dispatch(&_M_refcount, -1) == 1)
+ {
+          ;
+   if (true)
+     { delete this; }
+   if (false)
+     { }
+ }
+    }
+
+    const facet* _M_sso_shim(const id*) const;
+    const facet* _M_cow_shim(const id*) const;
+
+  protected:
+    class __shim;
+  };
+  class locale::id
+  {
+  private:
+    friend class locale;
+    friend class locale::_Impl;
+
+    template<typename _Facet>
+      friend const _Facet&
+      use_facet(const locale&);
+
+    template<typename _Facet>
+      friend bool
+      has_facet(const locale&) throw();
+
+
+
+
+    mutable size_t _M_index;
+
+
+    static _Atomic_word _S_refcount;
+
+    void
+    operator=(const id&);
+
+    id(const id&);
+
+  public:
+
+
+
+    id() { }
+
+    size_t
+    _M_id() const throw();
+  };
+
+
+
+  class locale::_Impl
+  {
+  public:
+
+    friend class locale;
+    friend class locale::facet;
+
+    template<typename _Facet>
+      friend bool
+      has_facet(const locale&) throw();
+
+    template<typename _Facet>
+      friend const _Facet&
+      use_facet(const locale&);
+
+    template<typename _Cache>
+      friend struct __use_cache;
+
+  private:
+
+    _Atomic_word _M_refcount;
+    const facet** _M_facets;
+    size_t _M_facets_size;
+    const facet** _M_caches;
+    char** _M_names;
+    static const locale::id* const _S_id_ctype[];
+    static const locale::id* const _S_id_numeric[];
+    static const locale::id* const _S_id_collate[];
+    static const locale::id* const _S_id_time[];
+    static const locale::id* const _S_id_monetary[];
+    static const locale::id* const _S_id_messages[];
+    static const locale::id* const* const _S_facet_categories[];
+
+    void
+    _M_add_reference() throw()
+    { __gnu_cxx::__atomic_add_dispatch(&_M_refcount, 1); }
+
+    void
+    _M_remove_reference() throw()
+    {
+
+      ;
+      if (__gnu_cxx::__exchange_and_add_dispatch(&_M_refcount, -1) == 1)
+ {
+          ;
+   if (true)
+     { delete this; }
+   if (false)
+     { }
+ }
+    }
+
+    _Impl(const _Impl&, size_t);
+    _Impl(const char*, size_t);
+    _Impl(size_t) throw();
+
+   ~_Impl() throw();
+
+    _Impl(const _Impl&);
+
+    void
+    operator=(const _Impl&);
+
+    bool
+    _M_check_same_name()
+    {
+      bool __ret = true;
+      if (_M_names[1])
+
+ for (size_t __i = 0; __ret && __i < _S_categories_size - 1; ++__i)
+   __ret = __builtin_strcmp(_M_names[__i], _M_names[__i + 1]) == 0;
+      return __ret;
+    }
+
+    void
+    _M_replace_categories(const _Impl*, category);
+
+    void
+    _M_replace_category(const _Impl*, const locale::id* const*);
+
+    void
+    _M_replace_facet(const _Impl*, const locale::id*);
+
+    void
+    _M_install_facet(const locale::id*, const facet*);
+
+    template<typename _Facet>
+      void
+      _M_init_facet(_Facet* __facet)
+      { _M_install_facet(&_Facet::id, __facet); }
+
+    template<typename _Facet>
+      void
+      _M_init_facet_unchecked(_Facet* __facet)
+      {
+ __facet->_M_add_reference();
+ _M_facets[_Facet::id._M_id()] = __facet;
+      }
+
+    void
+    _M_install_cache(const facet*, size_t);
+
+    void _M_init_extra(facet**);
+    void _M_init_extra(void*, void*, const char*, const char*);
+  };
+  template<typename _CharT>
+    class __cxx11:: collate : public locale::facet
+    {
+    public:
+
+
+
+      typedef _CharT char_type;
+      typedef basic_string<_CharT> string_type;
+
+
+    protected:
+
+
+      __c_locale _M_c_locale_collate;
+
+    public:
+
+      static locale::id id;
+      explicit
+      collate(size_t __refs = 0)
+      : facet(__refs), _M_c_locale_collate(_S_get_c_locale())
+      { }
+      explicit
+      collate(__c_locale __cloc, size_t __refs = 0)
+      : facet(__refs), _M_c_locale_collate(_S_clone_c_locale(__cloc))
+      { }
+      int
+      compare(const _CharT* __lo1, const _CharT* __hi1,
+       const _CharT* __lo2, const _CharT* __hi2) const
+      { return this->do_compare(__lo1, __hi1, __lo2, __hi2); }
+      string_type
+      transform(const _CharT* __lo, const _CharT* __hi) const
+      { return this->do_transform(__lo, __hi); }
+      long
+      hash(const _CharT* __lo, const _CharT* __hi) const
+      { return this->do_hash(__lo, __hi); }
+
+
+      int
+      _M_compare(const _CharT*, const _CharT*) const throw();
+
+      size_t
+      _M_transform(_CharT*, const _CharT*, size_t) const throw();
+
+  protected:
+
+      virtual
+      ~collate()
+      { _S_destroy_c_locale(_M_c_locale_collate); }
+      virtual int
+      do_compare(const _CharT* __lo1, const _CharT* __hi1,
+   const _CharT* __lo2, const _CharT* __hi2) const;
+      virtual string_type
+      do_transform(const _CharT* __lo, const _CharT* __hi) const;
+      virtual long
+      do_hash(const _CharT* __lo, const _CharT* __hi) const;
+    };
+
+  template<typename _CharT>
+    locale::id collate<_CharT>::id;
+
+
+  template<>
+    int
+    collate<char>::_M_compare(const char*, const char*) const throw();
+
+  template<>
+    size_t
+    collate<char>::_M_transform(char*, const char*, size_t) const throw();
+
+
+  template<>
+    int
+    collate<wchar_t>::_M_compare(const wchar_t*, const wchar_t*) const throw();
+
+  template<>
+    size_t
+    collate<wchar_t>::_M_transform(wchar_t*, const wchar_t*, size_t) const throw();
+
+
+
+  template<typename _CharT>
+    class __cxx11:: collate_byname : public collate<_CharT>
+    {
+    public:
+
+
+      typedef _CharT char_type;
+      typedef basic_string<_CharT> string_type;
+
+
+      explicit
+      collate_byname(const char* __s, size_t __refs = 0)
+      : collate<_CharT>(__refs)
+      {
+ if (__builtin_strcmp(__s, "C") != 0
+     && __builtin_strcmp(__s, "POSIX") != 0)
+   {
+     this->_S_destroy_c_locale(this->_M_c_locale_collate);
+     this->_S_create_c_locale(this->_M_c_locale_collate, __s);
+   }
+      }
+
+
+      explicit
+      collate_byname(const string& __s, size_t __refs = 0)
+      : collate_byname(__s.c_str(), __refs) { }
+
+
+    protected:
+      virtual
+      ~collate_byname() { }
+    };
+
+
+}
+
+       
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+  template<typename _Facet>
+    locale::
+    locale(const locale& __other, _Facet* __f)
+    {
+      _M_impl = new _Impl(*__other._M_impl, 1);
+
+      if (true)
+ { _M_impl->_M_install_facet(&_Facet::id, __f); }
+      if (false)
+ {
+   _M_impl->_M_remove_reference();
+   ;
+ }
+      delete [] _M_impl->_M_names[0];
+      _M_impl->_M_names[0] = 0;
+    }
+
+  template<typename _Facet>
+    locale
+    locale::
+    combine(const locale& __other) const
+    {
+      _Impl* __tmp = new _Impl(*_M_impl, 1);
+      if (true)
+ {
+   __tmp->_M_replace_facet(__other._M_impl, &_Facet::id);
+ }
+      if (false)
+ {
+   __tmp->_M_remove_reference();
+   ;
+ }
+      return locale(__tmp);
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    bool
+    locale::
+    operator()(const basic_string<_CharT, _Traits, _Alloc>& __s1,
+        const basic_string<_CharT, _Traits, _Alloc>& __s2) const
+    {
+      typedef std::collate<_CharT> __collate_type;
+      const __collate_type& __collate = use_facet<__collate_type>(*this);
+      return (__collate.compare(__s1.data(), __s1.data() + __s1.length(),
+    __s2.data(), __s2.data() + __s2.length()) < 0);
+    }
+  template<typename _Facet>
+    bool
+    has_facet(const locale& __loc) throw()
+    {
+      const size_t __i = _Facet::id._M_id();
+      const locale::facet** __facets = __loc._M_impl->_M_facets;
+      return (__i < __loc._M_impl->_M_facets_size
+
+
+
+              && static_cast<const _Facet*>(__facets[__i]));
+
+    }
+  template<typename _Facet>
+    const _Facet&
+    use_facet(const locale& __loc)
+    {
+      const size_t __i = _Facet::id._M_id();
+      const locale::facet** __facets = __loc._M_impl->_M_facets;
+      if (__i >= __loc._M_impl->_M_facets_size || !__facets[__i])
+        __throw_bad_cast();
+
+
+
+      return static_cast<const _Facet&>(*__facets[__i]);
+
+    }
+
+
+
+  template<typename _CharT>
+    int
+    collate<_CharT>::_M_compare(const _CharT*, const _CharT*) const throw ()
+    { return 0; }
+
+
+  template<typename _CharT>
+    size_t
+    collate<_CharT>::_M_transform(_CharT*, const _CharT*, size_t) const throw ()
+    { return 0; }
+
+  template<typename _CharT>
+    int
+    collate<_CharT>::
+    do_compare(const _CharT* __lo1, const _CharT* __hi1,
+        const _CharT* __lo2, const _CharT* __hi2) const
+    {
+
+
+      const string_type __one(__lo1, __hi1);
+      const string_type __two(__lo2, __hi2);
+
+      const _CharT* __p = __one.c_str();
+      const _CharT* __pend = __one.data() + __one.length();
+      const _CharT* __q = __two.c_str();
+      const _CharT* __qend = __two.data() + __two.length();
+
+
+
+
+      for (;;)
+ {
+   const int __res = _M_compare(__p, __q);
+   if (__res)
+     return __res;
+
+   __p += char_traits<_CharT>::length(__p);
+   __q += char_traits<_CharT>::length(__q);
+   if (__p == __pend && __q == __qend)
+     return 0;
+   else if (__p == __pend)
+     return -1;
+   else if (__q == __qend)
+     return 1;
+
+   __p++;
+   __q++;
+ }
+    }
+
+  template<typename _CharT>
+    typename collate<_CharT>::string_type
+    collate<_CharT>::
+    do_transform(const _CharT* __lo, const _CharT* __hi) const
+    {
+      string_type __ret;
+
+
+      const string_type __str(__lo, __hi);
+
+      const _CharT* __p = __str.c_str();
+      const _CharT* __pend = __str.data() + __str.length();
+
+      size_t __len = (__hi - __lo) * 2;
+
+      _CharT* __c = new _CharT[__len];
+
+      if (true)
+ {
+
+
+
+   for (;;)
+     {
+
+       size_t __res = _M_transform(__c, __p, __len);
+
+
+       if (__res >= __len)
+  {
+    __len = __res + 1;
+    delete [] __c, __c = 0;
+    __c = new _CharT[__len];
+    __res = _M_transform(__c, __p, __len);
+  }
+
+       __ret.append(__c, __res);
+       __p += char_traits<_CharT>::length(__p);
+       if (__p == __pend)
+  break;
+
+       __p++;
+       __ret.push_back(_CharT());
+     }
+ }
+      if (false)
+ {
+   delete [] __c;
+   ;
+ }
+
+      delete [] __c;
+
+      return __ret;
+    }
+
+  template<typename _CharT>
+    long
+    collate<_CharT>::
+    do_hash(const _CharT* __lo, const _CharT* __hi) const
+    {
+      unsigned long __val = 0;
+      for (; __lo < __hi; ++__lo)
+ __val =
+   *__lo + ((__val << 7)
+     | (__val >> (__gnu_cxx::__numeric_traits<unsigned long>::
+    __digits - 7)));
+      return static_cast<long>(__val);
+    }
+
+
+
+
+  extern template class collate<char>;
+  extern template class collate_byname<char>;
+
+  extern template
+    const collate<char>&
+    use_facet<collate<char> >(const locale&);
+
+  extern template
+    bool
+    has_facet<collate<char> >(const locale&);
+
+
+  extern template class collate<wchar_t>;
+  extern template class collate_byname<wchar_t>;
+
+  extern template
+    const collate<wchar_t>&
+    use_facet<collate<wchar_t> >(const locale&);
+
+  extern template
+    bool
+    has_facet<collate<wchar_t> >(const locale&);
+
+
+
+
+}
+
+
+
+
+       
+
+
+
+
+
+
+       
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+  enum class errc
+    {
+      address_family_not_supported = 97,
+      address_in_use = 98,
+      address_not_available = 99,
+      already_connected = 106,
+      argument_list_too_long = 7,
+      argument_out_of_domain = 33,
+      bad_address = 14,
+      bad_file_descriptor = 9,
+
+
+      bad_message = 74,
+
+
+      broken_pipe = 32,
+      connection_aborted = 103,
+      connection_already_in_progress = 114,
+      connection_refused = 111,
+      connection_reset = 104,
+      cross_device_link = 18,
+      destination_address_required = 89,
+      device_or_resource_busy = 16,
+      directory_not_empty = 39,
+      executable_format_error = 8,
+      file_exists = 17,
+      file_too_large = 27,
+      filename_too_long = 36,
+      function_not_supported = 38,
+      host_unreachable = 113,
+
+
+      identifier_removed = 43,
+
+
+      illegal_byte_sequence = 84,
+      inappropriate_io_control_operation = 25,
+      interrupted = 4,
+      invalid_argument = 22,
+      invalid_seek = 29,
+      io_error = 5,
+      is_a_directory = 21,
+      message_size = 90,
+      network_down = 100,
+      network_reset = 102,
+      network_unreachable = 101,
+      no_buffer_space = 105,
+      no_child_process = 10,
+
+
+      no_link = 67,
+
+
+      no_lock_available = 37,
+
+
+      no_message_available = 61,
+
+
+      no_message = 42,
+      no_protocol_option = 92,
+      no_space_on_device = 28,
+
+
+      no_stream_resources = 63,
+
+
+      no_such_device_or_address = 6,
+      no_such_device = 19,
+      no_such_file_or_directory = 2,
+      no_such_process = 3,
+      not_a_directory = 20,
+      not_a_socket = 88,
+
+
+      not_a_stream = 60,
+
+
+      not_connected = 107,
+      not_enough_memory = 12,
+
+
+      not_supported = 95,
+
+
+
+      operation_canceled = 125,
+
+
+      operation_in_progress = 115,
+      operation_not_permitted = 1,
+      operation_not_supported = 95,
+      operation_would_block = 11,
+
+
+      owner_dead = 130,
+
+
+      permission_denied = 13,
+
+
+      protocol_error = 71,
+
+
+      protocol_not_supported = 93,
+      read_only_file_system = 30,
+      resource_deadlock_would_occur = 35,
+      resource_unavailable_try_again = 11,
+      result_out_of_range = 34,
+
+
+      state_not_recoverable = 131,
+
+
+
+      stream_timeout = 62,
+
+
+
+      text_file_busy = 26,
+
+
+      timed_out = 110,
+      too_many_files_open_in_system = 23,
+      too_many_files_open = 24,
+      too_many_links = 31,
+      too_many_symbolic_link_levels = 40,
+
+
+      value_too_large = 75,
+
+
+      wrong_protocol_type = 91
+    };
+
+
+}
+
+       
+
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+
+
+  struct __cow_string
+  {
+    union {
+      const char* _M_p;
+      char _M_bytes[sizeof(const char*)];
+    };
+
+    __cow_string();
+    __cow_string(const std::string&);
+    __cow_string(const char*, size_t);
+    __cow_string(const __cow_string&) noexcept;
+    __cow_string& operator=(const __cow_string&) noexcept;
+    ~__cow_string();
+
+    __cow_string(__cow_string&&) noexcept;
+    __cow_string& operator=(__cow_string&&) noexcept;
+
+  };
+
+  typedef basic_string<char> __sso_string;
+  class logic_error : public exception
+  {
+    __cow_string _M_msg;
+
+  public:
+
+    explicit
+    logic_error(const string& __arg) ;
+
+
+    explicit
+    logic_error(const char*) ;
+
+
+
+    logic_error(const logic_error&) noexcept;
+    logic_error& operator=(const logic_error&) noexcept;
+
+
+    virtual ~logic_error() noexcept;
+
+
+
+    virtual const char*
+    what() const noexcept;
+
+
+
+
+
+  };
+
+
+
+  class domain_error : public logic_error
+  {
+  public:
+    explicit domain_error(const string& __arg) ;
+
+    explicit domain_error(const char*) ;
+
+    virtual ~domain_error() noexcept;
+  };
+
+
+  class invalid_argument : public logic_error
+  {
+  public:
+    explicit invalid_argument(const string& __arg) ;
+
+    explicit invalid_argument(const char*) ;
+
+    virtual ~invalid_argument() noexcept;
+  };
+
+
+
+  class length_error : public logic_error
+  {
+  public:
+    explicit length_error(const string& __arg) ;
+
+    explicit length_error(const char*) ;
+
+    virtual ~length_error() noexcept;
+  };
+
+
+
+  class out_of_range : public logic_error
+  {
+  public:
+    explicit out_of_range(const string& __arg) ;
+
+    explicit out_of_range(const char*) ;
+
+    virtual ~out_of_range() noexcept;
+  };
+
+
+
+
+
+
+  class runtime_error : public exception
+  {
+    __cow_string _M_msg;
+
+  public:
+
+    explicit
+    runtime_error(const string& __arg) ;
+
+
+    explicit
+    runtime_error(const char*) ;
+
+
+
+    runtime_error(const runtime_error&) noexcept;
+    runtime_error& operator=(const runtime_error&) noexcept;
+
+
+    virtual ~runtime_error() noexcept;
+
+
+
+    virtual const char*
+    what() const noexcept;
+
+
+
+
+
+  };
+
+
+  class range_error : public runtime_error
+  {
+  public:
+    explicit range_error(const string& __arg) ;
+
+    explicit range_error(const char*) ;
+
+    virtual ~range_error() noexcept;
+  };
+
+
+  class overflow_error : public runtime_error
+  {
+  public:
+    explicit overflow_error(const string& __arg) ;
+
+    explicit overflow_error(const char*) ;
+
+    virtual ~overflow_error() noexcept;
+  };
+
+
+  class underflow_error : public runtime_error
+  {
+  public:
+    explicit underflow_error(const string& __arg) ;
+
+    explicit underflow_error(const char*) ;
+
+    virtual ~underflow_error() noexcept;
+  };
+
+
+
+
+}
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+  class error_code;
+  class error_condition;
+  class system_error;
+
+
+  template<typename _Tp>
+    struct is_error_code_enum : public false_type { };
+
+
+  template<typename _Tp>
+    struct is_error_condition_enum : public false_type { };
+
+  template<>
+    struct is_error_condition_enum<errc>
+    : public true_type { };
+  inline namespace _V2 {
+
+
+  class error_category
+  {
+  public:
+    constexpr error_category() noexcept = default;
+
+    virtual ~error_category();
+
+    error_category(const error_category&) = delete;
+    error_category& operator=(const error_category&) = delete;
+
+    virtual const char*
+    name() const noexcept = 0;
+
+
+
+
+
+
+  private:
+    __attribute ((__abi_tag__ ("cxx11")))
+    virtual __cow_string
+    _M_message(int) const;
+
+  public:
+    __attribute ((__abi_tag__ ("cxx11")))
+    virtual string
+    message(int) const = 0;
+  public:
+    virtual error_condition
+    default_error_condition(int __i) const noexcept;
+
+    virtual bool
+    equivalent(int __i, const error_condition& __cond) const noexcept;
+
+    virtual bool
+    equivalent(const error_code& __code, int __i) const noexcept;
+
+    bool
+    operator<(const error_category& __other) const noexcept
+    { return less<const error_category*>()(this, &__other); }
+
+    bool
+    operator==(const error_category& __other) const noexcept
+    { return this == &__other; }
+
+    bool
+    operator!=(const error_category& __other) const noexcept
+    { return this != &__other; }
+  };
+
+
+  __attribute__ ((__const__)) const error_category& system_category() noexcept;
+  __attribute__ ((__const__)) const error_category& generic_category() noexcept;
+
+  }
+
+  error_code make_error_code(errc) noexcept;
+
+  template<typename _Tp>
+    struct hash;
+
+
+
+  struct error_code
+  {
+    error_code() noexcept
+    : _M_value(0), _M_cat(&system_category()) { }
+
+    error_code(int __v, const error_category& __cat) noexcept
+    : _M_value(__v), _M_cat(&__cat) { }
+
+    template<typename _ErrorCodeEnum, typename = typename
+      enable_if<is_error_code_enum<_ErrorCodeEnum>::value>::type>
+      error_code(_ErrorCodeEnum __e) noexcept
+      { *this = make_error_code(__e); }
+
+    void
+    assign(int __v, const error_category& __cat) noexcept
+    {
+      _M_value = __v;
+      _M_cat = &__cat;
+    }
+
+    void
+    clear() noexcept
+    { assign(0, system_category()); }
+
+
+    template<typename _ErrorCodeEnum>
+      typename enable_if<is_error_code_enum<_ErrorCodeEnum>::value,
+    error_code&>::type
+      operator=(_ErrorCodeEnum __e) noexcept
+      { return *this = make_error_code(__e); }
+
+    int
+    value() const noexcept { return _M_value; }
+
+    const error_category&
+    category() const noexcept { return *_M_cat; }
+
+    error_condition
+    default_error_condition() const noexcept;
+
+    __attribute ((__abi_tag__ ("cxx11")))
+    string
+    message() const
+    { return category().message(value()); }
+
+    explicit operator bool() const noexcept
+    { return _M_value != 0; }
+
+
+  private:
+    friend class hash<error_code>;
+
+    int _M_value;
+    const error_category* _M_cat;
+  };
+
+
+  inline error_code
+  make_error_code(errc __e) noexcept
+  { return error_code(static_cast<int>(__e), generic_category()); }
+
+  inline bool
+  operator<(const error_code& __lhs, const error_code& __rhs) noexcept
+  {
+    return (__lhs.category() < __rhs.category()
+     || (__lhs.category() == __rhs.category()
+  && __lhs.value() < __rhs.value()));
+  }
+
+  template<typename _CharT, typename _Traits>
+    basic_ostream<_CharT, _Traits>&
+    operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e)
+    { return (__os << __e.category().name() << ':' << __e.value()); }
+
+  error_condition make_error_condition(errc) noexcept;
+
+
+
+  struct error_condition
+  {
+    error_condition() noexcept
+    : _M_value(0), _M_cat(&generic_category()) { }
+
+    error_condition(int __v, const error_category& __cat) noexcept
+    : _M_value(__v), _M_cat(&__cat) { }
+
+    template<typename _ErrorConditionEnum, typename = typename
+  enable_if<is_error_condition_enum<_ErrorConditionEnum>::value>::type>
+      error_condition(_ErrorConditionEnum __e) noexcept
+      { *this = make_error_condition(__e); }
+
+    void
+    assign(int __v, const error_category& __cat) noexcept
+    {
+      _M_value = __v;
+      _M_cat = &__cat;
+    }
+
+
+    template<typename _ErrorConditionEnum>
+      typename enable_if<is_error_condition_enum
+    <_ErrorConditionEnum>::value, error_condition&>::type
+      operator=(_ErrorConditionEnum __e) noexcept
+      { return *this = make_error_condition(__e); }
+
+    void
+    clear() noexcept
+    { assign(0, generic_category()); }
+
+
+    int
+    value() const noexcept { return _M_value; }
+
+    const error_category&
+    category() const noexcept { return *_M_cat; }
+
+    __attribute ((__abi_tag__ ("cxx11")))
+    string
+    message() const
+    { return category().message(value()); }
+
+    explicit operator bool() const noexcept
+    { return _M_value != 0; }
+
+
+  private:
+    int _M_value;
+    const error_category* _M_cat;
+  };
+
+
+  inline error_condition
+  make_error_condition(errc __e) noexcept
+  { return error_condition(static_cast<int>(__e), generic_category()); }
+
+  inline bool
+  operator<(const error_condition& __lhs,
+     const error_condition& __rhs) noexcept
+  {
+    return (__lhs.category() < __rhs.category()
+     || (__lhs.category() == __rhs.category()
+  && __lhs.value() < __rhs.value()));
+  }
+
+
+  inline bool
+  operator==(const error_code& __lhs, const error_code& __rhs) noexcept
+  { return (__lhs.category() == __rhs.category()
+     && __lhs.value() == __rhs.value()); }
+
+  inline bool
+  operator==(const error_code& __lhs, const error_condition& __rhs) noexcept
+  {
+    return (__lhs.category().equivalent(__lhs.value(), __rhs)
+     || __rhs.category().equivalent(__lhs, __rhs.value()));
+  }
+
+  inline bool
+  operator==(const error_condition& __lhs, const error_code& __rhs) noexcept
+  {
+    return (__rhs.category().equivalent(__rhs.value(), __lhs)
+     || __lhs.category().equivalent(__rhs, __lhs.value()));
+  }
+
+  inline bool
+  operator==(const error_condition& __lhs,
+      const error_condition& __rhs) noexcept
+  {
+    return (__lhs.category() == __rhs.category()
+     && __lhs.value() == __rhs.value());
+  }
+
+  inline bool
+  operator!=(const error_code& __lhs, const error_code& __rhs) noexcept
+  { return !(__lhs == __rhs); }
+
+  inline bool
+  operator!=(const error_code& __lhs, const error_condition& __rhs) noexcept
+  { return !(__lhs == __rhs); }
+
+  inline bool
+  operator!=(const error_condition& __lhs, const error_code& __rhs) noexcept
+  { return !(__lhs == __rhs); }
+
+  inline bool
+  operator!=(const error_condition& __lhs,
+      const error_condition& __rhs) noexcept
+  { return !(__lhs == __rhs); }
+
+
+
+
+
+
+
+  class system_error : public std::runtime_error
+  {
+  private:
+    error_code _M_code;
+
+  public:
+    system_error(error_code __ec = error_code())
+    : runtime_error(__ec.message()), _M_code(__ec) { }
+
+    system_error(error_code __ec, const string& __what)
+    : runtime_error(__what + ": " + __ec.message()), _M_code(__ec) { }
+
+    system_error(error_code __ec, const char* __what)
+    : runtime_error(__what + (": " + __ec.message())), _M_code(__ec) { }
+
+    system_error(int __v, const error_category& __ecat, const char* __what)
+    : system_error(error_code(__v, __ecat), __what) { }
+
+    system_error(int __v, const error_category& __ecat)
+    : runtime_error(error_code(__v, __ecat).message()),
+      _M_code(__v, __ecat) { }
+
+    system_error(int __v, const error_category& __ecat, const string& __what)
+    : runtime_error(__what + ": " + error_code(__v, __ecat).message()),
+      _M_code(__v, __ecat) { }
+
+    virtual ~system_error() noexcept;
+
+    const error_code&
+    code() const noexcept { return _M_code; }
+  };
+
+
+}
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+
+
+  template<>
+    struct hash<error_code>
+    : public __hash_base<size_t, error_code>
+    {
+      size_t
+      operator()(const error_code& __e) const noexcept
+      {
+ const size_t __tmp = std::_Hash_impl::hash(__e._M_value);
+ return std::_Hash_impl::__hash_combine(__e._M_cat, __tmp);
+      }
+    };
+
+}
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+
+
+
+  enum _Ios_Fmtflags
+    {
+      _S_boolalpha = 1L << 0,
+      _S_dec = 1L << 1,
+      _S_fixed = 1L << 2,
+      _S_hex = 1L << 3,
+      _S_internal = 1L << 4,
+      _S_left = 1L << 5,
+      _S_oct = 1L << 6,
+      _S_right = 1L << 7,
+      _S_scientific = 1L << 8,
+      _S_showbase = 1L << 9,
+      _S_showpoint = 1L << 10,
+      _S_showpos = 1L << 11,
+      _S_skipws = 1L << 12,
+      _S_unitbuf = 1L << 13,
+      _S_uppercase = 1L << 14,
+      _S_adjustfield = _S_left | _S_right | _S_internal,
+      _S_basefield = _S_dec | _S_oct | _S_hex,
+      _S_floatfield = _S_scientific | _S_fixed,
+      _S_ios_fmtflags_end = 1L << 16,
+      _S_ios_fmtflags_max = 0x7fffffff,
+      _S_ios_fmtflags_min = ~0x7fffffff
+    };
+
+  inline constexpr _Ios_Fmtflags
+  operator&(_Ios_Fmtflags __a, _Ios_Fmtflags __b)
+  { return _Ios_Fmtflags(static_cast<int>(__a) & static_cast<int>(__b)); }
+
+  inline constexpr _Ios_Fmtflags
+  operator|(_Ios_Fmtflags __a, _Ios_Fmtflags __b)
+  { return _Ios_Fmtflags(static_cast<int>(__a) | static_cast<int>(__b)); }
+
+  inline constexpr _Ios_Fmtflags
+  operator^(_Ios_Fmtflags __a, _Ios_Fmtflags __b)
+  { return _Ios_Fmtflags(static_cast<int>(__a) ^ static_cast<int>(__b)); }
+
+  inline constexpr _Ios_Fmtflags
+  operator~(_Ios_Fmtflags __a)
+  { return _Ios_Fmtflags(~static_cast<int>(__a)); }
+
+  inline const _Ios_Fmtflags&
+  operator|=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b)
+  { return __a = __a | __b; }
+
+  inline const _Ios_Fmtflags&
+  operator&=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b)
+  { return __a = __a & __b; }
+
+  inline const _Ios_Fmtflags&
+  operator^=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b)
+  { return __a = __a ^ __b; }
+
+
+  enum _Ios_Openmode
+    {
+      _S_app = 1L << 0,
+      _S_ate = 1L << 1,
+      _S_bin = 1L << 2,
+      _S_in = 1L << 3,
+      _S_out = 1L << 4,
+      _S_trunc = 1L << 5,
+      _S_ios_openmode_end = 1L << 16,
+      _S_ios_openmode_max = 0x7fffffff,
+      _S_ios_openmode_min = ~0x7fffffff
+    };
+
+  inline constexpr _Ios_Openmode
+  operator&(_Ios_Openmode __a, _Ios_Openmode __b)
+  { return _Ios_Openmode(static_cast<int>(__a) & static_cast<int>(__b)); }
+
+  inline constexpr _Ios_Openmode
+  operator|(_Ios_Openmode __a, _Ios_Openmode __b)
+  { return _Ios_Openmode(static_cast<int>(__a) | static_cast<int>(__b)); }
+
+  inline constexpr _Ios_Openmode
+  operator^(_Ios_Openmode __a, _Ios_Openmode __b)
+  { return _Ios_Openmode(static_cast<int>(__a) ^ static_cast<int>(__b)); }
+
+  inline constexpr _Ios_Openmode
+  operator~(_Ios_Openmode __a)
+  { return _Ios_Openmode(~static_cast<int>(__a)); }
+
+  inline const _Ios_Openmode&
+  operator|=(_Ios_Openmode& __a, _Ios_Openmode __b)
+  { return __a = __a | __b; }
+
+  inline const _Ios_Openmode&
+  operator&=(_Ios_Openmode& __a, _Ios_Openmode __b)
+  { return __a = __a & __b; }
+
+  inline const _Ios_Openmode&
+  operator^=(_Ios_Openmode& __a, _Ios_Openmode __b)
+  { return __a = __a ^ __b; }
+
+
+  enum _Ios_Iostate
+    {
+      _S_goodbit = 0,
+      _S_badbit = 1L << 0,
+      _S_eofbit = 1L << 1,
+      _S_failbit = 1L << 2,
+      _S_ios_iostate_end = 1L << 16,
+      _S_ios_iostate_max = 0x7fffffff,
+      _S_ios_iostate_min = ~0x7fffffff
+    };
+
+  inline constexpr _Ios_Iostate
+  operator&(_Ios_Iostate __a, _Ios_Iostate __b)
+  { return _Ios_Iostate(static_cast<int>(__a) & static_cast<int>(__b)); }
+
+  inline constexpr _Ios_Iostate
+  operator|(_Ios_Iostate __a, _Ios_Iostate __b)
+  { return _Ios_Iostate(static_cast<int>(__a) | static_cast<int>(__b)); }
+
+  inline constexpr _Ios_Iostate
+  operator^(_Ios_Iostate __a, _Ios_Iostate __b)
+  { return _Ios_Iostate(static_cast<int>(__a) ^ static_cast<int>(__b)); }
+
+  inline constexpr _Ios_Iostate
+  operator~(_Ios_Iostate __a)
+  { return _Ios_Iostate(~static_cast<int>(__a)); }
+
+  inline const _Ios_Iostate&
+  operator|=(_Ios_Iostate& __a, _Ios_Iostate __b)
+  { return __a = __a | __b; }
+
+  inline const _Ios_Iostate&
+  operator&=(_Ios_Iostate& __a, _Ios_Iostate __b)
+  { return __a = __a & __b; }
+
+  inline const _Ios_Iostate&
+  operator^=(_Ios_Iostate& __a, _Ios_Iostate __b)
+  { return __a = __a ^ __b; }
+
+
+  enum _Ios_Seekdir
+    {
+      _S_beg = 0,
+      _S_cur = 1,
+      _S_end = 2,
+      _S_ios_seekdir_end = 1L << 16
+    };
+
+
+
+  enum class io_errc { stream = 1 };
+
+  template <> struct is_error_code_enum<io_errc> : public true_type { };
+
+  const error_category& iostream_category() noexcept;
+
+  inline error_code
+  make_error_code(io_errc __e) noexcept
+  { return error_code(static_cast<int>(__e), iostream_category()); }
+
+  inline error_condition
+  make_error_condition(io_errc __e) noexcept
+  { return error_condition(static_cast<int>(__e), iostream_category()); }
+  class ios_base
+  {
+  public:
+    class __attribute ((__abi_tag__ ("cxx11"))) failure : public system_error
+    {
+    public:
+      explicit
+      failure(const string& __str);
+
+
+      explicit
+      failure(const string&, const error_code&);
+
+      explicit
+      failure(const char*, const error_code& = io_errc::stream);
+
+
+      virtual
+      ~failure() throw();
+
+      virtual const char*
+      what() const throw();
+    };
+    typedef _Ios_Fmtflags fmtflags;
+
+
+    static const fmtflags boolalpha = _S_boolalpha;
+
+
+    static const fmtflags dec = _S_dec;
+
+
+    static const fmtflags fixed = _S_fixed;
+
+
+    static const fmtflags hex = _S_hex;
+
+
+
+
+    static const fmtflags internal = _S_internal;
+
+
+
+    static const fmtflags left = _S_left;
+
+
+    static const fmtflags oct = _S_oct;
+
+
+
+    static const fmtflags right = _S_right;
+
+
+    static const fmtflags scientific = _S_scientific;
+
+
+
+    static const fmtflags showbase = _S_showbase;
+
+
+
+    static const fmtflags showpoint = _S_showpoint;
+
+
+    static const fmtflags showpos = _S_showpos;
+
+
+    static const fmtflags skipws = _S_skipws;
+
+
+    static const fmtflags unitbuf = _S_unitbuf;
+
+
+
+    static const fmtflags uppercase = _S_uppercase;
+
+
+    static const fmtflags adjustfield = _S_adjustfield;
+
+
+    static const fmtflags basefield = _S_basefield;
+
+
+    static const fmtflags floatfield = _S_floatfield;
+    typedef _Ios_Iostate iostate;
+
+
+
+    static const iostate badbit = _S_badbit;
+
+
+    static const iostate eofbit = _S_eofbit;
+
+
+
+
+    static const iostate failbit = _S_failbit;
+
+
+    static const iostate goodbit = _S_goodbit;
+    typedef _Ios_Openmode openmode;
+
+
+    static const openmode app = _S_app;
+
+
+    static const openmode ate = _S_ate;
+
+
+
+
+    static const openmode binary = _S_bin;
+
+
+    static const openmode in = _S_in;
+
+
+    static const openmode out = _S_out;
+
+
+    static const openmode trunc = _S_trunc;
+    typedef _Ios_Seekdir seekdir;
+
+
+    static const seekdir beg = _S_beg;
+
+
+    static const seekdir cur = _S_cur;
+
+
+    static const seekdir end = _S_end;
+
+
+
+    typedef int io_state;
+    typedef int open_mode;
+    typedef int seek_dir;
+
+    typedef std::streampos streampos;
+    typedef std::streamoff streamoff;
+    enum event
+    {
+      erase_event,
+      imbue_event,
+      copyfmt_event
+    };
+    typedef void (*event_callback) (event __e, ios_base& __b, int __i);
+    void
+    register_callback(event_callback __fn, int __index);
+
+  protected:
+    streamsize _M_precision;
+    streamsize _M_width;
+    fmtflags _M_flags;
+    iostate _M_exception;
+    iostate _M_streambuf_state;
+
+
+
+    struct _Callback_list
+    {
+
+      _Callback_list* _M_next;
+      ios_base::event_callback _M_fn;
+      int _M_index;
+      _Atomic_word _M_refcount;
+
+      _Callback_list(ios_base::event_callback __fn, int __index,
+       _Callback_list* __cb)
+      : _M_next(__cb), _M_fn(__fn), _M_index(__index), _M_refcount(0) { }
+
+      void
+      _M_add_reference() { __gnu_cxx::__atomic_add_dispatch(&_M_refcount, 1); }
+
+
+      int
+      _M_remove_reference()
+      {
+
+        ;
+        int __res = __gnu_cxx::__exchange_and_add_dispatch(&_M_refcount, -1);
+        if (__res == 0)
+          {
+            ;
+          }
+        return __res;
+      }
+    };
+
+     _Callback_list* _M_callbacks;
+
+    void
+    _M_call_callbacks(event __ev) throw();
+
+    void
+    _M_dispose_callbacks(void) throw();
+
+
+    struct _Words
+    {
+      void* _M_pword;
+      long _M_iword;
+      _Words() : _M_pword(0), _M_iword(0) { }
+    };
+
+
+    _Words _M_word_zero;
+
+
+
+    enum { _S_local_word_size = 8 };
+    _Words _M_local_word[_S_local_word_size];
+
+
+    int _M_word_size;
+    _Words* _M_word;
+
+    _Words&
+    _M_grow_words(int __index, bool __iword);
+
+
+    locale _M_ios_locale;
+
+    void
+    _M_init() throw();
+
+  public:
+
+
+
+
+
+    class Init
+    {
+      friend class ios_base;
+    public:
+      Init();
+      ~Init();
+
+    private:
+      static _Atomic_word _S_refcount;
+      static bool _S_synced_with_stdio;
+    };
+
+
+
+
+
+
+    fmtflags
+    flags() const
+    { return _M_flags; }
+    fmtflags
+    flags(fmtflags __fmtfl)
+    {
+      fmtflags __old = _M_flags;
+      _M_flags = __fmtfl;
+      return __old;
+    }
+    fmtflags
+    setf(fmtflags __fmtfl)
+    {
+      fmtflags __old = _M_flags;
+      _M_flags |= __fmtfl;
+      return __old;
+    }
+    fmtflags
+    setf(fmtflags __fmtfl, fmtflags __mask)
+    {
+      fmtflags __old = _M_flags;
+      _M_flags &= ~__mask;
+      _M_flags |= (__fmtfl & __mask);
+      return __old;
+    }
+
+
+
+
+
+
+
+    void
+    unsetf(fmtflags __mask)
+    { _M_flags &= ~__mask; }
+    streamsize
+    precision() const
+    { return _M_precision; }
+
+
+
+
+
+
+    streamsize
+    precision(streamsize __prec)
+    {
+      streamsize __old = _M_precision;
+      _M_precision = __prec;
+      return __old;
+    }
+
+
+
+
+
+
+
+    streamsize
+    width() const
+    { return _M_width; }
+
+
+
+
+
+
+    streamsize
+    width(streamsize __wide)
+    {
+      streamsize __old = _M_width;
+      _M_width = __wide;
+      return __old;
+    }
+    static bool
+    sync_with_stdio(bool __sync = true);
+    locale
+    imbue(const locale& __loc) throw();
+    locale
+    getloc() const
+    { return _M_ios_locale; }
+    const locale&
+    _M_getloc() const
+    { return _M_ios_locale; }
+    static int
+    xalloc() throw();
+    long&
+    iword(int __ix)
+    {
+      _Words& __word = (__ix < _M_word_size)
+   ? _M_word[__ix] : _M_grow_words(__ix, true);
+      return __word._M_iword;
+    }
+    void*&
+    pword(int __ix)
+    {
+      _Words& __word = (__ix < _M_word_size)
+   ? _M_word[__ix] : _M_grow_words(__ix, false);
+      return __word._M_pword;
+    }
+    virtual ~ios_base();
+
+  protected:
+    ios_base() throw ();
+  public:
+    ios_base(const ios_base&) = delete;
+
+    ios_base&
+    operator=(const ios_base&) = delete;
+
+  protected:
+    void
+    _M_move(ios_base&) noexcept;
+
+    void
+    _M_swap(ios_base& __rhs) noexcept;
+
+  };
+
+
+
+  inline ios_base&
+  boolalpha(ios_base& __base)
+  {
+    __base.setf(ios_base::boolalpha);
+    return __base;
+  }
+
+
+  inline ios_base&
+  noboolalpha(ios_base& __base)
+  {
+    __base.unsetf(ios_base::boolalpha);
+    return __base;
+  }
+
+
+  inline ios_base&
+  showbase(ios_base& __base)
+  {
+    __base.setf(ios_base::showbase);
+    return __base;
+  }
+
+
+  inline ios_base&
+  noshowbase(ios_base& __base)
+  {
+    __base.unsetf(ios_base::showbase);
+    return __base;
+  }
+
+
+  inline ios_base&
+  showpoint(ios_base& __base)
+  {
+    __base.setf(ios_base::showpoint);
+    return __base;
+  }
+
+
+  inline ios_base&
+  noshowpoint(ios_base& __base)
+  {
+    __base.unsetf(ios_base::showpoint);
+    return __base;
+  }
+
+
+  inline ios_base&
+  showpos(ios_base& __base)
+  {
+    __base.setf(ios_base::showpos);
+    return __base;
+  }
+
+
+  inline ios_base&
+  noshowpos(ios_base& __base)
+  {
+    __base.unsetf(ios_base::showpos);
+    return __base;
+  }
+
+
+  inline ios_base&
+  skipws(ios_base& __base)
+  {
+    __base.setf(ios_base::skipws);
+    return __base;
+  }
+
+
+  inline ios_base&
+  noskipws(ios_base& __base)
+  {
+    __base.unsetf(ios_base::skipws);
+    return __base;
+  }
+
+
+  inline ios_base&
+  uppercase(ios_base& __base)
+  {
+    __base.setf(ios_base::uppercase);
+    return __base;
+  }
+
+
+  inline ios_base&
+  nouppercase(ios_base& __base)
+  {
+    __base.unsetf(ios_base::uppercase);
+    return __base;
+  }
+
+
+  inline ios_base&
+  unitbuf(ios_base& __base)
+  {
+     __base.setf(ios_base::unitbuf);
+     return __base;
+  }
+
+
+  inline ios_base&
+  nounitbuf(ios_base& __base)
+  {
+     __base.unsetf(ios_base::unitbuf);
+     return __base;
+  }
+
+
+
+  inline ios_base&
+  internal(ios_base& __base)
+  {
+     __base.setf(ios_base::internal, ios_base::adjustfield);
+     return __base;
+  }
+
+
+  inline ios_base&
+  left(ios_base& __base)
+  {
+    __base.setf(ios_base::left, ios_base::adjustfield);
+    return __base;
+  }
+
+
+  inline ios_base&
+  right(ios_base& __base)
+  {
+    __base.setf(ios_base::right, ios_base::adjustfield);
+    return __base;
+  }
+
+
+
+  inline ios_base&
+  dec(ios_base& __base)
+  {
+    __base.setf(ios_base::dec, ios_base::basefield);
+    return __base;
+  }
+
+
+  inline ios_base&
+  hex(ios_base& __base)
+  {
+    __base.setf(ios_base::hex, ios_base::basefield);
+    return __base;
+  }
+
+
+  inline ios_base&
+  oct(ios_base& __base)
+  {
+    __base.setf(ios_base::oct, ios_base::basefield);
+    return __base;
+  }
+
+
+
+  inline ios_base&
+  fixed(ios_base& __base)
+  {
+    __base.setf(ios_base::fixed, ios_base::floatfield);
+    return __base;
+  }
+
+
+  inline ios_base&
+  scientific(ios_base& __base)
+  {
+    __base.setf(ios_base::scientific, ios_base::floatfield);
+    return __base;
+  }
+
+
+
+
+
+
+  inline ios_base&
+  hexfloat(ios_base& __base)
+  {
+    __base.setf(ios_base::fixed | ios_base::scientific, ios_base::floatfield);
+    return __base;
+  }
+
+
+  inline ios_base&
+  defaultfloat(ios_base& __base)
+  {
+    __base.unsetf(ios_base::floatfield);
+    return __base;
+  }
+
+
+
+}
+       
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+
+  template<typename _CharT, typename _Traits>
+    streamsize
+    __copy_streambufs_eof(basic_streambuf<_CharT, _Traits>*,
+     basic_streambuf<_CharT, _Traits>*, bool&);
+  template<typename _CharT, typename _Traits>
+    class basic_streambuf
+    {
+    public:
+
+
+
+
+
+
+      typedef _CharT char_type;
+      typedef _Traits traits_type;
+      typedef typename traits_type::int_type int_type;
+      typedef typename traits_type::pos_type pos_type;
+      typedef typename traits_type::off_type off_type;
+
+
+
+
+      typedef basic_streambuf<char_type, traits_type> __streambuf_type;
+
+
+      friend class basic_ios<char_type, traits_type>;
+      friend class basic_istream<char_type, traits_type>;
+      friend class basic_ostream<char_type, traits_type>;
+      friend class istreambuf_iterator<char_type, traits_type>;
+      friend class ostreambuf_iterator<char_type, traits_type>;
+
+      friend streamsize
+      __copy_streambufs_eof<>(basic_streambuf*, basic_streambuf*, bool&);
+
+      template<bool _IsMove, typename _CharT2>
+        friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value,
+            _CharT2*>::__type
+        __copy_move_a2(istreambuf_iterator<_CharT2>,
+         istreambuf_iterator<_CharT2>, _CharT2*);
+
+      template<typename _CharT2>
+        friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value,
+      istreambuf_iterator<_CharT2> >::__type
+        find(istreambuf_iterator<_CharT2>, istreambuf_iterator<_CharT2>,
+      const _CharT2&);
+
+      template<typename _CharT2, typename _Distance>
+        friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value,
+            void>::__type
+        advance(istreambuf_iterator<_CharT2>&, _Distance);
+
+      template<typename _CharT2, typename _Traits2>
+        friend basic_istream<_CharT2, _Traits2>&
+        operator>>(basic_istream<_CharT2, _Traits2>&, _CharT2*);
+
+      template<typename _CharT2, typename _Traits2, typename _Alloc>
+        friend basic_istream<_CharT2, _Traits2>&
+        operator>>(basic_istream<_CharT2, _Traits2>&,
+     basic_string<_CharT2, _Traits2, _Alloc>&);
+
+      template<typename _CharT2, typename _Traits2, typename _Alloc>
+        friend basic_istream<_CharT2, _Traits2>&
+        getline(basic_istream<_CharT2, _Traits2>&,
+  basic_string<_CharT2, _Traits2, _Alloc>&, _CharT2);
+
+    protected:
+
+
+
+
+
+
+
+      char_type* _M_in_beg;
+      char_type* _M_in_cur;
+      char_type* _M_in_end;
+      char_type* _M_out_beg;
+      char_type* _M_out_cur;
+      char_type* _M_out_end;
+
+
+      locale _M_buf_locale;
+
+  public:
+
+      virtual
+      ~basic_streambuf()
+      { }
+      locale
+      pubimbue(const locale& __loc)
+      {
+ locale __tmp(this->getloc());
+ this->imbue(__loc);
+ _M_buf_locale = __loc;
+ return __tmp;
+      }
+      locale
+      getloc() const
+      { return _M_buf_locale; }
+      basic_streambuf*
+      pubsetbuf(char_type* __s, streamsize __n)
+      { return this->setbuf(__s, __n); }
+      pos_type
+      pubseekoff(off_type __off, ios_base::seekdir __way,
+   ios_base::openmode __mode = ios_base::in | ios_base::out)
+      { return this->seekoff(__off, __way, __mode); }
+      pos_type
+      pubseekpos(pos_type __sp,
+   ios_base::openmode __mode = ios_base::in | ios_base::out)
+      { return this->seekpos(__sp, __mode); }
+
+
+
+
+      int
+      pubsync() { return this->sync(); }
+      streamsize
+      in_avail()
+      {
+ const streamsize __ret = this->egptr() - this->gptr();
+ return __ret ? __ret : this->showmanyc();
+      }
+      int_type
+      snextc()
+      {
+ int_type __ret = traits_type::eof();
+ if (__builtin_expect(!traits_type::eq_int_type(this->sbumpc(),
+             __ret), true))
+   __ret = this->sgetc();
+ return __ret;
+      }
+      int_type
+      sbumpc()
+      {
+ int_type __ret;
+ if (__builtin_expect(this->gptr() < this->egptr(), true))
+   {
+     __ret = traits_type::to_int_type(*this->gptr());
+     this->gbump(1);
+   }
+ else
+   __ret = this->uflow();
+ return __ret;
+      }
+      int_type
+      sgetc()
+      {
+ int_type __ret;
+ if (__builtin_expect(this->gptr() < this->egptr(), true))
+   __ret = traits_type::to_int_type(*this->gptr());
+ else
+   __ret = this->underflow();
+ return __ret;
+      }
+      streamsize
+      sgetn(char_type* __s, streamsize __n)
+      { return this->xsgetn(__s, __n); }
+      int_type
+      sputbackc(char_type __c)
+      {
+ int_type __ret;
+ const bool __testpos = this->eback() < this->gptr();
+ if (__builtin_expect(!__testpos ||
+        !traits_type::eq(__c, this->gptr()[-1]), false))
+   __ret = this->pbackfail(traits_type::to_int_type(__c));
+ else
+   {
+     this->gbump(-1);
+     __ret = traits_type::to_int_type(*this->gptr());
+   }
+ return __ret;
+      }
+      int_type
+      sungetc()
+      {
+ int_type __ret;
+ if (__builtin_expect(this->eback() < this->gptr(), true))
+   {
+     this->gbump(-1);
+     __ret = traits_type::to_int_type(*this->gptr());
+   }
+ else
+   __ret = this->pbackfail();
+ return __ret;
+      }
+      int_type
+      sputc(char_type __c)
+      {
+ int_type __ret;
+ if (__builtin_expect(this->pptr() < this->epptr(), true))
+   {
+     *this->pptr() = __c;
+     this->pbump(1);
+     __ret = traits_type::to_int_type(__c);
+   }
+ else
+   __ret = this->overflow(traits_type::to_int_type(__c));
+ return __ret;
+      }
+      streamsize
+      sputn(const char_type* __s, streamsize __n)
+      { return this->xsputn(__s, __n); }
+
+    protected:
+      basic_streambuf()
+      : _M_in_beg(0), _M_in_cur(0), _M_in_end(0),
+      _M_out_beg(0), _M_out_cur(0), _M_out_end(0),
+      _M_buf_locale(locale())
+      { }
+      char_type*
+      eback() const { return _M_in_beg; }
+
+      char_type*
+      gptr() const { return _M_in_cur; }
+
+      char_type*
+      egptr() const { return _M_in_end; }
+      void
+      gbump(int __n) { _M_in_cur += __n; }
+      void
+      setg(char_type* __gbeg, char_type* __gnext, char_type* __gend)
+      {
+ _M_in_beg = __gbeg;
+ _M_in_cur = __gnext;
+ _M_in_end = __gend;
+      }
+      char_type*
+      pbase() const { return _M_out_beg; }
+
+      char_type*
+      pptr() const { return _M_out_cur; }
+
+      char_type*
+      epptr() const { return _M_out_end; }
+      void
+      pbump(int __n) { _M_out_cur += __n; }
+      void
+      setp(char_type* __pbeg, char_type* __pend)
+      {
+ _M_out_beg = _M_out_cur = __pbeg;
+ _M_out_end = __pend;
+      }
+      virtual void
+      imbue(const locale& __loc __attribute__ ((__unused__)))
+      { }
+      virtual basic_streambuf<char_type,_Traits>*
+      setbuf(char_type*, streamsize)
+      { return this; }
+      virtual pos_type
+      seekoff(off_type, ios_base::seekdir,
+       ios_base::openmode = ios_base::in | ios_base::out)
+      { return pos_type(off_type(-1)); }
+      virtual pos_type
+      seekpos(pos_type,
+       ios_base::openmode = ios_base::in | ios_base::out)
+      { return pos_type(off_type(-1)); }
+      virtual int
+      sync() { return 0; }
+      virtual streamsize
+      showmanyc() { return 0; }
+      virtual streamsize
+      xsgetn(char_type* __s, streamsize __n);
+      virtual int_type
+      underflow()
+      { return traits_type::eof(); }
+      virtual int_type
+      uflow()
+      {
+ int_type __ret = traits_type::eof();
+ const bool __testeof = traits_type::eq_int_type(this->underflow(),
+       __ret);
+ if (!__testeof)
+   {
+     __ret = traits_type::to_int_type(*this->gptr());
+     this->gbump(1);
+   }
+ return __ret;
+      }
+      virtual int_type
+      pbackfail(int_type __c __attribute__ ((__unused__)) = traits_type::eof())
+      { return traits_type::eof(); }
+      virtual streamsize
+      xsputn(const char_type* __s, streamsize __n);
+      virtual int_type
+      overflow(int_type __c __attribute__ ((__unused__)) = traits_type::eof())
+      { return traits_type::eof(); }
+
+
+
+    public:
+      [[__deprecated__("stossc is deprecated, use sbumpc instead")]]
+
+      void
+      stossc()
+      {
+ if (this->gptr() < this->egptr())
+   this->gbump(1);
+ else
+   this->uflow();
+      }
+
+
+
+      void
+      __safe_gbump(streamsize __n) { _M_in_cur += __n; }
+
+      void
+      __safe_pbump(streamsize __n) { _M_out_cur += __n; }
+
+
+
+
+    protected:
+
+      basic_streambuf(const basic_streambuf&);
+
+      basic_streambuf&
+      operator=(const basic_streambuf&);
+
+
+      void
+      swap(basic_streambuf& __sb)
+      {
+ std::swap(_M_in_beg, __sb._M_in_beg);
+ std::swap(_M_in_cur, __sb._M_in_cur);
+ std::swap(_M_in_end, __sb._M_in_end);
+ std::swap(_M_out_beg, __sb._M_out_beg);
+ std::swap(_M_out_cur, __sb._M_out_cur);
+ std::swap(_M_out_end, __sb._M_out_end);
+ std::swap(_M_buf_locale, __sb._M_buf_locale);
+      }
+
+    };
+
+
+  template<typename _CharT, typename _Traits>
+    std::basic_streambuf<_CharT, _Traits>::
+    basic_streambuf(const basic_streambuf&) = default;
+
+  template<typename _CharT, typename _Traits>
+    std::basic_streambuf<_CharT, _Traits>&
+    std::basic_streambuf<_CharT, _Traits>::
+    operator=(const basic_streambuf&) = default;
+
+
+
+  template<>
+    streamsize
+    __copy_streambufs_eof(basic_streambuf<char>* __sbin,
+     basic_streambuf<char>* __sbout, bool& __ineof);
+
+  template<>
+    streamsize
+    __copy_streambufs_eof(basic_streambuf<wchar_t>* __sbin,
+     basic_streambuf<wchar_t>* __sbout, bool& __ineof);
+
+
+
+
+
+}
+
+       
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+  template<typename _CharT, typename _Traits>
+    streamsize
+    basic_streambuf<_CharT, _Traits>::
+    xsgetn(char_type* __s, streamsize __n)
+    {
+      streamsize __ret = 0;
+      while (__ret < __n)
+ {
+   const streamsize __buf_len = this->egptr() - this->gptr();
+   if (__buf_len)
+     {
+       const streamsize __remaining = __n - __ret;
+       const streamsize __len = std::min(__buf_len, __remaining);
+       traits_type::copy(__s, this->gptr(), __len);
+       __ret += __len;
+       __s += __len;
+       this->__safe_gbump(__len);
+     }
+
+   if (__ret < __n)
+     {
+       const int_type __c = this->uflow();
+       if (!traits_type::eq_int_type(__c, traits_type::eof()))
+  {
+    traits_type::assign(*__s++, traits_type::to_char_type(__c));
+    ++__ret;
+  }
+       else
+  break;
+     }
+ }
+      return __ret;
+    }
+
+  template<typename _CharT, typename _Traits>
+    streamsize
+    basic_streambuf<_CharT, _Traits>::
+    xsputn(const char_type* __s, streamsize __n)
+    {
+      streamsize __ret = 0;
+      while (__ret < __n)
+ {
+   const streamsize __buf_len = this->epptr() - this->pptr();
+   if (__buf_len)
+     {
+       const streamsize __remaining = __n - __ret;
+       const streamsize __len = std::min(__buf_len, __remaining);
+       traits_type::copy(this->pptr(), __s, __len);
+       __ret += __len;
+       __s += __len;
+       this->__safe_pbump(__len);
+     }
+
+   if (__ret < __n)
+     {
+       int_type __c = this->overflow(traits_type::to_int_type(*__s));
+       if (!traits_type::eq_int_type(__c, traits_type::eof()))
+  {
+    ++__ret;
+    ++__s;
+  }
+       else
+  break;
+     }
+ }
+      return __ret;
+    }
+
+
+
+
+  template<typename _CharT, typename _Traits>
+    streamsize
+    __copy_streambufs_eof(basic_streambuf<_CharT, _Traits>* __sbin,
+     basic_streambuf<_CharT, _Traits>* __sbout,
+     bool& __ineof)
+    {
+      streamsize __ret = 0;
+      __ineof = true;
+      typename _Traits::int_type __c = __sbin->sgetc();
+      while (!_Traits::eq_int_type(__c, _Traits::eof()))
+ {
+   __c = __sbout->sputc(_Traits::to_char_type(__c));
+   if (_Traits::eq_int_type(__c, _Traits::eof()))
+     {
+       __ineof = false;
+       break;
+     }
+   ++__ret;
+   __c = __sbin->snextc();
+ }
+      return __ret;
+    }
+
+  template<typename _CharT, typename _Traits>
+    inline streamsize
+    __copy_streambufs(basic_streambuf<_CharT, _Traits>* __sbin,
+        basic_streambuf<_CharT, _Traits>* __sbout)
+    {
+      bool __ineof;
+      return __copy_streambufs_eof(__sbin, __sbout, __ineof);
+    }
+
+
+
+
+  extern template class basic_streambuf<char>;
+  extern template
+    streamsize
+    __copy_streambufs(basic_streambuf<char>*,
+        basic_streambuf<char>*);
+  extern template
+    streamsize
+    __copy_streambufs_eof(basic_streambuf<char>*,
+     basic_streambuf<char>*, bool&);
+
+
+  extern template class basic_streambuf<wchar_t>;
+  extern template
+    streamsize
+    __copy_streambufs(basic_streambuf<wchar_t>*,
+        basic_streambuf<wchar_t>*);
+  extern template
+    streamsize
+    __copy_streambufs_eof(basic_streambuf<wchar_t>*,
+     basic_streambuf<wchar_t>*, bool&);
+
+
+
+
+}
+       
+
+
+
+       
+
+       
+
+
+
+typedef unsigned long int wctype_t;
+
+enum
+{
+  __ISwupper = 0,
+  __ISwlower = 1,
+  __ISwalpha = 2,
+  __ISwdigit = 3,
+  __ISwxdigit = 4,
+  __ISwspace = 5,
+  __ISwprint = 6,
+  __ISwgraph = 7,
+  __ISwblank = 8,
+  __ISwcntrl = 9,
+  __ISwpunct = 10,
+  __ISwalnum = 11,
+
+  _ISwupper = ((__ISwupper) < 8 ? (int) ((1UL << (__ISwupper)) << 24) : ((__ISwupper) < 16 ? (int) ((1UL << (__ISwupper)) << 8) : ((__ISwupper) < 24 ? (int) ((1UL << (__ISwupper)) >> 8) : (int) ((1UL << (__ISwupper)) >> 24)))),
+  _ISwlower = ((__ISwlower) < 8 ? (int) ((1UL << (__ISwlower)) << 24) : ((__ISwlower) < 16 ? (int) ((1UL << (__ISwlower)) << 8) : ((__ISwlower) < 24 ? (int) ((1UL << (__ISwlower)) >> 8) : (int) ((1UL << (__ISwlower)) >> 24)))),
+  _ISwalpha = ((__ISwalpha) < 8 ? (int) ((1UL << (__ISwalpha)) << 24) : ((__ISwalpha) < 16 ? (int) ((1UL << (__ISwalpha)) << 8) : ((__ISwalpha) < 24 ? (int) ((1UL << (__ISwalpha)) >> 8) : (int) ((1UL << (__ISwalpha)) >> 24)))),
+  _ISwdigit = ((__ISwdigit) < 8 ? (int) ((1UL << (__ISwdigit)) << 24) : ((__ISwdigit) < 16 ? (int) ((1UL << (__ISwdigit)) << 8) : ((__ISwdigit) < 24 ? (int) ((1UL << (__ISwdigit)) >> 8) : (int) ((1UL << (__ISwdigit)) >> 24)))),
+  _ISwxdigit = ((__ISwxdigit) < 8 ? (int) ((1UL << (__ISwxdigit)) << 24) : ((__ISwxdigit) < 16 ? (int) ((1UL << (__ISwxdigit)) << 8) : ((__ISwxdigit) < 24 ? (int) ((1UL << (__ISwxdigit)) >> 8) : (int) ((1UL << (__ISwxdigit)) >> 24)))),
+  _ISwspace = ((__ISwspace) < 8 ? (int) ((1UL << (__ISwspace)) << 24) : ((__ISwspace) < 16 ? (int) ((1UL << (__ISwspace)) << 8) : ((__ISwspace) < 24 ? (int) ((1UL << (__ISwspace)) >> 8) : (int) ((1UL << (__ISwspace)) >> 24)))),
+  _ISwprint = ((__ISwprint) < 8 ? (int) ((1UL << (__ISwprint)) << 24) : ((__ISwprint) < 16 ? (int) ((1UL << (__ISwprint)) << 8) : ((__ISwprint) < 24 ? (int) ((1UL << (__ISwprint)) >> 8) : (int) ((1UL << (__ISwprint)) >> 24)))),
+  _ISwgraph = ((__ISwgraph) < 8 ? (int) ((1UL << (__ISwgraph)) << 24) : ((__ISwgraph) < 16 ? (int) ((1UL << (__ISwgraph)) << 8) : ((__ISwgraph) < 24 ? (int) ((1UL << (__ISwgraph)) >> 8) : (int) ((1UL << (__ISwgraph)) >> 24)))),
+  _ISwblank = ((__ISwblank) < 8 ? (int) ((1UL << (__ISwblank)) << 24) : ((__ISwblank) < 16 ? (int) ((1UL << (__ISwblank)) << 8) : ((__ISwblank) < 24 ? (int) ((1UL << (__ISwblank)) >> 8) : (int) ((1UL << (__ISwblank)) >> 24)))),
+  _ISwcntrl = ((__ISwcntrl) < 8 ? (int) ((1UL << (__ISwcntrl)) << 24) : ((__ISwcntrl) < 16 ? (int) ((1UL << (__ISwcntrl)) << 8) : ((__ISwcntrl) < 24 ? (int) ((1UL << (__ISwcntrl)) >> 8) : (int) ((1UL << (__ISwcntrl)) >> 24)))),
+  _ISwpunct = ((__ISwpunct) < 8 ? (int) ((1UL << (__ISwpunct)) << 24) : ((__ISwpunct) < 16 ? (int) ((1UL << (__ISwpunct)) << 8) : ((__ISwpunct) < 24 ? (int) ((1UL << (__ISwpunct)) >> 8) : (int) ((1UL << (__ISwpunct)) >> 24)))),
+  _ISwalnum = ((__ISwalnum) < 8 ? (int) ((1UL << (__ISwalnum)) << 24) : ((__ISwalnum) < 16 ? (int) ((1UL << (__ISwalnum)) << 8) : ((__ISwalnum) < 24 ? (int) ((1UL << (__ISwalnum)) >> 8) : (int) ((1UL << (__ISwalnum)) >> 24))))
+};
+
+
+
+extern "C" {
+
+
+
+
+
+
+
+
+extern int iswalnum (wint_t __wc) throw ();
+
+
+
+
+
+extern int iswalpha (wint_t __wc) throw ();
+
+
+extern int iswcntrl (wint_t __wc) throw ();
+
+
+
+extern int iswdigit (wint_t __wc) throw ();
+
+
+
+extern int iswgraph (wint_t __wc) throw ();
+
+
+
+
+extern int iswlower (wint_t __wc) throw ();
+
+
+extern int iswprint (wint_t __wc) throw ();
+
+
+
+
+extern int iswpunct (wint_t __wc) throw ();
+
+
+
+
+extern int iswspace (wint_t __wc) throw ();
+
+
+
+
+extern int iswupper (wint_t __wc) throw ();
+
+
+
+
+extern int iswxdigit (wint_t __wc) throw ();
+
+
+
+
+
+extern int iswblank (wint_t __wc) throw ();
+extern wctype_t wctype (const char *__property) throw ();
+
+
+
+extern int iswctype (wint_t __wc, wctype_t __desc) throw ();
+
+
+
+
+
+
+
+
+
+
+typedef const __int32_t *wctrans_t;
+
+
+
+
+
+
+
+extern wint_t towlower (wint_t __wc) throw ();
+
+
+extern wint_t towupper (wint_t __wc) throw ();
+
+
+}
+extern "C" {
+
+
+
+
+extern wctrans_t wctrans (const char *__property) throw ();
+
+
+extern wint_t towctrans (wint_t __wc, wctrans_t __desc) throw ();
+
+
+
+
+
+
+
+
+extern int iswalnum_l (wint_t __wc, __locale_t __locale) throw ();
+
+
+
+
+
+extern int iswalpha_l (wint_t __wc, __locale_t __locale) throw ();
+
+
+extern int iswcntrl_l (wint_t __wc, __locale_t __locale) throw ();
+
+
+
+extern int iswdigit_l (wint_t __wc, __locale_t __locale) throw ();
+
+
+
+extern int iswgraph_l (wint_t __wc, __locale_t __locale) throw ();
+
+
+
+
+extern int iswlower_l (wint_t __wc, __locale_t __locale) throw ();
+
+
+extern int iswprint_l (wint_t __wc, __locale_t __locale) throw ();
+
+
+
+
+extern int iswpunct_l (wint_t __wc, __locale_t __locale) throw ();
+
+
+
+
+extern int iswspace_l (wint_t __wc, __locale_t __locale) throw ();
+
+
+
+
+extern int iswupper_l (wint_t __wc, __locale_t __locale) throw ();
+
+
+
+
+extern int iswxdigit_l (wint_t __wc, __locale_t __locale) throw ();
+
+
+
+
+extern int iswblank_l (wint_t __wc, __locale_t __locale) throw ();
+
+
+
+extern wctype_t wctype_l (const char *__property, __locale_t __locale)
+     throw ();
+
+
+
+extern int iswctype_l (wint_t __wc, wctype_t __desc, __locale_t __locale)
+     throw ();
+
+
+
+
+
+
+
+extern wint_t towlower_l (wint_t __wc, __locale_t __locale) throw ();
+
+
+extern wint_t towupper_l (wint_t __wc, __locale_t __locale) throw ();
+
+
+
+extern wctrans_t wctrans_l (const char *__property, __locale_t __locale)
+     throw ();
+
+
+extern wint_t towctrans_l (wint_t __wc, wctrans_t __desc,
+      __locale_t __locale) throw ();
+
+
+
+}
+namespace std
+{
+  using ::wctrans_t;
+  using ::wctype_t;
+  using ::wint_t;
+
+  using ::iswalnum;
+  using ::iswalpha;
+
+  using ::iswblank;
+
+  using ::iswcntrl;
+  using ::iswctype;
+  using ::iswdigit;
+  using ::iswgraph;
+  using ::iswlower;
+  using ::iswprint;
+  using ::iswpunct;
+  using ::iswspace;
+  using ::iswupper;
+  using ::iswxdigit;
+  using ::towctrans;
+  using ::towlower;
+  using ::towupper;
+  using ::wctrans;
+  using ::wctype;
+}
+       
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+  struct ctype_base
+  {
+
+    typedef const int* __to_type;
+
+
+
+    typedef unsigned short mask;
+    static const mask upper = _ISupper;
+    static const mask lower = _ISlower;
+    static const mask alpha = _ISalpha;
+    static const mask digit = _ISdigit;
+    static const mask xdigit = _ISxdigit;
+    static const mask space = _ISspace;
+    static const mask print = _ISprint;
+    static const mask graph = _ISalpha | _ISdigit | _ISpunct;
+    static const mask cntrl = _IScntrl;
+    static const mask punct = _ISpunct;
+    static const mask alnum = _ISalpha | _ISdigit;
+
+    static const mask blank = _ISblank;
+
+  };
+
+
+}
+
+
+
+
+
+
+       
+
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+  template<typename _CharT, typename _Traits>
+    class istreambuf_iterator
+    : public iterator<input_iterator_tag, _CharT, typename _Traits::off_type,
+        _CharT*,
+
+
+        _CharT>
+
+
+
+    {
+    public:
+
+
+
+      typedef _CharT char_type;
+      typedef _Traits traits_type;
+      typedef typename _Traits::int_type int_type;
+      typedef basic_streambuf<_CharT, _Traits> streambuf_type;
+      typedef basic_istream<_CharT, _Traits> istream_type;
+
+
+      template<typename _CharT2>
+ friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value,
+        ostreambuf_iterator<_CharT2> >::__type
+ copy(istreambuf_iterator<_CharT2>, istreambuf_iterator<_CharT2>,
+      ostreambuf_iterator<_CharT2>);
+
+      template<bool _IsMove, typename _CharT2>
+ friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value,
+            _CharT2*>::__type
+ __copy_move_a2(istreambuf_iterator<_CharT2>,
+         istreambuf_iterator<_CharT2>, _CharT2*);
+
+      template<typename _CharT2>
+ friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value,
+        istreambuf_iterator<_CharT2> >::__type
+ find(istreambuf_iterator<_CharT2>, istreambuf_iterator<_CharT2>,
+      const _CharT2&);
+
+      template<typename _CharT2, typename _Distance>
+ friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value,
+            void>::__type
+ advance(istreambuf_iterator<_CharT2>&, _Distance);
+
+    private:
+
+
+
+
+
+
+
+      mutable streambuf_type* _M_sbuf;
+      int_type _M_c;
+
+    public:
+
+      constexpr istreambuf_iterator() noexcept
+      : _M_sbuf(0), _M_c(traits_type::eof()) { }
+
+
+      istreambuf_iterator(const istreambuf_iterator&) noexcept = default;
+
+      ~istreambuf_iterator() = default;
+
+
+
+      istreambuf_iterator(istream_type& __s) noexcept
+      : _M_sbuf(__s.rdbuf()), _M_c(traits_type::eof()) { }
+
+
+      istreambuf_iterator(streambuf_type* __s) noexcept
+      : _M_sbuf(__s), _M_c(traits_type::eof()) { }
+
+
+
+
+      char_type
+      operator*() const
+      {
+ int_type __c = _M_get();
+ return traits_type::to_char_type(__c);
+      }
+
+
+      istreambuf_iterator&
+      operator++()
+      {
+
+
+
+                        ;
+
+ _M_sbuf->sbumpc();
+ _M_c = traits_type::eof();
+ return *this;
+      }
+
+
+      istreambuf_iterator
+      operator++(int)
+      {
+
+
+
+                        ;
+
+ istreambuf_iterator __old = *this;
+ __old._M_c = _M_sbuf->sbumpc();
+ _M_c = traits_type::eof();
+ return __old;
+      }
+
+
+
+
+
+      bool
+      equal(const istreambuf_iterator& __b) const
+      { return _M_at_eof() == __b._M_at_eof(); }
+
+    private:
+      int_type
+      _M_get() const
+      {
+ int_type __ret = _M_c;
+ if (_M_sbuf && _S_is_eof(__ret) && _S_is_eof(__ret = _M_sbuf->sgetc()))
+   _M_sbuf = 0;
+ return __ret;
+      }
+
+      bool
+      _M_at_eof() const
+      { return _S_is_eof(_M_get()); }
+
+      static bool
+      _S_is_eof(int_type __c)
+      {
+ const int_type __eof = traits_type::eof();
+ return traits_type::eq_int_type(__c, __eof);
+      }
+    };
+
+  template<typename _CharT, typename _Traits>
+    inline bool
+    operator==(const istreambuf_iterator<_CharT, _Traits>& __a,
+        const istreambuf_iterator<_CharT, _Traits>& __b)
+    { return __a.equal(__b); }
+
+  template<typename _CharT, typename _Traits>
+    inline bool
+    operator!=(const istreambuf_iterator<_CharT, _Traits>& __a,
+        const istreambuf_iterator<_CharT, _Traits>& __b)
+    { return !__a.equal(__b); }
+
+
+  template<typename _CharT, typename _Traits>
+    class ostreambuf_iterator
+    : public iterator<output_iterator_tag, void, void, void, void>
+    {
+    public:
+
+
+
+      typedef _CharT char_type;
+      typedef _Traits traits_type;
+      typedef basic_streambuf<_CharT, _Traits> streambuf_type;
+      typedef basic_ostream<_CharT, _Traits> ostream_type;
+
+
+      template<typename _CharT2>
+ friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value,
+        ostreambuf_iterator<_CharT2> >::__type
+ copy(istreambuf_iterator<_CharT2>, istreambuf_iterator<_CharT2>,
+      ostreambuf_iterator<_CharT2>);
+
+    private:
+      streambuf_type* _M_sbuf;
+      bool _M_failed;
+
+    public:
+
+      ostreambuf_iterator(ostream_type& __s) noexcept
+      : _M_sbuf(__s.rdbuf()), _M_failed(!_M_sbuf) { }
+
+
+      ostreambuf_iterator(streambuf_type* __s) noexcept
+      : _M_sbuf(__s), _M_failed(!_M_sbuf) { }
+
+
+      ostreambuf_iterator&
+      operator=(_CharT __c)
+      {
+ if (!_M_failed &&
+     _Traits::eq_int_type(_M_sbuf->sputc(__c), _Traits::eof()))
+   _M_failed = true;
+ return *this;
+      }
+
+
+      ostreambuf_iterator&
+      operator*()
+      { return *this; }
+
+
+      ostreambuf_iterator&
+      operator++(int)
+      { return *this; }
+
+
+      ostreambuf_iterator&
+      operator++()
+      { return *this; }
+
+
+      bool
+      failed() const noexcept
+      { return _M_failed; }
+
+      ostreambuf_iterator&
+      _M_put(const _CharT* __ws, streamsize __len)
+      {
+ if (__builtin_expect(!_M_failed, true)
+     && __builtin_expect(this->_M_sbuf->sputn(__ws, __len) != __len,
+    false))
+   _M_failed = true;
+ return *this;
+      }
+    };
+
+
+  template<typename _CharT>
+    typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
+        ostreambuf_iterator<_CharT> >::__type
+    copy(istreambuf_iterator<_CharT> __first,
+  istreambuf_iterator<_CharT> __last,
+  ostreambuf_iterator<_CharT> __result)
+    {
+      if (__first._M_sbuf && !__last._M_sbuf && !__result._M_failed)
+ {
+   bool __ineof;
+   __copy_streambufs_eof(__first._M_sbuf, __result._M_sbuf, __ineof);
+   if (!__ineof)
+     __result._M_failed = true;
+ }
+      return __result;
+    }
+
+  template<bool _IsMove, typename _CharT>
+    typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
+        ostreambuf_iterator<_CharT> >::__type
+    __copy_move_a2(_CharT* __first, _CharT* __last,
+     ostreambuf_iterator<_CharT> __result)
+    {
+      const streamsize __num = __last - __first;
+      if (__num > 0)
+ __result._M_put(__first, __num);
+      return __result;
+    }
+
+  template<bool _IsMove, typename _CharT>
+    typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
+        ostreambuf_iterator<_CharT> >::__type
+    __copy_move_a2(const _CharT* __first, const _CharT* __last,
+     ostreambuf_iterator<_CharT> __result)
+    {
+      const streamsize __num = __last - __first;
+      if (__num > 0)
+ __result._M_put(__first, __num);
+      return __result;
+    }
+
+  template<bool _IsMove, typename _CharT>
+    typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
+        _CharT*>::__type
+    __copy_move_a2(istreambuf_iterator<_CharT> __first,
+     istreambuf_iterator<_CharT> __last, _CharT* __result)
+    {
+      typedef istreambuf_iterator<_CharT> __is_iterator_type;
+      typedef typename __is_iterator_type::traits_type traits_type;
+      typedef typename __is_iterator_type::streambuf_type streambuf_type;
+      typedef typename traits_type::int_type int_type;
+
+      if (__first._M_sbuf && !__last._M_sbuf)
+ {
+   streambuf_type* __sb = __first._M_sbuf;
+   int_type __c = __sb->sgetc();
+   while (!traits_type::eq_int_type(__c, traits_type::eof()))
+     {
+       const streamsize __n = __sb->egptr() - __sb->gptr();
+       if (__n > 1)
+  {
+    traits_type::copy(__result, __sb->gptr(), __n);
+    __sb->__safe_gbump(__n);
+    __result += __n;
+    __c = __sb->underflow();
+  }
+       else
+  {
+    *__result++ = traits_type::to_char_type(__c);
+    __c = __sb->snextc();
+  }
+     }
+ }
+      return __result;
+    }
+
+  template<typename _CharT>
+    typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
+          istreambuf_iterator<_CharT> >::__type
+    find(istreambuf_iterator<_CharT> __first,
+  istreambuf_iterator<_CharT> __last, const _CharT& __val)
+    {
+      typedef istreambuf_iterator<_CharT> __is_iterator_type;
+      typedef typename __is_iterator_type::traits_type traits_type;
+      typedef typename __is_iterator_type::streambuf_type streambuf_type;
+      typedef typename traits_type::int_type int_type;
+      const int_type __eof = traits_type::eof();
+
+      if (__first._M_sbuf && !__last._M_sbuf)
+ {
+   const int_type __ival = traits_type::to_int_type(__val);
+   streambuf_type* __sb = __first._M_sbuf;
+   int_type __c = __sb->sgetc();
+   while (!traits_type::eq_int_type(__c, __eof)
+   && !traits_type::eq_int_type(__c, __ival))
+     {
+       streamsize __n = __sb->egptr() - __sb->gptr();
+       if (__n > 1)
+  {
+    const _CharT* __p = traits_type::find(__sb->gptr(),
+       __n, __val);
+    if (__p)
+      __n = __p - __sb->gptr();
+    __sb->__safe_gbump(__n);
+    __c = __sb->sgetc();
+  }
+       else
+  __c = __sb->snextc();
+     }
+
+   __first._M_c = __eof;
+ }
+
+      return __first;
+    }
+
+  template<typename _CharT, typename _Distance>
+    typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
+        void>::__type
+    advance(istreambuf_iterator<_CharT>& __i, _Distance __n)
+    {
+      if (__n == 0)
+ return;
+
+      ;
+     
+
+                           ;
+
+      typedef istreambuf_iterator<_CharT> __is_iterator_type;
+      typedef typename __is_iterator_type::traits_type traits_type;
+      typedef typename __is_iterator_type::streambuf_type streambuf_type;
+      typedef typename traits_type::int_type int_type;
+      const int_type __eof = traits_type::eof();
+
+      streambuf_type* __sb = __i._M_sbuf;
+      while (__n > 0)
+ {
+   streamsize __size = __sb->egptr() - __sb->gptr();
+   if (__size > __n)
+     {
+       __sb->__safe_gbump(__n);
+       break;
+     }
+
+   __sb->__safe_gbump(__size);
+   __n -= __size;
+   if (traits_type::eq_int_type(__sb->underflow(), __eof))
+     {
+      
+
+                      ;
+       break;
+     }
+ }
+
+      __i._M_c = __eof;
+    }
+
+
+
+
+}
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+  template<typename _Tp>
+    void
+    __convert_to_v(const char*, _Tp&, ios_base::iostate&,
+     const __c_locale&) throw();
+
+
+  template<>
+    void
+    __convert_to_v(const char*, float&, ios_base::iostate&,
+     const __c_locale&) throw();
+
+  template<>
+    void
+    __convert_to_v(const char*, double&, ios_base::iostate&,
+     const __c_locale&) throw();
+
+  template<>
+    void
+    __convert_to_v(const char*, long double&, ios_base::iostate&,
+     const __c_locale&) throw();
+
+
+
+  template<typename _CharT, typename _Traits>
+    struct __pad
+    {
+      static void
+      _S_pad(ios_base& __io, _CharT __fill, _CharT* __news,
+      const _CharT* __olds, streamsize __newlen, streamsize __oldlen);
+    };
+
+
+
+
+
+
+  template<typename _CharT>
+    _CharT*
+    __add_grouping(_CharT* __s, _CharT __sep,
+     const char* __gbeg, size_t __gsize,
+     const _CharT* __first, const _CharT* __last);
+
+
+
+
+  template<typename _CharT>
+    inline
+    ostreambuf_iterator<_CharT>
+    __write(ostreambuf_iterator<_CharT> __s, const _CharT* __ws, int __len)
+    {
+      __s._M_put(__ws, __len);
+      return __s;
+    }
+
+
+  template<typename _CharT, typename _OutIter>
+    inline
+    _OutIter
+    __write(_OutIter __s, const _CharT* __ws, int __len)
+    {
+      for (int __j = 0; __j < __len; __j++, ++__s)
+ *__s = __ws[__j];
+      return __s;
+    }
+  template<typename _CharT>
+    class __ctype_abstract_base : public locale::facet, public ctype_base
+    {
+    public:
+
+
+      typedef _CharT char_type;
+      bool
+      is(mask __m, char_type __c) const
+      { return this->do_is(__m, __c); }
+      const char_type*
+      is(const char_type *__lo, const char_type *__hi, mask *__vec) const
+      { return this->do_is(__lo, __hi, __vec); }
+      const char_type*
+      scan_is(mask __m, const char_type* __lo, const char_type* __hi) const
+      { return this->do_scan_is(__m, __lo, __hi); }
+      const char_type*
+      scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
+      { return this->do_scan_not(__m, __lo, __hi); }
+      char_type
+      toupper(char_type __c) const
+      { return this->do_toupper(__c); }
+      const char_type*
+      toupper(char_type *__lo, const char_type* __hi) const
+      { return this->do_toupper(__lo, __hi); }
+      char_type
+      tolower(char_type __c) const
+      { return this->do_tolower(__c); }
+      const char_type*
+      tolower(char_type* __lo, const char_type* __hi) const
+      { return this->do_tolower(__lo, __hi); }
+      char_type
+      widen(char __c) const
+      { return this->do_widen(__c); }
+      const char*
+      widen(const char* __lo, const char* __hi, char_type* __to) const
+      { return this->do_widen(__lo, __hi, __to); }
+      char
+      narrow(char_type __c, char __dfault) const
+      { return this->do_narrow(__c, __dfault); }
+      const char_type*
+      narrow(const char_type* __lo, const char_type* __hi,
+       char __dfault, char* __to) const
+      { return this->do_narrow(__lo, __hi, __dfault, __to); }
+
+    protected:
+      explicit
+      __ctype_abstract_base(size_t __refs = 0): facet(__refs) { }
+
+      virtual
+      ~__ctype_abstract_base() { }
+      virtual bool
+      do_is(mask __m, char_type __c) const = 0;
+      virtual const char_type*
+      do_is(const char_type* __lo, const char_type* __hi,
+     mask* __vec) const = 0;
+      virtual const char_type*
+      do_scan_is(mask __m, const char_type* __lo,
+   const char_type* __hi) const = 0;
+      virtual const char_type*
+      do_scan_not(mask __m, const char_type* __lo,
+    const char_type* __hi) const = 0;
+      virtual char_type
+      do_toupper(char_type __c) const = 0;
+      virtual const char_type*
+      do_toupper(char_type* __lo, const char_type* __hi) const = 0;
+      virtual char_type
+      do_tolower(char_type __c) const = 0;
+      virtual const char_type*
+      do_tolower(char_type* __lo, const char_type* __hi) const = 0;
+      virtual char_type
+      do_widen(char __c) const = 0;
+      virtual const char*
+      do_widen(const char* __lo, const char* __hi, char_type* __to) const = 0;
+      virtual char
+      do_narrow(char_type __c, char __dfault) const = 0;
+      virtual const char_type*
+      do_narrow(const char_type* __lo, const char_type* __hi,
+  char __dfault, char* __to) const = 0;
+    };
+  template<typename _CharT>
+    class ctype : public __ctype_abstract_base<_CharT>
+    {
+    public:
+
+      typedef _CharT char_type;
+      typedef typename __ctype_abstract_base<_CharT>::mask mask;
+
+
+      static locale::id id;
+
+      explicit
+      ctype(size_t __refs = 0) : __ctype_abstract_base<_CharT>(__refs) { }
+
+   protected:
+      virtual
+      ~ctype();
+
+      virtual bool
+      do_is(mask __m, char_type __c) const;
+
+      virtual const char_type*
+      do_is(const char_type* __lo, const char_type* __hi, mask* __vec) const;
+
+      virtual const char_type*
+      do_scan_is(mask __m, const char_type* __lo, const char_type* __hi) const;
+
+      virtual const char_type*
+      do_scan_not(mask __m, const char_type* __lo,
+    const char_type* __hi) const;
+
+      virtual char_type
+      do_toupper(char_type __c) const;
+
+      virtual const char_type*
+      do_toupper(char_type* __lo, const char_type* __hi) const;
+
+      virtual char_type
+      do_tolower(char_type __c) const;
+
+      virtual const char_type*
+      do_tolower(char_type* __lo, const char_type* __hi) const;
+
+      virtual char_type
+      do_widen(char __c) const;
+
+      virtual const char*
+      do_widen(const char* __lo, const char* __hi, char_type* __dest) const;
+
+      virtual char
+      do_narrow(char_type, char __dfault) const;
+
+      virtual const char_type*
+      do_narrow(const char_type* __lo, const char_type* __hi,
+  char __dfault, char* __to) const;
+    };
+
+  template<typename _CharT>
+    locale::id ctype<_CharT>::id;
+  template<>
+    class ctype<char> : public locale::facet, public ctype_base
+    {
+    public:
+
+
+      typedef char char_type;
+
+    protected:
+
+      __c_locale _M_c_locale_ctype;
+      bool _M_del;
+      __to_type _M_toupper;
+      __to_type _M_tolower;
+      const mask* _M_table;
+      mutable char _M_widen_ok;
+      mutable char _M_widen[1 + static_cast<unsigned char>(-1)];
+      mutable char _M_narrow[1 + static_cast<unsigned char>(-1)];
+      mutable char _M_narrow_ok;
+
+
+    public:
+
+      static locale::id id;
+
+      static const size_t table_size = 1 + static_cast<unsigned char>(-1);
+      explicit
+      ctype(const mask* __table = 0, bool __del = false, size_t __refs = 0);
+      explicit
+      ctype(__c_locale __cloc, const mask* __table = 0, bool __del = false,
+     size_t __refs = 0);
+      inline bool
+      is(mask __m, char __c) const;
+      inline const char*
+      is(const char* __lo, const char* __hi, mask* __vec) const;
+      inline const char*
+      scan_is(mask __m, const char* __lo, const char* __hi) const;
+      inline const char*
+      scan_not(mask __m, const char* __lo, const char* __hi) const;
+      char_type
+      toupper(char_type __c) const
+      { return this->do_toupper(__c); }
+      const char_type*
+      toupper(char_type *__lo, const char_type* __hi) const
+      { return this->do_toupper(__lo, __hi); }
+      char_type
+      tolower(char_type __c) const
+      { return this->do_tolower(__c); }
+      const char_type*
+      tolower(char_type* __lo, const char_type* __hi) const
+      { return this->do_tolower(__lo, __hi); }
+      char_type
+      widen(char __c) const
+      {
+ if (_M_widen_ok)
+   return _M_widen[static_cast<unsigned char>(__c)];
+ this->_M_widen_init();
+ return this->do_widen(__c);
+      }
+      const char*
+      widen(const char* __lo, const char* __hi, char_type* __to) const
+      {
+ if (_M_widen_ok == 1)
+   {
+     __builtin_memcpy(__to, __lo, __hi - __lo);
+     return __hi;
+   }
+ if (!_M_widen_ok)
+   _M_widen_init();
+ return this->do_widen(__lo, __hi, __to);
+      }
+      char
+      narrow(char_type __c, char __dfault) const
+      {
+ if (_M_narrow[static_cast<unsigned char>(__c)])
+   return _M_narrow[static_cast<unsigned char>(__c)];
+ const char __t = do_narrow(__c, __dfault);
+ if (__t != __dfault)
+   _M_narrow[static_cast<unsigned char>(__c)] = __t;
+ return __t;
+      }
+      const char_type*
+      narrow(const char_type* __lo, const char_type* __hi,
+      char __dfault, char* __to) const
+      {
+ if (__builtin_expect(_M_narrow_ok == 1, true))
+   {
+     __builtin_memcpy(__to, __lo, __hi - __lo);
+     return __hi;
+   }
+ if (!_M_narrow_ok)
+   _M_narrow_init();
+ return this->do_narrow(__lo, __hi, __dfault, __to);
+      }
+
+
+
+
+
+      const mask*
+      table() const throw()
+      { return _M_table; }
+
+
+      static const mask*
+      classic_table() throw();
+    protected:
+
+
+
+
+
+
+
+      virtual
+      ~ctype();
+      virtual char_type
+      do_toupper(char_type __c) const;
+      virtual const char_type*
+      do_toupper(char_type* __lo, const char_type* __hi) const;
+      virtual char_type
+      do_tolower(char_type __c) const;
+      virtual const char_type*
+      do_tolower(char_type* __lo, const char_type* __hi) const;
+      virtual char_type
+      do_widen(char __c) const
+      { return __c; }
+      virtual const char*
+      do_widen(const char* __lo, const char* __hi, char_type* __to) const
+      {
+ __builtin_memcpy(__to, __lo, __hi - __lo);
+ return __hi;
+      }
+      virtual char
+      do_narrow(char_type __c, char __dfault __attribute__((__unused__))) const
+      { return __c; }
+      virtual const char_type*
+      do_narrow(const char_type* __lo, const char_type* __hi,
+  char __dfault __attribute__((__unused__)), char* __to) const
+      {
+ __builtin_memcpy(__to, __lo, __hi - __lo);
+ return __hi;
+      }
+
+    private:
+      void _M_narrow_init() const;
+      void _M_widen_init() const;
+    };
+  template<>
+    class ctype<wchar_t> : public __ctype_abstract_base<wchar_t>
+    {
+    public:
+
+
+      typedef wchar_t char_type;
+      typedef wctype_t __wmask_type;
+
+    protected:
+      __c_locale _M_c_locale_ctype;
+
+
+      bool _M_narrow_ok;
+      char _M_narrow[128];
+      wint_t _M_widen[1 + static_cast<unsigned char>(-1)];
+
+
+      mask _M_bit[16];
+      __wmask_type _M_wmask[16];
+
+    public:
+
+
+      static locale::id id;
+      explicit
+      ctype(size_t __refs = 0);
+      explicit
+      ctype(__c_locale __cloc, size_t __refs = 0);
+
+    protected:
+      __wmask_type
+      _M_convert_to_wmask(const mask __m) const throw();
+
+
+      virtual
+      ~ctype();
+      virtual bool
+      do_is(mask __m, char_type __c) const;
+      virtual const char_type*
+      do_is(const char_type* __lo, const char_type* __hi, mask* __vec) const;
+      virtual const char_type*
+      do_scan_is(mask __m, const char_type* __lo, const char_type* __hi) const;
+      virtual const char_type*
+      do_scan_not(mask __m, const char_type* __lo,
+    const char_type* __hi) const;
+      virtual char_type
+      do_toupper(char_type __c) const;
+      virtual const char_type*
+      do_toupper(char_type* __lo, const char_type* __hi) const;
+      virtual char_type
+      do_tolower(char_type __c) const;
+      virtual const char_type*
+      do_tolower(char_type* __lo, const char_type* __hi) const;
+      virtual char_type
+      do_widen(char __c) const;
+      virtual const char*
+      do_widen(const char* __lo, const char* __hi, char_type* __to) const;
+      virtual char
+      do_narrow(char_type __c, char __dfault) const;
+      virtual const char_type*
+      do_narrow(const char_type* __lo, const char_type* __hi,
+  char __dfault, char* __to) const;
+
+
+      void
+      _M_initialize_ctype() throw();
+    };
+
+
+
+  template<typename _CharT>
+    class ctype_byname : public ctype<_CharT>
+    {
+    public:
+      typedef typename ctype<_CharT>::mask mask;
+
+      explicit
+      ctype_byname(const char* __s, size_t __refs = 0);
+
+
+      explicit
+      ctype_byname(const string& __s, size_t __refs = 0)
+      : ctype_byname(__s.c_str(), __refs) { }
+
+
+    protected:
+      virtual
+      ~ctype_byname() { }
+    };
+
+
+  template<>
+    class ctype_byname<char> : public ctype<char>
+    {
+    public:
+      explicit
+      ctype_byname(const char* __s, size_t __refs = 0);
+
+
+      explicit
+      ctype_byname(const string& __s, size_t __refs = 0);
+
+
+    protected:
+      virtual
+      ~ctype_byname();
+    };
+
+
+  template<>
+    class ctype_byname<wchar_t> : public ctype<wchar_t>
+    {
+    public:
+      explicit
+      ctype_byname(const char* __s, size_t __refs = 0);
+
+
+      explicit
+      ctype_byname(const string& __s, size_t __refs = 0);
+
+
+    protected:
+      virtual
+      ~ctype_byname();
+    };
+
+
+
+}
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+  bool
+  ctype<char>::
+  is(mask __m, char __c) const
+  { return _M_table[static_cast<unsigned char>(__c)] & __m; }
+
+  const char*
+  ctype<char>::
+  is(const char* __low, const char* __high, mask* __vec) const
+  {
+    while (__low < __high)
+      *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
+    return __high;
+  }
+
+  const char*
+  ctype<char>::
+  scan_is(mask __m, const char* __low, const char* __high) const
+  {
+    while (__low < __high
+    && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
+      ++__low;
+    return __low;
+  }
+
+  const char*
+  ctype<char>::
+  scan_not(mask __m, const char* __low, const char* __high) const
+  {
+    while (__low < __high
+    && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
+      ++__low;
+    return __low;
+  }
+
+
+}
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+  class __num_base
+  {
+  public:
+
+
+    enum
+      {
+ _S_ominus,
+ _S_oplus,
+ _S_ox,
+ _S_oX,
+ _S_odigits,
+ _S_odigits_end = _S_odigits + 16,
+ _S_oudigits = _S_odigits_end,
+ _S_oudigits_end = _S_oudigits + 16,
+ _S_oe = _S_odigits + 14,
+ _S_oE = _S_oudigits + 14,
+ _S_oend = _S_oudigits_end
+      };
+
+
+
+
+
+
+    static const char* _S_atoms_out;
+
+
+
+    static const char* _S_atoms_in;
+
+    enum
+    {
+      _S_iminus,
+      _S_iplus,
+      _S_ix,
+      _S_iX,
+      _S_izero,
+      _S_ie = _S_izero + 14,
+      _S_iE = _S_izero + 20,
+      _S_iend = 26
+    };
+
+
+
+    static void
+    _S_format_float(const ios_base& __io, char* __fptr, char __mod) throw();
+  };
+
+  template<typename _CharT>
+    struct __numpunct_cache : public locale::facet
+    {
+      const char* _M_grouping;
+      size_t _M_grouping_size;
+      bool _M_use_grouping;
+      const _CharT* _M_truename;
+      size_t _M_truename_size;
+      const _CharT* _M_falsename;
+      size_t _M_falsename_size;
+      _CharT _M_decimal_point;
+      _CharT _M_thousands_sep;
+
+
+
+
+
+      _CharT _M_atoms_out[__num_base::_S_oend];
+
+
+
+
+
+      _CharT _M_atoms_in[__num_base::_S_iend];
+
+      bool _M_allocated;
+
+      __numpunct_cache(size_t __refs = 0)
+      : facet(__refs), _M_grouping(0), _M_grouping_size(0),
+ _M_use_grouping(false),
+ _M_truename(0), _M_truename_size(0), _M_falsename(0),
+ _M_falsename_size(0), _M_decimal_point(_CharT()),
+ _M_thousands_sep(_CharT()), _M_allocated(false)
+ { }
+
+      ~__numpunct_cache();
+
+      void
+      _M_cache(const locale& __loc);
+
+    private:
+      __numpunct_cache&
+      operator=(const __numpunct_cache&);
+
+      explicit
+      __numpunct_cache(const __numpunct_cache&);
+    };
+
+  template<typename _CharT>
+    __numpunct_cache<_CharT>::~__numpunct_cache()
+    {
+      if (_M_allocated)
+ {
+   delete [] _M_grouping;
+   delete [] _M_truename;
+   delete [] _M_falsename;
+ }
+    }
+
+namespace __cxx11 {
+  template<typename _CharT>
+    class numpunct : public locale::facet
+    {
+    public:
+
+
+
+      typedef _CharT char_type;
+      typedef basic_string<_CharT> string_type;
+
+      typedef __numpunct_cache<_CharT> __cache_type;
+
+    protected:
+      __cache_type* _M_data;
+
+    public:
+
+      static locale::id id;
+
+
+
+
+
+
+      explicit
+      numpunct(size_t __refs = 0)
+      : facet(__refs), _M_data(0)
+      { _M_initialize_numpunct(); }
+      explicit
+      numpunct(__cache_type* __cache, size_t __refs = 0)
+      : facet(__refs), _M_data(__cache)
+      { _M_initialize_numpunct(); }
+      explicit
+      numpunct(__c_locale __cloc, size_t __refs = 0)
+      : facet(__refs), _M_data(0)
+      { _M_initialize_numpunct(__cloc); }
+      char_type
+      decimal_point() const
+      { return this->do_decimal_point(); }
+      char_type
+      thousands_sep() const
+      { return this->do_thousands_sep(); }
+      string
+      grouping() const
+      { return this->do_grouping(); }
+      string_type
+      truename() const
+      { return this->do_truename(); }
+      string_type
+      falsename() const
+      { return this->do_falsename(); }
+
+    protected:
+
+      virtual
+      ~numpunct();
+      virtual char_type
+      do_decimal_point() const
+      { return _M_data->_M_decimal_point; }
+      virtual char_type
+      do_thousands_sep() const
+      { return _M_data->_M_thousands_sep; }
+      virtual string
+      do_grouping() const
+      { return _M_data->_M_grouping; }
+      virtual string_type
+      do_truename() const
+      { return _M_data->_M_truename; }
+      virtual string_type
+      do_falsename() const
+      { return _M_data->_M_falsename; }
+
+
+      void
+      _M_initialize_numpunct(__c_locale __cloc = 0);
+    };
+
+  template<typename _CharT>
+    locale::id numpunct<_CharT>::id;
+
+  template<>
+    numpunct<char>::~numpunct();
+
+  template<>
+    void
+    numpunct<char>::_M_initialize_numpunct(__c_locale __cloc);
+
+
+  template<>
+    numpunct<wchar_t>::~numpunct();
+
+  template<>
+    void
+    numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc);
+
+
+
+  template<typename _CharT>
+    class numpunct_byname : public numpunct<_CharT>
+    {
+    public:
+      typedef _CharT char_type;
+      typedef basic_string<_CharT> string_type;
+
+      explicit
+      numpunct_byname(const char* __s, size_t __refs = 0)
+      : numpunct<_CharT>(__refs)
+      {
+ if (__builtin_strcmp(__s, "C") != 0
+     && __builtin_strcmp(__s, "POSIX") != 0)
+   {
+     __c_locale __tmp;
+     this->_S_create_c_locale(__tmp, __s);
+     this->_M_initialize_numpunct(__tmp);
+     this->_S_destroy_c_locale(__tmp);
+   }
+      }
+
+
+      explicit
+      numpunct_byname(const string& __s, size_t __refs = 0)
+      : numpunct_byname(__s.c_str(), __refs) { }
+
+
+    protected:
+      virtual
+      ~numpunct_byname() { }
+    };
+
+}
+
+namespace __gnu_cxx_ldbl128 {
+  template<typename _CharT, typename _InIter>
+    class num_get : public locale::facet
+    {
+    public:
+
+
+
+      typedef _CharT char_type;
+      typedef _InIter iter_type;
+
+
+
+      static locale::id id;
+      explicit
+      num_get(size_t __refs = 0) : facet(__refs) { }
+      iter_type
+      get(iter_type __in, iter_type __end, ios_base& __io,
+   ios_base::iostate& __err, bool& __v) const
+      { return this->do_get(__in, __end, __io, __err, __v); }
+      iter_type
+      get(iter_type __in, iter_type __end, ios_base& __io,
+   ios_base::iostate& __err, long& __v) const
+      { return this->do_get(__in, __end, __io, __err, __v); }
+
+      iter_type
+      get(iter_type __in, iter_type __end, ios_base& __io,
+   ios_base::iostate& __err, unsigned short& __v) const
+      { return this->do_get(__in, __end, __io, __err, __v); }
+
+      iter_type
+      get(iter_type __in, iter_type __end, ios_base& __io,
+   ios_base::iostate& __err, unsigned int& __v) const
+      { return this->do_get(__in, __end, __io, __err, __v); }
+
+      iter_type
+      get(iter_type __in, iter_type __end, ios_base& __io,
+   ios_base::iostate& __err, unsigned long& __v) const
+      { return this->do_get(__in, __end, __io, __err, __v); }
+
+
+      iter_type
+      get(iter_type __in, iter_type __end, ios_base& __io,
+   ios_base::iostate& __err, long long& __v) const
+      { return this->do_get(__in, __end, __io, __err, __v); }
+
+      iter_type
+      get(iter_type __in, iter_type __end, ios_base& __io,
+   ios_base::iostate& __err, unsigned long long& __v) const
+      { return this->do_get(__in, __end, __io, __err, __v); }
+      iter_type
+      get(iter_type __in, iter_type __end, ios_base& __io,
+   ios_base::iostate& __err, float& __v) const
+      { return this->do_get(__in, __end, __io, __err, __v); }
+
+      iter_type
+      get(iter_type __in, iter_type __end, ios_base& __io,
+   ios_base::iostate& __err, double& __v) const
+      { return this->do_get(__in, __end, __io, __err, __v); }
+
+      iter_type
+      get(iter_type __in, iter_type __end, ios_base& __io,
+   ios_base::iostate& __err, long double& __v) const
+      { return this->do_get(__in, __end, __io, __err, __v); }
+      iter_type
+      get(iter_type __in, iter_type __end, ios_base& __io,
+   ios_base::iostate& __err, void*& __v) const
+      { return this->do_get(__in, __end, __io, __err, __v); }
+
+    protected:
+
+      virtual ~num_get() { }
+
+      __attribute ((__abi_tag__ ("cxx11")))
+      iter_type
+      _M_extract_float(iter_type, iter_type, ios_base&, ios_base::iostate&,
+         string&) const;
+
+      template<typename _ValueT>
+ __attribute ((__abi_tag__ ("cxx11")))
+ iter_type
+ _M_extract_int(iter_type, iter_type, ios_base&, ios_base::iostate&,
+         _ValueT&) const;
+
+      template<typename _CharT2>
+      typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value, int>::__type
+ _M_find(const _CharT2*, size_t __len, _CharT2 __c) const
+ {
+   int __ret = -1;
+   if (__len <= 10)
+     {
+       if (__c >= _CharT2('0') && __c < _CharT2(_CharT2('0') + __len))
+  __ret = __c - _CharT2('0');
+     }
+   else
+     {
+       if (__c >= _CharT2('0') && __c <= _CharT2('9'))
+  __ret = __c - _CharT2('0');
+       else if (__c >= _CharT2('a') && __c <= _CharT2('f'))
+  __ret = 10 + (__c - _CharT2('a'));
+       else if (__c >= _CharT2('A') && __c <= _CharT2('F'))
+  __ret = 10 + (__c - _CharT2('A'));
+     }
+   return __ret;
+ }
+
+      template<typename _CharT2>
+      typename __gnu_cxx::__enable_if<!__is_char<_CharT2>::__value,
+          int>::__type
+ _M_find(const _CharT2* __zero, size_t __len, _CharT2 __c) const
+ {
+   int __ret = -1;
+   const char_type* __q = char_traits<_CharT2>::find(__zero, __len, __c);
+   if (__q)
+     {
+       __ret = __q - __zero;
+       if (__ret > 15)
+  __ret -= 6;
+     }
+   return __ret;
+ }
+      virtual iter_type
+      do_get(iter_type, iter_type, ios_base&, ios_base::iostate&, bool&) const;
+
+      virtual iter_type
+      do_get(iter_type __beg, iter_type __end, ios_base& __io,
+      ios_base::iostate& __err, long& __v) const
+      { return _M_extract_int(__beg, __end, __io, __err, __v); }
+
+      virtual iter_type
+      do_get(iter_type __beg, iter_type __end, ios_base& __io,
+      ios_base::iostate& __err, unsigned short& __v) const
+      { return _M_extract_int(__beg, __end, __io, __err, __v); }
+
+      virtual iter_type
+      do_get(iter_type __beg, iter_type __end, ios_base& __io,
+      ios_base::iostate& __err, unsigned int& __v) const
+      { return _M_extract_int(__beg, __end, __io, __err, __v); }
+
+      virtual iter_type
+      do_get(iter_type __beg, iter_type __end, ios_base& __io,
+      ios_base::iostate& __err, unsigned long& __v) const
+      { return _M_extract_int(__beg, __end, __io, __err, __v); }
+
+
+      virtual iter_type
+      do_get(iter_type __beg, iter_type __end, ios_base& __io,
+      ios_base::iostate& __err, long long& __v) const
+      { return _M_extract_int(__beg, __end, __io, __err, __v); }
+
+      virtual iter_type
+      do_get(iter_type __beg, iter_type __end, ios_base& __io,
+      ios_base::iostate& __err, unsigned long long& __v) const
+      { return _M_extract_int(__beg, __end, __io, __err, __v); }
+
+
+      virtual iter_type
+      do_get(iter_type, iter_type, ios_base&, ios_base::iostate&, float&) const;
+
+      virtual iter_type
+      do_get(iter_type, iter_type, ios_base&, ios_base::iostate&,
+      double&) const;
+
+
+
+      virtual iter_type
+      __do_get(iter_type, iter_type, ios_base&, ios_base::iostate&,
+        double&) const;
+
+
+
+
+
+
+      virtual iter_type
+      do_get(iter_type, iter_type, ios_base&, ios_base::iostate&, void*&) const;
+
+
+
+      virtual iter_type
+      do_get(iter_type, iter_type, ios_base&, ios_base::iostate&,
+      long double&) const;
+
+
+    };
+
+  template<typename _CharT, typename _InIter>
+    locale::id num_get<_CharT, _InIter>::id;
+  template<typename _CharT, typename _OutIter>
+    class num_put : public locale::facet
+    {
+    public:
+
+
+
+      typedef _CharT char_type;
+      typedef _OutIter iter_type;
+
+
+
+      static locale::id id;
+      explicit
+      num_put(size_t __refs = 0) : facet(__refs) { }
+      iter_type
+      put(iter_type __s, ios_base& __io, char_type __fill, bool __v) const
+      { return this->do_put(__s, __io, __fill, __v); }
+      iter_type
+      put(iter_type __s, ios_base& __io, char_type __fill, long __v) const
+      { return this->do_put(__s, __io, __fill, __v); }
+
+      iter_type
+      put(iter_type __s, ios_base& __io, char_type __fill,
+   unsigned long __v) const
+      { return this->do_put(__s, __io, __fill, __v); }
+
+
+      iter_type
+      put(iter_type __s, ios_base& __io, char_type __fill, long long __v) const
+      { return this->do_put(__s, __io, __fill, __v); }
+
+      iter_type
+      put(iter_type __s, ios_base& __io, char_type __fill,
+   unsigned long long __v) const
+      { return this->do_put(__s, __io, __fill, __v); }
+      iter_type
+      put(iter_type __s, ios_base& __io, char_type __fill, double __v) const
+      { return this->do_put(__s, __io, __fill, __v); }
+
+      iter_type
+      put(iter_type __s, ios_base& __io, char_type __fill,
+   long double __v) const
+      { return this->do_put(__s, __io, __fill, __v); }
+      iter_type
+      put(iter_type __s, ios_base& __io, char_type __fill,
+   const void* __v) const
+      { return this->do_put(__s, __io, __fill, __v); }
+
+    protected:
+      template<typename _ValueT>
+ iter_type
+ _M_insert_float(iter_type, ios_base& __io, char_type __fill,
+   char __mod, _ValueT __v) const;
+
+      void
+      _M_group_float(const char* __grouping, size_t __grouping_size,
+       char_type __sep, const char_type* __p, char_type* __new,
+       char_type* __cs, int& __len) const;
+
+      template<typename _ValueT>
+ iter_type
+ _M_insert_int(iter_type, ios_base& __io, char_type __fill,
+        _ValueT __v) const;
+
+      void
+      _M_group_int(const char* __grouping, size_t __grouping_size,
+     char_type __sep, ios_base& __io, char_type* __new,
+     char_type* __cs, int& __len) const;
+
+      void
+      _M_pad(char_type __fill, streamsize __w, ios_base& __io,
+      char_type* __new, const char_type* __cs, int& __len) const;
+
+
+      virtual
+      ~num_put() { }
+      virtual iter_type
+      do_put(iter_type __s, ios_base& __io, char_type __fill, bool __v) const;
+
+      virtual iter_type
+      do_put(iter_type __s, ios_base& __io, char_type __fill, long __v) const
+      { return _M_insert_int(__s, __io, __fill, __v); }
+
+      virtual iter_type
+      do_put(iter_type __s, ios_base& __io, char_type __fill,
+      unsigned long __v) const
+      { return _M_insert_int(__s, __io, __fill, __v); }
+
+
+      virtual iter_type
+      do_put(iter_type __s, ios_base& __io, char_type __fill,
+      long long __v) const
+      { return _M_insert_int(__s, __io, __fill, __v); }
+
+      virtual iter_type
+      do_put(iter_type __s, ios_base& __io, char_type __fill,
+      unsigned long long __v) const
+      { return _M_insert_int(__s, __io, __fill, __v); }
+
+
+      virtual iter_type
+      do_put(iter_type, ios_base&, char_type, double) const;
+
+
+
+      virtual iter_type
+      __do_put(iter_type, ios_base&, char_type, double) const;
+
+
+
+
+
+      virtual iter_type
+      do_put(iter_type, ios_base&, char_type, const void*) const;
+
+
+
+      virtual iter_type
+      do_put(iter_type, ios_base&, char_type, long double) const;
+
+
+    };
+
+  template <typename _CharT, typename _OutIter>
+    locale::id num_put<_CharT, _OutIter>::id;
+
+}
+
+
+
+
+
+
+
+  template<typename _CharT>
+    inline bool
+    isspace(_CharT __c, const locale& __loc)
+    { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::space, __c); }
+
+
+  template<typename _CharT>
+    inline bool
+    isprint(_CharT __c, const locale& __loc)
+    { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::print, __c); }
+
+
+  template<typename _CharT>
+    inline bool
+    iscntrl(_CharT __c, const locale& __loc)
+    { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::cntrl, __c); }
+
+
+  template<typename _CharT>
+    inline bool
+    isupper(_CharT __c, const locale& __loc)
+    { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::upper, __c); }
+
+
+  template<typename _CharT>
+    inline bool
+    islower(_CharT __c, const locale& __loc)
+    { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::lower, __c); }
+
+
+  template<typename _CharT>
+    inline bool
+    isalpha(_CharT __c, const locale& __loc)
+    { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::alpha, __c); }
+
+
+  template<typename _CharT>
+    inline bool
+    isdigit(_CharT __c, const locale& __loc)
+    { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::digit, __c); }
+
+
+  template<typename _CharT>
+    inline bool
+    ispunct(_CharT __c, const locale& __loc)
+    { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::punct, __c); }
+
+
+  template<typename _CharT>
+    inline bool
+    isxdigit(_CharT __c, const locale& __loc)
+    { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::xdigit, __c); }
+
+
+  template<typename _CharT>
+    inline bool
+    isalnum(_CharT __c, const locale& __loc)
+    { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::alnum, __c); }
+
+
+  template<typename _CharT>
+    inline bool
+    isgraph(_CharT __c, const locale& __loc)
+    { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::graph, __c); }
+
+
+
+  template<typename _CharT>
+    inline bool
+    isblank(_CharT __c, const locale& __loc)
+    { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::blank, __c); }
+
+
+
+  template<typename _CharT>
+    inline _CharT
+    toupper(_CharT __c, const locale& __loc)
+    { return use_facet<ctype<_CharT> >(__loc).toupper(__c); }
+
+
+  template<typename _CharT>
+    inline _CharT
+    tolower(_CharT __c, const locale& __loc)
+    { return use_facet<ctype<_CharT> >(__loc).tolower(__c); }
+
+
+}
+
+       
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+
+  template<typename _Facet>
+    struct __use_cache
+    {
+      const _Facet*
+      operator() (const locale& __loc) const;
+    };
+
+
+  template<typename _CharT>
+    struct __use_cache<__numpunct_cache<_CharT> >
+    {
+      const __numpunct_cache<_CharT>*
+      operator() (const locale& __loc) const
+      {
+ const size_t __i = numpunct<_CharT>::id._M_id();
+ const locale::facet** __caches = __loc._M_impl->_M_caches;
+ if (!__caches[__i])
+   {
+     __numpunct_cache<_CharT>* __tmp = 0;
+     if (true)
+       {
+  __tmp = new __numpunct_cache<_CharT>;
+  __tmp->_M_cache(__loc);
+       }
+     if (false)
+       {
+  delete __tmp;
+  ;
+       }
+     __loc._M_impl->_M_install_cache(__tmp, __i);
+   }
+ return static_cast<const __numpunct_cache<_CharT>*>(__caches[__i]);
+      }
+    };
+
+  template<typename _CharT>
+    void
+    __numpunct_cache<_CharT>::_M_cache(const locale& __loc)
+    {
+      const numpunct<_CharT>& __np = use_facet<numpunct<_CharT> >(__loc);
+
+      char* __grouping = 0;
+      _CharT* __truename = 0;
+      _CharT* __falsename = 0;
+      if (true)
+ {
+   const string& __g = __np.grouping();
+   _M_grouping_size = __g.size();
+   __grouping = new char[_M_grouping_size];
+   __g.copy(__grouping, _M_grouping_size);
+   _M_use_grouping = (_M_grouping_size
+        && static_cast<signed char>(__grouping[0]) > 0
+        && (__grouping[0]
+     != __gnu_cxx::__numeric_traits<char>::__max));
+
+   const basic_string<_CharT>& __tn = __np.truename();
+   _M_truename_size = __tn.size();
+   __truename = new _CharT[_M_truename_size];
+   __tn.copy(__truename, _M_truename_size);
+
+   const basic_string<_CharT>& __fn = __np.falsename();
+   _M_falsename_size = __fn.size();
+   __falsename = new _CharT[_M_falsename_size];
+   __fn.copy(__falsename, _M_falsename_size);
+
+   _M_decimal_point = __np.decimal_point();
+   _M_thousands_sep = __np.thousands_sep();
+
+   const ctype<_CharT>& __ct = use_facet<ctype<_CharT> >(__loc);
+   __ct.widen(__num_base::_S_atoms_out,
+       __num_base::_S_atoms_out
+       + __num_base::_S_oend, _M_atoms_out);
+   __ct.widen(__num_base::_S_atoms_in,
+       __num_base::_S_atoms_in
+       + __num_base::_S_iend, _M_atoms_in);
+
+   _M_grouping = __grouping;
+   _M_truename = __truename;
+   _M_falsename = __falsename;
+   _M_allocated = true;
+ }
+      if (false)
+ {
+   delete [] __grouping;
+   delete [] __truename;
+   delete [] __falsename;
+   ;
+ }
+    }
+  __attribute__ ((__pure__)) bool
+  __verify_grouping(const char* __grouping, size_t __grouping_size,
+      const string& __grouping_tmp) throw ();
+
+namespace __gnu_cxx_ldbl128 {
+
+  template<typename _CharT, typename _InIter>
+    __attribute ((__abi_tag__ ("cxx11")))
+    _InIter
+    num_get<_CharT, _InIter>::
+    _M_extract_float(_InIter __beg, _InIter __end, ios_base& __io,
+       ios_base::iostate& __err, string& __xtrc) const
+    {
+      typedef char_traits<_CharT> __traits_type;
+      typedef __numpunct_cache<_CharT> __cache_type;
+      __use_cache<__cache_type> __uc;
+      const locale& __loc = __io._M_getloc();
+      const __cache_type* __lc = __uc(__loc);
+      const _CharT* __lit = __lc->_M_atoms_in;
+      char_type __c = char_type();
+
+
+      bool __testeof = __beg == __end;
+
+
+      if (!__testeof)
+ {
+   __c = *__beg;
+   const bool __plus = __c == __lit[__num_base::_S_iplus];
+   if ((__plus || __c == __lit[__num_base::_S_iminus])
+       && !(__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
+       && !(__c == __lc->_M_decimal_point))
+     {
+       __xtrc += __plus ? '+' : '-';
+       if (++__beg != __end)
+  __c = *__beg;
+       else
+  __testeof = true;
+     }
+ }
+
+
+      bool __found_mantissa = false;
+      int __sep_pos = 0;
+      while (!__testeof)
+ {
+   if ((__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
+       || __c == __lc->_M_decimal_point)
+     break;
+   else if (__c == __lit[__num_base::_S_izero])
+     {
+       if (!__found_mantissa)
+  {
+    __xtrc += '0';
+    __found_mantissa = true;
+  }
+       ++__sep_pos;
+
+       if (++__beg != __end)
+  __c = *__beg;
+       else
+  __testeof = true;
+     }
+   else
+     break;
+ }
+
+
+      bool __found_dec = false;
+      bool __found_sci = false;
+      string __found_grouping;
+      if (__lc->_M_use_grouping)
+ __found_grouping.reserve(32);
+      const char_type* __lit_zero = __lit + __num_base::_S_izero;
+
+      if (!__lc->_M_allocated)
+
+ while (!__testeof)
+   {
+     const int __digit = _M_find(__lit_zero, 10, __c);
+     if (__digit != -1)
+       {
+  __xtrc += '0' + __digit;
+  __found_mantissa = true;
+       }
+     else if (__c == __lc->_M_decimal_point
+       && !__found_dec && !__found_sci)
+       {
+  __xtrc += '.';
+  __found_dec = true;
+       }
+     else if ((__c == __lit[__num_base::_S_ie]
+        || __c == __lit[__num_base::_S_iE])
+       && !__found_sci && __found_mantissa)
+       {
+
+  __xtrc += 'e';
+  __found_sci = true;
+
+
+  if (++__beg != __end)
+    {
+      __c = *__beg;
+      const bool __plus = __c == __lit[__num_base::_S_iplus];
+      if (__plus || __c == __lit[__num_base::_S_iminus])
+        __xtrc += __plus ? '+' : '-';
+      else
+        continue;
+    }
+  else
+    {
+      __testeof = true;
+      break;
+    }
+       }
+     else
+       break;
+
+     if (++__beg != __end)
+       __c = *__beg;
+     else
+       __testeof = true;
+   }
+      else
+ while (!__testeof)
+   {
+
+
+     if (__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
+       {
+  if (!__found_dec && !__found_sci)
+    {
+
+
+      if (__sep_pos)
+        {
+   __found_grouping += static_cast<char>(__sep_pos);
+   __sep_pos = 0;
+        }
+      else
+        {
+
+
+   __xtrc.clear();
+   break;
+        }
+    }
+  else
+    break;
+       }
+     else if (__c == __lc->_M_decimal_point)
+       {
+  if (!__found_dec && !__found_sci)
+    {
+
+
+
+      if (__found_grouping.size())
+        __found_grouping += static_cast<char>(__sep_pos);
+      __xtrc += '.';
+      __found_dec = true;
+    }
+  else
+    break;
+       }
+     else
+       {
+  const char_type* __q =
+    __traits_type::find(__lit_zero, 10, __c);
+  if (__q)
+    {
+      __xtrc += '0' + (__q - __lit_zero);
+      __found_mantissa = true;
+      ++__sep_pos;
+    }
+  else if ((__c == __lit[__num_base::_S_ie]
+     || __c == __lit[__num_base::_S_iE])
+    && !__found_sci && __found_mantissa)
+    {
+
+      if (__found_grouping.size() && !__found_dec)
+        __found_grouping += static_cast<char>(__sep_pos);
+      __xtrc += 'e';
+      __found_sci = true;
+
+
+      if (++__beg != __end)
+        {
+   __c = *__beg;
+   const bool __plus = __c == __lit[__num_base::_S_iplus];
+   if ((__plus || __c == __lit[__num_base::_S_iminus])
+       && !(__lc->_M_use_grouping
+     && __c == __lc->_M_thousands_sep)
+       && !(__c == __lc->_M_decimal_point))
+        __xtrc += __plus ? '+' : '-';
+   else
+     continue;
+        }
+      else
+        {
+   __testeof = true;
+   break;
+        }
+    }
+  else
+    break;
+       }
+
+     if (++__beg != __end)
+       __c = *__beg;
+     else
+       __testeof = true;
+   }
+
+
+
+      if (__found_grouping.size())
+        {
+
+   if (!__found_dec && !__found_sci)
+     __found_grouping += static_cast<char>(__sep_pos);
+
+          if (!std::__verify_grouping(__lc->_M_grouping,
+          __lc->_M_grouping_size,
+          __found_grouping))
+     __err = ios_base::failbit;
+        }
+
+      return __beg;
+    }
+
+  template<typename _CharT, typename _InIter>
+    template<typename _ValueT>
+      __attribute ((__abi_tag__ ("cxx11")))
+      _InIter
+      num_get<_CharT, _InIter>::
+      _M_extract_int(_InIter __beg, _InIter __end, ios_base& __io,
+       ios_base::iostate& __err, _ValueT& __v) const
+      {
+        typedef char_traits<_CharT> __traits_type;
+ using __gnu_cxx::__add_unsigned;
+ typedef typename __add_unsigned<_ValueT>::__type __unsigned_type;
+ typedef __numpunct_cache<_CharT> __cache_type;
+ __use_cache<__cache_type> __uc;
+ const locale& __loc = __io._M_getloc();
+ const __cache_type* __lc = __uc(__loc);
+ const _CharT* __lit = __lc->_M_atoms_in;
+ char_type __c = char_type();
+
+
+ const ios_base::fmtflags __basefield = __io.flags()
+                                        & ios_base::basefield;
+ const bool __oct = __basefield == ios_base::oct;
+ int __base = __oct ? 8 : (__basefield == ios_base::hex ? 16 : 10);
+
+
+ bool __testeof = __beg == __end;
+
+
+ bool __negative = false;
+ if (!__testeof)
+   {
+     __c = *__beg;
+     __negative = __c == __lit[__num_base::_S_iminus];
+     if ((__negative || __c == __lit[__num_base::_S_iplus])
+  && !(__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
+  && !(__c == __lc->_M_decimal_point))
+       {
+  if (++__beg != __end)
+    __c = *__beg;
+  else
+    __testeof = true;
+       }
+   }
+
+
+
+ bool __found_zero = false;
+ int __sep_pos = 0;
+ while (!__testeof)
+   {
+     if ((__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
+  || __c == __lc->_M_decimal_point)
+       break;
+     else if (__c == __lit[__num_base::_S_izero]
+       && (!__found_zero || __base == 10))
+       {
+  __found_zero = true;
+  ++__sep_pos;
+  if (__basefield == 0)
+    __base = 8;
+  if (__base == 8)
+    __sep_pos = 0;
+       }
+     else if (__found_zero
+       && (__c == __lit[__num_base::_S_ix]
+    || __c == __lit[__num_base::_S_iX]))
+       {
+  if (__basefield == 0)
+    __base = 16;
+  if (__base == 16)
+    {
+      __found_zero = false;
+      __sep_pos = 0;
+    }
+  else
+    break;
+       }
+     else
+       break;
+
+     if (++__beg != __end)
+       {
+  __c = *__beg;
+  if (!__found_zero)
+    break;
+       }
+     else
+       __testeof = true;
+   }
+
+
+
+ const size_t __len = (__base == 16 ? __num_base::_S_iend
+         - __num_base::_S_izero : __base);
+
+
+ typedef __gnu_cxx::__numeric_traits<_ValueT> __num_traits;
+ string __found_grouping;
+ if (__lc->_M_use_grouping)
+   __found_grouping.reserve(32);
+ bool __testfail = false;
+ bool __testoverflow = false;
+ const __unsigned_type __max =
+   (__negative && __num_traits::__is_signed)
+   ? -static_cast<__unsigned_type>(__num_traits::__min)
+   : __num_traits::__max;
+ const __unsigned_type __smax = __max / __base;
+ __unsigned_type __result = 0;
+ int __digit = 0;
+ const char_type* __lit_zero = __lit + __num_base::_S_izero;
+
+ if (!__lc->_M_allocated)
+
+   while (!__testeof)
+     {
+       __digit = _M_find(__lit_zero, __len, __c);
+       if (__digit == -1)
+  break;
+
+       if (__result > __smax)
+  __testoverflow = true;
+       else
+  {
+    __result *= __base;
+    __testoverflow |= __result > __max - __digit;
+    __result += __digit;
+    ++__sep_pos;
+  }
+
+       if (++__beg != __end)
+  __c = *__beg;
+       else
+  __testeof = true;
+     }
+ else
+   while (!__testeof)
+     {
+
+
+       if (__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
+  {
+
+
+    if (__sep_pos)
+      {
+        __found_grouping += static_cast<char>(__sep_pos);
+        __sep_pos = 0;
+      }
+    else
+      {
+        __testfail = true;
+        break;
+      }
+  }
+       else if (__c == __lc->_M_decimal_point)
+  break;
+       else
+  {
+    const char_type* __q =
+      __traits_type::find(__lit_zero, __len, __c);
+    if (!__q)
+      break;
+
+    __digit = __q - __lit_zero;
+    if (__digit > 15)
+      __digit -= 6;
+    if (__result > __smax)
+      __testoverflow = true;
+    else
+      {
+        __result *= __base;
+        __testoverflow |= __result > __max - __digit;
+        __result += __digit;
+        ++__sep_pos;
+      }
+  }
+
+       if (++__beg != __end)
+  __c = *__beg;
+       else
+  __testeof = true;
+     }
+
+
+
+ if (__found_grouping.size())
+   {
+
+     __found_grouping += static_cast<char>(__sep_pos);
+
+     if (!std::__verify_grouping(__lc->_M_grouping,
+     __lc->_M_grouping_size,
+     __found_grouping))
+       __err = ios_base::failbit;
+   }
+
+
+
+ if ((!__sep_pos && !__found_zero && !__found_grouping.size())
+     || __testfail)
+   {
+     __v = 0;
+     __err = ios_base::failbit;
+   }
+ else if (__testoverflow)
+   {
+     if (__negative && __num_traits::__is_signed)
+       __v = __num_traits::__min;
+     else
+       __v = __num_traits::__max;
+     __err = ios_base::failbit;
+   }
+ else
+   __v = __negative ? -__result : __result;
+
+ if (__testeof)
+   __err |= ios_base::eofbit;
+ return __beg;
+      }
+
+
+
+  template<typename _CharT, typename _InIter>
+    _InIter
+    num_get<_CharT, _InIter>::
+    do_get(iter_type __beg, iter_type __end, ios_base& __io,
+           ios_base::iostate& __err, bool& __v) const
+    {
+      if (!(__io.flags() & ios_base::boolalpha))
+        {
+
+
+
+   long __l = -1;
+          __beg = _M_extract_int(__beg, __end, __io, __err, __l);
+   if (__l == 0 || __l == 1)
+     __v = bool(__l);
+   else
+     {
+
+
+       __v = true;
+       __err = ios_base::failbit;
+       if (__beg == __end)
+  __err |= ios_base::eofbit;
+     }
+        }
+      else
+        {
+
+   typedef __numpunct_cache<_CharT> __cache_type;
+   __use_cache<__cache_type> __uc;
+   const locale& __loc = __io._M_getloc();
+   const __cache_type* __lc = __uc(__loc);
+
+   bool __testf = true;
+   bool __testt = true;
+   bool __donef = __lc->_M_falsename_size == 0;
+   bool __donet = __lc->_M_truename_size == 0;
+   bool __testeof = false;
+   size_t __n = 0;
+   while (!__donef || !__donet)
+     {
+       if (__beg == __end)
+  {
+    __testeof = true;
+    break;
+  }
+
+       const char_type __c = *__beg;
+
+       if (!__donef)
+  __testf = __c == __lc->_M_falsename[__n];
+
+       if (!__testf && __donet)
+  break;
+
+       if (!__donet)
+  __testt = __c == __lc->_M_truename[__n];
+
+       if (!__testt && __donef)
+  break;
+
+       if (!__testt && !__testf)
+  break;
+
+       ++__n;
+       ++__beg;
+
+       __donef = !__testf || __n >= __lc->_M_falsename_size;
+       __donet = !__testt || __n >= __lc->_M_truename_size;
+     }
+   if (__testf && __n == __lc->_M_falsename_size && __n)
+     {
+       __v = false;
+       if (__testt && __n == __lc->_M_truename_size)
+  __err = ios_base::failbit;
+       else
+  __err = __testeof ? ios_base::eofbit : ios_base::goodbit;
+     }
+   else if (__testt && __n == __lc->_M_truename_size && __n)
+     {
+       __v = true;
+       __err = __testeof ? ios_base::eofbit : ios_base::goodbit;
+     }
+   else
+     {
+
+
+       __v = false;
+       __err = ios_base::failbit;
+       if (__testeof)
+  __err |= ios_base::eofbit;
+     }
+ }
+      return __beg;
+    }
+
+  template<typename _CharT, typename _InIter>
+    _InIter
+    num_get<_CharT, _InIter>::
+    do_get(iter_type __beg, iter_type __end, ios_base& __io,
+    ios_base::iostate& __err, float& __v) const
+    {
+      string __xtrc;
+      __xtrc.reserve(32);
+      __beg = _M_extract_float(__beg, __end, __io, __err, __xtrc);
+      std::__convert_to_v(__xtrc.c_str(), __v, __err, _S_get_c_locale());
+      if (__beg == __end)
+ __err |= ios_base::eofbit;
+      return __beg;
+    }
+
+  template<typename _CharT, typename _InIter>
+    _InIter
+    num_get<_CharT, _InIter>::
+    do_get(iter_type __beg, iter_type __end, ios_base& __io,
+           ios_base::iostate& __err, double& __v) const
+    {
+      string __xtrc;
+      __xtrc.reserve(32);
+      __beg = _M_extract_float(__beg, __end, __io, __err, __xtrc);
+      std::__convert_to_v(__xtrc.c_str(), __v, __err, _S_get_c_locale());
+      if (__beg == __end)
+ __err |= ios_base::eofbit;
+      return __beg;
+    }
+
+
+  template<typename _CharT, typename _InIter>
+    _InIter
+    num_get<_CharT, _InIter>::
+    __do_get(iter_type __beg, iter_type __end, ios_base& __io,
+      ios_base::iostate& __err, double& __v) const
+    {
+      string __xtrc;
+      __xtrc.reserve(32);
+      __beg = _M_extract_float(__beg, __end, __io, __err, __xtrc);
+      std::__convert_to_v(__xtrc.c_str(), __v, __err, _S_get_c_locale());
+      if (__beg == __end)
+ __err |= ios_base::eofbit;
+      return __beg;
+    }
+
+
+  template<typename _CharT, typename _InIter>
+    _InIter
+    num_get<_CharT, _InIter>::
+    do_get(iter_type __beg, iter_type __end, ios_base& __io,
+           ios_base::iostate& __err, long double& __v) const
+    {
+      string __xtrc;
+      __xtrc.reserve(32);
+      __beg = _M_extract_float(__beg, __end, __io, __err, __xtrc);
+      std::__convert_to_v(__xtrc.c_str(), __v, __err, _S_get_c_locale());
+      if (__beg == __end)
+ __err |= ios_base::eofbit;
+      return __beg;
+    }
+
+  template<typename _CharT, typename _InIter>
+    _InIter
+    num_get<_CharT, _InIter>::
+    do_get(iter_type __beg, iter_type __end, ios_base& __io,
+           ios_base::iostate& __err, void*& __v) const
+    {
+
+      typedef ios_base::fmtflags fmtflags;
+      const fmtflags __fmt = __io.flags();
+      __io.flags((__fmt & ~ios_base::basefield) | ios_base::hex);
+
+      typedef __gnu_cxx::__conditional_type<(sizeof(void*)
+          <= sizeof(unsigned long)),
+ unsigned long, unsigned long long>::__type _UIntPtrType;
+
+      _UIntPtrType __ul;
+      __beg = _M_extract_int(__beg, __end, __io, __err, __ul);
+
+
+      __io.flags(__fmt);
+
+      __v = reinterpret_cast<void*>(__ul);
+      return __beg;
+    }
+
+
+
+  template<typename _CharT, typename _OutIter>
+    void
+    num_put<_CharT, _OutIter>::
+    _M_pad(_CharT __fill, streamsize __w, ios_base& __io,
+    _CharT* __new, const _CharT* __cs, int& __len) const
+    {
+
+
+      __pad<_CharT, char_traits<_CharT> >::_S_pad(__io, __fill, __new,
+        __cs, __w, __len);
+      __len = static_cast<int>(__w);
+    }
+
+}
+
+  template<typename _CharT, typename _ValueT>
+    int
+    __int_to_char(_CharT* __bufend, _ValueT __v, const _CharT* __lit,
+    ios_base::fmtflags __flags, bool __dec)
+    {
+      _CharT* __buf = __bufend;
+      if (__builtin_expect(__dec, true))
+ {
+
+   do
+     {
+       *--__buf = __lit[(__v % 10) + __num_base::_S_odigits];
+       __v /= 10;
+     }
+   while (__v != 0);
+ }
+      else if ((__flags & ios_base::basefield) == ios_base::oct)
+ {
+
+   do
+     {
+       *--__buf = __lit[(__v & 0x7) + __num_base::_S_odigits];
+       __v >>= 3;
+     }
+   while (__v != 0);
+ }
+      else
+ {
+
+   const bool __uppercase = __flags & ios_base::uppercase;
+   const int __case_offset = __uppercase ? __num_base::_S_oudigits
+                                         : __num_base::_S_odigits;
+   do
+     {
+       *--__buf = __lit[(__v & 0xf) + __case_offset];
+       __v >>= 4;
+     }
+   while (__v != 0);
+ }
+      return __bufend - __buf;
+    }
+
+namespace __gnu_cxx_ldbl128 {
+
+  template<typename _CharT, typename _OutIter>
+    void
+    num_put<_CharT, _OutIter>::
+    _M_group_int(const char* __grouping, size_t __grouping_size, _CharT __sep,
+   ios_base&, _CharT* __new, _CharT* __cs, int& __len) const
+    {
+      _CharT* __p = std::__add_grouping(__new, __sep, __grouping,
+     __grouping_size, __cs, __cs + __len);
+      __len = __p - __new;
+    }
+
+  template<typename _CharT, typename _OutIter>
+    template<typename _ValueT>
+      _OutIter
+      num_put<_CharT, _OutIter>::
+      _M_insert_int(_OutIter __s, ios_base& __io, _CharT __fill,
+      _ValueT __v) const
+      {
+ using __gnu_cxx::__add_unsigned;
+ typedef typename __add_unsigned<_ValueT>::__type __unsigned_type;
+ typedef __numpunct_cache<_CharT> __cache_type;
+ __use_cache<__cache_type> __uc;
+ const locale& __loc = __io._M_getloc();
+ const __cache_type* __lc = __uc(__loc);
+ const _CharT* __lit = __lc->_M_atoms_out;
+ const ios_base::fmtflags __flags = __io.flags();
+
+
+ const int __ilen = 5 * sizeof(_ValueT);
+ _CharT* __cs = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+            * __ilen));
+
+
+
+ const ios_base::fmtflags __basefield = __flags & ios_base::basefield;
+ const bool __dec = (__basefield != ios_base::oct
+       && __basefield != ios_base::hex);
+ const __unsigned_type __u = ((__v > 0 || !__dec)
+         ? __unsigned_type(__v)
+         : -__unsigned_type(__v));
+  int __len = __int_to_char(__cs + __ilen, __u, __lit, __flags, __dec);
+ __cs += __ilen - __len;
+
+
+ if (__lc->_M_use_grouping)
+   {
+
+
+     _CharT* __cs2 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+          * (__len + 1)
+          * 2));
+     _M_group_int(__lc->_M_grouping, __lc->_M_grouping_size,
+    __lc->_M_thousands_sep, __io, __cs2 + 2, __cs, __len);
+     __cs = __cs2 + 2;
+   }
+
+
+ if (__builtin_expect(__dec, true))
+   {
+
+     if (__v >= 0)
+       {
+  if (bool(__flags & ios_base::showpos)
+      && __gnu_cxx::__numeric_traits<_ValueT>::__is_signed)
+    *--__cs = __lit[__num_base::_S_oplus], ++__len;
+       }
+     else
+       *--__cs = __lit[__num_base::_S_ominus], ++__len;
+   }
+ else if (bool(__flags & ios_base::showbase) && __v)
+   {
+     if (__basefield == ios_base::oct)
+       *--__cs = __lit[__num_base::_S_odigits], ++__len;
+     else
+       {
+
+  const bool __uppercase = __flags & ios_base::uppercase;
+  *--__cs = __lit[__num_base::_S_ox + __uppercase];
+
+  *--__cs = __lit[__num_base::_S_odigits];
+  __len += 2;
+       }
+   }
+
+
+ const streamsize __w = __io.width();
+ if (__w > static_cast<streamsize>(__len))
+   {
+     _CharT* __cs3 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+          * __w));
+     _M_pad(__fill, __w, __io, __cs3, __cs, __len);
+     __cs = __cs3;
+   }
+ __io.width(0);
+
+
+
+ return std::__write(__s, __cs, __len);
+      }
+
+  template<typename _CharT, typename _OutIter>
+    void
+    num_put<_CharT, _OutIter>::
+    _M_group_float(const char* __grouping, size_t __grouping_size,
+     _CharT __sep, const _CharT* __p, _CharT* __new,
+     _CharT* __cs, int& __len) const
+    {
+
+
+
+      const int __declen = __p ? __p - __cs : __len;
+      _CharT* __p2 = std::__add_grouping(__new, __sep, __grouping,
+      __grouping_size,
+      __cs, __cs + __declen);
+
+
+      int __newlen = __p2 - __new;
+      if (__p)
+ {
+   char_traits<_CharT>::copy(__p2, __p, __len - __declen);
+   __newlen += __len - __declen;
+ }
+      __len = __newlen;
+    }
+  template<typename _CharT, typename _OutIter>
+    template<typename _ValueT>
+      _OutIter
+      num_put<_CharT, _OutIter>::
+      _M_insert_float(_OutIter __s, ios_base& __io, _CharT __fill, char __mod,
+         _ValueT __v) const
+      {
+ typedef __numpunct_cache<_CharT> __cache_type;
+ __use_cache<__cache_type> __uc;
+ const locale& __loc = __io._M_getloc();
+ const __cache_type* __lc = __uc(__loc);
+
+
+ const streamsize __prec = __io.precision() < 0 ? 6 : __io.precision();
+
+ const int __max_digits =
+   __gnu_cxx::__numeric_traits<_ValueT>::__digits10;
+
+
+ int __len;
+
+ char __fbuf[16];
+ __num_base::_S_format_float(__io, __fbuf, __mod);
+
+
+
+ const bool __use_prec =
+   (__io.flags() & ios_base::floatfield) != ios_base::floatfield;
+
+
+
+ int __cs_size = __max_digits * 3;
+ char* __cs = static_cast<char*>(__builtin_alloca(__cs_size));
+ if (__use_prec)
+   __len = std::__convert_from_v(_S_get_c_locale(), __cs, __cs_size,
+     __fbuf, __prec, __v);
+ else
+   __len = std::__convert_from_v(_S_get_c_locale(), __cs, __cs_size,
+     __fbuf, __v);
+
+
+ if (__len >= __cs_size)
+   {
+     __cs_size = __len + 1;
+     __cs = static_cast<char*>(__builtin_alloca(__cs_size));
+     if (__use_prec)
+       __len = std::__convert_from_v(_S_get_c_locale(), __cs, __cs_size,
+         __fbuf, __prec, __v);
+     else
+       __len = std::__convert_from_v(_S_get_c_locale(), __cs, __cs_size,
+         __fbuf, __v);
+   }
+ const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
+
+ _CharT* __ws = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+            * __len));
+ __ctype.widen(__cs, __cs + __len, __ws);
+
+
+ _CharT* __wp = 0;
+ const char* __p = char_traits<char>::find(__cs, __len, '.');
+ if (__p)
+   {
+     __wp = __ws + (__p - __cs);
+     *__wp = __lc->_M_decimal_point;
+   }
+
+
+
+
+ if (__lc->_M_use_grouping
+     && (__wp || __len < 3 || (__cs[1] <= '9' && __cs[2] <= '9'
+          && __cs[1] >= '0' && __cs[2] >= '0')))
+   {
+
+
+     _CharT* __ws2 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+          * __len * 2));
+
+     streamsize __off = 0;
+     if (__cs[0] == '-' || __cs[0] == '+')
+       {
+  __off = 1;
+  __ws2[0] = __ws[0];
+  __len -= 1;
+       }
+
+     _M_group_float(__lc->_M_grouping, __lc->_M_grouping_size,
+      __lc->_M_thousands_sep, __wp, __ws2 + __off,
+      __ws + __off, __len);
+     __len += __off;
+
+     __ws = __ws2;
+   }
+
+
+ const streamsize __w = __io.width();
+ if (__w > static_cast<streamsize>(__len))
+   {
+     _CharT* __ws3 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+          * __w));
+     _M_pad(__fill, __w, __io, __ws3, __ws, __len);
+     __ws = __ws3;
+   }
+ __io.width(0);
+
+
+
+ return std::__write(__s, __ws, __len);
+      }
+
+  template<typename _CharT, typename _OutIter>
+    _OutIter
+    num_put<_CharT, _OutIter>::
+    do_put(iter_type __s, ios_base& __io, char_type __fill, bool __v) const
+    {
+      const ios_base::fmtflags __flags = __io.flags();
+      if ((__flags & ios_base::boolalpha) == 0)
+        {
+          const long __l = __v;
+          __s = _M_insert_int(__s, __io, __fill, __l);
+        }
+      else
+        {
+   typedef __numpunct_cache<_CharT> __cache_type;
+   __use_cache<__cache_type> __uc;
+   const locale& __loc = __io._M_getloc();
+   const __cache_type* __lc = __uc(__loc);
+
+   const _CharT* __name = __v ? __lc->_M_truename
+                              : __lc->_M_falsename;
+   int __len = __v ? __lc->_M_truename_size
+                   : __lc->_M_falsename_size;
+
+   const streamsize __w = __io.width();
+   if (__w > static_cast<streamsize>(__len))
+     {
+       const streamsize __plen = __w - __len;
+       _CharT* __ps
+  = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+       * __plen));
+
+       char_traits<_CharT>::assign(__ps, __plen, __fill);
+       __io.width(0);
+
+       if ((__flags & ios_base::adjustfield) == ios_base::left)
+  {
+    __s = std::__write(__s, __name, __len);
+    __s = std::__write(__s, __ps, __plen);
+  }
+       else
+  {
+    __s = std::__write(__s, __ps, __plen);
+    __s = std::__write(__s, __name, __len);
+  }
+       return __s;
+     }
+   __io.width(0);
+   __s = std::__write(__s, __name, __len);
+ }
+      return __s;
+    }
+
+  template<typename _CharT, typename _OutIter>
+    _OutIter
+    num_put<_CharT, _OutIter>::
+    do_put(iter_type __s, ios_base& __io, char_type __fill, double __v) const
+    { return _M_insert_float(__s, __io, __fill, char(), __v); }
+
+
+  template<typename _CharT, typename _OutIter>
+    _OutIter
+    num_put<_CharT, _OutIter>::
+    __do_put(iter_type __s, ios_base& __io, char_type __fill, double __v) const
+    { return _M_insert_float(__s, __io, __fill, char(), __v); }
+
+
+  template<typename _CharT, typename _OutIter>
+    _OutIter
+    num_put<_CharT, _OutIter>::
+    do_put(iter_type __s, ios_base& __io, char_type __fill,
+    long double __v) const
+    { return _M_insert_float(__s, __io, __fill, 'L', __v); }
+
+  template<typename _CharT, typename _OutIter>
+    _OutIter
+    num_put<_CharT, _OutIter>::
+    do_put(iter_type __s, ios_base& __io, char_type __fill,
+           const void* __v) const
+    {
+      const ios_base::fmtflags __flags = __io.flags();
+      const ios_base::fmtflags __fmt = ~(ios_base::basefield
+      | ios_base::uppercase);
+      __io.flags((__flags & __fmt) | (ios_base::hex | ios_base::showbase));
+
+      typedef __gnu_cxx::__conditional_type<(sizeof(const void*)
+          <= sizeof(unsigned long)),
+ unsigned long, unsigned long long>::__type _UIntPtrType;
+
+      __s = _M_insert_int(__s, __io, __fill,
+     reinterpret_cast<_UIntPtrType>(__v));
+      __io.flags(__flags);
+      return __s;
+    }
+
+}
+  template<typename _CharT, typename _Traits>
+    void
+    __pad<_CharT, _Traits>::_S_pad(ios_base& __io, _CharT __fill,
+       _CharT* __news, const _CharT* __olds,
+       streamsize __newlen, streamsize __oldlen)
+    {
+      const size_t __plen = static_cast<size_t>(__newlen - __oldlen);
+      const ios_base::fmtflags __adjust = __io.flags() & ios_base::adjustfield;
+
+
+      if (__adjust == ios_base::left)
+ {
+   _Traits::copy(__news, __olds, __oldlen);
+   _Traits::assign(__news + __oldlen, __plen, __fill);
+   return;
+ }
+
+      size_t __mod = 0;
+      if (__adjust == ios_base::internal)
+ {
+
+
+
+          const locale& __loc = __io._M_getloc();
+   const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
+
+   if (__ctype.widen('-') == __olds[0]
+       || __ctype.widen('+') == __olds[0])
+     {
+       __news[0] = __olds[0];
+       __mod = 1;
+       ++__news;
+     }
+   else if (__ctype.widen('0') == __olds[0]
+     && __oldlen > 1
+     && (__ctype.widen('x') == __olds[1]
+         || __ctype.widen('X') == __olds[1]))
+     {
+       __news[0] = __olds[0];
+       __news[1] = __olds[1];
+       __mod = 2;
+       __news += 2;
+     }
+
+ }
+      _Traits::assign(__news, __plen, __fill);
+      _Traits::copy(__news + __plen, __olds + __mod, __oldlen - __mod);
+    }
+
+  template<typename _CharT>
+    _CharT*
+    __add_grouping(_CharT* __s, _CharT __sep,
+     const char* __gbeg, size_t __gsize,
+     const _CharT* __first, const _CharT* __last)
+    {
+      size_t __idx = 0;
+      size_t __ctr = 0;
+
+      while (__last - __first > __gbeg[__idx]
+      && static_cast<signed char>(__gbeg[__idx]) > 0
+      && __gbeg[__idx] != __gnu_cxx::__numeric_traits<char>::__max)
+ {
+   __last -= __gbeg[__idx];
+   __idx < __gsize - 1 ? ++__idx : ++__ctr;
+ }
+
+      while (__first != __last)
+ *__s++ = *__first++;
+
+      while (__ctr--)
+ {
+   *__s++ = __sep;
+   for (char __i = __gbeg[__idx]; __i > 0; --__i)
+     *__s++ = *__first++;
+ }
+
+      while (__idx--)
+ {
+   *__s++ = __sep;
+   for (char __i = __gbeg[__idx]; __i > 0; --__i)
+     *__s++ = *__first++;
+ }
+
+      return __s;
+    }
+
+
+
+
+  extern template class __cxx11:: numpunct<char>;
+  extern template class __cxx11:: numpunct_byname<char>;
+  extern template class __gnu_cxx_ldbl128:: num_get<char>;
+  extern template class __gnu_cxx_ldbl128:: num_put<char>;
+  extern template class ctype_byname<char>;
+
+  extern template
+    const ctype<char>&
+    use_facet<ctype<char> >(const locale&);
+
+  extern template
+    const numpunct<char>&
+    use_facet<numpunct<char> >(const locale&);
+
+  extern template
+    const num_put<char>&
+    use_facet<num_put<char> >(const locale&);
+
+  extern template
+    const num_get<char>&
+    use_facet<num_get<char> >(const locale&);
+
+  extern template
+    bool
+    has_facet<ctype<char> >(const locale&);
+
+  extern template
+    bool
+    has_facet<numpunct<char> >(const locale&);
+
+  extern template
+    bool
+    has_facet<num_put<char> >(const locale&);
+
+  extern template
+    bool
+    has_facet<num_get<char> >(const locale&);
+
+
+  extern template class __cxx11:: numpunct<wchar_t>;
+  extern template class __cxx11:: numpunct_byname<wchar_t>;
+  extern template class __gnu_cxx_ldbl128:: num_get<wchar_t>;
+  extern template class __gnu_cxx_ldbl128:: num_put<wchar_t>;
+  extern template class ctype_byname<wchar_t>;
+
+  extern template
+    const ctype<wchar_t>&
+    use_facet<ctype<wchar_t> >(const locale&);
+
+  extern template
+    const numpunct<wchar_t>&
+    use_facet<numpunct<wchar_t> >(const locale&);
+
+  extern template
+    const num_put<wchar_t>&
+    use_facet<num_put<wchar_t> >(const locale&);
+
+  extern template
+    const num_get<wchar_t>&
+    use_facet<num_get<wchar_t> >(const locale&);
+
+ extern template
+    bool
+    has_facet<ctype<wchar_t> >(const locale&);
+
+  extern template
+    bool
+    has_facet<numpunct<wchar_t> >(const locale&);
+
+  extern template
+    bool
+    has_facet<num_put<wchar_t> >(const locale&);
+
+  extern template
+    bool
+    has_facet<num_get<wchar_t> >(const locale&);
+
+
+
+
+}
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+  template<typename _Facet>
+    inline const _Facet&
+    __check_facet(const _Facet* __f)
+    {
+      if (!__f)
+ __throw_bad_cast();
+      return *__f;
+    }
+  template<typename _CharT, typename _Traits>
+    class basic_ios : public ios_base
+    {
+    public:
+
+
+
+
+
+
+      typedef _CharT char_type;
+      typedef typename _Traits::int_type int_type;
+      typedef typename _Traits::pos_type pos_type;
+      typedef typename _Traits::off_type off_type;
+      typedef _Traits traits_type;
+
+
+
+
+
+
+      typedef ctype<_CharT> __ctype_type;
+      typedef num_put<_CharT, ostreambuf_iterator<_CharT, _Traits> >
+           __num_put_type;
+      typedef num_get<_CharT, istreambuf_iterator<_CharT, _Traits> >
+           __num_get_type;
+
+
+
+    protected:
+      basic_ostream<_CharT, _Traits>* _M_tie;
+      mutable char_type _M_fill;
+      mutable bool _M_fill_init;
+      basic_streambuf<_CharT, _Traits>* _M_streambuf;
+
+
+      const __ctype_type* _M_ctype;
+
+      const __num_put_type* _M_num_put;
+
+      const __num_get_type* _M_num_get;
+
+    public:
+      explicit operator bool() const
+      { return !this->fail(); }
+
+
+
+
+
+      bool
+      operator!() const
+      { return this->fail(); }
+      iostate
+      rdstate() const
+      { return _M_streambuf_state; }
+      void
+      clear(iostate __state = goodbit);
+
+
+
+
+
+
+
+      void
+      setstate(iostate __state)
+      { this->clear(this->rdstate() | __state); }
+
+
+
+
+      void
+      _M_setstate(iostate __state)
+      {
+
+
+ _M_streambuf_state |= __state;
+ if (this->exceptions() & __state)
+   ;
+      }
+
+
+
+
+
+
+
+      bool
+      good() const
+      { return this->rdstate() == 0; }
+
+
+
+
+
+
+
+      bool
+      eof() const
+      { return (this->rdstate() & eofbit) != 0; }
+      bool
+      fail() const
+      { return (this->rdstate() & (badbit | failbit)) != 0; }
+
+
+
+
+
+
+
+      bool
+      bad() const
+      { return (this->rdstate() & badbit) != 0; }
+      iostate
+      exceptions() const
+      { return _M_exception; }
+      void
+      exceptions(iostate __except)
+      {
+        _M_exception = __except;
+        this->clear(_M_streambuf_state);
+      }
+
+
+
+
+
+
+
+      explicit
+      basic_ios(basic_streambuf<_CharT, _Traits>* __sb)
+      : ios_base(), _M_tie(0), _M_fill(), _M_fill_init(false), _M_streambuf(0),
+ _M_ctype(0), _M_num_put(0), _M_num_get(0)
+      { this->init(__sb); }
+
+
+
+
+
+
+
+      virtual
+      ~basic_ios() { }
+      basic_ostream<_CharT, _Traits>*
+      tie() const
+      { return _M_tie; }
+      basic_ostream<_CharT, _Traits>*
+      tie(basic_ostream<_CharT, _Traits>* __tiestr)
+      {
+        basic_ostream<_CharT, _Traits>* __old = _M_tie;
+        _M_tie = __tiestr;
+        return __old;
+      }
+
+
+
+
+
+
+
+      basic_streambuf<_CharT, _Traits>*
+      rdbuf() const
+      { return _M_streambuf; }
+      basic_streambuf<_CharT, _Traits>*
+      rdbuf(basic_streambuf<_CharT, _Traits>* __sb);
+      basic_ios&
+      copyfmt(const basic_ios& __rhs);
+
+
+
+
+
+
+
+      char_type
+      fill() const
+      {
+ if (!_M_fill_init)
+   {
+     _M_fill = this->widen(' ');
+     _M_fill_init = true;
+   }
+ return _M_fill;
+      }
+      char_type
+      fill(char_type __ch)
+      {
+ char_type __old = this->fill();
+ _M_fill = __ch;
+ return __old;
+      }
+      locale
+      imbue(const locale& __loc);
+      char
+      narrow(char_type __c, char __dfault) const
+      { return __check_facet(_M_ctype).narrow(__c, __dfault); }
+      char_type
+      widen(char __c) const
+      { return __check_facet(_M_ctype).widen(__c); }
+
+    protected:
+
+
+
+
+
+
+
+      basic_ios()
+      : ios_base(), _M_tie(0), _M_fill(char_type()), _M_fill_init(false),
+ _M_streambuf(0), _M_ctype(0), _M_num_put(0), _M_num_get(0)
+      { }
+
+
+
+
+
+
+
+      void
+      init(basic_streambuf<_CharT, _Traits>* __sb);
+
+
+      basic_ios(const basic_ios&) = delete;
+      basic_ios& operator=(const basic_ios&) = delete;
+
+      void
+      move(basic_ios& __rhs)
+      {
+ ios_base::_M_move(__rhs);
+ _M_cache_locale(_M_ios_locale);
+ this->tie(__rhs.tie(nullptr));
+ _M_fill = __rhs._M_fill;
+ _M_fill_init = __rhs._M_fill_init;
+ _M_streambuf = nullptr;
+      }
+
+      void
+      move(basic_ios&& __rhs)
+      { this->move(__rhs); }
+
+      void
+      swap(basic_ios& __rhs) noexcept
+      {
+ ios_base::_M_swap(__rhs);
+ _M_cache_locale(_M_ios_locale);
+ __rhs._M_cache_locale(__rhs._M_ios_locale);
+ std::swap(_M_tie, __rhs._M_tie);
+ std::swap(_M_fill, __rhs._M_fill);
+ std::swap(_M_fill_init, __rhs._M_fill_init);
+      }
+
+      void
+      set_rdbuf(basic_streambuf<_CharT, _Traits>* __sb)
+      { _M_streambuf = __sb; }
+
+
+      void
+      _M_cache_locale(const locale& __loc);
+    };
+
+
+}
+
+       
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+  template<typename _CharT, typename _Traits>
+    void
+    basic_ios<_CharT, _Traits>::clear(iostate __state)
+    {
+      if (this->rdbuf())
+ _M_streambuf_state = __state;
+      else
+   _M_streambuf_state = __state | badbit;
+      if (this->exceptions() & this->rdstate())
+ __throw_ios_failure(("basic_ios::clear"));
+    }
+
+  template<typename _CharT, typename _Traits>
+    basic_streambuf<_CharT, _Traits>*
+    basic_ios<_CharT, _Traits>::rdbuf(basic_streambuf<_CharT, _Traits>* __sb)
+    {
+      basic_streambuf<_CharT, _Traits>* __old = _M_streambuf;
+      _M_streambuf = __sb;
+      this->clear();
+      return __old;
+    }
+
+  template<typename _CharT, typename _Traits>
+    basic_ios<_CharT, _Traits>&
+    basic_ios<_CharT, _Traits>::copyfmt(const basic_ios& __rhs)
+    {
+
+
+      if (this != &__rhs)
+ {
+
+
+
+
+   _Words* __words = (__rhs._M_word_size <= _S_local_word_size) ?
+                      _M_local_word : new _Words[__rhs._M_word_size];
+
+
+   _Callback_list* __cb = __rhs._M_callbacks;
+   if (__cb)
+     __cb->_M_add_reference();
+   _M_call_callbacks(erase_event);
+   if (_M_word != _M_local_word)
+     {
+       delete [] _M_word;
+       _M_word = 0;
+     }
+   _M_dispose_callbacks();
+
+
+   _M_callbacks = __cb;
+   for (int __i = 0; __i < __rhs._M_word_size; ++__i)
+     __words[__i] = __rhs._M_word[__i];
+   _M_word = __words;
+   _M_word_size = __rhs._M_word_size;
+
+   this->flags(__rhs.flags());
+   this->width(__rhs.width());
+   this->precision(__rhs.precision());
+   this->tie(__rhs.tie());
+   this->fill(__rhs.fill());
+   _M_ios_locale = __rhs.getloc();
+   _M_cache_locale(_M_ios_locale);
+
+   _M_call_callbacks(copyfmt_event);
+
+
+   this->exceptions(__rhs.exceptions());
+ }
+      return *this;
+    }
+
+
+  template<typename _CharT, typename _Traits>
+    locale
+    basic_ios<_CharT, _Traits>::imbue(const locale& __loc)
+    {
+      locale __old(this->getloc());
+      ios_base::imbue(__loc);
+      _M_cache_locale(__loc);
+      if (this->rdbuf() != 0)
+ this->rdbuf()->pubimbue(__loc);
+      return __old;
+    }
+
+  template<typename _CharT, typename _Traits>
+    void
+    basic_ios<_CharT, _Traits>::init(basic_streambuf<_CharT, _Traits>* __sb)
+    {
+
+      ios_base::_M_init();
+
+
+      _M_cache_locale(_M_ios_locale);
+      _M_fill = _CharT();
+      _M_fill_init = false;
+
+      _M_tie = 0;
+      _M_exception = goodbit;
+      _M_streambuf = __sb;
+      _M_streambuf_state = __sb ? goodbit : badbit;
+    }
+
+  template<typename _CharT, typename _Traits>
+    void
+    basic_ios<_CharT, _Traits>::_M_cache_locale(const locale& __loc)
+    {
+      if (__builtin_expect(has_facet<__ctype_type>(__loc), true))
+ _M_ctype = std::__addressof(use_facet<__ctype_type>(__loc));
+      else
+ _M_ctype = 0;
+
+      if (__builtin_expect(has_facet<__num_put_type>(__loc), true))
+ _M_num_put = std::__addressof(use_facet<__num_put_type>(__loc));
+      else
+ _M_num_put = 0;
+
+      if (__builtin_expect(has_facet<__num_get_type>(__loc), true))
+ _M_num_get = std::__addressof(use_facet<__num_get_type>(__loc));
+      else
+ _M_num_get = 0;
+    }
+
+
+
+
+  extern template class basic_ios<char>;
+
+
+  extern template class basic_ios<wchar_t>;
+
+
+
+
+}
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+  template<typename _CharT, typename _Traits>
+    class basic_ostream : virtual public basic_ios<_CharT, _Traits>
+    {
+    public:
+
+      typedef _CharT char_type;
+      typedef typename _Traits::int_type int_type;
+      typedef typename _Traits::pos_type pos_type;
+      typedef typename _Traits::off_type off_type;
+      typedef _Traits traits_type;
+
+
+      typedef basic_streambuf<_CharT, _Traits> __streambuf_type;
+      typedef basic_ios<_CharT, _Traits> __ios_type;
+      typedef basic_ostream<_CharT, _Traits> __ostream_type;
+      typedef num_put<_CharT, ostreambuf_iterator<_CharT, _Traits> >
+             __num_put_type;
+      typedef ctype<_CharT> __ctype_type;
+      explicit
+      basic_ostream(__streambuf_type* __sb)
+      { this->init(__sb); }
+
+
+
+
+
+
+      virtual
+      ~basic_ostream() { }
+
+
+      class sentry;
+      friend class sentry;
+      __ostream_type&
+      operator<<(__ostream_type& (*__pf)(__ostream_type&))
+      {
+
+
+
+ return __pf(*this);
+      }
+
+      __ostream_type&
+      operator<<(__ios_type& (*__pf)(__ios_type&))
+      {
+
+
+
+ __pf(*this);
+ return *this;
+      }
+
+      __ostream_type&
+      operator<<(ios_base& (*__pf) (ios_base&))
+      {
+
+
+
+ __pf(*this);
+ return *this;
+      }
+      __ostream_type&
+      operator<<(long __n)
+      { return _M_insert(__n); }
+
+      __ostream_type&
+      operator<<(unsigned long __n)
+      { return _M_insert(__n); }
+
+      __ostream_type&
+      operator<<(bool __n)
+      { return _M_insert(__n); }
+
+      __ostream_type&
+      operator<<(short __n);
+
+      __ostream_type&
+      operator<<(unsigned short __n)
+      {
+
+
+ return _M_insert(static_cast<unsigned long>(__n));
+      }
+
+      __ostream_type&
+      operator<<(int __n);
+
+      __ostream_type&
+      operator<<(unsigned int __n)
+      {
+
+
+ return _M_insert(static_cast<unsigned long>(__n));
+      }
+
+
+      __ostream_type&
+      operator<<(long long __n)
+      { return _M_insert(__n); }
+
+      __ostream_type&
+      operator<<(unsigned long long __n)
+      { return _M_insert(__n); }
+      __ostream_type&
+      operator<<(double __f)
+      { return _M_insert(__f); }
+
+      __ostream_type&
+      operator<<(float __f)
+      {
+
+
+ return _M_insert(static_cast<double>(__f));
+      }
+
+      __ostream_type&
+      operator<<(long double __f)
+      { return _M_insert(__f); }
+      __ostream_type&
+      operator<<(const void* __p)
+      { return _M_insert(__p); }
+      __ostream_type&
+      operator<<(__streambuf_type* __sb);
+      __ostream_type&
+      put(char_type __c);
+
+
+
+
+
+
+      void
+      _M_write(const char_type* __s, streamsize __n)
+      {
+ const streamsize __put = this->rdbuf()->sputn(__s, __n);
+ if (__put != __n)
+   this->setstate(ios_base::badbit);
+      }
+      __ostream_type&
+      write(const char_type* __s, streamsize __n);
+      __ostream_type&
+      flush();
+      pos_type
+      tellp();
+      __ostream_type&
+      seekp(pos_type);
+       __ostream_type&
+      seekp(off_type, ios_base::seekdir);
+
+    protected:
+      basic_ostream()
+      { this->init(0); }
+
+
+
+      basic_ostream(basic_iostream<_CharT, _Traits>&) { }
+
+      basic_ostream(const basic_ostream&) = delete;
+
+      basic_ostream(basic_ostream&& __rhs)
+      : __ios_type()
+      { __ios_type::move(__rhs); }
+
+
+
+      basic_ostream& operator=(const basic_ostream&) = delete;
+
+      basic_ostream&
+      operator=(basic_ostream&& __rhs)
+      {
+ swap(__rhs);
+ return *this;
+      }
+
+      void
+      swap(basic_ostream& __rhs)
+      { __ios_type::swap(__rhs); }
+
+
+      template<typename _ValueT>
+ __ostream_type&
+ _M_insert(_ValueT __v);
+    };
+  template <typename _CharT, typename _Traits>
+    class basic_ostream<_CharT, _Traits>::sentry
+    {
+
+      bool _M_ok;
+      basic_ostream<_CharT, _Traits>& _M_os;
+
+    public:
+      explicit
+      sentry(basic_ostream<_CharT, _Traits>& __os);
+      ~sentry()
+      {
+
+ if (bool(_M_os.flags() & ios_base::unitbuf) && !uncaught_exception())
+   {
+
+     if (_M_os.rdbuf() && _M_os.rdbuf()->pubsync() == -1)
+       _M_os.setstate(ios_base::badbit);
+   }
+      }
+      explicit
+
+      operator bool() const
+      { return _M_ok; }
+    };
+  template<typename _CharT, typename _Traits>
+    inline basic_ostream<_CharT, _Traits>&
+    operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
+    { return __ostream_insert(__out, &__c, 1); }
+
+  template<typename _CharT, typename _Traits>
+    inline basic_ostream<_CharT, _Traits>&
+    operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
+    { return (__out << __out.widen(__c)); }
+
+
+  template <class _Traits>
+    inline basic_ostream<char, _Traits>&
+    operator<<(basic_ostream<char, _Traits>& __out, char __c)
+    { return __ostream_insert(__out, &__c, 1); }
+
+
+  template<class _Traits>
+    inline basic_ostream<char, _Traits>&
+    operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
+    { return (__out << static_cast<char>(__c)); }
+
+  template<class _Traits>
+    inline basic_ostream<char, _Traits>&
+    operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
+    { return (__out << static_cast<char>(__c)); }
+  template<typename _CharT, typename _Traits>
+    inline basic_ostream<_CharT, _Traits>&
+    operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
+    {
+      if (!__s)
+ __out.setstate(ios_base::badbit);
+      else
+ __ostream_insert(__out, __s,
+    static_cast<streamsize>(_Traits::length(__s)));
+      return __out;
+    }
+
+  template<typename _CharT, typename _Traits>
+    basic_ostream<_CharT, _Traits> &
+    operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s);
+
+
+  template<class _Traits>
+    inline basic_ostream<char, _Traits>&
+    operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
+    {
+      if (!__s)
+ __out.setstate(ios_base::badbit);
+      else
+ __ostream_insert(__out, __s,
+    static_cast<streamsize>(_Traits::length(__s)));
+      return __out;
+    }
+
+
+  template<class _Traits>
+    inline basic_ostream<char, _Traits>&
+    operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s)
+    { return (__out << reinterpret_cast<const char*>(__s)); }
+
+  template<class _Traits>
+    inline basic_ostream<char, _Traits> &
+    operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s)
+    { return (__out << reinterpret_cast<const char*>(__s)); }
+  template<typename _CharT, typename _Traits>
+    inline basic_ostream<_CharT, _Traits>&
+    endl(basic_ostream<_CharT, _Traits>& __os)
+    { return flush(__os.put(__os.widen('\n'))); }
+  template<typename _CharT, typename _Traits>
+    inline basic_ostream<_CharT, _Traits>&
+    ends(basic_ostream<_CharT, _Traits>& __os)
+    { return __os.put(_CharT()); }
+
+
+
+
+
+
+  template<typename _CharT, typename _Traits>
+    inline basic_ostream<_CharT, _Traits>&
+    flush(basic_ostream<_CharT, _Traits>& __os)
+    { return __os.flush(); }
+
+
+  template<typename _Ch, typename _Up>
+    basic_ostream<_Ch, _Up>&
+    __is_convertible_to_basic_ostream_test(basic_ostream<_Ch, _Up>*);
+
+  template<typename _Tp, typename = void>
+    struct __is_convertible_to_basic_ostream_impl
+    {
+      using __ostream_type = void;
+    };
+
+  template<typename _Tp>
+    using __do_is_convertible_to_basic_ostream_impl =
+    decltype(__is_convertible_to_basic_ostream_test
+      (declval<typename remove_reference<_Tp>::type*>()));
+
+  template<typename _Tp>
+    struct __is_convertible_to_basic_ostream_impl
+    <_Tp,
+     __void_t<__do_is_convertible_to_basic_ostream_impl<_Tp>>>
+    {
+      using __ostream_type =
+ __do_is_convertible_to_basic_ostream_impl<_Tp>;
+    };
+
+  template<typename _Tp>
+    struct __is_convertible_to_basic_ostream
+    : __is_convertible_to_basic_ostream_impl<_Tp>
+    {
+    public:
+      using type = __not_<is_void<
+        typename __is_convertible_to_basic_ostream_impl<_Tp>::__ostream_type>>;
+      constexpr static bool value = type::value;
+    };
+
+  template<typename _Ostream, typename _Tp, typename = void>
+    struct __is_insertable : false_type {};
+
+  template<typename _Ostream, typename _Tp>
+    struct __is_insertable<_Ostream, _Tp,
+      __void_t<decltype(declval<_Ostream&>()
+          << declval<const _Tp&>())>>
+        : true_type {};
+
+  template<typename _Ostream>
+    using __rvalue_ostream_type =
+      typename __is_convertible_to_basic_ostream<
+ _Ostream>::__ostream_type;
+  template<typename _Ostream, typename _Tp>
+    inline
+    typename enable_if<__and_<__not_<is_lvalue_reference<_Ostream>>,
+         __is_convertible_to_basic_ostream<_Ostream>,
+         __is_insertable<
+    __rvalue_ostream_type<_Ostream>,
+    const _Tp&>>::value,
+         __rvalue_ostream_type<_Ostream>>::type
+    operator<<(_Ostream&& __os, const _Tp& __x)
+    {
+      __rvalue_ostream_type<_Ostream> __ret_os = __os;
+      __ret_os << __x;
+      return __ret_os;
+    }
+
+
+
+}
+
+       
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+  template<typename _CharT, typename _Traits>
+    basic_ostream<_CharT, _Traits>::sentry::
+    sentry(basic_ostream<_CharT, _Traits>& __os)
+    : _M_ok(false), _M_os(__os)
+    {
+
+      if (__os.tie() && __os.good())
+ __os.tie()->flush();
+
+      if (__os.good())
+ _M_ok = true;
+      else
+ __os.setstate(ios_base::failbit);
+    }
+
+  template<typename _CharT, typename _Traits>
+    template<typename _ValueT>
+      basic_ostream<_CharT, _Traits>&
+      basic_ostream<_CharT, _Traits>::
+      _M_insert(_ValueT __v)
+      {
+ sentry __cerb(*this);
+ if (__cerb)
+   {
+     ios_base::iostate __err = ios_base::goodbit;
+     if (true)
+       {
+  const __num_put_type& __np = __check_facet(this->_M_num_put);
+  if (__np.put(*this, *this, this->fill(), __v).failed())
+    __err |= ios_base::badbit;
+       }
+     if (false)
+       {
+  this->_M_setstate(ios_base::badbit);
+  ;
+       }
+     if (false)
+       { this->_M_setstate(ios_base::badbit); }
+     if (__err)
+       this->setstate(__err);
+   }
+ return *this;
+      }
+
+  template<typename _CharT, typename _Traits>
+    basic_ostream<_CharT, _Traits>&
+    basic_ostream<_CharT, _Traits>::
+    operator<<(short __n)
+    {
+
+
+      const ios_base::fmtflags __fmt = this->flags() & ios_base::basefield;
+      if (__fmt == ios_base::oct || __fmt == ios_base::hex)
+ return _M_insert(static_cast<long>(static_cast<unsigned short>(__n)));
+      else
+ return _M_insert(static_cast<long>(__n));
+    }
+
+  template<typename _CharT, typename _Traits>
+    basic_ostream<_CharT, _Traits>&
+    basic_ostream<_CharT, _Traits>::
+    operator<<(int __n)
+    {
+
+
+      const ios_base::fmtflags __fmt = this->flags() & ios_base::basefield;
+      if (__fmt == ios_base::oct || __fmt == ios_base::hex)
+ return _M_insert(static_cast<long>(static_cast<unsigned int>(__n)));
+      else
+ return _M_insert(static_cast<long>(__n));
+    }
+
+  template<typename _CharT, typename _Traits>
+    basic_ostream<_CharT, _Traits>&
+    basic_ostream<_CharT, _Traits>::
+    operator<<(__streambuf_type* __sbin)
+    {
+      ios_base::iostate __err = ios_base::goodbit;
+      sentry __cerb(*this);
+      if (__cerb && __sbin)
+ {
+   if (true)
+     {
+       if (!__copy_streambufs(__sbin, this->rdbuf()))
+  __err |= ios_base::failbit;
+     }
+   if (false)
+     {
+       this->_M_setstate(ios_base::badbit);
+       ;
+     }
+   if (false)
+     { this->_M_setstate(ios_base::failbit); }
+ }
+      else if (!__sbin)
+ __err |= ios_base::badbit;
+      if (__err)
+ this->setstate(__err);
+      return *this;
+    }
+
+  template<typename _CharT, typename _Traits>
+    basic_ostream<_CharT, _Traits>&
+    basic_ostream<_CharT, _Traits>::
+    put(char_type __c)
+    {
+
+
+
+
+
+
+      sentry __cerb(*this);
+      if (__cerb)
+ {
+   ios_base::iostate __err = ios_base::goodbit;
+   if (true)
+     {
+       const int_type __put = this->rdbuf()->sputc(__c);
+       if (traits_type::eq_int_type(__put, traits_type::eof()))
+  __err |= ios_base::badbit;
+     }
+   if (false)
+     {
+       this->_M_setstate(ios_base::badbit);
+       ;
+     }
+   if (false)
+     { this->_M_setstate(ios_base::badbit); }
+   if (__err)
+     this->setstate(__err);
+ }
+      return *this;
+    }
+
+  template<typename _CharT, typename _Traits>
+    basic_ostream<_CharT, _Traits>&
+    basic_ostream<_CharT, _Traits>::
+    write(const _CharT* __s, streamsize __n)
+    {
+
+
+
+
+
+
+
+      sentry __cerb(*this);
+      if (__cerb)
+ {
+   if (true)
+     { _M_write(__s, __n); }
+   if (false)
+     {
+       this->_M_setstate(ios_base::badbit);
+       ;
+     }
+   if (false)
+     { this->_M_setstate(ios_base::badbit); }
+ }
+      return *this;
+    }
+
+  template<typename _CharT, typename _Traits>
+    basic_ostream<_CharT, _Traits>&
+    basic_ostream<_CharT, _Traits>::
+    flush()
+    {
+
+
+
+      ios_base::iostate __err = ios_base::goodbit;
+      if (true)
+ {
+   if (this->rdbuf() && this->rdbuf()->pubsync() == -1)
+     __err |= ios_base::badbit;
+ }
+      if (false)
+ {
+   this->_M_setstate(ios_base::badbit);
+   ;
+ }
+      if (false)
+ { this->_M_setstate(ios_base::badbit); }
+      if (__err)
+ this->setstate(__err);
+      return *this;
+    }
+
+  template<typename _CharT, typename _Traits>
+    typename basic_ostream<_CharT, _Traits>::pos_type
+    basic_ostream<_CharT, _Traits>::
+    tellp()
+    {
+      pos_type __ret = pos_type(-1);
+      if (true)
+ {
+   if (!this->fail())
+     __ret = this->rdbuf()->pubseekoff(0, ios_base::cur, ios_base::out);
+ }
+      if (false)
+ {
+   this->_M_setstate(ios_base::badbit);
+   ;
+ }
+      if (false)
+ { this->_M_setstate(ios_base::badbit); }
+      return __ret;
+    }
+
+  template<typename _CharT, typename _Traits>
+    basic_ostream<_CharT, _Traits>&
+    basic_ostream<_CharT, _Traits>::
+    seekp(pos_type __pos)
+    {
+      ios_base::iostate __err = ios_base::goodbit;
+      if (true)
+ {
+   if (!this->fail())
+     {
+
+
+       const pos_type __p = this->rdbuf()->pubseekpos(__pos,
+            ios_base::out);
+
+
+       if (__p == pos_type(off_type(-1)))
+  __err |= ios_base::failbit;
+     }
+ }
+      if (false)
+ {
+   this->_M_setstate(ios_base::badbit);
+   ;
+ }
+      if (false)
+ { this->_M_setstate(ios_base::badbit); }
+      if (__err)
+ this->setstate(__err);
+      return *this;
+    }
+
+  template<typename _CharT, typename _Traits>
+    basic_ostream<_CharT, _Traits>&
+    basic_ostream<_CharT, _Traits>::
+    seekp(off_type __off, ios_base::seekdir __dir)
+    {
+      ios_base::iostate __err = ios_base::goodbit;
+      if (true)
+ {
+   if (!this->fail())
+     {
+
+
+       const pos_type __p = this->rdbuf()->pubseekoff(__off, __dir,
+            ios_base::out);
+
+
+       if (__p == pos_type(off_type(-1)))
+  __err |= ios_base::failbit;
+     }
+ }
+      if (false)
+ {
+   this->_M_setstate(ios_base::badbit);
+   ;
+ }
+      if (false)
+ { this->_M_setstate(ios_base::badbit); }
+      if (__err)
+ this->setstate(__err);
+      return *this;
+    }
+
+  template<typename _CharT, typename _Traits>
+    basic_ostream<_CharT, _Traits>&
+    operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
+    {
+      if (!__s)
+ __out.setstate(ios_base::badbit);
+      else
+ {
+
+
+   const size_t __clen = char_traits<char>::length(__s);
+   if (true)
+     {
+       struct __ptr_guard
+       {
+  _CharT *__p;
+  __ptr_guard (_CharT *__ip): __p(__ip) { }
+  ~__ptr_guard() { delete[] __p; }
+  _CharT* __get() { return __p; }
+       } __pg (new _CharT[__clen]);
+
+       _CharT *__ws = __pg.__get();
+       for (size_t __i = 0; __i < __clen; ++__i)
+  __ws[__i] = __out.widen(__s[__i]);
+       __ostream_insert(__out, __ws, __clen);
+     }
+   if (false)
+     {
+       __out._M_setstate(ios_base::badbit);
+       ;
+     }
+   if (false)
+     { __out._M_setstate(ios_base::badbit); }
+ }
+      return __out;
+    }
+
+
+
+
+  extern template class basic_ostream<char>;
+  extern template ostream& endl(ostream&);
+  extern template ostream& ends(ostream&);
+  extern template ostream& flush(ostream&);
+  extern template ostream& operator<<(ostream&, char);
+  extern template ostream& operator<<(ostream&, unsigned char);
+  extern template ostream& operator<<(ostream&, signed char);
+  extern template ostream& operator<<(ostream&, const char*);
+  extern template ostream& operator<<(ostream&, const unsigned char*);
+  extern template ostream& operator<<(ostream&, const signed char*);
+
+  extern template ostream& ostream::_M_insert(long);
+  extern template ostream& ostream::_M_insert(unsigned long);
+  extern template ostream& ostream::_M_insert(bool);
+
+  extern template ostream& ostream::_M_insert(long long);
+  extern template ostream& ostream::_M_insert(unsigned long long);
+
+  extern template ostream& ostream::_M_insert(double);
+  extern template ostream& ostream::_M_insert(long double);
+  extern template ostream& ostream::_M_insert(const void*);
+
+
+  extern template class basic_ostream<wchar_t>;
+  extern template wostream& endl(wostream&);
+  extern template wostream& ends(wostream&);
+  extern template wostream& flush(wostream&);
+  extern template wostream& operator<<(wostream&, wchar_t);
+  extern template wostream& operator<<(wostream&, char);
+  extern template wostream& operator<<(wostream&, const wchar_t*);
+  extern template wostream& operator<<(wostream&, const char*);
+
+  extern template wostream& wostream::_M_insert(long);
+  extern template wostream& wostream::_M_insert(unsigned long);
+  extern template wostream& wostream::_M_insert(bool);
+
+  extern template wostream& wostream::_M_insert(long long);
+  extern template wostream& wostream::_M_insert(unsigned long long);
+
+  extern template wostream& wostream::_M_insert(double);
+  extern template wostream& wostream::_M_insert(long double);
+  extern template wostream& wostream::_M_insert(const void*);
+
+
+
+
+}
+       
+
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+  template<typename _CharT, typename _Traits>
+    class basic_istream : virtual public basic_ios<_CharT, _Traits>
+    {
+    public:
+
+      typedef _CharT char_type;
+      typedef typename _Traits::int_type int_type;
+      typedef typename _Traits::pos_type pos_type;
+      typedef typename _Traits::off_type off_type;
+      typedef _Traits traits_type;
+
+
+      typedef basic_streambuf<_CharT, _Traits> __streambuf_type;
+      typedef basic_ios<_CharT, _Traits> __ios_type;
+      typedef basic_istream<_CharT, _Traits> __istream_type;
+      typedef num_get<_CharT, istreambuf_iterator<_CharT, _Traits> >
+        __num_get_type;
+      typedef ctype<_CharT> __ctype_type;
+
+    protected:
+
+
+
+
+
+      streamsize _M_gcount;
+
+    public:
+
+
+
+
+
+
+
+      explicit
+      basic_istream(__streambuf_type* __sb)
+      : _M_gcount(streamsize(0))
+      { this->init(__sb); }
+
+
+
+
+
+
+      virtual
+      ~basic_istream()
+      { _M_gcount = streamsize(0); }
+
+
+      class sentry;
+      friend class sentry;
+      __istream_type&
+      operator>>(__istream_type& (*__pf)(__istream_type&))
+      { return __pf(*this); }
+
+      __istream_type&
+      operator>>(__ios_type& (*__pf)(__ios_type&))
+      {
+ __pf(*this);
+ return *this;
+      }
+
+      __istream_type&
+      operator>>(ios_base& (*__pf)(ios_base&))
+      {
+ __pf(*this);
+ return *this;
+      }
+      __istream_type&
+      operator>>(bool& __n)
+      { return _M_extract(__n); }
+
+      __istream_type&
+      operator>>(short& __n);
+
+      __istream_type&
+      operator>>(unsigned short& __n)
+      { return _M_extract(__n); }
+
+      __istream_type&
+      operator>>(int& __n);
+
+      __istream_type&
+      operator>>(unsigned int& __n)
+      { return _M_extract(__n); }
+
+      __istream_type&
+      operator>>(long& __n)
+      { return _M_extract(__n); }
+
+      __istream_type&
+      operator>>(unsigned long& __n)
+      { return _M_extract(__n); }
+
+
+      __istream_type&
+      operator>>(long long& __n)
+      { return _M_extract(__n); }
+
+      __istream_type&
+      operator>>(unsigned long long& __n)
+      { return _M_extract(__n); }
+      __istream_type&
+      operator>>(float& __f)
+      { return _M_extract(__f); }
+
+      __istream_type&
+      operator>>(double& __f)
+      { return _M_extract(__f); }
+
+      __istream_type&
+      operator>>(long double& __f)
+      { return _M_extract(__f); }
+      __istream_type&
+      operator>>(void*& __p)
+      { return _M_extract(__p); }
+      __istream_type&
+      operator>>(__streambuf_type* __sb);
+      streamsize
+      gcount() const
+      { return _M_gcount; }
+      int_type
+      get();
+      __istream_type&
+      get(char_type& __c);
+      __istream_type&
+      get(char_type* __s, streamsize __n, char_type __delim);
+      __istream_type&
+      get(char_type* __s, streamsize __n)
+      { return this->get(__s, __n, this->widen('\n')); }
+      __istream_type&
+      get(__streambuf_type& __sb, char_type __delim);
+      __istream_type&
+      get(__streambuf_type& __sb)
+      { return this->get(__sb, this->widen('\n')); }
+      __istream_type&
+      getline(char_type* __s, streamsize __n, char_type __delim);
+      __istream_type&
+      getline(char_type* __s, streamsize __n)
+      { return this->getline(__s, __n, this->widen('\n')); }
+      __istream_type&
+      ignore(streamsize __n, int_type __delim);
+
+      __istream_type&
+      ignore(streamsize __n);
+
+      __istream_type&
+      ignore();
+      int_type
+      peek();
+      __istream_type&
+      read(char_type* __s, streamsize __n);
+      streamsize
+      readsome(char_type* __s, streamsize __n);
+      __istream_type&
+      putback(char_type __c);
+      __istream_type&
+      unget();
+      int
+      sync();
+      pos_type
+      tellg();
+      __istream_type&
+      seekg(pos_type);
+      __istream_type&
+      seekg(off_type, ios_base::seekdir);
+
+
+    protected:
+      basic_istream()
+      : _M_gcount(streamsize(0))
+      { this->init(0); }
+
+
+      basic_istream(const basic_istream&) = delete;
+
+      basic_istream(basic_istream&& __rhs)
+      : __ios_type(), _M_gcount(__rhs._M_gcount)
+      {
+ __ios_type::move(__rhs);
+ __rhs._M_gcount = 0;
+      }
+
+
+
+      basic_istream& operator=(const basic_istream&) = delete;
+
+      basic_istream&
+      operator=(basic_istream&& __rhs)
+      {
+ swap(__rhs);
+ return *this;
+      }
+
+      void
+      swap(basic_istream& __rhs)
+      {
+ __ios_type::swap(__rhs);
+ std::swap(_M_gcount, __rhs._M_gcount);
+      }
+
+
+      template<typename _ValueT>
+ __istream_type&
+ _M_extract(_ValueT& __v);
+    };
+
+
+  template<>
+    basic_istream<char>&
+    basic_istream<char>::
+    getline(char_type* __s, streamsize __n, char_type __delim);
+
+  template<>
+    basic_istream<char>&
+    basic_istream<char>::
+    ignore(streamsize __n);
+
+  template<>
+    basic_istream<char>&
+    basic_istream<char>::
+    ignore(streamsize __n, int_type __delim);
+
+
+  template<>
+    basic_istream<wchar_t>&
+    basic_istream<wchar_t>::
+    getline(char_type* __s, streamsize __n, char_type __delim);
+
+  template<>
+    basic_istream<wchar_t>&
+    basic_istream<wchar_t>::
+    ignore(streamsize __n);
+
+  template<>
+    basic_istream<wchar_t>&
+    basic_istream<wchar_t>::
+    ignore(streamsize __n, int_type __delim);
+  template<typename _CharT, typename _Traits>
+    class basic_istream<_CharT, _Traits>::sentry
+    {
+
+      bool _M_ok;
+
+    public:
+
+      typedef _Traits traits_type;
+      typedef basic_streambuf<_CharT, _Traits> __streambuf_type;
+      typedef basic_istream<_CharT, _Traits> __istream_type;
+      typedef typename __istream_type::__ctype_type __ctype_type;
+      typedef typename _Traits::int_type __int_type;
+      explicit
+      sentry(basic_istream<_CharT, _Traits>& __is, bool __noskipws = false);
+      explicit
+
+      operator bool() const
+      { return _M_ok; }
+    };
+  template<typename _CharT, typename _Traits>
+    basic_istream<_CharT, _Traits>&
+    operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c);
+
+  template<class _Traits>
+    inline basic_istream<char, _Traits>&
+    operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c)
+    { return (__in >> reinterpret_cast<char&>(__c)); }
+
+  template<class _Traits>
+    inline basic_istream<char, _Traits>&
+    operator>>(basic_istream<char, _Traits>& __in, signed char& __c)
+    { return (__in >> reinterpret_cast<char&>(__c)); }
+  template<typename _CharT, typename _Traits>
+    basic_istream<_CharT, _Traits>&
+    operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s);
+
+
+  template<>
+    basic_istream<char>&
+    operator>>(basic_istream<char>& __in, char* __s);
+
+  template<class _Traits>
+    inline basic_istream<char, _Traits>&
+    operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s)
+    { return (__in >> reinterpret_cast<char*>(__s)); }
+
+  template<class _Traits>
+    inline basic_istream<char, _Traits>&
+    operator>>(basic_istream<char, _Traits>& __in, signed char* __s)
+    { return (__in >> reinterpret_cast<char*>(__s)); }
+  template<typename _CharT, typename _Traits>
+    class basic_iostream
+    : public basic_istream<_CharT, _Traits>,
+      public basic_ostream<_CharT, _Traits>
+    {
+    public:
+
+
+
+      typedef _CharT char_type;
+      typedef typename _Traits::int_type int_type;
+      typedef typename _Traits::pos_type pos_type;
+      typedef typename _Traits::off_type off_type;
+      typedef _Traits traits_type;
+
+
+      typedef basic_istream<_CharT, _Traits> __istream_type;
+      typedef basic_ostream<_CharT, _Traits> __ostream_type;
+
+
+
+
+
+
+
+      explicit
+      basic_iostream(basic_streambuf<_CharT, _Traits>* __sb)
+      : __istream_type(__sb), __ostream_type(__sb) { }
+
+
+
+
+      virtual
+      ~basic_iostream() { }
+
+    protected:
+      basic_iostream()
+      : __istream_type(), __ostream_type() { }
+
+
+      basic_iostream(const basic_iostream&) = delete;
+
+      basic_iostream(basic_iostream&& __rhs)
+      : __istream_type(std::move(__rhs)), __ostream_type(*this)
+      { }
+
+
+
+      basic_iostream& operator=(const basic_iostream&) = delete;
+
+      basic_iostream&
+      operator=(basic_iostream&& __rhs)
+      {
+ swap(__rhs);
+ return *this;
+      }
+
+      void
+      swap(basic_iostream& __rhs)
+      { __istream_type::swap(__rhs); }
+
+    };
+  template<typename _CharT, typename _Traits>
+    basic_istream<_CharT, _Traits>&
+    ws(basic_istream<_CharT, _Traits>& __is);
+
+
+  template<typename _Ch, typename _Up>
+    basic_istream<_Ch, _Up>&
+    __is_convertible_to_basic_istream_test(basic_istream<_Ch, _Up>*);
+
+  template<typename _Tp, typename = void>
+    struct __is_convertible_to_basic_istream_impl
+    {
+      using __istream_type = void;
+    };
+
+  template<typename _Tp>
+    using __do_is_convertible_to_basic_istream_impl =
+    decltype(__is_convertible_to_basic_istream_test
+      (declval<typename remove_reference<_Tp>::type*>()));
+
+  template<typename _Tp>
+    struct __is_convertible_to_basic_istream_impl
+    <_Tp,
+     __void_t<__do_is_convertible_to_basic_istream_impl<_Tp>>>
+    {
+      using __istream_type =
+ __do_is_convertible_to_basic_istream_impl<_Tp>;
+    };
+
+  template<typename _Tp>
+    struct __is_convertible_to_basic_istream
+    : __is_convertible_to_basic_istream_impl<_Tp>
+    {
+    public:
+      using type = __not_<is_void<
+        typename __is_convertible_to_basic_istream_impl<_Tp>::__istream_type>>;
+      constexpr static bool value = type::value;
+    };
+
+  template<typename _Istream, typename _Tp, typename = void>
+    struct __is_extractable : false_type {};
+
+  template<typename _Istream, typename _Tp>
+    struct __is_extractable<_Istream, _Tp,
+       __void_t<decltype(declval<_Istream&>()
+           >> declval<_Tp>())>>
+    : true_type {};
+
+  template<typename _Istream>
+    using __rvalue_istream_type =
+      typename __is_convertible_to_basic_istream<
+ _Istream>::__istream_type;
+  template<typename _Istream, typename _Tp>
+    inline
+    typename enable_if<__and_<__not_<is_lvalue_reference<_Istream>>,
+         __is_convertible_to_basic_istream<_Istream>,
+         __is_extractable<
+    __rvalue_istream_type<_Istream>,
+    _Tp&&>>::value,
+         __rvalue_istream_type<_Istream>>::type
+    operator>>(_Istream&& __is, _Tp&& __x)
+    {
+      __rvalue_istream_type<_Istream> __ret_is = __is;
+      __ret_is >> std::forward<_Tp>(__x);
+      return __ret_is;
+    }
+
+
+
+}
+
+       
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+  template<typename _CharT, typename _Traits>
+    basic_istream<_CharT, _Traits>::sentry::
+    sentry(basic_istream<_CharT, _Traits>& __in, bool __noskip) : _M_ok(false)
+    {
+      ios_base::iostate __err = ios_base::goodbit;
+      if (__in.good())
+ if (true)
+   {
+     if (__in.tie())
+       __in.tie()->flush();
+     if (!__noskip && bool(__in.flags() & ios_base::skipws))
+       {
+  const __int_type __eof = traits_type::eof();
+  __streambuf_type* __sb = __in.rdbuf();
+  __int_type __c = __sb->sgetc();
+
+  const __ctype_type& __ct = __check_facet(__in._M_ctype);
+  while (!traits_type::eq_int_type(__c, __eof)
+         && __ct.is(ctype_base::space,
+      traits_type::to_char_type(__c)))
+    __c = __sb->snextc();
+
+
+
+
+  if (traits_type::eq_int_type(__c, __eof))
+    __err |= ios_base::eofbit;
+       }
+   }
+ if (false)
+   {
+     __in._M_setstate(ios_base::badbit);
+     ;
+   }
+ if (false)
+   { __in._M_setstate(ios_base::badbit); }
+
+      if (__in.good() && __err == ios_base::goodbit)
+ _M_ok = true;
+      else
+ {
+   __err |= ios_base::failbit;
+   __in.setstate(__err);
+ }
+    }
+
+  template<typename _CharT, typename _Traits>
+    template<typename _ValueT>
+      basic_istream<_CharT, _Traits>&
+      basic_istream<_CharT, _Traits>::
+      _M_extract(_ValueT& __v)
+      {
+ sentry __cerb(*this, false);
+ if (__cerb)
+   {
+     ios_base::iostate __err = ios_base::goodbit;
+     if (true)
+       {
+  const __num_get_type& __ng = __check_facet(this->_M_num_get);
+  __ng.get(*this, 0, *this, __err, __v);
+       }
+     if (false)
+       {
+  this->_M_setstate(ios_base::badbit);
+  ;
+       }
+     if (false)
+       { this->_M_setstate(ios_base::badbit); }
+     if (__err)
+       this->setstate(__err);
+   }
+ return *this;
+      }
+
+  template<typename _CharT, typename _Traits>
+    basic_istream<_CharT, _Traits>&
+    basic_istream<_CharT, _Traits>::
+    operator>>(short& __n)
+    {
+
+
+      sentry __cerb(*this, false);
+      if (__cerb)
+ {
+   ios_base::iostate __err = ios_base::goodbit;
+   if (true)
+     {
+       long __l;
+       const __num_get_type& __ng = __check_facet(this->_M_num_get);
+       __ng.get(*this, 0, *this, __err, __l);
+
+
+
+       if (__l < __gnu_cxx::__numeric_traits<short>::__min)
+  {
+    __err |= ios_base::failbit;
+    __n = __gnu_cxx::__numeric_traits<short>::__min;
+  }
+       else if (__l > __gnu_cxx::__numeric_traits<short>::__max)
+  {
+    __err |= ios_base::failbit;
+    __n = __gnu_cxx::__numeric_traits<short>::__max;
+  }
+       else
+  __n = short(__l);
+     }
+   if (false)
+     {
+       this->_M_setstate(ios_base::badbit);
+       ;
+     }
+   if (false)
+     { this->_M_setstate(ios_base::badbit); }
+   if (__err)
+     this->setstate(__err);
+ }
+      return *this;
+    }
+
+  template<typename _CharT, typename _Traits>
+    basic_istream<_CharT, _Traits>&
+    basic_istream<_CharT, _Traits>::
+    operator>>(int& __n)
+    {
+
+
+      sentry __cerb(*this, false);
+      if (__cerb)
+ {
+   ios_base::iostate __err = ios_base::goodbit;
+   if (true)
+     {
+       long __l;
+       const __num_get_type& __ng = __check_facet(this->_M_num_get);
+       __ng.get(*this, 0, *this, __err, __l);
+
+
+
+       if (__l < __gnu_cxx::__numeric_traits<int>::__min)
+  {
+    __err |= ios_base::failbit;
+    __n = __gnu_cxx::__numeric_traits<int>::__min;
+  }
+       else if (__l > __gnu_cxx::__numeric_traits<int>::__max)
+  {
+    __err |= ios_base::failbit;
+    __n = __gnu_cxx::__numeric_traits<int>::__max;
+  }
+       else
+  __n = int(__l);
+     }
+   if (false)
+     {
+       this->_M_setstate(ios_base::badbit);
+       ;
+     }
+   if (false)
+     { this->_M_setstate(ios_base::badbit); }
+   if (__err)
+     this->setstate(__err);
+ }
+      return *this;
+    }
+
+  template<typename _CharT, typename _Traits>
+    basic_istream<_CharT, _Traits>&
+    basic_istream<_CharT, _Traits>::
+    operator>>(__streambuf_type* __sbout)
+    {
+      ios_base::iostate __err = ios_base::goodbit;
+      sentry __cerb(*this, false);
+      if (__cerb && __sbout)
+ {
+   if (true)
+     {
+       bool __ineof;
+       if (!__copy_streambufs_eof(this->rdbuf(), __sbout, __ineof))
+  __err |= ios_base::failbit;
+       if (__ineof)
+  __err |= ios_base::eofbit;
+     }
+   if (false)
+     {
+       this->_M_setstate(ios_base::failbit);
+       ;
+     }
+   if (false)
+     { this->_M_setstate(ios_base::failbit); }
+ }
+      else if (!__sbout)
+ __err |= ios_base::failbit;
+      if (__err)
+ this->setstate(__err);
+      return *this;
+    }
+
+  template<typename _CharT, typename _Traits>
+    typename basic_istream<_CharT, _Traits>::int_type
+    basic_istream<_CharT, _Traits>::
+    get(void)
+    {
+      const int_type __eof = traits_type::eof();
+      int_type __c = __eof;
+      _M_gcount = 0;
+      ios_base::iostate __err = ios_base::goodbit;
+      sentry __cerb(*this, true);
+      if (__cerb)
+ {
+   if (true)
+     {
+       __c = this->rdbuf()->sbumpc();
+
+       if (!traits_type::eq_int_type(__c, __eof))
+  _M_gcount = 1;
+       else
+  __err |= ios_base::eofbit;
+     }
+   if (false)
+     {
+       this->_M_setstate(ios_base::badbit);
+       ;
+     }
+   if (false)
+     { this->_M_setstate(ios_base::badbit); }
+ }
+      if (!_M_gcount)
+ __err |= ios_base::failbit;
+      if (__err)
+ this->setstate(__err);
+      return __c;
+    }
+
+  template<typename _CharT, typename _Traits>
+    basic_istream<_CharT, _Traits>&
+    basic_istream<_CharT, _Traits>::
+    get(char_type& __c)
+    {
+      _M_gcount = 0;
+      ios_base::iostate __err = ios_base::goodbit;
+      sentry __cerb(*this, true);
+      if (__cerb)
+ {
+   if (true)
+     {
+       const int_type __cb = this->rdbuf()->sbumpc();
+
+       if (!traits_type::eq_int_type(__cb, traits_type::eof()))
+  {
+    _M_gcount = 1;
+    __c = traits_type::to_char_type(__cb);
+  }
+       else
+  __err |= ios_base::eofbit;
+     }
+   if (false)
+     {
+       this->_M_setstate(ios_base::badbit);
+       ;
+     }
+   if (false)
+     { this->_M_setstate(ios_base::badbit); }
+ }
+      if (!_M_gcount)
+ __err |= ios_base::failbit;
+      if (__err)
+ this->setstate(__err);
+      return *this;
+    }
+
+  template<typename _CharT, typename _Traits>
+    basic_istream<_CharT, _Traits>&
+    basic_istream<_CharT, _Traits>::
+    get(char_type* __s, streamsize __n, char_type __delim)
+    {
+      _M_gcount = 0;
+      ios_base::iostate __err = ios_base::goodbit;
+      sentry __cerb(*this, true);
+      if (__cerb)
+ {
+   if (true)
+     {
+       const int_type __idelim = traits_type::to_int_type(__delim);
+       const int_type __eof = traits_type::eof();
+       __streambuf_type* __sb = this->rdbuf();
+       int_type __c = __sb->sgetc();
+
+       while (_M_gcount + 1 < __n
+       && !traits_type::eq_int_type(__c, __eof)
+       && !traits_type::eq_int_type(__c, __idelim))
+  {
+    *__s++ = traits_type::to_char_type(__c);
+    ++_M_gcount;
+    __c = __sb->snextc();
+  }
+       if (traits_type::eq_int_type(__c, __eof))
+  __err |= ios_base::eofbit;
+     }
+   if (false)
+     {
+       this->_M_setstate(ios_base::badbit);
+       ;
+     }
+   if (false)
+     { this->_M_setstate(ios_base::badbit); }
+ }
+
+
+      if (__n > 0)
+ *__s = char_type();
+      if (!_M_gcount)
+ __err |= ios_base::failbit;
+      if (__err)
+ this->setstate(__err);
+      return *this;
+    }
+
+  template<typename _CharT, typename _Traits>
+    basic_istream<_CharT, _Traits>&
+    basic_istream<_CharT, _Traits>::
+    get(__streambuf_type& __sb, char_type __delim)
+    {
+      _M_gcount = 0;
+      ios_base::iostate __err = ios_base::goodbit;
+      sentry __cerb(*this, true);
+      if (__cerb)
+ {
+   if (true)
+     {
+       const int_type __idelim = traits_type::to_int_type(__delim);
+       const int_type __eof = traits_type::eof();
+       __streambuf_type* __this_sb = this->rdbuf();
+       int_type __c = __this_sb->sgetc();
+       char_type __c2 = traits_type::to_char_type(__c);
+
+       while (!traits_type::eq_int_type(__c, __eof)
+       && !traits_type::eq_int_type(__c, __idelim)
+       && !traits_type::eq_int_type(__sb.sputc(__c2), __eof))
+  {
+    ++_M_gcount;
+    __c = __this_sb->snextc();
+    __c2 = traits_type::to_char_type(__c);
+  }
+       if (traits_type::eq_int_type(__c, __eof))
+  __err |= ios_base::eofbit;
+     }
+   if (false)
+     {
+       this->_M_setstate(ios_base::badbit);
+       ;
+     }
+   if (false)
+     { this->_M_setstate(ios_base::badbit); }
+ }
+      if (!_M_gcount)
+ __err |= ios_base::failbit;
+      if (__err)
+ this->setstate(__err);
+      return *this;
+    }
+
+  template<typename _CharT, typename _Traits>
+    basic_istream<_CharT, _Traits>&
+    basic_istream<_CharT, _Traits>::
+    getline(char_type* __s, streamsize __n, char_type __delim)
+    {
+      _M_gcount = 0;
+      ios_base::iostate __err = ios_base::goodbit;
+      sentry __cerb(*this, true);
+      if (__cerb)
+        {
+          if (true)
+            {
+              const int_type __idelim = traits_type::to_int_type(__delim);
+              const int_type __eof = traits_type::eof();
+              __streambuf_type* __sb = this->rdbuf();
+              int_type __c = __sb->sgetc();
+
+              while (_M_gcount + 1 < __n
+                     && !traits_type::eq_int_type(__c, __eof)
+                     && !traits_type::eq_int_type(__c, __idelim))
+                {
+                  *__s++ = traits_type::to_char_type(__c);
+                  __c = __sb->snextc();
+                  ++_M_gcount;
+                }
+              if (traits_type::eq_int_type(__c, __eof))
+                __err |= ios_base::eofbit;
+              else
+                {
+                  if (traits_type::eq_int_type(__c, __idelim))
+                    {
+                      __sb->sbumpc();
+                      ++_M_gcount;
+                    }
+                  else
+                    __err |= ios_base::failbit;
+                }
+            }
+   if (false)
+     {
+       this->_M_setstate(ios_base::badbit);
+       ;
+     }
+          if (false)
+            { this->_M_setstate(ios_base::badbit); }
+        }
+
+
+      if (__n > 0)
+ *__s = char_type();
+      if (!_M_gcount)
+        __err |= ios_base::failbit;
+      if (__err)
+        this->setstate(__err);
+      return *this;
+    }
+
+
+
+
+  template<typename _CharT, typename _Traits>
+    basic_istream<_CharT, _Traits>&
+    basic_istream<_CharT, _Traits>::
+    ignore(void)
+    {
+      _M_gcount = 0;
+      sentry __cerb(*this, true);
+      if (__cerb)
+ {
+   ios_base::iostate __err = ios_base::goodbit;
+   if (true)
+     {
+       const int_type __eof = traits_type::eof();
+       __streambuf_type* __sb = this->rdbuf();
+
+       if (traits_type::eq_int_type(__sb->sbumpc(), __eof))
+  __err |= ios_base::eofbit;
+       else
+  _M_gcount = 1;
+     }
+   if (false)
+     {
+       this->_M_setstate(ios_base::badbit);
+       ;
+     }
+   if (false)
+     { this->_M_setstate(ios_base::badbit); }
+   if (__err)
+     this->setstate(__err);
+ }
+      return *this;
+    }
+
+  template<typename _CharT, typename _Traits>
+    basic_istream<_CharT, _Traits>&
+    basic_istream<_CharT, _Traits>::
+    ignore(streamsize __n)
+    {
+      _M_gcount = 0;
+      sentry __cerb(*this, true);
+      if (__cerb && __n > 0)
+        {
+          ios_base::iostate __err = ios_base::goodbit;
+          if (true)
+            {
+              const int_type __eof = traits_type::eof();
+              __streambuf_type* __sb = this->rdbuf();
+              int_type __c = __sb->sgetc();
+       bool __large_ignore = false;
+       while (true)
+  {
+    while (_M_gcount < __n
+    && !traits_type::eq_int_type(__c, __eof))
+      {
+        ++_M_gcount;
+        __c = __sb->snextc();
+      }
+    if (__n == __gnu_cxx::__numeric_traits<streamsize>::__max
+        && !traits_type::eq_int_type(__c, __eof))
+      {
+        _M_gcount =
+   __gnu_cxx::__numeric_traits<streamsize>::__min;
+        __large_ignore = true;
+      }
+    else
+      break;
+  }
+
+       if (__large_ignore)
+  _M_gcount = __gnu_cxx::__numeric_traits<streamsize>::__max;
+
+       if (traits_type::eq_int_type(__c, __eof))
+                __err |= ios_base::eofbit;
+            }
+   if (false)
+     {
+       this->_M_setstate(ios_base::badbit);
+       ;
+     }
+          if (false)
+            { this->_M_setstate(ios_base::badbit); }
+          if (__err)
+            this->setstate(__err);
+        }
+      return *this;
+    }
+
+  template<typename _CharT, typename _Traits>
+    basic_istream<_CharT, _Traits>&
+    basic_istream<_CharT, _Traits>::
+    ignore(streamsize __n, int_type __delim)
+    {
+      _M_gcount = 0;
+      sentry __cerb(*this, true);
+      if (__cerb && __n > 0)
+        {
+          ios_base::iostate __err = ios_base::goodbit;
+          if (true)
+            {
+              const int_type __eof = traits_type::eof();
+              __streambuf_type* __sb = this->rdbuf();
+              int_type __c = __sb->sgetc();
+
+
+       bool __large_ignore = false;
+       while (true)
+  {
+    while (_M_gcount < __n
+    && !traits_type::eq_int_type(__c, __eof)
+    && !traits_type::eq_int_type(__c, __delim))
+      {
+        ++_M_gcount;
+        __c = __sb->snextc();
+      }
+    if (__n == __gnu_cxx::__numeric_traits<streamsize>::__max
+        && !traits_type::eq_int_type(__c, __eof)
+        && !traits_type::eq_int_type(__c, __delim))
+      {
+        _M_gcount =
+   __gnu_cxx::__numeric_traits<streamsize>::__min;
+        __large_ignore = true;
+      }
+    else
+      break;
+  }
+
+       if (__large_ignore)
+  _M_gcount = __gnu_cxx::__numeric_traits<streamsize>::__max;
+
+              if (traits_type::eq_int_type(__c, __eof))
+                __err |= ios_base::eofbit;
+       else if (traits_type::eq_int_type(__c, __delim))
+  {
+    if (_M_gcount
+        < __gnu_cxx::__numeric_traits<streamsize>::__max)
+      ++_M_gcount;
+    __sb->sbumpc();
+  }
+            }
+   if (false)
+     {
+       this->_M_setstate(ios_base::badbit);
+       ;
+     }
+          if (false)
+            { this->_M_setstate(ios_base::badbit); }
+          if (__err)
+            this->setstate(__err);
+        }
+      return *this;
+    }
+
+  template<typename _CharT, typename _Traits>
+    typename basic_istream<_CharT, _Traits>::int_type
+    basic_istream<_CharT, _Traits>::
+    peek(void)
+    {
+      int_type __c = traits_type::eof();
+      _M_gcount = 0;
+      sentry __cerb(*this, true);
+      if (__cerb)
+ {
+   ios_base::iostate __err = ios_base::goodbit;
+   if (true)
+     {
+       __c = this->rdbuf()->sgetc();
+       if (traits_type::eq_int_type(__c, traits_type::eof()))
+  __err |= ios_base::eofbit;
+     }
+   if (false)
+     {
+       this->_M_setstate(ios_base::badbit);
+       ;
+     }
+   if (false)
+     { this->_M_setstate(ios_base::badbit); }
+   if (__err)
+     this->setstate(__err);
+ }
+      return __c;
+    }
+
+  template<typename _CharT, typename _Traits>
+    basic_istream<_CharT, _Traits>&
+    basic_istream<_CharT, _Traits>::
+    read(char_type* __s, streamsize __n)
+    {
+      _M_gcount = 0;
+      sentry __cerb(*this, true);
+      if (__cerb)
+ {
+   ios_base::iostate __err = ios_base::goodbit;
+   if (true)
+     {
+       _M_gcount = this->rdbuf()->sgetn(__s, __n);
+       if (_M_gcount != __n)
+  __err |= (ios_base::eofbit | ios_base::failbit);
+     }
+   if (false)
+     {
+       this->_M_setstate(ios_base::badbit);
+       ;
+     }
+   if (false)
+     { this->_M_setstate(ios_base::badbit); }
+   if (__err)
+     this->setstate(__err);
+ }
+      return *this;
+    }
+
+  template<typename _CharT, typename _Traits>
+    streamsize
+    basic_istream<_CharT, _Traits>::
+    readsome(char_type* __s, streamsize __n)
+    {
+      _M_gcount = 0;
+      sentry __cerb(*this, true);
+      if (__cerb)
+ {
+   ios_base::iostate __err = ios_base::goodbit;
+   if (true)
+     {
+
+       const streamsize __num = this->rdbuf()->in_avail();
+       if (__num > 0)
+  _M_gcount = this->rdbuf()->sgetn(__s, std::min(__num, __n));
+       else if (__num == -1)
+  __err |= ios_base::eofbit;
+     }
+   if (false)
+     {
+       this->_M_setstate(ios_base::badbit);
+       ;
+     }
+   if (false)
+     { this->_M_setstate(ios_base::badbit); }
+   if (__err)
+     this->setstate(__err);
+ }
+      return _M_gcount;
+    }
+
+  template<typename _CharT, typename _Traits>
+    basic_istream<_CharT, _Traits>&
+    basic_istream<_CharT, _Traits>::
+    putback(char_type __c)
+    {
+
+
+      _M_gcount = 0;
+
+      this->clear(this->rdstate() & ~ios_base::eofbit);
+      sentry __cerb(*this, true);
+      if (__cerb)
+ {
+   ios_base::iostate __err = ios_base::goodbit;
+   if (true)
+     {
+       const int_type __eof = traits_type::eof();
+       __streambuf_type* __sb = this->rdbuf();
+       if (!__sb
+    || traits_type::eq_int_type(__sb->sputbackc(__c), __eof))
+  __err |= ios_base::badbit;
+     }
+   if (false)
+     {
+       this->_M_setstate(ios_base::badbit);
+       ;
+     }
+   if (false)
+     { this->_M_setstate(ios_base::badbit); }
+   if (__err)
+     this->setstate(__err);
+ }
+      return *this;
+    }
+
+  template<typename _CharT, typename _Traits>
+    basic_istream<_CharT, _Traits>&
+    basic_istream<_CharT, _Traits>::
+    unget(void)
+    {
+
+
+      _M_gcount = 0;
+
+      this->clear(this->rdstate() & ~ios_base::eofbit);
+      sentry __cerb(*this, true);
+      if (__cerb)
+ {
+   ios_base::iostate __err = ios_base::goodbit;
+   if (true)
+     {
+       const int_type __eof = traits_type::eof();
+       __streambuf_type* __sb = this->rdbuf();
+       if (!__sb
+    || traits_type::eq_int_type(__sb->sungetc(), __eof))
+  __err |= ios_base::badbit;
+     }
+   if (false)
+     {
+       this->_M_setstate(ios_base::badbit);
+       ;
+     }
+   if (false)
+     { this->_M_setstate(ios_base::badbit); }
+   if (__err)
+     this->setstate(__err);
+ }
+      return *this;
+    }
+
+  template<typename _CharT, typename _Traits>
+    int
+    basic_istream<_CharT, _Traits>::
+    sync(void)
+    {
+
+
+      int __ret = -1;
+      sentry __cerb(*this, true);
+      if (__cerb)
+ {
+   ios_base::iostate __err = ios_base::goodbit;
+   if (true)
+     {
+       __streambuf_type* __sb = this->rdbuf();
+       if (__sb)
+  {
+    if (__sb->pubsync() == -1)
+      __err |= ios_base::badbit;
+    else
+      __ret = 0;
+  }
+     }
+   if (false)
+     {
+       this->_M_setstate(ios_base::badbit);
+       ;
+     }
+   if (false)
+     { this->_M_setstate(ios_base::badbit); }
+   if (__err)
+     this->setstate(__err);
+ }
+      return __ret;
+    }
+
+  template<typename _CharT, typename _Traits>
+    typename basic_istream<_CharT, _Traits>::pos_type
+    basic_istream<_CharT, _Traits>::
+    tellg(void)
+    {
+
+
+      pos_type __ret = pos_type(-1);
+      sentry __cerb(*this, true);
+      if (__cerb)
+ {
+   if (true)
+     {
+       if (!this->fail())
+  __ret = this->rdbuf()->pubseekoff(0, ios_base::cur,
+        ios_base::in);
+     }
+   if (false)
+     {
+       this->_M_setstate(ios_base::badbit);
+       ;
+     }
+   if (false)
+     { this->_M_setstate(ios_base::badbit); }
+ }
+      return __ret;
+    }
+
+  template<typename _CharT, typename _Traits>
+    basic_istream<_CharT, _Traits>&
+    basic_istream<_CharT, _Traits>::
+    seekg(pos_type __pos)
+    {
+
+
+
+      this->clear(this->rdstate() & ~ios_base::eofbit);
+      sentry __cerb(*this, true);
+      if (__cerb)
+ {
+   ios_base::iostate __err = ios_base::goodbit;
+   if (true)
+     {
+       if (!this->fail())
+  {
+
+    const pos_type __p = this->rdbuf()->pubseekpos(__pos,
+         ios_base::in);
+
+
+    if (__p == pos_type(off_type(-1)))
+      __err |= ios_base::failbit;
+  }
+     }
+   if (false)
+     {
+       this->_M_setstate(ios_base::badbit);
+       ;
+     }
+   if (false)
+     { this->_M_setstate(ios_base::badbit); }
+   if (__err)
+     this->setstate(__err);
+ }
+      return *this;
+    }
+
+  template<typename _CharT, typename _Traits>
+    basic_istream<_CharT, _Traits>&
+    basic_istream<_CharT, _Traits>::
+    seekg(off_type __off, ios_base::seekdir __dir)
+    {
+
+
+
+      this->clear(this->rdstate() & ~ios_base::eofbit);
+      sentry __cerb(*this, true);
+      if (__cerb)
+ {
+   ios_base::iostate __err = ios_base::goodbit;
+   if (true)
+     {
+       if (!this->fail())
+  {
+
+    const pos_type __p = this->rdbuf()->pubseekoff(__off, __dir,
+         ios_base::in);
+
+
+    if (__p == pos_type(off_type(-1)))
+      __err |= ios_base::failbit;
+  }
+     }
+   if (false)
+     {
+       this->_M_setstate(ios_base::badbit);
+       ;
+     }
+   if (false)
+     { this->_M_setstate(ios_base::badbit); }
+   if (__err)
+     this->setstate(__err);
+ }
+      return *this;
+    }
+
+
+  template<typename _CharT, typename _Traits>
+    basic_istream<_CharT, _Traits>&
+    operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c)
+    {
+      typedef basic_istream<_CharT, _Traits> __istream_type;
+      typedef typename __istream_type::int_type __int_type;
+
+      typename __istream_type::sentry __cerb(__in, false);
+      if (__cerb)
+ {
+   ios_base::iostate __err = ios_base::goodbit;
+   if (true)
+     {
+       const __int_type __cb = __in.rdbuf()->sbumpc();
+       if (!_Traits::eq_int_type(__cb, _Traits::eof()))
+  __c = _Traits::to_char_type(__cb);
+       else
+  __err |= (ios_base::eofbit | ios_base::failbit);
+     }
+   if (false)
+     {
+       __in._M_setstate(ios_base::badbit);
+       ;
+     }
+   if (false)
+     { __in._M_setstate(ios_base::badbit); }
+   if (__err)
+     __in.setstate(__err);
+ }
+      return __in;
+    }
+
+  template<typename _CharT, typename _Traits>
+    basic_istream<_CharT, _Traits>&
+    operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s)
+    {
+      typedef basic_istream<_CharT, _Traits> __istream_type;
+      typedef basic_streambuf<_CharT, _Traits> __streambuf_type;
+      typedef typename _Traits::int_type int_type;
+      typedef _CharT char_type;
+      typedef ctype<_CharT> __ctype_type;
+
+      streamsize __extracted = 0;
+      ios_base::iostate __err = ios_base::goodbit;
+      typename __istream_type::sentry __cerb(__in, false);
+      if (__cerb)
+ {
+   if (true)
+     {
+
+       streamsize __num = __in.width();
+       if (__num <= 0)
+  __num = __gnu_cxx::__numeric_traits<streamsize>::__max;
+
+       const __ctype_type& __ct = use_facet<__ctype_type>(__in.getloc());
+
+       const int_type __eof = _Traits::eof();
+       __streambuf_type* __sb = __in.rdbuf();
+       int_type __c = __sb->sgetc();
+
+       while (__extracted < __num - 1
+       && !_Traits::eq_int_type(__c, __eof)
+       && !__ct.is(ctype_base::space,
+     _Traits::to_char_type(__c)))
+  {
+    *__s++ = _Traits::to_char_type(__c);
+    ++__extracted;
+    __c = __sb->snextc();
+  }
+       if (_Traits::eq_int_type(__c, __eof))
+  __err |= ios_base::eofbit;
+
+
+
+       *__s = char_type();
+       __in.width(0);
+     }
+   if (false)
+     {
+       __in._M_setstate(ios_base::badbit);
+       ;
+     }
+   if (false)
+     { __in._M_setstate(ios_base::badbit); }
+ }
+      if (!__extracted)
+ __err |= ios_base::failbit;
+      if (__err)
+ __in.setstate(__err);
+      return __in;
+    }
+
+
+  template<typename _CharT, typename _Traits>
+    basic_istream<_CharT, _Traits>&
+    ws(basic_istream<_CharT, _Traits>& __in)
+    {
+      typedef basic_istream<_CharT, _Traits> __istream_type;
+      typedef basic_streambuf<_CharT, _Traits> __streambuf_type;
+      typedef typename __istream_type::int_type __int_type;
+      typedef ctype<_CharT> __ctype_type;
+
+      const __ctype_type& __ct = use_facet<__ctype_type>(__in.getloc());
+      const __int_type __eof = _Traits::eof();
+      __streambuf_type* __sb = __in.rdbuf();
+      __int_type __c = __sb->sgetc();
+
+      while (!_Traits::eq_int_type(__c, __eof)
+      && __ct.is(ctype_base::space, _Traits::to_char_type(__c)))
+ __c = __sb->snextc();
+
+       if (_Traits::eq_int_type(__c, __eof))
+  __in.setstate(ios_base::eofbit);
+      return __in;
+    }
+
+
+
+
+  extern template class basic_istream<char>;
+  extern template istream& ws(istream&);
+  extern template istream& operator>>(istream&, char&);
+  extern template istream& operator>>(istream&, char*);
+  extern template istream& operator>>(istream&, unsigned char&);
+  extern template istream& operator>>(istream&, signed char&);
+  extern template istream& operator>>(istream&, unsigned char*);
+  extern template istream& operator>>(istream&, signed char*);
+
+  extern template istream& istream::_M_extract(unsigned short&);
+  extern template istream& istream::_M_extract(unsigned int&);
+  extern template istream& istream::_M_extract(long&);
+  extern template istream& istream::_M_extract(unsigned long&);
+  extern template istream& istream::_M_extract(bool&);
+
+  extern template istream& istream::_M_extract(long long&);
+  extern template istream& istream::_M_extract(unsigned long long&);
+
+  extern template istream& istream::_M_extract(float&);
+  extern template istream& istream::_M_extract(double&);
+  extern template istream& istream::_M_extract(long double&);
+  extern template istream& istream::_M_extract(void*&);
+
+  extern template class basic_iostream<char>;
+
+
+  extern template class basic_istream<wchar_t>;
+  extern template wistream& ws(wistream&);
+  extern template wistream& operator>>(wistream&, wchar_t&);
+  extern template wistream& operator>>(wistream&, wchar_t*);
+
+  extern template wistream& wistream::_M_extract(unsigned short&);
+  extern template wistream& wistream::_M_extract(unsigned int&);
+  extern template wistream& wistream::_M_extract(long&);
+  extern template wistream& wistream::_M_extract(unsigned long&);
+  extern template wistream& wistream::_M_extract(bool&);
+
+  extern template wistream& wistream::_M_extract(long long&);
+  extern template wistream& wistream::_M_extract(unsigned long long&);
+
+  extern template wistream& wistream::_M_extract(float&);
+  extern template wistream& wistream::_M_extract(double&);
+  extern template wistream& wistream::_M_extract(long double&);
+  extern template wistream& wistream::_M_extract(void*&);
+
+  extern template class basic_iostream<wchar_t>;
+
+
+
+
+}
+       
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+
+
+
+
+
+  template<typename _Tp, typename _CharT = char,
+           typename _Traits = char_traits<_CharT>, typename _Dist = ptrdiff_t>
+    class istream_iterator
+    : public iterator<input_iterator_tag, _Tp, _Dist, const _Tp*, const _Tp&>
+    {
+    public:
+      typedef _CharT char_type;
+      typedef _Traits traits_type;
+      typedef basic_istream<_CharT, _Traits> istream_type;
+
+    private:
+      istream_type* _M_stream;
+      _Tp _M_value;
+      bool _M_ok;
+
+    public:
+
+      constexpr istream_iterator()
+      : _M_stream(0), _M_value(), _M_ok(false) {}
+
+
+      istream_iterator(istream_type& __s)
+      : _M_stream(std::__addressof(__s))
+      { _M_read(); }
+
+      istream_iterator(const istream_iterator& __obj)
+      : _M_stream(__obj._M_stream), _M_value(__obj._M_value),
+        _M_ok(__obj._M_ok)
+      { }
+
+      const _Tp&
+      operator*() const
+      {
+
+
+                        ;
+ return _M_value;
+      }
+
+      const _Tp*
+      operator->() const { return std::__addressof((operator*())); }
+
+      istream_iterator&
+      operator++()
+      {
+
+
+                        ;
+ _M_read();
+ return *this;
+      }
+
+      istream_iterator
+      operator++(int)
+      {
+
+
+                        ;
+ istream_iterator __tmp = *this;
+ _M_read();
+ return __tmp;
+      }
+
+      bool
+      _M_equal(const istream_iterator& __x) const
+      { return (_M_ok == __x._M_ok) && (!_M_ok || _M_stream == __x._M_stream); }
+
+    private:
+      void
+      _M_read()
+      {
+ _M_ok = (_M_stream && *_M_stream) ? true : false;
+ if (_M_ok)
+   {
+     *_M_stream >> _M_value;
+     _M_ok = *_M_stream ? true : false;
+   }
+      }
+    };
+
+
+  template<typename _Tp, typename _CharT, typename _Traits, typename _Dist>
+    inline bool
+    operator==(const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __x,
+        const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __y)
+    { return __x._M_equal(__y); }
+
+
+  template <class _Tp, class _CharT, class _Traits, class _Dist>
+    inline bool
+    operator!=(const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __x,
+        const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __y)
+    { return !__x._M_equal(__y); }
+  template<typename _Tp, typename _CharT = char,
+           typename _Traits = char_traits<_CharT> >
+    class ostream_iterator
+    : public iterator<output_iterator_tag, void, void, void, void>
+    {
+    public:
+
+
+      typedef _CharT char_type;
+      typedef _Traits traits_type;
+      typedef basic_ostream<_CharT, _Traits> ostream_type;
+
+
+    private:
+      ostream_type* _M_stream;
+      const _CharT* _M_string;
+
+    public:
+
+      ostream_iterator(ostream_type& __s)
+      : _M_stream(std::__addressof(__s)), _M_string(0) {}
+      ostream_iterator(ostream_type& __s, const _CharT* __c)
+      : _M_stream(&__s), _M_string(__c) { }
+
+
+      ostream_iterator(const ostream_iterator& __obj)
+      : _M_stream(__obj._M_stream), _M_string(__obj._M_string) { }
+
+
+
+      ostream_iterator&
+      operator=(const _Tp& __value)
+      {
+
+
+                        ;
+ *_M_stream << __value;
+ if (_M_string) *_M_stream << _M_string;
+ return *this;
+      }
+
+      ostream_iterator&
+      operator*()
+      { return *this; }
+
+      ostream_iterator&
+      operator++()
+      { return *this; }
+
+      ostream_iterator&
+      operator++(int)
+      { return *this; }
+    };
+
+
+
+
+}
+
+
+
+namespace llvm {
+
+
+
+
+
+template <typename IteratorT>
+class iterator_range {
+  IteratorT begin_iterator, end_iterator;
+
+public:
+
+
+  template <typename Container>
+  iterator_range(Container &&c)
+
+      : begin_iterator(c.begin()), end_iterator(c.end()) {}
+  iterator_range(IteratorT begin_iterator, IteratorT end_iterator)
+      : begin_iterator(std::move(begin_iterator)),
+        end_iterator(std::move(end_iterator)) {}
+
+  IteratorT begin() const { return begin_iterator; }
+  IteratorT end() const { return end_iterator; }
+};
+
+
+
+
+
+template <class T> iterator_range<T> make_range(T x, T y) {
+  return iterator_range<T>(std::move(x), std::move(y));
+}
+
+template <typename T> iterator_range<T> make_range(std::pair<T, T> p) {
+  return iterator_range<T>(std::move(p.first), std::move(p.second));
+}
+
+template<typename T>
+iterator_range<decltype(begin(std::declval<T>()))> drop_begin(T &&t, int n) {
+  return make_range(std::next(begin(t), n), end(t));
+}
+}
+
+
+
+
+namespace llvm {
+class StringRef;
+  class Twine;
+
+
+  typedef void (*fatal_error_handler_t)(void *user_data,
+                                        const std::string& reason,
+                                        bool gen_crash_diag);
+  void install_fatal_error_handler(fatal_error_handler_t handler,
+                                   void *user_data = nullptr);
+
+
+  void remove_fatal_error_handler();
+
+
+
+
+  struct ScopedFatalErrorHandler {
+    explicit ScopedFatalErrorHandler(fatal_error_handler_t handler,
+                                     void *user_data = nullptr) {
+      install_fatal_error_handler(handler, user_data);
+    }
+
+    ~ScopedFatalErrorHandler() { remove_fatal_error_handler(); }
+  };
+__attribute__((noreturn)) void report_fatal_error(const char *reason,
+                                                bool gen_crash_diag = true);
+__attribute__((noreturn)) void report_fatal_error(const std::string &reason,
+                                                bool gen_crash_diag = true);
+__attribute__((noreturn)) void report_fatal_error(StringRef reason,
+                                                bool gen_crash_diag = true);
+__attribute__((noreturn)) void report_fatal_error(const Twine &reason,
+                                                bool gen_crash_diag = true);
+void install_bad_alloc_error_handler(fatal_error_handler_t handler,
+                                     void *user_data = nullptr);
+
+
+void remove_bad_alloc_error_handler();
+void report_bad_alloc_error(const char *Reason, bool GenCrashDiag = true);
+
+
+
+
+__attribute__((noreturn)) void
+llvm_unreachable_internal(const char *msg = nullptr, const char *file = nullptr,
+                          unsigned line = 0);
+}
+
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+       
+       
+
+
+       
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+  template<bool _TrivialValueTypes>
+    struct __uninitialized_copy
+    {
+      template<typename _InputIterator, typename _ForwardIterator>
+        static _ForwardIterator
+        __uninit_copy(_InputIterator __first, _InputIterator __last,
+        _ForwardIterator __result)
+        {
+   _ForwardIterator __cur = __result;
+   if (true)
+     {
+       for (; __first != __last; ++__first, (void)++__cur)
+  std::_Construct(std::__addressof(*__cur), *__first);
+       return __cur;
+     }
+   if (false)
+     {
+       std::_Destroy(__result, __cur);
+       ;
+     }
+ }
+    };
+
+  template<>
+    struct __uninitialized_copy<true>
+    {
+      template<typename _InputIterator, typename _ForwardIterator>
+        static _ForwardIterator
+        __uninit_copy(_InputIterator __first, _InputIterator __last,
+        _ForwardIterator __result)
+        { return std::copy(__first, __last, __result); }
+    };
+  template<typename _InputIterator, typename _ForwardIterator>
+    inline _ForwardIterator
+    uninitialized_copy(_InputIterator __first, _InputIterator __last,
+         _ForwardIterator __result)
+    {
+      typedef typename iterator_traits<_InputIterator>::value_type
+ _ValueType1;
+      typedef typename iterator_traits<_ForwardIterator>::value_type
+ _ValueType2;
+
+
+
+
+      typedef typename iterator_traits<_InputIterator>::reference _RefType1;
+      typedef typename iterator_traits<_ForwardIterator>::reference _RefType2;
+      const bool __assignable = is_assignable<_RefType2, _RefType1>::value;
+
+
+      return std::__uninitialized_copy<__is_trivial(_ValueType1)
+           && __is_trivial(_ValueType2)
+           && __assignable>::
+ __uninit_copy(__first, __last, __result);
+    }
+
+
+  template<bool _TrivialValueType>
+    struct __uninitialized_fill
+    {
+      template<typename _ForwardIterator, typename _Tp>
+        static void
+        __uninit_fill(_ForwardIterator __first, _ForwardIterator __last,
+        const _Tp& __x)
+        {
+   _ForwardIterator __cur = __first;
+   if (true)
+     {
+       for (; __cur != __last; ++__cur)
+  std::_Construct(std::__addressof(*__cur), __x);
+     }
+   if (false)
+     {
+       std::_Destroy(__first, __cur);
+       ;
+     }
+ }
+    };
+
+  template<>
+    struct __uninitialized_fill<true>
+    {
+      template<typename _ForwardIterator, typename _Tp>
+        static void
+        __uninit_fill(_ForwardIterator __first, _ForwardIterator __last,
+        const _Tp& __x)
+        { std::fill(__first, __last, __x); }
+    };
+  template<typename _ForwardIterator, typename _Tp>
+    inline void
+    uninitialized_fill(_ForwardIterator __first, _ForwardIterator __last,
+         const _Tp& __x)
+    {
+      typedef typename iterator_traits<_ForwardIterator>::value_type
+ _ValueType;
+
+
+
+
+      const bool __assignable = is_copy_assignable<_ValueType>::value;
+
+
+      std::__uninitialized_fill<__is_trivial(_ValueType) && __assignable>::
+ __uninit_fill(__first, __last, __x);
+    }
+
+
+  template<bool _TrivialValueType>
+    struct __uninitialized_fill_n
+    {
+      template<typename _ForwardIterator, typename _Size, typename _Tp>
+        static _ForwardIterator
+        __uninit_fill_n(_ForwardIterator __first, _Size __n,
+   const _Tp& __x)
+        {
+   _ForwardIterator __cur = __first;
+   if (true)
+     {
+       for (; __n > 0; --__n, (void) ++__cur)
+  std::_Construct(std::__addressof(*__cur), __x);
+       return __cur;
+     }
+   if (false)
+     {
+       std::_Destroy(__first, __cur);
+       ;
+     }
+ }
+    };
+
+  template<>
+    struct __uninitialized_fill_n<true>
+    {
+      template<typename _ForwardIterator, typename _Size, typename _Tp>
+        static _ForwardIterator
+        __uninit_fill_n(_ForwardIterator __first, _Size __n,
+   const _Tp& __x)
+        { return std::fill_n(__first, __n, __x); }
+    };
+  template<typename _ForwardIterator, typename _Size, typename _Tp>
+    inline _ForwardIterator
+    uninitialized_fill_n(_ForwardIterator __first, _Size __n, const _Tp& __x)
+    {
+      typedef typename iterator_traits<_ForwardIterator>::value_type
+ _ValueType;
+
+
+
+
+      const bool __assignable = is_copy_assignable<_ValueType>::value;
+
+      return __uninitialized_fill_n<__is_trivial(_ValueType) && __assignable>::
+ __uninit_fill_n(__first, __n, __x);
+    }
+
+
+
+
+
+
+
+  template<typename _InputIterator, typename _ForwardIterator,
+    typename _Allocator>
+    _ForwardIterator
+    __uninitialized_copy_a(_InputIterator __first, _InputIterator __last,
+      _ForwardIterator __result, _Allocator& __alloc)
+    {
+      _ForwardIterator __cur = __result;
+      if (true)
+ {
+   typedef __gnu_cxx::__alloc_traits<_Allocator> __traits;
+   for (; __first != __last; ++__first, (void)++__cur)
+     __traits::construct(__alloc, std::__addressof(*__cur), *__first);
+   return __cur;
+ }
+      if (false)
+ {
+   std::_Destroy(__result, __cur, __alloc);
+   ;
+ }
+    }
+
+  template<typename _InputIterator, typename _ForwardIterator, typename _Tp>
+    inline _ForwardIterator
+    __uninitialized_copy_a(_InputIterator __first, _InputIterator __last,
+      _ForwardIterator __result, allocator<_Tp>&)
+    { return std::uninitialized_copy(__first, __last, __result); }
+
+  template<typename _InputIterator, typename _ForwardIterator,
+    typename _Allocator>
+    inline _ForwardIterator
+    __uninitialized_move_a(_InputIterator __first, _InputIterator __last,
+      _ForwardIterator __result, _Allocator& __alloc)
+    {
+      return std::__uninitialized_copy_a(std::make_move_iterator(__first),
+      std::make_move_iterator(__last),
+      __result, __alloc);
+    }
+
+  template<typename _InputIterator, typename _ForwardIterator,
+    typename _Allocator>
+    inline _ForwardIterator
+    __uninitialized_move_if_noexcept_a(_InputIterator __first,
+           _InputIterator __last,
+           _ForwardIterator __result,
+           _Allocator& __alloc)
+    {
+      return std::__uninitialized_copy_a
+ (std::__make_move_if_noexcept_iterator(__first),
+  std::__make_move_if_noexcept_iterator(__last), __result, __alloc);
+    }
+
+  template<typename _ForwardIterator, typename _Tp, typename _Allocator>
+    void
+    __uninitialized_fill_a(_ForwardIterator __first, _ForwardIterator __last,
+      const _Tp& __x, _Allocator& __alloc)
+    {
+      _ForwardIterator __cur = __first;
+      if (true)
+ {
+   typedef __gnu_cxx::__alloc_traits<_Allocator> __traits;
+   for (; __cur != __last; ++__cur)
+     __traits::construct(__alloc, std::__addressof(*__cur), __x);
+ }
+      if (false)
+ {
+   std::_Destroy(__first, __cur, __alloc);
+   ;
+ }
+    }
+
+  template<typename _ForwardIterator, typename _Tp, typename _Tp2>
+    inline void
+    __uninitialized_fill_a(_ForwardIterator __first, _ForwardIterator __last,
+      const _Tp& __x, allocator<_Tp2>&)
+    { std::uninitialized_fill(__first, __last, __x); }
+
+  template<typename _ForwardIterator, typename _Size, typename _Tp,
+    typename _Allocator>
+    _ForwardIterator
+    __uninitialized_fill_n_a(_ForwardIterator __first, _Size __n,
+        const _Tp& __x, _Allocator& __alloc)
+    {
+      _ForwardIterator __cur = __first;
+      if (true)
+ {
+   typedef __gnu_cxx::__alloc_traits<_Allocator> __traits;
+   for (; __n > 0; --__n, (void) ++__cur)
+     __traits::construct(__alloc, std::__addressof(*__cur), __x);
+   return __cur;
+ }
+      if (false)
+ {
+   std::_Destroy(__first, __cur, __alloc);
+   ;
+ }
+    }
+
+  template<typename _ForwardIterator, typename _Size, typename _Tp,
+    typename _Tp2>
+    inline _ForwardIterator
+    __uninitialized_fill_n_a(_ForwardIterator __first, _Size __n,
+        const _Tp& __x, allocator<_Tp2>&)
+    { return std::uninitialized_fill_n(__first, __n, __x); }
+  template<typename _InputIterator1, typename _InputIterator2,
+    typename _ForwardIterator, typename _Allocator>
+    inline _ForwardIterator
+    __uninitialized_copy_move(_InputIterator1 __first1,
+         _InputIterator1 __last1,
+         _InputIterator2 __first2,
+         _InputIterator2 __last2,
+         _ForwardIterator __result,
+         _Allocator& __alloc)
+    {
+      _ForwardIterator __mid = std::__uninitialized_copy_a(__first1, __last1,
+          __result,
+          __alloc);
+      if (true)
+ {
+   return std::__uninitialized_move_a(__first2, __last2, __mid, __alloc);
+ }
+      if (false)
+ {
+   std::_Destroy(__result, __mid, __alloc);
+   ;
+ }
+    }
+
+
+
+
+
+  template<typename _InputIterator1, typename _InputIterator2,
+    typename _ForwardIterator, typename _Allocator>
+    inline _ForwardIterator
+    __uninitialized_move_copy(_InputIterator1 __first1,
+         _InputIterator1 __last1,
+         _InputIterator2 __first2,
+         _InputIterator2 __last2,
+         _ForwardIterator __result,
+         _Allocator& __alloc)
+    {
+      _ForwardIterator __mid = std::__uninitialized_move_a(__first1, __last1,
+          __result,
+          __alloc);
+      if (true)
+ {
+   return std::__uninitialized_copy_a(__first2, __last2, __mid, __alloc);
+ }
+      if (false)
+ {
+   std::_Destroy(__result, __mid, __alloc);
+   ;
+ }
+    }
+
+
+
+
+  template<typename _ForwardIterator, typename _Tp, typename _InputIterator,
+    typename _Allocator>
+    inline _ForwardIterator
+    __uninitialized_fill_move(_ForwardIterator __result, _ForwardIterator __mid,
+         const _Tp& __x, _InputIterator __first,
+         _InputIterator __last, _Allocator& __alloc)
+    {
+      std::__uninitialized_fill_a(__result, __mid, __x, __alloc);
+      if (true)
+ {
+   return std::__uninitialized_move_a(__first, __last, __mid, __alloc);
+ }
+      if (false)
+ {
+   std::_Destroy(__result, __mid, __alloc);
+   ;
+ }
+    }
+
+
+
+
+  template<typename _InputIterator, typename _ForwardIterator, typename _Tp,
+    typename _Allocator>
+    inline void
+    __uninitialized_move_fill(_InputIterator __first1, _InputIterator __last1,
+         _ForwardIterator __first2,
+         _ForwardIterator __last2, const _Tp& __x,
+         _Allocator& __alloc)
+    {
+      _ForwardIterator __mid2 = std::__uninitialized_move_a(__first1, __last1,
+           __first2,
+           __alloc);
+      if (true)
+ {
+   std::__uninitialized_fill_a(__mid2, __last2, __x, __alloc);
+ }
+      if (false)
+ {
+   std::_Destroy(__first2, __mid2, __alloc);
+   ;
+ }
+    }
+
+
+
+
+
+  template<bool _TrivialValueType>
+    struct __uninitialized_default_1
+    {
+      template<typename _ForwardIterator>
+        static void
+        __uninit_default(_ForwardIterator __first, _ForwardIterator __last)
+        {
+   _ForwardIterator __cur = __first;
+   if (true)
+     {
+       for (; __cur != __last; ++__cur)
+  std::_Construct(std::__addressof(*__cur));
+     }
+   if (false)
+     {
+       std::_Destroy(__first, __cur);
+       ;
+     }
+ }
+    };
+
+  template<>
+    struct __uninitialized_default_1<true>
+    {
+      template<typename _ForwardIterator>
+        static void
+        __uninit_default(_ForwardIterator __first, _ForwardIterator __last)
+        {
+   typedef typename iterator_traits<_ForwardIterator>::value_type
+     _ValueType;
+
+   std::fill(__first, __last, _ValueType());
+ }
+    };
+
+  template<bool _TrivialValueType>
+    struct __uninitialized_default_n_1
+    {
+      template<typename _ForwardIterator, typename _Size>
+        static _ForwardIterator
+        __uninit_default_n(_ForwardIterator __first, _Size __n)
+        {
+   _ForwardIterator __cur = __first;
+   if (true)
+     {
+       for (; __n > 0; --__n, (void) ++__cur)
+  std::_Construct(std::__addressof(*__cur));
+       return __cur;
+     }
+   if (false)
+     {
+       std::_Destroy(__first, __cur);
+       ;
+     }
+ }
+    };
+
+  template<>
+    struct __uninitialized_default_n_1<true>
+    {
+      template<typename _ForwardIterator, typename _Size>
+        static _ForwardIterator
+        __uninit_default_n(_ForwardIterator __first, _Size __n)
+        {
+   typedef typename iterator_traits<_ForwardIterator>::value_type
+     _ValueType;
+
+   return std::fill_n(__first, __n, _ValueType());
+ }
+    };
+
+
+
+
+  template<typename _ForwardIterator>
+    inline void
+    __uninitialized_default(_ForwardIterator __first,
+       _ForwardIterator __last)
+    {
+      typedef typename iterator_traits<_ForwardIterator>::value_type
+ _ValueType;
+
+      const bool __assignable = is_copy_assignable<_ValueType>::value;
+
+      std::__uninitialized_default_1<__is_trivial(_ValueType)
+         && __assignable>::
+ __uninit_default(__first, __last);
+    }
+
+
+
+  template<typename _ForwardIterator, typename _Size>
+    inline _ForwardIterator
+    __uninitialized_default_n(_ForwardIterator __first, _Size __n)
+    {
+      typedef typename iterator_traits<_ForwardIterator>::value_type
+ _ValueType;
+
+      const bool __assignable = is_copy_assignable<_ValueType>::value;
+
+      return __uninitialized_default_n_1<__is_trivial(_ValueType)
+           && __assignable>::
+ __uninit_default_n(__first, __n);
+    }
+
+
+
+
+
+  template<typename _ForwardIterator, typename _Allocator>
+    void
+    __uninitialized_default_a(_ForwardIterator __first,
+         _ForwardIterator __last,
+         _Allocator& __alloc)
+    {
+      _ForwardIterator __cur = __first;
+      if (true)
+ {
+   typedef __gnu_cxx::__alloc_traits<_Allocator> __traits;
+   for (; __cur != __last; ++__cur)
+     __traits::construct(__alloc, std::__addressof(*__cur));
+ }
+      if (false)
+ {
+   std::_Destroy(__first, __cur, __alloc);
+   ;
+ }
+    }
+
+  template<typename _ForwardIterator, typename _Tp>
+    inline void
+    __uninitialized_default_a(_ForwardIterator __first,
+         _ForwardIterator __last,
+         allocator<_Tp>&)
+    { std::__uninitialized_default(__first, __last); }
+
+
+
+
+
+  template<typename _ForwardIterator, typename _Size, typename _Allocator>
+    _ForwardIterator
+    __uninitialized_default_n_a(_ForwardIterator __first, _Size __n,
+    _Allocator& __alloc)
+    {
+      _ForwardIterator __cur = __first;
+      if (true)
+ {
+   typedef __gnu_cxx::__alloc_traits<_Allocator> __traits;
+   for (; __n > 0; --__n, (void) ++__cur)
+     __traits::construct(__alloc, std::__addressof(*__cur));
+   return __cur;
+ }
+      if (false)
+ {
+   std::_Destroy(__first, __cur, __alloc);
+   ;
+ }
+    }
+
+  template<typename _ForwardIterator, typename _Size, typename _Tp>
+    inline _ForwardIterator
+    __uninitialized_default_n_a(_ForwardIterator __first, _Size __n,
+    allocator<_Tp>&)
+    { return std::__uninitialized_default_n(__first, __n); }
+
+  template<bool _TrivialValueType>
+    struct __uninitialized_default_novalue_1
+    {
+      template<typename _ForwardIterator>
+ static void
+ __uninit_default_novalue(_ForwardIterator __first,
+     _ForwardIterator __last)
+ {
+   _ForwardIterator __cur = __first;
+   if (true)
+     {
+       for (; __cur != __last; ++__cur)
+  std::_Construct_novalue(std::__addressof(*__cur));
+     }
+   if (false)
+     {
+       std::_Destroy(__first, __cur);
+       ;
+     }
+ }
+    };
+
+  template<>
+    struct __uninitialized_default_novalue_1<true>
+    {
+      template<typename _ForwardIterator>
+        static void
+        __uninit_default_novalue(_ForwardIterator __first,
+     _ForwardIterator __last)
+ {
+ }
+    };
+
+  template<bool _TrivialValueType>
+    struct __uninitialized_default_novalue_n_1
+    {
+      template<typename _ForwardIterator, typename _Size>
+ static _ForwardIterator
+ __uninit_default_novalue_n(_ForwardIterator __first, _Size __n)
+ {
+   _ForwardIterator __cur = __first;
+   if (true)
+     {
+       for (; __n > 0; --__n, (void) ++__cur)
+  std::_Construct_novalue(std::__addressof(*__cur));
+       return __cur;
+     }
+   if (false)
+     {
+       std::_Destroy(__first, __cur);
+       ;
+     }
+ }
+    };
+
+  template<>
+    struct __uninitialized_default_novalue_n_1<true>
+    {
+      template<typename _ForwardIterator, typename _Size>
+ static _ForwardIterator
+ __uninit_default_novalue_n(_ForwardIterator __first, _Size __n)
+ { return std::next(__first, __n); }
+    };
+
+
+
+
+  template<typename _ForwardIterator>
+    inline void
+    __uninitialized_default_novalue(_ForwardIterator __first,
+        _ForwardIterator __last)
+    {
+      typedef typename iterator_traits<_ForwardIterator>::value_type
+ _ValueType;
+
+      std::__uninitialized_default_novalue_1<
+ is_trivially_default_constructible<_ValueType>::value>::
+ __uninit_default_novalue(__first, __last);
+    }
+
+
+
+  template<typename _ForwardIterator, typename _Size>
+    inline _ForwardIterator
+    __uninitialized_default_novalue_n(_ForwardIterator __first, _Size __n)
+    {
+      typedef typename iterator_traits<_ForwardIterator>::value_type
+ _ValueType;
+
+      return __uninitialized_default_novalue_n_1<
+ is_trivially_default_constructible<_ValueType>::value>::
+ __uninit_default_novalue_n(__first, __n);
+    }
+
+  template<typename _InputIterator, typename _Size,
+    typename _ForwardIterator>
+    _ForwardIterator
+    __uninitialized_copy_n(_InputIterator __first, _Size __n,
+      _ForwardIterator __result, input_iterator_tag)
+    {
+      _ForwardIterator __cur = __result;
+      if (true)
+ {
+   for (; __n > 0; --__n, (void) ++__first, ++__cur)
+     std::_Construct(std::__addressof(*__cur), *__first);
+   return __cur;
+ }
+      if (false)
+ {
+   std::_Destroy(__result, __cur);
+   ;
+ }
+    }
+
+  template<typename _RandomAccessIterator, typename _Size,
+    typename _ForwardIterator>
+    inline _ForwardIterator
+    __uninitialized_copy_n(_RandomAccessIterator __first, _Size __n,
+      _ForwardIterator __result,
+      random_access_iterator_tag)
+    { return std::uninitialized_copy(__first, __first + __n, __result); }
+
+  template<typename _InputIterator, typename _Size,
+    typename _ForwardIterator>
+    pair<_InputIterator, _ForwardIterator>
+    __uninitialized_copy_n_pair(_InputIterator __first, _Size __n,
+      _ForwardIterator __result, input_iterator_tag)
+    {
+      _ForwardIterator __cur = __result;
+      if (true)
+ {
+   for (; __n > 0; --__n, (void) ++__first, ++__cur)
+     std::_Construct(std::__addressof(*__cur), *__first);
+   return {__first, __cur};
+ }
+      if (false)
+ {
+   std::_Destroy(__result, __cur);
+   ;
+ }
+    }
+
+  template<typename _RandomAccessIterator, typename _Size,
+    typename _ForwardIterator>
+    inline pair<_RandomAccessIterator, _ForwardIterator>
+    __uninitialized_copy_n_pair(_RandomAccessIterator __first, _Size __n,
+      _ForwardIterator __result,
+      random_access_iterator_tag)
+    {
+      auto __second_res = uninitialized_copy(__first, __first + __n, __result);
+      auto __first_res = std::next(__first, __n);
+      return {__first_res, __second_res};
+    }
+  template<typename _InputIterator, typename _Size, typename _ForwardIterator>
+    inline _ForwardIterator
+    uninitialized_copy_n(_InputIterator __first, _Size __n,
+    _ForwardIterator __result)
+    { return std::__uninitialized_copy_n(__first, __n, __result,
+      std::__iterator_category(__first)); }
+
+  template<typename _InputIterator, typename _Size, typename _ForwardIterator>
+    inline pair<_InputIterator, _ForwardIterator>
+    __uninitialized_copy_n_pair(_InputIterator __first, _Size __n,
+         _ForwardIterator __result)
+    {
+      return
+ std::__uninitialized_copy_n_pair(__first, __n, __result,
+      std::__iterator_category(__first));
+    }
+
+}
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+
+
+
+  template <class _OutputIterator, class _Tp>
+    class raw_storage_iterator
+    : public iterator<output_iterator_tag, void, void, void, void>
+    {
+    protected:
+      _OutputIterator _M_iter;
+
+    public:
+      explicit
+      raw_storage_iterator(_OutputIterator __x)
+      : _M_iter(__x) {}
+
+      raw_storage_iterator&
+      operator*() { return *this; }
+
+      raw_storage_iterator&
+      operator=(const _Tp& __element)
+      {
+ std::_Construct(std::__addressof(*_M_iter), __element);
+ return *this;
+      }
+
+
+
+
+      raw_storage_iterator&
+      operator=(_Tp&& __element)
+      {
+ std::_Construct(std::__addressof(*_M_iter), std::move(__element));
+ return *this;
+      }
+
+
+      raw_storage_iterator&
+      operator++()
+      {
+ ++_M_iter;
+ return *this;
+      }
+
+      raw_storage_iterator
+      operator++(int)
+      {
+ raw_storage_iterator __tmp = *this;
+ ++_M_iter;
+ return __tmp;
+      }
+
+
+
+      _OutputIterator base() const { return _M_iter; }
+    };
+
+
+}
+
+
+
+
+
+
+       
+
+
+
+
+
+
+
+namespace __gnu_cxx __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+
+
+
+
+  enum _Lock_policy { _S_single, _S_mutex, _S_atomic };
+
+
+
+  static const _Lock_policy __default_lock_policy =
+
+
+
+  _S_atomic;
+  class __concurrence_lock_error : public std::exception
+  {
+  public:
+    virtual char const*
+    what() const throw()
+    { return "__gnu_cxx::__concurrence_lock_error"; }
+  };
+
+  class __concurrence_unlock_error : public std::exception
+  {
+  public:
+    virtual char const*
+    what() const throw()
+    { return "__gnu_cxx::__concurrence_unlock_error"; }
+  };
+
+  class __concurrence_broadcast_error : public std::exception
+  {
+  public:
+    virtual char const*
+    what() const throw()
+    { return "__gnu_cxx::__concurrence_broadcast_error"; }
+  };
+
+  class __concurrence_wait_error : public std::exception
+  {
+  public:
+    virtual char const*
+    what() const throw()
+    { return "__gnu_cxx::__concurrence_wait_error"; }
+  };
+
+
+  inline void
+  __throw_concurrence_lock_error()
+  { (__builtin_abort()); }
+
+  inline void
+  __throw_concurrence_unlock_error()
+  { (__builtin_abort()); }
+
+
+  inline void
+  __throw_concurrence_broadcast_error()
+  { (__builtin_abort()); }
+
+  inline void
+  __throw_concurrence_wait_error()
+  { (__builtin_abort()); }
+
+
+  class __mutex
+  {
+  private:
+
+    __gthread_mutex_t _M_mutex = { { 0, 0, 0, 0, 0, 0, 0, { 0, 0 } } };
+
+
+
+
+    __mutex(const __mutex&);
+    __mutex& operator=(const __mutex&);
+
+  public:
+    __mutex()
+    {
+
+
+
+
+    }
+    void lock()
+    {
+
+      if (__gthread_active_p())
+ {
+   if (__gthread_mutex_lock(&_M_mutex) != 0)
+     __throw_concurrence_lock_error();
+ }
+
+    }
+
+    void unlock()
+    {
+
+      if (__gthread_active_p())
+ {
+   if (__gthread_mutex_unlock(&_M_mutex) != 0)
+     __throw_concurrence_unlock_error();
+ }
+
+    }
+
+    __gthread_mutex_t* gthread_mutex(void)
+      { return &_M_mutex; }
+  };
+
+  class __recursive_mutex
+  {
+  private:
+
+    __gthread_recursive_mutex_t _M_mutex = { { 0, 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, 0, 0, { 0, 0 } } };
+
+
+
+
+    __recursive_mutex(const __recursive_mutex&);
+    __recursive_mutex& operator=(const __recursive_mutex&);
+
+  public:
+    __recursive_mutex()
+    {
+
+
+
+
+    }
+    void lock()
+    {
+
+      if (__gthread_active_p())
+ {
+   if (__gthread_recursive_mutex_lock(&_M_mutex) != 0)
+     __throw_concurrence_lock_error();
+ }
+
+    }
+
+    void unlock()
+    {
+
+      if (__gthread_active_p())
+ {
+   if (__gthread_recursive_mutex_unlock(&_M_mutex) != 0)
+     __throw_concurrence_unlock_error();
+ }
+
+    }
+
+    __gthread_recursive_mutex_t* gthread_recursive_mutex(void)
+    { return &_M_mutex; }
+  };
+
+
+
+
+  class __scoped_lock
+  {
+  public:
+    typedef __mutex __mutex_type;
+
+  private:
+    __mutex_type& _M_device;
+
+    __scoped_lock(const __scoped_lock&);
+    __scoped_lock& operator=(const __scoped_lock&);
+
+  public:
+    explicit __scoped_lock(__mutex_type& __name) : _M_device(__name)
+    { _M_device.lock(); }
+
+    ~__scoped_lock() throw()
+    { _M_device.unlock(); }
+  };
+
+
+  class __cond
+  {
+  private:
+
+    __gthread_cond_t _M_cond = { { 0, 0, 0, 0, 0, (void *) 0, 0, 0 } };
+
+
+
+
+    __cond(const __cond&);
+    __cond& operator=(const __cond&);
+
+  public:
+    __cond()
+    {
+
+
+
+
+    }
+    void broadcast()
+    {
+
+      if (__gthread_active_p())
+ {
+   if (__gthread_cond_broadcast(&_M_cond) != 0)
+     __throw_concurrence_broadcast_error();
+ }
+
+    }
+
+    void wait(__mutex *mutex)
+    {
+
+      {
+   if (__gthread_cond_wait(&_M_cond, mutex->gthread_mutex()) != 0)
+     __throw_concurrence_wait_error();
+      }
+
+    }
+
+    void wait_recursive(__recursive_mutex *mutex)
+    {
+
+      {
+   if (__gthread_cond_wait_recursive(&_M_cond,
+         mutex->gthread_recursive_mutex())
+       != 0)
+     __throw_concurrence_wait_error();
+      }
+
+    }
+  };
+
+
+
+}
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+  struct __erased_type { };
+
+  template<typename _Alloc, typename _Tp>
+    using __is_erased_or_convertible
+      = __or_<is_same<_Tp, __erased_type>, is_convertible<_Alloc, _Tp>>;
+
+
+  struct allocator_arg_t { explicit allocator_arg_t() = default; };
+
+  constexpr allocator_arg_t allocator_arg =
+    allocator_arg_t();
+
+  template<typename _Tp, typename _Alloc, typename = __void_t<>>
+    struct __uses_allocator_helper
+    : false_type { };
+
+  template<typename _Tp, typename _Alloc>
+    struct __uses_allocator_helper<_Tp, _Alloc,
+       __void_t<typename _Tp::allocator_type>>
+    : __is_erased_or_convertible<_Alloc, typename _Tp::allocator_type>::type
+    { };
+
+
+  template<typename _Tp, typename _Alloc>
+    struct uses_allocator
+    : __uses_allocator_helper<_Tp, _Alloc>::type
+    { };
+
+  struct __uses_alloc_base { };
+
+  struct __uses_alloc0 : __uses_alloc_base
+  {
+    struct _Sink { void operator=(const void*) { } } _M_a;
+  };
+
+  template<typename _Alloc>
+    struct __uses_alloc1 : __uses_alloc_base { const _Alloc* _M_a; };
+
+  template<typename _Alloc>
+    struct __uses_alloc2 : __uses_alloc_base { const _Alloc* _M_a; };
+
+  template<bool, typename _Tp, typename _Alloc, typename... _Args>
+    struct __uses_alloc;
+
+  template<typename _Tp, typename _Alloc, typename... _Args>
+    struct __uses_alloc<true, _Tp, _Alloc, _Args...>
+    : conditional<
+        is_constructible<_Tp, allocator_arg_t, _Alloc, _Args...>::value,
+        __uses_alloc1<_Alloc>,
+        __uses_alloc2<_Alloc>>::type
+    {
+      static_assert(__or_<
+   is_constructible<_Tp, allocator_arg_t, _Alloc, _Args...>,
+   is_constructible<_Tp, _Args..., _Alloc>>::value, "construction with"
+   " an allocator must be possible if uses_allocator is true");
+    };
+
+  template<typename _Tp, typename _Alloc, typename... _Args>
+    struct __uses_alloc<false, _Tp, _Alloc, _Args...>
+    : __uses_alloc0 { };
+
+  template<typename _Tp, typename _Alloc, typename... _Args>
+    using __uses_alloc_t =
+      __uses_alloc<uses_allocator<_Tp, _Alloc>::value, _Tp, _Alloc, _Args...>;
+
+  template<typename _Tp, typename _Alloc, typename... _Args>
+    inline __uses_alloc_t<_Tp, _Alloc, _Args...>
+    __use_alloc(const _Alloc& __a)
+    {
+      __uses_alloc_t<_Tp, _Alloc, _Args...> __ret;
+      __ret._M_a = std::__addressof(__a);
+      return __ret;
+    }
+
+  template<typename _Tp, typename _Alloc, typename... _Args>
+    void
+    __use_alloc(const _Alloc&&) = delete;
+
+
+
+
+
+
+
+  template<template<typename...> class _Predicate,
+    typename _Tp, typename _Alloc, typename... _Args>
+    struct __is_uses_allocator_predicate
+    : conditional<uses_allocator<_Tp, _Alloc>::value,
+      __or_<_Predicate<_Tp, allocator_arg_t, _Alloc, _Args...>,
+     _Predicate<_Tp, _Args..., _Alloc>>,
+      _Predicate<_Tp, _Args...>>::type { };
+
+  template<typename _Tp, typename _Alloc, typename... _Args>
+    struct __is_uses_allocator_constructible
+    : __is_uses_allocator_predicate<is_constructible, _Tp, _Alloc, _Args...>
+    { };
+
+
+
+
+
+
+
+  template<typename _Tp, typename _Alloc, typename... _Args>
+    struct __is_nothrow_uses_allocator_constructible
+    : __is_uses_allocator_predicate<is_nothrow_constructible,
+        _Tp, _Alloc, _Args...>
+    { };
+  template<typename _Tp, typename... _Args>
+    void __uses_allocator_construct_impl(__uses_alloc0 __a, _Tp* __ptr,
+      _Args&&... __args)
+    { ::new ((void*)__ptr) _Tp(std::forward<_Args>(__args)...); }
+
+  template<typename _Tp, typename _Alloc, typename... _Args>
+    void __uses_allocator_construct_impl(__uses_alloc1<_Alloc> __a, _Tp* __ptr,
+      _Args&&... __args)
+    {
+      ::new ((void*)__ptr) _Tp(allocator_arg, *__a._M_a,
+          std::forward<_Args>(__args)...);
+    }
+
+  template<typename _Tp, typename _Alloc, typename... _Args>
+    void __uses_allocator_construct_impl(__uses_alloc2<_Alloc> __a, _Tp* __ptr,
+      _Args&&... __args)
+    { ::new ((void*)__ptr) _Tp(std::forward<_Args>(__args)..., *__a._M_a); }
+
+  template<typename _Tp, typename _Alloc, typename... _Args>
+    void __uses_allocator_construct(const _Alloc& __a, _Tp* __ptr,
+        _Args&&... __args)
+    {
+      __uses_allocator_construct_impl(__use_alloc<_Tp, _Alloc, _Args...>(__a),
+          __ptr, std::forward<_Args>(__args)...);
+    }
+
+
+}
+
+
+       
+
+
+
+
+
+
+       
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+  template<typename _Tp, std::size_t _Nm>
+    struct __array_traits
+    {
+      typedef _Tp _Type[_Nm];
+      typedef __is_swappable<_Tp> _Is_swappable;
+      typedef __is_nothrow_swappable<_Tp> _Is_nothrow_swappable;
+
+      static constexpr _Tp&
+      _S_ref(const _Type& __t, std::size_t __n) noexcept
+      { return const_cast<_Tp&>(__t[__n]); }
+
+      static constexpr _Tp*
+      _S_ptr(const _Type& __t) noexcept
+      { return const_cast<_Tp*>(__t); }
+    };
+
+ template<typename _Tp>
+   struct __array_traits<_Tp, 0>
+   {
+     struct _Type { };
+     typedef true_type _Is_swappable;
+     typedef true_type _Is_nothrow_swappable;
+
+     static constexpr _Tp&
+     _S_ref(const _Type&, std::size_t) noexcept
+     { return *static_cast<_Tp*>(nullptr); }
+
+     static constexpr _Tp*
+     _S_ptr(const _Type&) noexcept
+     { return nullptr; }
+   };
+  template<typename _Tp, std::size_t _Nm>
+    struct array
+    {
+      typedef _Tp value_type;
+      typedef value_type* pointer;
+      typedef const value_type* const_pointer;
+      typedef value_type& reference;
+      typedef const value_type& const_reference;
+      typedef value_type* iterator;
+      typedef const value_type* const_iterator;
+      typedef std::size_t size_type;
+      typedef std::ptrdiff_t difference_type;
+      typedef std::reverse_iterator<iterator> reverse_iterator;
+      typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+
+
+      typedef std::__array_traits<_Tp, _Nm> _AT_Type;
+      typename _AT_Type::_Type _M_elems;
+
+
+
+
+      void
+      fill(const value_type& __u)
+      { std::fill_n(begin(), size(), __u); }
+
+      void
+      swap(array& __other)
+      noexcept(_AT_Type::_Is_nothrow_swappable::value)
+      { std::swap_ranges(begin(), end(), __other.begin()); }
+
+
+      iterator
+      begin() noexcept
+      { return iterator(data()); }
+
+      const_iterator
+      begin() const noexcept
+      { return const_iterator(data()); }
+
+      iterator
+      end() noexcept
+      { return iterator(data() + _Nm); }
+
+      const_iterator
+      end() const noexcept
+      { return const_iterator(data() + _Nm); }
+
+      reverse_iterator
+      rbegin() noexcept
+      { return reverse_iterator(end()); }
+
+      const_reverse_iterator
+      rbegin() const noexcept
+      { return const_reverse_iterator(end()); }
+
+      reverse_iterator
+      rend() noexcept
+      { return reverse_iterator(begin()); }
+
+      const_reverse_iterator
+      rend() const noexcept
+      { return const_reverse_iterator(begin()); }
+
+      const_iterator
+      cbegin() const noexcept
+      { return const_iterator(data()); }
+
+      const_iterator
+      cend() const noexcept
+      { return const_iterator(data() + _Nm); }
+
+      const_reverse_iterator
+      crbegin() const noexcept
+      { return const_reverse_iterator(end()); }
+
+      const_reverse_iterator
+      crend() const noexcept
+      { return const_reverse_iterator(begin()); }
+
+
+      constexpr size_type
+      size() const noexcept { return _Nm; }
+
+      constexpr size_type
+      max_size() const noexcept { return _Nm; }
+
+      constexpr bool
+      empty() const noexcept { return size() == 0; }
+
+
+      reference
+      operator[](size_type __n) noexcept
+      { return _AT_Type::_S_ref(_M_elems, __n); }
+
+      constexpr const_reference
+      operator[](size_type __n) const noexcept
+      { return _AT_Type::_S_ref(_M_elems, __n); }
+
+      reference
+      at(size_type __n)
+      {
+ if (__n >= _Nm)
+   std::__throw_out_of_range_fmt(("array::at: __n (which is %zu) " ">= _Nm (which is %zu)")
+                                 ,
+     __n, _Nm);
+ return _AT_Type::_S_ref(_M_elems, __n);
+      }
+
+      constexpr const_reference
+      at(size_type __n) const
+      {
+
+
+ return __n < _Nm ? _AT_Type::_S_ref(_M_elems, __n)
+   : (std::__throw_out_of_range_fmt(("array::at: __n (which is %zu) " ">= _Nm (which is %zu)")
+                                    ,
+        __n, _Nm),
+      _AT_Type::_S_ref(_M_elems, 0));
+      }
+
+      reference
+      front() noexcept
+      { return *begin(); }
+
+      constexpr const_reference
+      front() const noexcept
+      { return _AT_Type::_S_ref(_M_elems, 0); }
+
+      reference
+      back() noexcept
+      { return _Nm ? *(end() - 1) : *end(); }
+
+      constexpr const_reference
+      back() const noexcept
+      {
+ return _Nm ? _AT_Type::_S_ref(_M_elems, _Nm - 1)
+             : _AT_Type::_S_ref(_M_elems, 0);
+      }
+
+      pointer
+      data() noexcept
+      { return _AT_Type::_S_ptr(_M_elems); }
+
+      const_pointer
+      data() const noexcept
+      { return _AT_Type::_S_ptr(_M_elems); }
+    };
+  template<typename _Tp, std::size_t _Nm>
+    inline bool
+    operator==(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
+    { return std::equal(__one.begin(), __one.end(), __two.begin()); }
+
+  template<typename _Tp, std::size_t _Nm>
+    inline bool
+    operator!=(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
+    { return !(__one == __two); }
+
+  template<typename _Tp, std::size_t _Nm>
+    inline bool
+    operator<(const array<_Tp, _Nm>& __a, const array<_Tp, _Nm>& __b)
+    {
+      return std::lexicographical_compare(__a.begin(), __a.end(),
+       __b.begin(), __b.end());
+    }
+
+  template<typename _Tp, std::size_t _Nm>
+    inline bool
+    operator>(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
+    { return __two < __one; }
+
+  template<typename _Tp, std::size_t _Nm>
+    inline bool
+    operator<=(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
+    { return !(__one > __two); }
+
+  template<typename _Tp, std::size_t _Nm>
+    inline bool
+    operator>=(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
+    { return !(__one < __two); }
+
+
+  template<typename _Tp, std::size_t _Nm>
+    inline
+
+
+
+
+
+
+    void
+
+    swap(array<_Tp, _Nm>& __one, array<_Tp, _Nm>& __two)
+    noexcept(noexcept(__one.swap(__two)))
+    { __one.swap(__two); }
+  template<std::size_t _Int, typename _Tp, std::size_t _Nm>
+    constexpr _Tp&
+    get(array<_Tp, _Nm>& __arr) noexcept
+    {
+      static_assert(_Int < _Nm, "array index is within bounds");
+      return std::__array_traits<_Tp, _Nm>::
+ _S_ref(__arr._M_elems, _Int);
+    }
+
+  template<std::size_t _Int, typename _Tp, std::size_t _Nm>
+    constexpr _Tp&&
+    get(array<_Tp, _Nm>&& __arr) noexcept
+    {
+      static_assert(_Int < _Nm, "array index is within bounds");
+      return std::move(std::get<_Int>(__arr));
+    }
+
+  template<std::size_t _Int, typename _Tp, std::size_t _Nm>
+    constexpr const _Tp&
+    get(const array<_Tp, _Nm>& __arr) noexcept
+    {
+      static_assert(_Int < _Nm, "array index is within bounds");
+      return std::__array_traits<_Tp, _Nm>::
+ _S_ref(__arr._M_elems, _Int);
+    }
+
+  template<std::size_t _Int, typename _Tp, std::size_t _Nm>
+    constexpr const _Tp&&
+    get(const array<_Tp, _Nm>&& __arr) noexcept
+    {
+      static_assert(_Int < _Nm, "array index is within bounds");
+      return std::move(std::get<_Int>(__arr));
+    }
+
+
+}
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+
+
+  template<typename _Tp>
+    struct tuple_size;
+
+
+  template<typename _Tp, std::size_t _Nm>
+    struct tuple_size<std::array<_Tp, _Nm>>
+    : public integral_constant<std::size_t, _Nm> { };
+
+
+  template<std::size_t _Int, typename _Tp>
+    struct tuple_element;
+
+
+  template<std::size_t _Int, typename _Tp, std::size_t _Nm>
+    struct tuple_element<_Int, std::array<_Tp, _Nm>>
+    {
+      static_assert(_Int < _Nm, "index is out of bounds");
+      typedef _Tp type;
+    };
+
+  template<typename _Tp, std::size_t _Nm>
+    struct __is_tuple_like_impl<std::array<_Tp, _Nm>> : true_type
+    { };
+
+
+}
+
+       
+
+
+
+
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+  template<typename _Tp, typename _Up = typename __inv_unwrap<_Tp>::type>
+    constexpr _Up&&
+    __invfwd(typename remove_reference<_Tp>::type& __t) noexcept
+    { return static_cast<_Up&&>(__t); }
+
+  template<typename _Res, typename _Fn, typename... _Args>
+    constexpr _Res
+    __invoke_impl(__invoke_other, _Fn&& __f, _Args&&... __args)
+    { return std::forward<_Fn>(__f)(std::forward<_Args>(__args)...); }
+
+  template<typename _Res, typename _MemFun, typename _Tp, typename... _Args>
+    constexpr _Res
+    __invoke_impl(__invoke_memfun_ref, _MemFun&& __f, _Tp&& __t,
+    _Args&&... __args)
+    { return (__invfwd<_Tp>(__t).*__f)(std::forward<_Args>(__args)...); }
+
+  template<typename _Res, typename _MemFun, typename _Tp, typename... _Args>
+    constexpr _Res
+    __invoke_impl(__invoke_memfun_deref, _MemFun&& __f, _Tp&& __t,
+    _Args&&... __args)
+    {
+      return ((*std::forward<_Tp>(__t)).*__f)(std::forward<_Args>(__args)...);
+    }
+
+  template<typename _Res, typename _MemPtr, typename _Tp>
+    constexpr _Res
+    __invoke_impl(__invoke_memobj_ref, _MemPtr&& __f, _Tp&& __t)
+    { return __invfwd<_Tp>(__t).*__f; }
+
+  template<typename _Res, typename _MemPtr, typename _Tp>
+    constexpr _Res
+    __invoke_impl(__invoke_memobj_deref, _MemPtr&& __f, _Tp&& __t)
+    { return (*std::forward<_Tp>(__t)).*__f; }
+
+
+  template<typename _Callable, typename... _Args>
+    constexpr typename __invoke_result<_Callable, _Args...>::type
+    __invoke(_Callable&& __fn, _Args&&... __args)
+    noexcept(__is_nothrow_invocable<_Callable, _Args...>::value)
+    {
+      using __result = __invoke_result<_Callable, _Args...>;
+      using __type = typename __result::type;
+      using __tag = typename __result::__invoke_type;
+      return std::__invoke_impl<__type>(__tag{}, std::forward<_Callable>(__fn),
+     std::forward<_Args>(__args)...);
+    }
+
+
+}
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+
+
+
+
+  template<typename... _Elements>
+    class tuple;
+
+  template<typename _Tp>
+    struct __is_empty_non_tuple : is_empty<_Tp> { };
+
+
+  template<typename _El0, typename... _El>
+    struct __is_empty_non_tuple<tuple<_El0, _El...>> : false_type { };
+
+
+  template<typename _Tp>
+    using __empty_not_final
+    = typename conditional<__is_final(_Tp), false_type,
+      __is_empty_non_tuple<_Tp>>::type;
+
+  template<std::size_t _Idx, typename _Head,
+    bool = __empty_not_final<_Head>::value>
+    struct _Head_base;
+
+  template<std::size_t _Idx, typename _Head>
+    struct _Head_base<_Idx, _Head, true>
+    : public _Head
+    {
+      constexpr _Head_base()
+      : _Head() { }
+
+      constexpr _Head_base(const _Head& __h)
+      : _Head(__h) { }
+
+      constexpr _Head_base(const _Head_base&) = default;
+      constexpr _Head_base(_Head_base&&) = default;
+
+      template<typename _UHead>
+        constexpr _Head_base(_UHead&& __h)
+ : _Head(std::forward<_UHead>(__h)) { }
+
+      _Head_base(allocator_arg_t, __uses_alloc0)
+      : _Head() { }
+
+      template<typename _Alloc>
+ _Head_base(allocator_arg_t, __uses_alloc1<_Alloc> __a)
+ : _Head(allocator_arg, *__a._M_a) { }
+
+      template<typename _Alloc>
+ _Head_base(allocator_arg_t, __uses_alloc2<_Alloc> __a)
+ : _Head(*__a._M_a) { }
+
+      template<typename _UHead>
+ _Head_base(__uses_alloc0, _UHead&& __uhead)
+ : _Head(std::forward<_UHead>(__uhead)) { }
+
+      template<typename _Alloc, typename _UHead>
+ _Head_base(__uses_alloc1<_Alloc> __a, _UHead&& __uhead)
+ : _Head(allocator_arg, *__a._M_a, std::forward<_UHead>(__uhead)) { }
+
+      template<typename _Alloc, typename _UHead>
+ _Head_base(__uses_alloc2<_Alloc> __a, _UHead&& __uhead)
+ : _Head(std::forward<_UHead>(__uhead), *__a._M_a) { }
+
+      static constexpr _Head&
+      _M_head(_Head_base& __b) noexcept { return __b; }
+
+      static constexpr const _Head&
+      _M_head(const _Head_base& __b) noexcept { return __b; }
+    };
+
+  template<std::size_t _Idx, typename _Head>
+    struct _Head_base<_Idx, _Head, false>
+    {
+      constexpr _Head_base()
+      : _M_head_impl() { }
+
+      constexpr _Head_base(const _Head& __h)
+      : _M_head_impl(__h) { }
+
+      constexpr _Head_base(const _Head_base&) = default;
+      constexpr _Head_base(_Head_base&&) = default;
+
+      template<typename _UHead>
+        constexpr _Head_base(_UHead&& __h)
+ : _M_head_impl(std::forward<_UHead>(__h)) { }
+
+      _Head_base(allocator_arg_t, __uses_alloc0)
+      : _M_head_impl() { }
+
+      template<typename _Alloc>
+ _Head_base(allocator_arg_t, __uses_alloc1<_Alloc> __a)
+ : _M_head_impl(allocator_arg, *__a._M_a) { }
+
+      template<typename _Alloc>
+ _Head_base(allocator_arg_t, __uses_alloc2<_Alloc> __a)
+ : _M_head_impl(*__a._M_a) { }
+
+      template<typename _UHead>
+ _Head_base(__uses_alloc0, _UHead&& __uhead)
+ : _M_head_impl(std::forward<_UHead>(__uhead)) { }
+
+      template<typename _Alloc, typename _UHead>
+ _Head_base(__uses_alloc1<_Alloc> __a, _UHead&& __uhead)
+ : _M_head_impl(allocator_arg, *__a._M_a, std::forward<_UHead>(__uhead))
+ { }
+
+      template<typename _Alloc, typename _UHead>
+ _Head_base(__uses_alloc2<_Alloc> __a, _UHead&& __uhead)
+ : _M_head_impl(std::forward<_UHead>(__uhead), *__a._M_a) { }
+
+      static constexpr _Head&
+      _M_head(_Head_base& __b) noexcept { return __b._M_head_impl; }
+
+      static constexpr const _Head&
+      _M_head(const _Head_base& __b) noexcept { return __b._M_head_impl; }
+
+      _Head _M_head_impl;
+    };
+  template<std::size_t _Idx, typename... _Elements>
+    struct _Tuple_impl;
+
+
+
+
+
+
+  template<std::size_t _Idx, typename _Head, typename... _Tail>
+    struct _Tuple_impl<_Idx, _Head, _Tail...>
+    : public _Tuple_impl<_Idx + 1, _Tail...>,
+      private _Head_base<_Idx, _Head>
+    {
+      template<std::size_t, typename...> friend class _Tuple_impl;
+
+      typedef _Tuple_impl<_Idx + 1, _Tail...> _Inherited;
+      typedef _Head_base<_Idx, _Head> _Base;
+
+      static constexpr _Head&
+      _M_head(_Tuple_impl& __t) noexcept { return _Base::_M_head(__t); }
+
+      static constexpr const _Head&
+      _M_head(const _Tuple_impl& __t) noexcept { return _Base::_M_head(__t); }
+
+      static constexpr _Inherited&
+      _M_tail(_Tuple_impl& __t) noexcept { return __t; }
+
+      static constexpr const _Inherited&
+      _M_tail(const _Tuple_impl& __t) noexcept { return __t; }
+
+      constexpr _Tuple_impl()
+      : _Inherited(), _Base() { }
+
+      explicit
+      constexpr _Tuple_impl(const _Head& __head, const _Tail&... __tail)
+      : _Inherited(__tail...), _Base(__head) { }
+
+      template<typename _UHead, typename... _UTail, typename = typename
+               enable_if<sizeof...(_Tail) == sizeof...(_UTail)>::type>
+        explicit
+        constexpr _Tuple_impl(_UHead&& __head, _UTail&&... __tail)
+ : _Inherited(std::forward<_UTail>(__tail)...),
+   _Base(std::forward<_UHead>(__head)) { }
+
+      constexpr _Tuple_impl(const _Tuple_impl&) = default;
+
+      constexpr
+      _Tuple_impl(_Tuple_impl&& __in)
+      noexcept(__and_<is_nothrow_move_constructible<_Head>,
+               is_nothrow_move_constructible<_Inherited>>::value)
+      : _Inherited(std::move(_M_tail(__in))),
+ _Base(std::forward<_Head>(_M_head(__in))) { }
+
+      template<typename... _UElements>
+        constexpr _Tuple_impl(const _Tuple_impl<_Idx, _UElements...>& __in)
+ : _Inherited(_Tuple_impl<_Idx, _UElements...>::_M_tail(__in)),
+   _Base(_Tuple_impl<_Idx, _UElements...>::_M_head(__in)) { }
+
+      template<typename _UHead, typename... _UTails>
+        constexpr _Tuple_impl(_Tuple_impl<_Idx, _UHead, _UTails...>&& __in)
+ : _Inherited(std::move
+       (_Tuple_impl<_Idx, _UHead, _UTails...>::_M_tail(__in))),
+   _Base(std::forward<_UHead>
+  (_Tuple_impl<_Idx, _UHead, _UTails...>::_M_head(__in))) { }
+
+      template<typename _Alloc>
+ _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a)
+ : _Inherited(__tag, __a),
+          _Base(__tag, __use_alloc<_Head>(__a)) { }
+
+      template<typename _Alloc>
+ _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a,
+      const _Head& __head, const _Tail&... __tail)
+ : _Inherited(__tag, __a, __tail...),
+          _Base(__use_alloc<_Head, _Alloc, _Head>(__a), __head) { }
+
+      template<typename _Alloc, typename _UHead, typename... _UTail,
+               typename = typename enable_if<sizeof...(_Tail)
+          == sizeof...(_UTail)>::type>
+ _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a,
+             _UHead&& __head, _UTail&&... __tail)
+ : _Inherited(__tag, __a, std::forward<_UTail>(__tail)...),
+          _Base(__use_alloc<_Head, _Alloc, _UHead>(__a),
+         std::forward<_UHead>(__head)) { }
+
+      template<typename _Alloc>
+        _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a,
+             const _Tuple_impl& __in)
+ : _Inherited(__tag, __a, _M_tail(__in)),
+          _Base(__use_alloc<_Head, _Alloc, _Head>(__a), _M_head(__in)) { }
+
+      template<typename _Alloc>
+ _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a,
+             _Tuple_impl&& __in)
+ : _Inherited(__tag, __a, std::move(_M_tail(__in))),
+   _Base(__use_alloc<_Head, _Alloc, _Head>(__a),
+         std::forward<_Head>(_M_head(__in))) { }
+
+      template<typename _Alloc, typename... _UElements>
+ _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a,
+             const _Tuple_impl<_Idx, _UElements...>& __in)
+ : _Inherited(__tag, __a,
+       _Tuple_impl<_Idx, _UElements...>::_M_tail(__in)),
+   _Base(__use_alloc<_Head, _Alloc, _Head>(__a),
+  _Tuple_impl<_Idx, _UElements...>::_M_head(__in)) { }
+
+      template<typename _Alloc, typename _UHead, typename... _UTails>
+ _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a,
+             _Tuple_impl<_Idx, _UHead, _UTails...>&& __in)
+ : _Inherited(__tag, __a, std::move
+       (_Tuple_impl<_Idx, _UHead, _UTails...>::_M_tail(__in))),
+   _Base(__use_alloc<_Head, _Alloc, _UHead>(__a),
+                std::forward<_UHead>
+  (_Tuple_impl<_Idx, _UHead, _UTails...>::_M_head(__in))) { }
+
+      _Tuple_impl&
+      operator=(const _Tuple_impl& __in)
+      {
+ _M_head(*this) = _M_head(__in);
+ _M_tail(*this) = _M_tail(__in);
+ return *this;
+      }
+
+      _Tuple_impl&
+      operator=(_Tuple_impl&& __in)
+      noexcept(__and_<is_nothrow_move_assignable<_Head>,
+               is_nothrow_move_assignable<_Inherited>>::value)
+      {
+ _M_head(*this) = std::forward<_Head>(_M_head(__in));
+ _M_tail(*this) = std::move(_M_tail(__in));
+ return *this;
+      }
+
+      template<typename... _UElements>
+        _Tuple_impl&
+        operator=(const _Tuple_impl<_Idx, _UElements...>& __in)
+        {
+   _M_head(*this) = _Tuple_impl<_Idx, _UElements...>::_M_head(__in);
+   _M_tail(*this) = _Tuple_impl<_Idx, _UElements...>::_M_tail(__in);
+   return *this;
+ }
+
+      template<typename _UHead, typename... _UTails>
+        _Tuple_impl&
+        operator=(_Tuple_impl<_Idx, _UHead, _UTails...>&& __in)
+        {
+   _M_head(*this) = std::forward<_UHead>
+     (_Tuple_impl<_Idx, _UHead, _UTails...>::_M_head(__in));
+   _M_tail(*this) = std::move
+     (_Tuple_impl<_Idx, _UHead, _UTails...>::_M_tail(__in));
+   return *this;
+ }
+
+    protected:
+      void
+      _M_swap(_Tuple_impl& __in)
+      noexcept(__is_nothrow_swappable<_Head>::value
+               && noexcept(_M_tail(__in)._M_swap(_M_tail(__in))))
+      {
+ using std::swap;
+ swap(_M_head(*this), _M_head(__in));
+ _Inherited::_M_swap(_M_tail(__in));
+      }
+    };
+
+
+  template<std::size_t _Idx, typename _Head>
+    struct _Tuple_impl<_Idx, _Head>
+    : private _Head_base<_Idx, _Head>
+    {
+      template<std::size_t, typename...> friend class _Tuple_impl;
+
+      typedef _Head_base<_Idx, _Head> _Base;
+
+      static constexpr _Head&
+      _M_head(_Tuple_impl& __t) noexcept { return _Base::_M_head(__t); }
+
+      static constexpr const _Head&
+      _M_head(const _Tuple_impl& __t) noexcept { return _Base::_M_head(__t); }
+
+      constexpr _Tuple_impl()
+      : _Base() { }
+
+      explicit
+      constexpr _Tuple_impl(const _Head& __head)
+      : _Base(__head) { }
+
+      template<typename _UHead>
+        explicit
+        constexpr _Tuple_impl(_UHead&& __head)
+ : _Base(std::forward<_UHead>(__head)) { }
+
+      constexpr _Tuple_impl(const _Tuple_impl&) = default;
+
+      constexpr
+      _Tuple_impl(_Tuple_impl&& __in)
+      noexcept(is_nothrow_move_constructible<_Head>::value)
+      : _Base(std::forward<_Head>(_M_head(__in))) { }
+
+      template<typename _UHead>
+        constexpr _Tuple_impl(const _Tuple_impl<_Idx, _UHead>& __in)
+ : _Base(_Tuple_impl<_Idx, _UHead>::_M_head(__in)) { }
+
+      template<typename _UHead>
+        constexpr _Tuple_impl(_Tuple_impl<_Idx, _UHead>&& __in)
+ : _Base(std::forward<_UHead>(_Tuple_impl<_Idx, _UHead>::_M_head(__in)))
+ { }
+
+      template<typename _Alloc>
+ _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a)
+ : _Base(__tag, __use_alloc<_Head>(__a)) { }
+
+      template<typename _Alloc>
+ _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a,
+      const _Head& __head)
+ : _Base(__use_alloc<_Head, _Alloc, _Head>(__a), __head) { }
+
+      template<typename _Alloc, typename _UHead>
+ _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a,
+             _UHead&& __head)
+ : _Base(__use_alloc<_Head, _Alloc, _UHead>(__a),
+         std::forward<_UHead>(__head)) { }
+
+      template<typename _Alloc>
+        _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a,
+             const _Tuple_impl& __in)
+ : _Base(__use_alloc<_Head, _Alloc, _Head>(__a), _M_head(__in)) { }
+
+      template<typename _Alloc>
+ _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a,
+             _Tuple_impl&& __in)
+ : _Base(__use_alloc<_Head, _Alloc, _Head>(__a),
+         std::forward<_Head>(_M_head(__in))) { }
+
+      template<typename _Alloc, typename _UHead>
+ _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a,
+             const _Tuple_impl<_Idx, _UHead>& __in)
+ : _Base(__use_alloc<_Head, _Alloc, _Head>(__a),
+  _Tuple_impl<_Idx, _UHead>::_M_head(__in)) { }
+
+      template<typename _Alloc, typename _UHead>
+ _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a,
+             _Tuple_impl<_Idx, _UHead>&& __in)
+ : _Base(__use_alloc<_Head, _Alloc, _UHead>(__a),
+                std::forward<_UHead>(_Tuple_impl<_Idx, _UHead>::_M_head(__in)))
+ { }
+
+      _Tuple_impl&
+      operator=(const _Tuple_impl& __in)
+      {
+ _M_head(*this) = _M_head(__in);
+ return *this;
+      }
+
+      _Tuple_impl&
+      operator=(_Tuple_impl&& __in)
+      noexcept(is_nothrow_move_assignable<_Head>::value)
+      {
+ _M_head(*this) = std::forward<_Head>(_M_head(__in));
+ return *this;
+      }
+
+      template<typename _UHead>
+        _Tuple_impl&
+        operator=(const _Tuple_impl<_Idx, _UHead>& __in)
+        {
+   _M_head(*this) = _Tuple_impl<_Idx, _UHead>::_M_head(__in);
+   return *this;
+ }
+
+      template<typename _UHead>
+        _Tuple_impl&
+        operator=(_Tuple_impl<_Idx, _UHead>&& __in)
+        {
+   _M_head(*this)
+     = std::forward<_UHead>(_Tuple_impl<_Idx, _UHead>::_M_head(__in));
+   return *this;
+ }
+
+    protected:
+      void
+      _M_swap(_Tuple_impl& __in)
+      noexcept(__is_nothrow_swappable<_Head>::value)
+      {
+ using std::swap;
+ swap(_M_head(*this), _M_head(__in));
+      }
+    };
+
+
+
+  template<bool, typename... _Elements>
+  struct _TC
+  {
+    template<typename... _UElements>
+    static constexpr bool _ConstructibleTuple()
+    {
+      return __and_<is_constructible<_Elements, const _UElements&>...>::value;
+    }
+
+    template<typename... _UElements>
+    static constexpr bool _ImplicitlyConvertibleTuple()
+    {
+      return __and_<is_convertible<const _UElements&, _Elements>...>::value;
+    }
+
+    template<typename... _UElements>
+    static constexpr bool _MoveConstructibleTuple()
+    {
+      return __and_<is_constructible<_Elements, _UElements&&>...>::value;
+    }
+
+    template<typename... _UElements>
+    static constexpr bool _ImplicitlyMoveConvertibleTuple()
+    {
+      return __and_<is_convertible<_UElements&&, _Elements>...>::value;
+    }
+
+    template<typename _SrcTuple>
+    static constexpr bool _NonNestedTuple()
+    {
+      return __and_<__not_<is_same<tuple<_Elements...>,
+                                   typename remove_cv<
+                                     typename remove_reference<_SrcTuple>::type
+                                   >::type>>,
+                     __not_<is_convertible<_SrcTuple, _Elements...>>,
+                     __not_<is_constructible<_Elements..., _SrcTuple>>
+              >::value;
+    }
+    template<typename... _UElements>
+    static constexpr bool _NotSameTuple()
+    {
+      return __not_<is_same<tuple<_Elements...>,
+        typename remove_const<
+          typename remove_reference<_UElements...>::type
+          >::type>>::value;
+    }
+  };
+
+  template<typename... _Elements>
+  struct _TC<false, _Elements...>
+  {
+    template<typename... _UElements>
+    static constexpr bool _ConstructibleTuple()
+    {
+      return false;
+    }
+
+    template<typename... _UElements>
+    static constexpr bool _ImplicitlyConvertibleTuple()
+    {
+      return false;
+    }
+
+    template<typename... _UElements>
+    static constexpr bool _MoveConstructibleTuple()
+    {
+      return false;
+    }
+
+    template<typename... _UElements>
+    static constexpr bool _ImplicitlyMoveConvertibleTuple()
+    {
+      return false;
+    }
+
+    template<typename... _UElements>
+    static constexpr bool _NonNestedTuple()
+    {
+      return true;
+    }
+    template<typename... _UElements>
+    static constexpr bool _NotSameTuple()
+    {
+      return true;
+    }
+  };
+
+
+  template<typename... _Elements>
+    class tuple : public _Tuple_impl<0, _Elements...>
+    {
+      typedef _Tuple_impl<0, _Elements...> _Inherited;
+
+
+
+      template<typename _Dummy>
+      struct _TC2
+      {
+        static constexpr bool _DefaultConstructibleTuple()
+        {
+          return __and_<is_default_constructible<_Elements>...>::value;
+        }
+        static constexpr bool _ImplicitlyDefaultConstructibleTuple()
+        {
+          return __and_<__is_implicitly_default_constructible<_Elements>...>
+            ::value;
+        }
+      };
+
+    public:
+      template<typename _Dummy = void,
+               typename enable_if<_TC2<_Dummy>::
+                                    _ImplicitlyDefaultConstructibleTuple(),
+                                  bool>::type = true>
+      constexpr tuple()
+      : _Inherited() { }
+
+      template<typename _Dummy = void,
+               typename enable_if<_TC2<_Dummy>::
+                                    _DefaultConstructibleTuple()
+                                  &&
+                                  !_TC2<_Dummy>::
+                                    _ImplicitlyDefaultConstructibleTuple(),
+                                  bool>::type = false>
+      explicit constexpr tuple()
+      : _Inherited() { }
+
+
+
+      template<typename _Dummy> using _TCC =
+        _TC<is_same<_Dummy, void>::value,
+            _Elements...>;
+
+      template<typename _Dummy = void,
+               typename enable_if<
+                 _TCC<_Dummy>::template
+                   _ConstructibleTuple<_Elements...>()
+                 && _TCC<_Dummy>::template
+                   _ImplicitlyConvertibleTuple<_Elements...>()
+                 && (sizeof...(_Elements) >= 1),
+               bool>::type=true>
+        constexpr tuple(const _Elements&... __elements)
+      : _Inherited(__elements...) { }
+
+      template<typename _Dummy = void,
+               typename enable_if<
+                 _TCC<_Dummy>::template
+                   _ConstructibleTuple<_Elements...>()
+                 && !_TCC<_Dummy>::template
+                   _ImplicitlyConvertibleTuple<_Elements...>()
+                 && (sizeof...(_Elements) >= 1),
+               bool>::type=false>
+      explicit constexpr tuple(const _Elements&... __elements)
+      : _Inherited(__elements...) { }
+
+
+
+      template<typename... _UElements> using _TMC =
+                  _TC<(sizeof...(_Elements) == sizeof...(_UElements))
+        && (_TC<(sizeof...(_UElements)==1), _Elements...>::
+     template _NotSameTuple<_UElements...>()),
+                      _Elements...>;
+
+
+
+      template<typename... _UElements> using _TMCT =
+                  _TC<(sizeof...(_Elements) == sizeof...(_UElements))
+        && !is_same<tuple<_Elements...>,
+      tuple<_UElements...>>::value,
+                      _Elements...>;
+
+      template<typename... _UElements, typename
+        enable_if<
+    _TMC<_UElements...>::template
+                    _MoveConstructibleTuple<_UElements...>()
+                  && _TMC<_UElements...>::template
+                    _ImplicitlyMoveConvertibleTuple<_UElements...>()
+                  && (sizeof...(_Elements) >= 1),
+        bool>::type=true>
+        constexpr tuple(_UElements&&... __elements)
+        : _Inherited(std::forward<_UElements>(__elements)...) { }
+
+      template<typename... _UElements, typename
+        enable_if<
+    _TMC<_UElements...>::template
+                    _MoveConstructibleTuple<_UElements...>()
+                  && !_TMC<_UElements...>::template
+                    _ImplicitlyMoveConvertibleTuple<_UElements...>()
+                  && (sizeof...(_Elements) >= 1),
+        bool>::type=false>
+        explicit constexpr tuple(_UElements&&... __elements)
+ : _Inherited(std::forward<_UElements>(__elements)...) { }
+
+      constexpr tuple(const tuple&) = default;
+
+      constexpr tuple(tuple&&) = default;
+
+
+
+      template<typename _Dummy> using _TNTC =
+        _TC<is_same<_Dummy, void>::value && sizeof...(_Elements) == 1,
+            _Elements...>;
+
+      template<typename... _UElements, typename _Dummy = void, typename
+        enable_if<_TMCT<_UElements...>::template
+                    _ConstructibleTuple<_UElements...>()
+                  && _TMCT<_UElements...>::template
+                    _ImplicitlyConvertibleTuple<_UElements...>()
+                  && _TNTC<_Dummy>::template
+                    _NonNestedTuple<const tuple<_UElements...>&>(),
+        bool>::type=true>
+        constexpr tuple(const tuple<_UElements...>& __in)
+        : _Inherited(static_cast<const _Tuple_impl<0, _UElements...>&>(__in))
+        { }
+
+      template<typename... _UElements, typename _Dummy = void, typename
+        enable_if<_TMCT<_UElements...>::template
+                    _ConstructibleTuple<_UElements...>()
+                  && !_TMCT<_UElements...>::template
+                    _ImplicitlyConvertibleTuple<_UElements...>()
+                  && _TNTC<_Dummy>::template
+                    _NonNestedTuple<const tuple<_UElements...>&>(),
+        bool>::type=false>
+        explicit constexpr tuple(const tuple<_UElements...>& __in)
+        : _Inherited(static_cast<const _Tuple_impl<0, _UElements...>&>(__in))
+        { }
+
+      template<typename... _UElements, typename _Dummy = void, typename
+        enable_if<_TMCT<_UElements...>::template
+                    _MoveConstructibleTuple<_UElements...>()
+                  && _TMCT<_UElements...>::template
+                    _ImplicitlyMoveConvertibleTuple<_UElements...>()
+                  && _TNTC<_Dummy>::template
+                    _NonNestedTuple<tuple<_UElements...>&&>(),
+        bool>::type=true>
+        constexpr tuple(tuple<_UElements...>&& __in)
+        : _Inherited(static_cast<_Tuple_impl<0, _UElements...>&&>(__in)) { }
+
+      template<typename... _UElements, typename _Dummy = void, typename
+        enable_if<_TMCT<_UElements...>::template
+                    _MoveConstructibleTuple<_UElements...>()
+                  && !_TMCT<_UElements...>::template
+                    _ImplicitlyMoveConvertibleTuple<_UElements...>()
+                  && _TNTC<_Dummy>::template
+                    _NonNestedTuple<tuple<_UElements...>&&>(),
+        bool>::type=false>
+        explicit constexpr tuple(tuple<_UElements...>&& __in)
+        : _Inherited(static_cast<_Tuple_impl<0, _UElements...>&&>(__in)) { }
+
+
+
+      template<typename _Alloc>
+ tuple(allocator_arg_t __tag, const _Alloc& __a)
+ : _Inherited(__tag, __a) { }
+
+      template<typename _Alloc, typename _Dummy = void,
+               typename enable_if<
+                 _TCC<_Dummy>::template
+                   _ConstructibleTuple<_Elements...>()
+                 && _TCC<_Dummy>::template
+                   _ImplicitlyConvertibleTuple<_Elements...>(),
+               bool>::type=true>
+ tuple(allocator_arg_t __tag, const _Alloc& __a,
+       const _Elements&... __elements)
+ : _Inherited(__tag, __a, __elements...) { }
+
+      template<typename _Alloc, typename _Dummy = void,
+               typename enable_if<
+                 _TCC<_Dummy>::template
+                   _ConstructibleTuple<_Elements...>()
+                 && !_TCC<_Dummy>::template
+                   _ImplicitlyConvertibleTuple<_Elements...>(),
+               bool>::type=false>
+ explicit tuple(allocator_arg_t __tag, const _Alloc& __a,
+                       const _Elements&... __elements)
+ : _Inherited(__tag, __a, __elements...) { }
+
+      template<typename _Alloc, typename... _UElements, typename
+        enable_if<_TMC<_UElements...>::template
+                    _MoveConstructibleTuple<_UElements...>()
+                  && _TMC<_UElements...>::template
+                    _ImplicitlyMoveConvertibleTuple<_UElements...>(),
+        bool>::type=true>
+ tuple(allocator_arg_t __tag, const _Alloc& __a,
+       _UElements&&... __elements)
+ : _Inherited(__tag, __a, std::forward<_UElements>(__elements)...)
+        { }
+
+      template<typename _Alloc, typename... _UElements, typename
+        enable_if<_TMC<_UElements...>::template
+                    _MoveConstructibleTuple<_UElements...>()
+                  && !_TMC<_UElements...>::template
+                    _ImplicitlyMoveConvertibleTuple<_UElements...>(),
+        bool>::type=false>
+ explicit tuple(allocator_arg_t __tag, const _Alloc& __a,
+       _UElements&&... __elements)
+ : _Inherited(__tag, __a, std::forward<_UElements>(__elements)...)
+        { }
+
+      template<typename _Alloc>
+ tuple(allocator_arg_t __tag, const _Alloc& __a, const tuple& __in)
+ : _Inherited(__tag, __a, static_cast<const _Inherited&>(__in)) { }
+
+      template<typename _Alloc>
+ tuple(allocator_arg_t __tag, const _Alloc& __a, tuple&& __in)
+ : _Inherited(__tag, __a, static_cast<_Inherited&&>(__in)) { }
+
+      template<typename _Alloc, typename _Dummy = void,
+        typename... _UElements, typename
+        enable_if<_TMCT<_UElements...>::template
+                    _ConstructibleTuple<_UElements...>()
+                  && _TMCT<_UElements...>::template
+                    _ImplicitlyConvertibleTuple<_UElements...>()
+                  && _TNTC<_Dummy>::template
+                    _NonNestedTuple<tuple<_UElements...>&&>(),
+        bool>::type=true>
+ tuple(allocator_arg_t __tag, const _Alloc& __a,
+       const tuple<_UElements...>& __in)
+ : _Inherited(__tag, __a,
+              static_cast<const _Tuple_impl<0, _UElements...>&>(__in))
+ { }
+
+      template<typename _Alloc, typename _Dummy = void,
+        typename... _UElements, typename
+        enable_if<_TMCT<_UElements...>::template
+                    _ConstructibleTuple<_UElements...>()
+                  && !_TMCT<_UElements...>::template
+                    _ImplicitlyConvertibleTuple<_UElements...>()
+                  && _TNTC<_Dummy>::template
+                    _NonNestedTuple<tuple<_UElements...>&&>(),
+        bool>::type=false>
+ explicit tuple(allocator_arg_t __tag, const _Alloc& __a,
+       const tuple<_UElements...>& __in)
+ : _Inherited(__tag, __a,
+              static_cast<const _Tuple_impl<0, _UElements...>&>(__in))
+ { }
+
+      template<typename _Alloc, typename _Dummy = void,
+        typename... _UElements, typename
+        enable_if<_TMCT<_UElements...>::template
+                    _MoveConstructibleTuple<_UElements...>()
+                  && _TMCT<_UElements...>::template
+                    _ImplicitlyMoveConvertibleTuple<_UElements...>()
+                  && _TNTC<_Dummy>::template
+                    _NonNestedTuple<tuple<_UElements...>&&>(),
+        bool>::type=true>
+ tuple(allocator_arg_t __tag, const _Alloc& __a,
+       tuple<_UElements...>&& __in)
+ : _Inherited(__tag, __a,
+              static_cast<_Tuple_impl<0, _UElements...>&&>(__in))
+ { }
+
+      template<typename _Alloc, typename _Dummy = void,
+        typename... _UElements, typename
+        enable_if<_TMCT<_UElements...>::template
+                    _MoveConstructibleTuple<_UElements...>()
+                  && !_TMCT<_UElements...>::template
+                    _ImplicitlyMoveConvertibleTuple<_UElements...>()
+                  && _TNTC<_Dummy>::template
+                    _NonNestedTuple<tuple<_UElements...>&&>(),
+        bool>::type=false>
+ explicit tuple(allocator_arg_t __tag, const _Alloc& __a,
+       tuple<_UElements...>&& __in)
+ : _Inherited(__tag, __a,
+              static_cast<_Tuple_impl<0, _UElements...>&&>(__in))
+ { }
+
+      tuple&
+      operator=(const tuple& __in)
+      {
+ static_cast<_Inherited&>(*this) = __in;
+ return *this;
+      }
+
+      tuple&
+      operator=(tuple&& __in)
+      noexcept(is_nothrow_move_assignable<_Inherited>::value)
+      {
+ static_cast<_Inherited&>(*this) = std::move(__in);
+ return *this;
+      }
+
+      template<typename... _UElements>
+ typename
+        enable_if<sizeof...(_UElements)
+    == sizeof...(_Elements), tuple&>::type
+        operator=(const tuple<_UElements...>& __in)
+        {
+   static_cast<_Inherited&>(*this) = __in;
+   return *this;
+ }
+
+      template<typename... _UElements>
+ typename
+        enable_if<sizeof...(_UElements)
+    == sizeof...(_Elements), tuple&>::type
+        operator=(tuple<_UElements...>&& __in)
+        {
+   static_cast<_Inherited&>(*this) = std::move(__in);
+   return *this;
+ }
+
+      void
+      swap(tuple& __in)
+      noexcept(noexcept(__in._M_swap(__in)))
+      { _Inherited::_M_swap(__in); }
+    };
+  template<>
+    class tuple<>
+    {
+    public:
+      void swap(tuple&) noexcept { }
+
+
+      tuple() = default;
+
+      template<typename _Alloc>
+ tuple(allocator_arg_t, const _Alloc&) { }
+      template<typename _Alloc>
+ tuple(allocator_arg_t, const _Alloc&, const tuple&) { }
+    };
+
+
+
+  template<typename _T1, typename _T2>
+    class tuple<_T1, _T2> : public _Tuple_impl<0, _T1, _T2>
+    {
+      typedef _Tuple_impl<0, _T1, _T2> _Inherited;
+
+    public:
+      template <typename _U1 = _T1,
+                typename _U2 = _T2,
+                typename enable_if<__and_<
+                                     __is_implicitly_default_constructible<_U1>,
+                                     __is_implicitly_default_constructible<_U2>>
+                                   ::value, bool>::type = true>
+
+      constexpr tuple()
+      : _Inherited() { }
+
+      template <typename _U1 = _T1,
+                typename _U2 = _T2,
+                typename enable_if<
+                  __and_<
+                    is_default_constructible<_U1>,
+                    is_default_constructible<_U2>,
+                    __not_<
+                      __and_<__is_implicitly_default_constructible<_U1>,
+                             __is_implicitly_default_constructible<_U2>>>>
+                  ::value, bool>::type = false>
+
+      explicit constexpr tuple()
+      : _Inherited() { }
+
+
+
+      template<typename _Dummy> using _TCC =
+        _TC<is_same<_Dummy, void>::value, _T1, _T2>;
+
+      template<typename _Dummy = void, typename
+               enable_if<_TCC<_Dummy>::template
+                           _ConstructibleTuple<_T1, _T2>()
+                         && _TCC<_Dummy>::template
+                           _ImplicitlyConvertibleTuple<_T1, _T2>(),
+ bool>::type = true>
+        constexpr tuple(const _T1& __a1, const _T2& __a2)
+        : _Inherited(__a1, __a2) { }
+
+      template<typename _Dummy = void, typename
+               enable_if<_TCC<_Dummy>::template
+                           _ConstructibleTuple<_T1, _T2>()
+                         && !_TCC<_Dummy>::template
+                           _ImplicitlyConvertibleTuple<_T1, _T2>(),
+ bool>::type = false>
+        explicit constexpr tuple(const _T1& __a1, const _T2& __a2)
+        : _Inherited(__a1, __a2) { }
+
+
+
+      using _TMC = _TC<true, _T1, _T2>;
+
+      template<typename _U1, typename _U2, typename
+        enable_if<_TMC::template
+                    _MoveConstructibleTuple<_U1, _U2>()
+                  && _TMC::template
+                    _ImplicitlyMoveConvertibleTuple<_U1, _U2>()
+           && !is_same<typename decay<_U1>::type,
+         allocator_arg_t>::value,
+ bool>::type = true>
+        constexpr tuple(_U1&& __a1, _U2&& __a2)
+ : _Inherited(std::forward<_U1>(__a1), std::forward<_U2>(__a2)) { }
+
+      template<typename _U1, typename _U2, typename
+        enable_if<_TMC::template
+                    _MoveConstructibleTuple<_U1, _U2>()
+                  && !_TMC::template
+                    _ImplicitlyMoveConvertibleTuple<_U1, _U2>()
+           && !is_same<typename decay<_U1>::type,
+         allocator_arg_t>::value,
+ bool>::type = false>
+        explicit constexpr tuple(_U1&& __a1, _U2&& __a2)
+ : _Inherited(std::forward<_U1>(__a1), std::forward<_U2>(__a2)) { }
+
+      constexpr tuple(const tuple&) = default;
+
+      constexpr tuple(tuple&&) = default;
+
+      template<typename _U1, typename _U2, typename
+        enable_if<_TMC::template
+                    _ConstructibleTuple<_U1, _U2>()
+                  && _TMC::template
+                    _ImplicitlyConvertibleTuple<_U1, _U2>(),
+ bool>::type = true>
+        constexpr tuple(const tuple<_U1, _U2>& __in)
+ : _Inherited(static_cast<const _Tuple_impl<0, _U1, _U2>&>(__in)) { }
+
+      template<typename _U1, typename _U2, typename
+        enable_if<_TMC::template
+                    _ConstructibleTuple<_U1, _U2>()
+                  && !_TMC::template
+                    _ImplicitlyConvertibleTuple<_U1, _U2>(),
+ bool>::type = false>
+        explicit constexpr tuple(const tuple<_U1, _U2>& __in)
+ : _Inherited(static_cast<const _Tuple_impl<0, _U1, _U2>&>(__in)) { }
+
+      template<typename _U1, typename _U2, typename
+        enable_if<_TMC::template
+                    _MoveConstructibleTuple<_U1, _U2>()
+                  && _TMC::template
+                    _ImplicitlyMoveConvertibleTuple<_U1, _U2>(),
+ bool>::type = true>
+        constexpr tuple(tuple<_U1, _U2>&& __in)
+ : _Inherited(static_cast<_Tuple_impl<0, _U1, _U2>&&>(__in)) { }
+
+      template<typename _U1, typename _U2, typename
+        enable_if<_TMC::template
+                    _MoveConstructibleTuple<_U1, _U2>()
+                  && !_TMC::template
+                    _ImplicitlyMoveConvertibleTuple<_U1, _U2>(),
+ bool>::type = false>
+        explicit constexpr tuple(tuple<_U1, _U2>&& __in)
+ : _Inherited(static_cast<_Tuple_impl<0, _U1, _U2>&&>(__in)) { }
+
+      template<typename _U1, typename _U2, typename
+        enable_if<_TMC::template
+                    _ConstructibleTuple<_U1, _U2>()
+                  && _TMC::template
+                    _ImplicitlyConvertibleTuple<_U1, _U2>(),
+ bool>::type = true>
+        constexpr tuple(const pair<_U1, _U2>& __in)
+ : _Inherited(__in.first, __in.second) { }
+
+      template<typename _U1, typename _U2, typename
+        enable_if<_TMC::template
+                    _ConstructibleTuple<_U1, _U2>()
+                  && !_TMC::template
+                    _ImplicitlyConvertibleTuple<_U1, _U2>(),
+ bool>::type = false>
+        explicit constexpr tuple(const pair<_U1, _U2>& __in)
+ : _Inherited(__in.first, __in.second) { }
+
+      template<typename _U1, typename _U2, typename
+        enable_if<_TMC::template
+                    _MoveConstructibleTuple<_U1, _U2>()
+                  && _TMC::template
+                    _ImplicitlyMoveConvertibleTuple<_U1, _U2>(),
+ bool>::type = true>
+        constexpr tuple(pair<_U1, _U2>&& __in)
+ : _Inherited(std::forward<_U1>(__in.first),
+       std::forward<_U2>(__in.second)) { }
+
+      template<typename _U1, typename _U2, typename
+        enable_if<_TMC::template
+                    _MoveConstructibleTuple<_U1, _U2>()
+                  && !_TMC::template
+                    _ImplicitlyMoveConvertibleTuple<_U1, _U2>(),
+ bool>::type = false>
+        explicit constexpr tuple(pair<_U1, _U2>&& __in)
+ : _Inherited(std::forward<_U1>(__in.first),
+       std::forward<_U2>(__in.second)) { }
+
+
+
+      template<typename _Alloc>
+ tuple(allocator_arg_t __tag, const _Alloc& __a)
+ : _Inherited(__tag, __a) { }
+
+      template<typename _Alloc, typename _Dummy = void,
+               typename enable_if<
+                 _TCC<_Dummy>::template
+                   _ConstructibleTuple<_T1, _T2>()
+                 && _TCC<_Dummy>::template
+                   _ImplicitlyConvertibleTuple<_T1, _T2>(),
+               bool>::type=true>
+
+ tuple(allocator_arg_t __tag, const _Alloc& __a,
+       const _T1& __a1, const _T2& __a2)
+ : _Inherited(__tag, __a, __a1, __a2) { }
+
+      template<typename _Alloc, typename _Dummy = void,
+               typename enable_if<
+                 _TCC<_Dummy>::template
+                   _ConstructibleTuple<_T1, _T2>()
+                 && !_TCC<_Dummy>::template
+                   _ImplicitlyConvertibleTuple<_T1, _T2>(),
+               bool>::type=false>
+
+ explicit tuple(allocator_arg_t __tag, const _Alloc& __a,
+       const _T1& __a1, const _T2& __a2)
+ : _Inherited(__tag, __a, __a1, __a2) { }
+
+      template<typename _Alloc, typename _U1, typename _U2, typename
+        enable_if<_TMC::template
+                    _MoveConstructibleTuple<_U1, _U2>()
+                  && _TMC::template
+                    _ImplicitlyMoveConvertibleTuple<_U1, _U2>(),
+ bool>::type = true>
+ tuple(allocator_arg_t __tag, const _Alloc& __a, _U1&& __a1, _U2&& __a2)
+ : _Inherited(__tag, __a, std::forward<_U1>(__a1),
+              std::forward<_U2>(__a2)) { }
+
+      template<typename _Alloc, typename _U1, typename _U2, typename
+        enable_if<_TMC::template
+                    _MoveConstructibleTuple<_U1, _U2>()
+                  && !_TMC::template
+                    _ImplicitlyMoveConvertibleTuple<_U1, _U2>(),
+ bool>::type = false>
+ explicit tuple(allocator_arg_t __tag, const _Alloc& __a,
+                       _U1&& __a1, _U2&& __a2)
+ : _Inherited(__tag, __a, std::forward<_U1>(__a1),
+              std::forward<_U2>(__a2)) { }
+
+      template<typename _Alloc>
+ tuple(allocator_arg_t __tag, const _Alloc& __a, const tuple& __in)
+ : _Inherited(__tag, __a, static_cast<const _Inherited&>(__in)) { }
+
+      template<typename _Alloc>
+ tuple(allocator_arg_t __tag, const _Alloc& __a, tuple&& __in)
+ : _Inherited(__tag, __a, static_cast<_Inherited&&>(__in)) { }
+
+      template<typename _Alloc, typename _U1, typename _U2, typename
+        enable_if<_TMC::template
+                    _ConstructibleTuple<_U1, _U2>()
+                  && _TMC::template
+                    _ImplicitlyConvertibleTuple<_U1, _U2>(),
+ bool>::type = true>
+ tuple(allocator_arg_t __tag, const _Alloc& __a,
+       const tuple<_U1, _U2>& __in)
+ : _Inherited(__tag, __a,
+              static_cast<const _Tuple_impl<0, _U1, _U2>&>(__in))
+ { }
+
+      template<typename _Alloc, typename _U1, typename _U2, typename
+        enable_if<_TMC::template
+                    _ConstructibleTuple<_U1, _U2>()
+                  && !_TMC::template
+                    _ImplicitlyConvertibleTuple<_U1, _U2>(),
+ bool>::type = false>
+ explicit tuple(allocator_arg_t __tag, const _Alloc& __a,
+       const tuple<_U1, _U2>& __in)
+ : _Inherited(__tag, __a,
+              static_cast<const _Tuple_impl<0, _U1, _U2>&>(__in))
+ { }
+
+      template<typename _Alloc, typename _U1, typename _U2, typename
+        enable_if<_TMC::template
+                    _MoveConstructibleTuple<_U1, _U2>()
+                  && _TMC::template
+                    _ImplicitlyMoveConvertibleTuple<_U1, _U2>(),
+ bool>::type = true>
+ tuple(allocator_arg_t __tag, const _Alloc& __a, tuple<_U1, _U2>&& __in)
+ : _Inherited(__tag, __a, static_cast<_Tuple_impl<0, _U1, _U2>&&>(__in))
+ { }
+
+      template<typename _Alloc, typename _U1, typename _U2, typename
+        enable_if<_TMC::template
+                    _MoveConstructibleTuple<_U1, _U2>()
+                  && !_TMC::template
+                    _ImplicitlyMoveConvertibleTuple<_U1, _U2>(),
+ bool>::type = false>
+ explicit tuple(allocator_arg_t __tag, const _Alloc& __a,
+                       tuple<_U1, _U2>&& __in)
+ : _Inherited(__tag, __a, static_cast<_Tuple_impl<0, _U1, _U2>&&>(__in))
+ { }
+
+      template<typename _Alloc, typename _U1, typename _U2, typename
+        enable_if<_TMC::template
+                    _ConstructibleTuple<_U1, _U2>()
+                  && _TMC::template
+                    _ImplicitlyConvertibleTuple<_U1, _U2>(),
+ bool>::type = true>
+        tuple(allocator_arg_t __tag, const _Alloc& __a,
+       const pair<_U1, _U2>& __in)
+ : _Inherited(__tag, __a, __in.first, __in.second) { }
+
+      template<typename _Alloc, typename _U1, typename _U2, typename
+        enable_if<_TMC::template
+                    _ConstructibleTuple<_U1, _U2>()
+                  && !_TMC::template
+                    _ImplicitlyConvertibleTuple<_U1, _U2>(),
+ bool>::type = false>
+        explicit tuple(allocator_arg_t __tag, const _Alloc& __a,
+       const pair<_U1, _U2>& __in)
+ : _Inherited(__tag, __a, __in.first, __in.second) { }
+
+      template<typename _Alloc, typename _U1, typename _U2, typename
+        enable_if<_TMC::template
+                    _MoveConstructibleTuple<_U1, _U2>()
+                  && _TMC::template
+                    _ImplicitlyMoveConvertibleTuple<_U1, _U2>(),
+ bool>::type = true>
+        tuple(allocator_arg_t __tag, const _Alloc& __a, pair<_U1, _U2>&& __in)
+ : _Inherited(__tag, __a, std::forward<_U1>(__in.first),
+       std::forward<_U2>(__in.second)) { }
+
+      template<typename _Alloc, typename _U1, typename _U2, typename
+        enable_if<_TMC::template
+                    _MoveConstructibleTuple<_U1, _U2>()
+                  && !_TMC::template
+                    _ImplicitlyMoveConvertibleTuple<_U1, _U2>(),
+ bool>::type = false>
+        explicit tuple(allocator_arg_t __tag, const _Alloc& __a,
+                       pair<_U1, _U2>&& __in)
+ : _Inherited(__tag, __a, std::forward<_U1>(__in.first),
+       std::forward<_U2>(__in.second)) { }
+
+      tuple&
+      operator=(const tuple& __in)
+      {
+ static_cast<_Inherited&>(*this) = __in;
+ return *this;
+      }
+
+      tuple&
+      operator=(tuple&& __in)
+      noexcept(is_nothrow_move_assignable<_Inherited>::value)
+      {
+ static_cast<_Inherited&>(*this) = std::move(__in);
+ return *this;
+      }
+
+      template<typename _U1, typename _U2>
+        tuple&
+        operator=(const tuple<_U1, _U2>& __in)
+        {
+   static_cast<_Inherited&>(*this) = __in;
+   return *this;
+ }
+
+      template<typename _U1, typename _U2>
+        tuple&
+        operator=(tuple<_U1, _U2>&& __in)
+        {
+   static_cast<_Inherited&>(*this) = std::move(__in);
+   return *this;
+ }
+
+      template<typename _U1, typename _U2>
+        tuple&
+        operator=(const pair<_U1, _U2>& __in)
+        {
+   this->_M_head(*this) = __in.first;
+   this->_M_tail(*this)._M_head(*this) = __in.second;
+   return *this;
+ }
+
+      template<typename _U1, typename _U2>
+        tuple&
+        operator=(pair<_U1, _U2>&& __in)
+        {
+   this->_M_head(*this) = std::forward<_U1>(__in.first);
+   this->_M_tail(*this)._M_head(*this) = std::forward<_U2>(__in.second);
+   return *this;
+ }
+
+      void
+      swap(tuple& __in)
+      noexcept(noexcept(__in._M_swap(__in)))
+      { _Inherited::_M_swap(__in); }
+    };
+
+
+
+  template<typename... _Elements>
+    struct tuple_size<tuple<_Elements...>>
+    : public integral_constant<std::size_t, sizeof...(_Elements)> { };
+  template<std::size_t __i, typename _Head, typename... _Tail>
+    struct tuple_element<__i, tuple<_Head, _Tail...> >
+    : tuple_element<__i - 1, tuple<_Tail...> > { };
+
+
+
+
+  template<typename _Head, typename... _Tail>
+    struct tuple_element<0, tuple<_Head, _Tail...> >
+    {
+      typedef _Head type;
+    };
+
+
+
+
+  template<size_t __i>
+    struct tuple_element<__i, tuple<>>
+    {
+      static_assert(__i < tuple_size<tuple<>>::value,
+   "tuple index is in range");
+    };
+
+  template<std::size_t __i, typename _Head, typename... _Tail>
+    constexpr _Head&
+    __get_helper(_Tuple_impl<__i, _Head, _Tail...>& __t) noexcept
+    { return _Tuple_impl<__i, _Head, _Tail...>::_M_head(__t); }
+
+  template<std::size_t __i, typename _Head, typename... _Tail>
+    constexpr const _Head&
+    __get_helper(const _Tuple_impl<__i, _Head, _Tail...>& __t) noexcept
+    { return _Tuple_impl<__i, _Head, _Tail...>::_M_head(__t); }
+
+
+  template<std::size_t __i, typename... _Elements>
+    constexpr __tuple_element_t<__i, tuple<_Elements...>>&
+    get(tuple<_Elements...>& __t) noexcept
+    { return std::__get_helper<__i>(__t); }
+
+
+  template<std::size_t __i, typename... _Elements>
+    constexpr const __tuple_element_t<__i, tuple<_Elements...>>&
+    get(const tuple<_Elements...>& __t) noexcept
+    { return std::__get_helper<__i>(__t); }
+
+
+  template<std::size_t __i, typename... _Elements>
+    constexpr __tuple_element_t<__i, tuple<_Elements...>>&&
+    get(tuple<_Elements...>&& __t) noexcept
+    {
+      typedef __tuple_element_t<__i, tuple<_Elements...>> __element_type;
+      return std::forward<__element_type&&>(std::get<__i>(__t));
+    }
+
+
+  template<std::size_t __i, typename... _Elements>
+    constexpr const __tuple_element_t<__i, tuple<_Elements...>>&&
+    get(const tuple<_Elements...>&& __t) noexcept
+    {
+      typedef __tuple_element_t<__i, tuple<_Elements...>> __element_type;
+      return std::forward<const __element_type&&>(std::get<__i>(__t));
+    }
+  template<typename _Tp, typename _Up, size_t __i, size_t __size>
+    struct __tuple_compare
+    {
+      static constexpr bool
+      __eq(const _Tp& __t, const _Up& __u)
+      {
+ return bool(std::get<__i>(__t) == std::get<__i>(__u))
+   && __tuple_compare<_Tp, _Up, __i + 1, __size>::__eq(__t, __u);
+      }
+
+      static constexpr bool
+      __less(const _Tp& __t, const _Up& __u)
+      {
+ return bool(std::get<__i>(__t) < std::get<__i>(__u))
+   || (!bool(std::get<__i>(__u) < std::get<__i>(__t))
+       && __tuple_compare<_Tp, _Up, __i + 1, __size>::__less(__t, __u));
+      }
+    };
+
+  template<typename _Tp, typename _Up, size_t __size>
+    struct __tuple_compare<_Tp, _Up, __size, __size>
+    {
+      static constexpr bool
+      __eq(const _Tp&, const _Up&) { return true; }
+
+      static constexpr bool
+      __less(const _Tp&, const _Up&) { return false; }
+    };
+
+  template<typename... _TElements, typename... _UElements>
+    constexpr bool
+    operator==(const tuple<_TElements...>& __t,
+        const tuple<_UElements...>& __u)
+    {
+      static_assert(sizeof...(_TElements) == sizeof...(_UElements),
+   "tuple objects can only be compared if they have equal sizes.");
+      using __compare = __tuple_compare<tuple<_TElements...>,
+     tuple<_UElements...>,
+     0, sizeof...(_TElements)>;
+      return __compare::__eq(__t, __u);
+    }
+
+  template<typename... _TElements, typename... _UElements>
+    constexpr bool
+    operator<(const tuple<_TElements...>& __t,
+       const tuple<_UElements...>& __u)
+    {
+      static_assert(sizeof...(_TElements) == sizeof...(_UElements),
+   "tuple objects can only be compared if they have equal sizes.");
+      using __compare = __tuple_compare<tuple<_TElements...>,
+     tuple<_UElements...>,
+     0, sizeof...(_TElements)>;
+      return __compare::__less(__t, __u);
+    }
+
+  template<typename... _TElements, typename... _UElements>
+    constexpr bool
+    operator!=(const tuple<_TElements...>& __t,
+        const tuple<_UElements...>& __u)
+    { return !(__t == __u); }
+
+  template<typename... _TElements, typename... _UElements>
+    constexpr bool
+    operator>(const tuple<_TElements...>& __t,
+       const tuple<_UElements...>& __u)
+    { return __u < __t; }
+
+  template<typename... _TElements, typename... _UElements>
+    constexpr bool
+    operator<=(const tuple<_TElements...>& __t,
+        const tuple<_UElements...>& __u)
+    { return !(__u < __t); }
+
+  template<typename... _TElements, typename... _UElements>
+    constexpr bool
+    operator>=(const tuple<_TElements...>& __t,
+        const tuple<_UElements...>& __u)
+    { return !(__t < __u); }
+
+
+  template<typename... _Elements>
+    constexpr tuple<typename __decay_and_strip<_Elements>::__type...>
+    make_tuple(_Elements&&... __args)
+    {
+      typedef tuple<typename __decay_and_strip<_Elements>::__type...>
+ __result_type;
+      return __result_type(std::forward<_Elements>(__args)...);
+    }
+
+
+
+  template<typename... _Elements>
+    constexpr tuple<_Elements&&...>
+    forward_as_tuple(_Elements&&... __args) noexcept
+    { return tuple<_Elements&&...>(std::forward<_Elements>(__args)...); }
+
+  template<size_t, typename, typename, size_t>
+    struct __make_tuple_impl;
+
+  template<size_t _Idx, typename _Tuple, typename... _Tp, size_t _Nm>
+    struct __make_tuple_impl<_Idx, tuple<_Tp...>, _Tuple, _Nm>
+    : __make_tuple_impl<_Idx + 1,
+   tuple<_Tp..., __tuple_element_t<_Idx, _Tuple>>,
+   _Tuple, _Nm>
+    { };
+
+  template<std::size_t _Nm, typename _Tuple, typename... _Tp>
+    struct __make_tuple_impl<_Nm, tuple<_Tp...>, _Tuple, _Nm>
+    {
+      typedef tuple<_Tp...> __type;
+    };
+
+  template<typename _Tuple>
+    struct __do_make_tuple
+    : __make_tuple_impl<0, tuple<>, _Tuple, std::tuple_size<_Tuple>::value>
+    { };
+
+
+  template<typename _Tuple>
+    struct __make_tuple
+    : public __do_make_tuple<typename std::remove_cv
+            <typename std::remove_reference<_Tuple>::type>::type>
+    { };
+
+
+  template<typename...>
+    struct __combine_tuples;
+
+  template<>
+    struct __combine_tuples<>
+    {
+      typedef tuple<> __type;
+    };
+
+  template<typename... _Ts>
+    struct __combine_tuples<tuple<_Ts...>>
+    {
+      typedef tuple<_Ts...> __type;
+    };
+
+  template<typename... _T1s, typename... _T2s, typename... _Rem>
+    struct __combine_tuples<tuple<_T1s...>, tuple<_T2s...>, _Rem...>
+    {
+      typedef typename __combine_tuples<tuple<_T1s..., _T2s...>,
+     _Rem...>::__type __type;
+    };
+
+
+  template<typename... _Tpls>
+    struct __tuple_cat_result
+    {
+      typedef typename __combine_tuples
+        <typename __make_tuple<_Tpls>::__type...>::__type __type;
+    };
+
+
+
+  template<typename...>
+    struct __make_1st_indices;
+
+  template<>
+    struct __make_1st_indices<>
+    {
+      typedef std::_Index_tuple<> __type;
+    };
+
+  template<typename _Tp, typename... _Tpls>
+    struct __make_1st_indices<_Tp, _Tpls...>
+    {
+      typedef typename std::_Build_index_tuple<std::tuple_size<
+ typename std::remove_reference<_Tp>::type>::value>::__type __type;
+    };
+
+
+
+
+  template<typename _Ret, typename _Indices, typename... _Tpls>
+    struct __tuple_concater;
+
+  template<typename _Ret, std::size_t... _Is, typename _Tp, typename... _Tpls>
+    struct __tuple_concater<_Ret, std::_Index_tuple<_Is...>, _Tp, _Tpls...>
+    {
+      template<typename... _Us>
+        static constexpr _Ret
+        _S_do(_Tp&& __tp, _Tpls&&... __tps, _Us&&... __us)
+        {
+   typedef typename __make_1st_indices<_Tpls...>::__type __idx;
+   typedef __tuple_concater<_Ret, __idx, _Tpls...> __next;
+   return __next::_S_do(std::forward<_Tpls>(__tps)...,
+          std::forward<_Us>(__us)...,
+          std::get<_Is>(std::forward<_Tp>(__tp))...);
+ }
+    };
+
+  template<typename _Ret>
+    struct __tuple_concater<_Ret, std::_Index_tuple<>>
+    {
+      template<typename... _Us>
+ static constexpr _Ret
+ _S_do(_Us&&... __us)
+        {
+   return _Ret(std::forward<_Us>(__us)...);
+ }
+    };
+
+
+  template<typename... _Tpls, typename = typename
+           enable_if<__and_<__is_tuple_like<_Tpls>...>::value>::type>
+    constexpr auto
+    tuple_cat(_Tpls&&... __tpls)
+    -> typename __tuple_cat_result<_Tpls...>::__type
+    {
+      typedef typename __tuple_cat_result<_Tpls...>::__type __ret;
+      typedef typename __make_1st_indices<_Tpls...>::__type __idx;
+      typedef __tuple_concater<__ret, __idx, _Tpls...> __concater;
+      return __concater::_S_do(std::forward<_Tpls>(__tpls)...);
+    }
+
+
+
+
+  template<typename... _Elements>
+    constexpr tuple<_Elements&...>
+    tie(_Elements&... __args) noexcept
+    { return tuple<_Elements&...>(__args...); }
+
+
+  template<typename... _Elements>
+    inline
+
+
+
+
+
+    void
+
+    swap(tuple<_Elements...>& __x, tuple<_Elements...>& __y)
+    noexcept(noexcept(__x.swap(__y)))
+    { __x.swap(__y); }
+  struct _Swallow_assign
+  {
+    template<class _Tp>
+      const _Swallow_assign&
+      operator=(const _Tp&) const
+      { return *this; }
+  };
+
+
+
+  constexpr _Swallow_assign ignore{};
+
+
+  template<typename... _Types, typename _Alloc>
+    struct uses_allocator<tuple<_Types...>, _Alloc> : true_type { };
+
+
+  template<class _T1, class _T2>
+    template<typename... _Args1, typename... _Args2>
+      inline
+      pair<_T1, _T2>::
+      pair(piecewise_construct_t,
+    tuple<_Args1...> __first, tuple<_Args2...> __second)
+      : pair(__first, __second,
+      typename _Build_index_tuple<sizeof...(_Args1)>::__type(),
+      typename _Build_index_tuple<sizeof...(_Args2)>::__type())
+      { }
+
+  template<class _T1, class _T2>
+    template<typename... _Args1, std::size_t... _Indexes1,
+             typename... _Args2, std::size_t... _Indexes2>
+      inline
+      pair<_T1, _T2>::
+      pair(tuple<_Args1...>& __tuple1, tuple<_Args2...>& __tuple2,
+    _Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>)
+      : first(std::forward<_Args1>(std::get<_Indexes1>(__tuple1))...),
+        second(std::forward<_Args2>(std::get<_Indexes2>(__tuple2))...)
+      { }
+
+}
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+
+
+
+
+
+  template<typename> class auto_ptr;
+
+
+
+  template<typename _Tp>
+    struct default_delete
+    {
+
+      constexpr default_delete() noexcept = default;
+
+
+
+
+
+
+      template<typename _Up, typename = typename
+        enable_if<is_convertible<_Up*, _Tp*>::value>::type>
+        default_delete(const default_delete<_Up>&) noexcept { }
+
+
+      void
+      operator()(_Tp* __ptr) const
+      {
+ static_assert(!is_void<_Tp>::value,
+        "can't delete pointer to incomplete type");
+ static_assert(sizeof(_Tp)>0,
+        "can't delete pointer to incomplete type");
+ delete __ptr;
+      }
+    };
+
+
+
+
+  template<typename _Tp>
+    struct default_delete<_Tp[]>
+    {
+    public:
+
+      constexpr default_delete() noexcept = default;
+      template<typename _Up, typename = typename
+        enable_if<is_convertible<_Up(*)[], _Tp(*)[]>::value>::type>
+        default_delete(const default_delete<_Up[]>&) noexcept { }
+
+
+      template<typename _Up>
+      typename enable_if<is_convertible<_Up(*)[], _Tp(*)[]>::value>::type
+ operator()(_Up* __ptr) const
+      {
+ static_assert(sizeof(_Tp)>0,
+        "can't delete pointer to incomplete type");
+ delete [] __ptr;
+      }
+    };
+
+  template <typename _Tp, typename _Dp>
+    class __uniq_ptr_impl
+    {
+      template <typename _Up, typename _Ep, typename = void>
+ struct _Ptr
+ {
+   using type = _Up*;
+ };
+
+      template <typename _Up, typename _Ep>
+ struct
+ _Ptr<_Up, _Ep, __void_t<typename remove_reference<_Ep>::type::pointer>>
+ {
+   using type = typename remove_reference<_Ep>::type::pointer;
+ };
+
+    public:
+      using _DeleterConstraint = enable_if<
+        __and_<__not_<is_pointer<_Dp>>,
+        is_default_constructible<_Dp>>::value>;
+
+      using pointer = typename _Ptr<_Tp, _Dp>::type;
+
+      __uniq_ptr_impl() = default;
+      __uniq_ptr_impl(pointer __p) : _M_t() { _M_ptr() = __p; }
+
+      template<typename _Del>
+      __uniq_ptr_impl(pointer __p, _Del&& __d)
+ : _M_t(__p, std::forward<_Del>(__d)) { }
+
+      pointer& _M_ptr() { return std::get<0>(_M_t); }
+      pointer _M_ptr() const { return std::get<0>(_M_t); }
+      _Dp& _M_deleter() { return std::get<1>(_M_t); }
+      const _Dp& _M_deleter() const { return std::get<1>(_M_t); }
+
+    private:
+      tuple<pointer, _Dp> _M_t;
+    };
+
+
+  template <typename _Tp, typename _Dp = default_delete<_Tp>>
+    class unique_ptr
+    {
+      template <class _Up>
+      using _DeleterConstraint =
+ typename __uniq_ptr_impl<_Tp, _Up>::_DeleterConstraint::type;
+
+      __uniq_ptr_impl<_Tp, _Dp> _M_t;
+
+    public:
+      using pointer = typename __uniq_ptr_impl<_Tp, _Dp>::pointer;
+      using element_type = _Tp;
+      using deleter_type = _Dp;
+
+
+
+      template<typename _Up, typename _Ep>
+ using __safe_conversion_up = __and_<
+         is_convertible<typename unique_ptr<_Up, _Ep>::pointer, pointer>,
+                __not_<is_array<_Up>>,
+                __or_<__and_<is_reference<deleter_type>,
+                             is_same<deleter_type, _Ep>>,
+                      __and_<__not_<is_reference<deleter_type>>,
+                             is_convertible<_Ep, deleter_type>>
+                >
+              >;
+
+
+
+
+      template <typename _Up = _Dp,
+  typename = _DeleterConstraint<_Up>>
+ constexpr unique_ptr() noexcept
+ : _M_t()
+        { }
+
+
+
+
+
+
+
+      template <typename _Up = _Dp,
+  typename = _DeleterConstraint<_Up>>
+ explicit
+ unique_ptr(pointer __p) noexcept
+ : _M_t(__p)
+        { }
+      unique_ptr(pointer __p,
+   typename conditional<is_reference<deleter_type>::value,
+     deleter_type, const deleter_type&>::type __d) noexcept
+      : _M_t(__p, __d) { }
+      unique_ptr(pointer __p,
+   typename remove_reference<deleter_type>::type&& __d) noexcept
+      : _M_t(std::move(__p), std::move(__d))
+      { static_assert(!std::is_reference<deleter_type>::value,
+        "rvalue deleter bound to reference"); }
+
+
+      template <typename _Up = _Dp,
+  typename = _DeleterConstraint<_Up>>
+ constexpr unique_ptr(nullptr_t) noexcept : unique_ptr() { }
+
+
+
+
+      unique_ptr(unique_ptr&& __u) noexcept
+      : _M_t(__u.release(), std::forward<deleter_type>(__u.get_deleter())) { }
+
+
+
+
+
+
+
+      template<typename _Up, typename _Ep, typename = _Require<
+               __safe_conversion_up<_Up, _Ep>,
+        typename conditional<is_reference<_Dp>::value,
+        is_same<_Ep, _Dp>,
+        is_convertible<_Ep, _Dp>>::type>>
+ unique_ptr(unique_ptr<_Up, _Ep>&& __u) noexcept
+ : _M_t(__u.release(), std::forward<_Ep>(__u.get_deleter()))
+ { }
+
+
+
+      template<typename _Up, typename = _Require<
+        is_convertible<_Up*, _Tp*>, is_same<_Dp, default_delete<_Tp>>>>
+ unique_ptr(auto_ptr<_Up>&& __u) noexcept;
+
+
+
+      ~unique_ptr() noexcept
+      {
+ auto& __ptr = _M_t._M_ptr();
+ if (__ptr != nullptr)
+   get_deleter()(__ptr);
+ __ptr = pointer();
+      }
+      unique_ptr&
+      operator=(unique_ptr&& __u) noexcept
+      {
+ reset(__u.release());
+ get_deleter() = std::forward<deleter_type>(__u.get_deleter());
+ return *this;
+      }
+      template<typename _Up, typename _Ep>
+        typename enable_if< __and_<
+          __safe_conversion_up<_Up, _Ep>,
+          is_assignable<deleter_type&, _Ep&&>
+          >::value,
+          unique_ptr&>::type
+ operator=(unique_ptr<_Up, _Ep>&& __u) noexcept
+ {
+   reset(__u.release());
+   get_deleter() = std::forward<_Ep>(__u.get_deleter());
+   return *this;
+ }
+
+
+      unique_ptr&
+      operator=(nullptr_t) noexcept
+      {
+ reset();
+ return *this;
+      }
+
+
+
+
+      typename add_lvalue_reference<element_type>::type
+      operator*() const
+      {
+ ;
+ return *get();
+      }
+
+
+      pointer
+      operator->() const noexcept
+      {
+ ;
+ return get();
+      }
+
+
+      pointer
+      get() const noexcept
+      { return _M_t._M_ptr(); }
+
+
+      deleter_type&
+      get_deleter() noexcept
+      { return _M_t._M_deleter(); }
+
+
+      const deleter_type&
+      get_deleter() const noexcept
+      { return _M_t._M_deleter(); }
+
+
+      explicit operator bool() const noexcept
+      { return get() == pointer() ? false : true; }
+
+
+
+
+      pointer
+      release() noexcept
+      {
+ pointer __p = get();
+ _M_t._M_ptr() = pointer();
+ return __p;
+      }
+
+
+
+
+
+
+
+      void
+      reset(pointer __p = pointer()) noexcept
+      {
+ using std::swap;
+ swap(_M_t._M_ptr(), __p);
+ if (__p != pointer())
+   get_deleter()(__p);
+      }
+
+
+      void
+      swap(unique_ptr& __u) noexcept
+      {
+ using std::swap;
+ swap(_M_t, __u._M_t);
+      }
+
+
+      unique_ptr(const unique_ptr&) = delete;
+      unique_ptr& operator=(const unique_ptr&) = delete;
+  };
+
+
+
+
+
+  template<typename _Tp, typename _Dp>
+    class unique_ptr<_Tp[], _Dp>
+    {
+      template <typename _Up>
+      using _DeleterConstraint =
+ typename __uniq_ptr_impl<_Tp, _Up>::_DeleterConstraint::type;
+
+      __uniq_ptr_impl<_Tp, _Dp> _M_t;
+
+      template<typename _Up>
+ using __remove_cv = typename remove_cv<_Up>::type;
+
+
+      template<typename _Up>
+ using __is_derived_Tp
+   = __and_< is_base_of<_Tp, _Up>,
+      __not_<is_same<__remove_cv<_Tp>, __remove_cv<_Up>>> >;
+
+    public:
+      using pointer = typename __uniq_ptr_impl<_Tp, _Dp>::pointer;
+      using element_type = _Tp;
+      using deleter_type = _Dp;
+
+
+
+      template<typename _Up, typename _Ep,
+               typename _Up_up = unique_ptr<_Up, _Ep>,
+        typename _Up_element_type = typename _Up_up::element_type>
+ using __safe_conversion_up = __and_<
+          is_array<_Up>,
+          is_same<pointer, element_type*>,
+          is_same<typename _Up_up::pointer, _Up_element_type*>,
+          is_convertible<_Up_element_type(*)[], element_type(*)[]>,
+          __or_<__and_<is_reference<deleter_type>, is_same<deleter_type, _Ep>>,
+                __and_<__not_<is_reference<deleter_type>>,
+                       is_convertible<_Ep, deleter_type>>>
+        >;
+
+
+      template<typename _Up>
+        using __safe_conversion_raw = __and_<
+          __or_<__or_<is_same<_Up, pointer>,
+                      is_same<_Up, nullptr_t>>,
+                __and_<is_pointer<_Up>,
+                       is_same<pointer, element_type*>,
+                       is_convertible<
+                         typename remove_pointer<_Up>::type(*)[],
+                         element_type(*)[]>
+                >
+          >
+        >;
+
+
+
+
+      template <typename _Up = _Dp,
+  typename = _DeleterConstraint<_Up>>
+ constexpr unique_ptr() noexcept
+ : _M_t()
+        { }
+      template<typename _Up,
+        typename _Vp = _Dp,
+        typename = _DeleterConstraint<_Vp>,
+        typename = typename enable_if<
+                 __safe_conversion_raw<_Up>::value, bool>::type>
+ explicit
+ unique_ptr(_Up __p) noexcept
+ : _M_t(__p)
+        { }
+      template<typename _Up,
+               typename = typename enable_if<
+                 __safe_conversion_raw<_Up>::value, bool>::type>
+      unique_ptr(_Up __p,
+                 typename conditional<is_reference<deleter_type>::value,
+                 deleter_type, const deleter_type&>::type __d) noexcept
+      : _M_t(__p, __d) { }
+      template<typename _Up,
+               typename = typename enable_if<
+                 __safe_conversion_raw<_Up>::value, bool>::type>
+      unique_ptr(_Up __p, typename
+   remove_reference<deleter_type>::type&& __d) noexcept
+      : _M_t(std::move(__p), std::move(__d))
+      { static_assert(!is_reference<deleter_type>::value,
+        "rvalue deleter bound to reference"); }
+
+
+      unique_ptr(unique_ptr&& __u) noexcept
+      : _M_t(__u.release(), std::forward<deleter_type>(__u.get_deleter())) { }
+
+
+      template <typename _Up = _Dp,
+  typename = _DeleterConstraint<_Up>>
+ constexpr unique_ptr(nullptr_t) noexcept : unique_ptr() { }
+
+      template<typename _Up, typename _Ep,
+        typename = _Require<__safe_conversion_up<_Up, _Ep>>>
+ unique_ptr(unique_ptr<_Up, _Ep>&& __u) noexcept
+ : _M_t(__u.release(), std::forward<_Ep>(__u.get_deleter()))
+ { }
+
+
+      ~unique_ptr()
+      {
+ auto& __ptr = _M_t._M_ptr();
+ if (__ptr != nullptr)
+   get_deleter()(__ptr);
+ __ptr = pointer();
+      }
+      unique_ptr&
+      operator=(unique_ptr&& __u) noexcept
+      {
+ reset(__u.release());
+ get_deleter() = std::forward<deleter_type>(__u.get_deleter());
+ return *this;
+      }
+      template<typename _Up, typename _Ep>
+ typename
+ enable_if<__and_<__safe_conversion_up<_Up, _Ep>,
+                         is_assignable<deleter_type&, _Ep&&>
+                  >::value,
+                  unique_ptr&>::type
+ operator=(unique_ptr<_Up, _Ep>&& __u) noexcept
+ {
+   reset(__u.release());
+   get_deleter() = std::forward<_Ep>(__u.get_deleter());
+   return *this;
+ }
+
+
+      unique_ptr&
+      operator=(nullptr_t) noexcept
+      {
+ reset();
+ return *this;
+      }
+
+
+
+
+      typename std::add_lvalue_reference<element_type>::type
+      operator[](size_t __i) const
+      {
+ ;
+ return get()[__i];
+      }
+
+
+      pointer
+      get() const noexcept
+      { return _M_t._M_ptr(); }
+
+
+      deleter_type&
+      get_deleter() noexcept
+      { return _M_t._M_deleter(); }
+
+
+      const deleter_type&
+      get_deleter() const noexcept
+      { return _M_t._M_deleter(); }
+
+
+      explicit operator bool() const noexcept
+      { return get() == pointer() ? false : true; }
+
+
+
+
+      pointer
+      release() noexcept
+      {
+ pointer __p = get();
+ _M_t._M_ptr() = pointer();
+ return __p;
+      }
+
+
+
+
+
+
+
+      template <typename _Up,
+                typename = _Require<
+                  __or_<is_same<_Up, pointer>,
+                        __and_<is_same<pointer, element_type*>,
+                               is_pointer<_Up>,
+                               is_convertible<
+                                 typename remove_pointer<_Up>::type(*)[],
+                                 element_type(*)[]
+                               >
+                        >
+                  >
+               >>
+      void
+      reset(_Up __p) noexcept
+      {
+ pointer __ptr = __p;
+ using std::swap;
+ swap(_M_t._M_ptr(), __ptr);
+ if (__ptr != nullptr)
+   get_deleter()(__ptr);
+      }
+
+      void reset(nullptr_t = nullptr) noexcept
+      {
+        reset(pointer());
+      }
+
+
+      void
+      swap(unique_ptr& __u) noexcept
+      {
+ using std::swap;
+ swap(_M_t, __u._M_t);
+      }
+
+
+      unique_ptr(const unique_ptr&) = delete;
+      unique_ptr& operator=(const unique_ptr&) = delete;
+    };
+
+  template<typename _Tp, typename _Dp>
+    inline
+
+
+
+
+    void
+
+    swap(unique_ptr<_Tp, _Dp>& __x,
+  unique_ptr<_Tp, _Dp>& __y) noexcept
+    { __x.swap(__y); }
+  template<typename _Tp, typename _Dp,
+    typename _Up, typename _Ep>
+    inline bool
+    operator==(const unique_ptr<_Tp, _Dp>& __x,
+        const unique_ptr<_Up, _Ep>& __y)
+    { return __x.get() == __y.get(); }
+
+  template<typename _Tp, typename _Dp>
+    inline bool
+    operator==(const unique_ptr<_Tp, _Dp>& __x, nullptr_t) noexcept
+    { return !__x; }
+
+  template<typename _Tp, typename _Dp>
+    inline bool
+    operator==(nullptr_t, const unique_ptr<_Tp, _Dp>& __x) noexcept
+    { return !__x; }
+
+  template<typename _Tp, typename _Dp,
+    typename _Up, typename _Ep>
+    inline bool
+    operator!=(const unique_ptr<_Tp, _Dp>& __x,
+        const unique_ptr<_Up, _Ep>& __y)
+    { return __x.get() != __y.get(); }
+
+  template<typename _Tp, typename _Dp>
+    inline bool
+    operator!=(const unique_ptr<_Tp, _Dp>& __x, nullptr_t) noexcept
+    { return (bool)__x; }
+
+  template<typename _Tp, typename _Dp>
+    inline bool
+    operator!=(nullptr_t, const unique_ptr<_Tp, _Dp>& __x) noexcept
+    { return (bool)__x; }
+
+  template<typename _Tp, typename _Dp,
+    typename _Up, typename _Ep>
+    inline bool
+    operator<(const unique_ptr<_Tp, _Dp>& __x,
+       const unique_ptr<_Up, _Ep>& __y)
+    {
+      typedef typename
+ std::common_type<typename unique_ptr<_Tp, _Dp>::pointer,
+                  typename unique_ptr<_Up, _Ep>::pointer>::type _CT;
+      return std::less<_CT>()(__x.get(), __y.get());
+    }
+
+  template<typename _Tp, typename _Dp>
+    inline bool
+    operator<(const unique_ptr<_Tp, _Dp>& __x, nullptr_t)
+    { return std::less<typename unique_ptr<_Tp, _Dp>::pointer>()(__x.get(),
+         nullptr); }
+
+  template<typename _Tp, typename _Dp>
+    inline bool
+    operator<(nullptr_t, const unique_ptr<_Tp, _Dp>& __x)
+    { return std::less<typename unique_ptr<_Tp, _Dp>::pointer>()(nullptr,
+         __x.get()); }
+
+  template<typename _Tp, typename _Dp,
+    typename _Up, typename _Ep>
+    inline bool
+    operator<=(const unique_ptr<_Tp, _Dp>& __x,
+        const unique_ptr<_Up, _Ep>& __y)
+    { return !(__y < __x); }
+
+  template<typename _Tp, typename _Dp>
+    inline bool
+    operator<=(const unique_ptr<_Tp, _Dp>& __x, nullptr_t)
+    { return !(nullptr < __x); }
+
+  template<typename _Tp, typename _Dp>
+    inline bool
+    operator<=(nullptr_t, const unique_ptr<_Tp, _Dp>& __x)
+    { return !(__x < nullptr); }
+
+  template<typename _Tp, typename _Dp,
+    typename _Up, typename _Ep>
+    inline bool
+    operator>(const unique_ptr<_Tp, _Dp>& __x,
+       const unique_ptr<_Up, _Ep>& __y)
+    { return (__y < __x); }
+
+  template<typename _Tp, typename _Dp>
+    inline bool
+    operator>(const unique_ptr<_Tp, _Dp>& __x, nullptr_t)
+    { return std::less<typename unique_ptr<_Tp, _Dp>::pointer>()(nullptr,
+         __x.get()); }
+
+  template<typename _Tp, typename _Dp>
+    inline bool
+    operator>(nullptr_t, const unique_ptr<_Tp, _Dp>& __x)
+    { return std::less<typename unique_ptr<_Tp, _Dp>::pointer>()(__x.get(),
+         nullptr); }
+
+  template<typename _Tp, typename _Dp,
+    typename _Up, typename _Ep>
+    inline bool
+    operator>=(const unique_ptr<_Tp, _Dp>& __x,
+        const unique_ptr<_Up, _Ep>& __y)
+    { return !(__x < __y); }
+
+  template<typename _Tp, typename _Dp>
+    inline bool
+    operator>=(const unique_ptr<_Tp, _Dp>& __x, nullptr_t)
+    { return !(__x < nullptr); }
+
+  template<typename _Tp, typename _Dp>
+    inline bool
+    operator>=(nullptr_t, const unique_ptr<_Tp, _Dp>& __x)
+    { return !(nullptr < __x); }
+
+
+  template<typename _Tp, typename _Dp>
+    struct hash<unique_ptr<_Tp, _Dp>>
+    : public __hash_base<size_t, unique_ptr<_Tp, _Dp>>,
+    private __poison_hash<typename unique_ptr<_Tp, _Dp>::pointer>
+    {
+      size_t
+      operator()(const unique_ptr<_Tp, _Dp>& __u) const noexcept
+      {
+ typedef unique_ptr<_Tp, _Dp> _UP;
+ return std::hash<typename _UP::pointer>()(__u.get());
+      }
+    };
+
+}
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+  template<typename _Alloc>
+    struct __allocated_ptr
+    {
+      using pointer = typename allocator_traits<_Alloc>::pointer;
+      using value_type = typename allocator_traits<_Alloc>::value_type;
+
+
+      __allocated_ptr(_Alloc& __a, pointer __ptr) noexcept
+      : _M_alloc(std::__addressof(__a)), _M_ptr(__ptr)
+      { }
+
+
+      template<typename _Ptr,
+        typename _Req = _Require<is_same<_Ptr, value_type*>>>
+      __allocated_ptr(_Alloc& __a, _Ptr __ptr)
+      : _M_alloc(std::__addressof(__a)),
+ _M_ptr(pointer_traits<pointer>::pointer_to(*__ptr))
+      { }
+
+
+      __allocated_ptr(__allocated_ptr&& __gd) noexcept
+      : _M_alloc(__gd._M_alloc), _M_ptr(__gd._M_ptr)
+      { __gd._M_ptr = nullptr; }
+
+
+      ~__allocated_ptr()
+      {
+ if (_M_ptr != nullptr)
+   std::allocator_traits<_Alloc>::deallocate(*_M_alloc, _M_ptr, 1);
+      }
+
+
+      __allocated_ptr&
+      operator=(std::nullptr_t) noexcept
+      {
+ _M_ptr = nullptr;
+ return *this;
+      }
+
+
+      value_type* get() { return std::__to_address(_M_ptr); }
+
+    private:
+      _Alloc* _M_alloc;
+      pointer _M_ptr;
+    };
+
+
+  template<typename _Alloc>
+    __allocated_ptr<_Alloc>
+    __allocate_guarded(_Alloc& __a)
+    {
+      return { __a, std::allocator_traits<_Alloc>::allocate(__a, 1) };
+    }
+
+
+}
+       
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+
+
+
+
+  template<typename _Res, typename... _ArgTypes>
+    struct _Maybe_unary_or_binary_function { };
+
+
+  template<typename _Res, typename _T1>
+    struct _Maybe_unary_or_binary_function<_Res, _T1>
+    : std::unary_function<_T1, _Res> { };
+
+
+  template<typename _Res, typename _T1, typename _T2>
+    struct _Maybe_unary_or_binary_function<_Res, _T1, _T2>
+    : std::binary_function<_T1, _T2, _Res> { };
+
+  template<typename _Signature>
+    struct _Mem_fn_traits;
+
+  template<typename _Res, typename _Class, typename... _ArgTypes>
+    struct _Mem_fn_traits_base
+    {
+      using __result_type = _Res;
+      using __maybe_type
+ = _Maybe_unary_or_binary_function<_Res, _Class*, _ArgTypes...>;
+      using __arity = integral_constant<size_t, sizeof...(_ArgTypes)>;
+    };
+template<typename _Res, typename _Class, typename... _ArgTypes> struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes...) > : _Mem_fn_traits_base<_Res, _Class, _ArgTypes...> { using __vararg = false_type; }; template<typename _Res, typename _Class, typename... _ArgTypes> struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes... ...) > : _Mem_fn_traits_base<_Res, _Class, _ArgTypes...> { using __vararg = true_type; }; template<typename _Res, typename _Class, typename... _ArgTypes> struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes...) const > : _Mem_fn_traits_base<_Res, const _Class, _ArgTypes...> { using __vararg = false_type; }; template<typename _Res, typename _Class, typename... _ArgTypes> struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes... ...) const > : _Mem_fn_traits_base<_Res, const _Class, _ArgTypes...> { using __vararg = true_type; }; template<typename _Res, typename _Class, typename... _ArgTypes> struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes...) volatile > : _Mem_fn_traits_base<_Res, volatile _Class, _ArgTypes...> { using __vararg = false_type; }; template<typename _Res, typename _Class, typename... _ArgTypes> struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes... ...) volatile > : _Mem_fn_traits_base<_Res, volatile _Class, _ArgTypes...> { using __vararg = true_type; }; template<typename _Res, typename _Class, typename... _ArgTypes> struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes...) const volatile > : _Mem_fn_traits_base<_Res, const volatile _Class, _ArgTypes...> { using __vararg = false_type; }; template<typename _Res, typename _Class, typename... _ArgTypes> struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes... ...) const volatile > : _Mem_fn_traits_base<_Res, const volatile _Class, _ArgTypes...> { using __vararg = true_type; };
+template<typename _Res, typename _Class, typename... _ArgTypes> struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes...) &> : _Mem_fn_traits_base<_Res, _Class, _ArgTypes...> { using __vararg = false_type; }; template<typename _Res, typename _Class, typename... _ArgTypes> struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes... ...) &> : _Mem_fn_traits_base<_Res, _Class, _ArgTypes...> { using __vararg = true_type; }; template<typename _Res, typename _Class, typename... _ArgTypes> struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes...) const &> : _Mem_fn_traits_base<_Res, const _Class, _ArgTypes...> { using __vararg = false_type; }; template<typename _Res, typename _Class, typename... _ArgTypes> struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes... ...) const &> : _Mem_fn_traits_base<_Res, const _Class, _ArgTypes...> { using __vararg = true_type; }; template<typename _Res, typename _Class, typename... _ArgTypes> struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes...) volatile &> : _Mem_fn_traits_base<_Res, volatile _Class, _ArgTypes...> { using __vararg = false_type; }; template<typename _Res, typename _Class, typename... _ArgTypes> struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes... ...) volatile &> : _Mem_fn_traits_base<_Res, volatile _Class, _ArgTypes...> { using __vararg = true_type; }; template<typename _Res, typename _Class, typename... _ArgTypes> struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes...) const volatile &> : _Mem_fn_traits_base<_Res, const volatile _Class, _ArgTypes...> { using __vararg = false_type; }; template<typename _Res, typename _Class, typename... _ArgTypes> struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes... ...) const volatile &> : _Mem_fn_traits_base<_Res, const volatile _Class, _ArgTypes...> { using __vararg = true_type; };
+template<typename _Res, typename _Class, typename... _ArgTypes> struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes...) &&> : _Mem_fn_traits_base<_Res, _Class, _ArgTypes...> { using __vararg = false_type; }; template<typename _Res, typename _Class, typename... _ArgTypes> struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes... ...) &&> : _Mem_fn_traits_base<_Res, _Class, _ArgTypes...> { using __vararg = true_type; }; template<typename _Res, typename _Class, typename... _ArgTypes> struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes...) const &&> : _Mem_fn_traits_base<_Res, const _Class, _ArgTypes...> { using __vararg = false_type; }; template<typename _Res, typename _Class, typename... _ArgTypes> struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes... ...) const &&> : _Mem_fn_traits_base<_Res, const _Class, _ArgTypes...> { using __vararg = true_type; }; template<typename _Res, typename _Class, typename... _ArgTypes> struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes...) volatile &&> : _Mem_fn_traits_base<_Res, volatile _Class, _ArgTypes...> { using __vararg = false_type; }; template<typename _Res, typename _Class, typename... _ArgTypes> struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes... ...) volatile &&> : _Mem_fn_traits_base<_Res, volatile _Class, _ArgTypes...> { using __vararg = true_type; }; template<typename _Res, typename _Class, typename... _ArgTypes> struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes...) const volatile &&> : _Mem_fn_traits_base<_Res, const volatile _Class, _ArgTypes...> { using __vararg = false_type; }; template<typename _Res, typename _Class, typename... _ArgTypes> struct _Mem_fn_traits<_Res (_Class::*)(_ArgTypes... ...) const volatile &&> : _Mem_fn_traits_base<_Res, const volatile _Class, _ArgTypes...> { using __vararg = true_type; };
+  template<typename _Functor, typename = __void_t<>>
+    struct _Maybe_get_result_type
+    { };
+
+  template<typename _Functor>
+    struct _Maybe_get_result_type<_Functor,
+      __void_t<typename _Functor::result_type>>
+    { typedef typename _Functor::result_type result_type; };
+
+
+
+
+
+  template<typename _Functor>
+    struct _Weak_result_type_impl
+    : _Maybe_get_result_type<_Functor>
+    { };
+
+
+  template<typename _Res, typename... _ArgTypes >
+    struct _Weak_result_type_impl<_Res(_ArgTypes...) >
+    { typedef _Res result_type; };
+
+
+  template<typename _Res, typename... _ArgTypes >
+    struct _Weak_result_type_impl<_Res(_ArgTypes......) >
+    { typedef _Res result_type; };
+
+
+  template<typename _Res, typename... _ArgTypes >
+    struct _Weak_result_type_impl<_Res(*)(_ArgTypes...) >
+    { typedef _Res result_type; };
+
+
+  template<typename _Res, typename... _ArgTypes >
+    struct
+    _Weak_result_type_impl<_Res(*)(_ArgTypes......) >
+    { typedef _Res result_type; };
+
+
+  template<typename _Functor,
+    bool = is_member_function_pointer<_Functor>::value>
+    struct _Weak_result_type_memfun
+    : _Weak_result_type_impl<_Functor>
+    { };
+
+
+  template<typename _MemFunPtr>
+    struct _Weak_result_type_memfun<_MemFunPtr, true>
+    {
+      using result_type = typename _Mem_fn_traits<_MemFunPtr>::__result_type;
+    };
+
+
+  template<typename _Func, typename _Class>
+    struct _Weak_result_type_memfun<_Func _Class::*, false>
+    { };
+
+
+
+
+
+  template<typename _Functor>
+    struct _Weak_result_type
+    : _Weak_result_type_memfun<typename remove_cv<_Functor>::type>
+    { };
+
+
+  template<typename _Tp, typename = __void_t<>>
+    struct _Refwrap_base_arg1
+    { };
+
+
+  template<typename _Tp>
+    struct _Refwrap_base_arg1<_Tp,
+         __void_t<typename _Tp::argument_type>>
+    {
+      typedef typename _Tp::argument_type argument_type;
+    };
+
+
+  template<typename _Tp, typename = __void_t<>>
+    struct _Refwrap_base_arg2
+    { };
+
+
+  template<typename _Tp>
+    struct _Refwrap_base_arg2<_Tp,
+         __void_t<typename _Tp::first_argument_type,
+           typename _Tp::second_argument_type>>
+    {
+      typedef typename _Tp::first_argument_type first_argument_type;
+      typedef typename _Tp::second_argument_type second_argument_type;
+    };
+
+
+
+
+
+
+
+  template<typename _Tp>
+    struct _Reference_wrapper_base
+    : _Weak_result_type<_Tp>, _Refwrap_base_arg1<_Tp>, _Refwrap_base_arg2<_Tp>
+    { };
+
+
+  template<typename _Res, typename _T1 >
+    struct _Reference_wrapper_base<_Res(_T1) >
+    : unary_function<_T1, _Res>
+    { };
+
+  template<typename _Res, typename _T1>
+    struct _Reference_wrapper_base<_Res(_T1) const>
+    : unary_function<_T1, _Res>
+    { };
+
+  template<typename _Res, typename _T1>
+    struct _Reference_wrapper_base<_Res(_T1) volatile>
+    : unary_function<_T1, _Res>
+    { };
+
+  template<typename _Res, typename _T1>
+    struct _Reference_wrapper_base<_Res(_T1) const volatile>
+    : unary_function<_T1, _Res>
+    { };
+
+
+  template<typename _Res, typename _T1, typename _T2 >
+    struct _Reference_wrapper_base<_Res(_T1, _T2) >
+    : binary_function<_T1, _T2, _Res>
+    { };
+
+  template<typename _Res, typename _T1, typename _T2>
+    struct _Reference_wrapper_base<_Res(_T1, _T2) const>
+    : binary_function<_T1, _T2, _Res>
+    { };
+
+  template<typename _Res, typename _T1, typename _T2>
+    struct _Reference_wrapper_base<_Res(_T1, _T2) volatile>
+    : binary_function<_T1, _T2, _Res>
+    { };
+
+  template<typename _Res, typename _T1, typename _T2>
+    struct _Reference_wrapper_base<_Res(_T1, _T2) const volatile>
+    : binary_function<_T1, _T2, _Res>
+    { };
+
+
+  template<typename _Res, typename _T1 >
+    struct _Reference_wrapper_base<_Res(*)(_T1) >
+    : unary_function<_T1, _Res>
+    { };
+
+
+  template<typename _Res, typename _T1, typename _T2 >
+    struct _Reference_wrapper_base<_Res(*)(_T1, _T2) >
+    : binary_function<_T1, _T2, _Res>
+    { };
+
+  template<typename _Tp, bool = is_member_function_pointer<_Tp>::value>
+    struct _Reference_wrapper_base_memfun
+    : _Reference_wrapper_base<_Tp>
+    { };
+
+  template<typename _MemFunPtr>
+    struct _Reference_wrapper_base_memfun<_MemFunPtr, true>
+    : _Mem_fn_traits<_MemFunPtr>::__maybe_type
+    {
+      using result_type = typename _Mem_fn_traits<_MemFunPtr>::__result_type;
+    };
+
+
+
+
+
+
+  template<typename _Tp>
+    class reference_wrapper
+    : public _Reference_wrapper_base_memfun<typename remove_cv<_Tp>::type>
+    {
+      _Tp* _M_data;
+
+    public:
+      typedef _Tp type;
+
+      reference_wrapper(_Tp& __indata) noexcept
+      : _M_data(std::__addressof(__indata))
+      { }
+
+      reference_wrapper(_Tp&&) = delete;
+
+      reference_wrapper(const reference_wrapper&) = default;
+
+      reference_wrapper&
+      operator=(const reference_wrapper&) = default;
+
+      operator _Tp&() const noexcept
+      { return this->get(); }
+
+      _Tp&
+      get() const noexcept
+      { return *_M_data; }
+
+      template<typename... _Args>
+ typename result_of<_Tp&(_Args&&...)>::type
+ operator()(_Args&&... __args) const
+ {
+   return std::__invoke(get(), std::forward<_Args>(__args)...);
+ }
+    };
+
+
+
+  template<typename _Tp>
+    inline reference_wrapper<_Tp>
+    ref(_Tp& __t) noexcept
+    { return reference_wrapper<_Tp>(__t); }
+
+
+  template<typename _Tp>
+    inline reference_wrapper<const _Tp>
+    cref(const _Tp& __t) noexcept
+    { return reference_wrapper<const _Tp>(__t); }
+
+  template<typename _Tp>
+    void ref(const _Tp&&) = delete;
+
+  template<typename _Tp>
+    void cref(const _Tp&&) = delete;
+
+
+  template<typename _Tp>
+    inline reference_wrapper<_Tp>
+    ref(reference_wrapper<_Tp> __t) noexcept
+    { return __t; }
+
+
+  template<typename _Tp>
+    inline reference_wrapper<const _Tp>
+    cref(reference_wrapper<_Tp> __t) noexcept
+    { return { __t.get() }; }
+
+
+
+
+}
+
+       
+
+
+
+
+
+
+
+namespace __gnu_cxx
+{
+
+
+
+
+  template<typename _Tp>
+    struct __aligned_membuf
+    {
+
+
+
+      struct _Tp2 { _Tp _M_t; };
+
+      alignas(__alignof__(_Tp2::_M_t)) unsigned char _M_storage[sizeof(_Tp)];
+
+      __aligned_membuf() = default;
+
+
+      __aligned_membuf(std::nullptr_t) { }
+
+      void*
+      _M_addr() noexcept
+      { return static_cast<void*>(&_M_storage); }
+
+      const void*
+      _M_addr() const noexcept
+      { return static_cast<const void*>(&_M_storage); }
+
+      _Tp*
+      _M_ptr() noexcept
+      { return static_cast<_Tp*>(_M_addr()); }
+
+      const _Tp*
+      _M_ptr() const noexcept
+      { return static_cast<const _Tp*>(_M_addr()); }
+    };
+
+
+
+
+
+
+  template<typename _Tp>
+    struct __aligned_buffer
+    : std::aligned_storage<sizeof(_Tp), std::alignment_of<_Tp>::value>
+    {
+      typename
+ std::aligned_storage<sizeof(_Tp), std::alignment_of<_Tp>::value>::type
+ _M_storage;
+
+      __aligned_buffer() = default;
+
+
+      __aligned_buffer(std::nullptr_t) { }
+
+      void*
+      _M_addr() noexcept
+      {
+        return static_cast<void*>(&_M_storage);
+      }
+
+      const void*
+      _M_addr() const noexcept
+      {
+        return static_cast<const void*>(&_M_storage);
+      }
+
+      _Tp*
+      _M_ptr() noexcept
+      { return static_cast<_Tp*>(_M_addr()); }
+
+      const _Tp*
+      _M_ptr() const noexcept
+      { return static_cast<const _Tp*>(_M_addr()); }
+    };
+
+}
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+  class type_info;
+
+
+
+
+
+  template<typename> class auto_ptr;
+
+
+
+
+
+
+  class bad_weak_ptr : public std::exception
+  {
+  public:
+    virtual char const* what() const noexcept;
+
+    virtual ~bad_weak_ptr() noexcept;
+  };
+
+
+  inline void
+  __throw_bad_weak_ptr()
+  { (__builtin_abort()); }
+
+  using __gnu_cxx::_Lock_policy;
+  using __gnu_cxx::__default_lock_policy;
+  using __gnu_cxx::_S_single;
+  using __gnu_cxx::_S_mutex;
+  using __gnu_cxx::_S_atomic;
+
+
+  template<_Lock_policy _Lp>
+    class _Mutex_base
+    {
+    protected:
+
+      enum { _S_need_barriers = 0 };
+    };
+
+  template<>
+    class _Mutex_base<_S_mutex>
+    : public __gnu_cxx::__mutex
+    {
+    protected:
+
+
+
+      enum { _S_need_barriers = 1 };
+    };
+
+  template<_Lock_policy _Lp = __default_lock_policy>
+    class _Sp_counted_base
+    : public _Mutex_base<_Lp>
+    {
+    public:
+      _Sp_counted_base() noexcept
+      : _M_use_count(1), _M_weak_count(1) { }
+
+      virtual
+      ~_Sp_counted_base() noexcept
+      { }
+
+
+
+      virtual void
+      _M_dispose() noexcept = 0;
+
+
+      virtual void
+      _M_destroy() noexcept
+      { delete this; }
+
+      virtual void*
+      _M_get_deleter(const std::type_info&) noexcept = 0;
+
+      void
+      _M_add_ref_copy()
+      { __gnu_cxx::__atomic_add_dispatch(&_M_use_count, 1); }
+
+      void
+      _M_add_ref_lock();
+
+      bool
+      _M_add_ref_lock_nothrow();
+
+      void
+      _M_release() noexcept
+      {
+
+        ;
+ if (__gnu_cxx::__exchange_and_add_dispatch(&_M_use_count, -1) == 1)
+   {
+            ;
+     _M_dispose();
+
+
+
+
+     if (_Mutex_base<_Lp>::_S_need_barriers)
+       {
+  __atomic_thread_fence (4);
+       }
+
+
+            ;
+     if (__gnu_cxx::__exchange_and_add_dispatch(&_M_weak_count,
+             -1) == 1)
+              {
+                ;
+         _M_destroy();
+              }
+   }
+      }
+
+      void
+      _M_weak_add_ref() noexcept
+      { __gnu_cxx::__atomic_add_dispatch(&_M_weak_count, 1); }
+
+      void
+      _M_weak_release() noexcept
+      {
+
+        ;
+ if (__gnu_cxx::__exchange_and_add_dispatch(&_M_weak_count, -1) == 1)
+   {
+            ;
+     if (_Mutex_base<_Lp>::_S_need_barriers)
+       {
+
+
+  __atomic_thread_fence (4);
+       }
+     _M_destroy();
+   }
+      }
+
+      long
+      _M_get_use_count() const noexcept
+      {
+
+
+        return __atomic_load_n(&_M_use_count, 0);
+      }
+
+    private:
+      _Sp_counted_base(_Sp_counted_base const&) = delete;
+      _Sp_counted_base& operator=(_Sp_counted_base const&) = delete;
+
+      _Atomic_word _M_use_count;
+      _Atomic_word _M_weak_count;
+    };
+
+  template<>
+    inline void
+    _Sp_counted_base<_S_single>::
+    _M_add_ref_lock()
+    {
+      if (_M_use_count == 0)
+ __throw_bad_weak_ptr();
+      ++_M_use_count;
+    }
+
+  template<>
+    inline void
+    _Sp_counted_base<_S_mutex>::
+    _M_add_ref_lock()
+    {
+      __gnu_cxx::__scoped_lock sentry(*this);
+      if (__gnu_cxx::__exchange_and_add_dispatch(&_M_use_count, 1) == 0)
+ {
+   _M_use_count = 0;
+   __throw_bad_weak_ptr();
+ }
+    }
+
+  template<>
+    inline void
+    _Sp_counted_base<_S_atomic>::
+    _M_add_ref_lock()
+    {
+
+      _Atomic_word __count = _M_get_use_count();
+      do
+ {
+   if (__count == 0)
+     __throw_bad_weak_ptr();
+
+
+ }
+      while (!__atomic_compare_exchange_n(&_M_use_count, &__count, __count + 1,
+       true, 4,
+       0));
+    }
+
+  template<>
+    inline bool
+    _Sp_counted_base<_S_single>::
+    _M_add_ref_lock_nothrow()
+    {
+      if (_M_use_count == 0)
+ return false;
+      ++_M_use_count;
+      return true;
+    }
+
+  template<>
+    inline bool
+    _Sp_counted_base<_S_mutex>::
+    _M_add_ref_lock_nothrow()
+    {
+      __gnu_cxx::__scoped_lock sentry(*this);
+      if (__gnu_cxx::__exchange_and_add_dispatch(&_M_use_count, 1) == 0)
+ {
+   _M_use_count = 0;
+   return false;
+ }
+      return true;
+    }
+
+  template<>
+    inline bool
+    _Sp_counted_base<_S_atomic>::
+    _M_add_ref_lock_nothrow()
+    {
+
+      _Atomic_word __count = _M_get_use_count();
+      do
+ {
+   if (__count == 0)
+     return false;
+
+
+ }
+      while (!__atomic_compare_exchange_n(&_M_use_count, &__count, __count + 1,
+       true, 4,
+       0));
+      return true;
+    }
+
+  template<>
+    inline void
+    _Sp_counted_base<_S_single>::_M_add_ref_copy()
+    { ++_M_use_count; }
+
+  template<>
+    inline void
+    _Sp_counted_base<_S_single>::_M_release() noexcept
+    {
+      if (--_M_use_count == 0)
+        {
+          _M_dispose();
+          if (--_M_weak_count == 0)
+            _M_destroy();
+        }
+    }
+
+  template<>
+    inline void
+    _Sp_counted_base<_S_single>::_M_weak_add_ref() noexcept
+    { ++_M_weak_count; }
+
+  template<>
+    inline void
+    _Sp_counted_base<_S_single>::_M_weak_release() noexcept
+    {
+      if (--_M_weak_count == 0)
+        _M_destroy();
+    }
+
+  template<>
+    inline long
+    _Sp_counted_base<_S_single>::_M_get_use_count() const noexcept
+    { return _M_use_count; }
+
+
+
+  template<typename _Tp, _Lock_policy _Lp = __default_lock_policy>
+    class __shared_ptr;
+
+  template<typename _Tp, _Lock_policy _Lp = __default_lock_policy>
+    class __weak_ptr;
+
+  template<typename _Tp, _Lock_policy _Lp = __default_lock_policy>
+    class __enable_shared_from_this;
+
+  template<typename _Tp>
+    class shared_ptr;
+
+  template<typename _Tp>
+    class weak_ptr;
+
+  template<typename _Tp>
+    struct owner_less;
+
+  template<typename _Tp>
+    class enable_shared_from_this;
+
+  template<_Lock_policy _Lp = __default_lock_policy>
+    class __weak_count;
+
+  template<_Lock_policy _Lp = __default_lock_policy>
+    class __shared_count;
+
+
+
+  template<typename _Ptr, _Lock_policy _Lp>
+    class _Sp_counted_ptr final : public _Sp_counted_base<_Lp>
+    {
+    public:
+      explicit
+      _Sp_counted_ptr(_Ptr __p) noexcept
+      : _M_ptr(__p) { }
+
+      virtual void
+      _M_dispose() noexcept
+      { delete _M_ptr; }
+
+      virtual void
+      _M_destroy() noexcept
+      { delete this; }
+
+      virtual void*
+      _M_get_deleter(const std::type_info&) noexcept
+      { return nullptr; }
+
+      _Sp_counted_ptr(const _Sp_counted_ptr&) = delete;
+      _Sp_counted_ptr& operator=(const _Sp_counted_ptr&) = delete;
+
+    private:
+      _Ptr _M_ptr;
+    };
+
+  template<>
+    inline void
+    _Sp_counted_ptr<nullptr_t, _S_single>::_M_dispose() noexcept { }
+
+  template<>
+    inline void
+    _Sp_counted_ptr<nullptr_t, _S_mutex>::_M_dispose() noexcept { }
+
+  template<>
+    inline void
+    _Sp_counted_ptr<nullptr_t, _S_atomic>::_M_dispose() noexcept { }
+
+  template<int _Nm, typename _Tp,
+    bool __use_ebo = !__is_final(_Tp) && __is_empty(_Tp)>
+    struct _Sp_ebo_helper;
+
+
+  template<int _Nm, typename _Tp>
+    struct _Sp_ebo_helper<_Nm, _Tp, true> : private _Tp
+    {
+      explicit _Sp_ebo_helper(const _Tp& __tp) : _Tp(__tp) { }
+      explicit _Sp_ebo_helper(_Tp&& __tp) : _Tp(std::move(__tp)) { }
+
+      static _Tp&
+      _S_get(_Sp_ebo_helper& __eboh) { return static_cast<_Tp&>(__eboh); }
+    };
+
+
+  template<int _Nm, typename _Tp>
+    struct _Sp_ebo_helper<_Nm, _Tp, false>
+    {
+      explicit _Sp_ebo_helper(const _Tp& __tp) : _M_tp(__tp) { }
+      explicit _Sp_ebo_helper(_Tp&& __tp) : _M_tp(std::move(__tp)) { }
+
+      static _Tp&
+      _S_get(_Sp_ebo_helper& __eboh)
+      { return __eboh._M_tp; }
+
+    private:
+      _Tp _M_tp;
+    };
+
+
+  template<typename _Ptr, typename _Deleter, typename _Alloc, _Lock_policy _Lp>
+    class _Sp_counted_deleter final : public _Sp_counted_base<_Lp>
+    {
+      class _Impl : _Sp_ebo_helper<0, _Deleter>, _Sp_ebo_helper<1, _Alloc>
+      {
+ typedef _Sp_ebo_helper<0, _Deleter> _Del_base;
+ typedef _Sp_ebo_helper<1, _Alloc> _Alloc_base;
+
+      public:
+ _Impl(_Ptr __p, _Deleter __d, const _Alloc& __a) noexcept
+ : _M_ptr(__p), _Del_base(std::move(__d)), _Alloc_base(__a)
+ { }
+
+ _Deleter& _M_del() noexcept { return _Del_base::_S_get(*this); }
+ _Alloc& _M_alloc() noexcept { return _Alloc_base::_S_get(*this); }
+
+ _Ptr _M_ptr;
+      };
+
+    public:
+      using __allocator_type = __alloc_rebind<_Alloc, _Sp_counted_deleter>;
+
+
+      _Sp_counted_deleter(_Ptr __p, _Deleter __d) noexcept
+      : _M_impl(__p, std::move(__d), _Alloc()) { }
+
+
+      _Sp_counted_deleter(_Ptr __p, _Deleter __d, const _Alloc& __a) noexcept
+      : _M_impl(__p, std::move(__d), __a) { }
+
+      ~_Sp_counted_deleter() noexcept { }
+
+      virtual void
+      _M_dispose() noexcept
+      { _M_impl._M_del()(_M_impl._M_ptr); }
+
+      virtual void
+      _M_destroy() noexcept
+      {
+ __allocator_type __a(_M_impl._M_alloc());
+ __allocated_ptr<__allocator_type> __guard_ptr{ __a, this };
+ this->~_Sp_counted_deleter();
+      }
+
+      virtual void*
+      _M_get_deleter(const std::type_info& __ti) noexcept
+      {
+
+
+
+
+
+
+
+        return nullptr;
+
+      }
+
+    private:
+      _Impl _M_impl;
+    };
+
+
+
+  struct _Sp_make_shared_tag
+  {
+
+  private:
+    template<typename _Tp, _Lock_policy _Lp>
+      friend class __shared_ptr;
+    template<typename _Tp, typename _Alloc, _Lock_policy _Lp>
+      friend class _Sp_counted_ptr_inplace;
+
+    static const type_info&
+    _S_ti() noexcept
+    {
+      static constexpr _Sp_make_shared_tag __tag;
+      return reinterpret_cast<const type_info&>(__tag);
+    }
+
+  };
+
+  template<typename _Tp, typename _Alloc, _Lock_policy _Lp>
+    class _Sp_counted_ptr_inplace final : public _Sp_counted_base<_Lp>
+    {
+      class _Impl : _Sp_ebo_helper<0, _Alloc>
+      {
+ typedef _Sp_ebo_helper<0, _Alloc> _A_base;
+
+      public:
+ explicit _Impl(_Alloc __a) noexcept : _A_base(__a) { }
+
+ _Alloc& _M_alloc() noexcept { return _A_base::_S_get(*this); }
+
+ __gnu_cxx::__aligned_buffer<_Tp> _M_storage;
+      };
+
+    public:
+      using __allocator_type = __alloc_rebind<_Alloc, _Sp_counted_ptr_inplace>;
+
+      template<typename... _Args>
+ _Sp_counted_ptr_inplace(_Alloc __a, _Args&&... __args)
+ : _M_impl(__a)
+ {
+
+
+   allocator_traits<_Alloc>::construct(__a, _M_ptr(),
+       std::forward<_Args>(__args)...);
+ }
+
+      ~_Sp_counted_ptr_inplace() noexcept { }
+
+      virtual void
+      _M_dispose() noexcept
+      {
+ allocator_traits<_Alloc>::destroy(_M_impl._M_alloc(), _M_ptr());
+      }
+
+
+      virtual void
+      _M_destroy() noexcept
+      {
+ __allocator_type __a(_M_impl._M_alloc());
+ __allocated_ptr<__allocator_type> __guard_ptr{ __a, this };
+ this->~_Sp_counted_ptr_inplace();
+      }
+
+
+      virtual void*
+      _M_get_deleter(const std::type_info& __ti) noexcept
+      {
+
+
+
+ if (&__ti == &_Sp_make_shared_tag::_S_ti())
+
+   return const_cast<typename remove_cv<_Tp>::type*>(_M_ptr());
+ return nullptr;
+      }
+
+    private:
+      _Tp* _M_ptr() noexcept { return _M_impl._M_storage._M_ptr(); }
+
+      _Impl _M_impl;
+    };
+
+
+  struct __sp_array_delete
+  {
+    template<typename _Yp>
+      void operator()(_Yp* __p) const { delete[] __p; }
+  };
+
+  template<_Lock_policy _Lp>
+    class __shared_count
+    {
+    public:
+      constexpr __shared_count() noexcept : _M_pi(0)
+      { }
+
+      template<typename _Ptr>
+        explicit
+ __shared_count(_Ptr __p) : _M_pi(0)
+ {
+   if (true)
+     {
+       _M_pi = new _Sp_counted_ptr<_Ptr, _Lp>(__p);
+     }
+   if (false)
+     {
+       delete __p;
+       ;
+     }
+ }
+
+      template<typename _Ptr>
+ __shared_count(_Ptr __p, false_type)
+ : __shared_count(__p)
+ { }
+
+      template<typename _Ptr>
+ __shared_count(_Ptr __p, true_type)
+ : __shared_count(__p, __sp_array_delete{}, allocator<void>())
+ { }
+
+      template<typename _Ptr, typename _Deleter>
+ __shared_count(_Ptr __p, _Deleter __d)
+ : __shared_count(__p, std::move(__d), allocator<void>())
+ { }
+
+      template<typename _Ptr, typename _Deleter, typename _Alloc>
+ __shared_count(_Ptr __p, _Deleter __d, _Alloc __a) : _M_pi(0)
+ {
+   typedef _Sp_counted_deleter<_Ptr, _Deleter, _Alloc, _Lp> _Sp_cd_type;
+   if (true)
+     {
+       typename _Sp_cd_type::__allocator_type __a2(__a);
+       auto __guard = std::__allocate_guarded(__a2);
+       _Sp_cd_type* __mem = __guard.get();
+       ::new (__mem) _Sp_cd_type(__p, std::move(__d), std::move(__a));
+       _M_pi = __mem;
+       __guard = nullptr;
+     }
+   if (false)
+     {
+       __d(__p);
+       ;
+     }
+ }
+
+      template<typename _Tp, typename _Alloc, typename... _Args>
+ __shared_count(_Sp_make_shared_tag, _Tp*, const _Alloc& __a,
+         _Args&&... __args)
+ : _M_pi(0)
+ {
+   typedef _Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp> _Sp_cp_type;
+   typename _Sp_cp_type::__allocator_type __a2(__a);
+   auto __guard = std::__allocate_guarded(__a2);
+   _Sp_cp_type* __mem = __guard.get();
+   ::new (__mem) _Sp_cp_type(std::move(__a),
+        std::forward<_Args>(__args)...);
+   _M_pi = __mem;
+   __guard = nullptr;
+ }
+
+
+
+      template<typename _Tp>
+        explicit
+ __shared_count(std::auto_ptr<_Tp>&& __r);
+
+
+
+      template<typename _Tp, typename _Del>
+        explicit
+ __shared_count(std::unique_ptr<_Tp, _Del>&& __r) : _M_pi(0)
+ {
+
+
+   if (__r.get() == nullptr)
+     return;
+
+   using _Ptr = typename unique_ptr<_Tp, _Del>::pointer;
+   using _Del2 = typename conditional<is_reference<_Del>::value,
+       reference_wrapper<typename remove_reference<_Del>::type>,
+       _Del>::type;
+   using _Sp_cd_type
+     = _Sp_counted_deleter<_Ptr, _Del2, allocator<void>, _Lp>;
+   using _Alloc = allocator<_Sp_cd_type>;
+   using _Alloc_traits = allocator_traits<_Alloc>;
+   _Alloc __a;
+   _Sp_cd_type* __mem = _Alloc_traits::allocate(__a, 1);
+   _Alloc_traits::construct(__a, __mem, __r.release(),
+       __r.get_deleter());
+   _M_pi = __mem;
+ }
+
+
+      explicit __shared_count(const __weak_count<_Lp>& __r);
+
+
+      explicit __shared_count(const __weak_count<_Lp>& __r, std::nothrow_t);
+
+      ~__shared_count() noexcept
+      {
+ if (_M_pi != nullptr)
+   _M_pi->_M_release();
+      }
+
+      __shared_count(const __shared_count& __r) noexcept
+      : _M_pi(__r._M_pi)
+      {
+ if (_M_pi != 0)
+   _M_pi->_M_add_ref_copy();
+      }
+
+      __shared_count&
+      operator=(const __shared_count& __r) noexcept
+      {
+ _Sp_counted_base<_Lp>* __tmp = __r._M_pi;
+ if (__tmp != _M_pi)
+   {
+     if (__tmp != 0)
+       __tmp->_M_add_ref_copy();
+     if (_M_pi != 0)
+       _M_pi->_M_release();
+     _M_pi = __tmp;
+   }
+ return *this;
+      }
+
+      void
+      _M_swap(__shared_count& __r) noexcept
+      {
+ _Sp_counted_base<_Lp>* __tmp = __r._M_pi;
+ __r._M_pi = _M_pi;
+ _M_pi = __tmp;
+      }
+
+      long
+      _M_get_use_count() const noexcept
+      { return _M_pi != 0 ? _M_pi->_M_get_use_count() : 0; }
+
+      bool
+      _M_unique() const noexcept
+      { return this->_M_get_use_count() == 1; }
+
+      void*
+      _M_get_deleter(const std::type_info& __ti) const noexcept
+      { return _M_pi ? _M_pi->_M_get_deleter(__ti) : nullptr; }
+
+      bool
+      _M_less(const __shared_count& __rhs) const noexcept
+      { return std::less<_Sp_counted_base<_Lp>*>()(this->_M_pi, __rhs._M_pi); }
+
+      bool
+      _M_less(const __weak_count<_Lp>& __rhs) const noexcept
+      { return std::less<_Sp_counted_base<_Lp>*>()(this->_M_pi, __rhs._M_pi); }
+
+
+      friend inline bool
+      operator==(const __shared_count& __a, const __shared_count& __b) noexcept
+      { return __a._M_pi == __b._M_pi; }
+
+    private:
+      friend class __weak_count<_Lp>;
+
+      _Sp_counted_base<_Lp>* _M_pi;
+    };
+
+
+  template<_Lock_policy _Lp>
+    class __weak_count
+    {
+    public:
+      constexpr __weak_count() noexcept : _M_pi(nullptr)
+      { }
+
+      __weak_count(const __shared_count<_Lp>& __r) noexcept
+      : _M_pi(__r._M_pi)
+      {
+ if (_M_pi != nullptr)
+   _M_pi->_M_weak_add_ref();
+      }
+
+      __weak_count(const __weak_count& __r) noexcept
+      : _M_pi(__r._M_pi)
+      {
+ if (_M_pi != nullptr)
+   _M_pi->_M_weak_add_ref();
+      }
+
+      __weak_count(__weak_count&& __r) noexcept
+      : _M_pi(__r._M_pi)
+      { __r._M_pi = nullptr; }
+
+      ~__weak_count() noexcept
+      {
+ if (_M_pi != nullptr)
+   _M_pi->_M_weak_release();
+      }
+
+      __weak_count&
+      operator=(const __shared_count<_Lp>& __r) noexcept
+      {
+ _Sp_counted_base<_Lp>* __tmp = __r._M_pi;
+ if (__tmp != nullptr)
+   __tmp->_M_weak_add_ref();
+ if (_M_pi != nullptr)
+   _M_pi->_M_weak_release();
+ _M_pi = __tmp;
+ return *this;
+      }
+
+      __weak_count&
+      operator=(const __weak_count& __r) noexcept
+      {
+ _Sp_counted_base<_Lp>* __tmp = __r._M_pi;
+ if (__tmp != nullptr)
+   __tmp->_M_weak_add_ref();
+ if (_M_pi != nullptr)
+   _M_pi->_M_weak_release();
+ _M_pi = __tmp;
+ return *this;
+      }
+
+      __weak_count&
+      operator=(__weak_count&& __r) noexcept
+      {
+ if (_M_pi != nullptr)
+   _M_pi->_M_weak_release();
+ _M_pi = __r._M_pi;
+        __r._M_pi = nullptr;
+ return *this;
+      }
+
+      void
+      _M_swap(__weak_count& __r) noexcept
+      {
+ _Sp_counted_base<_Lp>* __tmp = __r._M_pi;
+ __r._M_pi = _M_pi;
+ _M_pi = __tmp;
+      }
+
+      long
+      _M_get_use_count() const noexcept
+      { return _M_pi != nullptr ? _M_pi->_M_get_use_count() : 0; }
+
+      bool
+      _M_less(const __weak_count& __rhs) const noexcept
+      { return std::less<_Sp_counted_base<_Lp>*>()(this->_M_pi, __rhs._M_pi); }
+
+      bool
+      _M_less(const __shared_count<_Lp>& __rhs) const noexcept
+      { return std::less<_Sp_counted_base<_Lp>*>()(this->_M_pi, __rhs._M_pi); }
+
+
+      friend inline bool
+      operator==(const __weak_count& __a, const __weak_count& __b) noexcept
+      { return __a._M_pi == __b._M_pi; }
+
+    private:
+      friend class __shared_count<_Lp>;
+
+      _Sp_counted_base<_Lp>* _M_pi;
+    };
+
+
+  template<_Lock_policy _Lp>
+    inline
+    __shared_count<_Lp>::__shared_count(const __weak_count<_Lp>& __r)
+    : _M_pi(__r._M_pi)
+    {
+      if (_M_pi != nullptr)
+ _M_pi->_M_add_ref_lock();
+      else
+ __throw_bad_weak_ptr();
+    }
+
+
+  template<_Lock_policy _Lp>
+    inline
+    __shared_count<_Lp>::
+    __shared_count(const __weak_count<_Lp>& __r, std::nothrow_t)
+    : _M_pi(__r._M_pi)
+    {
+      if (_M_pi != nullptr)
+ if (!_M_pi->_M_add_ref_lock_nothrow())
+   _M_pi = nullptr;
+    }
+
+
+
+
+
+
+
+  template<typename _Yp_ptr, typename _Tp_ptr>
+    struct __sp_compatible_with
+    : false_type
+    { };
+
+  template<typename _Yp, typename _Tp>
+    struct __sp_compatible_with<_Yp*, _Tp*>
+    : is_convertible<_Yp*, _Tp*>::type
+    { };
+
+  template<typename _Up, size_t _Nm>
+    struct __sp_compatible_with<_Up(*)[_Nm], _Up(*)[]>
+    : true_type
+    { };
+
+  template<typename _Up, size_t _Nm>
+    struct __sp_compatible_with<_Up(*)[_Nm], const _Up(*)[]>
+    : true_type
+    { };
+
+  template<typename _Up, size_t _Nm>
+    struct __sp_compatible_with<_Up(*)[_Nm], volatile _Up(*)[]>
+    : true_type
+    { };
+
+  template<typename _Up, size_t _Nm>
+    struct __sp_compatible_with<_Up(*)[_Nm], const volatile _Up(*)[]>
+    : true_type
+    { };
+
+
+  template<typename _Up, size_t _Nm, typename _Yp, typename = void>
+    struct __sp_is_constructible_arrN
+    : false_type
+    { };
+
+  template<typename _Up, size_t _Nm, typename _Yp>
+    struct __sp_is_constructible_arrN<_Up, _Nm, _Yp, __void_t<_Yp[_Nm]>>
+    : is_convertible<_Yp(*)[_Nm], _Up(*)[_Nm]>::type
+    { };
+
+
+  template<typename _Up, typename _Yp, typename = void>
+    struct __sp_is_constructible_arr
+    : false_type
+    { };
+
+  template<typename _Up, typename _Yp>
+    struct __sp_is_constructible_arr<_Up, _Yp, __void_t<_Yp[]>>
+    : is_convertible<_Yp(*)[], _Up(*)[]>::type
+    { };
+
+
+  template<typename _Tp, typename _Yp>
+    struct __sp_is_constructible;
+
+
+  template<typename _Up, size_t _Nm, typename _Yp>
+    struct __sp_is_constructible<_Up[_Nm], _Yp>
+    : __sp_is_constructible_arrN<_Up, _Nm, _Yp>::type
+    { };
+
+
+  template<typename _Up, typename _Yp>
+    struct __sp_is_constructible<_Up[], _Yp>
+    : __sp_is_constructible_arr<_Up, _Yp>::type
+    { };
+
+
+  template<typename _Tp, typename _Yp>
+    struct __sp_is_constructible
+    : is_convertible<_Yp*, _Tp*>::type
+    { };
+
+
+
+  template<typename _Tp, _Lock_policy _Lp,
+    bool = is_array<_Tp>::value, bool = is_void<_Tp>::value>
+    class __shared_ptr_access
+    {
+    public:
+      using element_type = _Tp;
+
+      element_type&
+      operator*() const noexcept
+      {
+ ;
+ return *_M_get();
+      }
+
+      element_type*
+      operator->() const noexcept
+      {
+ ;
+ return _M_get();
+      }
+
+    private:
+      element_type*
+      _M_get() const noexcept
+      { return static_cast<const __shared_ptr<_Tp, _Lp>*>(this)->get(); }
+    };
+
+
+  template<typename _Tp, _Lock_policy _Lp>
+    class __shared_ptr_access<_Tp, _Lp, false, true>
+    {
+    public:
+      using element_type = _Tp;
+
+      element_type*
+      operator->() const noexcept
+      {
+ auto __ptr = static_cast<const __shared_ptr<_Tp, _Lp>*>(this)->get();
+ ;
+ return __ptr;
+      }
+    };
+
+
+  template<typename _Tp, _Lock_policy _Lp>
+    class __shared_ptr_access<_Tp, _Lp, true, false>
+    {
+    public:
+      using element_type = typename remove_extent<_Tp>::type;
+
+
+      [[__deprecated__("shared_ptr<T[]>::operator* is absent from C++17")]]
+      element_type&
+      operator*() const noexcept
+      {
+ ;
+ return *_M_get();
+      }
+
+      [[__deprecated__("shared_ptr<T[]>::operator-> is absent from C++17")]]
+      element_type*
+      operator->() const noexcept
+      {
+ ;
+ return _M_get();
+      }
+
+
+      element_type&
+      operator[](ptrdiff_t __i) const
+      {
+ ;
+ ;
+ return _M_get()[__i];
+      }
+
+    private:
+      element_type*
+      _M_get() const noexcept
+      { return static_cast<const __shared_ptr<_Tp, _Lp>*>(this)->get(); }
+    };
+
+  template<typename _Tp, _Lock_policy _Lp>
+    class __shared_ptr
+    : public __shared_ptr_access<_Tp, _Lp>
+    {
+    public:
+      using element_type = typename remove_extent<_Tp>::type;
+
+    private:
+
+      template<typename _Yp>
+ using _SafeConv
+   = typename enable_if<__sp_is_constructible<_Tp, _Yp>::value>::type;
+
+
+      template<typename _Yp, typename _Res = void>
+ using _Compatible = typename
+   enable_if<__sp_compatible_with<_Yp*, _Tp*>::value, _Res>::type;
+
+
+      template<typename _Yp>
+ using _Assignable = _Compatible<_Yp, __shared_ptr&>;
+
+
+      template<typename _Yp, typename _Del, typename _Res = void,
+        typename _Ptr = typename unique_ptr<_Yp, _Del>::pointer>
+ using _UniqCompatible = typename enable_if<__and_<
+   __sp_compatible_with<_Yp*, _Tp*>, is_convertible<_Ptr, element_type*>
+   >::value, _Res>::type;
+
+
+      template<typename _Yp, typename _Del>
+ using _UniqAssignable = _UniqCompatible<_Yp, _Del, __shared_ptr&>;
+
+    public:
+
+
+
+
+
+      constexpr __shared_ptr() noexcept
+      : _M_ptr(0), _M_refcount()
+      { }
+
+      template<typename _Yp, typename = _SafeConv<_Yp>>
+ explicit
+ __shared_ptr(_Yp* __p)
+ : _M_ptr(__p), _M_refcount(__p, typename is_array<_Tp>::type())
+ {
+   static_assert( !is_void<_Yp>::value, "incomplete type" );
+   static_assert( sizeof(_Yp) > 0, "incomplete type" );
+   _M_enable_shared_from_this_with(__p);
+ }
+
+      template<typename _Yp, typename _Deleter, typename = _SafeConv<_Yp>>
+ __shared_ptr(_Yp* __p, _Deleter __d)
+ : _M_ptr(__p), _M_refcount(__p, std::move(__d))
+ {
+   static_assert(__is_invocable<_Deleter&, _Yp*&>::value,
+       "deleter expression d(p) is well-formed");
+   _M_enable_shared_from_this_with(__p);
+ }
+
+      template<typename _Yp, typename _Deleter, typename _Alloc,
+        typename = _SafeConv<_Yp>>
+ __shared_ptr(_Yp* __p, _Deleter __d, _Alloc __a)
+ : _M_ptr(__p), _M_refcount(__p, std::move(__d), std::move(__a))
+ {
+   static_assert(__is_invocable<_Deleter&, _Yp*&>::value,
+       "deleter expression d(p) is well-formed");
+   _M_enable_shared_from_this_with(__p);
+ }
+
+      template<typename _Deleter>
+ __shared_ptr(nullptr_t __p, _Deleter __d)
+ : _M_ptr(0), _M_refcount(__p, std::move(__d))
+ { }
+
+      template<typename _Deleter, typename _Alloc>
+        __shared_ptr(nullptr_t __p, _Deleter __d, _Alloc __a)
+ : _M_ptr(0), _M_refcount(__p, std::move(__d), std::move(__a))
+ { }
+
+      template<typename _Yp>
+ __shared_ptr(const __shared_ptr<_Yp, _Lp>& __r,
+       element_type* __p) noexcept
+ : _M_ptr(__p), _M_refcount(__r._M_refcount)
+ { }
+
+      __shared_ptr(const __shared_ptr&) noexcept = default;
+      __shared_ptr& operator=(const __shared_ptr&) noexcept = default;
+      ~__shared_ptr() = default;
+
+      template<typename _Yp, typename = _Compatible<_Yp>>
+ __shared_ptr(const __shared_ptr<_Yp, _Lp>& __r) noexcept
+ : _M_ptr(__r._M_ptr), _M_refcount(__r._M_refcount)
+ { }
+
+      __shared_ptr(__shared_ptr&& __r) noexcept
+      : _M_ptr(__r._M_ptr), _M_refcount()
+      {
+ _M_refcount._M_swap(__r._M_refcount);
+ __r._M_ptr = 0;
+      }
+
+      template<typename _Yp, typename = _Compatible<_Yp>>
+ __shared_ptr(__shared_ptr<_Yp, _Lp>&& __r) noexcept
+ : _M_ptr(__r._M_ptr), _M_refcount()
+ {
+   _M_refcount._M_swap(__r._M_refcount);
+   __r._M_ptr = 0;
+ }
+
+      template<typename _Yp, typename = _Compatible<_Yp>>
+ explicit __shared_ptr(const __weak_ptr<_Yp, _Lp>& __r)
+ : _M_refcount(__r._M_refcount)
+ {
+
+
+   _M_ptr = __r._M_ptr;
+ }
+
+
+      template<typename _Yp, typename _Del,
+        typename = _UniqCompatible<_Yp, _Del>>
+ __shared_ptr(unique_ptr<_Yp, _Del>&& __r)
+ : _M_ptr(__r.get()), _M_refcount()
+ {
+   auto __raw = __to_address(__r.get());
+   _M_refcount = __shared_count<_Lp>(std::move(__r));
+   _M_enable_shared_from_this_with(__raw);
+ }
+
+
+    protected:
+
+      template<typename _Tp1, typename _Del,
+        typename enable_if<__and_<
+   __not_<is_array<_Tp>>, is_array<_Tp1>,
+          is_convertible<typename unique_ptr<_Tp1, _Del>::pointer, _Tp*>
+        >::value, bool>::type = true>
+ __shared_ptr(unique_ptr<_Tp1, _Del>&& __r, __sp_array_delete)
+ : _M_ptr(__r.get()), _M_refcount()
+ {
+   auto __raw = __to_address(__r.get());
+   _M_refcount = __shared_count<_Lp>(std::move(__r));
+   _M_enable_shared_from_this_with(__raw);
+ }
+    public:
+
+
+
+
+      template<typename _Yp, typename = _Compatible<_Yp>>
+ __shared_ptr(auto_ptr<_Yp>&& __r);
+
+
+      constexpr __shared_ptr(nullptr_t) noexcept : __shared_ptr() { }
+
+      template<typename _Yp>
+ _Assignable<_Yp>
+ operator=(const __shared_ptr<_Yp, _Lp>& __r) noexcept
+ {
+   _M_ptr = __r._M_ptr;
+   _M_refcount = __r._M_refcount;
+   return *this;
+ }
+
+
+      template<typename _Yp>
+ _Assignable<_Yp>
+ operator=(auto_ptr<_Yp>&& __r)
+ {
+   __shared_ptr(std::move(__r)).swap(*this);
+   return *this;
+ }
+
+
+      __shared_ptr&
+      operator=(__shared_ptr&& __r) noexcept
+      {
+ __shared_ptr(std::move(__r)).swap(*this);
+ return *this;
+      }
+
+      template<class _Yp>
+ _Assignable<_Yp>
+ operator=(__shared_ptr<_Yp, _Lp>&& __r) noexcept
+ {
+   __shared_ptr(std::move(__r)).swap(*this);
+   return *this;
+ }
+
+      template<typename _Yp, typename _Del>
+ _UniqAssignable<_Yp, _Del>
+ operator=(unique_ptr<_Yp, _Del>&& __r)
+ {
+   __shared_ptr(std::move(__r)).swap(*this);
+   return *this;
+ }
+
+      void
+      reset() noexcept
+      { __shared_ptr().swap(*this); }
+
+      template<typename _Yp>
+ _SafeConv<_Yp>
+ reset(_Yp* __p)
+ {
+
+   ;
+   __shared_ptr(__p).swap(*this);
+ }
+
+      template<typename _Yp, typename _Deleter>
+ _SafeConv<_Yp>
+ reset(_Yp* __p, _Deleter __d)
+ { __shared_ptr(__p, std::move(__d)).swap(*this); }
+
+      template<typename _Yp, typename _Deleter, typename _Alloc>
+ _SafeConv<_Yp>
+ reset(_Yp* __p, _Deleter __d, _Alloc __a)
+        { __shared_ptr(__p, std::move(__d), std::move(__a)).swap(*this); }
+
+      element_type*
+      get() const noexcept
+      { return _M_ptr; }
+
+      explicit operator bool() const
+      { return _M_ptr == 0 ? false : true; }
+
+      bool
+      unique() const noexcept
+      { return _M_refcount._M_unique(); }
+
+      long
+      use_count() const noexcept
+      { return _M_refcount._M_get_use_count(); }
+
+      void
+      swap(__shared_ptr<_Tp, _Lp>& __other) noexcept
+      {
+ std::swap(_M_ptr, __other._M_ptr);
+ _M_refcount._M_swap(__other._M_refcount);
+      }
+
+      template<typename _Tp1>
+ bool
+ owner_before(__shared_ptr<_Tp1, _Lp> const& __rhs) const noexcept
+ { return _M_refcount._M_less(__rhs._M_refcount); }
+
+      template<typename _Tp1>
+ bool
+ owner_before(__weak_ptr<_Tp1, _Lp> const& __rhs) const noexcept
+ { return _M_refcount._M_less(__rhs._M_refcount); }
+
+    protected:
+
+      template<typename _Alloc, typename... _Args>
+ __shared_ptr(_Sp_make_shared_tag __tag, const _Alloc& __a,
+       _Args&&... __args)
+ : _M_ptr(), _M_refcount(__tag, (_Tp*)0, __a,
+    std::forward<_Args>(__args)...)
+ {
+
+
+
+
+
+   void* __p = _M_refcount._M_get_deleter(_Sp_make_shared_tag::_S_ti());
+
+   _M_ptr = static_cast<_Tp*>(__p);
+   _M_enable_shared_from_this_with(_M_ptr);
+ }
+
+      template<typename _Tp1, _Lock_policy _Lp1, typename _Alloc,
+        typename... _Args>
+ friend __shared_ptr<_Tp1, _Lp1>
+ __allocate_shared(const _Alloc& __a, _Args&&... __args);
+
+
+
+      __shared_ptr(const __weak_ptr<_Tp, _Lp>& __r, std::nothrow_t)
+      : _M_refcount(__r._M_refcount, std::nothrow)
+      {
+ _M_ptr = _M_refcount._M_get_use_count() ? __r._M_ptr : nullptr;
+      }
+
+      friend class __weak_ptr<_Tp, _Lp>;
+
+    private:
+
+      template<typename _Yp>
+ using __esft_base_t = decltype(__enable_shared_from_this_base(
+       std::declval<const __shared_count<_Lp>&>(),
+       std::declval<_Yp*>()));
+
+
+      template<typename _Yp, typename = void>
+ struct __has_esft_base
+ : false_type { };
+
+      template<typename _Yp>
+ struct __has_esft_base<_Yp, __void_t<__esft_base_t<_Yp>>>
+ : __not_<is_array<_Tp>> { };
+
+      template<typename _Yp, typename _Yp2 = typename remove_cv<_Yp>::type>
+ typename enable_if<__has_esft_base<_Yp2>::value>::type
+ _M_enable_shared_from_this_with(_Yp* __p) noexcept
+ {
+   if (auto __base = __enable_shared_from_this_base(_M_refcount, __p))
+     __base->_M_weak_assign(const_cast<_Yp2*>(__p), _M_refcount);
+ }
+
+      template<typename _Yp, typename _Yp2 = typename remove_cv<_Yp>::type>
+ typename enable_if<!__has_esft_base<_Yp2>::value>::type
+ _M_enable_shared_from_this_with(_Yp*) noexcept
+ { }
+
+      void*
+      _M_get_deleter(const std::type_info& __ti) const noexcept
+      { return _M_refcount._M_get_deleter(__ti); }
+
+      template<typename _Tp1, _Lock_policy _Lp1> friend class __shared_ptr;
+      template<typename _Tp1, _Lock_policy _Lp1> friend class __weak_ptr;
+
+      template<typename _Del, typename _Tp1, _Lock_policy _Lp1>
+ friend _Del* get_deleter(const __shared_ptr<_Tp1, _Lp1>&) noexcept;
+
+      template<typename _Del, typename _Tp1>
+ friend _Del* get_deleter(const shared_ptr<_Tp1>&) noexcept;
+
+      element_type* _M_ptr;
+      __shared_count<_Lp> _M_refcount;
+    };
+
+
+
+  template<typename _Tp1, typename _Tp2, _Lock_policy _Lp>
+    inline bool
+    operator==(const __shared_ptr<_Tp1, _Lp>& __a,
+        const __shared_ptr<_Tp2, _Lp>& __b) noexcept
+    { return __a.get() == __b.get(); }
+
+  template<typename _Tp, _Lock_policy _Lp>
+    inline bool
+    operator==(const __shared_ptr<_Tp, _Lp>& __a, nullptr_t) noexcept
+    { return !__a; }
+
+  template<typename _Tp, _Lock_policy _Lp>
+    inline bool
+    operator==(nullptr_t, const __shared_ptr<_Tp, _Lp>& __a) noexcept
+    { return !__a; }
+
+  template<typename _Tp1, typename _Tp2, _Lock_policy _Lp>
+    inline bool
+    operator!=(const __shared_ptr<_Tp1, _Lp>& __a,
+        const __shared_ptr<_Tp2, _Lp>& __b) noexcept
+    { return __a.get() != __b.get(); }
+
+  template<typename _Tp, _Lock_policy _Lp>
+    inline bool
+    operator!=(const __shared_ptr<_Tp, _Lp>& __a, nullptr_t) noexcept
+    { return (bool)__a; }
+
+  template<typename _Tp, _Lock_policy _Lp>
+    inline bool
+    operator!=(nullptr_t, const __shared_ptr<_Tp, _Lp>& __a) noexcept
+    { return (bool)__a; }
+
+  template<typename _Tp, typename _Up, _Lock_policy _Lp>
+    inline bool
+    operator<(const __shared_ptr<_Tp, _Lp>& __a,
+       const __shared_ptr<_Up, _Lp>& __b) noexcept
+    {
+      using _Tp_elt = typename __shared_ptr<_Tp, _Lp>::element_type;
+      using _Up_elt = typename __shared_ptr<_Up, _Lp>::element_type;
+      using _Vp = typename common_type<_Tp_elt*, _Up_elt*>::type;
+      return less<_Vp>()(__a.get(), __b.get());
+    }
+
+  template<typename _Tp, _Lock_policy _Lp>
+    inline bool
+    operator<(const __shared_ptr<_Tp, _Lp>& __a, nullptr_t) noexcept
+    {
+      using _Tp_elt = typename __shared_ptr<_Tp, _Lp>::element_type;
+      return less<_Tp_elt*>()(__a.get(), nullptr);
+    }
+
+  template<typename _Tp, _Lock_policy _Lp>
+    inline bool
+    operator<(nullptr_t, const __shared_ptr<_Tp, _Lp>& __a) noexcept
+    {
+      using _Tp_elt = typename __shared_ptr<_Tp, _Lp>::element_type;
+      return less<_Tp_elt*>()(nullptr, __a.get());
+    }
+
+  template<typename _Tp1, typename _Tp2, _Lock_policy _Lp>
+    inline bool
+    operator<=(const __shared_ptr<_Tp1, _Lp>& __a,
+        const __shared_ptr<_Tp2, _Lp>& __b) noexcept
+    { return !(__b < __a); }
+
+  template<typename _Tp, _Lock_policy _Lp>
+    inline bool
+    operator<=(const __shared_ptr<_Tp, _Lp>& __a, nullptr_t) noexcept
+    { return !(nullptr < __a); }
+
+  template<typename _Tp, _Lock_policy _Lp>
+    inline bool
+    operator<=(nullptr_t, const __shared_ptr<_Tp, _Lp>& __a) noexcept
+    { return !(__a < nullptr); }
+
+  template<typename _Tp1, typename _Tp2, _Lock_policy _Lp>
+    inline bool
+    operator>(const __shared_ptr<_Tp1, _Lp>& __a,
+       const __shared_ptr<_Tp2, _Lp>& __b) noexcept
+    { return (__b < __a); }
+
+  template<typename _Tp, _Lock_policy _Lp>
+    inline bool
+    operator>(const __shared_ptr<_Tp, _Lp>& __a, nullptr_t) noexcept
+    { return nullptr < __a; }
+
+  template<typename _Tp, _Lock_policy _Lp>
+    inline bool
+    operator>(nullptr_t, const __shared_ptr<_Tp, _Lp>& __a) noexcept
+    { return __a < nullptr; }
+
+  template<typename _Tp1, typename _Tp2, _Lock_policy _Lp>
+    inline bool
+    operator>=(const __shared_ptr<_Tp1, _Lp>& __a,
+        const __shared_ptr<_Tp2, _Lp>& __b) noexcept
+    { return !(__a < __b); }
+
+  template<typename _Tp, _Lock_policy _Lp>
+    inline bool
+    operator>=(const __shared_ptr<_Tp, _Lp>& __a, nullptr_t) noexcept
+    { return !(__a < nullptr); }
+
+  template<typename _Tp, _Lock_policy _Lp>
+    inline bool
+    operator>=(nullptr_t, const __shared_ptr<_Tp, _Lp>& __a) noexcept
+    { return !(nullptr < __a); }
+
+  template<typename _Sp>
+    struct _Sp_less : public binary_function<_Sp, _Sp, bool>
+    {
+      bool
+      operator()(const _Sp& __lhs, const _Sp& __rhs) const noexcept
+      {
+ typedef typename _Sp::element_type element_type;
+ return std::less<element_type*>()(__lhs.get(), __rhs.get());
+      }
+    };
+
+  template<typename _Tp, _Lock_policy _Lp>
+    struct less<__shared_ptr<_Tp, _Lp>>
+    : public _Sp_less<__shared_ptr<_Tp, _Lp>>
+    { };
+
+
+  template<typename _Tp, _Lock_policy _Lp>
+    inline void
+    swap(__shared_ptr<_Tp, _Lp>& __a, __shared_ptr<_Tp, _Lp>& __b) noexcept
+    { __a.swap(__b); }
+  template<typename _Tp, typename _Tp1, _Lock_policy _Lp>
+    inline __shared_ptr<_Tp, _Lp>
+    static_pointer_cast(const __shared_ptr<_Tp1, _Lp>& __r) noexcept
+    {
+      using _Sp = __shared_ptr<_Tp, _Lp>;
+      return _Sp(__r, static_cast<typename _Sp::element_type*>(__r.get()));
+    }
+
+
+
+
+
+
+  template<typename _Tp, typename _Tp1, _Lock_policy _Lp>
+    inline __shared_ptr<_Tp, _Lp>
+    const_pointer_cast(const __shared_ptr<_Tp1, _Lp>& __r) noexcept
+    {
+      using _Sp = __shared_ptr<_Tp, _Lp>;
+      return _Sp(__r, const_cast<typename _Sp::element_type*>(__r.get()));
+    }
+
+
+
+
+
+
+  template<typename _Tp, typename _Tp1, _Lock_policy _Lp>
+    inline __shared_ptr<_Tp, _Lp>
+    dynamic_pointer_cast(const __shared_ptr<_Tp1, _Lp>& __r) noexcept
+    {
+      using _Sp = __shared_ptr<_Tp, _Lp>;
+      if (auto* __p = dynamic_cast<typename _Sp::element_type*>(__r.get()))
+ return _Sp(__r, __p);
+      return _Sp();
+    }
+  template<typename _Tp, _Lock_policy _Lp>
+    class __weak_ptr
+    {
+      template<typename _Yp, typename _Res = void>
+ using _Compatible = typename
+   enable_if<__sp_compatible_with<_Yp*, _Tp*>::value, _Res>::type;
+
+
+      template<typename _Yp>
+ using _Assignable = _Compatible<_Yp, __weak_ptr&>;
+
+    public:
+      using element_type = typename remove_extent<_Tp>::type;
+
+      constexpr __weak_ptr() noexcept
+      : _M_ptr(nullptr), _M_refcount()
+      { }
+
+      __weak_ptr(const __weak_ptr&) noexcept = default;
+
+      ~__weak_ptr() = default;
+      template<typename _Yp, typename = _Compatible<_Yp>>
+ __weak_ptr(const __weak_ptr<_Yp, _Lp>& __r) noexcept
+ : _M_refcount(__r._M_refcount)
+        { _M_ptr = __r.lock().get(); }
+
+      template<typename _Yp, typename = _Compatible<_Yp>>
+ __weak_ptr(const __shared_ptr<_Yp, _Lp>& __r) noexcept
+ : _M_ptr(__r._M_ptr), _M_refcount(__r._M_refcount)
+ { }
+
+      __weak_ptr(__weak_ptr&& __r) noexcept
+      : _M_ptr(__r._M_ptr), _M_refcount(std::move(__r._M_refcount))
+      { __r._M_ptr = nullptr; }
+
+      template<typename _Yp, typename = _Compatible<_Yp>>
+ __weak_ptr(__weak_ptr<_Yp, _Lp>&& __r) noexcept
+ : _M_ptr(__r.lock().get()), _M_refcount(std::move(__r._M_refcount))
+        { __r._M_ptr = nullptr; }
+
+      __weak_ptr&
+      operator=(const __weak_ptr& __r) noexcept = default;
+
+      template<typename _Yp>
+ _Assignable<_Yp>
+ operator=(const __weak_ptr<_Yp, _Lp>& __r) noexcept
+ {
+   _M_ptr = __r.lock().get();
+   _M_refcount = __r._M_refcount;
+   return *this;
+ }
+
+      template<typename _Yp>
+ _Assignable<_Yp>
+ operator=(const __shared_ptr<_Yp, _Lp>& __r) noexcept
+ {
+   _M_ptr = __r._M_ptr;
+   _M_refcount = __r._M_refcount;
+   return *this;
+ }
+
+      __weak_ptr&
+      operator=(__weak_ptr&& __r) noexcept
+      {
+ _M_ptr = __r._M_ptr;
+ _M_refcount = std::move(__r._M_refcount);
+ __r._M_ptr = nullptr;
+ return *this;
+      }
+
+      template<typename _Yp>
+ _Assignable<_Yp>
+ operator=(__weak_ptr<_Yp, _Lp>&& __r) noexcept
+ {
+   _M_ptr = __r.lock().get();
+   _M_refcount = std::move(__r._M_refcount);
+   __r._M_ptr = nullptr;
+   return *this;
+ }
+
+      __shared_ptr<_Tp, _Lp>
+      lock() const noexcept
+      { return __shared_ptr<element_type, _Lp>(*this, std::nothrow); }
+
+      long
+      use_count() const noexcept
+      { return _M_refcount._M_get_use_count(); }
+
+      bool
+      expired() const noexcept
+      { return _M_refcount._M_get_use_count() == 0; }
+
+      template<typename _Tp1>
+ bool
+ owner_before(const __shared_ptr<_Tp1, _Lp>& __rhs) const noexcept
+ { return _M_refcount._M_less(__rhs._M_refcount); }
+
+      template<typename _Tp1>
+ bool
+ owner_before(const __weak_ptr<_Tp1, _Lp>& __rhs) const noexcept
+ { return _M_refcount._M_less(__rhs._M_refcount); }
+
+      void
+      reset() noexcept
+      { __weak_ptr().swap(*this); }
+
+      void
+      swap(__weak_ptr& __s) noexcept
+      {
+ std::swap(_M_ptr, __s._M_ptr);
+ _M_refcount._M_swap(__s._M_refcount);
+      }
+
+    private:
+
+      void
+      _M_assign(_Tp* __ptr, const __shared_count<_Lp>& __refcount) noexcept
+      {
+ if (use_count() == 0)
+   {
+     _M_ptr = __ptr;
+     _M_refcount = __refcount;
+   }
+      }
+
+      template<typename _Tp1, _Lock_policy _Lp1> friend class __shared_ptr;
+      template<typename _Tp1, _Lock_policy _Lp1> friend class __weak_ptr;
+      friend class __enable_shared_from_this<_Tp, _Lp>;
+      friend class enable_shared_from_this<_Tp>;
+
+      element_type* _M_ptr;
+      __weak_count<_Lp> _M_refcount;
+    };
+
+
+  template<typename _Tp, _Lock_policy _Lp>
+    inline void
+    swap(__weak_ptr<_Tp, _Lp>& __a, __weak_ptr<_Tp, _Lp>& __b) noexcept
+    { __a.swap(__b); }
+
+  template<typename _Tp, typename _Tp1>
+    struct _Sp_owner_less : public binary_function<_Tp, _Tp, bool>
+    {
+      bool
+      operator()(const _Tp& __lhs, const _Tp& __rhs) const noexcept
+      { return __lhs.owner_before(__rhs); }
+
+      bool
+      operator()(const _Tp& __lhs, const _Tp1& __rhs) const noexcept
+      { return __lhs.owner_before(__rhs); }
+
+      bool
+      operator()(const _Tp1& __lhs, const _Tp& __rhs) const noexcept
+      { return __lhs.owner_before(__rhs); }
+    };
+
+  template<>
+    struct _Sp_owner_less<void, void>
+    {
+      template<typename _Tp, typename _Up>
+ auto
+ operator()(const _Tp& __lhs, const _Up& __rhs) const noexcept
+ -> decltype(__lhs.owner_before(__rhs))
+ { return __lhs.owner_before(__rhs); }
+
+      using is_transparent = void;
+    };
+
+  template<typename _Tp, _Lock_policy _Lp>
+    struct owner_less<__shared_ptr<_Tp, _Lp>>
+    : public _Sp_owner_less<__shared_ptr<_Tp, _Lp>, __weak_ptr<_Tp, _Lp>>
+    { };
+
+  template<typename _Tp, _Lock_policy _Lp>
+    struct owner_less<__weak_ptr<_Tp, _Lp>>
+    : public _Sp_owner_less<__weak_ptr<_Tp, _Lp>, __shared_ptr<_Tp, _Lp>>
+    { };
+
+
+  template<typename _Tp, _Lock_policy _Lp>
+    class __enable_shared_from_this
+    {
+    protected:
+      constexpr __enable_shared_from_this() noexcept { }
+
+      __enable_shared_from_this(const __enable_shared_from_this&) noexcept { }
+
+      __enable_shared_from_this&
+      operator=(const __enable_shared_from_this&) noexcept
+      { return *this; }
+
+      ~__enable_shared_from_this() { }
+
+    public:
+      __shared_ptr<_Tp, _Lp>
+      shared_from_this()
+      { return __shared_ptr<_Tp, _Lp>(this->_M_weak_this); }
+
+      __shared_ptr<const _Tp, _Lp>
+      shared_from_this() const
+      { return __shared_ptr<const _Tp, _Lp>(this->_M_weak_this); }
+    private:
+      template<typename _Tp1>
+ void
+ _M_weak_assign(_Tp1* __p, const __shared_count<_Lp>& __n) const noexcept
+ { _M_weak_this._M_assign(__p, __n); }
+
+      friend const __enable_shared_from_this*
+      __enable_shared_from_this_base(const __shared_count<_Lp>&,
+         const __enable_shared_from_this* __p)
+      { return __p; }
+
+      template<typename, _Lock_policy>
+ friend class __shared_ptr;
+
+      mutable __weak_ptr<_Tp, _Lp> _M_weak_this;
+    };
+
+  template<typename _Tp, _Lock_policy _Lp, typename _Alloc, typename... _Args>
+    inline __shared_ptr<_Tp, _Lp>
+    __allocate_shared(const _Alloc& __a, _Args&&... __args)
+    {
+      return __shared_ptr<_Tp, _Lp>(_Sp_make_shared_tag(), __a,
+        std::forward<_Args>(__args)...);
+    }
+
+  template<typename _Tp, _Lock_policy _Lp, typename... _Args>
+    inline __shared_ptr<_Tp, _Lp>
+    __make_shared(_Args&&... __args)
+    {
+      typedef typename std::remove_const<_Tp>::type _Tp_nc;
+      return std::__allocate_shared<_Tp, _Lp>(std::allocator<_Tp_nc>(),
+           std::forward<_Args>(__args)...);
+    }
+
+
+  template<typename _Tp, _Lock_policy _Lp>
+    struct hash<__shared_ptr<_Tp, _Lp>>
+    : public __hash_base<size_t, __shared_ptr<_Tp, _Lp>>
+    {
+      size_t
+      operator()(const __shared_ptr<_Tp, _Lp>& __s) const noexcept
+      {
+ return hash<typename __shared_ptr<_Tp, _Lp>::element_type*>()(
+     __s.get());
+      }
+    };
+
+
+}
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+
+
+
+
+
+  template<typename _Ch, typename _Tr, typename _Tp, _Lock_policy _Lp>
+    inline std::basic_ostream<_Ch, _Tr>&
+    operator<<(std::basic_ostream<_Ch, _Tr>& __os,
+        const __shared_ptr<_Tp, _Lp>& __p)
+    {
+      __os << __p.get();
+      return __os;
+    }
+
+  template<typename _Del, typename _Tp, _Lock_policy _Lp>
+    inline _Del*
+    get_deleter(const __shared_ptr<_Tp, _Lp>& __p) noexcept
+    {
+
+
+
+      return 0;
+
+    }
+
+
+  template<typename _Del, typename _Tp>
+    inline _Del*
+    get_deleter(const shared_ptr<_Tp>& __p) noexcept
+    {
+
+
+
+      return 0;
+
+    }
+
+
+
+
+
+
+
+  template<typename _Tp>
+    class shared_ptr : public __shared_ptr<_Tp>
+    {
+      template<typename... _Args>
+ using _Constructible = typename enable_if<
+   is_constructible<__shared_ptr<_Tp>, _Args...>::value
+ >::type;
+
+      template<typename _Arg>
+ using _Assignable = typename enable_if<
+   is_assignable<__shared_ptr<_Tp>&, _Arg>::value, shared_ptr&
+ >::type;
+
+    public:
+
+      using element_type = typename __shared_ptr<_Tp>::element_type;
+      constexpr shared_ptr() noexcept : __shared_ptr<_Tp>() { }
+
+      shared_ptr(const shared_ptr&) noexcept = default;
+
+
+
+
+
+
+
+      template<typename _Yp, typename = _Constructible<_Yp*>>
+ explicit
+ shared_ptr(_Yp* __p) : __shared_ptr<_Tp>(__p) { }
+      template<typename _Yp, typename _Deleter,
+        typename = _Constructible<_Yp*, _Deleter>>
+ shared_ptr(_Yp* __p, _Deleter __d)
+        : __shared_ptr<_Tp>(__p, std::move(__d)) { }
+      template<typename _Deleter>
+ shared_ptr(nullptr_t __p, _Deleter __d)
+        : __shared_ptr<_Tp>(__p, std::move(__d)) { }
+      template<typename _Yp, typename _Deleter, typename _Alloc,
+        typename = _Constructible<_Yp*, _Deleter, _Alloc>>
+ shared_ptr(_Yp* __p, _Deleter __d, _Alloc __a)
+ : __shared_ptr<_Tp>(__p, std::move(__d), std::move(__a)) { }
+      template<typename _Deleter, typename _Alloc>
+ shared_ptr(nullptr_t __p, _Deleter __d, _Alloc __a)
+ : __shared_ptr<_Tp>(__p, std::move(__d), std::move(__a)) { }
+      template<typename _Yp>
+ shared_ptr(const shared_ptr<_Yp>& __r, element_type* __p) noexcept
+ : __shared_ptr<_Tp>(__r, __p) { }
+      template<typename _Yp,
+        typename = _Constructible<const shared_ptr<_Yp>&>>
+ shared_ptr(const shared_ptr<_Yp>& __r) noexcept
+        : __shared_ptr<_Tp>(__r) { }
+
+
+
+
+
+
+      shared_ptr(shared_ptr&& __r) noexcept
+      : __shared_ptr<_Tp>(std::move(__r)) { }
+
+
+
+
+
+
+      template<typename _Yp, typename = _Constructible<shared_ptr<_Yp>>>
+ shared_ptr(shared_ptr<_Yp>&& __r) noexcept
+ : __shared_ptr<_Tp>(std::move(__r)) { }
+      template<typename _Yp, typename = _Constructible<const weak_ptr<_Yp>&>>
+ explicit shared_ptr(const weak_ptr<_Yp>& __r)
+ : __shared_ptr<_Tp>(__r) { }
+
+
+      template<typename _Yp, typename = _Constructible<auto_ptr<_Yp>>>
+ shared_ptr(auto_ptr<_Yp>&& __r);
+
+
+
+
+      template<typename _Yp, typename _Del,
+        typename = _Constructible<unique_ptr<_Yp, _Del>>>
+ shared_ptr(unique_ptr<_Yp, _Del>&& __r)
+ : __shared_ptr<_Tp>(std::move(__r)) { }
+
+
+
+
+
+      template<typename _Yp, typename _Del,
+  _Constructible<unique_ptr<_Yp, _Del>, __sp_array_delete>* = 0>
+ shared_ptr(unique_ptr<_Yp, _Del>&& __r)
+ : __shared_ptr<_Tp>(std::move(__r), __sp_array_delete()) { }
+
+
+
+
+
+
+      constexpr shared_ptr(nullptr_t) noexcept : shared_ptr() { }
+
+      shared_ptr& operator=(const shared_ptr&) noexcept = default;
+
+      template<typename _Yp>
+ _Assignable<const shared_ptr<_Yp>&>
+ operator=(const shared_ptr<_Yp>& __r) noexcept
+ {
+   this->__shared_ptr<_Tp>::operator=(__r);
+   return *this;
+ }
+
+
+      template<typename _Yp>
+ _Assignable<auto_ptr<_Yp>>
+ operator=(auto_ptr<_Yp>&& __r)
+ {
+   this->__shared_ptr<_Tp>::operator=(std::move(__r));
+   return *this;
+ }
+
+
+      shared_ptr&
+      operator=(shared_ptr&& __r) noexcept
+      {
+ this->__shared_ptr<_Tp>::operator=(std::move(__r));
+ return *this;
+      }
+
+      template<class _Yp>
+ _Assignable<shared_ptr<_Yp>>
+ operator=(shared_ptr<_Yp>&& __r) noexcept
+ {
+   this->__shared_ptr<_Tp>::operator=(std::move(__r));
+   return *this;
+ }
+
+      template<typename _Yp, typename _Del>
+ _Assignable<unique_ptr<_Yp, _Del>>
+ operator=(unique_ptr<_Yp, _Del>&& __r)
+ {
+   this->__shared_ptr<_Tp>::operator=(std::move(__r));
+   return *this;
+ }
+
+    private:
+
+      template<typename _Alloc, typename... _Args>
+ shared_ptr(_Sp_make_shared_tag __tag, const _Alloc& __a,
+     _Args&&... __args)
+ : __shared_ptr<_Tp>(__tag, __a, std::forward<_Args>(__args)...)
+ { }
+
+      template<typename _Yp, typename _Alloc, typename... _Args>
+ friend shared_ptr<_Yp>
+ allocate_shared(const _Alloc& __a, _Args&&... __args);
+
+
+      shared_ptr(const weak_ptr<_Tp>& __r, std::nothrow_t)
+      : __shared_ptr<_Tp>(__r, std::nothrow) { }
+
+      friend class weak_ptr<_Tp>;
+    };
+  template<typename _Tp, typename _Up>
+    inline bool
+    operator==(const shared_ptr<_Tp>& __a, const shared_ptr<_Up>& __b) noexcept
+    { return __a.get() == __b.get(); }
+
+  template<typename _Tp>
+    inline bool
+    operator==(const shared_ptr<_Tp>& __a, nullptr_t) noexcept
+    { return !__a; }
+
+  template<typename _Tp>
+    inline bool
+    operator==(nullptr_t, const shared_ptr<_Tp>& __a) noexcept
+    { return !__a; }
+
+  template<typename _Tp, typename _Up>
+    inline bool
+    operator!=(const shared_ptr<_Tp>& __a, const shared_ptr<_Up>& __b) noexcept
+    { return __a.get() != __b.get(); }
+
+  template<typename _Tp>
+    inline bool
+    operator!=(const shared_ptr<_Tp>& __a, nullptr_t) noexcept
+    { return (bool)__a; }
+
+  template<typename _Tp>
+    inline bool
+    operator!=(nullptr_t, const shared_ptr<_Tp>& __a) noexcept
+    { return (bool)__a; }
+
+  template<typename _Tp, typename _Up>
+    inline bool
+    operator<(const shared_ptr<_Tp>& __a, const shared_ptr<_Up>& __b) noexcept
+    {
+      using _Tp_elt = typename shared_ptr<_Tp>::element_type;
+      using _Up_elt = typename shared_ptr<_Up>::element_type;
+      using _Vp = typename common_type<_Tp_elt*, _Up_elt*>::type;
+      return less<_Vp>()(__a.get(), __b.get());
+    }
+
+  template<typename _Tp>
+    inline bool
+    operator<(const shared_ptr<_Tp>& __a, nullptr_t) noexcept
+    {
+      using _Tp_elt = typename shared_ptr<_Tp>::element_type;
+      return less<_Tp_elt*>()(__a.get(), nullptr);
+    }
+
+  template<typename _Tp>
+    inline bool
+    operator<(nullptr_t, const shared_ptr<_Tp>& __a) noexcept
+    {
+      using _Tp_elt = typename shared_ptr<_Tp>::element_type;
+      return less<_Tp_elt*>()(nullptr, __a.get());
+    }
+
+  template<typename _Tp, typename _Up>
+    inline bool
+    operator<=(const shared_ptr<_Tp>& __a, const shared_ptr<_Up>& __b) noexcept
+    { return !(__b < __a); }
+
+  template<typename _Tp>
+    inline bool
+    operator<=(const shared_ptr<_Tp>& __a, nullptr_t) noexcept
+    { return !(nullptr < __a); }
+
+  template<typename _Tp>
+    inline bool
+    operator<=(nullptr_t, const shared_ptr<_Tp>& __a) noexcept
+    { return !(__a < nullptr); }
+
+  template<typename _Tp, typename _Up>
+    inline bool
+    operator>(const shared_ptr<_Tp>& __a, const shared_ptr<_Up>& __b) noexcept
+    { return (__b < __a); }
+
+  template<typename _Tp>
+    inline bool
+    operator>(const shared_ptr<_Tp>& __a, nullptr_t) noexcept
+    { return nullptr < __a; }
+
+  template<typename _Tp>
+    inline bool
+    operator>(nullptr_t, const shared_ptr<_Tp>& __a) noexcept
+    { return __a < nullptr; }
+
+  template<typename _Tp, typename _Up>
+    inline bool
+    operator>=(const shared_ptr<_Tp>& __a, const shared_ptr<_Up>& __b) noexcept
+    { return !(__a < __b); }
+
+  template<typename _Tp>
+    inline bool
+    operator>=(const shared_ptr<_Tp>& __a, nullptr_t) noexcept
+    { return !(__a < nullptr); }
+
+  template<typename _Tp>
+    inline bool
+    operator>=(nullptr_t, const shared_ptr<_Tp>& __a) noexcept
+    { return !(nullptr < __a); }
+
+  template<typename _Tp>
+    struct less<shared_ptr<_Tp>> : public _Sp_less<shared_ptr<_Tp>>
+    { };
+
+
+  template<typename _Tp>
+    inline void
+    swap(shared_ptr<_Tp>& __a, shared_ptr<_Tp>& __b) noexcept
+    { __a.swap(__b); }
+
+
+  template<typename _Tp, typename _Up>
+    inline shared_ptr<_Tp>
+    static_pointer_cast(const shared_ptr<_Up>& __r) noexcept
+    {
+      using _Sp = shared_ptr<_Tp>;
+      return _Sp(__r, static_cast<typename _Sp::element_type*>(__r.get()));
+    }
+
+  template<typename _Tp, typename _Up>
+    inline shared_ptr<_Tp>
+    const_pointer_cast(const shared_ptr<_Up>& __r) noexcept
+    {
+      using _Sp = shared_ptr<_Tp>;
+      return _Sp(__r, const_cast<typename _Sp::element_type*>(__r.get()));
+    }
+
+  template<typename _Tp, typename _Up>
+    inline shared_ptr<_Tp>
+    dynamic_pointer_cast(const shared_ptr<_Up>& __r) noexcept
+    {
+      using _Sp = shared_ptr<_Tp>;
+      if (auto* __p = dynamic_cast<typename _Sp::element_type*>(__r.get()))
+ return _Sp(__r, __p);
+      return _Sp();
+    }
+  template<typename _Tp>
+    class weak_ptr : public __weak_ptr<_Tp>
+    {
+      template<typename _Arg>
+ using _Constructible = typename enable_if<
+   is_constructible<__weak_ptr<_Tp>, _Arg>::value
+ >::type;
+
+      template<typename _Arg>
+ using _Assignable = typename enable_if<
+   is_assignable<__weak_ptr<_Tp>&, _Arg>::value, weak_ptr&
+ >::type;
+
+    public:
+      constexpr weak_ptr() noexcept = default;
+
+      template<typename _Yp,
+        typename = _Constructible<const shared_ptr<_Yp>&>>
+ weak_ptr(const shared_ptr<_Yp>& __r) noexcept
+ : __weak_ptr<_Tp>(__r) { }
+
+      weak_ptr(const weak_ptr&) noexcept = default;
+
+      template<typename _Yp, typename = _Constructible<const weak_ptr<_Yp>&>>
+ weak_ptr(const weak_ptr<_Yp>& __r) noexcept
+ : __weak_ptr<_Tp>(__r) { }
+
+      weak_ptr(weak_ptr&&) noexcept = default;
+
+      template<typename _Yp, typename = _Constructible<weak_ptr<_Yp>>>
+ weak_ptr(weak_ptr<_Yp>&& __r) noexcept
+ : __weak_ptr<_Tp>(std::move(__r)) { }
+
+      weak_ptr&
+      operator=(const weak_ptr& __r) noexcept = default;
+
+      template<typename _Yp>
+ _Assignable<const weak_ptr<_Yp>&>
+ operator=(const weak_ptr<_Yp>& __r) noexcept
+ {
+   this->__weak_ptr<_Tp>::operator=(__r);
+   return *this;
+ }
+
+      template<typename _Yp>
+ _Assignable<const shared_ptr<_Yp>&>
+ operator=(const shared_ptr<_Yp>& __r) noexcept
+ {
+   this->__weak_ptr<_Tp>::operator=(__r);
+   return *this;
+ }
+
+      weak_ptr&
+      operator=(weak_ptr&& __r) noexcept = default;
+
+      template<typename _Yp>
+ _Assignable<weak_ptr<_Yp>>
+ operator=(weak_ptr<_Yp>&& __r) noexcept
+ {
+   this->__weak_ptr<_Tp>::operator=(std::move(__r));
+   return *this;
+ }
+
+      shared_ptr<_Tp>
+      lock() const noexcept
+      { return shared_ptr<_Tp>(*this, std::nothrow); }
+    };
+
+
+
+
+
+
+
+  template<typename _Tp>
+    inline void
+    swap(weak_ptr<_Tp>& __a, weak_ptr<_Tp>& __b) noexcept
+    { __a.swap(__b); }
+
+
+
+  template<typename _Tp = void>
+    struct owner_less;
+
+
+  template<>
+    struct owner_less<void> : _Sp_owner_less<void, void>
+    { };
+
+
+  template<typename _Tp>
+    struct owner_less<shared_ptr<_Tp>>
+    : public _Sp_owner_less<shared_ptr<_Tp>, weak_ptr<_Tp>>
+    { };
+
+
+  template<typename _Tp>
+    struct owner_less<weak_ptr<_Tp>>
+    : public _Sp_owner_less<weak_ptr<_Tp>, shared_ptr<_Tp>>
+    { };
+
+
+
+
+  template<typename _Tp>
+    class enable_shared_from_this
+    {
+    protected:
+      constexpr enable_shared_from_this() noexcept { }
+
+      enable_shared_from_this(const enable_shared_from_this&) noexcept { }
+
+      enable_shared_from_this&
+      operator=(const enable_shared_from_this&) noexcept
+      { return *this; }
+
+      ~enable_shared_from_this() { }
+
+    public:
+      shared_ptr<_Tp>
+      shared_from_this()
+      { return shared_ptr<_Tp>(this->_M_weak_this); }
+
+      shared_ptr<const _Tp>
+      shared_from_this() const
+      { return shared_ptr<const _Tp>(this->_M_weak_this); }
+    private:
+      template<typename _Tp1>
+ void
+ _M_weak_assign(_Tp1* __p, const __shared_count<>& __n) const noexcept
+ { _M_weak_this._M_assign(__p, __n); }
+
+
+      friend const enable_shared_from_this*
+      __enable_shared_from_this_base(const __shared_count<>&,
+         const enable_shared_from_this* __p)
+      { return __p; }
+
+      template<typename, _Lock_policy>
+ friend class __shared_ptr;
+
+      mutable weak_ptr<_Tp> _M_weak_this;
+    };
+  template<typename _Tp, typename _Alloc, typename... _Args>
+    inline shared_ptr<_Tp>
+    allocate_shared(const _Alloc& __a, _Args&&... __args)
+    {
+      return shared_ptr<_Tp>(_Sp_make_shared_tag(), __a,
+        std::forward<_Args>(__args)...);
+    }
+  template<typename _Tp, typename... _Args>
+    inline shared_ptr<_Tp>
+    make_shared(_Args&&... __args)
+    {
+      typedef typename std::remove_const<_Tp>::type _Tp_nc;
+      return std::allocate_shared<_Tp>(std::allocator<_Tp_nc>(),
+           std::forward<_Args>(__args)...);
+    }
+
+
+  template<typename _Tp>
+    struct hash<shared_ptr<_Tp>>
+    : public __hash_base<size_t, shared_ptr<_Tp>>
+    {
+      size_t
+      operator()(const shared_ptr<_Tp>& __s) const noexcept
+      {
+ return std::hash<typename shared_ptr<_Tp>::element_type*>()(__s.get());
+      }
+    };
+
+
+
+
+}
+       
+
+
+
+       
+
+
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+  typedef enum memory_order
+    {
+      memory_order_relaxed,
+      memory_order_consume,
+      memory_order_acquire,
+      memory_order_release,
+      memory_order_acq_rel,
+      memory_order_seq_cst
+    } memory_order;
+
+  enum __memory_order_modifier
+    {
+      __memory_order_mask = 0x0ffff,
+      __memory_order_modifier_mask = 0xffff0000,
+      __memory_order_hle_acquire = 0x10000,
+      __memory_order_hle_release = 0x20000
+    };
+
+  constexpr memory_order
+  operator|(memory_order __m, __memory_order_modifier __mod)
+  {
+    return memory_order(__m | int(__mod));
+  }
+
+  constexpr memory_order
+  operator&(memory_order __m, __memory_order_modifier __mod)
+  {
+    return memory_order(__m & int(__mod));
+  }
+
+
+  constexpr memory_order
+  __cmpexch_failure_order2(memory_order __m) noexcept
+  {
+    return __m == memory_order_acq_rel ? memory_order_acquire
+      : __m == memory_order_release ? memory_order_relaxed : __m;
+  }
+
+  constexpr memory_order
+  __cmpexch_failure_order(memory_order __m) noexcept
+  {
+    return memory_order(__cmpexch_failure_order2(__m & __memory_order_mask)
+      | (__m & __memory_order_modifier_mask));
+  }
+
+  inline __attribute__((__always_inline__)) void
+  atomic_thread_fence(memory_order __m) noexcept
+  { __atomic_thread_fence(__m); }
+
+  inline __attribute__((__always_inline__)) void
+  atomic_signal_fence(memory_order __m) noexcept
+  { __atomic_signal_fence(__m); }
+
+
+  template<typename _Tp>
+    inline _Tp
+    kill_dependency(_Tp __y) noexcept
+    {
+      _Tp __ret(__y);
+      return __ret;
+    }
+
+
+
+  template<typename _IntTp>
+    struct __atomic_base;
+
+
+
+
+  template<typename _Tp>
+    struct atomic;
+
+  template<typename _Tp>
+    struct atomic<_Tp*>;
+
+
+
+    typedef bool __atomic_flag_data_type;
+  extern "C" {
+
+  struct __atomic_flag_base
+  {
+    __atomic_flag_data_type _M_i;
+  };
+
+  }
+
+
+
+
+  struct atomic_flag : public __atomic_flag_base
+  {
+    atomic_flag() noexcept = default;
+    ~atomic_flag() noexcept = default;
+    atomic_flag(const atomic_flag&) = delete;
+    atomic_flag& operator=(const atomic_flag&) = delete;
+    atomic_flag& operator=(const atomic_flag&) volatile = delete;
+
+
+    constexpr atomic_flag(bool __i) noexcept
+      : __atomic_flag_base{ _S_init(__i) }
+    { }
+
+    inline __attribute__((__always_inline__)) bool
+    test_and_set(memory_order __m = memory_order_seq_cst) noexcept
+    {
+      return __atomic_test_and_set (&_M_i, __m);
+    }
+
+    inline __attribute__((__always_inline__)) bool
+    test_and_set(memory_order __m = memory_order_seq_cst) volatile noexcept
+    {
+      return __atomic_test_and_set (&_M_i, __m);
+    }
+
+    inline __attribute__((__always_inline__)) void
+    clear(memory_order __m = memory_order_seq_cst) noexcept
+    {
+      memory_order __b = __m & __memory_order_mask;
+      ;
+      ;
+      ;
+
+      __atomic_clear (&_M_i, __m);
+    }
+
+    inline __attribute__((__always_inline__)) void
+    clear(memory_order __m = memory_order_seq_cst) volatile noexcept
+    {
+      memory_order __b = __m & __memory_order_mask;
+      ;
+      ;
+      ;
+
+      __atomic_clear (&_M_i, __m);
+    }
+
+  private:
+    static constexpr __atomic_flag_data_type
+    _S_init(bool __i)
+    { return __i ? 1 : 0; }
+  };
+  template<typename _ITp>
+    struct __atomic_base
+    {
+    private:
+      typedef _ITp __int_type;
+
+      static constexpr int _S_alignment =
+ sizeof(_ITp) > alignof(_ITp) ? sizeof(_ITp) : alignof(_ITp);
+
+      alignas(_S_alignment) __int_type _M_i;
+
+    public:
+      __atomic_base() noexcept = default;
+      ~__atomic_base() noexcept = default;
+      __atomic_base(const __atomic_base&) = delete;
+      __atomic_base& operator=(const __atomic_base&) = delete;
+      __atomic_base& operator=(const __atomic_base&) volatile = delete;
+
+
+      constexpr __atomic_base(__int_type __i) noexcept : _M_i (__i) { }
+
+      operator __int_type() const noexcept
+      { return load(); }
+
+      operator __int_type() const volatile noexcept
+      { return load(); }
+
+      __int_type
+      operator=(__int_type __i) noexcept
+      {
+ store(__i);
+ return __i;
+      }
+
+      __int_type
+      operator=(__int_type __i) volatile noexcept
+      {
+ store(__i);
+ return __i;
+      }
+
+      __int_type
+      operator++(int) noexcept
+      { return fetch_add(1); }
+
+      __int_type
+      operator++(int) volatile noexcept
+      { return fetch_add(1); }
+
+      __int_type
+      operator--(int) noexcept
+      { return fetch_sub(1); }
+
+      __int_type
+      operator--(int) volatile noexcept
+      { return fetch_sub(1); }
+
+      __int_type
+      operator++() noexcept
+      { return __atomic_add_fetch(&_M_i, 1, memory_order_seq_cst); }
+
+      __int_type
+      operator++() volatile noexcept
+      { return __atomic_add_fetch(&_M_i, 1, memory_order_seq_cst); }
+
+      __int_type
+      operator--() noexcept
+      { return __atomic_sub_fetch(&_M_i, 1, memory_order_seq_cst); }
+
+      __int_type
+      operator--() volatile noexcept
+      { return __atomic_sub_fetch(&_M_i, 1, memory_order_seq_cst); }
+
+      __int_type
+      operator+=(__int_type __i) noexcept
+      { return __atomic_add_fetch(&_M_i, __i, memory_order_seq_cst); }
+
+      __int_type
+      operator+=(__int_type __i) volatile noexcept
+      { return __atomic_add_fetch(&_M_i, __i, memory_order_seq_cst); }
+
+      __int_type
+      operator-=(__int_type __i) noexcept
+      { return __atomic_sub_fetch(&_M_i, __i, memory_order_seq_cst); }
+
+      __int_type
+      operator-=(__int_type __i) volatile noexcept
+      { return __atomic_sub_fetch(&_M_i, __i, memory_order_seq_cst); }
+
+      __int_type
+      operator&=(__int_type __i) noexcept
+      { return __atomic_and_fetch(&_M_i, __i, memory_order_seq_cst); }
+
+      __int_type
+      operator&=(__int_type __i) volatile noexcept
+      { return __atomic_and_fetch(&_M_i, __i, memory_order_seq_cst); }
+
+      __int_type
+      operator|=(__int_type __i) noexcept
+      { return __atomic_or_fetch(&_M_i, __i, memory_order_seq_cst); }
+
+      __int_type
+      operator|=(__int_type __i) volatile noexcept
+      { return __atomic_or_fetch(&_M_i, __i, memory_order_seq_cst); }
+
+      __int_type
+      operator^=(__int_type __i) noexcept
+      { return __atomic_xor_fetch(&_M_i, __i, memory_order_seq_cst); }
+
+      __int_type
+      operator^=(__int_type __i) volatile noexcept
+      { return __atomic_xor_fetch(&_M_i, __i, memory_order_seq_cst); }
+
+      bool
+      is_lock_free() const noexcept
+      {
+
+ return __atomic_is_lock_free(sizeof(_M_i),
+     reinterpret_cast<void *>(-__alignof(_M_i)));
+      }
+
+      bool
+      is_lock_free() const volatile noexcept
+      {
+
+ return __atomic_is_lock_free(sizeof(_M_i),
+     reinterpret_cast<void *>(-__alignof(_M_i)));
+      }
+
+      inline __attribute__((__always_inline__)) void
+      store(__int_type __i, memory_order __m = memory_order_seq_cst) noexcept
+      {
+ memory_order __b = __m & __memory_order_mask;
+ ;
+ ;
+ ;
+
+ __atomic_store_n(&_M_i, __i, __m);
+      }
+
+      inline __attribute__((__always_inline__)) void
+      store(__int_type __i,
+     memory_order __m = memory_order_seq_cst) volatile noexcept
+      {
+ memory_order __b = __m & __memory_order_mask;
+ ;
+ ;
+ ;
+
+ __atomic_store_n(&_M_i, __i, __m);
+      }
+
+      inline __attribute__((__always_inline__)) __int_type
+      load(memory_order __m = memory_order_seq_cst) const noexcept
+      {
+ memory_order __b = __m & __memory_order_mask;
+ ;
+ ;
+
+ return __atomic_load_n(&_M_i, __m);
+      }
+
+      inline __attribute__((__always_inline__)) __int_type
+      load(memory_order __m = memory_order_seq_cst) const volatile noexcept
+      {
+ memory_order __b = __m & __memory_order_mask;
+ ;
+ ;
+
+ return __atomic_load_n(&_M_i, __m);
+      }
+
+      inline __attribute__((__always_inline__)) __int_type
+      exchange(__int_type __i,
+        memory_order __m = memory_order_seq_cst) noexcept
+      {
+ return __atomic_exchange_n(&_M_i, __i, __m);
+      }
+
+
+      inline __attribute__((__always_inline__)) __int_type
+      exchange(__int_type __i,
+        memory_order __m = memory_order_seq_cst) volatile noexcept
+      {
+ return __atomic_exchange_n(&_M_i, __i, __m);
+      }
+
+      inline __attribute__((__always_inline__)) bool
+      compare_exchange_weak(__int_type& __i1, __int_type __i2,
+       memory_order __m1, memory_order __m2) noexcept
+      {
+ memory_order __b2 = __m2 & __memory_order_mask;
+ memory_order __b1 = __m1 & __memory_order_mask;
+ ;
+ ;
+ ;
+
+ return __atomic_compare_exchange_n(&_M_i, &__i1, __i2, 1, __m1, __m2);
+      }
+
+      inline __attribute__((__always_inline__)) bool
+      compare_exchange_weak(__int_type& __i1, __int_type __i2,
+       memory_order __m1,
+       memory_order __m2) volatile noexcept
+      {
+ memory_order __b2 = __m2 & __memory_order_mask;
+ memory_order __b1 = __m1 & __memory_order_mask;
+ ;
+ ;
+ ;
+
+ return __atomic_compare_exchange_n(&_M_i, &__i1, __i2, 1, __m1, __m2);
+      }
+
+      inline __attribute__((__always_inline__)) bool
+      compare_exchange_weak(__int_type& __i1, __int_type __i2,
+       memory_order __m = memory_order_seq_cst) noexcept
+      {
+ return compare_exchange_weak(__i1, __i2, __m,
+         __cmpexch_failure_order(__m));
+      }
+
+      inline __attribute__((__always_inline__)) bool
+      compare_exchange_weak(__int_type& __i1, __int_type __i2,
+     memory_order __m = memory_order_seq_cst) volatile noexcept
+      {
+ return compare_exchange_weak(__i1, __i2, __m,
+         __cmpexch_failure_order(__m));
+      }
+
+      inline __attribute__((__always_inline__)) bool
+      compare_exchange_strong(__int_type& __i1, __int_type __i2,
+         memory_order __m1, memory_order __m2) noexcept
+      {
+ memory_order __b2 = __m2 & __memory_order_mask;
+ memory_order __b1 = __m1 & __memory_order_mask;
+ ;
+ ;
+ ;
+
+ return __atomic_compare_exchange_n(&_M_i, &__i1, __i2, 0, __m1, __m2);
+      }
+
+      inline __attribute__((__always_inline__)) bool
+      compare_exchange_strong(__int_type& __i1, __int_type __i2,
+         memory_order __m1,
+         memory_order __m2) volatile noexcept
+      {
+ memory_order __b2 = __m2 & __memory_order_mask;
+ memory_order __b1 = __m1 & __memory_order_mask;
+
+ ;
+ ;
+ ;
+
+ return __atomic_compare_exchange_n(&_M_i, &__i1, __i2, 0, __m1, __m2);
+      }
+
+      inline __attribute__((__always_inline__)) bool
+      compare_exchange_strong(__int_type& __i1, __int_type __i2,
+         memory_order __m = memory_order_seq_cst) noexcept
+      {
+ return compare_exchange_strong(__i1, __i2, __m,
+           __cmpexch_failure_order(__m));
+      }
+
+      inline __attribute__((__always_inline__)) bool
+      compare_exchange_strong(__int_type& __i1, __int_type __i2,
+   memory_order __m = memory_order_seq_cst) volatile noexcept
+      {
+ return compare_exchange_strong(__i1, __i2, __m,
+           __cmpexch_failure_order(__m));
+      }
+
+      inline __attribute__((__always_inline__)) __int_type
+      fetch_add(__int_type __i,
+  memory_order __m = memory_order_seq_cst) noexcept
+      { return __atomic_fetch_add(&_M_i, __i, __m); }
+
+      inline __attribute__((__always_inline__)) __int_type
+      fetch_add(__int_type __i,
+  memory_order __m = memory_order_seq_cst) volatile noexcept
+      { return __atomic_fetch_add(&_M_i, __i, __m); }
+
+      inline __attribute__((__always_inline__)) __int_type
+      fetch_sub(__int_type __i,
+  memory_order __m = memory_order_seq_cst) noexcept
+      { return __atomic_fetch_sub(&_M_i, __i, __m); }
+
+      inline __attribute__((__always_inline__)) __int_type
+      fetch_sub(__int_type __i,
+  memory_order __m = memory_order_seq_cst) volatile noexcept
+      { return __atomic_fetch_sub(&_M_i, __i, __m); }
+
+      inline __attribute__((__always_inline__)) __int_type
+      fetch_and(__int_type __i,
+  memory_order __m = memory_order_seq_cst) noexcept
+      { return __atomic_fetch_and(&_M_i, __i, __m); }
+
+      inline __attribute__((__always_inline__)) __int_type
+      fetch_and(__int_type __i,
+  memory_order __m = memory_order_seq_cst) volatile noexcept
+      { return __atomic_fetch_and(&_M_i, __i, __m); }
+
+      inline __attribute__((__always_inline__)) __int_type
+      fetch_or(__int_type __i,
+        memory_order __m = memory_order_seq_cst) noexcept
+      { return __atomic_fetch_or(&_M_i, __i, __m); }
+
+      inline __attribute__((__always_inline__)) __int_type
+      fetch_or(__int_type __i,
+        memory_order __m = memory_order_seq_cst) volatile noexcept
+      { return __atomic_fetch_or(&_M_i, __i, __m); }
+
+      inline __attribute__((__always_inline__)) __int_type
+      fetch_xor(__int_type __i,
+  memory_order __m = memory_order_seq_cst) noexcept
+      { return __atomic_fetch_xor(&_M_i, __i, __m); }
+
+      inline __attribute__((__always_inline__)) __int_type
+      fetch_xor(__int_type __i,
+  memory_order __m = memory_order_seq_cst) volatile noexcept
+      { return __atomic_fetch_xor(&_M_i, __i, __m); }
+    };
+
+
+
+  template<typename _PTp>
+    struct __atomic_base<_PTp*>
+    {
+    private:
+      typedef _PTp* __pointer_type;
+
+      __pointer_type _M_p;
+
+
+      constexpr ptrdiff_t
+      _M_type_size(ptrdiff_t __d) const { return __d * sizeof(_PTp); }
+
+      constexpr ptrdiff_t
+      _M_type_size(ptrdiff_t __d) const volatile { return __d * sizeof(_PTp); }
+
+    public:
+      __atomic_base() noexcept = default;
+      ~__atomic_base() noexcept = default;
+      __atomic_base(const __atomic_base&) = delete;
+      __atomic_base& operator=(const __atomic_base&) = delete;
+      __atomic_base& operator=(const __atomic_base&) volatile = delete;
+
+
+      constexpr __atomic_base(__pointer_type __p) noexcept : _M_p (__p) { }
+
+      operator __pointer_type() const noexcept
+      { return load(); }
+
+      operator __pointer_type() const volatile noexcept
+      { return load(); }
+
+      __pointer_type
+      operator=(__pointer_type __p) noexcept
+      {
+ store(__p);
+ return __p;
+      }
+
+      __pointer_type
+      operator=(__pointer_type __p) volatile noexcept
+      {
+ store(__p);
+ return __p;
+      }
+
+      __pointer_type
+      operator++(int) noexcept
+      { return fetch_add(1); }
+
+      __pointer_type
+      operator++(int) volatile noexcept
+      { return fetch_add(1); }
+
+      __pointer_type
+      operator--(int) noexcept
+      { return fetch_sub(1); }
+
+      __pointer_type
+      operator--(int) volatile noexcept
+      { return fetch_sub(1); }
+
+      __pointer_type
+      operator++() noexcept
+      { return __atomic_add_fetch(&_M_p, _M_type_size(1),
+      memory_order_seq_cst); }
+
+      __pointer_type
+      operator++() volatile noexcept
+      { return __atomic_add_fetch(&_M_p, _M_type_size(1),
+      memory_order_seq_cst); }
+
+      __pointer_type
+      operator--() noexcept
+      { return __atomic_sub_fetch(&_M_p, _M_type_size(1),
+      memory_order_seq_cst); }
+
+      __pointer_type
+      operator--() volatile noexcept
+      { return __atomic_sub_fetch(&_M_p, _M_type_size(1),
+      memory_order_seq_cst); }
+
+      __pointer_type
+      operator+=(ptrdiff_t __d) noexcept
+      { return __atomic_add_fetch(&_M_p, _M_type_size(__d),
+      memory_order_seq_cst); }
+
+      __pointer_type
+      operator+=(ptrdiff_t __d) volatile noexcept
+      { return __atomic_add_fetch(&_M_p, _M_type_size(__d),
+      memory_order_seq_cst); }
+
+      __pointer_type
+      operator-=(ptrdiff_t __d) noexcept
+      { return __atomic_sub_fetch(&_M_p, _M_type_size(__d),
+      memory_order_seq_cst); }
+
+      __pointer_type
+      operator-=(ptrdiff_t __d) volatile noexcept
+      { return __atomic_sub_fetch(&_M_p, _M_type_size(__d),
+      memory_order_seq_cst); }
+
+      bool
+      is_lock_free() const noexcept
+      {
+
+ return __atomic_is_lock_free(sizeof(_M_p),
+     reinterpret_cast<void *>(-__alignof(_M_p)));
+      }
+
+      bool
+      is_lock_free() const volatile noexcept
+      {
+
+ return __atomic_is_lock_free(sizeof(_M_p),
+     reinterpret_cast<void *>(-__alignof(_M_p)));
+      }
+
+      inline __attribute__((__always_inline__)) void
+      store(__pointer_type __p,
+     memory_order __m = memory_order_seq_cst) noexcept
+      {
+        memory_order __b = __m & __memory_order_mask;
+
+ ;
+ ;
+ ;
+
+ __atomic_store_n(&_M_p, __p, __m);
+      }
+
+      inline __attribute__((__always_inline__)) void
+      store(__pointer_type __p,
+     memory_order __m = memory_order_seq_cst) volatile noexcept
+      {
+ memory_order __b = __m & __memory_order_mask;
+ ;
+ ;
+ ;
+
+ __atomic_store_n(&_M_p, __p, __m);
+      }
+
+      inline __attribute__((__always_inline__)) __pointer_type
+      load(memory_order __m = memory_order_seq_cst) const noexcept
+      {
+ memory_order __b = __m & __memory_order_mask;
+ ;
+ ;
+
+ return __atomic_load_n(&_M_p, __m);
+      }
+
+      inline __attribute__((__always_inline__)) __pointer_type
+      load(memory_order __m = memory_order_seq_cst) const volatile noexcept
+      {
+ memory_order __b = __m & __memory_order_mask;
+ ;
+ ;
+
+ return __atomic_load_n(&_M_p, __m);
+      }
+
+      inline __attribute__((__always_inline__)) __pointer_type
+      exchange(__pointer_type __p,
+        memory_order __m = memory_order_seq_cst) noexcept
+      {
+ return __atomic_exchange_n(&_M_p, __p, __m);
+      }
+
+
+      inline __attribute__((__always_inline__)) __pointer_type
+      exchange(__pointer_type __p,
+        memory_order __m = memory_order_seq_cst) volatile noexcept
+      {
+ return __atomic_exchange_n(&_M_p, __p, __m);
+      }
+
+      inline __attribute__((__always_inline__)) bool
+      compare_exchange_strong(__pointer_type& __p1, __pointer_type __p2,
+         memory_order __m1,
+         memory_order __m2) noexcept
+      {
+ memory_order __b2 = __m2 & __memory_order_mask;
+ memory_order __b1 = __m1 & __memory_order_mask;
+ ;
+ ;
+ ;
+
+ return __atomic_compare_exchange_n(&_M_p, &__p1, __p2, 0, __m1, __m2);
+      }
+
+      inline __attribute__((__always_inline__)) bool
+      compare_exchange_strong(__pointer_type& __p1, __pointer_type __p2,
+         memory_order __m1,
+         memory_order __m2) volatile noexcept
+      {
+ memory_order __b2 = __m2 & __memory_order_mask;
+ memory_order __b1 = __m1 & __memory_order_mask;
+
+ ;
+ ;
+ ;
+
+ return __atomic_compare_exchange_n(&_M_p, &__p1, __p2, 0, __m1, __m2);
+      }
+
+      inline __attribute__((__always_inline__)) __pointer_type
+      fetch_add(ptrdiff_t __d,
+  memory_order __m = memory_order_seq_cst) noexcept
+      { return __atomic_fetch_add(&_M_p, _M_type_size(__d), __m); }
+
+      inline __attribute__((__always_inline__)) __pointer_type
+      fetch_add(ptrdiff_t __d,
+  memory_order __m = memory_order_seq_cst) volatile noexcept
+      { return __atomic_fetch_add(&_M_p, _M_type_size(__d), __m); }
+
+      inline __attribute__((__always_inline__)) __pointer_type
+      fetch_sub(ptrdiff_t __d,
+  memory_order __m = memory_order_seq_cst) noexcept
+      { return __atomic_fetch_sub(&_M_p, _M_type_size(__d), __m); }
+
+      inline __attribute__((__always_inline__)) __pointer_type
+      fetch_sub(ptrdiff_t __d,
+  memory_order __m = memory_order_seq_cst) volatile noexcept
+      { return __atomic_fetch_sub(&_M_p, _M_type_size(__d), __m); }
+    };
+
+
+
+
+}
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+
+
+
+
+  struct _Sp_locker
+  {
+    _Sp_locker(const _Sp_locker&) = delete;
+    _Sp_locker& operator=(const _Sp_locker&) = delete;
+
+
+    explicit
+    _Sp_locker(const void*) noexcept;
+    _Sp_locker(const void*, const void*) noexcept;
+    ~_Sp_locker();
+
+  private:
+    unsigned char _M_key1;
+    unsigned char _M_key2;
+
+
+
+  };
+
+
+
+
+
+
+
+  template<typename _Tp, _Lock_policy _Lp>
+    inline bool
+    atomic_is_lock_free(const __shared_ptr<_Tp, _Lp>* __p)
+    {
+
+      return __gthread_active_p() == 0;
+
+
+
+    }
+
+  template<typename _Tp>
+    inline bool
+    atomic_is_lock_free(const shared_ptr<_Tp>* __p)
+    { return std::atomic_is_lock_free<_Tp, __default_lock_policy>(__p); }
+  template<typename _Tp>
+    inline shared_ptr<_Tp>
+    atomic_load_explicit(const shared_ptr<_Tp>* __p, memory_order)
+    {
+      _Sp_locker __lock{__p};
+      return *__p;
+    }
+
+  template<typename _Tp>
+    inline shared_ptr<_Tp>
+    atomic_load(const shared_ptr<_Tp>* __p)
+    { return std::atomic_load_explicit(__p, memory_order_seq_cst); }
+
+  template<typename _Tp, _Lock_policy _Lp>
+    inline __shared_ptr<_Tp, _Lp>
+    atomic_load_explicit(const __shared_ptr<_Tp, _Lp>* __p, memory_order)
+    {
+      _Sp_locker __lock{__p};
+      return *__p;
+    }
+
+  template<typename _Tp, _Lock_policy _Lp>
+    inline __shared_ptr<_Tp, _Lp>
+    atomic_load(const __shared_ptr<_Tp, _Lp>* __p)
+    { return std::atomic_load_explicit(__p, memory_order_seq_cst); }
+  template<typename _Tp>
+    inline void
+    atomic_store_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r,
+     memory_order)
+    {
+      _Sp_locker __lock{__p};
+      __p->swap(__r);
+    }
+
+  template<typename _Tp>
+    inline void
+    atomic_store(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r)
+    { std::atomic_store_explicit(__p, std::move(__r), memory_order_seq_cst); }
+
+  template<typename _Tp, _Lock_policy _Lp>
+    inline void
+    atomic_store_explicit(__shared_ptr<_Tp, _Lp>* __p,
+     __shared_ptr<_Tp, _Lp> __r,
+     memory_order)
+    {
+      _Sp_locker __lock{__p};
+      __p->swap(__r);
+    }
+
+  template<typename _Tp, _Lock_policy _Lp>
+    inline void
+    atomic_store(__shared_ptr<_Tp, _Lp>* __p, __shared_ptr<_Tp, _Lp> __r)
+    { std::atomic_store_explicit(__p, std::move(__r), memory_order_seq_cst); }
+  template<typename _Tp>
+    inline shared_ptr<_Tp>
+    atomic_exchange_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r,
+        memory_order)
+    {
+      _Sp_locker __lock{__p};
+      __p->swap(__r);
+      return __r;
+    }
+
+  template<typename _Tp>
+    inline shared_ptr<_Tp>
+    atomic_exchange(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r)
+    {
+      return std::atomic_exchange_explicit(__p, std::move(__r),
+        memory_order_seq_cst);
+    }
+
+  template<typename _Tp, _Lock_policy _Lp>
+    inline __shared_ptr<_Tp, _Lp>
+    atomic_exchange_explicit(__shared_ptr<_Tp, _Lp>* __p,
+        __shared_ptr<_Tp, _Lp> __r,
+        memory_order)
+    {
+      _Sp_locker __lock{__p};
+      __p->swap(__r);
+      return __r;
+    }
+
+  template<typename _Tp, _Lock_policy _Lp>
+    inline __shared_ptr<_Tp, _Lp>
+    atomic_exchange(__shared_ptr<_Tp, _Lp>* __p, __shared_ptr<_Tp, _Lp> __r)
+    {
+      return std::atomic_exchange_explicit(__p, std::move(__r),
+        memory_order_seq_cst);
+    }
+  template<typename _Tp>
+    bool
+    atomic_compare_exchange_strong_explicit(shared_ptr<_Tp>* __p,
+         shared_ptr<_Tp>* __v,
+         shared_ptr<_Tp> __w,
+         memory_order,
+         memory_order)
+    {
+      shared_ptr<_Tp> __x;
+      _Sp_locker __lock{__p, __v};
+      owner_less<shared_ptr<_Tp>> __less;
+      if (*__p == *__v && !__less(*__p, *__v) && !__less(*__v, *__p))
+ {
+   __x = std::move(*__p);
+   *__p = std::move(__w);
+   return true;
+ }
+      __x = std::move(*__v);
+      *__v = *__p;
+      return false;
+    }
+
+  template<typename _Tp>
+    inline bool
+    atomic_compare_exchange_strong(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v,
+     shared_ptr<_Tp> __w)
+    {
+      return std::atomic_compare_exchange_strong_explicit(__p, __v,
+   std::move(__w), memory_order_seq_cst, memory_order_seq_cst);
+    }
+
+  template<typename _Tp>
+    inline bool
+    atomic_compare_exchange_weak_explicit(shared_ptr<_Tp>* __p,
+       shared_ptr<_Tp>* __v,
+       shared_ptr<_Tp> __w,
+       memory_order __success,
+       memory_order __failure)
+    {
+      return std::atomic_compare_exchange_strong_explicit(__p, __v,
+   std::move(__w), __success, __failure);
+    }
+
+  template<typename _Tp>
+    inline bool
+    atomic_compare_exchange_weak(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v,
+     shared_ptr<_Tp> __w)
+    {
+      return std::atomic_compare_exchange_weak_explicit(__p, __v,
+   std::move(__w), memory_order_seq_cst, memory_order_seq_cst);
+    }
+
+  template<typename _Tp, _Lock_policy _Lp>
+    bool
+    atomic_compare_exchange_strong_explicit(__shared_ptr<_Tp, _Lp>* __p,
+         __shared_ptr<_Tp, _Lp>* __v,
+         __shared_ptr<_Tp, _Lp> __w,
+         memory_order,
+         memory_order)
+    {
+      __shared_ptr<_Tp, _Lp> __x;
+      _Sp_locker __lock{__p, __v};
+      owner_less<__shared_ptr<_Tp, _Lp>> __less;
+      if (*__p == *__v && !__less(*__p, *__v) && !__less(*__v, *__p))
+ {
+   __x = std::move(*__p);
+   *__p = std::move(__w);
+   return true;
+ }
+      __x = std::move(*__v);
+      *__v = *__p;
+      return false;
+    }
+
+  template<typename _Tp, _Lock_policy _Lp>
+    inline bool
+    atomic_compare_exchange_strong(__shared_ptr<_Tp, _Lp>* __p,
+       __shared_ptr<_Tp, _Lp>* __v,
+       __shared_ptr<_Tp, _Lp> __w)
+    {
+      return std::atomic_compare_exchange_strong_explicit(__p, __v,
+   std::move(__w), memory_order_seq_cst, memory_order_seq_cst);
+    }
+
+  template<typename _Tp, _Lock_policy _Lp>
+    inline bool
+    atomic_compare_exchange_weak_explicit(__shared_ptr<_Tp, _Lp>* __p,
+       __shared_ptr<_Tp, _Lp>* __v,
+       __shared_ptr<_Tp, _Lp> __w,
+       memory_order __success,
+       memory_order __failure)
+    {
+      return std::atomic_compare_exchange_strong_explicit(__p, __v,
+   std::move(__w), __success, __failure);
+    }
+
+  template<typename _Tp, _Lock_policy _Lp>
+    inline bool
+    atomic_compare_exchange_weak(__shared_ptr<_Tp, _Lp>* __p,
+     __shared_ptr<_Tp, _Lp>* __v,
+     __shared_ptr<_Tp, _Lp> __w)
+    {
+      return std::atomic_compare_exchange_weak_explicit(__p, __v,
+   std::move(__w), memory_order_seq_cst, memory_order_seq_cst);
+    }
+
+
+
+
+
+}
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+  template<typename _Tp1>
+    struct auto_ptr_ref
+    {
+      _Tp1* _M_ptr;
+
+      explicit
+      auto_ptr_ref(_Tp1* __p): _M_ptr(__p) { }
+    } __attribute__ ((__deprecated__));
+
+  template<typename _Tp>
+    class auto_ptr
+    {
+    private:
+      _Tp* _M_ptr;
+
+    public:
+
+      typedef _Tp element_type;
+
+
+
+
+
+
+
+      explicit
+      auto_ptr(element_type* __p = 0) throw() : _M_ptr(__p) { }
+      auto_ptr(auto_ptr& __a) throw() : _M_ptr(__a.release()) { }
+      template<typename _Tp1>
+        auto_ptr(auto_ptr<_Tp1>& __a) throw() : _M_ptr(__a.release()) { }
+      auto_ptr&
+      operator=(auto_ptr& __a) throw()
+      {
+ reset(__a.release());
+ return *this;
+      }
+      template<typename _Tp1>
+        auto_ptr&
+        operator=(auto_ptr<_Tp1>& __a) throw()
+        {
+   reset(__a.release());
+   return *this;
+ }
+      ~auto_ptr() { delete _M_ptr; }
+      element_type&
+      operator*() const throw()
+      {
+ ;
+ return *_M_ptr;
+      }
+
+
+
+
+
+
+
+      element_type*
+      operator->() const throw()
+      {
+ ;
+ return _M_ptr;
+      }
+      element_type*
+      get() const throw() { return _M_ptr; }
+      element_type*
+      release() throw()
+      {
+ element_type* __tmp = _M_ptr;
+ _M_ptr = 0;
+ return __tmp;
+      }
+      void
+      reset(element_type* __p = 0) throw()
+      {
+ if (__p != _M_ptr)
+   {
+     delete _M_ptr;
+     _M_ptr = __p;
+   }
+      }
+      auto_ptr(auto_ptr_ref<element_type> __ref) throw()
+      : _M_ptr(__ref._M_ptr) { }
+
+      auto_ptr&
+      operator=(auto_ptr_ref<element_type> __ref) throw()
+      {
+ if (__ref._M_ptr != this->get())
+   {
+     delete _M_ptr;
+     _M_ptr = __ref._M_ptr;
+   }
+ return *this;
+      }
+
+      template<typename _Tp1>
+        operator auto_ptr_ref<_Tp1>() throw()
+        { return auto_ptr_ref<_Tp1>(this->release()); }
+
+      template<typename _Tp1>
+        operator auto_ptr<_Tp1>() throw()
+        { return auto_ptr<_Tp1>(this->release()); }
+    } __attribute__ ((__deprecated__));
+
+
+
+  template<>
+    class auto_ptr<void>
+    {
+    public:
+      typedef void element_type;
+    } __attribute__ ((__deprecated__));
+
+
+  template<_Lock_policy _Lp>
+  template<typename _Tp>
+    inline
+    __shared_count<_Lp>::__shared_count(std::auto_ptr<_Tp>&& __r)
+    : _M_pi(new _Sp_counted_ptr<_Tp*, _Lp>(__r.get()))
+    { __r.release(); }
+
+  template<typename _Tp, _Lock_policy _Lp>
+  template<typename _Tp1, typename>
+    inline
+    __shared_ptr<_Tp, _Lp>::__shared_ptr(std::auto_ptr<_Tp1>&& __r)
+    : _M_ptr(__r.get()), _M_refcount()
+    {
+     
+      static_assert( sizeof(_Tp1) > 0, "incomplete type" );
+      _Tp1* __tmp = __r.get();
+      _M_refcount = __shared_count<_Lp>(std::move(__r));
+      _M_enable_shared_from_this_with(__tmp);
+    }
+
+  template<typename _Tp>
+  template<typename _Tp1, typename>
+    inline
+    shared_ptr<_Tp>::shared_ptr(std::auto_ptr<_Tp1>&& __r)
+    : __shared_ptr<_Tp>(std::move(__r)) { }
+
+  template<typename _Tp, typename _Dp>
+  template<typename _Up, typename>
+    inline
+    unique_ptr<_Tp, _Dp>::unique_ptr(auto_ptr<_Up>&& __u) noexcept
+    : _M_t(__u.release(), deleter_type()) { }
+
+
+
+
+}
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+inline void*
+align(size_t __align, size_t __size, void*& __ptr, size_t& __space) noexcept
+{
+  const auto __intptr = reinterpret_cast<uintptr_t>(__ptr);
+  const auto __aligned = (__intptr - 1u + __align) & -__align;
+  const auto __diff = __aligned - __intptr;
+  if ((__size + __diff) > __space)
+    return nullptr;
+  else
+    {
+      __space -= __diff;
+      return __ptr = reinterpret_cast<void*>(__aligned);
+    }
+}
+
+
+
+enum class pointer_safety { relaxed, preferred, strict };
+
+inline void
+declare_reachable(void*) { }
+
+template <typename _Tp>
+  inline _Tp*
+  undeclare_reachable(_Tp* __p) { return __p; }
+
+inline void
+declare_no_pointers(char*, size_t) { }
+
+inline void
+undeclare_no_pointers(char*, size_t) { }
+
+inline pointer_safety
+get_pointer_safety() noexcept { return pointer_safety::relaxed; }
+
+
+}
+
+
+
+
+
+namespace llvm {
+
+
+class SmallVectorBase {
+protected:
+  void *BeginX, *EndX, *CapacityX;
+
+protected:
+  SmallVectorBase(void *FirstEl, size_t Size)
+    : BeginX(FirstEl), EndX(FirstEl), CapacityX((char*)FirstEl+Size) {}
+
+
+
+  void grow_pod(void *FirstEl, size_t MinSizeInBytes, size_t TSize);
+
+public:
+
+  size_t size_in_bytes() const {
+    return size_t((char*)EndX - (char*)BeginX);
+  }
+
+
+  size_t capacity_in_bytes() const {
+    return size_t((char*)CapacityX - (char*)BeginX);
+  }
+
+  bool empty() const { return BeginX == EndX; }
+};
+
+
+
+
+template <typename T, typename = void>
+class SmallVectorTemplateCommon : public SmallVectorBase {
+private:
+  template <typename, unsigned> friend struct SmallVectorStorage;
+
+
+
+
+  using U = AlignedCharArrayUnion<T>;
+  U FirstEl;
+
+
+protected:
+  SmallVectorTemplateCommon(size_t Size) : SmallVectorBase(&FirstEl, Size) {}
+
+  void grow_pod(size_t MinSizeInBytes, size_t TSize) {
+    SmallVectorBase::grow_pod(&FirstEl, MinSizeInBytes, TSize);
+  }
+
+
+
+  bool isSmall() const {
+    return BeginX == static_cast<const void*>(&FirstEl);
+  }
+
+
+  void resetToSmall() {
+    BeginX = EndX = CapacityX = &FirstEl;
+  }
+
+  void setEnd(T *P) { this->EndX = P; }
+
+public:
+  using size_type = size_t;
+  using difference_type = ptrdiff_t;
+  using value_type = T;
+  using iterator = T *;
+  using const_iterator = const T *;
+
+  using const_reverse_iterator = std::reverse_iterator<const_iterator>;
+  using reverse_iterator = std::reverse_iterator<iterator>;
+
+  using reference = T &;
+  using const_reference = const T &;
+  using pointer = T *;
+  using const_pointer = const T *;
+
+
+  __attribute__((always_inline))
+  iterator begin() { return (iterator)this->BeginX; }
+  __attribute__((always_inline))
+  const_iterator begin() const { return (const_iterator)this->BeginX; }
+  __attribute__((always_inline))
+  iterator end() { return (iterator)this->EndX; }
+  __attribute__((always_inline))
+  const_iterator end() const { return (const_iterator)this->EndX; }
+
+protected:
+  iterator capacity_ptr() { return (iterator)this->CapacityX; }
+  const_iterator capacity_ptr() const { return (const_iterator)this->CapacityX;}
+
+public:
+
+  reverse_iterator rbegin() { return reverse_iterator(end()); }
+  const_reverse_iterator rbegin() const{ return const_reverse_iterator(end()); }
+  reverse_iterator rend() { return reverse_iterator(begin()); }
+  const_reverse_iterator rend() const { return const_reverse_iterator(begin());}
+
+  __attribute__((always_inline))
+  size_type size() const { return end()-begin(); }
+  size_type max_size() const { return size_type(-1) / sizeof(T); }
+
+
+  size_t capacity() const { return capacity_ptr() - begin(); }
+
+
+  pointer data() { return pointer(begin()); }
+
+  const_pointer data() const { return const_pointer(begin()); }
+
+  __attribute__((always_inline))
+  reference operator[](size_type idx) {
+    
+   ((
+   idx < size()
+   ) ? static_cast<void> (0) : __assert_fail (
+   "idx < size()"
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/SmallVector.h", 149, __PRETTY_FUNCTION__))
+                       ;
+    return begin()[idx];
+  }
+  __attribute__((always_inline))
+  const_reference operator[](size_type idx) const {
+    
+   ((
+   idx < size()
+   ) ? static_cast<void> (0) : __assert_fail (
+   "idx < size()"
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/SmallVector.h", 154, __PRETTY_FUNCTION__))
+                       ;
+    return begin()[idx];
+  }
+
+  reference front() {
+    
+   ((
+   !empty()
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!empty()"
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/SmallVector.h", 159, __PRETTY_FUNCTION__))
+                   ;
+    return begin()[0];
+  }
+  const_reference front() const {
+    
+   ((
+   !empty()
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!empty()"
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/SmallVector.h", 163, __PRETTY_FUNCTION__))
+                   ;
+    return begin()[0];
+  }
+
+  reference back() {
+    
+   ((
+   !empty()
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!empty()"
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/SmallVector.h", 168, __PRETTY_FUNCTION__))
+                   ;
+    return end()[-1];
+  }
+  const_reference back() const {
+    
+   ((
+   !empty()
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!empty()"
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/SmallVector.h", 172, __PRETTY_FUNCTION__))
+                   ;
+    return end()[-1];
+  }
+};
+
+
+
+template <typename T, bool isPodLike>
+class SmallVectorTemplateBase : public SmallVectorTemplateCommon<T> {
+protected:
+  SmallVectorTemplateBase(size_t Size) : SmallVectorTemplateCommon<T>(Size) {}
+
+  static void destroy_range(T *S, T *E) {
+    while (S != E) {
+      --E;
+      E->~T();
+    }
+  }
+
+
+
+  template<typename It1, typename It2>
+  static void uninitialized_move(It1 I, It1 E, It2 Dest) {
+    std::uninitialized_copy(std::make_move_iterator(I),
+                            std::make_move_iterator(E), Dest);
+  }
+
+
+
+  template<typename It1, typename It2>
+  static void uninitialized_copy(It1 I, It1 E, It2 Dest) {
+    std::uninitialized_copy(I, E, Dest);
+  }
+
+
+
+
+  void grow(size_t MinSize = 0);
+
+public:
+  void push_back(const T &Elt) {
+    if (__builtin_expect((bool)(this->EndX >= this->CapacityX), false))
+      this->grow();
+    ::new ((void*) this->end()) T(Elt);
+    this->setEnd(this->end()+1);
+  }
+
+  void push_back(T &&Elt) {
+    if (__builtin_expect((bool)(this->EndX >= this->CapacityX), false))
+      this->grow();
+    ::new ((void*) this->end()) T(::std::move(Elt));
+    this->setEnd(this->end()+1);
+  }
+
+  void pop_back() {
+    this->setEnd(this->end()-1);
+    this->end()->~T();
+  }
+};
+
+
+template <typename T, bool isPodLike>
+void SmallVectorTemplateBase<T, isPodLike>::grow(size_t MinSize) {
+  size_t CurCapacity = this->capacity();
+  size_t CurSize = this->size();
+
+  size_t NewCapacity = size_t(NextPowerOf2(CurCapacity+2));
+  if (NewCapacity < MinSize)
+    NewCapacity = MinSize;
+  T *NewElts = static_cast<T*>(malloc(NewCapacity*sizeof(T)));
+  if (NewElts == nullptr)
+    report_bad_alloc_error("Allocation of SmallVector element failed.");
+
+
+  this->uninitialized_move(this->begin(), this->end(), NewElts);
+
+
+  destroy_range(this->begin(), this->end());
+
+
+  if (!this->isSmall())
+    free(this->begin());
+
+  this->setEnd(NewElts+CurSize);
+  this->BeginX = NewElts;
+  this->CapacityX = this->begin()+NewCapacity;
+}
+
+
+
+
+template <typename T>
+class SmallVectorTemplateBase<T, true> : public SmallVectorTemplateCommon<T> {
+protected:
+  SmallVectorTemplateBase(size_t Size) : SmallVectorTemplateCommon<T>(Size) {}
+
+
+  static void destroy_range(T *, T *) {}
+
+
+
+  template<typename It1, typename It2>
+  static void uninitialized_move(It1 I, It1 E, It2 Dest) {
+
+    uninitialized_copy(I, E, Dest);
+  }
+
+
+
+  template<typename It1, typename It2>
+  static void uninitialized_copy(It1 I, It1 E, It2 Dest) {
+
+    std::uninitialized_copy(I, E, Dest);
+  }
+
+
+
+  template <typename T1, typename T2>
+  static void uninitialized_copy(
+      T1 *I, T1 *E, T2 *Dest,
+      typename std::enable_if<std::is_same<typename std::remove_const<T1>::type,
+                                           T2>::value>::type * = nullptr) {
+
+
+
+
+    if (I != E)
+      memcpy(Dest, I, (E - I) * sizeof(T));
+  }
+
+
+
+  void grow(size_t MinSize = 0) {
+    this->grow_pod(MinSize*sizeof(T), sizeof(T));
+  }
+
+public:
+  void push_back(const T &Elt) {
+    if (__builtin_expect((bool)(this->EndX >= this->CapacityX), false))
+      this->grow();
+    memcpy(this->end(), &Elt, sizeof(T));
+    this->setEnd(this->end()+1);
+  }
+
+  void pop_back() {
+    this->setEnd(this->end()-1);
+  }
+};
+
+
+
+template <typename T>
+class SmallVectorImpl : public SmallVectorTemplateBase<T, isPodLike<T>::value> {
+  using SuperClass = SmallVectorTemplateBase<T, isPodLike<T>::value>;
+
+public:
+  using iterator = typename SuperClass::iterator;
+  using const_iterator = typename SuperClass::const_iterator;
+  using size_type = typename SuperClass::size_type;
+
+protected:
+
+  explicit SmallVectorImpl(unsigned N)
+    : SmallVectorTemplateBase<T, isPodLike<T>::value>(N*sizeof(T)) {
+  }
+
+public:
+  SmallVectorImpl(const SmallVectorImpl &) = delete;
+
+  ~SmallVectorImpl() {
+
+
+    if (!this->isSmall())
+      free(this->begin());
+  }
+
+  void clear() {
+    this->destroy_range(this->begin(), this->end());
+    this->EndX = this->BeginX;
+  }
+
+  void resize(size_type N) {
+    if (N < this->size()) {
+      this->destroy_range(this->begin()+N, this->end());
+      this->setEnd(this->begin()+N);
+    } else if (N > this->size()) {
+      if (this->capacity() < N)
+        this->grow(N);
+      for (auto I = this->end(), E = this->begin() + N; I != E; ++I)
+        new (&*I) T();
+      this->setEnd(this->begin()+N);
+    }
+  }
+
+  void resize(size_type N, const T &NV) {
+    if (N < this->size()) {
+      this->destroy_range(this->begin()+N, this->end());
+      this->setEnd(this->begin()+N);
+    } else if (N > this->size()) {
+      if (this->capacity() < N)
+        this->grow(N);
+      std::uninitialized_fill(this->end(), this->begin()+N, NV);
+      this->setEnd(this->begin()+N);
+    }
+  }
+
+  void reserve(size_type N) {
+    if (this->capacity() < N)
+      this->grow(N);
+  }
+
+  T pop_back_val() {
+    T Result = ::std::move(this->back());
+    this->pop_back();
+    return Result;
+  }
+
+  void swap(SmallVectorImpl &RHS);
+
+
+  template <typename in_iter,
+            typename = typename std::enable_if<std::is_convertible<
+                typename std::iterator_traits<in_iter>::iterator_category,
+                std::input_iterator_tag>::value>::type>
+  void append(in_iter in_start, in_iter in_end) {
+    size_type NumInputs = std::distance(in_start, in_end);
+
+    if (NumInputs > size_type(this->capacity_ptr()-this->end()))
+      this->grow(this->size()+NumInputs);
+
+
+    this->uninitialized_copy(in_start, in_end, this->end());
+    this->setEnd(this->end() + NumInputs);
+  }
+
+
+  void append(size_type NumInputs, const T &Elt) {
+
+    if (NumInputs > size_type(this->capacity_ptr()-this->end()))
+      this->grow(this->size()+NumInputs);
+
+
+    std::uninitialized_fill_n(this->end(), NumInputs, Elt);
+    this->setEnd(this->end() + NumInputs);
+  }
+
+  void append(std::initializer_list<T> IL) {
+    append(IL.begin(), IL.end());
+  }
+
+
+
+
+  void assign(size_type NumElts, const T &Elt) {
+    clear();
+    if (this->capacity() < NumElts)
+      this->grow(NumElts);
+    this->setEnd(this->begin()+NumElts);
+    std::uninitialized_fill(this->begin(), this->end(), Elt);
+  }
+
+  template <typename in_iter,
+            typename = typename std::enable_if<std::is_convertible<
+                typename std::iterator_traits<in_iter>::iterator_category,
+                std::input_iterator_tag>::value>::type>
+  void assign(in_iter in_start, in_iter in_end) {
+    clear();
+    append(in_start, in_end);
+  }
+
+  void assign(std::initializer_list<T> IL) {
+    clear();
+    append(IL);
+  }
+
+  iterator erase(const_iterator CI) {
+
+    iterator I = const_cast<iterator>(CI);
+
+    
+   ((
+   I >= this->begin() && "Iterator to erase is out of bounds."
+   ) ? static_cast<void> (0) : __assert_fail (
+   "I >= this->begin() && \"Iterator to erase is out of bounds.\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/SmallVector.h", 451, __PRETTY_FUNCTION__))
+                                                                      ;
+    
+   ((
+   I < this->end() && "Erasing at past-the-end iterator."
+   ) ? static_cast<void> (0) : __assert_fail (
+   "I < this->end() && \"Erasing at past-the-end iterator.\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/SmallVector.h", 452, __PRETTY_FUNCTION__))
+                                                                 ;
+
+    iterator N = I;
+
+    std::move(I+1, this->end(), I);
+
+    this->pop_back();
+    return(N);
+  }
+
+  iterator erase(const_iterator CS, const_iterator CE) {
+
+    iterator S = const_cast<iterator>(CS);
+    iterator E = const_cast<iterator>(CE);
+
+    
+   ((
+   S >= this->begin() && "Range to erase is out of bounds."
+   ) ? static_cast<void> (0) : __assert_fail (
+   "S >= this->begin() && \"Range to erase is out of bounds.\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/SmallVector.h", 467, __PRETTY_FUNCTION__))
+                                                                   ;
+    
+   ((
+   S <= E && "Trying to erase invalid range."
+   ) ? static_cast<void> (0) : __assert_fail (
+   "S <= E && \"Trying to erase invalid range.\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/SmallVector.h", 468, __PRETTY_FUNCTION__))
+                                                     ;
+    
+   ((
+   E <= this->end() && "Trying to erase past the end."
+   ) ? static_cast<void> (0) : __assert_fail (
+   "E <= this->end() && \"Trying to erase past the end.\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/SmallVector.h", 469, __PRETTY_FUNCTION__))
+                                                              ;
+
+    iterator N = S;
+
+    iterator I = std::move(E, this->end(), S);
+
+    this->destroy_range(I, this->end());
+    this->setEnd(I);
+    return(N);
+  }
+
+  iterator insert(iterator I, T &&Elt) {
+    if (I == this->end()) {
+      this->push_back(::std::move(Elt));
+      return this->end()-1;
+    }
+
+    
+   ((
+   I >= this->begin() && "Insertion iterator is out of bounds."
+   ) ? static_cast<void> (0) : __assert_fail (
+   "I >= this->begin() && \"Insertion iterator is out of bounds.\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/SmallVector.h", 486, __PRETTY_FUNCTION__))
+                                                                       ;
+    
+   ((
+   I <= this->end() && "Inserting past the end of the vector."
+   ) ? static_cast<void> (0) : __assert_fail (
+   "I <= this->end() && \"Inserting past the end of the vector.\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/SmallVector.h", 487, __PRETTY_FUNCTION__))
+                                                                      ;
+
+    if (this->EndX >= this->CapacityX) {
+      size_t EltNo = I-this->begin();
+      this->grow();
+      I = this->begin()+EltNo;
+    }
+
+    ::new ((void*) this->end()) T(::std::move(this->back()));
+
+    std::move_backward(I, this->end()-1, this->end());
+    this->setEnd(this->end()+1);
+
+
+
+    T *EltPtr = &Elt;
+    if (I <= EltPtr && EltPtr < this->EndX)
+      ++EltPtr;
+
+    *I = ::std::move(*EltPtr);
+    return I;
+  }
+
+  iterator insert(iterator I, const T &Elt) {
+    if (I == this->end()) {
+      this->push_back(Elt);
+      return this->end()-1;
+    }
+
+    
+   ((
+   I >= this->begin() && "Insertion iterator is out of bounds."
+   ) ? static_cast<void> (0) : __assert_fail (
+   "I >= this->begin() && \"Insertion iterator is out of bounds.\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/SmallVector.h", 516, __PRETTY_FUNCTION__))
+                                                                       ;
+    
+   ((
+   I <= this->end() && "Inserting past the end of the vector."
+   ) ? static_cast<void> (0) : __assert_fail (
+   "I <= this->end() && \"Inserting past the end of the vector.\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/SmallVector.h", 517, __PRETTY_FUNCTION__))
+                                                                      ;
+
+    if (this->EndX >= this->CapacityX) {
+      size_t EltNo = I-this->begin();
+      this->grow();
+      I = this->begin()+EltNo;
+    }
+    ::new ((void*) this->end()) T(std::move(this->back()));
+
+    std::move_backward(I, this->end()-1, this->end());
+    this->setEnd(this->end()+1);
+
+
+
+    const T *EltPtr = &Elt;
+    if (I <= EltPtr && EltPtr < this->EndX)
+      ++EltPtr;
+
+    *I = *EltPtr;
+    return I;
+  }
+
+  iterator insert(iterator I, size_type NumToInsert, const T &Elt) {
+
+    size_t InsertElt = I - this->begin();
+
+    if (I == this->end()) {
+      append(NumToInsert, Elt);
+      return this->begin()+InsertElt;
+    }
+
+    
+   ((
+   I >= this->begin() && "Insertion iterator is out of bounds."
+   ) ? static_cast<void> (0) : __assert_fail (
+   "I >= this->begin() && \"Insertion iterator is out of bounds.\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/SmallVector.h", 548, __PRETTY_FUNCTION__))
+                                                                       ;
+    
+   ((
+   I <= this->end() && "Inserting past the end of the vector."
+   ) ? static_cast<void> (0) : __assert_fail (
+   "I <= this->end() && \"Inserting past the end of the vector.\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/SmallVector.h", 549, __PRETTY_FUNCTION__))
+                                                                      ;
+
+
+    reserve(this->size() + NumToInsert);
+
+
+    I = this->begin()+InsertElt;
+
+
+
+
+
+    if (size_t(this->end()-I) >= NumToInsert) {
+      T *OldEnd = this->end();
+      append(std::move_iterator<iterator>(this->end() - NumToInsert),
+             std::move_iterator<iterator>(this->end()));
+
+
+      std::move_backward(I, OldEnd-NumToInsert, OldEnd);
+
+      std::fill_n(I, NumToInsert, Elt);
+      return I;
+    }
+
+
+
+
+
+    T *OldEnd = this->end();
+    this->setEnd(this->end() + NumToInsert);
+    size_t NumOverwritten = OldEnd-I;
+    this->uninitialized_move(I, OldEnd, this->end()-NumOverwritten);
+
+
+    std::fill_n(I, NumOverwritten, Elt);
+
+
+    std::uninitialized_fill_n(OldEnd, NumToInsert-NumOverwritten, Elt);
+    return I;
+  }
+
+  template <typename ItTy,
+            typename = typename std::enable_if<std::is_convertible<
+                typename std::iterator_traits<ItTy>::iterator_category,
+                std::input_iterator_tag>::value>::type>
+  iterator insert(iterator I, ItTy From, ItTy To) {
+
+    size_t InsertElt = I - this->begin();
+
+    if (I == this->end()) {
+      append(From, To);
+      return this->begin()+InsertElt;
+    }
+
+    
+   ((
+   I >= this->begin() && "Insertion iterator is out of bounds."
+   ) ? static_cast<void> (0) : __assert_fail (
+   "I >= this->begin() && \"Insertion iterator is out of bounds.\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/SmallVector.h", 603, __PRETTY_FUNCTION__))
+                                                                       ;
+    
+   ((
+   I <= this->end() && "Inserting past the end of the vector."
+   ) ? static_cast<void> (0) : __assert_fail (
+   "I <= this->end() && \"Inserting past the end of the vector.\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/SmallVector.h", 604, __PRETTY_FUNCTION__))
+                                                                      ;
+
+    size_t NumToInsert = std::distance(From, To);
+
+
+    reserve(this->size() + NumToInsert);
+
+
+    I = this->begin()+InsertElt;
+
+
+
+
+
+    if (size_t(this->end()-I) >= NumToInsert) {
+      T *OldEnd = this->end();
+      append(std::move_iterator<iterator>(this->end() - NumToInsert),
+             std::move_iterator<iterator>(this->end()));
+
+
+      std::move_backward(I, OldEnd-NumToInsert, OldEnd);
+
+      std::copy(From, To, I);
+      return I;
+    }
+
+
+
+
+
+    T *OldEnd = this->end();
+    this->setEnd(this->end() + NumToInsert);
+    size_t NumOverwritten = OldEnd-I;
+    this->uninitialized_move(I, OldEnd, this->end()-NumOverwritten);
+
+
+    for (T *J = I; NumOverwritten > 0; --NumOverwritten) {
+      *J = *From;
+      ++J; ++From;
+    }
+
+
+    this->uninitialized_copy(From, To, OldEnd);
+    return I;
+  }
+
+  void insert(iterator I, std::initializer_list<T> IL) {
+    insert(I, IL.begin(), IL.end());
+  }
+
+  template <typename... ArgTypes> void emplace_back(ArgTypes &&... Args) {
+    if (__builtin_expect((bool)(this->EndX >= this->CapacityX), false))
+      this->grow();
+    ::new ((void *)this->end()) T(std::forward<ArgTypes>(Args)...);
+    this->setEnd(this->end() + 1);
+  }
+
+  SmallVectorImpl &operator=(const SmallVectorImpl &RHS);
+
+  SmallVectorImpl &operator=(SmallVectorImpl &&RHS);
+
+  bool operator==(const SmallVectorImpl &RHS) const {
+    if (this->size() != RHS.size()) return false;
+    return std::equal(this->begin(), this->end(), RHS.begin());
+  }
+  bool operator!=(const SmallVectorImpl &RHS) const {
+    return !(*this == RHS);
+  }
+
+  bool operator<(const SmallVectorImpl &RHS) const {
+    return std::lexicographical_compare(this->begin(), this->end(),
+                                        RHS.begin(), RHS.end());
+  }
+  void set_size(size_type N) {
+    
+   ((
+   N <= this->capacity()
+   ) ? static_cast<void> (0) : __assert_fail (
+   "N <= this->capacity()"
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/SmallVector.h", 688, __PRETTY_FUNCTION__))
+                                ;
+    this->setEnd(this->begin() + N);
+  }
+};
+
+template <typename T>
+void SmallVectorImpl<T>::swap(SmallVectorImpl<T> &RHS) {
+  if (this == &RHS) return;
+
+
+  if (!this->isSmall() && !RHS.isSmall()) {
+    std::swap(this->BeginX, RHS.BeginX);
+    std::swap(this->EndX, RHS.EndX);
+    std::swap(this->CapacityX, RHS.CapacityX);
+    return;
+  }
+  if (RHS.size() > this->capacity())
+    this->grow(RHS.size());
+  if (this->size() > RHS.capacity())
+    RHS.grow(this->size());
+
+
+  size_t NumShared = this->size();
+  if (NumShared > RHS.size()) NumShared = RHS.size();
+  for (size_type i = 0; i != NumShared; ++i)
+    std::swap((*this)[i], RHS[i]);
+
+
+  if (this->size() > RHS.size()) {
+    size_t EltDiff = this->size() - RHS.size();
+    this->uninitialized_copy(this->begin()+NumShared, this->end(), RHS.end());
+    RHS.setEnd(RHS.end()+EltDiff);
+    this->destroy_range(this->begin()+NumShared, this->end());
+    this->setEnd(this->begin()+NumShared);
+  } else if (RHS.size() > this->size()) {
+    size_t EltDiff = RHS.size() - this->size();
+    this->uninitialized_copy(RHS.begin()+NumShared, RHS.end(), this->end());
+    this->setEnd(this->end() + EltDiff);
+    this->destroy_range(RHS.begin()+NumShared, RHS.end());
+    RHS.setEnd(RHS.begin()+NumShared);
+  }
+}
+
+template <typename T>
+SmallVectorImpl<T> &SmallVectorImpl<T>::
+  operator=(const SmallVectorImpl<T> &RHS) {
+
+  if (this == &RHS) return *this;
+
+
+
+  size_t RHSSize = RHS.size();
+  size_t CurSize = this->size();
+  if (CurSize >= RHSSize) {
+
+    iterator NewEnd;
+    if (RHSSize)
+      NewEnd = std::copy(RHS.begin(), RHS.begin()+RHSSize, this->begin());
+    else
+      NewEnd = this->begin();
+
+
+    this->destroy_range(NewEnd, this->end());
+
+
+    this->setEnd(NewEnd);
+    return *this;
+  }
+
+
+
+
+  if (this->capacity() < RHSSize) {
+
+    this->destroy_range(this->begin(), this->end());
+    this->setEnd(this->begin());
+    CurSize = 0;
+    this->grow(RHSSize);
+  } else if (CurSize) {
+
+    std::copy(RHS.begin(), RHS.begin()+CurSize, this->begin());
+  }
+
+
+  this->uninitialized_copy(RHS.begin()+CurSize, RHS.end(),
+                           this->begin()+CurSize);
+
+
+  this->setEnd(this->begin()+RHSSize);
+  return *this;
+}
+
+template <typename T>
+SmallVectorImpl<T> &SmallVectorImpl<T>::operator=(SmallVectorImpl<T> &&RHS) {
+
+  if (this == &RHS) return *this;
+
+
+  if (!RHS.isSmall()) {
+    this->destroy_range(this->begin(), this->end());
+    if (!this->isSmall()) free(this->begin());
+    this->BeginX = RHS.BeginX;
+    this->EndX = RHS.EndX;
+    this->CapacityX = RHS.CapacityX;
+    RHS.resetToSmall();
+    return *this;
+  }
+
+
+
+  size_t RHSSize = RHS.size();
+  size_t CurSize = this->size();
+  if (CurSize >= RHSSize) {
+
+    iterator NewEnd = this->begin();
+    if (RHSSize)
+      NewEnd = std::move(RHS.begin(), RHS.end(), NewEnd);
+
+
+    this->destroy_range(NewEnd, this->end());
+    this->setEnd(NewEnd);
+
+
+    RHS.clear();
+
+    return *this;
+  }
+
+
+
+
+
+  if (this->capacity() < RHSSize) {
+
+    this->destroy_range(this->begin(), this->end());
+    this->setEnd(this->begin());
+    CurSize = 0;
+    this->grow(RHSSize);
+  } else if (CurSize) {
+
+    std::move(RHS.begin(), RHS.begin()+CurSize, this->begin());
+  }
+
+
+  this->uninitialized_move(RHS.begin()+CurSize, RHS.end(),
+                           this->begin()+CurSize);
+
+
+  this->setEnd(this->begin()+RHSSize);
+
+  RHS.clear();
+  return *this;
+}
+
+
+
+
+
+template <typename T, unsigned N>
+struct SmallVectorStorage {
+  typename SmallVectorTemplateCommon<T>::U InlineElts[N - 1];
+};
+template <typename T> struct SmallVectorStorage<T, 1> {};
+template <typename T> struct SmallVectorStorage<T, 0> {};
+template <typename T, unsigned N>
+class SmallVector : public SmallVectorImpl<T> {
+
+  SmallVectorStorage<T, N> Storage;
+
+public:
+  SmallVector() : SmallVectorImpl<T>(N) {}
+
+  ~SmallVector() {
+
+    this->destroy_range(this->begin(), this->end());
+  }
+
+  explicit SmallVector(size_t Size, const T &Value = T())
+    : SmallVectorImpl<T>(N) {
+    this->assign(Size, Value);
+  }
+
+  template <typename ItTy,
+            typename = typename std::enable_if<std::is_convertible<
+                typename std::iterator_traits<ItTy>::iterator_category,
+                std::input_iterator_tag>::value>::type>
+  SmallVector(ItTy S, ItTy E) : SmallVectorImpl<T>(N) {
+    this->append(S, E);
+  }
+
+  template <typename RangeTy>
+  explicit SmallVector(const iterator_range<RangeTy> &R)
+      : SmallVectorImpl<T>(N) {
+    this->append(R.begin(), R.end());
+  }
+
+  SmallVector(std::initializer_list<T> IL) : SmallVectorImpl<T>(N) {
+    this->assign(IL);
+  }
+
+  SmallVector(const SmallVector &RHS) : SmallVectorImpl<T>(N) {
+    if (!RHS.empty())
+      SmallVectorImpl<T>::operator=(RHS);
+  }
+
+  const SmallVector &operator=(const SmallVector &RHS) {
+    SmallVectorImpl<T>::operator=(RHS);
+    return *this;
+  }
+
+  SmallVector(SmallVector &&RHS) : SmallVectorImpl<T>(N) {
+    if (!RHS.empty())
+      SmallVectorImpl<T>::operator=(::std::move(RHS));
+  }
+
+  SmallVector(SmallVectorImpl<T> &&RHS) : SmallVectorImpl<T>(N) {
+    if (!RHS.empty())
+      SmallVectorImpl<T>::operator=(::std::move(RHS));
+  }
+
+  const SmallVector &operator=(SmallVector &&RHS) {
+    SmallVectorImpl<T>::operator=(::std::move(RHS));
+    return *this;
+  }
+
+  const SmallVector &operator=(SmallVectorImpl<T> &&RHS) {
+    SmallVectorImpl<T>::operator=(::std::move(RHS));
+    return *this;
+  }
+
+  const SmallVector &operator=(std::initializer_list<T> IL) {
+    this->assign(IL);
+    return *this;
+  }
+};
+
+template <typename T, unsigned N>
+inline size_t capacity_in_bytes(const SmallVector<T, N> &X) {
+  return X.capacity_in_bytes();
+}
+
+}
+
+namespace std {
+
+
+  template<typename T>
+  inline void
+  swap(llvm::SmallVectorImpl<T> &LHS, llvm::SmallVectorImpl<T> &RHS) {
+    LHS.swap(RHS);
+  }
+
+
+  template<typename T, unsigned N>
+  inline void
+  swap(llvm::SmallVector<T, N> &LHS, llvm::SmallVector<T, N> &RHS) {
+    LHS.swap(RHS);
+  }
+
+}
+namespace llvm {
+template <typename DerivedT, typename IteratorCategoryT, typename T,
+          typename DifferenceTypeT = std::ptrdiff_t, typename PointerT = T *,
+          typename ReferenceT = T &>
+class iterator_facade_base
+    : public std::iterator<IteratorCategoryT, T, DifferenceTypeT, PointerT,
+                           ReferenceT> {
+protected:
+  enum {
+    IsRandomAccess = std::is_base_of<std::random_access_iterator_tag,
+                                     IteratorCategoryT>::value,
+    IsBidirectional = std::is_base_of<std::bidirectional_iterator_tag,
+                                      IteratorCategoryT>::value,
+  };
+
+
+
+
+
+
+  class ReferenceProxy {
+    friend iterator_facade_base;
+
+    DerivedT I;
+
+    ReferenceProxy(DerivedT I) : I(std::move(I)) {}
+
+  public:
+    operator ReferenceT() const { return *I; }
+  };
+
+public:
+  DerivedT operator+(DifferenceTypeT n) const {
+    static_assert(std::is_base_of<iterator_facade_base, DerivedT>::value,
+                  "Must pass the derived type to this template!");
+    static_assert(
+        IsRandomAccess,
+        "The '+' operator is only defined for random access iterators.");
+    DerivedT tmp = *static_cast<const DerivedT *>(this);
+    tmp += n;
+    return tmp;
+  }
+  friend DerivedT operator+(DifferenceTypeT n, const DerivedT &i) {
+    static_assert(
+        IsRandomAccess,
+        "The '+' operator is only defined for random access iterators.");
+    return i + n;
+  }
+  DerivedT operator-(DifferenceTypeT n) const {
+    static_assert(
+        IsRandomAccess,
+        "The '-' operator is only defined for random access iterators.");
+    DerivedT tmp = *static_cast<const DerivedT *>(this);
+    tmp -= n;
+    return tmp;
+  }
+
+  DerivedT &operator++() {
+    static_assert(std::is_base_of<iterator_facade_base, DerivedT>::value,
+                  "Must pass the derived type to this template!");
+    return static_cast<DerivedT *>(this)->operator+=(1);
+  }
+  DerivedT operator++(int) {
+    DerivedT tmp = *static_cast<DerivedT *>(this);
+    ++*static_cast<DerivedT *>(this);
+    return tmp;
+  }
+  DerivedT &operator--() {
+    static_assert(
+        IsBidirectional,
+        "The decrement operator is only defined for bidirectional iterators.");
+    return static_cast<DerivedT *>(this)->operator-=(1);
+  }
+  DerivedT operator--(int) {
+    static_assert(
+        IsBidirectional,
+        "The decrement operator is only defined for bidirectional iterators.");
+    DerivedT tmp = *static_cast<DerivedT *>(this);
+    --*static_cast<DerivedT *>(this);
+    return tmp;
+  }
+
+  bool operator!=(const DerivedT &RHS) const {
+    return !static_cast<const DerivedT *>(this)->operator==(RHS);
+  }
+
+  bool operator>(const DerivedT &RHS) const {
+    static_assert(
+        IsRandomAccess,
+        "Relational operators are only defined for random access iterators.");
+    return !static_cast<const DerivedT *>(this)->operator<(RHS) &&
+           !static_cast<const DerivedT *>(this)->operator==(RHS);
+  }
+  bool operator<=(const DerivedT &RHS) const {
+    static_assert(
+        IsRandomAccess,
+        "Relational operators are only defined for random access iterators.");
+    return !static_cast<const DerivedT *>(this)->operator>(RHS);
+  }
+  bool operator>=(const DerivedT &RHS) const {
+    static_assert(
+        IsRandomAccess,
+        "Relational operators are only defined for random access iterators.");
+    return !static_cast<const DerivedT *>(this)->operator<(RHS);
+  }
+
+  PointerT operator->() { return &static_cast<DerivedT *>(this)->operator*(); }
+  PointerT operator->() const {
+    return &static_cast<const DerivedT *>(this)->operator*();
+  }
+  ReferenceProxy operator[](DifferenceTypeT n) {
+    static_assert(IsRandomAccess,
+                  "Subscripting is only defined for random access iterators.");
+    return ReferenceProxy(static_cast<DerivedT *>(this)->operator+(n));
+  }
+  ReferenceProxy operator[](DifferenceTypeT n) const {
+    static_assert(IsRandomAccess,
+                  "Subscripting is only defined for random access iterators.");
+    return ReferenceProxy(static_cast<const DerivedT *>(this)->operator+(n));
+  }
+};
+
+
+
+
+
+
+template <
+    typename DerivedT, typename WrappedIteratorT,
+    typename IteratorCategoryT =
+        typename std::iterator_traits<WrappedIteratorT>::iterator_category,
+    typename T = typename std::iterator_traits<WrappedIteratorT>::value_type,
+    typename DifferenceTypeT =
+        typename std::iterator_traits<WrappedIteratorT>::difference_type,
+    typename PointerT = typename std::conditional<
+        std::is_same<T, typename std::iterator_traits<
+                            WrappedIteratorT>::value_type>::value,
+        typename std::iterator_traits<WrappedIteratorT>::pointer, T *>::type,
+    typename ReferenceT = typename std::conditional<
+        std::is_same<T, typename std::iterator_traits<
+                            WrappedIteratorT>::value_type>::value,
+        typename std::iterator_traits<WrappedIteratorT>::reference, T &>::type,
+
+    typename WrappedTraitsT = std::iterator_traits<WrappedIteratorT>>
+class iterator_adaptor_base
+    : public iterator_facade_base<DerivedT, IteratorCategoryT, T,
+                                  DifferenceTypeT, PointerT, ReferenceT> {
+  using BaseT = typename iterator_adaptor_base::iterator_facade_base;
+
+protected:
+  WrappedIteratorT I;
+
+  iterator_adaptor_base() = default;
+
+  explicit iterator_adaptor_base(WrappedIteratorT u) : I(std::move(u)) {
+    static_assert(std::is_base_of<iterator_adaptor_base, DerivedT>::value,
+                  "Must pass the derived type to this template!");
+  }
+
+  const WrappedIteratorT &wrapped() const { return I; }
+
+public:
+  using difference_type = DifferenceTypeT;
+
+  DerivedT &operator+=(difference_type n) {
+    static_assert(
+        BaseT::IsRandomAccess,
+        "The '+=' operator is only defined for random access iterators.");
+    I += n;
+    return *static_cast<DerivedT *>(this);
+  }
+  DerivedT &operator-=(difference_type n) {
+    static_assert(
+        BaseT::IsRandomAccess,
+        "The '-=' operator is only defined for random access iterators.");
+    I -= n;
+    return *static_cast<DerivedT *>(this);
+  }
+  using BaseT::operator-;
+  difference_type operator-(const DerivedT &RHS) const {
+    static_assert(
+        BaseT::IsRandomAccess,
+        "The '-' operator is only defined for random access iterators.");
+    return I - RHS.I;
+  }
+
+
+
+  using BaseT::operator++;
+  DerivedT &operator++() {
+    ++I;
+    return *static_cast<DerivedT *>(this);
+  }
+  using BaseT::operator--;
+  DerivedT &operator--() {
+    static_assert(
+        BaseT::IsBidirectional,
+        "The decrement operator is only defined for bidirectional iterators.");
+    --I;
+    return *static_cast<DerivedT *>(this);
+  }
+
+  bool operator==(const DerivedT &RHS) const { return I == RHS.I; }
+  bool operator<(const DerivedT &RHS) const {
+    static_assert(
+        BaseT::IsRandomAccess,
+        "Relational operators are only defined for random access iterators.");
+    return I < RHS.I;
+  }
+
+  ReferenceT operator*() const { return *I; }
+};
+template <typename WrappedIteratorT,
+          typename T = typename std::remove_reference<
+              decltype(**std::declval<WrappedIteratorT>())>::type>
+struct pointee_iterator
+    : iterator_adaptor_base<
+          pointee_iterator<WrappedIteratorT>, WrappedIteratorT,
+          typename std::iterator_traits<WrappedIteratorT>::iterator_category,
+          T> {
+  pointee_iterator() = default;
+  template <typename U>
+  pointee_iterator(U &&u)
+      : pointee_iterator::iterator_adaptor_base(std::forward<U &&>(u)) {}
+
+  T &operator*() const { return **this->I; }
+};
+
+template <typename RangeT, typename WrappedIteratorT =
+                               decltype(std::begin(std::declval<RangeT>()))>
+iterator_range<pointee_iterator<WrappedIteratorT>>
+make_pointee_range(RangeT &&Range) {
+  using PointeeIteratorT = pointee_iterator<WrappedIteratorT>;
+  return make_range(PointeeIteratorT(std::begin(std::forward<RangeT>(Range))),
+                    PointeeIteratorT(std::end(std::forward<RangeT>(Range))));
+}
+
+template <typename WrappedIteratorT,
+          typename T = decltype(&*std::declval<WrappedIteratorT>())>
+class pointer_iterator
+    : public iterator_adaptor_base<pointer_iterator<WrappedIteratorT>,
+                                   WrappedIteratorT, T> {
+  mutable T Ptr;
+
+public:
+  pointer_iterator() = default;
+
+  explicit pointer_iterator(WrappedIteratorT u)
+      : pointer_iterator::iterator_adaptor_base(std::move(u)) {}
+
+  T &operator*() { return Ptr = &*this->I; }
+  const T &operator*() const { return Ptr = &*this->I; }
+};
+
+template <typename RangeT, typename WrappedIteratorT =
+                               decltype(std::begin(std::declval<RangeT>()))>
+iterator_range<pointer_iterator<WrappedIteratorT>>
+make_pointer_range(RangeT &&Range) {
+  using PointerIteratorT = pointer_iterator<WrappedIteratorT>;
+  return make_range(PointerIteratorT(std::begin(std::forward<RangeT>(Range))),
+                    PointerIteratorT(std::end(std::forward<RangeT>(Range))));
+}
+
+}
+
+
+
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+       
+       
+       
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+
+
+
+
+  class bad_function_call : public std::exception
+  {
+  public:
+    virtual ~bad_function_call() noexcept;
+
+    const char* what() const noexcept;
+  };
+
+
+
+
+
+
+
+  template<typename _Tp>
+    struct __is_location_invariant
+    : is_trivially_copyable<_Tp>::type
+    { };
+
+  class _Undefined_class;
+
+  union _Nocopy_types
+  {
+    void* _M_object;
+    const void* _M_const_object;
+    void (*_M_function_pointer)();
+    void (_Undefined_class::*_M_member_pointer)();
+  };
+
+  union [[gnu::may_alias]] _Any_data
+  {
+    void* _M_access() { return &_M_pod_data[0]; }
+    const void* _M_access() const { return &_M_pod_data[0]; }
+
+    template<typename _Tp>
+      _Tp&
+      _M_access()
+      { return *static_cast<_Tp*>(_M_access()); }
+
+    template<typename _Tp>
+      const _Tp&
+      _M_access() const
+      { return *static_cast<const _Tp*>(_M_access()); }
+
+    _Nocopy_types _M_unused;
+    char _M_pod_data[sizeof(_Nocopy_types)];
+  };
+
+  enum _Manager_operation
+  {
+    __get_type_info,
+    __get_functor_ptr,
+    __clone_functor,
+    __destroy_functor
+  };
+
+
+
+  template<typename _Tp>
+    struct _Simple_type_wrapper
+    {
+      _Simple_type_wrapper(_Tp __value) : __value(__value) { }
+
+      _Tp __value;
+    };
+
+  template<typename _Tp>
+    struct __is_location_invariant<_Simple_type_wrapper<_Tp> >
+    : __is_location_invariant<_Tp>
+    { };
+
+  template<typename _Signature>
+    class function;
+
+
+  class _Function_base
+  {
+  public:
+    static const std::size_t _M_max_size = sizeof(_Nocopy_types);
+    static const std::size_t _M_max_align = __alignof__(_Nocopy_types);
+
+    template<typename _Functor>
+      class _Base_manager
+      {
+      protected:
+ static const bool __stored_locally =
+ (__is_location_invariant<_Functor>::value
+  && sizeof(_Functor) <= _M_max_size
+  && __alignof__(_Functor) <= _M_max_align
+  && (_M_max_align % __alignof__(_Functor) == 0));
+
+ typedef integral_constant<bool, __stored_locally> _Local_storage;
+
+
+ static _Functor*
+ _M_get_pointer(const _Any_data& __source)
+ {
+   const _Functor* __ptr =
+     __stored_locally? std::__addressof(__source._M_access<_Functor>())
+                                 : __source._M_access<_Functor*>();
+   return const_cast<_Functor*>(__ptr);
+ }
+
+
+
+ static void
+ _M_clone(_Any_data& __dest, const _Any_data& __source, true_type)
+ {
+   ::new (__dest._M_access()) _Functor(__source._M_access<_Functor>());
+ }
+
+
+
+ static void
+ _M_clone(_Any_data& __dest, const _Any_data& __source, false_type)
+ {
+   __dest._M_access<_Functor*>() =
+     new _Functor(*__source._M_access<_Functor*>());
+ }
+
+
+
+ static void
+ _M_destroy(_Any_data& __victim, true_type)
+ {
+   __victim._M_access<_Functor>().~_Functor();
+ }
+
+
+ static void
+ _M_destroy(_Any_data& __victim, false_type)
+ {
+   delete __victim._M_access<_Functor*>();
+ }
+
+      public:
+ static bool
+ _M_manager(_Any_data& __dest, const _Any_data& __source,
+     _Manager_operation __op)
+ {
+   switch (__op)
+     {
+
+
+
+
+
+     case __get_functor_ptr:
+       __dest._M_access<_Functor*>() = _M_get_pointer(__source);
+       break;
+
+     case __clone_functor:
+       _M_clone(__dest, __source, _Local_storage());
+       break;
+
+     case __destroy_functor:
+       _M_destroy(__dest, _Local_storage());
+       break;
+     }
+   return false;
+ }
+
+ static void
+ _M_init_functor(_Any_data& __functor, _Functor&& __f)
+ { _M_init_functor(__functor, std::move(__f), _Local_storage()); }
+
+ template<typename _Signature>
+   static bool
+   _M_not_empty_function(const function<_Signature>& __f)
+   { return static_cast<bool>(__f); }
+
+ template<typename _Tp>
+   static bool
+   _M_not_empty_function(_Tp* __fp)
+   { return __fp != nullptr; }
+
+ template<typename _Class, typename _Tp>
+   static bool
+   _M_not_empty_function(_Tp _Class::* __mp)
+   { return __mp != nullptr; }
+
+ template<typename _Tp>
+   static bool
+   _M_not_empty_function(const _Tp&)
+   { return true; }
+
+      private:
+ static void
+ _M_init_functor(_Any_data& __functor, _Functor&& __f, true_type)
+ { ::new (__functor._M_access()) _Functor(std::move(__f)); }
+
+ static void
+ _M_init_functor(_Any_data& __functor, _Functor&& __f, false_type)
+ { __functor._M_access<_Functor*>() = new _Functor(std::move(__f)); }
+      };
+
+    _Function_base() : _M_manager(nullptr) { }
+
+    ~_Function_base()
+    {
+      if (_M_manager)
+ _M_manager(_M_functor, _M_functor, __destroy_functor);
+    }
+
+    bool _M_empty() const { return !_M_manager; }
+
+    typedef bool (*_Manager_type)(_Any_data&, const _Any_data&,
+      _Manager_operation);
+
+    _Any_data _M_functor;
+    _Manager_type _M_manager;
+  };
+
+  template<typename _Signature, typename _Functor>
+    class _Function_handler;
+
+  template<typename _Res, typename _Functor, typename... _ArgTypes>
+    class _Function_handler<_Res(_ArgTypes...), _Functor>
+    : public _Function_base::_Base_manager<_Functor>
+    {
+      typedef _Function_base::_Base_manager<_Functor> _Base;
+
+    public:
+      static _Res
+      _M_invoke(const _Any_data& __functor, _ArgTypes&&... __args)
+      {
+ return (*_Base::_M_get_pointer(__functor))(
+     std::forward<_ArgTypes>(__args)...);
+      }
+    };
+
+  template<typename _Functor, typename... _ArgTypes>
+    class _Function_handler<void(_ArgTypes...), _Functor>
+    : public _Function_base::_Base_manager<_Functor>
+    {
+      typedef _Function_base::_Base_manager<_Functor> _Base;
+
+     public:
+      static void
+      _M_invoke(const _Any_data& __functor, _ArgTypes&&... __args)
+      {
+ (*_Base::_M_get_pointer(__functor))(
+     std::forward<_ArgTypes>(__args)...);
+      }
+    };
+
+  template<typename _Class, typename _Member, typename _Res,
+    typename... _ArgTypes>
+    class _Function_handler<_Res(_ArgTypes...), _Member _Class::*>
+    : public _Function_handler<void(_ArgTypes...), _Member _Class::*>
+    {
+      typedef _Function_handler<void(_ArgTypes...), _Member _Class::*>
+ _Base;
+
+     public:
+      static _Res
+      _M_invoke(const _Any_data& __functor, _ArgTypes&&... __args)
+      {
+ return std::__invoke(_Base::_M_get_pointer(__functor)->__value,
+        std::forward<_ArgTypes>(__args)...);
+      }
+    };
+
+  template<typename _Class, typename _Member, typename... _ArgTypes>
+    class _Function_handler<void(_ArgTypes...), _Member _Class::*>
+    : public _Function_base::_Base_manager<
+   _Simple_type_wrapper< _Member _Class::* > >
+    {
+      typedef _Member _Class::* _Functor;
+      typedef _Simple_type_wrapper<_Functor> _Wrapper;
+      typedef _Function_base::_Base_manager<_Wrapper> _Base;
+
+    public:
+      static bool
+      _M_manager(_Any_data& __dest, const _Any_data& __source,
+   _Manager_operation __op)
+      {
+ switch (__op)
+   {
+
+
+
+
+
+   case __get_functor_ptr:
+     __dest._M_access<_Functor*>() =
+       &_Base::_M_get_pointer(__source)->__value;
+     break;
+
+   default:
+     _Base::_M_manager(__dest, __source, __op);
+   }
+ return false;
+      }
+
+      static void
+      _M_invoke(const _Any_data& __functor, _ArgTypes&&... __args)
+      {
+ std::__invoke(_Base::_M_get_pointer(__functor)->__value,
+        std::forward<_ArgTypes>(__args)...);
+      }
+    };
+
+  template<typename _From, typename _To>
+    using __check_func_return_type
+      = __or_<is_void<_To>, is_same<_From, _To>, is_convertible<_From, _To>>;
+
+
+
+
+
+
+
+  template<typename _Res, typename... _ArgTypes>
+    class function<_Res(_ArgTypes...)>
+    : public _Maybe_unary_or_binary_function<_Res, _ArgTypes...>,
+      private _Function_base
+    {
+      template<typename _Func,
+        typename _Res2 = typename result_of<_Func&(_ArgTypes...)>::type>
+ struct _Callable : __check_func_return_type<_Res2, _Res> { };
+
+
+
+      template<typename _Tp>
+ struct _Callable<function, _Tp> : false_type { };
+
+      template<typename _Cond, typename _Tp>
+ using _Requires = typename enable_if<_Cond::value, _Tp>::type;
+
+    public:
+      typedef _Res result_type;
+
+
+
+
+
+
+
+      function() noexcept
+      : _Function_base() { }
+
+
+
+
+
+      function(nullptr_t) noexcept
+      : _Function_base() { }
+      function(const function& __x);
+      function(function&& __x) noexcept : _Function_base()
+      {
+ __x.swap(*this);
+      }
+      template<typename _Functor,
+        typename = _Requires<__not_<is_same<_Functor, function>>, void>,
+        typename = _Requires<_Callable<_Functor>, void>>
+ function(_Functor);
+      function&
+      operator=(const function& __x)
+      {
+ function(__x).swap(*this);
+ return *this;
+      }
+      function&
+      operator=(function&& __x) noexcept
+      {
+ function(std::move(__x)).swap(*this);
+ return *this;
+      }
+      function&
+      operator=(nullptr_t) noexcept
+      {
+ if (_M_manager)
+   {
+     _M_manager(_M_functor, _M_functor, __destroy_functor);
+     _M_manager = nullptr;
+     _M_invoker = nullptr;
+   }
+ return *this;
+      }
+      template<typename _Functor>
+ _Requires<_Callable<typename decay<_Functor>::type>, function&>
+ operator=(_Functor&& __f)
+ {
+   function(std::forward<_Functor>(__f)).swap(*this);
+   return *this;
+ }
+
+
+      template<typename _Functor>
+ function&
+ operator=(reference_wrapper<_Functor> __f) noexcept
+ {
+   function(__f).swap(*this);
+   return *this;
+ }
+      void swap(function& __x) noexcept
+      {
+ std::swap(_M_functor, __x._M_functor);
+ std::swap(_M_manager, __x._M_manager);
+ std::swap(_M_invoker, __x._M_invoker);
+      }
+      explicit operator bool() const noexcept
+      { return !_M_empty(); }
+      _Res operator()(_ArgTypes... __args) const;
+    private:
+      using _Invoker_type = _Res (*)(const _Any_data&, _ArgTypes&&...);
+      _Invoker_type _M_invoker;
+  };
+  template<typename _Res, typename... _ArgTypes>
+    function<_Res(_ArgTypes...)>::
+    function(const function& __x)
+    : _Function_base()
+    {
+      if (static_cast<bool>(__x))
+ {
+   __x._M_manager(_M_functor, __x._M_functor, __clone_functor);
+   _M_invoker = __x._M_invoker;
+   _M_manager = __x._M_manager;
+ }
+    }
+
+  template<typename _Res, typename... _ArgTypes>
+    template<typename _Functor, typename, typename>
+      function<_Res(_ArgTypes...)>::
+      function(_Functor __f)
+      : _Function_base()
+      {
+ typedef _Function_handler<_Res(_ArgTypes...), _Functor> _My_handler;
+
+ if (_My_handler::_M_not_empty_function(__f))
+   {
+     _My_handler::_M_init_functor(_M_functor, std::move(__f));
+     _M_invoker = &_My_handler::_M_invoke;
+     _M_manager = &_My_handler::_M_manager;
+   }
+      }
+
+  template<typename _Res, typename... _ArgTypes>
+    _Res
+    function<_Res(_ArgTypes...)>::
+    operator()(_ArgTypes... __args) const
+    {
+      if (_M_empty())
+ __throw_bad_function_call();
+      return _M_invoker(_M_functor, std::forward<_ArgTypes>(__args)...);
+    }
+  template<typename _Res, typename... _Args>
+    inline bool
+    operator==(const function<_Res(_Args...)>& __f, nullptr_t) noexcept
+    { return !static_cast<bool>(__f); }
+
+
+  template<typename _Res, typename... _Args>
+    inline bool
+    operator==(nullptr_t, const function<_Res(_Args...)>& __f) noexcept
+    { return !static_cast<bool>(__f); }
+  template<typename _Res, typename... _Args>
+    inline bool
+    operator!=(const function<_Res(_Args...)>& __f, nullptr_t) noexcept
+    { return static_cast<bool>(__f); }
+
+
+  template<typename _Res, typename... _Args>
+    inline bool
+    operator!=(nullptr_t, const function<_Res(_Args...)>& __f) noexcept
+    { return static_cast<bool>(__f); }
+  template<typename _Res, typename... _Args>
+    inline void
+    swap(function<_Res(_Args...)>& __x, function<_Res(_Args...)>& __y) noexcept
+    { __x.swap(__y); }
+
+
+}
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+  template<typename _MemFunPtr,
+    bool __is_mem_fn = is_member_function_pointer<_MemFunPtr>::value>
+    class _Mem_fn_base
+    : public _Mem_fn_traits<_MemFunPtr>::__maybe_type
+    {
+      using _Traits = _Mem_fn_traits<_MemFunPtr>;
+
+      using _Arity = typename _Traits::__arity;
+      using _Varargs = typename _Traits::__vararg;
+
+      template<typename _Func, typename... _BoundArgs>
+ friend struct _Bind_check_arity;
+
+      _MemFunPtr _M_pmf;
+
+    public:
+
+      using result_type = typename _Traits::__result_type;
+
+      explicit constexpr
+      _Mem_fn_base(_MemFunPtr __pmf) noexcept : _M_pmf(__pmf) { }
+
+      template<typename... _Args>
+ auto
+ operator()(_Args&&... __args) const
+ noexcept(noexcept(
+       std::__invoke(_M_pmf, std::forward<_Args>(__args)...)))
+ -> decltype(std::__invoke(_M_pmf, std::forward<_Args>(__args)...))
+ { return std::__invoke(_M_pmf, std::forward<_Args>(__args)...); }
+    };
+
+
+  template<typename _MemObjPtr>
+    class _Mem_fn_base<_MemObjPtr, false>
+    {
+      using _Arity = integral_constant<size_t, 0>;
+      using _Varargs = false_type;
+
+      template<typename _Func, typename... _BoundArgs>
+ friend struct _Bind_check_arity;
+
+      _MemObjPtr _M_pm;
+
+    public:
+      explicit constexpr
+      _Mem_fn_base(_MemObjPtr __pm) noexcept : _M_pm(__pm) { }
+
+      template<typename _Tp>
+ auto
+ operator()(_Tp&& __obj) const
+ noexcept(noexcept(std::__invoke(_M_pm, std::forward<_Tp>(__obj))))
+ -> decltype(std::__invoke(_M_pm, std::forward<_Tp>(__obj)))
+ { return std::__invoke(_M_pm, std::forward<_Tp>(__obj)); }
+    };
+
+  template<typename _MemberPointer>
+    struct _Mem_fn;
+
+  template<typename _Res, typename _Class>
+    struct _Mem_fn<_Res _Class::*>
+    : _Mem_fn_base<_Res _Class::*>
+    {
+      using _Mem_fn_base<_Res _Class::*>::_Mem_fn_base;
+    };
+  template<typename _Tp, typename _Class>
+    inline _Mem_fn<_Tp _Class::*>
+    mem_fn(_Tp _Class::* __pm) noexcept
+    {
+      return _Mem_fn<_Tp _Class::*>(__pm);
+    }
+  template<typename _Tp>
+    struct is_bind_expression
+    : public false_type { };
+  template<typename _Tp>
+    struct is_placeholder
+    : public integral_constant<int, 0>
+    { };
+  template<int _Num> struct _Placeholder { };
+
+
+
+
+
+  namespace placeholders
+  {
+
+
+
+
+    extern const _Placeholder<1> _1;
+    extern const _Placeholder<2> _2;
+    extern const _Placeholder<3> _3;
+    extern const _Placeholder<4> _4;
+    extern const _Placeholder<5> _5;
+    extern const _Placeholder<6> _6;
+    extern const _Placeholder<7> _7;
+    extern const _Placeholder<8> _8;
+    extern const _Placeholder<9> _9;
+    extern const _Placeholder<10> _10;
+    extern const _Placeholder<11> _11;
+    extern const _Placeholder<12> _12;
+    extern const _Placeholder<13> _13;
+    extern const _Placeholder<14> _14;
+    extern const _Placeholder<15> _15;
+    extern const _Placeholder<16> _16;
+    extern const _Placeholder<17> _17;
+    extern const _Placeholder<18> _18;
+    extern const _Placeholder<19> _19;
+    extern const _Placeholder<20> _20;
+    extern const _Placeholder<21> _21;
+    extern const _Placeholder<22> _22;
+    extern const _Placeholder<23> _23;
+    extern const _Placeholder<24> _24;
+    extern const _Placeholder<25> _25;
+    extern const _Placeholder<26> _26;
+    extern const _Placeholder<27> _27;
+    extern const _Placeholder<28> _28;
+    extern const _Placeholder<29> _29;
+  }
+
+
+
+
+
+
+  template<int _Num>
+    struct is_placeholder<_Placeholder<_Num> >
+    : public integral_constant<int, _Num>
+    { };
+
+  template<int _Num>
+    struct is_placeholder<const _Placeholder<_Num> >
+    : public integral_constant<int, _Num>
+    { };
+
+
+
+  template<std::size_t __i, typename _Tuple>
+    using _Safe_tuple_element_t
+      = typename enable_if<(__i < tuple_size<_Tuple>::value),
+      tuple_element<__i, _Tuple>>::type::type;
+  template<typename _Arg,
+    bool _IsBindExp = is_bind_expression<_Arg>::value,
+    bool _IsPlaceholder = (is_placeholder<_Arg>::value > 0)>
+    class _Mu;
+
+
+
+
+
+
+  template<typename _Tp>
+    class _Mu<reference_wrapper<_Tp>, false, false>
+    {
+    public:
+
+
+
+
+      template<typename _CVRef, typename _Tuple>
+ _Tp&
+ operator()(_CVRef& __arg, _Tuple&) const volatile
+ { return __arg.get(); }
+    };
+
+
+
+
+
+
+
+  template<typename _Arg>
+    class _Mu<_Arg, true, false>
+    {
+    public:
+      template<typename _CVArg, typename... _Args>
+ auto
+ operator()(_CVArg& __arg,
+     tuple<_Args...>& __tuple) const volatile
+ -> decltype(__arg(declval<_Args>()...))
+ {
+
+   typedef typename _Build_index_tuple<sizeof...(_Args)>::__type
+     _Indexes;
+   return this->__call(__arg, __tuple, _Indexes());
+ }
+
+    private:
+
+
+      template<typename _CVArg, typename... _Args, std::size_t... _Indexes>
+ auto
+ __call(_CVArg& __arg, tuple<_Args...>& __tuple,
+        const _Index_tuple<_Indexes...>&) const volatile
+ -> decltype(__arg(declval<_Args>()...))
+ {
+   return __arg(std::get<_Indexes>(std::move(__tuple))...);
+ }
+    };
+
+
+
+
+
+
+  template<typename _Arg>
+    class _Mu<_Arg, false, true>
+    {
+    public:
+      template<typename _Tuple>
+ _Safe_tuple_element_t<(is_placeholder<_Arg>::value - 1), _Tuple>&&
+ operator()(const volatile _Arg&, _Tuple& __tuple) const volatile
+ {
+   return
+     ::std::get<(is_placeholder<_Arg>::value - 1)>(std::move(__tuple));
+ }
+    };
+
+
+
+
+
+
+  template<typename _Arg>
+    class _Mu<_Arg, false, false>
+    {
+    public:
+      template<typename _CVArg, typename _Tuple>
+ _CVArg&&
+ operator()(_CVArg&& __arg, _Tuple&) const volatile
+ { return std::forward<_CVArg>(__arg); }
+    };
+
+
+  template<std::size_t _Ind, typename... _Tp>
+    inline auto
+    __volget(volatile tuple<_Tp...>& __tuple)
+    -> __tuple_element_t<_Ind, tuple<_Tp...>> volatile&
+    { return std::get<_Ind>(const_cast<tuple<_Tp...>&>(__tuple)); }
+
+
+  template<std::size_t _Ind, typename... _Tp>
+    inline auto
+    __volget(const volatile tuple<_Tp...>& __tuple)
+    -> __tuple_element_t<_Ind, tuple<_Tp...>> const volatile&
+    { return std::get<_Ind>(const_cast<const tuple<_Tp...>&>(__tuple)); }
+
+
+  template<typename _Signature>
+    struct _Bind;
+
+   template<typename _Functor, typename... _Bound_args>
+    class _Bind<_Functor(_Bound_args...)>
+    : public _Weak_result_type<_Functor>
+    {
+      typedef typename _Build_index_tuple<sizeof...(_Bound_args)>::__type
+ _Bound_indexes;
+
+      _Functor _M_f;
+      tuple<_Bound_args...> _M_bound_args;
+
+
+      template<typename _Result, typename... _Args, std::size_t... _Indexes>
+ _Result
+ __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>)
+ {
+   return std::__invoke(_M_f,
+       _Mu<_Bound_args>()(std::get<_Indexes>(_M_bound_args), __args)...
+       );
+ }
+
+
+      template<typename _Result, typename... _Args, std::size_t... _Indexes>
+ _Result
+ __call_c(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>) const
+ {
+   return std::__invoke(_M_f,
+       _Mu<_Bound_args>()(std::get<_Indexes>(_M_bound_args), __args)...
+       );
+ }
+
+
+      template<typename _Result, typename... _Args, std::size_t... _Indexes>
+ _Result
+ __call_v(tuple<_Args...>&& __args,
+   _Index_tuple<_Indexes...>) volatile
+ {
+   return std::__invoke(_M_f,
+       _Mu<_Bound_args>()(__volget<_Indexes>(_M_bound_args), __args)...
+       );
+ }
+
+
+      template<typename _Result, typename... _Args, std::size_t... _Indexes>
+ _Result
+ __call_c_v(tuple<_Args...>&& __args,
+     _Index_tuple<_Indexes...>) const volatile
+ {
+   return std::__invoke(_M_f,
+       _Mu<_Bound_args>()(__volget<_Indexes>(_M_bound_args), __args)...
+       );
+ }
+
+      template<typename _BoundArg, typename _CallArgs>
+ using _Mu_type = decltype(
+     _Mu<typename remove_cv<_BoundArg>::type>()(
+       std::declval<_BoundArg&>(), std::declval<_CallArgs&>()) );
+
+      template<typename _Fn, typename _CallArgs, typename... _BArgs>
+ using _Res_type_impl
+   = typename result_of< _Fn&(_Mu_type<_BArgs, _CallArgs>&&...) >::type;
+
+      template<typename _CallArgs>
+ using _Res_type = _Res_type_impl<_Functor, _CallArgs, _Bound_args...>;
+
+      template<typename _CallArgs>
+ using __dependent = typename
+   enable_if<bool(tuple_size<_CallArgs>::value+1), _Functor>::type;
+
+      template<typename _CallArgs, template<class> class __cv_quals>
+ using _Res_type_cv = _Res_type_impl<
+   typename __cv_quals<__dependent<_CallArgs>>::type,
+   _CallArgs,
+   typename __cv_quals<_Bound_args>::type...>;
+
+     public:
+      template<typename... _Args>
+ explicit _Bind(const _Functor& __f, _Args&&... __args)
+ : _M_f(__f), _M_bound_args(std::forward<_Args>(__args)...)
+ { }
+
+      template<typename... _Args>
+ explicit _Bind(_Functor&& __f, _Args&&... __args)
+ : _M_f(std::move(__f)), _M_bound_args(std::forward<_Args>(__args)...)
+ { }
+
+      _Bind(const _Bind&) = default;
+
+      _Bind(_Bind&& __b)
+      : _M_f(std::move(__b._M_f)), _M_bound_args(std::move(__b._M_bound_args))
+      { }
+
+
+      template<typename... _Args,
+        typename _Result = _Res_type<tuple<_Args...>>>
+ _Result
+ operator()(_Args&&... __args)
+ {
+   return this->__call<_Result>(
+       std::forward_as_tuple(std::forward<_Args>(__args)...),
+       _Bound_indexes());
+ }
+
+
+      template<typename... _Args,
+        typename _Result = _Res_type_cv<tuple<_Args...>, add_const>>
+ _Result
+ operator()(_Args&&... __args) const
+ {
+   return this->__call_c<_Result>(
+       std::forward_as_tuple(std::forward<_Args>(__args)...),
+       _Bound_indexes());
+ }
+      template<typename... _Args,
+        typename _Result = _Res_type_cv<tuple<_Args...>, add_volatile>>
+
+ _Result
+ operator()(_Args&&... __args) volatile
+ {
+   return this->__call_v<_Result>(
+       std::forward_as_tuple(std::forward<_Args>(__args)...),
+       _Bound_indexes());
+ }
+
+
+      template<typename... _Args,
+        typename _Result = _Res_type_cv<tuple<_Args...>, add_cv>>
+
+ _Result
+ operator()(_Args&&... __args) const volatile
+ {
+   return this->__call_c_v<_Result>(
+       std::forward_as_tuple(std::forward<_Args>(__args)...),
+       _Bound_indexes());
+ }
+    };
+
+
+  template<typename _Result, typename _Signature>
+    struct _Bind_result;
+
+  template<typename _Result, typename _Functor, typename... _Bound_args>
+    class _Bind_result<_Result, _Functor(_Bound_args...)>
+    {
+      typedef typename _Build_index_tuple<sizeof...(_Bound_args)>::__type
+ _Bound_indexes;
+
+      _Functor _M_f;
+      tuple<_Bound_args...> _M_bound_args;
+
+
+      template<typename _Res>
+ using __enable_if_void
+   = typename enable_if<is_void<_Res>{}>::type;
+
+      template<typename _Res>
+ using __disable_if_void
+   = typename enable_if<!is_void<_Res>{}, _Result>::type;
+
+
+      template<typename _Res, typename... _Args, std::size_t... _Indexes>
+ __disable_if_void<_Res>
+ __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>)
+ {
+   return std::__invoke(_M_f, _Mu<_Bound_args>()
+        (std::get<_Indexes>(_M_bound_args), __args)...);
+ }
+
+
+      template<typename _Res, typename... _Args, std::size_t... _Indexes>
+ __enable_if_void<_Res>
+ __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>)
+ {
+   std::__invoke(_M_f, _Mu<_Bound_args>()
+        (std::get<_Indexes>(_M_bound_args), __args)...);
+ }
+
+
+      template<typename _Res, typename... _Args, std::size_t... _Indexes>
+ __disable_if_void<_Res>
+ __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>) const
+ {
+   return std::__invoke(_M_f, _Mu<_Bound_args>()
+        (std::get<_Indexes>(_M_bound_args), __args)...);
+ }
+
+
+      template<typename _Res, typename... _Args, std::size_t... _Indexes>
+ __enable_if_void<_Res>
+ __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>) const
+ {
+   std::__invoke(_M_f, _Mu<_Bound_args>()
+        (std::get<_Indexes>(_M_bound_args), __args)...);
+ }
+
+
+      template<typename _Res, typename... _Args, std::size_t... _Indexes>
+ __disable_if_void<_Res>
+ __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>) volatile
+ {
+   return std::__invoke(_M_f, _Mu<_Bound_args>()
+        (__volget<_Indexes>(_M_bound_args), __args)...);
+ }
+
+
+      template<typename _Res, typename... _Args, std::size_t... _Indexes>
+ __enable_if_void<_Res>
+ __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>) volatile
+ {
+   std::__invoke(_M_f, _Mu<_Bound_args>()
+        (__volget<_Indexes>(_M_bound_args), __args)...);
+ }
+
+
+      template<typename _Res, typename... _Args, std::size_t... _Indexes>
+ __disable_if_void<_Res>
+ __call(tuple<_Args...>&& __args,
+        _Index_tuple<_Indexes...>) const volatile
+ {
+   return std::__invoke(_M_f, _Mu<_Bound_args>()
+        (__volget<_Indexes>(_M_bound_args), __args)...);
+ }
+
+
+      template<typename _Res, typename... _Args, std::size_t... _Indexes>
+ __enable_if_void<_Res>
+ __call(tuple<_Args...>&& __args,
+        _Index_tuple<_Indexes...>) const volatile
+ {
+   std::__invoke(_M_f, _Mu<_Bound_args>()
+        (__volget<_Indexes>(_M_bound_args), __args)...);
+ }
+
+    public:
+      typedef _Result result_type;
+
+      template<typename... _Args>
+ explicit _Bind_result(const _Functor& __f, _Args&&... __args)
+ : _M_f(__f), _M_bound_args(std::forward<_Args>(__args)...)
+ { }
+
+      template<typename... _Args>
+ explicit _Bind_result(_Functor&& __f, _Args&&... __args)
+ : _M_f(std::move(__f)), _M_bound_args(std::forward<_Args>(__args)...)
+ { }
+
+      _Bind_result(const _Bind_result&) = default;
+
+      _Bind_result(_Bind_result&& __b)
+      : _M_f(std::move(__b._M_f)), _M_bound_args(std::move(__b._M_bound_args))
+      { }
+
+
+      template<typename... _Args>
+ result_type
+ operator()(_Args&&... __args)
+ {
+   return this->__call<_Result>(
+       std::forward_as_tuple(std::forward<_Args>(__args)...),
+       _Bound_indexes());
+ }
+
+
+      template<typename... _Args>
+ result_type
+ operator()(_Args&&... __args) const
+ {
+   return this->__call<_Result>(
+       std::forward_as_tuple(std::forward<_Args>(__args)...),
+       _Bound_indexes());
+ }
+
+
+      template<typename... _Args>
+
+ result_type
+ operator()(_Args&&... __args) volatile
+ {
+   return this->__call<_Result>(
+       std::forward_as_tuple(std::forward<_Args>(__args)...),
+       _Bound_indexes());
+ }
+
+
+      template<typename... _Args>
+
+ result_type
+ operator()(_Args&&... __args) const volatile
+ {
+   return this->__call<_Result>(
+       std::forward_as_tuple(std::forward<_Args>(__args)...),
+       _Bound_indexes());
+ }
+    };
+
+
+
+
+
+
+  template<typename _Signature>
+    struct is_bind_expression<_Bind<_Signature> >
+    : public true_type { };
+
+
+
+
+
+  template<typename _Signature>
+    struct is_bind_expression<const _Bind<_Signature> >
+    : public true_type { };
+
+
+
+
+
+  template<typename _Signature>
+    struct is_bind_expression<volatile _Bind<_Signature> >
+    : public true_type { };
+
+
+
+
+
+  template<typename _Signature>
+    struct is_bind_expression<const volatile _Bind<_Signature>>
+    : public true_type { };
+
+
+
+
+
+  template<typename _Result, typename _Signature>
+    struct is_bind_expression<_Bind_result<_Result, _Signature>>
+    : public true_type { };
+
+
+
+
+
+  template<typename _Result, typename _Signature>
+    struct is_bind_expression<const _Bind_result<_Result, _Signature>>
+    : public true_type { };
+
+
+
+
+
+  template<typename _Result, typename _Signature>
+    struct is_bind_expression<volatile _Bind_result<_Result, _Signature>>
+    : public true_type { };
+
+
+
+
+
+  template<typename _Result, typename _Signature>
+    struct is_bind_expression<const volatile _Bind_result<_Result, _Signature>>
+    : public true_type { };
+
+  template<typename _Func, typename... _BoundArgs>
+    struct _Bind_check_arity { };
+
+  template<typename _Ret, typename... _Args, typename... _BoundArgs>
+    struct _Bind_check_arity<_Ret (*)(_Args...), _BoundArgs...>
+    {
+      static_assert(sizeof...(_BoundArgs) == sizeof...(_Args),
+                   "Wrong number of arguments for function");
+    };
+
+  template<typename _Ret, typename... _Args, typename... _BoundArgs>
+    struct _Bind_check_arity<_Ret (*)(_Args......), _BoundArgs...>
+    {
+      static_assert(sizeof...(_BoundArgs) >= sizeof...(_Args),
+                   "Wrong number of arguments for function");
+    };
+
+  template<typename _Tp, typename _Class, typename... _BoundArgs>
+    struct _Bind_check_arity<_Tp _Class::*, _BoundArgs...>
+    {
+      using _Arity = typename _Mem_fn<_Tp _Class::*>::_Arity;
+      using _Varargs = typename _Mem_fn<_Tp _Class::*>::_Varargs;
+      static_assert(_Varargs::value
+      ? sizeof...(_BoundArgs) >= _Arity::value + 1
+      : sizeof...(_BoundArgs) == _Arity::value + 1,
+      "Wrong number of arguments for pointer-to-member");
+    };
+
+
+
+
+  template<typename _Tp, typename _Tp2 = typename decay<_Tp>::type>
+    using __is_socketlike = __or_<is_integral<_Tp2>, is_enum<_Tp2>>;
+
+  template<bool _SocketLike, typename _Func, typename... _BoundArgs>
+    struct _Bind_helper
+    : _Bind_check_arity<typename decay<_Func>::type, _BoundArgs...>
+    {
+      typedef typename decay<_Func>::type __func_type;
+      typedef _Bind<__func_type(typename decay<_BoundArgs>::type...)> type;
+    };
+
+
+
+
+  template<typename _Func, typename... _BoundArgs>
+    struct _Bind_helper<true, _Func, _BoundArgs...>
+    { };
+
+
+
+
+
+  template<typename _Func, typename... _BoundArgs>
+    inline typename
+    _Bind_helper<__is_socketlike<_Func>::value, _Func, _BoundArgs...>::type
+    bind(_Func&& __f, _BoundArgs&&... __args)
+    {
+      typedef _Bind_helper<false, _Func, _BoundArgs...> __helper_type;
+      return typename __helper_type::type(std::forward<_Func>(__f),
+       std::forward<_BoundArgs>(__args)...);
+    }
+
+  template<typename _Result, typename _Func, typename... _BoundArgs>
+    struct _Bindres_helper
+    : _Bind_check_arity<typename decay<_Func>::type, _BoundArgs...>
+    {
+      typedef typename decay<_Func>::type __functor_type;
+      typedef _Bind_result<_Result,
+      __functor_type(typename decay<_BoundArgs>::type...)>
+ type;
+    };
+
+
+
+
+
+  template<typename _Result, typename _Func, typename... _BoundArgs>
+    inline
+    typename _Bindres_helper<_Result, _Func, _BoundArgs...>::type
+    bind(_Func&& __f, _BoundArgs&&... __args)
+    {
+      typedef _Bindres_helper<_Result, _Func, _BoundArgs...> __helper_type;
+      return typename __helper_type::type(std::forward<_Func>(__f),
+       std::forward<_BoundArgs>(__args)...);
+    }
+
+}
+
+namespace llvm {
+
+
+
+template <typename T, T> struct SameType;
+
+namespace detail {
+
+template <typename RangeT>
+using IterOfRange = decltype(std::begin(std::declval<RangeT &>()));
+
+template <typename RangeT>
+using ValueOfRange = typename std::remove_reference<decltype(
+    *std::begin(std::declval<RangeT &>()))>::type;
+
+}
+
+
+
+
+
+template <class Ty> struct identity {
+  using argument_type = Ty;
+
+  Ty &operator()(Ty &self) const {
+    return self;
+  }
+  const Ty &operator()(const Ty &self) const {
+    return self;
+  }
+};
+
+template <class Ty> struct less_ptr {
+  bool operator()(const Ty* left, const Ty* right) const {
+    return *left < *right;
+  }
+};
+
+template <class Ty> struct greater_ptr {
+  bool operator()(const Ty* left, const Ty* right) const {
+    return *right < *left;
+  }
+};
+
+
+
+
+
+
+
+template<typename Fn> class function_ref;
+
+template<typename Ret, typename ...Params>
+class function_ref<Ret(Params...)> {
+  Ret (*callback)(intptr_t callable, Params ...params) = nullptr;
+  intptr_t callable;
+
+  template<typename Callable>
+  static Ret callback_fn(intptr_t callable, Params ...params) {
+    return (*reinterpret_cast<Callable*>(callable))(
+        std::forward<Params>(params)...);
+  }
+
+public:
+  function_ref() = default;
+
+  template <typename Callable>
+  function_ref(Callable &&callable,
+               typename std::enable_if<
+                   !std::is_same<typename std::remove_reference<Callable>::type,
+                                 function_ref>::value>::type * = nullptr)
+      : callback(callback_fn<typename std::remove_reference<Callable>::type>),
+        callable(reinterpret_cast<intptr_t>(&callable)) {}
+
+  Ret operator()(Params ...params) const {
+    return callback(callable, std::forward<Params>(params)...);
+  }
+
+  operator bool() const { return callback; }
+};
+
+
+
+
+
+template <class T>
+inline void deleter(T *Ptr) {
+  delete Ptr;
+}
+
+
+
+
+
+namespace adl_detail {
+
+using std::begin;
+
+template <typename ContainerTy>
+auto adl_begin(ContainerTy &&container)
+    -> decltype(begin(std::forward<ContainerTy>(container))) {
+  return begin(std::forward<ContainerTy>(container));
+}
+
+using std::end;
+
+template <typename ContainerTy>
+auto adl_end(ContainerTy &&container)
+    -> decltype(end(std::forward<ContainerTy>(container))) {
+  return end(std::forward<ContainerTy>(container));
+}
+
+using std::swap;
+
+template <typename T>
+void adl_swap(T &&lhs, T &&rhs) noexcept(noexcept(swap(std::declval<T>(),
+                                                       std::declval<T>()))) {
+  swap(std::forward<T>(lhs), std::forward<T>(rhs));
+}
+
+}
+
+template <typename ContainerTy>
+auto adl_begin(ContainerTy &&container)
+    -> decltype(adl_detail::adl_begin(std::forward<ContainerTy>(container))) {
+  return adl_detail::adl_begin(std::forward<ContainerTy>(container));
+}
+
+template <typename ContainerTy>
+auto adl_end(ContainerTy &&container)
+    -> decltype(adl_detail::adl_end(std::forward<ContainerTy>(container))) {
+  return adl_detail::adl_end(std::forward<ContainerTy>(container));
+}
+
+template <typename T>
+void adl_swap(T &&lhs, T &&rhs) noexcept(
+    noexcept(adl_detail::adl_swap(std::declval<T>(), std::declval<T>()))) {
+  adl_detail::adl_swap(std::forward<T>(lhs), std::forward<T>(rhs));
+}
+
+
+
+
+template <typename ItTy, typename FuncTy,
+          typename FuncReturnTy =
+            decltype(std::declval<FuncTy>()(*std::declval<ItTy>()))>
+class mapped_iterator
+    : public iterator_adaptor_base<
+             mapped_iterator<ItTy, FuncTy>, ItTy,
+             typename std::iterator_traits<ItTy>::iterator_category,
+             typename std::remove_reference<FuncReturnTy>::type> {
+public:
+  mapped_iterator(ItTy U, FuncTy F)
+    : mapped_iterator::iterator_adaptor_base(std::move(U)), F(std::move(F)) {}
+
+  ItTy getCurrent() { return this->I; }
+
+  FuncReturnTy operator*() { return F(*this->I); }
+
+private:
+  FuncTy F;
+};
+
+
+
+template <class ItTy, class FuncTy>
+inline mapped_iterator<ItTy, FuncTy> map_iterator(ItTy I, FuncTy F) {
+  return mapped_iterator<ItTy, FuncTy>(std::move(I), std::move(F));
+}
+
+
+template <typename Ty> class has_rbegin_impl {
+  using yes = char[1];
+  using no = char[2];
+
+  template <typename Inner>
+  static yes& test(Inner *I, decltype(I->rbegin()) * = nullptr);
+
+  template <typename>
+  static no& test(...);
+
+public:
+  static const bool value = sizeof(test<Ty>(nullptr)) == sizeof(yes);
+};
+
+
+template <typename Ty>
+struct has_rbegin : has_rbegin_impl<typename std::remove_reference<Ty>::type> {
+};
+
+
+
+template <typename ContainerTy>
+auto reverse(ContainerTy &&C,
+             typename std::enable_if<has_rbegin<ContainerTy>::value>::type * =
+                 nullptr) -> decltype(make_range(C.rbegin(), C.rend())) {
+  return make_range(C.rbegin(), C.rend());
+}
+
+
+template <typename IteratorTy>
+std::reverse_iterator<IteratorTy> make_reverse_iterator(IteratorTy It) {
+  return std::reverse_iterator<IteratorTy>(It);
+}
+
+
+
+
+template <typename ContainerTy>
+auto reverse(
+    ContainerTy &&C,
+    typename std::enable_if<!has_rbegin<ContainerTy>::value>::type * = nullptr)
+    -> decltype(make_range(llvm::make_reverse_iterator(std::end(C)),
+                           llvm::make_reverse_iterator(std::begin(C)))) {
+  return make_range(llvm::make_reverse_iterator(std::end(C)),
+                    llvm::make_reverse_iterator(std::begin(C)));
+}
+template <typename WrappedIteratorT, typename PredicateT>
+class filter_iterator
+    : public iterator_adaptor_base<
+          filter_iterator<WrappedIteratorT, PredicateT>, WrappedIteratorT,
+          typename std::common_type<
+              std::forward_iterator_tag,
+              typename std::iterator_traits<
+                  WrappedIteratorT>::iterator_category>::type> {
+  using BaseT = iterator_adaptor_base<
+      filter_iterator<WrappedIteratorT, PredicateT>, WrappedIteratorT,
+      typename std::common_type<
+          std::forward_iterator_tag,
+          typename std::iterator_traits<WrappedIteratorT>::iterator_category>::
+          type>;
+
+  struct PayloadType {
+    WrappedIteratorT End;
+    PredicateT Pred;
+  };
+
+  Optional<PayloadType> Payload;
+
+  void findNextValid() {
+    
+   ((
+   Payload && "Payload should be engaged when findNextValid is called"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Payload && \"Payload should be engaged when findNextValid is called\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/STLExtras.h", 292, __PRETTY_FUNCTION__))
+                                                                              ;
+    while (this->I != Payload->End && !Payload->Pred(*this->I))
+      BaseT::operator++();
+  }
+
+
+
+  filter_iterator(WrappedIteratorT Begin, WrappedIteratorT End, PredicateT Pred)
+      : BaseT(std::move(Begin)),
+        Payload(PayloadType{std::move(End), std::move(Pred)}) {
+    findNextValid();
+  }
+
+
+
+  filter_iterator(WrappedIteratorT End) : BaseT(End) {}
+
+public:
+  using BaseT::operator++;
+
+  filter_iterator &operator++() {
+    BaseT::operator++();
+    findNextValid();
+    return *this;
+  }
+
+  template <typename RT, typename PT>
+  friend iterator_range<filter_iterator<detail::IterOfRange<RT>, PT>>
+  make_filter_range(RT &&, PT);
+};
+template <typename RangeT, typename PredicateT>
+iterator_range<filter_iterator<detail::IterOfRange<RangeT>, PredicateT>>
+make_filter_range(RangeT &&Range, PredicateT Pred) {
+  using FilterIteratorT =
+      filter_iterator<detail::IterOfRange<RangeT>, PredicateT>;
+  return make_range(FilterIteratorT(std::begin(std::forward<RangeT>(Range)),
+                                    std::end(std::forward<RangeT>(Range)),
+                                    std::move(Pred)),
+                    FilterIteratorT(std::end(std::forward<RangeT>(Range))));
+}
+
+
+template <typename R, typename UnaryPredicate>
+bool all_of(R &&range, UnaryPredicate P);
+
+template <size_t... I> struct index_sequence;
+
+template <class... Ts> struct index_sequence_for;
+
+namespace detail {
+
+using std::declval;
+
+
+
+template<typename... Iters> struct ZipTupleType {
+  using type = std::tuple<decltype(*declval<Iters>())...>;
+};
+
+template <typename ZipType, typename... Iters>
+using zip_traits = iterator_facade_base<
+    ZipType, typename std::common_type<std::bidirectional_iterator_tag,
+                                       typename std::iterator_traits<
+                                           Iters>::iterator_category...>::type,
+
+    typename ZipTupleType<Iters...>::type,
+    typename std::iterator_traits<typename std::tuple_element<
+        0, std::tuple<Iters...>>::type>::difference_type,
+
+
+
+
+    typename ZipTupleType<Iters...>::type *,
+    typename ZipTupleType<Iters...>::type>;
+
+template <typename ZipType, typename... Iters>
+struct zip_common : public zip_traits<ZipType, Iters...> {
+  using Base = zip_traits<ZipType, Iters...>;
+  using value_type = typename Base::value_type;
+
+  std::tuple<Iters...> iterators;
+
+protected:
+  template <size_t... Ns> value_type deref(index_sequence<Ns...>) const {
+    return value_type(*std::get<Ns>(iterators)...);
+  }
+
+  template <size_t... Ns>
+  decltype(iterators) tup_inc(index_sequence<Ns...>) const {
+    return std::tuple<Iters...>(std::next(std::get<Ns>(iterators))...);
+  }
+
+  template <size_t... Ns>
+  decltype(iterators) tup_dec(index_sequence<Ns...>) const {
+    return std::tuple<Iters...>(std::prev(std::get<Ns>(iterators))...);
+  }
+
+public:
+  zip_common(Iters &&... ts) : iterators(std::forward<Iters>(ts)...) {}
+
+  value_type operator*() { return deref(index_sequence_for<Iters...>{}); }
+
+  const value_type operator*() const {
+    return deref(index_sequence_for<Iters...>{});
+  }
+
+  ZipType &operator++() {
+    iterators = tup_inc(index_sequence_for<Iters...>{});
+    return *reinterpret_cast<ZipType *>(this);
+  }
+
+  ZipType &operator--() {
+    static_assert(Base::IsBidirectional,
+                  "All inner iterators must be at least bidirectional.");
+    iterators = tup_dec(index_sequence_for<Iters...>{});
+    return *reinterpret_cast<ZipType *>(this);
+  }
+};
+
+template <typename... Iters>
+struct zip_first : public zip_common<zip_first<Iters...>, Iters...> {
+  using Base = zip_common<zip_first<Iters...>, Iters...>;
+
+  bool operator==(const zip_first<Iters...> &other) const {
+    return std::get<0>(this->iterators) == std::get<0>(other.iterators);
+  }
+
+  zip_first(Iters &&... ts) : Base(std::forward<Iters>(ts)...) {}
+};
+
+template <typename... Iters>
+class zip_shortest : public zip_common<zip_shortest<Iters...>, Iters...> {
+  template <size_t... Ns>
+  bool test(const zip_shortest<Iters...> &other, index_sequence<Ns...>) const {
+    return all_of(std::initializer_list<bool>{std::get<Ns>(this->iterators) !=
+                                              std::get<Ns>(other.iterators)...},
+                  identity<bool>{});
+  }
+
+public:
+  using Base = zip_common<zip_shortest<Iters...>, Iters...>;
+
+  zip_shortest(Iters &&... ts) : Base(std::forward<Iters>(ts)...) {}
+
+  bool operator==(const zip_shortest<Iters...> &other) const {
+    return !test(other, index_sequence_for<Iters...>{});
+  }
+};
+
+template <template <typename...> class ItType, typename... Args> class zippy {
+public:
+  using iterator = ItType<decltype(std::begin(std::declval<Args>()))...>;
+  using iterator_category = typename iterator::iterator_category;
+  using value_type = typename iterator::value_type;
+  using difference_type = typename iterator::difference_type;
+  using pointer = typename iterator::pointer;
+  using reference = typename iterator::reference;
+
+private:
+  std::tuple<Args...> ts;
+
+  template <size_t... Ns> iterator begin_impl(index_sequence<Ns...>) const {
+    return iterator(std::begin(std::get<Ns>(ts))...);
+  }
+  template <size_t... Ns> iterator end_impl(index_sequence<Ns...>) const {
+    return iterator(std::end(std::get<Ns>(ts))...);
+  }
+
+public:
+  zippy(Args &&... ts_) : ts(std::forward<Args>(ts_)...) {}
+
+  iterator begin() const { return begin_impl(index_sequence_for<Args...>{}); }
+  iterator end() const { return end_impl(index_sequence_for<Args...>{}); }
+};
+
+}
+
+
+template <typename T, typename U, typename... Args>
+detail::zippy<detail::zip_shortest, T, U, Args...> zip(T &&t, U &&u,
+                                                       Args &&... args) {
+  return detail::zippy<detail::zip_shortest, T, U, Args...>(
+      std::forward<T>(t), std::forward<U>(u), std::forward<Args>(args)...);
+}
+
+
+
+template <typename T, typename U, typename... Args>
+detail::zippy<detail::zip_first, T, U, Args...> zip_first(T &&t, U &&u,
+                                                          Args &&... args) {
+  return detail::zippy<detail::zip_first, T, U, Args...>(
+      std::forward<T>(t), std::forward<U>(u), std::forward<Args>(args)...);
+}
+template <typename ValueT, typename... IterTs>
+class concat_iterator
+    : public iterator_facade_base<concat_iterator<ValueT, IterTs...>,
+                                  std::forward_iterator_tag, ValueT> {
+  using BaseT = typename concat_iterator::iterator_facade_base;
+
+
+
+
+
+
+
+  std::tuple<std::pair<IterTs, IterTs>...> IterPairs;
+
+
+
+
+
+  template <size_t Index> bool incrementHelper() {
+    auto &IterPair = std::get<Index>(IterPairs);
+    if (IterPair.first == IterPair.second)
+      return false;
+
+    ++IterPair.first;
+    return true;
+  }
+
+
+
+
+  template <size_t... Ns> void increment(index_sequence<Ns...>) {
+
+    bool (concat_iterator::*IncrementHelperFns[])() = {
+        &concat_iterator::incrementHelper<Ns>...};
+
+
+    for (auto &IncrementHelperFn : IncrementHelperFns)
+      if ((this->*IncrementHelperFn)())
+        return;
+
+    ::llvm::llvm_unreachable_internal("Attempted to increment an end concat iterator!", "/home/trippels/llvm/llvm/include/llvm/ADT/STLExtras.h", 544);
+  }
+
+
+
+
+  template <size_t Index> ValueT *getHelper() const {
+    auto &IterPair = std::get<Index>(IterPairs);
+    if (IterPair.first == IterPair.second)
+      return nullptr;
+
+    return &*IterPair.first;
+  }
+
+
+
+
+
+  template <size_t... Ns> ValueT &get(index_sequence<Ns...>) const {
+
+    ValueT *(concat_iterator::*GetHelperFns[])() const = {
+        &concat_iterator::getHelper<Ns>...};
+
+
+    for (auto &GetHelperFn : GetHelperFns)
+      if (ValueT *P = (this->*GetHelperFn)())
+        return *P;
+
+    ::llvm::llvm_unreachable_internal("Attempted to get a pointer from an end concat iterator!", "/home/trippels/llvm/llvm/include/llvm/ADT/STLExtras.h", 572);
+  }
+
+public:
+
+
+
+
+  template <typename... RangeTs>
+  explicit concat_iterator(RangeTs &&... Ranges)
+      : IterPairs({std::begin(Ranges), std::end(Ranges)}...) {}
+
+  using BaseT::operator++;
+
+  concat_iterator &operator++() {
+    increment(index_sequence_for<IterTs...>());
+    return *this;
+  }
+
+  ValueT &operator*() const { return get(index_sequence_for<IterTs...>()); }
+
+  bool operator==(const concat_iterator &RHS) const {
+    return IterPairs == RHS.IterPairs;
+  }
+};
+
+namespace detail {
+
+
+
+
+
+
+template <typename ValueT, typename... RangeTs> class concat_range {
+public:
+  using iterator =
+      concat_iterator<ValueT,
+                      decltype(std::begin(std::declval<RangeTs &>()))...>;
+
+private:
+  std::tuple<RangeTs...> Ranges;
+
+  template <size_t... Ns> iterator begin_impl(index_sequence<Ns...>) {
+    return iterator(std::get<Ns>(Ranges)...);
+  }
+  template <size_t... Ns> iterator end_impl(index_sequence<Ns...>) {
+    return iterator(make_range(std::end(std::get<Ns>(Ranges)),
+                               std::end(std::get<Ns>(Ranges)))...);
+  }
+
+public:
+  concat_range(RangeTs &&... Ranges)
+      : Ranges(std::forward<RangeTs>(Ranges)...) {}
+
+  iterator begin() { return begin_impl(index_sequence_for<RangeTs...>{}); }
+  iterator end() { return end_impl(index_sequence_for<RangeTs...>{}); }
+};
+
+}
+
+
+
+
+template <typename ValueT, typename... RangeTs>
+detail::concat_range<ValueT, RangeTs...> concat(RangeTs &&... Ranges) {
+  static_assert(sizeof...(RangeTs) > 1,
+                "Need more than one range to concatenate!");
+  return detail::concat_range<ValueT, RangeTs...>(
+      std::forward<RangeTs>(Ranges)...);
+}
+
+
+
+
+
+
+
+struct less_first {
+  template <typename T> bool operator()(const T &lhs, const T &rhs) const {
+    return lhs.first < rhs.first;
+  }
+};
+
+
+
+struct less_second {
+  template <typename T> bool operator()(const T &lhs, const T &rhs) const {
+    return lhs.second < rhs.second;
+  }
+};
+
+
+
+
+template <class T, T... I> struct integer_sequence {
+  using value_type = T;
+
+  static constexpr size_t size() { return sizeof...(I); }
+};
+
+
+template <size_t... I>
+struct index_sequence : integer_sequence<std::size_t, I...> {};
+
+template <std::size_t N, std::size_t... I>
+struct build_index_impl : build_index_impl<N - 1, N - 1, I...> {};
+template <std::size_t... I>
+struct build_index_impl<0, I...> : index_sequence<I...> {};
+
+
+template <class... Ts>
+struct index_sequence_for : build_index_impl<sizeof...(Ts)> {};
+
+
+
+template <int N> struct rank : rank<N - 1> {};
+template <> struct rank<0> {};
+
+
+
+template <typename T, typename... Ts> struct is_one_of {
+  static const bool value = false;
+};
+
+template <typename T, typename U, typename... Ts>
+struct is_one_of<T, U, Ts...> {
+  static const bool value =
+      std::is_same<T, U>::value || is_one_of<T, Ts...>::value;
+};
+
+
+
+template <typename T, typename... Ts> struct are_base_of {
+  static const bool value = true;
+};
+
+template <typename T, typename U, typename... Ts>
+struct are_base_of<T, U, Ts...> {
+  static const bool value =
+      std::is_base_of<T, U>::value && are_base_of<T, Ts...>::value;
+};
+
+
+
+
+
+
+template <class T, std::size_t N>
+constexpr inline size_t array_lengthof(T (&)[N]) {
+  return N;
+}
+
+
+template<typename T>
+inline int array_pod_sort_comparator(const void *P1, const void *P2) {
+  if (std::less<T>()(*reinterpret_cast<const T*>(P1),
+                     *reinterpret_cast<const T*>(P2)))
+    return -1;
+  if (std::less<T>()(*reinterpret_cast<const T*>(P2),
+                     *reinterpret_cast<const T*>(P1)))
+    return 1;
+  return 0;
+}
+
+
+
+template<typename T>
+inline int (*get_array_pod_sort_comparator(const T &))
+             (const void*, const void*) {
+  return array_pod_sort_comparator<T>;
+}
+template<class IteratorTy>
+inline void array_pod_sort(IteratorTy Start, IteratorTy End) {
+
+
+  auto NElts = End - Start;
+  if (NElts <= 1) return;
+  qsort(&*Start, NElts, sizeof(*Start), get_array_pod_sort_comparator(*Start));
+}
+
+template <class IteratorTy>
+inline void array_pod_sort(
+    IteratorTy Start, IteratorTy End,
+    int (*Compare)(
+        const typename std::iterator_traits<IteratorTy>::value_type *,
+        const typename std::iterator_traits<IteratorTy>::value_type *)) {
+
+
+  auto NElts = End - Start;
+  if (NElts <= 1) return;
+  qsort(&*Start, NElts, sizeof(*Start),
+        reinterpret_cast<int (*)(const void *, const void *)>(Compare));
+}
+
+
+
+
+
+
+
+template<typename Container>
+void DeleteContainerPointers(Container &C) {
+  for (auto V : C)
+    delete V;
+  C.clear();
+}
+
+
+
+template<typename Container>
+void DeleteContainerSeconds(Container &C) {
+  for (auto &V : C)
+    delete V.second;
+  C.clear();
+}
+
+
+
+template <typename R, typename UnaryPredicate>
+UnaryPredicate for_each(R &&Range, UnaryPredicate P) {
+  return std::for_each(adl_begin(Range), adl_end(Range), P);
+}
+
+
+
+template <typename R, typename UnaryPredicate>
+bool all_of(R &&Range, UnaryPredicate P) {
+  return std::all_of(adl_begin(Range), adl_end(Range), P);
+}
+
+
+
+template <typename R, typename UnaryPredicate>
+bool any_of(R &&Range, UnaryPredicate P) {
+  return std::any_of(adl_begin(Range), adl_end(Range), P);
+}
+
+
+
+template <typename R, typename UnaryPredicate>
+bool none_of(R &&Range, UnaryPredicate P) {
+  return std::none_of(adl_begin(Range), adl_end(Range), P);
+}
+
+
+
+template <typename R, typename T>
+auto find(R &&Range, const T &Val) -> decltype(adl_begin(Range)) {
+  return std::find(adl_begin(Range), adl_end(Range), Val);
+}
+
+
+
+template <typename R, typename UnaryPredicate>
+auto find_if(R &&Range, UnaryPredicate P) -> decltype(adl_begin(Range)) {
+  return std::find_if(adl_begin(Range), adl_end(Range), P);
+}
+
+template <typename R, typename UnaryPredicate>
+auto find_if_not(R &&Range, UnaryPredicate P) -> decltype(adl_begin(Range)) {
+  return std::find_if_not(adl_begin(Range), adl_end(Range), P);
+}
+
+
+
+template <typename R, typename UnaryPredicate>
+auto remove_if(R &&Range, UnaryPredicate P) -> decltype(adl_begin(Range)) {
+  return std::remove_if(adl_begin(Range), adl_end(Range), P);
+}
+
+
+
+template <typename R, typename OutputIt, typename UnaryPredicate>
+OutputIt copy_if(R &&Range, OutputIt Out, UnaryPredicate P) {
+  return std::copy_if(adl_begin(Range), adl_end(Range), Out, P);
+}
+
+template <typename R, typename OutputIt>
+OutputIt copy(R &&Range, OutputIt Out) {
+  return std::copy(adl_begin(Range), adl_end(Range), Out);
+}
+
+
+
+template <typename R, typename E>
+bool is_contained(R &&Range, const E &Element) {
+  return std::find(adl_begin(Range), adl_end(Range), Element) != adl_end(Range);
+}
+
+
+
+template <typename R, typename E>
+auto count(R &&Range, const E &Element) ->
+    typename std::iterator_traits<decltype(adl_begin(Range))>::difference_type {
+  return std::count(adl_begin(Range), adl_end(Range), Element);
+}
+
+
+
+template <typename R, typename UnaryPredicate>
+auto count_if(R &&Range, UnaryPredicate P) ->
+    typename std::iterator_traits<decltype(adl_begin(Range))>::difference_type {
+  return std::count_if(adl_begin(Range), adl_end(Range), P);
+}
+
+
+
+template <typename R, typename OutputIt, typename UnaryPredicate>
+OutputIt transform(R &&Range, OutputIt d_first, UnaryPredicate P) {
+  return std::transform(adl_begin(Range), adl_end(Range), d_first, P);
+}
+
+
+
+template <typename R, typename UnaryPredicate>
+auto partition(R &&Range, UnaryPredicate P) -> decltype(adl_begin(Range)) {
+  return std::partition(adl_begin(Range), adl_end(Range), P);
+}
+
+
+
+template <typename R, typename ForwardIt>
+auto lower_bound(R &&Range, ForwardIt I) -> decltype(adl_begin(Range)) {
+  return std::lower_bound(adl_begin(Range), adl_end(Range), I);
+}
+
+
+
+
+template <unsigned Size, typename R>
+SmallVector<typename std::remove_const<detail::ValueOfRange<R>>::type, Size>
+to_vector(R &&Range) {
+  return {adl_begin(Range), adl_end(Range)};
+}
+template <typename Container, typename UnaryPredicate>
+void erase_if(Container &C, UnaryPredicate P) {
+  C.erase(remove_if(C, P), C.end());
+}
+template <class T, class... Args>
+typename std::enable_if<!std::is_array<T>::value, std::unique_ptr<T>>::type
+make_unique(Args &&... args) {
+  return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
+}
+template <class T>
+typename std::enable_if<std::is_array<T>::value && std::extent<T>::value == 0,
+                        std::unique_ptr<T>>::type
+make_unique(size_t n) {
+  return std::unique_ptr<T>(new typename std::remove_extent<T>::type[n]());
+}
+
+
+template <class T, class... Args>
+typename std::enable_if<std::extent<T>::value != 0>::type
+make_unique(Args &&...) = delete;
+
+struct FreeDeleter {
+  void operator()(void* v) {
+    ::free(v);
+  }
+};
+
+template<typename First, typename Second>
+struct pair_hash {
+  size_t operator()(const std::pair<First, Second> &P) const {
+    return std::hash<First>()(P.first) * 31 + std::hash<Second>()(P.second);
+  }
+};
+
+
+struct less {
+  template <typename A, typename B> bool operator()(A &&a, B &&b) const {
+    return std::forward<A>(a) < std::forward<B>(b);
+  }
+};
+
+
+struct equal {
+  template <typename A, typename B> bool operator()(A &&a, B &&b) const {
+    return std::forward<A>(a) == std::forward<B>(b);
+  }
+};
+
+
+
+template <typename T> struct deref {
+  T func;
+
+
+
+
+  template <typename A, typename B>
+  auto operator()(A &lhs, B &rhs) const -> decltype(func(*lhs, *rhs)) {
+    
+   ((
+   lhs
+   ) ? static_cast<void> (0) : __assert_fail (
+   "lhs"
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/STLExtras.h", 1010, __PRETTY_FUNCTION__))
+              ;
+    
+   ((
+   rhs
+   ) ? static_cast<void> (0) : __assert_fail (
+   "rhs"
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/STLExtras.h", 1011, __PRETTY_FUNCTION__))
+              ;
+    return func(*lhs, *rhs);
+  }
+};
+
+namespace detail {
+
+template <typename R> class enumerator_iter;
+
+template <typename R> struct result_pair {
+  friend class enumerator_iter<R>;
+
+  result_pair() = default;
+  result_pair(std::size_t Index, IterOfRange<R> Iter)
+      : Index(Index), Iter(Iter) {}
+
+  result_pair<R> &operator=(const result_pair<R> &Other) {
+    Index = Other.Index;
+    Iter = Other.Iter;
+    return *this;
+  }
+
+  std::size_t index() const { return Index; }
+  const ValueOfRange<R> &value() const { return *Iter; }
+  ValueOfRange<R> &value() { return *Iter; }
+
+private:
+  std::size_t Index = std::numeric_limits<std::size_t>::max();
+  IterOfRange<R> Iter;
+};
+
+template <typename R>
+class enumerator_iter
+    : public iterator_facade_base<
+          enumerator_iter<R>, std::forward_iterator_tag, result_pair<R>,
+          typename std::iterator_traits<IterOfRange<R>>::difference_type,
+          typename std::iterator_traits<IterOfRange<R>>::pointer,
+          typename std::iterator_traits<IterOfRange<R>>::reference> {
+  using result_type = result_pair<R>;
+
+public:
+  explicit enumerator_iter(IterOfRange<R> EndIter)
+      : Result(std::numeric_limits<size_t>::max(), EndIter) {}
+
+  enumerator_iter(std::size_t Index, IterOfRange<R> Iter)
+      : Result(Index, Iter) {}
+
+  result_type &operator*() { return Result; }
+  const result_type &operator*() const { return Result; }
+
+  enumerator_iter<R> &operator++() {
+    
+   ((
+   Result.Index != std::numeric_limits<size_t>::max()
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Result.Index != std::numeric_limits<size_t>::max()"
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/STLExtras.h", 1062, __PRETTY_FUNCTION__))
+                                                             ;
+    ++Result.Iter;
+    ++Result.Index;
+    return *this;
+  }
+
+  bool operator==(const enumerator_iter<R> &RHS) const {
+
+
+
+    return Result.Iter == RHS.Result.Iter;
+  }
+
+  enumerator_iter<R> &operator=(const enumerator_iter<R> &Other) {
+    Result = Other.Result;
+    return *this;
+  }
+
+private:
+  result_type Result;
+};
+
+template <typename R> class enumerator {
+public:
+  explicit enumerator(R &&Range) : TheRange(std::forward<R>(Range)) {}
+
+  enumerator_iter<R> begin() {
+    return enumerator_iter<R>(0, std::begin(TheRange));
+  }
+
+  enumerator_iter<R> end() {
+    return enumerator_iter<R>(std::end(TheRange));
+  }
+
+private:
+  R TheRange;
+};
+
+}
+template <typename R> detail::enumerator<R> enumerate(R &&TheRange) {
+  return detail::enumerator<R>(std::forward<R>(TheRange));
+}
+
+namespace detail {
+
+template <typename F, typename Tuple, std::size_t... I>
+auto apply_tuple_impl(F &&f, Tuple &&t, index_sequence<I...>)
+    -> decltype(std::forward<F>(f)(std::get<I>(std::forward<Tuple>(t))...)) {
+  return std::forward<F>(f)(std::get<I>(std::forward<Tuple>(t))...);
+}
+
+}
+
+
+
+
+template <typename F, typename Tuple>
+auto apply_tuple(F &&f, Tuple &&t) -> decltype(detail::apply_tuple_impl(
+    std::forward<F>(f), std::forward<Tuple>(t),
+    build_index_impl<
+        std::tuple_size<typename std::decay<Tuple>::type>::value>{})) {
+  using Indices = build_index_impl<
+      std::tuple_size<typename std::decay<Tuple>::type>::value>;
+
+  return detail::apply_tuple_impl(std::forward<F>(f), std::forward<Tuple>(t),
+                                  Indices{});
+}
+
+}
+
+
+
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+       
+
+
+
+
+
+
+namespace llvm {
+
+  class APInt;
+  class hash_code;
+  template <typename T> class SmallVectorImpl;
+  class StringRef;
+
+
+  bool getAsUnsignedInteger(StringRef Str, unsigned Radix,
+                            unsigned long long &Result);
+
+  bool getAsSignedInteger(StringRef Str, unsigned Radix, long long &Result);
+
+  bool consumeUnsignedInteger(StringRef &Str, unsigned Radix,
+                              unsigned long long &Result);
+  bool consumeSignedInteger(StringRef &Str, unsigned Radix, long long &Result);
+  class StringRef {
+  public:
+    static const size_t npos = ~size_t(0);
+
+    using iterator = const char *;
+    using const_iterator = const char *;
+    using size_type = size_t;
+
+  private:
+
+    const char *Data = nullptr;
+
+
+    size_t Length = 0;
+
+
+
+    __attribute__((always_inline))
+    static int compareMemory(const char *Lhs, const char *Rhs, size_t Length) {
+      if (Length == 0) { return 0; }
+      return ::memcmp(Lhs,Rhs,Length);
+    }
+
+  public:
+
+
+
+
+                 StringRef() = default;
+
+
+
+    StringRef(std::nullptr_t) = delete;
+
+
+    __attribute__((always_inline))
+                 StringRef(const char *Str)
+        : Data(Str), Length(Str ? ::strlen(Str) : 0) {}
+
+
+    __attribute__((always_inline))
+                 constexpr StringRef(const char *data, size_t length)
+        : Data(data), Length(length) {}
+
+
+    __attribute__((always_inline))
+                 StringRef(const std::string &Str)
+      : Data(Str.data()), Length(Str.length()) {}
+
+    static StringRef withNullAsEmpty(const char *data) {
+      return StringRef(data ? data : "");
+    }
+
+
+
+
+
+    iterator begin() const { return Data; }
+
+    iterator end() const { return Data + Length; }
+
+    const unsigned char *bytes_begin() const {
+      return reinterpret_cast<const unsigned char *>(begin());
+    }
+    const unsigned char *bytes_end() const {
+      return reinterpret_cast<const unsigned char *>(end());
+    }
+    iterator_range<const unsigned char *> bytes() const {
+      return make_range(bytes_begin(), bytes_end());
+    }
+
+
+
+
+
+
+
+   
+    __attribute__((always_inline))
+    const char *data() const { return Data; }
+
+
+   
+    __attribute__((always_inline))
+    bool empty() const { return Length == 0; }
+
+
+   
+    __attribute__((always_inline))
+    size_t size() const { return Length; }
+
+
+   
+    char front() const {
+      
+     ((
+     !empty()
+     ) ? static_cast<void> (0) : __assert_fail (
+     "!empty()"
+     , "/home/trippels/llvm/llvm/include/llvm/ADT/StringRef.h", 143, __PRETTY_FUNCTION__))
+                     ;
+      return Data[0];
+    }
+
+
+   
+    char back() const {
+      
+     ((
+     !empty()
+     ) ? static_cast<void> (0) : __assert_fail (
+     "!empty()"
+     , "/home/trippels/llvm/llvm/include/llvm/ADT/StringRef.h", 150, __PRETTY_FUNCTION__))
+                     ;
+      return Data[Length-1];
+    }
+
+
+    template <typename Allocator>
+    StringRef copy(Allocator &A) const {
+
+      if (empty())
+        return StringRef();
+      char *S = A.template Allocate<char>(Length);
+      std::copy(begin(), end(), S);
+      return StringRef(S, Length);
+    }
+
+
+
+   
+    __attribute__((always_inline))
+    bool equals(StringRef RHS) const {
+      return (Length == RHS.Length &&
+              compareMemory(Data, RHS.Data, RHS.Length) == 0);
+    }
+
+
+   
+    bool equals_lower(StringRef RHS) const {
+      return Length == RHS.Length && compare_lower(RHS) == 0;
+    }
+
+
+
+   
+    __attribute__((always_inline))
+    int compare(StringRef RHS) const {
+
+      if (int Res = compareMemory(Data, RHS.Data, std::min(Length, RHS.Length)))
+        return Res < 0 ? -1 : 1;
+
+
+      if (Length == RHS.Length)
+        return 0;
+      return Length < RHS.Length ? -1 : 1;
+    }
+
+
+   
+    int compare_lower(StringRef RHS) const;
+
+
+
+   
+    int compare_numeric(StringRef RHS) const;
+   
+    unsigned edit_distance(StringRef Other, bool AllowReplacements = true,
+                           unsigned MaxEditDistance = 0) const;
+
+
+   
+    std::string str() const {
+      if (!Data) return std::string();
+      return std::string(Data, Length);
+    }
+
+
+
+
+
+   
+    char operator[](size_t Index) const {
+      
+     ((
+     Index < Length && "Invalid index!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "Index < Length && \"Invalid index!\""
+     , "/home/trippels/llvm/llvm/include/llvm/ADT/StringRef.h", 239, __PRETTY_FUNCTION__))
+                                               ;
+      return Data[Index];
+    }
+
+
+
+
+
+    template <typename T>
+    typename std::enable_if<std::is_same<T, std::string>::value,
+                            StringRef>::type &
+    operator=(T &&Str) = delete;
+
+
+
+
+
+    operator std::string() const {
+      return str();
+    }
+
+
+
+
+
+
+   
+    __attribute__((always_inline))
+    bool startswith(StringRef Prefix) const {
+      return Length >= Prefix.Length &&
+             compareMemory(Data, Prefix.Data, Prefix.Length) == 0;
+    }
+
+
+   
+    bool startswith_lower(StringRef Prefix) const;
+
+
+   
+    __attribute__((always_inline))
+    bool endswith(StringRef Suffix) const {
+      return Length >= Suffix.Length &&
+        compareMemory(end() - Suffix.Length, Suffix.Data, Suffix.Length) == 0;
+    }
+
+
+   
+    bool endswith_lower(StringRef Suffix) const;
+   
+    __attribute__((always_inline))
+    size_t find(char C, size_t From = 0) const {
+      size_t FindBegin = std::min(From, Length);
+      if (FindBegin < Length) {
+
+        if (const void *P = ::memchr(Data + FindBegin, C, Length - FindBegin))
+          return static_cast<const char *>(P) - Data;
+      }
+      return npos;
+    }
+
+
+
+
+
+   
+    size_t find_lower(char C, size_t From = 0) const;
+
+
+
+
+
+   
+    __attribute__((always_inline))
+    size_t find_if(function_ref<bool(char)> F, size_t From = 0) const {
+      StringRef S = drop_front(From);
+      while (!S.empty()) {
+        if (F(S.front()))
+          return size() - S.size();
+        S = S.drop_front();
+      }
+      return npos;
+    }
+
+
+
+
+
+   
+    __attribute__((always_inline))
+    size_t find_if_not(function_ref<bool(char)> F, size_t From = 0) const {
+      return find_if([F](char c) { return !F(c); }, From);
+    }
+
+
+
+
+
+   
+    size_t find(StringRef Str, size_t From = 0) const;
+
+
+
+
+
+   
+    size_t find_lower(StringRef Str, size_t From = 0) const;
+
+
+
+
+
+   
+    size_t rfind(char C, size_t From = npos) const {
+      From = std::min(From, Length);
+      size_t i = From;
+      while (i != 0) {
+        --i;
+        if (Data[i] == C)
+          return i;
+      }
+      return npos;
+    }
+
+
+
+
+
+   
+    size_t rfind_lower(char C, size_t From = npos) const;
+
+
+
+
+
+   
+    size_t rfind(StringRef Str) const;
+
+
+
+
+
+   
+    size_t rfind_lower(StringRef Str) const;
+
+
+
+   
+    size_t find_first_of(char C, size_t From = 0) const {
+      return find(C, From);
+    }
+
+
+
+
+
+   
+    size_t find_first_of(StringRef Chars, size_t From = 0) const;
+
+
+
+   
+    size_t find_first_not_of(char C, size_t From = 0) const;
+
+
+
+
+
+   
+    size_t find_first_not_of(StringRef Chars, size_t From = 0) const;
+
+
+
+   
+    size_t find_last_of(char C, size_t From = npos) const {
+      return rfind(C, From);
+    }
+
+
+
+
+
+   
+    size_t find_last_of(StringRef Chars, size_t From = npos) const;
+
+
+
+   
+    size_t find_last_not_of(char C, size_t From = npos) const;
+
+
+
+
+
+   
+    size_t find_last_not_of(StringRef Chars, size_t From = npos) const;
+
+
+
+   
+    __attribute__((always_inline))
+    bool contains(StringRef Other) const { return find(Other) != npos; }
+
+
+
+   
+    __attribute__((always_inline))
+    bool contains(char C) const { return find_first_of(C) != npos; }
+
+
+
+   
+    __attribute__((always_inline))
+    bool contains_lower(StringRef Other) const {
+      return find_lower(Other) != npos;
+    }
+
+
+
+   
+    __attribute__((always_inline))
+    bool contains_lower(char C) const { return find_lower(C) != npos; }
+
+
+
+
+
+
+   
+    size_t count(char C) const {
+      size_t Count = 0;
+      for (size_t i = 0, e = Length; i != e; ++i)
+        if (Data[i] == C)
+          ++Count;
+      return Count;
+    }
+
+
+
+    size_t count(StringRef Str) const;
+    template <typename T>
+    typename std::enable_if<std::numeric_limits<T>::is_signed, bool>::type
+    getAsInteger(unsigned Radix, T &Result) const {
+      long long LLVal;
+      if (getAsSignedInteger(*this, Radix, LLVal) ||
+            static_cast<T>(LLVal) != LLVal)
+        return true;
+      Result = LLVal;
+      return false;
+    }
+
+    template <typename T>
+    typename std::enable_if<!std::numeric_limits<T>::is_signed, bool>::type
+    getAsInteger(unsigned Radix, T &Result) const {
+      unsigned long long ULLVal;
+
+
+
+      if (getAsUnsignedInteger(*this, Radix, ULLVal) ||
+          static_cast<unsigned long long>(static_cast<T>(ULLVal)) != ULLVal)
+        return true;
+      Result = ULLVal;
+      return false;
+    }
+    template <typename T>
+    typename std::enable_if<std::numeric_limits<T>::is_signed, bool>::type
+    consumeInteger(unsigned Radix, T &Result) {
+      long long LLVal;
+      if (consumeSignedInteger(*this, Radix, LLVal) ||
+          static_cast<long long>(static_cast<T>(LLVal)) != LLVal)
+        return true;
+      Result = LLVal;
+      return false;
+    }
+
+    template <typename T>
+    typename std::enable_if<!std::numeric_limits<T>::is_signed, bool>::type
+    consumeInteger(unsigned Radix, T &Result) {
+      unsigned long long ULLVal;
+      if (consumeUnsignedInteger(*this, Radix, ULLVal) ||
+          static_cast<unsigned long long>(static_cast<T>(ULLVal)) != ULLVal)
+        return true;
+      Result = ULLVal;
+      return false;
+    }
+    bool getAsInteger(unsigned Radix, APInt &Result) const;
+
+
+
+
+
+
+
+    bool getAsDouble(double &Result, bool AllowInexact = true) const;
+
+
+
+
+
+
+   
+    std::string lower() const;
+
+
+   
+    std::string upper() const;
+   
+    __attribute__((always_inline))
+    StringRef substr(size_t Start, size_t N = npos) const {
+      Start = std::min(Start, Length);
+      return StringRef(Data + Start, std::min(N, Length - Start));
+    }
+
+
+
+
+   
+    __attribute__((always_inline))
+    StringRef take_front(size_t N = 1) const {
+      if (N >= size())
+        return *this;
+      return drop_back(size() - N);
+    }
+
+
+
+
+   
+    __attribute__((always_inline))
+    StringRef take_back(size_t N = 1) const {
+      if (N >= size())
+        return *this;
+      return drop_front(size() - N);
+    }
+
+
+
+   
+    __attribute__((always_inline))
+    StringRef take_while(function_ref<bool(char)> F) const {
+      return substr(0, find_if_not(F));
+    }
+
+
+
+   
+    __attribute__((always_inline))
+    StringRef take_until(function_ref<bool(char)> F) const {
+      return substr(0, find_if(F));
+    }
+
+
+
+   
+    __attribute__((always_inline))
+    StringRef drop_front(size_t N = 1) const {
+      
+     ((
+     size() >= N && "Dropping more elements than exist"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "size() >= N && \"Dropping more elements than exist\""
+     , "/home/trippels/llvm/llvm/include/llvm/ADT/StringRef.h", 646, __PRETTY_FUNCTION__))
+                                                               ;
+      return substr(N);
+    }
+
+
+
+   
+    __attribute__((always_inline))
+    StringRef drop_back(size_t N = 1) const {
+      
+     ((
+     size() >= N && "Dropping more elements than exist"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "size() >= N && \"Dropping more elements than exist\""
+     , "/home/trippels/llvm/llvm/include/llvm/ADT/StringRef.h", 655, __PRETTY_FUNCTION__))
+                                                               ;
+      return substr(0, size()-N);
+    }
+
+
+
+   
+    __attribute__((always_inline))
+    StringRef drop_while(function_ref<bool(char)> F) const {
+      return substr(find_if_not(F));
+    }
+
+
+
+   
+    __attribute__((always_inline))
+    StringRef drop_until(function_ref<bool(char)> F) const {
+      return substr(find_if(F));
+    }
+
+
+
+    __attribute__((always_inline))
+    bool consume_front(StringRef Prefix) {
+      if (!startswith(Prefix))
+        return false;
+
+      *this = drop_front(Prefix.size());
+      return true;
+    }
+
+
+
+    __attribute__((always_inline))
+    bool consume_back(StringRef Suffix) {
+      if (!endswith(Suffix))
+        return false;
+
+      *this = drop_back(Suffix.size());
+      return true;
+    }
+   
+    __attribute__((always_inline))
+    StringRef slice(size_t Start, size_t End) const {
+      Start = std::min(Start, Length);
+      End = std::min(std::max(Start, End), Length);
+      return StringRef(Data + Start, End - Start);
+    }
+   
+    std::pair<StringRef, StringRef> split(char Separator) const {
+      size_t Idx = find(Separator);
+      if (Idx == npos)
+        return std::make_pair(*this, StringRef());
+      return std::make_pair(slice(0, Idx), slice(Idx+1, npos));
+    }
+   
+    std::pair<StringRef, StringRef> split(StringRef Separator) const {
+      size_t Idx = find(Separator);
+      if (Idx == npos)
+        return std::make_pair(*this, StringRef());
+      return std::make_pair(slice(0, Idx), slice(Idx + Separator.size(), npos));
+    }
+    void split(SmallVectorImpl<StringRef> &A,
+               StringRef Separator, int MaxSplit = -1,
+               bool KeepEmpty = true) const;
+    void split(SmallVectorImpl<StringRef> &A, char Separator, int MaxSplit = -1,
+               bool KeepEmpty = true) const;
+   
+    std::pair<StringRef, StringRef> rsplit(char Separator) const {
+      size_t Idx = rfind(Separator);
+      if (Idx == npos)
+        return std::make_pair(*this, StringRef());
+      return std::make_pair(slice(0, Idx), slice(Idx+1, npos));
+    }
+
+
+
+   
+    StringRef ltrim(char Char) const {
+      return drop_front(std::min(Length, find_first_not_of(Char)));
+    }
+
+
+
+   
+    StringRef ltrim(StringRef Chars = " \t\n\v\f\r") const {
+      return drop_front(std::min(Length, find_first_not_of(Chars)));
+    }
+
+
+
+   
+    StringRef rtrim(char Char) const {
+      return drop_back(Length - std::min(Length, find_last_not_of(Char) + 1));
+    }
+
+
+
+   
+    StringRef rtrim(StringRef Chars = " \t\n\v\f\r") const {
+      return drop_back(Length - std::min(Length, find_last_not_of(Chars) + 1));
+    }
+
+
+
+   
+    StringRef trim(char Char) const {
+      return ltrim(Char).rtrim(Char);
+    }
+
+
+
+   
+    StringRef trim(StringRef Chars = " \t\n\v\f\r") const {
+      return ltrim(Chars).rtrim(Chars);
+    }
+
+
+  };
+  class StringLiteral : public StringRef {
+  public:
+    template <size_t N>
+    constexpr StringLiteral(const char (&Str)[N])
+
+
+
+
+
+
+
+        : StringRef(Str, N - 1) {
+    }
+  };
+
+
+
+
+  __attribute__((always_inline))
+  inline bool operator==(StringRef LHS, StringRef RHS) {
+    return LHS.equals(RHS);
+  }
+
+  __attribute__((always_inline))
+  inline bool operator!=(StringRef LHS, StringRef RHS) { return !(LHS == RHS); }
+
+  inline bool operator<(StringRef LHS, StringRef RHS) {
+    return LHS.compare(RHS) == -1;
+  }
+
+  inline bool operator<=(StringRef LHS, StringRef RHS) {
+    return LHS.compare(RHS) != 1;
+  }
+
+  inline bool operator>(StringRef LHS, StringRef RHS) {
+    return LHS.compare(RHS) == 1;
+  }
+
+  inline bool operator>=(StringRef LHS, StringRef RHS) {
+    return LHS.compare(RHS) != -1;
+  }
+
+  inline std::string &operator+=(std::string &buffer, StringRef string) {
+    return buffer.append(string.data(), string.size());
+  }
+
+
+
+
+ 
+  hash_code hash_value(StringRef S);
+
+
+  template <typename T> struct isPodLike;
+  template <> struct isPodLike<StringRef> { static const bool value = true; };
+
+}
+
+
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+       
+
+
+
+
+
+namespace llvm {
+
+
+
+
+
+
+
+template <typename DerivedT> class AllocatorBase {
+public:
+
+
+  void *Allocate(size_t Size, size_t Alignment) {
+    return static_cast<DerivedT *>(this)->Allocate(Size, Alignment);
+  }
+
+
+
+  void Deallocate(const void *Ptr, size_t Size) {
+    return static_cast<DerivedT *>(this)->Deallocate(Ptr, Size);
+  }
+
+
+
+
+
+  template <typename T> T *Allocate(size_t Num = 1) {
+    return static_cast<T *>(Allocate(Num * sizeof(T), alignof(T)));
+  }
+
+
+  template <typename T>
+  typename std::enable_if<
+      !std::is_same<typename std::remove_cv<T>::type, void>::value, void>::type
+  Deallocate(T *Ptr, size_t Num = 1) {
+    Deallocate(static_cast<const void *>(Ptr), Num * sizeof(T));
+  }
+};
+
+class MallocAllocator : public AllocatorBase<MallocAllocator> {
+public:
+  void Reset() {}
+
+  __attribute__((returns_nonnull)) void *Allocate(size_t Size,
+                                                size_t ) {
+    return malloc(Size);
+  }
+
+
+  using AllocatorBase<MallocAllocator>::Allocate;
+
+  void Deallocate(const void *Ptr, size_t ) {
+    free(const_cast<void *>(Ptr));
+  }
+
+
+  using AllocatorBase<MallocAllocator>::Deallocate;
+
+  void PrintStats() const {}
+};
+
+namespace detail {
+
+
+
+void printBumpPtrAllocatorStats(unsigned NumSlabs, size_t BytesAllocated,
+                                size_t TotalMemory);
+
+}
+template <typename AllocatorT = MallocAllocator, size_t SlabSize = 4096,
+          size_t SizeThreshold = SlabSize>
+class BumpPtrAllocatorImpl
+    : public AllocatorBase<
+          BumpPtrAllocatorImpl<AllocatorT, SlabSize, SizeThreshold>> {
+public:
+  static_assert(SizeThreshold <= SlabSize,
+                "The SizeThreshold must be at most the SlabSize to ensure "
+                "that objects larger than a slab go into their own memory "
+                "allocation.");
+
+  BumpPtrAllocatorImpl() = default;
+
+  template <typename T>
+  BumpPtrAllocatorImpl(T &&Allocator)
+      : Allocator(std::forward<T &&>(Allocator)) {}
+
+
+
+  BumpPtrAllocatorImpl(BumpPtrAllocatorImpl &&Old)
+      : CurPtr(Old.CurPtr), End(Old.End), Slabs(std::move(Old.Slabs)),
+        CustomSizedSlabs(std::move(Old.CustomSizedSlabs)),
+        BytesAllocated(Old.BytesAllocated), RedZoneSize(Old.RedZoneSize),
+        Allocator(std::move(Old.Allocator)) {
+    Old.CurPtr = Old.End = nullptr;
+    Old.BytesAllocated = 0;
+    Old.Slabs.clear();
+    Old.CustomSizedSlabs.clear();
+  }
+
+  ~BumpPtrAllocatorImpl() {
+    DeallocateSlabs(Slabs.begin(), Slabs.end());
+    DeallocateCustomSizedSlabs();
+  }
+
+  BumpPtrAllocatorImpl &operator=(BumpPtrAllocatorImpl &&RHS) {
+    DeallocateSlabs(Slabs.begin(), Slabs.end());
+    DeallocateCustomSizedSlabs();
+
+    CurPtr = RHS.CurPtr;
+    End = RHS.End;
+    BytesAllocated = RHS.BytesAllocated;
+    RedZoneSize = RHS.RedZoneSize;
+    Slabs = std::move(RHS.Slabs);
+    CustomSizedSlabs = std::move(RHS.CustomSizedSlabs);
+    Allocator = std::move(RHS.Allocator);
+
+    RHS.CurPtr = RHS.End = nullptr;
+    RHS.BytesAllocated = 0;
+    RHS.Slabs.clear();
+    RHS.CustomSizedSlabs.clear();
+    return *this;
+  }
+
+
+
+  void Reset() {
+
+    DeallocateCustomSizedSlabs();
+    CustomSizedSlabs.clear();
+
+    if (Slabs.empty())
+      return;
+
+
+    BytesAllocated = 0;
+    CurPtr = (char *)Slabs.front();
+    End = CurPtr + SlabSize;
+
+    ;
+    DeallocateSlabs(std::next(Slabs.begin()), Slabs.end());
+    Slabs.erase(std::next(Slabs.begin()), Slabs.end());
+  }
+
+
+  __attribute__((returns_nonnull)) __attribute__((__malloc__)) void *
+  Allocate(size_t Size, size_t Alignment) {
+    
+   ((
+   Alignment > 0 && "0-byte alignnment is not allowed. Use 1 instead."
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Alignment > 0 && \"0-byte alignnment is not allowed. Use 1 instead.\""
+   , "/home/trippels/llvm/llvm/include/llvm/Support/Allocator.h", 213, __PRETTY_FUNCTION__))
+                                                                              ;
+
+
+    BytesAllocated += Size;
+
+    size_t Adjustment = alignmentAdjustment(CurPtr, Alignment);
+    
+   ((
+   Adjustment + Size >= Size && "Adjustment + Size must not overflow"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Adjustment + Size >= Size && \"Adjustment + Size must not overflow\""
+   , "/home/trippels/llvm/llvm/include/llvm/Support/Allocator.h", 219, __PRETTY_FUNCTION__))
+                                                                             ;
+
+    size_t SizeToAllocate = Size;
+
+
+
+
+
+
+    if (Adjustment + SizeToAllocate <= size_t(End - CurPtr)) {
+      char *AlignedPtr = CurPtr + Adjustment;
+      CurPtr = AlignedPtr + SizeToAllocate;
+
+
+
+      ;
+
+      ;
+      return AlignedPtr;
+    }
+
+
+    size_t PaddedSize = SizeToAllocate + Alignment - 1;
+    if (PaddedSize > SizeThreshold) {
+      void *NewSlab = Allocator.Allocate(PaddedSize, 0);
+
+
+      ;
+      CustomSizedSlabs.push_back(std::make_pair(NewSlab, PaddedSize));
+
+      uintptr_t AlignedAddr = alignAddr(NewSlab, Alignment);
+      
+     ((
+     AlignedAddr + Size <= (uintptr_t)NewSlab + PaddedSize
+     ) ? static_cast<void> (0) : __assert_fail (
+     "AlignedAddr + Size <= (uintptr_t)NewSlab + PaddedSize"
+     , "/home/trippels/llvm/llvm/include/llvm/Support/Allocator.h", 250, __PRETTY_FUNCTION__))
+                                                                  ;
+      char *AlignedPtr = (char*)AlignedAddr;
+      ;
+      ;
+      return AlignedPtr;
+    }
+
+
+    StartNewSlab();
+    uintptr_t AlignedAddr = alignAddr(CurPtr, Alignment);
+    
+   ((
+   AlignedAddr + SizeToAllocate <= (uintptr_t)End && "Unable to allocate memory!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "AlignedAddr + SizeToAllocate <= (uintptr_t)End && \"Unable to allocate memory!\""
+   ,
+                                       "/home/trippels/llvm/llvm/include/llvm/Support/Allocator.h"
+    ,
+                                       261
+    , __PRETTY_FUNCTION__))
+                                        
+                                       ;
+    char *AlignedPtr = (char*)AlignedAddr;
+    CurPtr = AlignedPtr + SizeToAllocate;
+    ;
+    ;
+    return AlignedPtr;
+  }
+
+
+  using AllocatorBase<BumpPtrAllocatorImpl>::Allocate;
+
+
+
+
+  void Deallocate(const void *Ptr, size_t Size) {
+    ;
+  }
+
+
+  using AllocatorBase<BumpPtrAllocatorImpl>::Deallocate;
+
+  size_t GetNumSlabs() const { return Slabs.size() + CustomSizedSlabs.size(); }
+
+  size_t getTotalMemory() const {
+    size_t TotalMemory = 0;
+    for (auto I = Slabs.begin(), E = Slabs.end(); I != E; ++I)
+      TotalMemory += computeSlabSize(std::distance(Slabs.begin(), I));
+    for (auto &PtrAndSize : CustomSizedSlabs)
+      TotalMemory += PtrAndSize.second;
+    return TotalMemory;
+  }
+
+  size_t getBytesAllocated() const { return BytesAllocated; }
+
+  void setRedZoneSize(size_t NewSize) {
+    RedZoneSize = NewSize;
+  }
+
+  void PrintStats() const {
+    detail::printBumpPtrAllocatorStats(Slabs.size(), BytesAllocated,
+                                       getTotalMemory());
+  }
+
+private:
+
+
+
+  char *CurPtr = nullptr;
+
+
+  char *End = nullptr;
+
+
+  SmallVector<void *, 4> Slabs;
+
+
+  SmallVector<std::pair<void *, size_t>, 0> CustomSizedSlabs;
+
+
+
+
+  size_t BytesAllocated = 0;
+
+
+
+  size_t RedZoneSize = 1;
+
+
+  AllocatorT Allocator;
+
+  static size_t computeSlabSize(unsigned SlabIdx) {
+
+
+
+
+    return SlabSize * ((size_t)1 << std::min<size_t>(30, SlabIdx / 128));
+  }
+
+
+
+  void StartNewSlab() {
+    size_t AllocatedSlabSize = computeSlabSize(Slabs.size());
+
+    void *NewSlab = Allocator.Allocate(AllocatedSlabSize, 0);
+
+
+    ;
+
+    Slabs.push_back(NewSlab);
+    CurPtr = (char *)(NewSlab);
+    End = ((char *)NewSlab) + AllocatedSlabSize;
+  }
+
+
+  void DeallocateSlabs(SmallVectorImpl<void *>::iterator I,
+                       SmallVectorImpl<void *>::iterator E) {
+    for (; I != E; ++I) {
+      size_t AllocatedSlabSize =
+          computeSlabSize(std::distance(Slabs.begin(), I));
+      Allocator.Deallocate(*I, AllocatedSlabSize);
+    }
+  }
+
+
+  void DeallocateCustomSizedSlabs() {
+    for (auto &PtrAndSize : CustomSizedSlabs) {
+      void *Ptr = PtrAndSize.first;
+      size_t Size = PtrAndSize.second;
+      Allocator.Deallocate(Ptr, Size);
+    }
+  }
+
+  template <typename T> friend class SpecificBumpPtrAllocator;
+};
+
+
+
+typedef BumpPtrAllocatorImpl<> BumpPtrAllocator;
+
+
+
+
+
+
+template <typename T> class SpecificBumpPtrAllocator {
+  BumpPtrAllocator Allocator;
+
+public:
+  SpecificBumpPtrAllocator() {
+
+
+    Allocator.setRedZoneSize(0);
+  }
+  SpecificBumpPtrAllocator(SpecificBumpPtrAllocator &&Old)
+      : Allocator(std::move(Old.Allocator)) {}
+  ~SpecificBumpPtrAllocator() { DestroyAll(); }
+
+  SpecificBumpPtrAllocator &operator=(SpecificBumpPtrAllocator &&RHS) {
+    Allocator = std::move(RHS.Allocator);
+    return *this;
+  }
+
+
+
+
+  void DestroyAll() {
+    auto DestroyElements = [](char *Begin, char *End) {
+      
+     ((
+     Begin == (char *)alignAddr(Begin, alignof(T))
+     ) ? static_cast<void> (0) : __assert_fail (
+     "Begin == (char *)alignAddr(Begin, alignof(T))"
+     , "/home/trippels/llvm/llvm/include/llvm/Support/Allocator.h", 408, __PRETTY_FUNCTION__))
+                                                          ;
+      for (char *Ptr = Begin; Ptr + sizeof(T) <= End; Ptr += sizeof(T))
+        reinterpret_cast<T *>(Ptr)->~T();
+    };
+
+    for (auto I = Allocator.Slabs.begin(), E = Allocator.Slabs.end(); I != E;
+         ++I) {
+      size_t AllocatedSlabSize = BumpPtrAllocator::computeSlabSize(
+          std::distance(Allocator.Slabs.begin(), I));
+      char *Begin = (char *)alignAddr(*I, alignof(T));
+      char *End = *I == Allocator.Slabs.back() ? Allocator.CurPtr
+                                               : (char *)*I + AllocatedSlabSize;
+
+      DestroyElements(Begin, End);
+    }
+
+    for (auto &PtrAndSize : Allocator.CustomSizedSlabs) {
+      void *Ptr = PtrAndSize.first;
+      size_t Size = PtrAndSize.second;
+      DestroyElements((char *)alignAddr(Ptr, alignof(T)), (char *)Ptr + Size);
+    }
+
+    Allocator.Reset();
+  }
+
+
+  T *Allocate(size_t num = 1) { return Allocator.Allocate<T>(num); }
+};
+
+}
+
+template <typename AllocatorT, size_t SlabSize, size_t SizeThreshold>
+void *operator new(size_t Size,
+                   llvm::BumpPtrAllocatorImpl<AllocatorT, SlabSize,
+                                              SizeThreshold> &Allocator) {
+  struct S {
+    char c;
+    union {
+      double D;
+      long double LD;
+      long long L;
+      void *P;
+    } x;
+  };
+  return Allocator.Allocate(
+      Size, std::min((size_t)llvm::NextPowerOf2(Size), 
+                                                      __builtin_offsetof (
+                                                      S
+                                                      , 
+                                                      x
+                                                      )
+                                                                    ));
+}
+
+template <typename AllocatorT, size_t SlabSize, size_t SizeThreshold>
+void operator delete(
+    void *, llvm::BumpPtrAllocatorImpl<AllocatorT, SlabSize, SizeThreshold> &) {
+}
+namespace llvm {
+
+
+
+template <typename T> struct PointerLikeTypeTraits;
+
+namespace detail {
+
+template <size_t N>
+struct ConstantLog2
+    : std::integral_constant<size_t, ConstantLog2<N / 2>::value + 1> {};
+template <> struct ConstantLog2<1> : std::integral_constant<size_t, 0> {};
+
+
+template <typename T, typename U = void> struct HasPointerLikeTypeTraits {
+  static const bool value = false;
+};
+
+
+template <typename T> struct HasPointerLikeTypeTraits<
+  T, decltype((sizeof(PointerLikeTypeTraits<T>) + sizeof(T)), void())> {
+  static const bool value = true;
+};
+
+template <typename T> struct IsPointerLike {
+  static const bool value = HasPointerLikeTypeTraits<T>::value;
+};
+
+template <typename T> struct IsPointerLike<T *> {
+  static const bool value = true;
+};
+}
+
+
+template <typename T> struct PointerLikeTypeTraits<T *> {
+  static inline void *getAsVoidPointer(T *P) { return P; }
+  static inline T *getFromVoidPointer(void *P) { return static_cast<T *>(P); }
+
+  enum { NumLowBitsAvailable = detail::ConstantLog2<alignof(T)>::value };
+};
+
+template <> struct PointerLikeTypeTraits<void *> {
+  static inline void *getAsVoidPointer(void *P) { return P; }
+  static inline void *getFromVoidPointer(void *P) { return P; }
+  enum { NumLowBitsAvailable = 2 };
+};
+
+
+template <typename T> struct PointerLikeTypeTraits<const T> {
+  typedef PointerLikeTypeTraits<T> NonConst;
+
+  static inline const void *getAsVoidPointer(const T P) {
+    return NonConst::getAsVoidPointer(P);
+  }
+  static inline const T getFromVoidPointer(const void *P) {
+    return NonConst::getFromVoidPointer(const_cast<void *>(P));
+  }
+  enum { NumLowBitsAvailable = NonConst::NumLowBitsAvailable };
+};
+
+
+template <typename T> struct PointerLikeTypeTraits<const T *> {
+  typedef PointerLikeTypeTraits<T *> NonConst;
+
+  static inline const void *getAsVoidPointer(const T *P) {
+    return NonConst::getAsVoidPointer(const_cast<T *>(P));
+  }
+  static inline const T *getFromVoidPointer(const void *P) {
+    return NonConst::getFromVoidPointer(const_cast<void *>(P));
+  }
+  enum { NumLowBitsAvailable = NonConst::NumLowBitsAvailable };
+};
+
+
+template <> struct PointerLikeTypeTraits<uintptr_t> {
+  static inline void *getAsVoidPointer(uintptr_t P) {
+    return reinterpret_cast<void *>(P);
+  }
+  static inline uintptr_t getFromVoidPointer(void *P) {
+    return reinterpret_cast<uintptr_t>(P);
+  }
+
+  enum { NumLowBitsAvailable = 0 };
+};
+
+}
+
+
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+       
+       
+
+
+
+
+
+namespace llvm {
+
+template<typename ValueTy> class StringMapConstIterator;
+template<typename ValueTy> class StringMapIterator;
+template<typename ValueTy> class StringMapKeyIterator;
+
+
+class StringMapEntryBase {
+  unsigned StrLen;
+
+public:
+  explicit StringMapEntryBase(unsigned Len) : StrLen(Len) {}
+
+  unsigned getKeyLength() const { return StrLen; }
+};
+
+
+
+class StringMapImpl {
+protected:
+
+
+
+  StringMapEntryBase **TheTable = nullptr;
+  unsigned NumBuckets = 0;
+  unsigned NumItems = 0;
+  unsigned NumTombstones = 0;
+  unsigned ItemSize;
+
+protected:
+  explicit StringMapImpl(unsigned itemSize)
+      : ItemSize(itemSize) {}
+  StringMapImpl(StringMapImpl &&RHS)
+      : TheTable(RHS.TheTable), NumBuckets(RHS.NumBuckets),
+        NumItems(RHS.NumItems), NumTombstones(RHS.NumTombstones),
+        ItemSize(RHS.ItemSize) {
+    RHS.TheTable = nullptr;
+    RHS.NumBuckets = 0;
+    RHS.NumItems = 0;
+    RHS.NumTombstones = 0;
+  }
+
+  StringMapImpl(unsigned InitSize, unsigned ItemSize);
+  unsigned RehashTable(unsigned BucketNo = 0);
+
+
+
+
+
+
+  unsigned LookupBucketFor(StringRef Key);
+
+
+
+
+  int FindKey(StringRef Key) const;
+
+
+
+  void RemoveKey(StringMapEntryBase *V);
+
+
+
+  StringMapEntryBase *RemoveKey(StringRef Key);
+
+
+
+  void init(unsigned Size);
+
+public:
+  static StringMapEntryBase *getTombstoneVal() {
+    uintptr_t Val = static_cast<uintptr_t>(-1);
+    Val <<= PointerLikeTypeTraits<StringMapEntryBase *>::NumLowBitsAvailable;
+    return reinterpret_cast<StringMapEntryBase *>(Val);
+  }
+
+  unsigned getNumBuckets() const { return NumBuckets; }
+  unsigned getNumItems() const { return NumItems; }
+
+  bool empty() const { return NumItems == 0; }
+  unsigned size() const { return NumItems; }
+
+  void swap(StringMapImpl &Other) {
+    std::swap(TheTable, Other.TheTable);
+    std::swap(NumBuckets, Other.NumBuckets);
+    std::swap(NumItems, Other.NumItems);
+    std::swap(NumTombstones, Other.NumTombstones);
+  }
+};
+
+
+
+
+template<typename ValueTy>
+class StringMapEntry : public StringMapEntryBase {
+public:
+  ValueTy second;
+
+  explicit StringMapEntry(unsigned strLen)
+    : StringMapEntryBase(strLen), second() {}
+  template <typename... InitTy>
+  StringMapEntry(unsigned strLen, InitTy &&... InitVals)
+      : StringMapEntryBase(strLen), second(std::forward<InitTy>(InitVals)...) {}
+  StringMapEntry(StringMapEntry &E) = delete;
+
+  StringRef getKey() const {
+    return StringRef(getKeyData(), getKeyLength());
+  }
+
+  const ValueTy &getValue() const { return second; }
+  ValueTy &getValue() { return second; }
+
+  void setValue(const ValueTy &V) { second = V; }
+
+
+
+
+  const char *getKeyData() const {return reinterpret_cast<const char*>(this+1);}
+
+  StringRef first() const { return StringRef(getKeyData(), getKeyLength()); }
+
+
+
+  template <typename AllocatorTy, typename... InitTy>
+  static StringMapEntry *Create(StringRef Key, AllocatorTy &Allocator,
+                                InitTy &&... InitVals) {
+    unsigned KeyLength = Key.size();
+
+
+
+    unsigned AllocSize = static_cast<unsigned>(sizeof(StringMapEntry))+
+      KeyLength+1;
+    unsigned Alignment = alignof(StringMapEntry);
+
+    StringMapEntry *NewItem =
+      static_cast<StringMapEntry*>(Allocator.Allocate(AllocSize,Alignment));
+
+    if (NewItem == nullptr)
+      report_bad_alloc_error("Allocation of StringMap entry failed.");
+
+
+    new (NewItem) StringMapEntry(KeyLength, std::forward<InitTy>(InitVals)...);
+
+
+    char *StrBuffer = const_cast<char*>(NewItem->getKeyData());
+    if (KeyLength > 0)
+      memcpy(StrBuffer, Key.data(), KeyLength);
+    StrBuffer[KeyLength] = 0;
+    return NewItem;
+  }
+
+
+  template <typename... InitType>
+  static StringMapEntry *Create(StringRef Key, InitType &&... InitVal) {
+    MallocAllocator A;
+    return Create(Key, A, std::forward<InitType>(InitVal)...);
+  }
+
+  static StringMapEntry *Create(StringRef Key) {
+    return Create(Key, ValueTy());
+  }
+
+
+
+  static StringMapEntry &GetStringMapEntryFromKeyData(const char *KeyData) {
+    char *Ptr = const_cast<char*>(KeyData) - sizeof(StringMapEntry<ValueTy>);
+    return *reinterpret_cast<StringMapEntry*>(Ptr);
+  }
+
+
+
+  template<typename AllocatorTy>
+  void Destroy(AllocatorTy &Allocator) {
+
+    unsigned AllocSize =
+        static_cast<unsigned>(sizeof(StringMapEntry)) + getKeyLength() + 1;
+    this->~StringMapEntry();
+    Allocator.Deallocate(static_cast<void *>(this), AllocSize);
+  }
+
+
+  void Destroy() {
+    MallocAllocator A;
+    Destroy(A);
+  }
+};
+
+
+
+
+
+template<typename ValueTy, typename AllocatorTy = MallocAllocator>
+class StringMap : public StringMapImpl {
+  AllocatorTy Allocator;
+
+public:
+  using MapEntryTy = StringMapEntry<ValueTy>;
+
+  StringMap() : StringMapImpl(static_cast<unsigned>(sizeof(MapEntryTy))) {}
+
+  explicit StringMap(unsigned InitialSize)
+    : StringMapImpl(InitialSize, static_cast<unsigned>(sizeof(MapEntryTy))) {}
+
+  explicit StringMap(AllocatorTy A)
+    : StringMapImpl(static_cast<unsigned>(sizeof(MapEntryTy))), Allocator(A) {}
+
+  StringMap(unsigned InitialSize, AllocatorTy A)
+    : StringMapImpl(InitialSize, static_cast<unsigned>(sizeof(MapEntryTy))),
+      Allocator(A) {}
+
+  StringMap(std::initializer_list<std::pair<StringRef, ValueTy>> List)
+      : StringMapImpl(List.size(), static_cast<unsigned>(sizeof(MapEntryTy))) {
+    for (const auto &P : List) {
+      insert(P);
+    }
+  }
+
+  StringMap(StringMap &&RHS)
+      : StringMapImpl(std::move(RHS)), Allocator(std::move(RHS.Allocator)) {}
+
+  StringMap(const StringMap &RHS) :
+    StringMapImpl(static_cast<unsigned>(sizeof(MapEntryTy))),
+    Allocator(RHS.Allocator) {
+    if (RHS.empty())
+      return;
+
+
+
+    init(RHS.NumBuckets);
+    unsigned *HashTable = (unsigned *)(TheTable + NumBuckets + 1),
+             *RHSHashTable = (unsigned *)(RHS.TheTable + NumBuckets + 1);
+
+    NumItems = RHS.NumItems;
+    NumTombstones = RHS.NumTombstones;
+    for (unsigned I = 0, E = NumBuckets; I != E; ++I) {
+      StringMapEntryBase *Bucket = RHS.TheTable[I];
+      if (!Bucket || Bucket == getTombstoneVal()) {
+        TheTable[I] = Bucket;
+        continue;
+      }
+
+      TheTable[I] = MapEntryTy::Create(
+          static_cast<MapEntryTy *>(Bucket)->getKey(), Allocator,
+          static_cast<MapEntryTy *>(Bucket)->getValue());
+      HashTable[I] = RHSHashTable[I];
+    }
+
+
+
+
+
+
+
+  }
+
+  StringMap &operator=(StringMap RHS) {
+    StringMapImpl::swap(RHS);
+    std::swap(Allocator, RHS.Allocator);
+    return *this;
+  }
+
+  ~StringMap() {
+
+
+
+    if (!empty()) {
+      for (unsigned I = 0, E = NumBuckets; I != E; ++I) {
+        StringMapEntryBase *Bucket = TheTable[I];
+        if (Bucket && Bucket != getTombstoneVal()) {
+          static_cast<MapEntryTy*>(Bucket)->Destroy(Allocator);
+        }
+      }
+    }
+    free(TheTable);
+  }
+
+  AllocatorTy &getAllocator() { return Allocator; }
+  const AllocatorTy &getAllocator() const { return Allocator; }
+
+  using key_type = const char*;
+  using mapped_type = ValueTy;
+  using value_type = StringMapEntry<ValueTy>;
+  using size_type = size_t;
+
+  using const_iterator = StringMapConstIterator<ValueTy>;
+  using iterator = StringMapIterator<ValueTy>;
+
+  iterator begin() {
+    return iterator(TheTable, NumBuckets == 0);
+  }
+  iterator end() {
+    return iterator(TheTable+NumBuckets, true);
+  }
+  const_iterator begin() const {
+    return const_iterator(TheTable, NumBuckets == 0);
+  }
+  const_iterator end() const {
+    return const_iterator(TheTable+NumBuckets, true);
+  }
+
+  iterator_range<StringMapKeyIterator<ValueTy>> keys() const {
+    return make_range(StringMapKeyIterator<ValueTy>(begin()),
+                      StringMapKeyIterator<ValueTy>(end()));
+  }
+
+  iterator find(StringRef Key) {
+    int Bucket = FindKey(Key);
+    if (Bucket == -1) return end();
+    return iterator(TheTable+Bucket, true);
+  }
+
+  const_iterator find(StringRef Key) const {
+    int Bucket = FindKey(Key);
+    if (Bucket == -1) return end();
+    return const_iterator(TheTable+Bucket, true);
+  }
+
+
+
+  ValueTy lookup(StringRef Key) const {
+    const_iterator it = find(Key);
+    if (it != end())
+      return it->second;
+    return ValueTy();
+  }
+
+
+
+  ValueTy &operator[](StringRef Key) { return try_emplace(Key).first->second; }
+
+
+  size_type count(StringRef Key) const {
+    return find(Key) == end() ? 0 : 1;
+  }
+
+
+
+
+  bool insert(MapEntryTy *KeyValue) {
+    unsigned BucketNo = LookupBucketFor(KeyValue->getKey());
+    StringMapEntryBase *&Bucket = TheTable[BucketNo];
+    if (Bucket && Bucket != getTombstoneVal())
+      return false;
+
+    if (Bucket == getTombstoneVal())
+      --NumTombstones;
+    Bucket = KeyValue;
+    ++NumItems;
+    
+   ((
+   NumItems + NumTombstones <= NumBuckets
+   ) ? static_cast<void> (0) : __assert_fail (
+   "NumItems + NumTombstones <= NumBuckets"
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/StringMap.h", 380, __PRETTY_FUNCTION__))
+                                                 ;
+
+    RehashTable();
+    return true;
+  }
+
+
+
+
+
+  std::pair<iterator, bool> insert(std::pair<StringRef, ValueTy> KV) {
+    return try_emplace(KV.first, std::move(KV.second));
+  }
+
+
+
+
+
+  template <typename... ArgsTy>
+  std::pair<iterator, bool> try_emplace(StringRef Key, ArgsTy &&... Args) {
+    unsigned BucketNo = LookupBucketFor(Key);
+    StringMapEntryBase *&Bucket = TheTable[BucketNo];
+    if (Bucket && Bucket != getTombstoneVal())
+      return std::make_pair(iterator(TheTable + BucketNo, false),
+                            false);
+
+    if (Bucket == getTombstoneVal())
+      --NumTombstones;
+    Bucket = MapEntryTy::Create(Key, Allocator, std::forward<ArgsTy>(Args)...);
+    ++NumItems;
+    
+   ((
+   NumItems + NumTombstones <= NumBuckets
+   ) ? static_cast<void> (0) : __assert_fail (
+   "NumItems + NumTombstones <= NumBuckets"
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/StringMap.h", 410, __PRETTY_FUNCTION__))
+                                                 ;
+
+    BucketNo = RehashTable(BucketNo);
+    return std::make_pair(iterator(TheTable + BucketNo, false), true);
+  }
+
+
+  void clear() {
+    if (empty()) return;
+
+
+
+    for (unsigned I = 0, E = NumBuckets; I != E; ++I) {
+      StringMapEntryBase *&Bucket = TheTable[I];
+      if (Bucket && Bucket != getTombstoneVal()) {
+        static_cast<MapEntryTy*>(Bucket)->Destroy(Allocator);
+      }
+      Bucket = nullptr;
+    }
+
+    NumItems = 0;
+    NumTombstones = 0;
+  }
+
+
+
+  void remove(MapEntryTy *KeyValue) {
+    RemoveKey(KeyValue);
+  }
+
+  void erase(iterator I) {
+    MapEntryTy &V = *I;
+    remove(&V);
+    V.Destroy(Allocator);
+  }
+
+  bool erase(StringRef Key) {
+    iterator I = find(Key);
+    if (I == end()) return false;
+    erase(I);
+    return true;
+  }
+};
+
+template <typename DerivedTy, typename ValueTy>
+class StringMapIterBase
+    : public iterator_facade_base<DerivedTy, std::forward_iterator_tag,
+                                  ValueTy> {
+protected:
+  StringMapEntryBase **Ptr = nullptr;
+
+public:
+  StringMapIterBase() = default;
+
+  explicit StringMapIterBase(StringMapEntryBase **Bucket,
+                             bool NoAdvance = false)
+      : Ptr(Bucket) {
+    if (!NoAdvance) AdvancePastEmptyBuckets();
+  }
+
+  DerivedTy &operator=(const DerivedTy &Other) {
+    Ptr = Other.Ptr;
+    return static_cast<DerivedTy &>(*this);
+  }
+
+  bool operator==(const DerivedTy &RHS) const { return Ptr == RHS.Ptr; }
+
+  DerivedTy &operator++() {
+    ++Ptr;
+    AdvancePastEmptyBuckets();
+    return static_cast<DerivedTy &>(*this);
+  }
+
+  DerivedTy operator++(int) {
+    DerivedTy Tmp(Ptr);
+    ++*this;
+    return Tmp;
+  }
+
+private:
+  void AdvancePastEmptyBuckets() {
+    while (*Ptr == nullptr || *Ptr == StringMapImpl::getTombstoneVal())
+      ++Ptr;
+  }
+};
+
+template <typename ValueTy>
+class StringMapConstIterator
+    : public StringMapIterBase<StringMapConstIterator<ValueTy>,
+                               const StringMapEntry<ValueTy>> {
+  using base = StringMapIterBase<StringMapConstIterator<ValueTy>,
+                                 const StringMapEntry<ValueTy>>;
+
+public:
+  StringMapConstIterator() = default;
+  explicit StringMapConstIterator(StringMapEntryBase **Bucket,
+                                  bool NoAdvance = false)
+      : base(Bucket, NoAdvance) {}
+
+  const StringMapEntry<ValueTy> &operator*() const {
+    return *static_cast<const StringMapEntry<ValueTy> *>(*this->Ptr);
+  }
+};
+
+template <typename ValueTy>
+class StringMapIterator : public StringMapIterBase<StringMapIterator<ValueTy>,
+                                                   StringMapEntry<ValueTy>> {
+  using base =
+      StringMapIterBase<StringMapIterator<ValueTy>, StringMapEntry<ValueTy>>;
+
+public:
+  StringMapIterator() = default;
+  explicit StringMapIterator(StringMapEntryBase **Bucket,
+                             bool NoAdvance = false)
+      : base(Bucket, NoAdvance) {}
+
+  StringMapEntry<ValueTy> &operator*() const {
+    return *static_cast<StringMapEntry<ValueTy> *>(*this->Ptr);
+  }
+
+  operator StringMapConstIterator<ValueTy>() const {
+    return StringMapConstIterator<ValueTy>(this->Ptr, true);
+  }
+};
+
+template <typename ValueTy>
+class StringMapKeyIterator
+    : public iterator_adaptor_base<StringMapKeyIterator<ValueTy>,
+                                   StringMapConstIterator<ValueTy>,
+                                   std::forward_iterator_tag, StringRef> {
+  using base = iterator_adaptor_base<StringMapKeyIterator<ValueTy>,
+                                     StringMapConstIterator<ValueTy>,
+                                     std::forward_iterator_tag, StringRef>;
+
+public:
+  StringMapKeyIterator() = default;
+  explicit StringMapKeyIterator(StringMapConstIterator<ValueTy> Iter)
+      : base(std::move(Iter)) {}
+
+  StringRef &operator*() {
+    Key = this->wrapped()->getKey();
+    return Key;
+  }
+
+private:
+  StringRef Key;
+};
+
+}
+namespace llvm {
+namespace sys {
+
+
+
+
+constexpr bool IsBigEndianHost = false;
+
+
+  static const bool IsLittleEndianHost = !IsBigEndianHost;
+  std::string getDefaultTargetTriple();
+
+
+
+  std::string getProcessTriple();
+
+
+
+
+
+
+  StringRef getHostCPUName();
+  bool getHostCPUFeatures(StringMap<bool> &Features);
+
+
+
+
+  int getHostNumPhysicalCores();
+
+  namespace detail {
+
+  StringRef getHostCPUNameForPowerPC(const StringRef &ProcCpuinfoContent);
+  StringRef getHostCPUNameForARM(const StringRef &ProcCpuinfoContent);
+  StringRef getHostCPUNameForS390x(const StringRef &ProcCpuinfoContent);
+  StringRef getHostCPUNameForBPF();
+  }
+}
+}
+
+
+
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+       
+
+
+
+
+namespace llvm {
+class hash_code {
+  size_t value;
+
+public:
+
+
+  hash_code() = default;
+
+
+  hash_code(size_t value) : value(value) {}
+
+
+               operator size_t() const { return value; }
+
+  friend bool operator==(const hash_code &lhs, const hash_code &rhs) {
+    return lhs.value == rhs.value;
+  }
+  friend bool operator!=(const hash_code &lhs, const hash_code &rhs) {
+    return lhs.value != rhs.value;
+  }
+
+
+  friend size_t hash_value(const hash_code &code) { return code.value; }
+};
+template <typename T>
+typename std::enable_if<is_integral_or_enum<T>::value, hash_code>::type
+hash_value(T value);
+
+
+
+
+template <typename T> hash_code hash_value(const T *ptr);
+
+
+template <typename T, typename U>
+hash_code hash_value(const std::pair<T, U> &arg);
+
+
+template <typename T>
+hash_code hash_value(const std::basic_string<T> &arg);
+void set_fixed_execution_hash_seed(size_t fixed_value);
+
+
+
+
+
+namespace hashing {
+namespace detail {
+
+inline uint64_t fetch64(const char *p) {
+  uint64_t result;
+  memcpy(&result, p, sizeof(result));
+  if (sys::IsBigEndianHost)
+    sys::swapByteOrder(result);
+  return result;
+}
+
+inline uint32_t fetch32(const char *p) {
+  uint32_t result;
+  memcpy(&result, p, sizeof(result));
+  if (sys::IsBigEndianHost)
+    sys::swapByteOrder(result);
+  return result;
+}
+
+
+static const uint64_t k0 = 0xc3a5c85c97cb3127ULL;
+static const uint64_t k1 = 0xb492b66fbe98f273ULL;
+static const uint64_t k2 = 0x9ae16a3b2f90404fULL;
+static const uint64_t k3 = 0xc949d7c7509e6557ULL;
+
+
+
+
+inline uint64_t rotate(uint64_t val, size_t shift) {
+
+  return shift == 0 ? val : ((val >> shift) | (val << (64 - shift)));
+}
+
+inline uint64_t shift_mix(uint64_t val) {
+  return val ^ (val >> 47);
+}
+
+inline uint64_t hash_16_bytes(uint64_t low, uint64_t high) {
+
+  const uint64_t kMul = 0x9ddfea08eb382d69ULL;
+  uint64_t a = (low ^ high) * kMul;
+  a ^= (a >> 47);
+  uint64_t b = (high ^ a) * kMul;
+  b ^= (b >> 47);
+  b *= kMul;
+  return b;
+}
+
+inline uint64_t hash_1to3_bytes(const char *s, size_t len, uint64_t seed) {
+  uint8_t a = s[0];
+  uint8_t b = s[len >> 1];
+  uint8_t c = s[len - 1];
+  uint32_t y = static_cast<uint32_t>(a) + (static_cast<uint32_t>(b) << 8);
+  uint32_t z = len + (static_cast<uint32_t>(c) << 2);
+  return shift_mix(y * k2 ^ z * k3 ^ seed) * k2;
+}
+
+inline uint64_t hash_4to8_bytes(const char *s, size_t len, uint64_t seed) {
+  uint64_t a = fetch32(s);
+  return hash_16_bytes(len + (a << 3), seed ^ fetch32(s + len - 4));
+}
+
+inline uint64_t hash_9to16_bytes(const char *s, size_t len, uint64_t seed) {
+  uint64_t a = fetch64(s);
+  uint64_t b = fetch64(s + len - 8);
+  return hash_16_bytes(seed ^ a, rotate(b + len, len)) ^ b;
+}
+
+inline uint64_t hash_17to32_bytes(const char *s, size_t len, uint64_t seed) {
+  uint64_t a = fetch64(s) * k1;
+  uint64_t b = fetch64(s + 8);
+  uint64_t c = fetch64(s + len - 8) * k2;
+  uint64_t d = fetch64(s + len - 16) * k0;
+  return hash_16_bytes(rotate(a - b, 43) + rotate(c ^ seed, 30) + d,
+                       a + rotate(b ^ k3, 20) - c + len + seed);
+}
+
+inline uint64_t hash_33to64_bytes(const char *s, size_t len, uint64_t seed) {
+  uint64_t z = fetch64(s + 24);
+  uint64_t a = fetch64(s) + (len + fetch64(s + len - 16)) * k0;
+  uint64_t b = rotate(a + z, 52);
+  uint64_t c = rotate(a, 37);
+  a += fetch64(s + 8);
+  c += rotate(a, 7);
+  a += fetch64(s + 16);
+  uint64_t vf = a + z;
+  uint64_t vs = b + rotate(a, 31) + c;
+  a = fetch64(s + 16) + fetch64(s + len - 32);
+  z = fetch64(s + len - 8);
+  b = rotate(a + z, 52);
+  c = rotate(a, 37);
+  a += fetch64(s + len - 24);
+  c += rotate(a, 7);
+  a += fetch64(s + len - 16);
+  uint64_t wf = a + z;
+  uint64_t ws = b + rotate(a, 31) + c;
+  uint64_t r = shift_mix((vf + ws) * k2 + (wf + vs) * k0);
+  return shift_mix((seed ^ (r * k0)) + vs) * k2;
+}
+
+inline uint64_t hash_short(const char *s, size_t length, uint64_t seed) {
+  if (length >= 4 && length <= 8)
+    return hash_4to8_bytes(s, length, seed);
+  if (length > 8 && length <= 16)
+    return hash_9to16_bytes(s, length, seed);
+  if (length > 16 && length <= 32)
+    return hash_17to32_bytes(s, length, seed);
+  if (length > 32)
+    return hash_33to64_bytes(s, length, seed);
+  if (length != 0)
+    return hash_1to3_bytes(s, length, seed);
+
+  return k2 ^ seed;
+}
+
+
+
+
+struct hash_state {
+  uint64_t h0, h1, h2, h3, h4, h5, h6;
+
+
+
+
+  static hash_state create(const char *s, uint64_t seed) {
+    hash_state state = {
+      0, seed, hash_16_bytes(seed, k1), rotate(seed ^ k1, 49),
+      seed * k1, shift_mix(seed), 0 };
+    state.h6 = hash_16_bytes(state.h4, state.h5);
+    state.mix(s);
+    return state;
+  }
+
+
+
+  static void mix_32_bytes(const char *s, uint64_t &a, uint64_t &b) {
+    a += fetch64(s);
+    uint64_t c = fetch64(s + 24);
+    b = rotate(b + a + c, 21);
+    uint64_t d = a;
+    a += fetch64(s + 8) + fetch64(s + 16);
+    b += rotate(a, 44) + d;
+    a += c;
+  }
+
+
+
+
+  void mix(const char *s) {
+    h0 = rotate(h0 + h1 + h3 + fetch64(s + 8), 37) * k1;
+    h1 = rotate(h1 + h4 + fetch64(s + 48), 42) * k1;
+    h0 ^= h6;
+    h1 += h3 + fetch64(s + 40);
+    h2 = rotate(h2 + h5, 33) * k1;
+    h3 = h4 * k1;
+    h4 = h0 + h5;
+    mix_32_bytes(s, h3, h4);
+    h5 = h2 + h6;
+    h6 = h1 + fetch64(s + 16);
+    mix_32_bytes(s + 32, h5, h6);
+    std::swap(h2, h0);
+  }
+
+
+
+  uint64_t finalize(size_t length) {
+    return hash_16_bytes(hash_16_bytes(h3, h5) + shift_mix(h1) * k1 + h2,
+                         hash_16_bytes(h4, h6) + shift_mix(length) * k1 + h0);
+  }
+};
+
+
+
+
+
+
+
+extern size_t fixed_seed_override;
+
+inline size_t get_execution_seed() {
+
+
+
+
+
+
+  const uint64_t seed_prime = 0xff51afd7ed558ccdULL;
+  static size_t seed = fixed_seed_override ? fixed_seed_override
+                                           : (size_t)seed_prime;
+  return seed;
+}
+template <typename T> struct is_hashable_data
+  : std::integral_constant<bool, ((is_integral_or_enum<T>::value ||
+                                   std::is_pointer<T>::value) &&
+                                  64 % sizeof(T) == 0)> {};
+
+
+
+
+
+template <typename T, typename U> struct is_hashable_data<std::pair<T, U> >
+  : std::integral_constant<bool, (is_hashable_data<T>::value &&
+                                  is_hashable_data<U>::value &&
+                                  (sizeof(T) + sizeof(U)) ==
+                                   sizeof(std::pair<T, U>))> {};
+
+
+
+template <typename T>
+typename std::enable_if<is_hashable_data<T>::value, T>::type
+get_hashable_data(const T &value) {
+  return value;
+}
+
+
+
+template <typename T>
+typename std::enable_if<!is_hashable_data<T>::value, size_t>::type
+get_hashable_data(const T &value) {
+  using ::llvm::hash_value;
+  return hash_value(value);
+}
+template <typename T>
+bool store_and_advance(char *&buffer_ptr, char *buffer_end, const T& value,
+                       size_t offset = 0) {
+  size_t store_size = sizeof(value) - offset;
+  if (buffer_ptr + store_size > buffer_end)
+    return false;
+  const char *value_data = reinterpret_cast<const char *>(&value);
+  memcpy(buffer_ptr, value_data + offset, store_size);
+  buffer_ptr += store_size;
+  return true;
+}
+
+
+
+
+
+
+template <typename InputIteratorT>
+hash_code hash_combine_range_impl(InputIteratorT first, InputIteratorT last) {
+  const size_t seed = get_execution_seed();
+  char buffer[64], *buffer_ptr = buffer;
+  char *const buffer_end = std::end(buffer);
+  while (first != last && store_and_advance(buffer_ptr, buffer_end,
+                                            get_hashable_data(*first)))
+    ++first;
+  if (first == last)
+    return hash_short(buffer, buffer_ptr - buffer, seed);
+  
+ ((
+ buffer_ptr == buffer_end
+ ) ? static_cast<void> (0) : __assert_fail (
+ "buffer_ptr == buffer_end"
+ , "/home/trippels/llvm/llvm/include/llvm/ADT/Hashing.h", 413, __PRETTY_FUNCTION__))
+                                 ;
+
+  hash_state state = state.create(buffer, seed);
+  size_t length = 64;
+  while (first != last) {
+
+
+    buffer_ptr = buffer;
+    while (first != last && store_and_advance(buffer_ptr, buffer_end,
+                                              get_hashable_data(*first)))
+      ++first;
+
+
+
+
+    std::rotate(buffer, buffer_ptr, buffer_end);
+
+
+    state.mix(buffer);
+    length += buffer_ptr - buffer;
+  };
+
+  return state.finalize(length);
+}
+template <typename ValueT>
+typename std::enable_if<is_hashable_data<ValueT>::value, hash_code>::type
+hash_combine_range_impl(ValueT *first, ValueT *last) {
+  const size_t seed = get_execution_seed();
+  const char *s_begin = reinterpret_cast<const char *>(first);
+  const char *s_end = reinterpret_cast<const char *>(last);
+  const size_t length = std::distance(s_begin, s_end);
+  if (length <= 64)
+    return hash_short(s_begin, length, seed);
+
+  const char *s_aligned_end = s_begin + (length & ~63);
+  hash_state state = state.create(s_begin, seed);
+  s_begin += 64;
+  while (s_begin != s_aligned_end) {
+    state.mix(s_begin);
+    s_begin += 64;
+  }
+  if (length & 63)
+    state.mix(s_end - 64);
+
+  return state.finalize(length);
+}
+
+}
+}
+template <typename InputIteratorT>
+hash_code hash_combine_range(InputIteratorT first, InputIteratorT last) {
+  return ::llvm::hashing::detail::hash_combine_range_impl(first, last);
+}
+
+
+
+namespace hashing {
+namespace detail {
+struct hash_combine_recursive_helper {
+  char buffer[64];
+  hash_state state;
+  const size_t seed;
+
+public:
+
+
+
+
+  hash_combine_recursive_helper()
+    : seed(get_execution_seed()) {}
+
+
+
+
+
+
+
+  template <typename T>
+  char *combine_data(size_t &length, char *buffer_ptr, char *buffer_end, T data) {
+    if (!store_and_advance(buffer_ptr, buffer_end, data)) {
+
+
+
+
+      size_t partial_store_size = buffer_end - buffer_ptr;
+      memcpy(buffer_ptr, &data, partial_store_size);
+
+
+
+
+
+      if (length == 0) {
+        state = state.create(buffer, seed);
+        length = 64;
+      } else {
+
+        state.mix(buffer);
+        length += 64;
+      }
+
+
+      buffer_ptr = buffer;
+
+
+
+      if (!store_and_advance(buffer_ptr, buffer_end, data,
+                             partial_store_size))
+        abort();
+    }
+    return buffer_ptr;
+  }
+
+
+
+
+
+  template <typename T, typename ...Ts>
+  hash_code combine(size_t length, char *buffer_ptr, char *buffer_end,
+                    const T &arg, const Ts &...args) {
+    buffer_ptr = combine_data(length, buffer_ptr, buffer_end, get_hashable_data(arg));
+
+
+    return combine(length, buffer_ptr, buffer_end, args...);
+  }
+
+
+
+
+
+
+  hash_code combine(size_t length, char *buffer_ptr, char *buffer_end) {
+
+
+    if (length == 0)
+      return hash_short(buffer, buffer_ptr - buffer, seed);
+
+
+
+
+
+    std::rotate(buffer, buffer_ptr, buffer_end);
+
+
+    state.mix(buffer);
+    length += buffer_ptr - buffer;
+
+    return state.finalize(length);
+  }
+};
+
+}
+}
+template <typename ...Ts> hash_code hash_combine(const Ts &...args) {
+
+  ::llvm::hashing::detail::hash_combine_recursive_helper helper;
+  return helper.combine(0, helper.buffer, helper.buffer + 64, args...);
+}
+
+
+
+namespace hashing {
+namespace detail {
+
+
+
+
+
+
+inline hash_code hash_integer_value(uint64_t value) {
+
+  const uint64_t seed = get_execution_seed();
+  const char *s = reinterpret_cast<const char *>(&value);
+  const uint64_t a = fetch32(s);
+  return hash_16_bytes(seed + (a << 3), fetch32(s + 4));
+}
+
+}
+}
+
+
+
+template <typename T>
+typename std::enable_if<is_integral_or_enum<T>::value, hash_code>::type
+hash_value(T value) {
+  return ::llvm::hashing::detail::hash_integer_value(
+      static_cast<uint64_t>(value));
+}
+
+
+
+template <typename T> hash_code hash_value(const T *ptr) {
+  return ::llvm::hashing::detail::hash_integer_value(
+    reinterpret_cast<uintptr_t>(ptr));
+}
+
+
+
+template <typename T, typename U>
+hash_code hash_value(const std::pair<T, U> &arg) {
+  return hash_combine(arg.first, arg.second);
+}
+
+
+
+template <typename T>
+hash_code hash_value(const std::basic_string<T> &arg) {
+  return hash_combine_range(arg.begin(), arg.end());
+}
+
+}
+
+
+
+
+
+
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+
+       
+
+
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+
+  template<typename _Tp, typename _Alloc>
+    struct _Vector_base
+    {
+      typedef typename __gnu_cxx::__alloc_traits<_Alloc>::template
+ rebind<_Tp>::other _Tp_alloc_type;
+      typedef typename __gnu_cxx::__alloc_traits<_Tp_alloc_type>::pointer
+        pointer;
+
+      struct _Vector_impl
+      : public _Tp_alloc_type
+      {
+ pointer _M_start;
+ pointer _M_finish;
+ pointer _M_end_of_storage;
+
+ _Vector_impl()
+ : _Tp_alloc_type(), _M_start(), _M_finish(), _M_end_of_storage()
+ { }
+
+ _Vector_impl(_Tp_alloc_type const& __a) noexcept
+ : _Tp_alloc_type(__a), _M_start(), _M_finish(), _M_end_of_storage()
+ { }
+
+
+ _Vector_impl(_Tp_alloc_type&& __a) noexcept
+ : _Tp_alloc_type(std::move(__a)),
+   _M_start(), _M_finish(), _M_end_of_storage()
+ { }
+
+
+ void _M_swap_data(_Vector_impl& __x) noexcept
+ {
+   std::swap(_M_start, __x._M_start);
+   std::swap(_M_finish, __x._M_finish);
+   std::swap(_M_end_of_storage, __x._M_end_of_storage);
+ }
+      };
+
+    public:
+      typedef _Alloc allocator_type;
+
+      _Tp_alloc_type&
+      _M_get_Tp_allocator() noexcept
+      { return *static_cast<_Tp_alloc_type*>(&this->_M_impl); }
+
+      const _Tp_alloc_type&
+      _M_get_Tp_allocator() const noexcept
+      { return *static_cast<const _Tp_alloc_type*>(&this->_M_impl); }
+
+      allocator_type
+      get_allocator() const noexcept
+      { return allocator_type(_M_get_Tp_allocator()); }
+
+      _Vector_base()
+      : _M_impl() { }
+
+      _Vector_base(const allocator_type& __a) noexcept
+      : _M_impl(__a) { }
+
+      _Vector_base(size_t __n)
+      : _M_impl()
+      { _M_create_storage(__n); }
+
+      _Vector_base(size_t __n, const allocator_type& __a)
+      : _M_impl(__a)
+      { _M_create_storage(__n); }
+
+
+      _Vector_base(_Tp_alloc_type&& __a) noexcept
+      : _M_impl(std::move(__a)) { }
+
+      _Vector_base(_Vector_base&& __x) noexcept
+      : _M_impl(std::move(__x._M_get_Tp_allocator()))
+      { this->_M_impl._M_swap_data(__x._M_impl); }
+
+      _Vector_base(_Vector_base&& __x, const allocator_type& __a)
+      : _M_impl(__a)
+      {
+ if (__x.get_allocator() == __a)
+   this->_M_impl._M_swap_data(__x._M_impl);
+ else
+   {
+     size_t __n = __x._M_impl._M_finish - __x._M_impl._M_start;
+     _M_create_storage(__n);
+   }
+      }
+
+
+      ~_Vector_base() noexcept
+      {
+ _M_deallocate(_M_impl._M_start,
+        _M_impl._M_end_of_storage - _M_impl._M_start);
+      }
+
+    public:
+      _Vector_impl _M_impl;
+
+      pointer
+      _M_allocate(size_t __n)
+      {
+ typedef __gnu_cxx::__alloc_traits<_Tp_alloc_type> _Tr;
+ return __n != 0 ? _Tr::allocate(_M_impl, __n) : pointer();
+      }
+
+      void
+      _M_deallocate(pointer __p, size_t __n)
+      {
+ typedef __gnu_cxx::__alloc_traits<_Tp_alloc_type> _Tr;
+ if (__p)
+   _Tr::deallocate(_M_impl, __p, __n);
+      }
+
+    private:
+      void
+      _M_create_storage(size_t __n)
+      {
+ this->_M_impl._M_start = this->_M_allocate(__n);
+ this->_M_impl._M_finish = this->_M_impl._M_start;
+ this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n;
+      }
+    };
+  template<typename _Tp, typename _Alloc = std::allocator<_Tp> >
+    class vector : protected _Vector_base<_Tp, _Alloc>
+    {
+      static_assert(is_same<typename remove_cv<_Tp>::type, _Tp>::value,
+   "std::vector must have a non-const, non-volatile value_type");
+
+      static_assert(is_same<typename _Alloc::value_type, _Tp>::value,
+   "std::vector must have the same value_type as its allocator");
+
+
+
+      typedef _Vector_base<_Tp, _Alloc> _Base;
+      typedef typename _Base::_Tp_alloc_type _Tp_alloc_type;
+      typedef __gnu_cxx::__alloc_traits<_Tp_alloc_type> _Alloc_traits;
+
+    public:
+      typedef _Tp value_type;
+      typedef typename _Base::pointer pointer;
+      typedef typename _Alloc_traits::const_pointer const_pointer;
+      typedef typename _Alloc_traits::reference reference;
+      typedef typename _Alloc_traits::const_reference const_reference;
+      typedef __gnu_cxx::__normal_iterator<pointer, vector> iterator;
+      typedef __gnu_cxx::__normal_iterator<const_pointer, vector>
+      const_iterator;
+      typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+      typedef std::reverse_iterator<iterator> reverse_iterator;
+      typedef size_t size_type;
+      typedef ptrdiff_t difference_type;
+      typedef _Alloc allocator_type;
+
+    protected:
+      using _Base::_M_allocate;
+      using _Base::_M_deallocate;
+      using _Base::_M_impl;
+      using _Base::_M_get_Tp_allocator;
+
+    public:
+
+
+
+
+
+
+      vector()
+
+      noexcept(is_nothrow_default_constructible<_Alloc>::value)
+
+      : _Base() { }
+
+
+
+
+
+      explicit
+      vector(const allocator_type& __a) noexcept
+      : _Base(__a) { }
+      explicit
+      vector(size_type __n, const allocator_type& __a = allocator_type())
+      : _Base(__n, __a)
+      { _M_default_initialize(__n); }
+      vector(size_type __n, const value_type& __value,
+      const allocator_type& __a = allocator_type())
+      : _Base(__n, __a)
+      { _M_fill_initialize(__n, __value); }
+      vector(const vector& __x)
+      : _Base(__x.size(),
+ _Alloc_traits::_S_select_on_copy(__x._M_get_Tp_allocator()))
+      {
+ this->_M_impl._M_finish =
+   std::__uninitialized_copy_a(__x.begin(), __x.end(),
+          this->_M_impl._M_start,
+          _M_get_Tp_allocator());
+      }
+      vector(vector&& __x) noexcept
+      : _Base(std::move(__x)) { }
+
+
+      vector(const vector& __x, const allocator_type& __a)
+      : _Base(__x.size(), __a)
+      {
+ this->_M_impl._M_finish =
+   std::__uninitialized_copy_a(__x.begin(), __x.end(),
+          this->_M_impl._M_start,
+          _M_get_Tp_allocator());
+      }
+
+
+      vector(vector&& __rv, const allocator_type& __m)
+      noexcept(_Alloc_traits::_S_always_equal())
+      : _Base(std::move(__rv), __m)
+      {
+ if (__rv.get_allocator() != __m)
+   {
+     this->_M_impl._M_finish =
+       std::__uninitialized_move_a(__rv.begin(), __rv.end(),
+       this->_M_impl._M_start,
+       _M_get_Tp_allocator());
+     __rv.clear();
+   }
+      }
+      vector(initializer_list<value_type> __l,
+      const allocator_type& __a = allocator_type())
+      : _Base(__a)
+      {
+ _M_range_initialize(__l.begin(), __l.end(),
+       random_access_iterator_tag());
+      }
+      template<typename _InputIterator,
+        typename = std::_RequireInputIter<_InputIterator>>
+ vector(_InputIterator __first, _InputIterator __last,
+        const allocator_type& __a = allocator_type())
+ : _Base(__a)
+ { _M_initialize_dispatch(__first, __last, __false_type()); }
+      ~vector() noexcept
+      {
+ std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
+        _M_get_Tp_allocator());
+ ;
+      }
+      vector&
+      operator=(const vector& __x);
+      vector&
+      operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
+      {
+ constexpr bool __move_storage =
+   _Alloc_traits::_S_propagate_on_move_assign()
+   || _Alloc_traits::_S_always_equal();
+ _M_move_assign(std::move(__x), __bool_constant<__move_storage>());
+ return *this;
+      }
+      vector&
+      operator=(initializer_list<value_type> __l)
+      {
+ this->_M_assign_aux(__l.begin(), __l.end(),
+       random_access_iterator_tag());
+ return *this;
+      }
+      void
+      assign(size_type __n, const value_type& __val)
+      { _M_fill_assign(__n, __val); }
+      template<typename _InputIterator,
+        typename = std::_RequireInputIter<_InputIterator>>
+ void
+ assign(_InputIterator __first, _InputIterator __last)
+ { _M_assign_dispatch(__first, __last, __false_type()); }
+      void
+      assign(initializer_list<value_type> __l)
+      {
+ this->_M_assign_aux(__l.begin(), __l.end(),
+       random_access_iterator_tag());
+      }
+
+
+
+      using _Base::get_allocator;
+
+
+
+
+
+
+
+      iterator
+      begin() noexcept
+      { return iterator(this->_M_impl._M_start); }
+
+
+
+
+
+
+      const_iterator
+      begin() const noexcept
+      { return const_iterator(this->_M_impl._M_start); }
+
+
+
+
+
+
+      iterator
+      end() noexcept
+      { return iterator(this->_M_impl._M_finish); }
+
+
+
+
+
+
+      const_iterator
+      end() const noexcept
+      { return const_iterator(this->_M_impl._M_finish); }
+
+
+
+
+
+
+      reverse_iterator
+      rbegin() noexcept
+      { return reverse_iterator(end()); }
+
+
+
+
+
+
+      const_reverse_iterator
+      rbegin() const noexcept
+      { return const_reverse_iterator(end()); }
+
+
+
+
+
+
+      reverse_iterator
+      rend() noexcept
+      { return reverse_iterator(begin()); }
+
+
+
+
+
+
+      const_reverse_iterator
+      rend() const noexcept
+      { return const_reverse_iterator(begin()); }
+
+
+
+
+
+
+
+      const_iterator
+      cbegin() const noexcept
+      { return const_iterator(this->_M_impl._M_start); }
+
+
+
+
+
+
+      const_iterator
+      cend() const noexcept
+      { return const_iterator(this->_M_impl._M_finish); }
+
+
+
+
+
+
+      const_reverse_iterator
+      crbegin() const noexcept
+      { return const_reverse_iterator(end()); }
+
+
+
+
+
+
+      const_reverse_iterator
+      crend() const noexcept
+      { return const_reverse_iterator(begin()); }
+
+
+
+
+      size_type
+      size() const noexcept
+      { return size_type(this->_M_impl._M_finish - this->_M_impl._M_start); }
+
+
+      size_type
+      max_size() const noexcept
+      { return _Alloc_traits::max_size(_M_get_Tp_allocator()); }
+      void
+      resize(size_type __new_size)
+      {
+ if (__new_size > size())
+   _M_default_append(__new_size - size());
+ else if (__new_size < size())
+   _M_erase_at_end(this->_M_impl._M_start + __new_size);
+      }
+      void
+      resize(size_type __new_size, const value_type& __x)
+      {
+ if (__new_size > size())
+   _M_fill_insert(end(), __new_size - size(), __x);
+ else if (__new_size < size())
+   _M_erase_at_end(this->_M_impl._M_start + __new_size);
+      }
+      void
+      shrink_to_fit()
+      { _M_shrink_to_fit(); }
+
+
+
+
+
+
+      size_type
+      capacity() const noexcept
+      { return size_type(this->_M_impl._M_end_of_storage
+    - this->_M_impl._M_start); }
+
+
+
+
+
+      bool
+      empty() const noexcept
+      { return begin() == end(); }
+      void
+      reserve(size_type __n);
+      reference
+      operator[](size_type __n) noexcept
+      {
+ ;
+ return *(this->_M_impl._M_start + __n);
+      }
+      const_reference
+      operator[](size_type __n) const noexcept
+      {
+ ;
+ return *(this->_M_impl._M_start + __n);
+      }
+
+    protected:
+
+      void
+      _M_range_check(size_type __n) const
+      {
+ if (__n >= this->size())
+   __throw_out_of_range_fmt(("vector::_M_range_check: __n " "(which is %zu) >= this->size() " "(which is %zu)")
+
+                            ,
+       __n, this->size());
+      }
+
+    public:
+      reference
+      at(size_type __n)
+      {
+ _M_range_check(__n);
+ return (*this)[__n];
+      }
+      const_reference
+      at(size_type __n) const
+      {
+ _M_range_check(__n);
+ return (*this)[__n];
+      }
+
+
+
+
+
+      reference
+      front() noexcept
+      {
+ ;
+ return *begin();
+      }
+
+
+
+
+
+      const_reference
+      front() const noexcept
+      {
+ ;
+ return *begin();
+      }
+
+
+
+
+
+      reference
+      back() noexcept
+      {
+ ;
+ return *(end() - 1);
+      }
+
+
+
+
+
+      const_reference
+      back() const noexcept
+      {
+ ;
+ return *(end() - 1);
+      }
+      _Tp*
+      data() noexcept
+      { return _M_data_ptr(this->_M_impl._M_start); }
+
+      const _Tp*
+      data() const noexcept
+      { return _M_data_ptr(this->_M_impl._M_start); }
+      void
+      push_back(const value_type& __x)
+      {
+ if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage)
+   {
+     ;
+     _Alloc_traits::construct(this->_M_impl, this->_M_impl._M_finish,
+         __x);
+     ++this->_M_impl._M_finish;
+     ;
+   }
+ else
+   _M_realloc_insert(end(), __x);
+      }
+
+
+      void
+      push_back(value_type&& __x)
+      { emplace_back(std::move(__x)); }
+
+      template<typename... _Args>
+
+
+
+ void
+
+ emplace_back(_Args&&... __args);
+      void
+      pop_back() noexcept
+      {
+ ;
+ --this->_M_impl._M_finish;
+ _Alloc_traits::destroy(this->_M_impl, this->_M_impl._M_finish);
+ ;
+      }
+      template<typename... _Args>
+ iterator
+ emplace(const_iterator __position, _Args&&... __args)
+ { return _M_emplace_aux(__position, std::forward<_Args>(__args)...); }
+      iterator
+      insert(const_iterator __position, const value_type& __x);
+      iterator
+      insert(const_iterator __position, value_type&& __x)
+      { return _M_insert_rval(__position, std::move(__x)); }
+      iterator
+      insert(const_iterator __position, initializer_list<value_type> __l)
+      {
+ auto __offset = __position - cbegin();
+ _M_range_insert(begin() + __offset, __l.begin(), __l.end(),
+   std::random_access_iterator_tag());
+ return begin() + __offset;
+      }
+      iterator
+      insert(const_iterator __position, size_type __n, const value_type& __x)
+      {
+ difference_type __offset = __position - cbegin();
+ _M_fill_insert(begin() + __offset, __n, __x);
+ return begin() + __offset;
+      }
+      template<typename _InputIterator,
+        typename = std::_RequireInputIter<_InputIterator>>
+ iterator
+ insert(const_iterator __position, _InputIterator __first,
+        _InputIterator __last)
+ {
+   difference_type __offset = __position - cbegin();
+   _M_insert_dispatch(begin() + __offset,
+        __first, __last, __false_type());
+   return begin() + __offset;
+ }
+      iterator
+
+      erase(const_iterator __position)
+      { return _M_erase(begin() + (__position - cbegin())); }
+      iterator
+
+      erase(const_iterator __first, const_iterator __last)
+      {
+ const auto __beg = begin();
+ const auto __cbeg = cbegin();
+ return _M_erase(__beg + (__first - __cbeg), __beg + (__last - __cbeg));
+      }
+      void
+      swap(vector& __x) noexcept
+      {
+
+
+                                                          ;
+
+ this->_M_impl._M_swap_data(__x._M_impl);
+ _Alloc_traits::_S_on_swap(_M_get_Tp_allocator(),
+      __x._M_get_Tp_allocator());
+      }
+
+
+
+
+
+
+
+      void
+      clear() noexcept
+      { _M_erase_at_end(this->_M_impl._M_start); }
+
+    protected:
+
+
+
+
+      template<typename _ForwardIterator>
+ pointer
+ _M_allocate_and_copy(size_type __n,
+        _ForwardIterator __first, _ForwardIterator __last)
+ {
+   pointer __result = this->_M_allocate(__n);
+   if (true)
+     {
+       std::__uninitialized_copy_a(__first, __last, __result,
+       _M_get_Tp_allocator());
+       return __result;
+     }
+   if (false)
+     {
+       _M_deallocate(__result, __n);
+       ;
+     }
+ }
+      template<typename _Integer>
+ void
+ _M_initialize_dispatch(_Integer __n, _Integer __value, __true_type)
+ {
+   this->_M_impl._M_start = _M_allocate(static_cast<size_type>(__n));
+   this->_M_impl._M_end_of_storage =
+     this->_M_impl._M_start + static_cast<size_type>(__n);
+   _M_fill_initialize(static_cast<size_type>(__n), __value);
+ }
+
+
+      template<typename _InputIterator>
+ void
+ _M_initialize_dispatch(_InputIterator __first, _InputIterator __last,
+          __false_type)
+ {
+   typedef typename std::iterator_traits<_InputIterator>::
+     iterator_category _IterCategory;
+   _M_range_initialize(__first, __last, _IterCategory());
+ }
+
+
+      template<typename _InputIterator>
+ void
+ _M_range_initialize(_InputIterator __first,
+       _InputIterator __last, std::input_iterator_tag)
+ {
+   for (; __first != __last; ++__first)
+
+     emplace_back(*__first);
+
+
+
+ }
+
+
+      template<typename _ForwardIterator>
+ void
+ _M_range_initialize(_ForwardIterator __first,
+       _ForwardIterator __last, std::forward_iterator_tag)
+ {
+   const size_type __n = std::distance(__first, __last);
+   this->_M_impl._M_start = this->_M_allocate(__n);
+   this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n;
+   this->_M_impl._M_finish =
+     std::__uninitialized_copy_a(__first, __last,
+     this->_M_impl._M_start,
+     _M_get_Tp_allocator());
+ }
+
+
+
+      void
+      _M_fill_initialize(size_type __n, const value_type& __value)
+      {
+ this->_M_impl._M_finish =
+   std::__uninitialized_fill_n_a(this->_M_impl._M_start, __n, __value,
+     _M_get_Tp_allocator());
+      }
+
+
+
+      void
+      _M_default_initialize(size_type __n)
+      {
+ this->_M_impl._M_finish =
+   std::__uninitialized_default_n_a(this->_M_impl._M_start, __n,
+        _M_get_Tp_allocator());
+      }
+      template<typename _Integer>
+ void
+ _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
+ { _M_fill_assign(__n, __val); }
+
+
+      template<typename _InputIterator>
+ void
+ _M_assign_dispatch(_InputIterator __first, _InputIterator __last,
+      __false_type)
+ { _M_assign_aux(__first, __last, std::__iterator_category(__first)); }
+
+
+      template<typename _InputIterator>
+ void
+ _M_assign_aux(_InputIterator __first, _InputIterator __last,
+        std::input_iterator_tag);
+
+
+      template<typename _ForwardIterator>
+ void
+ _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
+        std::forward_iterator_tag);
+
+
+
+      void
+      _M_fill_assign(size_type __n, const value_type& __val);
+
+
+
+
+
+
+
+      template<typename _Integer>
+ void
+ _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __val,
+      __true_type)
+ { _M_fill_insert(__pos, __n, __val); }
+
+
+      template<typename _InputIterator>
+ void
+ _M_insert_dispatch(iterator __pos, _InputIterator __first,
+      _InputIterator __last, __false_type)
+ {
+   _M_range_insert(__pos, __first, __last,
+     std::__iterator_category(__first));
+ }
+
+
+      template<typename _InputIterator>
+ void
+ _M_range_insert(iterator __pos, _InputIterator __first,
+   _InputIterator __last, std::input_iterator_tag);
+
+
+      template<typename _ForwardIterator>
+ void
+ _M_range_insert(iterator __pos, _ForwardIterator __first,
+   _ForwardIterator __last, std::forward_iterator_tag);
+
+
+
+      void
+      _M_fill_insert(iterator __pos, size_type __n, const value_type& __x);
+
+
+
+      void
+      _M_default_append(size_type __n);
+
+      bool
+      _M_shrink_to_fit();
+      struct _Temporary_value
+      {
+ template<typename... _Args>
+   explicit
+   _Temporary_value(vector* __vec, _Args&&... __args) : _M_this(__vec)
+   {
+     _Alloc_traits::construct(_M_this->_M_impl, _M_ptr(),
+         std::forward<_Args>(__args)...);
+   }
+
+ ~_Temporary_value()
+ { _Alloc_traits::destroy(_M_this->_M_impl, _M_ptr()); }
+
+ value_type&
+ _M_val() { return *reinterpret_cast<_Tp*>(&__buf); }
+
+      private:
+ pointer
+ _M_ptr() { return pointer_traits<pointer>::pointer_to(_M_val()); }
+
+ vector* _M_this;
+ typename aligned_storage<sizeof(_Tp), alignof(_Tp)>::type __buf;
+      };
+
+
+
+      template<typename _Arg>
+ void
+ _M_insert_aux(iterator __position, _Arg&& __arg);
+
+      template<typename... _Args>
+ void
+ _M_realloc_insert(iterator __position, _Args&&... __args);
+
+
+      iterator
+      _M_insert_rval(const_iterator __position, value_type&& __v);
+
+
+      template<typename... _Args>
+ iterator
+ _M_emplace_aux(const_iterator __position, _Args&&... __args);
+
+
+      iterator
+      _M_emplace_aux(const_iterator __position, value_type&& __v)
+      { return _M_insert_rval(__position, std::move(__v)); }
+
+
+
+      size_type
+      _M_check_len(size_type __n, const char* __s) const
+      {
+ if (max_size() - size() < __n)
+   __throw_length_error((__s));
+
+ const size_type __len = size() + std::max(size(), __n);
+ return (__len < size() || __len > max_size()) ? max_size() : __len;
+      }
+
+
+
+
+
+      void
+      _M_erase_at_end(pointer __pos) noexcept
+      {
+ if (size_type __n = this->_M_impl._M_finish - __pos)
+   {
+     std::_Destroy(__pos, this->_M_impl._M_finish,
+     _M_get_Tp_allocator());
+     this->_M_impl._M_finish = __pos;
+     ;
+   }
+      }
+
+      iterator
+      _M_erase(iterator __position);
+
+      iterator
+      _M_erase(iterator __first, iterator __last);
+
+
+    private:
+
+
+
+      void
+      _M_move_assign(vector&& __x, std::true_type) noexcept
+      {
+ vector __tmp(get_allocator());
+ this->_M_impl._M_swap_data(__tmp._M_impl);
+ this->_M_impl._M_swap_data(__x._M_impl);
+ std::__alloc_on_move(_M_get_Tp_allocator(), __x._M_get_Tp_allocator());
+      }
+
+
+
+      void
+      _M_move_assign(vector&& __x, std::false_type)
+      {
+ if (__x._M_get_Tp_allocator() == this->_M_get_Tp_allocator())
+   _M_move_assign(std::move(__x), std::true_type());
+ else
+   {
+
+
+     this->assign(std::__make_move_if_noexcept_iterator(__x.begin()),
+    std::__make_move_if_noexcept_iterator(__x.end()));
+     __x.clear();
+   }
+      }
+
+
+      template<typename _Up>
+ _Up*
+ _M_data_ptr(_Up* __ptr) const noexcept
+ { return __ptr; }
+
+
+      template<typename _Ptr>
+ typename std::pointer_traits<_Ptr>::element_type*
+ _M_data_ptr(_Ptr __ptr) const
+ { return empty() ? nullptr : std::__to_address(__ptr); }
+    };
+  template<typename _Tp, typename _Alloc>
+    inline bool
+    operator==(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
+    { return (__x.size() == __y.size()
+       && std::equal(__x.begin(), __x.end(), __y.begin())); }
+  template<typename _Tp, typename _Alloc>
+    inline bool
+    operator<(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
+    { return std::lexicographical_compare(__x.begin(), __x.end(),
+       __y.begin(), __y.end()); }
+
+
+  template<typename _Tp, typename _Alloc>
+    inline bool
+    operator!=(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
+    { return !(__x == __y); }
+
+
+  template<typename _Tp, typename _Alloc>
+    inline bool
+    operator>(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
+    { return __y < __x; }
+
+
+  template<typename _Tp, typename _Alloc>
+    inline bool
+    operator<=(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
+    { return !(__y < __x); }
+
+
+  template<typename _Tp, typename _Alloc>
+    inline bool
+    operator>=(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
+    { return !(__x < __y); }
+
+
+  template<typename _Tp, typename _Alloc>
+    inline void
+    swap(vector<_Tp, _Alloc>& __x, vector<_Tp, _Alloc>& __y)
+    noexcept(noexcept(__x.swap(__y)))
+    { __x.swap(__y); }
+
+
+
+}
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+  typedef unsigned long _Bit_type;
+  enum { _S_word_bit = int(8 * sizeof(_Bit_type)) };
+
+  struct _Bit_reference
+  {
+    _Bit_type * _M_p;
+    _Bit_type _M_mask;
+
+    _Bit_reference(_Bit_type * __x, _Bit_type __y)
+    : _M_p(__x), _M_mask(__y) { }
+
+    _Bit_reference() noexcept : _M_p(0), _M_mask(0) { }
+
+    operator bool() const noexcept
+    { return !!(*_M_p & _M_mask); }
+
+    _Bit_reference&
+    operator=(bool __x) noexcept
+    {
+      if (__x)
+ *_M_p |= _M_mask;
+      else
+ *_M_p &= ~_M_mask;
+      return *this;
+    }
+
+    _Bit_reference&
+    operator=(const _Bit_reference& __x) noexcept
+    { return *this = bool(__x); }
+
+    bool
+    operator==(const _Bit_reference& __x) const
+    { return bool(*this) == bool(__x); }
+
+    bool
+    operator<(const _Bit_reference& __x) const
+    { return !bool(*this) && bool(__x); }
+
+    void
+    flip() noexcept
+    { *_M_p ^= _M_mask; }
+  };
+
+
+  inline void
+  swap(_Bit_reference __x, _Bit_reference __y) noexcept
+  {
+    bool __tmp = __x;
+    __x = __y;
+    __y = __tmp;
+  }
+
+  inline void
+  swap(_Bit_reference __x, bool& __y) noexcept
+  {
+    bool __tmp = __x;
+    __x = __y;
+    __y = __tmp;
+  }
+
+  inline void
+  swap(bool& __x, _Bit_reference __y) noexcept
+  {
+    bool __tmp = __x;
+    __x = __y;
+    __y = __tmp;
+  }
+
+
+  struct _Bit_iterator_base
+  : public std::iterator<std::random_access_iterator_tag, bool>
+  {
+    _Bit_type * _M_p;
+    unsigned int _M_offset;
+
+    _Bit_iterator_base(_Bit_type * __x, unsigned int __y)
+    : _M_p(__x), _M_offset(__y) { }
+
+    void
+    _M_bump_up()
+    {
+      if (_M_offset++ == int(_S_word_bit) - 1)
+ {
+   _M_offset = 0;
+   ++_M_p;
+ }
+    }
+
+    void
+    _M_bump_down()
+    {
+      if (_M_offset-- == 0)
+ {
+   _M_offset = int(_S_word_bit) - 1;
+   --_M_p;
+ }
+    }
+
+    void
+    _M_incr(ptrdiff_t __i)
+    {
+      difference_type __n = __i + _M_offset;
+      _M_p += __n / int(_S_word_bit);
+      __n = __n % int(_S_word_bit);
+      if (__n < 0)
+ {
+   __n += int(_S_word_bit);
+   --_M_p;
+ }
+      _M_offset = static_cast<unsigned int>(__n);
+    }
+
+    bool
+    operator==(const _Bit_iterator_base& __i) const
+    { return _M_p == __i._M_p && _M_offset == __i._M_offset; }
+
+    bool
+    operator<(const _Bit_iterator_base& __i) const
+    {
+      return _M_p < __i._M_p
+     || (_M_p == __i._M_p && _M_offset < __i._M_offset);
+    }
+
+    bool
+    operator!=(const _Bit_iterator_base& __i) const
+    { return !(*this == __i); }
+
+    bool
+    operator>(const _Bit_iterator_base& __i) const
+    { return __i < *this; }
+
+    bool
+    operator<=(const _Bit_iterator_base& __i) const
+    { return !(__i < *this); }
+
+    bool
+    operator>=(const _Bit_iterator_base& __i) const
+    { return !(*this < __i); }
+  };
+
+  inline ptrdiff_t
+  operator-(const _Bit_iterator_base& __x, const _Bit_iterator_base& __y)
+  {
+    return (int(_S_word_bit) * (__x._M_p - __y._M_p)
+     + __x._M_offset - __y._M_offset);
+  }
+
+  struct _Bit_iterator : public _Bit_iterator_base
+  {
+    typedef _Bit_reference reference;
+    typedef _Bit_reference* pointer;
+    typedef _Bit_iterator iterator;
+
+    _Bit_iterator() : _Bit_iterator_base(0, 0) { }
+
+    _Bit_iterator(_Bit_type * __x, unsigned int __y)
+    : _Bit_iterator_base(__x, __y) { }
+
+    iterator
+    _M_const_cast() const
+    { return *this; }
+
+    reference
+    operator*() const
+    { return reference(_M_p, 1UL << _M_offset); }
+
+    iterator&
+    operator++()
+    {
+      _M_bump_up();
+      return *this;
+    }
+
+    iterator
+    operator++(int)
+    {
+      iterator __tmp = *this;
+      _M_bump_up();
+      return __tmp;
+    }
+
+    iterator&
+    operator--()
+    {
+      _M_bump_down();
+      return *this;
+    }
+
+    iterator
+    operator--(int)
+    {
+      iterator __tmp = *this;
+      _M_bump_down();
+      return __tmp;
+    }
+
+    iterator&
+    operator+=(difference_type __i)
+    {
+      _M_incr(__i);
+      return *this;
+    }
+
+    iterator&
+    operator-=(difference_type __i)
+    {
+      *this += -__i;
+      return *this;
+    }
+
+    iterator
+    operator+(difference_type __i) const
+    {
+      iterator __tmp = *this;
+      return __tmp += __i;
+    }
+
+    iterator
+    operator-(difference_type __i) const
+    {
+      iterator __tmp = *this;
+      return __tmp -= __i;
+    }
+
+    reference
+    operator[](difference_type __i) const
+    { return *(*this + __i); }
+  };
+
+  inline _Bit_iterator
+  operator+(ptrdiff_t __n, const _Bit_iterator& __x)
+  { return __x + __n; }
+
+  struct _Bit_const_iterator : public _Bit_iterator_base
+  {
+    typedef bool reference;
+    typedef bool const_reference;
+    typedef const bool* pointer;
+    typedef _Bit_const_iterator const_iterator;
+
+    _Bit_const_iterator() : _Bit_iterator_base(0, 0) { }
+
+    _Bit_const_iterator(_Bit_type * __x, unsigned int __y)
+    : _Bit_iterator_base(__x, __y) { }
+
+    _Bit_const_iterator(const _Bit_iterator& __x)
+    : _Bit_iterator_base(__x._M_p, __x._M_offset) { }
+
+    _Bit_iterator
+    _M_const_cast() const
+    { return _Bit_iterator(_M_p, _M_offset); }
+
+    const_reference
+    operator*() const
+    { return _Bit_reference(_M_p, 1UL << _M_offset); }
+
+    const_iterator&
+    operator++()
+    {
+      _M_bump_up();
+      return *this;
+    }
+
+    const_iterator
+    operator++(int)
+    {
+      const_iterator __tmp = *this;
+      _M_bump_up();
+      return __tmp;
+    }
+
+    const_iterator&
+    operator--()
+    {
+      _M_bump_down();
+      return *this;
+    }
+
+    const_iterator
+    operator--(int)
+    {
+      const_iterator __tmp = *this;
+      _M_bump_down();
+      return __tmp;
+    }
+
+    const_iterator&
+    operator+=(difference_type __i)
+    {
+      _M_incr(__i);
+      return *this;
+    }
+
+    const_iterator&
+    operator-=(difference_type __i)
+    {
+      *this += -__i;
+      return *this;
+    }
+
+    const_iterator
+    operator+(difference_type __i) const
+    {
+      const_iterator __tmp = *this;
+      return __tmp += __i;
+    }
+
+    const_iterator
+    operator-(difference_type __i) const
+    {
+      const_iterator __tmp = *this;
+      return __tmp -= __i;
+    }
+
+    const_reference
+    operator[](difference_type __i) const
+    { return *(*this + __i); }
+  };
+
+  inline _Bit_const_iterator
+  operator+(ptrdiff_t __n, const _Bit_const_iterator& __x)
+  { return __x + __n; }
+
+  inline void
+  __fill_bvector(_Bit_type * __v,
+   unsigned int __first, unsigned int __last, bool __x)
+  {
+    const _Bit_type __fmask = ~0ul << __first;
+    const _Bit_type __lmask = ~0ul >> (_S_word_bit - __last);
+    const _Bit_type __mask = __fmask & __lmask;
+
+    if (__x)
+      *__v |= __mask;
+    else
+      *__v &= ~__mask;
+  }
+
+  inline void
+  fill(_Bit_iterator __first, _Bit_iterator __last, const bool& __x)
+  {
+    if (__first._M_p != __last._M_p)
+      {
+ _Bit_type* __first_p = __first._M_p;
+ if (__first._M_offset != 0)
+   __fill_bvector(__first_p++, __first._M_offset, _S_word_bit, __x);
+
+ __builtin_memset(__first_p, __x ? ~0 : 0,
+    (__last._M_p - __first_p) * sizeof(_Bit_type));
+
+ if (__last._M_offset != 0)
+   __fill_bvector(__last._M_p, 0, __last._M_offset, __x);
+      }
+    else if (__first._M_offset != __last._M_offset)
+      __fill_bvector(__first._M_p, __first._M_offset, __last._M_offset, __x);
+  }
+
+  template<typename _Alloc>
+    struct _Bvector_base
+    {
+      typedef typename __gnu_cxx::__alloc_traits<_Alloc>::template
+        rebind<_Bit_type>::other _Bit_alloc_type;
+      typedef typename __gnu_cxx::__alloc_traits<_Bit_alloc_type>
+ _Bit_alloc_traits;
+      typedef typename _Bit_alloc_traits::pointer _Bit_pointer;
+
+      struct _Bvector_impl_data
+      {
+ _Bit_iterator _M_start;
+ _Bit_iterator _M_finish;
+ _Bit_pointer _M_end_of_storage;
+
+ _Bvector_impl_data() noexcept
+ : _M_start(), _M_finish(), _M_end_of_storage()
+ { }
+
+
+ _Bvector_impl_data(_Bvector_impl_data&& __x) noexcept
+ : _M_start(__x._M_start), _M_finish(__x._M_finish)
+ , _M_end_of_storage(__x._M_end_of_storage)
+ { __x._M_reset(); }
+
+ void
+ _M_move_data(_Bvector_impl_data&& __x) noexcept
+ {
+   this->_M_start = __x._M_start;
+   this->_M_finish = __x._M_finish;
+   this->_M_end_of_storage = __x._M_end_of_storage;
+   __x._M_reset();
+ }
+
+
+ void
+ _M_reset() noexcept
+ {
+   _M_start = _M_finish = _Bit_iterator();
+   _M_end_of_storage = _Bit_pointer();
+ }
+      };
+
+      struct _Bvector_impl
+ : public _Bit_alloc_type, public _Bvector_impl_data
+ {
+ public:
+   _Bvector_impl()
+     noexcept(noexcept(_Bit_alloc_type()))
+   : _Bit_alloc_type()
+   { }
+
+   _Bvector_impl(const _Bit_alloc_type& __a) noexcept
+   : _Bit_alloc_type(__a)
+   { }
+
+
+ _Bvector_impl(_Bvector_impl&&) = default;
+
+
+ _Bit_type*
+ _M_end_addr() const noexcept
+ {
+   if (this->_M_end_of_storage)
+     return std::__addressof(this->_M_end_of_storage[-1]) + 1;
+   return 0;
+ }
+      };
+
+    public:
+      typedef _Alloc allocator_type;
+
+      _Bit_alloc_type&
+      _M_get_Bit_allocator() noexcept
+      { return this->_M_impl; }
+
+      const _Bit_alloc_type&
+      _M_get_Bit_allocator() const noexcept
+      { return this->_M_impl; }
+
+      allocator_type
+      get_allocator() const noexcept
+      { return allocator_type(_M_get_Bit_allocator()); }
+
+
+      _Bvector_base() = default;
+
+
+
+
+      _Bvector_base(const allocator_type& __a)
+      : _M_impl(__a) { }
+
+
+      _Bvector_base(_Bvector_base&&) = default;
+
+
+      ~_Bvector_base()
+      { this->_M_deallocate(); }
+
+    protected:
+      _Bvector_impl _M_impl;
+
+      _Bit_pointer
+      _M_allocate(size_t __n)
+      { return _Bit_alloc_traits::allocate(_M_impl, _S_nword(__n)); }
+
+      void
+      _M_deallocate()
+      {
+ if (_M_impl._M_start._M_p)
+   {
+     const size_t __n = _M_impl._M_end_addr() - _M_impl._M_start._M_p;
+     _Bit_alloc_traits::deallocate(_M_impl,
+       _M_impl._M_end_of_storage - __n,
+       __n);
+     _M_impl._M_reset();
+   }
+      }
+
+
+      void
+      _M_move_data(_Bvector_base&& __x) noexcept
+      { _M_impl._M_move_data(std::move(__x._M_impl)); }
+
+
+      static size_t
+      _S_nword(size_t __n)
+      { return (__n + int(_S_word_bit) - 1) / int(_S_word_bit); }
+    };
+
+
+
+}
+
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+  template<typename _Alloc>
+    class vector<bool, _Alloc> : protected _Bvector_base<_Alloc>
+    {
+      typedef _Bvector_base<_Alloc> _Base;
+      typedef typename _Base::_Bit_pointer _Bit_pointer;
+      typedef typename _Base::_Bit_alloc_traits _Bit_alloc_traits;
+
+
+      template<typename> friend struct hash;
+
+
+    public:
+      typedef bool value_type;
+      typedef size_t size_type;
+      typedef ptrdiff_t difference_type;
+      typedef _Bit_reference reference;
+      typedef bool const_reference;
+      typedef _Bit_reference* pointer;
+      typedef const bool* const_pointer;
+      typedef _Bit_iterator iterator;
+      typedef _Bit_const_iterator const_iterator;
+      typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+      typedef std::reverse_iterator<iterator> reverse_iterator;
+      typedef _Alloc allocator_type;
+
+      allocator_type
+      get_allocator() const
+      { return _Base::get_allocator(); }
+
+    protected:
+      using _Base::_M_allocate;
+      using _Base::_M_deallocate;
+      using _Base::_S_nword;
+      using _Base::_M_get_Bit_allocator;
+
+    public:
+
+      vector() = default;
+
+
+
+
+      explicit
+      vector(const allocator_type& __a)
+      : _Base(__a) { }
+
+
+      explicit
+      vector(size_type __n, const allocator_type& __a = allocator_type())
+      : vector(__n, false, __a)
+      { }
+
+      vector(size_type __n, const bool& __value,
+      const allocator_type& __a = allocator_type())
+
+
+
+
+
+      : _Base(__a)
+      {
+ _M_initialize(__n);
+ _M_initialize_value(__value);
+      }
+
+      vector(const vector& __x)
+      : _Base(_Bit_alloc_traits::_S_select_on_copy(__x._M_get_Bit_allocator()))
+      {
+ _M_initialize(__x.size());
+ _M_copy_aligned(__x.begin(), __x.end(), this->_M_impl._M_start);
+      }
+
+
+      vector(vector&&) = default;
+
+      vector(vector&& __x, const allocator_type& __a)
+      noexcept(_Bit_alloc_traits::_S_always_equal())
+      : _Base(__a)
+      {
+ if (__x.get_allocator() == __a)
+   this->_M_move_data(std::move(__x));
+ else
+   {
+     _M_initialize(__x.size());
+     _M_copy_aligned(__x.begin(), __x.end(), begin());
+     __x.clear();
+   }
+      }
+
+      vector(const vector& __x, const allocator_type& __a)
+      : _Base(__a)
+      {
+ _M_initialize(__x.size());
+ _M_copy_aligned(__x.begin(), __x.end(), this->_M_impl._M_start);
+      }
+
+      vector(initializer_list<bool> __l,
+      const allocator_type& __a = allocator_type())
+      : _Base(__a)
+      {
+ _M_initialize_range(__l.begin(), __l.end(),
+       random_access_iterator_tag());
+      }
+
+
+
+      template<typename _InputIterator,
+        typename = std::_RequireInputIter<_InputIterator>>
+ vector(_InputIterator __first, _InputIterator __last,
+        const allocator_type& __a = allocator_type())
+ : _Base(__a)
+ { _M_initialize_dispatch(__first, __last, __false_type()); }
+      ~vector() noexcept { }
+
+      vector&
+      operator=(const vector& __x)
+      {
+ if (&__x == this)
+   return *this;
+
+ if (_Bit_alloc_traits::_S_propagate_on_copy_assign())
+   {
+     if (this->_M_get_Bit_allocator() != __x._M_get_Bit_allocator())
+       {
+  this->_M_deallocate();
+  std::__alloc_on_copy(_M_get_Bit_allocator(),
+         __x._M_get_Bit_allocator());
+  _M_initialize(__x.size());
+       }
+     else
+       std::__alloc_on_copy(_M_get_Bit_allocator(),
+       __x._M_get_Bit_allocator());
+   }
+
+ if (__x.size() > capacity())
+   {
+     this->_M_deallocate();
+     _M_initialize(__x.size());
+   }
+ this->_M_impl._M_finish = _M_copy_aligned(__x.begin(), __x.end(),
+        begin());
+ return *this;
+      }
+
+
+      vector&
+      operator=(vector&& __x) noexcept(_Bit_alloc_traits::_S_nothrow_move())
+      {
+ if (_Bit_alloc_traits::_S_propagate_on_move_assign()
+     || this->_M_get_Bit_allocator() == __x._M_get_Bit_allocator())
+   {
+     this->_M_deallocate();
+     this->_M_move_data(std::move(__x));
+     std::__alloc_on_move(_M_get_Bit_allocator(),
+     __x._M_get_Bit_allocator());
+   }
+ else
+   {
+     if (__x.size() > capacity())
+       {
+  this->_M_deallocate();
+  _M_initialize(__x.size());
+       }
+     this->_M_impl._M_finish = _M_copy_aligned(__x.begin(), __x.end(),
+            begin());
+     __x.clear();
+   }
+ return *this;
+      }
+
+      vector&
+      operator=(initializer_list<bool> __l)
+      {
+ this->assign (__l.begin(), __l.end());
+ return *this;
+      }
+
+
+
+
+
+
+      void
+      assign(size_type __n, const bool& __x)
+      { _M_fill_assign(__n, __x); }
+
+
+      template<typename _InputIterator,
+        typename = std::_RequireInputIter<_InputIterator>>
+ void
+ assign(_InputIterator __first, _InputIterator __last)
+ { _M_assign_aux(__first, __last, std::__iterator_category(__first)); }
+      void
+      assign(initializer_list<bool> __l)
+      { _M_assign_aux(__l.begin(), __l.end(), random_access_iterator_tag()); }
+
+
+      iterator
+      begin() noexcept
+      { return this->_M_impl._M_start; }
+
+      const_iterator
+      begin() const noexcept
+      { return this->_M_impl._M_start; }
+
+      iterator
+      end() noexcept
+      { return this->_M_impl._M_finish; }
+
+      const_iterator
+      end() const noexcept
+      { return this->_M_impl._M_finish; }
+
+      reverse_iterator
+      rbegin() noexcept
+      { return reverse_iterator(end()); }
+
+      const_reverse_iterator
+      rbegin() const noexcept
+      { return const_reverse_iterator(end()); }
+
+      reverse_iterator
+      rend() noexcept
+      { return reverse_iterator(begin()); }
+
+      const_reverse_iterator
+      rend() const noexcept
+      { return const_reverse_iterator(begin()); }
+
+
+      const_iterator
+      cbegin() const noexcept
+      { return this->_M_impl._M_start; }
+
+      const_iterator
+      cend() const noexcept
+      { return this->_M_impl._M_finish; }
+
+      const_reverse_iterator
+      crbegin() const noexcept
+      { return const_reverse_iterator(end()); }
+
+      const_reverse_iterator
+      crend() const noexcept
+      { return const_reverse_iterator(begin()); }
+
+
+      size_type
+      size() const noexcept
+      { return size_type(end() - begin()); }
+
+      size_type
+      max_size() const noexcept
+      {
+ const size_type __isize =
+   __gnu_cxx::__numeric_traits<difference_type>::__max
+   - int(_S_word_bit) + 1;
+ const size_type __asize
+   = _Bit_alloc_traits::max_size(_M_get_Bit_allocator());
+ return (__asize <= __isize / int(_S_word_bit)
+  ? __asize * int(_S_word_bit) : __isize);
+      }
+
+      size_type
+      capacity() const noexcept
+      { return size_type(const_iterator(this->_M_impl._M_end_addr(), 0)
+    - begin()); }
+
+      bool
+      empty() const noexcept
+      { return begin() == end(); }
+
+      reference
+      operator[](size_type __n)
+      {
+ return *iterator(this->_M_impl._M_start._M_p
+    + __n / int(_S_word_bit), __n % int(_S_word_bit));
+      }
+
+      const_reference
+      operator[](size_type __n) const
+      {
+ return *const_iterator(this->_M_impl._M_start._M_p
+        + __n / int(_S_word_bit), __n % int(_S_word_bit));
+      }
+
+    protected:
+      void
+      _M_range_check(size_type __n) const
+      {
+ if (__n >= this->size())
+   __throw_out_of_range_fmt(("vector<bool>::_M_range_check: __n " "(which is %zu) >= this->size() " "(which is %zu)")
+
+                            ,
+       __n, this->size());
+      }
+
+    public:
+      reference
+      at(size_type __n)
+      { _M_range_check(__n); return (*this)[__n]; }
+
+      const_reference
+      at(size_type __n) const
+      { _M_range_check(__n); return (*this)[__n]; }
+
+      void
+      reserve(size_type __n)
+      {
+ if (__n > max_size())
+   __throw_length_error(("vector::reserve"));
+ if (capacity() < __n)
+   _M_reallocate(__n);
+      }
+
+      reference
+      front()
+      { return *begin(); }
+
+      const_reference
+      front() const
+      { return *begin(); }
+
+      reference
+      back()
+      { return *(end() - 1); }
+
+      const_reference
+      back() const
+      { return *(end() - 1); }
+
+
+
+
+
+
+      void
+      data() noexcept { }
+
+      void
+      push_back(bool __x)
+      {
+ if (this->_M_impl._M_finish._M_p != this->_M_impl._M_end_addr())
+   *this->_M_impl._M_finish++ = __x;
+ else
+   _M_insert_aux(end(), __x);
+      }
+
+      void
+      swap(vector& __x) noexcept
+      {
+ std::swap(this->_M_impl._M_start, __x._M_impl._M_start);
+ std::swap(this->_M_impl._M_finish, __x._M_impl._M_finish);
+ std::swap(this->_M_impl._M_end_of_storage,
+    __x._M_impl._M_end_of_storage);
+ _Bit_alloc_traits::_S_on_swap(_M_get_Bit_allocator(),
+          __x._M_get_Bit_allocator());
+      }
+
+
+      static void
+      swap(reference __x, reference __y) noexcept
+      {
+ bool __tmp = __x;
+ __x = __y;
+ __y = __tmp;
+      }
+
+      iterator
+
+      insert(const_iterator __position, const bool& __x = bool())
+
+
+
+      {
+ const difference_type __n = __position - begin();
+ if (this->_M_impl._M_finish._M_p != this->_M_impl._M_end_addr()
+     && __position == end())
+   *this->_M_impl._M_finish++ = __x;
+ else
+   _M_insert_aux(__position._M_const_cast(), __x);
+ return begin() + __n;
+      }
+
+
+      template<typename _InputIterator,
+        typename = std::_RequireInputIter<_InputIterator>>
+ iterator
+ insert(const_iterator __position,
+        _InputIterator __first, _InputIterator __last)
+ {
+   difference_type __offset = __position - cbegin();
+   _M_insert_dispatch(__position._M_const_cast(),
+        __first, __last, __false_type());
+   return begin() + __offset;
+ }
+      iterator
+      insert(const_iterator __position, size_type __n, const bool& __x)
+      {
+ difference_type __offset = __position - cbegin();
+ _M_fill_insert(__position._M_const_cast(), __n, __x);
+ return begin() + __offset;
+      }
+
+
+
+
+
+
+
+      iterator
+      insert(const_iterator __p, initializer_list<bool> __l)
+      { return this->insert(__p, __l.begin(), __l.end()); }
+
+
+      void
+      pop_back()
+      { --this->_M_impl._M_finish; }
+
+      iterator
+
+      erase(const_iterator __position)
+
+
+
+      { return _M_erase(__position._M_const_cast()); }
+
+      iterator
+
+      erase(const_iterator __first, const_iterator __last)
+
+
+
+      { return _M_erase(__first._M_const_cast(), __last._M_const_cast()); }
+
+      void
+      resize(size_type __new_size, bool __x = bool())
+      {
+ if (__new_size < size())
+   _M_erase_at_end(begin() + difference_type(__new_size));
+ else
+   insert(end(), __new_size - size(), __x);
+      }
+
+
+      void
+      shrink_to_fit()
+      { _M_shrink_to_fit(); }
+
+
+      void
+      flip() noexcept
+      {
+ _Bit_type * const __end = this->_M_impl._M_end_addr();
+ for (_Bit_type * __p = this->_M_impl._M_start._M_p; __p != __end; ++__p)
+   *__p = ~*__p;
+      }
+
+      void
+      clear() noexcept
+      { _M_erase_at_end(begin()); }
+
+
+      template<typename... _Args>
+
+
+
+ void
+
+ emplace_back(_Args&&... __args)
+ {
+   push_back(bool(__args...));
+
+
+
+ }
+
+      template<typename... _Args>
+ iterator
+ emplace(const_iterator __pos, _Args&&... __args)
+ { return insert(__pos, bool(__args...)); }
+
+
+    protected:
+
+      iterator
+      _M_copy_aligned(const_iterator __first, const_iterator __last,
+        iterator __result)
+      {
+ _Bit_type* __q = std::copy(__first._M_p, __last._M_p, __result._M_p);
+ return std::copy(const_iterator(__last._M_p, 0), __last,
+    iterator(__q, 0));
+      }
+
+      void
+      _M_initialize(size_type __n)
+      {
+ if (__n)
+   {
+     _Bit_pointer __q = this->_M_allocate(__n);
+     this->_M_impl._M_end_of_storage = __q + _S_nword(__n);
+     this->_M_impl._M_start = iterator(std::__addressof(*__q), 0);
+   }
+ else
+   {
+     this->_M_impl._M_end_of_storage = _Bit_pointer();
+     this->_M_impl._M_start = iterator(0, 0);
+   }
+ this->_M_impl._M_finish = this->_M_impl._M_start + difference_type(__n);
+
+      }
+
+      void
+      _M_initialize_value(bool __x)
+      {
+ if (_Bit_type* __p = this->_M_impl._M_start._M_p)
+   __builtin_memset(__p, __x ? ~0 : 0,
+      (this->_M_impl._M_end_addr() - __p)
+      * sizeof(_Bit_type));
+      }
+
+      void
+      _M_reallocate(size_type __n);
+
+
+      bool
+      _M_shrink_to_fit();
+
+
+
+
+
+
+      template<typename _Integer>
+ void
+ _M_initialize_dispatch(_Integer __n, _Integer __x, __true_type)
+ {
+   _M_initialize(static_cast<size_type>(__n));
+   _M_initialize_value(__x);
+ }
+
+      template<typename _InputIterator>
+ void
+ _M_initialize_dispatch(_InputIterator __first, _InputIterator __last,
+          __false_type)
+ { _M_initialize_range(__first, __last,
+         std::__iterator_category(__first)); }
+
+      template<typename _InputIterator>
+ void
+ _M_initialize_range(_InputIterator __first, _InputIterator __last,
+       std::input_iterator_tag)
+ {
+   for (; __first != __last; ++__first)
+     push_back(*__first);
+ }
+
+      template<typename _ForwardIterator>
+ void
+ _M_initialize_range(_ForwardIterator __first, _ForwardIterator __last,
+       std::forward_iterator_tag)
+ {
+   const size_type __n = std::distance(__first, __last);
+   _M_initialize(__n);
+   std::copy(__first, __last, this->_M_impl._M_start);
+ }
+      void
+      _M_fill_assign(size_t __n, bool __x)
+      {
+ if (__n > size())
+   {
+     _M_initialize_value(__x);
+     insert(end(), __n - size(), __x);
+   }
+ else
+   {
+     _M_erase_at_end(begin() + __n);
+     _M_initialize_value(__x);
+   }
+      }
+
+      template<typename _InputIterator>
+ void
+ _M_assign_aux(_InputIterator __first, _InputIterator __last,
+        std::input_iterator_tag)
+ {
+   iterator __cur = begin();
+   for (; __first != __last && __cur != end(); ++__cur, ++__first)
+     *__cur = *__first;
+   if (__first == __last)
+     _M_erase_at_end(__cur);
+   else
+     insert(end(), __first, __last);
+ }
+
+      template<typename _ForwardIterator>
+ void
+ _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
+        std::forward_iterator_tag)
+ {
+   const size_type __len = std::distance(__first, __last);
+   if (__len < size())
+     _M_erase_at_end(std::copy(__first, __last, begin()));
+   else
+     {
+       _ForwardIterator __mid = __first;
+       std::advance(__mid, size());
+       std::copy(__first, __mid, begin());
+       insert(end(), __mid, __last);
+     }
+ }
+
+
+
+
+
+      template<typename _Integer>
+ void
+ _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __x,
+      __true_type)
+ { _M_fill_insert(__pos, __n, __x); }
+
+      template<typename _InputIterator>
+ void
+ _M_insert_dispatch(iterator __pos,
+      _InputIterator __first, _InputIterator __last,
+      __false_type)
+ { _M_insert_range(__pos, __first, __last,
+     std::__iterator_category(__first)); }
+
+      void
+      _M_fill_insert(iterator __position, size_type __n, bool __x);
+
+      template<typename _InputIterator>
+ void
+ _M_insert_range(iterator __pos, _InputIterator __first,
+   _InputIterator __last, std::input_iterator_tag)
+ {
+   for (; __first != __last; ++__first)
+     {
+       __pos = insert(__pos, *__first);
+       ++__pos;
+     }
+ }
+
+      template<typename _ForwardIterator>
+ void
+ _M_insert_range(iterator __position, _ForwardIterator __first,
+   _ForwardIterator __last, std::forward_iterator_tag);
+
+      void
+      _M_insert_aux(iterator __position, bool __x);
+
+      size_type
+      _M_check_len(size_type __n, const char* __s) const
+      {
+ if (max_size() - size() < __n)
+   __throw_length_error((__s));
+
+ const size_type __len = size() + std::max(size(), __n);
+ return (__len < size() || __len > max_size()) ? max_size() : __len;
+      }
+
+      void
+      _M_erase_at_end(iterator __pos)
+      { this->_M_impl._M_finish = __pos; }
+
+      iterator
+      _M_erase(iterator __pos);
+
+      iterator
+      _M_erase(iterator __first, iterator __last);
+  };
+
+
+
+}
+
+
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+
+  template<typename _Alloc>
+    struct hash<std::vector<bool, _Alloc>>
+    : public __hash_base<size_t, std::vector<bool, _Alloc>>
+    {
+      size_t
+      operator()(const std::vector<bool, _Alloc>&) const noexcept;
+    };
+
+
+}
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+  template<typename _Tp, typename _Alloc>
+    void
+    vector<_Tp, _Alloc>::
+    reserve(size_type __n)
+    {
+      if (__n > this->max_size())
+ __throw_length_error(("vector::reserve"));
+      if (this->capacity() < __n)
+ {
+   const size_type __old_size = size();
+   pointer __tmp = _M_allocate_and_copy(__n,
+     std::__make_move_if_noexcept_iterator(this->_M_impl._M_start),
+     std::__make_move_if_noexcept_iterator(this->_M_impl._M_finish));
+   ;
+   std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
+   _M_get_Tp_allocator());
+   _M_deallocate(this->_M_impl._M_start,
+   this->_M_impl._M_end_of_storage
+   - this->_M_impl._M_start);
+   this->_M_impl._M_start = __tmp;
+   this->_M_impl._M_finish = __tmp + __old_size;
+   this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n;
+ }
+    }
+
+
+  template<typename _Tp, typename _Alloc>
+    template<typename... _Args>
+
+
+
+      void
+
+      vector<_Tp, _Alloc>::
+      emplace_back(_Args&&... __args)
+      {
+ if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage)
+   {
+     ;
+     _Alloc_traits::construct(this->_M_impl, this->_M_impl._M_finish,
+         std::forward<_Args>(__args)...);
+     ++this->_M_impl._M_finish;
+     ;
+   }
+ else
+   _M_realloc_insert(end(), std::forward<_Args>(__args)...);
+
+
+
+      }
+
+
+  template<typename _Tp, typename _Alloc>
+    typename vector<_Tp, _Alloc>::iterator
+    vector<_Tp, _Alloc>::
+
+    insert(const_iterator __position, const value_type& __x)
+
+
+
+    {
+      const size_type __n = __position - begin();
+      if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage)
+ if (__position == end())
+   {
+     ;
+     _Alloc_traits::construct(this->_M_impl, this->_M_impl._M_finish,
+         __x);
+     ++this->_M_impl._M_finish;
+     ;
+   }
+ else
+   {
+
+     const auto __pos = begin() + (__position - cbegin());
+
+
+     _Temporary_value __x_copy(this, __x);
+     _M_insert_aux(__pos, std::move(__x_copy._M_val()));
+
+
+
+   }
+      else
+
+ _M_realloc_insert(begin() + (__position - cbegin()), __x);
+
+
+
+
+      return iterator(this->_M_impl._M_start + __n);
+    }
+
+  template<typename _Tp, typename _Alloc>
+    typename vector<_Tp, _Alloc>::iterator
+    vector<_Tp, _Alloc>::
+    _M_erase(iterator __position)
+    {
+      if (__position + 1 != end())
+ std::move(__position + 1, end(), __position);
+      --this->_M_impl._M_finish;
+      _Alloc_traits::destroy(this->_M_impl, this->_M_impl._M_finish);
+      ;
+      return __position;
+    }
+
+  template<typename _Tp, typename _Alloc>
+    typename vector<_Tp, _Alloc>::iterator
+    vector<_Tp, _Alloc>::
+    _M_erase(iterator __first, iterator __last)
+    {
+      if (__first != __last)
+ {
+   if (__last != end())
+     std::move(__last, end(), __first);
+   _M_erase_at_end(__first.base() + (end() - __last));
+ }
+      return __first;
+    }
+
+  template<typename _Tp, typename _Alloc>
+    vector<_Tp, _Alloc>&
+    vector<_Tp, _Alloc>::
+    operator=(const vector<_Tp, _Alloc>& __x)
+    {
+      if (&__x != this)
+ {
+   ;
+
+   if (_Alloc_traits::_S_propagate_on_copy_assign())
+     {
+       if (!_Alloc_traits::_S_always_equal()
+           && _M_get_Tp_allocator() != __x._M_get_Tp_allocator())
+         {
+
+    this->clear();
+    _M_deallocate(this->_M_impl._M_start,
+    this->_M_impl._M_end_of_storage
+    - this->_M_impl._M_start);
+    this->_M_impl._M_start = nullptr;
+    this->_M_impl._M_finish = nullptr;
+    this->_M_impl._M_end_of_storage = nullptr;
+  }
+       std::__alloc_on_copy(_M_get_Tp_allocator(),
+       __x._M_get_Tp_allocator());
+     }
+
+   const size_type __xlen = __x.size();
+   if (__xlen > capacity())
+     {
+       pointer __tmp = _M_allocate_and_copy(__xlen, __x.begin(),
+         __x.end());
+       std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
+       _M_get_Tp_allocator());
+       _M_deallocate(this->_M_impl._M_start,
+       this->_M_impl._M_end_of_storage
+       - this->_M_impl._M_start);
+       this->_M_impl._M_start = __tmp;
+       this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __xlen;
+     }
+   else if (size() >= __xlen)
+     {
+       std::_Destroy(std::copy(__x.begin(), __x.end(), begin()),
+       end(), _M_get_Tp_allocator());
+     }
+   else
+     {
+       std::copy(__x._M_impl._M_start, __x._M_impl._M_start + size(),
+   this->_M_impl._M_start);
+       std::__uninitialized_copy_a(__x._M_impl._M_start + size(),
+       __x._M_impl._M_finish,
+       this->_M_impl._M_finish,
+       _M_get_Tp_allocator());
+     }
+   this->_M_impl._M_finish = this->_M_impl._M_start + __xlen;
+ }
+      return *this;
+    }
+
+  template<typename _Tp, typename _Alloc>
+    void
+    vector<_Tp, _Alloc>::
+    _M_fill_assign(size_t __n, const value_type& __val)
+    {
+      if (__n > capacity())
+ {
+   vector __tmp(__n, __val, _M_get_Tp_allocator());
+   __tmp._M_impl._M_swap_data(this->_M_impl);
+ }
+      else if (__n > size())
+ {
+   std::fill(begin(), end(), __val);
+   const size_type __add = __n - size();
+   ;
+   this->_M_impl._M_finish =
+     std::__uninitialized_fill_n_a(this->_M_impl._M_finish,
+       __add, __val, _M_get_Tp_allocator());
+   ;
+ }
+      else
+        _M_erase_at_end(std::fill_n(this->_M_impl._M_start, __n, __val));
+    }
+
+  template<typename _Tp, typename _Alloc>
+    template<typename _InputIterator>
+      void
+      vector<_Tp, _Alloc>::
+      _M_assign_aux(_InputIterator __first, _InputIterator __last,
+      std::input_iterator_tag)
+      {
+ pointer __cur(this->_M_impl._M_start);
+ for (; __first != __last && __cur != this->_M_impl._M_finish;
+      ++__cur, ++__first)
+   *__cur = *__first;
+ if (__first == __last)
+   _M_erase_at_end(__cur);
+ else
+   _M_range_insert(end(), __first, __last,
+     std::__iterator_category(__first));
+      }
+
+  template<typename _Tp, typename _Alloc>
+    template<typename _ForwardIterator>
+      void
+      vector<_Tp, _Alloc>::
+      _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
+      std::forward_iterator_tag)
+      {
+ const size_type __len = std::distance(__first, __last);
+
+ if (__len > capacity())
+   {
+     pointer __tmp(_M_allocate_and_copy(__len, __first, __last));
+     ;
+     std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
+     _M_get_Tp_allocator());
+     _M_deallocate(this->_M_impl._M_start,
+     this->_M_impl._M_end_of_storage
+     - this->_M_impl._M_start);
+     this->_M_impl._M_start = __tmp;
+     this->_M_impl._M_finish = this->_M_impl._M_start + __len;
+     this->_M_impl._M_end_of_storage = this->_M_impl._M_finish;
+   }
+ else if (size() >= __len)
+   _M_erase_at_end(std::copy(__first, __last, this->_M_impl._M_start));
+ else
+   {
+     _ForwardIterator __mid = __first;
+     std::advance(__mid, size());
+     std::copy(__first, __mid, this->_M_impl._M_start);
+     const size_type __attribute__((__unused__)) __n = __len - size();
+     ;
+     this->_M_impl._M_finish =
+       std::__uninitialized_copy_a(__mid, __last,
+       this->_M_impl._M_finish,
+       _M_get_Tp_allocator());
+     ;
+   }
+      }
+
+
+  template<typename _Tp, typename _Alloc>
+    auto
+    vector<_Tp, _Alloc>::
+    _M_insert_rval(const_iterator __position, value_type&& __v) -> iterator
+    {
+      const auto __n = __position - cbegin();
+      if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage)
+ if (__position == cend())
+   {
+     ;
+     _Alloc_traits::construct(this->_M_impl, this->_M_impl._M_finish,
+         std::move(__v));
+     ++this->_M_impl._M_finish;
+     ;
+   }
+ else
+   _M_insert_aux(begin() + __n, std::move(__v));
+      else
+ _M_realloc_insert(begin() + __n, std::move(__v));
+
+      return iterator(this->_M_impl._M_start + __n);
+    }
+
+  template<typename _Tp, typename _Alloc>
+    template<typename... _Args>
+      auto
+      vector<_Tp, _Alloc>::
+      _M_emplace_aux(const_iterator __position, _Args&&... __args)
+      -> iterator
+      {
+ const auto __n = __position - cbegin();
+ if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage)
+   if (__position == cend())
+     {
+       ;
+       _Alloc_traits::construct(this->_M_impl, this->_M_impl._M_finish,
+           std::forward<_Args>(__args)...);
+       ++this->_M_impl._M_finish;
+       ;
+     }
+   else
+     {
+
+
+
+       _Temporary_value __tmp(this, std::forward<_Args>(__args)...);
+       _M_insert_aux(begin() + __n, std::move(__tmp._M_val()));
+     }
+ else
+   _M_realloc_insert(begin() + __n, std::forward<_Args>(__args)...);
+
+ return iterator(this->_M_impl._M_start + __n);
+      }
+
+  template<typename _Tp, typename _Alloc>
+    template<typename _Arg>
+      void
+      vector<_Tp, _Alloc>::
+      _M_insert_aux(iterator __position, _Arg&& __arg)
+
+
+
+
+
+
+    {
+      ;
+      _Alloc_traits::construct(this->_M_impl, this->_M_impl._M_finish,
+          std::move(*(this->_M_impl._M_finish - 1)));
+      ++this->_M_impl._M_finish;
+      ;
+
+
+
+      std::move_backward(__position.base(), this->_M_impl._M_finish - 2, this->_M_impl._M_finish - 1)
+
+                                     ;
+
+
+
+      *__position = std::forward<_Arg>(__arg);
+
+    }
+
+
+  template<typename _Tp, typename _Alloc>
+    template<typename... _Args>
+      void
+      vector<_Tp, _Alloc>::
+      _M_realloc_insert(iterator __position, _Args&&... __args)
+
+
+
+
+
+
+    {
+      const size_type __len =
+ _M_check_len(size_type(1), "vector::_M_realloc_insert");
+      pointer __old_start = this->_M_impl._M_start;
+      pointer __old_finish = this->_M_impl._M_finish;
+      const size_type __elems_before = __position - begin();
+      pointer __new_start(this->_M_allocate(__len));
+      pointer __new_finish(__new_start);
+      if (true)
+ {
+
+
+
+
+
+   _Alloc_traits::construct(this->_M_impl,
+       __new_start + __elems_before,
+
+       std::forward<_Args>(__args)...);
+
+
+
+   __new_finish = pointer();
+
+   __new_finish
+     = std::__uninitialized_move_if_noexcept_a
+     (__old_start, __position.base(),
+      __new_start, _M_get_Tp_allocator());
+
+   ++__new_finish;
+
+   __new_finish
+     = std::__uninitialized_move_if_noexcept_a
+     (__position.base(), __old_finish,
+      __new_finish, _M_get_Tp_allocator());
+ }
+      if (false)
+ {
+   if (!__new_finish)
+     _Alloc_traits::destroy(this->_M_impl,
+       __new_start + __elems_before);
+   else
+     std::_Destroy(__new_start, __new_finish, _M_get_Tp_allocator());
+   _M_deallocate(__new_start, __len);
+   ;
+ }
+      ;
+      std::_Destroy(__old_start, __old_finish, _M_get_Tp_allocator());
+      _M_deallocate(__old_start,
+      this->_M_impl._M_end_of_storage - __old_start);
+      this->_M_impl._M_start = __new_start;
+      this->_M_impl._M_finish = __new_finish;
+      this->_M_impl._M_end_of_storage = __new_start + __len;
+    }
+
+  template<typename _Tp, typename _Alloc>
+    void
+    vector<_Tp, _Alloc>::
+    _M_fill_insert(iterator __position, size_type __n, const value_type& __x)
+    {
+      if (__n != 0)
+ {
+   if (size_type(this->_M_impl._M_end_of_storage
+   - this->_M_impl._M_finish) >= __n)
+     {
+
+
+
+       _Temporary_value __tmp(this, __x);
+       value_type& __x_copy = __tmp._M_val();
+
+       const size_type __elems_after = end() - __position;
+       pointer __old_finish(this->_M_impl._M_finish);
+       if (__elems_after > __n)
+  {
+    ;
+    std::__uninitialized_move_a(this->_M_impl._M_finish - __n,
+           this->_M_impl._M_finish,
+           this->_M_impl._M_finish,
+           _M_get_Tp_allocator());
+    this->_M_impl._M_finish += __n;
+    ;
+    std::move_backward(__position.base(), __old_finish - __n, __old_finish)
+                                        ;
+    std::fill(__position.base(), __position.base() + __n,
+       __x_copy);
+  }
+       else
+  {
+    ;
+    this->_M_impl._M_finish =
+      std::__uninitialized_fill_n_a(this->_M_impl._M_finish,
+        __n - __elems_after,
+        __x_copy,
+        _M_get_Tp_allocator());
+    ;
+    std::__uninitialized_move_a(__position.base(), __old_finish,
+           this->_M_impl._M_finish,
+           _M_get_Tp_allocator());
+    this->_M_impl._M_finish += __elems_after;
+    ;
+    std::fill(__position.base(), __old_finish, __x_copy);
+  }
+     }
+   else
+     {
+       const size_type __len =
+  _M_check_len(__n, "vector::_M_fill_insert");
+       const size_type __elems_before = __position - begin();
+       pointer __new_start(this->_M_allocate(__len));
+       pointer __new_finish(__new_start);
+       if (true)
+  {
+
+    std::__uninitialized_fill_n_a(__new_start + __elems_before,
+      __n, __x,
+      _M_get_Tp_allocator());
+    __new_finish = pointer();
+
+    __new_finish
+      = std::__uninitialized_move_if_noexcept_a
+      (this->_M_impl._M_start, __position.base(),
+       __new_start, _M_get_Tp_allocator());
+
+    __new_finish += __n;
+
+    __new_finish
+      = std::__uninitialized_move_if_noexcept_a
+      (__position.base(), this->_M_impl._M_finish,
+       __new_finish, _M_get_Tp_allocator());
+  }
+       if (false)
+  {
+    if (!__new_finish)
+      std::_Destroy(__new_start + __elems_before,
+      __new_start + __elems_before + __n,
+      _M_get_Tp_allocator());
+    else
+      std::_Destroy(__new_start, __new_finish,
+      _M_get_Tp_allocator());
+    _M_deallocate(__new_start, __len);
+    ;
+  }
+       ;
+       std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
+       _M_get_Tp_allocator());
+       _M_deallocate(this->_M_impl._M_start,
+       this->_M_impl._M_end_of_storage
+       - this->_M_impl._M_start);
+       this->_M_impl._M_start = __new_start;
+       this->_M_impl._M_finish = __new_finish;
+       this->_M_impl._M_end_of_storage = __new_start + __len;
+     }
+ }
+    }
+
+
+  template<typename _Tp, typename _Alloc>
+    void
+    vector<_Tp, _Alloc>::
+    _M_default_append(size_type __n)
+    {
+      if (__n != 0)
+ {
+   size_type __size = size();
+   size_type __navail = size_type(this->_M_impl._M_end_of_storage
+      - this->_M_impl._M_finish);
+
+   if (__size > max_size() || __navail > max_size() - __size)
+     __builtin_unreachable();
+
+   if (__navail >= __n)
+     {
+       ;
+       this->_M_impl._M_finish =
+  std::__uninitialized_default_n_a(this->_M_impl._M_finish,
+       __n, _M_get_Tp_allocator());
+       ;
+     }
+   else
+     {
+       const size_type __len =
+  _M_check_len(__n, "vector::_M_default_append");
+       const size_type __old_size = __size;
+       pointer __new_start(this->_M_allocate(__len));
+       pointer __new_finish(__new_start);
+       if (true)
+  {
+    __new_finish
+      = std::__uninitialized_move_if_noexcept_a
+      (this->_M_impl._M_start, this->_M_impl._M_finish,
+       __new_start, _M_get_Tp_allocator());
+    __new_finish =
+      std::__uninitialized_default_n_a(__new_finish, __n,
+           _M_get_Tp_allocator());
+  }
+       if (false)
+  {
+    std::_Destroy(__new_start, __new_finish,
+    _M_get_Tp_allocator());
+    _M_deallocate(__new_start, __len);
+    ;
+  }
+       ;
+       std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
+       _M_get_Tp_allocator());
+       _M_deallocate(this->_M_impl._M_start,
+       this->_M_impl._M_end_of_storage
+       - this->_M_impl._M_start);
+       this->_M_impl._M_start = __new_start;
+       this->_M_impl._M_finish = __new_finish;
+       this->_M_impl._M_end_of_storage = __new_start + __len;
+     }
+ }
+    }
+
+  template<typename _Tp, typename _Alloc>
+    bool
+    vector<_Tp, _Alloc>::
+    _M_shrink_to_fit()
+    {
+      if (capacity() == size())
+ return false;
+      ;
+      return std::__shrink_to_fit_aux<vector>::_S_do_it(*this);
+    }
+
+
+  template<typename _Tp, typename _Alloc>
+    template<typename _InputIterator>
+      void
+      vector<_Tp, _Alloc>::
+      _M_range_insert(iterator __pos, _InputIterator __first,
+        _InputIterator __last, std::input_iterator_tag)
+      {
+ if (__pos == end())
+   {
+     for (; __first != __last; ++__first)
+       insert(end(), *__first);
+   }
+ else if (__first != __last)
+   {
+     vector __tmp(__first, __last, _M_get_Tp_allocator());
+     insert(__pos,
+     std::make_move_iterator(__tmp.begin()),
+     std::make_move_iterator(__tmp.end()));
+   }
+      }
+
+  template<typename _Tp, typename _Alloc>
+    template<typename _ForwardIterator>
+      void
+      vector<_Tp, _Alloc>::
+      _M_range_insert(iterator __position, _ForwardIterator __first,
+        _ForwardIterator __last, std::forward_iterator_tag)
+      {
+ if (__first != __last)
+   {
+     const size_type __n = std::distance(__first, __last);
+     if (size_type(this->_M_impl._M_end_of_storage
+     - this->_M_impl._M_finish) >= __n)
+       {
+  const size_type __elems_after = end() - __position;
+  pointer __old_finish(this->_M_impl._M_finish);
+  if (__elems_after > __n)
+    {
+      ;
+      std::__uninitialized_move_a(this->_M_impl._M_finish - __n,
+      this->_M_impl._M_finish,
+      this->_M_impl._M_finish,
+      _M_get_Tp_allocator());
+      this->_M_impl._M_finish += __n;
+      ;
+      std::move_backward(__position.base(), __old_finish - __n, __old_finish)
+                                          ;
+      std::copy(__first, __last, __position);
+    }
+  else
+    {
+      _ForwardIterator __mid = __first;
+      std::advance(__mid, __elems_after);
+      ;
+      std::__uninitialized_copy_a(__mid, __last,
+      this->_M_impl._M_finish,
+      _M_get_Tp_allocator());
+      this->_M_impl._M_finish += __n - __elems_after;
+      ;
+      std::__uninitialized_move_a(__position.base(),
+      __old_finish,
+      this->_M_impl._M_finish,
+      _M_get_Tp_allocator());
+      this->_M_impl._M_finish += __elems_after;
+      ;
+      std::copy(__first, __mid, __position);
+    }
+       }
+     else
+       {
+  const size_type __len =
+    _M_check_len(__n, "vector::_M_range_insert");
+  pointer __new_start(this->_M_allocate(__len));
+  pointer __new_finish(__new_start);
+  if (true)
+    {
+      __new_finish
+        = std::__uninitialized_move_if_noexcept_a
+        (this->_M_impl._M_start, __position.base(),
+         __new_start, _M_get_Tp_allocator());
+      __new_finish
+        = std::__uninitialized_copy_a(__first, __last,
+          __new_finish,
+          _M_get_Tp_allocator());
+      __new_finish
+        = std::__uninitialized_move_if_noexcept_a
+        (__position.base(), this->_M_impl._M_finish,
+         __new_finish, _M_get_Tp_allocator());
+    }
+  if (false)
+    {
+      std::_Destroy(__new_start, __new_finish,
+      _M_get_Tp_allocator());
+      _M_deallocate(__new_start, __len);
+      ;
+    }
+  ;
+  std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
+         _M_get_Tp_allocator());
+  _M_deallocate(this->_M_impl._M_start,
+         this->_M_impl._M_end_of_storage
+         - this->_M_impl._M_start);
+  this->_M_impl._M_start = __new_start;
+  this->_M_impl._M_finish = __new_finish;
+  this->_M_impl._M_end_of_storage = __new_start + __len;
+       }
+   }
+      }
+
+
+
+  template<typename _Alloc>
+    void
+    vector<bool, _Alloc>::
+    _M_reallocate(size_type __n)
+    {
+      _Bit_pointer __q = this->_M_allocate(__n);
+      iterator __start(std::__addressof(*__q), 0);
+      iterator __finish(_M_copy_aligned(begin(), end(), __start));
+      this->_M_deallocate();
+      this->_M_impl._M_start = __start;
+      this->_M_impl._M_finish = __finish;
+      this->_M_impl._M_end_of_storage = __q + _S_nword(__n);
+    }
+
+  template<typename _Alloc>
+    void
+    vector<bool, _Alloc>::
+    _M_fill_insert(iterator __position, size_type __n, bool __x)
+    {
+      if (__n == 0)
+ return;
+      if (capacity() - size() >= __n)
+ {
+   std::copy_backward(__position, end(),
+        this->_M_impl._M_finish + difference_type(__n));
+   std::fill(__position, __position + difference_type(__n), __x);
+   this->_M_impl._M_finish += difference_type(__n);
+ }
+      else
+ {
+   const size_type __len =
+     _M_check_len(__n, "vector<bool>::_M_fill_insert");
+   _Bit_pointer __q = this->_M_allocate(__len);
+   iterator __start(std::__addressof(*__q), 0);
+   iterator __i = _M_copy_aligned(begin(), __position, __start);
+   std::fill(__i, __i + difference_type(__n), __x);
+   iterator __finish = std::copy(__position, end(),
+     __i + difference_type(__n));
+   this->_M_deallocate();
+   this->_M_impl._M_end_of_storage = __q + _S_nword(__len);
+   this->_M_impl._M_start = __start;
+   this->_M_impl._M_finish = __finish;
+ }
+    }
+
+  template<typename _Alloc>
+    template<typename _ForwardIterator>
+      void
+      vector<bool, _Alloc>::
+      _M_insert_range(iterator __position, _ForwardIterator __first,
+        _ForwardIterator __last, std::forward_iterator_tag)
+      {
+ if (__first != __last)
+   {
+     size_type __n = std::distance(__first, __last);
+     if (capacity() - size() >= __n)
+       {
+  std::copy_backward(__position, end(),
+       this->_M_impl._M_finish
+       + difference_type(__n));
+  std::copy(__first, __last, __position);
+  this->_M_impl._M_finish += difference_type(__n);
+       }
+     else
+       {
+  const size_type __len =
+    _M_check_len(__n, "vector<bool>::_M_insert_range");
+  _Bit_pointer __q = this->_M_allocate(__len);
+  iterator __start(std::__addressof(*__q), 0);
+  iterator __i = _M_copy_aligned(begin(), __position, __start);
+  __i = std::copy(__first, __last, __i);
+  iterator __finish = std::copy(__position, end(), __i);
+  this->_M_deallocate();
+  this->_M_impl._M_end_of_storage = __q + _S_nword(__len);
+  this->_M_impl._M_start = __start;
+  this->_M_impl._M_finish = __finish;
+       }
+   }
+      }
+
+  template<typename _Alloc>
+    void
+    vector<bool, _Alloc>::
+    _M_insert_aux(iterator __position, bool __x)
+    {
+      if (this->_M_impl._M_finish._M_p != this->_M_impl._M_end_addr())
+ {
+   std::copy_backward(__position, this->_M_impl._M_finish,
+        this->_M_impl._M_finish + 1);
+   *__position = __x;
+   ++this->_M_impl._M_finish;
+ }
+      else
+ {
+   const size_type __len =
+     _M_check_len(size_type(1), "vector<bool>::_M_insert_aux");
+   _Bit_pointer __q = this->_M_allocate(__len);
+   iterator __start(std::__addressof(*__q), 0);
+   iterator __i = _M_copy_aligned(begin(), __position, __start);
+   *__i++ = __x;
+   iterator __finish = std::copy(__position, end(), __i);
+   this->_M_deallocate();
+   this->_M_impl._M_end_of_storage = __q + _S_nword(__len);
+   this->_M_impl._M_start = __start;
+   this->_M_impl._M_finish = __finish;
+ }
+    }
+
+  template<typename _Alloc>
+    typename vector<bool, _Alloc>::iterator
+    vector<bool, _Alloc>::
+    _M_erase(iterator __position)
+    {
+      if (__position + 1 != end())
+        std::copy(__position + 1, end(), __position);
+      --this->_M_impl._M_finish;
+      return __position;
+    }
+
+  template<typename _Alloc>
+    typename vector<bool, _Alloc>::iterator
+    vector<bool, _Alloc>::
+    _M_erase(iterator __first, iterator __last)
+    {
+      if (__first != __last)
+ _M_erase_at_end(std::copy(__last, end(), __first));
+      return __first;
+    }
+
+
+  template<typename _Alloc>
+    bool
+    vector<bool, _Alloc>::
+    _M_shrink_to_fit()
+    {
+      if (capacity() - size() < int(_S_word_bit))
+ return false;
+      if (true)
+ {
+   _M_reallocate(size());
+   return true;
+ }
+      if (false)
+ { return false; }
+    }
+
+
+
+
+}
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+  template<typename _Alloc>
+    size_t
+    hash<std::vector<bool, _Alloc>>::
+    operator()(const std::vector<bool, _Alloc>& __b) const noexcept
+    {
+      size_t __hash = 0;
+      using std::_S_word_bit;
+      using std::_Bit_type;
+
+      const size_t __words = __b.size() / _S_word_bit;
+      if (__words)
+ {
+   const size_t __clength = __words * sizeof(_Bit_type);
+   __hash = std::_Hash_impl::hash(__b._M_impl._M_start._M_p, __clength);
+ }
+
+      const size_t __extrabits = __b.size() % _S_word_bit;
+      if (__extrabits)
+ {
+   _Bit_type __hiword = *__b._M_impl._M_finish._M_p;
+   __hiword &= ~((~static_cast<_Bit_type>(0)) << __extrabits);
+
+   const size_t __clength
+     = (__extrabits + 8 - 1) / 8;
+   if (__words)
+     __hash = std::_Hash_impl::hash(&__hiword, __clength, __hash);
+   else
+     __hash = std::_Hash_impl::hash(&__hiword, __clength);
+ }
+
+      return __hash;
+    }
+
+
+}
+
+
+namespace llvm {
+  template<typename T>
+  class ArrayRef {
+  public:
+    using iterator = const T *;
+    using const_iterator = const T *;
+    using size_type = size_t;
+    using reverse_iterator = std::reverse_iterator<iterator>;
+
+  private:
+
+    const T *Data = nullptr;
+
+
+    size_type Length = 0;
+
+  public:
+
+
+
+
+                 ArrayRef() = default;
+
+
+                 ArrayRef(NoneType) {}
+
+
+                 ArrayRef(const T &OneElt)
+      : Data(&OneElt), Length(1) {}
+
+
+                 ArrayRef(const T *data, size_t length)
+      : Data(data), Length(length) {}
+
+
+    ArrayRef(const T *begin, const T *end)
+      : Data(begin), Length(end - begin) {}
+
+
+
+
+    template<typename U>
+                 ArrayRef(const SmallVectorTemplateCommon<T, U> &Vec)
+      : Data(Vec.data()), Length(Vec.size()) {
+    }
+
+
+    template<typename A>
+                 ArrayRef(const std::vector<T, A> &Vec)
+      : Data(Vec.data()), Length(Vec.size()) {}
+
+
+    template <size_t N>
+                 constexpr ArrayRef(const std::array<T, N> &Arr)
+        : Data(Arr.data()), Length(N) {}
+
+
+    template <size_t N>
+                 constexpr ArrayRef(const T (&Arr)[N]) : Data(Arr), Length(N) {}
+
+
+                 ArrayRef(const std::initializer_list<T> &Vec)
+    : Data(Vec.begin() == Vec.end() ? (T*)nullptr : Vec.begin()),
+      Length(Vec.size()) {}
+
+
+
+    template <typename U>
+    ArrayRef(
+        const ArrayRef<U *> &A,
+        typename std::enable_if<
+           std::is_convertible<U *const *, T const *>::value>::type * = nullptr)
+      : Data(A.data()), Length(A.size()) {}
+
+
+
+
+    template<typename U, typename DummyT>
+                 ArrayRef(
+      const SmallVectorTemplateCommon<U *, DummyT> &Vec,
+      typename std::enable_if<
+          std::is_convertible<U *const *, T const *>::value>::type * = nullptr)
+      : Data(Vec.data()), Length(Vec.size()) {
+    }
+
+
+
+    template<typename U, typename A>
+    ArrayRef(const std::vector<U *, A> &Vec,
+             typename std::enable_if<
+                 std::is_convertible<U *const *, T const *>::value>::type* = 0)
+      : Data(Vec.data()), Length(Vec.size()) {}
+
+
+
+
+
+    iterator begin() const { return Data; }
+    iterator end() const { return Data + Length; }
+
+    reverse_iterator rbegin() const { return reverse_iterator(end()); }
+    reverse_iterator rend() const { return reverse_iterator(begin()); }
+
+
+    bool empty() const { return Length == 0; }
+
+    const T *data() const { return Data; }
+
+
+    size_t size() const { return Length; }
+
+
+    const T &front() const {
+      
+     ((
+     !empty()
+     ) ? static_cast<void> (0) : __assert_fail (
+     "!empty()"
+     , "/home/trippels/llvm/llvm/include/llvm/ADT/ArrayRef.h", 153, __PRETTY_FUNCTION__))
+                     ;
+      return Data[0];
+    }
+
+
+    const T &back() const {
+      
+     ((
+     !empty()
+     ) ? static_cast<void> (0) : __assert_fail (
+     "!empty()"
+     , "/home/trippels/llvm/llvm/include/llvm/ADT/ArrayRef.h", 159, __PRETTY_FUNCTION__))
+                     ;
+      return Data[Length-1];
+    }
+
+
+    template <typename Allocator> ArrayRef<T> copy(Allocator &A) {
+      T *Buff = A.template Allocate<T>(Length);
+      std::uninitialized_copy(begin(), end(), Buff);
+      return ArrayRef<T>(Buff, Length);
+    }
+
+
+    bool equals(ArrayRef RHS) const {
+      if (Length != RHS.Length)
+        return false;
+      return std::equal(begin(), end(), RHS.begin());
+    }
+
+
+
+    ArrayRef<T> slice(size_t N, size_t M) const {
+      
+     ((
+     N+M <= size() && "Invalid specifier"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "N+M <= size() && \"Invalid specifier\""
+     , "/home/trippels/llvm/llvm/include/llvm/ADT/ArrayRef.h", 180, __PRETTY_FUNCTION__))
+                                                 ;
+      return ArrayRef<T>(data()+N, M);
+    }
+
+
+    ArrayRef<T> slice(size_t N) const { return slice(N, size() - N); }
+
+
+    ArrayRef<T> drop_front(size_t N = 1) const {
+      
+     ((
+     size() >= N && "Dropping more elements than exist"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "size() >= N && \"Dropping more elements than exist\""
+     , "/home/trippels/llvm/llvm/include/llvm/ADT/ArrayRef.h", 189, __PRETTY_FUNCTION__))
+                                                               ;
+      return slice(N, size() - N);
+    }
+
+
+    ArrayRef<T> drop_back(size_t N = 1) const {
+      
+     ((
+     size() >= N && "Dropping more elements than exist"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "size() >= N && \"Dropping more elements than exist\""
+     , "/home/trippels/llvm/llvm/include/llvm/ADT/ArrayRef.h", 195, __PRETTY_FUNCTION__))
+                                                               ;
+      return slice(0, size() - N);
+    }
+
+
+
+    template <class PredicateT> ArrayRef<T> drop_while(PredicateT Pred) const {
+      return ArrayRef<T>(find_if_not(*this, Pred), end());
+    }
+
+
+
+    template <class PredicateT> ArrayRef<T> drop_until(PredicateT Pred) const {
+      return ArrayRef<T>(find_if(*this, Pred), end());
+    }
+
+
+    ArrayRef<T> take_front(size_t N = 1) const {
+      if (N >= size())
+        return *this;
+      return drop_back(size() - N);
+    }
+
+
+    ArrayRef<T> take_back(size_t N = 1) const {
+      if (N >= size())
+        return *this;
+      return drop_front(size() - N);
+    }
+
+
+
+    template <class PredicateT> ArrayRef<T> take_while(PredicateT Pred) const {
+      return ArrayRef<T>(begin(), find_if_not(*this, Pred));
+    }
+
+
+
+    template <class PredicateT> ArrayRef<T> take_until(PredicateT Pred) const {
+      return ArrayRef<T>(begin(), find_if(*this, Pred));
+    }
+
+
+
+
+    const T &operator[](size_t Index) const {
+      
+     ((
+     Index < Length && "Invalid index!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "Index < Length && \"Invalid index!\""
+     , "/home/trippels/llvm/llvm/include/llvm/ADT/ArrayRef.h", 241, __PRETTY_FUNCTION__))
+                                               ;
+      return Data[Index];
+    }
+
+
+
+
+
+    template <typename U>
+    typename std::enable_if<std::is_same<U, T>::value, ArrayRef<T>>::type &
+    operator=(U &&Temporary) = delete;
+
+
+
+
+
+    template <typename U>
+    typename std::enable_if<std::is_same<U, T>::value, ArrayRef<T>>::type &
+    operator=(std::initializer_list<U>) = delete;
+
+
+
+
+    std::vector<T> vec() const {
+      return std::vector<T>(Data, Data+Length);
+    }
+
+
+
+
+    operator std::vector<T>() const {
+      return std::vector<T>(Data, Data+Length);
+    }
+
+
+  };
+  template<typename T>
+  class MutableArrayRef : public ArrayRef<T> {
+  public:
+    using iterator = T *;
+    using reverse_iterator = std::reverse_iterator<iterator>;
+
+
+                 MutableArrayRef() = default;
+
+
+                 MutableArrayRef(NoneType) : ArrayRef<T>() {}
+
+
+                 MutableArrayRef(T &OneElt) : ArrayRef<T>(OneElt) {}
+
+
+                 MutableArrayRef(T *data, size_t length)
+      : ArrayRef<T>(data, length) {}
+
+
+    MutableArrayRef(T *begin, T *end) : ArrayRef<T>(begin, end) {}
+
+
+                 MutableArrayRef(SmallVectorImpl<T> &Vec)
+    : ArrayRef<T>(Vec) {}
+
+
+                 MutableArrayRef(std::vector<T> &Vec)
+    : ArrayRef<T>(Vec) {}
+
+
+    template <size_t N>
+                 constexpr MutableArrayRef(std::array<T, N> &Arr)
+        : ArrayRef<T>(Arr) {}
+
+
+    template <size_t N>
+                 constexpr MutableArrayRef(T (&Arr)[N]) : ArrayRef<T>(Arr) {}
+
+    T *data() const { return const_cast<T*>(ArrayRef<T>::data()); }
+
+    iterator begin() const { return data(); }
+    iterator end() const { return data() + this->size(); }
+
+    reverse_iterator rbegin() const { return reverse_iterator(end()); }
+    reverse_iterator rend() const { return reverse_iterator(begin()); }
+
+
+    T &front() const {
+      
+     ((
+     !this->empty()
+     ) ? static_cast<void> (0) : __assert_fail (
+     "!this->empty()"
+     , "/home/trippels/llvm/llvm/include/llvm/ADT/ArrayRef.h", 339, __PRETTY_FUNCTION__))
+                           ;
+      return data()[0];
+    }
+
+
+    T &back() const {
+      
+     ((
+     !this->empty()
+     ) ? static_cast<void> (0) : __assert_fail (
+     "!this->empty()"
+     , "/home/trippels/llvm/llvm/include/llvm/ADT/ArrayRef.h", 345, __PRETTY_FUNCTION__))
+                           ;
+      return data()[this->size()-1];
+    }
+
+
+
+    MutableArrayRef<T> slice(size_t N, size_t M) const {
+      
+     ((
+     N + M <= this->size() && "Invalid specifier"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "N + M <= this->size() && \"Invalid specifier\""
+     , "/home/trippels/llvm/llvm/include/llvm/ADT/ArrayRef.h", 352, __PRETTY_FUNCTION__))
+                                                         ;
+      return MutableArrayRef<T>(this->data() + N, M);
+    }
+
+
+    MutableArrayRef<T> slice(size_t N) const {
+      return slice(N, this->size() - N);
+    }
+
+
+    MutableArrayRef<T> drop_front(size_t N = 1) const {
+      
+     ((
+     this->size() >= N && "Dropping more elements than exist"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "this->size() >= N && \"Dropping more elements than exist\""
+     , "/home/trippels/llvm/llvm/include/llvm/ADT/ArrayRef.h", 363, __PRETTY_FUNCTION__))
+                                                                     ;
+      return slice(N, this->size() - N);
+    }
+
+    MutableArrayRef<T> drop_back(size_t N = 1) const {
+      
+     ((
+     this->size() >= N && "Dropping more elements than exist"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "this->size() >= N && \"Dropping more elements than exist\""
+     , "/home/trippels/llvm/llvm/include/llvm/ADT/ArrayRef.h", 368, __PRETTY_FUNCTION__))
+                                                                     ;
+      return slice(0, this->size() - N);
+    }
+
+
+
+    template <class PredicateT>
+    MutableArrayRef<T> drop_while(PredicateT Pred) const {
+      return MutableArrayRef<T>(find_if_not(*this, Pred), end());
+    }
+
+
+
+    template <class PredicateT>
+    MutableArrayRef<T> drop_until(PredicateT Pred) const {
+      return MutableArrayRef<T>(find_if(*this, Pred), end());
+    }
+
+
+    MutableArrayRef<T> take_front(size_t N = 1) const {
+      if (N >= this->size())
+        return *this;
+      return drop_back(this->size() - N);
+    }
+
+
+    MutableArrayRef<T> take_back(size_t N = 1) const {
+      if (N >= this->size())
+        return *this;
+      return drop_front(this->size() - N);
+    }
+
+
+
+    template <class PredicateT>
+    MutableArrayRef<T> take_while(PredicateT Pred) const {
+      return MutableArrayRef<T>(begin(), find_if_not(*this, Pred));
+    }
+
+
+
+    template <class PredicateT>
+    MutableArrayRef<T> take_until(PredicateT Pred) const {
+      return MutableArrayRef<T>(begin(), find_if(*this, Pred));
+    }
+
+
+
+
+    T &operator[](size_t Index) const {
+      
+     ((
+     Index < this->size() && "Invalid index!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "Index < this->size() && \"Invalid index!\""
+     , "/home/trippels/llvm/llvm/include/llvm/ADT/ArrayRef.h", 418, __PRETTY_FUNCTION__))
+                                                     ;
+      return data()[Index];
+    }
+  };
+
+
+  template <typename T> class OwningArrayRef : public MutableArrayRef<T> {
+  public:
+    OwningArrayRef() = default;
+    OwningArrayRef(size_t Size) : MutableArrayRef<T>(new T[Size], Size) {}
+
+    OwningArrayRef(ArrayRef<T> Data)
+        : MutableArrayRef<T>(new T[Data.size()], Data.size()) {
+      std::copy(Data.begin(), Data.end(), this->begin());
+    }
+
+    OwningArrayRef(OwningArrayRef &&Other) { *this = Other; }
+
+    OwningArrayRef &operator=(OwningArrayRef &&Other) {
+      delete[] this->data();
+      this->MutableArrayRef<T>::operator=(Other);
+      Other.MutableArrayRef<T>::operator=(MutableArrayRef<T>());
+      return *this;
+    }
+
+    ~OwningArrayRef() { delete[] this->data(); }
+  };
+
+
+
+
+
+  template<typename T>
+  ArrayRef<T> makeArrayRef(const T &OneElt) {
+    return OneElt;
+  }
+
+
+  template<typename T>
+  ArrayRef<T> makeArrayRef(const T *data, size_t length) {
+    return ArrayRef<T>(data, length);
+  }
+
+
+  template<typename T>
+  ArrayRef<T> makeArrayRef(const T *begin, const T *end) {
+    return ArrayRef<T>(begin, end);
+  }
+
+
+  template <typename T>
+  ArrayRef<T> makeArrayRef(const SmallVectorImpl<T> &Vec) {
+    return Vec;
+  }
+
+
+  template <typename T, unsigned N>
+  ArrayRef<T> makeArrayRef(const SmallVector<T, N> &Vec) {
+    return Vec;
+  }
+
+
+  template<typename T>
+  ArrayRef<T> makeArrayRef(const std::vector<T> &Vec) {
+    return Vec;
+  }
+
+
+  template <typename T> ArrayRef<T> makeArrayRef(const ArrayRef<T> &Vec) {
+    return Vec;
+  }
+
+
+  template <typename T> ArrayRef<T> &makeArrayRef(ArrayRef<T> &Vec) {
+    return Vec;
+  }
+
+
+  template<typename T, size_t N>
+  ArrayRef<T> makeArrayRef(const T (&Arr)[N]) {
+    return ArrayRef<T>(Arr);
+  }
+
+
+  template<typename T>
+  MutableArrayRef<T> makeMutableArrayRef(T &OneElt) {
+    return OneElt;
+  }
+
+
+  template<typename T>
+  MutableArrayRef<T> makeMutableArrayRef(T *data, size_t length) {
+    return MutableArrayRef<T>(data, length);
+  }
+
+
+
+
+
+  template<typename T>
+  inline bool operator==(ArrayRef<T> LHS, ArrayRef<T> RHS) {
+    return LHS.equals(RHS);
+  }
+
+  template<typename T>
+  inline bool operator!=(ArrayRef<T> LHS, ArrayRef<T> RHS) {
+    return !(LHS == RHS);
+  }
+
+
+
+
+  template <typename T> struct isPodLike;
+  template <typename T> struct isPodLike<ArrayRef<T>> {
+    static const bool value = true;
+  };
+
+  template <typename T> hash_code hash_value(ArrayRef<T> S) {
+    return hash_combine_range(S.begin(), S.end());
+  }
+
+}
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+       
+
+
+
+       
+       
+
+
+
+namespace llvm {
+
+
+
+template <typename BitVectorT> class const_set_bits_iterator_impl {
+  const BitVectorT &Parent;
+  int Current = 0;
+
+  void advance() {
+    
+   ((
+   Current != -1 && "Trying to advance past end."
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Current != -1 && \"Trying to advance past end.\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/BitVector.h", 37, __PRETTY_FUNCTION__))
+                                                         ;
+    Current = Parent.find_next(Current);
+  }
+
+public:
+  const_set_bits_iterator_impl(const BitVectorT &Parent, int Current)
+      : Parent(Parent), Current(Current) {}
+  explicit const_set_bits_iterator_impl(const BitVectorT &Parent)
+      : const_set_bits_iterator_impl(Parent, Parent.find_first()) {}
+  const_set_bits_iterator_impl(const const_set_bits_iterator_impl &) = default;
+
+  const_set_bits_iterator_impl operator++(int) {
+    auto Prev = *this;
+    advance();
+    return Prev;
+  }
+
+  const_set_bits_iterator_impl &operator++() {
+    advance();
+    return *this;
+  }
+
+  unsigned operator*() const { return Current; }
+
+  bool operator==(const const_set_bits_iterator_impl &Other) const {
+    
+   ((
+   &Parent == &Other.Parent && "Comparing iterators from different BitVectors"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "&Parent == &Other.Parent && \"Comparing iterators from different BitVectors\""
+   ,
+                                                          "/home/trippels/llvm/llvm/include/llvm/ADT/BitVector.h"
+    ,
+                                                          63
+    , __PRETTY_FUNCTION__))
+                                                           
+                                                          ;
+    return Current == Other.Current;
+  }
+
+  bool operator!=(const const_set_bits_iterator_impl &Other) const {
+    
+   ((
+   &Parent == &Other.Parent && "Comparing iterators from different BitVectors"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "&Parent == &Other.Parent && \"Comparing iterators from different BitVectors\""
+   ,
+                                                          "/home/trippels/llvm/llvm/include/llvm/ADT/BitVector.h"
+    ,
+                                                          69
+    , __PRETTY_FUNCTION__))
+                                                           
+                                                          ;
+    return Current != Other.Current;
+  }
+};
+
+class BitVector {
+  typedef unsigned long BitWord;
+
+  enum { BITWORD_SIZE = (unsigned)sizeof(BitWord) * 8 };
+
+  static_assert(BITWORD_SIZE == 64 || BITWORD_SIZE == 32,
+                "Unsupported word size");
+
+  MutableArrayRef<BitWord> Bits;
+  unsigned Size;
+
+public:
+  typedef unsigned size_type;
+
+  class reference {
+    friend class BitVector;
+
+    BitWord *WordRef;
+    unsigned BitPos;
+
+  public:
+    reference(BitVector &b, unsigned Idx) {
+      WordRef = &b.Bits[Idx / BITWORD_SIZE];
+      BitPos = Idx % BITWORD_SIZE;
+    }
+
+    reference() = delete;
+    reference(const reference&) = default;
+
+    reference &operator=(reference t) {
+      *this = bool(t);
+      return *this;
+    }
+
+    reference& operator=(bool t) {
+      if (t)
+        *WordRef |= BitWord(1) << BitPos;
+      else
+        *WordRef &= ~(BitWord(1) << BitPos);
+      return *this;
+    }
+
+    operator bool() const {
+      return ((*WordRef) & (BitWord(1) << BitPos)) != 0;
+    }
+  };
+
+  typedef const_set_bits_iterator_impl<BitVector> const_set_bits_iterator;
+  typedef const_set_bits_iterator set_iterator;
+
+  const_set_bits_iterator set_bits_begin() const {
+    return const_set_bits_iterator(*this);
+  }
+  const_set_bits_iterator set_bits_end() const {
+    return const_set_bits_iterator(*this, -1);
+  }
+  iterator_range<const_set_bits_iterator> set_bits() const {
+    return make_range(set_bits_begin(), set_bits_end());
+  }
+
+
+  BitVector() : Size(0) {}
+
+
+
+  explicit BitVector(unsigned s, bool t = false) : Size(s) {
+    size_t Capacity = NumBitWords(s);
+    Bits = allocate(Capacity);
+    init_words(Bits, t);
+    if (t)
+      clear_unused_bits();
+  }
+
+
+  BitVector(const BitVector &RHS) : Size(RHS.size()) {
+    if (Size == 0) {
+      Bits = MutableArrayRef<BitWord>();
+      return;
+    }
+
+    size_t Capacity = NumBitWords(RHS.size());
+    Bits = allocate(Capacity);
+    std::memcpy(Bits.data(), RHS.Bits.data(), Capacity * sizeof(BitWord));
+  }
+
+  BitVector(BitVector &&RHS) : Bits(RHS.Bits), Size(RHS.Size) {
+    RHS.Bits = MutableArrayRef<BitWord>();
+    RHS.Size = 0;
+  }
+
+  ~BitVector() { std::free(Bits.data()); }
+
+
+  bool empty() const { return Size == 0; }
+
+
+  size_type size() const { return Size; }
+
+
+  size_type count() const {
+    unsigned NumBits = 0;
+    for (unsigned i = 0; i < NumBitWords(size()); ++i)
+      NumBits += countPopulation(Bits[i]);
+    return NumBits;
+  }
+
+
+  bool any() const {
+    for (unsigned i = 0; i < NumBitWords(size()); ++i)
+      if (Bits[i] != 0)
+        return true;
+    return false;
+  }
+
+
+  bool all() const {
+    for (unsigned i = 0; i < Size / BITWORD_SIZE; ++i)
+      if (Bits[i] != ~0UL)
+        return false;
+
+
+    if (unsigned Remainder = Size % BITWORD_SIZE)
+      return Bits[Size / BITWORD_SIZE] == (1UL << Remainder) - 1;
+
+    return true;
+  }
+
+
+  bool none() const {
+    return !any();
+  }
+
+
+
+  int find_first_in(unsigned Begin, unsigned End) const {
+    
+   ((
+   Begin <= End && End <= Size
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Begin <= End && End <= Size"
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/BitVector.h", 209, __PRETTY_FUNCTION__))
+                                      ;
+    if (Begin == End)
+      return -1;
+
+    unsigned FirstWord = Begin / BITWORD_SIZE;
+    unsigned LastWord = (End - 1) / BITWORD_SIZE;
+
+
+    for (unsigned i = FirstWord; i <= LastWord; ++i) {
+      BitWord Copy = Bits[i];
+
+      if (i == FirstWord) {
+        unsigned FirstBit = Begin % BITWORD_SIZE;
+        Copy &= maskTrailingZeros<BitWord>(FirstBit);
+      }
+
+      if (i == LastWord) {
+        unsigned LastBit = (End - 1) % BITWORD_SIZE;
+        Copy &= maskTrailingOnes<BitWord>(LastBit + 1);
+      }
+      if (Copy != 0)
+        return i * BITWORD_SIZE + countTrailingZeros(Copy);
+    }
+    return -1;
+  }
+
+
+
+  int find_last_in(unsigned Begin, unsigned End) const {
+    
+   ((
+   Begin <= End && End <= Size
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Begin <= End && End <= Size"
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/BitVector.h", 238, __PRETTY_FUNCTION__))
+                                      ;
+    if (Begin == End)
+      return -1;
+
+    unsigned LastWord = (End - 1) / BITWORD_SIZE;
+    unsigned FirstWord = Begin / BITWORD_SIZE;
+
+    for (unsigned i = LastWord + 1; i >= FirstWord + 1; --i) {
+      unsigned CurrentWord = i - 1;
+
+      BitWord Copy = Bits[CurrentWord];
+      if (CurrentWord == LastWord) {
+        unsigned LastBit = (End - 1) % BITWORD_SIZE;
+        Copy &= maskTrailingOnes<BitWord>(LastBit + 1);
+      }
+
+      if (CurrentWord == FirstWord) {
+        unsigned FirstBit = Begin % BITWORD_SIZE;
+        Copy &= maskTrailingZeros<BitWord>(FirstBit);
+      }
+
+      if (Copy != 0)
+        return (CurrentWord + 1) * BITWORD_SIZE - countLeadingZeros(Copy) - 1;
+    }
+
+    return -1;
+  }
+
+
+
+  int find_first_unset_in(unsigned Begin, unsigned End) const {
+    
+   ((
+   Begin <= End && End <= Size
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Begin <= End && End <= Size"
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/BitVector.h", 269, __PRETTY_FUNCTION__))
+                                      ;
+    if (Begin == End)
+      return -1;
+
+    unsigned FirstWord = Begin / BITWORD_SIZE;
+    unsigned LastWord = (End - 1) / BITWORD_SIZE;
+
+
+    for (unsigned i = FirstWord; i <= LastWord; ++i) {
+      BitWord Copy = Bits[i];
+
+      if (i == FirstWord) {
+        unsigned FirstBit = Begin % BITWORD_SIZE;
+        Copy |= maskTrailingOnes<BitWord>(FirstBit);
+      }
+
+      if (i == LastWord) {
+        unsigned LastBit = (End - 1) % BITWORD_SIZE;
+        Copy |= maskTrailingZeros<BitWord>(LastBit + 1);
+      }
+      if (Copy != ~0UL) {
+        unsigned Result = i * BITWORD_SIZE + countTrailingOnes(Copy);
+        return Result < size() ? Result : -1;
+      }
+    }
+    return -1;
+  }
+
+
+
+  int find_last_unset_in(unsigned Begin, unsigned End) const {
+    
+   ((
+   Begin <= End && End <= Size
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Begin <= End && End <= Size"
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/BitVector.h", 300, __PRETTY_FUNCTION__))
+                                      ;
+    if (Begin == End)
+      return -1;
+
+    unsigned LastWord = (End - 1) / BITWORD_SIZE;
+    unsigned FirstWord = Begin / BITWORD_SIZE;
+
+    for (unsigned i = LastWord + 1; i >= FirstWord + 1; --i) {
+      unsigned CurrentWord = i - 1;
+
+      BitWord Copy = Bits[CurrentWord];
+      if (CurrentWord == LastWord) {
+        unsigned LastBit = (End - 1) % BITWORD_SIZE;
+        Copy |= maskTrailingZeros<BitWord>(LastBit + 1);
+      }
+
+      if (CurrentWord == FirstWord) {
+        unsigned FirstBit = Begin % BITWORD_SIZE;
+        Copy |= maskTrailingOnes<BitWord>(FirstBit);
+      }
+
+      if (Copy != ~0UL) {
+        unsigned Result =
+            (CurrentWord + 1) * BITWORD_SIZE - countLeadingOnes(Copy) - 1;
+        return Result < Size ? Result : -1;
+      }
+    }
+    return -1;
+  }
+
+
+
+  int find_first() const { return find_first_in(0, Size); }
+
+
+
+  int find_last() const { return find_last_in(0, Size); }
+
+
+
+  int find_next(unsigned Prev) const { return find_first_in(Prev + 1, Size); }
+
+
+
+  int find_prev(unsigned PriorTo) const { return find_last_in(0, PriorTo); }
+
+
+
+  int find_first_unset() const { return find_first_unset_in(0, Size); }
+
+
+
+  int find_next_unset(unsigned Prev) const {
+    return find_first_unset_in(Prev + 1, Size);
+  }
+
+
+
+  int find_last_unset() const { return find_last_unset_in(0, Size); }
+
+
+
+  int find_prev_unset(unsigned PriorTo) {
+    return find_last_unset_in(0, PriorTo);
+  }
+
+
+  void clear() {
+    Size = 0;
+  }
+
+
+  void resize(unsigned N, bool t = false) {
+    if (N > getBitCapacity()) {
+      unsigned OldCapacity = Bits.size();
+      grow(N);
+      init_words(Bits.drop_front(OldCapacity), t);
+    }
+
+
+
+
+    if (N > Size)
+      set_unused_bits(t);
+
+
+    unsigned OldSize = Size;
+    Size = N;
+    if (t || N < OldSize)
+      clear_unused_bits();
+  }
+
+  void reserve(unsigned N) {
+    if (N > getBitCapacity())
+      grow(N);
+  }
+
+
+  BitVector &set() {
+    init_words(Bits, true);
+    clear_unused_bits();
+    return *this;
+  }
+
+  BitVector &set(unsigned Idx) {
+    
+   ((
+   Bits.data() && "Bits never allocated"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Bits.data() && \"Bits never allocated\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/BitVector.h", 405, __PRETTY_FUNCTION__))
+                                                ;
+    Bits[Idx / BITWORD_SIZE] |= BitWord(1) << (Idx % BITWORD_SIZE);
+    return *this;
+  }
+
+
+  BitVector &set(unsigned I, unsigned E) {
+    
+   ((
+   I <= E && "Attempted to set backwards range!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "I <= E && \"Attempted to set backwards range!\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/BitVector.h", 412, __PRETTY_FUNCTION__))
+                                                        ;
+    
+   ((
+   E <= size() && "Attempted to set out-of-bounds range!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "E <= size() && \"Attempted to set out-of-bounds range!\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/BitVector.h", 413, __PRETTY_FUNCTION__))
+                                                                 ;
+
+    if (I == E) return *this;
+
+    if (I / BITWORD_SIZE == E / BITWORD_SIZE) {
+      BitWord EMask = 1UL << (E % BITWORD_SIZE);
+      BitWord IMask = 1UL << (I % BITWORD_SIZE);
+      BitWord Mask = EMask - IMask;
+      Bits[I / BITWORD_SIZE] |= Mask;
+      return *this;
+    }
+
+    BitWord PrefixMask = ~0UL << (I % BITWORD_SIZE);
+    Bits[I / BITWORD_SIZE] |= PrefixMask;
+    I = alignTo(I, BITWORD_SIZE);
+
+    for (; I + BITWORD_SIZE <= E; I += BITWORD_SIZE)
+      Bits[I / BITWORD_SIZE] = ~0UL;
+
+    BitWord PostfixMask = (1UL << (E % BITWORD_SIZE)) - 1;
+    if (I < E)
+      Bits[I / BITWORD_SIZE] |= PostfixMask;
+
+    return *this;
+  }
+
+  BitVector &reset() {
+    init_words(Bits, false);
+    return *this;
+  }
+
+  BitVector &reset(unsigned Idx) {
+    Bits[Idx / BITWORD_SIZE] &= ~(BitWord(1) << (Idx % BITWORD_SIZE));
+    return *this;
+  }
+
+
+  BitVector &reset(unsigned I, unsigned E) {
+    
+   ((
+   I <= E && "Attempted to reset backwards range!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "I <= E && \"Attempted to reset backwards range!\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/BitVector.h", 451, __PRETTY_FUNCTION__))
+                                                          ;
+    
+   ((
+   E <= size() && "Attempted to reset out-of-bounds range!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "E <= size() && \"Attempted to reset out-of-bounds range!\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/BitVector.h", 452, __PRETTY_FUNCTION__))
+                                                                   ;
+
+    if (I == E) return *this;
+
+    if (I / BITWORD_SIZE == E / BITWORD_SIZE) {
+      BitWord EMask = 1UL << (E % BITWORD_SIZE);
+      BitWord IMask = 1UL << (I % BITWORD_SIZE);
+      BitWord Mask = EMask - IMask;
+      Bits[I / BITWORD_SIZE] &= ~Mask;
+      return *this;
+    }
+
+    BitWord PrefixMask = ~0UL << (I % BITWORD_SIZE);
+    Bits[I / BITWORD_SIZE] &= ~PrefixMask;
+    I = alignTo(I, BITWORD_SIZE);
+
+    for (; I + BITWORD_SIZE <= E; I += BITWORD_SIZE)
+      Bits[I / BITWORD_SIZE] = 0UL;
+
+    BitWord PostfixMask = (1UL << (E % BITWORD_SIZE)) - 1;
+    if (I < E)
+      Bits[I / BITWORD_SIZE] &= ~PostfixMask;
+
+    return *this;
+  }
+
+  BitVector &flip() {
+    for (unsigned i = 0; i < NumBitWords(size()); ++i)
+      Bits[i] = ~Bits[i];
+    clear_unused_bits();
+    return *this;
+  }
+
+  BitVector &flip(unsigned Idx) {
+    Bits[Idx / BITWORD_SIZE] ^= BitWord(1) << (Idx % BITWORD_SIZE);
+    return *this;
+  }
+
+
+  reference operator[](unsigned Idx) {
+    
+   ((
+   Idx < Size && "Out-of-bounds Bit access."
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Idx < Size && \"Out-of-bounds Bit access.\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/BitVector.h", 492, __PRETTY_FUNCTION__))
+                                                     ;
+    return reference(*this, Idx);
+  }
+
+  bool operator[](unsigned Idx) const {
+    
+   ((
+   Idx < Size && "Out-of-bounds Bit access."
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Idx < Size && \"Out-of-bounds Bit access.\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/BitVector.h", 497, __PRETTY_FUNCTION__))
+                                                     ;
+    BitWord Mask = BitWord(1) << (Idx % BITWORD_SIZE);
+    return (Bits[Idx / BITWORD_SIZE] & Mask) != 0;
+  }
+
+  bool test(unsigned Idx) const {
+    return (*this)[Idx];
+  }
+
+
+  bool anyCommon(const BitVector &RHS) const {
+    unsigned ThisWords = NumBitWords(size());
+    unsigned RHSWords = NumBitWords(RHS.size());
+    for (unsigned i = 0, e = std::min(ThisWords, RHSWords); i != e; ++i)
+      if (Bits[i] & RHS.Bits[i])
+        return true;
+    return false;
+  }
+
+
+  bool operator==(const BitVector &RHS) const {
+    unsigned ThisWords = NumBitWords(size());
+    unsigned RHSWords = NumBitWords(RHS.size());
+    unsigned i;
+    for (i = 0; i != std::min(ThisWords, RHSWords); ++i)
+      if (Bits[i] != RHS.Bits[i])
+        return false;
+
+
+    if (i != ThisWords) {
+      for (; i != ThisWords; ++i)
+        if (Bits[i])
+          return false;
+    } else if (i != RHSWords) {
+      for (; i != RHSWords; ++i)
+        if (RHS.Bits[i])
+          return false;
+    }
+    return true;
+  }
+
+  bool operator!=(const BitVector &RHS) const {
+    return !(*this == RHS);
+  }
+
+
+  BitVector &operator&=(const BitVector &RHS) {
+    unsigned ThisWords = NumBitWords(size());
+    unsigned RHSWords = NumBitWords(RHS.size());
+    unsigned i;
+    for (i = 0; i != std::min(ThisWords, RHSWords); ++i)
+      Bits[i] &= RHS.Bits[i];
+
+
+
+
+    for (; i != ThisWords; ++i)
+      Bits[i] = 0;
+
+    return *this;
+  }
+
+
+  BitVector &reset(const BitVector &RHS) {
+    unsigned ThisWords = NumBitWords(size());
+    unsigned RHSWords = NumBitWords(RHS.size());
+    unsigned i;
+    for (i = 0; i != std::min(ThisWords, RHSWords); ++i)
+      Bits[i] &= ~RHS.Bits[i];
+    return *this;
+  }
+
+
+
+  bool test(const BitVector &RHS) const {
+    unsigned ThisWords = NumBitWords(size());
+    unsigned RHSWords = NumBitWords(RHS.size());
+    unsigned i;
+    for (i = 0; i != std::min(ThisWords, RHSWords); ++i)
+      if ((Bits[i] & ~RHS.Bits[i]) != 0)
+        return true;
+
+    for (; i != ThisWords ; ++i)
+      if (Bits[i] != 0)
+        return true;
+
+    return false;
+  }
+
+  BitVector &operator|=(const BitVector &RHS) {
+    if (size() < RHS.size())
+      resize(RHS.size());
+    for (size_t i = 0, e = NumBitWords(RHS.size()); i != e; ++i)
+      Bits[i] |= RHS.Bits[i];
+    return *this;
+  }
+
+  BitVector &operator^=(const BitVector &RHS) {
+    if (size() < RHS.size())
+      resize(RHS.size());
+    for (size_t i = 0, e = NumBitWords(RHS.size()); i != e; ++i)
+      Bits[i] ^= RHS.Bits[i];
+    return *this;
+  }
+
+  BitVector &operator>>=(unsigned N) {
+    
+   ((
+   N <= Size
+   ) ? static_cast<void> (0) : __assert_fail (
+   "N <= Size"
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/BitVector.h", 603, __PRETTY_FUNCTION__))
+                    ;
+    if (__builtin_expect((bool)(empty() || N == 0), false))
+      return *this;
+
+    unsigned NumWords = NumBitWords(Size);
+    
+   ((
+   NumWords >= 1
+   ) ? static_cast<void> (0) : __assert_fail (
+   "NumWords >= 1"
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/BitVector.h", 608, __PRETTY_FUNCTION__))
+                        ;
+
+    wordShr(N / BITWORD_SIZE);
+
+    unsigned BitDistance = N % BITWORD_SIZE;
+    if (BitDistance == 0)
+      return *this;
+    const BitWord Mask = maskTrailingOnes<BitWord>(BitDistance);
+    const unsigned LSH = BITWORD_SIZE - BitDistance;
+
+    for (unsigned I = 0; I < NumWords - 1; ++I) {
+      Bits[I] >>= BitDistance;
+      Bits[I] |= (Bits[I + 1] & Mask) << LSH;
+    }
+
+    Bits[NumWords - 1] >>= BitDistance;
+
+    return *this;
+  }
+
+  BitVector &operator<<=(unsigned N) {
+    
+   ((
+   N <= Size
+   ) ? static_cast<void> (0) : __assert_fail (
+   "N <= Size"
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/BitVector.h", 652, __PRETTY_FUNCTION__))
+                    ;
+    if (__builtin_expect((bool)(empty() || N == 0), false))
+      return *this;
+
+    unsigned NumWords = NumBitWords(Size);
+    
+   ((
+   NumWords >= 1
+   ) ? static_cast<void> (0) : __assert_fail (
+   "NumWords >= 1"
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/BitVector.h", 657, __PRETTY_FUNCTION__))
+                        ;
+
+    wordShl(N / BITWORD_SIZE);
+
+    unsigned BitDistance = N % BITWORD_SIZE;
+    if (BitDistance == 0)
+      return *this;
+    const BitWord Mask = maskLeadingOnes<BitWord>(BitDistance);
+    const unsigned RSH = BITWORD_SIZE - BitDistance;
+
+    for (int I = NumWords - 1; I > 0; --I) {
+      Bits[I] <<= BitDistance;
+      Bits[I] |= (Bits[I - 1] & Mask) >> RSH;
+    }
+    Bits[0] <<= BitDistance;
+    clear_unused_bits();
+
+    return *this;
+  }
+
+
+  const BitVector &operator=(const BitVector &RHS) {
+    if (this == &RHS) return *this;
+
+    Size = RHS.size();
+    unsigned RHSWords = NumBitWords(Size);
+    if (Size <= getBitCapacity()) {
+      if (Size)
+        std::memcpy(Bits.data(), RHS.Bits.data(), RHSWords * sizeof(BitWord));
+      clear_unused_bits();
+      return *this;
+    }
+
+
+    unsigned NewCapacity = RHSWords;
+    
+   ((
+   NewCapacity > 0 && "negative capacity?"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "NewCapacity > 0 && \"negative capacity?\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/BitVector.h", 716, __PRETTY_FUNCTION__))
+                                                  ;
+    auto NewBits = allocate(NewCapacity);
+    std::memcpy(NewBits.data(), RHS.Bits.data(), NewCapacity * sizeof(BitWord));
+
+
+    std::free(Bits.data());
+    Bits = NewBits;
+
+    return *this;
+  }
+
+  const BitVector &operator=(BitVector &&RHS) {
+    if (this == &RHS) return *this;
+
+    std::free(Bits.data());
+    Bits = RHS.Bits;
+    Size = RHS.Size;
+
+    RHS.Bits = MutableArrayRef<BitWord>();
+    RHS.Size = 0;
+
+    return *this;
+  }
+
+  void swap(BitVector &RHS) {
+    std::swap(Bits, RHS.Bits);
+    std::swap(Size, RHS.Size);
+  }
+  void setBitsInMask(const uint32_t *Mask, unsigned MaskWords = ~0u) {
+    applyMask<true, false>(Mask, MaskWords);
+  }
+
+
+
+  void clearBitsInMask(const uint32_t *Mask, unsigned MaskWords = ~0u) {
+    applyMask<false, false>(Mask, MaskWords);
+  }
+
+
+
+  void setBitsNotInMask(const uint32_t *Mask, unsigned MaskWords = ~0u) {
+    applyMask<true, true>(Mask, MaskWords);
+  }
+
+
+
+  void clearBitsNotInMask(const uint32_t *Mask, unsigned MaskWords = ~0u) {
+    applyMask<false, true>(Mask, MaskWords);
+  }
+
+private:
+  void wordShl(uint32_t Count) {
+    if (Count == 0)
+      return;
+
+    uint32_t NumWords = NumBitWords(Size);
+
+    auto Src = Bits.take_front(NumWords).drop_back(Count);
+    auto Dest = Bits.take_front(NumWords).drop_front(Count);
+
+
+
+
+    std::memmove(Dest.begin(), Src.begin(), Dest.size() * sizeof(BitWord));
+    std::memset(Bits.data(), 0, Count * sizeof(BitWord));
+    clear_unused_bits();
+  }
+
+
+
+
+  void wordShr(uint32_t Count) {
+    if (Count == 0)
+      return;
+
+    uint32_t NumWords = NumBitWords(Size);
+
+    auto Src = Bits.take_front(NumWords).drop_front(Count);
+    auto Dest = Bits.take_front(NumWords).drop_back(Count);
+    
+   ((
+   Dest.size() == Src.size()
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Dest.size() == Src.size()"
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/BitVector.h", 824, __PRETTY_FUNCTION__))
+                                    ;
+
+    std::memmove(Dest.begin(), Src.begin(), Dest.size() * sizeof(BitWord));
+    std::memset(Dest.end(), 0, Count * sizeof(BitWord));
+  }
+
+  MutableArrayRef<BitWord> allocate(size_t NumWords) {
+    BitWord *RawBits = (BitWord *)std::malloc(NumWords * sizeof(BitWord));
+    return MutableArrayRef<BitWord>(RawBits, NumWords);
+  }
+
+  int next_unset_in_word(int WordIndex, BitWord Word) const {
+    unsigned Result = WordIndex * BITWORD_SIZE + countTrailingOnes(Word);
+    return Result < size() ? Result : -1;
+  }
+
+  unsigned NumBitWords(unsigned S) const {
+    return (S + BITWORD_SIZE-1) / BITWORD_SIZE;
+  }
+
+
+  void set_unused_bits(bool t = true) {
+
+    unsigned UsedWords = NumBitWords(Size);
+    if (Bits.size() > UsedWords)
+      init_words(Bits.drop_front(UsedWords), t);
+
+
+    unsigned ExtraBits = Size % BITWORD_SIZE;
+    if (ExtraBits) {
+      BitWord ExtraBitMask = ~0UL << ExtraBits;
+      if (t)
+        Bits[UsedWords-1] |= ExtraBitMask;
+      else
+        Bits[UsedWords-1] &= ~ExtraBitMask;
+    }
+  }
+
+
+  void clear_unused_bits() {
+    set_unused_bits(false);
+  }
+
+  void grow(unsigned NewSize) {
+    size_t NewCapacity = std::max<size_t>(NumBitWords(NewSize), Bits.size() * 2);
+    
+   ((
+   NewCapacity > 0 && "realloc-ing zero space"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "NewCapacity > 0 && \"realloc-ing zero space\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/BitVector.h", 869, __PRETTY_FUNCTION__))
+                                                      ;
+    BitWord *NewBits =
+        (BitWord *)std::realloc(Bits.data(), NewCapacity * sizeof(BitWord));
+    Bits = MutableArrayRef<BitWord>(NewBits, NewCapacity);
+    clear_unused_bits();
+  }
+
+  void init_words(MutableArrayRef<BitWord> B, bool t) {
+    if (B.size() > 0)
+      memset(B.data(), 0 - (int)t, B.size() * sizeof(BitWord));
+  }
+
+  template<bool AddBits, bool InvertMask>
+  void applyMask(const uint32_t *Mask, unsigned MaskWords) {
+    static_assert(BITWORD_SIZE % 32 == 0, "Unsupported BitWord size.");
+    MaskWords = std::min(MaskWords, (size() + 31) / 32);
+    const unsigned Scale = BITWORD_SIZE / 32;
+    unsigned i;
+    for (i = 0; MaskWords >= Scale; ++i, MaskWords -= Scale) {
+      BitWord BW = Bits[i];
+
+      for (unsigned b = 0; b != BITWORD_SIZE; b += 32) {
+        uint32_t M = *Mask++;
+        if (InvertMask) M = ~M;
+        if (AddBits) BW |= BitWord(M) << b;
+        else BW &= ~(BitWord(M) << b);
+      }
+      Bits[i] = BW;
+    }
+    for (unsigned b = 0; MaskWords; b += 32, --MaskWords) {
+      uint32_t M = *Mask++;
+      if (InvertMask) M = ~M;
+      if (AddBits) Bits[i] |= BitWord(M) << b;
+      else Bits[i] &= ~(BitWord(M) << b);
+    }
+    if (AddBits)
+      clear_unused_bits();
+  }
+
+public:
+
+  size_t getMemorySize() const { return Bits.size() * sizeof(BitWord); }
+  size_t getBitCapacity() const { return Bits.size() * BITWORD_SIZE; }
+};
+
+inline size_t capacity_in_bytes(const BitVector &X) {
+  return X.getMemorySize();
+}
+
+}
+
+namespace std {
+
+  inline void
+  swap(llvm::BitVector &LHS, llvm::BitVector &RHS) {
+    LHS.swap(RHS);
+  }
+}
+namespace llvm {
+
+extern int EnableABIBreakingChecks;
+__attribute__((weak, visibility ("hidden"))) int *VerifyEnableABIBreakingChecks = &EnableABIBreakingChecks;
+
+
+
+
+}
+
+
+
+
+namespace llvm {
+class DebugEpochBase {
+  uint64_t Epoch;
+
+public:
+  DebugEpochBase() : Epoch(0) {}
+
+
+
+  void incrementEpoch() { ++Epoch; }
+
+
+
+  ~DebugEpochBase() { incrementEpoch(); }
+  class HandleBase {
+    const uint64_t *EpochAddress;
+    uint64_t EpochAtCreation;
+
+  public:
+    HandleBase() : EpochAddress(nullptr), EpochAtCreation(
+                                                         (18446744073709551615UL)
+                                                                   ) {}
+
+    explicit HandleBase(const DebugEpochBase *Parent)
+        : EpochAddress(&Parent->Epoch), EpochAtCreation(Parent->Epoch) {}
+
+
+
+
+    bool isHandleInSync() const { return *EpochAddress == EpochAtCreation; }
+
+
+
+
+    const void *getEpochAddress() const { return EpochAddress; }
+  };
+};
+}
+
+
+
+
+
+
+
+namespace llvm {
+
+template<class T = void *>
+bool shouldReverseIterate() {
+
+
+
+  return false;
+
+}
+
+}
+
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+       
+       
+
+
+
+
+
+namespace llvm {
+class SmallPtrSetImplBase : public DebugEpochBase {
+  friend class SmallPtrSetIteratorImpl;
+
+protected:
+
+  const void **SmallArray;
+
+
+  const void **CurArray;
+
+  unsigned CurArraySize;
+
+
+
+
+  unsigned NumNonEmpty;
+
+  unsigned NumTombstones;
+
+
+  SmallPtrSetImplBase(const void **SmallStorage,
+                      const SmallPtrSetImplBase &that);
+  SmallPtrSetImplBase(const void **SmallStorage, unsigned SmallSize,
+                      SmallPtrSetImplBase &&that);
+
+  explicit SmallPtrSetImplBase(const void **SmallStorage, unsigned SmallSize)
+      : SmallArray(SmallStorage), CurArray(SmallStorage),
+        CurArraySize(SmallSize), NumNonEmpty(0), NumTombstones(0) {
+    
+   ((
+   SmallSize && (SmallSize & (SmallSize-1)) == 0 && "Initial size must be a power of two!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "SmallSize && (SmallSize & (SmallSize-1)) == 0 && \"Initial size must be a power of two!\""
+   ,
+                                                 "/home/trippels/llvm/llvm/include/llvm/ADT/SmallPtrSet.h"
+    ,
+                                                 79
+    , __PRETTY_FUNCTION__))
+                                                  
+                                                 ;
+  }
+
+  ~SmallPtrSetImplBase() {
+    if (!isSmall())
+      free(CurArray);
+  }
+
+public:
+  using size_type = unsigned;
+
+  SmallPtrSetImplBase &operator=(const SmallPtrSetImplBase &) = delete;
+
+  bool empty() const { return size() == 0; }
+  size_type size() const { return NumNonEmpty - NumTombstones; }
+
+  void clear() {
+    incrementEpoch();
+
+
+    if (!isSmall()) {
+      if (size() * 4 < CurArraySize && CurArraySize > 32)
+        return shrink_and_clear();
+
+      memset(CurArray, -1, CurArraySize * sizeof(void *));
+    }
+
+    NumNonEmpty = 0;
+    NumTombstones = 0;
+  }
+
+protected:
+  static void *getTombstoneMarker() { return reinterpret_cast<void*>(-2); }
+
+  static void *getEmptyMarker() {
+
+
+    return reinterpret_cast<void*>(-1);
+  }
+
+  const void **EndPointer() const {
+    return isSmall() ? CurArray + NumNonEmpty : CurArray + CurArraySize;
+  }
+
+
+
+
+  std::pair<const void *const *, bool> insert_imp(const void *Ptr) {
+    if (isSmall()) {
+
+      const void **LastTombstone = nullptr;
+      for (const void **APtr = SmallArray, **E = SmallArray + NumNonEmpty;
+           APtr != E; ++APtr) {
+        const void *Value = *APtr;
+        if (Value == Ptr)
+          return std::make_pair(APtr, false);
+        if (Value == getTombstoneMarker())
+          LastTombstone = APtr;
+      }
+
+
+      if (LastTombstone != nullptr) {
+        *LastTombstone = Ptr;
+        --NumTombstones;
+        incrementEpoch();
+        return std::make_pair(LastTombstone, true);
+      }
+
+
+      if (NumNonEmpty < CurArraySize) {
+        SmallArray[NumNonEmpty++] = Ptr;
+        incrementEpoch();
+        return std::make_pair(SmallArray + (NumNonEmpty - 1), true);
+      }
+
+    }
+    return insert_imp_big(Ptr);
+  }
+
+
+
+
+
+  bool erase_imp(const void * Ptr) {
+    const void *const *P = find_imp(Ptr);
+    if (P == EndPointer())
+      return false;
+
+    const void **Loc = const_cast<const void **>(P);
+    
+   ((
+   *Loc == Ptr && "broken find!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "*Loc == Ptr && \"broken find!\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/SmallPtrSet.h", 168, __PRETTY_FUNCTION__))
+                                        ;
+    *Loc = getTombstoneMarker();
+    NumTombstones++;
+    return true;
+  }
+
+
+
+
+  const void *const * find_imp(const void * Ptr) const {
+    if (isSmall()) {
+
+      for (const void *const *APtr = SmallArray,
+                      *const *E = SmallArray + NumNonEmpty; APtr != E; ++APtr)
+        if (*APtr == Ptr)
+          return APtr;
+      return EndPointer();
+    }
+
+
+    auto *Bucket = FindBucketFor(Ptr);
+    if (*Bucket == Ptr)
+      return Bucket;
+    return EndPointer();
+  }
+
+private:
+  bool isSmall() const { return CurArray == SmallArray; }
+
+  std::pair<const void *const *, bool> insert_imp_big(const void *Ptr);
+
+  const void * const *FindBucketFor(const void *Ptr) const;
+  void shrink_and_clear();
+
+
+  void Grow(unsigned NewSize);
+
+protected:
+
+
+  void swap(SmallPtrSetImplBase &RHS);
+
+  void CopyFrom(const SmallPtrSetImplBase &RHS);
+  void MoveFrom(unsigned SmallSize, SmallPtrSetImplBase &&RHS);
+
+private:
+
+  void MoveHelper(unsigned SmallSize, SmallPtrSetImplBase &&RHS);
+
+  void CopyHelper(const SmallPtrSetImplBase &RHS);
+};
+
+
+
+class SmallPtrSetIteratorImpl {
+protected:
+  const void *const *Bucket;
+  const void *const *End;
+
+public:
+  explicit SmallPtrSetIteratorImpl(const void *const *BP, const void*const *E)
+    : Bucket(BP), End(E) {
+    if (shouldReverseIterate()) {
+      RetreatIfNotValid();
+      return;
+    }
+    AdvanceIfNotValid();
+  }
+
+  bool operator==(const SmallPtrSetIteratorImpl &RHS) const {
+    return Bucket == RHS.Bucket;
+  }
+  bool operator!=(const SmallPtrSetIteratorImpl &RHS) const {
+    return Bucket != RHS.Bucket;
+  }
+
+protected:
+
+
+
+  void AdvanceIfNotValid() {
+    
+   ((
+   Bucket <= End
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Bucket <= End"
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/SmallPtrSet.h", 249, __PRETTY_FUNCTION__))
+                        ;
+    while (Bucket != End &&
+           (*Bucket == SmallPtrSetImplBase::getEmptyMarker() ||
+            *Bucket == SmallPtrSetImplBase::getTombstoneMarker()))
+      ++Bucket;
+  }
+  void RetreatIfNotValid() {
+    
+   ((
+   Bucket >= End
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Bucket >= End"
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/SmallPtrSet.h", 256, __PRETTY_FUNCTION__))
+                        ;
+    while (Bucket != End &&
+           (Bucket[-1] == SmallPtrSetImplBase::getEmptyMarker() ||
+            Bucket[-1] == SmallPtrSetImplBase::getTombstoneMarker())) {
+      --Bucket;
+    }
+  }
+};
+
+
+template <typename PtrTy>
+class SmallPtrSetIterator : public SmallPtrSetIteratorImpl,
+                            DebugEpochBase::HandleBase {
+  using PtrTraits = PointerLikeTypeTraits<PtrTy>;
+
+public:
+  using value_type = PtrTy;
+  using reference = PtrTy;
+  using pointer = PtrTy;
+  using difference_type = std::ptrdiff_t;
+  using iterator_category = std::forward_iterator_tag;
+
+  explicit SmallPtrSetIterator(const void *const *BP, const void *const *E,
+                               const DebugEpochBase &Epoch)
+      : SmallPtrSetIteratorImpl(BP, E), DebugEpochBase::HandleBase(&Epoch) {}
+
+
+
+  const PtrTy operator*() const {
+    
+   ((
+   isHandleInSync() && "invalid iterator access!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isHandleInSync() && \"invalid iterator access!\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/SmallPtrSet.h", 285, __PRETTY_FUNCTION__))
+                                                         ;
+    if (shouldReverseIterate()) {
+      
+     ((
+     Bucket > End
+     ) ? static_cast<void> (0) : __assert_fail (
+     "Bucket > End"
+     , "/home/trippels/llvm/llvm/include/llvm/ADT/SmallPtrSet.h", 287, __PRETTY_FUNCTION__))
+                         ;
+      return PtrTraits::getFromVoidPointer(const_cast<void *>(Bucket[-1]));
+    }
+    
+   ((
+   Bucket < End
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Bucket < End"
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/SmallPtrSet.h", 290, __PRETTY_FUNCTION__))
+                       ;
+    return PtrTraits::getFromVoidPointer(const_cast<void*>(*Bucket));
+  }
+
+  inline SmallPtrSetIterator& operator++() {
+    
+   ((
+   isHandleInSync() && "invalid iterator access!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isHandleInSync() && \"invalid iterator access!\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/SmallPtrSet.h", 295, __PRETTY_FUNCTION__))
+                                                         ;
+    if (shouldReverseIterate()) {
+      --Bucket;
+      RetreatIfNotValid();
+      return *this;
+    }
+    ++Bucket;
+    AdvanceIfNotValid();
+    return *this;
+  }
+
+  SmallPtrSetIterator operator++(int) {
+    SmallPtrSetIterator tmp = *this;
+    ++*this;
+    return tmp;
+  }
+};
+
+
+
+template<unsigned N>
+struct RoundUpToPowerOfTwo;
+
+
+
+template<unsigned N, bool isPowerTwo>
+struct RoundUpToPowerOfTwoH {
+  enum { Val = N };
+};
+template<unsigned N>
+struct RoundUpToPowerOfTwoH<N, false> {
+  enum {
+
+
+    Val = RoundUpToPowerOfTwo<(N|(N-1)) + 1>::Val
+  };
+};
+
+template<unsigned N>
+struct RoundUpToPowerOfTwo {
+  enum { Val = RoundUpToPowerOfTwoH<N, (N&(N-1)) == 0>::Val };
+};
+
+
+
+
+
+
+template <typename PtrType>
+class SmallPtrSetImpl : public SmallPtrSetImplBase {
+  using ConstPtrType = typename add_const_past_pointer<PtrType>::type;
+  using PtrTraits = PointerLikeTypeTraits<PtrType>;
+  using ConstPtrTraits = PointerLikeTypeTraits<ConstPtrType>;
+
+protected:
+
+  SmallPtrSetImpl(const void **SmallStorage, const SmallPtrSetImpl &that)
+      : SmallPtrSetImplBase(SmallStorage, that) {}
+  SmallPtrSetImpl(const void **SmallStorage, unsigned SmallSize,
+                  SmallPtrSetImpl &&that)
+      : SmallPtrSetImplBase(SmallStorage, SmallSize, std::move(that)) {}
+  explicit SmallPtrSetImpl(const void **SmallStorage, unsigned SmallSize)
+      : SmallPtrSetImplBase(SmallStorage, SmallSize) {}
+
+public:
+  using iterator = SmallPtrSetIterator<PtrType>;
+  using const_iterator = SmallPtrSetIterator<PtrType>;
+  using key_type = ConstPtrType;
+  using value_type = PtrType;
+
+  SmallPtrSetImpl(const SmallPtrSetImpl &) = delete;
+
+
+
+
+
+  std::pair<iterator, bool> insert(PtrType Ptr) {
+    auto p = insert_imp(PtrTraits::getAsVoidPointer(Ptr));
+    return std::make_pair(makeIterator(p.first), p.second);
+  }
+
+
+
+  bool erase(PtrType Ptr) {
+    return erase_imp(PtrTraits::getAsVoidPointer(Ptr));
+  }
+
+  size_type count(ConstPtrType Ptr) const { return find(Ptr) != end() ? 1 : 0; }
+  iterator find(ConstPtrType Ptr) const {
+    return makeIterator(find_imp(ConstPtrTraits::getAsVoidPointer(Ptr)));
+  }
+
+  template <typename IterT>
+  void insert(IterT I, IterT E) {
+    for (; I != E; ++I)
+      insert(*I);
+  }
+
+  void insert(std::initializer_list<PtrType> IL) {
+    insert(IL.begin(), IL.end());
+  }
+
+  iterator begin() const {
+    if (shouldReverseIterate())
+      return makeIterator(EndPointer() - 1);
+    return makeIterator(CurArray);
+  }
+  iterator end() const { return makeIterator(EndPointer()); }
+
+private:
+
+  iterator makeIterator(const void *const *P) const {
+    if (shouldReverseIterate())
+      return iterator(P == EndPointer() ? CurArray : P + 1, CurArray, *this);
+    return iterator(P, EndPointer(), *this);
+  }
+};
+
+
+
+
+
+template<class PtrType, unsigned SmallSize>
+class SmallPtrSet : public SmallPtrSetImpl<PtrType> {
+
+
+
+  static_assert(SmallSize <= 32, "SmallSize should be small");
+
+  using BaseT = SmallPtrSetImpl<PtrType>;
+
+
+  enum { SmallSizePowTwo = RoundUpToPowerOfTwo<SmallSize>::Val };
+
+  const void *SmallStorage[SmallSizePowTwo];
+
+public:
+  SmallPtrSet() : BaseT(SmallStorage, SmallSizePowTwo) {}
+  SmallPtrSet(const SmallPtrSet &that) : BaseT(SmallStorage, that) {}
+  SmallPtrSet(SmallPtrSet &&that)
+      : BaseT(SmallStorage, SmallSizePowTwo, std::move(that)) {}
+
+  template<typename It>
+  SmallPtrSet(It I, It E) : BaseT(SmallStorage, SmallSizePowTwo) {
+    this->insert(I, E);
+  }
+
+  SmallPtrSet(std::initializer_list<PtrType> IL)
+      : BaseT(SmallStorage, SmallSizePowTwo) {
+    this->insert(IL.begin(), IL.end());
+  }
+
+  SmallPtrSet<PtrType, SmallSize> &
+  operator=(const SmallPtrSet<PtrType, SmallSize> &RHS) {
+    if (&RHS != this)
+      this->CopyFrom(RHS);
+    return *this;
+  }
+
+  SmallPtrSet<PtrType, SmallSize> &
+  operator=(SmallPtrSet<PtrType, SmallSize> &&RHS) {
+    if (&RHS != this)
+      this->MoveFrom(SmallSizePowTwo, std::move(RHS));
+    return *this;
+  }
+
+  SmallPtrSet<PtrType, SmallSize> &
+  operator=(std::initializer_list<PtrType> IL) {
+    this->clear();
+    this->insert(IL.begin(), IL.end());
+    return *this;
+  }
+
+
+  void swap(SmallPtrSet<PtrType, SmallSize> &RHS) {
+    SmallPtrSetImplBase::swap(RHS);
+  }
+};
+
+}
+
+namespace std {
+
+
+  template<class T, unsigned N>
+  inline void swap(llvm::SmallPtrSet<T, N> &LHS, llvm::SmallPtrSet<T, N> &RHS) {
+    LHS.swap(RHS);
+  }
+
+}
+
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+
+namespace llvm {
+
+template<typename T>
+struct DenseMapInfo {
+
+
+
+
+};
+
+
+template<typename T>
+struct DenseMapInfo<T*> {
+  static inline T* getEmptyKey() {
+    uintptr_t Val = static_cast<uintptr_t>(-1);
+    Val <<= PointerLikeTypeTraits<T*>::NumLowBitsAvailable;
+    return reinterpret_cast<T*>(Val);
+  }
+
+  static inline T* getTombstoneKey() {
+    uintptr_t Val = static_cast<uintptr_t>(-2);
+    Val <<= PointerLikeTypeTraits<T*>::NumLowBitsAvailable;
+    return reinterpret_cast<T*>(Val);
+  }
+
+  static unsigned getHashValue(const T *PtrVal) {
+    return (unsigned((uintptr_t)PtrVal) >> 4) ^
+           (unsigned((uintptr_t)PtrVal) >> 9);
+  }
+
+  static bool isEqual(const T *LHS, const T *RHS) { return LHS == RHS; }
+};
+
+
+template<> struct DenseMapInfo<char> {
+  static inline char getEmptyKey() { return ~0; }
+  static inline char getTombstoneKey() { return ~0 - 1; }
+  static unsigned getHashValue(const char& Val) { return Val * 37U; }
+
+  static bool isEqual(const char &LHS, const char &RHS) {
+    return LHS == RHS;
+  }
+};
+
+
+template <> struct DenseMapInfo<unsigned short> {
+  static inline unsigned short getEmptyKey() { return 0xFFFF; }
+  static inline unsigned short getTombstoneKey() { return 0xFFFF - 1; }
+  static unsigned getHashValue(const unsigned short &Val) { return Val * 37U; }
+
+  static bool isEqual(const unsigned short &LHS, const unsigned short &RHS) {
+    return LHS == RHS;
+  }
+};
+
+
+template<> struct DenseMapInfo<unsigned> {
+  static inline unsigned getEmptyKey() { return ~0U; }
+  static inline unsigned getTombstoneKey() { return ~0U - 1; }
+  static unsigned getHashValue(const unsigned& Val) { return Val * 37U; }
+
+  static bool isEqual(const unsigned& LHS, const unsigned& RHS) {
+    return LHS == RHS;
+  }
+};
+
+
+template<> struct DenseMapInfo<unsigned long> {
+  static inline unsigned long getEmptyKey() { return ~0UL; }
+  static inline unsigned long getTombstoneKey() { return ~0UL - 1L; }
+
+  static unsigned getHashValue(const unsigned long& Val) {
+    return (unsigned)(Val * 37UL);
+  }
+
+  static bool isEqual(const unsigned long& LHS, const unsigned long& RHS) {
+    return LHS == RHS;
+  }
+};
+
+
+template<> struct DenseMapInfo<unsigned long long> {
+  static inline unsigned long long getEmptyKey() { return ~0ULL; }
+  static inline unsigned long long getTombstoneKey() { return ~0ULL - 1ULL; }
+
+  static unsigned getHashValue(const unsigned long long& Val) {
+    return (unsigned)(Val * 37ULL);
+  }
+
+  static bool isEqual(const unsigned long long& LHS,
+                      const unsigned long long& RHS) {
+    return LHS == RHS;
+  }
+};
+
+
+template <> struct DenseMapInfo<short> {
+  static inline short getEmptyKey() { return 0x7FFF; }
+  static inline short getTombstoneKey() { return -0x7FFF - 1; }
+  static unsigned getHashValue(const short &Val) { return Val * 37U; }
+  static bool isEqual(const short &LHS, const short &RHS) { return LHS == RHS; }
+};
+
+
+template<> struct DenseMapInfo<int> {
+  static inline int getEmptyKey() { return 0x7fffffff; }
+  static inline int getTombstoneKey() { return -0x7fffffff - 1; }
+  static unsigned getHashValue(const int& Val) { return (unsigned)(Val * 37U); }
+
+  static bool isEqual(const int& LHS, const int& RHS) {
+    return LHS == RHS;
+  }
+};
+
+
+template<> struct DenseMapInfo<long> {
+  static inline long getEmptyKey() {
+    return (1UL << (sizeof(long) * 8 - 1)) - 1UL;
+  }
+
+  static inline long getTombstoneKey() { return getEmptyKey() - 1L; }
+
+  static unsigned getHashValue(const long& Val) {
+    return (unsigned)(Val * 37UL);
+  }
+
+  static bool isEqual(const long& LHS, const long& RHS) {
+    return LHS == RHS;
+  }
+};
+
+
+template<> struct DenseMapInfo<long long> {
+  static inline long long getEmptyKey() { return 0x7fffffffffffffffLL; }
+  static inline long long getTombstoneKey() { return -0x7fffffffffffffffLL-1; }
+
+  static unsigned getHashValue(const long long& Val) {
+    return (unsigned)(Val * 37ULL);
+  }
+
+  static bool isEqual(const long long& LHS,
+                      const long long& RHS) {
+    return LHS == RHS;
+  }
+};
+
+
+template<typename T, typename U>
+struct DenseMapInfo<std::pair<T, U>> {
+  using Pair = std::pair<T, U>;
+  using FirstInfo = DenseMapInfo<T>;
+  using SecondInfo = DenseMapInfo<U>;
+
+  static inline Pair getEmptyKey() {
+    return std::make_pair(FirstInfo::getEmptyKey(),
+                          SecondInfo::getEmptyKey());
+  }
+
+  static inline Pair getTombstoneKey() {
+    return std::make_pair(FirstInfo::getTombstoneKey(),
+                          SecondInfo::getTombstoneKey());
+  }
+
+  static unsigned getHashValue(const Pair& PairVal) {
+    uint64_t key = (uint64_t)FirstInfo::getHashValue(PairVal.first) << 32
+          | (uint64_t)SecondInfo::getHashValue(PairVal.second);
+    key += ~(key << 32);
+    key ^= (key >> 22);
+    key += ~(key << 13);
+    key ^= (key >> 8);
+    key += (key << 3);
+    key ^= (key >> 15);
+    key += ~(key << 27);
+    key ^= (key >> 31);
+    return (unsigned)key;
+  }
+
+  static bool isEqual(const Pair &LHS, const Pair &RHS) {
+    return FirstInfo::isEqual(LHS.first, RHS.first) &&
+           SecondInfo::isEqual(LHS.second, RHS.second);
+  }
+};
+
+
+template <> struct DenseMapInfo<StringRef> {
+  static inline StringRef getEmptyKey() {
+    return StringRef(reinterpret_cast<const char *>(~static_cast<uintptr_t>(0)),
+                     0);
+  }
+
+  static inline StringRef getTombstoneKey() {
+    return StringRef(reinterpret_cast<const char *>(~static_cast<uintptr_t>(1)),
+                     0);
+  }
+
+  static unsigned getHashValue(StringRef Val) {
+    
+   ((
+   Val.data() != getEmptyKey().data() && "Cannot hash the empty key!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Val.data() != getEmptyKey().data() && \"Cannot hash the empty key!\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/DenseMapInfo.h", 222, __PRETTY_FUNCTION__))
+                                                                             ;
+    
+   ((
+   Val.data() != getTombstoneKey().data() && "Cannot hash the tombstone key!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Val.data() != getTombstoneKey().data() && \"Cannot hash the tombstone key!\""
+   ,
+                                           "/home/trippels/llvm/llvm/include/llvm/ADT/DenseMapInfo.h"
+    ,
+                                           224
+    , __PRETTY_FUNCTION__))
+                                            
+                                           ;
+    return (unsigned)(hash_value(Val));
+  }
+
+  static bool isEqual(StringRef LHS, StringRef RHS) {
+    if (RHS.data() == getEmptyKey().data())
+      return LHS.data() == getEmptyKey().data();
+    if (RHS.data() == getTombstoneKey().data())
+      return LHS.data() == getTombstoneKey().data();
+    return LHS == RHS;
+  }
+};
+
+
+template <typename T> struct DenseMapInfo<ArrayRef<T>> {
+  static inline ArrayRef<T> getEmptyKey() {
+    return ArrayRef<T>(reinterpret_cast<const T *>(~static_cast<uintptr_t>(0)),
+                       size_t(0));
+  }
+
+  static inline ArrayRef<T> getTombstoneKey() {
+    return ArrayRef<T>(reinterpret_cast<const T *>(~static_cast<uintptr_t>(1)),
+                       size_t(0));
+  }
+
+  static unsigned getHashValue(ArrayRef<T> Val) {
+    
+   ((
+   Val.data() != getEmptyKey().data() && "Cannot hash the empty key!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Val.data() != getEmptyKey().data() && \"Cannot hash the empty key!\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/DenseMapInfo.h", 250, __PRETTY_FUNCTION__))
+                                                                             ;
+    
+   ((
+   Val.data() != getTombstoneKey().data() && "Cannot hash the tombstone key!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Val.data() != getTombstoneKey().data() && \"Cannot hash the tombstone key!\""
+   ,
+                                           "/home/trippels/llvm/llvm/include/llvm/ADT/DenseMapInfo.h"
+    ,
+                                           252
+    , __PRETTY_FUNCTION__))
+                                            
+                                           ;
+    return (unsigned)(hash_value(Val));
+  }
+
+  static bool isEqual(ArrayRef<T> LHS, ArrayRef<T> RHS) {
+    if (RHS.data() == getEmptyKey().data())
+      return LHS.data() == getEmptyKey().data();
+    if (RHS.data() == getTombstoneKey().data())
+      return LHS.data() == getTombstoneKey().data();
+    return LHS == RHS;
+  }
+};
+
+}
+
+
+
+
+
+
+
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+       
+
+
+
+
+
+
+namespace llvm {
+
+namespace detail {
+
+
+
+template <typename KeyT, typename ValueT>
+struct DenseMapPair : public std::pair<KeyT, ValueT> {
+  KeyT &getFirst() { return std::pair<KeyT, ValueT>::first; }
+  const KeyT &getFirst() const { return std::pair<KeyT, ValueT>::first; }
+  ValueT &getSecond() { return std::pair<KeyT, ValueT>::second; }
+  const ValueT &getSecond() const { return std::pair<KeyT, ValueT>::second; }
+};
+
+}
+
+template <
+    typename KeyT, typename ValueT, typename KeyInfoT = DenseMapInfo<KeyT>,
+    typename Bucket = detail::DenseMapPair<KeyT, ValueT>, bool IsConst = false>
+class DenseMapIterator;
+
+template <typename DerivedT, typename KeyT, typename ValueT, typename KeyInfoT,
+          typename BucketT>
+class DenseMapBase : public DebugEpochBase {
+  template <typename T>
+  using const_arg_type_t = typename const_pointer_or_const_ref<T>::type;
+
+public:
+  using size_type = unsigned;
+  using key_type = KeyT;
+  using mapped_type = ValueT;
+  using value_type = BucketT;
+
+  using iterator = DenseMapIterator<KeyT, ValueT, KeyInfoT, BucketT>;
+  using const_iterator =
+      DenseMapIterator<KeyT, ValueT, KeyInfoT, BucketT, true>;
+
+  inline iterator begin() {
+
+
+    if (empty())
+      return end();
+    if (shouldReverseIterate<KeyT>())
+      return makeIterator(getBucketsEnd() - 1, getBuckets(), *this);
+    return makeIterator(getBuckets(), getBucketsEnd(), *this);
+  }
+  inline iterator end() {
+    return makeIterator(getBucketsEnd(), getBucketsEnd(), *this, true);
+  }
+  inline const_iterator begin() const {
+    if (empty())
+      return end();
+    if (shouldReverseIterate<KeyT>())
+      return makeConstIterator(getBucketsEnd() - 1, getBuckets(), *this);
+    return makeConstIterator(getBuckets(), getBucketsEnd(), *this);
+  }
+  inline const_iterator end() const {
+    return makeConstIterator(getBucketsEnd(), getBucketsEnd(), *this, true);
+  }
+
+  bool empty() const {
+    return getNumEntries() == 0;
+  }
+  unsigned size() const { return getNumEntries(); }
+
+
+
+  void reserve(size_type NumEntries) {
+    auto NumBuckets = getMinBucketToReserveForEntries(NumEntries);
+    incrementEpoch();
+    if (NumBuckets > getNumBuckets())
+      grow(NumBuckets);
+  }
+
+  void clear() {
+    incrementEpoch();
+    if (getNumEntries() == 0 && getNumTombstones() == 0) return;
+
+
+
+    if (getNumEntries() * 4 < getNumBuckets() && getNumBuckets() > 64) {
+      shrink_and_clear();
+      return;
+    }
+
+    const KeyT EmptyKey = getEmptyKey(), TombstoneKey = getTombstoneKey();
+    if (isPodLike<KeyT>::value && isPodLike<ValueT>::value) {
+
+      for (BucketT *P = getBuckets(), *E = getBucketsEnd(); P != E; ++P)
+        P->getFirst() = EmptyKey;
+    } else {
+      unsigned NumEntries = getNumEntries();
+      for (BucketT *P = getBuckets(), *E = getBucketsEnd(); P != E; ++P) {
+        if (!KeyInfoT::isEqual(P->getFirst(), EmptyKey)) {
+          if (!KeyInfoT::isEqual(P->getFirst(), TombstoneKey)) {
+            P->getSecond().~ValueT();
+            --NumEntries;
+          }
+          P->getFirst() = EmptyKey;
+        }
+      }
+      
+     ((
+     NumEntries == 0 && "Node count imbalance!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "NumEntries == 0 && \"Node count imbalance!\""
+     , "/home/trippels/llvm/llvm/include/llvm/ADT/DenseMap.h", 134, __PRETTY_FUNCTION__))
+                                                       ;
+    }
+    setNumEntries(0);
+    setNumTombstones(0);
+  }
+
+
+  size_type count(const_arg_type_t<KeyT> Val) const {
+    const BucketT *TheBucket;
+    return LookupBucketFor(Val, TheBucket) ? 1 : 0;
+  }
+
+  iterator find(const_arg_type_t<KeyT> Val) {
+    BucketT *TheBucket;
+    if (LookupBucketFor(Val, TheBucket))
+      return makeIterator(TheBucket, getBucketsEnd(), *this, true);
+    return end();
+  }
+  const_iterator find(const_arg_type_t<KeyT> Val) const {
+    const BucketT *TheBucket;
+    if (LookupBucketFor(Val, TheBucket))
+      return makeConstIterator(TheBucket, getBucketsEnd(), *this, true);
+    return end();
+  }
+
+
+
+
+
+
+  template<class LookupKeyT>
+  iterator find_as(const LookupKeyT &Val) {
+    BucketT *TheBucket;
+    if (LookupBucketFor(Val, TheBucket))
+      return makeIterator(TheBucket, getBucketsEnd(), *this, true);
+    return end();
+  }
+  template<class LookupKeyT>
+  const_iterator find_as(const LookupKeyT &Val) const {
+    const BucketT *TheBucket;
+    if (LookupBucketFor(Val, TheBucket))
+      return makeConstIterator(TheBucket, getBucketsEnd(), *this, true);
+    return end();
+  }
+
+
+
+  ValueT lookup(const_arg_type_t<KeyT> Val) const {
+    const BucketT *TheBucket;
+    if (LookupBucketFor(Val, TheBucket))
+      return TheBucket->getSecond();
+    return ValueT();
+  }
+
+
+
+
+  std::pair<iterator, bool> insert(const std::pair<KeyT, ValueT> &KV) {
+    return try_emplace(KV.first, KV.second);
+  }
+
+
+
+
+  std::pair<iterator, bool> insert(std::pair<KeyT, ValueT> &&KV) {
+    return try_emplace(std::move(KV.first), std::move(KV.second));
+  }
+
+
+
+
+  template <typename... Ts>
+  std::pair<iterator, bool> try_emplace(KeyT &&Key, Ts &&... Args) {
+    BucketT *TheBucket;
+    if (LookupBucketFor(Key, TheBucket))
+      return std::make_pair(
+               makeIterator(TheBucket, getBucketsEnd(), *this, true),
+               false);
+
+
+    TheBucket =
+        InsertIntoBucket(TheBucket, std::move(Key), std::forward<Ts>(Args)...);
+    return std::make_pair(
+             makeIterator(TheBucket, getBucketsEnd(), *this, true),
+             true);
+  }
+
+
+
+
+  template <typename... Ts>
+  std::pair<iterator, bool> try_emplace(const KeyT &Key, Ts &&... Args) {
+    BucketT *TheBucket;
+    if (LookupBucketFor(Key, TheBucket))
+      return std::make_pair(
+               makeIterator(TheBucket, getBucketsEnd(), *this, true),
+               false);
+
+
+    TheBucket = InsertIntoBucket(TheBucket, Key, std::forward<Ts>(Args)...);
+    return std::make_pair(
+             makeIterator(TheBucket, getBucketsEnd(), *this, true),
+             true);
+  }
+
+
+
+
+
+
+  template <typename LookupKeyT>
+  std::pair<iterator, bool> insert_as(std::pair<KeyT, ValueT> &&KV,
+                                      const LookupKeyT &Val) {
+    BucketT *TheBucket;
+    if (LookupBucketFor(Val, TheBucket))
+      return std::make_pair(
+               makeIterator(TheBucket, getBucketsEnd(), *this, true),
+               false);
+
+
+    TheBucket = InsertIntoBucketWithLookup(TheBucket, std::move(KV.first),
+                                           std::move(KV.second), Val);
+    return std::make_pair(
+             makeIterator(TheBucket, getBucketsEnd(), *this, true),
+             true);
+  }
+
+
+  template<typename InputIt>
+  void insert(InputIt I, InputIt E) {
+    for (; I != E; ++I)
+      insert(*I);
+  }
+
+  bool erase(const KeyT &Val) {
+    BucketT *TheBucket;
+    if (!LookupBucketFor(Val, TheBucket))
+      return false;
+
+    TheBucket->getSecond().~ValueT();
+    TheBucket->getFirst() = getTombstoneKey();
+    decrementNumEntries();
+    incrementNumTombstones();
+    return true;
+  }
+  void erase(iterator I) {
+    BucketT *TheBucket = &*I;
+    TheBucket->getSecond().~ValueT();
+    TheBucket->getFirst() = getTombstoneKey();
+    decrementNumEntries();
+    incrementNumTombstones();
+  }
+
+  value_type& FindAndConstruct(const KeyT &Key) {
+    BucketT *TheBucket;
+    if (LookupBucketFor(Key, TheBucket))
+      return *TheBucket;
+
+    return *InsertIntoBucket(TheBucket, Key);
+  }
+
+  ValueT &operator[](const KeyT &Key) {
+    return FindAndConstruct(Key).second;
+  }
+
+  value_type& FindAndConstruct(KeyT &&Key) {
+    BucketT *TheBucket;
+    if (LookupBucketFor(Key, TheBucket))
+      return *TheBucket;
+
+    return *InsertIntoBucket(TheBucket, std::move(Key));
+  }
+
+  ValueT &operator[](KeyT &&Key) {
+    return FindAndConstruct(std::move(Key)).second;
+  }
+
+
+
+
+  bool isPointerIntoBucketsArray(const void *Ptr) const {
+    return Ptr >= getBuckets() && Ptr < getBucketsEnd();
+  }
+
+
+
+
+  const void *getPointerIntoBucketsArray() const { return getBuckets(); }
+
+protected:
+  DenseMapBase() = default;
+
+  void destroyAll() {
+    if (getNumBuckets() == 0)
+      return;
+
+    const KeyT EmptyKey = getEmptyKey(), TombstoneKey = getTombstoneKey();
+    for (BucketT *P = getBuckets(), *E = getBucketsEnd(); P != E; ++P) {
+      if (!KeyInfoT::isEqual(P->getFirst(), EmptyKey) &&
+          !KeyInfoT::isEqual(P->getFirst(), TombstoneKey))
+        P->getSecond().~ValueT();
+      P->getFirst().~KeyT();
+    }
+  }
+
+  void initEmpty() {
+    setNumEntries(0);
+    setNumTombstones(0);
+
+    
+   ((
+   (getNumBuckets() & (getNumBuckets()-1)) == 0 && "# initial buckets must be a power of two!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "(getNumBuckets() & (getNumBuckets()-1)) == 0 && \"# initial buckets must be a power of two!\""
+   ,
+                                                      "/home/trippels/llvm/llvm/include/llvm/ADT/DenseMap.h"
+    ,
+                                                      344
+    , __PRETTY_FUNCTION__))
+                                                       
+                                                      ;
+    const KeyT EmptyKey = getEmptyKey();
+    for (BucketT *B = getBuckets(), *E = getBucketsEnd(); B != E; ++B)
+      ::new (&B->getFirst()) KeyT(EmptyKey);
+  }
+
+
+
+  unsigned getMinBucketToReserveForEntries(unsigned NumEntries) {
+
+    if (NumEntries == 0)
+      return 0;
+
+
+    return NextPowerOf2(NumEntries * 4 / 3 + 1);
+  }
+
+  void moveFromOldBuckets(BucketT *OldBucketsBegin, BucketT *OldBucketsEnd) {
+    initEmpty();
+
+
+    const KeyT EmptyKey = getEmptyKey();
+    const KeyT TombstoneKey = getTombstoneKey();
+    for (BucketT *B = OldBucketsBegin, *E = OldBucketsEnd; B != E; ++B) {
+      if (!KeyInfoT::isEqual(B->getFirst(), EmptyKey) &&
+          !KeyInfoT::isEqual(B->getFirst(), TombstoneKey)) {
+
+        BucketT *DestBucket;
+        bool FoundVal = LookupBucketFor(B->getFirst(), DestBucket);
+        (void)FoundVal;
+        
+       ((
+       !FoundVal && "Key already in new map?"
+       ) ? static_cast<void> (0) : __assert_fail (
+       "!FoundVal && \"Key already in new map?\""
+       , "/home/trippels/llvm/llvm/include/llvm/ADT/DenseMap.h", 374, __PRETTY_FUNCTION__))
+                                                     ;
+        DestBucket->getFirst() = std::move(B->getFirst());
+        ::new (&DestBucket->getSecond()) ValueT(std::move(B->getSecond()));
+        incrementNumEntries();
+
+
+        B->getSecond().~ValueT();
+      }
+      B->getFirst().~KeyT();
+    }
+  }
+
+  template <typename OtherBaseT>
+  void copyFrom(
+      const DenseMapBase<OtherBaseT, KeyT, ValueT, KeyInfoT, BucketT> &other) {
+    
+   ((
+   &other != this
+   ) ? static_cast<void> (0) : __assert_fail (
+   "&other != this"
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/DenseMap.h", 389, __PRETTY_FUNCTION__))
+                         ;
+    
+   ((
+   getNumBuckets() == other.getNumBuckets()
+   ) ? static_cast<void> (0) : __assert_fail (
+   "getNumBuckets() == other.getNumBuckets()"
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/DenseMap.h", 390, __PRETTY_FUNCTION__))
+                                                   ;
+
+    setNumEntries(other.getNumEntries());
+    setNumTombstones(other.getNumTombstones());
+
+    if (isPodLike<KeyT>::value && isPodLike<ValueT>::value)
+      memcpy(getBuckets(), other.getBuckets(),
+             getNumBuckets() * sizeof(BucketT));
+    else
+      for (size_t i = 0; i < getNumBuckets(); ++i) {
+        ::new (&getBuckets()[i].getFirst())
+            KeyT(other.getBuckets()[i].getFirst());
+        if (!KeyInfoT::isEqual(getBuckets()[i].getFirst(), getEmptyKey()) &&
+            !KeyInfoT::isEqual(getBuckets()[i].getFirst(), getTombstoneKey()))
+          ::new (&getBuckets()[i].getSecond())
+              ValueT(other.getBuckets()[i].getSecond());
+      }
+  }
+
+  static unsigned getHashValue(const KeyT &Val) {
+    return KeyInfoT::getHashValue(Val);
+  }
+
+  template<typename LookupKeyT>
+  static unsigned getHashValue(const LookupKeyT &Val) {
+    return KeyInfoT::getHashValue(Val);
+  }
+
+  static const KeyT getEmptyKey() {
+    static_assert(std::is_base_of<DenseMapBase, DerivedT>::value,
+                  "Must pass the derived type to this template!");
+    return KeyInfoT::getEmptyKey();
+  }
+
+  static const KeyT getTombstoneKey() {
+    return KeyInfoT::getTombstoneKey();
+  }
+
+private:
+  iterator makeIterator(BucketT *P, BucketT *E,
+                        DebugEpochBase &Epoch,
+                        bool NoAdvance=false) {
+    if (shouldReverseIterate<KeyT>()) {
+      BucketT *B = P == getBucketsEnd() ? getBuckets() : P + 1;
+      return iterator(B, E, Epoch, NoAdvance);
+    }
+    return iterator(P, E, Epoch, NoAdvance);
+  }
+
+  const_iterator makeConstIterator(const BucketT *P, const BucketT *E,
+                                   const DebugEpochBase &Epoch,
+                                   const bool NoAdvance=false) const {
+    if (shouldReverseIterate<KeyT>()) {
+      const BucketT *B = P == getBucketsEnd() ? getBuckets() : P + 1;
+      return const_iterator(B, E, Epoch, NoAdvance);
+    }
+    return const_iterator(P, E, Epoch, NoAdvance);
+  }
+
+  unsigned getNumEntries() const {
+    return static_cast<const DerivedT *>(this)->getNumEntries();
+  }
+
+  void setNumEntries(unsigned Num) {
+    static_cast<DerivedT *>(this)->setNumEntries(Num);
+  }
+
+  void incrementNumEntries() {
+    setNumEntries(getNumEntries() + 1);
+  }
+
+  void decrementNumEntries() {
+    setNumEntries(getNumEntries() - 1);
+  }
+
+  unsigned getNumTombstones() const {
+    return static_cast<const DerivedT *>(this)->getNumTombstones();
+  }
+
+  void setNumTombstones(unsigned Num) {
+    static_cast<DerivedT *>(this)->setNumTombstones(Num);
+  }
+
+  void incrementNumTombstones() {
+    setNumTombstones(getNumTombstones() + 1);
+  }
+
+  void decrementNumTombstones() {
+    setNumTombstones(getNumTombstones() - 1);
+  }
+
+  const BucketT *getBuckets() const {
+    return static_cast<const DerivedT *>(this)->getBuckets();
+  }
+
+  BucketT *getBuckets() {
+    return static_cast<DerivedT *>(this)->getBuckets();
+  }
+
+  unsigned getNumBuckets() const {
+    return static_cast<const DerivedT *>(this)->getNumBuckets();
+  }
+
+  BucketT *getBucketsEnd() {
+    return getBuckets() + getNumBuckets();
+  }
+
+  const BucketT *getBucketsEnd() const {
+    return getBuckets() + getNumBuckets();
+  }
+
+  void grow(unsigned AtLeast) {
+    static_cast<DerivedT *>(this)->grow(AtLeast);
+  }
+
+  void shrink_and_clear() {
+    static_cast<DerivedT *>(this)->shrink_and_clear();
+  }
+
+  template <typename KeyArg, typename... ValueArgs>
+  BucketT *InsertIntoBucket(BucketT *TheBucket, KeyArg &&Key,
+                            ValueArgs &&... Values) {
+    TheBucket = InsertIntoBucketImpl(Key, Key, TheBucket);
+
+    TheBucket->getFirst() = std::forward<KeyArg>(Key);
+    ::new (&TheBucket->getSecond()) ValueT(std::forward<ValueArgs>(Values)...);
+    return TheBucket;
+  }
+
+  template <typename LookupKeyT>
+  BucketT *InsertIntoBucketWithLookup(BucketT *TheBucket, KeyT &&Key,
+                                      ValueT &&Value, LookupKeyT &Lookup) {
+    TheBucket = InsertIntoBucketImpl(Key, Lookup, TheBucket);
+
+    TheBucket->getFirst() = std::move(Key);
+    ::new (&TheBucket->getSecond()) ValueT(std::move(Value));
+    return TheBucket;
+  }
+
+  template <typename LookupKeyT>
+  BucketT *InsertIntoBucketImpl(const KeyT &Key, const LookupKeyT &Lookup,
+                                BucketT *TheBucket) {
+    incrementEpoch();
+    unsigned NewNumEntries = getNumEntries() + 1;
+    unsigned NumBuckets = getNumBuckets();
+    if (__builtin_expect((bool)(NewNumEntries * 4 >= NumBuckets * 3), false)) {
+      this->grow(NumBuckets * 2);
+      LookupBucketFor(Lookup, TheBucket);
+      NumBuckets = getNumBuckets();
+    } else if (__builtin_expect((bool)(NumBuckets-(NewNumEntries+getNumTombstones()) <= NumBuckets/8), false)
+                                          ) {
+      this->grow(NumBuckets);
+      LookupBucketFor(Lookup, TheBucket);
+    }
+    
+   ((
+   TheBucket
+   ) ? static_cast<void> (0) : __assert_fail (
+   "TheBucket"
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/DenseMap.h", 554, __PRETTY_FUNCTION__))
+                    ;
+
+
+
+    incrementNumEntries();
+
+
+    const KeyT EmptyKey = getEmptyKey();
+    if (!KeyInfoT::isEqual(TheBucket->getFirst(), EmptyKey))
+      decrementNumTombstones();
+
+    return TheBucket;
+  }
+
+
+
+
+
+  template<typename LookupKeyT>
+  bool LookupBucketFor(const LookupKeyT &Val,
+                       const BucketT *&FoundBucket) const {
+    const BucketT *BucketsPtr = getBuckets();
+    const unsigned NumBuckets = getNumBuckets();
+
+    if (NumBuckets == 0) {
+      FoundBucket = nullptr;
+      return false;
+    }
+
+
+    const BucketT *FoundTombstone = nullptr;
+    const KeyT EmptyKey = getEmptyKey();
+    const KeyT TombstoneKey = getTombstoneKey();
+    
+   ((
+   !KeyInfoT::isEqual(Val, EmptyKey) && !KeyInfoT::isEqual(Val, TombstoneKey) && "Empty/Tombstone value shouldn't be inserted into map!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!KeyInfoT::isEqual(Val, EmptyKey) && !KeyInfoT::isEqual(Val, TombstoneKey) && \"Empty/Tombstone value shouldn't be inserted into map!\""
+   ,
+
+                                                                  "/home/trippels/llvm/llvm/include/llvm/ADT/DenseMap.h"
+    ,
+
+                                                                  589
+    , __PRETTY_FUNCTION__))
+
+                                                                   
+                                                                  ;
+
+    unsigned BucketNo = getHashValue(Val) & (NumBuckets-1);
+    unsigned ProbeAmt = 1;
+    while (true) {
+      const BucketT *ThisBucket = BucketsPtr + BucketNo;
+
+      if (__builtin_expect((bool)(KeyInfoT::isEqual(Val, ThisBucket->getFirst())), true)) {
+        FoundBucket = ThisBucket;
+        return true;
+      }
+
+
+
+      if (__builtin_expect((bool)(KeyInfoT::isEqual(ThisBucket->getFirst(), EmptyKey)), true)) {
+
+
+        FoundBucket = FoundTombstone ? FoundTombstone : ThisBucket;
+        return false;
+      }
+
+
+
+      if (KeyInfoT::isEqual(ThisBucket->getFirst(), TombstoneKey) &&
+          !FoundTombstone)
+        FoundTombstone = ThisBucket;
+
+
+
+      BucketNo += ProbeAmt++;
+      BucketNo &= (NumBuckets-1);
+    }
+  }
+
+  template <typename LookupKeyT>
+  bool LookupBucketFor(const LookupKeyT &Val, BucketT *&FoundBucket) {
+    const BucketT *ConstFoundBucket;
+    bool Result = const_cast<const DenseMapBase *>(this)
+      ->LookupBucketFor(Val, ConstFoundBucket);
+    FoundBucket = const_cast<BucketT *>(ConstFoundBucket);
+    return Result;
+  }
+
+public:
+
+
+
+
+  size_t getMemorySize() const {
+    return getNumBuckets() * sizeof(BucketT);
+  }
+};
+
+template <typename KeyT, typename ValueT,
+          typename KeyInfoT = DenseMapInfo<KeyT>,
+          typename BucketT = detail::DenseMapPair<KeyT, ValueT>>
+class DenseMap : public DenseMapBase<DenseMap<KeyT, ValueT, KeyInfoT, BucketT>,
+                                     KeyT, ValueT, KeyInfoT, BucketT> {
+  friend class DenseMapBase<DenseMap, KeyT, ValueT, KeyInfoT, BucketT>;
+
+
+
+  using BaseT = DenseMapBase<DenseMap, KeyT, ValueT, KeyInfoT, BucketT>;
+
+  BucketT *Buckets;
+  unsigned NumEntries;
+  unsigned NumTombstones;
+  unsigned NumBuckets;
+
+public:
+
+
+  explicit DenseMap(unsigned InitialReserve = 0) { init(InitialReserve); }
+
+  DenseMap(const DenseMap &other) : BaseT() {
+    init(0);
+    copyFrom(other);
+  }
+
+  DenseMap(DenseMap &&other) : BaseT() {
+    init(0);
+    swap(other);
+  }
+
+  template<typename InputIt>
+  DenseMap(const InputIt &I, const InputIt &E) {
+    init(std::distance(I, E));
+    this->insert(I, E);
+  }
+
+  ~DenseMap() {
+    this->destroyAll();
+    operator delete(Buckets);
+  }
+
+  void swap(DenseMap& RHS) {
+    this->incrementEpoch();
+    RHS.incrementEpoch();
+    std::swap(Buckets, RHS.Buckets);
+    std::swap(NumEntries, RHS.NumEntries);
+    std::swap(NumTombstones, RHS.NumTombstones);
+    std::swap(NumBuckets, RHS.NumBuckets);
+  }
+
+  DenseMap& operator=(const DenseMap& other) {
+    if (&other != this)
+      copyFrom(other);
+    return *this;
+  }
+
+  DenseMap& operator=(DenseMap &&other) {
+    this->destroyAll();
+    operator delete(Buckets);
+    init(0);
+    swap(other);
+    return *this;
+  }
+
+  void copyFrom(const DenseMap& other) {
+    this->destroyAll();
+    operator delete(Buckets);
+    if (allocateBuckets(other.NumBuckets)) {
+      this->BaseT::copyFrom(other);
+    } else {
+      NumEntries = 0;
+      NumTombstones = 0;
+    }
+  }
+
+  void init(unsigned InitNumEntries) {
+    auto InitBuckets = BaseT::getMinBucketToReserveForEntries(InitNumEntries);
+    if (allocateBuckets(InitBuckets)) {
+      this->BaseT::initEmpty();
+    } else {
+      NumEntries = 0;
+      NumTombstones = 0;
+    }
+  }
+
+  void grow(unsigned AtLeast) {
+    unsigned OldNumBuckets = NumBuckets;
+    BucketT *OldBuckets = Buckets;
+
+    allocateBuckets(std::max<unsigned>(64, static_cast<unsigned>(NextPowerOf2(AtLeast-1))));
+    
+   ((
+   Buckets
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Buckets"
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/DenseMap.h", 733, __PRETTY_FUNCTION__))
+                  ;
+    if (!OldBuckets) {
+      this->BaseT::initEmpty();
+      return;
+    }
+
+    this->moveFromOldBuckets(OldBuckets, OldBuckets+OldNumBuckets);
+
+
+    operator delete(OldBuckets);
+  }
+
+  void shrink_and_clear() {
+    unsigned OldNumEntries = NumEntries;
+    this->destroyAll();
+
+
+    unsigned NewNumBuckets = 0;
+    if (OldNumEntries)
+      NewNumBuckets = std::max(64, 1 << (Log2_32_Ceil(OldNumEntries) + 1));
+    if (NewNumBuckets == NumBuckets) {
+      this->BaseT::initEmpty();
+      return;
+    }
+
+    operator delete(Buckets);
+    init(NewNumBuckets);
+  }
+
+private:
+  unsigned getNumEntries() const {
+    return NumEntries;
+  }
+
+  void setNumEntries(unsigned Num) {
+    NumEntries = Num;
+  }
+
+  unsigned getNumTombstones() const {
+    return NumTombstones;
+  }
+
+  void setNumTombstones(unsigned Num) {
+    NumTombstones = Num;
+  }
+
+  BucketT *getBuckets() const {
+    return Buckets;
+  }
+
+  unsigned getNumBuckets() const {
+    return NumBuckets;
+  }
+
+  bool allocateBuckets(unsigned Num) {
+    NumBuckets = Num;
+    if (NumBuckets == 0) {
+      Buckets = nullptr;
+      return false;
+    }
+
+    Buckets = static_cast<BucketT*>(operator new(sizeof(BucketT) * NumBuckets));
+    return true;
+  }
+};
+
+template <typename KeyT, typename ValueT, unsigned InlineBuckets = 4,
+          typename KeyInfoT = DenseMapInfo<KeyT>,
+          typename BucketT = detail::DenseMapPair<KeyT, ValueT>>
+class SmallDenseMap
+    : public DenseMapBase<
+          SmallDenseMap<KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT>, KeyT,
+          ValueT, KeyInfoT, BucketT> {
+  friend class DenseMapBase<SmallDenseMap, KeyT, ValueT, KeyInfoT, BucketT>;
+
+
+
+  using BaseT = DenseMapBase<SmallDenseMap, KeyT, ValueT, KeyInfoT, BucketT>;
+
+  static_assert(isPowerOf2_64(InlineBuckets),
+                "InlineBuckets must be a power of 2.");
+
+  unsigned Small : 1;
+  unsigned NumEntries : 31;
+  unsigned NumTombstones;
+
+  struct LargeRep {
+    BucketT *Buckets;
+    unsigned NumBuckets;
+  };
+
+
+
+  AlignedCharArrayUnion<BucketT[InlineBuckets], LargeRep> storage;
+
+public:
+  explicit SmallDenseMap(unsigned NumInitBuckets = 0) {
+    init(NumInitBuckets);
+  }
+
+  SmallDenseMap(const SmallDenseMap &other) : BaseT() {
+    init(0);
+    copyFrom(other);
+  }
+
+  SmallDenseMap(SmallDenseMap &&other) : BaseT() {
+    init(0);
+    swap(other);
+  }
+
+  template<typename InputIt>
+  SmallDenseMap(const InputIt &I, const InputIt &E) {
+    init(NextPowerOf2(std::distance(I, E)));
+    this->insert(I, E);
+  }
+
+  ~SmallDenseMap() {
+    this->destroyAll();
+    deallocateBuckets();
+  }
+
+  void swap(SmallDenseMap& RHS) {
+    unsigned TmpNumEntries = RHS.NumEntries;
+    RHS.NumEntries = NumEntries;
+    NumEntries = TmpNumEntries;
+    std::swap(NumTombstones, RHS.NumTombstones);
+
+    const KeyT EmptyKey = this->getEmptyKey();
+    const KeyT TombstoneKey = this->getTombstoneKey();
+    if (Small && RHS.Small) {
+
+
+
+
+      for (unsigned i = 0, e = InlineBuckets; i != e; ++i) {
+        BucketT *LHSB = &getInlineBuckets()[i],
+                *RHSB = &RHS.getInlineBuckets()[i];
+        bool hasLHSValue = (!KeyInfoT::isEqual(LHSB->getFirst(), EmptyKey) &&
+                            !KeyInfoT::isEqual(LHSB->getFirst(), TombstoneKey));
+        bool hasRHSValue = (!KeyInfoT::isEqual(RHSB->getFirst(), EmptyKey) &&
+                            !KeyInfoT::isEqual(RHSB->getFirst(), TombstoneKey));
+        if (hasLHSValue && hasRHSValue) {
+
+          std::swap(*LHSB, *RHSB);
+          continue;
+        }
+
+        std::swap(LHSB->getFirst(), RHSB->getFirst());
+        if (hasLHSValue) {
+          ::new (&RHSB->getSecond()) ValueT(std::move(LHSB->getSecond()));
+          LHSB->getSecond().~ValueT();
+        } else if (hasRHSValue) {
+          ::new (&LHSB->getSecond()) ValueT(std::move(RHSB->getSecond()));
+          RHSB->getSecond().~ValueT();
+        }
+      }
+      return;
+    }
+    if (!Small && !RHS.Small) {
+      std::swap(getLargeRep()->Buckets, RHS.getLargeRep()->Buckets);
+      std::swap(getLargeRep()->NumBuckets, RHS.getLargeRep()->NumBuckets);
+      return;
+    }
+
+    SmallDenseMap &SmallSide = Small ? *this : RHS;
+    SmallDenseMap &LargeSide = Small ? RHS : *this;
+
+
+    LargeRep TmpRep = std::move(*LargeSide.getLargeRep());
+    LargeSide.getLargeRep()->~LargeRep();
+    LargeSide.Small = true;
+
+
+
+
+    for (unsigned i = 0, e = InlineBuckets; i != e; ++i) {
+      BucketT *NewB = &LargeSide.getInlineBuckets()[i],
+              *OldB = &SmallSide.getInlineBuckets()[i];
+      ::new (&NewB->getFirst()) KeyT(std::move(OldB->getFirst()));
+      OldB->getFirst().~KeyT();
+      if (!KeyInfoT::isEqual(NewB->getFirst(), EmptyKey) &&
+          !KeyInfoT::isEqual(NewB->getFirst(), TombstoneKey)) {
+        ::new (&NewB->getSecond()) ValueT(std::move(OldB->getSecond()));
+        OldB->getSecond().~ValueT();
+      }
+    }
+
+
+
+    SmallSide.Small = false;
+    new (SmallSide.getLargeRep()) LargeRep(std::move(TmpRep));
+  }
+
+  SmallDenseMap& operator=(const SmallDenseMap& other) {
+    if (&other != this)
+      copyFrom(other);
+    return *this;
+  }
+
+  SmallDenseMap& operator=(SmallDenseMap &&other) {
+    this->destroyAll();
+    deallocateBuckets();
+    init(0);
+    swap(other);
+    return *this;
+  }
+
+  void copyFrom(const SmallDenseMap& other) {
+    this->destroyAll();
+    deallocateBuckets();
+    Small = true;
+    if (other.getNumBuckets() > InlineBuckets) {
+      Small = false;
+      new (getLargeRep()) LargeRep(allocateBuckets(other.getNumBuckets()));
+    }
+    this->BaseT::copyFrom(other);
+  }
+
+  void init(unsigned InitBuckets) {
+    Small = true;
+    if (InitBuckets > InlineBuckets) {
+      Small = false;
+      new (getLargeRep()) LargeRep(allocateBuckets(InitBuckets));
+    }
+    this->BaseT::initEmpty();
+  }
+
+  void grow(unsigned AtLeast) {
+    if (AtLeast >= InlineBuckets)
+      AtLeast = std::max<unsigned>(64, NextPowerOf2(AtLeast-1));
+
+    if (Small) {
+      if (AtLeast < InlineBuckets)
+        return;
+
+
+      AlignedCharArrayUnion<BucketT[InlineBuckets]> TmpStorage;
+      BucketT *TmpBegin = reinterpret_cast<BucketT *>(TmpStorage.buffer);
+      BucketT *TmpEnd = TmpBegin;
+
+
+
+      const KeyT EmptyKey = this->getEmptyKey();
+      const KeyT TombstoneKey = this->getTombstoneKey();
+      for (BucketT *P = getBuckets(), *E = P + InlineBuckets; P != E; ++P) {
+        if (!KeyInfoT::isEqual(P->getFirst(), EmptyKey) &&
+            !KeyInfoT::isEqual(P->getFirst(), TombstoneKey)) {
+          
+         ((
+         size_t(TmpEnd - TmpBegin) < InlineBuckets && "Too many inline buckets!"
+         ) ? static_cast<void> (0) : __assert_fail (
+         "size_t(TmpEnd - TmpBegin) < InlineBuckets && \"Too many inline buckets!\""
+         ,
+                                           "/home/trippels/llvm/llvm/include/llvm/ADT/DenseMap.h"
+          ,
+                                           981
+          , __PRETTY_FUNCTION__))
+                                            
+                                           ;
+          ::new (&TmpEnd->getFirst()) KeyT(std::move(P->getFirst()));
+          ::new (&TmpEnd->getSecond()) ValueT(std::move(P->getSecond()));
+          ++TmpEnd;
+          P->getSecond().~ValueT();
+        }
+        P->getFirst().~KeyT();
+      }
+
+
+
+      Small = false;
+      new (getLargeRep()) LargeRep(allocateBuckets(AtLeast));
+      this->moveFromOldBuckets(TmpBegin, TmpEnd);
+      return;
+    }
+
+    LargeRep OldRep = std::move(*getLargeRep());
+    getLargeRep()->~LargeRep();
+    if (AtLeast <= InlineBuckets) {
+      Small = true;
+    } else {
+      new (getLargeRep()) LargeRep(allocateBuckets(AtLeast));
+    }
+
+    this->moveFromOldBuckets(OldRep.Buckets, OldRep.Buckets+OldRep.NumBuckets);
+
+
+    operator delete(OldRep.Buckets);
+  }
+
+  void shrink_and_clear() {
+    unsigned OldSize = this->size();
+    this->destroyAll();
+
+
+    unsigned NewNumBuckets = 0;
+    if (OldSize) {
+      NewNumBuckets = 1 << (Log2_32_Ceil(OldSize) + 1);
+      if (NewNumBuckets > InlineBuckets && NewNumBuckets < 64u)
+        NewNumBuckets = 64;
+    }
+    if ((Small && NewNumBuckets <= InlineBuckets) ||
+        (!Small && NewNumBuckets == getLargeRep()->NumBuckets)) {
+      this->BaseT::initEmpty();
+      return;
+    }
+
+    deallocateBuckets();
+    init(NewNumBuckets);
+  }
+
+private:
+  unsigned getNumEntries() const {
+    return NumEntries;
+  }
+
+  void setNumEntries(unsigned Num) {
+
+    
+   ((
+   Num < (1U << 31) && "Cannot support more than 1<<31 entries"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Num < (1U << 31) && \"Cannot support more than 1<<31 entries\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/DenseMap.h", 1040, __PRETTY_FUNCTION__))
+                                                                       ;
+    NumEntries = Num;
+  }
+
+  unsigned getNumTombstones() const {
+    return NumTombstones;
+  }
+
+  void setNumTombstones(unsigned Num) {
+    NumTombstones = Num;
+  }
+
+  const BucketT *getInlineBuckets() const {
+    
+   ((
+   Small
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Small"
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/DenseMap.h", 1053, __PRETTY_FUNCTION__))
+                ;
+
+
+
+    return reinterpret_cast<const BucketT *>(storage.buffer);
+  }
+
+  BucketT *getInlineBuckets() {
+    return const_cast<BucketT *>(
+      const_cast<const SmallDenseMap *>(this)->getInlineBuckets());
+  }
+
+  const LargeRep *getLargeRep() const {
+    
+   ((
+   !Small
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!Small"
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/DenseMap.h", 1066, __PRETTY_FUNCTION__))
+                 ;
+
+    return reinterpret_cast<const LargeRep *>(storage.buffer);
+  }
+
+  LargeRep *getLargeRep() {
+    return const_cast<LargeRep *>(
+      const_cast<const SmallDenseMap *>(this)->getLargeRep());
+  }
+
+  const BucketT *getBuckets() const {
+    return Small ? getInlineBuckets() : getLargeRep()->Buckets;
+  }
+
+  BucketT *getBuckets() {
+    return const_cast<BucketT *>(
+      const_cast<const SmallDenseMap *>(this)->getBuckets());
+  }
+
+  unsigned getNumBuckets() const {
+    return Small ? InlineBuckets : getLargeRep()->NumBuckets;
+  }
+
+  void deallocateBuckets() {
+    if (Small)
+      return;
+
+    operator delete(getLargeRep()->Buckets);
+    getLargeRep()->~LargeRep();
+  }
+
+  LargeRep allocateBuckets(unsigned Num) {
+    
+   ((
+   Num > InlineBuckets && "Must allocate more buckets than are inline"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Num > InlineBuckets && \"Must allocate more buckets than are inline\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/DenseMap.h", 1098, __PRETTY_FUNCTION__))
+                                                                              ;
+    LargeRep Rep = {
+      static_cast<BucketT*>(operator new(sizeof(BucketT) * Num)), Num
+    };
+    return Rep;
+  }
+};
+
+template <typename KeyT, typename ValueT, typename KeyInfoT, typename Bucket,
+          bool IsConst>
+class DenseMapIterator : DebugEpochBase::HandleBase {
+  friend class DenseMapIterator<KeyT, ValueT, KeyInfoT, Bucket, true>;
+  friend class DenseMapIterator<KeyT, ValueT, KeyInfoT, Bucket, false>;
+
+  using ConstIterator = DenseMapIterator<KeyT, ValueT, KeyInfoT, Bucket, true>;
+
+public:
+  using difference_type = ptrdiff_t;
+  using value_type =
+      typename std::conditional<IsConst, const Bucket, Bucket>::type;
+  using pointer = value_type *;
+  using reference = value_type &;
+  using iterator_category = std::forward_iterator_tag;
+
+private:
+  pointer Ptr = nullptr;
+  pointer End = nullptr;
+
+public:
+  DenseMapIterator() = default;
+
+  DenseMapIterator(pointer Pos, pointer E, const DebugEpochBase &Epoch,
+                   bool NoAdvance = false)
+      : DebugEpochBase::HandleBase(&Epoch), Ptr(Pos), End(E) {
+    
+   ((
+   isHandleInSync() && "invalid construction!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isHandleInSync() && \"invalid construction!\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/DenseMap.h", 1132, __PRETTY_FUNCTION__))
+                                                      ;
+
+    if (NoAdvance) return;
+    if (shouldReverseIterate<KeyT>()) {
+      RetreatPastEmptyBuckets();
+      return;
+    }
+    AdvancePastEmptyBuckets();
+  }
+
+
+
+
+  template <bool IsConstSrc,
+            typename = typename std::enable_if<!IsConstSrc && IsConst>::type>
+  DenseMapIterator(
+      const DenseMapIterator<KeyT, ValueT, KeyInfoT, Bucket, IsConstSrc> &I)
+      : DebugEpochBase::HandleBase(I), Ptr(I.Ptr), End(I.End) {}
+
+  reference operator*() const {
+    
+   ((
+   isHandleInSync() && "invalid iterator access!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isHandleInSync() && \"invalid iterator access!\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/DenseMap.h", 1152, __PRETTY_FUNCTION__))
+                                                         ;
+    if (shouldReverseIterate<KeyT>())
+      return Ptr[-1];
+    return *Ptr;
+  }
+  pointer operator->() const {
+    
+   ((
+   isHandleInSync() && "invalid iterator access!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isHandleInSync() && \"invalid iterator access!\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/DenseMap.h", 1158, __PRETTY_FUNCTION__))
+                                                         ;
+    if (shouldReverseIterate<KeyT>())
+      return &(Ptr[-1]);
+    return Ptr;
+  }
+
+  bool operator==(const ConstIterator &RHS) const {
+    
+   ((
+   (!Ptr || isHandleInSync()) && "handle not in sync!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "(!Ptr || isHandleInSync()) && \"handle not in sync!\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/DenseMap.h", 1165, __PRETTY_FUNCTION__))
+                                                              ;
+    
+   ((
+   (!RHS.Ptr || RHS.isHandleInSync()) && "handle not in sync!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "(!RHS.Ptr || RHS.isHandleInSync()) && \"handle not in sync!\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/DenseMap.h", 1166, __PRETTY_FUNCTION__))
+                                                                      ;
+    
+   ((
+   getEpochAddress() == RHS.getEpochAddress() && "comparing incomparable iterators!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "getEpochAddress() == RHS.getEpochAddress() && \"comparing incomparable iterators!\""
+   ,
+                                              "/home/trippels/llvm/llvm/include/llvm/ADT/DenseMap.h"
+    ,
+                                              1168
+    , __PRETTY_FUNCTION__))
+                                               
+                                              ;
+    return Ptr == RHS.Ptr;
+  }
+  bool operator!=(const ConstIterator &RHS) const {
+    
+   ((
+   (!Ptr || isHandleInSync()) && "handle not in sync!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "(!Ptr || isHandleInSync()) && \"handle not in sync!\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/DenseMap.h", 1172, __PRETTY_FUNCTION__))
+                                                              ;
+    
+   ((
+   (!RHS.Ptr || RHS.isHandleInSync()) && "handle not in sync!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "(!RHS.Ptr || RHS.isHandleInSync()) && \"handle not in sync!\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/DenseMap.h", 1173, __PRETTY_FUNCTION__))
+                                                                      ;
+    
+   ((
+   getEpochAddress() == RHS.getEpochAddress() && "comparing incomparable iterators!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "getEpochAddress() == RHS.getEpochAddress() && \"comparing incomparable iterators!\""
+   ,
+                                              "/home/trippels/llvm/llvm/include/llvm/ADT/DenseMap.h"
+    ,
+                                              1175
+    , __PRETTY_FUNCTION__))
+                                               
+                                              ;
+    return Ptr != RHS.Ptr;
+  }
+
+  inline DenseMapIterator& operator++() {
+    
+   ((
+   isHandleInSync() && "invalid iterator access!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isHandleInSync() && \"invalid iterator access!\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/DenseMap.h", 1180, __PRETTY_FUNCTION__))
+                                                         ;
+    if (shouldReverseIterate<KeyT>()) {
+      --Ptr;
+      RetreatPastEmptyBuckets();
+      return *this;
+    }
+    ++Ptr;
+    AdvancePastEmptyBuckets();
+    return *this;
+  }
+  DenseMapIterator operator++(int) {
+    
+   ((
+   isHandleInSync() && "invalid iterator access!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isHandleInSync() && \"invalid iterator access!\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/DenseMap.h", 1191, __PRETTY_FUNCTION__))
+                                                         ;
+    DenseMapIterator tmp = *this; ++*this; return tmp;
+  }
+
+private:
+  void AdvancePastEmptyBuckets() {
+    
+   ((
+   Ptr <= End
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Ptr <= End"
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/DenseMap.h", 1197, __PRETTY_FUNCTION__))
+                     ;
+    const KeyT Empty = KeyInfoT::getEmptyKey();
+    const KeyT Tombstone = KeyInfoT::getTombstoneKey();
+
+    while (Ptr != End && (KeyInfoT::isEqual(Ptr->getFirst(), Empty) ||
+                          KeyInfoT::isEqual(Ptr->getFirst(), Tombstone)))
+      ++Ptr;
+  }
+
+  void RetreatPastEmptyBuckets() {
+    
+   ((
+   Ptr >= End
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Ptr >= End"
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/DenseMap.h", 1207, __PRETTY_FUNCTION__))
+                     ;
+    const KeyT Empty = KeyInfoT::getEmptyKey();
+    const KeyT Tombstone = KeyInfoT::getTombstoneKey();
+
+    while (Ptr != End && (KeyInfoT::isEqual(Ptr[-1].getFirst(), Empty) ||
+                          KeyInfoT::isEqual(Ptr[-1].getFirst(), Tombstone)))
+      --Ptr;
+  }
+};
+
+template <typename KeyT, typename ValueT, typename KeyInfoT>
+inline size_t capacity_in_bytes(const DenseMap<KeyT, ValueT, KeyInfoT> &X) {
+  return X.getMemorySize();
+}
+
+}
+namespace llvm {
+
+namespace detail {
+
+struct DenseSetEmpty {};
+
+
+
+template <typename KeyT> class DenseSetPair : public DenseSetEmpty {
+  KeyT key;
+
+public:
+  KeyT &getFirst() { return key; }
+  const KeyT &getFirst() const { return key; }
+  DenseSetEmpty &getSecond() { return *this; }
+  const DenseSetEmpty &getSecond() const { return *this; }
+};
+template <typename ValueT, typename MapTy, typename ValueInfoT>
+class DenseSetImpl {
+  static_assert(sizeof(typename MapTy::value_type) == sizeof(ValueT),
+                "DenseMap buckets unexpectedly large!");
+  MapTy TheMap;
+
+  template <typename T>
+  using const_arg_type_t = typename const_pointer_or_const_ref<T>::type;
+
+public:
+  using key_type = ValueT;
+  using value_type = ValueT;
+  using size_type = unsigned;
+
+  explicit DenseSetImpl(unsigned InitialReserve = 0) : TheMap(InitialReserve) {}
+
+  DenseSetImpl(std::initializer_list<ValueT> Elems)
+      : DenseSetImpl(Elems.size()) {
+    insert(Elems.begin(), Elems.end());
+  }
+
+  bool empty() const { return TheMap.empty(); }
+  size_type size() const { return TheMap.size(); }
+  size_t getMemorySize() const { return TheMap.getMemorySize(); }
+
+
+
+  void resize(size_t Size) { TheMap.resize(Size); }
+
+
+
+  void reserve(size_t Size) { TheMap.reserve(Size); }
+
+  void clear() {
+    TheMap.clear();
+  }
+
+
+  size_type count(const_arg_type_t<ValueT> V) const {
+    return TheMap.count(V);
+  }
+
+  bool erase(const ValueT &V) {
+    return TheMap.erase(V);
+  }
+
+  void swap(DenseSetImpl &RHS) { TheMap.swap(RHS.TheMap); }
+
+
+
+  class ConstIterator;
+
+  class Iterator {
+    typename MapTy::iterator I;
+    friend class DenseSetImpl;
+    friend class ConstIterator;
+
+  public:
+    using difference_type = typename MapTy::iterator::difference_type;
+    using value_type = ValueT;
+    using pointer = value_type *;
+    using reference = value_type &;
+    using iterator_category = std::forward_iterator_tag;
+
+    Iterator() = default;
+    Iterator(const typename MapTy::iterator &i) : I(i) {}
+
+    ValueT &operator*() { return I->getFirst(); }
+    const ValueT &operator*() const { return I->getFirst(); }
+    ValueT *operator->() { return &I->getFirst(); }
+    const ValueT *operator->() const { return &I->getFirst(); }
+
+    Iterator& operator++() { ++I; return *this; }
+    Iterator operator++(int) { auto T = *this; ++I; return T; }
+    bool operator==(const ConstIterator& X) const { return I == X.I; }
+    bool operator!=(const ConstIterator& X) const { return I != X.I; }
+  };
+
+  class ConstIterator {
+    typename MapTy::const_iterator I;
+    friend class DenseSet;
+    friend class Iterator;
+
+  public:
+    using difference_type = typename MapTy::const_iterator::difference_type;
+    using value_type = ValueT;
+    using pointer = value_type *;
+    using reference = value_type &;
+    using iterator_category = std::forward_iterator_tag;
+
+    ConstIterator() = default;
+    ConstIterator(const Iterator &B) : I(B.I) {}
+    ConstIterator(const typename MapTy::const_iterator &i) : I(i) {}
+
+    const ValueT &operator*() const { return I->getFirst(); }
+    const ValueT *operator->() const { return &I->getFirst(); }
+
+    ConstIterator& operator++() { ++I; return *this; }
+    ConstIterator operator++(int) { auto T = *this; ++I; return T; }
+    bool operator==(const ConstIterator& X) const { return I == X.I; }
+    bool operator!=(const ConstIterator& X) const { return I != X.I; }
+  };
+
+  using iterator = Iterator;
+  using const_iterator = ConstIterator;
+
+  iterator begin() { return Iterator(TheMap.begin()); }
+  iterator end() { return Iterator(TheMap.end()); }
+
+  const_iterator begin() const { return ConstIterator(TheMap.begin()); }
+  const_iterator end() const { return ConstIterator(TheMap.end()); }
+
+  iterator find(const_arg_type_t<ValueT> V) { return Iterator(TheMap.find(V)); }
+  const_iterator find(const_arg_type_t<ValueT> V) const {
+    return ConstIterator(TheMap.find(V));
+  }
+
+
+
+
+
+
+  template <class LookupKeyT>
+  iterator find_as(const LookupKeyT &Val) {
+    return Iterator(TheMap.find_as(Val));
+  }
+  template <class LookupKeyT>
+  const_iterator find_as(const LookupKeyT &Val) const {
+    return ConstIterator(TheMap.find_as(Val));
+  }
+
+  void erase(Iterator I) { return TheMap.erase(I.I); }
+  void erase(ConstIterator CI) { return TheMap.erase(CI.I); }
+
+  std::pair<iterator, bool> insert(const ValueT &V) {
+    detail::DenseSetEmpty Empty;
+    return TheMap.try_emplace(V, Empty);
+  }
+
+  std::pair<iterator, bool> insert(ValueT &&V) {
+    detail::DenseSetEmpty Empty;
+    return TheMap.try_emplace(std::move(V), Empty);
+  }
+
+
+
+  template <typename LookupKeyT>
+  std::pair<iterator, bool> insert_as(const ValueT &V,
+                                      const LookupKeyT &LookupKey) {
+    return TheMap.insert_as({V, detail::DenseSetEmpty()}, LookupKey);
+  }
+  template <typename LookupKeyT>
+  std::pair<iterator, bool> insert_as(ValueT &&V, const LookupKeyT &LookupKey) {
+    return TheMap.insert_as({std::move(V), detail::DenseSetEmpty()}, LookupKey);
+  }
+
+
+  template<typename InputIt>
+  void insert(InputIt I, InputIt E) {
+    for (; I != E; ++I)
+      insert(*I);
+  }
+};
+
+}
+
+
+template <typename ValueT, typename ValueInfoT = DenseMapInfo<ValueT>>
+class DenseSet : public detail::DenseSetImpl<
+                     ValueT, DenseMap<ValueT, detail::DenseSetEmpty, ValueInfoT,
+                                      detail::DenseSetPair<ValueT>>,
+                     ValueInfoT> {
+  using BaseT =
+      detail::DenseSetImpl<ValueT,
+                           DenseMap<ValueT, detail::DenseSetEmpty, ValueInfoT,
+                                    detail::DenseSetPair<ValueT>>,
+                           ValueInfoT>;
+
+public:
+  using BaseT::BaseT;
+};
+
+
+
+template <typename ValueT, unsigned InlineBuckets = 4,
+          typename ValueInfoT = DenseMapInfo<ValueT>>
+class SmallDenseSet
+    : public detail::DenseSetImpl<
+          ValueT, SmallDenseMap<ValueT, detail::DenseSetEmpty, InlineBuckets,
+                                ValueInfoT, detail::DenseSetPair<ValueT>>,
+          ValueInfoT> {
+  using BaseT = detail::DenseSetImpl<
+      ValueT, SmallDenseMap<ValueT, detail::DenseSetEmpty, InlineBuckets,
+                            ValueInfoT, detail::DenseSetPair<ValueT>>,
+      ValueInfoT>;
+
+public:
+  using BaseT::BaseT;
+};
+
+}
+namespace llvm {
+
+
+
+
+template<class GraphType>
+struct GraphTraits {
+  using NodeRef = typename GraphType::UnknownGraphTypeError;
+};
+template <class GraphType>
+struct Inverse {
+  const GraphType &Graph;
+
+  inline Inverse(const GraphType &G) : Graph(G) {}
+};
+
+
+
+template <class T> struct GraphTraits<Inverse<Inverse<T>>> : GraphTraits<T> {};
+
+
+template <class GraphType>
+iterator_range<typename GraphTraits<GraphType>::nodes_iterator>
+nodes(const GraphType &G) {
+  return make_range(GraphTraits<GraphType>::nodes_begin(G),
+                    GraphTraits<GraphType>::nodes_end(G));
+}
+template <class GraphType>
+iterator_range<typename GraphTraits<Inverse<GraphType>>::nodes_iterator>
+inverse_nodes(const GraphType &G) {
+  return make_range(GraphTraits<Inverse<GraphType>>::nodes_begin(G),
+                    GraphTraits<Inverse<GraphType>>::nodes_end(G));
+}
+
+template <class GraphType>
+iterator_range<typename GraphTraits<GraphType>::ChildIteratorType>
+children(const typename GraphTraits<GraphType>::NodeRef &G) {
+  return make_range(GraphTraits<GraphType>::child_begin(G),
+                    GraphTraits<GraphType>::child_end(G));
+}
+
+template <class GraphType>
+iterator_range<typename GraphTraits<Inverse<GraphType>>::ChildIteratorType>
+inverse_children(const typename GraphTraits<GraphType>::NodeRef &G) {
+  return make_range(GraphTraits<Inverse<GraphType>>::child_begin(G),
+                    GraphTraits<Inverse<GraphType>>::child_end(G));
+}
+
+}
+
+
+extern "C" {
+typedef int LLVMBool;
+typedef struct LLVMOpaqueMemoryBuffer *LLVMMemoryBufferRef;
+
+
+
+
+typedef struct LLVMOpaqueContext *LLVMContextRef;
+
+
+
+
+
+
+
+typedef struct LLVMOpaqueModule *LLVMModuleRef;
+
+
+
+
+
+
+typedef struct LLVMOpaqueType *LLVMTypeRef;
+
+
+
+
+
+
+typedef struct LLVMOpaqueValue *LLVMValueRef;
+
+
+
+
+
+
+typedef struct LLVMOpaqueBasicBlock *LLVMBasicBlockRef;
+
+
+
+
+
+
+typedef struct LLVMOpaqueMetadata *LLVMMetadataRef;
+
+
+
+
+
+
+typedef struct LLVMOpaqueBuilder *LLVMBuilderRef;
+
+
+
+
+
+
+typedef struct LLVMOpaqueDIBuilder *LLVMDIBuilderRef;
+
+
+
+
+
+
+typedef struct LLVMOpaqueModuleProvider *LLVMModuleProviderRef;
+
+
+typedef struct LLVMOpaquePassManager *LLVMPassManagerRef;
+
+
+typedef struct LLVMOpaquePassRegistry *LLVMPassRegistryRef;
+
+
+
+
+
+typedef struct LLVMOpaqueUse *LLVMUseRef;
+
+
+
+
+
+
+typedef struct LLVMOpaqueAttributeRef *LLVMAttributeRef;
+
+
+
+
+typedef struct LLVMOpaqueDiagnosticInfo *LLVMDiagnosticInfoRef;
+
+
+
+
+
+
+}
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+namespace llvm {
+
+  class formatv_object_base;
+  class raw_ostream;
+  class Twine {
+
+    enum NodeKind : unsigned char {
+
+
+      NullKind,
+
+
+      EmptyKind,
+
+
+      TwineKind,
+
+
+      CStringKind,
+
+
+      StdStringKind,
+
+
+      StringRefKind,
+
+
+      SmallStringKind,
+
+
+      FormatvObjectKind,
+
+
+      CharKind,
+
+
+      DecUIKind,
+
+
+      DecIKind,
+
+
+
+      DecULKind,
+
+
+      DecLKind,
+
+
+
+      DecULLKind,
+
+
+      DecLLKind,
+
+
+
+      UHexKind
+    };
+
+    union Child
+    {
+      const Twine *twine;
+      const char *cString;
+      const std::string *stdString;
+      const StringRef *stringRef;
+      const SmallVectorImpl<char> *smallString;
+      const formatv_object_base *formatvObject;
+      char character;
+      unsigned int decUI;
+      int decI;
+      const unsigned long *decUL;
+      const long *decL;
+      const unsigned long long *decULL;
+      const long long *decLL;
+      const uint64_t *uHex;
+    };
+
+
+
+    Child LHS;
+
+
+
+    Child RHS;
+
+
+    NodeKind LHSKind = EmptyKind;
+
+
+    NodeKind RHSKind = EmptyKind;
+
+
+    explicit Twine(NodeKind Kind) : LHSKind(Kind) {
+      
+     ((
+     isNullary() && "Invalid kind!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "isNullary() && \"Invalid kind!\""
+     , "/home/trippels/llvm/llvm/include/llvm/ADT/Twine.h", 171, __PRETTY_FUNCTION__))
+                                           ;
+    }
+
+
+    explicit Twine(const Twine &LHS, const Twine &RHS)
+        : LHSKind(TwineKind), RHSKind(TwineKind) {
+      this->LHS.twine = &LHS;
+      this->RHS.twine = &RHS;
+      
+     ((
+     isValid() && "Invalid twine!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "isValid() && \"Invalid twine!\""
+     , "/home/trippels/llvm/llvm/include/llvm/ADT/Twine.h", 179, __PRETTY_FUNCTION__))
+                                          ;
+    }
+
+
+    explicit Twine(Child LHS, NodeKind LHSKind, Child RHS, NodeKind RHSKind)
+        : LHS(LHS), RHS(RHS), LHSKind(LHSKind), RHSKind(RHSKind) {
+      
+     ((
+     isValid() && "Invalid twine!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "isValid() && \"Invalid twine!\""
+     , "/home/trippels/llvm/llvm/include/llvm/ADT/Twine.h", 185, __PRETTY_FUNCTION__))
+                                          ;
+    }
+
+
+    bool isNull() const {
+      return getLHSKind() == NullKind;
+    }
+
+
+    bool isEmpty() const {
+      return getLHSKind() == EmptyKind;
+    }
+
+
+    bool isNullary() const {
+      return isNull() || isEmpty();
+    }
+
+
+    bool isUnary() const {
+      return getRHSKind() == EmptyKind && !isNullary();
+    }
+
+
+    bool isBinary() const {
+      return getLHSKind() != NullKind && getRHSKind() != EmptyKind;
+    }
+
+
+
+    bool isValid() const {
+
+      if (isNullary() && getRHSKind() != EmptyKind)
+        return false;
+
+
+      if (getRHSKind() == NullKind)
+        return false;
+
+
+      if (getRHSKind() != EmptyKind && getLHSKind() == EmptyKind)
+        return false;
+
+
+      if (getLHSKind() == TwineKind &&
+          !LHS.twine->isBinary())
+        return false;
+      if (getRHSKind() == TwineKind &&
+          !RHS.twine->isBinary())
+        return false;
+
+      return true;
+    }
+
+
+    NodeKind getLHSKind() const { return LHSKind; }
+
+
+    NodeKind getRHSKind() const { return RHSKind; }
+
+
+    void printOneChild(raw_ostream &OS, Child Ptr, NodeKind Kind) const;
+
+
+    void printOneChildRepr(raw_ostream &OS, Child Ptr,
+                           NodeKind Kind) const;
+
+  public:
+
+
+
+
+                 Twine() {
+      
+     ((
+     isValid() && "Invalid twine!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "isValid() && \"Invalid twine!\""
+     , "/home/trippels/llvm/llvm/include/llvm/ADT/Twine.h", 258, __PRETTY_FUNCTION__))
+                                          ;
+    }
+
+    Twine(const Twine &) = default;
+
+
+
+
+
+
+                 Twine(const char *Str) {
+      if (Str[0] != '\0') {
+        LHS.cString = Str;
+        LHSKind = CStringKind;
+      } else
+        LHSKind = EmptyKind;
+
+      
+     ((
+     isValid() && "Invalid twine!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "isValid() && \"Invalid twine!\""
+     , "/home/trippels/llvm/llvm/include/llvm/ADT/Twine.h", 275, __PRETTY_FUNCTION__))
+                                          ;
+    }
+
+
+                 Twine(const std::string &Str) : LHSKind(StdStringKind) {
+      LHS.stdString = &Str;
+      
+     ((
+     isValid() && "Invalid twine!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "isValid() && \"Invalid twine!\""
+     , "/home/trippels/llvm/llvm/include/llvm/ADT/Twine.h", 281, __PRETTY_FUNCTION__))
+                                          ;
+    }
+
+
+                 Twine(const StringRef &Str) : LHSKind(StringRefKind) {
+      LHS.stringRef = &Str;
+      
+     ((
+     isValid() && "Invalid twine!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "isValid() && \"Invalid twine!\""
+     , "/home/trippels/llvm/llvm/include/llvm/ADT/Twine.h", 287, __PRETTY_FUNCTION__))
+                                          ;
+    }
+
+
+                 Twine(const SmallVectorImpl<char> &Str)
+        : LHSKind(SmallStringKind) {
+      LHS.smallString = &Str;
+      
+     ((
+     isValid() && "Invalid twine!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "isValid() && \"Invalid twine!\""
+     , "/home/trippels/llvm/llvm/include/llvm/ADT/Twine.h", 294, __PRETTY_FUNCTION__))
+                                          ;
+    }
+
+
+                 Twine(const formatv_object_base &Fmt)
+        : LHSKind(FormatvObjectKind) {
+      LHS.formatvObject = &Fmt;
+      
+     ((
+     isValid() && "Invalid twine!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "isValid() && \"Invalid twine!\""
+     , "/home/trippels/llvm/llvm/include/llvm/ADT/Twine.h", 301, __PRETTY_FUNCTION__))
+                                          ;
+    }
+
+
+    explicit Twine(char Val) : LHSKind(CharKind) {
+      LHS.character = Val;
+    }
+
+
+    explicit Twine(signed char Val) : LHSKind(CharKind) {
+      LHS.character = static_cast<char>(Val);
+    }
+
+
+    explicit Twine(unsigned char Val) : LHSKind(CharKind) {
+      LHS.character = static_cast<char>(Val);
+    }
+
+
+    explicit Twine(unsigned Val) : LHSKind(DecUIKind) {
+      LHS.decUI = Val;
+    }
+
+
+    explicit Twine(int Val) : LHSKind(DecIKind) {
+      LHS.decI = Val;
+    }
+
+
+    explicit Twine(const unsigned long &Val) : LHSKind(DecULKind) {
+      LHS.decUL = &Val;
+    }
+
+
+    explicit Twine(const long &Val) : LHSKind(DecLKind) {
+      LHS.decL = &Val;
+    }
+
+
+    explicit Twine(const unsigned long long &Val) : LHSKind(DecULLKind) {
+      LHS.decULL = &Val;
+    }
+
+
+    explicit Twine(const long long &Val) : LHSKind(DecLLKind) {
+      LHS.decLL = &Val;
+    }
+
+
+
+
+
+
+
+                 Twine(const char *LHS, const StringRef &RHS)
+        : LHSKind(CStringKind), RHSKind(StringRefKind) {
+      this->LHS.cString = LHS;
+      this->RHS.stringRef = &RHS;
+      
+     ((
+     isValid() && "Invalid twine!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "isValid() && \"Invalid twine!\""
+     , "/home/trippels/llvm/llvm/include/llvm/ADT/Twine.h", 359, __PRETTY_FUNCTION__))
+                                          ;
+    }
+
+
+                 Twine(const StringRef &LHS, const char *RHS)
+        : LHSKind(StringRefKind), RHSKind(CStringKind) {
+      this->LHS.stringRef = &LHS;
+      this->RHS.cString = RHS;
+      
+     ((
+     isValid() && "Invalid twine!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "isValid() && \"Invalid twine!\""
+     , "/home/trippels/llvm/llvm/include/llvm/ADT/Twine.h", 367, __PRETTY_FUNCTION__))
+                                          ;
+    }
+
+
+
+    Twine &operator=(const Twine &) = delete;
+
+
+
+    static Twine createNull() {
+      return Twine(NullKind);
+    }
+
+
+
+
+
+
+    static Twine utohexstr(const uint64_t &Val) {
+      Child LHS, RHS;
+      LHS.uHex = &Val;
+      RHS.twine = nullptr;
+      return Twine(LHS, UHexKind, RHS, EmptyKind);
+    }
+
+
+
+
+
+
+
+    bool isTriviallyEmpty() const {
+      return isNullary();
+    }
+
+
+
+    bool isSingleStringRef() const {
+      if (getRHSKind() != EmptyKind) return false;
+
+      switch (getLHSKind()) {
+      case EmptyKind:
+      case CStringKind:
+      case StdStringKind:
+      case StringRefKind:
+      case SmallStringKind:
+        return true;
+      default:
+        return false;
+      }
+    }
+
+
+
+
+
+    Twine concat(const Twine &Suffix) const;
+
+
+
+
+
+
+    std::string str() const;
+
+
+    void toVector(SmallVectorImpl<char> &Out) const;
+
+
+
+    StringRef getSingleStringRef() const {
+      
+     ((
+     isSingleStringRef() &&"This cannot be had as a single stringref!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "isSingleStringRef() &&\"This cannot be had as a single stringref!\""
+     , "/home/trippels/llvm/llvm/include/llvm/ADT/Twine.h", 438, __PRETTY_FUNCTION__))
+                                                                              ;
+      switch (getLHSKind()) {
+      default: ::llvm::llvm_unreachable_internal("Out of sync with isSingleStringRef", "/home/trippels/llvm/llvm/include/llvm/ADT/Twine.h", 440);
+      case EmptyKind: return StringRef();
+      case CStringKind: return StringRef(LHS.cString);
+      case StdStringKind: return StringRef(*LHS.stdString);
+      case StringRefKind: return *LHS.stringRef;
+      case SmallStringKind:
+        return StringRef(LHS.smallString->data(), LHS.smallString->size());
+      }
+    }
+
+
+
+
+    StringRef toStringRef(SmallVectorImpl<char> &Out) const {
+      if (isSingleStringRef())
+        return getSingleStringRef();
+      toVector(Out);
+      return StringRef(Out.data(), Out.size());
+    }
+
+
+
+
+
+
+    StringRef toNullTerminatedStringRef(SmallVectorImpl<char> &Out) const;
+
+
+
+    void print(raw_ostream &OS) const;
+
+
+    void dump() const;
+
+
+    void printRepr(raw_ostream &OS) const;
+
+
+    void dumpRepr() const;
+
+
+  };
+
+
+
+
+  inline Twine Twine::concat(const Twine &Suffix) const {
+
+    if (isNull() || Suffix.isNull())
+      return Twine(NullKind);
+
+
+    if (isEmpty())
+      return Suffix;
+    if (Suffix.isEmpty())
+      return *this;
+
+
+
+    Child NewLHS, NewRHS;
+    NewLHS.twine = this;
+    NewRHS.twine = &Suffix;
+    NodeKind NewLHSKind = TwineKind, NewRHSKind = TwineKind;
+    if (isUnary()) {
+      NewLHS = LHS;
+      NewLHSKind = getLHSKind();
+    }
+    if (Suffix.isUnary()) {
+      NewRHS = Suffix.LHS;
+      NewRHSKind = Suffix.getLHSKind();
+    }
+
+    return Twine(NewLHS, NewLHSKind, NewRHS, NewRHSKind);
+  }
+
+  inline Twine operator+(const Twine &LHS, const Twine &RHS) {
+    return LHS.concat(RHS);
+  }
+
+
+
+
+  inline Twine operator+(const char *LHS, const StringRef &RHS) {
+    return Twine(LHS, RHS);
+  }
+
+
+
+
+  inline Twine operator+(const StringRef &LHS, const char *RHS) {
+    return Twine(LHS, RHS);
+  }
+
+  inline raw_ostream &operator<<(raw_ostream &OS, const Twine &RHS) {
+    RHS.print(OS);
+    return OS;
+  }
+
+
+
+}
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+namespace llvm {
+
+template <typename T> struct DenseMapInfo;
+template <typename PointerT, unsigned IntBits, typename PtrTraits>
+struct PointerIntPairInfo;
+template <typename PointerTy, unsigned IntBits, typename IntType = unsigned,
+          typename PtrTraits = PointerLikeTypeTraits<PointerTy>,
+          typename Info = PointerIntPairInfo<PointerTy, IntBits, PtrTraits>>
+class PointerIntPair {
+  intptr_t Value = 0;
+
+public:
+  constexpr PointerIntPair() = default;
+
+  PointerIntPair(PointerTy PtrVal, IntType IntVal) {
+    setPointerAndInt(PtrVal, IntVal);
+  }
+
+  explicit PointerIntPair(PointerTy PtrVal) { initWithPointer(PtrVal); }
+
+  PointerTy getPointer() const { return Info::getPointer(Value); }
+
+  IntType getInt() const { return (IntType)Info::getInt(Value); }
+
+  void setPointer(PointerTy PtrVal) {
+    Value = Info::updatePointer(Value, PtrVal);
+  }
+
+  void setInt(IntType IntVal) {
+    Value = Info::updateInt(Value, static_cast<intptr_t>(IntVal));
+  }
+
+  void initWithPointer(PointerTy PtrVal) {
+    Value = Info::updatePointer(0, PtrVal);
+  }
+
+  void setPointerAndInt(PointerTy PtrVal, IntType IntVal) {
+    Value = Info::updateInt(Info::updatePointer(0, PtrVal),
+                            static_cast<intptr_t>(IntVal));
+  }
+
+  PointerTy const *getAddrOfPointer() const {
+    return const_cast<PointerIntPair *>(this)->getAddrOfPointer();
+  }
+
+  PointerTy *getAddrOfPointer() {
+    
+   ((
+   Value == reinterpret_cast<intptr_t>(getPointer()) && "Can only return the address if IntBits is cleared and " "PtrTraits doesn't change the pointer"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Value == reinterpret_cast<intptr_t>(getPointer()) && \"Can only return the address if IntBits is cleared and \" \"PtrTraits doesn't change the pointer\""
+   ,
+
+                                                 "/home/trippels/llvm/llvm/include/llvm/ADT/PointerIntPair.h"
+    ,
+
+                                                 84
+    , __PRETTY_FUNCTION__))
+
+                                                  
+                                                 ;
+    return reinterpret_cast<PointerTy *>(&Value);
+  }
+
+  void *getOpaqueValue() const { return reinterpret_cast<void *>(Value); }
+
+  void setFromOpaqueValue(void *Val) {
+    Value = reinterpret_cast<intptr_t>(Val);
+  }
+
+  static PointerIntPair getFromOpaqueValue(void *V) {
+    PointerIntPair P;
+    P.setFromOpaqueValue(V);
+    return P;
+  }
+
+
+
+  static PointerIntPair getFromOpaqueValue(const void *V) {
+    (void)PtrTraits::getFromVoidPointer(V);
+    return getFromOpaqueValue(const_cast<void *>(V));
+  }
+
+  bool operator==(const PointerIntPair &RHS) const {
+    return Value == RHS.Value;
+  }
+
+  bool operator!=(const PointerIntPair &RHS) const {
+    return Value != RHS.Value;
+  }
+
+  bool operator<(const PointerIntPair &RHS) const { return Value < RHS.Value; }
+  bool operator>(const PointerIntPair &RHS) const { return Value > RHS.Value; }
+
+  bool operator<=(const PointerIntPair &RHS) const {
+    return Value <= RHS.Value;
+  }
+
+  bool operator>=(const PointerIntPair &RHS) const {
+    return Value >= RHS.Value;
+  }
+};
+
+template <typename PointerT, unsigned IntBits, typename PtrTraits>
+struct PointerIntPairInfo {
+  static_assert(PtrTraits::NumLowBitsAvailable <
+                    std::numeric_limits<uintptr_t>::digits,
+                "cannot use a pointer type that has all bits free");
+  static_assert(IntBits <= PtrTraits::NumLowBitsAvailable,
+                "PointerIntPair with integer size too large for pointer");
+  enum : uintptr_t {
+
+    PointerBitMask =
+        ~(uintptr_t)(((intptr_t)1 << PtrTraits::NumLowBitsAvailable) - 1),
+
+
+
+    IntShift = (uintptr_t)PtrTraits::NumLowBitsAvailable - IntBits,
+
+
+    IntMask = (uintptr_t)(((intptr_t)1 << IntBits) - 1),
+
+
+    ShiftedIntMask = (uintptr_t)(IntMask << IntShift)
+  };
+
+  static PointerT getPointer(intptr_t Value) {
+    return PtrTraits::getFromVoidPointer(
+        reinterpret_cast<void *>(Value & PointerBitMask));
+  }
+
+  static intptr_t getInt(intptr_t Value) {
+    return (Value >> IntShift) & IntMask;
+  }
+
+  static intptr_t updatePointer(intptr_t OrigValue, PointerT Ptr) {
+    intptr_t PtrWord =
+        reinterpret_cast<intptr_t>(PtrTraits::getAsVoidPointer(Ptr));
+    
+   ((
+   (PtrWord & ~PointerBitMask) == 0 && "Pointer is not sufficiently aligned"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "(PtrWord & ~PointerBitMask) == 0 && \"Pointer is not sufficiently aligned\""
+   ,
+                                                "/home/trippels/llvm/llvm/include/llvm/ADT/PointerIntPair.h"
+    ,
+                                                163
+    , __PRETTY_FUNCTION__))
+                                                 
+                                                ;
+
+    return PtrWord | (OrigValue & ~PointerBitMask);
+  }
+
+  static intptr_t updateInt(intptr_t OrigValue, intptr_t Int) {
+    intptr_t IntWord = static_cast<intptr_t>(Int);
+    
+   ((
+   (IntWord & ~IntMask) == 0 && "Integer too large for field"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "(IntWord & ~IntMask) == 0 && \"Integer too large for field\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/PointerIntPair.h", 170, __PRETTY_FUNCTION__))
+                                                                     ;
+
+
+    return (OrigValue & ~ShiftedIntMask) | IntWord << IntShift;
+  }
+};
+
+template <typename T> struct isPodLike;
+template <typename PointerTy, unsigned IntBits, typename IntType>
+struct isPodLike<PointerIntPair<PointerTy, IntBits, IntType>> {
+  static const bool value = true;
+};
+
+
+template <typename PointerTy, unsigned IntBits, typename IntType>
+struct DenseMapInfo<PointerIntPair<PointerTy, IntBits, IntType>> {
+  using Ty = PointerIntPair<PointerTy, IntBits, IntType>;
+
+  static Ty getEmptyKey() {
+    uintptr_t Val = static_cast<uintptr_t>(-1);
+    Val <<= PointerLikeTypeTraits<Ty>::NumLowBitsAvailable;
+    return Ty::getFromOpaqueValue(reinterpret_cast<void *>(Val));
+  }
+
+  static Ty getTombstoneKey() {
+    uintptr_t Val = static_cast<uintptr_t>(-2);
+    Val <<= PointerLikeTypeTraits<PointerTy>::NumLowBitsAvailable;
+    return Ty::getFromOpaqueValue(reinterpret_cast<void *>(Val));
+  }
+
+  static unsigned getHashValue(Ty V) {
+    uintptr_t IV = reinterpret_cast<uintptr_t>(V.getOpaqueValue());
+    return unsigned(IV) ^ unsigned(IV >> 9);
+  }
+
+  static bool isEqual(const Ty &LHS, const Ty &RHS) { return LHS == RHS; }
+};
+
+
+template <typename PointerTy, unsigned IntBits, typename IntType,
+          typename PtrTraits>
+struct PointerLikeTypeTraits<
+    PointerIntPair<PointerTy, IntBits, IntType, PtrTraits>> {
+  static inline void *
+  getAsVoidPointer(const PointerIntPair<PointerTy, IntBits, IntType> &P) {
+    return P.getOpaqueValue();
+  }
+
+  static inline PointerIntPair<PointerTy, IntBits, IntType>
+  getFromVoidPointer(void *P) {
+    return PointerIntPair<PointerTy, IntBits, IntType>::getFromOpaqueValue(P);
+  }
+
+  static inline PointerIntPair<PointerTy, IntBits, IntType>
+  getFromVoidPointer(const void *P) {
+    return PointerIntPair<PointerTy, IntBits, IntType>::getFromOpaqueValue(P);
+  }
+
+  enum { NumLowBitsAvailable = PtrTraits::NumLowBitsAvailable - IntBits };
+};
+
+}
+
+namespace llvm {
+
+
+
+
+template <bool EnableSentinelTracking> class ilist_node_base;
+
+template <> class ilist_node_base<false> {
+  ilist_node_base *Prev = nullptr;
+  ilist_node_base *Next = nullptr;
+
+public:
+  void setPrev(ilist_node_base *Prev) { this->Prev = Prev; }
+  void setNext(ilist_node_base *Next) { this->Next = Next; }
+  ilist_node_base *getPrev() const { return Prev; }
+  ilist_node_base *getNext() const { return Next; }
+
+  bool isKnownSentinel() const { return false; }
+  void initializeSentinel() {}
+};
+
+template <> class ilist_node_base<true> {
+  PointerIntPair<ilist_node_base *, 1> PrevAndSentinel;
+  ilist_node_base *Next = nullptr;
+
+public:
+  void setPrev(ilist_node_base *Prev) { PrevAndSentinel.setPointer(Prev); }
+  void setNext(ilist_node_base *Next) { this->Next = Next; }
+  ilist_node_base *getPrev() const { return PrevAndSentinel.getPointer(); }
+  ilist_node_base *getNext() const { return Next; }
+
+  bool isSentinel() const { return PrevAndSentinel.getInt(); }
+  bool isKnownSentinel() const { return isSentinel(); }
+  void initializeSentinel() { PrevAndSentinel.setInt(true); }
+};
+
+}
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+namespace llvm {
+
+
+template <bool EnableSentinelTracking> class ilist_base {
+public:
+  using node_base_type = ilist_node_base<EnableSentinelTracking>;
+
+  static void insertBeforeImpl(node_base_type &Next, node_base_type &N) {
+    node_base_type &Prev = *Next.getPrev();
+    N.setNext(&Next);
+    N.setPrev(&Prev);
+    Prev.setNext(&N);
+    Next.setPrev(&N);
+  }
+
+  static void removeImpl(node_base_type &N) {
+    node_base_type *Prev = N.getPrev();
+    node_base_type *Next = N.getNext();
+    Next->setPrev(Prev);
+    Prev->setNext(Next);
+
+
+    N.setPrev(nullptr);
+    N.setNext(nullptr);
+  }
+
+  static void removeRangeImpl(node_base_type &First, node_base_type &Last) {
+    node_base_type *Prev = First.getPrev();
+    node_base_type *Final = Last.getPrev();
+    Last.setPrev(Prev);
+    Prev->setNext(&Last);
+
+
+    First.setPrev(nullptr);
+    Final->setNext(nullptr);
+  }
+
+  static void transferBeforeImpl(node_base_type &Next, node_base_type &First,
+                                 node_base_type &Last) {
+    if (&Next == &Last || &First == &Last)
+      return;
+
+
+    
+   ((
+   &Next != &First && "Insertion point can't be one of the transferred nodes"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "&Next != &First && \"Insertion point can't be one of the transferred nodes\""
+   ,
+
+                                                                  "/home/trippels/llvm/llvm/include/llvm/ADT/ilist_base.h"
+    ,
+
+                                                                  61
+    , __PRETTY_FUNCTION__))
+
+                                                                   
+                                                                  ;
+
+    node_base_type &Final = *Last.getPrev();
+
+
+    First.getPrev()->setNext(&Last);
+    Last.setPrev(First.getPrev());
+
+
+    node_base_type &Prev = *Next.getPrev();
+    Final.setNext(&Next);
+    First.setPrev(&Prev);
+    Prev.setNext(&First);
+    Next.setPrev(&Final);
+  }
+
+  template <class T> static void insertBefore(T &Next, T &N) {
+    insertBeforeImpl(Next, N);
+  }
+
+  template <class T> static void remove(T &N) { removeImpl(N); }
+  template <class T> static void removeRange(T &First, T &Last) {
+    removeRangeImpl(First, Last);
+  }
+
+  template <class T> static void transferBefore(T &Next, T &First, T &Last) {
+    transferBeforeImpl(Next, First, Last);
+  }
+};
+
+}
+namespace llvm {
+
+template <bool EnableSentinelTracking> class ilist_node_base;
+template <bool EnableSentinelTracking> class ilist_base;
+
+
+
+
+
+
+template <bool EnableSentinelTracking> struct ilist_sentinel_tracking {};
+
+
+
+
+
+template <class Tag> struct ilist_tag {};
+
+namespace ilist_detail {
+
+
+template <bool IsExplicit> struct explicitness {
+  static const bool is_explicit = IsExplicit;
+};
+typedef explicitness<true> is_explicit;
+typedef explicitness<false> is_implicit;
+template <class Option> struct is_valid_option : std::false_type {};
+
+
+
+
+
+template <class... Options> struct extract_sentinel_tracking;
+template <bool EnableSentinelTracking, class... Options>
+struct extract_sentinel_tracking<
+    ilist_sentinel_tracking<EnableSentinelTracking>, Options...>
+    : std::integral_constant<bool, EnableSentinelTracking>, is_explicit {};
+template <class Option1, class... Options>
+struct extract_sentinel_tracking<Option1, Options...>
+    : extract_sentinel_tracking<Options...> {};
+
+template <> struct extract_sentinel_tracking<> : std::true_type, is_implicit {};
+
+
+
+
+template <bool EnableSentinelTracking>
+struct is_valid_option<ilist_sentinel_tracking<EnableSentinelTracking>>
+    : std::true_type {};
+
+
+
+
+
+template <class... Options> struct extract_tag;
+template <class Tag, class... Options>
+struct extract_tag<ilist_tag<Tag>, Options...> {
+  typedef Tag type;
+};
+template <class Option1, class... Options>
+struct extract_tag<Option1, Options...> : extract_tag<Options...> {};
+template <> struct extract_tag<> { typedef void type; };
+template <class Tag> struct is_valid_option<ilist_tag<Tag>> : std::true_type {};
+
+
+
+
+template <class... Options> struct check_options;
+template <> struct check_options<> : std::true_type {};
+template <class Option1, class... Options>
+struct check_options<Option1, Options...>
+    : std::integral_constant<bool, is_valid_option<Option1>::value &&
+                                       check_options<Options...>::value> {};
+
+
+
+
+template <class T, bool EnableSentinelTracking, bool IsSentinelTrackingExplicit,
+          class TagT>
+struct node_options {
+  typedef T value_type;
+  typedef T *pointer;
+  typedef T &reference;
+  typedef const T *const_pointer;
+  typedef const T &const_reference;
+
+  static const bool enable_sentinel_tracking = EnableSentinelTracking;
+  static const bool is_sentinel_tracking_explicit = IsSentinelTrackingExplicit;
+  typedef TagT tag;
+  typedef ilist_node_base<enable_sentinel_tracking> node_base_type;
+  typedef ilist_base<enable_sentinel_tracking> list_base_type;
+};
+
+template <class T, class... Options> struct compute_node_options {
+  typedef node_options<T, extract_sentinel_tracking<Options...>::value,
+                       extract_sentinel_tracking<Options...>::is_explicit,
+                       typename extract_tag<Options...>::type>
+      type;
+};
+
+}
+}
+
+namespace llvm {
+
+namespace ilist_detail {
+
+struct NodeAccess;
+
+}
+
+template <class OptionsT, bool IsReverse, bool IsConst> class ilist_iterator;
+template <class OptionsT> class ilist_sentinel;
+template <class OptionsT> class ilist_node_impl : OptionsT::node_base_type {
+  using value_type = typename OptionsT::value_type;
+  using node_base_type = typename OptionsT::node_base_type;
+  using list_base_type = typename OptionsT::list_base_type;
+
+  friend typename OptionsT::list_base_type;
+  friend struct ilist_detail::NodeAccess;
+  friend class ilist_sentinel<OptionsT>;
+  friend class ilist_iterator<OptionsT, false, false>;
+  friend class ilist_iterator<OptionsT, false, true>;
+  friend class ilist_iterator<OptionsT, true, false>;
+  friend class ilist_iterator<OptionsT, true, true>;
+
+protected:
+  using self_iterator = ilist_iterator<OptionsT, false, false>;
+  using const_self_iterator = ilist_iterator<OptionsT, false, true>;
+  using reverse_self_iterator = ilist_iterator<OptionsT, true, false>;
+  using const_reverse_self_iterator = ilist_iterator<OptionsT, true, true>;
+
+  ilist_node_impl() = default;
+
+private:
+  ilist_node_impl *getPrev() {
+    return static_cast<ilist_node_impl *>(node_base_type::getPrev());
+  }
+
+  ilist_node_impl *getNext() {
+    return static_cast<ilist_node_impl *>(node_base_type::getNext());
+  }
+
+  const ilist_node_impl *getPrev() const {
+    return static_cast<ilist_node_impl *>(node_base_type::getPrev());
+  }
+
+  const ilist_node_impl *getNext() const {
+    return static_cast<ilist_node_impl *>(node_base_type::getNext());
+  }
+
+  void setPrev(ilist_node_impl *N) { node_base_type::setPrev(N); }
+  void setNext(ilist_node_impl *N) { node_base_type::setNext(N); }
+
+public:
+  self_iterator getIterator() { return self_iterator(*this); }
+  const_self_iterator getIterator() const { return const_self_iterator(*this); }
+
+  reverse_self_iterator getReverseIterator() {
+    return reverse_self_iterator(*this);
+  }
+
+  const_reverse_self_iterator getReverseIterator() const {
+    return const_reverse_self_iterator(*this);
+  }
+
+
+  using node_base_type::isKnownSentinel;
+
+
+
+
+
+  bool isSentinel() const {
+    static_assert(OptionsT::is_sentinel_tracking_explicit,
+                  "Use ilist_sentinel_tracking<true> to enable isSentinel()");
+    return node_base_type::isSentinel();
+  }
+};
+template <class T, class... Options>
+class ilist_node
+    : public ilist_node_impl<
+          typename ilist_detail::compute_node_options<T, Options...>::type> {
+  static_assert(ilist_detail::check_options<Options...>::value,
+                "Unrecognized node option!");
+};
+
+namespace ilist_detail {
+
+
+
+
+
+
+
+struct NodeAccess {
+protected:
+  template <class OptionsT>
+  static ilist_node_impl<OptionsT> *getNodePtr(typename OptionsT::pointer N) {
+    return N;
+  }
+
+  template <class OptionsT>
+  static const ilist_node_impl<OptionsT> *
+  getNodePtr(typename OptionsT::const_pointer N) {
+    return N;
+  }
+
+  template <class OptionsT>
+  static typename OptionsT::pointer getValuePtr(ilist_node_impl<OptionsT> *N) {
+    return static_cast<typename OptionsT::pointer>(N);
+  }
+
+  template <class OptionsT>
+  static typename OptionsT::const_pointer
+  getValuePtr(const ilist_node_impl<OptionsT> *N) {
+    return static_cast<typename OptionsT::const_pointer>(N);
+  }
+
+  template <class OptionsT>
+  static ilist_node_impl<OptionsT> *getPrev(ilist_node_impl<OptionsT> &N) {
+    return N.getPrev();
+  }
+
+  template <class OptionsT>
+  static ilist_node_impl<OptionsT> *getNext(ilist_node_impl<OptionsT> &N) {
+    return N.getNext();
+  }
+
+  template <class OptionsT>
+  static const ilist_node_impl<OptionsT> *
+  getPrev(const ilist_node_impl<OptionsT> &N) {
+    return N.getPrev();
+  }
+
+  template <class OptionsT>
+  static const ilist_node_impl<OptionsT> *
+  getNext(const ilist_node_impl<OptionsT> &N) {
+    return N.getNext();
+  }
+};
+
+template <class OptionsT> struct SpecificNodeAccess : NodeAccess {
+protected:
+  using pointer = typename OptionsT::pointer;
+  using const_pointer = typename OptionsT::const_pointer;
+  using node_type = ilist_node_impl<OptionsT>;
+
+  static node_type *getNodePtr(pointer N) {
+    return NodeAccess::getNodePtr<OptionsT>(N);
+  }
+
+  static const node_type *getNodePtr(const_pointer N) {
+    return NodeAccess::getNodePtr<OptionsT>(N);
+  }
+
+  static pointer getValuePtr(node_type *N) {
+    return NodeAccess::getValuePtr<OptionsT>(N);
+  }
+
+  static const_pointer getValuePtr(const node_type *N) {
+    return NodeAccess::getValuePtr<OptionsT>(N);
+  }
+};
+
+}
+
+template <class OptionsT>
+class ilist_sentinel : public ilist_node_impl<OptionsT> {
+public:
+  ilist_sentinel() {
+    this->initializeSentinel();
+    reset();
+  }
+
+  void reset() {
+    this->setPrev(this);
+    this->setNext(this);
+  }
+
+  bool empty() const { return this == this->getPrev(); }
+};
+
+
+
+
+
+template <typename NodeTy, typename ParentTy, class... Options>
+class ilist_node_with_parent : public ilist_node<NodeTy, Options...> {
+protected:
+  ilist_node_with_parent() = default;
+
+private:
+
+
+
+
+
+  const ParentTy *getNodeParent() const {
+    return static_cast<const NodeTy *>(this)->getParent();
+  }
+
+public:
+
+
+
+  NodeTy *getPrevNode() {
+
+
+    const auto &List =
+        getNodeParent()->*(ParentTy::getSublistAccess((NodeTy *)nullptr));
+    return List.getPrevNode(*static_cast<NodeTy *>(this));
+  }
+
+
+  const NodeTy *getPrevNode() const {
+    return const_cast<ilist_node_with_parent *>(this)->getPrevNode();
+  }
+
+
+  NodeTy *getNextNode() {
+
+
+    const auto &List =
+        getNodeParent()->*(ParentTy::getSublistAccess((NodeTy *)nullptr));
+    return List.getNextNode(*static_cast<NodeTy *>(this));
+  }
+
+
+  const NodeTy *getNextNode() const {
+    return const_cast<ilist_node_with_parent *>(this)->getNextNode();
+  }
+
+};
+
+}
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+
+namespace llvm {
+
+namespace ilist_detail {
+
+
+template <class OptionsT, bool IsConst> struct IteratorTraits;
+template <class OptionsT> struct IteratorTraits<OptionsT, false> {
+  using value_type = typename OptionsT::value_type;
+  using pointer = typename OptionsT::pointer;
+  using reference = typename OptionsT::reference;
+  using node_pointer = ilist_node_impl<OptionsT> *;
+  using node_reference = ilist_node_impl<OptionsT> &;
+};
+template <class OptionsT> struct IteratorTraits<OptionsT, true> {
+  using value_type = const typename OptionsT::value_type;
+  using pointer = typename OptionsT::const_pointer;
+  using reference = typename OptionsT::const_reference;
+  using node_pointer = const ilist_node_impl<OptionsT> *;
+  using node_reference = const ilist_node_impl<OptionsT> &;
+};
+
+template <bool IsReverse> struct IteratorHelper;
+template <> struct IteratorHelper<false> : ilist_detail::NodeAccess {
+  using Access = ilist_detail::NodeAccess;
+
+  template <class T> static void increment(T *&I) { I = Access::getNext(*I); }
+  template <class T> static void decrement(T *&I) { I = Access::getPrev(*I); }
+};
+template <> struct IteratorHelper<true> : ilist_detail::NodeAccess {
+  using Access = ilist_detail::NodeAccess;
+
+  template <class T> static void increment(T *&I) { I = Access::getPrev(*I); }
+  template <class T> static void decrement(T *&I) { I = Access::getNext(*I); }
+};
+
+}
+
+
+template <class OptionsT, bool IsReverse, bool IsConst>
+class ilist_iterator : ilist_detail::SpecificNodeAccess<OptionsT> {
+  friend ilist_iterator<OptionsT, IsReverse, !IsConst>;
+  friend ilist_iterator<OptionsT, !IsReverse, IsConst>;
+  friend ilist_iterator<OptionsT, !IsReverse, !IsConst>;
+
+  using Traits = ilist_detail::IteratorTraits<OptionsT, IsConst>;
+  using Access = ilist_detail::SpecificNodeAccess<OptionsT>;
+
+public:
+  using value_type = typename Traits::value_type;
+  using pointer = typename Traits::pointer;
+  using reference = typename Traits::reference;
+  using difference_type = ptrdiff_t;
+  using iterator_category = std::bidirectional_iterator_tag;
+  using const_pointer = typename OptionsT::const_pointer;
+  using const_reference = typename OptionsT::const_reference;
+
+private:
+  using node_pointer = typename Traits::node_pointer;
+  using node_reference = typename Traits::node_reference;
+
+  node_pointer NodePtr = nullptr;
+
+public:
+
+  explicit ilist_iterator(node_reference N) : NodePtr(&N) {}
+
+  explicit ilist_iterator(pointer NP) : NodePtr(Access::getNodePtr(NP)) {}
+  explicit ilist_iterator(reference NR) : NodePtr(Access::getNodePtr(&NR)) {}
+  ilist_iterator() = default;
+
+
+
+  template <bool RHSIsConst>
+  ilist_iterator(
+      const ilist_iterator<OptionsT, IsReverse, RHSIsConst> &RHS,
+      typename std::enable_if<IsConst || !RHSIsConst, void *>::type = nullptr)
+      : NodePtr(RHS.NodePtr) {}
+
+
+
+  template <bool RHSIsConst>
+  typename std::enable_if<IsConst || !RHSIsConst, ilist_iterator &>::type
+  operator=(const ilist_iterator<OptionsT, IsReverse, RHSIsConst> &RHS) {
+    NodePtr = RHS.NodePtr;
+    return *this;
+  }
+  explicit ilist_iterator(
+      const ilist_iterator<OptionsT, !IsReverse, IsConst> &RHS)
+      : ilist_iterator(++RHS.getReverse()) {}
+
+
+
+
+
+
+  ilist_iterator<OptionsT, !IsReverse, IsConst> getReverse() const {
+    if (NodePtr)
+      return ilist_iterator<OptionsT, !IsReverse, IsConst>(*NodePtr);
+    return ilist_iterator<OptionsT, !IsReverse, IsConst>();
+  }
+
+
+  ilist_iterator<OptionsT, IsReverse, false> getNonConst() const {
+    if (NodePtr)
+      return ilist_iterator<OptionsT, IsReverse, false>(
+          const_cast<typename ilist_iterator<OptionsT, IsReverse,
+                                             false>::node_reference>(*NodePtr));
+    return ilist_iterator<OptionsT, IsReverse, false>();
+  }
+
+
+  reference operator*() const {
+    
+   ((
+   !NodePtr->isKnownSentinel()
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!NodePtr->isKnownSentinel()"
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/ilist_iterator.h", 140, __PRETTY_FUNCTION__))
+                                      ;
+    return *Access::getValuePtr(NodePtr);
+  }
+  pointer operator->() const { return &operator*(); }
+
+
+  friend bool operator==(const ilist_iterator &LHS, const ilist_iterator &RHS) {
+    return LHS.NodePtr == RHS.NodePtr;
+  }
+  friend bool operator!=(const ilist_iterator &LHS, const ilist_iterator &RHS) {
+    return LHS.NodePtr != RHS.NodePtr;
+  }
+
+
+  ilist_iterator &operator--() {
+    NodePtr = IsReverse ? NodePtr->getNext() : NodePtr->getPrev();
+    return *this;
+  }
+  ilist_iterator &operator++() {
+    NodePtr = IsReverse ? NodePtr->getPrev() : NodePtr->getNext();
+    return *this;
+  }
+  ilist_iterator operator--(int) {
+    ilist_iterator tmp = *this;
+    --*this;
+    return tmp;
+  }
+  ilist_iterator operator++(int) {
+    ilist_iterator tmp = *this;
+    ++*this;
+    return tmp;
+  }
+
+
+  node_pointer getNodePtr() const { return static_cast<node_pointer>(NodePtr); }
+
+
+  bool isEnd() const { return NodePtr ? NodePtr->isSentinel() : false; }
+};
+
+template <typename From> struct simplify_type;
+
+
+
+
+
+template <class OptionsT, bool IsConst>
+struct simplify_type<ilist_iterator<OptionsT, false, IsConst>> {
+  using iterator = ilist_iterator<OptionsT, false, IsConst>;
+  using SimpleType = typename iterator::pointer;
+
+  static SimpleType getSimplifiedValue(const iterator &Node) { return &*Node; }
+};
+template <class OptionsT, bool IsConst>
+struct simplify_type<const ilist_iterator<OptionsT, false, IsConst>>
+    : simplify_type<ilist_iterator<OptionsT, false, IsConst>> {};
+
+}
+
+
+
+
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+
+
+namespace llvm {
+template <typename T, class... Options>
+class simple_ilist
+    : ilist_detail::compute_node_options<T, Options...>::type::list_base_type,
+      ilist_detail::SpecificNodeAccess<
+          typename ilist_detail::compute_node_options<T, Options...>::type> {
+  static_assert(ilist_detail::check_options<Options...>::value,
+                "Unrecognized node option!");
+  using OptionsT =
+      typename ilist_detail::compute_node_options<T, Options...>::type;
+  using list_base_type = typename OptionsT::list_base_type;
+  ilist_sentinel<OptionsT> Sentinel;
+
+public:
+  using value_type = typename OptionsT::value_type;
+  using pointer = typename OptionsT::pointer;
+  using reference = typename OptionsT::reference;
+  using const_pointer = typename OptionsT::const_pointer;
+  using const_reference = typename OptionsT::const_reference;
+  using iterator = ilist_iterator<OptionsT, false, false>;
+  using const_iterator = ilist_iterator<OptionsT, false, true>;
+  using reverse_iterator = ilist_iterator<OptionsT, true, false>;
+  using const_reverse_iterator = ilist_iterator<OptionsT, true, true>;
+  using size_type = size_t;
+  using difference_type = ptrdiff_t;
+
+  simple_ilist() = default;
+  ~simple_ilist() = default;
+
+
+  simple_ilist(const simple_ilist &) = delete;
+  simple_ilist &operator=(const simple_ilist &) = delete;
+
+
+  simple_ilist(simple_ilist &&X) { splice(end(), X); }
+  simple_ilist &operator=(simple_ilist &&X) {
+    clear();
+    splice(end(), X);
+    return *this;
+  }
+
+  iterator begin() { return ++iterator(Sentinel); }
+  const_iterator begin() const { return ++const_iterator(Sentinel); }
+  iterator end() { return iterator(Sentinel); }
+  const_iterator end() const { return const_iterator(Sentinel); }
+  reverse_iterator rbegin() { return ++reverse_iterator(Sentinel); }
+  const_reverse_iterator rbegin() const {
+    return ++const_reverse_iterator(Sentinel);
+  }
+  reverse_iterator rend() { return reverse_iterator(Sentinel); }
+  const_reverse_iterator rend() const {
+    return const_reverse_iterator(Sentinel);
+  }
+
+
+  bool empty() const { return Sentinel.empty(); }
+
+
+  size_type size() const {
+    return std::distance(begin(), end());
+  }
+
+  reference front() { return *begin(); }
+  const_reference front() const { return *begin(); }
+  reference back() { return *rbegin(); }
+  const_reference back() const { return *rbegin(); }
+
+
+  void push_front(reference Node) { insert(begin(), Node); }
+
+
+  void push_back(reference Node) { insert(end(), Node); }
+
+
+  void pop_front() { erase(begin()); }
+
+
+  void pop_back() { erase(--end()); }
+
+
+  void swap(simple_ilist &X) { std::swap(*this, X); }
+
+
+  iterator insert(iterator I, reference Node) {
+    list_base_type::insertBefore(*I.getNodePtr(), *this->getNodePtr(&Node));
+    return iterator(&Node);
+  }
+
+
+  template <class Iterator>
+  void insert(iterator I, Iterator First, Iterator Last) {
+    for (; First != Last; ++First)
+      insert(I, *First);
+  }
+
+
+  template <class Cloner, class Disposer>
+  void cloneFrom(const simple_ilist &L2, Cloner clone, Disposer dispose) {
+    clearAndDispose(dispose);
+    for (const_reference V : L2)
+      push_back(*clone(V));
+  }
+
+
+
+
+
+  void remove(reference N) { list_base_type::remove(*this->getNodePtr(&N)); }
+
+
+  template <class Disposer>
+  void removeAndDispose(reference N, Disposer dispose) {
+    remove(N);
+    dispose(&N);
+  }
+
+
+
+
+
+  iterator erase(iterator I) {
+    
+   ((
+   I != end() && "Cannot remove end of list!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "I != end() && \"Cannot remove end of list!\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/simple_ilist.h", 198, __PRETTY_FUNCTION__))
+                                                     ;
+    remove(*I++);
+    return I;
+  }
+
+
+
+
+  iterator erase(iterator First, iterator Last) {
+    list_base_type::removeRange(*First.getNodePtr(), *Last.getNodePtr());
+    return Last;
+  }
+
+
+  template <class Disposer>
+  iterator eraseAndDispose(iterator I, Disposer dispose) {
+    auto Next = std::next(I);
+    erase(I);
+    dispose(&*I);
+    return Next;
+  }
+
+
+  template <class Disposer>
+  iterator eraseAndDispose(iterator First, iterator Last, Disposer dispose) {
+    while (First != Last)
+      First = eraseAndDispose(First, dispose);
+    return Last;
+  }
+
+
+
+
+  void clear() { Sentinel.reset(); }
+
+
+  template <class Disposer> void clearAndDispose(Disposer dispose) {
+    eraseAndDispose(begin(), end(), dispose);
+  }
+
+
+  void splice(iterator I, simple_ilist &L2) {
+    splice(I, L2, L2.begin(), L2.end());
+  }
+
+
+  void splice(iterator I, simple_ilist &L2, iterator Node) {
+    splice(I, L2, Node, std::next(Node));
+  }
+
+
+  void splice(iterator I, simple_ilist &, iterator First, iterator Last) {
+    list_base_type::transferBefore(*I.getNodePtr(), *First.getNodePtr(),
+                                   *Last.getNodePtr());
+  }
+
+
+
+
+
+  void merge(simple_ilist &RHS) { merge(RHS, std::less<T>()); }
+  template <class Compare> void merge(simple_ilist &RHS, Compare comp);
+
+
+
+
+  void sort() { sort(std::less<T>()); }
+  template <class Compare> void sort(Compare comp);
+
+};
+
+template <class T, class... Options>
+template <class Compare>
+void simple_ilist<T, Options...>::merge(simple_ilist &RHS, Compare comp) {
+  if (this == &RHS || RHS.empty())
+    return;
+  iterator LI = begin(), LE = end();
+  iterator RI = RHS.begin(), RE = RHS.end();
+  while (LI != LE) {
+    if (comp(*RI, *LI)) {
+
+      iterator RunStart = RI++;
+      RI = std::find_if(RI, RE, [&](reference RV) { return !comp(RV, *LI); });
+      splice(LI, RHS, RunStart, RI);
+      if (RI == RE)
+        return;
+    }
+    ++LI;
+  }
+
+  splice(LE, RHS, RI, RE);
+}
+
+template <class T, class... Options>
+template <class Compare>
+void simple_ilist<T, Options...>::sort(Compare comp) {
+
+  if (empty() || std::next(begin()) == end())
+    return;
+
+
+  iterator Center = begin(), End = begin();
+  while (End != end() && ++End != end()) {
+    ++Center;
+    ++End;
+  }
+  simple_ilist RHS;
+  RHS.splice(RHS.end(), *this, Center, end());
+
+
+  sort(comp);
+  RHS.sort(comp);
+  merge(RHS, comp);
+}
+
+}
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+namespace llvm {
+template <typename NodeTy> struct ilist_alloc_traits {
+  static void deleteNode(NodeTy *V) { delete V; }
+};
+template <typename NodeTy> struct ilist_noalloc_traits {
+  static void deleteNode(NodeTy *V) {}
+};
+
+
+
+
+
+template <typename NodeTy> struct ilist_callback_traits {
+  void addNodeToList(NodeTy *) {}
+  void removeNodeFromList(NodeTy *) {}
+
+
+
+
+  template <class Iterator>
+  void transferNodesFromList(ilist_callback_traits &OldList, Iterator ,
+                             Iterator ) {
+    (void)OldList;
+  }
+};
+
+
+
+
+
+template <typename NodeTy>
+struct ilist_node_traits : ilist_alloc_traits<NodeTy>,
+                           ilist_callback_traits<NodeTy> {};
+template <typename NodeTy>
+struct ilist_default_traits : public ilist_node_traits<NodeTy> {};
+
+
+
+
+template <typename NodeTy>
+struct ilist_traits : public ilist_default_traits<NodeTy> {};
+
+
+template <typename Ty> struct ilist_traits<const Ty> {};
+
+namespace ilist_detail {
+
+template <class T> T &make();
+
+
+
+template <class TraitsT, class NodeT> struct HasGetNext {
+  typedef char Yes[1];
+  typedef char No[2];
+  template <size_t N> struct SFINAE {};
+
+  template <class U>
+  static Yes &test(U *I, decltype(I->getNext(&make<NodeT>())) * = 0);
+  template <class> static No &test(...);
+
+public:
+  static const bool value = sizeof(test<TraitsT>(nullptr)) == sizeof(Yes);
+};
+
+
+
+template <class TraitsT> struct HasCreateSentinel {
+  typedef char Yes[1];
+  typedef char No[2];
+
+  template <class U>
+  static Yes &test(U *I, decltype(I->createSentinel()) * = 0);
+  template <class> static No &test(...);
+
+public:
+  static const bool value = sizeof(test<TraitsT>(nullptr)) == sizeof(Yes);
+};
+
+
+
+
+template <class TraitsT, class NodeT> struct HasCreateNode {
+  typedef char Yes[1];
+  typedef char No[2];
+  template <size_t N> struct SFINAE {};
+
+  template <class U>
+  static Yes &test(U *I, decltype(I->createNode(make<NodeT>())) * = 0);
+  template <class> static No &test(...);
+
+public:
+  static const bool value = sizeof(test<TraitsT>(nullptr)) == sizeof(Yes);
+};
+
+template <class TraitsT, class NodeT> struct HasObsoleteCustomization {
+  static const bool value = HasGetNext<TraitsT, NodeT>::value ||
+                            HasCreateSentinel<TraitsT>::value ||
+                            HasCreateNode<TraitsT, NodeT>::value;
+};
+
+}
+template <class IntrusiveListT, class TraitsT>
+class iplist_impl : public TraitsT, IntrusiveListT {
+  typedef IntrusiveListT base_list_type;
+
+protected:
+  typedef iplist_impl iplist_impl_type;
+
+public:
+  typedef typename base_list_type::pointer pointer;
+  typedef typename base_list_type::const_pointer const_pointer;
+  typedef typename base_list_type::reference reference;
+  typedef typename base_list_type::const_reference const_reference;
+  typedef typename base_list_type::value_type value_type;
+  typedef typename base_list_type::size_type size_type;
+  typedef typename base_list_type::difference_type difference_type;
+  typedef typename base_list_type::iterator iterator;
+  typedef typename base_list_type::const_iterator const_iterator;
+  typedef typename base_list_type::reverse_iterator reverse_iterator;
+  typedef
+      typename base_list_type::const_reverse_iterator const_reverse_iterator;
+
+private:
+
+
+
+  static_assert(
+      !ilist_detail::HasObsoleteCustomization<TraitsT, value_type>::value,
+      "ilist customization points have changed!");
+
+  static bool op_less(const_reference L, const_reference R) { return L < R; }
+  static bool op_equal(const_reference L, const_reference R) { return L == R; }
+
+public:
+  iplist_impl() = default;
+
+  iplist_impl(const iplist_impl &) = delete;
+  iplist_impl &operator=(const iplist_impl &) = delete;
+
+  iplist_impl(iplist_impl &&X)
+      : TraitsT(std::move(X)), IntrusiveListT(std::move(X)) {}
+  iplist_impl &operator=(iplist_impl &&X) {
+    *static_cast<TraitsT *>(this) = std::move(X);
+    *static_cast<IntrusiveListT *>(this) = std::move(X);
+    return *this;
+  }
+
+  ~iplist_impl() { clear(); }
+
+
+  size_type max_size() const { return size_type(-1); }
+
+  using base_list_type::begin;
+  using base_list_type::end;
+  using base_list_type::rbegin;
+  using base_list_type::rend;
+  using base_list_type::empty;
+  using base_list_type::front;
+  using base_list_type::back;
+
+  void swap(iplist_impl &RHS) {
+    
+   ((
+   0 && "Swap does not use list traits callback correctly yet!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "0 && \"Swap does not use list traits callback correctly yet!\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/ilist.h", 237, __PRETTY_FUNCTION__))
+                                                                       ;
+    base_list_type::swap(RHS);
+  }
+
+  iterator insert(iterator where, pointer New) {
+    this->addNodeToList(New);
+    return base_list_type::insert(where, *New);
+  }
+
+  iterator insert(iterator where, const_reference New) {
+    return this->insert(where, new value_type(New));
+  }
+
+  iterator insertAfter(iterator where, pointer New) {
+    if (empty())
+      return insert(begin(), New);
+    else
+      return insert(++where, New);
+  }
+
+
+  template <class Cloner> void cloneFrom(const iplist_impl &L2, Cloner clone) {
+    clear();
+    for (const_reference V : L2)
+      push_back(clone(V));
+  }
+
+  pointer remove(iterator &IT) {
+    pointer Node = &*IT++;
+    this->removeNodeFromList(Node);
+    base_list_type::remove(*Node);
+    return Node;
+  }
+
+  pointer remove(const iterator &IT) {
+    iterator MutIt = IT;
+    return remove(MutIt);
+  }
+
+  pointer remove(pointer IT) { return remove(iterator(IT)); }
+  pointer remove(reference IT) { return remove(iterator(IT)); }
+
+
+  iterator erase(iterator where) {
+    this->deleteNode(remove(where));
+    return where;
+  }
+
+  iterator erase(pointer IT) { return erase(iterator(IT)); }
+  iterator erase(reference IT) { return erase(iterator(IT)); }
+
+
+
+
+
+
+  void clearAndLeakNodesUnsafely() { base_list_type::clear(); }
+
+private:
+
+
+
+  void transfer(iterator position, iplist_impl &L2, iterator first, iterator last) {
+    if (position == last)
+      return;
+
+    if (this != &L2)
+      this->transferNodesFromList(L2, first, last);
+
+    base_list_type::splice(position, L2, first, last);
+  }
+
+public:
+
+
+
+
+  using base_list_type::size;
+
+  iterator erase(iterator first, iterator last) {
+    while (first != last)
+      first = erase(first);
+    return last;
+  }
+
+  void clear() { erase(begin(), end()); }
+
+
+  void push_front(pointer val) { insert(begin(), val); }
+  void push_back(pointer val) { insert(end(), val); }
+  void pop_front() {
+    
+   ((
+   !empty() && "pop_front() on empty list!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!empty() && \"pop_front() on empty list!\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/ilist.h", 328, __PRETTY_FUNCTION__))
+                                                   ;
+    erase(begin());
+  }
+  void pop_back() {
+    
+   ((
+   !empty() && "pop_back() on empty list!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!empty() && \"pop_back() on empty list!\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/ilist.h", 332, __PRETTY_FUNCTION__))
+                                                  ;
+    iterator t = end(); erase(--t);
+  }
+
+
+  template<class InIt> void insert(iterator where, InIt first, InIt last) {
+    for (; first != last; ++first) insert(where, *first);
+  }
+
+
+  void splice(iterator where, iplist_impl &L2) {
+    if (!L2.empty())
+      transfer(where, L2, L2.begin(), L2.end());
+  }
+  void splice(iterator where, iplist_impl &L2, iterator first) {
+    iterator last = first; ++last;
+    if (where == first || where == last) return;
+    transfer(where, L2, first, last);
+  }
+  void splice(iterator where, iplist_impl &L2, iterator first, iterator last) {
+    if (first != last) transfer(where, L2, first, last);
+  }
+  void splice(iterator where, iplist_impl &L2, reference N) {
+    splice(where, L2, iterator(N));
+  }
+  void splice(iterator where, iplist_impl &L2, pointer N) {
+    splice(where, L2, iterator(N));
+  }
+
+  template <class Compare>
+  void merge(iplist_impl &Right, Compare comp) {
+    if (this == &Right)
+      return;
+    this->transferNodesFromList(Right, Right.begin(), Right.end());
+    base_list_type::merge(Right, comp);
+  }
+  void merge(iplist_impl &Right) { return merge(Right, op_less); }
+
+  using base_list_type::sort;
+
+
+  pointer getPrevNode(reference N) const {
+    auto I = N.getIterator();
+    if (I == begin())
+      return nullptr;
+    return &*std::prev(I);
+  }
+
+  const_pointer getPrevNode(const_reference N) const {
+    return getPrevNode(const_cast<reference >(N));
+  }
+
+
+  pointer getNextNode(reference N) const {
+    auto Next = std::next(N.getIterator());
+    if (Next == end())
+      return nullptr;
+    return &*Next;
+  }
+
+  const_pointer getNextNode(const_reference N) const {
+    return getNextNode(const_cast<reference >(N));
+  }
+};
+
+
+
+
+
+
+template <class T, class... Options>
+class iplist
+    : public iplist_impl<simple_ilist<T, Options...>, ilist_traits<T>> {
+  typedef typename iplist::iplist_impl_type iplist_impl_type;
+
+public:
+  iplist() = default;
+
+  iplist(const iplist &X) = delete;
+  iplist &operator=(const iplist &X) = delete;
+
+  iplist(iplist &&X) : iplist_impl_type(std::move(X)) {}
+  iplist &operator=(iplist &&X) {
+    *static_cast<iplist_impl_type *>(this) = std::move(X);
+    return *this;
+  }
+};
+
+template <class T, class... Options> using ilist = iplist<T, Options...>;
+
+}
+
+namespace std {
+
+
+  template<class Ty>
+  void swap(llvm::iplist<Ty> &Left, llvm::iplist<Ty> &Right) {
+    Left.swap(Right);
+  }
+
+}
+
+
+
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+namespace llvm {
+
+template <typename T> struct PointerUnionTypeSelectorReturn {
+  using Return = T;
+};
+template <typename T1, typename T2, typename RET_EQ, typename RET_NE>
+struct PointerUnionTypeSelector {
+  using Return = typename PointerUnionTypeSelectorReturn<RET_NE>::Return;
+};
+
+template <typename T, typename RET_EQ, typename RET_NE>
+struct PointerUnionTypeSelector<T, T, RET_EQ, RET_NE> {
+  using Return = typename PointerUnionTypeSelectorReturn<RET_EQ>::Return;
+};
+
+template <typename T1, typename T2, typename RET_EQ, typename RET_NE>
+struct PointerUnionTypeSelectorReturn<
+    PointerUnionTypeSelector<T1, T2, RET_EQ, RET_NE>> {
+  using Return =
+      typename PointerUnionTypeSelector<T1, T2, RET_EQ, RET_NE>::Return;
+};
+
+
+
+template <typename PT1, typename PT2> class PointerUnionUIntTraits {
+public:
+  static inline void *getAsVoidPointer(void *P) { return P; }
+  static inline void *getFromVoidPointer(void *P) { return P; }
+
+  enum {
+    PT1BitsAv = (int)(PointerLikeTypeTraits<PT1>::NumLowBitsAvailable),
+    PT2BitsAv = (int)(PointerLikeTypeTraits<PT2>::NumLowBitsAvailable),
+    NumLowBitsAvailable = PT1BitsAv < PT2BitsAv ? PT1BitsAv : PT2BitsAv
+  };
+};
+template <typename PT1, typename PT2> class PointerUnion {
+public:
+  using ValTy =
+      PointerIntPair<void *, 1, bool, PointerUnionUIntTraits<PT1, PT2>>;
+
+private:
+  ValTy Val;
+
+  struct IsPT1 {
+    static const int Num = 0;
+  };
+  struct IsPT2 {
+    static const int Num = 1;
+  };
+  template <typename T> struct UNION_DOESNT_CONTAIN_TYPE {};
+
+public:
+  PointerUnion() = default;
+  PointerUnion(PT1 V)
+      : Val(const_cast<void *>(
+            PointerLikeTypeTraits<PT1>::getAsVoidPointer(V))) {}
+  PointerUnion(PT2 V)
+      : Val(const_cast<void *>(PointerLikeTypeTraits<PT2>::getAsVoidPointer(V)),
+            1) {}
+
+
+
+  bool isNull() const {
+
+
+    return !PointerLikeTypeTraits<PT1>::getFromVoidPointer(Val.getPointer());
+  }
+
+  explicit operator bool() const { return !isNull(); }
+
+
+  template <typename T> int is() const {
+    using Ty = typename ::llvm::PointerUnionTypeSelector<
+        PT1, T, IsPT1,
+        ::llvm::PointerUnionTypeSelector<PT2, T, IsPT2,
+                                         UNION_DOESNT_CONTAIN_TYPE<T>>>::Return;
+    int TyNo = Ty::Num;
+    return static_cast<int>(Val.getInt()) == TyNo;
+  }
+
+
+
+
+  template <typename T> T get() const {
+    
+   ((
+   is<T>() && "Invalid accessor called"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "is<T>() && \"Invalid accessor called\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/PointerUnion.h", 136, __PRETTY_FUNCTION__))
+                                               ;
+    return PointerLikeTypeTraits<T>::getFromVoidPointer(Val.getPointer());
+  }
+
+
+
+  template <typename T> T dyn_cast() const {
+    if (is<T>())
+      return get<T>();
+    return T();
+  }
+
+
+
+  PT1 const *getAddrOfPtr1() const {
+    return const_cast<PointerUnion *>(this)->getAddrOfPtr1();
+  }
+
+
+
+  PT1 *getAddrOfPtr1() {
+    
+   ((
+   is<PT1>() && "Val is not the first pointer"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "is<PT1>() && \"Val is not the first pointer\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/PointerUnion.h", 157, __PRETTY_FUNCTION__))
+                                                      ;
+    
+   ((
+   get<PT1>() == Val.getPointer() && "Can't get the address because PointerLikeTypeTraits changes the ptr"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "get<PT1>() == Val.getPointer() && \"Can't get the address because PointerLikeTypeTraits changes the ptr\""
+   ,
+
+                                                                             "/home/trippels/llvm/llvm/include/llvm/ADT/PointerUnion.h"
+    ,
+
+                                                                             160
+    , __PRETTY_FUNCTION__))
+
+                                                                              
+                                                                             ;
+    return const_cast<PT1 *>(
+        reinterpret_cast<const PT1 *>(Val.getAddrOfPointer()));
+  }
+
+
+  const PointerUnion &operator=(std::nullptr_t) {
+    Val.initWithPointer(nullptr);
+    return *this;
+  }
+
+
+
+  const PointerUnion &operator=(const PT1 &RHS) {
+    Val.initWithPointer(
+        const_cast<void *>(PointerLikeTypeTraits<PT1>::getAsVoidPointer(RHS)));
+    return *this;
+  }
+  const PointerUnion &operator=(const PT2 &RHS) {
+    Val.setPointerAndInt(
+        const_cast<void *>(PointerLikeTypeTraits<PT2>::getAsVoidPointer(RHS)),
+        1);
+    return *this;
+  }
+
+  void *getOpaqueValue() const { return Val.getOpaqueValue(); }
+  static inline PointerUnion getFromOpaqueValue(void *VP) {
+    PointerUnion V;
+    V.Val = ValTy::getFromOpaqueValue(VP);
+    return V;
+  }
+};
+
+template <typename PT1, typename PT2>
+bool operator==(PointerUnion<PT1, PT2> lhs, PointerUnion<PT1, PT2> rhs) {
+  return lhs.getOpaqueValue() == rhs.getOpaqueValue();
+}
+
+template <typename PT1, typename PT2>
+bool operator!=(PointerUnion<PT1, PT2> lhs, PointerUnion<PT1, PT2> rhs) {
+  return lhs.getOpaqueValue() != rhs.getOpaqueValue();
+}
+
+template <typename PT1, typename PT2>
+bool operator<(PointerUnion<PT1, PT2> lhs, PointerUnion<PT1, PT2> rhs) {
+  return lhs.getOpaqueValue() < rhs.getOpaqueValue();
+}
+
+
+
+template <typename PT1, typename PT2>
+struct PointerLikeTypeTraits<PointerUnion<PT1, PT2>> {
+  static inline void *getAsVoidPointer(const PointerUnion<PT1, PT2> &P) {
+    return P.getOpaqueValue();
+  }
+
+  static inline PointerUnion<PT1, PT2> getFromVoidPointer(void *P) {
+    return PointerUnion<PT1, PT2>::getFromOpaqueValue(P);
+  }
+
+
+  enum {
+    NumLowBitsAvailable = PointerLikeTypeTraits<
+        typename PointerUnion<PT1, PT2>::ValTy>::NumLowBitsAvailable
+  };
+};
+
+
+
+template <typename PT1, typename PT2, typename PT3> class PointerUnion3 {
+public:
+  using InnerUnion = PointerUnion<PT1, PT2>;
+  using ValTy = PointerUnion<InnerUnion, PT3>;
+
+private:
+  ValTy Val;
+
+  struct IsInnerUnion {
+    ValTy Val;
+
+    IsInnerUnion(ValTy val) : Val(val) {}
+
+    template <typename T> int is() const {
+      return Val.template is<InnerUnion>() &&
+             Val.template get<InnerUnion>().template is<T>();
+    }
+
+    template <typename T> T get() const {
+      return Val.template get<InnerUnion>().template get<T>();
+    }
+  };
+
+  struct IsPT3 {
+    ValTy Val;
+
+    IsPT3(ValTy val) : Val(val) {}
+
+    template <typename T> int is() const { return Val.template is<T>(); }
+    template <typename T> T get() const { return Val.template get<T>(); }
+  };
+
+public:
+  PointerUnion3() = default;
+  PointerUnion3(PT1 V) { Val = InnerUnion(V); }
+  PointerUnion3(PT2 V) { Val = InnerUnion(V); }
+  PointerUnion3(PT3 V) { Val = V; }
+
+
+
+  bool isNull() const { return Val.isNull(); }
+  explicit operator bool() const { return !isNull(); }
+
+
+  template <typename T> int is() const {
+
+    using Ty = typename ::llvm::PointerUnionTypeSelector<
+        PT1, T, IsInnerUnion,
+        ::llvm::PointerUnionTypeSelector<PT2, T, IsInnerUnion, IsPT3>>::Return;
+    return Ty(Val).template is<T>();
+  }
+
+
+
+
+  template <typename T> T get() const {
+    
+   ((
+   is<T>() && "Invalid accessor called"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "is<T>() && \"Invalid accessor called\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/PointerUnion.h", 285, __PRETTY_FUNCTION__))
+                                               ;
+
+    using Ty = typename ::llvm::PointerUnionTypeSelector<
+        PT1, T, IsInnerUnion,
+        ::llvm::PointerUnionTypeSelector<PT2, T, IsInnerUnion, IsPT3>>::Return;
+    return Ty(Val).template get<T>();
+  }
+
+
+
+  template <typename T> T dyn_cast() const {
+    if (is<T>())
+      return get<T>();
+    return T();
+  }
+
+
+  const PointerUnion3 &operator=(std::nullptr_t) {
+    Val = nullptr;
+    return *this;
+  }
+
+
+
+  const PointerUnion3 &operator=(const PT1 &RHS) {
+    Val = InnerUnion(RHS);
+    return *this;
+  }
+  const PointerUnion3 &operator=(const PT2 &RHS) {
+    Val = InnerUnion(RHS);
+    return *this;
+  }
+  const PointerUnion3 &operator=(const PT3 &RHS) {
+    Val = RHS;
+    return *this;
+  }
+
+  void *getOpaqueValue() const { return Val.getOpaqueValue(); }
+  static inline PointerUnion3 getFromOpaqueValue(void *VP) {
+    PointerUnion3 V;
+    V.Val = ValTy::getFromOpaqueValue(VP);
+    return V;
+  }
+};
+
+
+
+template <typename PT1, typename PT2, typename PT3>
+struct PointerLikeTypeTraits<PointerUnion3<PT1, PT2, PT3>> {
+  static inline void *getAsVoidPointer(const PointerUnion3<PT1, PT2, PT3> &P) {
+    return P.getOpaqueValue();
+  }
+
+  static inline PointerUnion3<PT1, PT2, PT3> getFromVoidPointer(void *P) {
+    return PointerUnion3<PT1, PT2, PT3>::getFromOpaqueValue(P);
+  }
+
+
+  enum {
+    NumLowBitsAvailable = PointerLikeTypeTraits<
+        typename PointerUnion3<PT1, PT2, PT3>::ValTy>::NumLowBitsAvailable
+  };
+};
+
+
+
+template <typename PT1, typename PT2, typename PT3, typename PT4>
+class PointerUnion4 {
+public:
+  using InnerUnion1 = PointerUnion<PT1, PT2>;
+  using InnerUnion2 = PointerUnion<PT3, PT4>;
+  using ValTy = PointerUnion<InnerUnion1, InnerUnion2>;
+
+private:
+  ValTy Val;
+
+public:
+  PointerUnion4() = default;
+  PointerUnion4(PT1 V) { Val = InnerUnion1(V); }
+  PointerUnion4(PT2 V) { Val = InnerUnion1(V); }
+  PointerUnion4(PT3 V) { Val = InnerUnion2(V); }
+  PointerUnion4(PT4 V) { Val = InnerUnion2(V); }
+
+
+
+  bool isNull() const { return Val.isNull(); }
+  explicit operator bool() const { return !isNull(); }
+
+
+  template <typename T> int is() const {
+
+    using Ty = typename ::llvm::PointerUnionTypeSelector<
+        PT1, T, InnerUnion1,
+        ::llvm::PointerUnionTypeSelector<PT2, T, InnerUnion1,
+                                         InnerUnion2>>::Return;
+    return Val.template is<Ty>() && Val.template get<Ty>().template is<T>();
+  }
+
+
+
+
+  template <typename T> T get() const {
+    
+   ((
+   is<T>() && "Invalid accessor called"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "is<T>() && \"Invalid accessor called\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/PointerUnion.h", 387, __PRETTY_FUNCTION__))
+                                               ;
+
+    using Ty = typename ::llvm::PointerUnionTypeSelector<
+        PT1, T, InnerUnion1,
+        ::llvm::PointerUnionTypeSelector<PT2, T, InnerUnion1,
+                                         InnerUnion2>>::Return;
+    return Val.template get<Ty>().template get<T>();
+  }
+
+
+
+  template <typename T> T dyn_cast() const {
+    if (is<T>())
+      return get<T>();
+    return T();
+  }
+
+
+  const PointerUnion4 &operator=(std::nullptr_t) {
+    Val = nullptr;
+    return *this;
+  }
+
+
+
+  const PointerUnion4 &operator=(const PT1 &RHS) {
+    Val = InnerUnion1(RHS);
+    return *this;
+  }
+  const PointerUnion4 &operator=(const PT2 &RHS) {
+    Val = InnerUnion1(RHS);
+    return *this;
+  }
+  const PointerUnion4 &operator=(const PT3 &RHS) {
+    Val = InnerUnion2(RHS);
+    return *this;
+  }
+  const PointerUnion4 &operator=(const PT4 &RHS) {
+    Val = InnerUnion2(RHS);
+    return *this;
+  }
+
+  void *getOpaqueValue() const { return Val.getOpaqueValue(); }
+  static inline PointerUnion4 getFromOpaqueValue(void *VP) {
+    PointerUnion4 V;
+    V.Val = ValTy::getFromOpaqueValue(VP);
+    return V;
+  }
+};
+
+
+
+template <typename PT1, typename PT2, typename PT3, typename PT4>
+struct PointerLikeTypeTraits<PointerUnion4<PT1, PT2, PT3, PT4>> {
+  static inline void *
+  getAsVoidPointer(const PointerUnion4<PT1, PT2, PT3, PT4> &P) {
+    return P.getOpaqueValue();
+  }
+
+  static inline PointerUnion4<PT1, PT2, PT3, PT4> getFromVoidPointer(void *P) {
+    return PointerUnion4<PT1, PT2, PT3, PT4>::getFromOpaqueValue(P);
+  }
+
+
+  enum {
+    NumLowBitsAvailable = PointerLikeTypeTraits<
+        typename PointerUnion4<PT1, PT2, PT3, PT4>::ValTy>::NumLowBitsAvailable
+  };
+};
+
+
+template <typename T, typename U> struct DenseMapInfo<PointerUnion<T, U>> {
+  using Pair = PointerUnion<T, U>;
+  using FirstInfo = DenseMapInfo<T>;
+  using SecondInfo = DenseMapInfo<U>;
+
+  static inline Pair getEmptyKey() { return Pair(FirstInfo::getEmptyKey()); }
+
+  static inline Pair getTombstoneKey() {
+    return Pair(FirstInfo::getTombstoneKey());
+  }
+
+  static unsigned getHashValue(const Pair &PairVal) {
+    intptr_t key = (intptr_t)PairVal.getOpaqueValue();
+    return DenseMapInfo<intptr_t>::getHashValue(key);
+  }
+
+  static bool isEqual(const Pair &LHS, const Pair &RHS) {
+    return LHS.template is<T>() == RHS.template is<T>() &&
+           (LHS.template is<T>() ? FirstInfo::isEqual(LHS.template get<T>(),
+                                                      RHS.template get<T>())
+                                 : SecondInfo::isEqual(LHS.template get<U>(),
+                                                       RHS.template get<U>()));
+  }
+};
+
+}
+
+
+
+
+
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+namespace llvm {
+template<typename From> struct simplify_type {
+  using SimpleType = From;
+
+
+  static SimpleType &getSimplifiedValue(From &Val) { return Val; }
+};
+
+template<typename From> struct simplify_type<const From> {
+  using NonConstSimpleType = typename simplify_type<From>::SimpleType;
+  using SimpleType =
+      typename add_const_past_pointer<NonConstSimpleType>::type;
+  using RetType =
+      typename add_lvalue_reference_if_not_pointer<SimpleType>::type;
+
+  static RetType getSimplifiedValue(const From& Val) {
+    return simplify_type<From>::getSimplifiedValue(const_cast<From&>(Val));
+  }
+};
+
+
+
+
+template <typename To, typename From, typename Enabler = void>
+struct isa_impl {
+  static inline bool doit(const From &Val) {
+    return To::classof(&Val);
+  }
+};
+
+
+template <typename To, typename From>
+struct isa_impl<
+    To, From, typename std::enable_if<std::is_base_of<To, From>::value>::type> {
+  static inline bool doit(const From &) { return true; }
+};
+
+template <typename To, typename From> struct isa_impl_cl {
+  static inline bool doit(const From &Val) {
+    return isa_impl<To, From>::doit(Val);
+  }
+};
+
+template <typename To, typename From> struct isa_impl_cl<To, const From> {
+  static inline bool doit(const From &Val) {
+    return isa_impl<To, From>::doit(Val);
+  }
+};
+
+template <typename To, typename From>
+struct isa_impl_cl<To, const std::unique_ptr<From>> {
+  static inline bool doit(const std::unique_ptr<From> &Val) {
+    
+   ((
+   Val && "isa<> used on a null pointer"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Val && \"isa<> used on a null pointer\""
+   , "/home/trippels/llvm/llvm/include/llvm/Support/Casting.h", 85, __PRETTY_FUNCTION__))
+                                                ;
+    return isa_impl_cl<To, From>::doit(*Val);
+  }
+};
+
+template <typename To, typename From> struct isa_impl_cl<To, From*> {
+  static inline bool doit(const From *Val) {
+    
+   ((
+   Val && "isa<> used on a null pointer"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Val && \"isa<> used on a null pointer\""
+   , "/home/trippels/llvm/llvm/include/llvm/Support/Casting.h", 92, __PRETTY_FUNCTION__))
+                                                ;
+    return isa_impl<To, From>::doit(*Val);
+  }
+};
+
+template <typename To, typename From> struct isa_impl_cl<To, From*const> {
+  static inline bool doit(const From *Val) {
+    
+   ((
+   Val && "isa<> used on a null pointer"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Val && \"isa<> used on a null pointer\""
+   , "/home/trippels/llvm/llvm/include/llvm/Support/Casting.h", 99, __PRETTY_FUNCTION__))
+                                                ;
+    return isa_impl<To, From>::doit(*Val);
+  }
+};
+
+template <typename To, typename From> struct isa_impl_cl<To, const From*> {
+  static inline bool doit(const From *Val) {
+    
+   ((
+   Val && "isa<> used on a null pointer"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Val && \"isa<> used on a null pointer\""
+   , "/home/trippels/llvm/llvm/include/llvm/Support/Casting.h", 106, __PRETTY_FUNCTION__))
+                                                ;
+    return isa_impl<To, From>::doit(*Val);
+  }
+};
+
+template <typename To, typename From> struct isa_impl_cl<To, const From*const> {
+  static inline bool doit(const From *Val) {
+    
+   ((
+   Val && "isa<> used on a null pointer"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Val && \"isa<> used on a null pointer\""
+   , "/home/trippels/llvm/llvm/include/llvm/Support/Casting.h", 113, __PRETTY_FUNCTION__))
+                                                ;
+    return isa_impl<To, From>::doit(*Val);
+  }
+};
+
+template<typename To, typename From, typename SimpleFrom>
+struct isa_impl_wrap {
+
+
+  static bool doit(const From &Val) {
+    return isa_impl_wrap<To, SimpleFrom,
+      typename simplify_type<SimpleFrom>::SimpleType>::doit(
+                          simplify_type<const From>::getSimplifiedValue(Val));
+  }
+};
+
+template<typename To, typename FromTy>
+struct isa_impl_wrap<To, FromTy, FromTy> {
+
+  static bool doit(const FromTy &Val) {
+    return isa_impl_cl<To,FromTy>::doit(Val);
+  }
+};
+
+
+
+
+
+
+template <class X, class Y> inline bool isa(const Y &Val) {
+  return isa_impl_wrap<X, const Y,
+                       typename simplify_type<const Y>::SimpleType>::doit(Val);
+}
+
+
+
+
+
+template<class To, class From> struct cast_retty;
+
+
+
+template<class To, class From> struct cast_retty_impl {
+  using ret_type = To &;
+};
+template<class To, class From> struct cast_retty_impl<To, const From> {
+  using ret_type = const To &;
+};
+
+template<class To, class From> struct cast_retty_impl<To, From*> {
+  using ret_type = To *;
+};
+
+template<class To, class From> struct cast_retty_impl<To, const From*> {
+  using ret_type = const To *;
+};
+
+template<class To, class From> struct cast_retty_impl<To, const From*const> {
+  using ret_type = const To *;
+};
+
+template <class To, class From>
+struct cast_retty_impl<To, std::unique_ptr<From>> {
+private:
+  using PointerType = typename cast_retty_impl<To, From *>::ret_type;
+  using ResultType = typename std::remove_pointer<PointerType>::type;
+
+public:
+  using ret_type = std::unique_ptr<ResultType>;
+};
+
+template<class To, class From, class SimpleFrom>
+struct cast_retty_wrap {
+
+
+
+  using ret_type = typename cast_retty<To, SimpleFrom>::ret_type;
+};
+
+template<class To, class FromTy>
+struct cast_retty_wrap<To, FromTy, FromTy> {
+
+  using ret_type = typename cast_retty_impl<To,FromTy>::ret_type;
+};
+
+template<class To, class From>
+struct cast_retty {
+  using ret_type = typename cast_retty_wrap<
+      To, From, typename simplify_type<From>::SimpleType>::ret_type;
+};
+
+
+
+
+template<class To, class From, class SimpleFrom> struct cast_convert_val {
+
+  static typename cast_retty<To, From>::ret_type doit(From &Val) {
+    return cast_convert_val<To, SimpleFrom,
+      typename simplify_type<SimpleFrom>::SimpleType>::doit(
+                          simplify_type<From>::getSimplifiedValue(Val));
+  }
+};
+
+template<class To, class FromTy> struct cast_convert_val<To,FromTy,FromTy> {
+
+  static typename cast_retty<To, FromTy>::ret_type doit(const FromTy &Val) {
+    typename cast_retty<To, FromTy>::ret_type Res2
+     = (typename cast_retty<To, FromTy>::ret_type)const_cast<FromTy&>(Val);
+    return Res2;
+  }
+};
+
+template <class X> struct is_simple_type {
+  static const bool value =
+      std::is_same<X, typename simplify_type<X>::SimpleType>::value;
+};
+template <class X, class Y>
+inline typename std::enable_if<!is_simple_type<Y>::value,
+                               typename cast_retty<X, const Y>::ret_type>::type
+cast(const Y &Val) {
+  
+ ((
+ isa<X>(Val) && "cast<Ty>() argument of incompatible type!"
+ ) ? static_cast<void> (0) : __assert_fail (
+ "isa<X>(Val) && \"cast<Ty>() argument of incompatible type!\""
+ , "/home/trippels/llvm/llvm/include/llvm/Support/Casting.h", 241, __PRETTY_FUNCTION__))
+                                                                   ;
+  return cast_convert_val<
+      X, const Y, typename simplify_type<const Y>::SimpleType>::doit(Val);
+}
+
+template <class X, class Y>
+inline typename cast_retty<X, Y>::ret_type cast(Y &Val) {
+  
+ ((
+ isa<X>(Val) && "cast<Ty>() argument of incompatible type!"
+ ) ? static_cast<void> (0) : __assert_fail (
+ "isa<X>(Val) && \"cast<Ty>() argument of incompatible type!\""
+ , "/home/trippels/llvm/llvm/include/llvm/Support/Casting.h", 248, __PRETTY_FUNCTION__))
+                                                                   ;
+  return cast_convert_val<X, Y,
+                          typename simplify_type<Y>::SimpleType>::doit(Val);
+}
+
+template <class X, class Y>
+inline typename cast_retty<X, Y *>::ret_type cast(Y *Val) {
+  
+ ((
+ isa<X>(Val) && "cast<Ty>() argument of incompatible type!"
+ ) ? static_cast<void> (0) : __assert_fail (
+ "isa<X>(Val) && \"cast<Ty>() argument of incompatible type!\""
+ , "/home/trippels/llvm/llvm/include/llvm/Support/Casting.h", 255, __PRETTY_FUNCTION__))
+                                                                   ;
+  return cast_convert_val<X, Y*,
+                          typename simplify_type<Y*>::SimpleType>::doit(Val);
+}
+
+template <class X, class Y>
+inline typename cast_retty<X, std::unique_ptr<Y>>::ret_type
+cast(std::unique_ptr<Y> &&Val) {
+  
+ ((
+ isa<X>(Val.get()) && "cast<Ty>() argument of incompatible type!"
+ ) ? static_cast<void> (0) : __assert_fail (
+ "isa<X>(Val.get()) && \"cast<Ty>() argument of incompatible type!\""
+ , "/home/trippels/llvm/llvm/include/llvm/Support/Casting.h", 263, __PRETTY_FUNCTION__))
+                                                                         ;
+  using ret_type = typename cast_retty<X, std::unique_ptr<Y>>::ret_type;
+  return ret_type(
+      cast_convert_val<X, Y *, typename simplify_type<Y *>::SimpleType>::doit(
+          Val.release()));
+}
+
+
+
+
+template <class X, class Y>
+ inline
+    typename std::enable_if<!is_simple_type<Y>::value,
+                            typename cast_retty<X, const Y>::ret_type>::type
+    cast_or_null(const Y &Val) {
+  if (!Val)
+    return nullptr;
+  
+ ((
+ isa<X>(Val) && "cast_or_null<Ty>() argument of incompatible type!"
+ ) ? static_cast<void> (0) : __assert_fail (
+ "isa<X>(Val) && \"cast_or_null<Ty>() argument of incompatible type!\""
+ , "/home/trippels/llvm/llvm/include/llvm/Support/Casting.h", 280, __PRETTY_FUNCTION__))
+                                                                           ;
+  return cast<X>(Val);
+}
+
+template <class X, class Y>
+ inline
+    typename std::enable_if<!is_simple_type<Y>::value,
+                            typename cast_retty<X, Y>::ret_type>::type
+    cast_or_null(Y &Val) {
+  if (!Val)
+    return nullptr;
+  
+ ((
+ isa<X>(Val) && "cast_or_null<Ty>() argument of incompatible type!"
+ ) ? static_cast<void> (0) : __assert_fail (
+ "isa<X>(Val) && \"cast_or_null<Ty>() argument of incompatible type!\""
+ , "/home/trippels/llvm/llvm/include/llvm/Support/Casting.h", 291, __PRETTY_FUNCTION__))
+                                                                           ;
+  return cast<X>(Val);
+}
+
+template <class X, class Y>
+ inline typename cast_retty<X, Y *>::ret_type
+cast_or_null(Y *Val) {
+  if (!Val) return nullptr;
+  
+ ((
+ isa<X>(Val) && "cast_or_null<Ty>() argument of incompatible type!"
+ ) ? static_cast<void> (0) : __assert_fail (
+ "isa<X>(Val) && \"cast_or_null<Ty>() argument of incompatible type!\""
+ , "/home/trippels/llvm/llvm/include/llvm/Support/Casting.h", 299, __PRETTY_FUNCTION__))
+                                                                           ;
+  return cast<X>(Val);
+}
+
+template <class X, class Y>
+inline typename cast_retty<X, std::unique_ptr<Y>>::ret_type
+cast_or_null(std::unique_ptr<Y> &&Val) {
+  if (!Val)
+    return nullptr;
+  return cast<X>(std::move(Val));
+}
+template <class X, class Y>
+ inline
+    typename std::enable_if<!is_simple_type<Y>::value,
+                            typename cast_retty<X, const Y>::ret_type>::type
+    dyn_cast(const Y &Val) {
+  return isa<X>(Val) ? cast<X>(Val) : nullptr;
+}
+
+template <class X, class Y>
+ inline typename cast_retty<X, Y>::ret_type dyn_cast(Y &Val) {
+  return isa<X>(Val) ? cast<X>(Val) : nullptr;
+}
+
+template <class X, class Y>
+ inline typename cast_retty<X, Y *>::ret_type dyn_cast(Y *Val) {
+  return isa<X>(Val) ? cast<X>(Val) : nullptr;
+}
+
+
+
+
+template <class X, class Y>
+ inline
+    typename std::enable_if<!is_simple_type<Y>::value,
+                            typename cast_retty<X, const Y>::ret_type>::type
+    dyn_cast_or_null(const Y &Val) {
+  return (Val && isa<X>(Val)) ? cast<X>(Val) : nullptr;
+}
+
+template <class X, class Y>
+ inline
+    typename std::enable_if<!is_simple_type<Y>::value,
+                            typename cast_retty<X, Y>::ret_type>::type
+    dyn_cast_or_null(Y &Val) {
+  return (Val && isa<X>(Val)) ? cast<X>(Val) : nullptr;
+}
+
+template <class X, class Y>
+ inline typename cast_retty<X, Y *>::ret_type
+dyn_cast_or_null(Y *Val) {
+  return (Val && isa<X>(Val)) ? cast<X>(Val) : nullptr;
+}
+
+
+
+
+
+
+template <class X, class Y>
+ inline auto unique_dyn_cast(std::unique_ptr<Y> &Val)
+    -> decltype(cast<X>(Val)) {
+  if (!isa<X>(Val))
+    return nullptr;
+  return cast<X>(std::move(Val));
+}
+
+template <class X, class Y>
+ inline auto unique_dyn_cast(std::unique_ptr<Y> &&Val)
+    -> decltype(cast<X>(Val)) {
+  return unique_dyn_cast<X, Y>(Val);
+}
+
+
+
+template <class X, class Y>
+ inline auto unique_dyn_cast_or_null(std::unique_ptr<Y> &Val)
+    -> decltype(cast<X>(Val)) {
+  if (!Val)
+    return nullptr;
+  return unique_dyn_cast<X, Y>(Val);
+}
+
+template <class X, class Y>
+ inline auto unique_dyn_cast_or_null(std::unique_ptr<Y> &&Val)
+    -> decltype(cast<X>(Val)) {
+  return unique_dyn_cast_or_null<X, Y>(Val);
+}
+
+}
+
+
+namespace llvm {
+
+template <typename> struct simplify_type;
+class User;
+class Value;
+class Use {
+public:
+  Use(const Use &U) = delete;
+
+
+
+  void swap(Use &RHS);
+
+
+
+  struct UserRefPointerTraits {
+    static inline void *getAsVoidPointer(User *P) { return P; }
+
+    static inline User *getFromVoidPointer(void *P) {
+      return (User *)P;
+    }
+
+    enum { NumLowBitsAvailable = 1 };
+  };
+
+
+
+  using UserRef = PointerIntPair<User *, 1, unsigned, UserRefPointerTraits>;
+
+
+
+  struct PrevPointerTraits {
+    static inline void *getAsVoidPointer(Use **P) { return P; }
+
+    static inline Use **getFromVoidPointer(void *P) {
+      return (Use **)P;
+    }
+
+    enum { NumLowBitsAvailable = 2 };
+  };
+
+private:
+
+  ~Use() {
+    if (Val)
+      removeFromList();
+  }
+
+  enum PrevPtrTag { zeroDigitTag, oneDigitTag, stopTag, fullStopTag };
+
+
+  Use(PrevPtrTag tag) { Prev.setInt(tag); }
+
+public:
+  friend class Value;
+
+  operator Value *() const { return Val; }
+  Value *get() const { return Val; }
+
+
+
+
+
+  User *getUser() const __attribute__((__pure__));
+
+  inline void set(Value *Val);
+
+  inline Value *operator=(Value *RHS);
+  inline const Use &operator=(const Use &RHS);
+
+  Value *operator->() { return Val; }
+  const Value *operator->() const { return Val; }
+
+  Use *getNext() const { return Next; }
+
+
+  unsigned getOperandNo() const;
+
+
+
+
+
+  static Use *initTags(Use *Start, Use *Stop);
+
+
+
+  static void zap(Use *Start, const Use *Stop, bool del = false);
+
+private:
+  const Use *getImpliedUser() const __attribute__((__pure__));
+
+  Value *Val = nullptr;
+  Use *Next;
+  PointerIntPair<Use **, 2, PrevPtrTag, PrevPointerTraits> Prev;
+
+  void setPrev(Use **NewPrev) { Prev.setPointer(NewPrev); }
+
+  void addToList(Use **List) {
+    Next = *List;
+    if (Next)
+      Next->setPrev(&Next);
+    setPrev(List);
+    *List = this;
+  }
+
+  void removeFromList() {
+    Use **StrippedPrev = Prev.getPointer();
+    *StrippedPrev = Next;
+    if (Next)
+      Next->setPrev(StrippedPrev);
+  }
+};
+
+
+
+template <> struct simplify_type<Use> {
+  using SimpleType = Value *;
+
+  static SimpleType getSimplifiedValue(Use &Val) { return Val.get(); }
+};
+template <> struct simplify_type<const Use> {
+  using SimpleType = Value *;
+
+  static SimpleType getSimplifiedValue(const Use &Val) { return Val.get(); }
+};
+
+
+inline Use *unwrap(LLVMUseRef P) { return reinterpret_cast<Use*>(P); } inline LLVMUseRef wrap(const Use *P) { return reinterpret_cast<LLVMUseRef>(const_cast<Use*>(P)); }
+
+}
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+namespace llvm {
+
+class APInt;
+class Argument;
+class BasicBlock;
+class Constant;
+class ConstantData;
+class ConstantAggregate;
+class DataLayout;
+class Function;
+class GlobalAlias;
+class GlobalIFunc;
+class GlobalIndirectSymbol;
+class GlobalObject;
+class GlobalValue;
+class GlobalVariable;
+class InlineAsm;
+class Instruction;
+class LLVMContext;
+class Module;
+class ModuleSlotTracker;
+class raw_ostream;
+template<typename ValueTy> class StringMapEntry;
+class StringRef;
+class Twine;
+class Type;
+class User;
+
+using ValueName = StringMapEntry<Value *>;
+class Value {
+
+
+  Type *VTy;
+  Use *UseList;
+
+  friend class ValueAsMetadata;
+  friend class ValueHandleBase;
+
+  const unsigned char SubclassID;
+  unsigned char HasValueHandle : 1;
+
+protected:
+
+
+
+
+
+  unsigned char SubclassOptionalData : 7;
+
+private:
+
+
+
+
+
+  unsigned short SubclassData;
+
+protected:
+  enum : unsigned { NumUserOperandsBits = 28 };
+  unsigned NumUserOperands : NumUserOperandsBits;
+
+
+  unsigned IsUsedByMD : 1;
+  unsigned HasName : 1;
+  unsigned HasHungOffUses : 1;
+  unsigned HasDescriptor : 1;
+
+private:
+  template <typename UseT>
+  class use_iterator_impl
+      : public std::iterator<std::forward_iterator_tag, UseT *> {
+    friend class Value;
+
+    UseT *U;
+
+    explicit use_iterator_impl(UseT *u) : U(u) {}
+
+  public:
+    use_iterator_impl() : U() {}
+
+    bool operator==(const use_iterator_impl &x) const { return U == x.U; }
+    bool operator!=(const use_iterator_impl &x) const { return !operator==(x); }
+
+    use_iterator_impl &operator++() {
+      
+     ((
+     U && "Cannot increment end iterator!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "U && \"Cannot increment end iterator!\""
+     , "/home/trippels/llvm/llvm/include/llvm/IR/Value.h", 140, __PRETTY_FUNCTION__))
+                                                  ;
+      U = U->getNext();
+      return *this;
+    }
+
+    use_iterator_impl operator++(int) {
+      auto tmp = *this;
+      ++*this;
+      return tmp;
+    }
+
+    UseT &operator*() const {
+      
+     ((
+     U && "Cannot dereference end iterator!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "U && \"Cannot dereference end iterator!\""
+     , "/home/trippels/llvm/llvm/include/llvm/IR/Value.h", 152, __PRETTY_FUNCTION__))
+                                                    ;
+      return *U;
+    }
+
+    UseT *operator->() const { return &operator*(); }
+
+    operator use_iterator_impl<const UseT>() const {
+      return use_iterator_impl<const UseT>(U);
+    }
+  };
+
+  template <typename UserTy>
+  class user_iterator_impl
+      : public std::iterator<std::forward_iterator_tag, UserTy *> {
+    use_iterator_impl<Use> UI;
+    explicit user_iterator_impl(Use *U) : UI(U) {}
+    friend class Value;
+
+  public:
+    user_iterator_impl() = default;
+
+    bool operator==(const user_iterator_impl &x) const { return UI == x.UI; }
+    bool operator!=(const user_iterator_impl &x) const { return !operator==(x); }
+
+
+    bool atEnd() const { return *this == user_iterator_impl(); }
+
+    user_iterator_impl &operator++() {
+      ++UI;
+      return *this;
+    }
+
+    user_iterator_impl operator++(int) {
+      auto tmp = *this;
+      ++*this;
+      return tmp;
+    }
+
+
+    UserTy *operator*() const {
+      return UI->getUser();
+    }
+
+    UserTy *operator->() const { return operator*(); }
+
+    operator user_iterator_impl<const UserTy>() const {
+      return user_iterator_impl<const UserTy>(*UI);
+    }
+
+    Use &getUse() const { return *UI; }
+  };
+
+protected:
+  Value(Type *Ty, unsigned scid);
+
+
+
+
+
+
+  ~Value();
+
+public:
+  Value(const Value &) = delete;
+  Value &operator=(const Value &) = delete;
+
+
+  void deleteValue();
+
+
+  void dump() const;
+
+
+
+  void print(raw_ostream &O, bool IsForDebug = false) const;
+  void print(raw_ostream &O, ModuleSlotTracker &MST,
+             bool IsForDebug = false) const;
+  void printAsOperand(raw_ostream &O, bool PrintType = true,
+                      const Module *M = nullptr) const;
+  void printAsOperand(raw_ostream &O, bool PrintType,
+                      ModuleSlotTracker &MST) const;
+
+
+
+  Type *getType() const { return VTy; }
+
+
+  LLVMContext &getContext() const;
+
+
+  bool hasName() const { return HasName; }
+  ValueName *getValueName() const;
+  void setValueName(ValueName *VN);
+
+private:
+  void destroyValueName();
+  void doRAUW(Value *New, bool NoMetadata);
+  void setNameImpl(const Twine &Name);
+
+public:
+
+
+
+
+
+  StringRef getName() const;
+
+
+
+
+
+
+  void setName(const Twine &Name);
+
+
+
+
+
+
+  void takeName(Value *V);
+
+
+
+
+
+
+  void replaceAllUsesWith(Value *V);
+
+
+
+
+
+  void replaceNonMetadataUsesWith(Value *V);
+
+
+
+
+
+
+  void replaceUsesOutsideBlock(Value *V, BasicBlock *BB);
+
+
+
+
+
+  void replaceUsesExceptBlockAddr(Value *New);
+  void assertModuleIsMaterializedImpl() const;
+
+
+
+  void assertModuleIsMaterialized() const {
+
+    assertModuleIsMaterializedImpl();
+
+  }
+
+  bool use_empty() const {
+    assertModuleIsMaterialized();
+    return UseList == nullptr;
+  }
+
+  bool materialized_use_empty() const {
+    return UseList == nullptr;
+  }
+
+  using use_iterator = use_iterator_impl<Use>;
+  using const_use_iterator = use_iterator_impl<const Use>;
+
+  use_iterator materialized_use_begin() { return use_iterator(UseList); }
+  const_use_iterator materialized_use_begin() const {
+    return const_use_iterator(UseList);
+  }
+  use_iterator use_begin() {
+    assertModuleIsMaterialized();
+    return materialized_use_begin();
+  }
+  const_use_iterator use_begin() const {
+    assertModuleIsMaterialized();
+    return materialized_use_begin();
+  }
+  use_iterator use_end() { return use_iterator(); }
+  const_use_iterator use_end() const { return const_use_iterator(); }
+  iterator_range<use_iterator> materialized_uses() {
+    return make_range(materialized_use_begin(), use_end());
+  }
+  iterator_range<const_use_iterator> materialized_uses() const {
+    return make_range(materialized_use_begin(), use_end());
+  }
+  iterator_range<use_iterator> uses() {
+    assertModuleIsMaterialized();
+    return materialized_uses();
+  }
+  iterator_range<const_use_iterator> uses() const {
+    assertModuleIsMaterialized();
+    return materialized_uses();
+  }
+
+  bool user_empty() const {
+    assertModuleIsMaterialized();
+    return UseList == nullptr;
+  }
+
+  using user_iterator = user_iterator_impl<User>;
+  using const_user_iterator = user_iterator_impl<const User>;
+
+  user_iterator materialized_user_begin() { return user_iterator(UseList); }
+  const_user_iterator materialized_user_begin() const {
+    return const_user_iterator(UseList);
+  }
+  user_iterator user_begin() {
+    assertModuleIsMaterialized();
+    return materialized_user_begin();
+  }
+  const_user_iterator user_begin() const {
+    assertModuleIsMaterialized();
+    return materialized_user_begin();
+  }
+  user_iterator user_end() { return user_iterator(); }
+  const_user_iterator user_end() const { return const_user_iterator(); }
+  User *user_back() {
+    assertModuleIsMaterialized();
+    return *materialized_user_begin();
+  }
+  const User *user_back() const {
+    assertModuleIsMaterialized();
+    return *materialized_user_begin();
+  }
+  iterator_range<user_iterator> materialized_users() {
+    return make_range(materialized_user_begin(), user_end());
+  }
+  iterator_range<const_user_iterator> materialized_users() const {
+    return make_range(materialized_user_begin(), user_end());
+  }
+  iterator_range<user_iterator> users() {
+    assertModuleIsMaterialized();
+    return materialized_users();
+  }
+  iterator_range<const_user_iterator> users() const {
+    assertModuleIsMaterialized();
+    return materialized_users();
+  }
+
+
+
+
+
+  bool hasOneUse() const {
+    const_use_iterator I = use_begin(), E = use_end();
+    if (I == E) return false;
+    return ++I == E;
+  }
+
+
+  bool hasNUses(unsigned N) const;
+
+
+
+
+  bool hasNUsesOrMore(unsigned N) const;
+
+
+  bool isUsedInBasicBlock(const BasicBlock *BB) const;
+
+
+
+
+
+  unsigned getNumUses() const;
+
+
+  void addUse(Use &U) { U.addToList(&UseList); }
+
+
+
+
+
+
+
+  enum ValueTy {
+
+FunctionVal,
+GlobalAliasVal,
+GlobalIFuncVal,
+GlobalVariableVal,
+BlockAddressVal,
+ConstantExprVal,
+
+
+ConstantArrayVal,
+ConstantStructVal,
+ConstantVectorVal,
+
+
+UndefValueVal,
+ConstantAggregateZeroVal,
+ConstantDataArrayVal,
+ConstantDataVectorVal,
+ConstantIntVal,
+ConstantFPVal,
+ConstantPointerNullVal,
+ConstantTokenNoneVal,
+
+
+
+
+
+
+
+
+ArgumentVal,
+BasicBlockVal,
+
+
+MetadataAsValueVal,
+InlineAsmVal,
+
+
+
+
+MemoryUseVal,
+MemoryDefVal,
+MemoryPhiVal,
+
+InstructionVal,
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ConstantFirstVal = FunctionVal,
+ConstantLastVal = ConstantTokenNoneVal,
+ConstantDataFirstVal = UndefValueVal,
+ConstantDataLastVal = ConstantTokenNoneVal,
+ConstantAggregateFirstVal = ConstantArrayVal,
+ConstantAggregateLastVal = ConstantVectorVal,
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  };
+  unsigned getValueID() const {
+    return SubclassID;
+  }
+
+
+
+
+  unsigned getRawSubclassOptionalData() const {
+    return SubclassOptionalData;
+  }
+
+
+  void clearSubclassOptionalData() {
+    SubclassOptionalData = 0;
+  }
+
+
+  bool hasSameSubclassOptionalData(const Value *V) const {
+    return SubclassOptionalData == V->SubclassOptionalData;
+  }
+
+
+  bool hasValueHandle() const { return HasValueHandle; }
+
+
+  bool isUsedByMetadata() const { return IsUsedByMD; }
+
+
+
+
+
+  bool isSwiftError() const;
+
+
+
+
+
+  const Value *stripPointerCasts() const;
+  Value *stripPointerCasts() {
+    return const_cast<Value *>(
+                         static_cast<const Value *>(this)->stripPointerCasts());
+  }
+
+
+
+
+
+
+  const Value *stripPointerCastsAndBarriers() const;
+  Value *stripPointerCastsAndBarriers() {
+    return const_cast<Value *>(
+        static_cast<const Value *>(this)->stripPointerCastsAndBarriers());
+  }
+
+
+
+
+
+  const Value *stripPointerCastsNoFollowAliases() const;
+  Value *stripPointerCastsNoFollowAliases() {
+    return const_cast<Value *>(
+          static_cast<const Value *>(this)->stripPointerCastsNoFollowAliases());
+  }
+
+
+
+
+
+  const Value *stripInBoundsConstantOffsets() const;
+  Value *stripInBoundsConstantOffsets() {
+    return const_cast<Value *>(
+              static_cast<const Value *>(this)->stripInBoundsConstantOffsets());
+  }
+  const Value *stripAndAccumulateInBoundsConstantOffsets(const DataLayout &DL,
+                                                         APInt &Offset) const;
+  Value *stripAndAccumulateInBoundsConstantOffsets(const DataLayout &DL,
+                                                   APInt &Offset) {
+    return const_cast<Value *>(static_cast<const Value *>(this)
+        ->stripAndAccumulateInBoundsConstantOffsets(DL, Offset));
+  }
+
+
+
+
+
+  const Value *stripInBoundsOffsets() const;
+  Value *stripInBoundsOffsets() {
+    return const_cast<Value *>(
+                      static_cast<const Value *>(this)->stripInBoundsOffsets());
+  }
+
+
+
+
+
+
+  uint64_t getPointerDereferenceableBytes(const DataLayout &DL,
+                                          bool &CanBeNull) const;
+
+
+
+
+
+  unsigned getPointerAlignment(const DataLayout &DL) const;
+
+
+
+
+
+
+
+  const Value *DoPHITranslation(const BasicBlock *CurBB,
+                                const BasicBlock *PredBB) const;
+  Value *DoPHITranslation(const BasicBlock *CurBB, const BasicBlock *PredBB) {
+    return const_cast<Value *>(
+             static_cast<const Value *>(this)->DoPHITranslation(CurBB, PredBB));
+  }
+
+
+
+
+
+  static const unsigned MaxAlignmentExponent = 29;
+  static const unsigned MaximumAlignment = 1u << MaxAlignmentExponent;
+
+
+
+
+
+
+
+  void mutateType(Type *Ty) {
+    VTy = Ty;
+  }
+
+
+
+
+
+  template <class Compare> void sortUseList(Compare Cmp);
+
+
+  void reverseUseList();
+
+private:
+  template <class Compare>
+  static Use *mergeUseLists(Use *L, Use *R, Compare Cmp) {
+    Use *Merged;
+    Use **Next = &Merged;
+
+    while (true) {
+      if (!L) {
+        *Next = R;
+        break;
+      }
+      if (!R) {
+        *Next = L;
+        break;
+      }
+      if (Cmp(*R, *L)) {
+        *Next = R;
+        Next = &R->Next;
+        R = R->Next;
+      } else {
+        *Next = L;
+        Next = &L->Next;
+        L = L->Next;
+      }
+    }
+
+    return Merged;
+  }
+
+protected:
+  unsigned short getSubclassDataFromValue() const { return SubclassData; }
+  void setValueSubclassData(unsigned short D) { SubclassData = D; }
+};
+
+struct ValueDeleter { void operator()(Value *V) { V->deleteValue(); } };
+
+
+
+
+using unique_value = std::unique_ptr<Value, ValueDeleter>;
+
+inline raw_ostream &operator<<(raw_ostream &OS, const Value &V) {
+  V.print(OS);
+  return OS;
+}
+
+void Use::set(Value *V) {
+  if (Val) removeFromList();
+  Val = V;
+  if (V) V->addUse(*this);
+}
+
+Value *Use::operator=(Value *RHS) {
+  set(RHS);
+  return RHS;
+}
+
+const Use &Use::operator=(const Use &RHS) {
+  set(RHS.Val);
+  return *this;
+}
+
+template <class Compare> void Value::sortUseList(Compare Cmp) {
+  if (!UseList || !UseList->Next)
+
+    return;
+
+
+
+
+
+
+  const unsigned MaxSlots = 32;
+  Use *Slots[MaxSlots];
+
+
+  Use *Next = UseList->Next;
+  UseList->Next = nullptr;
+  unsigned NumSlots = 1;
+  Slots[0] = UseList;
+
+
+  while (Next->Next) {
+    Use *Current = Next;
+    Next = Current->Next;
+
+
+    Current->Next = nullptr;
+
+
+    unsigned I;
+    for (I = 0; I < NumSlots; ++I) {
+      if (!Slots[I])
+        break;
+
+
+
+
+
+      Current = mergeUseLists(Slots[I], Current, Cmp);
+      Slots[I] = nullptr;
+    }
+
+    if (I == NumSlots) {
+      ++NumSlots;
+      
+     ((
+     NumSlots <= MaxSlots && "Use list bigger than 2^32"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "NumSlots <= MaxSlots && \"Use list bigger than 2^32\""
+     , "/home/trippels/llvm/llvm/include/llvm/IR/Value.h", 734, __PRETTY_FUNCTION__))
+                                                                ;
+    }
+
+
+    Slots[I] = Current;
+  }
+
+
+  
+ ((
+ Next && "Expected one more Use"
+ ) ? static_cast<void> (0) : __assert_fail (
+ "Next && \"Expected one more Use\""
+ , "/home/trippels/llvm/llvm/include/llvm/IR/Value.h", 742, __PRETTY_FUNCTION__))
+                                        ;
+  
+ ((
+ !Next->Next && "Expected only one Use"
+ ) ? static_cast<void> (0) : __assert_fail (
+ "!Next->Next && \"Expected only one Use\""
+ , "/home/trippels/llvm/llvm/include/llvm/IR/Value.h", 743, __PRETTY_FUNCTION__))
+                                               ;
+  UseList = Next;
+  for (unsigned I = 0; I < NumSlots; ++I)
+    if (Slots[I])
+
+
+      UseList = mergeUseLists(Slots[I], UseList, Cmp);
+
+
+  for (Use *I = UseList, **Prev = &UseList; I; I = I->Next) {
+    I->setPrev(Prev);
+    Prev = &I->Next;
+  }
+}
+
+
+
+
+template <> struct isa_impl<Constant, Value> {
+  static inline bool doit(const Value &Val) {
+    static_assert(Value::ConstantFirstVal == 0, "Val.getValueID() >= Value::ConstantFirstVal");
+    return Val.getValueID() <= Value::ConstantLastVal;
+  }
+};
+
+template <> struct isa_impl<ConstantData, Value> {
+  static inline bool doit(const Value &Val) {
+    return Val.getValueID() >= Value::ConstantDataFirstVal &&
+           Val.getValueID() <= Value::ConstantDataLastVal;
+  }
+};
+
+template <> struct isa_impl<ConstantAggregate, Value> {
+  static inline bool doit(const Value &Val) {
+    return Val.getValueID() >= Value::ConstantAggregateFirstVal &&
+           Val.getValueID() <= Value::ConstantAggregateLastVal;
+  }
+};
+
+template <> struct isa_impl<Argument, Value> {
+  static inline bool doit (const Value &Val) {
+    return Val.getValueID() == Value::ArgumentVal;
+  }
+};
+
+template <> struct isa_impl<InlineAsm, Value> {
+  static inline bool doit(const Value &Val) {
+    return Val.getValueID() == Value::InlineAsmVal;
+  }
+};
+
+template <> struct isa_impl<Instruction, Value> {
+  static inline bool doit(const Value &Val) {
+    return Val.getValueID() >= Value::InstructionVal;
+  }
+};
+
+template <> struct isa_impl<BasicBlock, Value> {
+  static inline bool doit(const Value &Val) {
+    return Val.getValueID() == Value::BasicBlockVal;
+  }
+};
+
+template <> struct isa_impl<Function, Value> {
+  static inline bool doit(const Value &Val) {
+    return Val.getValueID() == Value::FunctionVal;
+  }
+};
+
+template <> struct isa_impl<GlobalVariable, Value> {
+  static inline bool doit(const Value &Val) {
+    return Val.getValueID() == Value::GlobalVariableVal;
+  }
+};
+
+template <> struct isa_impl<GlobalAlias, Value> {
+  static inline bool doit(const Value &Val) {
+    return Val.getValueID() == Value::GlobalAliasVal;
+  }
+};
+
+template <> struct isa_impl<GlobalIFunc, Value> {
+  static inline bool doit(const Value &Val) {
+    return Val.getValueID() == Value::GlobalIFuncVal;
+  }
+};
+
+template <> struct isa_impl<GlobalIndirectSymbol, Value> {
+  static inline bool doit(const Value &Val) {
+    return isa<GlobalAlias>(Val) || isa<GlobalIFunc>(Val);
+  }
+};
+
+template <> struct isa_impl<GlobalValue, Value> {
+  static inline bool doit(const Value &Val) {
+    return isa<GlobalObject>(Val) || isa<GlobalIndirectSymbol>(Val);
+  }
+};
+
+template <> struct isa_impl<GlobalObject, Value> {
+  static inline bool doit(const Value &Val) {
+    return isa<GlobalVariable>(Val) || isa<Function>(Val);
+  }
+};
+
+
+inline Value *unwrap(LLVMValueRef P) { return reinterpret_cast<Value*>(P); } inline LLVMValueRef wrap(const Value *P) { return reinterpret_cast<LLVMValueRef>(const_cast<Value*>(P)); } template<typename T> inline T *unwrap(LLVMValueRef P) { return cast<T>(unwrap(P)); }
+
+
+inline Value **unwrap(LLVMValueRef *Vals) {
+  return reinterpret_cast<Value**>(Vals);
+}
+
+template<typename T>
+inline T **unwrap(LLVMValueRef *Vals, unsigned Length) {
+
+  for (LLVMValueRef *I = Vals, *E = Vals + Length; I != E; ++I)
+    unwrap<T>(*I);
+
+  (void)Length;
+  return reinterpret_cast<T**>(Vals);
+}
+
+inline LLVMValueRef *wrap(const Value **Vals) {
+  return reinterpret_cast<LLVMValueRef*>(const_cast<Value**>(Vals));
+}
+
+}
+
+
+
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+
+namespace llvm {
+
+template <typename T> class ArrayRef;
+template <typename T> class MutableArrayRef;
+
+
+
+
+template <class>
+struct OperandTraits;
+
+class User : public Value {
+  template <unsigned>
+  friend struct HungoffOperandTraits;
+
+  __attribute__((always_inline)) inline static void *
+  allocateFixedOperandUser(size_t, unsigned, unsigned);
+
+protected:
+
+
+
+
+  void *operator new(size_t Size);
+
+
+
+
+  void *operator new(size_t Size, unsigned Us);
+  void *operator new(size_t Size, unsigned Us, unsigned DescBytes);
+
+  User(Type *ty, unsigned vty, Use *, unsigned NumOps)
+      : Value(ty, vty) {
+    
+   ((
+   NumOps < (1u << NumUserOperandsBits) && "Too many operands"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "NumOps < (1u << NumUserOperandsBits) && \"Too many operands\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/User.h", 76, __PRETTY_FUNCTION__))
+                                                                      ;
+    NumUserOperands = NumOps;
+
+
+    
+   ((
+   (!HasHungOffUses || !getOperandList()) && "Error in initializing hung off uses for User"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "(!HasHungOffUses || !getOperandList()) && \"Error in initializing hung off uses for User\""
+   ,
+                                                         "/home/trippels/llvm/llvm/include/llvm/IR/User.h"
+    ,
+                                                         81
+    , __PRETTY_FUNCTION__))
+                                                          
+                                                         ;
+  }
+
+
+
+
+
+  void allocHungoffUses(unsigned N, bool IsPhi = false);
+
+
+
+  void growHungoffUses(unsigned N, bool IsPhi = false);
+
+protected:
+  ~User() = default;
+
+public:
+  User(const User &) = delete;
+
+
+  void operator delete(void *Usr);
+
+  void operator delete(void*, unsigned) {
+    ::llvm::llvm_unreachable_internal("Constructor throws?", "/home/trippels/llvm/llvm/include/llvm/IR/User.h", 104);
+  }
+
+  void operator delete(void*, unsigned, bool) {
+    ::llvm::llvm_unreachable_internal("Constructor throws?", "/home/trippels/llvm/llvm/include/llvm/IR/User.h", 108);
+  }
+
+protected:
+  template <int Idx, typename U> static Use &OpFrom(const U *that) {
+    return Idx < 0
+      ? OperandTraits<U>::op_end(const_cast<U*>(that))[Idx]
+      : OperandTraits<U>::op_begin(const_cast<U*>(that))[Idx];
+  }
+
+  template <int Idx> Use &Op() {
+    return OpFrom<Idx>(this);
+  }
+  template <int Idx> const Use &Op() const {
+    return OpFrom<Idx>(this);
+  }
+
+private:
+  const Use *getHungOffOperands() const {
+    return *(reinterpret_cast<const Use *const *>(this) - 1);
+  }
+
+  Use *&getHungOffOperands() { return *(reinterpret_cast<Use **>(this) - 1); }
+
+  const Use *getIntrusiveOperands() const {
+    return reinterpret_cast<const Use *>(this) - NumUserOperands;
+  }
+
+  Use *getIntrusiveOperands() {
+    return reinterpret_cast<Use *>(this) - NumUserOperands;
+  }
+
+  void setOperandList(Use *NewList) {
+    
+   ((
+   HasHungOffUses && "Setting operand list only required for hung off uses"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "HasHungOffUses && \"Setting operand list only required for hung off uses\""
+   ,
+                                                                 "/home/trippels/llvm/llvm/include/llvm/IR/User.h"
+    ,
+                                                                 142
+    , __PRETTY_FUNCTION__))
+                                                                  
+                                                                 ;
+    getHungOffOperands() = NewList;
+  }
+
+public:
+  const Use *getOperandList() const {
+    return HasHungOffUses ? getHungOffOperands() : getIntrusiveOperands();
+  }
+  Use *getOperandList() {
+    return const_cast<Use *>(static_cast<const User *>(this)->getOperandList());
+  }
+
+  Value *getOperand(unsigned i) const {
+    
+   ((
+   i < NumUserOperands && "getOperand() out of range!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "i < NumUserOperands && \"getOperand() out of range!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/User.h", 155, __PRETTY_FUNCTION__))
+                                                              ;
+    return getOperandList()[i];
+  }
+
+  void setOperand(unsigned i, Value *Val) {
+    
+   ((
+   i < NumUserOperands && "setOperand() out of range!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "i < NumUserOperands && \"setOperand() out of range!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/User.h", 160, __PRETTY_FUNCTION__))
+                                                              ;
+    
+   ((
+   (!isa<Constant>((const Value*)this) || isa<GlobalValue>((const Value*)this)) && "Cannot mutate a constant with setOperand!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "(!isa<Constant>((const Value*)this) || isa<GlobalValue>((const Value*)this)) && \"Cannot mutate a constant with setOperand!\""
+   ,
+
+                                                      "/home/trippels/llvm/llvm/include/llvm/IR/User.h"
+    ,
+
+                                                      163
+    , __PRETTY_FUNCTION__))
+
+                                                       
+                                                      ;
+    getOperandList()[i] = Val;
+  }
+
+  const Use &getOperandUse(unsigned i) const {
+    
+   ((
+   i < NumUserOperands && "getOperandUse() out of range!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "i < NumUserOperands && \"getOperandUse() out of range!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/User.h", 168, __PRETTY_FUNCTION__))
+                                                                 ;
+    return getOperandList()[i];
+  }
+  Use &getOperandUse(unsigned i) {
+    
+   ((
+   i < NumUserOperands && "getOperandUse() out of range!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "i < NumUserOperands && \"getOperandUse() out of range!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/User.h", 172, __PRETTY_FUNCTION__))
+                                                                 ;
+    return getOperandList()[i];
+  }
+
+  unsigned getNumOperands() const { return NumUserOperands; }
+
+
+  ArrayRef<const uint8_t> getDescriptor() const;
+
+
+  MutableArrayRef<uint8_t> getDescriptor();
+  void setGlobalVariableNumOperands(unsigned NumOps) {
+    
+   ((
+   NumOps <= 1 && "GlobalVariable can only have 0 or 1 operands"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "NumOps <= 1 && \"GlobalVariable can only have 0 or 1 operands\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/User.h", 193, __PRETTY_FUNCTION__))
+                                                                        ;
+    NumUserOperands = NumOps;
+  }
+
+
+
+
+  void setNumHungOffUseOperands(unsigned NumOps) {
+    
+   ((
+   HasHungOffUses && "Must have hung off uses to use this method"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "HasHungOffUses && \"Must have hung off uses to use this method\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/User.h", 201, __PRETTY_FUNCTION__))
+                                                                         ;
+    
+   ((
+   NumOps < (1u << NumUserOperandsBits) && "Too many operands"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "NumOps < (1u << NumUserOperandsBits) && \"Too many operands\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/User.h", 202, __PRETTY_FUNCTION__))
+                                                                      ;
+    NumUserOperands = NumOps;
+  }
+
+
+
+
+  using op_iterator = Use*;
+  using const_op_iterator = const Use*;
+  using op_range = iterator_range<op_iterator>;
+  using const_op_range = iterator_range<const_op_iterator>;
+
+  op_iterator op_begin() { return getOperandList(); }
+  const_op_iterator op_begin() const { return getOperandList(); }
+  op_iterator op_end() {
+    return getOperandList() + NumUserOperands;
+  }
+  const_op_iterator op_end() const {
+    return getOperandList() + NumUserOperands;
+  }
+  op_range operands() {
+    return op_range(op_begin(), op_end());
+  }
+  const_op_range operands() const {
+    return const_op_range(op_begin(), op_end());
+  }
+
+
+  struct value_op_iterator
+      : iterator_adaptor_base<value_op_iterator, op_iterator,
+                              std::random_access_iterator_tag, Value *,
+                              ptrdiff_t, Value *, Value *> {
+    explicit value_op_iterator(Use *U = nullptr) : iterator_adaptor_base(U) {}
+
+    Value *operator*() const { return *I; }
+    Value *operator->() const { return operator*(); }
+  };
+
+  value_op_iterator value_op_begin() {
+    return value_op_iterator(op_begin());
+  }
+  value_op_iterator value_op_end() {
+    return value_op_iterator(op_end());
+  }
+  iterator_range<value_op_iterator> operand_values() {
+    return make_range(value_op_begin(), value_op_end());
+  }
+
+  struct const_value_op_iterator
+      : iterator_adaptor_base<const_value_op_iterator, const_op_iterator,
+                              std::random_access_iterator_tag, const Value *,
+                              ptrdiff_t, const Value *, const Value *> {
+    explicit const_value_op_iterator(const Use *U = nullptr) :
+      iterator_adaptor_base(U) {}
+
+    const Value *operator*() const { return *I; }
+    const Value *operator->() const { return operator*(); }
+  };
+
+  const_value_op_iterator value_op_begin() const {
+    return const_value_op_iterator(op_begin());
+  }
+  const_value_op_iterator value_op_end() const {
+    return const_value_op_iterator(op_end());
+  }
+  iterator_range<const_value_op_iterator> operand_values() const {
+    return make_range(value_op_begin(), value_op_end());
+  }
+  void dropAllReferences() {
+    for (Use &U : operands())
+      U.set(nullptr);
+  }
+
+
+
+
+
+  void replaceUsesOfWith(Value *From, Value *To);
+
+
+  static bool classof(const Value *V) {
+    return isa<Instruction>(V) || isa<Constant>(V);
+  }
+};
+
+
+static_assert(alignof(Use) >= alignof(User),
+              "Alignment is insufficient after objects prepended to User");
+static_assert(alignof(Use *) >= alignof(User),
+              "Alignment is insufficient after objects prepended to User");
+
+template<> struct simplify_type<User::op_iterator> {
+  using SimpleType = Value*;
+
+  static SimpleType getSimplifiedValue(User::op_iterator &Val) {
+    return Val->get();
+  }
+};
+template<> struct simplify_type<User::const_op_iterator> {
+  using SimpleType = Value*;
+
+  static SimpleType getSimplifiedValue(User::const_op_iterator &Val) {
+    return Val->get();
+  }
+};
+
+}
+
+
+
+namespace llvm {
+
+class APInt;
+class Constant : public User {
+protected:
+  Constant(Type *ty, ValueTy vty, Use *Ops, unsigned NumOps)
+    : User(ty, vty, Ops, NumOps) {}
+
+public:
+  void operator=(const Constant &) = delete;
+  Constant(const Constant &) = delete;
+
+
+  bool isNullValue() const;
+
+
+  bool isOneValue() const;
+
+
+
+  bool isAllOnesValue() const;
+
+
+
+  bool isNegativeZeroValue() const;
+
+
+  bool isZeroValue() const;
+
+
+  bool isNotMinSignedValue() const;
+
+
+  bool isMinSignedValue() const;
+
+
+
+  bool canTrap() const;
+
+
+  bool isThreadDependent() const;
+
+
+  bool isDLLImportDependent() const;
+
+
+
+  bool isConstantUsed() const;
+
+
+
+
+
+
+  bool needsRelocation() const;
+
+
+
+
+  Constant *getAggregateElement(unsigned Elt) const;
+  Constant *getAggregateElement(Constant *Elt) const;
+
+
+
+  Constant *getSplatValue() const;
+
+
+
+  const APInt &getUniqueInteger() const;
+  void destroyConstant();
+
+
+  static bool classof(const Value *V) {
+    static_assert(ConstantFirstVal == 0, "V->getValueID() >= ConstantFirstVal always succeeds");
+    return V->getValueID() <= ConstantLastVal;
+  }
+  void handleOperandChange(Value *, Value *);
+
+  static Constant *getNullValue(Type* Ty);
+
+
+
+
+  static Constant *getAllOnesValue(Type* Ty);
+
+
+
+  static Constant *getIntegerValue(Type *Ty, const APInt &V);
+
+
+
+
+
+  void removeDeadConstantUsers() const;
+
+  const Constant *stripPointerCasts() const {
+    return cast<Constant>(Value::stripPointerCasts());
+  }
+
+  Constant *stripPointerCasts() {
+    return const_cast<Constant*>(
+                      static_cast<const Constant *>(this)->stripPointerCasts());
+  }
+};
+
+}
+namespace llvm {
+class DiagnosticInfo;
+
+
+
+
+
+struct DiagnosticHandler {
+  void *DiagnosticContext = nullptr;
+  DiagnosticHandler(void *DiagContext = nullptr)
+      : DiagnosticContext(DiagContext) {}
+  virtual ~DiagnosticHandler() = default;
+
+  using DiagnosticHandlerTy = void (*)(const DiagnosticInfo &DI, void *Context);
+
+
+
+
+
+  DiagnosticHandlerTy DiagHandlerCallback = nullptr;
+
+
+
+
+
+  virtual bool handleDiagnostics(const DiagnosticInfo &DI) {
+    if (DiagHandlerCallback) {
+      DiagHandlerCallback(DI, DiagnosticContext);
+      return true;
+    }
+    return false;
+  }
+
+
+
+  virtual bool isAnalysisRemarkEnabled(StringRef PassName) const;
+
+
+
+  virtual bool isMissedOptRemarkEnabled(StringRef PassName) const;
+
+
+
+  virtual bool isPassedOptRemarkEnabled(StringRef PassName) const;
+
+
+  bool isAnyRemarkEnabled(StringRef PassName) const {
+    return (isMissedOptRemarkEnabled(PassName) ||
+            isPassedOptRemarkEnabled(PassName) ||
+            isAnalysisRemarkEnabled(PassName));
+  }
+
+
+  virtual bool isAnyRemarkEnabled() const;
+};
+}
+
+       
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+  template<typename _Tp>
+    struct atomic;
+
+
+
+  template<>
+  struct atomic<bool>
+  {
+  private:
+    __atomic_base<bool> _M_base;
+
+  public:
+    atomic() noexcept = default;
+    ~atomic() noexcept = default;
+    atomic(const atomic&) = delete;
+    atomic& operator=(const atomic&) = delete;
+    atomic& operator=(const atomic&) volatile = delete;
+
+    constexpr atomic(bool __i) noexcept : _M_base(__i) { }
+
+    bool
+    operator=(bool __i) noexcept
+    { return _M_base.operator=(__i); }
+
+    bool
+    operator=(bool __i) volatile noexcept
+    { return _M_base.operator=(__i); }
+
+    operator bool() const noexcept
+    { return _M_base.load(); }
+
+    operator bool() const volatile noexcept
+    { return _M_base.load(); }
+
+    bool
+    is_lock_free() const noexcept { return _M_base.is_lock_free(); }
+
+    bool
+    is_lock_free() const volatile noexcept { return _M_base.is_lock_free(); }
+
+
+
+
+
+    void
+    store(bool __i, memory_order __m = memory_order_seq_cst) noexcept
+    { _M_base.store(__i, __m); }
+
+    void
+    store(bool __i, memory_order __m = memory_order_seq_cst) volatile noexcept
+    { _M_base.store(__i, __m); }
+
+    bool
+    load(memory_order __m = memory_order_seq_cst) const noexcept
+    { return _M_base.load(__m); }
+
+    bool
+    load(memory_order __m = memory_order_seq_cst) const volatile noexcept
+    { return _M_base.load(__m); }
+
+    bool
+    exchange(bool __i, memory_order __m = memory_order_seq_cst) noexcept
+    { return _M_base.exchange(__i, __m); }
+
+    bool
+    exchange(bool __i,
+      memory_order __m = memory_order_seq_cst) volatile noexcept
+    { return _M_base.exchange(__i, __m); }
+
+    bool
+    compare_exchange_weak(bool& __i1, bool __i2, memory_order __m1,
+     memory_order __m2) noexcept
+    { return _M_base.compare_exchange_weak(__i1, __i2, __m1, __m2); }
+
+    bool
+    compare_exchange_weak(bool& __i1, bool __i2, memory_order __m1,
+     memory_order __m2) volatile noexcept
+    { return _M_base.compare_exchange_weak(__i1, __i2, __m1, __m2); }
+
+    bool
+    compare_exchange_weak(bool& __i1, bool __i2,
+     memory_order __m = memory_order_seq_cst) noexcept
+    { return _M_base.compare_exchange_weak(__i1, __i2, __m); }
+
+    bool
+    compare_exchange_weak(bool& __i1, bool __i2,
+       memory_order __m = memory_order_seq_cst) volatile noexcept
+    { return _M_base.compare_exchange_weak(__i1, __i2, __m); }
+
+    bool
+    compare_exchange_strong(bool& __i1, bool __i2, memory_order __m1,
+       memory_order __m2) noexcept
+    { return _M_base.compare_exchange_strong(__i1, __i2, __m1, __m2); }
+
+    bool
+    compare_exchange_strong(bool& __i1, bool __i2, memory_order __m1,
+       memory_order __m2) volatile noexcept
+    { return _M_base.compare_exchange_strong(__i1, __i2, __m1, __m2); }
+
+    bool
+    compare_exchange_strong(bool& __i1, bool __i2,
+       memory_order __m = memory_order_seq_cst) noexcept
+    { return _M_base.compare_exchange_strong(__i1, __i2, __m); }
+
+    bool
+    compare_exchange_strong(bool& __i1, bool __i2,
+      memory_order __m = memory_order_seq_cst) volatile noexcept
+    { return _M_base.compare_exchange_strong(__i1, __i2, __m); }
+  };
+
+
+
+
+
+
+
+  template<typename _Tp>
+    struct atomic
+    {
+    private:
+
+      static constexpr int _S_min_alignment
+ = (sizeof(_Tp) & (sizeof(_Tp) - 1)) || sizeof(_Tp) > 16
+ ? 0 : sizeof(_Tp);
+
+      static constexpr int _S_alignment
+        = _S_min_alignment > alignof(_Tp) ? _S_min_alignment : alignof(_Tp);
+
+      alignas(_S_alignment) _Tp _M_i;
+
+      static_assert(__is_trivially_copyable(_Tp),
+      "std::atomic requires a trivially copyable type");
+
+      static_assert(sizeof(_Tp) > 0,
+      "Incomplete or zero-sized types are not supported");
+
+    public:
+      atomic() noexcept = default;
+      ~atomic() noexcept = default;
+      atomic(const atomic&) = delete;
+      atomic& operator=(const atomic&) = delete;
+      atomic& operator=(const atomic&) volatile = delete;
+
+      constexpr atomic(_Tp __i) noexcept : _M_i(__i) { }
+
+      operator _Tp() const noexcept
+      { return load(); }
+
+      operator _Tp() const volatile noexcept
+      { return load(); }
+
+      _Tp
+      operator=(_Tp __i) noexcept
+      { store(__i); return __i; }
+
+      _Tp
+      operator=(_Tp __i) volatile noexcept
+      { store(__i); return __i; }
+
+      bool
+      is_lock_free() const noexcept
+      {
+
+ return __atomic_is_lock_free(sizeof(_M_i),
+     reinterpret_cast<void *>(-__alignof(_M_i)));
+      }
+
+      bool
+      is_lock_free() const volatile noexcept
+      {
+
+ return __atomic_is_lock_free(sizeof(_M_i),
+     reinterpret_cast<void *>(-__alignof(_M_i)));
+      }
+
+
+
+
+
+
+      void
+      store(_Tp __i, memory_order __m = memory_order_seq_cst) noexcept
+      { __atomic_store(std::__addressof(_M_i), std::__addressof(__i), __m); }
+
+      void
+      store(_Tp __i, memory_order __m = memory_order_seq_cst) volatile noexcept
+      { __atomic_store(std::__addressof(_M_i), std::__addressof(__i), __m); }
+
+      _Tp
+      load(memory_order __m = memory_order_seq_cst) const noexcept
+      {
+ alignas(_Tp) unsigned char __buf[sizeof(_Tp)];
+ _Tp* __ptr = reinterpret_cast<_Tp*>(__buf);
+ __atomic_load(std::__addressof(_M_i), __ptr, __m);
+ return *__ptr;
+      }
+
+      _Tp
+      load(memory_order __m = memory_order_seq_cst) const volatile noexcept
+      {
+        alignas(_Tp) unsigned char __buf[sizeof(_Tp)];
+ _Tp* __ptr = reinterpret_cast<_Tp*>(__buf);
+ __atomic_load(std::__addressof(_M_i), __ptr, __m);
+ return *__ptr;
+      }
+
+      _Tp
+      exchange(_Tp __i, memory_order __m = memory_order_seq_cst) noexcept
+      {
+        alignas(_Tp) unsigned char __buf[sizeof(_Tp)];
+ _Tp* __ptr = reinterpret_cast<_Tp*>(__buf);
+ __atomic_exchange(std::__addressof(_M_i), std::__addressof(__i),
+     __ptr, __m);
+ return *__ptr;
+      }
+
+      _Tp
+      exchange(_Tp __i,
+        memory_order __m = memory_order_seq_cst) volatile noexcept
+      {
+        alignas(_Tp) unsigned char __buf[sizeof(_Tp)];
+ _Tp* __ptr = reinterpret_cast<_Tp*>(__buf);
+ __atomic_exchange(std::__addressof(_M_i), std::__addressof(__i),
+     __ptr, __m);
+ return *__ptr;
+      }
+
+      bool
+      compare_exchange_weak(_Tp& __e, _Tp __i, memory_order __s,
+       memory_order __f) noexcept
+      {
+ return __atomic_compare_exchange(std::__addressof(_M_i),
+      std::__addressof(__e),
+      std::__addressof(__i),
+      true, __s, __f);
+      }
+
+      bool
+      compare_exchange_weak(_Tp& __e, _Tp __i, memory_order __s,
+       memory_order __f) volatile noexcept
+      {
+ return __atomic_compare_exchange(std::__addressof(_M_i),
+      std::__addressof(__e),
+      std::__addressof(__i),
+      true, __s, __f);
+      }
+
+      bool
+      compare_exchange_weak(_Tp& __e, _Tp __i,
+       memory_order __m = memory_order_seq_cst) noexcept
+      { return compare_exchange_weak(__e, __i, __m,
+                                     __cmpexch_failure_order(__m)); }
+
+      bool
+      compare_exchange_weak(_Tp& __e, _Tp __i,
+       memory_order __m = memory_order_seq_cst) volatile noexcept
+      { return compare_exchange_weak(__e, __i, __m,
+                                     __cmpexch_failure_order(__m)); }
+
+      bool
+      compare_exchange_strong(_Tp& __e, _Tp __i, memory_order __s,
+         memory_order __f) noexcept
+      {
+ return __atomic_compare_exchange(std::__addressof(_M_i),
+      std::__addressof(__e),
+      std::__addressof(__i),
+      false, __s, __f);
+      }
+
+      bool
+      compare_exchange_strong(_Tp& __e, _Tp __i, memory_order __s,
+         memory_order __f) volatile noexcept
+      {
+ return __atomic_compare_exchange(std::__addressof(_M_i),
+      std::__addressof(__e),
+      std::__addressof(__i),
+      false, __s, __f);
+      }
+
+      bool
+      compare_exchange_strong(_Tp& __e, _Tp __i,
+          memory_order __m = memory_order_seq_cst) noexcept
+      { return compare_exchange_strong(__e, __i, __m,
+                                       __cmpexch_failure_order(__m)); }
+
+      bool
+      compare_exchange_strong(_Tp& __e, _Tp __i,
+       memory_order __m = memory_order_seq_cst) volatile noexcept
+      { return compare_exchange_strong(__e, __i, __m,
+                                       __cmpexch_failure_order(__m)); }
+    };
+
+
+
+  template<typename _Tp>
+    struct atomic<_Tp*>
+    {
+      typedef _Tp* __pointer_type;
+      typedef __atomic_base<_Tp*> __base_type;
+      __base_type _M_b;
+
+      atomic() noexcept = default;
+      ~atomic() noexcept = default;
+      atomic(const atomic&) = delete;
+      atomic& operator=(const atomic&) = delete;
+      atomic& operator=(const atomic&) volatile = delete;
+
+      constexpr atomic(__pointer_type __p) noexcept : _M_b(__p) { }
+
+      operator __pointer_type() const noexcept
+      { return __pointer_type(_M_b); }
+
+      operator __pointer_type() const volatile noexcept
+      { return __pointer_type(_M_b); }
+
+      __pointer_type
+      operator=(__pointer_type __p) noexcept
+      { return _M_b.operator=(__p); }
+
+      __pointer_type
+      operator=(__pointer_type __p) volatile noexcept
+      { return _M_b.operator=(__p); }
+
+      __pointer_type
+      operator++(int) noexcept
+      { return _M_b++; }
+
+      __pointer_type
+      operator++(int) volatile noexcept
+      { return _M_b++; }
+
+      __pointer_type
+      operator--(int) noexcept
+      { return _M_b--; }
+
+      __pointer_type
+      operator--(int) volatile noexcept
+      { return _M_b--; }
+
+      __pointer_type
+      operator++() noexcept
+      { return ++_M_b; }
+
+      __pointer_type
+      operator++() volatile noexcept
+      { return ++_M_b; }
+
+      __pointer_type
+      operator--() noexcept
+      { return --_M_b; }
+
+      __pointer_type
+      operator--() volatile noexcept
+      { return --_M_b; }
+
+      __pointer_type
+      operator+=(ptrdiff_t __d) noexcept
+      { return _M_b.operator+=(__d); }
+
+      __pointer_type
+      operator+=(ptrdiff_t __d) volatile noexcept
+      { return _M_b.operator+=(__d); }
+
+      __pointer_type
+      operator-=(ptrdiff_t __d) noexcept
+      { return _M_b.operator-=(__d); }
+
+      __pointer_type
+      operator-=(ptrdiff_t __d) volatile noexcept
+      { return _M_b.operator-=(__d); }
+
+      bool
+      is_lock_free() const noexcept
+      { return _M_b.is_lock_free(); }
+
+      bool
+      is_lock_free() const volatile noexcept
+      { return _M_b.is_lock_free(); }
+
+
+
+
+
+      void
+      store(__pointer_type __p,
+     memory_order __m = memory_order_seq_cst) noexcept
+      { return _M_b.store(__p, __m); }
+
+      void
+      store(__pointer_type __p,
+     memory_order __m = memory_order_seq_cst) volatile noexcept
+      { return _M_b.store(__p, __m); }
+
+      __pointer_type
+      load(memory_order __m = memory_order_seq_cst) const noexcept
+      { return _M_b.load(__m); }
+
+      __pointer_type
+      load(memory_order __m = memory_order_seq_cst) const volatile noexcept
+      { return _M_b.load(__m); }
+
+      __pointer_type
+      exchange(__pointer_type __p,
+        memory_order __m = memory_order_seq_cst) noexcept
+      { return _M_b.exchange(__p, __m); }
+
+      __pointer_type
+      exchange(__pointer_type __p,
+        memory_order __m = memory_order_seq_cst) volatile noexcept
+      { return _M_b.exchange(__p, __m); }
+
+      bool
+      compare_exchange_weak(__pointer_type& __p1, __pointer_type __p2,
+       memory_order __m1, memory_order __m2) noexcept
+      { return _M_b.compare_exchange_strong(__p1, __p2, __m1, __m2); }
+
+      bool
+      compare_exchange_weak(__pointer_type& __p1, __pointer_type __p2,
+       memory_order __m1,
+       memory_order __m2) volatile noexcept
+      { return _M_b.compare_exchange_strong(__p1, __p2, __m1, __m2); }
+
+      bool
+      compare_exchange_weak(__pointer_type& __p1, __pointer_type __p2,
+       memory_order __m = memory_order_seq_cst) noexcept
+      {
+ return compare_exchange_weak(__p1, __p2, __m,
+         __cmpexch_failure_order(__m));
+      }
+
+      bool
+      compare_exchange_weak(__pointer_type& __p1, __pointer_type __p2,
+      memory_order __m = memory_order_seq_cst) volatile noexcept
+      {
+ return compare_exchange_weak(__p1, __p2, __m,
+         __cmpexch_failure_order(__m));
+      }
+
+      bool
+      compare_exchange_strong(__pointer_type& __p1, __pointer_type __p2,
+         memory_order __m1, memory_order __m2) noexcept
+      { return _M_b.compare_exchange_strong(__p1, __p2, __m1, __m2); }
+
+      bool
+      compare_exchange_strong(__pointer_type& __p1, __pointer_type __p2,
+         memory_order __m1,
+         memory_order __m2) volatile noexcept
+      { return _M_b.compare_exchange_strong(__p1, __p2, __m1, __m2); }
+
+      bool
+      compare_exchange_strong(__pointer_type& __p1, __pointer_type __p2,
+         memory_order __m = memory_order_seq_cst) noexcept
+      {
+ return _M_b.compare_exchange_strong(__p1, __p2, __m,
+         __cmpexch_failure_order(__m));
+      }
+
+      bool
+      compare_exchange_strong(__pointer_type& __p1, __pointer_type __p2,
+      memory_order __m = memory_order_seq_cst) volatile noexcept
+      {
+ return _M_b.compare_exchange_strong(__p1, __p2, __m,
+         __cmpexch_failure_order(__m));
+      }
+
+      __pointer_type
+      fetch_add(ptrdiff_t __d,
+  memory_order __m = memory_order_seq_cst) noexcept
+      { return _M_b.fetch_add(__d, __m); }
+
+      __pointer_type
+      fetch_add(ptrdiff_t __d,
+  memory_order __m = memory_order_seq_cst) volatile noexcept
+      { return _M_b.fetch_add(__d, __m); }
+
+      __pointer_type
+      fetch_sub(ptrdiff_t __d,
+  memory_order __m = memory_order_seq_cst) noexcept
+      { return _M_b.fetch_sub(__d, __m); }
+
+      __pointer_type
+      fetch_sub(ptrdiff_t __d,
+  memory_order __m = memory_order_seq_cst) volatile noexcept
+      { return _M_b.fetch_sub(__d, __m); }
+    };
+
+
+
+  template<>
+    struct atomic<char> : __atomic_base<char>
+    {
+      typedef char __integral_type;
+      typedef __atomic_base<char> __base_type;
+
+      atomic() noexcept = default;
+      ~atomic() noexcept = default;
+      atomic(const atomic&) = delete;
+      atomic& operator=(const atomic&) = delete;
+      atomic& operator=(const atomic&) volatile = delete;
+
+      constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
+
+      using __base_type::operator __integral_type;
+      using __base_type::operator=;
+
+
+
+
+    };
+
+
+  template<>
+    struct atomic<signed char> : __atomic_base<signed char>
+    {
+      typedef signed char __integral_type;
+      typedef __atomic_base<signed char> __base_type;
+
+      atomic() noexcept= default;
+      ~atomic() noexcept = default;
+      atomic(const atomic&) = delete;
+      atomic& operator=(const atomic&) = delete;
+      atomic& operator=(const atomic&) volatile = delete;
+
+      constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
+
+      using __base_type::operator __integral_type;
+      using __base_type::operator=;
+
+
+
+
+    };
+
+
+  template<>
+    struct atomic<unsigned char> : __atomic_base<unsigned char>
+    {
+      typedef unsigned char __integral_type;
+      typedef __atomic_base<unsigned char> __base_type;
+
+      atomic() noexcept= default;
+      ~atomic() noexcept = default;
+      atomic(const atomic&) = delete;
+      atomic& operator=(const atomic&) = delete;
+      atomic& operator=(const atomic&) volatile = delete;
+
+      constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
+
+      using __base_type::operator __integral_type;
+      using __base_type::operator=;
+
+
+
+
+    };
+
+
+  template<>
+    struct atomic<short> : __atomic_base<short>
+    {
+      typedef short __integral_type;
+      typedef __atomic_base<short> __base_type;
+
+      atomic() noexcept = default;
+      ~atomic() noexcept = default;
+      atomic(const atomic&) = delete;
+      atomic& operator=(const atomic&) = delete;
+      atomic& operator=(const atomic&) volatile = delete;
+
+      constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
+
+      using __base_type::operator __integral_type;
+      using __base_type::operator=;
+
+
+
+
+    };
+
+
+  template<>
+    struct atomic<unsigned short> : __atomic_base<unsigned short>
+    {
+      typedef unsigned short __integral_type;
+      typedef __atomic_base<unsigned short> __base_type;
+
+      atomic() noexcept = default;
+      ~atomic() noexcept = default;
+      atomic(const atomic&) = delete;
+      atomic& operator=(const atomic&) = delete;
+      atomic& operator=(const atomic&) volatile = delete;
+
+      constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
+
+      using __base_type::operator __integral_type;
+      using __base_type::operator=;
+
+
+
+
+    };
+
+
+  template<>
+    struct atomic<int> : __atomic_base<int>
+    {
+      typedef int __integral_type;
+      typedef __atomic_base<int> __base_type;
+
+      atomic() noexcept = default;
+      ~atomic() noexcept = default;
+      atomic(const atomic&) = delete;
+      atomic& operator=(const atomic&) = delete;
+      atomic& operator=(const atomic&) volatile = delete;
+
+      constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
+
+      using __base_type::operator __integral_type;
+      using __base_type::operator=;
+
+
+
+
+    };
+
+
+  template<>
+    struct atomic<unsigned int> : __atomic_base<unsigned int>
+    {
+      typedef unsigned int __integral_type;
+      typedef __atomic_base<unsigned int> __base_type;
+
+      atomic() noexcept = default;
+      ~atomic() noexcept = default;
+      atomic(const atomic&) = delete;
+      atomic& operator=(const atomic&) = delete;
+      atomic& operator=(const atomic&) volatile = delete;
+
+      constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
+
+      using __base_type::operator __integral_type;
+      using __base_type::operator=;
+
+
+
+
+    };
+
+
+  template<>
+    struct atomic<long> : __atomic_base<long>
+    {
+      typedef long __integral_type;
+      typedef __atomic_base<long> __base_type;
+
+      atomic() noexcept = default;
+      ~atomic() noexcept = default;
+      atomic(const atomic&) = delete;
+      atomic& operator=(const atomic&) = delete;
+      atomic& operator=(const atomic&) volatile = delete;
+
+      constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
+
+      using __base_type::operator __integral_type;
+      using __base_type::operator=;
+
+
+
+
+    };
+
+
+  template<>
+    struct atomic<unsigned long> : __atomic_base<unsigned long>
+    {
+      typedef unsigned long __integral_type;
+      typedef __atomic_base<unsigned long> __base_type;
+
+      atomic() noexcept = default;
+      ~atomic() noexcept = default;
+      atomic(const atomic&) = delete;
+      atomic& operator=(const atomic&) = delete;
+      atomic& operator=(const atomic&) volatile = delete;
+
+      constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
+
+      using __base_type::operator __integral_type;
+      using __base_type::operator=;
+
+
+
+
+    };
+
+
+  template<>
+    struct atomic<long long> : __atomic_base<long long>
+    {
+      typedef long long __integral_type;
+      typedef __atomic_base<long long> __base_type;
+
+      atomic() noexcept = default;
+      ~atomic() noexcept = default;
+      atomic(const atomic&) = delete;
+      atomic& operator=(const atomic&) = delete;
+      atomic& operator=(const atomic&) volatile = delete;
+
+      constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
+
+      using __base_type::operator __integral_type;
+      using __base_type::operator=;
+
+
+
+
+    };
+
+
+  template<>
+    struct atomic<unsigned long long> : __atomic_base<unsigned long long>
+    {
+      typedef unsigned long long __integral_type;
+      typedef __atomic_base<unsigned long long> __base_type;
+
+      atomic() noexcept = default;
+      ~atomic() noexcept = default;
+      atomic(const atomic&) = delete;
+      atomic& operator=(const atomic&) = delete;
+      atomic& operator=(const atomic&) volatile = delete;
+
+      constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
+
+      using __base_type::operator __integral_type;
+      using __base_type::operator=;
+
+
+
+
+    };
+
+
+  template<>
+    struct atomic<wchar_t> : __atomic_base<wchar_t>
+    {
+      typedef wchar_t __integral_type;
+      typedef __atomic_base<wchar_t> __base_type;
+
+      atomic() noexcept = default;
+      ~atomic() noexcept = default;
+      atomic(const atomic&) = delete;
+      atomic& operator=(const atomic&) = delete;
+      atomic& operator=(const atomic&) volatile = delete;
+
+      constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
+
+      using __base_type::operator __integral_type;
+      using __base_type::operator=;
+
+
+
+
+    };
+
+
+  template<>
+    struct atomic<char16_t> : __atomic_base<char16_t>
+    {
+      typedef char16_t __integral_type;
+      typedef __atomic_base<char16_t> __base_type;
+
+      atomic() noexcept = default;
+      ~atomic() noexcept = default;
+      atomic(const atomic&) = delete;
+      atomic& operator=(const atomic&) = delete;
+      atomic& operator=(const atomic&) volatile = delete;
+
+      constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
+
+      using __base_type::operator __integral_type;
+      using __base_type::operator=;
+
+
+
+
+    };
+
+
+  template<>
+    struct atomic<char32_t> : __atomic_base<char32_t>
+    {
+      typedef char32_t __integral_type;
+      typedef __atomic_base<char32_t> __base_type;
+
+      atomic() noexcept = default;
+      ~atomic() noexcept = default;
+      atomic(const atomic&) = delete;
+      atomic& operator=(const atomic&) = delete;
+      atomic& operator=(const atomic&) volatile = delete;
+
+      constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
+
+      using __base_type::operator __integral_type;
+      using __base_type::operator=;
+
+
+
+
+    };
+
+
+
+  typedef atomic<bool> atomic_bool;
+
+
+  typedef atomic<char> atomic_char;
+
+
+  typedef atomic<signed char> atomic_schar;
+
+
+  typedef atomic<unsigned char> atomic_uchar;
+
+
+  typedef atomic<short> atomic_short;
+
+
+  typedef atomic<unsigned short> atomic_ushort;
+
+
+  typedef atomic<int> atomic_int;
+
+
+  typedef atomic<unsigned int> atomic_uint;
+
+
+  typedef atomic<long> atomic_long;
+
+
+  typedef atomic<unsigned long> atomic_ulong;
+
+
+  typedef atomic<long long> atomic_llong;
+
+
+  typedef atomic<unsigned long long> atomic_ullong;
+
+
+  typedef atomic<wchar_t> atomic_wchar_t;
+
+
+  typedef atomic<char16_t> atomic_char16_t;
+
+
+  typedef atomic<char32_t> atomic_char32_t;
+
+
+
+
+
+
+  typedef atomic<int8_t> atomic_int8_t;
+
+
+  typedef atomic<uint8_t> atomic_uint8_t;
+
+
+  typedef atomic<int16_t> atomic_int16_t;
+
+
+  typedef atomic<uint16_t> atomic_uint16_t;
+
+
+  typedef atomic<int32_t> atomic_int32_t;
+
+
+  typedef atomic<uint32_t> atomic_uint32_t;
+
+
+  typedef atomic<int64_t> atomic_int64_t;
+
+
+  typedef atomic<uint64_t> atomic_uint64_t;
+
+
+
+  typedef atomic<int_least8_t> atomic_int_least8_t;
+
+
+  typedef atomic<uint_least8_t> atomic_uint_least8_t;
+
+
+  typedef atomic<int_least16_t> atomic_int_least16_t;
+
+
+  typedef atomic<uint_least16_t> atomic_uint_least16_t;
+
+
+  typedef atomic<int_least32_t> atomic_int_least32_t;
+
+
+  typedef atomic<uint_least32_t> atomic_uint_least32_t;
+
+
+  typedef atomic<int_least64_t> atomic_int_least64_t;
+
+
+  typedef atomic<uint_least64_t> atomic_uint_least64_t;
+
+
+
+  typedef atomic<int_fast8_t> atomic_int_fast8_t;
+
+
+  typedef atomic<uint_fast8_t> atomic_uint_fast8_t;
+
+
+  typedef atomic<int_fast16_t> atomic_int_fast16_t;
+
+
+  typedef atomic<uint_fast16_t> atomic_uint_fast16_t;
+
+
+  typedef atomic<int_fast32_t> atomic_int_fast32_t;
+
+
+  typedef atomic<uint_fast32_t> atomic_uint_fast32_t;
+
+
+  typedef atomic<int_fast64_t> atomic_int_fast64_t;
+
+
+  typedef atomic<uint_fast64_t> atomic_uint_fast64_t;
+
+
+
+
+  typedef atomic<intptr_t> atomic_intptr_t;
+
+
+  typedef atomic<uintptr_t> atomic_uintptr_t;
+
+
+  typedef atomic<size_t> atomic_size_t;
+
+
+  typedef atomic<ptrdiff_t> atomic_ptrdiff_t;
+
+
+
+  typedef atomic<intmax_t> atomic_intmax_t;
+
+
+  typedef atomic<uintmax_t> atomic_uintmax_t;
+
+
+
+  inline bool
+  atomic_flag_test_and_set_explicit(atomic_flag* __a,
+        memory_order __m) noexcept
+  { return __a->test_and_set(__m); }
+
+  inline bool
+  atomic_flag_test_and_set_explicit(volatile atomic_flag* __a,
+        memory_order __m) noexcept
+  { return __a->test_and_set(__m); }
+
+  inline void
+  atomic_flag_clear_explicit(atomic_flag* __a, memory_order __m) noexcept
+  { __a->clear(__m); }
+
+  inline void
+  atomic_flag_clear_explicit(volatile atomic_flag* __a,
+        memory_order __m) noexcept
+  { __a->clear(__m); }
+
+  inline bool
+  atomic_flag_test_and_set(atomic_flag* __a) noexcept
+  { return atomic_flag_test_and_set_explicit(__a, memory_order_seq_cst); }
+
+  inline bool
+  atomic_flag_test_and_set(volatile atomic_flag* __a) noexcept
+  { return atomic_flag_test_and_set_explicit(__a, memory_order_seq_cst); }
+
+  inline void
+  atomic_flag_clear(atomic_flag* __a) noexcept
+  { atomic_flag_clear_explicit(__a, memory_order_seq_cst); }
+
+  inline void
+  atomic_flag_clear(volatile atomic_flag* __a) noexcept
+  { atomic_flag_clear_explicit(__a, memory_order_seq_cst); }
+
+
+
+  template<typename _ITp>
+    inline bool
+    atomic_is_lock_free(const atomic<_ITp>* __a) noexcept
+    { return __a->is_lock_free(); }
+
+  template<typename _ITp>
+    inline bool
+    atomic_is_lock_free(const volatile atomic<_ITp>* __a) noexcept
+    { return __a->is_lock_free(); }
+
+  template<typename _ITp>
+    inline void
+    atomic_init(atomic<_ITp>* __a, _ITp __i) noexcept
+    { __a->store(__i, memory_order_relaxed); }
+
+  template<typename _ITp>
+    inline void
+    atomic_init(volatile atomic<_ITp>* __a, _ITp __i) noexcept
+    { __a->store(__i, memory_order_relaxed); }
+
+  template<typename _ITp>
+    inline void
+    atomic_store_explicit(atomic<_ITp>* __a, _ITp __i,
+     memory_order __m) noexcept
+    { __a->store(__i, __m); }
+
+  template<typename _ITp>
+    inline void
+    atomic_store_explicit(volatile atomic<_ITp>* __a, _ITp __i,
+     memory_order __m) noexcept
+    { __a->store(__i, __m); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_load_explicit(const atomic<_ITp>* __a, memory_order __m) noexcept
+    { return __a->load(__m); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_load_explicit(const volatile atomic<_ITp>* __a,
+    memory_order __m) noexcept
+    { return __a->load(__m); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_exchange_explicit(atomic<_ITp>* __a, _ITp __i,
+        memory_order __m) noexcept
+    { return __a->exchange(__i, __m); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_exchange_explicit(volatile atomic<_ITp>* __a, _ITp __i,
+        memory_order __m) noexcept
+    { return __a->exchange(__i, __m); }
+
+  template<typename _ITp>
+    inline bool
+    atomic_compare_exchange_weak_explicit(atomic<_ITp>* __a,
+       _ITp* __i1, _ITp __i2,
+       memory_order __m1,
+       memory_order __m2) noexcept
+    { return __a->compare_exchange_weak(*__i1, __i2, __m1, __m2); }
+
+  template<typename _ITp>
+    inline bool
+    atomic_compare_exchange_weak_explicit(volatile atomic<_ITp>* __a,
+       _ITp* __i1, _ITp __i2,
+       memory_order __m1,
+       memory_order __m2) noexcept
+    { return __a->compare_exchange_weak(*__i1, __i2, __m1, __m2); }
+
+  template<typename _ITp>
+    inline bool
+    atomic_compare_exchange_strong_explicit(atomic<_ITp>* __a,
+         _ITp* __i1, _ITp __i2,
+         memory_order __m1,
+         memory_order __m2) noexcept
+    { return __a->compare_exchange_strong(*__i1, __i2, __m1, __m2); }
+
+  template<typename _ITp>
+    inline bool
+    atomic_compare_exchange_strong_explicit(volatile atomic<_ITp>* __a,
+         _ITp* __i1, _ITp __i2,
+         memory_order __m1,
+         memory_order __m2) noexcept
+    { return __a->compare_exchange_strong(*__i1, __i2, __m1, __m2); }
+
+
+  template<typename _ITp>
+    inline void
+    atomic_store(atomic<_ITp>* __a, _ITp __i) noexcept
+    { atomic_store_explicit(__a, __i, memory_order_seq_cst); }
+
+  template<typename _ITp>
+    inline void
+    atomic_store(volatile atomic<_ITp>* __a, _ITp __i) noexcept
+    { atomic_store_explicit(__a, __i, memory_order_seq_cst); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_load(const atomic<_ITp>* __a) noexcept
+    { return atomic_load_explicit(__a, memory_order_seq_cst); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_load(const volatile atomic<_ITp>* __a) noexcept
+    { return atomic_load_explicit(__a, memory_order_seq_cst); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_exchange(atomic<_ITp>* __a, _ITp __i) noexcept
+    { return atomic_exchange_explicit(__a, __i, memory_order_seq_cst); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_exchange(volatile atomic<_ITp>* __a, _ITp __i) noexcept
+    { return atomic_exchange_explicit(__a, __i, memory_order_seq_cst); }
+
+  template<typename _ITp>
+    inline bool
+    atomic_compare_exchange_weak(atomic<_ITp>* __a,
+     _ITp* __i1, _ITp __i2) noexcept
+    {
+      return atomic_compare_exchange_weak_explicit(__a, __i1, __i2,
+         memory_order_seq_cst,
+         memory_order_seq_cst);
+    }
+
+  template<typename _ITp>
+    inline bool
+    atomic_compare_exchange_weak(volatile atomic<_ITp>* __a,
+     _ITp* __i1, _ITp __i2) noexcept
+    {
+      return atomic_compare_exchange_weak_explicit(__a, __i1, __i2,
+         memory_order_seq_cst,
+         memory_order_seq_cst);
+    }
+
+  template<typename _ITp>
+    inline bool
+    atomic_compare_exchange_strong(atomic<_ITp>* __a,
+       _ITp* __i1, _ITp __i2) noexcept
+    {
+      return atomic_compare_exchange_strong_explicit(__a, __i1, __i2,
+           memory_order_seq_cst,
+           memory_order_seq_cst);
+    }
+
+  template<typename _ITp>
+    inline bool
+    atomic_compare_exchange_strong(volatile atomic<_ITp>* __a,
+       _ITp* __i1, _ITp __i2) noexcept
+    {
+      return atomic_compare_exchange_strong_explicit(__a, __i1, __i2,
+           memory_order_seq_cst,
+           memory_order_seq_cst);
+    }
+
+
+
+
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_fetch_add_explicit(__atomic_base<_ITp>* __a, _ITp __i,
+         memory_order __m) noexcept
+    { return __a->fetch_add(__i, __m); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_fetch_add_explicit(volatile __atomic_base<_ITp>* __a, _ITp __i,
+         memory_order __m) noexcept
+    { return __a->fetch_add(__i, __m); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_fetch_sub_explicit(__atomic_base<_ITp>* __a, _ITp __i,
+         memory_order __m) noexcept
+    { return __a->fetch_sub(__i, __m); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_fetch_sub_explicit(volatile __atomic_base<_ITp>* __a, _ITp __i,
+         memory_order __m) noexcept
+    { return __a->fetch_sub(__i, __m); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_fetch_and_explicit(__atomic_base<_ITp>* __a, _ITp __i,
+         memory_order __m) noexcept
+    { return __a->fetch_and(__i, __m); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_fetch_and_explicit(volatile __atomic_base<_ITp>* __a, _ITp __i,
+         memory_order __m) noexcept
+    { return __a->fetch_and(__i, __m); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_fetch_or_explicit(__atomic_base<_ITp>* __a, _ITp __i,
+        memory_order __m) noexcept
+    { return __a->fetch_or(__i, __m); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_fetch_or_explicit(volatile __atomic_base<_ITp>* __a, _ITp __i,
+        memory_order __m) noexcept
+    { return __a->fetch_or(__i, __m); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_fetch_xor_explicit(__atomic_base<_ITp>* __a, _ITp __i,
+         memory_order __m) noexcept
+    { return __a->fetch_xor(__i, __m); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_fetch_xor_explicit(volatile __atomic_base<_ITp>* __a, _ITp __i,
+         memory_order __m) noexcept
+    { return __a->fetch_xor(__i, __m); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_fetch_add(__atomic_base<_ITp>* __a, _ITp __i) noexcept
+    { return atomic_fetch_add_explicit(__a, __i, memory_order_seq_cst); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_fetch_add(volatile __atomic_base<_ITp>* __a, _ITp __i) noexcept
+    { return atomic_fetch_add_explicit(__a, __i, memory_order_seq_cst); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_fetch_sub(__atomic_base<_ITp>* __a, _ITp __i) noexcept
+    { return atomic_fetch_sub_explicit(__a, __i, memory_order_seq_cst); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_fetch_sub(volatile __atomic_base<_ITp>* __a, _ITp __i) noexcept
+    { return atomic_fetch_sub_explicit(__a, __i, memory_order_seq_cst); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_fetch_and(__atomic_base<_ITp>* __a, _ITp __i) noexcept
+    { return atomic_fetch_and_explicit(__a, __i, memory_order_seq_cst); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_fetch_and(volatile __atomic_base<_ITp>* __a, _ITp __i) noexcept
+    { return atomic_fetch_and_explicit(__a, __i, memory_order_seq_cst); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_fetch_or(__atomic_base<_ITp>* __a, _ITp __i) noexcept
+    { return atomic_fetch_or_explicit(__a, __i, memory_order_seq_cst); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_fetch_or(volatile __atomic_base<_ITp>* __a, _ITp __i) noexcept
+    { return atomic_fetch_or_explicit(__a, __i, memory_order_seq_cst); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_fetch_xor(__atomic_base<_ITp>* __a, _ITp __i) noexcept
+    { return atomic_fetch_xor_explicit(__a, __i, memory_order_seq_cst); }
+
+  template<typename _ITp>
+    inline _ITp
+    atomic_fetch_xor(volatile __atomic_base<_ITp>* __a, _ITp __i) noexcept
+    { return atomic_fetch_xor_explicit(__a, __i, memory_order_seq_cst); }
+
+
+
+  template<typename _ITp>
+    inline _ITp*
+    atomic_fetch_add_explicit(atomic<_ITp*>* __a, ptrdiff_t __d,
+         memory_order __m) noexcept
+    { return __a->fetch_add(__d, __m); }
+
+  template<typename _ITp>
+    inline _ITp*
+    atomic_fetch_add_explicit(volatile atomic<_ITp*>* __a, ptrdiff_t __d,
+         memory_order __m) noexcept
+    { return __a->fetch_add(__d, __m); }
+
+  template<typename _ITp>
+    inline _ITp*
+    atomic_fetch_add(volatile atomic<_ITp*>* __a, ptrdiff_t __d) noexcept
+    { return __a->fetch_add(__d); }
+
+  template<typename _ITp>
+    inline _ITp*
+    atomic_fetch_add(atomic<_ITp*>* __a, ptrdiff_t __d) noexcept
+    { return __a->fetch_add(__d); }
+
+  template<typename _ITp>
+    inline _ITp*
+    atomic_fetch_sub_explicit(volatile atomic<_ITp*>* __a,
+         ptrdiff_t __d, memory_order __m) noexcept
+    { return __a->fetch_sub(__d, __m); }
+
+  template<typename _ITp>
+    inline _ITp*
+    atomic_fetch_sub_explicit(atomic<_ITp*>* __a, ptrdiff_t __d,
+         memory_order __m) noexcept
+    { return __a->fetch_sub(__d, __m); }
+
+  template<typename _ITp>
+    inline _ITp*
+    atomic_fetch_sub(volatile atomic<_ITp*>* __a, ptrdiff_t __d) noexcept
+    { return __a->fetch_sub(__d); }
+
+  template<typename _ITp>
+    inline _ITp*
+    atomic_fetch_sub(atomic<_ITp*>* __a, ptrdiff_t __d) noexcept
+    { return __a->fetch_sub(__d); }
+
+
+
+}
+
+
+
+namespace llvm {
+
+
+template <class C> struct object_creator {
+  static void *call() { return new C(); }
+};
+
+
+
+template <typename T> struct object_deleter {
+  static void call(void *Ptr) { delete (T *)Ptr; }
+};
+template <typename T, size_t N> struct object_deleter<T[N]> {
+  static void call(void *Ptr) { delete[](T *)Ptr; }
+};
+
+
+class ManagedStaticBase {
+protected:
+
+
+  mutable std::atomic<void *> Ptr;
+  mutable void (*DeleterFn)(void*);
+  mutable const ManagedStaticBase *Next;
+
+  void RegisterManagedStatic(void *(*creator)(), void (*deleter)(void*)) const;
+
+public:
+
+  bool isConstructed() const { return Ptr != nullptr; }
+
+  void destroy() const;
+};
+
+
+
+
+
+
+template <class C, class Creator = object_creator<C>,
+          class Deleter = object_deleter<C>>
+class ManagedStatic : public ManagedStaticBase {
+public:
+
+  C &operator*() {
+    void *Tmp = Ptr.load(std::memory_order_acquire);
+    if (!Tmp)
+      RegisterManagedStatic(Creator::call, Deleter::call);
+
+    return *static_cast<C *>(Ptr.load(std::memory_order_relaxed));
+  }
+
+  C *operator->() { return &**this; }
+
+  const C &operator*() const {
+    void *Tmp = Ptr.load(std::memory_order_acquire);
+    if (!Tmp)
+      RegisterManagedStatic(Creator::call, Deleter::call);
+
+    return *static_cast<C *>(Ptr.load(std::memory_order_relaxed));
+  }
+
+  const C *operator->() const { return &**this; }
+};
+
+
+void llvm_shutdown();
+
+
+
+struct llvm_shutdown_obj {
+  llvm_shutdown_obj() = default;
+  ~llvm_shutdown_obj() { llvm_shutdown(); }
+};
+
+}
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+       
+
+
+
+
+
+
+
+
+
+
+namespace llvm {
+
+class StringSaver;
+class raw_ostream;
+
+
+
+
+namespace cl {
+
+
+
+
+
+
+
+bool ParseCommandLineOptions(int argc, const char *const *argv,
+                             StringRef Overview = "",
+                             raw_ostream *Errs = nullptr);
+
+
+
+
+
+void ParseEnvironmentOptions(const char *progName, const char *envvar,
+                             const char *Overview = "");
+
+
+using VersionPrinterTy = std::function<void(raw_ostream &)>;
+
+
+
+
+
+
+void SetVersionPrinter(VersionPrinterTy func);
+void AddExtraVersionPrinter(VersionPrinterTy func);
+
+
+
+
+
+void PrintOptionValues();
+
+
+class Option;
+void AddLiteralOption(Option &O, StringRef Name);
+
+
+
+
+
+enum NumOccurrencesFlag {
+  Optional = 0x00,
+  ZeroOrMore = 0x01,
+  Required = 0x02,
+  OneOrMore = 0x03,
+  ConsumeAfter = 0x04
+};
+
+enum ValueExpected {
+
+  ValueOptional = 0x01,
+  ValueRequired = 0x02,
+  ValueDisallowed = 0x03
+};
+
+enum OptionHidden {
+  NotHidden = 0x00,
+  Hidden = 0x01,
+  ReallyHidden = 0x02
+};
+enum FormattingFlags {
+  NormalFormatting = 0x00,
+  Positional = 0x01,
+  Prefix = 0x02,
+  Grouping = 0x03
+};
+
+enum MiscFlags {
+  CommaSeparated = 0x01,
+  PositionalEatsArgs = 0x02,
+  Sink = 0x04
+};
+
+
+
+
+class OptionCategory {
+private:
+  StringRef const Name;
+  StringRef const Description;
+
+  void registerCategory();
+
+public:
+  OptionCategory(StringRef const Name,
+                 StringRef const Description = "")
+      : Name(Name), Description(Description) {
+    registerCategory();
+  }
+
+  StringRef getName() const { return Name; }
+  StringRef getDescription() const { return Description; }
+};
+
+
+extern OptionCategory GeneralCategory;
+
+
+
+
+class SubCommand {
+private:
+  StringRef Name;
+  StringRef Description;
+
+protected:
+  void registerSubCommand();
+  void unregisterSubCommand();
+
+public:
+  SubCommand(StringRef Name, StringRef Description = "")
+      : Name(Name), Description(Description) {
+        registerSubCommand();
+  }
+  SubCommand() = default;
+
+  void reset();
+
+  explicit operator bool() const;
+
+  StringRef getName() const { return Name; }
+  StringRef getDescription() const { return Description; }
+
+  SmallVector<Option *, 4> PositionalOpts;
+  SmallVector<Option *, 4> SinkOpts;
+  StringMap<Option *> OptionsMap;
+
+  Option *ConsumeAfterOpt = nullptr;
+};
+
+
+extern ManagedStatic<SubCommand> TopLevelSubCommand;
+
+
+extern ManagedStatic<SubCommand> AllSubCommands;
+
+
+
+
+class Option {
+  friend class alias;
+
+
+
+
+
+  virtual bool handleOccurrence(unsigned pos, StringRef ArgName,
+                                StringRef Arg) = 0;
+
+  virtual enum ValueExpected getValueExpectedFlagDefault() const {
+    return ValueOptional;
+  }
+
+
+  virtual void anchor();
+
+  int NumOccurrences = 0;
+
+
+  unsigned Occurrences : 3;
+
+
+  unsigned Value : 2;
+  unsigned HiddenFlag : 2;
+  unsigned Formatting : 2;
+  unsigned Misc : 3;
+  unsigned Position = 0;
+  unsigned AdditionalVals = 0;
+
+public:
+  StringRef ArgStr;
+  StringRef HelpStr;
+  StringRef ValueStr;
+  OptionCategory *Category;
+  SmallPtrSet<SubCommand *, 4> Subs;
+  bool FullyInitialized = false;
+
+  inline enum NumOccurrencesFlag getNumOccurrencesFlag() const {
+    return (enum NumOccurrencesFlag)Occurrences;
+  }
+
+  inline enum ValueExpected getValueExpectedFlag() const {
+    return Value ? ((enum ValueExpected)Value) : getValueExpectedFlagDefault();
+  }
+
+  inline enum OptionHidden getOptionHiddenFlag() const {
+    return (enum OptionHidden)HiddenFlag;
+  }
+
+  inline enum FormattingFlags getFormattingFlag() const {
+    return (enum FormattingFlags)Formatting;
+  }
+
+  inline unsigned getMiscFlags() const { return Misc; }
+  inline unsigned getPosition() const { return Position; }
+  inline unsigned getNumAdditionalVals() const { return AdditionalVals; }
+
+
+  bool hasArgStr() const { return !ArgStr.empty(); }
+  bool isPositional() const { return getFormattingFlag() == cl::Positional; }
+  bool isSink() const { return getMiscFlags() & cl::Sink; }
+
+  bool isConsumeAfter() const {
+    return getNumOccurrencesFlag() == cl::ConsumeAfter;
+  }
+
+  bool isInAllSubCommands() const {
+    return any_of(Subs, [](const SubCommand *SC) {
+      return SC == &*AllSubCommands;
+    });
+  }
+
+
+
+
+  void setArgStr(StringRef S);
+  void setDescription(StringRef S) { HelpStr = S; }
+  void setValueStr(StringRef S) { ValueStr = S; }
+  void setNumOccurrencesFlag(enum NumOccurrencesFlag Val) { Occurrences = Val; }
+  void setValueExpectedFlag(enum ValueExpected Val) { Value = Val; }
+  void setHiddenFlag(enum OptionHidden Val) { HiddenFlag = Val; }
+  void setFormattingFlag(enum FormattingFlags V) { Formatting = V; }
+  void setMiscFlag(enum MiscFlags M) { Misc |= M; }
+  void setPosition(unsigned pos) { Position = pos; }
+  void setCategory(OptionCategory &C) { Category = &C; }
+  void addSubCommand(SubCommand &S) { Subs.insert(&S); }
+
+protected:
+  explicit Option(enum NumOccurrencesFlag OccurrencesFlag,
+                  enum OptionHidden Hidden)
+      : Occurrences(OccurrencesFlag), Value(0), HiddenFlag(Hidden),
+        Formatting(NormalFormatting), Misc(0), Category(&GeneralCategory) {}
+
+  inline void setNumAdditionalVals(unsigned n) { AdditionalVals = n; }
+
+public:
+  virtual ~Option() = default;
+
+
+
+  void addArgument();
+
+
+
+
+
+  void removeArgument();
+
+
+  virtual size_t getOptionWidth() const = 0;
+
+
+
+
+  virtual void printOptionInfo(size_t GlobalWidth) const = 0;
+
+  virtual void printOptionValue(size_t GlobalWidth, bool Force) const = 0;
+
+  virtual void setDefault() = 0;
+
+  static void printHelpStr(StringRef HelpStr, size_t Indent,
+                           size_t FirstLineIndentedBy);
+
+  virtual void getExtraOptionNames(SmallVectorImpl<StringRef> &) {}
+
+
+
+  virtual bool addOccurrence(unsigned pos, StringRef ArgName, StringRef Value,
+                             bool MultiArg = false);
+
+
+  bool error(const Twine &Message, StringRef ArgName = StringRef());
+
+  inline int getNumOccurrences() const { return NumOccurrences; }
+  inline void reset() { NumOccurrences = 0; }
+};
+
+
+
+
+
+
+
+struct desc {
+  StringRef Desc;
+
+  desc(StringRef Str) : Desc(Str) {}
+
+  void apply(Option &O) const { O.setDescription(Desc); }
+};
+
+
+
+struct value_desc {
+  StringRef Desc;
+
+  value_desc(StringRef Str) : Desc(Str) {}
+
+  void apply(Option &O) const { O.setValueStr(Desc); }
+};
+
+
+
+
+
+template <class Ty> struct initializer {
+  const Ty &Init;
+  initializer(const Ty &Val) : Init(Val) {}
+
+  template <class Opt> void apply(Opt &O) const { O.setInitialValue(Init); }
+};
+
+template <class Ty> initializer<Ty> init(const Ty &Val) {
+  return initializer<Ty>(Val);
+}
+
+
+
+
+
+template <class Ty> struct LocationClass {
+  Ty &Loc;
+
+  LocationClass(Ty &L) : Loc(L) {}
+
+  template <class Opt> void apply(Opt &O) const { O.setLocation(O, Loc); }
+};
+
+template <class Ty> LocationClass<Ty> location(Ty &L) {
+  return LocationClass<Ty>(L);
+}
+
+
+
+struct cat {
+  OptionCategory &Category;
+
+  cat(OptionCategory &c) : Category(c) {}
+
+  template <class Opt> void apply(Opt &O) const { O.setCategory(Category); }
+};
+
+
+struct sub {
+  SubCommand &Sub;
+
+  sub(SubCommand &S) : Sub(S) {}
+
+  template <class Opt> void apply(Opt &O) const { O.addSubCommand(Sub); }
+};
+
+
+
+
+
+struct GenericOptionValue {
+  virtual bool compare(const GenericOptionValue &V) const = 0;
+
+protected:
+  GenericOptionValue() = default;
+  GenericOptionValue(const GenericOptionValue&) = default;
+  GenericOptionValue &operator=(const GenericOptionValue &) = default;
+  ~GenericOptionValue() = default;
+
+private:
+  virtual void anchor();
+};
+
+template <class DataType> struct OptionValue;
+
+
+
+template <class DataType, bool isClass>
+struct OptionValueBase : public GenericOptionValue {
+
+  using WrapperType = OptionValue<DataType>;
+
+  bool hasValue() const { return false; }
+
+  const DataType &getValue() const { ::llvm::llvm_unreachable_internal("no default value", "/home/trippels/llvm/llvm/include/llvm/Support/CommandLine.h", 473); }
+
+
+  template <class DT> void setValue(const DT & ) {}
+
+  bool compare(const DataType & ) const { return false; }
+
+  bool compare(const GenericOptionValue & ) const override {
+    return false;
+  }
+
+protected:
+  ~OptionValueBase() = default;
+};
+
+
+template <class DataType> class OptionValueCopy : public GenericOptionValue {
+  DataType Value;
+  bool Valid = false;
+
+protected:
+  OptionValueCopy(const OptionValueCopy&) = default;
+  OptionValueCopy &operator=(const OptionValueCopy &) = default;
+  ~OptionValueCopy() = default;
+
+public:
+  OptionValueCopy() = default;
+
+  bool hasValue() const { return Valid; }
+
+  const DataType &getValue() const {
+    
+   ((
+   Valid && "invalid option value"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Valid && \"invalid option value\""
+   , "/home/trippels/llvm/llvm/include/llvm/Support/CommandLine.h", 504, __PRETTY_FUNCTION__))
+                                          ;
+    return Value;
+  }
+
+  void setValue(const DataType &V) {
+    Valid = true;
+    Value = V;
+  }
+
+  bool compare(const DataType &V) const { return Valid && (Value != V); }
+
+  bool compare(const GenericOptionValue &V) const override {
+    const OptionValueCopy<DataType> &VC =
+        static_cast<const OptionValueCopy<DataType> &>(V);
+    if (!VC.hasValue())
+      return false;
+    return compare(VC.getValue());
+  }
+};
+
+
+template <class DataType>
+struct OptionValueBase<DataType, false> : OptionValueCopy<DataType> {
+  using WrapperType = DataType;
+
+protected:
+  OptionValueBase() = default;
+  OptionValueBase(const OptionValueBase&) = default;
+  OptionValueBase &operator=(const OptionValueBase &) = default;
+  ~OptionValueBase() = default;
+};
+
+
+template <class DataType>
+struct OptionValue final
+    : OptionValueBase<DataType, std::is_class<DataType>::value> {
+  OptionValue() = default;
+
+  OptionValue(const DataType &V) { this->setValue(V); }
+
+
+  template <class DT> OptionValue<DataType> &operator=(const DT &V) {
+    this->setValue(V);
+    return *this;
+  }
+};
+
+
+enum boolOrDefault { BOU_UNSET, BOU_TRUE, BOU_FALSE };
+template <>
+struct OptionValue<cl::boolOrDefault> final
+    : OptionValueCopy<cl::boolOrDefault> {
+  using WrapperType = cl::boolOrDefault;
+
+  OptionValue() = default;
+
+  OptionValue(const cl::boolOrDefault &V) { this->setValue(V); }
+
+  OptionValue<cl::boolOrDefault> &operator=(const cl::boolOrDefault &V) {
+    setValue(V);
+    return *this;
+  }
+
+private:
+  void anchor() override;
+};
+
+template <>
+struct OptionValue<std::string> final : OptionValueCopy<std::string> {
+  using WrapperType = StringRef;
+
+  OptionValue() = default;
+
+  OptionValue(const std::string &V) { this->setValue(V); }
+
+  OptionValue<std::string> &operator=(const std::string &V) {
+    setValue(V);
+    return *this;
+  }
+
+private:
+  void anchor() override;
+};
+
+
+
+
+
+
+struct OptionEnumValue {
+  StringRef Name;
+  int Value;
+  StringRef Description;
+};
+class ValuesClass {
+
+
+
+  SmallVector<OptionEnumValue, 4> Values;
+
+public:
+  ValuesClass(std::initializer_list<OptionEnumValue> Options)
+      : Values(Options) {}
+
+  template <class Opt> void apply(Opt &O) const {
+    for (auto Value : Values)
+      O.getParser().addLiteralOption(Value.Name, Value.Value,
+                                     Value.Description);
+  }
+};
+
+
+
+template <typename... OptsTy> ValuesClass values(OptsTy... Options) {
+  return ValuesClass({Options...});
+}
+class generic_parser_base {
+protected:
+  class GenericOptionInfo {
+  public:
+    GenericOptionInfo(StringRef name, StringRef helpStr)
+        : Name(name), HelpStr(helpStr) {}
+    StringRef Name;
+    StringRef HelpStr;
+  };
+
+public:
+  generic_parser_base(Option &O) : Owner(O) {}
+
+  virtual ~generic_parser_base() = default;
+
+
+
+
+
+  virtual unsigned getNumOptions() const = 0;
+
+
+  virtual StringRef getOption(unsigned N) const = 0;
+
+
+  virtual StringRef getDescription(unsigned N) const = 0;
+
+
+  virtual size_t getOptionWidth(const Option &O) const;
+
+  virtual const GenericOptionValue &getOptionValue(unsigned N) const = 0;
+
+
+
+
+  virtual void printOptionInfo(const Option &O, size_t GlobalWidth) const;
+
+  void printGenericOptionDiff(const Option &O, const GenericOptionValue &V,
+                              const GenericOptionValue &Default,
+                              size_t GlobalWidth) const;
+
+
+
+
+
+  template <class AnyOptionValue>
+  void printOptionDiff(const Option &O, const AnyOptionValue &V,
+                       const AnyOptionValue &Default,
+                       size_t GlobalWidth) const {
+    printGenericOptionDiff(O, V, Default, GlobalWidth);
+  }
+
+  void initialize() {}
+
+  void getExtraOptionNames(SmallVectorImpl<StringRef> &OptionNames) {
+
+
+
+    if (!Owner.hasArgStr())
+      for (unsigned i = 0, e = getNumOptions(); i != e; ++i)
+        OptionNames.push_back(getOption(i));
+  }
+
+  enum ValueExpected getValueExpectedFlagDefault() const {
+    if (Owner.hasArgStr())
+      return ValueRequired;
+    else
+      return ValueDisallowed;
+  }
+
+
+
+
+  unsigned findOption(StringRef Name);
+
+protected:
+  Option &Owner;
+};
+
+
+
+
+
+
+
+template <class DataType> class parser : public generic_parser_base {
+protected:
+  class OptionInfo : public GenericOptionInfo {
+  public:
+    OptionInfo(StringRef name, DataType v, StringRef helpStr)
+        : GenericOptionInfo(name, helpStr), V(v) {}
+
+    OptionValue<DataType> V;
+  };
+  SmallVector<OptionInfo, 8> Values;
+
+public:
+  parser(Option &O) : generic_parser_base(O) {}
+
+  using parser_data_type = DataType;
+
+
+  unsigned getNumOptions() const override { return unsigned(Values.size()); }
+  StringRef getOption(unsigned N) const override { return Values[N].Name; }
+  StringRef getDescription(unsigned N) const override {
+    return Values[N].HelpStr;
+  }
+
+
+  const GenericOptionValue &getOptionValue(unsigned N) const override {
+    return Values[N].V;
+  }
+
+
+  bool parse(Option &O, StringRef ArgName, StringRef Arg, DataType &V) {
+    StringRef ArgVal;
+    if (Owner.hasArgStr())
+      ArgVal = Arg;
+    else
+      ArgVal = ArgName;
+
+    for (size_t i = 0, e = Values.size(); i != e; ++i)
+      if (Values[i].Name == ArgVal) {
+        V = Values[i].V.getValue();
+        return false;
+      }
+
+    return O.error("Cannot find option named '" + ArgVal + "'!");
+  }
+
+
+
+  template <class DT>
+  void addLiteralOption(StringRef Name, const DT &V, StringRef HelpStr) {
+    
+   ((
+   findOption(Name) == Values.size() && "Option already exists!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "findOption(Name) == Values.size() && \"Option already exists!\""
+   , "/home/trippels/llvm/llvm/include/llvm/Support/CommandLine.h", 787, __PRETTY_FUNCTION__))
+                                                                        ;
+    OptionInfo X(Name, static_cast<DataType>(V), HelpStr);
+    Values.push_back(X);
+    AddLiteralOption(Owner, Name);
+  }
+
+
+
+  void removeLiteralOption(StringRef Name) {
+    unsigned N = findOption(Name);
+    
+   ((
+   N != Values.size() && "Option not found!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "N != Values.size() && \"Option not found!\""
+   , "/home/trippels/llvm/llvm/include/llvm/Support/CommandLine.h", 797, __PRETTY_FUNCTION__))
+                                                    ;
+    Values.erase(Values.begin() + N);
+  }
+};
+
+
+
+
+class basic_parser_impl {
+public:
+  basic_parser_impl(Option &) {}
+
+  enum ValueExpected getValueExpectedFlagDefault() const {
+    return ValueRequired;
+  }
+
+  void getExtraOptionNames(SmallVectorImpl<StringRef> &) {}
+
+  void initialize() {}
+
+
+  size_t getOptionWidth(const Option &O) const;
+
+
+
+
+  void printOptionInfo(const Option &O, size_t GlobalWidth) const;
+
+
+
+  void printOptionNoValue(const Option &O, size_t GlobalWidth) const;
+
+
+  virtual StringRef getValueName() const { return "value"; }
+
+
+  virtual void anchor();
+
+protected:
+  ~basic_parser_impl() = default;
+
+
+  void printOptionName(const Option &O, size_t GlobalWidth) const;
+};
+
+
+
+
+template <class DataType> class basic_parser : public basic_parser_impl {
+public:
+  using parser_data_type = DataType;
+  using OptVal = OptionValue<DataType>;
+
+  basic_parser(Option &O) : basic_parser_impl(O) {}
+
+protected:
+  ~basic_parser() = default;
+};
+
+
+
+
+template <> class parser<bool> final : public basic_parser<bool> {
+public:
+  parser(Option &O) : basic_parser(O) {}
+
+
+  bool parse(Option &O, StringRef ArgName, StringRef Arg, bool &Val);
+
+  void initialize() {}
+
+  enum ValueExpected getValueExpectedFlagDefault() const {
+    return ValueOptional;
+  }
+
+
+  StringRef getValueName() const override { return StringRef(); }
+
+  void printOptionDiff(const Option &O, bool V, OptVal Default,
+                       size_t GlobalWidth) const;
+
+
+  void anchor() override;
+};
+
+extern template class basic_parser<bool>;
+
+
+
+template <>
+class parser<boolOrDefault> final : public basic_parser<boolOrDefault> {
+public:
+  parser(Option &O) : basic_parser(O) {}
+
+
+  bool parse(Option &O, StringRef ArgName, StringRef Arg, boolOrDefault &Val);
+
+  enum ValueExpected getValueExpectedFlagDefault() const {
+    return ValueOptional;
+  }
+
+
+  StringRef getValueName() const override { return StringRef(); }
+
+  void printOptionDiff(const Option &O, boolOrDefault V, OptVal Default,
+                       size_t GlobalWidth) const;
+
+
+  void anchor() override;
+};
+
+extern template class basic_parser<boolOrDefault>;
+
+
+
+
+template <> class parser<int> final : public basic_parser<int> {
+public:
+  parser(Option &O) : basic_parser(O) {}
+
+
+  bool parse(Option &O, StringRef ArgName, StringRef Arg, int &Val);
+
+
+  StringRef getValueName() const override { return "int"; }
+
+  void printOptionDiff(const Option &O, int V, OptVal Default,
+                       size_t GlobalWidth) const;
+
+
+  void anchor() override;
+};
+
+extern template class basic_parser<int>;
+
+
+
+
+template <> class parser<unsigned> final : public basic_parser<unsigned> {
+public:
+  parser(Option &O) : basic_parser(O) {}
+
+
+  bool parse(Option &O, StringRef ArgName, StringRef Arg, unsigned &Val);
+
+
+  StringRef getValueName() const override { return "uint"; }
+
+  void printOptionDiff(const Option &O, unsigned V, OptVal Default,
+                       size_t GlobalWidth) const;
+
+
+  void anchor() override;
+};
+
+extern template class basic_parser<unsigned>;
+
+
+
+
+template <>
+class parser<unsigned long long> final
+    : public basic_parser<unsigned long long> {
+public:
+  parser(Option &O) : basic_parser(O) {}
+
+
+  bool parse(Option &O, StringRef ArgName, StringRef Arg,
+             unsigned long long &Val);
+
+
+  StringRef getValueName() const override { return "uint"; }
+
+  void printOptionDiff(const Option &O, unsigned long long V, OptVal Default,
+                       size_t GlobalWidth) const;
+
+
+  void anchor() override;
+};
+
+extern template class basic_parser<unsigned long long>;
+
+
+
+
+template <> class parser<double> final : public basic_parser<double> {
+public:
+  parser(Option &O) : basic_parser(O) {}
+
+
+  bool parse(Option &O, StringRef ArgName, StringRef Arg, double &Val);
+
+
+  StringRef getValueName() const override { return "number"; }
+
+  void printOptionDiff(const Option &O, double V, OptVal Default,
+                       size_t GlobalWidth) const;
+
+
+  void anchor() override;
+};
+
+extern template class basic_parser<double>;
+
+
+
+
+template <> class parser<float> final : public basic_parser<float> {
+public:
+  parser(Option &O) : basic_parser(O) {}
+
+
+  bool parse(Option &O, StringRef ArgName, StringRef Arg, float &Val);
+
+
+  StringRef getValueName() const override { return "number"; }
+
+  void printOptionDiff(const Option &O, float V, OptVal Default,
+                       size_t GlobalWidth) const;
+
+
+  void anchor() override;
+};
+
+extern template class basic_parser<float>;
+
+
+
+
+template <> class parser<std::string> final : public basic_parser<std::string> {
+public:
+  parser(Option &O) : basic_parser(O) {}
+
+
+  bool parse(Option &, StringRef, StringRef Arg, std::string &Value) {
+    Value = Arg.str();
+    return false;
+  }
+
+
+  StringRef getValueName() const override { return "string"; }
+
+  void printOptionDiff(const Option &O, StringRef V, const OptVal &Default,
+                       size_t GlobalWidth) const;
+
+
+  void anchor() override;
+};
+
+extern template class basic_parser<std::string>;
+
+
+
+
+template <> class parser<char> final : public basic_parser<char> {
+public:
+  parser(Option &O) : basic_parser(O) {}
+
+
+  bool parse(Option &, StringRef, StringRef Arg, char &Value) {
+    Value = Arg[0];
+    return false;
+  }
+
+
+  StringRef getValueName() const override { return "char"; }
+
+  void printOptionDiff(const Option &O, char V, OptVal Default,
+                       size_t GlobalWidth) const;
+
+
+  void anchor() override;
+};
+
+extern template class basic_parser<char>;
+template <class ParserClass, class DT>
+void printOptionDiff(const Option &O, const generic_parser_base &P, const DT &V,
+                     const OptionValue<DT> &Default, size_t GlobalWidth) {
+  OptionValue<DT> OV = V;
+  P.printOptionDiff(O, OV, Default, GlobalWidth);
+}
+
+
+
+template <class ParserDT, class ValDT> struct OptionDiffPrinter {
+  void print(const Option &O, const parser<ParserDT> &P, const ValDT & ,
+             const OptionValue<ValDT> & , size_t GlobalWidth) {
+    P.printOptionNoValue(O, GlobalWidth);
+  }
+};
+
+
+
+template <class DT> struct OptionDiffPrinter<DT, DT> {
+  void print(const Option &O, const parser<DT> &P, const DT &V,
+             const OptionValue<DT> &Default, size_t GlobalWidth) {
+    P.printOptionDiff(O, V, Default, GlobalWidth);
+  }
+};
+
+
+
+template <class ParserClass, class ValDT>
+void printOptionDiff(
+    const Option &O,
+    const basic_parser<typename ParserClass::parser_data_type> &P,
+    const ValDT &V, const OptionValue<ValDT> &Default, size_t GlobalWidth) {
+
+  OptionDiffPrinter<typename ParserClass::parser_data_type, ValDT> printer;
+  printer.print(O, static_cast<const ParserClass &>(P), V, Default,
+                GlobalWidth);
+}
+
+
+
+
+
+
+
+template <class Mod> struct applicator {
+  template <class Opt> static void opt(const Mod &M, Opt &O) { M.apply(O); }
+};
+
+
+template <unsigned n> struct applicator<char[n]> {
+  template <class Opt> static void opt(StringRef Str, Opt &O) {
+    O.setArgStr(Str);
+  }
+};
+template <unsigned n> struct applicator<const char[n]> {
+  template <class Opt> static void opt(StringRef Str, Opt &O) {
+    O.setArgStr(Str);
+  }
+};
+template <> struct applicator<StringRef > {
+  template <class Opt> static void opt(StringRef Str, Opt &O) {
+    O.setArgStr(Str);
+  }
+};
+
+template <> struct applicator<NumOccurrencesFlag> {
+  static void opt(NumOccurrencesFlag N, Option &O) {
+    O.setNumOccurrencesFlag(N);
+  }
+};
+
+template <> struct applicator<ValueExpected> {
+  static void opt(ValueExpected VE, Option &O) { O.setValueExpectedFlag(VE); }
+};
+
+template <> struct applicator<OptionHidden> {
+  static void opt(OptionHidden OH, Option &O) { O.setHiddenFlag(OH); }
+};
+
+template <> struct applicator<FormattingFlags> {
+  static void opt(FormattingFlags FF, Option &O) { O.setFormattingFlag(FF); }
+};
+
+template <> struct applicator<MiscFlags> {
+  static void opt(MiscFlags MF, Option &O) { O.setMiscFlag(MF); }
+};
+
+
+template <class Opt, class Mod, class... Mods>
+void apply(Opt *O, const Mod &M, const Mods &... Ms) {
+  applicator<Mod>::opt(M, *O);
+  apply(O, Ms...);
+}
+
+template <class Opt, class Mod> void apply(Opt *O, const Mod &M) {
+  applicator<Mod>::opt(M, *O);
+}
+template <class DataType, bool ExternalStorage, bool isClass>
+class opt_storage {
+  DataType *Location = nullptr;
+  OptionValue<DataType> Default;
+
+  void check_location() const {
+    
+   ((
+   Location && "cl::location(...) not specified for a command " "line option with external storage, " "or cl::init specified before cl::location()!!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Location && \"cl::location(...) not specified for a command \" \"line option with external storage, \" \"or cl::init specified before cl::location()!!\""
+   ,
+
+                                                                      "/home/trippels/llvm/llvm/include/llvm/Support/CommandLine.h"
+    ,
+
+                                                                      1193
+    , __PRETTY_FUNCTION__))
+
+                                                                       
+                                                                      ;
+  }
+
+public:
+  opt_storage() = default;
+
+  bool setLocation(Option &O, DataType &L) {
+    if (Location)
+      return O.error("cl::location(x) specified more than once!");
+    Location = &L;
+    Default = L;
+    return false;
+  }
+
+  template <class T> void setValue(const T &V, bool initial = false) {
+    check_location();
+    *Location = V;
+    if (initial)
+      Default = V;
+  }
+
+  DataType &getValue() {
+    check_location();
+    return *Location;
+  }
+  const DataType &getValue() const {
+    check_location();
+    return *Location;
+  }
+
+  operator DataType() const { return this->getValue(); }
+
+  const OptionValue<DataType> &getDefault() const { return Default; }
+};
+
+
+
+
+
+template <class DataType>
+class opt_storage<DataType, false, true> : public DataType {
+public:
+  OptionValue<DataType> Default;
+
+  template <class T> void setValue(const T &V, bool initial = false) {
+    DataType::operator=(V);
+    if (initial)
+      Default = V;
+  }
+
+  DataType &getValue() { return *this; }
+  const DataType &getValue() const { return *this; }
+
+  const OptionValue<DataType> &getDefault() const { return Default; }
+};
+
+
+
+
+
+template <class DataType> class opt_storage<DataType, false, false> {
+public:
+  DataType Value;
+  OptionValue<DataType> Default;
+
+
+
+  opt_storage() : Value(DataType()), Default(DataType()) {}
+
+  template <class T> void setValue(const T &V, bool initial = false) {
+    Value = V;
+    if (initial)
+      Default = V;
+  }
+  DataType &getValue() { return Value; }
+  DataType getValue() const { return Value; }
+
+  const OptionValue<DataType> &getDefault() const { return Default; }
+
+  operator DataType() const { return getValue(); }
+
+
+  DataType operator->() const { return Value; }
+};
+
+
+
+
+template <class DataType, bool ExternalStorage = false,
+          class ParserClass = parser<DataType>>
+class opt : public Option,
+            public opt_storage<DataType, ExternalStorage,
+                               std::is_class<DataType>::value> {
+  ParserClass Parser;
+
+  bool handleOccurrence(unsigned pos, StringRef ArgName,
+                        StringRef Arg) override {
+    typename ParserClass::parser_data_type Val =
+        typename ParserClass::parser_data_type();
+    if (Parser.parse(*this, ArgName, Arg, Val))
+      return true;
+    this->setValue(Val);
+    this->setPosition(pos);
+    return false;
+  }
+
+  enum ValueExpected getValueExpectedFlagDefault() const override {
+    return Parser.getValueExpectedFlagDefault();
+  }
+
+  void getExtraOptionNames(SmallVectorImpl<StringRef> &OptionNames) override {
+    return Parser.getExtraOptionNames(OptionNames);
+  }
+
+
+  size_t getOptionWidth() const override {
+    return Parser.getOptionWidth(*this);
+  }
+
+  void printOptionInfo(size_t GlobalWidth) const override {
+    Parser.printOptionInfo(*this, GlobalWidth);
+  }
+
+  void printOptionValue(size_t GlobalWidth, bool Force) const override {
+    if (Force || this->getDefault().compare(this->getValue())) {
+      cl::printOptionDiff<ParserClass>(*this, Parser, this->getValue(),
+                                       this->getDefault(), GlobalWidth);
+    }
+  }
+
+  template <class T, class = typename std::enable_if<
+            std::is_assignable<T&, T>::value>::type>
+  void setDefaultImpl() {
+    const OptionValue<DataType> &V = this->getDefault();
+    if (V.hasValue())
+      this->setValue(V.getValue());
+  }
+
+  template <class T, class = typename std::enable_if<
+            !std::is_assignable<T&, T>::value>::type>
+  void setDefaultImpl(...) {}
+
+  void setDefault() override { setDefaultImpl<DataType>(); }
+
+  void done() {
+    addArgument();
+    Parser.initialize();
+  }
+
+public:
+
+  opt(const opt &) = delete;
+  opt &operator=(const opt &) = delete;
+
+
+  void setInitialValue(const DataType &V) { this->setValue(V, true); }
+
+  ParserClass &getParser() { return Parser; }
+
+  template <class T> DataType &operator=(const T &Val) {
+    this->setValue(Val);
+    return this->getValue();
+  }
+
+  template <class... Mods>
+  explicit opt(const Mods &... Ms)
+      : Option(Optional, NotHidden), Parser(*this) {
+    apply(this, Ms...);
+    done();
+  }
+};
+
+extern template class opt<unsigned>;
+extern template class opt<int>;
+extern template class opt<std::string>;
+extern template class opt<char>;
+extern template class opt<bool>;
+template <class DataType, class StorageClass> class list_storage {
+  StorageClass *Location = nullptr;
+
+public:
+  list_storage() = default;
+
+  bool setLocation(Option &O, StorageClass &L) {
+    if (Location)
+      return O.error("cl::location(x) specified more than once!");
+    Location = &L;
+    return false;
+  }
+
+  template <class T> void addValue(const T &V) {
+    
+   ((
+   Location != 0 && "cl::location(...) not specified for a command " "line option with external storage!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Location != 0 && \"cl::location(...) not specified for a command \" \"line option with external storage!\""
+   ,
+                                                                "/home/trippels/llvm/llvm/include/llvm/Support/CommandLine.h"
+    ,
+                                                                1393
+    , __PRETTY_FUNCTION__))
+                                                                 
+                                                                ;
+    Location->push_back(V);
+  }
+};
+template <class DataType> class list_storage<DataType, bool> {
+  std::vector<DataType> Storage;
+
+public:
+  using iterator = typename std::vector<DataType>::iterator;
+
+  iterator begin() { return Storage.begin(); }
+  iterator end() { return Storage.end(); }
+
+  using const_iterator = typename std::vector<DataType>::const_iterator;
+
+  const_iterator begin() const { return Storage.begin(); }
+  const_iterator end() const { return Storage.end(); }
+
+  using size_type = typename std::vector<DataType>::size_type;
+
+  size_type size() const { return Storage.size(); }
+
+  bool empty() const { return Storage.empty(); }
+
+  void push_back(const DataType &value) { Storage.push_back(value); }
+  void push_back(DataType &&value) { Storage.push_back(value); }
+
+  using reference = typename std::vector<DataType>::reference;
+  using const_reference = typename std::vector<DataType>::const_reference;
+
+  reference operator[](size_type pos) { return Storage[pos]; }
+  const_reference operator[](size_type pos) const { return Storage[pos]; }
+
+  iterator erase(const_iterator pos) { return Storage.erase(pos); }
+  iterator erase(const_iterator first, const_iterator last) {
+    return Storage.erase(first, last);
+  }
+
+  iterator erase(iterator pos) { return Storage.erase(pos); }
+  iterator erase(iterator first, iterator last) {
+    return Storage.erase(first, last);
+  }
+
+  iterator insert(const_iterator pos, const DataType &value) {
+    return Storage.insert(pos, value);
+  }
+  iterator insert(const_iterator pos, DataType &&value) {
+    return Storage.insert(pos, value);
+  }
+
+  iterator insert(iterator pos, const DataType &value) {
+    return Storage.insert(pos, value);
+  }
+  iterator insert(iterator pos, DataType &&value) {
+    return Storage.insert(pos, value);
+  }
+
+  reference front() { return Storage.front(); }
+  const_reference front() const { return Storage.front(); }
+
+  operator std::vector<DataType>&() { return Storage; }
+  operator ArrayRef<DataType>() { return Storage; }
+  std::vector<DataType> *operator&() { return &Storage; }
+  const std::vector<DataType> *operator&() const { return &Storage; }
+
+  template <class T> void addValue(const T &V) { Storage.push_back(V); }
+};
+
+
+
+
+template <class DataType, class StorageClass = bool,
+          class ParserClass = parser<DataType>>
+class list : public Option, public list_storage<DataType, StorageClass> {
+  std::vector<unsigned> Positions;
+  ParserClass Parser;
+
+  enum ValueExpected getValueExpectedFlagDefault() const override {
+    return Parser.getValueExpectedFlagDefault();
+  }
+
+  void getExtraOptionNames(SmallVectorImpl<StringRef> &OptionNames) override {
+    return Parser.getExtraOptionNames(OptionNames);
+  }
+
+  bool handleOccurrence(unsigned pos, StringRef ArgName,
+                        StringRef Arg) override {
+    typename ParserClass::parser_data_type Val =
+        typename ParserClass::parser_data_type();
+    if (Parser.parse(*this, ArgName, Arg, Val))
+      return true;
+    list_storage<DataType, StorageClass>::addValue(Val);
+    setPosition(pos);
+    Positions.push_back(pos);
+    return false;
+  }
+
+
+  size_t getOptionWidth() const override {
+    return Parser.getOptionWidth(*this);
+  }
+
+  void printOptionInfo(size_t GlobalWidth) const override {
+    Parser.printOptionInfo(*this, GlobalWidth);
+  }
+
+
+  void printOptionValue(size_t , bool ) const override {
+  }
+
+  void setDefault() override {}
+
+  void done() {
+    addArgument();
+    Parser.initialize();
+  }
+
+public:
+
+  list(const list &) = delete;
+  list &operator=(const list &) = delete;
+
+  ParserClass &getParser() { return Parser; }
+
+  unsigned getPosition(unsigned optnum) const {
+    
+   ((
+   optnum < this->size() && "Invalid option index"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "optnum < this->size() && \"Invalid option index\""
+   , "/home/trippels/llvm/llvm/include/llvm/Support/CommandLine.h", 1527, __PRETTY_FUNCTION__))
+                                                          ;
+    return Positions[optnum];
+  }
+
+  void setNumAdditionalVals(unsigned n) { Option::setNumAdditionalVals(n); }
+
+  template <class... Mods>
+  explicit list(const Mods &... Ms)
+      : Option(ZeroOrMore, NotHidden), Parser(*this) {
+    apply(this, Ms...);
+    done();
+  }
+};
+
+
+struct multi_val {
+  unsigned AdditionalVals;
+  explicit multi_val(unsigned N) : AdditionalVals(N) {}
+
+  template <typename D, typename S, typename P>
+  void apply(list<D, S, P> &L) const {
+    L.setNumAdditionalVals(AdditionalVals);
+  }
+};
+template <class DataType, class StorageClass> class bits_storage {
+  unsigned *Location = nullptr;
+
+  template <class T> static unsigned Bit(const T &V) {
+    unsigned BitPos = reinterpret_cast<unsigned>(V);
+    
+   ((
+   BitPos < sizeof(unsigned) * 8 && "enum exceeds width of bit vector!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "BitPos < sizeof(unsigned) * 8 && \"enum exceeds width of bit vector!\""
+   ,
+                                              "/home/trippels/llvm/llvm/include/llvm/Support/CommandLine.h"
+    ,
+                                              1565
+    , __PRETTY_FUNCTION__))
+                                               
+                                              ;
+    return 1 << BitPos;
+  }
+
+public:
+  bits_storage() = default;
+
+  bool setLocation(Option &O, unsigned &L) {
+    if (Location)
+      return O.error("cl::location(x) specified more than once!");
+    Location = &L;
+    return false;
+  }
+
+  template <class T> void addValue(const T &V) {
+    
+   ((
+   Location != 0 && "cl::location(...) not specified for a command " "line option with external storage!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Location != 0 && \"cl::location(...) not specified for a command \" \"line option with external storage!\""
+   ,
+                                                                "/home/trippels/llvm/llvm/include/llvm/Support/CommandLine.h"
+    ,
+                                                                1581
+    , __PRETTY_FUNCTION__))
+                                                                 
+                                                                ;
+    *Location |= Bit(V);
+  }
+
+  unsigned getBits() { return *Location; }
+
+  template <class T> bool isSet(const T &V) {
+    return (*Location & Bit(V)) != 0;
+  }
+};
+
+
+
+
+template <class DataType> class bits_storage<DataType, bool> {
+  unsigned Bits;
+
+  template <class T> static unsigned Bit(const T &V) {
+    unsigned BitPos = (unsigned)V;
+    
+   ((
+   BitPos < sizeof(unsigned) * 8 && "enum exceeds width of bit vector!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "BitPos < sizeof(unsigned) * 8 && \"enum exceeds width of bit vector!\""
+   ,
+                                              "/home/trippels/llvm/llvm/include/llvm/Support/CommandLine.h"
+    ,
+                                              1601
+    , __PRETTY_FUNCTION__))
+                                               
+                                              ;
+    return 1 << BitPos;
+  }
+
+public:
+  template <class T> void addValue(const T &V) { Bits |= Bit(V); }
+
+  unsigned getBits() { return Bits; }
+
+  template <class T> bool isSet(const T &V) { return (Bits & Bit(V)) != 0; }
+};
+
+
+
+
+template <class DataType, class Storage = bool,
+          class ParserClass = parser<DataType>>
+class bits : public Option, public bits_storage<DataType, Storage> {
+  std::vector<unsigned> Positions;
+  ParserClass Parser;
+
+  enum ValueExpected getValueExpectedFlagDefault() const override {
+    return Parser.getValueExpectedFlagDefault();
+  }
+
+  void getExtraOptionNames(SmallVectorImpl<StringRef> &OptionNames) override {
+    return Parser.getExtraOptionNames(OptionNames);
+  }
+
+  bool handleOccurrence(unsigned pos, StringRef ArgName,
+                        StringRef Arg) override {
+    typename ParserClass::parser_data_type Val =
+        typename ParserClass::parser_data_type();
+    if (Parser.parse(*this, ArgName, Arg, Val))
+      return true;
+    this->addValue(Val);
+    setPosition(pos);
+    Positions.push_back(pos);
+    return false;
+  }
+
+
+  size_t getOptionWidth() const override {
+    return Parser.getOptionWidth(*this);
+  }
+
+  void printOptionInfo(size_t GlobalWidth) const override {
+    Parser.printOptionInfo(*this, GlobalWidth);
+  }
+
+
+  void printOptionValue(size_t , bool ) const override {
+  }
+
+  void setDefault() override {}
+
+  void done() {
+    addArgument();
+    Parser.initialize();
+  }
+
+public:
+
+  bits(const bits &) = delete;
+  bits &operator=(const bits &) = delete;
+
+  ParserClass &getParser() { return Parser; }
+
+  unsigned getPosition(unsigned optnum) const {
+    
+   ((
+   optnum < this->size() && "Invalid option index"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "optnum < this->size() && \"Invalid option index\""
+   , "/home/trippels/llvm/llvm/include/llvm/Support/CommandLine.h", 1670, __PRETTY_FUNCTION__))
+                                                          ;
+    return Positions[optnum];
+  }
+
+  template <class... Mods>
+  explicit bits(const Mods &... Ms)
+      : Option(ZeroOrMore, NotHidden), Parser(*this) {
+    apply(this, Ms...);
+    done();
+  }
+};
+
+
+
+
+
+class alias : public Option {
+  Option *AliasFor;
+
+  bool handleOccurrence(unsigned pos, StringRef ,
+                        StringRef Arg) override {
+    return AliasFor->handleOccurrence(pos, AliasFor->ArgStr, Arg);
+  }
+
+  bool addOccurrence(unsigned pos, StringRef , StringRef Value,
+                     bool MultiArg = false) override {
+    return AliasFor->addOccurrence(pos, AliasFor->ArgStr, Value, MultiArg);
+  }
+
+
+  size_t getOptionWidth() const override;
+  void printOptionInfo(size_t GlobalWidth) const override;
+
+
+  void printOptionValue(size_t , bool ) const override {
+  }
+
+  void setDefault() override { AliasFor->setDefault(); }
+
+  ValueExpected getValueExpectedFlagDefault() const override {
+    return AliasFor->getValueExpectedFlag();
+  }
+
+  void done() {
+    if (!hasArgStr())
+      error("cl::alias must have argument name specified!");
+    if (!AliasFor)
+      error("cl::alias must have an cl::aliasopt(option) specified!");
+    Subs = AliasFor->Subs;
+    addArgument();
+  }
+
+public:
+
+  alias(const alias &) = delete;
+  alias &operator=(const alias &) = delete;
+
+  void setAliasFor(Option &O) {
+    if (AliasFor)
+      error("cl::alias must only have one cl::aliasopt(...) specified!");
+    AliasFor = &O;
+  }
+
+  template <class... Mods>
+  explicit alias(const Mods &... Ms)
+      : Option(Optional, Hidden), AliasFor(nullptr) {
+    apply(this, Ms...);
+    done();
+  }
+};
+
+
+struct aliasopt {
+  Option &Opt;
+
+  explicit aliasopt(Option &O) : Opt(O) {}
+
+  void apply(alias &A) const { A.setAliasFor(Opt); }
+};
+
+
+
+
+
+struct extrahelp {
+  StringRef morehelp;
+
+  explicit extrahelp(StringRef help);
+};
+
+void PrintVersionMessage();
+
+
+
+
+
+
+void PrintHelpMessage(bool Hidden = false, bool Categorized = false);
+StringMap<Option *> &getRegisteredOptions(SubCommand &Sub = *TopLevelSubCommand);
+iterator_range<typename SmallPtrSet<SubCommand *, 4>::iterator>
+getRegisteredSubcommands();
+void TokenizeGNUCommandLine(StringRef Source, StringSaver &Saver,
+                            SmallVectorImpl<const char *> &NewArgv,
+                            bool MarkEOLs = false);
+void TokenizeWindowsCommandLine(StringRef Source, StringSaver &Saver,
+                                SmallVectorImpl<const char *> &NewArgv,
+                                bool MarkEOLs = false);
+
+
+
+using TokenizerCallback = void (*)(StringRef Source, StringSaver &Saver,
+                                   SmallVectorImpl<const char *> &NewArgv,
+                                   bool MarkEOLs);
+void tokenizeConfigFile(StringRef Source, StringSaver &Saver,
+                        SmallVectorImpl<const char *> &NewArgv,
+                        bool MarkEOLs = false);
+bool readConfigFile(StringRef CfgFileName, StringSaver &Saver,
+                    SmallVectorImpl<const char *> &Argv);
+bool ExpandResponseFiles(StringSaver &Saver, TokenizerCallback Tokenizer,
+                         SmallVectorImpl<const char *> &Argv,
+                         bool MarkEOLs = false, bool RelativeNames = false);
+void HideUnrelatedOptions(cl::OptionCategory &Category,
+                          SubCommand &Sub = *TopLevelSubCommand);
+void HideUnrelatedOptions(ArrayRef<const cl::OptionCategory *> Categories,
+                          SubCommand &Sub = *TopLevelSubCommand);
+
+
+
+
+void ResetAllOptionOccurrences();
+
+
+
+
+
+void ResetCommandLineParser();
+
+}
+
+}
+
+namespace llvm {
+
+namespace detail {
+
+
+
+template <typename ValT, typename Base, ValT(Base::*Mem)> class OptionKey {
+public:
+  static char ID;
+};
+
+template <typename ValT, typename Base, ValT(Base::*Mem)>
+char OptionKey<ValT, Base, Mem>::ID = 0;
+
+}
+
+
+
+
+
+
+
+class OptionRegistry {
+private:
+  DenseMap<void *, cl::Option *> Options;
+  void addOption(void *Key, cl::Option *O);
+
+public:
+  ~OptionRegistry();
+  OptionRegistry() {}
+
+
+  static OptionRegistry &instance();
+  template <typename ValT, typename Base, ValT(Base::*Mem)>
+  static void registerOption(StringRef ArgStr, StringRef Desc,
+                             const ValT &InitValue) {
+    cl::opt<ValT> *Option = new cl::opt<ValT>(ArgStr, cl::desc(Desc),
+                                              cl::Hidden, cl::init(InitValue));
+    instance().addOption(&detail::OptionKey<ValT, Base, Mem>::ID, Option);
+  }
+  template <typename ValT, typename Base, ValT(Base::*Mem)> ValT get() const {
+    auto It = Options.find(&detail::OptionKey<ValT, Base, Mem>::ID);
+    
+   ((
+   It != Options.end() && "Option not in OptionRegistry"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "It != Options.end() && \"Option not in OptionRegistry\""
+   , "/home/trippels/llvm/llvm/include/llvm/Support/Options.h", 113, __PRETTY_FUNCTION__))
+                                                                ;
+    return *(cl::opt<ValT> *)It->second;
+  }
+};
+
+}
+
+
+
+
+namespace llvm {
+
+class DiagnosticInfo;
+enum DiagnosticSeverity : char;
+class Function;
+class Instruction;
+class LLVMContextImpl;
+class Module;
+class OptBisect;
+template <typename T> class SmallVectorImpl;
+class SMDiagnostic;
+class StringRef;
+class Twine;
+
+namespace yaml {
+
+class Output;
+
+}
+
+namespace SyncScope {
+
+typedef uint8_t ID;
+
+
+
+
+
+enum {
+
+  SingleThread = 0,
+
+
+  System = 1
+};
+
+}
+
+
+
+
+
+
+class LLVMContext {
+public:
+  LLVMContextImpl *const pImpl;
+  LLVMContext();
+  LLVMContext(LLVMContext &) = delete;
+  LLVMContext &operator=(const LLVMContext &) = delete;
+  ~LLVMContext();
+
+
+
+  enum : unsigned {
+    MD_dbg = 0,
+    MD_tbaa = 1,
+    MD_prof = 2,
+    MD_fpmath = 3,
+    MD_range = 4,
+    MD_tbaa_struct = 5,
+    MD_invariant_load = 6,
+    MD_alias_scope = 7,
+    MD_noalias = 8,
+    MD_nontemporal = 9,
+    MD_mem_parallel_loop_access = 10,
+    MD_nonnull = 11,
+    MD_dereferenceable = 12,
+    MD_dereferenceable_or_null = 13,
+    MD_make_implicit = 14,
+    MD_unpredictable = 15,
+    MD_invariant_group = 16,
+    MD_align = 17,
+    MD_loop = 18,
+    MD_type = 19,
+    MD_section_prefix = 20,
+    MD_absolute_symbol = 21,
+    MD_associated = 22,
+    MD_callees = 23,
+    MD_irr_loop = 24,
+  };
+
+
+
+
+
+  enum : unsigned {
+    OB_deopt = 0,
+    OB_funclet = 1,
+    OB_gc_transition = 2,
+  };
+
+
+
+  unsigned getMDKindID(StringRef Name) const;
+
+
+
+  void getMDKindNames(SmallVectorImpl<StringRef> &Result) const;
+
+
+
+
+
+  void getOperandBundleTags(SmallVectorImpl<StringRef> &Result) const;
+
+
+
+  uint32_t getOperandBundleTagID(StringRef Tag) const;
+
+
+
+
+  SyncScope::ID getOrInsertSyncScopeID(StringRef SSN);
+
+
+
+
+  void getSyncScopeNames(SmallVectorImpl<StringRef> &SSNs) const;
+
+
+  void setGC(const Function &Fn, std::string GCName);
+
+
+  const std::string &getGC(const Function &Fn);
+
+
+  void deleteGC(const Function &Fn);
+
+
+
+
+  bool shouldDiscardValueNames() const;
+
+
+
+
+  void setDiscardValueNames(bool Discard);
+
+
+
+  bool isODRUniquingDebugTypes() const;
+  void enableDebugTypeODRUniquing();
+  void disableDebugTypeODRUniquing();
+
+  using InlineAsmDiagHandlerTy = void (*)(const SMDiagnostic&, void *Context,
+                                          unsigned LocCookie);
+
+
+
+  using YieldCallbackTy = void (*)(LLVMContext *Context, void *OpaqueHandle);
+  void setInlineAsmDiagnosticHandler(InlineAsmDiagHandlerTy DiagHandler,
+                                     void *DiagContext = nullptr);
+
+
+
+  InlineAsmDiagHandlerTy getInlineAsmDiagnosticHandler() const;
+
+
+
+  void *getInlineAsmDiagnosticContext() const;
+  void setDiagnosticHandlerCallBack(
+      DiagnosticHandler::DiagnosticHandlerTy DiagHandler,
+      void *DiagContext = nullptr, bool RespectFilters = false);
+
+
+
+
+
+
+
+  void setDiagnosticHandler(std::unique_ptr<DiagnosticHandler> &&DH,
+                            bool RespectFilters = false);
+
+
+
+  DiagnosticHandler::DiagnosticHandlerTy getDiagnosticHandlerCallBack() const;
+
+
+
+  void *getDiagnosticContext() const;
+
+
+
+  const DiagnosticHandler *getDiagHandlerPtr() const;
+
+
+
+  std::unique_ptr<DiagnosticHandler> getDiagnosticHandler();
+
+
+
+  bool getDiagnosticsHotnessRequested() const;
+
+
+  void setDiagnosticsHotnessRequested(bool Requested);
+
+
+
+
+  uint64_t getDiagnosticsHotnessThreshold() const;
+
+
+
+  void setDiagnosticsHotnessThreshold(uint64_t Threshold);
+
+
+
+
+  yaml::Output *getDiagnosticsOutputFile();
+
+
+
+
+
+  void setDiagnosticsOutputFile(std::unique_ptr<yaml::Output> F);
+
+
+
+  static const char *getDiagnosticMessagePrefix(DiagnosticSeverity Severity);
+  void diagnose(const DiagnosticInfo &DI);
+  void setYieldCallback(YieldCallbackTy Callback, void *OpaqueHandle);
+
+
+
+
+
+
+  void yield();
+
+
+
+
+
+
+  void emitError(unsigned LocCookie, const Twine &ErrorStr);
+  void emitError(const Instruction *I, const Twine &ErrorStr);
+  void emitError(const Twine &ErrorStr);
+
+
+
+
+  template <typename ValT, typename Base, ValT(Base::*Mem)>
+  ValT getOption() const {
+    return OptionRegistry::instance().template get<ValT, Base, Mem>();
+  }
+
+
+
+  OptBisect &getOptBisect();
+private:
+
+  friend class Module;
+
+
+
+  void addModule(Module*);
+
+
+  void removeModule(Module*);
+};
+
+
+inline LLVMContext *unwrap(LLVMContextRef P) { return reinterpret_cast<LLVMContext*>(P); } inline LLVMContextRef wrap(const LLVMContext *P) { return reinterpret_cast<LLVMContextRef>(const_cast<LLVMContext*>(P)); }
+
+
+
+inline LLVMContext **unwrap(LLVMContextRef* Tys) {
+  return reinterpret_cast<LLVMContext**>(Tys);
+}
+
+inline LLVMContextRef *wrap(const LLVMContext **Tys) {
+  return reinterpret_cast<LLVMContextRef*>(const_cast<LLVMContext**>(Tys));
+}
+
+}
+
+
+
+
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+namespace llvm {
+
+class Module;
+class ModuleSlotTracker;
+class raw_ostream;
+class Type;
+
+enum LLVMConstants : uint32_t {
+  DEBUG_METADATA_VERSION = 3
+};
+
+
+
+
+class Metadata {
+  friend class ReplaceableMetadataImpl;
+
+
+  const unsigned char SubclassID;
+
+protected:
+
+  enum StorageType { Uniqued, Distinct, Temporary };
+
+
+  unsigned char Storage;
+
+
+  unsigned short SubclassData16 = 0;
+  unsigned SubclassData32 = 0;
+
+public:
+  enum MetadataKind {
+
+MDStringKind,
+
+ConstantAsMetadataKind,
+LocalAsMetadataKind,
+DistinctMDOperandPlaceholderKind,
+
+MDTupleKind,
+DILocationKind,
+DIExpressionKind,
+DIGlobalVariableExpressionKind,
+
+GenericDINodeKind,
+DISubrangeKind,
+DIEnumeratorKind,
+
+
+DIBasicTypeKind,
+DIDerivedTypeKind,
+DICompositeTypeKind,
+DISubroutineTypeKind,
+DIFileKind,
+DICompileUnitKind,
+
+DISubprogramKind,
+
+DILexicalBlockKind,
+DILexicalBlockFileKind,
+DINamespaceKind,
+DIModuleKind,
+
+DITemplateTypeParameterKind,
+DITemplateValueParameterKind,
+
+DIGlobalVariableKind,
+DILocalVariableKind,
+DIObjCPropertyKind,
+DIImportedEntityKind,
+
+DIMacroKind,
+DIMacroFileKind,
+  };
+
+protected:
+  Metadata(unsigned ID, StorageType Storage)
+      : SubclassID(ID), Storage(Storage) {
+    static_assert(sizeof(*this) == 8, "Metadata fields poorly packed");
+  }
+
+  ~Metadata() = default;
+
+
+
+
+
+  void handleChangedOperand(void *, Metadata *) {
+    ::llvm::llvm_unreachable_internal("Unimplemented in Metadata subclass", "/home/trippels/llvm/llvm/include/llvm/IR/Metadata.h", 94);
+  }
+
+public:
+  unsigned getMetadataID() const { return SubclassID; }
+  void dump() const;
+  void dump(const Module *M) const;
+  void print(raw_ostream &OS, const Module *M = nullptr,
+             bool IsForDebug = false) const;
+  void print(raw_ostream &OS, ModuleSlotTracker &MST, const Module *M = nullptr,
+             bool IsForDebug = false) const;
+  void printAsOperand(raw_ostream &OS, const Module *M = nullptr) const;
+  void printAsOperand(raw_ostream &OS, ModuleSlotTracker &MST,
+                      const Module *M = nullptr) const;
+
+};
+
+
+inline Metadata *unwrap(LLVMMetadataRef P) { return reinterpret_cast<Metadata*>(P); } inline LLVMMetadataRef wrap(const Metadata *P) { return reinterpret_cast<LLVMMetadataRef>(const_cast<Metadata*>(P)); } template<typename T> inline T *unwrap(LLVMMetadataRef P) { return cast<T>(unwrap(P)); }
+
+
+inline Metadata **unwrap(LLVMMetadataRef *MDs) {
+  return reinterpret_cast<Metadata**>(MDs);
+}
+
+
+class MDString;
+class ValueAsMetadata;
+class ConstantAsMetadata;
+class LocalAsMetadata;
+class DistinctMDOperandPlaceholder;
+class MDNode;
+class MDTuple;
+class DILocation;
+class DIExpression;
+class DIGlobalVariableExpression;
+class DINode;
+class GenericDINode;
+class DISubrange;
+class DIEnumerator;
+class DIScope;
+class DIType;
+class DIBasicType;
+class DIDerivedType;
+class DICompositeType;
+class DISubroutineType;
+class DIFile;
+class DICompileUnit;
+class DILocalScope;
+class DISubprogram;
+class DILexicalBlockBase;
+class DILexicalBlock;
+class DILexicalBlockFile;
+class DINamespace;
+class DIModule;
+class DITemplateParameter;
+class DITemplateTypeParameter;
+class DITemplateValueParameter;
+class DIVariable;
+class DIGlobalVariable;
+class DILocalVariable;
+class DIObjCProperty;
+class DIImportedEntity;
+class DIMacroNode;
+class DIMacro;
+class DIMacroFile;
+template <> struct isa_impl<MDString, Metadata> { static inline bool doit(const Metadata &MD) { return MD.getMetadataID() == Metadata::MDStringKind; } };
+
+template <> struct isa_impl<ConstantAsMetadata, Metadata> { static inline bool doit(const Metadata &MD) { return MD.getMetadataID() == Metadata::ConstantAsMetadataKind; } };
+template <> struct isa_impl<LocalAsMetadata, Metadata> { static inline bool doit(const Metadata &MD) { return MD.getMetadataID() == Metadata::LocalAsMetadataKind; } };
+template <> struct isa_impl<DistinctMDOperandPlaceholder, Metadata> { static inline bool doit(const Metadata &MD) { return MD.getMetadataID() == Metadata::DistinctMDOperandPlaceholderKind; } };
+
+template <> struct isa_impl<MDTuple, Metadata> { static inline bool doit(const Metadata &MD) { return MD.getMetadataID() == Metadata::MDTupleKind; } };
+template <> struct isa_impl<DILocation, Metadata> { static inline bool doit(const Metadata &MD) { return MD.getMetadataID() == Metadata::DILocationKind; } };
+template <> struct isa_impl<DIExpression, Metadata> { static inline bool doit(const Metadata &MD) { return MD.getMetadataID() == Metadata::DIExpressionKind; } };
+template <> struct isa_impl<DIGlobalVariableExpression, Metadata> { static inline bool doit(const Metadata &MD) { return MD.getMetadataID() == Metadata::DIGlobalVariableExpressionKind; } };
+
+template <> struct isa_impl<GenericDINode, Metadata> { static inline bool doit(const Metadata &MD) { return MD.getMetadataID() == Metadata::GenericDINodeKind; } };
+template <> struct isa_impl<DISubrange, Metadata> { static inline bool doit(const Metadata &MD) { return MD.getMetadataID() == Metadata::DISubrangeKind; } };
+template <> struct isa_impl<DIEnumerator, Metadata> { static inline bool doit(const Metadata &MD) { return MD.getMetadataID() == Metadata::DIEnumeratorKind; } };
+
+
+template <> struct isa_impl<DIBasicType, Metadata> { static inline bool doit(const Metadata &MD) { return MD.getMetadataID() == Metadata::DIBasicTypeKind; } };
+template <> struct isa_impl<DIDerivedType, Metadata> { static inline bool doit(const Metadata &MD) { return MD.getMetadataID() == Metadata::DIDerivedTypeKind; } };
+template <> struct isa_impl<DICompositeType, Metadata> { static inline bool doit(const Metadata &MD) { return MD.getMetadataID() == Metadata::DICompositeTypeKind; } };
+template <> struct isa_impl<DISubroutineType, Metadata> { static inline bool doit(const Metadata &MD) { return MD.getMetadataID() == Metadata::DISubroutineTypeKind; } };
+template <> struct isa_impl<DIFile, Metadata> { static inline bool doit(const Metadata &MD) { return MD.getMetadataID() == Metadata::DIFileKind; } };
+template <> struct isa_impl<DICompileUnit, Metadata> { static inline bool doit(const Metadata &MD) { return MD.getMetadataID() == Metadata::DICompileUnitKind; } };
+
+template <> struct isa_impl<DISubprogram, Metadata> { static inline bool doit(const Metadata &MD) { return MD.getMetadataID() == Metadata::DISubprogramKind; } };
+
+template <> struct isa_impl<DILexicalBlock, Metadata> { static inline bool doit(const Metadata &MD) { return MD.getMetadataID() == Metadata::DILexicalBlockKind; } };
+template <> struct isa_impl<DILexicalBlockFile, Metadata> { static inline bool doit(const Metadata &MD) { return MD.getMetadataID() == Metadata::DILexicalBlockFileKind; } };
+template <> struct isa_impl<DINamespace, Metadata> { static inline bool doit(const Metadata &MD) { return MD.getMetadataID() == Metadata::DINamespaceKind; } };
+template <> struct isa_impl<DIModule, Metadata> { static inline bool doit(const Metadata &MD) { return MD.getMetadataID() == Metadata::DIModuleKind; } };
+
+template <> struct isa_impl<DITemplateTypeParameter, Metadata> { static inline bool doit(const Metadata &MD) { return MD.getMetadataID() == Metadata::DITemplateTypeParameterKind; } };
+template <> struct isa_impl<DITemplateValueParameter, Metadata> { static inline bool doit(const Metadata &MD) { return MD.getMetadataID() == Metadata::DITemplateValueParameterKind; } };
+
+template <> struct isa_impl<DIGlobalVariable, Metadata> { static inline bool doit(const Metadata &MD) { return MD.getMetadataID() == Metadata::DIGlobalVariableKind; } };
+template <> struct isa_impl<DILocalVariable, Metadata> { static inline bool doit(const Metadata &MD) { return MD.getMetadataID() == Metadata::DILocalVariableKind; } };
+template <> struct isa_impl<DIObjCProperty, Metadata> { static inline bool doit(const Metadata &MD) { return MD.getMetadataID() == Metadata::DIObjCPropertyKind; } };
+template <> struct isa_impl<DIImportedEntity, Metadata> { static inline bool doit(const Metadata &MD) { return MD.getMetadataID() == Metadata::DIImportedEntityKind; } };
+
+template <> struct isa_impl<DIMacro, Metadata> { static inline bool doit(const Metadata &MD) { return MD.getMetadataID() == Metadata::DIMacroKind; } };
+template <> struct isa_impl<DIMacroFile, Metadata> { static inline bool doit(const Metadata &MD) { return MD.getMetadataID() == Metadata::DIMacroFileKind; } };
+
+inline raw_ostream &operator<<(raw_ostream &OS, const Metadata &MD) {
+  MD.print(OS);
+  return OS;
+}
+class MetadataAsValue : public Value {
+  friend class ReplaceableMetadataImpl;
+  friend class LLVMContextImpl;
+
+  Metadata *MD;
+
+  MetadataAsValue(Type *Ty, Metadata *MD);
+
+
+  void dropUse() { MD = nullptr; }
+
+public:
+  ~MetadataAsValue();
+
+  static MetadataAsValue *get(LLVMContext &Context, Metadata *MD);
+  static MetadataAsValue *getIfExists(LLVMContext &Context, Metadata *MD);
+
+  Metadata *getMetadata() const { return MD; }
+
+  static bool classof(const Value *V) {
+    return V->getValueID() == MetadataAsValueVal;
+  }
+
+private:
+  void handleChangedMetadata(Metadata *MD);
+  void track();
+  void untrack();
+};
+class MetadataTracking {
+public:
+  static bool track(Metadata *&MD) {
+    return track(&MD, *MD, static_cast<Metadata *>(nullptr));
+  }
+
+
+
+
+
+
+  static bool track(void *Ref, Metadata &MD, Metadata &Owner) {
+    return track(Ref, MD, &Owner);
+  }
+
+
+
+
+
+
+  static bool track(void *Ref, Metadata &MD, MetadataAsValue &Owner) {
+    return track(Ref, MD, &Owner);
+  }
+
+
+
+
+  static void untrack(Metadata *&MD) { untrack(&MD, *MD); }
+  static void untrack(void *Ref, Metadata &MD);
+  static bool retrack(Metadata *&MD, Metadata *&New) {
+    return retrack(&MD, *MD, &New);
+  }
+  static bool retrack(void *Ref, Metadata &MD, void *New);
+
+
+  static bool isReplaceable(const Metadata &MD);
+
+  using OwnerTy = PointerUnion<MetadataAsValue *, Metadata *>;
+
+private:
+
+
+
+  static bool track(void *Ref, Metadata &MD, OwnerTy Owner);
+};
+
+
+
+
+
+
+class ReplaceableMetadataImpl {
+  friend class MetadataTracking;
+
+public:
+  using OwnerTy = MetadataTracking::OwnerTy;
+
+private:
+  LLVMContext &Context;
+  uint64_t NextIndex = 0;
+  SmallDenseMap<void *, std::pair<OwnerTy, uint64_t>, 4> UseMap;
+
+public:
+  ReplaceableMetadataImpl(LLVMContext &Context) : Context(Context) {}
+
+  ~ReplaceableMetadataImpl() {
+    
+   ((
+   UseMap.empty() && "Cannot destroy in-use replaceable metadata"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "UseMap.empty() && \"Cannot destroy in-use replaceable metadata\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Metadata.h", 292, __PRETTY_FUNCTION__))
+                                                                         ;
+  }
+
+  LLVMContext &getContext() const { return Context; }
+
+
+
+
+  void replaceAllUsesWith(Metadata *MD);
+
+
+
+
+
+
+  void resolveAllUses(bool ResolveUsers = true);
+
+private:
+  void addRef(void *Ref, OwnerTy Owner);
+  void dropRef(void *Ref);
+  void moveRef(void *Ref, void *New, const Metadata &MD);
+
+
+
+
+
+  static ReplaceableMetadataImpl *getOrCreate(Metadata &MD);
+
+
+  static ReplaceableMetadataImpl *getIfExists(Metadata &MD);
+
+
+
+
+  static bool isReplaceable(const Metadata &MD);
+};
+class ValueAsMetadata : public Metadata, ReplaceableMetadataImpl {
+  friend class ReplaceableMetadataImpl;
+  friend class LLVMContextImpl;
+
+  Value *V;
+
+
+  void dropUsers() {
+    ReplaceableMetadataImpl::resolveAllUses( false);
+  }
+
+protected:
+  ValueAsMetadata(unsigned ID, Value *V)
+      : Metadata(ID, Uniqued), ReplaceableMetadataImpl(V->getContext()), V(V) {
+    
+   ((
+   V && "Expected valid value"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "V && \"Expected valid value\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Metadata.h", 351, __PRETTY_FUNCTION__))
+                                      ;
+  }
+
+  ~ValueAsMetadata() = default;
+
+public:
+  static ValueAsMetadata *get(Value *V);
+
+  static ConstantAsMetadata *getConstant(Value *C) {
+    return cast<ConstantAsMetadata>(get(C));
+  }
+
+  static LocalAsMetadata *getLocal(Value *Local) {
+    return cast<LocalAsMetadata>(get(Local));
+  }
+
+  static ValueAsMetadata *getIfExists(Value *V);
+
+  static ConstantAsMetadata *getConstantIfExists(Value *C) {
+    return cast_or_null<ConstantAsMetadata>(getIfExists(C));
+  }
+
+  static LocalAsMetadata *getLocalIfExists(Value *Local) {
+    return cast_or_null<LocalAsMetadata>(getIfExists(Local));
+  }
+
+  Value *getValue() const { return V; }
+  Type *getType() const { return V->getType(); }
+  LLVMContext &getContext() const { return V->getContext(); }
+
+  static void handleDeletion(Value *V);
+  static void handleRAUW(Value *From, Value *To);
+
+protected:
+
+
+
+
+
+  void replaceAllUsesWith(Metadata *MD) {
+    ReplaceableMetadataImpl::replaceAllUsesWith(MD);
+  }
+
+public:
+  static bool classof(const Metadata *MD) {
+    return MD->getMetadataID() == LocalAsMetadataKind ||
+           MD->getMetadataID() == ConstantAsMetadataKind;
+  }
+};
+
+class ConstantAsMetadata : public ValueAsMetadata {
+  friend class ValueAsMetadata;
+
+  ConstantAsMetadata(Constant *C)
+      : ValueAsMetadata(ConstantAsMetadataKind, C) {}
+
+public:
+  static ConstantAsMetadata *get(Constant *C) {
+    return ValueAsMetadata::getConstant(C);
+  }
+
+  static ConstantAsMetadata *getIfExists(Constant *C) {
+    return ValueAsMetadata::getConstantIfExists(C);
+  }
+
+  Constant *getValue() const {
+    return cast<Constant>(ValueAsMetadata::getValue());
+  }
+
+  static bool classof(const Metadata *MD) {
+    return MD->getMetadataID() == ConstantAsMetadataKind;
+  }
+};
+
+class LocalAsMetadata : public ValueAsMetadata {
+  friend class ValueAsMetadata;
+
+  LocalAsMetadata(Value *Local)
+      : ValueAsMetadata(LocalAsMetadataKind, Local) {
+    
+   ((
+   !isa<Constant>(Local) && "Expected local value"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!isa<Constant>(Local) && \"Expected local value\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Metadata.h", 430, __PRETTY_FUNCTION__))
+                                                          ;
+  }
+
+public:
+  static LocalAsMetadata *get(Value *Local) {
+    return ValueAsMetadata::getLocal(Local);
+  }
+
+  static LocalAsMetadata *getIfExists(Value *Local) {
+    return ValueAsMetadata::getLocalIfExists(Local);
+  }
+
+  static bool classof(const Metadata *MD) {
+    return MD->getMetadataID() == LocalAsMetadataKind;
+  }
+};
+namespace mdconst {
+
+namespace detail {
+
+template <class T> T &make();
+template <class T, class Result> struct HasDereference {
+  using Yes = char[1];
+  using No = char[2];
+  template <size_t N> struct SFINAE {};
+
+  template <class U, class V>
+  static Yes &hasDereference(SFINAE<sizeof(static_cast<V>(*make<U>()))> * = 0);
+  template <class U, class V> static No &hasDereference(...);
+
+  static const bool value =
+      sizeof(hasDereference<T, Result>(nullptr)) == sizeof(Yes);
+};
+template <class V, class M> struct IsValidPointer {
+  static const bool value = std::is_base_of<Constant, V>::value &&
+                            HasDereference<M, const Metadata &>::value;
+};
+template <class V, class M> struct IsValidReference {
+  static const bool value = std::is_base_of<Constant, V>::value &&
+                            std::is_convertible<M, const Metadata &>::value;
+};
+
+}
+
+
+
+
+
+template <class X, class Y>
+inline typename std::enable_if<detail::IsValidPointer<X, Y>::value, bool>::type
+hasa(Y &&MD) {
+  
+ ((
+ MD && "Null pointer sent into hasa"
+ ) ? static_cast<void> (0) : __assert_fail (
+ "MD && \"Null pointer sent into hasa\""
+ , "/home/trippels/llvm/llvm/include/llvm/IR/Metadata.h", 530, __PRETTY_FUNCTION__))
+                                            ;
+  if (auto *V = dyn_cast<ConstantAsMetadata>(MD))
+    return isa<X>(V->getValue());
+  return false;
+}
+template <class X, class Y>
+inline
+    typename std::enable_if<detail::IsValidReference<X, Y &>::value, bool>::type
+    hasa(Y &MD) {
+  return hasa(&MD);
+}
+
+
+
+
+template <class X, class Y>
+inline typename std::enable_if<detail::IsValidPointer<X, Y>::value, X *>::type
+extract(Y &&MD) {
+  return cast<X>(cast<ConstantAsMetadata>(MD)->getValue());
+}
+template <class X, class Y>
+inline
+    typename std::enable_if<detail::IsValidReference<X, Y &>::value, X *>::type
+    extract(Y &MD) {
+  return extract(&MD);
+}
+
+
+
+
+
+template <class X, class Y>
+inline typename std::enable_if<detail::IsValidPointer<X, Y>::value, X *>::type
+extract_or_null(Y &&MD) {
+  if (auto *V = cast_or_null<ConstantAsMetadata>(MD))
+    return cast<X>(V->getValue());
+  return nullptr;
+}
+
+
+
+
+
+
+template <class X, class Y>
+inline typename std::enable_if<detail::IsValidPointer<X, Y>::value, X *>::type
+dyn_extract(Y &&MD) {
+  if (auto *V = dyn_cast<ConstantAsMetadata>(MD))
+    return dyn_cast<X>(V->getValue());
+  return nullptr;
+}
+
+
+
+
+
+
+template <class X, class Y>
+inline typename std::enable_if<detail::IsValidPointer<X, Y>::value, X *>::type
+dyn_extract_or_null(Y &&MD) {
+  if (auto *V = dyn_cast_or_null<ConstantAsMetadata>(MD))
+    return dyn_cast<X>(V->getValue());
+  return nullptr;
+}
+
+}
+
+
+
+
+
+
+class MDString : public Metadata {
+  friend class StringMapEntry<MDString>;
+
+  StringMapEntry<MDString> *Entry = nullptr;
+
+  MDString() : Metadata(MDStringKind, Uniqued) {}
+
+public:
+  MDString(const MDString &) = delete;
+  MDString &operator=(MDString &&) = delete;
+  MDString &operator=(const MDString &) = delete;
+
+  static MDString *get(LLVMContext &Context, StringRef Str);
+  static MDString *get(LLVMContext &Context, const char *Str) {
+    return get(Context, Str ? StringRef(Str) : StringRef());
+  }
+
+  StringRef getString() const;
+
+  unsigned getLength() const { return (unsigned)getString().size(); }
+
+  using iterator = StringRef::iterator;
+
+
+  iterator begin() const { return getString().begin(); }
+
+
+  iterator end() const { return getString().end(); }
+
+  const unsigned char *bytes_begin() const { return getString().bytes_begin(); }
+  const unsigned char *bytes_end() const { return getString().bytes_end(); }
+
+
+  static bool classof(const Metadata *MD) {
+    return MD->getMetadataID() == MDStringKind;
+  }
+};
+
+
+
+struct AAMDNodes {
+  explicit AAMDNodes(MDNode *T = nullptr, MDNode *S = nullptr,
+                     MDNode *N = nullptr)
+      : TBAA(T), Scope(S), NoAlias(N) {}
+
+  bool operator==(const AAMDNodes &A) const {
+    return TBAA == A.TBAA && Scope == A.Scope && NoAlias == A.NoAlias;
+  }
+
+  bool operator!=(const AAMDNodes &A) const { return !(*this == A); }
+
+  explicit operator bool() const { return TBAA || Scope || NoAlias; }
+
+
+  MDNode *TBAA;
+
+
+  MDNode *Scope;
+
+
+  MDNode *NoAlias;
+
+
+
+
+
+
+  AAMDNodes intersect(const AAMDNodes &Other) {
+    AAMDNodes Result;
+    Result.TBAA = Other.TBAA == TBAA ? TBAA : nullptr;
+    Result.Scope = Other.Scope == Scope ? Scope : nullptr;
+    Result.NoAlias = Other.NoAlias == NoAlias ? NoAlias : nullptr;
+    return Result;
+  }
+};
+
+
+template<>
+struct DenseMapInfo<AAMDNodes> {
+  static inline AAMDNodes getEmptyKey() {
+    return AAMDNodes(DenseMapInfo<MDNode *>::getEmptyKey(),
+                     nullptr, nullptr);
+  }
+
+  static inline AAMDNodes getTombstoneKey() {
+    return AAMDNodes(DenseMapInfo<MDNode *>::getTombstoneKey(),
+                     nullptr, nullptr);
+  }
+
+  static unsigned getHashValue(const AAMDNodes &Val) {
+    return DenseMapInfo<MDNode *>::getHashValue(Val.TBAA) ^
+           DenseMapInfo<MDNode *>::getHashValue(Val.Scope) ^
+           DenseMapInfo<MDNode *>::getHashValue(Val.NoAlias);
+  }
+
+  static bool isEqual(const AAMDNodes &LHS, const AAMDNodes &RHS) {
+    return LHS == RHS;
+  }
+};
+class MDOperand {
+  Metadata *MD = nullptr;
+
+public:
+  MDOperand() = default;
+  MDOperand(MDOperand &&) = delete;
+  MDOperand(const MDOperand &) = delete;
+  MDOperand &operator=(MDOperand &&) = delete;
+  MDOperand &operator=(const MDOperand &) = delete;
+  ~MDOperand() { untrack(); }
+
+  Metadata *get() const { return MD; }
+  operator Metadata *() const { return get(); }
+  Metadata *operator->() const { return get(); }
+  Metadata &operator*() const { return *get(); }
+
+  void reset() {
+    untrack();
+    MD = nullptr;
+  }
+  void reset(Metadata *MD, Metadata *Owner) {
+    untrack();
+    this->MD = MD;
+    track(Owner);
+  }
+
+private:
+  void track(Metadata *Owner) {
+    if (MD) {
+      if (Owner)
+        MetadataTracking::track(this, *MD, *Owner);
+      else
+        MetadataTracking::track(MD);
+    }
+  }
+
+  void untrack() {
+    
+   ((
+   static_cast<void *>(this) == &MD && "Expected same address"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "static_cast<void *>(this) == &MD && \"Expected same address\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Metadata.h", 746, __PRETTY_FUNCTION__))
+                                                                      ;
+    if (MD)
+      MetadataTracking::untrack(MD);
+  }
+};
+
+template <> struct simplify_type<MDOperand> {
+  using SimpleType = Metadata *;
+
+  static SimpleType getSimplifiedValue(MDOperand &MD) { return MD.get(); }
+};
+
+template <> struct simplify_type<const MDOperand> {
+  using SimpleType = Metadata *;
+
+  static SimpleType getSimplifiedValue(const MDOperand &MD) { return MD.get(); }
+};
+
+
+
+
+
+class ContextAndReplaceableUses {
+  PointerUnion<LLVMContext *, ReplaceableMetadataImpl *> Ptr;
+
+public:
+  ContextAndReplaceableUses(LLVMContext &Context) : Ptr(&Context) {}
+  ContextAndReplaceableUses(
+      std::unique_ptr<ReplaceableMetadataImpl> ReplaceableUses)
+      : Ptr(ReplaceableUses.release()) {
+    
+   ((
+   getReplaceableUses() && "Expected non-null replaceable uses"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "getReplaceableUses() && \"Expected non-null replaceable uses\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Metadata.h", 776, __PRETTY_FUNCTION__))
+                                                                       ;
+  }
+  ContextAndReplaceableUses() = delete;
+  ContextAndReplaceableUses(ContextAndReplaceableUses &&) = delete;
+  ContextAndReplaceableUses(const ContextAndReplaceableUses &) = delete;
+  ContextAndReplaceableUses &operator=(ContextAndReplaceableUses &&) = delete;
+  ContextAndReplaceableUses &
+  operator=(const ContextAndReplaceableUses &) = delete;
+  ~ContextAndReplaceableUses() { delete getReplaceableUses(); }
+
+  operator LLVMContext &() { return getContext(); }
+
+
+  bool hasReplaceableUses() const {
+    return Ptr.is<ReplaceableMetadataImpl *>();
+  }
+
+  LLVMContext &getContext() const {
+    if (hasReplaceableUses())
+      return getReplaceableUses()->getContext();
+    return *Ptr.get<LLVMContext *>();
+  }
+
+  ReplaceableMetadataImpl *getReplaceableUses() const {
+    if (hasReplaceableUses())
+      return Ptr.get<ReplaceableMetadataImpl *>();
+    return nullptr;
+  }
+
+
+  ReplaceableMetadataImpl *getOrCreateReplaceableUses() {
+    if (!hasReplaceableUses())
+      makeReplaceable(llvm::make_unique<ReplaceableMetadataImpl>(getContext()));
+    return getReplaceableUses();
+  }
+
+
+
+
+
+  void
+  makeReplaceable(std::unique_ptr<ReplaceableMetadataImpl> ReplaceableUses) {
+    
+   ((
+   ReplaceableUses && "Expected non-null replaceable uses"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "ReplaceableUses && \"Expected non-null replaceable uses\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Metadata.h", 818, __PRETTY_FUNCTION__))
+                                                                  ;
+    
+   ((
+   &ReplaceableUses->getContext() == &getContext() && "Expected same context"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "&ReplaceableUses->getContext() == &getContext() && \"Expected same context\""
+   ,
+                                  "/home/trippels/llvm/llvm/include/llvm/IR/Metadata.h"
+    ,
+                                  820
+    , __PRETTY_FUNCTION__))
+                                   
+                                  ;
+    delete getReplaceableUses();
+    Ptr = ReplaceableUses.release();
+  }
+
+
+
+
+  std::unique_ptr<ReplaceableMetadataImpl> takeReplaceableUses() {
+    
+   ((
+   hasReplaceableUses() && "Expected to own replaceable uses"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "hasReplaceableUses() && \"Expected to own replaceable uses\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Metadata.h", 829, __PRETTY_FUNCTION__))
+                                                                     ;
+    std::unique_ptr<ReplaceableMetadataImpl> ReplaceableUses(
+        getReplaceableUses());
+    Ptr = &ReplaceableUses->getContext();
+    return ReplaceableUses;
+  }
+};
+
+struct TempMDNodeDeleter {
+  inline void operator()(MDNode *Node) const;
+};
+
+
+
+
+
+
+
+
+
+using TempMDNode = std::unique_ptr<MDNode, TempMDNodeDeleter>;
+using TempMDTuple = std::unique_ptr<MDTuple, TempMDNodeDeleter>;
+using TempDILocation = std::unique_ptr<DILocation, TempMDNodeDeleter>;
+using TempDIExpression = std::unique_ptr<DIExpression, TempMDNodeDeleter>;
+using TempDIGlobalVariableExpression = std::unique_ptr<DIGlobalVariableExpression, TempMDNodeDeleter>;
+using TempDINode = std::unique_ptr<DINode, TempMDNodeDeleter>;
+using TempGenericDINode = std::unique_ptr<GenericDINode, TempMDNodeDeleter>;
+using TempDISubrange = std::unique_ptr<DISubrange, TempMDNodeDeleter>;
+using TempDIEnumerator = std::unique_ptr<DIEnumerator, TempMDNodeDeleter>;
+using TempDIScope = std::unique_ptr<DIScope, TempMDNodeDeleter>;
+using TempDIType = std::unique_ptr<DIType, TempMDNodeDeleter>;
+using TempDIBasicType = std::unique_ptr<DIBasicType, TempMDNodeDeleter>;
+using TempDIDerivedType = std::unique_ptr<DIDerivedType, TempMDNodeDeleter>;
+using TempDICompositeType = std::unique_ptr<DICompositeType, TempMDNodeDeleter>;
+using TempDISubroutineType = std::unique_ptr<DISubroutineType, TempMDNodeDeleter>;
+using TempDIFile = std::unique_ptr<DIFile, TempMDNodeDeleter>;
+using TempDICompileUnit = std::unique_ptr<DICompileUnit, TempMDNodeDeleter>;
+using TempDILocalScope = std::unique_ptr<DILocalScope, TempMDNodeDeleter>;
+using TempDISubprogram = std::unique_ptr<DISubprogram, TempMDNodeDeleter>;
+using TempDILexicalBlockBase = std::unique_ptr<DILexicalBlockBase, TempMDNodeDeleter>;
+using TempDILexicalBlock = std::unique_ptr<DILexicalBlock, TempMDNodeDeleter>;
+using TempDILexicalBlockFile = std::unique_ptr<DILexicalBlockFile, TempMDNodeDeleter>;
+using TempDINamespace = std::unique_ptr<DINamespace, TempMDNodeDeleter>;
+using TempDIModule = std::unique_ptr<DIModule, TempMDNodeDeleter>;
+using TempDITemplateParameter = std::unique_ptr<DITemplateParameter, TempMDNodeDeleter>;
+using TempDITemplateTypeParameter = std::unique_ptr<DITemplateTypeParameter, TempMDNodeDeleter>;
+using TempDITemplateValueParameter = std::unique_ptr<DITemplateValueParameter, TempMDNodeDeleter>;
+using TempDIVariable = std::unique_ptr<DIVariable, TempMDNodeDeleter>;
+using TempDIGlobalVariable = std::unique_ptr<DIGlobalVariable, TempMDNodeDeleter>;
+using TempDILocalVariable = std::unique_ptr<DILocalVariable, TempMDNodeDeleter>;
+using TempDIObjCProperty = std::unique_ptr<DIObjCProperty, TempMDNodeDeleter>;
+using TempDIImportedEntity = std::unique_ptr<DIImportedEntity, TempMDNodeDeleter>;
+using TempDIMacroNode = std::unique_ptr<DIMacroNode, TempMDNodeDeleter>;
+using TempDIMacro = std::unique_ptr<DIMacro, TempMDNodeDeleter>;
+using TempDIMacroFile = std::unique_ptr<DIMacroFile, TempMDNodeDeleter>;
+class MDNode : public Metadata {
+  friend class ReplaceableMetadataImpl;
+  friend class LLVMContextImpl;
+
+  unsigned NumOperands;
+  unsigned NumUnresolved;
+
+  ContextAndReplaceableUses Context;
+
+protected:
+  MDNode(LLVMContext &Context, unsigned ID, StorageType Storage,
+         ArrayRef<Metadata *> Ops1, ArrayRef<Metadata *> Ops2 = None);
+  ~MDNode() = default;
+
+  void *operator new(size_t Size, unsigned NumOps);
+  void operator delete(void *Mem);
+
+
+  void operator delete(void *, unsigned) {
+    ::llvm::llvm_unreachable_internal("Constructor throws?", "/home/trippels/llvm/llvm/include/llvm/IR/Metadata.h", 881);
+  }
+
+
+  void operator delete(void *, unsigned, bool) {
+    ::llvm::llvm_unreachable_internal("Constructor throws?", "/home/trippels/llvm/llvm/include/llvm/IR/Metadata.h", 886);
+  }
+
+  void dropAllReferences();
+
+  MDOperand *mutable_begin() { return mutable_end() - NumOperands; }
+  MDOperand *mutable_end() { return reinterpret_cast<MDOperand *>(this); }
+
+  using mutable_op_range = iterator_range<MDOperand *>;
+
+  mutable_op_range mutable_operands() {
+    return mutable_op_range(mutable_begin(), mutable_end());
+  }
+
+public:
+  MDNode(const MDNode &) = delete;
+  void operator=(const MDNode &) = delete;
+  void *operator new(size_t) = delete;
+
+  static inline MDTuple *get(LLVMContext &Context, ArrayRef<Metadata *> MDs);
+  static inline MDTuple *getIfExists(LLVMContext &Context,
+                                     ArrayRef<Metadata *> MDs);
+  static inline MDTuple *getDistinct(LLVMContext &Context,
+                                     ArrayRef<Metadata *> MDs);
+  static inline TempMDTuple getTemporary(LLVMContext &Context,
+                                         ArrayRef<Metadata *> MDs);
+
+
+  TempMDNode clone() const;
+
+
+
+
+
+  static void deleteTemporary(MDNode *N);
+
+  LLVMContext &getContext() const { return Context.getContext(); }
+
+
+  void replaceOperandWith(unsigned I, Metadata *New);
+  bool isResolved() const { return !isTemporary() && !NumUnresolved; }
+
+  bool isUniqued() const { return Storage == Uniqued; }
+  bool isDistinct() const { return Storage == Distinct; }
+  bool isTemporary() const { return Storage == Temporary; }
+
+
+
+
+  void replaceAllUsesWith(Metadata *MD) {
+    
+   ((
+   isTemporary() && "Expected temporary node"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isTemporary() && \"Expected temporary node\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Metadata.h", 948, __PRETTY_FUNCTION__))
+                                                     ;
+    if (Context.hasReplaceableUses())
+      Context.getReplaceableUses()->replaceAllUsesWith(MD);
+  }
+
+
+
+
+
+
+
+  void resolveCycles();
+
+
+  void resolve();
+
+
+
+
+
+  template <class T>
+  static typename std::enable_if<std::is_base_of<MDNode, T>::value, T *>::type
+  replaceWithPermanent(std::unique_ptr<T, TempMDNodeDeleter> N) {
+    return cast<T>(N.release()->replaceWithPermanentImpl());
+  }
+
+
+
+
+
+
+
+  template <class T>
+  static typename std::enable_if<std::is_base_of<MDNode, T>::value, T *>::type
+  replaceWithUniqued(std::unique_ptr<T, TempMDNodeDeleter> N) {
+    return cast<T>(N.release()->replaceWithUniquedImpl());
+  }
+
+
+
+
+
+  template <class T>
+  static typename std::enable_if<std::is_base_of<MDNode, T>::value, T *>::type
+  replaceWithDistinct(std::unique_ptr<T, TempMDNodeDeleter> N) {
+    return cast<T>(N.release()->replaceWithDistinctImpl());
+  }
+
+private:
+  MDNode *replaceWithPermanentImpl();
+  MDNode *replaceWithUniquedImpl();
+  MDNode *replaceWithDistinctImpl();
+
+protected:
+
+
+
+  void setOperand(unsigned I, Metadata *New);
+
+  void storeDistinctInContext();
+  template <class T, class StoreT>
+  static T *storeImpl(T *N, StorageType Storage, StoreT &Store);
+  template <class T> static T *storeImpl(T *N, StorageType Storage);
+
+private:
+  void handleChangedOperand(void *Ref, Metadata *New);
+
+
+  void dropReplaceableUses();
+
+  void resolveAfterOperandChange(Metadata *Old, Metadata *New);
+  void decrementUnresolvedOperandCount();
+  void countUnresolvedOperands();
+
+
+
+
+
+
+  void makeUniqued();
+
+
+
+
+
+  void makeDistinct();
+
+  void deleteAsSubclass();
+  MDNode *uniquify();
+  void eraseFromStore();
+
+  template <class NodeTy> struct HasCachedHash;
+  template <class NodeTy>
+  static void dispatchRecalculateHash(NodeTy *N, std::true_type) {
+    N->recalculateHash();
+  }
+  template <class NodeTy>
+  static void dispatchRecalculateHash(NodeTy *, std::false_type) {}
+  template <class NodeTy>
+  static void dispatchResetHash(NodeTy *N, std::true_type) {
+    N->setHash(0);
+  }
+  template <class NodeTy>
+  static void dispatchResetHash(NodeTy *, std::false_type) {}
+
+public:
+  using op_iterator = const MDOperand *;
+  using op_range = iterator_range<op_iterator>;
+
+  op_iterator op_begin() const {
+    return const_cast<MDNode *>(this)->mutable_begin();
+  }
+
+  op_iterator op_end() const {
+    return const_cast<MDNode *>(this)->mutable_end();
+  }
+
+  op_range operands() const { return op_range(op_begin(), op_end()); }
+
+  const MDOperand &getOperand(unsigned I) const {
+    
+   ((
+   I < NumOperands && "Out of range"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "I < NumOperands && \"Out of range\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Metadata.h", 1068, __PRETTY_FUNCTION__))
+                                            ;
+    return op_begin()[I];
+  }
+
+
+  unsigned getNumOperands() const { return NumOperands; }
+
+
+  static bool classof(const Metadata *MD) {
+    switch (MD->getMetadataID()) {
+    default:
+      return false;
+
+
+
+
+
+
+
+
+
+case MDTupleKind: return true;
+case DILocationKind: return true;
+case DIExpressionKind: return true;
+case DIGlobalVariableExpressionKind: return true;
+
+case GenericDINodeKind: return true;
+case DISubrangeKind: return true;
+case DIEnumeratorKind: return true;
+
+
+case DIBasicTypeKind: return true;
+case DIDerivedTypeKind: return true;
+case DICompositeTypeKind: return true;
+case DISubroutineTypeKind: return true;
+case DIFileKind: return true;
+case DICompileUnitKind: return true;
+
+case DISubprogramKind: return true;
+
+case DILexicalBlockKind: return true;
+case DILexicalBlockFileKind: return true;
+case DINamespaceKind: return true;
+case DIModuleKind: return true;
+
+case DITemplateTypeParameterKind: return true;
+case DITemplateValueParameterKind: return true;
+
+case DIGlobalVariableKind: return true;
+case DILocalVariableKind: return true;
+case DIObjCPropertyKind: return true;
+case DIImportedEntityKind: return true;
+
+case DIMacroKind: return true;
+case DIMacroFileKind: return true;
+    }
+  }
+
+
+  bool isTBAAVtableAccess() const;
+
+
+  static MDNode *concatenate(MDNode *A, MDNode *B);
+  static MDNode *intersect(MDNode *A, MDNode *B);
+  static MDNode *getMostGenericTBAA(MDNode *A, MDNode *B);
+  static MDNode *getMostGenericFPMath(MDNode *A, MDNode *B);
+  static MDNode *getMostGenericRange(MDNode *A, MDNode *B);
+  static MDNode *getMostGenericAliasScope(MDNode *A, MDNode *B);
+  static MDNode *getMostGenericAlignmentOrDereferenceable(MDNode *A, MDNode *B);
+};
+
+
+
+
+
+class MDTuple : public MDNode {
+  friend class LLVMContextImpl;
+  friend class MDNode;
+
+  MDTuple(LLVMContext &C, StorageType Storage, unsigned Hash,
+          ArrayRef<Metadata *> Vals)
+      : MDNode(C, MDTupleKind, Storage, Vals) {
+    setHash(Hash);
+  }
+
+  ~MDTuple() { dropAllReferences(); }
+
+  void setHash(unsigned Hash) { SubclassData32 = Hash; }
+  void recalculateHash();
+
+  static MDTuple *getImpl(LLVMContext &Context, ArrayRef<Metadata *> MDs,
+                          StorageType Storage, bool ShouldCreate = true);
+
+  TempMDTuple cloneImpl() const {
+    return getTemporary(getContext(),
+                        SmallVector<Metadata *, 4>(op_begin(), op_end()));
+  }
+
+public:
+
+  unsigned getHash() const { return SubclassData32; }
+
+  static MDTuple *get(LLVMContext &Context, ArrayRef<Metadata *> MDs) {
+    return getImpl(Context, MDs, Uniqued);
+  }
+
+  static MDTuple *getIfExists(LLVMContext &Context, ArrayRef<Metadata *> MDs) {
+    return getImpl(Context, MDs, Uniqued, false);
+  }
+
+
+
+
+  static MDTuple *getDistinct(LLVMContext &Context, ArrayRef<Metadata *> MDs) {
+    return getImpl(Context, MDs, Distinct);
+  }
+
+
+
+
+
+
+  static TempMDTuple getTemporary(LLVMContext &Context,
+                                  ArrayRef<Metadata *> MDs) {
+    return TempMDTuple(getImpl(Context, MDs, Temporary));
+  }
+
+
+  TempMDTuple clone() const { return cloneImpl(); }
+
+  static bool classof(const Metadata *MD) {
+    return MD->getMetadataID() == MDTupleKind;
+  }
+};
+
+MDTuple *MDNode::get(LLVMContext &Context, ArrayRef<Metadata *> MDs) {
+  return MDTuple::get(Context, MDs);
+}
+
+MDTuple *MDNode::getIfExists(LLVMContext &Context, ArrayRef<Metadata *> MDs) {
+  return MDTuple::getIfExists(Context, MDs);
+}
+
+MDTuple *MDNode::getDistinct(LLVMContext &Context, ArrayRef<Metadata *> MDs) {
+  return MDTuple::getDistinct(Context, MDs);
+}
+
+TempMDTuple MDNode::getTemporary(LLVMContext &Context,
+                                 ArrayRef<Metadata *> MDs) {
+  return MDTuple::getTemporary(Context, MDs);
+}
+
+void TempMDNodeDeleter::operator()(MDNode *Node) const {
+  MDNode::deleteTemporary(Node);
+}
+
+
+
+
+
+template <class T>
+class TypedMDOperandIterator
+    : public std::iterator<std::input_iterator_tag, T *, std::ptrdiff_t, void,
+                           T *> {
+  MDNode::op_iterator I = nullptr;
+
+public:
+  TypedMDOperandIterator() = default;
+  explicit TypedMDOperandIterator(MDNode::op_iterator I) : I(I) {}
+
+  T *operator*() const { return cast_or_null<T>(*I); }
+
+  TypedMDOperandIterator &operator++() {
+    ++I;
+    return *this;
+  }
+
+  TypedMDOperandIterator operator++(int) {
+    TypedMDOperandIterator Temp(*this);
+    ++I;
+    return Temp;
+  }
+
+  bool operator==(const TypedMDOperandIterator &X) const { return I == X.I; }
+  bool operator!=(const TypedMDOperandIterator &X) const { return I != X.I; }
+};
+
+
+
+
+
+template <class T> class MDTupleTypedArrayWrapper {
+  const MDTuple *N = nullptr;
+
+public:
+  MDTupleTypedArrayWrapper() = default;
+  MDTupleTypedArrayWrapper(const MDTuple *N) : N(N) {}
+
+  template <class U>
+  MDTupleTypedArrayWrapper(
+      const MDTupleTypedArrayWrapper<U> &Other,
+      typename std::enable_if<std::is_convertible<U *, T *>::value>::type * =
+          nullptr)
+      : N(Other.get()) {}
+
+  template <class U>
+  explicit MDTupleTypedArrayWrapper(
+      const MDTupleTypedArrayWrapper<U> &Other,
+      typename std::enable_if<!std::is_convertible<U *, T *>::value>::type * =
+          nullptr)
+      : N(Other.get()) {}
+
+  explicit operator bool() const { return get(); }
+  explicit operator MDTuple *() const { return get(); }
+
+  MDTuple *get() const { return const_cast<MDTuple *>(N); }
+  MDTuple *operator->() const { return get(); }
+  MDTuple &operator*() const { return *get(); }
+
+
+  unsigned size() const { return N ? N->getNumOperands() : 0u; }
+  bool empty() const { return N ? N->getNumOperands() == 0 : true; }
+  T *operator[](unsigned I) const { return cast_or_null<T>(N->getOperand(I)); }
+
+
+  using iterator = TypedMDOperandIterator<T>;
+
+  iterator begin() const { return N ? iterator(N->op_begin()) : iterator(); }
+  iterator end() const { return N ? iterator(N->op_end()) : iterator(); }
+};
+
+
+
+using MDStringArray = MDTupleTypedArrayWrapper<MDString>;
+using ValueAsMetadataArray = MDTupleTypedArrayWrapper<ValueAsMetadata>;
+using ConstantAsMetadataArray = MDTupleTypedArrayWrapper<ConstantAsMetadata>;
+using LocalAsMetadataArray = MDTupleTypedArrayWrapper<LocalAsMetadata>;
+using DistinctMDOperandPlaceholderArray = MDTupleTypedArrayWrapper<DistinctMDOperandPlaceholder>;
+using MDNodeArray = MDTupleTypedArrayWrapper<MDNode>;
+using MDTupleArray = MDTupleTypedArrayWrapper<MDTuple>;
+using DILocationArray = MDTupleTypedArrayWrapper<DILocation>;
+using DIExpressionArray = MDTupleTypedArrayWrapper<DIExpression>;
+using DIGlobalVariableExpressionArray = MDTupleTypedArrayWrapper<DIGlobalVariableExpression>;
+using DINodeArray = MDTupleTypedArrayWrapper<DINode>;
+using GenericDINodeArray = MDTupleTypedArrayWrapper<GenericDINode>;
+using DISubrangeArray = MDTupleTypedArrayWrapper<DISubrange>;
+using DIEnumeratorArray = MDTupleTypedArrayWrapper<DIEnumerator>;
+using DIScopeArray = MDTupleTypedArrayWrapper<DIScope>;
+using DITypeArray = MDTupleTypedArrayWrapper<DIType>;
+using DIBasicTypeArray = MDTupleTypedArrayWrapper<DIBasicType>;
+using DIDerivedTypeArray = MDTupleTypedArrayWrapper<DIDerivedType>;
+using DICompositeTypeArray = MDTupleTypedArrayWrapper<DICompositeType>;
+using DISubroutineTypeArray = MDTupleTypedArrayWrapper<DISubroutineType>;
+using DIFileArray = MDTupleTypedArrayWrapper<DIFile>;
+using DICompileUnitArray = MDTupleTypedArrayWrapper<DICompileUnit>;
+using DILocalScopeArray = MDTupleTypedArrayWrapper<DILocalScope>;
+using DISubprogramArray = MDTupleTypedArrayWrapper<DISubprogram>;
+using DILexicalBlockBaseArray = MDTupleTypedArrayWrapper<DILexicalBlockBase>;
+using DILexicalBlockArray = MDTupleTypedArrayWrapper<DILexicalBlock>;
+using DILexicalBlockFileArray = MDTupleTypedArrayWrapper<DILexicalBlockFile>;
+using DINamespaceArray = MDTupleTypedArrayWrapper<DINamespace>;
+using DIModuleArray = MDTupleTypedArrayWrapper<DIModule>;
+using DITemplateParameterArray = MDTupleTypedArrayWrapper<DITemplateParameter>;
+using DITemplateTypeParameterArray = MDTupleTypedArrayWrapper<DITemplateTypeParameter>;
+using DITemplateValueParameterArray = MDTupleTypedArrayWrapper<DITemplateValueParameter>;
+using DIVariableArray = MDTupleTypedArrayWrapper<DIVariable>;
+using DIGlobalVariableArray = MDTupleTypedArrayWrapper<DIGlobalVariable>;
+using DILocalVariableArray = MDTupleTypedArrayWrapper<DILocalVariable>;
+using DIObjCPropertyArray = MDTupleTypedArrayWrapper<DIObjCProperty>;
+using DIImportedEntityArray = MDTupleTypedArrayWrapper<DIImportedEntity>;
+using DIMacroNodeArray = MDTupleTypedArrayWrapper<DIMacroNode>;
+using DIMacroArray = MDTupleTypedArrayWrapper<DIMacro>;
+using DIMacroFileArray = MDTupleTypedArrayWrapper<DIMacroFile>;
+class DistinctMDOperandPlaceholder : public Metadata {
+  friend class MetadataTracking;
+
+  Metadata **Use = nullptr;
+
+public:
+  explicit DistinctMDOperandPlaceholder(unsigned ID)
+      : Metadata(DistinctMDOperandPlaceholderKind, Distinct) {
+    SubclassData32 = ID;
+  }
+
+  DistinctMDOperandPlaceholder() = delete;
+  DistinctMDOperandPlaceholder(DistinctMDOperandPlaceholder &&) = delete;
+  DistinctMDOperandPlaceholder(const DistinctMDOperandPlaceholder &) = delete;
+
+  ~DistinctMDOperandPlaceholder() {
+    if (Use)
+      *Use = nullptr;
+  }
+
+  unsigned getID() const { return SubclassData32; }
+
+
+  void replaceUseWith(Metadata *MD) {
+    if (!Use)
+      return;
+    *Use = MD;
+
+    if (*Use)
+      MetadataTracking::track(*Use);
+
+    Metadata *T = cast<Metadata>(this);
+    MetadataTracking::untrack(T);
+    
+   ((
+   !Use && "Use is still being tracked despite being untracked!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!Use && \"Use is still being tracked despite being untracked!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Metadata.h", 1312, __PRETTY_FUNCTION__))
+                                                                        ;
+  }
+};
+class NamedMDNode : public ilist_node<NamedMDNode> {
+  friend class LLVMContextImpl;
+  friend class Module;
+
+  std::string Name;
+  Module *Parent = nullptr;
+  void *Operands;
+
+  void setParent(Module *M) { Parent = M; }
+
+  explicit NamedMDNode(const Twine &N);
+
+  template<class T1, class T2>
+  class op_iterator_impl :
+      public std::iterator<std::bidirectional_iterator_tag, T2> {
+    friend class NamedMDNode;
+
+    const NamedMDNode *Node = nullptr;
+    unsigned Idx = 0;
+
+    op_iterator_impl(const NamedMDNode *N, unsigned i) : Node(N), Idx(i) {}
+
+  public:
+    op_iterator_impl() = default;
+
+    bool operator==(const op_iterator_impl &o) const { return Idx == o.Idx; }
+    bool operator!=(const op_iterator_impl &o) const { return Idx != o.Idx; }
+
+    op_iterator_impl &operator++() {
+      ++Idx;
+      return *this;
+    }
+
+    op_iterator_impl operator++(int) {
+      op_iterator_impl tmp(*this);
+      operator++();
+      return tmp;
+    }
+
+    op_iterator_impl &operator--() {
+      --Idx;
+      return *this;
+    }
+
+    op_iterator_impl operator--(int) {
+      op_iterator_impl tmp(*this);
+      operator--();
+      return tmp;
+    }
+
+    T1 operator*() const { return Node->getOperand(Idx); }
+  };
+
+public:
+  NamedMDNode(const NamedMDNode &) = delete;
+  ~NamedMDNode();
+
+
+  void eraseFromParent();
+
+
+  void dropAllReferences() { clearOperands(); }
+
+  void clearOperands();
+
+
+  inline Module *getParent() { return Parent; }
+  inline const Module *getParent() const { return Parent; }
+
+  MDNode *getOperand(unsigned i) const;
+  unsigned getNumOperands() const;
+  void addOperand(MDNode *M);
+  void setOperand(unsigned I, MDNode *New);
+  StringRef getName() const;
+  void print(raw_ostream &ROS, bool IsForDebug = false) const;
+  void print(raw_ostream &ROS, ModuleSlotTracker &MST,
+             bool IsForDebug = false) const;
+  void dump() const;
+
+
+
+
+  using op_iterator = op_iterator_impl<MDNode *, MDNode>;
+
+  op_iterator op_begin() { return op_iterator(this, 0); }
+  op_iterator op_end() { return op_iterator(this, getNumOperands()); }
+
+  using const_op_iterator = op_iterator_impl<const MDNode *, MDNode>;
+
+  const_op_iterator op_begin() const { return const_op_iterator(this, 0); }
+  const_op_iterator op_end() const { return const_op_iterator(this, getNumOperands()); }
+
+  inline iterator_range<op_iterator> operands() {
+    return make_range(op_begin(), op_end());
+  }
+  inline iterator_range<const_op_iterator> operands() const {
+    return make_range(op_begin(), op_end());
+  }
+};
+
+}
+
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+namespace llvm {
+
+
+
+
+class TrackingMDRef {
+  Metadata *MD = nullptr;
+
+public:
+  TrackingMDRef() = default;
+  explicit TrackingMDRef(Metadata *MD) : MD(MD) { track(); }
+
+  TrackingMDRef(TrackingMDRef &&X) : MD(X.MD) { retrack(X); }
+  TrackingMDRef(const TrackingMDRef &X) : MD(X.MD) { track(); }
+
+  TrackingMDRef &operator=(TrackingMDRef &&X) {
+    if (&X == this)
+      return *this;
+
+    untrack();
+    MD = X.MD;
+    retrack(X);
+    return *this;
+  }
+
+  TrackingMDRef &operator=(const TrackingMDRef &X) {
+    if (&X == this)
+      return *this;
+
+    untrack();
+    MD = X.MD;
+    track();
+    return *this;
+  }
+
+  ~TrackingMDRef() { untrack(); }
+
+  Metadata *get() const { return MD; }
+  operator Metadata *() const { return get(); }
+  Metadata *operator->() const { return get(); }
+  Metadata &operator*() const { return *get(); }
+
+  void reset() {
+    untrack();
+    MD = nullptr;
+  }
+  void reset(Metadata *MD) {
+    untrack();
+    this->MD = MD;
+    track();
+  }
+
+
+
+
+  bool hasTrivialDestructor() const {
+    return !MD || !MetadataTracking::isReplaceable(*MD);
+  }
+
+  bool operator==(const TrackingMDRef &X) const { return MD == X.MD; }
+  bool operator!=(const TrackingMDRef &X) const { return MD != X.MD; }
+
+private:
+  void track() {
+    if (MD)
+      MetadataTracking::track(MD);
+  }
+
+  void untrack() {
+    if (MD)
+      MetadataTracking::untrack(MD);
+  }
+
+  void retrack(TrackingMDRef &X) {
+    
+   ((
+   MD == X.MD && "Expected values to match"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "MD == X.MD && \"Expected values to match\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/TrackingMDRef.h", 95, __PRETTY_FUNCTION__))
+                                                   ;
+    if (X.MD) {
+      MetadataTracking::retrack(X.MD, MD);
+      X.MD = nullptr;
+    }
+  }
+};
+
+
+
+
+
+template <class T> class TypedTrackingMDRef {
+  TrackingMDRef Ref;
+
+public:
+  TypedTrackingMDRef() = default;
+  explicit TypedTrackingMDRef(T *MD) : Ref(static_cast<Metadata *>(MD)) {}
+
+  TypedTrackingMDRef(TypedTrackingMDRef &&X) : Ref(std::move(X.Ref)) {}
+  TypedTrackingMDRef(const TypedTrackingMDRef &X) : Ref(X.Ref) {}
+
+  TypedTrackingMDRef &operator=(TypedTrackingMDRef &&X) {
+    Ref = std::move(X.Ref);
+    return *this;
+  }
+
+  TypedTrackingMDRef &operator=(const TypedTrackingMDRef &X) {
+    Ref = X.Ref;
+    return *this;
+  }
+
+  T *get() const { return (T *)Ref.get(); }
+  operator T *() const { return get(); }
+  T *operator->() const { return get(); }
+  T &operator*() const { return *get(); }
+
+  bool operator==(const TypedTrackingMDRef &X) const { return Ref == X.Ref; }
+  bool operator!=(const TypedTrackingMDRef &X) const { return Ref != X.Ref; }
+
+  void reset() { Ref.reset(); }
+  void reset(T *MD) { Ref.reset(static_cast<Metadata *>(MD)); }
+
+
+  bool hasTrivialDestructor() const { return Ref.hasTrivialDestructor(); }
+};
+
+using TrackingMDNodeRef = TypedTrackingMDRef<MDNode>;
+using TrackingValueAsMetadataRef = TypedTrackingMDRef<ValueAsMetadata>;
+
+
+template <> struct simplify_type<TrackingMDRef> {
+  using SimpleType = Metadata *;
+
+  static SimpleType getSimplifiedValue(TrackingMDRef &MD) { return MD.get(); }
+};
+
+template <> struct simplify_type<const TrackingMDRef> {
+  using SimpleType = Metadata *;
+
+  static SimpleType getSimplifiedValue(const TrackingMDRef &MD) {
+    return MD.get();
+  }
+};
+
+template <class T> struct simplify_type<TypedTrackingMDRef<T>> {
+  using SimpleType = T *;
+
+  static SimpleType getSimplifiedValue(TypedTrackingMDRef<T> &MD) {
+    return MD.get();
+  }
+};
+
+template <class T> struct simplify_type<const TypedTrackingMDRef<T>> {
+  using SimpleType = T *;
+
+  static SimpleType getSimplifiedValue(const TypedTrackingMDRef<T> &MD) {
+    return MD.get();
+  }
+};
+
+}
+
+
+namespace llvm {
+
+  class LLVMContext;
+  class raw_ostream;
+  class DILocation;
+  class DebugLoc {
+    TrackingMDNodeRef Loc;
+
+  public:
+    DebugLoc() = default;
+
+
+    DebugLoc(const DILocation *L);
+
+
+
+
+
+
+
+    explicit DebugLoc(const MDNode *N);
+
+
+
+
+
+    DILocation *get() const;
+    operator DILocation *() const { return get(); }
+    DILocation *operator->() const { return get(); }
+    DILocation &operator*() const { return *get(); }
+    explicit operator bool() const { return Loc; }
+
+
+    bool hasTrivialDestructor() const { return Loc.hasTrivialDestructor(); }
+    static DebugLoc get(unsigned Line, unsigned Col, const MDNode *Scope,
+                        const MDNode *InlinedAt = nullptr);
+
+    enum { ReplaceLastInlinedAt = true };
+
+
+
+
+    static DebugLoc appendInlinedAt(DebugLoc DL, DILocation *InlinedAt,
+                                    LLVMContext &Ctx,
+                                    DenseMap<const MDNode *, MDNode *> &Cache,
+                                    bool ReplaceLast = false);
+
+    unsigned getLine() const;
+    unsigned getCol() const;
+    MDNode *getScope() const;
+    DILocation *getInlinedAt() const;
+
+
+
+
+    MDNode *getInlinedAtScope() const;
+    DebugLoc getFnDebugLoc() const;
+
+
+    MDNode *getAsMDNode() const { return Loc; }
+
+    bool operator==(const DebugLoc &DL) const { return Loc == DL.Loc; }
+    bool operator!=(const DebugLoc &DL) const { return Loc != DL.Loc; }
+
+    void dump() const;
+
+
+    void print(raw_ostream &OS) const;
+  };
+
+}
+namespace llvm {
+
+class Argument;
+class BasicBlock;
+class Function;
+class GlobalAlias;
+class GlobalIFunc;
+class GlobalVariable;
+class Instruction;
+class Module;
+class ValueSymbolTable;
+
+
+
+
+
+template <typename NodeTy> struct SymbolTableListParentType {};
+
+
+
+template <> struct SymbolTableListParentType<Instruction> { using type = BasicBlock; };
+template <> struct SymbolTableListParentType<BasicBlock> { using type = Function; };
+template <> struct SymbolTableListParentType<Argument> { using type = Function; };
+template <> struct SymbolTableListParentType<Function> { using type = Module; };
+template <> struct SymbolTableListParentType<GlobalVariable> { using type = Module; };
+template <> struct SymbolTableListParentType<GlobalAlias> { using type = Module; };
+template <> struct SymbolTableListParentType<GlobalIFunc> { using type = Module; };
+
+
+template <typename NodeTy> class SymbolTableList;
+
+
+
+
+template <typename ValueSubClass>
+class SymbolTableListTraits : public ilist_alloc_traits<ValueSubClass> {
+  using ListTy = SymbolTableList<ValueSubClass>;
+  using iterator = typename simple_ilist<ValueSubClass>::iterator;
+  using ItemParentClass =
+      typename SymbolTableListParentType<ValueSubClass>::type;
+
+public:
+  SymbolTableListTraits() = default;
+
+private:
+
+
+  ItemParentClass *getListOwner() {
+    size_t Offset(size_t(&((ItemParentClass*)nullptr->*ItemParentClass::
+                           getSublistAccess(static_cast<ValueSubClass*>(nullptr)))));
+    ListTy *Anchor(static_cast<ListTy *>(this));
+    return reinterpret_cast<ItemParentClass*>(reinterpret_cast<char*>(Anchor)-
+                                              Offset);
+  }
+
+  static ListTy &getList(ItemParentClass *Par) {
+    return Par->*(Par->getSublistAccess((ValueSubClass*)nullptr));
+  }
+
+  static ValueSymbolTable *getSymTab(ItemParentClass *Par) {
+    return Par ? toPtr(Par->getValueSymbolTable()) : nullptr;
+  }
+
+public:
+  void addNodeToList(ValueSubClass *V);
+  void removeNodeFromList(ValueSubClass *V);
+  void transferNodesFromList(SymbolTableListTraits &L2, iterator first,
+                             iterator last);
+
+  template<typename TPtr>
+  void setSymTabObject(TPtr *, TPtr);
+  static ValueSymbolTable *toPtr(ValueSymbolTable *P) { return P; }
+  static ValueSymbolTable *toPtr(ValueSymbolTable &R) { return &R; }
+};
+
+
+
+
+
+
+template <class T>
+class SymbolTableList
+    : public iplist_impl<simple_ilist<T>, SymbolTableListTraits<T>> {};
+
+}
+
+
+
+
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+namespace llvm {
+
+class BasicBlock;
+class FastMathFlags;
+class MDNode;
+class Module;
+struct AAMDNodes;
+
+template <> struct ilist_alloc_traits<Instruction> {
+  static inline void deleteNode(Instruction *V);
+};
+
+class Instruction : public User,
+                    public ilist_node_with_parent<Instruction, BasicBlock> {
+  BasicBlock *Parent;
+  DebugLoc DbgLoc;
+
+  enum {
+
+
+    HasMetadataBit = 1 << 15
+  };
+
+protected:
+  ~Instruction();
+
+public:
+  Instruction(const Instruction &) = delete;
+  Instruction &operator=(const Instruction &) = delete;
+
+
+
+  Instruction *user_back() { return cast<Instruction>(*user_begin());}
+  const Instruction *user_back() const { return cast<Instruction>(*user_begin());}
+
+  inline const BasicBlock *getParent() const { return Parent; }
+  inline BasicBlock *getParent() { return Parent; }
+
+
+
+
+
+
+  const Module *getModule() const;
+  Module *getModule() {
+    return const_cast<Module *>(
+                           static_cast<const Instruction *>(this)->getModule());
+  }
+
+
+
+
+
+  const Function *getFunction() const;
+  Function *getFunction() {
+    return const_cast<Function *>(
+                         static_cast<const Instruction *>(this)->getFunction());
+  }
+
+
+
+  void removeFromParent();
+
+
+
+
+  SymbolTableList<Instruction>::iterator eraseFromParent();
+
+
+
+  void insertBefore(Instruction *InsertPos);
+
+
+
+  void insertAfter(Instruction *InsertPos);
+
+
+
+  void moveBefore(Instruction *MovePos);
+
+
+
+
+  void moveBefore(BasicBlock &BB, SymbolTableList<Instruction>::iterator I);
+
+
+
+  void moveAfter(Instruction *MovePos);
+
+
+
+
+
+
+  unsigned getOpcode() const { return getValueID() - InstructionVal; }
+
+  const char *getOpcodeName() const { return getOpcodeName(getOpcode()); }
+  bool isTerminator() const { return isTerminator(getOpcode()); }
+  bool isBinaryOp() const { return isBinaryOp(getOpcode()); }
+  bool isShift() { return isShift(getOpcode()); }
+  bool isCast() const { return isCast(getOpcode()); }
+  bool isFuncletPad() const { return isFuncletPad(getOpcode()); }
+
+  static const char* getOpcodeName(unsigned OpCode);
+
+  static inline bool isTerminator(unsigned OpCode) {
+    return OpCode >= TermOpsBegin && OpCode < TermOpsEnd;
+  }
+
+  static inline bool isBinaryOp(unsigned Opcode) {
+    return Opcode >= BinaryOpsBegin && Opcode < BinaryOpsEnd;
+  }
+
+
+  static inline bool isShift(unsigned Opcode) {
+    return Opcode >= Shl && Opcode <= AShr;
+  }
+
+
+  inline bool isLogicalShift() const {
+    return getOpcode() == Shl || getOpcode() == LShr;
+  }
+
+
+  inline bool isArithmeticShift() const {
+    return getOpcode() == AShr;
+  }
+
+
+  static inline bool isBitwiseLogicOp(unsigned Opcode) {
+    return Opcode == And || Opcode == Or || Opcode == Xor;
+  }
+
+
+  inline bool isBitwiseLogicOp() const {
+    return isBitwiseLogicOp(getOpcode());
+  }
+
+
+  static inline bool isCast(unsigned OpCode) {
+    return OpCode >= CastOpsBegin && OpCode < CastOpsEnd;
+  }
+
+
+  static inline bool isFuncletPad(unsigned OpCode) {
+    return OpCode >= FuncletPadOpsBegin && OpCode < FuncletPadOpsEnd;
+  }
+
+
+
+
+
+
+  bool hasMetadata() const { return DbgLoc || hasMetadataHashEntry(); }
+
+
+
+  bool hasMetadataOtherThanDebugLoc() const {
+    return hasMetadataHashEntry();
+  }
+
+
+
+  MDNode *getMetadata(unsigned KindID) const {
+    if (!hasMetadata()) return nullptr;
+    return getMetadataImpl(KindID);
+  }
+
+
+
+  MDNode *getMetadata(StringRef Kind) const {
+    if (!hasMetadata()) return nullptr;
+    return getMetadataImpl(Kind);
+  }
+
+
+
+
+  void
+  getAllMetadata(SmallVectorImpl<std::pair<unsigned, MDNode *>> &MDs) const {
+    if (hasMetadata())
+      getAllMetadataImpl(MDs);
+  }
+
+
+
+  void getAllMetadataOtherThanDebugLoc(
+      SmallVectorImpl<std::pair<unsigned, MDNode *>> &MDs) const {
+    if (hasMetadataOtherThanDebugLoc())
+      getAllMetadataOtherThanDebugLocImpl(MDs);
+  }
+
+
+
+
+  void getAAMetadata(AAMDNodes &N, bool Merge = false) const;
+
+
+
+  void setMetadata(unsigned KindID, MDNode *Node);
+  void setMetadata(StringRef Kind, MDNode *Node);
+
+
+
+
+  void copyMetadata(const Instruction &SrcInst,
+                    ArrayRef<unsigned> WL = ArrayRef<unsigned>());
+
+
+
+
+  void swapProfMetadata();
+
+
+
+
+
+  void dropUnknownNonDebugMetadata(ArrayRef<unsigned> KnownIDs);
+  void dropUnknownNonDebugMetadata() {
+    return dropUnknownNonDebugMetadata(None);
+  }
+  void dropUnknownNonDebugMetadata(unsigned ID1) {
+    return dropUnknownNonDebugMetadata(makeArrayRef(ID1));
+  }
+  void dropUnknownNonDebugMetadata(unsigned ID1, unsigned ID2) {
+    unsigned IDs[] = {ID1, ID2};
+    return dropUnknownNonDebugMetadata(IDs);
+  }
+
+
+
+  void setAAMetadata(const AAMDNodes &N);
+
+
+
+
+  bool extractProfMetadata(uint64_t &TrueVal, uint64_t &FalseVal) const;
+
+
+
+
+  bool extractProfTotalWeight(uint64_t &TotalVal) const;
+
+
+  void updateProfWeight(uint64_t S, uint64_t T);
+
+
+  void setProfWeight(uint64_t W);
+
+
+  void setDebugLoc(DebugLoc Loc) { DbgLoc = std::move(Loc); }
+
+
+  const DebugLoc &getDebugLoc() const { return DbgLoc; }
+
+
+
+  void setHasNoUnsignedWrap(bool b = true);
+
+
+
+  void setHasNoSignedWrap(bool b = true);
+
+
+
+  void setIsExact(bool b = true);
+
+
+  bool hasNoUnsignedWrap() const;
+
+
+  bool hasNoSignedWrap() const;
+
+
+
+  void dropPoisonGeneratingFlags();
+
+
+  bool isExact() const;
+
+
+
+
+  void setFast(bool B);
+
+
+
+
+  void setHasAllowReassoc(bool B);
+
+
+
+
+  void setHasNoNaNs(bool B);
+
+
+
+
+  void setHasNoInfs(bool B);
+
+
+
+
+  void setHasNoSignedZeros(bool B);
+
+
+
+
+  void setHasAllowReciprocal(bool B);
+
+
+
+
+  void setHasApproxFunc(bool B);
+
+
+
+
+  void setFastMathFlags(FastMathFlags FMF);
+
+
+
+
+  void copyFastMathFlags(FastMathFlags FMF);
+
+
+  bool isFast() const;
+
+
+  bool hasAllowReassoc() const;
+
+
+  bool hasNoNaNs() const;
+
+
+  bool hasNoInfs() const;
+
+
+  bool hasNoSignedZeros() const;
+
+
+  bool hasAllowReciprocal() const;
+
+
+  bool hasAllowContract() const;
+
+
+  bool hasApproxFunc() const;
+
+
+
+
+  FastMathFlags getFastMathFlags() const;
+
+
+  void copyFastMathFlags(const Instruction *I);
+
+
+
+  void copyIRFlags(const Value *V, bool IncludeWrapFlags = true);
+
+
+
+  void andIRFlags(const Value *V);
+  void applyMergedLocation(const DILocation *LocA, const DILocation *LocB);
+
+private:
+
+  bool hasMetadataHashEntry() const {
+    return (getSubclassDataFromValue() & HasMetadataBit) != 0;
+  }
+
+
+  MDNode *getMetadataImpl(unsigned KindID) const;
+  MDNode *getMetadataImpl(StringRef Kind) const;
+  void
+  getAllMetadataImpl(SmallVectorImpl<std::pair<unsigned, MDNode *>> &) const;
+  void getAllMetadataOtherThanDebugLocImpl(
+      SmallVectorImpl<std::pair<unsigned, MDNode *>> &) const;
+
+  void clearMetadataHashEntries();
+
+public:
+  bool isAssociative() const __attribute__((__pure__));
+  static bool isAssociative(unsigned Opcode) {
+    return Opcode == And || Opcode == Or || Opcode == Xor ||
+           Opcode == Add || Opcode == Mul;
+  }
+  bool isCommutative() const { return isCommutative(getOpcode()); }
+  static bool isCommutative(unsigned Opcode) {
+    switch (Opcode) {
+    case Add: case FAdd:
+    case Mul: case FMul:
+    case And: case Or: case Xor:
+      return true;
+    default:
+      return false;
+  }
+  }
+
+
+
+
+
+
+
+  bool isIdempotent() const { return isIdempotent(getOpcode()); }
+  static bool isIdempotent(unsigned Opcode) {
+    return Opcode == And || Opcode == Or;
+  }
+  bool isNilpotent() const { return isNilpotent(getOpcode()); }
+  static bool isNilpotent(unsigned Opcode) {
+    return Opcode == Xor;
+  }
+
+
+  bool mayWriteToMemory() const;
+
+
+  bool mayReadFromMemory() const;
+
+
+  bool mayReadOrWriteMemory() const {
+    return mayReadFromMemory() || mayWriteToMemory();
+  }
+
+
+
+  bool isAtomic() const;
+
+
+  bool hasAtomicLoad() const;
+
+
+  bool hasAtomicStore() const;
+
+
+  bool mayThrow() const;
+
+
+
+  bool isFenceLike() const {
+    switch (getOpcode()) {
+    default:
+      return false;
+
+
+    case Instruction::Fence:
+    case Instruction::CatchPad:
+    case Instruction::CatchRet:
+    case Instruction::Call:
+    case Instruction::Invoke:
+      return true;
+    }
+  }
+
+
+
+
+
+
+
+  bool mayHaveSideEffects() const { return mayWriteToMemory() || mayThrow(); }
+
+
+
+
+
+
+
+  bool isSafeToRemove() const;
+
+
+  bool isEHPad() const {
+    switch (getOpcode()) {
+    case Instruction::CatchSwitch:
+    case Instruction::CatchPad:
+    case Instruction::CleanupPad:
+    case Instruction::LandingPad:
+      return true;
+    default:
+      return false;
+    }
+  }
+
+
+
+
+
+
+  Instruction *clone() const;
+
+
+
+
+  bool isIdenticalTo(const Instruction *I) const;
+
+
+
+
+  bool isIdenticalToWhenDefined(const Instruction *I) const;
+
+
+
+  enum OperationEquivalenceFlags {
+
+    CompareIgnoringAlignment = 1<<0,
+
+
+    CompareUsingScalarTypes = 1<<1
+  };
+  bool isSameOperationAs(const Instruction *I, unsigned flags = 0) const;
+
+
+
+
+  bool isUsedOutsideOfBlock(const BasicBlock *BB) const;
+
+
+
+  static bool classof(const Value *V) {
+    return V->getValueID() >= Value::InstructionVal;
+  }
+
+
+
+
+  enum TermOps {
+
+
+
+ TermOpsBegin = 1,
+Ret = 1,
+Br = 2,
+Switch = 3,
+IndirectBr = 4,
+Invoke = 5,
+Resume = 6,
+Unreachable = 7,
+CleanupRet = 8,
+CatchRet = 9,
+CatchSwitch = 10,
+  TermOpsEnd = 10 +1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 
+
+
+
+
+
+
+
+
+
+
+ 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 
+
+
+
+
+ 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 
+  };
+
+  enum BinaryOps {
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 
+
+
+ BinaryOpsBegin = 11,
+Add = 11,
+FAdd = 12,
+Sub = 13,
+FSub = 14,
+Mul = 15,
+FMul = 16,
+UDiv = 17,
+SDiv = 18,
+FDiv = 19,
+URem = 20,
+SRem = 21,
+FRem = 22,
+
+
+Shl = 23,
+LShr = 24,
+AShr = 25,
+And = 26,
+Or = 27,
+Xor = 28,
+  BinaryOpsEnd = 28 +1
+
+
+
+
+
+
+
+
+
+
+ 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 
+
+
+
+
+ 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 
+  };
+
+  enum MemoryOps {
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 
+
+
+ MemoryOpsBegin = 29,
+Alloca = 29,
+Load = 30,
+Store = 31,
+GetElementPtr = 32,
+Fence = 33,
+AtomicCmpXchg = 34,
+AtomicRMW = 35,
+  MemoryOpsEnd = 35 +1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 
+
+
+
+
+ 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 
+  };
+
+  enum CastOps {
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 
+
+
+
+
+
+
+
+
+
+
+ 
+
+
+
+
+ CastOpsBegin = 36,
+Trunc = 36,
+ZExt = 37,
+SExt = 38,
+FPToUI = 39,
+FPToSI = 40,
+UIToFP = 41,
+SIToFP = 42,
+FPTrunc = 43,
+FPExt = 44,
+PtrToInt = 45,
+IntToPtr = 46,
+BitCast = 47,
+AddrSpaceCast = 48,
+  CastOpsEnd = 48 +1
+
+
+
+
+ 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 
+  };
+
+  enum FuncletPadOps {
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 
+
+
+
+
+
+
+
+
+
+
+ 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 
+
+ FuncletPadOpsBegin = 49,
+CleanupPad = 49,
+CatchPad = 50,
+  FuncletPadOpsEnd = 50 +1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 
+  };
+
+  enum OtherOps {
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 
+
+
+
+
+
+
+
+
+
+
+ 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 
+
+
+
+
+ 
+
+
+ OtherOpsBegin = 51,
+ICmp = 51,
+FCmp = 52,
+PHI = 53,
+Call = 54,
+Select = 55,
+UserOp1 = 56,
+UserOp2 = 57,
+VAArg = 58,
+ExtractElement = 59,
+InsertElement = 60,
+ShuffleVector = 61,
+ExtractValue = 62,
+InsertValue = 63,
+LandingPad = 64,
+  OtherOpsEnd = 64 +1
+  };
+
+private:
+  friend class SymbolTableListTraits<Instruction>;
+
+
+
+  void setValueSubclassData(unsigned short D) {
+    Value::setValueSubclassData(D);
+  }
+
+  unsigned short getSubclassDataFromValue() const {
+    return Value::getSubclassDataFromValue();
+  }
+
+  void setHasMetadataHashEntry(bool V) {
+    setValueSubclassData((getSubclassDataFromValue() & ~HasMetadataBit) |
+                         (V ? HasMetadataBit : 0));
+  }
+
+  void setParent(BasicBlock *P);
+
+protected:
+
+
+
+
+  void setInstructionSubclassData(unsigned short D) {
+    
+   ((
+   (D & HasMetadataBit) == 0 && "Out of range value put into field"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "(D & HasMetadataBit) == 0 && \"Out of range value put into field\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Instruction.h", 678, __PRETTY_FUNCTION__))
+                                                                           ;
+    setValueSubclassData((getSubclassDataFromValue() & HasMetadataBit) | D);
+  }
+
+  unsigned getSubclassDataFromInstruction() const {
+    return getSubclassDataFromValue() & ~HasMetadataBit;
+  }
+
+  Instruction(Type *Ty, unsigned iType, Use *Ops, unsigned NumOps,
+              Instruction *InsertBefore = nullptr);
+  Instruction(Type *Ty, unsigned iType, Use *Ops, unsigned NumOps,
+              BasicBlock *InsertAtEnd);
+
+private:
+
+  Instruction *cloneImpl() const;
+};
+
+inline void ilist_alloc_traits<Instruction>::deleteNode(Instruction *V) {
+  V->deleteValue();
+}
+
+}
+
+
+
+
+
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+namespace llvm {
+
+class CallInst;
+class Function;
+class LandingPadInst;
+class LLVMContext;
+class Module;
+class PHINode;
+class TerminatorInst;
+class ValueSymbolTable;
+class BasicBlock final : public Value,
+                         public ilist_node_with_parent<BasicBlock, Function> {
+public:
+  using InstListType = SymbolTableList<Instruction>;
+
+private:
+  friend class BlockAddress;
+  friend class SymbolTableListTraits<BasicBlock>;
+
+  InstListType InstList;
+  Function *Parent;
+
+  void setParent(Function *parent);
+
+
+
+
+
+
+  explicit BasicBlock(LLVMContext &C, const Twine &Name = "",
+                      Function *Parent = nullptr,
+                      BasicBlock *InsertBefore = nullptr);
+
+public:
+  BasicBlock(const BasicBlock &) = delete;
+  BasicBlock &operator=(const BasicBlock &) = delete;
+  ~BasicBlock();
+
+
+  LLVMContext &getContext() const;
+
+
+  using iterator = InstListType::iterator;
+  using const_iterator = InstListType::const_iterator;
+  using reverse_iterator = InstListType::reverse_iterator;
+  using const_reverse_iterator = InstListType::const_reverse_iterator;
+
+
+
+
+
+
+  static BasicBlock *Create(LLVMContext &Context, const Twine &Name = "",
+                            Function *Parent = nullptr,
+                            BasicBlock *InsertBefore = nullptr) {
+    return new BasicBlock(Context, Name, Parent, InsertBefore);
+  }
+
+
+  const Function *getParent() const { return Parent; }
+        Function *getParent() { return Parent; }
+
+
+
+
+
+  const Module *getModule() const;
+  Module *getModule() {
+    return const_cast<Module *>(
+                            static_cast<const BasicBlock *>(this)->getModule());
+  }
+
+
+
+  const TerminatorInst *getTerminator() const __attribute__((__pure__));
+  TerminatorInst *getTerminator() {
+    return const_cast<TerminatorInst *>(
+                        static_cast<const BasicBlock *>(this)->getTerminator());
+  }
+
+
+
+
+  const CallInst *getTerminatingDeoptimizeCall() const;
+  CallInst *getTerminatingDeoptimizeCall() {
+    return const_cast<CallInst *>(
+         static_cast<const BasicBlock *>(this)->getTerminatingDeoptimizeCall());
+  }
+
+
+
+
+  const CallInst *getTerminatingMustTailCall() const;
+  CallInst *getTerminatingMustTailCall() {
+    return const_cast<CallInst *>(
+           static_cast<const BasicBlock *>(this)->getTerminatingMustTailCall());
+  }
+
+
+
+
+
+
+
+  const Instruction* getFirstNonPHI() const;
+  Instruction* getFirstNonPHI() {
+    return const_cast<Instruction *>(
+                       static_cast<const BasicBlock *>(this)->getFirstNonPHI());
+  }
+
+
+
+  const Instruction* getFirstNonPHIOrDbg() const;
+  Instruction* getFirstNonPHIOrDbg() {
+    return const_cast<Instruction *>(
+                  static_cast<const BasicBlock *>(this)->getFirstNonPHIOrDbg());
+  }
+
+
+
+  const Instruction* getFirstNonPHIOrDbgOrLifetime() const;
+  Instruction* getFirstNonPHIOrDbgOrLifetime() {
+    return const_cast<Instruction *>(
+        static_cast<const BasicBlock *>(this)->getFirstNonPHIOrDbgOrLifetime());
+  }
+
+
+
+
+
+  const_iterator getFirstInsertionPt() const;
+  iterator getFirstInsertionPt() {
+    return static_cast<const BasicBlock *>(this)
+                                          ->getFirstInsertionPt().getNonConst();
+  }
+
+
+  void removeFromParent();
+
+
+
+
+  SymbolTableList<BasicBlock>::iterator eraseFromParent();
+
+
+
+  void moveBefore(BasicBlock *MovePos);
+
+
+
+  void moveAfter(BasicBlock *MovePos);
+
+
+
+
+
+
+
+  void insertInto(Function *Parent, BasicBlock *InsertBefore = nullptr);
+
+
+
+  const BasicBlock *getSinglePredecessor() const;
+  BasicBlock *getSinglePredecessor() {
+    return const_cast<BasicBlock *>(
+                 static_cast<const BasicBlock *>(this)->getSinglePredecessor());
+  }
+
+
+
+
+
+
+
+  const BasicBlock *getUniquePredecessor() const;
+  BasicBlock *getUniquePredecessor() {
+    return const_cast<BasicBlock *>(
+                 static_cast<const BasicBlock *>(this)->getUniquePredecessor());
+  }
+
+
+
+
+
+  const BasicBlock *getSingleSuccessor() const;
+  BasicBlock *getSingleSuccessor() {
+    return const_cast<BasicBlock *>(
+                   static_cast<const BasicBlock *>(this)->getSingleSuccessor());
+  }
+
+
+
+
+
+  const BasicBlock *getUniqueSuccessor() const;
+  BasicBlock *getUniqueSuccessor() {
+    return const_cast<BasicBlock *>(
+                   static_cast<const BasicBlock *>(this)->getUniqueSuccessor());
+  }
+
+
+
+
+  inline iterator begin() { return InstList.begin(); }
+  inline const_iterator begin() const { return InstList.begin(); }
+  inline iterator end () { return InstList.end(); }
+  inline const_iterator end () const { return InstList.end(); }
+
+  inline reverse_iterator rbegin() { return InstList.rbegin(); }
+  inline const_reverse_iterator rbegin() const { return InstList.rbegin(); }
+  inline reverse_iterator rend () { return InstList.rend(); }
+  inline const_reverse_iterator rend () const { return InstList.rend(); }
+
+  inline size_t size() const { return InstList.size(); }
+  inline bool empty() const { return InstList.empty(); }
+  inline const Instruction &front() const { return InstList.front(); }
+  inline Instruction &front() { return InstList.front(); }
+  inline const Instruction &back() const { return InstList.back(); }
+  inline Instruction &back() { return InstList.back(); }
+
+
+  template <typename PHINodeT = PHINode, typename BBIteratorT = iterator>
+  class phi_iterator_impl
+      : public iterator_facade_base<phi_iterator_impl<PHINodeT, BBIteratorT>,
+                                    std::forward_iterator_tag, PHINodeT> {
+    friend BasicBlock;
+
+    PHINodeT *PN;
+
+    phi_iterator_impl(PHINodeT *PN) : PN(PN) {}
+
+  public:
+
+
+    phi_iterator_impl() = default;
+
+
+    template <typename PHINodeU, typename BBIteratorU>
+    phi_iterator_impl(const phi_iterator_impl<PHINodeU, BBIteratorU> &Arg)
+        : PN(Arg.PN) {}
+
+    bool operator==(const phi_iterator_impl &Arg) const { return PN == Arg.PN; }
+
+    PHINodeT &operator*() const { return *PN; }
+
+    using phi_iterator_impl::iterator_facade_base::operator++;
+    phi_iterator_impl &operator++() {
+      
+     ((
+     PN && "Cannot increment the end iterator!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "PN && \"Cannot increment the end iterator!\""
+     , "/home/trippels/llvm/llvm/include/llvm/IR/BasicBlock.h", 296, __PRETTY_FUNCTION__))
+                                                       ;
+      PN = dyn_cast<PHINodeT>(std::next(BBIteratorT(PN)));
+      return *this;
+    }
+  };
+  using phi_iterator = phi_iterator_impl<>;
+  using const_phi_iterator =
+      phi_iterator_impl<const PHINode, BasicBlock::const_iterator>;
+
+
+
+
+  iterator_range<const_phi_iterator> phis() const {
+    return const_cast<BasicBlock *>(this)->phis();
+  }
+  iterator_range<phi_iterator> phis();
+
+
+
+
+
+  const InstListType &getInstList() const { return InstList; }
+        InstListType &getInstList() { return InstList; }
+
+
+  static InstListType BasicBlock::*getSublistAccess(Instruction*) {
+    return &BasicBlock::InstList;
+  }
+
+
+  ValueSymbolTable *getValueSymbolTable();
+
+
+  static bool classof(const Value *V) {
+    return V->getValueID() == Value::BasicBlockVal;
+  }
+  void dropAllReferences();
+
+
+
+
+
+
+
+  void removePredecessor(BasicBlock *Pred, bool DontDeleteUselessPHIs = false);
+
+  bool canSplitPredecessors() const;
+  BasicBlock *splitBasicBlock(iterator I, const Twine &BBName = "");
+  BasicBlock *splitBasicBlock(Instruction *I, const Twine &BBName = "") {
+    return splitBasicBlock(I->getIterator(), BBName);
+  }
+
+
+
+  bool hasAddressTaken() const { return getSubclassDataFromValue() != 0; }
+
+
+
+  void replaceSuccessorsPhiUsesWith(BasicBlock *New);
+
+
+  bool isEHPad() const { return getFirstNonPHI()->isEHPad(); }
+
+
+
+
+
+  bool isLandingPad() const;
+
+
+  const LandingPadInst *getLandingPadInst() const;
+  LandingPadInst *getLandingPadInst() {
+    return const_cast<LandingPadInst *>(
+                    static_cast<const BasicBlock *>(this)->getLandingPadInst());
+  }
+
+
+  bool isLegalToHoistInto() const;
+
+  Optional<uint64_t> getIrrLoopHeaderWeight() const;
+
+private:
+
+
+
+
+
+  void AdjustBlockAddressRefCount(int Amt) {
+    setValueSubclassData(getSubclassDataFromValue()+Amt);
+    
+   ((
+   (int)(signed char)getSubclassDataFromValue() >= 0 && "Refcount wrap-around"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "(int)(signed char)getSubclassDataFromValue() >= 0 && \"Refcount wrap-around\""
+   ,
+                                 "/home/trippels/llvm/llvm/include/llvm/IR/BasicBlock.h"
+    ,
+                                 412
+    , __PRETTY_FUNCTION__))
+                                  
+                                 ;
+  }
+
+
+
+  void setValueSubclassData(unsigned short D) {
+    Value::setValueSubclassData(D);
+  }
+};
+
+
+inline BasicBlock *unwrap(LLVMBasicBlockRef P) { return reinterpret_cast<BasicBlock*>(P); } inline LLVMBasicBlockRef wrap(const BasicBlock *P) { return reinterpret_cast<LLVMBasicBlockRef>(const_cast<BasicBlock*>(P)); }
+
+}
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+
+namespace llvm {
+class FoldingSetNodeID;
+class StringRef;
+class FoldingSetBase {
+  virtual void anchor();
+
+protected:
+
+  void **Buckets;
+
+
+  unsigned NumBuckets;
+
+
+
+  unsigned NumNodes;
+
+  explicit FoldingSetBase(unsigned Log2InitSize = 6);
+  FoldingSetBase(FoldingSetBase &&Arg);
+  FoldingSetBase &operator=(FoldingSetBase &&RHS);
+  ~FoldingSetBase();
+
+public:
+
+
+
+  class Node {
+  private:
+
+    void *NextInFoldingSetBucket = nullptr;
+
+  public:
+    Node() = default;
+
+
+    void *getNextInBucket() const { return NextInFoldingSetBucket; }
+    void SetNextInBucket(void *N) { NextInFoldingSetBucket = N; }
+  };
+
+
+  void clear();
+
+
+  unsigned size() const { return NumNodes; }
+
+
+  bool empty() const { return NumNodes == 0; }
+
+
+
+
+  void reserve(unsigned EltCount);
+
+
+
+  unsigned capacity() {
+
+
+    return NumBuckets * 2;
+  }
+
+private:
+
+  void GrowHashTable();
+
+
+
+
+  void GrowBucketCount(unsigned NewBucketCount);
+
+protected:
+
+
+  virtual void GetNodeProfile(Node *N, FoldingSetNodeID &ID) const = 0;
+
+
+
+  virtual bool NodeEquals(Node *N, const FoldingSetNodeID &ID, unsigned IDHash,
+                          FoldingSetNodeID &TempID) const=0;
+
+
+
+  virtual unsigned ComputeNodeHash(Node *N, FoldingSetNodeID &TempID) const = 0;
+
+
+
+
+
+
+  bool RemoveNode(Node *N);
+
+
+
+
+  Node *GetOrInsertNode(Node *N);
+
+
+
+
+  Node *FindNodeOrInsertPos(const FoldingSetNodeID &ID, void *&InsertPos);
+
+
+
+
+  void InsertNode(Node *N, void *InsertPos);
+};
+
+
+
+
+
+template<typename T> struct DefaultFoldingSetTrait {
+  static void Profile(const T &X, FoldingSetNodeID &ID) {
+    X.Profile(ID);
+  }
+  static void Profile(T &X, FoldingSetNodeID &ID) {
+    X.Profile(ID);
+  }
+
+
+
+
+
+  static inline bool Equals(T &X, const FoldingSetNodeID &ID, unsigned IDHash,
+                            FoldingSetNodeID &TempID);
+
+
+
+
+
+
+  static inline unsigned ComputeHash(T &X, FoldingSetNodeID &TempID);
+};
+
+
+
+
+
+
+
+template<typename T> struct FoldingSetTrait
+  : public DefaultFoldingSetTrait<T> {};
+
+
+
+template<typename T, typename Ctx>
+struct DefaultContextualFoldingSetTrait {
+  static void Profile(T &X, FoldingSetNodeID &ID, Ctx Context) {
+    X.Profile(ID, Context);
+  }
+
+  static inline bool Equals(T &X, const FoldingSetNodeID &ID, unsigned IDHash,
+                            FoldingSetNodeID &TempID, Ctx Context);
+  static inline unsigned ComputeHash(T &X, FoldingSetNodeID &TempID,
+                                     Ctx Context);
+};
+
+
+
+template<typename T, typename Ctx> struct ContextualFoldingSetTrait
+  : public DefaultContextualFoldingSetTrait<T, Ctx> {};
+
+
+
+
+
+
+
+class FoldingSetNodeIDRef {
+  const unsigned *Data = nullptr;
+  size_t Size = 0;
+
+public:
+  FoldingSetNodeIDRef() = default;
+  FoldingSetNodeIDRef(const unsigned *D, size_t S) : Data(D), Size(S) {}
+
+
+
+  unsigned ComputeHash() const;
+
+  bool operator==(FoldingSetNodeIDRef) const;
+
+  bool operator!=(FoldingSetNodeIDRef RHS) const { return !(*this == RHS); }
+
+
+
+  bool operator<(FoldingSetNodeIDRef) const;
+
+  const unsigned *getData() const { return Data; }
+  size_t getSize() const { return Size; }
+};
+
+
+
+
+
+class FoldingSetNodeID {
+
+
+  SmallVector<unsigned, 32> Bits;
+
+public:
+  FoldingSetNodeID() = default;
+
+  FoldingSetNodeID(FoldingSetNodeIDRef Ref)
+    : Bits(Ref.getData(), Ref.getData() + Ref.getSize()) {}
+
+
+  void AddPointer(const void *Ptr);
+  void AddInteger(signed I);
+  void AddInteger(unsigned I);
+  void AddInteger(long I);
+  void AddInteger(unsigned long I);
+  void AddInteger(long long I);
+  void AddInteger(unsigned long long I);
+  void AddBoolean(bool B) { AddInteger(B ? 1U : 0U); }
+  void AddString(StringRef String);
+  void AddNodeID(const FoldingSetNodeID &ID);
+
+  template <typename T>
+  inline void Add(const T &x) { FoldingSetTrait<T>::Profile(x, *this); }
+
+
+
+  inline void clear() { Bits.clear(); }
+
+
+
+  unsigned ComputeHash() const;
+
+
+  bool operator==(const FoldingSetNodeID &RHS) const;
+  bool operator==(const FoldingSetNodeIDRef RHS) const;
+
+  bool operator!=(const FoldingSetNodeID &RHS) const { return !(*this == RHS); }
+  bool operator!=(const FoldingSetNodeIDRef RHS) const { return !(*this ==RHS);}
+
+
+
+  bool operator<(const FoldingSetNodeID &RHS) const;
+  bool operator<(const FoldingSetNodeIDRef RHS) const;
+
+
+
+
+  FoldingSetNodeIDRef Intern(BumpPtrAllocator &Allocator) const;
+};
+
+
+using FoldingSetNode = FoldingSetBase::Node;
+template<class T> class FoldingSetIterator;
+template<class T> class FoldingSetBucketIterator;
+
+
+
+template<typename T>
+inline bool
+DefaultFoldingSetTrait<T>::Equals(T &X, const FoldingSetNodeID &ID,
+                                  unsigned ,
+                                  FoldingSetNodeID &TempID) {
+  FoldingSetTrait<T>::Profile(X, TempID);
+  return TempID == ID;
+}
+template<typename T>
+inline unsigned
+DefaultFoldingSetTrait<T>::ComputeHash(T &X, FoldingSetNodeID &TempID) {
+  FoldingSetTrait<T>::Profile(X, TempID);
+  return TempID.ComputeHash();
+}
+template<typename T, typename Ctx>
+inline bool
+DefaultContextualFoldingSetTrait<T, Ctx>::Equals(T &X,
+                                                 const FoldingSetNodeID &ID,
+                                                 unsigned ,
+                                                 FoldingSetNodeID &TempID,
+                                                 Ctx Context) {
+  ContextualFoldingSetTrait<T, Ctx>::Profile(X, TempID, Context);
+  return TempID == ID;
+}
+template<typename T, typename Ctx>
+inline unsigned
+DefaultContextualFoldingSetTrait<T, Ctx>::ComputeHash(T &X,
+                                                      FoldingSetNodeID &TempID,
+                                                      Ctx Context) {
+  ContextualFoldingSetTrait<T, Ctx>::Profile(X, TempID, Context);
+  return TempID.ComputeHash();
+}
+
+
+
+
+template <class T> class FoldingSetImpl : public FoldingSetBase {
+protected:
+  explicit FoldingSetImpl(unsigned Log2InitSize)
+      : FoldingSetBase(Log2InitSize) {}
+
+  FoldingSetImpl(FoldingSetImpl &&Arg) = default;
+  FoldingSetImpl &operator=(FoldingSetImpl &&RHS) = default;
+  ~FoldingSetImpl() = default;
+
+public:
+  using iterator = FoldingSetIterator<T>;
+
+  iterator begin() { return iterator(Buckets); }
+  iterator end() { return iterator(Buckets+NumBuckets); }
+
+  using const_iterator = FoldingSetIterator<const T>;
+
+  const_iterator begin() const { return const_iterator(Buckets); }
+  const_iterator end() const { return const_iterator(Buckets+NumBuckets); }
+
+  using bucket_iterator = FoldingSetBucketIterator<T>;
+
+  bucket_iterator bucket_begin(unsigned hash) {
+    return bucket_iterator(Buckets + (hash & (NumBuckets-1)));
+  }
+
+  bucket_iterator bucket_end(unsigned hash) {
+    return bucket_iterator(Buckets + (hash & (NumBuckets-1)), true);
+  }
+
+
+
+  bool RemoveNode(T *N) { return FoldingSetBase::RemoveNode(N); }
+
+
+
+
+  T *GetOrInsertNode(T *N) {
+    return static_cast<T *>(FoldingSetBase::GetOrInsertNode(N));
+  }
+
+
+
+
+  T *FindNodeOrInsertPos(const FoldingSetNodeID &ID, void *&InsertPos) {
+    return static_cast<T *>(FoldingSetBase::FindNodeOrInsertPos(ID, InsertPos));
+  }
+
+
+
+
+  void InsertNode(T *N, void *InsertPos) {
+    FoldingSetBase::InsertNode(N, InsertPos);
+  }
+
+
+
+  void InsertNode(T *N) {
+    T *Inserted = GetOrInsertNode(N);
+    (void)Inserted;
+    
+   ((
+   Inserted == N && "Node already inserted!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Inserted == N && \"Node already inserted!\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/FoldingSet.h", 461, __PRETTY_FUNCTION__))
+                                                    ;
+  }
+};
+template <class T> class FoldingSet final : public FoldingSetImpl<T> {
+  using Super = FoldingSetImpl<T>;
+  using Node = typename Super::Node;
+
+
+
+  void GetNodeProfile(Node *N, FoldingSetNodeID &ID) const override {
+    T *TN = static_cast<T *>(N);
+    FoldingSetTrait<T>::Profile(*TN, ID);
+  }
+
+
+
+  bool NodeEquals(Node *N, const FoldingSetNodeID &ID, unsigned IDHash,
+                  FoldingSetNodeID &TempID) const override {
+    T *TN = static_cast<T *>(N);
+    return FoldingSetTrait<T>::Equals(*TN, ID, IDHash, TempID);
+  }
+
+
+
+  unsigned ComputeNodeHash(Node *N, FoldingSetNodeID &TempID) const override {
+    T *TN = static_cast<T *>(N);
+    return FoldingSetTrait<T>::ComputeHash(*TN, TempID);
+  }
+
+public:
+  explicit FoldingSet(unsigned Log2InitSize = 6) : Super(Log2InitSize) {}
+  FoldingSet(FoldingSet &&Arg) = default;
+  FoldingSet &operator=(FoldingSet &&RHS) = default;
+};
+template <class T, class Ctx>
+class ContextualFoldingSet final : public FoldingSetImpl<T> {
+
+
+
+
+
+  using Super = FoldingSetImpl<T>;
+  using Node = typename Super::Node;
+
+  Ctx Context;
+
+
+
+  void GetNodeProfile(Node *N, FoldingSetNodeID &ID) const override {
+    T *TN = static_cast<T *>(N);
+    ContextualFoldingSetTrait<T, Ctx>::Profile(*TN, ID, Context);
+  }
+
+  bool NodeEquals(Node *N, const FoldingSetNodeID &ID, unsigned IDHash,
+                  FoldingSetNodeID &TempID) const override {
+    T *TN = static_cast<T *>(N);
+    return ContextualFoldingSetTrait<T, Ctx>::Equals(*TN, ID, IDHash, TempID,
+                                                     Context);
+  }
+
+  unsigned ComputeNodeHash(Node *N, FoldingSetNodeID &TempID) const override {
+    T *TN = static_cast<T *>(N);
+    return ContextualFoldingSetTrait<T, Ctx>::ComputeHash(*TN, TempID, Context);
+  }
+
+public:
+  explicit ContextualFoldingSet(Ctx Context, unsigned Log2InitSize = 6)
+      : Super(Log2InitSize), Context(Context) {}
+
+  Ctx getContext() const { return Context; }
+};
+
+
+
+
+
+
+template <class T, class VectorT = SmallVector<T*, 8>>
+class FoldingSetVector {
+  FoldingSet<T> Set;
+  VectorT Vector;
+
+public:
+  explicit FoldingSetVector(unsigned Log2InitSize = 6) : Set(Log2InitSize) {}
+
+  using iterator = pointee_iterator<typename VectorT::iterator>;
+
+  iterator begin() { return Vector.begin(); }
+  iterator end() { return Vector.end(); }
+
+  using const_iterator = pointee_iterator<typename VectorT::const_iterator>;
+
+  const_iterator begin() const { return Vector.begin(); }
+  const_iterator end() const { return Vector.end(); }
+
+
+  void clear() { Set.clear(); Vector.clear(); }
+
+
+
+
+  T *FindNodeOrInsertPos(const FoldingSetNodeID &ID, void *&InsertPos) {
+    return Set.FindNodeOrInsertPos(ID, InsertPos);
+  }
+
+
+
+
+  T *GetOrInsertNode(T *N) {
+    T *Result = Set.GetOrInsertNode(N);
+    if (Result == N) Vector.push_back(N);
+    return Result;
+  }
+
+
+
+
+  void InsertNode(T *N, void *InsertPos) {
+    Set.InsertNode(N, InsertPos);
+    Vector.push_back(N);
+  }
+
+
+
+  void InsertNode(T *N) {
+    Set.InsertNode(N);
+    Vector.push_back(N);
+  }
+
+
+  unsigned size() const { return Set.size(); }
+
+
+  bool empty() const { return Set.empty(); }
+};
+
+
+
+
+class FoldingSetIteratorImpl {
+protected:
+  FoldingSetNode *NodePtr;
+
+  FoldingSetIteratorImpl(void **Bucket);
+
+  void advance();
+
+public:
+  bool operator==(const FoldingSetIteratorImpl &RHS) const {
+    return NodePtr == RHS.NodePtr;
+  }
+  bool operator!=(const FoldingSetIteratorImpl &RHS) const {
+    return NodePtr != RHS.NodePtr;
+  }
+};
+
+template <class T> class FoldingSetIterator : public FoldingSetIteratorImpl {
+public:
+  explicit FoldingSetIterator(void **Bucket) : FoldingSetIteratorImpl(Bucket) {}
+
+  T &operator*() const {
+    return *static_cast<T*>(NodePtr);
+  }
+
+  T *operator->() const {
+    return static_cast<T*>(NodePtr);
+  }
+
+  inline FoldingSetIterator &operator++() {
+    advance();
+    return *this;
+  }
+  FoldingSetIterator operator++(int) {
+    FoldingSetIterator tmp = *this; ++*this; return tmp;
+  }
+};
+
+
+
+
+
+class FoldingSetBucketIteratorImpl {
+protected:
+  void *Ptr;
+
+  explicit FoldingSetBucketIteratorImpl(void **Bucket);
+
+  FoldingSetBucketIteratorImpl(void **Bucket, bool) : Ptr(Bucket) {}
+
+  void advance() {
+    void *Probe = static_cast<FoldingSetNode*>(Ptr)->getNextInBucket();
+    uintptr_t x = reinterpret_cast<uintptr_t>(Probe) & ~0x1;
+    Ptr = reinterpret_cast<void*>(x);
+  }
+
+public:
+  bool operator==(const FoldingSetBucketIteratorImpl &RHS) const {
+    return Ptr == RHS.Ptr;
+  }
+  bool operator!=(const FoldingSetBucketIteratorImpl &RHS) const {
+    return Ptr != RHS.Ptr;
+  }
+};
+
+template <class T>
+class FoldingSetBucketIterator : public FoldingSetBucketIteratorImpl {
+public:
+  explicit FoldingSetBucketIterator(void **Bucket) :
+    FoldingSetBucketIteratorImpl(Bucket) {}
+
+  FoldingSetBucketIterator(void **Bucket, bool) :
+    FoldingSetBucketIteratorImpl(Bucket, true) {}
+
+  T &operator*() const { return *static_cast<T*>(Ptr); }
+  T *operator->() const { return static_cast<T*>(Ptr); }
+
+  inline FoldingSetBucketIterator &operator++() {
+    advance();
+    return *this;
+  }
+  FoldingSetBucketIterator operator++(int) {
+    FoldingSetBucketIterator tmp = *this; ++*this; return tmp;
+  }
+};
+
+
+
+
+template <typename T>
+class FoldingSetNodeWrapper : public FoldingSetNode {
+  T data;
+
+public:
+  template <typename... Ts>
+  explicit FoldingSetNodeWrapper(Ts &&... Args)
+      : data(std::forward<Ts>(Args)...) {}
+
+  void Profile(FoldingSetNodeID &ID) { FoldingSetTrait<T>::Profile(data, ID); }
+
+  T &getValue() { return data; }
+  const T &getValue() const { return data; }
+
+  operator T&() { return data; }
+  operator const T&() const { return data; }
+};
+
+
+
+
+
+
+
+class FastFoldingSetNode : public FoldingSetNode {
+  FoldingSetNodeID FastID;
+
+protected:
+  explicit FastFoldingSetNode(const FoldingSetNodeID &ID) : FastID(ID) {}
+
+public:
+  void Profile(FoldingSetNodeID &ID) const { ID.AddNodeID(FastID); }
+};
+
+
+
+
+template<typename T> struct FoldingSetTrait<T*> {
+  static inline void Profile(T *X, FoldingSetNodeID &ID) {
+    ID.AddPointer(X);
+  }
+};
+template <typename T1, typename T2>
+struct FoldingSetTrait<std::pair<T1, T2>> {
+  static inline void Profile(const std::pair<T1, T2> &P,
+                             FoldingSetNodeID &ID) {
+    ID.Add(P.first);
+    ID.Add(P.second);
+  }
+};
+
+}
+
+
+
+
+       
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+
+
+
+
+
+  template<size_t _Nw>
+    struct _Base_bitset
+    {
+      typedef unsigned long _WordT;
+
+
+      _WordT _M_w[_Nw];
+
+      constexpr _Base_bitset() noexcept
+      : _M_w() { }
+
+
+      constexpr _Base_bitset(unsigned long long __val) noexcept
+      : _M_w{ _WordT(__val)
+
+
+
+       } { }
+
+
+
+
+
+
+      static constexpr size_t
+      _S_whichword(size_t __pos) noexcept
+      { return __pos / (8 * 8); }
+
+      static constexpr size_t
+      _S_whichbyte(size_t __pos) noexcept
+      { return (__pos % (8 * 8)) / 8; }
+
+      static constexpr size_t
+      _S_whichbit(size_t __pos) noexcept
+      { return __pos % (8 * 8); }
+
+      static constexpr _WordT
+      _S_maskbit(size_t __pos) noexcept
+      { return (static_cast<_WordT>(1)) << _S_whichbit(__pos); }
+
+      _WordT&
+      _M_getword(size_t __pos) noexcept
+      { return _M_w[_S_whichword(__pos)]; }
+
+      constexpr _WordT
+      _M_getword(size_t __pos) const noexcept
+      { return _M_w[_S_whichword(__pos)]; }
+
+
+      const _WordT*
+      _M_getdata() const noexcept
+      { return _M_w; }
+
+
+      _WordT&
+      _M_hiword() noexcept
+      { return _M_w[_Nw - 1]; }
+
+      constexpr _WordT
+      _M_hiword() const noexcept
+      { return _M_w[_Nw - 1]; }
+
+      void
+      _M_do_and(const _Base_bitset<_Nw>& __x) noexcept
+      {
+ for (size_t __i = 0; __i < _Nw; __i++)
+   _M_w[__i] &= __x._M_w[__i];
+      }
+
+      void
+      _M_do_or(const _Base_bitset<_Nw>& __x) noexcept
+      {
+ for (size_t __i = 0; __i < _Nw; __i++)
+   _M_w[__i] |= __x._M_w[__i];
+      }
+
+      void
+      _M_do_xor(const _Base_bitset<_Nw>& __x) noexcept
+      {
+ for (size_t __i = 0; __i < _Nw; __i++)
+   _M_w[__i] ^= __x._M_w[__i];
+      }
+
+      void
+      _M_do_left_shift(size_t __shift) noexcept;
+
+      void
+      _M_do_right_shift(size_t __shift) noexcept;
+
+      void
+      _M_do_flip() noexcept
+      {
+ for (size_t __i = 0; __i < _Nw; __i++)
+   _M_w[__i] = ~_M_w[__i];
+      }
+
+      void
+      _M_do_set() noexcept
+      {
+ for (size_t __i = 0; __i < _Nw; __i++)
+   _M_w[__i] = ~static_cast<_WordT>(0);
+      }
+
+      void
+      _M_do_reset() noexcept
+      { __builtin_memset(_M_w, 0, _Nw * sizeof(_WordT)); }
+
+      bool
+      _M_is_equal(const _Base_bitset<_Nw>& __x) const noexcept
+      {
+ for (size_t __i = 0; __i < _Nw; ++__i)
+   if (_M_w[__i] != __x._M_w[__i])
+     return false;
+ return true;
+      }
+
+      template<size_t _Nb>
+        bool
+        _M_are_all() const noexcept
+        {
+   for (size_t __i = 0; __i < _Nw - 1; __i++)
+     if (_M_w[__i] != ~static_cast<_WordT>(0))
+       return false;
+   return _M_hiword() == (~static_cast<_WordT>(0)
+     >> (_Nw * (8 * 8)
+         - _Nb));
+ }
+
+      bool
+      _M_is_any() const noexcept
+      {
+ for (size_t __i = 0; __i < _Nw; __i++)
+   if (_M_w[__i] != static_cast<_WordT>(0))
+     return true;
+ return false;
+      }
+
+      size_t
+      _M_do_count() const noexcept
+      {
+ size_t __result = 0;
+ for (size_t __i = 0; __i < _Nw; __i++)
+   __result += __builtin_popcountl(_M_w[__i]);
+ return __result;
+      }
+
+      unsigned long
+      _M_do_to_ulong() const;
+
+
+      unsigned long long
+      _M_do_to_ullong() const;
+
+
+
+      size_t
+      _M_do_find_first(size_t) const noexcept;
+
+
+      size_t
+      _M_do_find_next(size_t, size_t) const noexcept;
+    };
+
+
+  template<size_t _Nw>
+    void
+    _Base_bitset<_Nw>::_M_do_left_shift(size_t __shift) noexcept
+    {
+      if (__builtin_expect(__shift != 0, 1))
+ {
+   const size_t __wshift = __shift / (8 * 8);
+   const size_t __offset = __shift % (8 * 8);
+
+   if (__offset == 0)
+     for (size_t __n = _Nw - 1; __n >= __wshift; --__n)
+       _M_w[__n] = _M_w[__n - __wshift];
+   else
+     {
+       const size_t __sub_offset = ((8 * 8)
+        - __offset);
+       for (size_t __n = _Nw - 1; __n > __wshift; --__n)
+  _M_w[__n] = ((_M_w[__n - __wshift] << __offset)
+        | (_M_w[__n - __wshift - 1] >> __sub_offset));
+       _M_w[__wshift] = _M_w[0] << __offset;
+     }
+
+   std::fill(_M_w + 0, _M_w + __wshift, static_cast<_WordT>(0));
+ }
+    }
+
+  template<size_t _Nw>
+    void
+    _Base_bitset<_Nw>::_M_do_right_shift(size_t __shift) noexcept
+    {
+      if (__builtin_expect(__shift != 0, 1))
+ {
+   const size_t __wshift = __shift / (8 * 8);
+   const size_t __offset = __shift % (8 * 8);
+   const size_t __limit = _Nw - __wshift - 1;
+
+   if (__offset == 0)
+     for (size_t __n = 0; __n <= __limit; ++__n)
+       _M_w[__n] = _M_w[__n + __wshift];
+   else
+     {
+       const size_t __sub_offset = ((8 * 8)
+        - __offset);
+       for (size_t __n = 0; __n < __limit; ++__n)
+  _M_w[__n] = ((_M_w[__n + __wshift] >> __offset)
+        | (_M_w[__n + __wshift + 1] << __sub_offset));
+       _M_w[__limit] = _M_w[_Nw-1] >> __offset;
+     }
+
+   std::fill(_M_w + __limit + 1, _M_w + _Nw, static_cast<_WordT>(0));
+ }
+    }
+
+  template<size_t _Nw>
+    unsigned long
+    _Base_bitset<_Nw>::_M_do_to_ulong() const
+    {
+      for (size_t __i = 1; __i < _Nw; ++__i)
+ if (_M_w[__i])
+   __throw_overflow_error(("_Base_bitset::_M_do_to_ulong"));
+      return _M_w[0];
+    }
+
+
+  template<size_t _Nw>
+    unsigned long long
+    _Base_bitset<_Nw>::_M_do_to_ullong() const
+    {
+      const bool __dw = sizeof(unsigned long long) > sizeof(unsigned long);
+      for (size_t __i = 1 + __dw; __i < _Nw; ++__i)
+ if (_M_w[__i])
+   __throw_overflow_error(("_Base_bitset::_M_do_to_ullong"));
+
+      if (__dw)
+ return _M_w[0] + (static_cast<unsigned long long>(_M_w[1])
+     << (8 * 8));
+      return _M_w[0];
+    }
+
+
+  template<size_t _Nw>
+    size_t
+    _Base_bitset<_Nw>::
+    _M_do_find_first(size_t __not_found) const noexcept
+    {
+      for (size_t __i = 0; __i < _Nw; __i++)
+ {
+   _WordT __thisword = _M_w[__i];
+   if (__thisword != static_cast<_WordT>(0))
+     return (__i * (8 * 8)
+      + __builtin_ctzl(__thisword));
+ }
+
+      return __not_found;
+    }
+
+  template<size_t _Nw>
+    size_t
+    _Base_bitset<_Nw>::
+    _M_do_find_next(size_t __prev, size_t __not_found) const noexcept
+    {
+
+      ++__prev;
+
+
+      if (__prev >= _Nw * (8 * 8))
+ return __not_found;
+
+
+      size_t __i = _S_whichword(__prev);
+      _WordT __thisword = _M_w[__i];
+
+
+      __thisword &= (~static_cast<_WordT>(0)) << _S_whichbit(__prev);
+
+      if (__thisword != static_cast<_WordT>(0))
+ return (__i * (8 * 8)
+  + __builtin_ctzl(__thisword));
+
+
+      __i++;
+      for (; __i < _Nw; __i++)
+ {
+   __thisword = _M_w[__i];
+   if (__thisword != static_cast<_WordT>(0))
+     return (__i * (8 * 8)
+      + __builtin_ctzl(__thisword));
+ }
+
+      return __not_found;
+    }
+
+
+
+
+
+
+  template<>
+    struct _Base_bitset<1>
+    {
+      typedef unsigned long _WordT;
+      _WordT _M_w;
+
+      constexpr _Base_bitset() noexcept
+      : _M_w(0)
+      { }
+
+
+      constexpr _Base_bitset(unsigned long long __val) noexcept
+
+
+
+      : _M_w(__val)
+      { }
+
+      static constexpr size_t
+      _S_whichword(size_t __pos) noexcept
+      { return __pos / (8 * 8); }
+
+      static constexpr size_t
+      _S_whichbyte(size_t __pos) noexcept
+      { return (__pos % (8 * 8)) / 8; }
+
+      static constexpr size_t
+      _S_whichbit(size_t __pos) noexcept
+      { return __pos % (8 * 8); }
+
+      static constexpr _WordT
+      _S_maskbit(size_t __pos) noexcept
+      { return (static_cast<_WordT>(1)) << _S_whichbit(__pos); }
+
+      _WordT&
+      _M_getword(size_t) noexcept
+      { return _M_w; }
+
+      constexpr _WordT
+      _M_getword(size_t) const noexcept
+      { return _M_w; }
+
+
+      const _WordT*
+      _M_getdata() const noexcept
+      { return &_M_w; }
+
+
+      _WordT&
+      _M_hiword() noexcept
+      { return _M_w; }
+
+      constexpr _WordT
+      _M_hiword() const noexcept
+      { return _M_w; }
+
+      void
+      _M_do_and(const _Base_bitset<1>& __x) noexcept
+      { _M_w &= __x._M_w; }
+
+      void
+      _M_do_or(const _Base_bitset<1>& __x) noexcept
+      { _M_w |= __x._M_w; }
+
+      void
+      _M_do_xor(const _Base_bitset<1>& __x) noexcept
+      { _M_w ^= __x._M_w; }
+
+      void
+      _M_do_left_shift(size_t __shift) noexcept
+      { _M_w <<= __shift; }
+
+      void
+      _M_do_right_shift(size_t __shift) noexcept
+      { _M_w >>= __shift; }
+
+      void
+      _M_do_flip() noexcept
+      { _M_w = ~_M_w; }
+
+      void
+      _M_do_set() noexcept
+      { _M_w = ~static_cast<_WordT>(0); }
+
+      void
+      _M_do_reset() noexcept
+      { _M_w = 0; }
+
+      bool
+      _M_is_equal(const _Base_bitset<1>& __x) const noexcept
+      { return _M_w == __x._M_w; }
+
+      template<size_t _Nb>
+        bool
+        _M_are_all() const noexcept
+        { return _M_w == (~static_cast<_WordT>(0)
+     >> ((8 * 8) - _Nb)); }
+
+      bool
+      _M_is_any() const noexcept
+      { return _M_w != 0; }
+
+      size_t
+      _M_do_count() const noexcept
+      { return __builtin_popcountl(_M_w); }
+
+      unsigned long
+      _M_do_to_ulong() const noexcept
+      { return _M_w; }
+
+
+      unsigned long long
+      _M_do_to_ullong() const noexcept
+      { return _M_w; }
+
+
+      size_t
+      _M_do_find_first(size_t __not_found) const noexcept
+      {
+        if (_M_w != 0)
+          return __builtin_ctzl(_M_w);
+        else
+          return __not_found;
+      }
+
+
+      size_t
+      _M_do_find_next(size_t __prev, size_t __not_found) const
+ noexcept
+      {
+ ++__prev;
+ if (__prev >= ((size_t) (8 * 8)))
+   return __not_found;
+
+ _WordT __x = _M_w >> __prev;
+ if (__x != 0)
+   return __builtin_ctzl(__x) + __prev;
+ else
+   return __not_found;
+      }
+    };
+
+
+
+
+
+
+  template<>
+    struct _Base_bitset<0>
+    {
+      typedef unsigned long _WordT;
+
+      constexpr _Base_bitset() noexcept
+      { }
+
+
+      constexpr _Base_bitset(unsigned long long) noexcept
+
+
+
+      { }
+
+      static constexpr size_t
+      _S_whichword(size_t __pos) noexcept
+      { return __pos / (8 * 8); }
+
+      static constexpr size_t
+      _S_whichbyte(size_t __pos) noexcept
+      { return (__pos % (8 * 8)) / 8; }
+
+      static constexpr size_t
+      _S_whichbit(size_t __pos) noexcept
+      { return __pos % (8 * 8); }
+
+      static constexpr _WordT
+      _S_maskbit(size_t __pos) noexcept
+      { return (static_cast<_WordT>(1)) << _S_whichbit(__pos); }
+      _WordT&
+      _M_getword(size_t) noexcept
+      {
+ __throw_out_of_range(("_Base_bitset::_M_getword"));
+ return *new _WordT;
+      }
+
+      constexpr _WordT
+      _M_getword(size_t) const noexcept
+      { return 0; }
+
+      constexpr _WordT
+      _M_hiword() const noexcept
+      { return 0; }
+
+      void
+      _M_do_and(const _Base_bitset<0>&) noexcept
+      { }
+
+      void
+      _M_do_or(const _Base_bitset<0>&) noexcept
+      { }
+
+      void
+      _M_do_xor(const _Base_bitset<0>&) noexcept
+      { }
+
+      void
+      _M_do_left_shift(size_t) noexcept
+      { }
+
+      void
+      _M_do_right_shift(size_t) noexcept
+      { }
+
+      void
+      _M_do_flip() noexcept
+      { }
+
+      void
+      _M_do_set() noexcept
+      { }
+
+      void
+      _M_do_reset() noexcept
+      { }
+
+
+
+
+      bool
+      _M_is_equal(const _Base_bitset<0>&) const noexcept
+      { return true; }
+
+      template<size_t _Nb>
+        bool
+        _M_are_all() const noexcept
+        { return true; }
+
+      bool
+      _M_is_any() const noexcept
+      { return false; }
+
+      size_t
+      _M_do_count() const noexcept
+      { return 0; }
+
+      unsigned long
+      _M_do_to_ulong() const noexcept
+      { return 0; }
+
+
+      unsigned long long
+      _M_do_to_ullong() const noexcept
+      { return 0; }
+
+
+
+
+      size_t
+      _M_do_find_first(size_t) const noexcept
+      { return 0; }
+
+      size_t
+      _M_do_find_next(size_t, size_t) const noexcept
+      { return 0; }
+    };
+
+
+
+  template<size_t _Extrabits>
+    struct _Sanitize
+    {
+      typedef unsigned long _WordT;
+
+      static void
+      _S_do_sanitize(_WordT& __val) noexcept
+      { __val &= ~((~static_cast<_WordT>(0)) << _Extrabits); }
+    };
+
+  template<>
+    struct _Sanitize<0>
+    {
+      typedef unsigned long _WordT;
+
+      static void
+      _S_do_sanitize(_WordT) noexcept { }
+    };
+
+
+  template<size_t _Nb, bool = (_Nb < (8 * 8))>
+    struct _Sanitize_val
+    {
+      static constexpr unsigned long long
+      _S_do_sanitize_val(unsigned long long __val)
+      { return __val; }
+    };
+
+  template<size_t _Nb>
+    struct _Sanitize_val<_Nb, true>
+    {
+      static constexpr unsigned long long
+      _S_do_sanitize_val(unsigned long long __val)
+      { return __val & ~((~static_cast<unsigned long long>(0)) << _Nb); }
+    };
+  template<size_t _Nb>
+    class bitset
+    : private _Base_bitset<((_Nb) / (8 * 8) + ((_Nb) % (8 * 8) == 0 ? 0 : 1))>
+    {
+    private:
+      typedef _Base_bitset<((_Nb) / (8 * 8) + ((_Nb) % (8 * 8) == 0 ? 0 : 1))> _Base;
+      typedef unsigned long _WordT;
+
+      template<class _CharT, class _Traits, class _Alloc>
+      void
+      _M_check_initial_position(const std::basic_string<_CharT, _Traits, _Alloc>& __s,
+    size_t __position) const
+      {
+ if (__position > __s.size())
+   __throw_out_of_range_fmt(("bitset::bitset: __position " "(which is %zu) > __s.size() " "(which is %zu)")
+
+                            ,
+       __position, __s.size());
+      }
+
+      void _M_check(size_t __position, const char *__s) const
+      {
+ if (__position >= _Nb)
+   __throw_out_of_range_fmt(("%s: __position (which is %zu) " ">= _Nb (which is %zu)")
+                                   ,
+       __s, __position, _Nb);
+      }
+
+      void
+      _M_do_sanitize() noexcept
+      {
+ typedef _Sanitize<_Nb % (8 * 8)> __sanitize_type;
+ __sanitize_type::_S_do_sanitize(this->_M_hiword());
+      }
+
+
+      template<typename> friend struct hash;
+
+
+    public:
+      class reference
+      {
+ friend class bitset;
+
+ _WordT* _M_wp;
+ size_t _M_bpos;
+
+
+ reference();
+
+      public:
+ reference(bitset& __b, size_t __pos) noexcept
+ {
+   _M_wp = &__b._M_getword(__pos);
+   _M_bpos = _Base::_S_whichbit(__pos);
+ }
+
+ ~reference() noexcept
+ { }
+
+
+ reference&
+ operator=(bool __x) noexcept
+ {
+   if (__x)
+     *_M_wp |= _Base::_S_maskbit(_M_bpos);
+   else
+     *_M_wp &= ~_Base::_S_maskbit(_M_bpos);
+   return *this;
+ }
+
+
+ reference&
+ operator=(const reference& __j) noexcept
+ {
+   if ((*(__j._M_wp) & _Base::_S_maskbit(__j._M_bpos)))
+     *_M_wp |= _Base::_S_maskbit(_M_bpos);
+   else
+     *_M_wp &= ~_Base::_S_maskbit(_M_bpos);
+   return *this;
+ }
+
+
+ bool
+ operator~() const noexcept
+ { return (*(_M_wp) & _Base::_S_maskbit(_M_bpos)) == 0; }
+
+
+ operator bool() const noexcept
+ { return (*(_M_wp) & _Base::_S_maskbit(_M_bpos)) != 0; }
+
+
+ reference&
+ flip() noexcept
+ {
+   *_M_wp ^= _Base::_S_maskbit(_M_bpos);
+   return *this;
+ }
+      };
+      friend class reference;
+
+
+
+      constexpr bitset() noexcept
+      { }
+
+
+
+      constexpr bitset(unsigned long long __val) noexcept
+      : _Base(_Sanitize_val<_Nb>::_S_do_sanitize_val(__val)) { }
+      template<class _CharT, class _Traits, class _Alloc>
+ explicit
+ bitset(const std::basic_string<_CharT, _Traits, _Alloc>& __s,
+        size_t __position = 0)
+ : _Base()
+ {
+   _M_check_initial_position(__s, __position);
+   _M_copy_from_string(__s, __position,
+         std::basic_string<_CharT, _Traits, _Alloc>::npos,
+         _CharT('0'), _CharT('1'));
+ }
+      template<class _CharT, class _Traits, class _Alloc>
+ bitset(const std::basic_string<_CharT, _Traits, _Alloc>& __s,
+        size_t __position, size_t __n)
+ : _Base()
+ {
+   _M_check_initial_position(__s, __position);
+   _M_copy_from_string(__s, __position, __n, _CharT('0'), _CharT('1'));
+ }
+
+
+
+      template<class _CharT, class _Traits, class _Alloc>
+ bitset(const std::basic_string<_CharT, _Traits, _Alloc>& __s,
+        size_t __position, size_t __n,
+        _CharT __zero, _CharT __one = _CharT('1'))
+ : _Base()
+ {
+   _M_check_initial_position(__s, __position);
+   _M_copy_from_string(__s, __position, __n, __zero, __one);
+ }
+      template<typename _CharT>
+        explicit
+        bitset(const _CharT* __str,
+        typename std::basic_string<_CharT>::size_type __n
+        = std::basic_string<_CharT>::npos,
+        _CharT __zero = _CharT('0'), _CharT __one = _CharT('1'))
+        : _Base()
+        {
+   if (!__str)
+     __throw_logic_error(("bitset::bitset(const _CharT*, ...)"));
+
+   if (__n == std::basic_string<_CharT>::npos)
+     __n = std::char_traits<_CharT>::length(__str);
+   _M_copy_from_ptr<_CharT, std::char_traits<_CharT>>(__str, __n, 0,
+            __n, __zero,
+            __one);
+ }
+      bitset<_Nb>&
+      operator&=(const bitset<_Nb>& __rhs) noexcept
+      {
+ this->_M_do_and(__rhs);
+ return *this;
+      }
+
+      bitset<_Nb>&
+      operator|=(const bitset<_Nb>& __rhs) noexcept
+      {
+ this->_M_do_or(__rhs);
+ return *this;
+      }
+
+      bitset<_Nb>&
+      operator^=(const bitset<_Nb>& __rhs) noexcept
+      {
+ this->_M_do_xor(__rhs);
+ return *this;
+      }
+      bitset<_Nb>&
+      operator<<=(size_t __position) noexcept
+      {
+ if (__builtin_expect(__position < _Nb, 1))
+   {
+     this->_M_do_left_shift(__position);
+     this->_M_do_sanitize();
+   }
+ else
+   this->_M_do_reset();
+ return *this;
+      }
+
+      bitset<_Nb>&
+      operator>>=(size_t __position) noexcept
+      {
+ if (__builtin_expect(__position < _Nb, 1))
+   {
+     this->_M_do_right_shift(__position);
+     this->_M_do_sanitize();
+   }
+ else
+   this->_M_do_reset();
+ return *this;
+      }
+      bitset<_Nb>&
+      _Unchecked_set(size_t __pos) noexcept
+      {
+ this->_M_getword(__pos) |= _Base::_S_maskbit(__pos);
+ return *this;
+      }
+
+      bitset<_Nb>&
+      _Unchecked_set(size_t __pos, int __val) noexcept
+      {
+ if (__val)
+   this->_M_getword(__pos) |= _Base::_S_maskbit(__pos);
+ else
+   this->_M_getword(__pos) &= ~_Base::_S_maskbit(__pos);
+ return *this;
+      }
+
+      bitset<_Nb>&
+      _Unchecked_reset(size_t __pos) noexcept
+      {
+ this->_M_getword(__pos) &= ~_Base::_S_maskbit(__pos);
+ return *this;
+      }
+
+      bitset<_Nb>&
+      _Unchecked_flip(size_t __pos) noexcept
+      {
+ this->_M_getword(__pos) ^= _Base::_S_maskbit(__pos);
+ return *this;
+      }
+
+      constexpr bool
+      _Unchecked_test(size_t __pos) const noexcept
+      { return ((this->_M_getword(__pos) & _Base::_S_maskbit(__pos))
+  != static_cast<_WordT>(0)); }
+
+
+
+
+
+
+      bitset<_Nb>&
+      set() noexcept
+      {
+ this->_M_do_set();
+ this->_M_do_sanitize();
+ return *this;
+      }
+
+
+
+
+
+
+
+      bitset<_Nb>&
+      set(size_t __position, bool __val = true)
+      {
+ this->_M_check(__position, ("bitset::set"));
+ return _Unchecked_set(__position, __val);
+      }
+
+
+
+
+      bitset<_Nb>&
+      reset() noexcept
+      {
+ this->_M_do_reset();
+ return *this;
+      }
+      bitset<_Nb>&
+      reset(size_t __position)
+      {
+ this->_M_check(__position, ("bitset::reset"));
+ return _Unchecked_reset(__position);
+      }
+
+
+
+
+      bitset<_Nb>&
+      flip() noexcept
+      {
+ this->_M_do_flip();
+ this->_M_do_sanitize();
+ return *this;
+      }
+
+
+
+
+
+
+      bitset<_Nb>&
+      flip(size_t __position)
+      {
+ this->_M_check(__position, ("bitset::flip"));
+ return _Unchecked_flip(__position);
+      }
+
+
+      bitset<_Nb>
+      operator~() const noexcept
+      { return bitset<_Nb>(*this).flip(); }
+      reference
+      operator[](size_t __position)
+      { return reference(*this, __position); }
+
+      constexpr bool
+      operator[](size_t __position) const
+      { return _Unchecked_test(__position); }
+      unsigned long
+      to_ulong() const
+      { return this->_M_do_to_ulong(); }
+
+
+      unsigned long long
+      to_ullong() const
+      { return this->_M_do_to_ullong(); }
+      template<class _CharT, class _Traits, class _Alloc>
+ std::basic_string<_CharT, _Traits, _Alloc>
+ to_string() const
+ {
+   std::basic_string<_CharT, _Traits, _Alloc> __result;
+   _M_copy_to_string(__result, _CharT('0'), _CharT('1'));
+   return __result;
+ }
+
+
+
+      template<class _CharT, class _Traits, class _Alloc>
+ std::basic_string<_CharT, _Traits, _Alloc>
+ to_string(_CharT __zero, _CharT __one = _CharT('1')) const
+ {
+   std::basic_string<_CharT, _Traits, _Alloc> __result;
+   _M_copy_to_string(__result, __zero, __one);
+   return __result;
+ }
+
+
+
+      template<class _CharT, class _Traits>
+ std::basic_string<_CharT, _Traits, std::allocator<_CharT> >
+ to_string() const
+ { return to_string<_CharT, _Traits, std::allocator<_CharT> >(); }
+
+
+
+      template<class _CharT, class _Traits>
+ std::basic_string<_CharT, _Traits, std::allocator<_CharT> >
+ to_string(_CharT __zero, _CharT __one = _CharT('1')) const
+ { return to_string<_CharT, _Traits,
+                    std::allocator<_CharT> >(__zero, __one); }
+
+      template<class _CharT>
+ std::basic_string<_CharT, std::char_traits<_CharT>,
+                   std::allocator<_CharT> >
+ to_string() const
+ {
+   return to_string<_CharT, std::char_traits<_CharT>,
+                    std::allocator<_CharT> >();
+ }
+
+      template<class _CharT>
+ std::basic_string<_CharT, std::char_traits<_CharT>,
+                   std::allocator<_CharT> >
+ to_string(_CharT __zero, _CharT __one = _CharT('1')) const
+ {
+   return to_string<_CharT, std::char_traits<_CharT>,
+                    std::allocator<_CharT> >(__zero, __one);
+ }
+
+      std::basic_string<char, std::char_traits<char>, std::allocator<char> >
+      to_string() const
+      {
+ return to_string<char, std::char_traits<char>,
+                  std::allocator<char> >();
+      }
+
+      std::basic_string<char, std::char_traits<char>, std::allocator<char> >
+      to_string(char __zero, char __one = '1') const
+      {
+ return to_string<char, std::char_traits<char>,
+                  std::allocator<char> >(__zero, __one);
+      }
+
+
+      template<class _CharT, class _Traits>
+        void
+        _M_copy_from_ptr(const _CharT*, size_t, size_t, size_t,
+    _CharT, _CharT);
+
+      template<class _CharT, class _Traits, class _Alloc>
+ void
+ _M_copy_from_string(const std::basic_string<_CharT,
+       _Traits, _Alloc>& __s, size_t __pos, size_t __n,
+       _CharT __zero, _CharT __one)
+ { _M_copy_from_ptr<_CharT, _Traits>(__s.data(), __s.size(), __pos, __n,
+         __zero, __one); }
+
+      template<class _CharT, class _Traits, class _Alloc>
+ void
+        _M_copy_to_string(std::basic_string<_CharT, _Traits, _Alloc>&,
+     _CharT, _CharT) const;
+
+
+      template<class _CharT, class _Traits, class _Alloc>
+ void
+ _M_copy_from_string(const std::basic_string<_CharT,
+       _Traits, _Alloc>& __s, size_t __pos, size_t __n)
+ { _M_copy_from_string(__s, __pos, __n, _CharT('0'), _CharT('1')); }
+
+      template<class _CharT, class _Traits, class _Alloc>
+ void
+        _M_copy_to_string(std::basic_string<_CharT, _Traits,_Alloc>& __s) const
+ { _M_copy_to_string(__s, _CharT('0'), _CharT('1')); }
+
+
+      size_t
+      count() const noexcept
+      { return this->_M_do_count(); }
+
+
+      constexpr size_t
+      size() const noexcept
+      { return _Nb; }
+
+
+
+      bool
+      operator==(const bitset<_Nb>& __rhs) const noexcept
+      { return this->_M_is_equal(__rhs); }
+
+      bool
+      operator!=(const bitset<_Nb>& __rhs) const noexcept
+      { return !this->_M_is_equal(__rhs); }
+      bool
+      test(size_t __position) const
+      {
+ this->_M_check(__position, ("bitset::test"));
+ return _Unchecked_test(__position);
+      }
+
+
+
+
+
+
+
+      bool
+      all() const noexcept
+      { return this->template _M_are_all<_Nb>(); }
+
+
+
+
+
+      bool
+      any() const noexcept
+      { return this->_M_is_any(); }
+
+
+
+
+
+      bool
+      none() const noexcept
+      { return !this->_M_is_any(); }
+
+
+
+      bitset<_Nb>
+      operator<<(size_t __position) const noexcept
+      { return bitset<_Nb>(*this) <<= __position; }
+
+      bitset<_Nb>
+      operator>>(size_t __position) const noexcept
+      { return bitset<_Nb>(*this) >>= __position; }
+      size_t
+      _Find_first() const noexcept
+      { return this->_M_do_find_first(_Nb); }
+      size_t
+      _Find_next(size_t __prev) const noexcept
+      { return this->_M_do_find_next(__prev, _Nb); }
+    };
+
+
+  template<size_t _Nb>
+    template<class _CharT, class _Traits>
+      void
+      bitset<_Nb>::
+      _M_copy_from_ptr(const _CharT* __s, size_t __len,
+         size_t __pos, size_t __n, _CharT __zero, _CharT __one)
+      {
+ reset();
+ const size_t __nbits = std::min(_Nb, std::min(__n, size_t(__len - __pos)));
+ for (size_t __i = __nbits; __i > 0; --__i)
+   {
+     const _CharT __c = __s[__pos + __nbits - __i];
+     if (_Traits::eq(__c, __zero))
+       ;
+     else if (_Traits::eq(__c, __one))
+       _Unchecked_set(__i - 1);
+     else
+       __throw_invalid_argument(("bitset::_M_copy_from_ptr"));
+   }
+      }
+
+  template<size_t _Nb>
+    template<class _CharT, class _Traits, class _Alloc>
+      void
+      bitset<_Nb>::
+      _M_copy_to_string(std::basic_string<_CharT, _Traits, _Alloc>& __s,
+   _CharT __zero, _CharT __one) const
+      {
+ __s.assign(_Nb, __zero);
+ for (size_t __i = _Nb; __i > 0; --__i)
+   if (_Unchecked_test(__i - 1))
+     _Traits::assign(__s[_Nb - __i], __one);
+      }
+  template<size_t _Nb>
+    inline bitset<_Nb>
+    operator&(const bitset<_Nb>& __x, const bitset<_Nb>& __y) noexcept
+    {
+      bitset<_Nb> __result(__x);
+      __result &= __y;
+      return __result;
+    }
+
+  template<size_t _Nb>
+    inline bitset<_Nb>
+    operator|(const bitset<_Nb>& __x, const bitset<_Nb>& __y) noexcept
+    {
+      bitset<_Nb> __result(__x);
+      __result |= __y;
+      return __result;
+    }
+
+  template <size_t _Nb>
+    inline bitset<_Nb>
+    operator^(const bitset<_Nb>& __x, const bitset<_Nb>& __y) noexcept
+    {
+      bitset<_Nb> __result(__x);
+      __result ^= __y;
+      return __result;
+    }
+  template<class _CharT, class _Traits, size_t _Nb>
+    std::basic_istream<_CharT, _Traits>&
+    operator>>(std::basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x)
+    {
+      typedef typename _Traits::char_type char_type;
+      typedef std::basic_istream<_CharT, _Traits> __istream_type;
+      typedef typename __istream_type::ios_base __ios_base;
+
+      std::basic_string<_CharT, _Traits> __tmp;
+      __tmp.reserve(_Nb);
+
+
+
+      const char_type __zero = __is.widen('0');
+      const char_type __one = __is.widen('1');
+
+      typename __ios_base::iostate __state = __ios_base::goodbit;
+      typename __istream_type::sentry __sentry(__is);
+      if (__sentry)
+ {
+   if (true)
+     {
+       for (size_t __i = _Nb; __i > 0; --__i)
+  {
+    static typename _Traits::int_type __eof = _Traits::eof();
+
+    typename _Traits::int_type __c1 = __is.rdbuf()->sbumpc();
+    if (_Traits::eq_int_type(__c1, __eof))
+      {
+        __state |= __ios_base::eofbit;
+        break;
+      }
+    else
+      {
+        const char_type __c2 = _Traits::to_char_type(__c1);
+        if (_Traits::eq(__c2, __zero))
+   __tmp.push_back(__zero);
+        else if (_Traits::eq(__c2, __one))
+   __tmp.push_back(__one);
+        else if (_Traits::
+          eq_int_type(__is.rdbuf()->sputbackc(__c2),
+        __eof))
+   {
+     __state |= __ios_base::failbit;
+     break;
+   }
+      }
+  }
+     }
+   if (false)
+     {
+       __is._M_setstate(__ios_base::badbit);
+       ;
+     }
+   if (false)
+     { __is._M_setstate(__ios_base::badbit); }
+ }
+
+      if (__tmp.empty() && _Nb)
+ __state |= __ios_base::failbit;
+      else
+ __x._M_copy_from_string(__tmp, static_cast<size_t>(0), _Nb,
+    __zero, __one);
+      if (__state)
+ __is.setstate(__state);
+      return __is;
+    }
+
+  template <class _CharT, class _Traits, size_t _Nb>
+    std::basic_ostream<_CharT, _Traits>&
+    operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+        const bitset<_Nb>& __x)
+    {
+      std::basic_string<_CharT, _Traits> __tmp;
+
+
+
+      const ctype<_CharT>& __ct = use_facet<ctype<_CharT> >(__os.getloc());
+      __x._M_copy_to_string(__tmp, __ct.widen('0'), __ct.widen('1'));
+      return __os << __tmp;
+    }
+
+
+
+}
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+
+  template<size_t _Nb>
+    struct hash<std::bitset<_Nb>>
+    : public __hash_base<size_t, std::bitset<_Nb>>
+    {
+      size_t
+      operator()(const std::bitset<_Nb>& __b) const noexcept
+      {
+ const size_t __clength = (_Nb + 8 - 1) / 8;
+ return std::_Hash_impl::hash(__b._M_getdata(), __clength);
+      }
+    };
+
+  template<>
+    struct hash<std::bitset<0>>
+    : public __hash_base<size_t, std::bitset<0>>
+    {
+      size_t
+      operator()(const std::bitset<0>&) const noexcept
+      { return 0; }
+    };
+
+
+}
+       
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+       
+
+       
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+  enum _Rb_tree_color { _S_red = false, _S_black = true };
+
+  struct _Rb_tree_node_base
+  {
+    typedef _Rb_tree_node_base* _Base_ptr;
+    typedef const _Rb_tree_node_base* _Const_Base_ptr;
+
+    _Rb_tree_color _M_color;
+    _Base_ptr _M_parent;
+    _Base_ptr _M_left;
+    _Base_ptr _M_right;
+
+    static _Base_ptr
+    _S_minimum(_Base_ptr __x) noexcept
+    {
+      while (__x->_M_left != 0) __x = __x->_M_left;
+      return __x;
+    }
+
+    static _Const_Base_ptr
+    _S_minimum(_Const_Base_ptr __x) noexcept
+    {
+      while (__x->_M_left != 0) __x = __x->_M_left;
+      return __x;
+    }
+
+    static _Base_ptr
+    _S_maximum(_Base_ptr __x) noexcept
+    {
+      while (__x->_M_right != 0) __x = __x->_M_right;
+      return __x;
+    }
+
+    static _Const_Base_ptr
+    _S_maximum(_Const_Base_ptr __x) noexcept
+    {
+      while (__x->_M_right != 0) __x = __x->_M_right;
+      return __x;
+    }
+  };
+
+
+  template<typename _Key_compare>
+    struct _Rb_tree_key_compare
+    {
+      _Key_compare _M_key_compare;
+
+      _Rb_tree_key_compare()
+      noexcept(is_nothrow_default_constructible<_Key_compare>::value)
+
+      : _M_key_compare()
+      { }
+
+      _Rb_tree_key_compare(const _Key_compare& __comp)
+      : _M_key_compare(__comp)
+      { }
+
+
+
+      _Rb_tree_key_compare(const _Rb_tree_key_compare&) = default;
+
+      _Rb_tree_key_compare(_Rb_tree_key_compare&& __x)
+ noexcept(is_nothrow_copy_constructible<_Key_compare>::value)
+      : _M_key_compare(__x._M_key_compare)
+      { }
+
+    };
+
+
+  struct _Rb_tree_header
+  {
+    _Rb_tree_node_base _M_header;
+    size_t _M_node_count;
+
+    _Rb_tree_header() noexcept
+    {
+      _M_header._M_color = _S_red;
+      _M_reset();
+    }
+
+
+    _Rb_tree_header(_Rb_tree_header&& __x) noexcept
+    {
+      if (__x._M_header._M_parent != nullptr)
+ _M_move_data(__x);
+      else
+ {
+   _M_header._M_color = _S_red;
+   _M_reset();
+ }
+    }
+
+
+    void
+    _M_move_data(_Rb_tree_header& __from)
+    {
+      _M_header._M_color = __from._M_header._M_color;
+      _M_header._M_parent = __from._M_header._M_parent;
+      _M_header._M_left = __from._M_header._M_left;
+      _M_header._M_right = __from._M_header._M_right;
+      _M_header._M_parent->_M_parent = &_M_header;
+      _M_node_count = __from._M_node_count;
+
+      __from._M_reset();
+    }
+
+    void
+    _M_reset()
+    {
+      _M_header._M_parent = 0;
+      _M_header._M_left = &_M_header;
+      _M_header._M_right = &_M_header;
+      _M_node_count = 0;
+    }
+  };
+
+  template<typename _Val>
+    struct _Rb_tree_node : public _Rb_tree_node_base
+    {
+      typedef _Rb_tree_node<_Val>* _Link_type;
+      __gnu_cxx::__aligned_membuf<_Val> _M_storage;
+
+      _Val*
+      _M_valptr()
+      { return _M_storage._M_ptr(); }
+
+      const _Val*
+      _M_valptr() const
+      { return _M_storage._M_ptr(); }
+
+    };
+
+  __attribute__ ((__pure__)) _Rb_tree_node_base*
+  _Rb_tree_increment(_Rb_tree_node_base* __x) throw ();
+
+  __attribute__ ((__pure__)) const _Rb_tree_node_base*
+  _Rb_tree_increment(const _Rb_tree_node_base* __x) throw ();
+
+  __attribute__ ((__pure__)) _Rb_tree_node_base*
+  _Rb_tree_decrement(_Rb_tree_node_base* __x) throw ();
+
+  __attribute__ ((__pure__)) const _Rb_tree_node_base*
+  _Rb_tree_decrement(const _Rb_tree_node_base* __x) throw ();
+
+  template<typename _Tp>
+    struct _Rb_tree_iterator
+    {
+      typedef _Tp value_type;
+      typedef _Tp& reference;
+      typedef _Tp* pointer;
+
+      typedef bidirectional_iterator_tag iterator_category;
+      typedef ptrdiff_t difference_type;
+
+      typedef _Rb_tree_iterator<_Tp> _Self;
+      typedef _Rb_tree_node_base::_Base_ptr _Base_ptr;
+      typedef _Rb_tree_node<_Tp>* _Link_type;
+
+      _Rb_tree_iterator() noexcept
+      : _M_node() { }
+
+      explicit
+      _Rb_tree_iterator(_Base_ptr __x) noexcept
+      : _M_node(__x) { }
+
+      reference
+      operator*() const noexcept
+      { return *static_cast<_Link_type>(_M_node)->_M_valptr(); }
+
+      pointer
+      operator->() const noexcept
+      { return static_cast<_Link_type> (_M_node)->_M_valptr(); }
+
+      _Self&
+      operator++() noexcept
+      {
+ _M_node = _Rb_tree_increment(_M_node);
+ return *this;
+      }
+
+      _Self
+      operator++(int) noexcept
+      {
+ _Self __tmp = *this;
+ _M_node = _Rb_tree_increment(_M_node);
+ return __tmp;
+      }
+
+      _Self&
+      operator--() noexcept
+      {
+ _M_node = _Rb_tree_decrement(_M_node);
+ return *this;
+      }
+
+      _Self
+      operator--(int) noexcept
+      {
+ _Self __tmp = *this;
+ _M_node = _Rb_tree_decrement(_M_node);
+ return __tmp;
+      }
+
+      bool
+      operator==(const _Self& __x) const noexcept
+      { return _M_node == __x._M_node; }
+
+      bool
+      operator!=(const _Self& __x) const noexcept
+      { return _M_node != __x._M_node; }
+
+      _Base_ptr _M_node;
+  };
+
+  template<typename _Tp>
+    struct _Rb_tree_const_iterator
+    {
+      typedef _Tp value_type;
+      typedef const _Tp& reference;
+      typedef const _Tp* pointer;
+
+      typedef _Rb_tree_iterator<_Tp> iterator;
+
+      typedef bidirectional_iterator_tag iterator_category;
+      typedef ptrdiff_t difference_type;
+
+      typedef _Rb_tree_const_iterator<_Tp> _Self;
+      typedef _Rb_tree_node_base::_Const_Base_ptr _Base_ptr;
+      typedef const _Rb_tree_node<_Tp>* _Link_type;
+
+      _Rb_tree_const_iterator() noexcept
+      : _M_node() { }
+
+      explicit
+      _Rb_tree_const_iterator(_Base_ptr __x) noexcept
+      : _M_node(__x) { }
+
+      _Rb_tree_const_iterator(const iterator& __it) noexcept
+      : _M_node(__it._M_node) { }
+
+      iterator
+      _M_const_cast() const noexcept
+      { return iterator(const_cast<typename iterator::_Base_ptr>(_M_node)); }
+
+      reference
+      operator*() const noexcept
+      { return *static_cast<_Link_type>(_M_node)->_M_valptr(); }
+
+      pointer
+      operator->() const noexcept
+      { return static_cast<_Link_type>(_M_node)->_M_valptr(); }
+
+      _Self&
+      operator++() noexcept
+      {
+ _M_node = _Rb_tree_increment(_M_node);
+ return *this;
+      }
+
+      _Self
+      operator++(int) noexcept
+      {
+ _Self __tmp = *this;
+ _M_node = _Rb_tree_increment(_M_node);
+ return __tmp;
+      }
+
+      _Self&
+      operator--() noexcept
+      {
+ _M_node = _Rb_tree_decrement(_M_node);
+ return *this;
+      }
+
+      _Self
+      operator--(int) noexcept
+      {
+ _Self __tmp = *this;
+ _M_node = _Rb_tree_decrement(_M_node);
+ return __tmp;
+      }
+
+      bool
+      operator==(const _Self& __x) const noexcept
+      { return _M_node == __x._M_node; }
+
+      bool
+      operator!=(const _Self& __x) const noexcept
+      { return _M_node != __x._M_node; }
+
+      _Base_ptr _M_node;
+    };
+
+  template<typename _Val>
+    inline bool
+    operator==(const _Rb_tree_iterator<_Val>& __x,
+        const _Rb_tree_const_iterator<_Val>& __y) noexcept
+    { return __x._M_node == __y._M_node; }
+
+  template<typename _Val>
+    inline bool
+    operator!=(const _Rb_tree_iterator<_Val>& __x,
+        const _Rb_tree_const_iterator<_Val>& __y) noexcept
+    { return __x._M_node != __y._M_node; }
+
+  void
+  _Rb_tree_insert_and_rebalance(const bool __insert_left,
+    _Rb_tree_node_base* __x,
+    _Rb_tree_node_base* __p,
+    _Rb_tree_node_base& __header) throw ();
+
+  _Rb_tree_node_base*
+  _Rb_tree_rebalance_for_erase(_Rb_tree_node_base* const __z,
+          _Rb_tree_node_base& __header) throw ();
+  template<typename _Key, typename _Val, typename _KeyOfValue,
+    typename _Compare, typename _Alloc = allocator<_Val> >
+    class _Rb_tree
+    {
+      typedef typename __gnu_cxx::__alloc_traits<_Alloc>::template
+ rebind<_Rb_tree_node<_Val> >::other _Node_allocator;
+
+      typedef __gnu_cxx::__alloc_traits<_Node_allocator> _Alloc_traits;
+
+
+      static_assert(__is_invocable<_Compare&, const _Key&, const _Key&>{},
+   "comparison object must be invocable with two arguments of key type");
+    protected:
+      typedef _Rb_tree_node_base* _Base_ptr;
+      typedef const _Rb_tree_node_base* _Const_Base_ptr;
+      typedef _Rb_tree_node<_Val>* _Link_type;
+      typedef const _Rb_tree_node<_Val>* _Const_Link_type;
+
+    private:
+
+
+      struct _Reuse_or_alloc_node
+      {
+ _Reuse_or_alloc_node(_Rb_tree& __t)
+   : _M_root(__t._M_root()), _M_nodes(__t._M_rightmost()), _M_t(__t)
+ {
+   if (_M_root)
+     {
+       _M_root->_M_parent = 0;
+
+       if (_M_nodes->_M_left)
+  _M_nodes = _M_nodes->_M_left;
+     }
+   else
+     _M_nodes = 0;
+ }
+
+
+ _Reuse_or_alloc_node(const _Reuse_or_alloc_node&) = delete;
+
+
+ ~_Reuse_or_alloc_node()
+ { _M_t._M_erase(static_cast<_Link_type>(_M_root)); }
+
+ template<typename _Arg>
+   _Link_type
+
+
+
+   operator()(_Arg&& __arg)
+
+   {
+     _Link_type __node = static_cast<_Link_type>(_M_extract());
+     if (__node)
+       {
+  _M_t._M_destroy_node(__node);
+  _M_t._M_construct_node(__node, std::forward<_Arg>(__arg));
+  return __node;
+       }
+
+     return _M_t._M_create_node(std::forward<_Arg>(__arg));
+   }
+
+      private:
+ _Base_ptr
+ _M_extract()
+ {
+   if (!_M_nodes)
+     return _M_nodes;
+
+   _Base_ptr __node = _M_nodes;
+   _M_nodes = _M_nodes->_M_parent;
+   if (_M_nodes)
+     {
+       if (_M_nodes->_M_right == __node)
+  {
+    _M_nodes->_M_right = 0;
+
+    if (_M_nodes->_M_left)
+      {
+        _M_nodes = _M_nodes->_M_left;
+
+        while (_M_nodes->_M_right)
+   _M_nodes = _M_nodes->_M_right;
+
+        if (_M_nodes->_M_left)
+   _M_nodes = _M_nodes->_M_left;
+      }
+  }
+       else
+  _M_nodes->_M_left = 0;
+     }
+   else
+     _M_root = 0;
+
+   return __node;
+ }
+
+ _Base_ptr _M_root;
+ _Base_ptr _M_nodes;
+ _Rb_tree& _M_t;
+      };
+
+
+
+      struct _Alloc_node
+      {
+ _Alloc_node(_Rb_tree& __t)
+   : _M_t(__t) { }
+
+ template<typename _Arg>
+   _Link_type
+
+
+
+   operator()(_Arg&& __arg) const
+
+   { return _M_t._M_create_node(std::forward<_Arg>(__arg)); }
+
+      private:
+ _Rb_tree& _M_t;
+      };
+
+    public:
+      typedef _Key key_type;
+      typedef _Val value_type;
+      typedef value_type* pointer;
+      typedef const value_type* const_pointer;
+      typedef value_type& reference;
+      typedef const value_type& const_reference;
+      typedef size_t size_type;
+      typedef ptrdiff_t difference_type;
+      typedef _Alloc allocator_type;
+
+      _Node_allocator&
+      _M_get_Node_allocator() noexcept
+      { return this->_M_impl; }
+
+      const _Node_allocator&
+      _M_get_Node_allocator() const noexcept
+      { return this->_M_impl; }
+
+      allocator_type
+      get_allocator() const noexcept
+      { return allocator_type(_M_get_Node_allocator()); }
+
+    protected:
+      _Link_type
+      _M_get_node()
+      { return _Alloc_traits::allocate(_M_get_Node_allocator(), 1); }
+
+      void
+      _M_put_node(_Link_type __p) noexcept
+      { _Alloc_traits::deallocate(_M_get_Node_allocator(), __p, 1); }
+      template<typename... _Args>
+ void
+ _M_construct_node(_Link_type __node, _Args&&... __args)
+ {
+   if (true)
+     {
+       ::new(__node) _Rb_tree_node<_Val>;
+       _Alloc_traits::construct(_M_get_Node_allocator(),
+           __node->_M_valptr(),
+           std::forward<_Args>(__args)...);
+     }
+   if (false)
+     {
+       __node->~_Rb_tree_node<_Val>();
+       _M_put_node(__node);
+       ;
+     }
+ }
+
+      template<typename... _Args>
+ _Link_type
+ _M_create_node(_Args&&... __args)
+ {
+   _Link_type __tmp = _M_get_node();
+   _M_construct_node(__tmp, std::forward<_Args>(__args)...);
+   return __tmp;
+ }
+
+      void
+      _M_destroy_node(_Link_type __p) noexcept
+      {
+ _Alloc_traits::destroy(_M_get_Node_allocator(), __p->_M_valptr());
+ __p->~_Rb_tree_node<_Val>();
+      }
+
+
+      void
+      _M_drop_node(_Link_type __p) noexcept
+      {
+ _M_destroy_node(__p);
+ _M_put_node(__p);
+      }
+
+      template<typename _NodeGen>
+ _Link_type
+ _M_clone_node(_Const_Link_type __x, _NodeGen& __node_gen)
+ {
+   _Link_type __tmp = __node_gen(*__x->_M_valptr());
+   __tmp->_M_color = __x->_M_color;
+   __tmp->_M_left = 0;
+   __tmp->_M_right = 0;
+   return __tmp;
+ }
+
+    protected:
+
+
+
+
+      template<typename _Key_compare,
+        bool = __is_pod(_Key_compare)>
+
+ struct _Rb_tree_impl
+ : public _Node_allocator
+ , public _Rb_tree_key_compare<_Key_compare>
+ , public _Rb_tree_header
+ {
+   typedef _Rb_tree_key_compare<_Key_compare> _Base_key_compare;
+
+   _Rb_tree_impl()
+     noexcept(is_nothrow_default_constructible<_Node_allocator>::value && is_nothrow_default_constructible<_Base_key_compare>::value)
+
+
+   : _Node_allocator()
+   { }
+
+   _Rb_tree_impl(const _Rb_tree_impl& __x)
+   : _Node_allocator(_Alloc_traits::_S_select_on_copy(__x))
+   , _Base_key_compare(__x._M_key_compare)
+   { }
+
+
+
+
+
+
+   _Rb_tree_impl(_Rb_tree_impl&&) = default;
+
+   _Rb_tree_impl(const _Key_compare& __comp, _Node_allocator&& __a)
+   : _Node_allocator(std::move(__a)), _Base_key_compare(__comp)
+   { }
+
+ };
+
+      _Rb_tree_impl<_Compare> _M_impl;
+
+    protected:
+      _Base_ptr&
+      _M_root() noexcept
+      { return this->_M_impl._M_header._M_parent; }
+
+      _Const_Base_ptr
+      _M_root() const noexcept
+      { return this->_M_impl._M_header._M_parent; }
+
+      _Base_ptr&
+      _M_leftmost() noexcept
+      { return this->_M_impl._M_header._M_left; }
+
+      _Const_Base_ptr
+      _M_leftmost() const noexcept
+      { return this->_M_impl._M_header._M_left; }
+
+      _Base_ptr&
+      _M_rightmost() noexcept
+      { return this->_M_impl._M_header._M_right; }
+
+      _Const_Base_ptr
+      _M_rightmost() const noexcept
+      { return this->_M_impl._M_header._M_right; }
+
+      _Link_type
+      _M_begin() noexcept
+      { return static_cast<_Link_type>(this->_M_impl._M_header._M_parent); }
+
+      _Const_Link_type
+      _M_begin() const noexcept
+      {
+ return static_cast<_Const_Link_type>
+   (this->_M_impl._M_header._M_parent);
+      }
+
+      _Base_ptr
+      _M_end() noexcept
+      { return &this->_M_impl._M_header; }
+
+      _Const_Base_ptr
+      _M_end() const noexcept
+      { return &this->_M_impl._M_header; }
+
+      static const_reference
+      _S_value(_Const_Link_type __x)
+      { return *__x->_M_valptr(); }
+
+      static const _Key&
+      _S_key(_Const_Link_type __x)
+      { return _KeyOfValue()(_S_value(__x)); }
+
+      static _Link_type
+      _S_left(_Base_ptr __x) noexcept
+      { return static_cast<_Link_type>(__x->_M_left); }
+
+      static _Const_Link_type
+      _S_left(_Const_Base_ptr __x) noexcept
+      { return static_cast<_Const_Link_type>(__x->_M_left); }
+
+      static _Link_type
+      _S_right(_Base_ptr __x) noexcept
+      { return static_cast<_Link_type>(__x->_M_right); }
+
+      static _Const_Link_type
+      _S_right(_Const_Base_ptr __x) noexcept
+      { return static_cast<_Const_Link_type>(__x->_M_right); }
+
+      static const_reference
+      _S_value(_Const_Base_ptr __x)
+      { return *static_cast<_Const_Link_type>(__x)->_M_valptr(); }
+
+      static const _Key&
+      _S_key(_Const_Base_ptr __x)
+      { return _KeyOfValue()(_S_value(__x)); }
+
+      static _Base_ptr
+      _S_minimum(_Base_ptr __x) noexcept
+      { return _Rb_tree_node_base::_S_minimum(__x); }
+
+      static _Const_Base_ptr
+      _S_minimum(_Const_Base_ptr __x) noexcept
+      { return _Rb_tree_node_base::_S_minimum(__x); }
+
+      static _Base_ptr
+      _S_maximum(_Base_ptr __x) noexcept
+      { return _Rb_tree_node_base::_S_maximum(__x); }
+
+      static _Const_Base_ptr
+      _S_maximum(_Const_Base_ptr __x) noexcept
+      { return _Rb_tree_node_base::_S_maximum(__x); }
+
+    public:
+      typedef _Rb_tree_iterator<value_type> iterator;
+      typedef _Rb_tree_const_iterator<value_type> const_iterator;
+
+      typedef std::reverse_iterator<iterator> reverse_iterator;
+      typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+      pair<_Base_ptr, _Base_ptr>
+      _M_get_insert_unique_pos(const key_type& __k);
+
+      pair<_Base_ptr, _Base_ptr>
+      _M_get_insert_equal_pos(const key_type& __k);
+
+      pair<_Base_ptr, _Base_ptr>
+      _M_get_insert_hint_unique_pos(const_iterator __pos,
+        const key_type& __k);
+
+      pair<_Base_ptr, _Base_ptr>
+      _M_get_insert_hint_equal_pos(const_iterator __pos,
+       const key_type& __k);
+
+    private:
+
+      template<typename _Arg, typename _NodeGen>
+ iterator
+ _M_insert_(_Base_ptr __x, _Base_ptr __y, _Arg&& __v, _NodeGen&);
+
+      iterator
+      _M_insert_node(_Base_ptr __x, _Base_ptr __y, _Link_type __z);
+
+      template<typename _Arg>
+ iterator
+ _M_insert_lower(_Base_ptr __y, _Arg&& __v);
+
+      template<typename _Arg>
+ iterator
+ _M_insert_equal_lower(_Arg&& __x);
+
+      iterator
+      _M_insert_lower_node(_Base_ptr __p, _Link_type __z);
+
+      iterator
+      _M_insert_equal_lower_node(_Link_type __z);
+      template<typename _NodeGen>
+ _Link_type
+ _M_copy(_Const_Link_type __x, _Base_ptr __p, _NodeGen&);
+
+      template<typename _NodeGen>
+ _Link_type
+ _M_copy(const _Rb_tree& __x, _NodeGen& __gen)
+ {
+   _Link_type __root = _M_copy(__x._M_begin(), _M_end(), __gen);
+   _M_leftmost() = _S_minimum(__root);
+   _M_rightmost() = _S_maximum(__root);
+   _M_impl._M_node_count = __x._M_impl._M_node_count;
+   return __root;
+ }
+
+      _Link_type
+      _M_copy(const _Rb_tree& __x)
+      {
+ _Alloc_node __an(*this);
+ return _M_copy(__x, __an);
+      }
+
+      void
+      _M_erase(_Link_type __x);
+
+      iterator
+      _M_lower_bound(_Link_type __x, _Base_ptr __y,
+       const _Key& __k);
+
+      const_iterator
+      _M_lower_bound(_Const_Link_type __x, _Const_Base_ptr __y,
+       const _Key& __k) const;
+
+      iterator
+      _M_upper_bound(_Link_type __x, _Base_ptr __y,
+       const _Key& __k);
+
+      const_iterator
+      _M_upper_bound(_Const_Link_type __x, _Const_Base_ptr __y,
+       const _Key& __k) const;
+
+    public:
+
+
+
+
+      _Rb_tree() = default;
+
+
+      _Rb_tree(const _Compare& __comp,
+        const allocator_type& __a = allocator_type())
+      : _M_impl(__comp, _Node_allocator(__a)) { }
+
+      _Rb_tree(const _Rb_tree& __x)
+      : _M_impl(__x._M_impl)
+      {
+ if (__x._M_root() != 0)
+   _M_root() = _M_copy(__x);
+      }
+
+
+      _Rb_tree(const allocator_type& __a)
+      : _M_impl(_Compare(), _Node_allocator(__a))
+      { }
+
+      _Rb_tree(const _Rb_tree& __x, const allocator_type& __a)
+      : _M_impl(__x._M_impl._M_key_compare, _Node_allocator(__a))
+      {
+ if (__x._M_root() != nullptr)
+   _M_root() = _M_copy(__x);
+      }
+
+      _Rb_tree(_Rb_tree&&) = default;
+
+      _Rb_tree(_Rb_tree&& __x, const allocator_type& __a)
+      : _Rb_tree(std::move(__x), _Node_allocator(__a))
+      { }
+
+      _Rb_tree(_Rb_tree&& __x, _Node_allocator&& __a);
+
+
+      ~_Rb_tree() noexcept
+      { _M_erase(_M_begin()); }
+
+      _Rb_tree&
+      operator=(const _Rb_tree& __x);
+
+
+      _Compare
+      key_comp() const
+      { return _M_impl._M_key_compare; }
+
+      iterator
+      begin() noexcept
+      { return iterator(this->_M_impl._M_header._M_left); }
+
+      const_iterator
+      begin() const noexcept
+      { return const_iterator(this->_M_impl._M_header._M_left); }
+
+      iterator
+      end() noexcept
+      { return iterator(&this->_M_impl._M_header); }
+
+      const_iterator
+      end() const noexcept
+      { return const_iterator(&this->_M_impl._M_header); }
+
+      reverse_iterator
+      rbegin() noexcept
+      { return reverse_iterator(end()); }
+
+      const_reverse_iterator
+      rbegin() const noexcept
+      { return const_reverse_iterator(end()); }
+
+      reverse_iterator
+      rend() noexcept
+      { return reverse_iterator(begin()); }
+
+      const_reverse_iterator
+      rend() const noexcept
+      { return const_reverse_iterator(begin()); }
+
+      bool
+      empty() const noexcept
+      { return _M_impl._M_node_count == 0; }
+
+      size_type
+      size() const noexcept
+      { return _M_impl._M_node_count; }
+
+      size_type
+      max_size() const noexcept
+      { return _Alloc_traits::max_size(_M_get_Node_allocator()); }
+
+      void
+      swap(_Rb_tree& __t)
+      noexcept(__is_nothrow_swappable<_Compare>::value);
+
+
+
+      template<typename _Arg>
+ pair<iterator, bool>
+ _M_insert_unique(_Arg&& __x);
+
+      template<typename _Arg>
+ iterator
+ _M_insert_equal(_Arg&& __x);
+
+      template<typename _Arg, typename _NodeGen>
+ iterator
+ _M_insert_unique_(const_iterator __pos, _Arg&& __x, _NodeGen&);
+
+      template<typename _Arg>
+ iterator
+ _M_insert_unique_(const_iterator __pos, _Arg&& __x)
+ {
+   _Alloc_node __an(*this);
+   return _M_insert_unique_(__pos, std::forward<_Arg>(__x), __an);
+ }
+
+      template<typename _Arg, typename _NodeGen>
+ iterator
+ _M_insert_equal_(const_iterator __pos, _Arg&& __x, _NodeGen&);
+
+      template<typename _Arg>
+ iterator
+ _M_insert_equal_(const_iterator __pos, _Arg&& __x)
+ {
+   _Alloc_node __an(*this);
+   return _M_insert_equal_(__pos, std::forward<_Arg>(__x), __an);
+ }
+
+      template<typename... _Args>
+ pair<iterator, bool>
+ _M_emplace_unique(_Args&&... __args);
+
+      template<typename... _Args>
+ iterator
+ _M_emplace_equal(_Args&&... __args);
+
+      template<typename... _Args>
+ iterator
+ _M_emplace_hint_unique(const_iterator __pos, _Args&&... __args);
+
+      template<typename... _Args>
+ iterator
+ _M_emplace_hint_equal(const_iterator __pos, _Args&&... __args);
+      template<typename _InputIterator>
+ void
+ _M_insert_unique(_InputIterator __first, _InputIterator __last);
+
+      template<typename _InputIterator>
+ void
+ _M_insert_equal(_InputIterator __first, _InputIterator __last);
+
+    private:
+      void
+      _M_erase_aux(const_iterator __position);
+
+      void
+      _M_erase_aux(const_iterator __first, const_iterator __last);
+
+    public:
+
+
+
+      __attribute ((__abi_tag__ ("cxx11")))
+      iterator
+      erase(const_iterator __position)
+      {
+ ;
+ const_iterator __result = __position;
+ ++__result;
+ _M_erase_aux(__position);
+ return __result._M_const_cast();
+      }
+
+
+      __attribute ((__abi_tag__ ("cxx11")))
+      iterator
+      erase(iterator __position)
+      {
+ ;
+ iterator __result = __position;
+ ++__result;
+ _M_erase_aux(__position);
+ return __result;
+      }
+      size_type
+      erase(const key_type& __x);
+
+
+
+
+      __attribute ((__abi_tag__ ("cxx11")))
+      iterator
+      erase(const_iterator __first, const_iterator __last)
+      {
+ _M_erase_aux(__first, __last);
+ return __last._M_const_cast();
+      }
+      void
+      erase(const key_type* __first, const key_type* __last);
+
+      void
+      clear() noexcept
+      {
+ _M_erase(_M_begin());
+ _M_impl._M_reset();
+      }
+
+
+      iterator
+      find(const key_type& __k);
+
+      const_iterator
+      find(const key_type& __k) const;
+
+      size_type
+      count(const key_type& __k) const;
+
+      iterator
+      lower_bound(const key_type& __k)
+      { return _M_lower_bound(_M_begin(), _M_end(), __k); }
+
+      const_iterator
+      lower_bound(const key_type& __k) const
+      { return _M_lower_bound(_M_begin(), _M_end(), __k); }
+
+      iterator
+      upper_bound(const key_type& __k)
+      { return _M_upper_bound(_M_begin(), _M_end(), __k); }
+
+      const_iterator
+      upper_bound(const key_type& __k) const
+      { return _M_upper_bound(_M_begin(), _M_end(), __k); }
+
+      pair<iterator, iterator>
+      equal_range(const key_type& __k);
+
+      pair<const_iterator, const_iterator>
+      equal_range(const key_type& __k) const;
+      bool
+      __rb_verify() const;
+
+
+      _Rb_tree&
+      operator=(_Rb_tree&&)
+      noexcept(_Alloc_traits::_S_nothrow_move()
+        && is_nothrow_move_assignable<_Compare>::value);
+
+      template<typename _Iterator>
+ void
+ _M_assign_unique(_Iterator, _Iterator);
+
+      template<typename _Iterator>
+ void
+ _M_assign_equal(_Iterator, _Iterator);
+
+    private:
+
+      void
+      _M_move_data(_Rb_tree& __x, std::true_type)
+      { _M_impl._M_move_data(__x._M_impl); }
+
+
+
+      void
+      _M_move_data(_Rb_tree&, std::false_type);
+
+
+      void
+      _M_move_assign(_Rb_tree&, std::true_type);
+
+
+
+      void
+      _M_move_assign(_Rb_tree&, std::false_type);
+    };
+
+  template<typename _Key, typename _Val, typename _KeyOfValue,
+    typename _Compare, typename _Alloc>
+    inline bool
+    operator==(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
+        const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
+    {
+      return __x.size() == __y.size()
+      && std::equal(__x.begin(), __x.end(), __y.begin());
+    }
+
+  template<typename _Key, typename _Val, typename _KeyOfValue,
+    typename _Compare, typename _Alloc>
+    inline bool
+    operator<(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
+       const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
+    {
+      return std::lexicographical_compare(__x.begin(), __x.end(),
+       __y.begin(), __y.end());
+    }
+
+  template<typename _Key, typename _Val, typename _KeyOfValue,
+    typename _Compare, typename _Alloc>
+    inline bool
+    operator!=(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
+        const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
+    { return !(__x == __y); }
+
+  template<typename _Key, typename _Val, typename _KeyOfValue,
+    typename _Compare, typename _Alloc>
+    inline bool
+    operator>(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
+       const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
+    { return __y < __x; }
+
+  template<typename _Key, typename _Val, typename _KeyOfValue,
+    typename _Compare, typename _Alloc>
+    inline bool
+    operator<=(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
+        const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
+    { return !(__y < __x); }
+
+  template<typename _Key, typename _Val, typename _KeyOfValue,
+    typename _Compare, typename _Alloc>
+    inline bool
+    operator>=(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
+        const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
+    { return !(__x < __y); }
+
+  template<typename _Key, typename _Val, typename _KeyOfValue,
+    typename _Compare, typename _Alloc>
+    inline void
+    swap(_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
+  _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
+    { __x.swap(__y); }
+
+
+  template<typename _Key, typename _Val, typename _KeyOfValue,
+    typename _Compare, typename _Alloc>
+    _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+    _Rb_tree(_Rb_tree&& __x, _Node_allocator&& __a)
+    : _M_impl(__x._M_impl._M_key_compare, std::move(__a))
+    {
+      using __eq = typename _Alloc_traits::is_always_equal;
+      if (__x._M_root() != nullptr)
+ _M_move_data(__x, __eq());
+    }
+
+  template<typename _Key, typename _Val, typename _KeyOfValue,
+    typename _Compare, typename _Alloc>
+    void
+    _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+    _M_move_data(_Rb_tree& __x, std::false_type)
+    {
+      if (_M_get_Node_allocator() == __x._M_get_Node_allocator())
+ _M_move_data(__x, std::true_type());
+      else
+ {
+   _Alloc_node __an(*this);
+   auto __lbd =
+     [&__an](const value_type& __cval)
+     {
+       auto& __val = const_cast<value_type&>(__cval);
+       return __an(std::move_if_noexcept(__val));
+     };
+   _M_root() = _M_copy(__x, __lbd);
+ }
+    }
+
+  template<typename _Key, typename _Val, typename _KeyOfValue,
+    typename _Compare, typename _Alloc>
+    inline void
+    _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+    _M_move_assign(_Rb_tree& __x, true_type)
+    {
+      clear();
+      if (__x._M_root() != nullptr)
+ _M_move_data(__x, std::true_type());
+      std::__alloc_on_move(_M_get_Node_allocator(),
+      __x._M_get_Node_allocator());
+    }
+
+  template<typename _Key, typename _Val, typename _KeyOfValue,
+    typename _Compare, typename _Alloc>
+    void
+    _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+    _M_move_assign(_Rb_tree& __x, false_type)
+    {
+      if (_M_get_Node_allocator() == __x._M_get_Node_allocator())
+ return _M_move_assign(__x, true_type{});
+
+
+
+      _Reuse_or_alloc_node __roan(*this);
+      _M_impl._M_reset();
+      if (__x._M_root() != nullptr)
+ {
+   auto __lbd =
+     [&__roan](const value_type& __cval)
+     {
+       auto& __val = const_cast<value_type&>(__cval);
+       return __roan(std::move_if_noexcept(__val));
+     };
+   _M_root() = _M_copy(__x, __lbd);
+   __x.clear();
+ }
+    }
+
+  template<typename _Key, typename _Val, typename _KeyOfValue,
+    typename _Compare, typename _Alloc>
+    inline _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>&
+    _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+    operator=(_Rb_tree&& __x)
+    noexcept(_Alloc_traits::_S_nothrow_move()
+      && is_nothrow_move_assignable<_Compare>::value)
+    {
+      _M_impl._M_key_compare = std::move(__x._M_impl._M_key_compare);
+      _M_move_assign(__x, __bool_constant<_Alloc_traits::_S_nothrow_move()>());
+      return *this;
+    }
+
+  template<typename _Key, typename _Val, typename _KeyOfValue,
+    typename _Compare, typename _Alloc>
+    template<typename _Iterator>
+      void
+      _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+      _M_assign_unique(_Iterator __first, _Iterator __last)
+      {
+ _Reuse_or_alloc_node __roan(*this);
+ _M_impl._M_reset();
+ for (; __first != __last; ++__first)
+   _M_insert_unique_(end(), *__first, __roan);
+      }
+
+  template<typename _Key, typename _Val, typename _KeyOfValue,
+    typename _Compare, typename _Alloc>
+    template<typename _Iterator>
+      void
+      _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+      _M_assign_equal(_Iterator __first, _Iterator __last)
+      {
+ _Reuse_or_alloc_node __roan(*this);
+ _M_impl._M_reset();
+ for (; __first != __last; ++__first)
+   _M_insert_equal_(end(), *__first, __roan);
+      }
+
+
+  template<typename _Key, typename _Val, typename _KeyOfValue,
+    typename _Compare, typename _Alloc>
+    _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>&
+    _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+    operator=(const _Rb_tree& __x)
+    {
+      if (this != &__x)
+ {
+
+
+   if (_Alloc_traits::_S_propagate_on_copy_assign())
+     {
+       auto& __this_alloc = this->_M_get_Node_allocator();
+       auto& __that_alloc = __x._M_get_Node_allocator();
+       if (!_Alloc_traits::_S_always_equal()
+    && __this_alloc != __that_alloc)
+  {
+
+
+    clear();
+    std::__alloc_on_copy(__this_alloc, __that_alloc);
+  }
+     }
+
+
+   _Reuse_or_alloc_node __roan(*this);
+   _M_impl._M_reset();
+   _M_impl._M_key_compare = __x._M_impl._M_key_compare;
+   if (__x._M_root() != 0)
+     _M_root() = _M_copy(__x, __roan);
+ }
+
+      return *this;
+    }
+
+  template<typename _Key, typename _Val, typename _KeyOfValue,
+    typename _Compare, typename _Alloc>
+
+    template<typename _Arg, typename _NodeGen>
+
+
+
+      typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
+      _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+      _M_insert_(_Base_ptr __x, _Base_ptr __p,
+
+   _Arg&& __v,
+
+
+
+   _NodeGen& __node_gen)
+      {
+ bool __insert_left = (__x != 0 || __p == _M_end()
+         || _M_impl._M_key_compare(_KeyOfValue()(__v),
+       _S_key(__p)));
+
+ _Link_type __z = __node_gen(std::forward<_Arg>(__v));
+
+ _Rb_tree_insert_and_rebalance(__insert_left, __z, __p,
+          this->_M_impl._M_header);
+ ++_M_impl._M_node_count;
+ return iterator(__z);
+      }
+
+  template<typename _Key, typename _Val, typename _KeyOfValue,
+    typename _Compare, typename _Alloc>
+
+    template<typename _Arg>
+
+    typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
+    _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+
+    _M_insert_lower(_Base_ptr __p, _Arg&& __v)
+
+
+
+    {
+      bool __insert_left = (__p == _M_end()
+       || !_M_impl._M_key_compare(_S_key(__p),
+             _KeyOfValue()(__v)));
+
+      _Link_type __z = _M_create_node(std::forward<_Arg>(__v));
+
+      _Rb_tree_insert_and_rebalance(__insert_left, __z, __p,
+        this->_M_impl._M_header);
+      ++_M_impl._M_node_count;
+      return iterator(__z);
+    }
+
+  template<typename _Key, typename _Val, typename _KeyOfValue,
+    typename _Compare, typename _Alloc>
+
+    template<typename _Arg>
+
+    typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
+    _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+
+    _M_insert_equal_lower(_Arg&& __v)
+
+
+
+    {
+      _Link_type __x = _M_begin();
+      _Base_ptr __y = _M_end();
+      while (__x != 0)
+ {
+   __y = __x;
+   __x = !_M_impl._M_key_compare(_S_key(__x), _KeyOfValue()(__v)) ?
+  _S_left(__x) : _S_right(__x);
+ }
+      return _M_insert_lower(__y, std::forward<_Arg>(__v));
+    }
+
+  template<typename _Key, typename _Val, typename _KoV,
+    typename _Compare, typename _Alloc>
+    template<typename _NodeGen>
+      typename _Rb_tree<_Key, _Val, _KoV, _Compare, _Alloc>::_Link_type
+      _Rb_tree<_Key, _Val, _KoV, _Compare, _Alloc>::
+      _M_copy(_Const_Link_type __x, _Base_ptr __p, _NodeGen& __node_gen)
+      {
+
+ _Link_type __top = _M_clone_node(__x, __node_gen);
+ __top->_M_parent = __p;
+
+ if (true)
+   {
+     if (__x->_M_right)
+       __top->_M_right = _M_copy(_S_right(__x), __top, __node_gen);
+     __p = __top;
+     __x = _S_left(__x);
+
+     while (__x != 0)
+       {
+  _Link_type __y = _M_clone_node(__x, __node_gen);
+  __p->_M_left = __y;
+  __y->_M_parent = __p;
+  if (__x->_M_right)
+    __y->_M_right = _M_copy(_S_right(__x), __y, __node_gen);
+  __p = __y;
+  __x = _S_left(__x);
+       }
+   }
+ if (false)
+   {
+     _M_erase(__top);
+     ;
+   }
+ return __top;
+      }
+
+  template<typename _Key, typename _Val, typename _KeyOfValue,
+    typename _Compare, typename _Alloc>
+    void
+    _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+    _M_erase(_Link_type __x)
+    {
+
+      while (__x != 0)
+ {
+   _M_erase(_S_right(__x));
+   _Link_type __y = _S_left(__x);
+   _M_drop_node(__x);
+   __x = __y;
+ }
+    }
+
+  template<typename _Key, typename _Val, typename _KeyOfValue,
+    typename _Compare, typename _Alloc>
+    typename _Rb_tree<_Key, _Val, _KeyOfValue,
+        _Compare, _Alloc>::iterator
+    _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+    _M_lower_bound(_Link_type __x, _Base_ptr __y,
+     const _Key& __k)
+    {
+      while (__x != 0)
+ if (!_M_impl._M_key_compare(_S_key(__x), __k))
+   __y = __x, __x = _S_left(__x);
+ else
+   __x = _S_right(__x);
+      return iterator(__y);
+    }
+
+  template<typename _Key, typename _Val, typename _KeyOfValue,
+    typename _Compare, typename _Alloc>
+    typename _Rb_tree<_Key, _Val, _KeyOfValue,
+        _Compare, _Alloc>::const_iterator
+    _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+    _M_lower_bound(_Const_Link_type __x, _Const_Base_ptr __y,
+     const _Key& __k) const
+    {
+      while (__x != 0)
+ if (!_M_impl._M_key_compare(_S_key(__x), __k))
+   __y = __x, __x = _S_left(__x);
+ else
+   __x = _S_right(__x);
+      return const_iterator(__y);
+    }
+
+  template<typename _Key, typename _Val, typename _KeyOfValue,
+    typename _Compare, typename _Alloc>
+    typename _Rb_tree<_Key, _Val, _KeyOfValue,
+        _Compare, _Alloc>::iterator
+    _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+    _M_upper_bound(_Link_type __x, _Base_ptr __y,
+     const _Key& __k)
+    {
+      while (__x != 0)
+ if (_M_impl._M_key_compare(__k, _S_key(__x)))
+   __y = __x, __x = _S_left(__x);
+ else
+   __x = _S_right(__x);
+      return iterator(__y);
+    }
+
+  template<typename _Key, typename _Val, typename _KeyOfValue,
+    typename _Compare, typename _Alloc>
+    typename _Rb_tree<_Key, _Val, _KeyOfValue,
+        _Compare, _Alloc>::const_iterator
+    _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+    _M_upper_bound(_Const_Link_type __x, _Const_Base_ptr __y,
+     const _Key& __k) const
+    {
+      while (__x != 0)
+ if (_M_impl._M_key_compare(__k, _S_key(__x)))
+   __y = __x, __x = _S_left(__x);
+ else
+   __x = _S_right(__x);
+      return const_iterator(__y);
+    }
+
+  template<typename _Key, typename _Val, typename _KeyOfValue,
+    typename _Compare, typename _Alloc>
+    pair<typename _Rb_tree<_Key, _Val, _KeyOfValue,
+      _Compare, _Alloc>::iterator,
+  typename _Rb_tree<_Key, _Val, _KeyOfValue,
+      _Compare, _Alloc>::iterator>
+    _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+    equal_range(const _Key& __k)
+    {
+      _Link_type __x = _M_begin();
+      _Base_ptr __y = _M_end();
+      while (__x != 0)
+ {
+   if (_M_impl._M_key_compare(_S_key(__x), __k))
+     __x = _S_right(__x);
+   else if (_M_impl._M_key_compare(__k, _S_key(__x)))
+     __y = __x, __x = _S_left(__x);
+   else
+     {
+       _Link_type __xu(__x);
+       _Base_ptr __yu(__y);
+       __y = __x, __x = _S_left(__x);
+       __xu = _S_right(__xu);
+       return pair<iterator,
+     iterator>(_M_lower_bound(__x, __y, __k),
+        _M_upper_bound(__xu, __yu, __k));
+     }
+ }
+      return pair<iterator, iterator>(iterator(__y),
+          iterator(__y));
+    }
+
+  template<typename _Key, typename _Val, typename _KeyOfValue,
+    typename _Compare, typename _Alloc>
+    pair<typename _Rb_tree<_Key, _Val, _KeyOfValue,
+      _Compare, _Alloc>::const_iterator,
+  typename _Rb_tree<_Key, _Val, _KeyOfValue,
+      _Compare, _Alloc>::const_iterator>
+    _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+    equal_range(const _Key& __k) const
+    {
+      _Const_Link_type __x = _M_begin();
+      _Const_Base_ptr __y = _M_end();
+      while (__x != 0)
+ {
+   if (_M_impl._M_key_compare(_S_key(__x), __k))
+     __x = _S_right(__x);
+   else if (_M_impl._M_key_compare(__k, _S_key(__x)))
+     __y = __x, __x = _S_left(__x);
+   else
+     {
+       _Const_Link_type __xu(__x);
+       _Const_Base_ptr __yu(__y);
+       __y = __x, __x = _S_left(__x);
+       __xu = _S_right(__xu);
+       return pair<const_iterator,
+     const_iterator>(_M_lower_bound(__x, __y, __k),
+       _M_upper_bound(__xu, __yu, __k));
+     }
+ }
+      return pair<const_iterator, const_iterator>(const_iterator(__y),
+        const_iterator(__y));
+    }
+
+  template<typename _Key, typename _Val, typename _KeyOfValue,
+    typename _Compare, typename _Alloc>
+    void
+    _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+    swap(_Rb_tree& __t)
+    noexcept(__is_nothrow_swappable<_Compare>::value)
+    {
+      if (_M_root() == 0)
+ {
+   if (__t._M_root() != 0)
+     _M_impl._M_move_data(__t._M_impl);
+ }
+      else if (__t._M_root() == 0)
+ __t._M_impl._M_move_data(_M_impl);
+      else
+ {
+   std::swap(_M_root(),__t._M_root());
+   std::swap(_M_leftmost(),__t._M_leftmost());
+   std::swap(_M_rightmost(),__t._M_rightmost());
+
+   _M_root()->_M_parent = _M_end();
+   __t._M_root()->_M_parent = __t._M_end();
+   std::swap(this->_M_impl._M_node_count, __t._M_impl._M_node_count);
+ }
+
+      std::swap(this->_M_impl._M_key_compare, __t._M_impl._M_key_compare);
+
+      _Alloc_traits::_S_on_swap(_M_get_Node_allocator(),
+    __t._M_get_Node_allocator());
+    }
+
+  template<typename _Key, typename _Val, typename _KeyOfValue,
+    typename _Compare, typename _Alloc>
+    pair<typename _Rb_tree<_Key, _Val, _KeyOfValue,
+      _Compare, _Alloc>::_Base_ptr,
+  typename _Rb_tree<_Key, _Val, _KeyOfValue,
+      _Compare, _Alloc>::_Base_ptr>
+    _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+    _M_get_insert_unique_pos(const key_type& __k)
+    {
+      typedef pair<_Base_ptr, _Base_ptr> _Res;
+      _Link_type __x = _M_begin();
+      _Base_ptr __y = _M_end();
+      bool __comp = true;
+      while (__x != 0)
+ {
+   __y = __x;
+   __comp = _M_impl._M_key_compare(__k, _S_key(__x));
+   __x = __comp ? _S_left(__x) : _S_right(__x);
+ }
+      iterator __j = iterator(__y);
+      if (__comp)
+ {
+   if (__j == begin())
+     return _Res(__x, __y);
+   else
+     --__j;
+ }
+      if (_M_impl._M_key_compare(_S_key(__j._M_node), __k))
+ return _Res(__x, __y);
+      return _Res(__j._M_node, 0);
+    }
+
+  template<typename _Key, typename _Val, typename _KeyOfValue,
+    typename _Compare, typename _Alloc>
+    pair<typename _Rb_tree<_Key, _Val, _KeyOfValue,
+      _Compare, _Alloc>::_Base_ptr,
+  typename _Rb_tree<_Key, _Val, _KeyOfValue,
+      _Compare, _Alloc>::_Base_ptr>
+    _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+    _M_get_insert_equal_pos(const key_type& __k)
+    {
+      typedef pair<_Base_ptr, _Base_ptr> _Res;
+      _Link_type __x = _M_begin();
+      _Base_ptr __y = _M_end();
+      while (__x != 0)
+ {
+   __y = __x;
+   __x = _M_impl._M_key_compare(__k, _S_key(__x)) ?
+  _S_left(__x) : _S_right(__x);
+ }
+      return _Res(__x, __y);
+    }
+
+  template<typename _Key, typename _Val, typename _KeyOfValue,
+    typename _Compare, typename _Alloc>
+
+    template<typename _Arg>
+
+    pair<typename _Rb_tree<_Key, _Val, _KeyOfValue,
+      _Compare, _Alloc>::iterator, bool>
+    _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+
+    _M_insert_unique(_Arg&& __v)
+
+
+
+    {
+      typedef pair<iterator, bool> _Res;
+      pair<_Base_ptr, _Base_ptr> __res
+ = _M_get_insert_unique_pos(_KeyOfValue()(__v));
+
+      if (__res.second)
+ {
+   _Alloc_node __an(*this);
+   return _Res(_M_insert_(__res.first, __res.second,
+     std::forward<_Arg>(__v), __an),
+        true);
+ }
+
+      return _Res(iterator(__res.first), false);
+    }
+
+  template<typename _Key, typename _Val, typename _KeyOfValue,
+    typename _Compare, typename _Alloc>
+
+    template<typename _Arg>
+
+    typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
+    _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+
+    _M_insert_equal(_Arg&& __v)
+
+
+
+    {
+      pair<_Base_ptr, _Base_ptr> __res
+ = _M_get_insert_equal_pos(_KeyOfValue()(__v));
+      _Alloc_node __an(*this);
+      return _M_insert_(__res.first, __res.second,
+   std::forward<_Arg>(__v), __an);
+    }
+
+  template<typename _Key, typename _Val, typename _KeyOfValue,
+    typename _Compare, typename _Alloc>
+    pair<typename _Rb_tree<_Key, _Val, _KeyOfValue,
+      _Compare, _Alloc>::_Base_ptr,
+  typename _Rb_tree<_Key, _Val, _KeyOfValue,
+      _Compare, _Alloc>::_Base_ptr>
+    _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+    _M_get_insert_hint_unique_pos(const_iterator __position,
+      const key_type& __k)
+    {
+      iterator __pos = __position._M_const_cast();
+      typedef pair<_Base_ptr, _Base_ptr> _Res;
+
+
+      if (__pos._M_node == _M_end())
+ {
+   if (size() > 0
+       && _M_impl._M_key_compare(_S_key(_M_rightmost()), __k))
+     return _Res(0, _M_rightmost());
+   else
+     return _M_get_insert_unique_pos(__k);
+ }
+      else if (_M_impl._M_key_compare(__k, _S_key(__pos._M_node)))
+ {
+
+   iterator __before = __pos;
+   if (__pos._M_node == _M_leftmost())
+     return _Res(_M_leftmost(), _M_leftmost());
+   else if (_M_impl._M_key_compare(_S_key((--__before)._M_node), __k))
+     {
+       if (_S_right(__before._M_node) == 0)
+  return _Res(0, __before._M_node);
+       else
+  return _Res(__pos._M_node, __pos._M_node);
+     }
+   else
+     return _M_get_insert_unique_pos(__k);
+ }
+      else if (_M_impl._M_key_compare(_S_key(__pos._M_node), __k))
+ {
+
+   iterator __after = __pos;
+   if (__pos._M_node == _M_rightmost())
+     return _Res(0, _M_rightmost());
+   else if (_M_impl._M_key_compare(__k, _S_key((++__after)._M_node)))
+     {
+       if (_S_right(__pos._M_node) == 0)
+  return _Res(0, __pos._M_node);
+       else
+  return _Res(__after._M_node, __after._M_node);
+     }
+   else
+     return _M_get_insert_unique_pos(__k);
+ }
+      else
+
+ return _Res(__pos._M_node, 0);
+    }
+
+  template<typename _Key, typename _Val, typename _KeyOfValue,
+    typename _Compare, typename _Alloc>
+
+    template<typename _Arg, typename _NodeGen>
+
+
+
+      typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
+      _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+      _M_insert_unique_(const_iterator __position,
+
+   _Arg&& __v,
+
+
+
+   _NodeGen& __node_gen)
+    {
+      pair<_Base_ptr, _Base_ptr> __res
+ = _M_get_insert_hint_unique_pos(__position, _KeyOfValue()(__v));
+
+      if (__res.second)
+ return _M_insert_(__res.first, __res.second,
+     std::forward<_Arg>(__v),
+     __node_gen);
+      return iterator(__res.first);
+    }
+
+  template<typename _Key, typename _Val, typename _KeyOfValue,
+    typename _Compare, typename _Alloc>
+    pair<typename _Rb_tree<_Key, _Val, _KeyOfValue,
+      _Compare, _Alloc>::_Base_ptr,
+  typename _Rb_tree<_Key, _Val, _KeyOfValue,
+      _Compare, _Alloc>::_Base_ptr>
+    _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+    _M_get_insert_hint_equal_pos(const_iterator __position, const key_type& __k)
+    {
+      iterator __pos = __position._M_const_cast();
+      typedef pair<_Base_ptr, _Base_ptr> _Res;
+
+
+      if (__pos._M_node == _M_end())
+ {
+   if (size() > 0
+       && !_M_impl._M_key_compare(__k, _S_key(_M_rightmost())))
+     return _Res(0, _M_rightmost());
+   else
+     return _M_get_insert_equal_pos(__k);
+ }
+      else if (!_M_impl._M_key_compare(_S_key(__pos._M_node), __k))
+ {
+
+   iterator __before = __pos;
+   if (__pos._M_node == _M_leftmost())
+     return _Res(_M_leftmost(), _M_leftmost());
+   else if (!_M_impl._M_key_compare(__k, _S_key((--__before)._M_node)))
+     {
+       if (_S_right(__before._M_node) == 0)
+  return _Res(0, __before._M_node);
+       else
+  return _Res(__pos._M_node, __pos._M_node);
+     }
+   else
+     return _M_get_insert_equal_pos(__k);
+ }
+      else
+ {
+
+   iterator __after = __pos;
+   if (__pos._M_node == _M_rightmost())
+     return _Res(0, _M_rightmost());
+   else if (!_M_impl._M_key_compare(_S_key((++__after)._M_node), __k))
+     {
+       if (_S_right(__pos._M_node) == 0)
+  return _Res(0, __pos._M_node);
+       else
+  return _Res(__after._M_node, __after._M_node);
+     }
+   else
+     return _Res(0, 0);
+ }
+    }
+
+  template<typename _Key, typename _Val, typename _KeyOfValue,
+    typename _Compare, typename _Alloc>
+
+    template<typename _Arg, typename _NodeGen>
+
+
+
+      typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
+      _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+      _M_insert_equal_(const_iterator __position,
+
+         _Arg&& __v,
+
+
+
+         _NodeGen& __node_gen)
+      {
+ pair<_Base_ptr, _Base_ptr> __res
+   = _M_get_insert_hint_equal_pos(__position, _KeyOfValue()(__v));
+
+ if (__res.second)
+   return _M_insert_(__res.first, __res.second,
+       std::forward<_Arg>(__v),
+       __node_gen);
+
+ return _M_insert_equal_lower(std::forward<_Arg>(__v));
+      }
+
+
+  template<typename _Key, typename _Val, typename _KeyOfValue,
+    typename _Compare, typename _Alloc>
+    typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
+    _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+    _M_insert_node(_Base_ptr __x, _Base_ptr __p, _Link_type __z)
+    {
+      bool __insert_left = (__x != 0 || __p == _M_end()
+       || _M_impl._M_key_compare(_S_key(__z),
+            _S_key(__p)));
+
+      _Rb_tree_insert_and_rebalance(__insert_left, __z, __p,
+        this->_M_impl._M_header);
+      ++_M_impl._M_node_count;
+      return iterator(__z);
+    }
+
+  template<typename _Key, typename _Val, typename _KeyOfValue,
+    typename _Compare, typename _Alloc>
+    typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
+    _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+    _M_insert_lower_node(_Base_ptr __p, _Link_type __z)
+    {
+      bool __insert_left = (__p == _M_end()
+       || !_M_impl._M_key_compare(_S_key(__p),
+             _S_key(__z)));
+
+      _Rb_tree_insert_and_rebalance(__insert_left, __z, __p,
+        this->_M_impl._M_header);
+      ++_M_impl._M_node_count;
+      return iterator(__z);
+    }
+
+  template<typename _Key, typename _Val, typename _KeyOfValue,
+    typename _Compare, typename _Alloc>
+    typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
+    _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+    _M_insert_equal_lower_node(_Link_type __z)
+    {
+      _Link_type __x = _M_begin();
+      _Base_ptr __y = _M_end();
+      while (__x != 0)
+ {
+   __y = __x;
+   __x = !_M_impl._M_key_compare(_S_key(__x), _S_key(__z)) ?
+  _S_left(__x) : _S_right(__x);
+ }
+      return _M_insert_lower_node(__y, __z);
+    }
+
+  template<typename _Key, typename _Val, typename _KeyOfValue,
+    typename _Compare, typename _Alloc>
+    template<typename... _Args>
+      pair<typename _Rb_tree<_Key, _Val, _KeyOfValue,
+        _Compare, _Alloc>::iterator, bool>
+      _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+      _M_emplace_unique(_Args&&... __args)
+      {
+ _Link_type __z = _M_create_node(std::forward<_Args>(__args)...);
+
+ if (true)
+   {
+     typedef pair<iterator, bool> _Res;
+     auto __res = _M_get_insert_unique_pos(_S_key(__z));
+     if (__res.second)
+       return _Res(_M_insert_node(__res.first, __res.second, __z), true);
+
+     _M_drop_node(__z);
+     return _Res(iterator(__res.first), false);
+   }
+ if (false)
+   {
+     _M_drop_node(__z);
+     ;
+   }
+      }
+
+  template<typename _Key, typename _Val, typename _KeyOfValue,
+    typename _Compare, typename _Alloc>
+    template<typename... _Args>
+      typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
+      _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+      _M_emplace_equal(_Args&&... __args)
+      {
+ _Link_type __z = _M_create_node(std::forward<_Args>(__args)...);
+
+ if (true)
+   {
+     auto __res = _M_get_insert_equal_pos(_S_key(__z));
+     return _M_insert_node(__res.first, __res.second, __z);
+   }
+ if (false)
+   {
+     _M_drop_node(__z);
+     ;
+   }
+      }
+
+  template<typename _Key, typename _Val, typename _KeyOfValue,
+    typename _Compare, typename _Alloc>
+    template<typename... _Args>
+      typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
+      _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+      _M_emplace_hint_unique(const_iterator __pos, _Args&&... __args)
+      {
+ _Link_type __z = _M_create_node(std::forward<_Args>(__args)...);
+
+ if (true)
+   {
+     auto __res = _M_get_insert_hint_unique_pos(__pos, _S_key(__z));
+
+     if (__res.second)
+       return _M_insert_node(__res.first, __res.second, __z);
+
+     _M_drop_node(__z);
+     return iterator(__res.first);
+   }
+ if (false)
+   {
+     _M_drop_node(__z);
+     ;
+   }
+      }
+
+  template<typename _Key, typename _Val, typename _KeyOfValue,
+    typename _Compare, typename _Alloc>
+    template<typename... _Args>
+      typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
+      _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+      _M_emplace_hint_equal(const_iterator __pos, _Args&&... __args)
+      {
+ _Link_type __z = _M_create_node(std::forward<_Args>(__args)...);
+
+ if (true)
+   {
+     auto __res = _M_get_insert_hint_equal_pos(__pos, _S_key(__z));
+
+     if (__res.second)
+       return _M_insert_node(__res.first, __res.second, __z);
+
+     return _M_insert_equal_lower_node(__z);
+   }
+ if (false)
+   {
+     _M_drop_node(__z);
+     ;
+   }
+      }
+
+
+  template<typename _Key, typename _Val, typename _KoV,
+    typename _Cmp, typename _Alloc>
+    template<class _II>
+      void
+      _Rb_tree<_Key, _Val, _KoV, _Cmp, _Alloc>::
+      _M_insert_unique(_II __first, _II __last)
+      {
+ _Alloc_node __an(*this);
+ for (; __first != __last; ++__first)
+   _M_insert_unique_(end(), *__first, __an);
+      }
+
+  template<typename _Key, typename _Val, typename _KoV,
+    typename _Cmp, typename _Alloc>
+    template<class _II>
+      void
+      _Rb_tree<_Key, _Val, _KoV, _Cmp, _Alloc>::
+      _M_insert_equal(_II __first, _II __last)
+      {
+ _Alloc_node __an(*this);
+ for (; __first != __last; ++__first)
+   _M_insert_equal_(end(), *__first, __an);
+      }
+
+  template<typename _Key, typename _Val, typename _KeyOfValue,
+    typename _Compare, typename _Alloc>
+    void
+    _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+    _M_erase_aux(const_iterator __position)
+    {
+      _Link_type __y =
+ static_cast<_Link_type>(_Rb_tree_rebalance_for_erase
+    (const_cast<_Base_ptr>(__position._M_node),
+     this->_M_impl._M_header));
+      _M_drop_node(__y);
+      --_M_impl._M_node_count;
+    }
+
+  template<typename _Key, typename _Val, typename _KeyOfValue,
+    typename _Compare, typename _Alloc>
+    void
+    _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+    _M_erase_aux(const_iterator __first, const_iterator __last)
+    {
+      if (__first == begin() && __last == end())
+ clear();
+      else
+ while (__first != __last)
+   _M_erase_aux(__first++);
+    }
+
+  template<typename _Key, typename _Val, typename _KeyOfValue,
+    typename _Compare, typename _Alloc>
+    typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::size_type
+    _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+    erase(const _Key& __x)
+    {
+      pair<iterator, iterator> __p = equal_range(__x);
+      const size_type __old_size = size();
+      _M_erase_aux(__p.first, __p.second);
+      return __old_size - size();
+    }
+
+  template<typename _Key, typename _Val, typename _KeyOfValue,
+    typename _Compare, typename _Alloc>
+    void
+    _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+    erase(const _Key* __first, const _Key* __last)
+    {
+      while (__first != __last)
+ erase(*__first++);
+    }
+
+  template<typename _Key, typename _Val, typename _KeyOfValue,
+    typename _Compare, typename _Alloc>
+    typename _Rb_tree<_Key, _Val, _KeyOfValue,
+        _Compare, _Alloc>::iterator
+    _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+    find(const _Key& __k)
+    {
+      iterator __j = _M_lower_bound(_M_begin(), _M_end(), __k);
+      return (__j == end()
+       || _M_impl._M_key_compare(__k,
+     _S_key(__j._M_node))) ? end() : __j;
+    }
+
+  template<typename _Key, typename _Val, typename _KeyOfValue,
+    typename _Compare, typename _Alloc>
+    typename _Rb_tree<_Key, _Val, _KeyOfValue,
+        _Compare, _Alloc>::const_iterator
+    _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+    find(const _Key& __k) const
+    {
+      const_iterator __j = _M_lower_bound(_M_begin(), _M_end(), __k);
+      return (__j == end()
+       || _M_impl._M_key_compare(__k,
+     _S_key(__j._M_node))) ? end() : __j;
+    }
+
+  template<typename _Key, typename _Val, typename _KeyOfValue,
+    typename _Compare, typename _Alloc>
+    typename _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::size_type
+    _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+    count(const _Key& __k) const
+    {
+      pair<const_iterator, const_iterator> __p = equal_range(__k);
+      const size_type __n = std::distance(__p.first, __p.second);
+      return __n;
+    }
+
+  __attribute__ ((__pure__)) unsigned int
+  _Rb_tree_black_count(const _Rb_tree_node_base* __node,
+         const _Rb_tree_node_base* __root) throw ();
+
+  template<typename _Key, typename _Val, typename _KeyOfValue,
+    typename _Compare, typename _Alloc>
+    bool
+    _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>::__rb_verify() const
+    {
+      if (_M_impl._M_node_count == 0 || begin() == end())
+ return _M_impl._M_node_count == 0 && begin() == end()
+        && this->_M_impl._M_header._M_left == _M_end()
+        && this->_M_impl._M_header._M_right == _M_end();
+
+      unsigned int __len = _Rb_tree_black_count(_M_leftmost(), _M_root());
+      for (const_iterator __it = begin(); __it != end(); ++__it)
+ {
+   _Const_Link_type __x = static_cast<_Const_Link_type>(__it._M_node);
+   _Const_Link_type __L = _S_left(__x);
+   _Const_Link_type __R = _S_right(__x);
+
+   if (__x->_M_color == _S_red)
+     if ((__L && __L->_M_color == _S_red)
+  || (__R && __R->_M_color == _S_red))
+       return false;
+
+   if (__L && _M_impl._M_key_compare(_S_key(__x), _S_key(__L)))
+     return false;
+   if (__R && _M_impl._M_key_compare(_S_key(__R), _S_key(__x)))
+     return false;
+
+   if (!__L && !__R && _Rb_tree_black_count(__x, _M_root()) != __len)
+     return false;
+ }
+
+      if (_M_leftmost() != _Rb_tree_node_base::_S_minimum(_M_root()))
+ return false;
+      if (_M_rightmost() != _Rb_tree_node_base::_S_maximum(_M_root()))
+ return false;
+      return true;
+    }
+
+}
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+  template <typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+    class multimap;
+  template <typename _Key, typename _Tp, typename _Compare = std::less<_Key>,
+     typename _Alloc = std::allocator<std::pair<const _Key, _Tp> > >
+    class map
+    {
+    public:
+      typedef _Key key_type;
+      typedef _Tp mapped_type;
+      typedef std::pair<const _Key, _Tp> value_type;
+      typedef _Compare key_compare;
+      typedef _Alloc allocator_type;
+
+    private:
+      static_assert(is_same<typename _Alloc::value_type, value_type>::value,
+   "std::map must have the same value_type as its allocator");
+
+
+    public:
+      class value_compare
+      : public std::binary_function<value_type, value_type, bool>
+      {
+ friend class map<_Key, _Tp, _Compare, _Alloc>;
+      protected:
+ _Compare comp;
+
+ value_compare(_Compare __c)
+ : comp(__c) { }
+
+      public:
+ bool operator()(const value_type& __x, const value_type& __y) const
+ { return comp(__x.first, __y.first); }
+      };
+
+    private:
+
+      typedef typename __gnu_cxx::__alloc_traits<_Alloc>::template
+ rebind<value_type>::other _Pair_alloc_type;
+
+      typedef _Rb_tree<key_type, value_type, _Select1st<value_type>,
+         key_compare, _Pair_alloc_type> _Rep_type;
+
+
+      _Rep_type _M_t;
+
+      typedef __gnu_cxx::__alloc_traits<_Pair_alloc_type> _Alloc_traits;
+
+    public:
+
+
+      typedef typename _Alloc_traits::pointer pointer;
+      typedef typename _Alloc_traits::const_pointer const_pointer;
+      typedef typename _Alloc_traits::reference reference;
+      typedef typename _Alloc_traits::const_reference const_reference;
+      typedef typename _Rep_type::iterator iterator;
+      typedef typename _Rep_type::const_iterator const_iterator;
+      typedef typename _Rep_type::size_type size_type;
+      typedef typename _Rep_type::difference_type difference_type;
+      typedef typename _Rep_type::reverse_iterator reverse_iterator;
+      typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator;
+      map() = default;
+
+
+
+
+
+
+
+      explicit
+      map(const _Compare& __comp,
+   const allocator_type& __a = allocator_type())
+      : _M_t(__comp, _Pair_alloc_type(__a)) { }
+      map(const map&) = default;
+
+
+
+
+
+
+
+      map(map&&) = default;
+      map(initializer_list<value_type> __l,
+   const _Compare& __comp = _Compare(),
+   const allocator_type& __a = allocator_type())
+      : _M_t(__comp, _Pair_alloc_type(__a))
+      { _M_t._M_insert_unique(__l.begin(), __l.end()); }
+
+
+      explicit
+      map(const allocator_type& __a)
+      : _M_t(_Compare(), _Pair_alloc_type(__a)) { }
+
+
+      map(const map& __m, const allocator_type& __a)
+      : _M_t(__m._M_t, _Pair_alloc_type(__a)) { }
+
+
+      map(map&& __m, const allocator_type& __a)
+      noexcept(is_nothrow_copy_constructible<_Compare>::value
+        && _Alloc_traits::_S_always_equal())
+      : _M_t(std::move(__m._M_t), _Pair_alloc_type(__a)) { }
+
+
+      map(initializer_list<value_type> __l, const allocator_type& __a)
+      : _M_t(_Compare(), _Pair_alloc_type(__a))
+      { _M_t._M_insert_unique(__l.begin(), __l.end()); }
+
+
+      template<typename _InputIterator>
+ map(_InputIterator __first, _InputIterator __last,
+     const allocator_type& __a)
+ : _M_t(_Compare(), _Pair_alloc_type(__a))
+ { _M_t._M_insert_unique(__first, __last); }
+      template<typename _InputIterator>
+ map(_InputIterator __first, _InputIterator __last)
+ : _M_t()
+ { _M_t._M_insert_unique(__first, __last); }
+      template<typename _InputIterator>
+ map(_InputIterator __first, _InputIterator __last,
+     const _Compare& __comp,
+     const allocator_type& __a = allocator_type())
+ : _M_t(__comp, _Pair_alloc_type(__a))
+ { _M_t._M_insert_unique(__first, __last); }
+
+
+
+
+
+
+
+      ~map() = default;
+      map&
+      operator=(const map&) = default;
+
+
+      map&
+      operator=(map&&) = default;
+      map&
+      operator=(initializer_list<value_type> __l)
+      {
+ _M_t._M_assign_unique(__l.begin(), __l.end());
+ return *this;
+      }
+
+
+
+      allocator_type
+      get_allocator() const noexcept
+      { return allocator_type(_M_t.get_allocator()); }
+
+
+
+
+
+
+
+      iterator
+      begin() noexcept
+      { return _M_t.begin(); }
+
+
+
+
+
+
+      const_iterator
+      begin() const noexcept
+      { return _M_t.begin(); }
+
+
+
+
+
+
+      iterator
+      end() noexcept
+      { return _M_t.end(); }
+
+
+
+
+
+
+      const_iterator
+      end() const noexcept
+      { return _M_t.end(); }
+
+
+
+
+
+
+      reverse_iterator
+      rbegin() noexcept
+      { return _M_t.rbegin(); }
+
+
+
+
+
+
+      const_reverse_iterator
+      rbegin() const noexcept
+      { return _M_t.rbegin(); }
+
+
+
+
+
+
+      reverse_iterator
+      rend() noexcept
+      { return _M_t.rend(); }
+
+
+
+
+
+
+      const_reverse_iterator
+      rend() const noexcept
+      { return _M_t.rend(); }
+
+
+
+
+
+
+
+      const_iterator
+      cbegin() const noexcept
+      { return _M_t.begin(); }
+
+
+
+
+
+
+      const_iterator
+      cend() const noexcept
+      { return _M_t.end(); }
+
+
+
+
+
+
+      const_reverse_iterator
+      crbegin() const noexcept
+      { return _M_t.rbegin(); }
+
+
+
+
+
+
+      const_reverse_iterator
+      crend() const noexcept
+      { return _M_t.rend(); }
+
+
+
+
+
+
+      bool
+      empty() const noexcept
+      { return _M_t.empty(); }
+
+
+      size_type
+      size() const noexcept
+      { return _M_t.size(); }
+
+
+      size_type
+      max_size() const noexcept
+      { return _M_t.max_size(); }
+      mapped_type&
+      operator[](const key_type& __k)
+      {
+
+
+
+ iterator __i = lower_bound(__k);
+
+ if (__i == end() || key_comp()(__k, (*__i).first))
+
+   __i = _M_t._M_emplace_hint_unique(__i, std::piecewise_construct,
+         std::tuple<const key_type&>(__k),
+         std::tuple<>());
+
+
+
+ return (*__i).second;
+      }
+
+
+      mapped_type&
+      operator[](key_type&& __k)
+      {
+
+
+
+ iterator __i = lower_bound(__k);
+
+ if (__i == end() || key_comp()(__k, (*__i).first))
+   __i = _M_t._M_emplace_hint_unique(__i, std::piecewise_construct,
+     std::forward_as_tuple(std::move(__k)),
+     std::tuple<>());
+ return (*__i).second;
+      }
+      mapped_type&
+      at(const key_type& __k)
+      {
+ iterator __i = lower_bound(__k);
+ if (__i == end() || key_comp()(__k, (*__i).first))
+   __throw_out_of_range(("map::at"));
+ return (*__i).second;
+      }
+
+      const mapped_type&
+      at(const key_type& __k) const
+      {
+ const_iterator __i = lower_bound(__k);
+ if (__i == end() || key_comp()(__k, (*__i).first))
+   __throw_out_of_range(("map::at"));
+ return (*__i).second;
+      }
+      template<typename... _Args>
+ std::pair<iterator, bool>
+ emplace(_Args&&... __args)
+ { return _M_t._M_emplace_unique(std::forward<_Args>(__args)...); }
+      template<typename... _Args>
+ iterator
+ emplace_hint(const_iterator __pos, _Args&&... __args)
+ {
+   return _M_t._M_emplace_hint_unique(__pos,
+          std::forward<_Args>(__args)...);
+ }
+      std::pair<iterator, bool>
+      insert(const value_type& __x)
+      { return _M_t._M_insert_unique(__x); }
+
+
+
+
+      std::pair<iterator, bool>
+      insert(value_type&& __x)
+      { return _M_t._M_insert_unique(std::move(__x)); }
+
+      template<typename _Pair, typename = typename
+        std::enable_if<std::is_constructible<value_type,
+          _Pair&&>::value>::type>
+ std::pair<iterator, bool>
+ insert(_Pair&& __x)
+ { return _M_t._M_insert_unique(std::forward<_Pair>(__x)); }
+      void
+      insert(std::initializer_list<value_type> __list)
+      { insert(__list.begin(), __list.end()); }
+      iterator
+
+      insert(const_iterator __position, const value_type& __x)
+
+
+
+      { return _M_t._M_insert_unique_(__position, __x); }
+
+
+
+
+      iterator
+      insert(const_iterator __position, value_type&& __x)
+      { return _M_t._M_insert_unique_(__position, std::move(__x)); }
+
+      template<typename _Pair, typename = typename
+        std::enable_if<std::is_constructible<value_type,
+          _Pair&&>::value>::type>
+ iterator
+ insert(const_iterator __position, _Pair&& __x)
+ { return _M_t._M_insert_unique_(__position,
+     std::forward<_Pair>(__x)); }
+      template<typename _InputIterator>
+ void
+ insert(_InputIterator __first, _InputIterator __last)
+ { _M_t._M_insert_unique(__first, __last); }
+      iterator
+      erase(const_iterator __position)
+      { return _M_t.erase(__position); }
+
+
+      __attribute ((__abi_tag__ ("cxx11")))
+      iterator
+      erase(iterator __position)
+      { return _M_t.erase(__position); }
+      size_type
+      erase(const key_type& __x)
+      { return _M_t.erase(__x); }
+      iterator
+      erase(const_iterator __first, const_iterator __last)
+      { return _M_t.erase(__first, __last); }
+      void
+      swap(map& __x)
+      noexcept(__is_nothrow_swappable<_Compare>::value)
+      { _M_t.swap(__x._M_t); }
+
+
+
+
+
+
+
+      void
+      clear() noexcept
+      { _M_t.clear(); }
+
+
+
+
+
+
+      key_compare
+      key_comp() const
+      { return _M_t.key_comp(); }
+
+
+
+
+
+      value_compare
+      value_comp() const
+      { return value_compare(_M_t.key_comp()); }
+      iterator
+      find(const key_type& __x)
+      { return _M_t.find(__x); }
+      const_iterator
+      find(const key_type& __x) const
+      { return _M_t.find(__x); }
+      size_type
+      count(const key_type& __x) const
+      { return _M_t.find(__x) == _M_t.end() ? 0 : 1; }
+      iterator
+      lower_bound(const key_type& __x)
+      { return _M_t.lower_bound(__x); }
+      const_iterator
+      lower_bound(const key_type& __x) const
+      { return _M_t.lower_bound(__x); }
+      iterator
+      upper_bound(const key_type& __x)
+      { return _M_t.upper_bound(__x); }
+      const_iterator
+      upper_bound(const key_type& __x) const
+      { return _M_t.upper_bound(__x); }
+      std::pair<iterator, iterator>
+      equal_range(const key_type& __x)
+      { return _M_t.equal_range(__x); }
+      std::pair<const_iterator, const_iterator>
+      equal_range(const key_type& __x) const
+      { return _M_t.equal_range(__x); }
+      template<typename _K1, typename _T1, typename _C1, typename _A1>
+ friend bool
+ operator==(const map<_K1, _T1, _C1, _A1>&,
+     const map<_K1, _T1, _C1, _A1>&);
+
+      template<typename _K1, typename _T1, typename _C1, typename _A1>
+ friend bool
+ operator<(const map<_K1, _T1, _C1, _A1>&,
+    const map<_K1, _T1, _C1, _A1>&);
+    };
+  template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+    inline bool
+    operator==(const map<_Key, _Tp, _Compare, _Alloc>& __x,
+        const map<_Key, _Tp, _Compare, _Alloc>& __y)
+    { return __x._M_t == __y._M_t; }
+  template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+    inline bool
+    operator<(const map<_Key, _Tp, _Compare, _Alloc>& __x,
+       const map<_Key, _Tp, _Compare, _Alloc>& __y)
+    { return __x._M_t < __y._M_t; }
+
+
+  template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+    inline bool
+    operator!=(const map<_Key, _Tp, _Compare, _Alloc>& __x,
+        const map<_Key, _Tp, _Compare, _Alloc>& __y)
+    { return !(__x == __y); }
+
+
+  template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+    inline bool
+    operator>(const map<_Key, _Tp, _Compare, _Alloc>& __x,
+       const map<_Key, _Tp, _Compare, _Alloc>& __y)
+    { return __y < __x; }
+
+
+  template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+    inline bool
+    operator<=(const map<_Key, _Tp, _Compare, _Alloc>& __x,
+        const map<_Key, _Tp, _Compare, _Alloc>& __y)
+    { return !(__y < __x); }
+
+
+  template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+    inline bool
+    operator>=(const map<_Key, _Tp, _Compare, _Alloc>& __x,
+        const map<_Key, _Tp, _Compare, _Alloc>& __y)
+    { return !(__x < __y); }
+
+
+  template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+    inline void
+    swap(map<_Key, _Tp, _Compare, _Alloc>& __x,
+  map<_Key, _Tp, _Compare, _Alloc>& __y)
+    noexcept(noexcept(__x.swap(__y)))
+    { __x.swap(__y); }
+
+
+
+}
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+  template <typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+    class map;
+  template <typename _Key, typename _Tp,
+     typename _Compare = std::less<_Key>,
+     typename _Alloc = std::allocator<std::pair<const _Key, _Tp> > >
+    class multimap
+    {
+    public:
+      typedef _Key key_type;
+      typedef _Tp mapped_type;
+      typedef std::pair<const _Key, _Tp> value_type;
+      typedef _Compare key_compare;
+      typedef _Alloc allocator_type;
+
+    private:
+      static_assert(is_same<typename _Alloc::value_type, value_type>::value,
+   "std::multimap must have the same value_type as its allocator");
+
+
+    public:
+      class value_compare
+      : public std::binary_function<value_type, value_type, bool>
+      {
+ friend class multimap<_Key, _Tp, _Compare, _Alloc>;
+      protected:
+ _Compare comp;
+
+ value_compare(_Compare __c)
+ : comp(__c) { }
+
+      public:
+ bool operator()(const value_type& __x, const value_type& __y) const
+ { return comp(__x.first, __y.first); }
+      };
+
+    private:
+
+      typedef typename __gnu_cxx::__alloc_traits<_Alloc>::template
+ rebind<value_type>::other _Pair_alloc_type;
+
+      typedef _Rb_tree<key_type, value_type, _Select1st<value_type>,
+         key_compare, _Pair_alloc_type> _Rep_type;
+
+      _Rep_type _M_t;
+
+      typedef __gnu_cxx::__alloc_traits<_Pair_alloc_type> _Alloc_traits;
+
+    public:
+
+
+      typedef typename _Alloc_traits::pointer pointer;
+      typedef typename _Alloc_traits::const_pointer const_pointer;
+      typedef typename _Alloc_traits::reference reference;
+      typedef typename _Alloc_traits::const_reference const_reference;
+      typedef typename _Rep_type::iterator iterator;
+      typedef typename _Rep_type::const_iterator const_iterator;
+      typedef typename _Rep_type::size_type size_type;
+      typedef typename _Rep_type::difference_type difference_type;
+      typedef typename _Rep_type::reverse_iterator reverse_iterator;
+      typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator;
+      multimap() = default;
+
+
+
+
+
+
+
+      explicit
+      multimap(const _Compare& __comp,
+        const allocator_type& __a = allocator_type())
+      : _M_t(__comp, _Pair_alloc_type(__a)) { }
+      multimap(const multimap&) = default;
+      multimap(multimap&&) = default;
+      multimap(initializer_list<value_type> __l,
+        const _Compare& __comp = _Compare(),
+        const allocator_type& __a = allocator_type())
+      : _M_t(__comp, _Pair_alloc_type(__a))
+      { _M_t._M_insert_equal(__l.begin(), __l.end()); }
+
+
+      explicit
+      multimap(const allocator_type& __a)
+      : _M_t(_Compare(), _Pair_alloc_type(__a)) { }
+
+
+      multimap(const multimap& __m, const allocator_type& __a)
+      : _M_t(__m._M_t, _Pair_alloc_type(__a)) { }
+
+
+      multimap(multimap&& __m, const allocator_type& __a)
+      noexcept(is_nothrow_copy_constructible<_Compare>::value
+        && _Alloc_traits::_S_always_equal())
+      : _M_t(std::move(__m._M_t), _Pair_alloc_type(__a)) { }
+
+
+      multimap(initializer_list<value_type> __l, const allocator_type& __a)
+      : _M_t(_Compare(), _Pair_alloc_type(__a))
+      { _M_t._M_insert_equal(__l.begin(), __l.end()); }
+
+
+      template<typename _InputIterator>
+ multimap(_InputIterator __first, _InputIterator __last,
+   const allocator_type& __a)
+ : _M_t(_Compare(), _Pair_alloc_type(__a))
+ { _M_t._M_insert_equal(__first, __last); }
+      template<typename _InputIterator>
+ multimap(_InputIterator __first, _InputIterator __last)
+ : _M_t()
+ { _M_t._M_insert_equal(__first, __last); }
+      template<typename _InputIterator>
+ multimap(_InputIterator __first, _InputIterator __last,
+   const _Compare& __comp,
+   const allocator_type& __a = allocator_type())
+ : _M_t(__comp, _Pair_alloc_type(__a))
+ { _M_t._M_insert_equal(__first, __last); }
+
+
+
+
+
+
+
+      ~multimap() = default;
+      multimap&
+      operator=(const multimap&) = default;
+
+
+      multimap&
+      operator=(multimap&&) = default;
+      multimap&
+      operator=(initializer_list<value_type> __l)
+      {
+ _M_t._M_assign_equal(__l.begin(), __l.end());
+ return *this;
+      }
+
+
+
+      allocator_type
+      get_allocator() const noexcept
+      { return allocator_type(_M_t.get_allocator()); }
+
+
+
+
+
+
+
+      iterator
+      begin() noexcept
+      { return _M_t.begin(); }
+
+
+
+
+
+
+      const_iterator
+      begin() const noexcept
+      { return _M_t.begin(); }
+
+
+
+
+
+
+      iterator
+      end() noexcept
+      { return _M_t.end(); }
+
+
+
+
+
+
+      const_iterator
+      end() const noexcept
+      { return _M_t.end(); }
+
+
+
+
+
+
+      reverse_iterator
+      rbegin() noexcept
+      { return _M_t.rbegin(); }
+
+
+
+
+
+
+      const_reverse_iterator
+      rbegin() const noexcept
+      { return _M_t.rbegin(); }
+
+
+
+
+
+
+      reverse_iterator
+      rend() noexcept
+      { return _M_t.rend(); }
+
+
+
+
+
+
+      const_reverse_iterator
+      rend() const noexcept
+      { return _M_t.rend(); }
+
+
+
+
+
+
+
+      const_iterator
+      cbegin() const noexcept
+      { return _M_t.begin(); }
+
+
+
+
+
+
+      const_iterator
+      cend() const noexcept
+      { return _M_t.end(); }
+
+
+
+
+
+
+      const_reverse_iterator
+      crbegin() const noexcept
+      { return _M_t.rbegin(); }
+
+
+
+
+
+
+      const_reverse_iterator
+      crend() const noexcept
+      { return _M_t.rend(); }
+
+
+
+
+      bool
+      empty() const noexcept
+      { return _M_t.empty(); }
+
+
+      size_type
+      size() const noexcept
+      { return _M_t.size(); }
+
+
+      size_type
+      max_size() const noexcept
+      { return _M_t.max_size(); }
+      template<typename... _Args>
+ iterator
+ emplace(_Args&&... __args)
+ { return _M_t._M_emplace_equal(std::forward<_Args>(__args)...); }
+      template<typename... _Args>
+ iterator
+ emplace_hint(const_iterator __pos, _Args&&... __args)
+ {
+   return _M_t._M_emplace_hint_equal(__pos,
+         std::forward<_Args>(__args)...);
+ }
+      iterator
+      insert(const value_type& __x)
+      { return _M_t._M_insert_equal(__x); }
+
+
+
+
+      iterator
+      insert(value_type&& __x)
+      { return _M_t._M_insert_equal(std::move(__x)); }
+
+      template<typename _Pair, typename = typename
+        std::enable_if<std::is_constructible<value_type,
+          _Pair&&>::value>::type>
+ iterator
+ insert(_Pair&& __x)
+ { return _M_t._M_insert_equal(std::forward<_Pair>(__x)); }
+      iterator
+
+      insert(const_iterator __position, const value_type& __x)
+
+
+
+      { return _M_t._M_insert_equal_(__position, __x); }
+
+
+
+
+      iterator
+      insert(const_iterator __position, value_type&& __x)
+      { return _M_t._M_insert_equal_(__position, std::move(__x)); }
+
+      template<typename _Pair, typename = typename
+        std::enable_if<std::is_constructible<value_type,
+          _Pair&&>::value>::type>
+ iterator
+ insert(const_iterator __position, _Pair&& __x)
+ { return _M_t._M_insert_equal_(__position,
+           std::forward<_Pair>(__x)); }
+      template<typename _InputIterator>
+ void
+ insert(_InputIterator __first, _InputIterator __last)
+ { _M_t._M_insert_equal(__first, __last); }
+      void
+      insert(initializer_list<value_type> __l)
+      { this->insert(__l.begin(), __l.end()); }
+      iterator
+      erase(const_iterator __position)
+      { return _M_t.erase(__position); }
+
+
+      __attribute ((__abi_tag__ ("cxx11")))
+      iterator
+      erase(iterator __position)
+      { return _M_t.erase(__position); }
+      size_type
+      erase(const key_type& __x)
+      { return _M_t.erase(__x); }
+      iterator
+      erase(const_iterator __first, const_iterator __last)
+      { return _M_t.erase(__first, __last); }
+      void
+      swap(multimap& __x)
+      noexcept(__is_nothrow_swappable<_Compare>::value)
+      { _M_t.swap(__x._M_t); }
+
+
+
+
+
+
+
+      void
+      clear() noexcept
+      { _M_t.clear(); }
+
+
+
+
+
+
+      key_compare
+      key_comp() const
+      { return _M_t.key_comp(); }
+
+
+
+
+
+      value_compare
+      value_comp() const
+      { return value_compare(_M_t.key_comp()); }
+      iterator
+      find(const key_type& __x)
+      { return _M_t.find(__x); }
+      const_iterator
+      find(const key_type& __x) const
+      { return _M_t.find(__x); }
+      size_type
+      count(const key_type& __x) const
+      { return _M_t.count(__x); }
+      iterator
+      lower_bound(const key_type& __x)
+      { return _M_t.lower_bound(__x); }
+      const_iterator
+      lower_bound(const key_type& __x) const
+      { return _M_t.lower_bound(__x); }
+      iterator
+      upper_bound(const key_type& __x)
+      { return _M_t.upper_bound(__x); }
+      const_iterator
+      upper_bound(const key_type& __x) const
+      { return _M_t.upper_bound(__x); }
+      std::pair<iterator, iterator>
+      equal_range(const key_type& __x)
+      { return _M_t.equal_range(__x); }
+      std::pair<const_iterator, const_iterator>
+      equal_range(const key_type& __x) const
+      { return _M_t.equal_range(__x); }
+      template<typename _K1, typename _T1, typename _C1, typename _A1>
+ friend bool
+ operator==(const multimap<_K1, _T1, _C1, _A1>&,
+     const multimap<_K1, _T1, _C1, _A1>&);
+
+      template<typename _K1, typename _T1, typename _C1, typename _A1>
+ friend bool
+ operator<(const multimap<_K1, _T1, _C1, _A1>&,
+    const multimap<_K1, _T1, _C1, _A1>&);
+  };
+  template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+    inline bool
+    operator==(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
+        const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
+    { return __x._M_t == __y._M_t; }
+  template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+    inline bool
+    operator<(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
+       const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
+    { return __x._M_t < __y._M_t; }
+
+
+  template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+    inline bool
+    operator!=(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
+        const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
+    { return !(__x == __y); }
+
+
+  template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+    inline bool
+    operator>(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
+       const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
+    { return __y < __x; }
+
+
+  template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+    inline bool
+    operator<=(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
+        const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
+    { return !(__y < __x); }
+
+
+  template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+    inline bool
+    operator>=(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
+        const multimap<_Key, _Tp, _Compare, _Alloc>& __y)
+    { return !(__x < __y); }
+
+
+  template<typename _Key, typename _Tp, typename _Compare, typename _Alloc>
+    inline void
+    swap(multimap<_Key, _Tp, _Compare, _Alloc>& __x,
+  multimap<_Key, _Tp, _Compare, _Alloc>& __y)
+    noexcept(noexcept(__x.swap(__y)))
+    { __x.swap(__y); }
+
+
+
+}
+
+
+
+
+namespace llvm {
+
+class AttrBuilder;
+class AttributeImpl;
+class AttributeListImpl;
+class AttributeList;
+class AttributeSetNode;
+template<typename T> struct DenseMapInfo;
+class Function;
+class LLVMContext;
+class Type;
+
+
+
+
+
+
+
+class Attribute {
+public:
+  enum AttrKind {
+
+    None,
+
+
+
+Alignment,
+AllocSize,
+AlwaysInline,
+ArgMemOnly,
+Builtin,
+ByVal,
+Cold,
+Convergent,
+Dereferenceable,
+DereferenceableOrNull,
+InAlloca,
+InReg,
+InaccessibleMemOnly,
+InaccessibleMemOrArgMemOnly,
+InlineHint,
+JumpTable,
+MinSize,
+Naked,
+Nest,
+NoAlias,
+NoBuiltin,
+NoCapture,
+NoDuplicate,
+NoImplicitFloat,
+NoInline,
+NoRecurse,
+NoRedZone,
+NoReturn,
+NoUnwind,
+NonLazyBind,
+NonNull,
+OptimizeForSize,
+OptimizeNone,
+ReadNone,
+ReadOnly,
+Returned,
+ReturnsTwice,
+SExt,
+SafeStack,
+SanitizeAddress,
+SanitizeHWAddress,
+SanitizeMemory,
+SanitizeThread,
+Speculatable,
+StackAlignment,
+StackProtect,
+StackProtectReq,
+StackProtectStrong,
+StrictFP,
+StructRet,
+SwiftError,
+SwiftSelf,
+UWTable,
+WriteOnly,
+ZExt,
+    EndAttrKinds
+  };
+
+private:
+  AttributeImpl *pImpl = nullptr;
+
+  Attribute(AttributeImpl *A) : pImpl(A) {}
+
+public:
+  Attribute() = default;
+
+
+
+
+
+
+  static Attribute get(LLVMContext &Context, AttrKind Kind, uint64_t Val = 0);
+  static Attribute get(LLVMContext &Context, StringRef Kind,
+                       StringRef Val = StringRef());
+
+
+
+  static Attribute getWithAlignment(LLVMContext &Context, uint64_t Align);
+  static Attribute getWithStackAlignment(LLVMContext &Context, uint64_t Align);
+  static Attribute getWithDereferenceableBytes(LLVMContext &Context,
+                                              uint64_t Bytes);
+  static Attribute getWithDereferenceableOrNullBytes(LLVMContext &Context,
+                                                     uint64_t Bytes);
+  static Attribute getWithAllocSizeArgs(LLVMContext &Context,
+                                        unsigned ElemSizeArg,
+                                        const Optional<unsigned> &NumElemsArg);
+
+
+
+
+
+
+  bool isEnumAttribute() const;
+
+
+  bool isIntAttribute() const;
+
+
+
+  bool isStringAttribute() const;
+
+
+  bool hasAttribute(AttrKind Val) const;
+
+
+  bool hasAttribute(StringRef Val) const;
+
+
+
+  Attribute::AttrKind getKindAsEnum() const;
+
+
+
+  uint64_t getValueAsInt() const;
+
+
+
+  StringRef getKindAsString() const;
+
+
+
+  StringRef getValueAsString() const;
+
+
+
+  unsigned getAlignment() const;
+
+
+
+  unsigned getStackAlignment() const;
+
+
+
+  uint64_t getDereferenceableBytes() const;
+
+
+
+  uint64_t getDereferenceableOrNullBytes() const;
+
+
+
+  std::pair<unsigned, Optional<unsigned>> getAllocSizeArgs() const;
+
+
+
+  std::string getAsString(bool InAttrGrp = false) const;
+
+
+  bool operator==(Attribute A) const { return pImpl == A.pImpl; }
+  bool operator!=(Attribute A) const { return pImpl != A.pImpl; }
+
+
+  bool operator<(Attribute A) const;
+
+  void Profile(FoldingSetNodeID &ID) const {
+    ID.AddPointer(pImpl);
+  }
+
+
+  void *getRawPointer() const {
+    return pImpl;
+  }
+
+
+  static Attribute fromRawPointer(void *RawPtr) {
+    return Attribute(reinterpret_cast<AttributeImpl*>(RawPtr));
+  }
+};
+
+
+inline LLVMAttributeRef wrap(Attribute Attr) {
+  return reinterpret_cast<LLVMAttributeRef>(Attr.getRawPointer());
+}
+
+
+inline Attribute unwrap(LLVMAttributeRef Attr) {
+  return Attribute::fromRawPointer(Attr);
+}
+
+
+
+
+
+
+
+class AttributeSet {
+
+
+
+
+
+  AttributeSetNode *SetNode = nullptr;
+
+  friend AttributeListImpl;
+  template <typename Ty> friend struct DenseMapInfo;
+
+private:
+  explicit AttributeSet(AttributeSetNode *ASN) : SetNode(ASN) {}
+
+public:
+
+  AttributeSet() = default;
+  AttributeSet(const AttributeSet &) = default;
+  ~AttributeSet() = default;
+
+  static AttributeSet get(LLVMContext &C, const AttrBuilder &B);
+  static AttributeSet get(LLVMContext &C, ArrayRef<Attribute> Attrs);
+
+  bool operator==(const AttributeSet &O) const { return SetNode == O.SetNode; }
+  bool operator!=(const AttributeSet &O) const { return !(*this == O); }
+
+
+
+  AttributeSet addAttribute(LLVMContext &C, Attribute::AttrKind Kind) const;
+
+
+
+  AttributeSet addAttribute(LLVMContext &C, StringRef Kind,
+                            StringRef Value = StringRef()) const;
+
+
+
+  AttributeSet addAttributes(LLVMContext &C, AttributeSet AS) const;
+
+
+
+  AttributeSet removeAttribute(LLVMContext &C, Attribute::AttrKind Kind) const;
+
+
+
+  AttributeSet removeAttribute(LLVMContext &C, StringRef Kind) const;
+
+
+
+  AttributeSet removeAttributes(LLVMContext &C,
+                                const AttrBuilder &AttrsToRemove) const;
+
+
+  unsigned getNumAttributes() const;
+
+
+  bool hasAttributes() const { return SetNode != nullptr; }
+
+
+  bool hasAttribute(Attribute::AttrKind Kind) const;
+
+
+  bool hasAttribute(StringRef Kind) const;
+
+
+  Attribute getAttribute(Attribute::AttrKind Kind) const;
+
+
+  Attribute getAttribute(StringRef Kind) const;
+
+  unsigned getAlignment() const;
+  unsigned getStackAlignment() const;
+  uint64_t getDereferenceableBytes() const;
+  uint64_t getDereferenceableOrNullBytes() const;
+  std::pair<unsigned, Optional<unsigned>> getAllocSizeArgs() const;
+  std::string getAsString(bool InAttrGrp = false) const;
+
+  using iterator = const Attribute *;
+
+  iterator begin() const;
+  iterator end() const;
+
+  void dump() const;
+
+};
+
+
+
+
+template <> struct DenseMapInfo<AttributeSet> {
+  static inline AttributeSet getEmptyKey() {
+    uintptr_t Val = static_cast<uintptr_t>(-1);
+    Val <<= PointerLikeTypeTraits<void *>::NumLowBitsAvailable;
+    return AttributeSet(reinterpret_cast<AttributeSetNode *>(Val));
+  }
+
+  static inline AttributeSet getTombstoneKey() {
+    uintptr_t Val = static_cast<uintptr_t>(-2);
+    Val <<= PointerLikeTypeTraits<void *>::NumLowBitsAvailable;
+    return AttributeSet(reinterpret_cast<AttributeSetNode *>(Val));
+  }
+
+  static unsigned getHashValue(AttributeSet AS) {
+    return (unsigned((uintptr_t)AS.SetNode) >> 4) ^
+           (unsigned((uintptr_t)AS.SetNode) >> 9);
+  }
+
+  static bool isEqual(AttributeSet LHS, AttributeSet RHS) { return LHS == RHS; }
+};
+class AttributeList {
+public:
+  enum AttrIndex : unsigned {
+    ReturnIndex = 0U,
+    FunctionIndex = ~0U,
+    FirstArgIndex = 1,
+  };
+
+private:
+  friend class AttrBuilder;
+  friend class AttributeListImpl;
+  friend class AttributeSet;
+  friend class AttributeSetNode;
+
+  template <typename Ty> friend struct DenseMapInfo;
+
+
+
+  AttributeListImpl *pImpl = nullptr;
+
+public:
+
+  static AttributeList get(LLVMContext &C,
+                           ArrayRef<std::pair<unsigned, Attribute>> Attrs);
+  static AttributeList get(LLVMContext &C,
+                           ArrayRef<std::pair<unsigned, AttributeSet>> Attrs);
+
+
+
+  static AttributeList get(LLVMContext &C, AttributeSet FnAttrs,
+                           AttributeSet RetAttrs,
+                           ArrayRef<AttributeSet> ArgAttrs);
+
+private:
+  explicit AttributeList(AttributeListImpl *LI) : pImpl(LI) {}
+
+  static AttributeList getImpl(LLVMContext &C, ArrayRef<AttributeSet> AttrSets);
+
+public:
+  AttributeList() = default;
+
+
+
+
+
+
+  static AttributeList get(LLVMContext &C, ArrayRef<AttributeList> Attrs);
+  static AttributeList get(LLVMContext &C, unsigned Index,
+                           ArrayRef<Attribute::AttrKind> Kinds);
+  static AttributeList get(LLVMContext &C, unsigned Index,
+                           ArrayRef<StringRef> Kind);
+  static AttributeList get(LLVMContext &C, unsigned Index,
+                           const AttrBuilder &B);
+
+
+
+  AttributeList addAttribute(LLVMContext &C, unsigned Index,
+                             Attribute::AttrKind Kind) const;
+
+
+
+  AttributeList addAttribute(LLVMContext &C, unsigned Index, StringRef Kind,
+                             StringRef Value = StringRef()) const;
+
+
+
+  AttributeList addAttribute(LLVMContext &C, unsigned Index, Attribute A) const;
+
+
+
+  AttributeList addAttributes(LLVMContext &C, unsigned Index,
+                              const AttrBuilder &B) const;
+
+
+
+  AttributeList addParamAttribute(LLVMContext &C, unsigned ArgNo,
+                                  Attribute::AttrKind Kind) const {
+    return addAttribute(C, ArgNo + FirstArgIndex, Kind);
+  }
+
+
+
+  AttributeList addParamAttribute(LLVMContext &C, unsigned ArgNo,
+                                  StringRef Kind,
+                                  StringRef Value = StringRef()) const {
+    return addAttribute(C, ArgNo + FirstArgIndex, Kind, Value);
+  }
+
+
+
+  AttributeList addParamAttribute(LLVMContext &C, ArrayRef<unsigned> ArgNos,
+                                  Attribute A) const;
+
+
+
+  AttributeList addParamAttributes(LLVMContext &C, unsigned ArgNo,
+                                   const AttrBuilder &B) const {
+    return addAttributes(C, ArgNo + FirstArgIndex, B);
+  }
+
+
+
+  AttributeList removeAttribute(LLVMContext &C, unsigned Index,
+                                Attribute::AttrKind Kind) const;
+
+
+
+  AttributeList removeAttribute(LLVMContext &C, unsigned Index,
+                                StringRef Kind) const;
+
+
+
+  AttributeList removeAttributes(LLVMContext &C, unsigned Index,
+                                 const AttrBuilder &AttrsToRemove) const;
+
+
+
+  AttributeList removeAttributes(LLVMContext &C, unsigned Index) const;
+
+
+
+  AttributeList removeParamAttribute(LLVMContext &C, unsigned ArgNo,
+                                     Attribute::AttrKind Kind) const {
+    return removeAttribute(C, ArgNo + FirstArgIndex, Kind);
+  }
+
+
+
+  AttributeList removeParamAttribute(LLVMContext &C, unsigned ArgNo,
+                                     StringRef Kind) const {
+    return removeAttribute(C, ArgNo + FirstArgIndex, Kind);
+  }
+
+
+
+  AttributeList removeParamAttributes(LLVMContext &C, unsigned ArgNo,
+                                      const AttrBuilder &AttrsToRemove) const {
+    return removeAttributes(C, ArgNo + FirstArgIndex, AttrsToRemove);
+  }
+
+
+
+  AttributeList removeParamAttributes(LLVMContext &C, unsigned ArgNo) const {
+    return removeAttributes(C, ArgNo + FirstArgIndex);
+  }
+
+
+
+  AttributeList addDereferenceableAttr(LLVMContext &C, unsigned Index,
+                                       uint64_t Bytes) const;
+
+
+
+  AttributeList addDereferenceableParamAttr(LLVMContext &C, unsigned ArgNo,
+                                            uint64_t Bytes) const {
+    return addDereferenceableAttr(C, ArgNo + FirstArgIndex, Bytes);
+  }
+
+
+
+  AttributeList addDereferenceableOrNullAttr(LLVMContext &C, unsigned Index,
+                                             uint64_t Bytes) const;
+
+
+
+
+  AttributeList addDereferenceableOrNullParamAttr(LLVMContext &C,
+                                                  unsigned ArgNo,
+                                                  uint64_t Bytes) const {
+    return addDereferenceableOrNullAttr(C, ArgNo + FirstArgIndex, Bytes);
+  }
+
+
+
+  AttributeList addAllocSizeAttr(LLVMContext &C, unsigned Index,
+                                 unsigned ElemSizeArg,
+                                 const Optional<unsigned> &NumElemsArg);
+
+
+
+  AttributeList addAllocSizeParamAttr(LLVMContext &C, unsigned ArgNo,
+                                      unsigned ElemSizeArg,
+                                      const Optional<unsigned> &NumElemsArg) {
+    return addAllocSizeAttr(C, ArgNo + FirstArgIndex, ElemSizeArg, NumElemsArg);
+  }
+
+
+
+
+
+
+  LLVMContext &getContext() const;
+
+
+  AttributeSet getAttributes(unsigned Index) const;
+
+
+
+  AttributeSet getParamAttributes(unsigned ArgNo) const;
+
+
+  AttributeSet getRetAttributes() const;
+
+
+  AttributeSet getFnAttributes() const;
+
+
+  bool hasAttribute(unsigned Index, Attribute::AttrKind Kind) const;
+
+
+  bool hasAttribute(unsigned Index, StringRef Kind) const;
+
+
+  bool hasAttributes(unsigned Index) const;
+
+
+  bool hasParamAttr(unsigned ArgNo, Attribute::AttrKind Kind) const {
+    return hasAttribute(ArgNo + FirstArgIndex, Kind);
+  }
+
+
+  bool hasParamAttr(unsigned ArgNo, StringRef Kind) const {
+    return hasAttribute(ArgNo + FirstArgIndex, Kind);
+  }
+
+
+  bool hasParamAttrs(unsigned ArgNo) const {
+    return hasAttributes(ArgNo + FirstArgIndex);
+  }
+
+
+
+  bool hasFnAttribute(Attribute::AttrKind Kind) const;
+
+
+
+  bool hasFnAttribute(StringRef Kind) const;
+
+
+  bool hasParamAttribute(unsigned ArgNo, Attribute::AttrKind Kind) const;
+
+
+
+
+  bool hasAttrSomewhere(Attribute::AttrKind Kind,
+                        unsigned *Index = nullptr) const;
+
+
+  Attribute getAttribute(unsigned Index, Attribute::AttrKind Kind) const;
+
+
+  Attribute getAttribute(unsigned Index, StringRef Kind) const;
+
+
+  Attribute getParamAttr(unsigned ArgNo, Attribute::AttrKind Kind) const {
+    return getAttribute(ArgNo + FirstArgIndex, Kind);
+  }
+
+
+  Attribute getParamAttr(unsigned ArgNo, StringRef Kind) const {
+    return getAttribute(ArgNo + FirstArgIndex, Kind);
+  }
+
+
+  unsigned getRetAlignment() const;
+
+
+  unsigned getParamAlignment(unsigned ArgNo) const;
+
+
+  unsigned getStackAlignment(unsigned Index) const;
+
+
+  uint64_t getDereferenceableBytes(unsigned Index) const;
+
+
+
+  uint64_t getParamDereferenceableBytes(unsigned ArgNo) const {
+    return getDereferenceableBytes(ArgNo + FirstArgIndex);
+  }
+
+
+
+  uint64_t getDereferenceableOrNullBytes(unsigned Index) const;
+
+
+
+  uint64_t getParamDereferenceableOrNullBytes(unsigned ArgNo) const {
+    return getDereferenceableOrNullBytes(ArgNo + FirstArgIndex);
+  }
+
+
+  std::pair<unsigned, Optional<unsigned>>
+  getAllocSizeArgs(unsigned Index) const;
+
+
+  std::string getAsString(unsigned Index, bool InAttrGrp = false) const;
+
+
+
+
+
+  using iterator = const AttributeSet *;
+
+  iterator begin() const;
+  iterator end() const;
+
+  unsigned getNumAttrSets() const;
+
+
+  unsigned index_begin() const { return AttributeList::FunctionIndex; }
+  unsigned index_end() const { return getNumAttrSets() - 1; }
+
+
+  bool operator==(const AttributeList &RHS) const { return pImpl == RHS.pImpl; }
+  bool operator!=(const AttributeList &RHS) const { return pImpl != RHS.pImpl; }
+
+
+  void *getRawPointer() const {
+    return pImpl;
+  }
+
+
+  bool isEmpty() const { return pImpl == nullptr; }
+
+  void dump() const;
+};
+
+
+
+
+template <> struct DenseMapInfo<AttributeList> {
+  static inline AttributeList getEmptyKey() {
+    uintptr_t Val = static_cast<uintptr_t>(-1);
+    Val <<= PointerLikeTypeTraits<void*>::NumLowBitsAvailable;
+    return AttributeList(reinterpret_cast<AttributeListImpl *>(Val));
+  }
+
+  static inline AttributeList getTombstoneKey() {
+    uintptr_t Val = static_cast<uintptr_t>(-2);
+    Val <<= PointerLikeTypeTraits<void*>::NumLowBitsAvailable;
+    return AttributeList(reinterpret_cast<AttributeListImpl *>(Val));
+  }
+
+  static unsigned getHashValue(AttributeList AS) {
+    return (unsigned((uintptr_t)AS.pImpl) >> 4) ^
+           (unsigned((uintptr_t)AS.pImpl) >> 9);
+  }
+
+  static bool isEqual(AttributeList LHS, AttributeList RHS) {
+    return LHS == RHS;
+  }
+};
+
+
+
+
+
+
+
+class AttrBuilder {
+  std::bitset<Attribute::EndAttrKinds> Attrs;
+  std::map<std::string, std::string> TargetDepAttrs;
+  uint64_t Alignment = 0;
+  uint64_t StackAlignment = 0;
+  uint64_t DerefBytes = 0;
+  uint64_t DerefOrNullBytes = 0;
+  uint64_t AllocSizeArgs = 0;
+
+public:
+  AttrBuilder() = default;
+  AttrBuilder(const Attribute &A) {
+    addAttribute(A);
+  }
+  AttrBuilder(AttributeList AS, unsigned Idx);
+  AttrBuilder(AttributeSet AS);
+
+  void clear();
+
+
+  AttrBuilder &addAttribute(Attribute::AttrKind Val);
+
+
+  AttrBuilder &addAttribute(Attribute A);
+
+
+  AttrBuilder &addAttribute(StringRef A, StringRef V = StringRef());
+
+
+  AttrBuilder &removeAttribute(Attribute::AttrKind Val);
+
+
+  AttrBuilder &removeAttributes(AttributeList A, uint64_t WithoutIndex);
+
+
+  AttrBuilder &removeAttribute(StringRef A);
+
+
+  AttrBuilder &merge(const AttrBuilder &B);
+
+
+  AttrBuilder &remove(const AttrBuilder &B);
+
+
+
+  bool overlaps(const AttrBuilder &B) const;
+
+
+  bool contains(Attribute::AttrKind A) const {
+    
+   ((
+   (unsigned)A < Attribute::EndAttrKinds && "Attribute out of range!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "(unsigned)A < Attribute::EndAttrKinds && \"Attribute out of range!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Attributes.h", 732, __PRETTY_FUNCTION__))
+                                                                             ;
+    return Attrs[A];
+  }
+
+
+
+  bool contains(StringRef A) const;
+
+
+  bool hasAttributes() const;
+
+
+
+  bool hasAttributes(AttributeList A, uint64_t Index) const;
+
+
+  bool hasAlignmentAttr() const;
+
+
+  uint64_t getAlignment() const { return Alignment; }
+
+
+  uint64_t getStackAlignment() const { return StackAlignment; }
+
+
+
+  uint64_t getDereferenceableBytes() const { return DerefBytes; }
+
+
+
+  uint64_t getDereferenceableOrNullBytes() const { return DerefOrNullBytes; }
+
+
+
+  std::pair<unsigned, Optional<unsigned>> getAllocSizeArgs() const;
+
+
+
+  AttrBuilder &addAlignmentAttr(unsigned Align);
+
+
+
+  AttrBuilder &addStackAlignmentAttr(unsigned Align);
+
+
+
+  AttrBuilder &addDereferenceableAttr(uint64_t Bytes);
+
+
+
+  AttrBuilder &addDereferenceableOrNullAttr(uint64_t Bytes);
+
+
+  AttrBuilder &addAllocSizeAttr(unsigned ElemSizeArg,
+                                const Optional<unsigned> &NumElemsArg);
+
+
+
+  AttrBuilder &addAllocSizeAttrFromRawRepr(uint64_t RawAllocSizeRepr);
+
+
+
+  bool empty() const { return Attrs.none(); }
+
+
+  using td_type = std::pair<std::string, std::string>;
+  using td_iterator = std::map<std::string, std::string>::iterator;
+  using td_const_iterator = std::map<std::string, std::string>::const_iterator;
+  using td_range = iterator_range<td_iterator>;
+  using td_const_range = iterator_range<td_const_iterator>;
+
+  td_iterator td_begin() { return TargetDepAttrs.begin(); }
+  td_iterator td_end() { return TargetDepAttrs.end(); }
+
+  td_const_iterator td_begin() const { return TargetDepAttrs.begin(); }
+  td_const_iterator td_end() const { return TargetDepAttrs.end(); }
+
+  td_range td_attrs() { return td_range(td_begin(), td_end()); }
+  td_const_range td_attrs() const {
+    return td_const_range(td_begin(), td_end());
+  }
+
+  bool td_empty() const { return TargetDepAttrs.empty(); }
+
+  bool operator==(const AttrBuilder &B);
+  bool operator!=(const AttrBuilder &B) {
+    return !(*this == B);
+  }
+};
+
+namespace AttributeFuncs {
+
+
+AttrBuilder typeIncompatible(Type *Ty);
+
+
+
+bool areInlineCompatible(const Function &Caller, const Function &Callee);
+
+
+void mergeAttributesForInlining(Function &Caller, const Function &Callee);
+
+}
+
+}
+
+
+namespace llvm {
+
+
+
+
+
+
+
+class Argument final : public Value {
+  Function *Parent;
+  unsigned ArgNo;
+
+  friend class Function;
+  void setParent(Function *parent);
+
+public:
+
+  explicit Argument(Type *Ty, const Twine &Name = "", Function *F = nullptr,
+                    unsigned ArgNo = 0);
+
+  inline const Function *getParent() const { return Parent; }
+  inline Function *getParent() { return Parent; }
+
+
+
+
+  unsigned getArgNo() const {
+    
+   ((
+   Parent && "can't get number of unparented arg"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Parent && \"can't get number of unparented arg\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Argument.h", 49, __PRETTY_FUNCTION__))
+                                                         ;
+    return ArgNo;
+  }
+
+
+
+
+  bool hasNonNullAttr() const;
+
+
+
+  uint64_t getDereferenceableBytes() const;
+
+
+
+  uint64_t getDereferenceableOrNullBytes() const;
+
+
+  bool hasByValAttr() const;
+
+
+  bool hasSwiftSelfAttr() const;
+
+
+  bool hasSwiftErrorAttr() const;
+
+
+
+  bool hasByValOrInAllocaAttr() const;
+
+
+  unsigned getParamAlignment() const;
+
+
+  bool hasNestAttr() const;
+
+
+  bool hasNoAliasAttr() const;
+
+
+  bool hasNoCaptureAttr() const;
+
+
+  bool hasStructRetAttr() const;
+
+
+  bool hasReturnedAttr() const;
+
+
+  bool onlyReadsMemory() const;
+
+
+  bool hasInAllocaAttr() const;
+
+
+  bool hasZExtAttr() const;
+
+
+  bool hasSExtAttr() const;
+
+
+  void addAttrs(AttrBuilder &B);
+
+  void addAttr(Attribute::AttrKind Kind);
+
+  void addAttr(Attribute Attr);
+
+
+  void removeAttr(Attribute::AttrKind Kind);
+
+
+  bool hasAttribute(Attribute::AttrKind Kind) const;
+
+
+  static bool classof(const Value *V) {
+    return V->getValueID() == ArgumentVal;
+  }
+};
+
+}
+
+
+namespace llvm {
+
+
+
+
+namespace CallingConv {
+
+
+  using ID = unsigned;
+
+
+
+
+  enum {
+
+
+
+
+    C = 0,
+
+
+
+
+
+
+
+    Fast = 8,
+
+
+
+
+
+    Cold = 9,
+
+
+    GHC = 10,
+
+
+
+    HiPE = 11,
+
+
+    WebKit_JS = 12,
+
+
+
+    AnyReg = 13,
+
+
+
+    PreserveMost = 14,
+
+
+
+    PreserveAll = 15,
+
+
+    Swift = 16,
+
+
+    CXX_FAST_TLS = 17,
+
+
+
+    FirstTargetCC = 64,
+
+
+
+
+
+    X86_StdCall = 64,
+
+
+
+
+    X86_FastCall = 65,
+
+
+
+    ARM_APCS = 66,
+
+
+
+    ARM_AAPCS = 67,
+
+
+    ARM_AAPCS_VFP = 68,
+
+
+    MSP430_INTR = 69,
+
+
+
+
+    X86_ThisCall = 70,
+
+
+
+    PTX_Kernel = 71,
+
+
+
+    PTX_Device = 72,
+    SPIR_FUNC = 75,
+
+
+
+
+
+
+
+    SPIR_KERNEL = 76,
+
+
+    Intel_OCL_BI = 77,
+
+
+
+    X86_64_SysV = 78,
+    Win64 = 79,
+
+
+
+    X86_VectorCall = 80,
+
+
+
+
+
+    HHVM = 81,
+
+
+    HHVM_C = 82,
+
+
+
+
+
+
+    X86_INTR = 83,
+
+
+    AVR_INTR = 84,
+
+
+    AVR_SIGNAL = 85,
+
+
+
+    AVR_BUILTIN = 86,
+
+
+
+
+    AMDGPU_VS = 87,
+
+
+    AMDGPU_GS = 88,
+
+
+    AMDGPU_PS = 89,
+
+
+    AMDGPU_CS = 90,
+
+
+    AMDGPU_KERNEL = 91,
+
+
+    X86_RegCall = 92,
+
+
+
+    AMDGPU_HS = 93,
+
+
+
+    MSP430_BUILTIN = 94,
+
+
+
+    AMDGPU_LS = 95,
+
+
+
+
+    AMDGPU_ES = 96,
+
+
+    MaxID = 1023
+  };
+
+}
+
+}
+namespace llvm {
+
+struct fltSemantics;
+class APSInt;
+class StringRef;
+class APFloat;
+class raw_ostream;
+
+template <typename T> class SmallVectorImpl;
+
+
+
+
+
+enum lostFraction {
+  lfExactlyZero,
+  lfLessThanHalf,
+  lfExactlyHalf,
+  lfMoreThanHalf
+};
+struct APFloatBase {
+  typedef APInt::WordType integerPart;
+  static const unsigned integerPartWidth = APInt::APINT_BITS_PER_WORD;
+
+
+  typedef signed short ExponentType;
+
+
+
+
+  static const fltSemantics &IEEEhalf() __attribute__((__const__));
+  static const fltSemantics &IEEEsingle() __attribute__((__const__));
+  static const fltSemantics &IEEEdouble() __attribute__((__const__));
+  static const fltSemantics &IEEEquad() __attribute__((__const__));
+  static const fltSemantics &PPCDoubleDouble() __attribute__((__const__));
+  static const fltSemantics &x87DoubleExtended() __attribute__((__const__));
+
+
+
+  static const fltSemantics &Bogus() __attribute__((__const__));
+
+
+
+
+  enum cmpResult {
+    cmpLessThan,
+    cmpEqual,
+    cmpGreaterThan,
+    cmpUnordered
+  };
+
+
+  enum roundingMode {
+    rmNearestTiesToEven,
+    rmTowardPositive,
+    rmTowardNegative,
+    rmTowardZero,
+    rmNearestTiesToAway
+  };
+
+
+
+
+  enum opStatus {
+    opOK = 0x00,
+    opInvalidOp = 0x01,
+    opDivByZero = 0x02,
+    opOverflow = 0x04,
+    opUnderflow = 0x08,
+    opInexact = 0x10
+  };
+
+
+  enum fltCategory {
+    fcInfinity,
+    fcNaN,
+    fcNormal,
+    fcZero
+  };
+
+
+  enum uninitializedTag {
+    uninitialized
+  };
+
+
+  enum IlogbErrorKinds {
+    IEK_Zero = 
+              (-0x7fffffff - 1) 
+                      + 1,
+    IEK_NaN = 
+             (-0x7fffffff - 1)
+                    ,
+    IEK_Inf = 0x7fffffff
+  };
+
+  static unsigned int semanticsPrecision(const fltSemantics &);
+  static ExponentType semanticsMinExponent(const fltSemantics &);
+  static ExponentType semanticsMaxExponent(const fltSemantics &);
+  static unsigned int semanticsSizeInBits(const fltSemantics &);
+
+
+
+  static unsigned getSizeInBits(const fltSemantics &Sem);
+};
+
+namespace detail {
+
+class IEEEFloat final : public APFloatBase {
+public:
+
+
+
+  IEEEFloat(const fltSemantics &);
+  IEEEFloat(const fltSemantics &, integerPart);
+  IEEEFloat(const fltSemantics &, uninitializedTag);
+  IEEEFloat(const fltSemantics &, const APInt &);
+  explicit IEEEFloat(double d);
+  explicit IEEEFloat(float f);
+  IEEEFloat(const IEEEFloat &);
+  IEEEFloat(IEEEFloat &&);
+  ~IEEEFloat();
+
+
+
+
+  bool needsCleanup() const { return partCount() > 1; }
+  opStatus add(const IEEEFloat &, roundingMode);
+  opStatus subtract(const IEEEFloat &, roundingMode);
+  opStatus multiply(const IEEEFloat &, roundingMode);
+  opStatus divide(const IEEEFloat &, roundingMode);
+
+  opStatus remainder(const IEEEFloat &);
+
+  opStatus mod(const IEEEFloat &);
+  opStatus fusedMultiplyAdd(const IEEEFloat &, const IEEEFloat &, roundingMode);
+  opStatus roundToIntegral(roundingMode);
+
+  opStatus next(bool nextDown);
+
+
+
+
+
+
+  void changeSign();
+
+
+
+
+
+
+  opStatus convert(const fltSemantics &, roundingMode, bool *);
+  opStatus convertToInteger(MutableArrayRef<integerPart>, unsigned int, bool,
+                            roundingMode, bool *) const;
+  opStatus convertFromAPInt(const APInt &, bool, roundingMode);
+  opStatus convertFromSignExtendedInteger(const integerPart *, unsigned int,
+                                          bool, roundingMode);
+  opStatus convertFromZeroExtendedInteger(const integerPart *, unsigned int,
+                                          bool, roundingMode);
+  opStatus convertFromString(StringRef, roundingMode);
+  APInt bitcastToAPInt() const;
+  double convertToDouble() const;
+  float convertToFloat() const;
+
+
+
+
+
+
+  bool operator==(const IEEEFloat &) const = delete;
+
+
+
+  cmpResult compare(const IEEEFloat &) const;
+
+
+  bool bitwiseIsEqual(const IEEEFloat &) const;
+
+
+
+
+  unsigned int convertToHexString(char *dst, unsigned int hexDigits,
+                                  bool upperCase, roundingMode) const;
+  bool isNegative() const { return sign; }
+
+
+
+
+
+  bool isNormal() const { return !isDenormal() && isFiniteNonZero(); }
+
+
+
+
+
+  bool isFinite() const { return !isNaN() && !isInfinity(); }
+
+
+  bool isZero() const { return category == fcZero; }
+
+
+
+  bool isDenormal() const;
+
+
+  bool isInfinity() const { return category == fcInfinity; }
+
+
+  bool isNaN() const { return category == fcNaN; }
+
+
+  bool isSignaling() const;
+
+
+
+
+
+
+  fltCategory getCategory() const { return category; }
+  const fltSemantics &getSemantics() const { return *semantics; }
+  bool isNonZero() const { return category != fcZero; }
+  bool isFiniteNonZero() const { return isFinite() && !isZero(); }
+  bool isPosZero() const { return isZero() && !isNegative(); }
+  bool isNegZero() const { return isZero() && isNegative(); }
+
+
+
+  bool isSmallest() const;
+
+
+
+  bool isLargest() const;
+
+
+  bool isInteger() const;
+
+
+
+  IEEEFloat &operator=(const IEEEFloat &);
+  IEEEFloat &operator=(IEEEFloat &&);
+  friend hash_code hash_value(const IEEEFloat &Arg);
+  void toString(SmallVectorImpl<char> &Str, unsigned FormatPrecision = 0,
+                unsigned FormatMaxPadding = 3, bool TruncateZero = true) const;
+
+
+
+  bool getExactInverse(APFloat *inv) const;
+  friend int ilogb(const IEEEFloat &Arg);
+
+
+  friend IEEEFloat scalbn(IEEEFloat X, int Exp, roundingMode);
+
+  friend IEEEFloat frexp(const IEEEFloat &X, int &Exp, roundingMode);
+
+
+
+
+  void makeLargest(bool Neg = false);
+  void makeSmallest(bool Neg = false);
+  void makeNaN(bool SNaN = false, bool Neg = false,
+               const APInt *fill = nullptr);
+  void makeInf(bool Neg = false);
+  void makeZero(bool Neg = false);
+  void makeQuiet();
+
+
+
+
+
+  void makeSmallestNormalized(bool Negative = false);
+
+
+
+  cmpResult compareAbsoluteValue(const IEEEFloat &) const;
+
+private:
+
+
+
+  integerPart *significandParts();
+  const integerPart *significandParts() const;
+  unsigned int partCount() const;
+
+
+
+
+
+
+  integerPart addSignificand(const IEEEFloat &);
+  integerPart subtractSignificand(const IEEEFloat &, integerPart);
+  lostFraction addOrSubtractSignificand(const IEEEFloat &, bool subtract);
+  lostFraction multiplySignificand(const IEEEFloat &, const IEEEFloat *);
+  lostFraction divideSignificand(const IEEEFloat &);
+  void incrementSignificand();
+  void initialize(const fltSemantics *);
+  void shiftSignificandLeft(unsigned int);
+  lostFraction shiftSignificandRight(unsigned int);
+  unsigned int significandLSB() const;
+  unsigned int significandMSB() const;
+  void zeroSignificand();
+
+  bool isSignificandAllOnes() const;
+
+  bool isSignificandAllZeros() const;
+
+
+
+
+
+
+  opStatus addOrSubtractSpecials(const IEEEFloat &, bool subtract);
+  opStatus divideSpecials(const IEEEFloat &);
+  opStatus multiplySpecials(const IEEEFloat &);
+  opStatus modSpecials(const IEEEFloat &);
+
+
+
+
+
+
+  bool convertFromStringSpecials(StringRef str);
+  opStatus normalize(roundingMode, lostFraction);
+  opStatus addOrSubtract(const IEEEFloat &, roundingMode, bool subtract);
+  opStatus handleOverflow(roundingMode);
+  bool roundAwayFromZero(roundingMode, lostFraction, unsigned int) const;
+  opStatus convertToSignExtendedInteger(MutableArrayRef<integerPart>,
+                                        unsigned int, bool, roundingMode,
+                                        bool *) const;
+  opStatus convertFromUnsignedParts(const integerPart *, unsigned int,
+                                    roundingMode);
+  opStatus convertFromHexadecimalString(StringRef, roundingMode);
+  opStatus convertFromDecimalString(StringRef, roundingMode);
+  char *convertNormalToHexString(char *, unsigned int, bool,
+                                 roundingMode) const;
+  opStatus roundSignificandWithExponent(const integerPart *, unsigned int, int,
+                                        roundingMode);
+
+
+
+  APInt convertHalfAPFloatToAPInt() const;
+  APInt convertFloatAPFloatToAPInt() const;
+  APInt convertDoubleAPFloatToAPInt() const;
+  APInt convertQuadrupleAPFloatToAPInt() const;
+  APInt convertF80LongDoubleAPFloatToAPInt() const;
+  APInt convertPPCDoubleDoubleAPFloatToAPInt() const;
+  void initFromAPInt(const fltSemantics *Sem, const APInt &api);
+  void initFromHalfAPInt(const APInt &api);
+  void initFromFloatAPInt(const APInt &api);
+  void initFromDoubleAPInt(const APInt &api);
+  void initFromQuadrupleAPInt(const APInt &api);
+  void initFromF80LongDoubleAPInt(const APInt &api);
+  void initFromPPCDoubleDoubleAPInt(const APInt &api);
+
+  void assign(const IEEEFloat &);
+  void copySignificand(const IEEEFloat &);
+  void freeSignificand();
+
+
+
+  const fltSemantics *semantics;
+
+
+
+
+  union Significand {
+    integerPart part;
+    integerPart *parts;
+  } significand;
+
+
+  ExponentType exponent;
+
+
+
+
+
+  fltCategory category : 3;
+
+
+  unsigned int sign : 1;
+};
+
+hash_code hash_value(const IEEEFloat &Arg);
+int ilogb(const IEEEFloat &Arg);
+IEEEFloat scalbn(IEEEFloat X, int Exp, IEEEFloat::roundingMode);
+IEEEFloat frexp(const IEEEFloat &Val, int &Exp, IEEEFloat::roundingMode RM);
+
+
+
+
+
+class DoubleAPFloat final : public APFloatBase {
+
+  const fltSemantics *Semantics;
+  std::unique_ptr<APFloat[]> Floats;
+
+  opStatus addImpl(const APFloat &a, const APFloat &aa, const APFloat &c,
+                   const APFloat &cc, roundingMode RM);
+
+  opStatus addWithSpecial(const DoubleAPFloat &LHS, const DoubleAPFloat &RHS,
+                          DoubleAPFloat &Out, roundingMode RM);
+
+public:
+  DoubleAPFloat(const fltSemantics &S);
+  DoubleAPFloat(const fltSemantics &S, uninitializedTag);
+  DoubleAPFloat(const fltSemantics &S, integerPart);
+  DoubleAPFloat(const fltSemantics &S, const APInt &I);
+  DoubleAPFloat(const fltSemantics &S, APFloat &&First, APFloat &&Second);
+  DoubleAPFloat(const DoubleAPFloat &RHS);
+  DoubleAPFloat(DoubleAPFloat &&RHS);
+
+  DoubleAPFloat &operator=(const DoubleAPFloat &RHS);
+
+  DoubleAPFloat &operator=(DoubleAPFloat &&RHS) {
+    if (this != &RHS) {
+      this->~DoubleAPFloat();
+      new (this) DoubleAPFloat(std::move(RHS));
+    }
+    return *this;
+  }
+
+  bool needsCleanup() const { return Floats != nullptr; }
+
+  APFloat &getFirst() { return Floats[0]; }
+  const APFloat &getFirst() const { return Floats[0]; }
+  APFloat &getSecond() { return Floats[1]; }
+  const APFloat &getSecond() const { return Floats[1]; }
+
+  opStatus add(const DoubleAPFloat &RHS, roundingMode RM);
+  opStatus subtract(const DoubleAPFloat &RHS, roundingMode RM);
+  opStatus multiply(const DoubleAPFloat &RHS, roundingMode RM);
+  opStatus divide(const DoubleAPFloat &RHS, roundingMode RM);
+  opStatus remainder(const DoubleAPFloat &RHS);
+  opStatus mod(const DoubleAPFloat &RHS);
+  opStatus fusedMultiplyAdd(const DoubleAPFloat &Multiplicand,
+                            const DoubleAPFloat &Addend, roundingMode RM);
+  opStatus roundToIntegral(roundingMode RM);
+  void changeSign();
+  cmpResult compareAbsoluteValue(const DoubleAPFloat &RHS) const;
+
+  fltCategory getCategory() const;
+  bool isNegative() const;
+
+  void makeInf(bool Neg);
+  void makeZero(bool Neg);
+  void makeLargest(bool Neg);
+  void makeSmallest(bool Neg);
+  void makeSmallestNormalized(bool Neg);
+  void makeNaN(bool SNaN, bool Neg, const APInt *fill);
+
+  cmpResult compare(const DoubleAPFloat &RHS) const;
+  bool bitwiseIsEqual(const DoubleAPFloat &RHS) const;
+  APInt bitcastToAPInt() const;
+  opStatus convertFromString(StringRef, roundingMode);
+  opStatus next(bool nextDown);
+
+  opStatus convertToInteger(MutableArrayRef<integerPart> Input,
+                            unsigned int Width, bool IsSigned, roundingMode RM,
+                            bool *IsExact) const;
+  opStatus convertFromAPInt(const APInt &Input, bool IsSigned, roundingMode RM);
+  opStatus convertFromSignExtendedInteger(const integerPart *Input,
+                                          unsigned int InputSize, bool IsSigned,
+                                          roundingMode RM);
+  opStatus convertFromZeroExtendedInteger(const integerPart *Input,
+                                          unsigned int InputSize, bool IsSigned,
+                                          roundingMode RM);
+  unsigned int convertToHexString(char *DST, unsigned int HexDigits,
+                                  bool UpperCase, roundingMode RM) const;
+
+  bool isDenormal() const;
+  bool isSmallest() const;
+  bool isLargest() const;
+  bool isInteger() const;
+
+  void toString(SmallVectorImpl<char> &Str, unsigned FormatPrecision,
+                unsigned FormatMaxPadding, bool TruncateZero = true) const;
+
+  bool getExactInverse(APFloat *inv) const;
+
+  friend int ilogb(const DoubleAPFloat &Arg);
+  friend DoubleAPFloat scalbn(DoubleAPFloat X, int Exp, roundingMode);
+  friend DoubleAPFloat frexp(const DoubleAPFloat &X, int &Exp, roundingMode);
+  friend hash_code hash_value(const DoubleAPFloat &Arg);
+};
+
+hash_code hash_value(const DoubleAPFloat &Arg);
+
+}
+
+
+
+class APFloat : public APFloatBase {
+  typedef detail::IEEEFloat IEEEFloat;
+  typedef detail::DoubleAPFloat DoubleAPFloat;
+
+  static_assert(std::is_standard_layout<IEEEFloat>::value, "");
+
+  union Storage {
+    const fltSemantics *semantics;
+    IEEEFloat IEEE;
+    DoubleAPFloat Double;
+
+    explicit Storage(IEEEFloat F, const fltSemantics &S);
+    explicit Storage(DoubleAPFloat F, const fltSemantics &S)
+        : Double(std::move(F)) {
+      
+     ((
+     &S == &PPCDoubleDouble()
+     ) ? static_cast<void> (0) : __assert_fail (
+     "&S == &PPCDoubleDouble()"
+     , "/home/trippels/llvm/llvm/include/llvm/ADT/APFloat.h", 688, __PRETTY_FUNCTION__))
+                                     ;
+    }
+
+    template <typename... ArgTypes>
+    Storage(const fltSemantics &Semantics, ArgTypes &&... Args) {
+      if (usesLayout<IEEEFloat>(Semantics)) {
+        new (&IEEE) IEEEFloat(Semantics, std::forward<ArgTypes>(Args)...);
+        return;
+      }
+      if (usesLayout<DoubleAPFloat>(Semantics)) {
+        new (&Double) DoubleAPFloat(Semantics, std::forward<ArgTypes>(Args)...);
+        return;
+      }
+      ::llvm::llvm_unreachable_internal("Unexpected semantics", "/home/trippels/llvm/llvm/include/llvm/ADT/APFloat.h", 701);
+    }
+
+    ~Storage() {
+      if (usesLayout<IEEEFloat>(*semantics)) {
+        IEEE.~IEEEFloat();
+        return;
+      }
+      if (usesLayout<DoubleAPFloat>(*semantics)) {
+        Double.~DoubleAPFloat();
+        return;
+      }
+      ::llvm::llvm_unreachable_internal("Unexpected semantics", "/home/trippels/llvm/llvm/include/llvm/ADT/APFloat.h", 713);
+    }
+
+    Storage(const Storage &RHS) {
+      if (usesLayout<IEEEFloat>(*RHS.semantics)) {
+        new (this) IEEEFloat(RHS.IEEE);
+        return;
+      }
+      if (usesLayout<DoubleAPFloat>(*RHS.semantics)) {
+        new (this) DoubleAPFloat(RHS.Double);
+        return;
+      }
+      ::llvm::llvm_unreachable_internal("Unexpected semantics", "/home/trippels/llvm/llvm/include/llvm/ADT/APFloat.h", 725);
+    }
+
+    Storage(Storage &&RHS) {
+      if (usesLayout<IEEEFloat>(*RHS.semantics)) {
+        new (this) IEEEFloat(std::move(RHS.IEEE));
+        return;
+      }
+      if (usesLayout<DoubleAPFloat>(*RHS.semantics)) {
+        new (this) DoubleAPFloat(std::move(RHS.Double));
+        return;
+      }
+      ::llvm::llvm_unreachable_internal("Unexpected semantics", "/home/trippels/llvm/llvm/include/llvm/ADT/APFloat.h", 737);
+    }
+
+    Storage &operator=(const Storage &RHS) {
+      if (usesLayout<IEEEFloat>(*semantics) &&
+          usesLayout<IEEEFloat>(*RHS.semantics)) {
+        IEEE = RHS.IEEE;
+      } else if (usesLayout<DoubleAPFloat>(*semantics) &&
+                 usesLayout<DoubleAPFloat>(*RHS.semantics)) {
+        Double = RHS.Double;
+      } else if (this != &RHS) {
+        this->~Storage();
+        new (this) Storage(RHS);
+      }
+      return *this;
+    }
+
+    Storage &operator=(Storage &&RHS) {
+      if (usesLayout<IEEEFloat>(*semantics) &&
+          usesLayout<IEEEFloat>(*RHS.semantics)) {
+        IEEE = std::move(RHS.IEEE);
+      } else if (usesLayout<DoubleAPFloat>(*semantics) &&
+                 usesLayout<DoubleAPFloat>(*RHS.semantics)) {
+        Double = std::move(RHS.Double);
+      } else if (this != &RHS) {
+        this->~Storage();
+        new (this) Storage(std::move(RHS));
+      }
+      return *this;
+    }
+  } U;
+
+  template <typename T> static bool usesLayout(const fltSemantics &Semantics) {
+    static_assert(std::is_same<T, IEEEFloat>::value ||
+                  std::is_same<T, DoubleAPFloat>::value, "");
+    if (std::is_same<T, DoubleAPFloat>::value) {
+      return &Semantics == &PPCDoubleDouble();
+    }
+    return &Semantics != &PPCDoubleDouble();
+  }
+
+  IEEEFloat &getIEEE() {
+    if (usesLayout<IEEEFloat>(*U.semantics))
+      return U.IEEE;
+    if (usesLayout<DoubleAPFloat>(*U.semantics))
+      return U.Double.getFirst().U.IEEE;
+    ::llvm::llvm_unreachable_internal("Unexpected semantics", "/home/trippels/llvm/llvm/include/llvm/ADT/APFloat.h", 783);
+  }
+
+  const IEEEFloat &getIEEE() const {
+    if (usesLayout<IEEEFloat>(*U.semantics))
+      return U.IEEE;
+    if (usesLayout<DoubleAPFloat>(*U.semantics))
+      return U.Double.getFirst().U.IEEE;
+    ::llvm::llvm_unreachable_internal("Unexpected semantics", "/home/trippels/llvm/llvm/include/llvm/ADT/APFloat.h", 791);
+  }
+
+  void makeZero(bool Neg) { do { if (usesLayout<IEEEFloat>(getSemantics())) return U.IEEE.makeZero(Neg); if (usesLayout<DoubleAPFloat>(getSemantics())) return U.Double.makeZero(Neg); ::llvm::llvm_unreachable_internal("Unexpected semantics", "/home/trippels/llvm/llvm/include/llvm/ADT/APFloat.h", 794); } while (false); }
+
+  void makeInf(bool Neg) { do { if (usesLayout<IEEEFloat>(getSemantics())) return U.IEEE.makeInf(Neg); if (usesLayout<DoubleAPFloat>(getSemantics())) return U.Double.makeInf(Neg); ::llvm::llvm_unreachable_internal("Unexpected semantics", "/home/trippels/llvm/llvm/include/llvm/ADT/APFloat.h", 796); } while (false); }
+
+  void makeNaN(bool SNaN, bool Neg, const APInt *fill) {
+    do { if (usesLayout<IEEEFloat>(getSemantics())) return U.IEEE.makeNaN(SNaN, Neg, fill); if (usesLayout<DoubleAPFloat>(getSemantics())) return U.Double.makeNaN(SNaN, Neg, fill); ::llvm::llvm_unreachable_internal("Unexpected semantics", "/home/trippels/llvm/llvm/include/llvm/ADT/APFloat.h", 799); } while (false);
+  }
+
+  void makeLargest(bool Neg) {
+    do { if (usesLayout<IEEEFloat>(getSemantics())) return U.IEEE.makeLargest(Neg); if (usesLayout<DoubleAPFloat>(getSemantics())) return U.Double.makeLargest(Neg); ::llvm::llvm_unreachable_internal("Unexpected semantics", "/home/trippels/llvm/llvm/include/llvm/ADT/APFloat.h", 803); } while (false);
+  }
+
+  void makeSmallest(bool Neg) {
+    do { if (usesLayout<IEEEFloat>(getSemantics())) return U.IEEE.makeSmallest(Neg); if (usesLayout<DoubleAPFloat>(getSemantics())) return U.Double.makeSmallest(Neg); ::llvm::llvm_unreachable_internal("Unexpected semantics", "/home/trippels/llvm/llvm/include/llvm/ADT/APFloat.h", 807); } while (false);
+  }
+
+  void makeSmallestNormalized(bool Neg) {
+    do { if (usesLayout<IEEEFloat>(getSemantics())) return U.IEEE.makeSmallestNormalized(Neg); if (usesLayout<DoubleAPFloat>(getSemantics())) return U.Double.makeSmallestNormalized(Neg); ::llvm::llvm_unreachable_internal("Unexpected semantics", "/home/trippels/llvm/llvm/include/llvm/ADT/APFloat.h", 811); } while (false);
+  }
+
+
+
+
+  APFloat() : U(IEEEdouble()) {
+    ::llvm::llvm_unreachable_internal("This is a workaround for old clang.", "/home/trippels/llvm/llvm/include/llvm/ADT/APFloat.h", 818);
+  }
+
+  explicit APFloat(IEEEFloat F, const fltSemantics &S) : U(std::move(F), S) {}
+  explicit APFloat(DoubleAPFloat F, const fltSemantics &S)
+      : U(std::move(F), S) {}
+
+  cmpResult compareAbsoluteValue(const APFloat &RHS) const {
+    
+   ((
+   &getSemantics() == &RHS.getSemantics() && "Should only compare APFloats with the same semantics"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "&getSemantics() == &RHS.getSemantics() && \"Should only compare APFloats with the same semantics\""
+   ,
+                                                                 "/home/trippels/llvm/llvm/include/llvm/ADT/APFloat.h"
+    ,
+                                                                 827
+    , __PRETTY_FUNCTION__))
+                                                                  
+                                                                 ;
+    if (usesLayout<IEEEFloat>(getSemantics()))
+      return U.IEEE.compareAbsoluteValue(RHS.U.IEEE);
+    if (usesLayout<DoubleAPFloat>(getSemantics()))
+      return U.Double.compareAbsoluteValue(RHS.U.Double);
+    ::llvm::llvm_unreachable_internal("Unexpected semantics", "/home/trippels/llvm/llvm/include/llvm/ADT/APFloat.h", 832);
+  }
+
+public:
+  APFloat(const fltSemantics &Semantics) : U(Semantics) {}
+  APFloat(const fltSemantics &Semantics, StringRef S);
+  APFloat(const fltSemantics &Semantics, integerPart I) : U(Semantics, I) {}
+
+  APFloat(const fltSemantics &Semantics, uninitializedTag)
+      : U(Semantics, uninitialized) {}
+  APFloat(const fltSemantics &Semantics, const APInt &I) : U(Semantics, I) {}
+  explicit APFloat(double d) : U(IEEEFloat(d), IEEEdouble()) {}
+  explicit APFloat(float f) : U(IEEEFloat(f), IEEEsingle()) {}
+  APFloat(const APFloat &RHS) = default;
+  APFloat(APFloat &&RHS) = default;
+
+  ~APFloat() = default;
+
+  bool needsCleanup() const { do { if (usesLayout<IEEEFloat>(getSemantics())) return U.IEEE.needsCleanup(); if (usesLayout<DoubleAPFloat>(getSemantics())) return U.Double.needsCleanup(); ::llvm::llvm_unreachable_internal("Unexpected semantics", "/home/trippels/llvm/llvm/include/llvm/ADT/APFloat.h", 850); } while (false); }
+
+
+
+
+  static APFloat getZero(const fltSemantics &Sem, bool Negative = false) {
+    APFloat Val(Sem, uninitialized);
+    Val.makeZero(Negative);
+    return Val;
+  }
+
+
+
+
+  static APFloat getInf(const fltSemantics &Sem, bool Negative = false) {
+    APFloat Val(Sem, uninitialized);
+    Val.makeInf(Negative);
+    return Val;
+  }
+
+
+
+
+
+
+  static APFloat getNaN(const fltSemantics &Sem, bool Negative = false,
+                        unsigned type = 0) {
+    if (type) {
+      APInt fill(64, type);
+      return getQNaN(Sem, Negative, &fill);
+    } else {
+      return getQNaN(Sem, Negative, nullptr);
+    }
+  }
+
+
+  static APFloat getQNaN(const fltSemantics &Sem, bool Negative = false,
+                         const APInt *payload = nullptr) {
+    APFloat Val(Sem, uninitialized);
+    Val.makeNaN(false, Negative, payload);
+    return Val;
+  }
+
+
+  static APFloat getSNaN(const fltSemantics &Sem, bool Negative = false,
+                         const APInt *payload = nullptr) {
+    APFloat Val(Sem, uninitialized);
+    Val.makeNaN(true, Negative, payload);
+    return Val;
+  }
+
+
+
+
+  static APFloat getLargest(const fltSemantics &Sem, bool Negative = false) {
+    APFloat Val(Sem, uninitialized);
+    Val.makeLargest(Negative);
+    return Val;
+  }
+
+
+
+
+
+  static APFloat getSmallest(const fltSemantics &Sem, bool Negative = false) {
+    APFloat Val(Sem, uninitialized);
+    Val.makeSmallest(Negative);
+    return Val;
+  }
+
+
+
+
+
+  static APFloat getSmallestNormalized(const fltSemantics &Sem,
+                                       bool Negative = false) {
+    APFloat Val(Sem, uninitialized);
+    Val.makeSmallestNormalized(Negative);
+    return Val;
+  }
+
+
+
+
+
+  static APFloat getAllOnesValue(unsigned BitWidth, bool isIEEE = false);
+
+
+
+  void Profile(FoldingSetNodeID &NID) const;
+
+  opStatus add(const APFloat &RHS, roundingMode RM) {
+    
+   ((
+   &getSemantics() == &RHS.getSemantics() && "Should only call on two APFloats with the same semantics"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "&getSemantics() == &RHS.getSemantics() && \"Should only call on two APFloats with the same semantics\""
+   ,
+                                                                     "/home/trippels/llvm/llvm/include/llvm/ADT/APFloat.h"
+    ,
+                                                                     943
+    , __PRETTY_FUNCTION__))
+                                                                      
+                                                                     ;
+    if (usesLayout<IEEEFloat>(getSemantics()))
+      return U.IEEE.add(RHS.U.IEEE, RM);
+    if (usesLayout<DoubleAPFloat>(getSemantics()))
+      return U.Double.add(RHS.U.Double, RM);
+    ::llvm::llvm_unreachable_internal("Unexpected semantics", "/home/trippels/llvm/llvm/include/llvm/ADT/APFloat.h", 948);
+  }
+  opStatus subtract(const APFloat &RHS, roundingMode RM) {
+    
+   ((
+   &getSemantics() == &RHS.getSemantics() && "Should only call on two APFloats with the same semantics"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "&getSemantics() == &RHS.getSemantics() && \"Should only call on two APFloats with the same semantics\""
+   ,
+                                                                     "/home/trippels/llvm/llvm/include/llvm/ADT/APFloat.h"
+    ,
+                                                                     952
+    , __PRETTY_FUNCTION__))
+                                                                      
+                                                                     ;
+    if (usesLayout<IEEEFloat>(getSemantics()))
+      return U.IEEE.subtract(RHS.U.IEEE, RM);
+    if (usesLayout<DoubleAPFloat>(getSemantics()))
+      return U.Double.subtract(RHS.U.Double, RM);
+    ::llvm::llvm_unreachable_internal("Unexpected semantics", "/home/trippels/llvm/llvm/include/llvm/ADT/APFloat.h", 957);
+  }
+  opStatus multiply(const APFloat &RHS, roundingMode RM) {
+    
+   ((
+   &getSemantics() == &RHS.getSemantics() && "Should only call on two APFloats with the same semantics"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "&getSemantics() == &RHS.getSemantics() && \"Should only call on two APFloats with the same semantics\""
+   ,
+                                                                     "/home/trippels/llvm/llvm/include/llvm/ADT/APFloat.h"
+    ,
+                                                                     961
+    , __PRETTY_FUNCTION__))
+                                                                      
+                                                                     ;
+    if (usesLayout<IEEEFloat>(getSemantics()))
+      return U.IEEE.multiply(RHS.U.IEEE, RM);
+    if (usesLayout<DoubleAPFloat>(getSemantics()))
+      return U.Double.multiply(RHS.U.Double, RM);
+    ::llvm::llvm_unreachable_internal("Unexpected semantics", "/home/trippels/llvm/llvm/include/llvm/ADT/APFloat.h", 966);
+  }
+  opStatus divide(const APFloat &RHS, roundingMode RM) {
+    
+   ((
+   &getSemantics() == &RHS.getSemantics() && "Should only call on two APFloats with the same semantics"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "&getSemantics() == &RHS.getSemantics() && \"Should only call on two APFloats with the same semantics\""
+   ,
+                                                                     "/home/trippels/llvm/llvm/include/llvm/ADT/APFloat.h"
+    ,
+                                                                     970
+    , __PRETTY_FUNCTION__))
+                                                                      
+                                                                     ;
+    if (usesLayout<IEEEFloat>(getSemantics()))
+      return U.IEEE.divide(RHS.U.IEEE, RM);
+    if (usesLayout<DoubleAPFloat>(getSemantics()))
+      return U.Double.divide(RHS.U.Double, RM);
+    ::llvm::llvm_unreachable_internal("Unexpected semantics", "/home/trippels/llvm/llvm/include/llvm/ADT/APFloat.h", 975);
+  }
+  opStatus remainder(const APFloat &RHS) {
+    
+   ((
+   &getSemantics() == &RHS.getSemantics() && "Should only call on two APFloats with the same semantics"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "&getSemantics() == &RHS.getSemantics() && \"Should only call on two APFloats with the same semantics\""
+   ,
+                                                                     "/home/trippels/llvm/llvm/include/llvm/ADT/APFloat.h"
+    ,
+                                                                     979
+    , __PRETTY_FUNCTION__))
+                                                                      
+                                                                     ;
+    if (usesLayout<IEEEFloat>(getSemantics()))
+      return U.IEEE.remainder(RHS.U.IEEE);
+    if (usesLayout<DoubleAPFloat>(getSemantics()))
+      return U.Double.remainder(RHS.U.Double);
+    ::llvm::llvm_unreachable_internal("Unexpected semantics", "/home/trippels/llvm/llvm/include/llvm/ADT/APFloat.h", 984);
+  }
+  opStatus mod(const APFloat &RHS) {
+    
+   ((
+   &getSemantics() == &RHS.getSemantics() && "Should only call on two APFloats with the same semantics"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "&getSemantics() == &RHS.getSemantics() && \"Should only call on two APFloats with the same semantics\""
+   ,
+                                                                     "/home/trippels/llvm/llvm/include/llvm/ADT/APFloat.h"
+    ,
+                                                                     988
+    , __PRETTY_FUNCTION__))
+                                                                      
+                                                                     ;
+    if (usesLayout<IEEEFloat>(getSemantics()))
+      return U.IEEE.mod(RHS.U.IEEE);
+    if (usesLayout<DoubleAPFloat>(getSemantics()))
+      return U.Double.mod(RHS.U.Double);
+    ::llvm::llvm_unreachable_internal("Unexpected semantics", "/home/trippels/llvm/llvm/include/llvm/ADT/APFloat.h", 993);
+  }
+  opStatus fusedMultiplyAdd(const APFloat &Multiplicand, const APFloat &Addend,
+                            roundingMode RM) {
+    
+   ((
+   &getSemantics() == &Multiplicand.getSemantics() && "Should only call on APFloats with the same semantics"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "&getSemantics() == &Multiplicand.getSemantics() && \"Should only call on APFloats with the same semantics\""
+   ,
+                                                                 "/home/trippels/llvm/llvm/include/llvm/ADT/APFloat.h"
+    ,
+                                                                 998
+    , __PRETTY_FUNCTION__))
+                                                                  
+                                                                 ;
+    
+   ((
+   &getSemantics() == &Addend.getSemantics() && "Should only call on APFloats with the same semantics"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "&getSemantics() == &Addend.getSemantics() && \"Should only call on APFloats with the same semantics\""
+   ,
+                                                                 "/home/trippels/llvm/llvm/include/llvm/ADT/APFloat.h"
+    ,
+                                                                 1000
+    , __PRETTY_FUNCTION__))
+                                                                  
+                                                                 ;
+    if (usesLayout<IEEEFloat>(getSemantics()))
+      return U.IEEE.fusedMultiplyAdd(Multiplicand.U.IEEE, Addend.U.IEEE, RM);
+    if (usesLayout<DoubleAPFloat>(getSemantics()))
+      return U.Double.fusedMultiplyAdd(Multiplicand.U.Double, Addend.U.Double,
+                                       RM);
+    ::llvm::llvm_unreachable_internal("Unexpected semantics", "/home/trippels/llvm/llvm/include/llvm/ADT/APFloat.h", 1006);
+  }
+  opStatus roundToIntegral(roundingMode RM) {
+    do { if (usesLayout<IEEEFloat>(getSemantics())) return U.IEEE.roundToIntegral(RM); if (usesLayout<DoubleAPFloat>(getSemantics())) return U.Double.roundToIntegral(RM); ::llvm::llvm_unreachable_internal("Unexpected semantics", "/home/trippels/llvm/llvm/include/llvm/ADT/APFloat.h", 1009); } while (false);
+  }
+
+
+
+  opStatus next(bool nextDown) {
+    do { if (usesLayout<IEEEFloat>(getSemantics())) return U.IEEE.next(nextDown); if (usesLayout<DoubleAPFloat>(getSemantics())) return U.Double.next(nextDown); ::llvm::llvm_unreachable_internal("Unexpected semantics", "/home/trippels/llvm/llvm/include/llvm/ADT/APFloat.h", 1015); } while (false);
+  }
+
+
+
+  APFloat operator+(const APFloat &RHS) const {
+    APFloat Result(*this);
+    (void)Result.add(RHS, rmNearestTiesToEven);
+    return Result;
+  }
+
+
+
+  APFloat operator-(const APFloat &RHS) const {
+    APFloat Result(*this);
+    (void)Result.subtract(RHS, rmNearestTiesToEven);
+    return Result;
+  }
+
+
+
+  APFloat operator*(const APFloat &RHS) const {
+    APFloat Result(*this);
+    (void)Result.multiply(RHS, rmNearestTiesToEven);
+    return Result;
+  }
+
+
+
+  APFloat operator/(const APFloat &RHS) const {
+    APFloat Result(*this);
+    (void)Result.divide(RHS, rmNearestTiesToEven);
+    return Result;
+  }
+
+  void changeSign() { do { if (usesLayout<IEEEFloat>(getSemantics())) return U.IEEE.changeSign(); if (usesLayout<DoubleAPFloat>(getSemantics())) return U.Double.changeSign(); ::llvm::llvm_unreachable_internal("Unexpected semantics", "/home/trippels/llvm/llvm/include/llvm/ADT/APFloat.h", 1050); } while (false); }
+  void clearSign() {
+    if (isNegative())
+      changeSign();
+  }
+  void copySign(const APFloat &RHS) {
+    if (isNegative() != RHS.isNegative())
+      changeSign();
+  }
+
+
+
+  static APFloat copySign(APFloat Value, const APFloat &Sign) {
+    Value.copySign(Sign);
+    return Value;
+  }
+
+  opStatus convert(const fltSemantics &ToSemantics, roundingMode RM,
+                   bool *losesInfo);
+  opStatus convertToInteger(MutableArrayRef<integerPart> Input,
+                            unsigned int Width, bool IsSigned, roundingMode RM,
+                            bool *IsExact) const {
+    do { if (usesLayout<IEEEFloat>(getSemantics())) return U.IEEE.convertToInteger(Input, Width, IsSigned, RM, IsExact); if (usesLayout<DoubleAPFloat>(getSemantics())) return U.Double.convertToInteger(Input, Width, IsSigned, RM, IsExact); ::llvm::llvm_unreachable_internal("Unexpected semantics",
+                                                             "/home/trippels/llvm/llvm/include/llvm/ADT/APFloat.h"
+    ,
+                                                             1073
+    ); } while (false)
+                                                              ;
+  }
+  opStatus convertToInteger(APSInt &Result, roundingMode RM,
+                            bool *IsExact) const;
+  opStatus convertFromAPInt(const APInt &Input, bool IsSigned,
+                            roundingMode RM) {
+    do { if (usesLayout<IEEEFloat>(getSemantics())) return U.IEEE.convertFromAPInt(Input, IsSigned, RM); if (usesLayout<DoubleAPFloat>(getSemantics())) return U.Double.convertFromAPInt(Input, IsSigned, RM); ::llvm::llvm_unreachable_internal("Unexpected semantics", "/home/trippels/llvm/llvm/include/llvm/ADT/APFloat.h", 1079); } while (false);
+  }
+  opStatus convertFromSignExtendedInteger(const integerPart *Input,
+                                          unsigned int InputSize, bool IsSigned,
+                                          roundingMode RM) {
+    do { if (usesLayout<IEEEFloat>(getSemantics())) return U.IEEE.convertFromSignExtendedInteger(Input, InputSize, IsSigned, RM); if (usesLayout<DoubleAPFloat>(getSemantics())) return U.Double.convertFromSignExtendedInteger(Input, InputSize, IsSigned, RM); ::llvm::llvm_unreachable_internal("Unexpected semantics",
+                                                                      "/home/trippels/llvm/llvm/include/llvm/ADT/APFloat.h"
+    ,
+                                                                      1085
+    ); } while (false)
+                                                                       ;
+  }
+  opStatus convertFromZeroExtendedInteger(const integerPart *Input,
+                                          unsigned int InputSize, bool IsSigned,
+                                          roundingMode RM) {
+    do { if (usesLayout<IEEEFloat>(getSemantics())) return U.IEEE.convertFromZeroExtendedInteger(Input, InputSize, IsSigned, RM); if (usesLayout<DoubleAPFloat>(getSemantics())) return U.Double.convertFromZeroExtendedInteger(Input, InputSize, IsSigned, RM); ::llvm::llvm_unreachable_internal("Unexpected semantics",
+                                                                      "/home/trippels/llvm/llvm/include/llvm/ADT/APFloat.h"
+    ,
+                                                                      1091
+    ); } while (false)
+                                                                       ;
+  }
+  opStatus convertFromString(StringRef, roundingMode);
+  APInt bitcastToAPInt() const {
+    do { if (usesLayout<IEEEFloat>(getSemantics())) return U.IEEE.bitcastToAPInt(); if (usesLayout<DoubleAPFloat>(getSemantics())) return U.Double.bitcastToAPInt(); ::llvm::llvm_unreachable_internal("Unexpected semantics", "/home/trippels/llvm/llvm/include/llvm/ADT/APFloat.h", 1095); } while (false);
+  }
+  double convertToDouble() const { return getIEEE().convertToDouble(); }
+  float convertToFloat() const { return getIEEE().convertToFloat(); }
+
+  bool operator==(const APFloat &) const = delete;
+
+  cmpResult compare(const APFloat &RHS) const {
+    
+   ((
+   &getSemantics() == &RHS.getSemantics() && "Should only compare APFloats with the same semantics"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "&getSemantics() == &RHS.getSemantics() && \"Should only compare APFloats with the same semantics\""
+   ,
+                                                                 "/home/trippels/llvm/llvm/include/llvm/ADT/APFloat.h"
+    ,
+                                                                 1104
+    , __PRETTY_FUNCTION__))
+                                                                  
+                                                                 ;
+    if (usesLayout<IEEEFloat>(getSemantics()))
+      return U.IEEE.compare(RHS.U.IEEE);
+    if (usesLayout<DoubleAPFloat>(getSemantics()))
+      return U.Double.compare(RHS.U.Double);
+    ::llvm::llvm_unreachable_internal("Unexpected semantics", "/home/trippels/llvm/llvm/include/llvm/ADT/APFloat.h", 1109);
+  }
+
+  bool bitwiseIsEqual(const APFloat &RHS) const {
+    if (&getSemantics() != &RHS.getSemantics())
+      return false;
+    if (usesLayout<IEEEFloat>(getSemantics()))
+      return U.IEEE.bitwiseIsEqual(RHS.U.IEEE);
+    if (usesLayout<DoubleAPFloat>(getSemantics()))
+      return U.Double.bitwiseIsEqual(RHS.U.Double);
+    ::llvm::llvm_unreachable_internal("Unexpected semantics", "/home/trippels/llvm/llvm/include/llvm/ADT/APFloat.h", 1119);
+  }
+  bool isExactlyValue(double V) const {
+    bool ignored;
+    APFloat Tmp(V);
+    Tmp.convert(getSemantics(), APFloat::rmNearestTiesToEven, &ignored);
+    return bitwiseIsEqual(Tmp);
+  }
+
+  unsigned int convertToHexString(char *DST, unsigned int HexDigits,
+                                  bool UpperCase, roundingMode RM) const {
+    do { if (usesLayout<IEEEFloat>(getSemantics())) return U.IEEE.convertToHexString(DST, HexDigits, UpperCase, RM); if (usesLayout<DoubleAPFloat>(getSemantics())) return U.Double.convertToHexString(DST, HexDigits, UpperCase, RM); ::llvm::llvm_unreachable_internal("Unexpected semantics",
+                                                         "/home/trippels/llvm/llvm/include/llvm/ADT/APFloat.h"
+    ,
+                                                         1140
+    ); } while (false)
+                                                          ;
+  }
+
+  bool isZero() const { return getCategory() == fcZero; }
+  bool isInfinity() const { return getCategory() == fcInfinity; }
+  bool isNaN() const { return getCategory() == fcNaN; }
+
+  bool isNegative() const { return getIEEE().isNegative(); }
+  bool isDenormal() const { do { if (usesLayout<IEEEFloat>(getSemantics())) return U.IEEE.isDenormal(); if (usesLayout<DoubleAPFloat>(getSemantics())) return U.Double.isDenormal(); ::llvm::llvm_unreachable_internal("Unexpected semantics", "/home/trippels/llvm/llvm/include/llvm/ADT/APFloat.h", 1148); } while (false); }
+  bool isSignaling() const { return getIEEE().isSignaling(); }
+
+  bool isNormal() const { return !isDenormal() && isFiniteNonZero(); }
+  bool isFinite() const { return !isNaN() && !isInfinity(); }
+
+  fltCategory getCategory() const { return getIEEE().getCategory(); }
+  const fltSemantics &getSemantics() const { return *U.semantics; }
+  bool isNonZero() const { return !isZero(); }
+  bool isFiniteNonZero() const { return isFinite() && !isZero(); }
+  bool isPosZero() const { return isZero() && !isNegative(); }
+  bool isNegZero() const { return isZero() && isNegative(); }
+  bool isSmallest() const { do { if (usesLayout<IEEEFloat>(getSemantics())) return U.IEEE.isSmallest(); if (usesLayout<DoubleAPFloat>(getSemantics())) return U.Double.isSmallest(); ::llvm::llvm_unreachable_internal("Unexpected semantics", "/home/trippels/llvm/llvm/include/llvm/ADT/APFloat.h", 1160); } while (false); }
+  bool isLargest() const { do { if (usesLayout<IEEEFloat>(getSemantics())) return U.IEEE.isLargest(); if (usesLayout<DoubleAPFloat>(getSemantics())) return U.Double.isLargest(); ::llvm::llvm_unreachable_internal("Unexpected semantics", "/home/trippels/llvm/llvm/include/llvm/ADT/APFloat.h", 1161); } while (false); }
+  bool isInteger() const { do { if (usesLayout<IEEEFloat>(getSemantics())) return U.IEEE.isInteger(); if (usesLayout<DoubleAPFloat>(getSemantics())) return U.Double.isInteger(); ::llvm::llvm_unreachable_internal("Unexpected semantics", "/home/trippels/llvm/llvm/include/llvm/ADT/APFloat.h", 1162); } while (false); }
+
+  APFloat &operator=(const APFloat &RHS) = default;
+  APFloat &operator=(APFloat &&RHS) = default;
+
+  void toString(SmallVectorImpl<char> &Str, unsigned FormatPrecision = 0,
+                unsigned FormatMaxPadding = 3, bool TruncateZero = true) const {
+    do { if (usesLayout<IEEEFloat>(getSemantics())) return U.IEEE.toString(Str, FormatPrecision, FormatMaxPadding, TruncateZero); if (usesLayout<DoubleAPFloat>(getSemantics())) return U.Double.toString(Str, FormatPrecision, FormatMaxPadding, TruncateZero); ::llvm::llvm_unreachable_internal("Unexpected semantics",
+                                                                      "/home/trippels/llvm/llvm/include/llvm/ADT/APFloat.h"
+    ,
+                                                                      1170
+    ); } while (false)
+                                                                       ;
+  }
+
+  void print(raw_ostream &) const;
+  void dump() const;
+
+  bool getExactInverse(APFloat *inv) const {
+    do { if (usesLayout<IEEEFloat>(getSemantics())) return U.IEEE.getExactInverse(inv); if (usesLayout<DoubleAPFloat>(getSemantics())) return U.Double.getExactInverse(inv); ::llvm::llvm_unreachable_internal("Unexpected semantics", "/home/trippels/llvm/llvm/include/llvm/ADT/APFloat.h", 1177); } while (false);
+  }
+
+  friend hash_code hash_value(const APFloat &Arg);
+  friend int ilogb(const APFloat &Arg) { return ilogb(Arg.getIEEE()); }
+  friend APFloat scalbn(APFloat X, int Exp, roundingMode RM);
+  friend APFloat frexp(const APFloat &X, int &Exp, roundingMode RM);
+  friend IEEEFloat;
+  friend DoubleAPFloat;
+};
+
+
+
+
+
+hash_code hash_value(const APFloat &Arg);
+inline APFloat scalbn(APFloat X, int Exp, APFloat::roundingMode RM) {
+  if (APFloat::usesLayout<detail::IEEEFloat>(X.getSemantics()))
+    return APFloat(scalbn(X.U.IEEE, Exp, RM), X.getSemantics());
+  if (APFloat::usesLayout<detail::DoubleAPFloat>(X.getSemantics()))
+    return APFloat(scalbn(X.U.Double, Exp, RM), X.getSemantics());
+  ::llvm::llvm_unreachable_internal("Unexpected semantics", "/home/trippels/llvm/llvm/include/llvm/ADT/APFloat.h", 1198);
+}
+
+
+
+
+
+inline APFloat frexp(const APFloat &X, int &Exp, APFloat::roundingMode RM) {
+  if (APFloat::usesLayout<detail::IEEEFloat>(X.getSemantics()))
+    return APFloat(frexp(X.U.IEEE, Exp, RM), X.getSemantics());
+  if (APFloat::usesLayout<detail::DoubleAPFloat>(X.getSemantics()))
+    return APFloat(frexp(X.U.Double, Exp, RM), X.getSemantics());
+  ::llvm::llvm_unreachable_internal("Unexpected semantics", "/home/trippels/llvm/llvm/include/llvm/ADT/APFloat.h", 1210);
+}
+
+inline APFloat abs(APFloat X) {
+  X.clearSign();
+  return X;
+}
+
+
+inline APFloat neg(APFloat X) {
+  X.changeSign();
+  return X;
+}
+
+
+
+__attribute__((__pure__))
+inline APFloat minnum(const APFloat &A, const APFloat &B) {
+  if (A.isNaN())
+    return B;
+  if (B.isNaN())
+    return A;
+  return (B.compare(A) == APFloat::cmpLessThan) ? B : A;
+}
+
+
+
+__attribute__((__pure__))
+inline APFloat maxnum(const APFloat &A, const APFloat &B) {
+  if (A.isNaN())
+    return B;
+  if (B.isNaN())
+    return A;
+  return (A.compare(B) == APFloat::cmpLessThan) ? B : A;
+}
+
+}
+
+
+
+
+
+
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+namespace llvm {
+
+template<class GraphType> struct GraphTraits;
+class IntegerType;
+class LLVMContext;
+class PointerType;
+class raw_ostream;
+class StringRef;
+class Type {
+public:
+
+
+
+
+
+
+
+  enum TypeID {
+
+    VoidTyID = 0,
+    HalfTyID,
+    FloatTyID,
+    DoubleTyID,
+    X86_FP80TyID,
+    FP128TyID,
+    PPC_FP128TyID,
+    LabelTyID,
+    MetadataTyID,
+    X86_MMXTyID,
+    TokenTyID,
+
+
+
+    IntegerTyID,
+    FunctionTyID,
+    StructTyID,
+    ArrayTyID,
+    PointerTyID,
+    VectorTyID
+  };
+
+private:
+
+  LLVMContext &Context;
+
+  TypeID ID : 8;
+  unsigned SubclassData : 24;
+
+
+
+protected:
+  friend class LLVMContextImpl;
+
+  explicit Type(LLVMContext &C, TypeID tid)
+    : Context(C), ID(tid), SubclassData(0) {}
+  ~Type() = default;
+
+  unsigned getSubclassData() const { return SubclassData; }
+
+  void setSubclassData(unsigned val) {
+    SubclassData = val;
+
+    
+   ((
+   getSubclassData() == val && "Subclass data too large for field"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "getSubclassData() == val && \"Subclass data too large for field\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Type.h", 100, __PRETTY_FUNCTION__))
+                                                                          ;
+  }
+
+
+  unsigned NumContainedTys = 0;
+
+
+
+
+
+
+  Type * const *ContainedTys = nullptr;
+
+  static bool isSequentialType(TypeID TyID) {
+    return TyID == ArrayTyID || TyID == VectorTyID;
+  }
+
+public:
+
+
+
+
+
+
+  void print(raw_ostream &O, bool IsForDebug = false,
+             bool NoDetails = false) const;
+
+  void dump() const;
+
+
+  LLVMContext &getContext() const { return Context; }
+
+
+
+
+
+
+
+  TypeID getTypeID() const { return ID; }
+
+
+  bool isVoidTy() const { return getTypeID() == VoidTyID; }
+
+
+  bool isHalfTy() const { return getTypeID() == HalfTyID; }
+
+
+  bool isFloatTy() const { return getTypeID() == FloatTyID; }
+
+
+  bool isDoubleTy() const { return getTypeID() == DoubleTyID; }
+
+
+  bool isX86_FP80Ty() const { return getTypeID() == X86_FP80TyID; }
+
+
+  bool isFP128Ty() const { return getTypeID() == FP128TyID; }
+
+
+  bool isPPC_FP128Ty() const { return getTypeID() == PPC_FP128TyID; }
+
+
+  bool isFloatingPointTy() const {
+    return getTypeID() == HalfTyID || getTypeID() == FloatTyID ||
+           getTypeID() == DoubleTyID ||
+           getTypeID() == X86_FP80TyID || getTypeID() == FP128TyID ||
+           getTypeID() == PPC_FP128TyID;
+  }
+
+  const fltSemantics &getFltSemantics() const {
+    switch (getTypeID()) {
+    case HalfTyID: return APFloat::IEEEhalf();
+    case FloatTyID: return APFloat::IEEEsingle();
+    case DoubleTyID: return APFloat::IEEEdouble();
+    case X86_FP80TyID: return APFloat::x87DoubleExtended();
+    case FP128TyID: return APFloat::IEEEquad();
+    case PPC_FP128TyID: return APFloat::PPCDoubleDouble();
+    default: ::llvm::llvm_unreachable_internal("Invalid floating type", "/home/trippels/llvm/llvm/include/llvm/IR/Type.h", 177);
+    }
+  }
+
+
+  bool isX86_MMXTy() const { return getTypeID() == X86_MMXTyID; }
+
+
+  bool isFPOrFPVectorTy() const { return getScalarType()->isFloatingPointTy(); }
+
+
+  bool isLabelTy() const { return getTypeID() == LabelTyID; }
+
+
+  bool isMetadataTy() const { return getTypeID() == MetadataTyID; }
+
+
+  bool isTokenTy() const { return getTypeID() == TokenTyID; }
+
+
+  bool isIntegerTy() const { return getTypeID() == IntegerTyID; }
+
+
+  bool isIntegerTy(unsigned Bitwidth) const;
+
+
+  bool isIntOrIntVectorTy() const { return getScalarType()->isIntegerTy(); }
+
+
+
+  bool isIntOrIntVectorTy(unsigned BitWidth) const {
+    return getScalarType()->isIntegerTy(BitWidth);
+  }
+
+
+  bool isFunctionTy() const { return getTypeID() == FunctionTyID; }
+
+
+  bool isStructTy() const { return getTypeID() == StructTyID; }
+
+
+  bool isArrayTy() const { return getTypeID() == ArrayTyID; }
+
+
+  bool isPointerTy() const { return getTypeID() == PointerTyID; }
+
+
+  bool isPtrOrPtrVectorTy() const { return getScalarType()->isPointerTy(); }
+
+
+  bool isVectorTy() const { return getTypeID() == VectorTyID; }
+
+
+
+
+
+  bool canLosslesslyBitCastTo(Type *Ty) const;
+
+
+
+  bool isEmptyTy() const;
+
+
+
+  bool isFirstClassType() const {
+    return getTypeID() != FunctionTyID && getTypeID() != VoidTyID;
+  }
+
+
+
+  bool isSingleValueType() const {
+    return isFloatingPointTy() || isX86_MMXTy() || isIntegerTy() ||
+           isPointerTy() || isVectorTy();
+  }
+
+
+
+
+  bool isAggregateType() const {
+    return getTypeID() == StructTyID || getTypeID() == ArrayTyID;
+  }
+
+
+
+
+  bool isSized(SmallPtrSetImpl<Type*> *Visited = nullptr) const {
+
+    if (getTypeID() == IntegerTyID || isFloatingPointTy() ||
+        getTypeID() == PointerTyID ||
+        getTypeID() == X86_MMXTyID)
+      return true;
+
+
+    if (getTypeID() != StructTyID && getTypeID() != ArrayTyID &&
+        getTypeID() != VectorTyID)
+      return false;
+
+    return isSizedDerivedType(Visited);
+  }
+  unsigned getPrimitiveSizeInBits() const __attribute__((__pure__));
+
+
+
+
+  unsigned getScalarSizeInBits() const __attribute__((__pure__));
+
+
+
+
+  int getFPMantissaWidth() const;
+
+
+
+  Type *getScalarType() const {
+    if (isVectorTy())
+      return getVectorElementType();
+    return const_cast<Type*>(this);
+  }
+
+
+
+
+  using subtype_iterator = Type * const *;
+
+  subtype_iterator subtype_begin() const { return ContainedTys; }
+  subtype_iterator subtype_end() const { return &ContainedTys[NumContainedTys];}
+  ArrayRef<Type*> subtypes() const {
+    return makeArrayRef(subtype_begin(), subtype_end());
+  }
+
+  using subtype_reverse_iterator = std::reverse_iterator<subtype_iterator>;
+
+  subtype_reverse_iterator subtype_rbegin() const {
+    return subtype_reverse_iterator(subtype_end());
+  }
+  subtype_reverse_iterator subtype_rend() const {
+    return subtype_reverse_iterator(subtype_begin());
+  }
+
+
+
+
+  Type *getContainedType(unsigned i) const {
+    
+   ((
+   i < NumContainedTys && "Index out of range!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "i < NumContainedTys && \"Index out of range!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Type.h", 331, __PRETTY_FUNCTION__))
+                                                       ;
+    return ContainedTys[i];
+  }
+
+
+  unsigned getNumContainedTypes() const { return NumContainedTys; }
+  inline unsigned getIntegerBitWidth() const;
+
+  inline Type *getFunctionParamType(unsigned i) const;
+  inline unsigned getFunctionNumParams() const;
+  inline bool isFunctionVarArg() const;
+
+  inline StringRef getStructName() const;
+  inline unsigned getStructNumElements() const;
+  inline Type *getStructElementType(unsigned N) const;
+
+  inline Type *getSequentialElementType() const {
+    
+   ((
+   isSequentialType(getTypeID()) && "Not a sequential type!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isSequentialType(getTypeID()) && \"Not a sequential type!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Type.h", 356, __PRETTY_FUNCTION__))
+                                                                    ;
+    return ContainedTys[0];
+  }
+
+  inline uint64_t getArrayNumElements() const;
+
+  Type *getArrayElementType() const {
+    
+   ((
+   getTypeID() == ArrayTyID
+   ) ? static_cast<void> (0) : __assert_fail (
+   "getTypeID() == ArrayTyID"
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Type.h", 363, __PRETTY_FUNCTION__))
+                                   ;
+    return ContainedTys[0];
+  }
+
+  inline unsigned getVectorNumElements() const;
+  Type *getVectorElementType() const {
+    
+   ((
+   getTypeID() == VectorTyID
+   ) ? static_cast<void> (0) : __assert_fail (
+   "getTypeID() == VectorTyID"
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Type.h", 369, __PRETTY_FUNCTION__))
+                                    ;
+    return ContainedTys[0];
+  }
+
+  Type *getPointerElementType() const {
+    
+   ((
+   getTypeID() == PointerTyID
+   ) ? static_cast<void> (0) : __assert_fail (
+   "getTypeID() == PointerTyID"
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Type.h", 374, __PRETTY_FUNCTION__))
+                                     ;
+    return ContainedTys[0];
+  }
+
+
+  inline unsigned getPointerAddressSpace() const;
+
+
+
+
+
+
+
+  static Type *getPrimitiveType(LLVMContext &C, TypeID IDNumber);
+
+
+
+
+  static Type *getVoidTy(LLVMContext &C);
+  static Type *getLabelTy(LLVMContext &C);
+  static Type *getHalfTy(LLVMContext &C);
+  static Type *getFloatTy(LLVMContext &C);
+  static Type *getDoubleTy(LLVMContext &C);
+  static Type *getMetadataTy(LLVMContext &C);
+  static Type *getX86_FP80Ty(LLVMContext &C);
+  static Type *getFP128Ty(LLVMContext &C);
+  static Type *getPPC_FP128Ty(LLVMContext &C);
+  static Type *getX86_MMXTy(LLVMContext &C);
+  static Type *getTokenTy(LLVMContext &C);
+  static IntegerType *getIntNTy(LLVMContext &C, unsigned N);
+  static IntegerType *getInt1Ty(LLVMContext &C);
+  static IntegerType *getInt8Ty(LLVMContext &C);
+  static IntegerType *getInt16Ty(LLVMContext &C);
+  static IntegerType *getInt32Ty(LLVMContext &C);
+  static IntegerType *getInt64Ty(LLVMContext &C);
+  static IntegerType *getInt128Ty(LLVMContext &C);
+
+
+
+
+
+  static PointerType *getHalfPtrTy(LLVMContext &C, unsigned AS = 0);
+  static PointerType *getFloatPtrTy(LLVMContext &C, unsigned AS = 0);
+  static PointerType *getDoublePtrTy(LLVMContext &C, unsigned AS = 0);
+  static PointerType *getX86_FP80PtrTy(LLVMContext &C, unsigned AS = 0);
+  static PointerType *getFP128PtrTy(LLVMContext &C, unsigned AS = 0);
+  static PointerType *getPPC_FP128PtrTy(LLVMContext &C, unsigned AS = 0);
+  static PointerType *getX86_MMXPtrTy(LLVMContext &C, unsigned AS = 0);
+  static PointerType *getIntNPtrTy(LLVMContext &C, unsigned N, unsigned AS = 0);
+  static PointerType *getInt1PtrTy(LLVMContext &C, unsigned AS = 0);
+  static PointerType *getInt8PtrTy(LLVMContext &C, unsigned AS = 0);
+  static PointerType *getInt16PtrTy(LLVMContext &C, unsigned AS = 0);
+  static PointerType *getInt32PtrTy(LLVMContext &C, unsigned AS = 0);
+  static PointerType *getInt64PtrTy(LLVMContext &C, unsigned AS = 0);
+
+
+
+  PointerType *getPointerTo(unsigned AddrSpace = 0) const;
+
+private:
+
+
+
+  bool isSizedDerivedType(SmallPtrSetImpl<Type*> *Visited = nullptr) const;
+};
+
+
+inline raw_ostream &operator<<(raw_ostream &OS, const Type &T) {
+  T.print(OS);
+  return OS;
+}
+
+
+template <> struct isa_impl<PointerType, Type> {
+  static inline bool doit(const Type &Ty) {
+    return Ty.getTypeID() == Type::PointerTyID;
+  }
+};
+
+
+
+
+
+template <> struct GraphTraits<Type *> {
+  using NodeRef = Type *;
+  using ChildIteratorType = Type::subtype_iterator;
+
+  static NodeRef getEntryNode(Type *T) { return T; }
+  static ChildIteratorType child_begin(NodeRef N) { return N->subtype_begin(); }
+  static ChildIteratorType child_end(NodeRef N) { return N->subtype_end(); }
+};
+
+template <> struct GraphTraits<const Type*> {
+  using NodeRef = const Type *;
+  using ChildIteratorType = Type::subtype_iterator;
+
+  static NodeRef getEntryNode(NodeRef T) { return T; }
+  static ChildIteratorType child_begin(NodeRef N) { return N->subtype_begin(); }
+  static ChildIteratorType child_end(NodeRef N) { return N->subtype_end(); }
+};
+
+
+inline Type *unwrap(LLVMTypeRef P) { return reinterpret_cast<Type*>(P); } inline LLVMTypeRef wrap(const Type *P) { return reinterpret_cast<LLVMTypeRef>(const_cast<Type*>(P)); } template<typename T> inline T *unwrap(LLVMTypeRef P) { return cast<T>(unwrap(P)); }
+
+
+
+inline Type **unwrap(LLVMTypeRef* Tys) {
+  return reinterpret_cast<Type**>(Tys);
+}
+
+inline LLVMTypeRef *wrap(Type **Tys) {
+  return reinterpret_cast<LLVMTypeRef*>(const_cast<Type**>(Tys));
+}
+
+}
+
+
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+namespace llvm {
+
+class Value;
+class APInt;
+class LLVMContext;
+
+
+
+
+
+class IntegerType : public Type {
+  friend class LLVMContextImpl;
+
+protected:
+  explicit IntegerType(LLVMContext &C, unsigned NumBits) : Type(C, IntegerTyID){
+    setSubclassData(NumBits);
+  }
+
+public:
+
+  enum {
+    MIN_INT_BITS = 1,
+    MAX_INT_BITS = (1<<24)-1
+
+
+
+  };
+
+
+
+
+
+
+  static IntegerType *get(LLVMContext &C, unsigned NumBits);
+
+
+  unsigned getBitWidth() const { return getSubclassData(); }
+
+
+
+  uint64_t getBitMask() const {
+    return ~uint64_t(0UL) >> (64-getBitWidth());
+  }
+
+
+
+  uint64_t getSignBit() const {
+    return 1ULL << (getBitWidth()-1);
+  }
+
+
+
+
+  APInt getMask() const;
+
+
+
+
+
+  bool isPowerOf2ByteWidth() const;
+
+
+  static bool classof(const Type *T) {
+    return T->getTypeID() == IntegerTyID;
+  }
+};
+
+unsigned Type::getIntegerBitWidth() const {
+  return cast<IntegerType>(this)->getBitWidth();
+}
+
+
+
+class FunctionType : public Type {
+  FunctionType(Type *Result, ArrayRef<Type*> Params, bool IsVarArgs);
+
+public:
+  FunctionType(const FunctionType &) = delete;
+  FunctionType &operator=(const FunctionType &) = delete;
+
+
+  static FunctionType *get(Type *Result,
+                           ArrayRef<Type*> Params, bool isVarArg);
+
+
+  static FunctionType *get(Type *Result, bool isVarArg);
+
+
+  static bool isValidReturnType(Type *RetTy);
+
+
+  static bool isValidArgumentType(Type *ArgTy);
+
+  bool isVarArg() const { return getSubclassData()!=0; }
+  Type *getReturnType() const { return ContainedTys[0]; }
+
+  using param_iterator = Type::subtype_iterator;
+
+  param_iterator param_begin() const { return ContainedTys + 1; }
+  param_iterator param_end() const { return &ContainedTys[NumContainedTys]; }
+  ArrayRef<Type *> params() const {
+    return makeArrayRef(param_begin(), param_end());
+  }
+
+
+  Type *getParamType(unsigned i) const { return ContainedTys[i+1]; }
+
+
+
+  unsigned getNumParams() const { return NumContainedTys - 1; }
+
+
+  static bool classof(const Type *T) {
+    return T->getTypeID() == FunctionTyID;
+  }
+};
+static_assert(alignof(FunctionType) >= alignof(Type *),
+              "Alignment sufficient for objects appended to FunctionType");
+
+bool Type::isFunctionVarArg() const {
+  return cast<FunctionType>(this)->isVarArg();
+}
+
+Type *Type::getFunctionParamType(unsigned i) const {
+  return cast<FunctionType>(this)->getParamType(i);
+}
+
+unsigned Type::getFunctionNumParams() const {
+  return cast<FunctionType>(this)->getNumParams();
+}
+
+
+class CompositeType : public Type {
+protected:
+  explicit CompositeType(LLVMContext &C, TypeID tid) : Type(C, tid) {}
+
+public:
+
+  Type *getTypeAtIndex(const Value *V) const;
+  Type *getTypeAtIndex(unsigned Idx) const;
+  bool indexValid(const Value *V) const;
+  bool indexValid(unsigned Idx) const;
+
+
+  static bool classof(const Type *T) {
+    return T->getTypeID() == ArrayTyID ||
+           T->getTypeID() == StructTyID ||
+           T->getTypeID() == VectorTyID;
+  }
+};
+class StructType : public CompositeType {
+  StructType(LLVMContext &C) : CompositeType(C, StructTyID) {}
+
+  enum {
+
+    SCDB_HasBody = 1,
+    SCDB_Packed = 2,
+    SCDB_IsLiteral = 4,
+    SCDB_IsSized = 8
+  };
+
+
+
+
+
+  void *SymbolTableEntry = nullptr;
+
+public:
+  StructType(const StructType &) = delete;
+  StructType &operator=(const StructType &) = delete;
+
+
+  static StructType *create(LLVMContext &Context, StringRef Name);
+  static StructType *create(LLVMContext &Context);
+
+  static StructType *create(ArrayRef<Type *> Elements, StringRef Name,
+                            bool isPacked = false);
+  static StructType *create(ArrayRef<Type *> Elements);
+  static StructType *create(LLVMContext &Context, ArrayRef<Type *> Elements,
+                            StringRef Name, bool isPacked = false);
+  static StructType *create(LLVMContext &Context, ArrayRef<Type *> Elements);
+  template <class... Tys>
+  static typename std::enable_if<are_base_of<Type, Tys...>::value,
+                                 StructType *>::type
+  create(StringRef Name, Type *elt1, Tys *... elts) {
+    
+   ((
+   elt1 && "Cannot create a struct type with no elements with this"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "elt1 && \"Cannot create a struct type with no elements with this\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/DerivedTypes.h", 236, __PRETTY_FUNCTION__))
+                                                                           ;
+    SmallVector<llvm::Type *, 8> StructFields({elt1, elts...});
+    return create(StructFields, Name);
+  }
+
+
+  static StructType *get(LLVMContext &Context, ArrayRef<Type*> Elements,
+                         bool isPacked = false);
+
+
+  static StructType *get(LLVMContext &Context, bool isPacked = false);
+
+
+
+
+  template <class... Tys>
+  static typename std::enable_if<are_base_of<Type, Tys...>::value,
+                                 StructType *>::type
+  get(Type *elt1, Tys *... elts) {
+    
+   ((
+   elt1 && "Cannot create a struct type with no elements with this"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "elt1 && \"Cannot create a struct type with no elements with this\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/DerivedTypes.h", 255, __PRETTY_FUNCTION__))
+                                                                           ;
+    LLVMContext &Ctx = elt1->getContext();
+    SmallVector<llvm::Type *, 8> StructFields({elt1, elts...});
+    return llvm::StructType::get(Ctx, StructFields);
+  }
+
+  bool isPacked() const { return (getSubclassData() & SCDB_Packed) != 0; }
+
+
+
+  bool isLiteral() const { return (getSubclassData() & SCDB_IsLiteral) != 0; }
+
+
+
+  bool isOpaque() const { return (getSubclassData() & SCDB_HasBody) == 0; }
+
+
+  bool isSized(SmallPtrSetImpl<Type *> *Visited = nullptr) const;
+
+
+  bool hasName() const { return SymbolTableEntry != nullptr; }
+
+
+
+
+  StringRef getName() const;
+
+
+
+  void setName(StringRef Name);
+
+
+  void setBody(ArrayRef<Type*> Elements, bool isPacked = false);
+
+  template <typename... Tys>
+  typename std::enable_if<are_base_of<Type, Tys...>::value, void>::type
+  setBody(Type *elt1, Tys *... elts) {
+    
+   ((
+   elt1 && "Cannot create a struct type with no elements with this"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "elt1 && \"Cannot create a struct type with no elements with this\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/DerivedTypes.h", 292, __PRETTY_FUNCTION__))
+                                                                           ;
+    SmallVector<llvm::Type *, 8> StructFields({elt1, elts...});
+    setBody(StructFields);
+  }
+
+
+  static bool isValidElementType(Type *ElemTy);
+
+
+  using element_iterator = Type::subtype_iterator;
+
+  element_iterator element_begin() const { return ContainedTys; }
+  element_iterator element_end() const { return &ContainedTys[NumContainedTys];}
+  ArrayRef<Type *> const elements() const {
+    return makeArrayRef(element_begin(), element_end());
+  }
+
+
+  bool isLayoutIdentical(StructType *Other) const;
+
+
+  unsigned getNumElements() const { return NumContainedTys; }
+  Type *getElementType(unsigned N) const {
+    
+   ((
+   N < NumContainedTys && "Element number out of range!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "N < NumContainedTys && \"Element number out of range!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/DerivedTypes.h", 315, __PRETTY_FUNCTION__))
+                                                                ;
+    return ContainedTys[N];
+  }
+
+
+  static bool classof(const Type *T) {
+    return T->getTypeID() == StructTyID;
+  }
+};
+
+StringRef Type::getStructName() const {
+  return cast<StructType>(this)->getName();
+}
+
+unsigned Type::getStructNumElements() const {
+  return cast<StructType>(this)->getNumElements();
+}
+
+Type *Type::getStructElementType(unsigned N) const {
+  return cast<StructType>(this)->getElementType(N);
+}
+
+
+
+
+
+
+
+class SequentialType : public CompositeType {
+  Type *ContainedType;
+  uint64_t NumElements;
+
+protected:
+  SequentialType(TypeID TID, Type *ElType, uint64_t NumElements)
+    : CompositeType(ElType->getContext(), TID), ContainedType(ElType),
+      NumElements(NumElements) {
+    ContainedTys = &ContainedType;
+    NumContainedTys = 1;
+  }
+
+public:
+  SequentialType(const SequentialType &) = delete;
+  SequentialType &operator=(const SequentialType &) = delete;
+
+  uint64_t getNumElements() const { return NumElements; }
+  Type *getElementType() const { return ContainedType; }
+
+
+  static bool classof(const Type *T) {
+    return T->getTypeID() == ArrayTyID || T->getTypeID() == VectorTyID;
+  }
+};
+
+
+class ArrayType : public SequentialType {
+  ArrayType(Type *ElType, uint64_t NumEl);
+
+public:
+  ArrayType(const ArrayType &) = delete;
+  ArrayType &operator=(const ArrayType &) = delete;
+
+
+  static ArrayType *get(Type *ElementType, uint64_t NumElements);
+
+
+  static bool isValidElementType(Type *ElemTy);
+
+
+  static bool classof(const Type *T) {
+    return T->getTypeID() == ArrayTyID;
+  }
+};
+
+uint64_t Type::getArrayNumElements() const {
+  return cast<ArrayType>(this)->getNumElements();
+}
+
+
+class VectorType : public SequentialType {
+  VectorType(Type *ElType, unsigned NumEl);
+
+public:
+  VectorType(const VectorType &) = delete;
+  VectorType &operator=(const VectorType &) = delete;
+
+
+  static VectorType *get(Type *ElementType, unsigned NumElements);
+
+
+
+
+  static VectorType *getInteger(VectorType *VTy) {
+    unsigned EltBits = VTy->getElementType()->getPrimitiveSizeInBits();
+    
+   ((
+   EltBits && "Element size must be of a non-zero size"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "EltBits && \"Element size must be of a non-zero size\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/DerivedTypes.h", 408, __PRETTY_FUNCTION__))
+                                                               ;
+    Type *EltTy = IntegerType::get(VTy->getContext(), EltBits);
+    return VectorType::get(EltTy, VTy->getNumElements());
+  }
+
+
+
+  static VectorType *getExtendedElementVectorType(VectorType *VTy) {
+    unsigned EltBits = VTy->getElementType()->getPrimitiveSizeInBits();
+    Type *EltTy = IntegerType::get(VTy->getContext(), EltBits * 2);
+    return VectorType::get(EltTy, VTy->getNumElements());
+  }
+
+
+
+  static VectorType *getTruncatedElementVectorType(VectorType *VTy) {
+    unsigned EltBits = VTy->getElementType()->getPrimitiveSizeInBits();
+    
+   ((
+   (EltBits & 1) == 0 && "Cannot truncate vector element with odd bit-width"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "(EltBits & 1) == 0 && \"Cannot truncate vector element with odd bit-width\""
+   ,
+                                                              "/home/trippels/llvm/llvm/include/llvm/IR/DerivedTypes.h"
+    ,
+                                                              426
+    , __PRETTY_FUNCTION__))
+                                                               
+                                                              ;
+    Type *EltTy = IntegerType::get(VTy->getContext(), EltBits / 2);
+    return VectorType::get(EltTy, VTy->getNumElements());
+  }
+
+
+
+  static VectorType *getHalfElementsVectorType(VectorType *VTy) {
+    unsigned NumElts = VTy->getNumElements();
+    
+   ((
+   (NumElts & 1) == 0 && "Cannot halve vector with odd number of elements."
+   ) ? static_cast<void> (0) : __assert_fail (
+   "(NumElts & 1) == 0 && \"Cannot halve vector with odd number of elements.\""
+   ,
+                                                              "/home/trippels/llvm/llvm/include/llvm/IR/DerivedTypes.h"
+    ,
+                                                              436
+    , __PRETTY_FUNCTION__))
+                                                               
+                                                              ;
+    return VectorType::get(VTy->getElementType(), NumElts/2);
+  }
+
+
+
+  static VectorType *getDoubleElementsVectorType(VectorType *VTy) {
+    unsigned NumElts = VTy->getNumElements();
+    return VectorType::get(VTy->getElementType(), NumElts*2);
+  }
+
+
+  static bool isValidElementType(Type *ElemTy);
+
+
+
+  unsigned getBitWidth() const {
+    return getNumElements() * getElementType()->getPrimitiveSizeInBits();
+  }
+
+
+  static bool classof(const Type *T) {
+    return T->getTypeID() == VectorTyID;
+  }
+};
+
+unsigned Type::getVectorNumElements() const {
+  return cast<VectorType>(this)->getNumElements();
+}
+
+
+class PointerType : public Type {
+  explicit PointerType(Type *ElType, unsigned AddrSpace);
+
+  Type *PointeeTy;
+
+public:
+  PointerType(const PointerType &) = delete;
+  PointerType &operator=(const PointerType &) = delete;
+
+
+
+  static PointerType *get(Type *ElementType, unsigned AddressSpace);
+
+
+
+  static PointerType *getUnqual(Type *ElementType) {
+    return PointerType::get(ElementType, 0);
+  }
+
+  Type *getElementType() const { return PointeeTy; }
+
+
+  static bool isValidElementType(Type *ElemTy);
+
+
+  static bool isLoadableOrStorableType(Type *ElemTy);
+
+
+  inline unsigned getAddressSpace() const { return getSubclassData(); }
+
+
+  static bool classof(const Type *T) {
+    return T->getTypeID() == PointerTyID;
+  }
+};
+
+unsigned Type::getPointerAddressSpace() const {
+  return cast<PointerType>(getScalarType())->getAddressSpace();
+}
+
+}
+namespace llvm {
+
+
+
+template<unsigned InternalLen>
+class SmallString : public SmallVector<char, InternalLen> {
+public:
+
+  SmallString() = default;
+
+
+  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
+
+
+  template<typename ItTy>
+  SmallString(ItTy S, ItTy E) : SmallVector<char, InternalLen>(S, E) {}
+  void assign(size_t NumElts, char Elt) {
+    this->SmallVectorImpl<char>::assign(NumElts, Elt);
+  }
+
+
+  template<typename in_iter>
+  void assign(in_iter S, in_iter E) {
+    this->clear();
+    SmallVectorImpl<char>::append(S, E);
+  }
+
+
+  void assign(StringRef RHS) {
+    this->clear();
+    SmallVectorImpl<char>::append(RHS.begin(), RHS.end());
+  }
+
+
+  void assign(const SmallVectorImpl<char> &RHS) {
+    this->clear();
+    SmallVectorImpl<char>::append(RHS.begin(), RHS.end());
+  }
+
+
+
+
+
+
+  template<typename in_iter>
+  void append(in_iter S, in_iter E) {
+    SmallVectorImpl<char>::append(S, E);
+  }
+
+  void append(size_t NumInputs, char Elt) {
+    SmallVectorImpl<char>::append(NumInputs, Elt);
+  }
+
+
+  void append(StringRef RHS) {
+    SmallVectorImpl<char>::append(RHS.begin(), RHS.end());
+  }
+
+
+  void append(const SmallVectorImpl<char> &RHS) {
+    SmallVectorImpl<char>::append(RHS.begin(), RHS.end());
+  }
+
+
+
+
+
+
+
+  bool equals(StringRef RHS) const {
+    return str().equals(RHS);
+  }
+
+
+  bool equals_lower(StringRef RHS) const {
+    return str().equals_lower(RHS);
+  }
+
+
+
+  int compare(StringRef RHS) const {
+    return str().compare(RHS);
+  }
+
+
+  int compare_lower(StringRef RHS) const {
+    return str().compare_lower(RHS);
+  }
+
+
+
+  int compare_numeric(StringRef RHS) const {
+    return str().compare_numeric(RHS);
+  }
+
+
+
+
+
+
+  bool startswith(StringRef Prefix) const {
+    return str().startswith(Prefix);
+  }
+
+
+  bool endswith(StringRef Suffix) const {
+    return str().endswith(Suffix);
+  }
+  size_t find(char C, size_t From = 0) const {
+    return str().find(C, From);
+  }
+
+
+
+
+
+  size_t find(StringRef Str, size_t From = 0) const {
+    return str().find(Str, From);
+  }
+
+
+
+
+
+  size_t rfind(char C, size_t From = StringRef::npos) const {
+    return str().rfind(C, From);
+  }
+
+
+
+
+
+  size_t rfind(StringRef Str) const {
+    return str().rfind(Str);
+  }
+
+
+
+  size_t find_first_of(char C, size_t From = 0) const {
+    return str().find_first_of(C, From);
+  }
+
+
+
+
+
+  size_t find_first_of(StringRef Chars, size_t From = 0) const {
+    return str().find_first_of(Chars, From);
+  }
+
+
+
+  size_t find_first_not_of(char C, size_t From = 0) const {
+    return str().find_first_not_of(C, From);
+  }
+
+
+
+
+
+  size_t find_first_not_of(StringRef Chars, size_t From = 0) const {
+    return str().find_first_not_of(Chars, From);
+  }
+
+
+
+  size_t find_last_of(char C, size_t From = StringRef::npos) const {
+    return str().find_last_of(C, From);
+  }
+
+
+
+
+
+  size_t find_last_of(
+      StringRef Chars, size_t From = StringRef::npos) const {
+    return str().find_last_of(Chars, From);
+  }
+
+
+
+
+
+
+  size_t count(char C) const {
+    return str().count(C);
+  }
+
+
+
+  size_t count(StringRef Str) const {
+    return str().count(Str);
+  }
+  StringRef substr(size_t Start, size_t N = StringRef::npos) const {
+    return str().substr(Start, N);
+  }
+  StringRef slice(size_t Start, size_t End) const {
+    return str().slice(Start, End);
+  }
+
+
+
+
+  StringRef str() const { return StringRef(this->begin(), this->size()); }
+
+
+  const char* c_str() {
+    this->push_back(0);
+    this->pop_back();
+    return this->data();
+  }
+
+
+  operator StringRef() const { return str(); }
+
+
+  const SmallString &operator=(StringRef RHS) {
+    this->clear();
+    return *this += RHS;
+  }
+
+  SmallString &operator+=(StringRef RHS) {
+    this->append(RHS.begin(), RHS.end());
+    return *this;
+  }
+  SmallString &operator+=(char C) {
+    this->push_back(C);
+    return *this;
+  }
+};
+
+}
+
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+       
+
+
+
+namespace llvm {
+namespace support {
+
+enum endianness {big, little, native};
+
+
+enum {aligned = 0, unaligned = 1};
+
+namespace detail {
+
+
+template<class T, int alignment>
+struct PickAlignment {
+ enum { value = alignment == 0 ? alignof(T) : alignment };
+};
+
+}
+
+namespace endian {
+
+constexpr endianness system_endianness() {
+  return sys::IsBigEndianHost ? big : little;
+}
+
+template <typename value_type>
+inline value_type byte_swap(value_type value, endianness endian) {
+  if ((endian != native) && (endian != system_endianness()))
+    sys::swapByteOrder(value);
+  return value;
+}
+
+
+template<typename value_type, endianness endian>
+inline value_type byte_swap(value_type value) {
+  return byte_swap(value, endian);
+}
+
+
+template <typename value_type, std::size_t alignment>
+inline value_type read(const void *memory, endianness endian) {
+  value_type ret;
+
+  memcpy(&ret,
+         __builtin_assume_aligned(memory, (detail::PickAlignment<value_type, alignment>::value))
+                                                                           ,
+         sizeof(value_type));
+  return byte_swap<value_type>(ret, endian);
+}
+
+template<typename value_type,
+         endianness endian,
+         std::size_t alignment>
+inline value_type read(const void *memory) {
+  return read<value_type, alignment>(memory, endian);
+}
+
+
+
+template <typename value_type, std::size_t alignment, typename CharT>
+inline value_type readNext(const CharT *&memory, endianness endian) {
+  value_type ret = read<value_type, alignment>(memory, endian);
+  memory += sizeof(value_type);
+  return ret;
+}
+
+template<typename value_type, endianness endian, std::size_t alignment,
+         typename CharT>
+inline value_type readNext(const CharT *&memory) {
+  return readNext<value_type, alignment, CharT>(memory, endian);
+}
+
+
+template <typename value_type, std::size_t alignment>
+inline void write(void *memory, value_type value, endianness endian) {
+  value = byte_swap<value_type>(value, endian);
+  memcpy(__builtin_assume_aligned(memory, (detail::PickAlignment<value_type, alignment>::value))
+                                                                           ,
+         &value, sizeof(value_type));
+}
+
+template<typename value_type,
+         endianness endian,
+         std::size_t alignment>
+inline void write(void *memory, value_type value) {
+  write<value_type, alignment>(memory, value, endian);
+}
+
+template <typename value_type>
+using make_unsigned_t = typename std::make_unsigned<value_type>::type;
+
+
+
+template <typename value_type, endianness endian, std::size_t alignment>
+inline value_type readAtBitAlignment(const void *memory, uint64_t startBit) {
+  
+ ((
+ startBit < 8
+ ) ? static_cast<void> (0) : __assert_fail (
+ "startBit < 8"
+ , "/home/trippels/llvm/llvm/include/llvm/Support/Endian.h", 121, __PRETTY_FUNCTION__))
+                     ;
+  if (startBit == 0)
+    return read<value_type, endian, alignment>(memory);
+  else {
+
+    value_type val[2];
+    memcpy(&val[0],
+           __builtin_assume_aligned(memory, (detail::PickAlignment<value_type, alignment>::value))
+                                                                             ,
+           sizeof(value_type) * 2);
+    val[0] = byte_swap<value_type, endian>(val[0]);
+    val[1] = byte_swap<value_type, endian>(val[1]);
+
+
+    make_unsigned_t<value_type> lowerVal = val[0] >> startBit;
+
+    make_unsigned_t<value_type> numBitsFirstVal =
+        (sizeof(value_type) * 8) - startBit;
+    lowerVal &= ((make_unsigned_t<value_type>)1 << numBitsFirstVal) - 1;
+
+
+    make_unsigned_t<value_type> upperVal =
+        val[1] & (((make_unsigned_t<value_type>)1 << startBit) - 1);
+
+    upperVal <<= numBitsFirstVal;
+
+    return lowerVal | upperVal;
+  }
+}
+
+
+
+template <typename value_type, endianness endian, std::size_t alignment>
+inline void writeAtBitAlignment(void *memory, value_type value,
+                                uint64_t startBit) {
+  
+ ((
+ startBit < 8
+ ) ? static_cast<void> (0) : __assert_fail (
+ "startBit < 8"
+ , "/home/trippels/llvm/llvm/include/llvm/Support/Endian.h", 156, __PRETTY_FUNCTION__))
+                     ;
+  if (startBit == 0)
+    write<value_type, endian, alignment>(memory, value);
+  else {
+
+    value_type val[2];
+    memcpy(&val[0],
+           __builtin_assume_aligned(memory, (detail::PickAlignment<value_type, alignment>::value))
+                                                                             ,
+           sizeof(value_type) * 2);
+    val[0] = byte_swap<value_type, endian>(val[0]);
+    val[1] = byte_swap<value_type, endian>(val[1]);
+
+
+
+    val[0] &= ((make_unsigned_t<value_type>)1 << startBit) - 1;
+    make_unsigned_t<value_type> numBitsFirstVal =
+        (sizeof(value_type) * 8) - startBit;
+    make_unsigned_t<value_type> lowerVal = value;
+    if (startBit > 0) {
+
+
+
+      lowerVal &= (((make_unsigned_t<value_type>)1 << numBitsFirstVal) - 1);
+
+      lowerVal <<= startBit;
+    }
+    val[0] |= lowerVal;
+
+
+
+    val[1] &= ~(((make_unsigned_t<value_type>)1 << startBit) - 1);
+
+    make_unsigned_t<value_type> upperVal = value >> numBitsFirstVal;
+
+    upperVal &= ((make_unsigned_t<value_type>)1 << startBit) - 1;
+    val[1] |= upperVal;
+
+
+    val[0] = byte_swap<value_type, endian>(val[0]);
+    val[1] = byte_swap<value_type, endian>(val[1]);
+    memcpy(__builtin_assume_aligned(memory, (detail::PickAlignment<value_type, alignment>::value))
+                                                                             ,
+           &val[0], sizeof(value_type) * 2);
+  }
+}
+
+}
+
+namespace detail {
+
+template<typename value_type,
+         endianness endian,
+         std::size_t alignment>
+struct packed_endian_specific_integral {
+  packed_endian_specific_integral() = default;
+
+  explicit packed_endian_specific_integral(value_type val) { *this = val; }
+
+  operator value_type() const {
+    return endian::read<value_type, endian, alignment>(
+      (const void*)Value.buffer);
+  }
+
+  void operator=(value_type newValue) {
+    endian::write<value_type, endian, alignment>(
+      (void*)Value.buffer, newValue);
+  }
+
+  packed_endian_specific_integral &operator+=(value_type newValue) {
+    *this = *this + newValue;
+    return *this;
+  }
+
+  packed_endian_specific_integral &operator-=(value_type newValue) {
+    *this = *this - newValue;
+    return *this;
+  }
+
+  packed_endian_specific_integral &operator|=(value_type newValue) {
+    *this = *this | newValue;
+    return *this;
+  }
+
+  packed_endian_specific_integral &operator&=(value_type newValue) {
+    *this = *this & newValue;
+    return *this;
+  }
+
+private:
+  AlignedCharArray<PickAlignment<value_type, alignment>::value,
+                   sizeof(value_type)> Value;
+
+public:
+  struct ref {
+    explicit ref(void *Ptr) : Ptr(Ptr) {}
+
+    operator value_type() const {
+      return endian::read<value_type, endian, alignment>(Ptr);
+    }
+
+    void operator=(value_type NewValue) {
+      endian::write<value_type, endian, alignment>(Ptr, NewValue);
+    }
+
+  private:
+    void *Ptr;
+  };
+};
+
+}
+
+using ulittle16_t =
+    detail::packed_endian_specific_integral<uint16_t, little, unaligned>;
+using ulittle32_t =
+    detail::packed_endian_specific_integral<uint32_t, little, unaligned>;
+using ulittle64_t =
+    detail::packed_endian_specific_integral<uint64_t, little, unaligned>;
+
+using little16_t =
+    detail::packed_endian_specific_integral<int16_t, little, unaligned>;
+using little32_t =
+    detail::packed_endian_specific_integral<int32_t, little, unaligned>;
+using little64_t =
+    detail::packed_endian_specific_integral<int64_t, little, unaligned>;
+
+using aligned_ulittle16_t =
+    detail::packed_endian_specific_integral<uint16_t, little, aligned>;
+using aligned_ulittle32_t =
+    detail::packed_endian_specific_integral<uint32_t, little, aligned>;
+using aligned_ulittle64_t =
+    detail::packed_endian_specific_integral<uint64_t, little, aligned>;
+
+using aligned_little16_t =
+    detail::packed_endian_specific_integral<int16_t, little, aligned>;
+using aligned_little32_t =
+    detail::packed_endian_specific_integral<int32_t, little, aligned>;
+using aligned_little64_t =
+    detail::packed_endian_specific_integral<int64_t, little, aligned>;
+
+using ubig16_t =
+    detail::packed_endian_specific_integral<uint16_t, big, unaligned>;
+using ubig32_t =
+    detail::packed_endian_specific_integral<uint32_t, big, unaligned>;
+using ubig64_t =
+    detail::packed_endian_specific_integral<uint64_t, big, unaligned>;
+
+using big16_t =
+    detail::packed_endian_specific_integral<int16_t, big, unaligned>;
+using big32_t =
+    detail::packed_endian_specific_integral<int32_t, big, unaligned>;
+using big64_t =
+    detail::packed_endian_specific_integral<int64_t, big, unaligned>;
+
+using aligned_ubig16_t =
+    detail::packed_endian_specific_integral<uint16_t, big, aligned>;
+using aligned_ubig32_t =
+    detail::packed_endian_specific_integral<uint32_t, big, aligned>;
+using aligned_ubig64_t =
+    detail::packed_endian_specific_integral<uint64_t, big, aligned>;
+
+using aligned_big16_t =
+    detail::packed_endian_specific_integral<int16_t, big, aligned>;
+using aligned_big32_t =
+    detail::packed_endian_specific_integral<int32_t, big, aligned>;
+using aligned_big64_t =
+    detail::packed_endian_specific_integral<int64_t, big, aligned>;
+
+using unaligned_uint16_t =
+    detail::packed_endian_specific_integral<uint16_t, native, unaligned>;
+using unaligned_uint32_t =
+    detail::packed_endian_specific_integral<uint32_t, native, unaligned>;
+using unaligned_uint64_t =
+    detail::packed_endian_specific_integral<uint64_t, native, unaligned>;
+
+using unaligned_int16_t =
+    detail::packed_endian_specific_integral<int16_t, native, unaligned>;
+using unaligned_int32_t =
+    detail::packed_endian_specific_integral<int32_t, native, unaligned>;
+using unaligned_int64_t =
+    detail::packed_endian_specific_integral<int64_t, native, unaligned>;
+
+namespace endian {
+
+template <typename T> inline T read(const void *P, endianness E) {
+  return read<T, unaligned>(P, E);
+}
+
+template <typename T, endianness E> inline T read(const void *P) {
+  return *(const detail::packed_endian_specific_integral<T, E, unaligned> *)P;
+}
+
+inline uint16_t read16(const void *P, endianness E) {
+  return read<uint16_t>(P, E);
+}
+inline uint32_t read32(const void *P, endianness E) {
+  return read<uint32_t>(P, E);
+}
+inline uint64_t read64(const void *P, endianness E) {
+  return read<uint64_t>(P, E);
+}
+
+template <endianness E> inline uint16_t read16(const void *P) {
+  return read<uint16_t, E>(P);
+}
+template <endianness E> inline uint32_t read32(const void *P) {
+  return read<uint32_t, E>(P);
+}
+template <endianness E> inline uint64_t read64(const void *P) {
+  return read<uint64_t, E>(P);
+}
+
+inline uint16_t read16le(const void *P) { return read16<little>(P); }
+inline uint32_t read32le(const void *P) { return read32<little>(P); }
+inline uint64_t read64le(const void *P) { return read64<little>(P); }
+inline uint16_t read16be(const void *P) { return read16<big>(P); }
+inline uint32_t read32be(const void *P) { return read32<big>(P); }
+inline uint64_t read64be(const void *P) { return read64<big>(P); }
+
+template <typename T> inline void write(void *P, T V, endianness E) {
+  write<T, unaligned>(P, V, E);
+}
+
+template <typename T, endianness E> inline void write(void *P, T V) {
+  *(detail::packed_endian_specific_integral<T, E, unaligned> *)P = V;
+}
+
+inline void write16(void *P, uint16_t V, endianness E) {
+  write<uint16_t>(P, V, E);
+}
+inline void write32(void *P, uint32_t V, endianness E) {
+  write<uint32_t>(P, V, E);
+}
+inline void write64(void *P, uint64_t V, endianness E) {
+  write<uint64_t>(P, V, E);
+}
+
+template <endianness E> inline void write16(void *P, uint16_t V) {
+  write<uint16_t, E>(P, V);
+}
+template <endianness E> inline void write32(void *P, uint32_t V) {
+  write<uint32_t, E>(P, V);
+}
+template <endianness E> inline void write64(void *P, uint64_t V) {
+  write<uint64_t, E>(P, V);
+}
+
+inline void write16le(void *P, uint16_t V) { write16<little>(P, V); }
+inline void write32le(void *P, uint32_t V) { write32<little>(P, V); }
+inline void write64le(void *P, uint64_t V) { write64<little>(P, V); }
+inline void write16be(void *P, uint16_t V) { write16<big>(P, V); }
+inline void write32be(void *P, uint32_t V) { write32<big>(P, V); }
+inline void write64be(void *P, uint64_t V) { write64<big>(P, V); }
+
+}
+
+}
+}
+
+
+
+namespace llvm {
+
+template <typename T> class ArrayRef;
+
+class MD5 {
+
+  typedef uint32_t MD5_u32plus;
+
+  MD5_u32plus a = 0x67452301;
+  MD5_u32plus b = 0xefcdab89;
+  MD5_u32plus c = 0x98badcfe;
+  MD5_u32plus d = 0x10325476;
+  MD5_u32plus hi = 0;
+  MD5_u32plus lo = 0;
+  uint8_t buffer[64];
+  MD5_u32plus block[16];
+
+public:
+  struct MD5Result {
+    std::array<uint8_t, 16> Bytes;
+
+    operator std::array<uint8_t, 16>() const { return Bytes; }
+
+    const uint8_t &operator[](size_t I) const { return Bytes[I]; }
+    uint8_t &operator[](size_t I) { return Bytes[I]; }
+
+    SmallString<32> digest() const;
+
+    uint64_t low() const {
+
+
+      using namespace support;
+      return endian::read<uint64_t, little, unaligned>(Bytes.data());
+    }
+
+    uint64_t high() const {
+      using namespace support;
+      return endian::read<uint64_t, little, unaligned>(Bytes.data() + 8);
+    }
+    std::pair<uint64_t, uint64_t> words() const {
+      using namespace support;
+      return std::make_pair(high(), low());
+    }
+  };
+
+  MD5();
+
+
+  void update(ArrayRef<uint8_t> Data);
+
+
+  void update(StringRef Str);
+
+
+  void final(MD5Result &Result);
+
+
+
+  static void stringifyResult(MD5Result &Result, SmallString<32> &Str);
+
+
+  static std::array<uint8_t, 16> hash(ArrayRef<uint8_t> Data);
+
+private:
+  const uint8_t *body(ArrayRef<uint8_t> Data);
+};
+
+inline bool operator==(const MD5::MD5Result &LHS, const MD5::MD5Result &RHS) {
+  return LHS.Bytes == RHS.Bytes;
+}
+
+
+inline uint64_t MD5Hash(StringRef Str) {
+  using namespace support;
+
+  MD5 Hash;
+  Hash.update(Str);
+  MD5::MD5Result Result;
+  Hash.final(Result);
+
+  return Result.low();
+}
+
+}
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+namespace llvm {
+
+class Comdat;
+class ConstantRange;
+class Error;
+class GlobalObject;
+class Module;
+
+namespace Intrinsic {
+  enum ID : unsigned;
+}
+
+class GlobalValue : public Constant {
+public:
+
+  enum LinkageTypes {
+    ExternalLinkage = 0,
+    AvailableExternallyLinkage,
+    LinkOnceAnyLinkage,
+    LinkOnceODRLinkage,
+    WeakAnyLinkage,
+    WeakODRLinkage,
+    AppendingLinkage,
+    InternalLinkage,
+    PrivateLinkage,
+    ExternalWeakLinkage,
+    CommonLinkage
+  };
+
+
+  enum VisibilityTypes {
+    DefaultVisibility = 0,
+    HiddenVisibility,
+    ProtectedVisibility
+  };
+
+
+  enum DLLStorageClassTypes {
+    DefaultStorageClass = 0,
+    DLLImportStorageClass = 1,
+    DLLExportStorageClass = 2
+  };
+
+protected:
+  GlobalValue(Type *Ty, ValueTy VTy, Use *Ops, unsigned NumOps,
+              LinkageTypes Linkage, const Twine &Name, unsigned AddressSpace)
+      : Constant(PointerType::get(Ty, AddressSpace), VTy, Ops, NumOps),
+        ValueType(Ty), Linkage(Linkage), Visibility(DefaultVisibility),
+        UnnamedAddrVal(unsigned(UnnamedAddr::None)),
+        DllStorageClass(DefaultStorageClass), ThreadLocal(NotThreadLocal),
+        HasLLVMReservedName(false), IsDSOLocal(false),
+        IntID((Intrinsic::ID)0U), Parent(nullptr) {
+    setName(Name);
+  }
+
+  Type *ValueType;
+
+  static const unsigned GlobalValueSubClassDataBits = 17;
+
+
+
+  unsigned Linkage : 4;
+  unsigned Visibility : 2;
+  unsigned UnnamedAddrVal : 2;
+  unsigned DllStorageClass : 2;
+
+  unsigned ThreadLocal : 3;
+
+
+
+
+
+  unsigned HasLLVMReservedName : 1;
+
+
+
+  unsigned IsDSOLocal : 1;
+
+private:
+  friend class Constant;
+
+
+
+  unsigned SubClassData : GlobalValueSubClassDataBits;
+
+  void destroyConstantImpl();
+  Value *handleOperandChangeImpl(Value *From, Value *To);
+
+
+
+
+  bool mayBeDerefined() const {
+    switch (getLinkage()) {
+    case WeakODRLinkage:
+    case LinkOnceODRLinkage:
+    case AvailableExternallyLinkage:
+      return true;
+
+    case WeakAnyLinkage:
+    case LinkOnceAnyLinkage:
+    case CommonLinkage:
+    case ExternalWeakLinkage:
+    case ExternalLinkage:
+    case AppendingLinkage:
+    case InternalLinkage:
+    case PrivateLinkage:
+      return isInterposable();
+    }
+
+    ::llvm::llvm_unreachable_internal("Fully covered switch above!", "/home/trippels/llvm/llvm/include/llvm/IR/GlobalValue.h", 142);
+  }
+
+protected:
+
+
+
+
+
+
+  Intrinsic::ID IntID;
+
+  unsigned getGlobalValueSubClassData() const {
+    return SubClassData;
+  }
+  void setGlobalValueSubClassData(unsigned V) {
+    
+   ((
+   V < (1 << GlobalValueSubClassDataBits) && "It will not fit"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "V < (1 << GlobalValueSubClassDataBits) && \"It will not fit\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/GlobalValue.h", 158, __PRETTY_FUNCTION__))
+                                                                      ;
+    SubClassData = V;
+  }
+
+  Module *Parent;
+
+
+  void setParent(Module *parent) {
+    Parent = parent;
+  }
+
+  ~GlobalValue() {
+    removeDeadConstantUsers();
+  }
+
+public:
+  enum ThreadLocalMode {
+    NotThreadLocal = 0,
+    GeneralDynamicTLSModel,
+    LocalDynamicTLSModel,
+    InitialExecTLSModel,
+    LocalExecTLSModel
+  };
+
+  GlobalValue(const GlobalValue &) = delete;
+
+  unsigned getAlignment() const;
+
+  enum class UnnamedAddr {
+    None,
+    Local,
+    Global,
+  };
+
+  bool hasGlobalUnnamedAddr() const {
+    return getUnnamedAddr() == UnnamedAddr::Global;
+  }
+
+
+
+
+
+
+  bool hasAtLeastLocalUnnamedAddr() const {
+    return getUnnamedAddr() != UnnamedAddr::None;
+  }
+
+  UnnamedAddr getUnnamedAddr() const {
+    return UnnamedAddr(UnnamedAddrVal);
+  }
+  void setUnnamedAddr(UnnamedAddr Val) { UnnamedAddrVal = unsigned(Val); }
+
+  static UnnamedAddr getMinUnnamedAddr(UnnamedAddr A, UnnamedAddr B) {
+    if (A == UnnamedAddr::None || B == UnnamedAddr::None)
+      return UnnamedAddr::None;
+    if (A == UnnamedAddr::Local || B == UnnamedAddr::Local)
+      return UnnamedAddr::Local;
+    return UnnamedAddr::Global;
+  }
+
+  bool hasComdat() const { return getComdat() != nullptr; }
+  const Comdat *getComdat() const;
+  Comdat *getComdat() {
+    return const_cast<Comdat *>(
+                           static_cast<const GlobalValue *>(this)->getComdat());
+  }
+
+  VisibilityTypes getVisibility() const { return VisibilityTypes(Visibility); }
+  bool hasDefaultVisibility() const { return Visibility == DefaultVisibility; }
+  bool hasHiddenVisibility() const { return Visibility == HiddenVisibility; }
+  bool hasProtectedVisibility() const {
+    return Visibility == ProtectedVisibility;
+  }
+  void setVisibility(VisibilityTypes V) {
+    
+   ((
+   (!hasLocalLinkage() || V == DefaultVisibility) && "local linkage requires default visibility"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "(!hasLocalLinkage() || V == DefaultVisibility) && \"local linkage requires default visibility\""
+   ,
+                                                      "/home/trippels/llvm/llvm/include/llvm/IR/GlobalValue.h"
+    ,
+                                                      233
+    , __PRETTY_FUNCTION__))
+                                                       
+                                                      ;
+    Visibility = V;
+  }
+
+
+  bool isThreadLocal() const { return getThreadLocalMode() != NotThreadLocal; }
+  void setThreadLocal(bool Val) {
+    setThreadLocalMode(Val ? GeneralDynamicTLSModel : NotThreadLocal);
+  }
+  void setThreadLocalMode(ThreadLocalMode Val) {
+    
+   ((
+   Val == NotThreadLocal || getValueID() != Value::FunctionVal
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Val == NotThreadLocal || getValueID() != Value::FunctionVal"
+   , "/home/trippels/llvm/llvm/include/llvm/IR/GlobalValue.h", 243, __PRETTY_FUNCTION__))
+                                                                      ;
+    ThreadLocal = Val;
+  }
+  ThreadLocalMode getThreadLocalMode() const {
+    return static_cast<ThreadLocalMode>(ThreadLocal);
+  }
+
+  DLLStorageClassTypes getDLLStorageClass() const {
+    return DLLStorageClassTypes(DllStorageClass);
+  }
+  bool hasDLLImportStorageClass() const {
+    return DllStorageClass == DLLImportStorageClass;
+  }
+  bool hasDLLExportStorageClass() const {
+    return DllStorageClass == DLLExportStorageClass;
+  }
+  void setDLLStorageClass(DLLStorageClassTypes C) { DllStorageClass = C; }
+
+  bool hasSection() const { return !getSection().empty(); }
+  StringRef getSection() const;
+
+
+  PointerType *getType() const { return cast<PointerType>(User::getType()); }
+
+  Type *getValueType() const { return ValueType; }
+
+  void setDSOLocal(bool Local) { IsDSOLocal = Local; }
+
+  bool isDSOLocal() const {
+    return IsDSOLocal;
+  }
+
+  static LinkageTypes getLinkOnceLinkage(bool ODR) {
+    return ODR ? LinkOnceODRLinkage : LinkOnceAnyLinkage;
+  }
+  static LinkageTypes getWeakLinkage(bool ODR) {
+    return ODR ? WeakODRLinkage : WeakAnyLinkage;
+  }
+
+  static bool isExternalLinkage(LinkageTypes Linkage) {
+    return Linkage == ExternalLinkage;
+  }
+  static bool isAvailableExternallyLinkage(LinkageTypes Linkage) {
+    return Linkage == AvailableExternallyLinkage;
+  }
+  static bool isLinkOnceODRLinkage(LinkageTypes Linkage) {
+    return Linkage == LinkOnceODRLinkage;
+  }
+  static bool isLinkOnceLinkage(LinkageTypes Linkage) {
+    return Linkage == LinkOnceAnyLinkage || Linkage == LinkOnceODRLinkage;
+  }
+  static bool isWeakAnyLinkage(LinkageTypes Linkage) {
+    return Linkage == WeakAnyLinkage;
+  }
+  static bool isWeakODRLinkage(LinkageTypes Linkage) {
+    return Linkage == WeakODRLinkage;
+  }
+  static bool isWeakLinkage(LinkageTypes Linkage) {
+    return isWeakAnyLinkage(Linkage) || isWeakODRLinkage(Linkage);
+  }
+  static bool isAppendingLinkage(LinkageTypes Linkage) {
+    return Linkage == AppendingLinkage;
+  }
+  static bool isInternalLinkage(LinkageTypes Linkage) {
+    return Linkage == InternalLinkage;
+  }
+  static bool isPrivateLinkage(LinkageTypes Linkage) {
+    return Linkage == PrivateLinkage;
+  }
+  static bool isLocalLinkage(LinkageTypes Linkage) {
+    return isInternalLinkage(Linkage) || isPrivateLinkage(Linkage);
+  }
+  static bool isExternalWeakLinkage(LinkageTypes Linkage) {
+    return Linkage == ExternalWeakLinkage;
+  }
+  static bool isCommonLinkage(LinkageTypes Linkage) {
+    return Linkage == CommonLinkage;
+  }
+  static bool isValidDeclarationLinkage(LinkageTypes Linkage) {
+    return isExternalWeakLinkage(Linkage) || isExternalLinkage(Linkage);
+  }
+
+
+
+
+  static bool isInterposableLinkage(LinkageTypes Linkage) {
+    switch (Linkage) {
+    case WeakAnyLinkage:
+    case LinkOnceAnyLinkage:
+    case CommonLinkage:
+    case ExternalWeakLinkage:
+      return true;
+
+    case AvailableExternallyLinkage:
+    case LinkOnceODRLinkage:
+    case WeakODRLinkage:
+
+
+    case ExternalLinkage:
+    case AppendingLinkage:
+    case InternalLinkage:
+    case PrivateLinkage:
+      return false;
+    }
+    ::llvm::llvm_unreachable_internal("Fully covered switch above!", "/home/trippels/llvm/llvm/include/llvm/IR/GlobalValue.h", 347);
+  }
+
+
+
+  static bool isDiscardableIfUnused(LinkageTypes Linkage) {
+    return isLinkOnceLinkage(Linkage) || isLocalLinkage(Linkage) ||
+           isAvailableExternallyLinkage(Linkage);
+  }
+
+
+
+
+
+  static bool isWeakForLinker(LinkageTypes Linkage) {
+    return Linkage == WeakAnyLinkage || Linkage == WeakODRLinkage ||
+           Linkage == LinkOnceAnyLinkage || Linkage == LinkOnceODRLinkage ||
+           Linkage == CommonLinkage || Linkage == ExternalWeakLinkage;
+  }
+  bool isDefinitionExact() const {
+    return !mayBeDerefined();
+  }
+
+
+  bool hasExactDefinition() const {
+
+
+
+
+
+    return !isDeclaration() && isDefinitionExact();
+  }
+
+
+
+
+
+  bool isInterposable() const { return isInterposableLinkage(getLinkage()); }
+
+  bool hasExternalLinkage() const { return isExternalLinkage(getLinkage()); }
+  bool hasAvailableExternallyLinkage() const {
+    return isAvailableExternallyLinkage(getLinkage());
+  }
+  bool hasLinkOnceLinkage() const { return isLinkOnceLinkage(getLinkage()); }
+  bool hasLinkOnceODRLinkage() const {
+    return isLinkOnceODRLinkage(getLinkage());
+  }
+  bool hasWeakLinkage() const { return isWeakLinkage(getLinkage()); }
+  bool hasWeakAnyLinkage() const { return isWeakAnyLinkage(getLinkage()); }
+  bool hasWeakODRLinkage() const { return isWeakODRLinkage(getLinkage()); }
+  bool hasAppendingLinkage() const { return isAppendingLinkage(getLinkage()); }
+  bool hasInternalLinkage() const { return isInternalLinkage(getLinkage()); }
+  bool hasPrivateLinkage() const { return isPrivateLinkage(getLinkage()); }
+  bool hasLocalLinkage() const { return isLocalLinkage(getLinkage()); }
+  bool hasExternalWeakLinkage() const {
+    return isExternalWeakLinkage(getLinkage());
+  }
+  bool hasCommonLinkage() const { return isCommonLinkage(getLinkage()); }
+  bool hasValidDeclarationLinkage() const {
+    return isValidDeclarationLinkage(getLinkage());
+  }
+
+  void setLinkage(LinkageTypes LT) {
+    if (isLocalLinkage(LT))
+      Visibility = DefaultVisibility;
+    Linkage = LT;
+  }
+  LinkageTypes getLinkage() const { return LinkageTypes(Linkage); }
+
+  bool isDiscardableIfUnused() const {
+    return isDiscardableIfUnused(getLinkage());
+  }
+
+  bool isWeakForLinker() const { return isWeakForLinker(getLinkage()); }
+
+protected:
+
+
+  void copyAttributesFrom(const GlobalValue *Src);
+
+public:
+
+
+
+
+
+
+
+  static StringRef dropLLVMManglingEscape(StringRef Name) {
+    if (!Name.empty() && Name[0] == '\1')
+      return Name.substr(1);
+    return Name;
+  }
+
+
+
+
+
+  static std::string getGlobalIdentifier(StringRef Name,
+                                         GlobalValue::LinkageTypes Linkage,
+                                         StringRef FileName);
+
+
+
+  std::string getGlobalIdentifier() const;
+
+
+
+
+  using GUID = uint64_t;
+
+
+
+  static GUID getGUID(StringRef GlobalName) { return MD5Hash(GlobalName); }
+
+
+
+  GUID getGUID() const { return getGUID(getGlobalIdentifier()); }
+  bool isMaterializable() const;
+
+
+  Error materialize();
+
+
+
+
+
+  bool isDeclaration() const;
+
+  bool isDeclarationForLinker() const {
+    if (hasAvailableExternallyLinkage())
+      return true;
+
+    return isDeclaration();
+  }
+
+
+
+
+
+
+
+  bool isStrongDefinitionForLinker() const {
+    return !(isDeclarationForLinker() || isWeakForLinker());
+  }
+
+
+
+  bool canIncreaseAlignment() const;
+
+  const GlobalObject *getBaseObject() const;
+  GlobalObject *getBaseObject() {
+    return const_cast<GlobalObject *>(
+                       static_cast<const GlobalValue *>(this)->getBaseObject());
+  }
+
+
+  bool isAbsoluteSymbolRef() const;
+
+
+
+  Optional<ConstantRange> getAbsoluteSymbolRange() const;
+
+
+
+  void removeFromParent();
+
+
+  void eraseFromParent();
+
+
+  Module *getParent() { return Parent; }
+  const Module *getParent() const { return Parent; }
+
+
+  static bool classof(const Value *V) {
+    return V->getValueID() == Value::FunctionVal ||
+           V->getValueID() == Value::GlobalVariableVal ||
+           V->getValueID() == Value::GlobalAliasVal ||
+           V->getValueID() == Value::GlobalIFuncVal;
+  }
+};
+
+}
+
+
+
+
+namespace llvm {
+
+class Comdat;
+class MDNode;
+class Metadata;
+
+class GlobalObject : public GlobalValue {
+protected:
+  GlobalObject(Type *Ty, ValueTy VTy, Use *Ops, unsigned NumOps,
+               LinkageTypes Linkage, const Twine &Name,
+               unsigned AddressSpace = 0)
+      : GlobalValue(Ty, VTy, Ops, NumOps, Linkage, Name, AddressSpace),
+        ObjComdat(nullptr) {
+    setGlobalValueSubClassData(0);
+  }
+
+  Comdat *ObjComdat;
+  enum {
+    LastAlignmentBit = 4,
+    HasMetadataHashEntryBit,
+    HasSectionHashEntryBit,
+
+    GlobalObjectBits,
+  };
+  static const unsigned GlobalObjectSubClassDataBits =
+      GlobalValueSubClassDataBits - GlobalObjectBits;
+
+private:
+  static const unsigned AlignmentBits = LastAlignmentBit + 1;
+  static const unsigned AlignmentMask = (1 << AlignmentBits) - 1;
+  static const unsigned GlobalObjectMask = (1 << GlobalObjectBits) - 1;
+
+public:
+  GlobalObject(const GlobalObject &) = delete;
+
+  unsigned getAlignment() const {
+    unsigned Data = getGlobalValueSubClassData();
+    unsigned AlignmentData = Data & AlignmentMask;
+    return (1u << AlignmentData) >> 1;
+  }
+  void setAlignment(unsigned Align);
+
+  unsigned getGlobalObjectSubClassData() const {
+    unsigned ValueData = getGlobalValueSubClassData();
+    return ValueData >> GlobalObjectBits;
+  }
+
+  void setGlobalObjectSubClassData(unsigned Val) {
+    unsigned OldData = getGlobalValueSubClassData();
+    setGlobalValueSubClassData((OldData & GlobalObjectMask) |
+                               (Val << GlobalObjectBits));
+    
+   ((
+   getGlobalObjectSubClassData() == Val && "representation error"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "getGlobalObjectSubClassData() == Val && \"representation error\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/GlobalObject.h", 75, __PRETTY_FUNCTION__))
+                                                                         ;
+  }
+
+
+
+
+
+  bool hasSection() const {
+    return getGlobalValueSubClassData() & (1 << HasSectionHashEntryBit);
+  }
+
+
+
+
+
+  StringRef getSection() const {
+    return hasSection() ? getSectionImpl() : StringRef();
+  }
+
+
+
+
+
+  void setSection(StringRef S);
+
+  bool hasComdat() const { return getComdat() != nullptr; }
+  const Comdat *getComdat() const { return ObjComdat; }
+  Comdat *getComdat() { return ObjComdat; }
+  void setComdat(Comdat *C) { ObjComdat = C; }
+
+
+  bool hasMetadata() const { return hasMetadataHashEntry(); }
+
+
+
+
+
+
+  MDNode *getMetadata(unsigned KindID) const;
+  MDNode *getMetadata(StringRef Kind) const;
+
+
+
+
+
+
+  void getMetadata(unsigned KindID, SmallVectorImpl<MDNode *> &MDs) const;
+  void getMetadata(StringRef Kind, SmallVectorImpl<MDNode *> &MDs) const;
+
+
+
+
+
+
+
+  void setMetadata(unsigned KindID, MDNode *MD);
+  void setMetadata(StringRef Kind, MDNode *MD);
+
+
+
+
+  void addMetadata(unsigned KindID, MDNode &MD);
+  void addMetadata(StringRef Kind, MDNode &MD);
+
+
+
+
+  void
+  getAllMetadata(SmallVectorImpl<std::pair<unsigned, MDNode *>> &MDs) const;
+
+
+  void eraseMetadata(unsigned KindID);
+
+
+  void copyMetadata(const GlobalObject *Src, unsigned Offset);
+
+  void addTypeMetadata(unsigned Offset, Metadata *TypeID);
+
+protected:
+  void copyAttributesFrom(const GlobalObject *Src);
+
+public:
+
+  static bool classof(const Value *V) {
+    return V->getValueID() == Value::FunctionVal ||
+           V->getValueID() == Value::GlobalVariableVal;
+  }
+
+  void clearMetadata();
+
+private:
+  void setGlobalObjectFlag(unsigned Bit, bool Val) {
+    unsigned Mask = 1 << Bit;
+    setGlobalValueSubClassData((~Mask & getGlobalValueSubClassData()) |
+                               (Val ? Mask : 0u));
+  }
+
+  bool hasMetadataHashEntry() const {
+    return getGlobalValueSubClassData() & (1 << HasMetadataHashEntryBit);
+  }
+  void setHasMetadataHashEntry(bool HasEntry) {
+    setGlobalObjectFlag(HasMetadataHashEntryBit, HasEntry);
+  }
+
+  StringRef getSectionImpl() const;
+};
+
+}
+
+namespace llvm {
+template <typename SubClass, unsigned ARITY>
+struct FixedNumOperandTraits {
+  static Use *op_begin(SubClass* U) {
+    static_assert(
+        !std::is_polymorphic<SubClass>::value,
+        "adding virtual methods to subclasses of User breaks use lists");
+    return reinterpret_cast<Use*>(U) - ARITY;
+  }
+  static Use *op_end(SubClass* U) {
+    return reinterpret_cast<Use*>(U);
+  }
+  static unsigned operands(const User*) {
+    return ARITY;
+  }
+};
+template <typename SubClass, unsigned ARITY = 1>
+struct OptionalOperandTraits : public FixedNumOperandTraits<SubClass, ARITY> {
+  static unsigned operands(const User *U) {
+    return U->getNumOperands();
+  }
+};
+template <typename SubClass, unsigned MINARITY = 0>
+struct VariadicOperandTraits {
+  static Use *op_begin(SubClass* U) {
+    static_assert(
+        !std::is_polymorphic<SubClass>::value,
+        "adding virtual methods to subclasses of User breaks use lists");
+    return reinterpret_cast<Use*>(U) - static_cast<User*>(U)->getNumOperands();
+  }
+  static Use *op_end(SubClass* U) {
+    return reinterpret_cast<Use*>(U);
+  }
+  static unsigned operands(const User *U) {
+    return U->getNumOperands();
+  }
+};
+template <unsigned MINARITY = 1>
+struct HungoffOperandTraits {
+  static Use *op_begin(User* U) {
+    return U->getOperandList();
+  }
+  static Use *op_end(User* U) {
+    return U->getOperandList() + U->getNumOperands();
+  }
+  static unsigned operands(const User *U) {
+    return U->getNumOperands();
+  }
+};
+}
+
+
+
+
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+
+
+namespace llvm {
+
+namespace Intrinsic {
+enum ID : unsigned;
+}
+
+class AssemblyAnnotationWriter;
+class Constant;
+class DISubprogram;
+class LLVMContext;
+class Module;
+template <typename T> class Optional;
+class raw_ostream;
+class Type;
+class User;
+
+class Function : public GlobalObject, public ilist_node<Function> {
+public:
+  using BasicBlockListType = SymbolTableList<BasicBlock>;
+
+
+  using iterator = BasicBlockListType::iterator;
+  using const_iterator = BasicBlockListType::const_iterator;
+
+  using arg_iterator = Argument *;
+  using const_arg_iterator = const Argument *;
+
+private:
+
+  BasicBlockListType BasicBlocks;
+  mutable Argument *Arguments = nullptr;
+  size_t NumArgs;
+  std::unique_ptr<ValueSymbolTable>
+      SymTab;
+  AttributeList AttributeSets;
+  enum {
+
+    IsMaterializableBit = 0,
+  };
+
+  friend class SymbolTableListTraits<Function>;
+
+
+
+
+
+public:
+  bool hasLazyArguments() const {
+    return getSubclassDataFromValue() & (1<<0);
+  }
+
+private:
+  void CheckLazyArguments() const {
+    if (hasLazyArguments())
+      BuildLazyArguments();
+  }
+
+  void BuildLazyArguments() const;
+
+  void clearArguments();
+
+
+
+
+
+  Function(FunctionType *Ty, LinkageTypes Linkage,
+           const Twine &N = "", Module *M = nullptr);
+
+public:
+  Function(const Function&) = delete;
+  void operator=(const Function&) = delete;
+  ~Function();
+
+
+
+
+  const Function &getFunction() const { return *this; }
+
+  static Function *Create(FunctionType *Ty, LinkageTypes Linkage,
+                          const Twine &N = "", Module *M = nullptr) {
+    return new Function(Ty, Linkage, N, M);
+  }
+
+
+  public: inline Value *getOperand(unsigned) const; inline void setOperand(unsigned, Value*); inline op_iterator op_begin(); inline const_op_iterator op_begin() const; inline op_iterator op_end(); inline const_op_iterator op_end() const; protected: template <int> inline Use &Op(); template <int> inline const Use &Op() const; public: inline unsigned getNumOperands() const;
+
+
+  FunctionType *getFunctionType() const {
+    return cast<FunctionType>(getValueType());
+  }
+
+
+  Type *getReturnType() const { return getFunctionType()->getReturnType(); }
+
+
+
+  LLVMContext &getContext() const;
+
+
+
+  bool isVarArg() const { return getFunctionType()->isVarArg(); }
+
+  bool isMaterializable() const {
+    return getGlobalObjectSubClassData() & (1 << IsMaterializableBit);
+  }
+  void setIsMaterializable(bool V) {
+    unsigned Mask = 1 << IsMaterializableBit;
+    setGlobalObjectSubClassData((~Mask & getGlobalObjectSubClassData()) |
+                                (V ? Mask : 0u));
+  }
+
+
+
+
+
+
+
+  Intrinsic::ID getIntrinsicID() const __attribute__((__pure__)) { return IntID; }
+
+
+
+
+  bool isIntrinsic() const { return HasLLVMReservedName; }
+
+  static Intrinsic::ID lookupIntrinsicID(StringRef Name);
+
+
+
+
+
+
+  void recalculateIntrinsicID();
+
+
+
+
+  CallingConv::ID getCallingConv() const {
+    return static_cast<CallingConv::ID>((getSubclassDataFromValue() >> 4) &
+                                        CallingConv::MaxID);
+  }
+  void setCallingConv(CallingConv::ID CC) {
+    auto ID = static_cast<unsigned>(CC);
+    
+   ((
+   !(ID & ~CallingConv::MaxID) && "Unsupported calling convention"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!(ID & ~CallingConv::MaxID) && \"Unsupported calling convention\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Function.h", 200, __PRETTY_FUNCTION__))
+                                                                          ;
+    setValueSubclassData((getSubclassDataFromValue() & 0xc00f) | (ID << 4));
+  }
+
+
+  AttributeList getAttributes() const { return AttributeSets; }
+
+
+  void setAttributes(AttributeList Attrs) { AttributeSets = Attrs; }
+
+
+  void addFnAttr(Attribute::AttrKind Kind) {
+    addAttribute(AttributeList::FunctionIndex, Kind);
+  }
+
+
+  void addFnAttr(StringRef Kind, StringRef Val = StringRef()) {
+    addAttribute(AttributeList::FunctionIndex,
+                 Attribute::get(getContext(), Kind, Val));
+  }
+
+
+  void addFnAttr(Attribute Attr) {
+    addAttribute(AttributeList::FunctionIndex, Attr);
+  }
+
+
+  void removeFnAttr(Attribute::AttrKind Kind) {
+    removeAttribute(AttributeList::FunctionIndex, Kind);
+  }
+
+
+  void removeFnAttr(StringRef Kind) {
+    setAttributes(getAttributes().removeAttribute(
+        getContext(), AttributeList::FunctionIndex, Kind));
+  }
+  void setEntryCount(uint64_t Count, bool Synthetic = false,
+                     const DenseSet<GlobalValue::GUID> *Imports = nullptr);
+
+
+
+
+
+  Optional<uint64_t> getEntryCount() const;
+
+
+
+
+
+  bool hasProfileData() const { return getEntryCount().hasValue(); }
+
+
+
+  DenseSet<GlobalValue::GUID> getImportGUIDs() const;
+
+
+  void setSectionPrefix(StringRef Prefix);
+
+
+  Optional<StringRef> getSectionPrefix() const;
+
+
+  bool hasFnAttribute(Attribute::AttrKind Kind) const {
+    return AttributeSets.hasFnAttribute(Kind);
+  }
+
+
+  bool hasFnAttribute(StringRef Kind) const {
+    return AttributeSets.hasFnAttribute(Kind);
+  }
+
+
+  Attribute getFnAttribute(Attribute::AttrKind Kind) const {
+    return getAttribute(AttributeList::FunctionIndex, Kind);
+  }
+
+
+  Attribute getFnAttribute(StringRef Kind) const {
+    return getAttribute(AttributeList::FunctionIndex, Kind);
+  }
+
+
+  unsigned getFnStackAlignment() const {
+    if (!hasFnAttribute(Attribute::StackAlignment))
+      return 0;
+    return AttributeSets.getStackAlignment(AttributeList::FunctionIndex);
+  }
+
+
+
+  bool hasGC() const {
+    return getSubclassDataFromValue() & (1<<14);
+  }
+  const std::string &getGC() const;
+  void setGC(std::string Str);
+  void clearGC();
+
+
+  void addAttribute(unsigned i, Attribute::AttrKind Kind);
+
+
+  void addAttribute(unsigned i, Attribute Attr);
+
+
+  void addAttributes(unsigned i, const AttrBuilder &Attrs);
+
+
+  void addParamAttr(unsigned ArgNo, Attribute::AttrKind Kind);
+
+
+  void addParamAttr(unsigned ArgNo, Attribute Attr);
+
+
+  void addParamAttrs(unsigned ArgNo, const AttrBuilder &Attrs);
+
+
+  void removeAttribute(unsigned i, Attribute::AttrKind Kind);
+
+
+  void removeAttribute(unsigned i, StringRef Kind);
+
+
+  void removeAttributes(unsigned i, const AttrBuilder &Attrs);
+
+
+  void removeParamAttr(unsigned ArgNo, Attribute::AttrKind Kind);
+
+
+  void removeParamAttr(unsigned ArgNo, StringRef Kind);
+
+
+  void removeParamAttrs(unsigned ArgNo, const AttrBuilder &Attrs);
+
+
+  bool hasAttribute(unsigned i, Attribute::AttrKind Kind) const {
+    return getAttributes().hasAttribute(i, Kind);
+  }
+
+
+  bool hasParamAttribute(unsigned ArgNo, Attribute::AttrKind Kind) const {
+    return getAttributes().hasParamAttribute(ArgNo, Kind);
+  }
+
+
+  Attribute getAttribute(unsigned i, Attribute::AttrKind Kind) const {
+    return AttributeSets.getAttribute(i, Kind);
+  }
+
+
+  Attribute getAttribute(unsigned i, StringRef Kind) const {
+    return AttributeSets.getAttribute(i, Kind);
+  }
+
+
+  void addDereferenceableAttr(unsigned i, uint64_t Bytes);
+
+
+
+  void addDereferenceableParamAttr(unsigned ArgNo, uint64_t Bytes);
+
+
+
+  void addDereferenceableOrNullAttr(unsigned i, uint64_t Bytes);
+
+
+
+  void addDereferenceableOrNullParamAttr(unsigned ArgNo, uint64_t Bytes);
+
+
+  unsigned getParamAlignment(unsigned ArgNo) const {
+    return AttributeSets.getParamAlignment(ArgNo);
+  }
+
+
+
+
+  uint64_t getDereferenceableBytes(unsigned i) const {
+    return AttributeSets.getDereferenceableBytes(i);
+  }
+
+
+
+  uint64_t getParamDereferenceableBytes(unsigned ArgNo) const {
+    return AttributeSets.getParamDereferenceableBytes(ArgNo);
+  }
+
+
+
+
+  uint64_t getDereferenceableOrNullBytes(unsigned i) const {
+    return AttributeSets.getDereferenceableOrNullBytes(i);
+  }
+
+
+
+
+  uint64_t getParamDereferenceableOrNullBytes(unsigned ArgNo) const {
+    return AttributeSets.getParamDereferenceableOrNullBytes(ArgNo);
+  }
+
+
+  bool doesNotAccessMemory() const {
+    return hasFnAttribute(Attribute::ReadNone);
+  }
+  void setDoesNotAccessMemory() {
+    addFnAttr(Attribute::ReadNone);
+  }
+
+
+  bool onlyReadsMemory() const {
+    return doesNotAccessMemory() || hasFnAttribute(Attribute::ReadOnly);
+  }
+  void setOnlyReadsMemory() {
+    addFnAttr(Attribute::ReadOnly);
+  }
+
+
+  bool doesNotReadMemory() const {
+    return doesNotAccessMemory() || hasFnAttribute(Attribute::WriteOnly);
+  }
+  void setDoesNotReadMemory() {
+    addFnAttr(Attribute::WriteOnly);
+  }
+
+
+
+  bool onlyAccessesArgMemory() const {
+    return hasFnAttribute(Attribute::ArgMemOnly);
+  }
+  void setOnlyAccessesArgMemory() { addFnAttr(Attribute::ArgMemOnly); }
+
+
+
+  bool onlyAccessesInaccessibleMemory() const {
+    return hasFnAttribute(Attribute::InaccessibleMemOnly);
+  }
+  void setOnlyAccessesInaccessibleMemory() {
+    addFnAttr(Attribute::InaccessibleMemOnly);
+  }
+
+
+
+  bool onlyAccessesInaccessibleMemOrArgMem() const {
+    return hasFnAttribute(Attribute::InaccessibleMemOrArgMemOnly);
+  }
+  void setOnlyAccessesInaccessibleMemOrArgMem() {
+    addFnAttr(Attribute::InaccessibleMemOrArgMemOnly);
+  }
+
+
+  bool doesNotReturn() const {
+    return hasFnAttribute(Attribute::NoReturn);
+  }
+  void setDoesNotReturn() {
+    addFnAttr(Attribute::NoReturn);
+  }
+
+
+  bool doesNotThrow() const {
+    return hasFnAttribute(Attribute::NoUnwind);
+  }
+  void setDoesNotThrow() {
+    addFnAttr(Attribute::NoUnwind);
+  }
+
+
+  bool cannotDuplicate() const {
+    return hasFnAttribute(Attribute::NoDuplicate);
+  }
+  void setCannotDuplicate() {
+    addFnAttr(Attribute::NoDuplicate);
+  }
+
+
+  bool isConvergent() const {
+    return hasFnAttribute(Attribute::Convergent);
+  }
+  void setConvergent() {
+    addFnAttr(Attribute::Convergent);
+  }
+  void setNotConvergent() {
+    removeFnAttr(Attribute::Convergent);
+  }
+
+
+  bool isSpeculatable() const {
+    return hasFnAttribute(Attribute::Speculatable);
+  }
+  void setSpeculatable() {
+    addFnAttr(Attribute::Speculatable);
+  }
+
+
+
+  bool doesNotRecurse() const {
+    return hasFnAttribute(Attribute::NoRecurse);
+  }
+  void setDoesNotRecurse() {
+    addFnAttr(Attribute::NoRecurse);
+  }
+
+
+
+  bool hasUWTable() const {
+    return hasFnAttribute(Attribute::UWTable);
+  }
+  void setHasUWTable() {
+    addFnAttr(Attribute::UWTable);
+  }
+
+
+  bool needsUnwindTableEntry() const {
+    return hasUWTable() || !doesNotThrow();
+  }
+
+
+
+  bool hasStructRetAttr() const {
+    return AttributeSets.hasParamAttribute(0, Attribute::StructRet) ||
+           AttributeSets.hasParamAttribute(1, Attribute::StructRet);
+  }
+
+
+
+  bool returnDoesNotAlias() const {
+    return AttributeSets.hasAttribute(AttributeList::ReturnIndex,
+                                      Attribute::NoAlias);
+  }
+  void setReturnDoesNotAlias() {
+    addAttribute(AttributeList::ReturnIndex, Attribute::NoAlias);
+  }
+
+
+  bool optForMinSize() const { return hasFnAttribute(Attribute::MinSize); }
+
+
+  bool optForSize() const {
+    return hasFnAttribute(Attribute::OptimizeForSize) || optForMinSize();
+  }
+
+
+
+  void copyAttributesFrom(const Function *Src);
+
+
+
+
+  void deleteBody() {
+    dropAllReferences();
+    setLinkage(ExternalLinkage);
+  }
+
+
+
+
+  void removeFromParent();
+
+
+
+
+  void eraseFromParent();
+
+
+
+
+
+  void stealArgumentListFrom(Function &Src);
+
+
+
+
+  const BasicBlockListType &getBasicBlockList() const { return BasicBlocks; }
+        BasicBlockListType &getBasicBlockList() { return BasicBlocks; }
+
+  static BasicBlockListType Function::*getSublistAccess(BasicBlock*) {
+    return &Function::BasicBlocks;
+  }
+
+  const BasicBlock &getEntryBlock() const { return front(); }
+        BasicBlock &getEntryBlock() { return front(); }
+
+
+
+
+
+
+  inline ValueSymbolTable *getValueSymbolTable() { return SymTab.get(); }
+  inline const ValueSymbolTable *getValueSymbolTable() const {
+    return SymTab.get();
+  }
+
+
+
+
+  iterator begin() { return BasicBlocks.begin(); }
+  const_iterator begin() const { return BasicBlocks.begin(); }
+  iterator end () { return BasicBlocks.end(); }
+  const_iterator end () const { return BasicBlocks.end(); }
+
+  size_t size() const { return BasicBlocks.size(); }
+  bool empty() const { return BasicBlocks.empty(); }
+  const BasicBlock &front() const { return BasicBlocks.front(); }
+        BasicBlock &front() { return BasicBlocks.front(); }
+  const BasicBlock &back() const { return BasicBlocks.back(); }
+        BasicBlock &back() { return BasicBlocks.back(); }
+
+
+
+
+  arg_iterator arg_begin() {
+    CheckLazyArguments();
+    return Arguments;
+  }
+  const_arg_iterator arg_begin() const {
+    CheckLazyArguments();
+    return Arguments;
+  }
+
+  arg_iterator arg_end() {
+    CheckLazyArguments();
+    return Arguments + NumArgs;
+  }
+  const_arg_iterator arg_end() const {
+    CheckLazyArguments();
+    return Arguments + NumArgs;
+  }
+
+  iterator_range<arg_iterator> args() {
+    return make_range(arg_begin(), arg_end());
+  }
+  iterator_range<const_arg_iterator> args() const {
+    return make_range(arg_begin(), arg_end());
+  }
+
+
+
+  size_t arg_size() const { return NumArgs; }
+  bool arg_empty() const { return arg_size() == 0; }
+
+
+  bool hasPersonalityFn() const {
+    return getSubclassDataFromValue() & (1<<3);
+  }
+
+
+  Constant *getPersonalityFn() const;
+  void setPersonalityFn(Constant *Fn);
+
+
+  bool hasPrefixData() const {
+    return getSubclassDataFromValue() & (1<<1);
+  }
+
+
+  Constant *getPrefixData() const;
+  void setPrefixData(Constant *PrefixData);
+
+
+  bool hasPrologueData() const {
+    return getSubclassDataFromValue() & (1<<2);
+  }
+
+
+  Constant *getPrologueData() const;
+  void setPrologueData(Constant *PrologueData);
+
+
+
+  void print(raw_ostream &OS, AssemblyAnnotationWriter *AAW = nullptr,
+             bool ShouldPreserveUseListOrder = false,
+             bool IsForDebug = false) const;
+
+
+
+
+
+
+
+  void viewCFG() const;
+
+
+
+
+
+
+  void viewCFGOnly() const;
+
+
+  static bool classof(const Value *V) {
+    return V->getValueID() == Value::FunctionVal;
+  }
+  void dropAllReferences();
+
+
+
+
+
+  bool hasAddressTaken(const User** = nullptr) const;
+
+
+
+
+
+  bool isDefTriviallyDead() const;
+
+
+
+  bool callsFunctionThatReturnsTwice() const;
+
+
+
+
+  void setSubprogram(DISubprogram *SP);
+
+
+
+
+
+  DISubprogram *getSubprogram() const;
+
+
+  bool isDebugInfoForProfiling() const;
+
+private:
+  void allocHungoffUselist();
+  template<int Idx> void setHungoffOperand(Constant *C);
+
+
+
+  void setValueSubclassData(unsigned short D) {
+    Value::setValueSubclassData(D);
+  }
+  void setValueSubclassDataBit(unsigned Bit, bool On);
+};
+
+template <>
+struct OperandTraits<Function> : public HungoffOperandTraits<3> {};
+
+Function::op_iterator Function::op_begin() { return OperandTraits<Function>::op_begin(this); } Function::const_op_iterator Function::op_begin() const { return OperandTraits<Function>::op_begin(const_cast<Function*>(this)); } Function::op_iterator Function::op_end() { return OperandTraits<Function>::op_end(this); } Function::const_op_iterator Function::op_end() const { return OperandTraits<Function>::op_end(const_cast<Function*>(this)); } Value *Function::getOperand(unsigned i_nocapture) const { 
+((
+i_nocapture < OperandTraits<Function>::operands(this) && "getOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<Function>::operands(this) && \"getOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/Function.h", 759, __PRETTY_FUNCTION__))
+; return cast_or_null<Value>( OperandTraits<Function>::op_begin(const_cast<Function*>(this))[i_nocapture].get()); } void Function::setOperand(unsigned i_nocapture, Value *Val_nocapture) { 
+((
+i_nocapture < OperandTraits<Function>::operands(this) && "setOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<Function>::operands(this) && \"setOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/Function.h", 759, __PRETTY_FUNCTION__))
+; OperandTraits<Function>::op_begin(this)[i_nocapture] = Val_nocapture; } unsigned Function::getNumOperands() const { return OperandTraits<Function>::operands(this); } template <int Idx_nocapture> Use &Function::Op() { return this->OpFrom<Idx_nocapture>(this); } template <int Idx_nocapture> const Use &Function::Op() const { return this->OpFrom<Idx_nocapture>(this); }
+
+}
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+
+
+
+namespace llvm {
+class TerminatorInst : public Instruction {
+protected:
+  TerminatorInst(Type *Ty, Instruction::TermOps iType,
+                 Use *Ops, unsigned NumOps,
+                 Instruction *InsertBefore = nullptr)
+    : Instruction(Ty, iType, Ops, NumOps, InsertBefore) {}
+
+  TerminatorInst(Type *Ty, Instruction::TermOps iType,
+                 Use *Ops, unsigned NumOps, BasicBlock *InsertAtEnd)
+    : Instruction(Ty, iType, Ops, NumOps, InsertAtEnd) {}
+
+public:
+
+  unsigned getNumSuccessors() const;
+
+
+  BasicBlock *getSuccessor(unsigned idx) const;
+
+
+  void setSuccessor(unsigned idx, BasicBlock *B);
+
+
+  static bool classof(const Instruction *I) {
+    return I->isTerminator();
+  }
+  static bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+
+
+  bool isExceptional() const {
+    switch (getOpcode()) {
+    case Instruction::CatchSwitch:
+    case Instruction::CatchRet:
+    case Instruction::CleanupRet:
+    case Instruction::Invoke:
+    case Instruction::Resume:
+      return true;
+    default:
+      return false;
+    }
+  }
+
+
+
+
+
+  template <class Term, class BB>
+  class SuccIterator : public std::iterator<std::random_access_iterator_tag, BB,
+                                            int, BB *, BB *> {
+    using super =
+        std::iterator<std::random_access_iterator_tag, BB, int, BB *, BB *>;
+
+  public:
+    using pointer = typename super::pointer;
+    using reference = typename super::reference;
+
+  private:
+    Term TermInst;
+    unsigned idx;
+    using Self = SuccIterator<Term, BB>;
+
+    inline bool index_is_valid(unsigned idx) {
+      return idx < TermInst->getNumSuccessors();
+    }
+
+
+    class SuccessorProxy {
+      Self it;
+
+    public:
+      explicit SuccessorProxy(const Self &it) : it(it) {}
+
+      SuccessorProxy(const SuccessorProxy &) = default;
+
+      SuccessorProxy &operator=(SuccessorProxy r) {
+        *this = reference(r);
+        return *this;
+      }
+
+      SuccessorProxy &operator=(reference r) {
+        it.TermInst->setSuccessor(it.idx, r);
+        return *this;
+      }
+
+      operator reference() const { return *it; }
+    };
+
+  public:
+
+    explicit inline SuccIterator(Term T) : TermInst(T), idx(0) {}
+
+    inline SuccIterator(Term T, bool) : TermInst(T) {
+      if (TermInst)
+        idx = TermInst->getNumSuccessors();
+      else
+
+
+
+
+
+
+        idx = 0;
+    }
+
+
+
+    unsigned getSuccessorIndex() const { return idx; }
+
+    inline bool operator==(const Self &x) const { return idx == x.idx; }
+    inline bool operator!=(const Self &x) const { return !operator==(x); }
+
+    inline reference operator*() const { return TermInst->getSuccessor(idx); }
+    inline pointer operator->() const { return operator*(); }
+
+    inline Self &operator++() {
+      ++idx;
+      return *this;
+    }
+
+    inline Self operator++(int) {
+      Self tmp = *this;
+      ++*this;
+      return tmp;
+    }
+
+    inline Self &operator--() {
+      --idx;
+      return *this;
+    }
+    inline Self operator--(int) {
+      Self tmp = *this;
+      --*this;
+      return tmp;
+    }
+
+    inline bool operator<(const Self &x) const {
+      
+     ((
+     TermInst == x.TermInst && "Cannot compare iterators of different blocks!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "TermInst == x.TermInst && \"Cannot compare iterators of different blocks!\""
+     ,
+                                                            "/home/trippels/llvm/llvm/include/llvm/IR/InstrTypes.h"
+      ,
+                                                            192
+      , __PRETTY_FUNCTION__))
+                                                             
+                                                            ;
+      return idx < x.idx;
+    }
+
+    inline bool operator<=(const Self &x) const {
+      
+     ((
+     TermInst == x.TermInst && "Cannot compare iterators of different blocks!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "TermInst == x.TermInst && \"Cannot compare iterators of different blocks!\""
+     ,
+                                                            "/home/trippels/llvm/llvm/include/llvm/IR/InstrTypes.h"
+      ,
+                                                            198
+      , __PRETTY_FUNCTION__))
+                                                             
+                                                            ;
+      return idx <= x.idx;
+    }
+    inline bool operator>=(const Self &x) const {
+      
+     ((
+     TermInst == x.TermInst && "Cannot compare iterators of different blocks!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "TermInst == x.TermInst && \"Cannot compare iterators of different blocks!\""
+     ,
+                                                            "/home/trippels/llvm/llvm/include/llvm/IR/InstrTypes.h"
+      ,
+                                                            203
+      , __PRETTY_FUNCTION__))
+                                                             
+                                                            ;
+      return idx >= x.idx;
+    }
+
+    inline bool operator>(const Self &x) const {
+      
+     ((
+     TermInst == x.TermInst && "Cannot compare iterators of different blocks!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "TermInst == x.TermInst && \"Cannot compare iterators of different blocks!\""
+     ,
+                                                            "/home/trippels/llvm/llvm/include/llvm/IR/InstrTypes.h"
+      ,
+                                                            209
+      , __PRETTY_FUNCTION__))
+                                                             
+                                                            ;
+      return idx > x.idx;
+    }
+
+    inline Self &operator+=(int Right) {
+      unsigned new_idx = idx + Right;
+      
+     ((
+     index_is_valid(new_idx) && "Iterator index out of bound"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "index_is_valid(new_idx) && \"Iterator index out of bound\""
+     , "/home/trippels/llvm/llvm/include/llvm/IR/InstrTypes.h", 215, __PRETTY_FUNCTION__))
+                                                                     ;
+      idx = new_idx;
+      return *this;
+    }
+
+    inline Self operator+(int Right) const {
+      Self tmp = *this;
+      tmp += Right;
+      return tmp;
+    }
+
+    inline Self &operator-=(int Right) { return operator+=(-Right); }
+
+    inline Self operator-(int Right) const { return operator+(-Right); }
+
+    inline int operator-(const Self &x) const {
+      
+     ((
+     TermInst == x.TermInst && "Cannot work on iterators of different blocks!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "TermInst == x.TermInst && \"Cannot work on iterators of different blocks!\""
+     ,
+                                                            "/home/trippels/llvm/llvm/include/llvm/IR/InstrTypes.h"
+      ,
+                                                            232
+      , __PRETTY_FUNCTION__))
+                                                             
+                                                            ;
+      int distance = idx - x.idx;
+      return distance;
+    }
+
+    inline SuccessorProxy operator[](int offset) {
+      Self tmp = *this;
+      tmp += offset;
+      return SuccessorProxy(tmp);
+    }
+
+
+    inline BB *getSource() {
+      
+     ((
+     TermInst && "Source not available, if basic block was malformed"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "TermInst && \"Source not available, if basic block was malformed\""
+     , "/home/trippels/llvm/llvm/include/llvm/IR/InstrTypes.h", 245, __PRETTY_FUNCTION__))
+                                                                             ;
+      return TermInst->getParent();
+    }
+  };
+
+  using succ_iterator = SuccIterator<TerminatorInst *, BasicBlock>;
+  using succ_const_iterator =
+      SuccIterator<const TerminatorInst *, const BasicBlock>;
+  using succ_range = iterator_range<succ_iterator>;
+  using succ_const_range = iterator_range<succ_const_iterator>;
+
+private:
+  inline succ_iterator succ_begin() { return succ_iterator(this); }
+  inline succ_const_iterator succ_begin() const {
+    return succ_const_iterator(this);
+  }
+  inline succ_iterator succ_end() { return succ_iterator(this, true); }
+  inline succ_const_iterator succ_end() const {
+    return succ_const_iterator(this, true);
+  }
+
+public:
+  inline succ_range successors() {
+    return succ_range(succ_begin(), succ_end());
+  }
+  inline succ_const_range successors() const {
+    return succ_const_range(succ_begin(), succ_end());
+  }
+};
+
+
+
+
+
+class UnaryInstruction : public Instruction {
+protected:
+  UnaryInstruction(Type *Ty, unsigned iType, Value *V,
+                   Instruction *IB = nullptr)
+    : Instruction(Ty, iType, &Op<0>(), 1, IB) {
+    Op<0>() = V;
+  }
+  UnaryInstruction(Type *Ty, unsigned iType, Value *V, BasicBlock *IAE)
+    : Instruction(Ty, iType, &Op<0>(), 1, IAE) {
+    Op<0>() = V;
+  }
+
+public:
+
+  void *operator new(size_t s) {
+    return User::operator new(s, 1);
+  }
+
+
+  public: inline Value *getOperand(unsigned) const; inline void setOperand(unsigned, Value*); inline op_iterator op_begin(); inline const_op_iterator op_begin() const; inline op_iterator op_end(); inline const_op_iterator op_end() const; protected: template <int> inline Use &Op(); template <int> inline const Use &Op() const; public: inline unsigned getNumOperands() const;
+
+
+  static bool classof(const Instruction *I) {
+    return I->getOpcode() == Instruction::Alloca ||
+           I->getOpcode() == Instruction::Load ||
+           I->getOpcode() == Instruction::VAArg ||
+           I->getOpcode() == Instruction::ExtractValue ||
+           (I->getOpcode() >= CastOpsBegin && I->getOpcode() < CastOpsEnd);
+  }
+  static bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+};
+
+template <>
+struct OperandTraits<UnaryInstruction> :
+  public FixedNumOperandTraits<UnaryInstruction, 1> {
+};
+
+UnaryInstruction::op_iterator UnaryInstruction::op_begin() { return OperandTraits<UnaryInstruction>::op_begin(this); } UnaryInstruction::const_op_iterator UnaryInstruction::op_begin() const { return OperandTraits<UnaryInstruction>::op_begin(const_cast<UnaryInstruction*>(this)); } UnaryInstruction::op_iterator UnaryInstruction::op_end() { return OperandTraits<UnaryInstruction>::op_end(this); } UnaryInstruction::const_op_iterator UnaryInstruction::op_end() const { return OperandTraits<UnaryInstruction>::op_end(const_cast<UnaryInstruction*>(this)); } Value *UnaryInstruction::getOperand(unsigned i_nocapture) const { 
+((
+i_nocapture < OperandTraits<UnaryInstruction>::operands(this) && "getOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<UnaryInstruction>::operands(this) && \"getOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/InstrTypes.h", 318, __PRETTY_FUNCTION__))
+; return cast_or_null<Value>( OperandTraits<UnaryInstruction>::op_begin(const_cast<UnaryInstruction*>(this))[i_nocapture].get()); } void UnaryInstruction::setOperand(unsigned i_nocapture, Value *Val_nocapture) { 
+((
+i_nocapture < OperandTraits<UnaryInstruction>::operands(this) && "setOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<UnaryInstruction>::operands(this) && \"setOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/InstrTypes.h", 318, __PRETTY_FUNCTION__))
+; OperandTraits<UnaryInstruction>::op_begin(this)[i_nocapture] = Val_nocapture; } unsigned UnaryInstruction::getNumOperands() const { return OperandTraits<UnaryInstruction>::operands(this); } template <int Idx_nocapture> Use &UnaryInstruction::Op() { return this->OpFrom<Idx_nocapture>(this); } template <int Idx_nocapture> const Use &UnaryInstruction::Op() const { return this->OpFrom<Idx_nocapture>(this); }
+
+
+
+
+
+class BinaryOperator : public Instruction {
+  void AssertOK();
+
+protected:
+  BinaryOperator(BinaryOps iType, Value *S1, Value *S2, Type *Ty,
+                 const Twine &Name, Instruction *InsertBefore);
+  BinaryOperator(BinaryOps iType, Value *S1, Value *S2, Type *Ty,
+                 const Twine &Name, BasicBlock *InsertAtEnd);
+
+
+  friend class Instruction;
+
+  BinaryOperator *cloneImpl() const;
+
+public:
+
+  void *operator new(size_t s) {
+    return User::operator new(s, 2);
+  }
+
+
+  public: inline Value *getOperand(unsigned) const; inline void setOperand(unsigned, Value*); inline op_iterator op_begin(); inline const_op_iterator op_begin() const; inline op_iterator op_end(); inline const_op_iterator op_end() const; protected: template <int> inline Use &Op(); template <int> inline const Use &Op() const; public: inline unsigned getNumOperands() const;
+
+
+
+
+
+
+  static BinaryOperator *Create(BinaryOps Op, Value *S1, Value *S2,
+                                const Twine &Name = Twine(),
+                                Instruction *InsertBefore = nullptr);
+
+
+
+
+
+  static BinaryOperator *Create(BinaryOps Op, Value *S1, Value *S2,
+                                const Twine &Name, BasicBlock *InsertAtEnd);
+
+
+
+
+
+
+
+
+
+
+
+ 
+
+
+
+static BinaryOperator *CreateAdd(Value *V1, Value *V2, const Twine &Name = "") { return Create(Instruction::Add, V1, V2, Name); }
+static BinaryOperator *CreateFAdd(Value *V1, Value *V2, const Twine &Name = "") { return Create(Instruction::FAdd, V1, V2, Name); }
+static BinaryOperator *CreateSub(Value *V1, Value *V2, const Twine &Name = "") { return Create(Instruction::Sub, V1, V2, Name); }
+static BinaryOperator *CreateFSub(Value *V1, Value *V2, const Twine &Name = "") { return Create(Instruction::FSub, V1, V2, Name); }
+static BinaryOperator *CreateMul(Value *V1, Value *V2, const Twine &Name = "") { return Create(Instruction::Mul, V1, V2, Name); }
+static BinaryOperator *CreateFMul(Value *V1, Value *V2, const Twine &Name = "") { return Create(Instruction::FMul, V1, V2, Name); }
+static BinaryOperator *CreateUDiv(Value *V1, Value *V2, const Twine &Name = "") { return Create(Instruction::UDiv, V1, V2, Name); }
+static BinaryOperator *CreateSDiv(Value *V1, Value *V2, const Twine &Name = "") { return Create(Instruction::SDiv, V1, V2, Name); }
+static BinaryOperator *CreateFDiv(Value *V1, Value *V2, const Twine &Name = "") { return Create(Instruction::FDiv, V1, V2, Name); }
+static BinaryOperator *CreateURem(Value *V1, Value *V2, const Twine &Name = "") { return Create(Instruction::URem, V1, V2, Name); }
+static BinaryOperator *CreateSRem(Value *V1, Value *V2, const Twine &Name = "") { return Create(Instruction::SRem, V1, V2, Name); }
+static BinaryOperator *CreateFRem(Value *V1, Value *V2, const Twine &Name = "") { return Create(Instruction::FRem, V1, V2, Name); }
+
+
+static BinaryOperator *CreateShl(Value *V1, Value *V2, const Twine &Name = "") { return Create(Instruction::Shl, V1, V2, Name); }
+static BinaryOperator *CreateLShr(Value *V1, Value *V2, const Twine &Name = "") { return Create(Instruction::LShr, V1, V2, Name); }
+static BinaryOperator *CreateAShr(Value *V1, Value *V2, const Twine &Name = "") { return Create(Instruction::AShr, V1, V2, Name); }
+static BinaryOperator *CreateAnd(Value *V1, Value *V2, const Twine &Name = "") { return Create(Instruction::And, V1, V2, Name); }
+static BinaryOperator *CreateOr(Value *V1, Value *V2, const Twine &Name = "") { return Create(Instruction::Or, V1, V2, Name); }
+static BinaryOperator *CreateXor(Value *V1, Value *V2, const Twine &Name = "") { return Create(Instruction::Xor, V1, V2, Name); }
+ 
+
+
+
+
+
+
+
+
+
+
+ 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 
+
+
+
+
+ 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 
+
+
+
+static BinaryOperator *CreateAdd(Value *V1, Value *V2, const Twine &Name, BasicBlock *BB) { return Create(Instruction::Add, V1, V2, Name, BB); }
+static BinaryOperator *CreateFAdd(Value *V1, Value *V2, const Twine &Name, BasicBlock *BB) { return Create(Instruction::FAdd, V1, V2, Name, BB); }
+static BinaryOperator *CreateSub(Value *V1, Value *V2, const Twine &Name, BasicBlock *BB) { return Create(Instruction::Sub, V1, V2, Name, BB); }
+static BinaryOperator *CreateFSub(Value *V1, Value *V2, const Twine &Name, BasicBlock *BB) { return Create(Instruction::FSub, V1, V2, Name, BB); }
+static BinaryOperator *CreateMul(Value *V1, Value *V2, const Twine &Name, BasicBlock *BB) { return Create(Instruction::Mul, V1, V2, Name, BB); }
+static BinaryOperator *CreateFMul(Value *V1, Value *V2, const Twine &Name, BasicBlock *BB) { return Create(Instruction::FMul, V1, V2, Name, BB); }
+static BinaryOperator *CreateUDiv(Value *V1, Value *V2, const Twine &Name, BasicBlock *BB) { return Create(Instruction::UDiv, V1, V2, Name, BB); }
+static BinaryOperator *CreateSDiv(Value *V1, Value *V2, const Twine &Name, BasicBlock *BB) { return Create(Instruction::SDiv, V1, V2, Name, BB); }
+static BinaryOperator *CreateFDiv(Value *V1, Value *V2, const Twine &Name, BasicBlock *BB) { return Create(Instruction::FDiv, V1, V2, Name, BB); }
+static BinaryOperator *CreateURem(Value *V1, Value *V2, const Twine &Name, BasicBlock *BB) { return Create(Instruction::URem, V1, V2, Name, BB); }
+static BinaryOperator *CreateSRem(Value *V1, Value *V2, const Twine &Name, BasicBlock *BB) { return Create(Instruction::SRem, V1, V2, Name, BB); }
+static BinaryOperator *CreateFRem(Value *V1, Value *V2, const Twine &Name, BasicBlock *BB) { return Create(Instruction::FRem, V1, V2, Name, BB); }
+
+
+static BinaryOperator *CreateShl(Value *V1, Value *V2, const Twine &Name, BasicBlock *BB) { return Create(Instruction::Shl, V1, V2, Name, BB); }
+static BinaryOperator *CreateLShr(Value *V1, Value *V2, const Twine &Name, BasicBlock *BB) { return Create(Instruction::LShr, V1, V2, Name, BB); }
+static BinaryOperator *CreateAShr(Value *V1, Value *V2, const Twine &Name, BasicBlock *BB) { return Create(Instruction::AShr, V1, V2, Name, BB); }
+static BinaryOperator *CreateAnd(Value *V1, Value *V2, const Twine &Name, BasicBlock *BB) { return Create(Instruction::And, V1, V2, Name, BB); }
+static BinaryOperator *CreateOr(Value *V1, Value *V2, const Twine &Name, BasicBlock *BB) { return Create(Instruction::Or, V1, V2, Name, BB); }
+static BinaryOperator *CreateXor(Value *V1, Value *V2, const Twine &Name, BasicBlock *BB) { return Create(Instruction::Xor, V1, V2, Name, BB); }
+ 
+
+
+
+
+
+
+
+
+
+
+ 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 
+
+
+
+
+ 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 
+
+
+
+static BinaryOperator *CreateAdd(Value *V1, Value *V2, const Twine &Name, Instruction *I) { return Create(Instruction::Add, V1, V2, Name, I); }
+static BinaryOperator *CreateFAdd(Value *V1, Value *V2, const Twine &Name, Instruction *I) { return Create(Instruction::FAdd, V1, V2, Name, I); }
+static BinaryOperator *CreateSub(Value *V1, Value *V2, const Twine &Name, Instruction *I) { return Create(Instruction::Sub, V1, V2, Name, I); }
+static BinaryOperator *CreateFSub(Value *V1, Value *V2, const Twine &Name, Instruction *I) { return Create(Instruction::FSub, V1, V2, Name, I); }
+static BinaryOperator *CreateMul(Value *V1, Value *V2, const Twine &Name, Instruction *I) { return Create(Instruction::Mul, V1, V2, Name, I); }
+static BinaryOperator *CreateFMul(Value *V1, Value *V2, const Twine &Name, Instruction *I) { return Create(Instruction::FMul, V1, V2, Name, I); }
+static BinaryOperator *CreateUDiv(Value *V1, Value *V2, const Twine &Name, Instruction *I) { return Create(Instruction::UDiv, V1, V2, Name, I); }
+static BinaryOperator *CreateSDiv(Value *V1, Value *V2, const Twine &Name, Instruction *I) { return Create(Instruction::SDiv, V1, V2, Name, I); }
+static BinaryOperator *CreateFDiv(Value *V1, Value *V2, const Twine &Name, Instruction *I) { return Create(Instruction::FDiv, V1, V2, Name, I); }
+static BinaryOperator *CreateURem(Value *V1, Value *V2, const Twine &Name, Instruction *I) { return Create(Instruction::URem, V1, V2, Name, I); }
+static BinaryOperator *CreateSRem(Value *V1, Value *V2, const Twine &Name, Instruction *I) { return Create(Instruction::SRem, V1, V2, Name, I); }
+static BinaryOperator *CreateFRem(Value *V1, Value *V2, const Twine &Name, Instruction *I) { return Create(Instruction::FRem, V1, V2, Name, I); }
+
+
+static BinaryOperator *CreateShl(Value *V1, Value *V2, const Twine &Name, Instruction *I) { return Create(Instruction::Shl, V1, V2, Name, I); }
+static BinaryOperator *CreateLShr(Value *V1, Value *V2, const Twine &Name, Instruction *I) { return Create(Instruction::LShr, V1, V2, Name, I); }
+static BinaryOperator *CreateAShr(Value *V1, Value *V2, const Twine &Name, Instruction *I) { return Create(Instruction::AShr, V1, V2, Name, I); }
+static BinaryOperator *CreateAnd(Value *V1, Value *V2, const Twine &Name, Instruction *I) { return Create(Instruction::And, V1, V2, Name, I); }
+static BinaryOperator *CreateOr(Value *V1, Value *V2, const Twine &Name, Instruction *I) { return Create(Instruction::Or, V1, V2, Name, I); }
+static BinaryOperator *CreateXor(Value *V1, Value *V2, const Twine &Name, Instruction *I) { return Create(Instruction::Xor, V1, V2, Name, I); }
+ 
+
+
+
+
+
+
+
+
+
+
+ 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 
+
+
+
+
+ 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 
+
+  static BinaryOperator *CreateWithCopiedFlags(BinaryOps Opc,
+                                               Value *V1, Value *V2,
+                                               BinaryOperator *CopyBO,
+                                               const Twine &Name = "") {
+    BinaryOperator *BO = Create(Opc, V1, V2, Name);
+    BO->copyIRFlags(CopyBO);
+    return BO;
+  }
+
+  static BinaryOperator *CreateNSW(BinaryOps Opc, Value *V1, Value *V2,
+                                   const Twine &Name = "") {
+    BinaryOperator *BO = Create(Opc, V1, V2, Name);
+    BO->setHasNoSignedWrap(true);
+    return BO;
+  }
+  static BinaryOperator *CreateNSW(BinaryOps Opc, Value *V1, Value *V2,
+                                   const Twine &Name, BasicBlock *BB) {
+    BinaryOperator *BO = Create(Opc, V1, V2, Name, BB);
+    BO->setHasNoSignedWrap(true);
+    return BO;
+  }
+  static BinaryOperator *CreateNSW(BinaryOps Opc, Value *V1, Value *V2,
+                                   const Twine &Name, Instruction *I) {
+    BinaryOperator *BO = Create(Opc, V1, V2, Name, I);
+    BO->setHasNoSignedWrap(true);
+    return BO;
+  }
+
+  static BinaryOperator *CreateNUW(BinaryOps Opc, Value *V1, Value *V2,
+                                   const Twine &Name = "") {
+    BinaryOperator *BO = Create(Opc, V1, V2, Name);
+    BO->setHasNoUnsignedWrap(true);
+    return BO;
+  }
+  static BinaryOperator *CreateNUW(BinaryOps Opc, Value *V1, Value *V2,
+                                   const Twine &Name, BasicBlock *BB) {
+    BinaryOperator *BO = Create(Opc, V1, V2, Name, BB);
+    BO->setHasNoUnsignedWrap(true);
+    return BO;
+  }
+  static BinaryOperator *CreateNUW(BinaryOps Opc, Value *V1, Value *V2,
+                                   const Twine &Name, Instruction *I) {
+    BinaryOperator *BO = Create(Opc, V1, V2, Name, I);
+    BO->setHasNoUnsignedWrap(true);
+    return BO;
+  }
+
+  static BinaryOperator *CreateExact(BinaryOps Opc, Value *V1, Value *V2,
+                                     const Twine &Name = "") {
+    BinaryOperator *BO = Create(Opc, V1, V2, Name);
+    BO->setIsExact(true);
+    return BO;
+  }
+  static BinaryOperator *CreateExact(BinaryOps Opc, Value *V1, Value *V2,
+                                     const Twine &Name, BasicBlock *BB) {
+    BinaryOperator *BO = Create(Opc, V1, V2, Name, BB);
+    BO->setIsExact(true);
+    return BO;
+  }
+  static BinaryOperator *CreateExact(BinaryOps Opc, Value *V1, Value *V2,
+                                     const Twine &Name, Instruction *I) {
+    BinaryOperator *BO = Create(Opc, V1, V2, Name, I);
+    BO->setIsExact(true);
+    return BO;
+  }
+  static BinaryOperator *CreateNSWAdd(Value *V1, Value *V2, const Twine &Name = "") { return CreateNSW(Instruction::Add, V1, V2, Name); } static BinaryOperator *CreateNSWAdd( Value *V1, Value *V2, const Twine &Name, BasicBlock *BB) { return CreateNSW(Instruction::Add, V1, V2, Name, BB); } static BinaryOperator *CreateNSWAdd( Value *V1, Value *V2, const Twine &Name, Instruction *I) { return CreateNSW(Instruction::Add, V1, V2, Name, I); }
+  static BinaryOperator *CreateNUWAdd(Value *V1, Value *V2, const Twine &Name = "") { return CreateNUW(Instruction::Add, V1, V2, Name); } static BinaryOperator *CreateNUWAdd( Value *V1, Value *V2, const Twine &Name, BasicBlock *BB) { return CreateNUW(Instruction::Add, V1, V2, Name, BB); } static BinaryOperator *CreateNUWAdd( Value *V1, Value *V2, const Twine &Name, Instruction *I) { return CreateNUW(Instruction::Add, V1, V2, Name, I); }
+  static BinaryOperator *CreateNSWSub(Value *V1, Value *V2, const Twine &Name = "") { return CreateNSW(Instruction::Sub, V1, V2, Name); } static BinaryOperator *CreateNSWSub( Value *V1, Value *V2, const Twine &Name, BasicBlock *BB) { return CreateNSW(Instruction::Sub, V1, V2, Name, BB); } static BinaryOperator *CreateNSWSub( Value *V1, Value *V2, const Twine &Name, Instruction *I) { return CreateNSW(Instruction::Sub, V1, V2, Name, I); }
+  static BinaryOperator *CreateNUWSub(Value *V1, Value *V2, const Twine &Name = "") { return CreateNUW(Instruction::Sub, V1, V2, Name); } static BinaryOperator *CreateNUWSub( Value *V1, Value *V2, const Twine &Name, BasicBlock *BB) { return CreateNUW(Instruction::Sub, V1, V2, Name, BB); } static BinaryOperator *CreateNUWSub( Value *V1, Value *V2, const Twine &Name, Instruction *I) { return CreateNUW(Instruction::Sub, V1, V2, Name, I); }
+  static BinaryOperator *CreateNSWMul(Value *V1, Value *V2, const Twine &Name = "") { return CreateNSW(Instruction::Mul, V1, V2, Name); } static BinaryOperator *CreateNSWMul( Value *V1, Value *V2, const Twine &Name, BasicBlock *BB) { return CreateNSW(Instruction::Mul, V1, V2, Name, BB); } static BinaryOperator *CreateNSWMul( Value *V1, Value *V2, const Twine &Name, Instruction *I) { return CreateNSW(Instruction::Mul, V1, V2, Name, I); }
+  static BinaryOperator *CreateNUWMul(Value *V1, Value *V2, const Twine &Name = "") { return CreateNUW(Instruction::Mul, V1, V2, Name); } static BinaryOperator *CreateNUWMul( Value *V1, Value *V2, const Twine &Name, BasicBlock *BB) { return CreateNUW(Instruction::Mul, V1, V2, Name, BB); } static BinaryOperator *CreateNUWMul( Value *V1, Value *V2, const Twine &Name, Instruction *I) { return CreateNUW(Instruction::Mul, V1, V2, Name, I); }
+  static BinaryOperator *CreateNSWShl(Value *V1, Value *V2, const Twine &Name = "") { return CreateNSW(Instruction::Shl, V1, V2, Name); } static BinaryOperator *CreateNSWShl( Value *V1, Value *V2, const Twine &Name, BasicBlock *BB) { return CreateNSW(Instruction::Shl, V1, V2, Name, BB); } static BinaryOperator *CreateNSWShl( Value *V1, Value *V2, const Twine &Name, Instruction *I) { return CreateNSW(Instruction::Shl, V1, V2, Name, I); }
+  static BinaryOperator *CreateNUWShl(Value *V1, Value *V2, const Twine &Name = "") { return CreateNUW(Instruction::Shl, V1, V2, Name); } static BinaryOperator *CreateNUWShl( Value *V1, Value *V2, const Twine &Name, BasicBlock *BB) { return CreateNUW(Instruction::Shl, V1, V2, Name, BB); } static BinaryOperator *CreateNUWShl( Value *V1, Value *V2, const Twine &Name, Instruction *I) { return CreateNUW(Instruction::Shl, V1, V2, Name, I); }
+
+  static BinaryOperator *CreateExactSDiv(Value *V1, Value *V2, const Twine &Name = "") { return CreateExact(Instruction::SDiv, V1, V2, Name); } static BinaryOperator *CreateExactSDiv( Value *V1, Value *V2, const Twine &Name, BasicBlock *BB) { return CreateExact(Instruction::SDiv, V1, V2, Name, BB); } static BinaryOperator *CreateExactSDiv( Value *V1, Value *V2, const Twine &Name, Instruction *I) { return CreateExact(Instruction::SDiv, V1, V2, Name, I); }
+  static BinaryOperator *CreateExactUDiv(Value *V1, Value *V2, const Twine &Name = "") { return CreateExact(Instruction::UDiv, V1, V2, Name); } static BinaryOperator *CreateExactUDiv( Value *V1, Value *V2, const Twine &Name, BasicBlock *BB) { return CreateExact(Instruction::UDiv, V1, V2, Name, BB); } static BinaryOperator *CreateExactUDiv( Value *V1, Value *V2, const Twine &Name, Instruction *I) { return CreateExact(Instruction::UDiv, V1, V2, Name, I); }
+  static BinaryOperator *CreateExactAShr(Value *V1, Value *V2, const Twine &Name = "") { return CreateExact(Instruction::AShr, V1, V2, Name); } static BinaryOperator *CreateExactAShr( Value *V1, Value *V2, const Twine &Name, BasicBlock *BB) { return CreateExact(Instruction::AShr, V1, V2, Name, BB); } static BinaryOperator *CreateExactAShr( Value *V1, Value *V2, const Twine &Name, Instruction *I) { return CreateExact(Instruction::AShr, V1, V2, Name, I); }
+  static BinaryOperator *CreateExactLShr(Value *V1, Value *V2, const Twine &Name = "") { return CreateExact(Instruction::LShr, V1, V2, Name); } static BinaryOperator *CreateExactLShr( Value *V1, Value *V2, const Twine &Name, BasicBlock *BB) { return CreateExact(Instruction::LShr, V1, V2, Name, BB); } static BinaryOperator *CreateExactLShr( Value *V1, Value *V2, const Twine &Name, Instruction *I) { return CreateExact(Instruction::LShr, V1, V2, Name, I); }
+  static BinaryOperator *CreateNeg(Value *Op, const Twine &Name = "",
+                                   Instruction *InsertBefore = nullptr);
+  static BinaryOperator *CreateNeg(Value *Op, const Twine &Name,
+                                   BasicBlock *InsertAtEnd);
+  static BinaryOperator *CreateNSWNeg(Value *Op, const Twine &Name = "",
+                                      Instruction *InsertBefore = nullptr);
+  static BinaryOperator *CreateNSWNeg(Value *Op, const Twine &Name,
+                                      BasicBlock *InsertAtEnd);
+  static BinaryOperator *CreateNUWNeg(Value *Op, const Twine &Name = "",
+                                      Instruction *InsertBefore = nullptr);
+  static BinaryOperator *CreateNUWNeg(Value *Op, const Twine &Name,
+                                      BasicBlock *InsertAtEnd);
+  static BinaryOperator *CreateFNeg(Value *Op, const Twine &Name = "",
+                                    Instruction *InsertBefore = nullptr);
+  static BinaryOperator *CreateFNeg(Value *Op, const Twine &Name,
+                                    BasicBlock *InsertAtEnd);
+  static BinaryOperator *CreateNot(Value *Op, const Twine &Name = "",
+                                   Instruction *InsertBefore = nullptr);
+  static BinaryOperator *CreateNot(Value *Op, const Twine &Name,
+                                   BasicBlock *InsertAtEnd);
+
+
+
+  static bool isNeg(const Value *V);
+  static bool isFNeg(const Value *V, bool IgnoreZeroSign=false);
+  static bool isNot(const Value *V);
+
+
+
+
+  static const Value *getNegArgument(const Value *BinOp);
+  static Value *getNegArgument( Value *BinOp);
+  static const Value *getFNegArgument(const Value *BinOp);
+  static Value *getFNegArgument( Value *BinOp);
+  static const Value *getNotArgument(const Value *BinOp);
+  static Value *getNotArgument( Value *BinOp);
+
+  BinaryOps getOpcode() const {
+    return static_cast<BinaryOps>(Instruction::getOpcode());
+  }
+
+
+
+
+
+
+  bool swapOperands();
+
+
+  static bool classof(const Instruction *I) {
+    return I->isBinaryOp();
+  }
+  static bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+};
+
+template <>
+struct OperandTraits<BinaryOperator> :
+  public FixedNumOperandTraits<BinaryOperator, 2> {
+};
+
+BinaryOperator::op_iterator BinaryOperator::op_begin() { return OperandTraits<BinaryOperator>::op_begin(this); } BinaryOperator::const_op_iterator BinaryOperator::op_begin() const { return OperandTraits<BinaryOperator>::op_begin(const_cast<BinaryOperator*>(this)); } BinaryOperator::op_iterator BinaryOperator::op_end() { return OperandTraits<BinaryOperator>::op_end(this); } BinaryOperator::const_op_iterator BinaryOperator::op_end() const { return OperandTraits<BinaryOperator>::op_end(const_cast<BinaryOperator*>(this)); } Value *BinaryOperator::getOperand(unsigned i_nocapture) const { 
+((
+i_nocapture < OperandTraits<BinaryOperator>::operands(this) && "getOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<BinaryOperator>::operands(this) && \"getOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/InstrTypes.h", 548, __PRETTY_FUNCTION__))
+; return cast_or_null<Value>( OperandTraits<BinaryOperator>::op_begin(const_cast<BinaryOperator*>(this))[i_nocapture].get()); } void BinaryOperator::setOperand(unsigned i_nocapture, Value *Val_nocapture) { 
+((
+i_nocapture < OperandTraits<BinaryOperator>::operands(this) && "setOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<BinaryOperator>::operands(this) && \"setOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/InstrTypes.h", 548, __PRETTY_FUNCTION__))
+; OperandTraits<BinaryOperator>::op_begin(this)[i_nocapture] = Val_nocapture; } unsigned BinaryOperator::getNumOperands() const { return OperandTraits<BinaryOperator>::operands(this); } template <int Idx_nocapture> Use &BinaryOperator::Op() { return this->OpFrom<Idx_nocapture>(this); } template <int Idx_nocapture> const Use &BinaryOperator::Op() const { return this->OpFrom<Idx_nocapture>(this); }
+class CastInst : public UnaryInstruction {
+protected:
+
+  CastInst(Type *Ty, unsigned iType, Value *S,
+           const Twine &NameStr = "", Instruction *InsertBefore = nullptr)
+    : UnaryInstruction(Ty, iType, S, InsertBefore) {
+    setName(NameStr);
+  }
+
+  CastInst(Type *Ty, unsigned iType, Value *S,
+           const Twine &NameStr, BasicBlock *InsertAtEnd)
+    : UnaryInstruction(Ty, iType, S, InsertAtEnd) {
+    setName(NameStr);
+  }
+
+public:
+
+
+
+
+
+
+  static CastInst *Create(
+    Instruction::CastOps,
+    Value *S,
+    Type *Ty,
+    const Twine &Name = "",
+    Instruction *InsertBefore = nullptr
+  );
+
+
+
+
+
+
+  static CastInst *Create(
+    Instruction::CastOps,
+    Value *S,
+    Type *Ty,
+    const Twine &Name,
+    BasicBlock *InsertAtEnd
+  );
+
+
+  static CastInst *CreateZExtOrBitCast(
+    Value *S,
+    Type *Ty,
+    const Twine &Name = "",
+    Instruction *InsertBefore = nullptr
+  );
+
+
+  static CastInst *CreateZExtOrBitCast(
+    Value *S,
+    Type *Ty,
+    const Twine &Name,
+    BasicBlock *InsertAtEnd
+  );
+
+
+  static CastInst *CreateSExtOrBitCast(
+    Value *S,
+    Type *Ty,
+    const Twine &Name = "",
+    Instruction *InsertBefore = nullptr
+  );
+
+
+  static CastInst *CreateSExtOrBitCast(
+    Value *S,
+    Type *Ty,
+    const Twine &Name,
+    BasicBlock *InsertAtEnd
+  );
+
+
+  static CastInst *CreatePointerCast(
+    Value *S,
+    Type *Ty,
+    const Twine &Name,
+    BasicBlock *InsertAtEnd
+  );
+
+
+  static CastInst *CreatePointerCast(
+    Value *S,
+    Type *Ty,
+    const Twine &Name = "",
+    Instruction *InsertBefore = nullptr
+  );
+
+
+  static CastInst *CreatePointerBitCastOrAddrSpaceCast(
+    Value *S,
+    Type *Ty,
+    const Twine &Name,
+    BasicBlock *InsertAtEnd
+  );
+
+
+  static CastInst *CreatePointerBitCastOrAddrSpaceCast(
+    Value *S,
+    Type *Ty,
+    const Twine &Name = "",
+    Instruction *InsertBefore = nullptr
+  );
+
+
+
+
+
+
+
+  static CastInst *CreateBitOrPointerCast(
+    Value *S,
+    Type *Ty,
+    const Twine &Name = "",
+    Instruction *InsertBefore = nullptr
+  );
+
+
+  static CastInst *CreateIntegerCast(
+    Value *S,
+    Type *Ty,
+    bool isSigned,
+    const Twine &Name = "",
+    Instruction *InsertBefore = nullptr
+  );
+
+
+  static CastInst *CreateIntegerCast(
+    Value *S,
+    Type *Ty,
+    bool isSigned,
+    const Twine &Name,
+    BasicBlock *InsertAtEnd
+  );
+
+
+  static CastInst *CreateFPCast(
+    Value *S,
+    Type *Ty,
+    const Twine &Name = "",
+    Instruction *InsertBefore = nullptr
+  );
+
+
+  static CastInst *CreateFPCast(
+    Value *S,
+    Type *Ty,
+    const Twine &Name,
+    BasicBlock *InsertAtEnd
+  );
+
+
+  static CastInst *CreateTruncOrBitCast(
+    Value *S,
+    Type *Ty,
+    const Twine &Name = "",
+    Instruction *InsertBefore = nullptr
+  );
+
+
+  static CastInst *CreateTruncOrBitCast(
+    Value *S,
+    Type *Ty,
+    const Twine &Name,
+    BasicBlock *InsertAtEnd
+  );
+
+
+  static bool isCastable(
+    Type *SrcTy,
+    Type *DestTy
+  );
+
+
+  static bool isBitCastable(
+    Type *SrcTy,
+    Type *DestTy
+  );
+
+
+
+
+
+
+  static bool isBitOrNoopPointerCastable(
+      Type *SrcTy,
+      Type *DestTy,
+      const DataLayout &DL);
+
+
+
+
+  static Instruction::CastOps getCastOpcode(
+    const Value *Val,
+    bool SrcIsSigned,
+    Type *Ty,
+    bool DstIsSigned
+  );
+
+
+
+
+
+
+  bool isIntegerCast() const;
+
+
+
+
+
+
+  bool isLosslessCast() const;
+  static bool isNoopCast(
+    Instruction::CastOps Opcode,
+    Type *SrcTy,
+    Type *DstTy,
+    const DataLayout &DL
+  );
+
+
+
+
+  bool isNoopCast(const DataLayout &DL) const;
+
+
+
+
+
+
+
+  static unsigned isEliminableCastPair(
+    Instruction::CastOps firstOpcode,
+    Instruction::CastOps secondOpcode,
+    Type *SrcTy,
+    Type *MidTy,
+    Type *DstTy,
+    Type *SrcIntPtrTy,
+    Type *MidIntPtrTy,
+    Type *DstIntPtrTy
+  );
+
+
+  Instruction::CastOps getOpcode() const {
+    return Instruction::CastOps(Instruction::getOpcode());
+  }
+
+
+  Type* getSrcTy() const { return getOperand(0)->getType(); }
+
+  Type* getDestTy() const { return getType(); }
+
+
+
+
+
+  static bool castIsValid(Instruction::CastOps op, Value *S, Type *DstTy);
+
+
+  static bool classof(const Instruction *I) {
+    return I->isCast();
+  }
+  static bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+};
+
+
+
+
+
+
+
+class CmpInst : public Instruction {
+public:
+  enum Predicate {
+
+    FCMP_FALSE = 0,
+    FCMP_OEQ = 1,
+    FCMP_OGT = 2,
+    FCMP_OGE = 3,
+    FCMP_OLT = 4,
+    FCMP_OLE = 5,
+    FCMP_ONE = 6,
+    FCMP_ORD = 7,
+    FCMP_UNO = 8,
+    FCMP_UEQ = 9,
+    FCMP_UGT = 10,
+    FCMP_UGE = 11,
+    FCMP_ULT = 12,
+    FCMP_ULE = 13,
+    FCMP_UNE = 14,
+    FCMP_TRUE = 15,
+    FIRST_FCMP_PREDICATE = FCMP_FALSE,
+    LAST_FCMP_PREDICATE = FCMP_TRUE,
+    BAD_FCMP_PREDICATE = FCMP_TRUE + 1,
+    ICMP_EQ = 32,
+    ICMP_NE = 33,
+    ICMP_UGT = 34,
+    ICMP_UGE = 35,
+    ICMP_ULT = 36,
+    ICMP_ULE = 37,
+    ICMP_SGT = 38,
+    ICMP_SGE = 39,
+    ICMP_SLT = 40,
+    ICMP_SLE = 41,
+    FIRST_ICMP_PREDICATE = ICMP_EQ,
+    LAST_ICMP_PREDICATE = ICMP_SLE,
+    BAD_ICMP_PREDICATE = ICMP_SLE + 1
+  };
+
+protected:
+  CmpInst(Type *ty, Instruction::OtherOps op, Predicate pred,
+          Value *LHS, Value *RHS, const Twine &Name = "",
+          Instruction *InsertBefore = nullptr);
+
+  CmpInst(Type *ty, Instruction::OtherOps op, Predicate pred,
+          Value *LHS, Value *RHS, const Twine &Name,
+          BasicBlock *InsertAtEnd);
+
+public:
+
+  void *operator new(size_t s) {
+    return User::operator new(s, 2);
+  }
+
+
+
+
+
+
+  static CmpInst *Create(OtherOps Op,
+                         Predicate predicate, Value *S1,
+                         Value *S2, const Twine &Name = "",
+                         Instruction *InsertBefore = nullptr);
+
+
+
+
+
+  static CmpInst *Create(OtherOps Op, Predicate predicate, Value *S1,
+                         Value *S2, const Twine &Name, BasicBlock *InsertAtEnd);
+
+
+  OtherOps getOpcode() const {
+    return static_cast<OtherOps>(Instruction::getOpcode());
+  }
+
+
+  Predicate getPredicate() const {
+    return Predicate(getSubclassDataFromInstruction());
+  }
+
+
+  void setPredicate(Predicate P) { setInstructionSubclassData(P); }
+
+  static bool isFPPredicate(Predicate P) {
+    return P >= FIRST_FCMP_PREDICATE && P <= LAST_FCMP_PREDICATE;
+  }
+
+  static bool isIntPredicate(Predicate P) {
+    return P >= FIRST_ICMP_PREDICATE && P <= LAST_ICMP_PREDICATE;
+  }
+
+  static StringRef getPredicateName(Predicate P);
+
+  bool isFPPredicate() const { return isFPPredicate(getPredicate()); }
+  bool isIntPredicate() const { return isIntPredicate(getPredicate()); }
+
+
+
+
+
+  Predicate getInversePredicate() const {
+    return getInversePredicate(getPredicate());
+  }
+
+
+
+
+
+  static Predicate getInversePredicate(Predicate pred);
+
+
+
+
+
+
+
+  Predicate getSwappedPredicate() const {
+    return getSwappedPredicate(getPredicate());
+  }
+
+
+
+
+  static Predicate getSwappedPredicate(Predicate pred);
+
+
+  public: inline Value *getOperand(unsigned) const; inline void setOperand(unsigned, Value*); inline op_iterator op_begin(); inline const_op_iterator op_begin() const; inline op_iterator op_end(); inline const_op_iterator op_end() const; protected: template <int> inline Use &Op(); template <int> inline const Use &Op() const; public: inline unsigned getNumOperands() const;
+
+
+
+
+  void swapOperands();
+
+
+
+  bool isCommutative() const;
+
+
+
+  bool isEquality() const;
+
+
+
+  bool isSigned() const {
+    return isSigned(getPredicate());
+  }
+
+
+
+  bool isUnsigned() const {
+    return isUnsigned(getPredicate());
+  }
+
+
+
+
+  static Predicate getSignedPredicate(Predicate pred);
+
+
+
+
+
+  Predicate getSignedPredicate() {
+    return getSignedPredicate(getPredicate());
+  }
+
+
+
+  bool isTrueWhenEqual() const {
+    return isTrueWhenEqual(getPredicate());
+  }
+
+
+
+  bool isFalseWhenEqual() const {
+    return isFalseWhenEqual(getPredicate());
+  }
+
+
+
+  static bool isUnsigned(Predicate predicate);
+
+
+
+  static bool isSigned(Predicate predicate);
+
+
+  static bool isOrdered(Predicate predicate);
+
+
+  static bool isUnordered(Predicate predicate);
+
+
+  static bool isTrueWhenEqual(Predicate predicate);
+
+
+  static bool isFalseWhenEqual(Predicate predicate);
+
+
+
+  static bool isImpliedTrueByMatchingCmp(Predicate Pred1, Predicate Pred2);
+
+
+
+  static bool isImpliedFalseByMatchingCmp(Predicate Pred1, Predicate Pred2);
+
+
+  static bool classof(const Instruction *I) {
+    return I->getOpcode() == Instruction::ICmp ||
+           I->getOpcode() == Instruction::FCmp;
+  }
+  static bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+
+
+  static Type* makeCmpResultType(Type* opnd_type) {
+    if (VectorType* vt = dyn_cast<VectorType>(opnd_type)) {
+      return VectorType::get(Type::getInt1Ty(opnd_type->getContext()),
+                             vt->getNumElements());
+    }
+    return Type::getInt1Ty(opnd_type->getContext());
+  }
+
+private:
+
+
+  void setValueSubclassData(unsigned short D) {
+    Value::setValueSubclassData(D);
+  }
+};
+
+
+template <>
+struct OperandTraits<CmpInst> : public FixedNumOperandTraits<CmpInst, 2> {
+};
+
+CmpInst::op_iterator CmpInst::op_begin() { return OperandTraits<CmpInst>::op_begin(this); } CmpInst::const_op_iterator CmpInst::op_begin() const { return OperandTraits<CmpInst>::op_begin(const_cast<CmpInst*>(this)); } CmpInst::op_iterator CmpInst::op_end() { return OperandTraits<CmpInst>::op_end(this); } CmpInst::const_op_iterator CmpInst::op_end() const { return OperandTraits<CmpInst>::op_end(const_cast<CmpInst*>(this)); } Value *CmpInst::getOperand(unsigned i_nocapture) const { 
+((
+i_nocapture < OperandTraits<CmpInst>::operands(this) && "getOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<CmpInst>::operands(this) && \"getOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/InstrTypes.h", 1088, __PRETTY_FUNCTION__))
+; return cast_or_null<Value>( OperandTraits<CmpInst>::op_begin(const_cast<CmpInst*>(this))[i_nocapture].get()); } void CmpInst::setOperand(unsigned i_nocapture, Value *Val_nocapture) { 
+((
+i_nocapture < OperandTraits<CmpInst>::operands(this) && "setOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<CmpInst>::operands(this) && \"setOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/InstrTypes.h", 1088, __PRETTY_FUNCTION__))
+; OperandTraits<CmpInst>::op_begin(this)[i_nocapture] = Val_nocapture; } unsigned CmpInst::getNumOperands() const { return OperandTraits<CmpInst>::operands(this); } template <int Idx_nocapture> Use &CmpInst::Op() { return this->OpFrom<Idx_nocapture>(this); } template <int Idx_nocapture> const Use &CmpInst::Op() const { return this->OpFrom<Idx_nocapture>(this); }
+
+
+
+
+class FuncletPadInst : public Instruction {
+private:
+  FuncletPadInst(const FuncletPadInst &CPI);
+
+  explicit FuncletPadInst(Instruction::FuncletPadOps Op, Value *ParentPad,
+                          ArrayRef<Value *> Args, unsigned Values,
+                          const Twine &NameStr, Instruction *InsertBefore);
+  explicit FuncletPadInst(Instruction::FuncletPadOps Op, Value *ParentPad,
+                          ArrayRef<Value *> Args, unsigned Values,
+                          const Twine &NameStr, BasicBlock *InsertAtEnd);
+
+  void init(Value *ParentPad, ArrayRef<Value *> Args, const Twine &NameStr);
+
+protected:
+
+  friend class Instruction;
+  friend class CatchPadInst;
+  friend class CleanupPadInst;
+
+  FuncletPadInst *cloneImpl() const;
+
+public:
+
+  public: inline Value *getOperand(unsigned) const; inline void setOperand(unsigned, Value*); inline op_iterator op_begin(); inline const_op_iterator op_begin() const; inline op_iterator op_end(); inline const_op_iterator op_end() const; protected: template <int> inline Use &Op(); template <int> inline const Use &Op() const; public: inline unsigned getNumOperands() const;
+
+
+
+  unsigned getNumArgOperands() const { return getNumOperands() - 1; }
+
+
+
+
+
+
+
+  Value *getParentPad() const { return Op<-1>(); }
+  void setParentPad(Value *ParentPad) {
+    
+   ((
+   ParentPad
+   ) ? static_cast<void> (0) : __assert_fail (
+   "ParentPad"
+   , "/home/trippels/llvm/llvm/include/llvm/IR/InstrTypes.h", 1130, __PRETTY_FUNCTION__))
+                    ;
+    Op<-1>() = ParentPad;
+  }
+
+
+
+  Value *getArgOperand(unsigned i) const { return getOperand(i); }
+  void setArgOperand(unsigned i, Value *v) { setOperand(i, v); }
+
+
+  op_range arg_operands() { return op_range(op_begin(), op_end() - 1); }
+
+
+  const_op_range arg_operands() const {
+    return const_op_range(op_begin(), op_end() - 1);
+  }
+
+
+  static bool classof(const Instruction *I) { return I->isFuncletPad(); }
+  static bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+};
+
+template <>
+struct OperandTraits<FuncletPadInst>
+    : public VariadicOperandTraits<FuncletPadInst, 1> {};
+
+FuncletPadInst::op_iterator FuncletPadInst::op_begin() { return OperandTraits<FuncletPadInst>::op_begin(this); } FuncletPadInst::const_op_iterator FuncletPadInst::op_begin() const { return OperandTraits<FuncletPadInst>::op_begin(const_cast<FuncletPadInst*>(this)); } FuncletPadInst::op_iterator FuncletPadInst::op_end() { return OperandTraits<FuncletPadInst>::op_end(this); } FuncletPadInst::const_op_iterator FuncletPadInst::op_end() const { return OperandTraits<FuncletPadInst>::op_end(const_cast<FuncletPadInst*>(this)); } Value *FuncletPadInst::getOperand(unsigned i_nocapture) const { 
+((
+i_nocapture < OperandTraits<FuncletPadInst>::operands(this) && "getOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<FuncletPadInst>::operands(this) && \"getOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/InstrTypes.h", 1158, __PRETTY_FUNCTION__))
+; return cast_or_null<Value>( OperandTraits<FuncletPadInst>::op_begin(const_cast<FuncletPadInst*>(this))[i_nocapture].get()); } void FuncletPadInst::setOperand(unsigned i_nocapture, Value *Val_nocapture) { 
+((
+i_nocapture < OperandTraits<FuncletPadInst>::operands(this) && "setOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<FuncletPadInst>::operands(this) && \"setOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/InstrTypes.h", 1158, __PRETTY_FUNCTION__))
+; OperandTraits<FuncletPadInst>::op_begin(this)[i_nocapture] = Val_nocapture; } unsigned FuncletPadInst::getNumOperands() const { return OperandTraits<FuncletPadInst>::operands(this); } template <int Idx_nocapture> Use &FuncletPadInst::Op() { return this->OpFrom<Idx_nocapture>(this); } template <int Idx_nocapture> const Use &FuncletPadInst::Op() const { return this->OpFrom<Idx_nocapture>(this); }
+
+
+
+struct OperandBundleUse {
+  ArrayRef<Use> Inputs;
+
+  OperandBundleUse() = default;
+  explicit OperandBundleUse(StringMapEntry<uint32_t> *Tag, ArrayRef<Use> Inputs)
+      : Inputs(Inputs), Tag(Tag) {}
+
+
+
+  bool operandHasAttr(unsigned Idx, Attribute::AttrKind A) const {
+    if (isDeoptOperandBundle())
+      if (A == Attribute::ReadOnly || A == Attribute::NoCapture)
+        return Inputs[Idx]->getType()->isPointerTy();
+
+
+    return false;
+  }
+
+
+  StringRef getTagName() const {
+    return Tag->getKey();
+  }
+
+
+
+
+
+
+  uint32_t getTagID() const {
+    return Tag->getValue();
+  }
+
+
+  bool isDeoptOperandBundle() const {
+    return getTagID() == LLVMContext::OB_deopt;
+  }
+
+
+  bool isFuncletOperandBundle() const {
+    return getTagID() == LLVMContext::OB_funclet;
+  }
+
+private:
+
+  StringMapEntry<uint32_t> *Tag;
+};
+
+
+
+
+
+
+
+template <typename InputTy> class OperandBundleDefT {
+  std::string Tag;
+  std::vector<InputTy> Inputs;
+
+public:
+  explicit OperandBundleDefT(std::string Tag, std::vector<InputTy> Inputs)
+      : Tag(std::move(Tag)), Inputs(std::move(Inputs)) {}
+  explicit OperandBundleDefT(std::string Tag, ArrayRef<InputTy> Inputs)
+      : Tag(std::move(Tag)), Inputs(Inputs) {}
+
+  explicit OperandBundleDefT(const OperandBundleUse &OBU) {
+    Tag = OBU.getTagName();
+    Inputs.insert(Inputs.end(), OBU.Inputs.begin(), OBU.Inputs.end());
+  }
+
+  ArrayRef<InputTy> inputs() const { return Inputs; }
+
+  using input_iterator = typename std::vector<InputTy>::const_iterator;
+
+  size_t input_size() const { return Inputs.size(); }
+  input_iterator input_begin() const { return Inputs.begin(); }
+  input_iterator input_end() const { return Inputs.end(); }
+
+  StringRef getTag() const { return Tag; }
+};
+
+using OperandBundleDef = OperandBundleDefT<Value *>;
+using ConstOperandBundleDef = OperandBundleDefT<const Value *>;
+template <typename InstrTy, typename OpIteratorTy> class OperandBundleUser {
+public:
+
+  unsigned getNumOperandBundles() const {
+    return std::distance(bundle_op_info_begin(), bundle_op_info_end());
+  }
+
+
+  bool hasOperandBundles() const { return getNumOperandBundles() != 0; }
+
+
+  unsigned getBundleOperandsStartIndex() const {
+    
+   ((
+   hasOperandBundles() && "Don't call otherwise!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "hasOperandBundles() && \"Don't call otherwise!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/InstrTypes.h", 1302, __PRETTY_FUNCTION__))
+                                                         ;
+    return bundle_op_info_begin()->Begin;
+  }
+
+
+  unsigned getBundleOperandsEndIndex() const {
+    
+   ((
+   hasOperandBundles() && "Don't call otherwise!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "hasOperandBundles() && \"Don't call otherwise!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/InstrTypes.h", 1308, __PRETTY_FUNCTION__))
+                                                         ;
+    return bundle_op_info_end()[-1].End;
+  }
+
+
+  bool isBundleOperand(unsigned Idx) const {
+    return hasOperandBundles() && Idx >= getBundleOperandsStartIndex() &&
+           Idx < getBundleOperandsEndIndex();
+  }
+
+
+
+  unsigned getNumTotalBundleOperands() const {
+    if (!hasOperandBundles())
+      return 0;
+
+    unsigned Begin = getBundleOperandsStartIndex();
+    unsigned End = getBundleOperandsEndIndex();
+
+    
+   ((
+   Begin <= End && "Should be!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Begin <= End && \"Should be!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/InstrTypes.h", 1327, __PRETTY_FUNCTION__))
+                                       ;
+    return End - Begin;
+  }
+
+
+  OperandBundleUse getOperandBundleAt(unsigned Index) const {
+    
+   ((
+   Index < getNumOperandBundles() && "Index out of bounds!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Index < getNumOperandBundles() && \"Index out of bounds!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/InstrTypes.h", 1333, __PRETTY_FUNCTION__))
+                                                                   ;
+    return operandBundleFromBundleOpInfo(*(bundle_op_info_begin() + Index));
+  }
+
+
+
+  unsigned countOperandBundlesOfType(StringRef Name) const {
+    unsigned Count = 0;
+    for (unsigned i = 0, e = getNumOperandBundles(); i != e; ++i)
+      if (getOperandBundleAt(i).getTagName() == Name)
+        Count++;
+
+    return Count;
+  }
+
+
+
+  unsigned countOperandBundlesOfType(uint32_t ID) const {
+    unsigned Count = 0;
+    for (unsigned i = 0, e = getNumOperandBundles(); i != e; ++i)
+      if (getOperandBundleAt(i).getTagID() == ID)
+        Count++;
+
+    return Count;
+  }
+
+
+
+
+
+  Optional<OperandBundleUse> getOperandBundle(StringRef Name) const {
+    
+   ((
+   countOperandBundlesOfType(Name) < 2 && "Precondition violated!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "countOperandBundlesOfType(Name) < 2 && \"Precondition violated!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/InstrTypes.h", 1364, __PRETTY_FUNCTION__))
+                                                                          ;
+
+    for (unsigned i = 0, e = getNumOperandBundles(); i != e; ++i) {
+      OperandBundleUse U = getOperandBundleAt(i);
+      if (U.getTagName() == Name)
+        return U;
+    }
+
+    return None;
+  }
+
+
+
+
+
+  Optional<OperandBundleUse> getOperandBundle(uint32_t ID) const {
+    
+   ((
+   countOperandBundlesOfType(ID) < 2 && "Precondition violated!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "countOperandBundlesOfType(ID) < 2 && \"Precondition violated!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/InstrTypes.h", 1380, __PRETTY_FUNCTION__))
+                                                                        ;
+
+    for (unsigned i = 0, e = getNumOperandBundles(); i != e; ++i) {
+      OperandBundleUse U = getOperandBundleAt(i);
+      if (U.getTagID() == ID)
+        return U;
+    }
+
+    return None;
+  }
+  void getOperandBundlesAsDefs(SmallVectorImpl<OperandBundleDef> &Defs) const {
+    for (unsigned i = 0, e = getNumOperandBundles(); i != e; ++i)
+      Defs.emplace_back(getOperandBundleAt(i));
+  }
+
+
+
+
+
+  OperandBundleUse getOperandBundleForOperand(unsigned OpIdx) const {
+    return operandBundleFromBundleOpInfo(getBundleOpInfoForOperand(OpIdx));
+  }
+
+
+
+  bool hasReadingOperandBundles() const {
+
+
+
+    return hasOperandBundles();
+  }
+
+
+
+  bool hasClobberingOperandBundles() const {
+    for (auto &BOI : bundle_op_infos()) {
+      if (BOI.Tag->second == LLVMContext::OB_deopt ||
+          BOI.Tag->second == LLVMContext::OB_funclet)
+        continue;
+
+
+
+      return true;
+    }
+
+    return false;
+  }
+
+
+
+  bool bundleOperandHasAttr(unsigned OpIdx, Attribute::AttrKind A) const {
+    auto &BOI = getBundleOpInfoForOperand(OpIdx);
+    auto OBU = operandBundleFromBundleOpInfo(BOI);
+    return OBU.operandHasAttr(OpIdx - BOI.Begin, A);
+  }
+
+
+
+
+  bool hasIdenticalOperandBundleSchema(
+      const OperandBundleUser<InstrTy, OpIteratorTy> &Other) const {
+    if (getNumOperandBundles() != Other.getNumOperandBundles())
+      return false;
+
+    return std::equal(bundle_op_info_begin(), bundle_op_info_end(),
+                      Other.bundle_op_info_begin());
+  }
+
+
+
+  bool hasOperandBundlesOtherThan(ArrayRef<uint32_t> IDs) const {
+    for (unsigned i = 0, e = getNumOperandBundles(); i != e; ++i) {
+      uint32_t ID = getOperandBundleAt(i).getTagID();
+      if (!is_contained(IDs, ID))
+        return true;
+    }
+    return false;
+  }
+
+protected:
+
+
+  bool isFnAttrDisallowedByOpBundle(StringRef S) const {
+
+
+    return false;
+  }
+
+
+
+  bool isFnAttrDisallowedByOpBundle(Attribute::AttrKind A) const {
+    switch (A) {
+    default:
+      return false;
+
+    case Attribute::InaccessibleMemOrArgMemOnly:
+      return hasReadingOperandBundles();
+
+    case Attribute::InaccessibleMemOnly:
+      return hasReadingOperandBundles();
+
+    case Attribute::ArgMemOnly:
+      return hasReadingOperandBundles();
+
+    case Attribute::ReadNone:
+      return hasReadingOperandBundles();
+
+    case Attribute::ReadOnly:
+      return hasClobberingOperandBundles();
+    }
+
+    ::llvm::llvm_unreachable_internal("switch has a default case!", "/home/trippels/llvm/llvm/include/llvm/IR/InstrTypes.h", 1499);
+  }
+
+
+
+  struct BundleOpInfo {
+
+
+    StringMapEntry<uint32_t> *Tag;
+
+
+
+    uint32_t Begin;
+
+
+
+    uint32_t End;
+
+    bool operator==(const BundleOpInfo &Other) const {
+      return Tag == Other.Tag && Begin == Other.Begin && End == Other.End;
+    }
+  };
+
+
+
+  OperandBundleUse
+  operandBundleFromBundleOpInfo(const BundleOpInfo &BOI) const {
+    auto op_begin = static_cast<const InstrTy *>(this)->op_begin();
+    ArrayRef<Use> Inputs(op_begin + BOI.Begin, op_begin + BOI.End);
+    return OperandBundleUse(BOI.Tag, Inputs);
+  }
+
+  using bundle_op_iterator = BundleOpInfo *;
+  using const_bundle_op_iterator = const BundleOpInfo *;
+
+
+
+  bundle_op_iterator bundle_op_info_begin() {
+    if (!static_cast<InstrTy *>(this)->hasDescriptor())
+      return nullptr;
+
+    uint8_t *BytesBegin = static_cast<InstrTy *>(this)->getDescriptor().begin();
+    return reinterpret_cast<bundle_op_iterator>(BytesBegin);
+  }
+
+
+
+  const_bundle_op_iterator bundle_op_info_begin() const {
+    auto *NonConstThis =
+        const_cast<OperandBundleUser<InstrTy, OpIteratorTy> *>(this);
+    return NonConstThis->bundle_op_info_begin();
+  }
+
+
+
+  bundle_op_iterator bundle_op_info_end() {
+    if (!static_cast<InstrTy *>(this)->hasDescriptor())
+      return nullptr;
+
+    uint8_t *BytesEnd = static_cast<InstrTy *>(this)->getDescriptor().end();
+    return reinterpret_cast<bundle_op_iterator>(BytesEnd);
+  }
+
+
+
+  const_bundle_op_iterator bundle_op_info_end() const {
+    auto *NonConstThis =
+        const_cast<OperandBundleUser<InstrTy, OpIteratorTy> *>(this);
+    return NonConstThis->bundle_op_info_end();
+  }
+
+
+  iterator_range<bundle_op_iterator> bundle_op_infos() {
+    return make_range(bundle_op_info_begin(), bundle_op_info_end());
+  }
+
+
+  iterator_range<const_bundle_op_iterator> bundle_op_infos() const {
+    return make_range(bundle_op_info_begin(), bundle_op_info_end());
+  }
+
+
+
+
+
+
+
+  OpIteratorTy populateBundleOperandInfos(ArrayRef<OperandBundleDef> Bundles,
+                                          const unsigned BeginIndex) {
+    auto It = static_cast<InstrTy *>(this)->op_begin() + BeginIndex;
+    for (auto &B : Bundles)
+      It = std::copy(B.input_begin(), B.input_end(), It);
+
+    auto *ContextImpl = static_cast<InstrTy *>(this)->getContext().pImpl;
+    auto BI = Bundles.begin();
+    unsigned CurrentIndex = BeginIndex;
+
+    for (auto &BOI : bundle_op_infos()) {
+      
+     ((
+     BI != Bundles.end() && "Incorrect allocation?"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "BI != Bundles.end() && \"Incorrect allocation?\""
+     , "/home/trippels/llvm/llvm/include/llvm/IR/InstrTypes.h", 1597, __PRETTY_FUNCTION__))
+                                                           ;
+
+      BOI.Tag = ContextImpl->getOrInsertBundleTag(BI->getTag());
+      BOI.Begin = CurrentIndex;
+      BOI.End = CurrentIndex + BI->input_size();
+      CurrentIndex = BOI.End;
+      BI++;
+    }
+
+    
+   ((
+   BI == Bundles.end() && "Incorrect allocation?"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "BI == Bundles.end() && \"Incorrect allocation?\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/InstrTypes.h", 1606, __PRETTY_FUNCTION__))
+                                                         ;
+
+    return It;
+  }
+
+
+
+
+
+  const BundleOpInfo &getBundleOpInfoForOperand(unsigned OpIdx) const {
+    for (auto &BOI : bundle_op_infos())
+      if (BOI.Begin <= OpIdx && OpIdx < BOI.End)
+        return BOI;
+
+    ::llvm::llvm_unreachable_internal("Did not find operand bundle for operand!", "/home/trippels/llvm/llvm/include/llvm/IR/InstrTypes.h", 1620);
+  }
+
+
+  static unsigned CountBundleInputs(ArrayRef<OperandBundleDef> Bundles) {
+    unsigned Total = 0;
+    for (auto &B : Bundles)
+      Total += B.input_size();
+    return Total;
+  }
+};
+
+}
+
+
+
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+namespace llvm {
+
+
+
+
+
+template <class Ptr, class USE_iterator>
+class PredIterator : public std::iterator<std::forward_iterator_tag,
+                                          Ptr, ptrdiff_t, Ptr*, Ptr*> {
+  using super =
+      std::iterator<std::forward_iterator_tag, Ptr, ptrdiff_t, Ptr*, Ptr*>;
+  using Self = PredIterator<Ptr, USE_iterator>;
+  USE_iterator It;
+
+  inline void advancePastNonTerminators() {
+
+    while (!It.atEnd() && !isa<TerminatorInst>(*It))
+      ++It;
+  }
+
+public:
+  using pointer = typename super::pointer;
+  using reference = typename super::reference;
+
+  PredIterator() = default;
+  explicit inline PredIterator(Ptr *bb) : It(bb->user_begin()) {
+    advancePastNonTerminators();
+  }
+  inline PredIterator(Ptr *bb, bool) : It(bb->user_end()) {}
+
+  inline bool operator==(const Self& x) const { return It == x.It; }
+  inline bool operator!=(const Self& x) const { return !operator==(x); }
+
+  inline reference operator*() const {
+    
+   ((
+   !It.atEnd() && "pred_iterator out of range!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!It.atEnd() && \"pred_iterator out of range!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/CFG.h", 65, __PRETTY_FUNCTION__))
+                                                       ;
+    return cast<TerminatorInst>(*It)->getParent();
+  }
+  inline pointer *operator->() const { return &operator*(); }
+
+  inline Self& operator++() {
+    
+   ((
+   !It.atEnd() && "pred_iterator out of range!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!It.atEnd() && \"pred_iterator out of range!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/CFG.h", 71, __PRETTY_FUNCTION__))
+                                                       ;
+    ++It; advancePastNonTerminators();
+    return *this;
+  }
+
+  inline Self operator++(int) {
+    Self tmp = *this; ++*this; return tmp;
+  }
+
+
+
+  unsigned getOperandNo() const {
+    return It.getOperandNo();
+  }
+
+
+
+  Use &getUse() const {
+    return It.getUse();
+  }
+};
+
+using pred_iterator = PredIterator<BasicBlock, Value::user_iterator>;
+using const_pred_iterator =
+    PredIterator<const BasicBlock, Value::const_user_iterator>;
+using pred_range = iterator_range<pred_iterator>;
+using pred_const_range = iterator_range<const_pred_iterator>;
+
+inline pred_iterator pred_begin(BasicBlock *BB) { return pred_iterator(BB); }
+inline const_pred_iterator pred_begin(const BasicBlock *BB) {
+  return const_pred_iterator(BB);
+}
+inline pred_iterator pred_end(BasicBlock *BB) { return pred_iterator(BB, true);}
+inline const_pred_iterator pred_end(const BasicBlock *BB) {
+  return const_pred_iterator(BB, true);
+}
+inline bool pred_empty(const BasicBlock *BB) {
+  return pred_begin(BB) == pred_end(BB);
+}
+inline pred_range predecessors(BasicBlock *BB) {
+  return pred_range(pred_begin(BB), pred_end(BB));
+}
+inline pred_const_range predecessors(const BasicBlock *BB) {
+  return pred_const_range(pred_begin(BB), pred_end(BB));
+}
+
+
+
+
+
+using succ_iterator =
+    TerminatorInst::SuccIterator<TerminatorInst *, BasicBlock>;
+using succ_const_iterator =
+    TerminatorInst::SuccIterator<const TerminatorInst *, const BasicBlock>;
+using succ_range = iterator_range<succ_iterator>;
+using succ_const_range = iterator_range<succ_const_iterator>;
+
+inline succ_iterator succ_begin(BasicBlock *BB) {
+  return succ_iterator(BB->getTerminator());
+}
+inline succ_const_iterator succ_begin(const BasicBlock *BB) {
+  return succ_const_iterator(BB->getTerminator());
+}
+inline succ_iterator succ_end(BasicBlock *BB) {
+  return succ_iterator(BB->getTerminator(), true);
+}
+inline succ_const_iterator succ_end(const BasicBlock *BB) {
+  return succ_const_iterator(BB->getTerminator(), true);
+}
+inline bool succ_empty(const BasicBlock *BB) {
+  return succ_begin(BB) == succ_end(BB);
+}
+inline succ_range successors(BasicBlock *BB) {
+  return succ_range(succ_begin(BB), succ_end(BB));
+}
+inline succ_const_range successors(const BasicBlock *BB) {
+  return succ_const_range(succ_begin(BB), succ_end(BB));
+}
+
+template <typename T, typename U>
+struct isPodLike<TerminatorInst::SuccIterator<T, U>> {
+  static const bool value = isPodLike<T>::value;
+};
+template <> struct GraphTraits<BasicBlock*> {
+  using NodeRef = BasicBlock *;
+  using ChildIteratorType = succ_iterator;
+
+  static NodeRef getEntryNode(BasicBlock *BB) { return BB; }
+  static ChildIteratorType child_begin(NodeRef N) { return succ_begin(N); }
+  static ChildIteratorType child_end(NodeRef N) { return succ_end(N); }
+};
+
+template <> struct GraphTraits<const BasicBlock*> {
+  using NodeRef = const BasicBlock *;
+  using ChildIteratorType = succ_const_iterator;
+
+  static NodeRef getEntryNode(const BasicBlock *BB) { return BB; }
+
+  static ChildIteratorType child_begin(NodeRef N) { return succ_begin(N); }
+  static ChildIteratorType child_end(NodeRef N) { return succ_end(N); }
+};
+
+
+
+
+
+
+template <> struct GraphTraits<Inverse<BasicBlock*>> {
+  using NodeRef = BasicBlock *;
+  using ChildIteratorType = pred_iterator;
+
+  static NodeRef getEntryNode(Inverse<BasicBlock *> G) { return G.Graph; }
+  static ChildIteratorType child_begin(NodeRef N) { return pred_begin(N); }
+  static ChildIteratorType child_end(NodeRef N) { return pred_end(N); }
+};
+
+template <> struct GraphTraits<Inverse<const BasicBlock*>> {
+  using NodeRef = const BasicBlock *;
+  using ChildIteratorType = const_pred_iterator;
+
+  static NodeRef getEntryNode(Inverse<const BasicBlock *> G) { return G.Graph; }
+  static ChildIteratorType child_begin(NodeRef N) { return pred_begin(N); }
+  static ChildIteratorType child_end(NodeRef N) { return pred_end(N); }
+};
+template <> struct GraphTraits<Function*> : public GraphTraits<BasicBlock*> {
+  static NodeRef getEntryNode(Function *F) { return &F->getEntryBlock(); }
+
+
+  using nodes_iterator = pointer_iterator<Function::iterator>;
+
+  static nodes_iterator nodes_begin(Function *F) {
+    return nodes_iterator(F->begin());
+  }
+
+  static nodes_iterator nodes_end(Function *F) {
+    return nodes_iterator(F->end());
+  }
+
+  static size_t size(Function *F) { return F->size(); }
+};
+template <> struct GraphTraits<const Function*> :
+  public GraphTraits<const BasicBlock*> {
+  static NodeRef getEntryNode(const Function *F) { return &F->getEntryBlock(); }
+
+
+  using nodes_iterator = pointer_iterator<Function::const_iterator>;
+
+  static nodes_iterator nodes_begin(const Function *F) {
+    return nodes_iterator(F->begin());
+  }
+
+  static nodes_iterator nodes_end(const Function *F) {
+    return nodes_iterator(F->end());
+  }
+
+  static size_t size(const Function *F) { return F->size(); }
+};
+
+
+
+
+
+
+template <> struct GraphTraits<Inverse<Function*>> :
+  public GraphTraits<Inverse<BasicBlock*>> {
+  static NodeRef getEntryNode(Inverse<Function *> G) {
+    return &G.Graph->getEntryBlock();
+  }
+};
+template <> struct GraphTraits<Inverse<const Function*>> :
+  public GraphTraits<Inverse<const BasicBlock*>> {
+  static NodeRef getEntryNode(Inverse<const Function *> G) {
+    return &G.Graph->getEntryBlock();
+  }
+};
+
+}
+
+namespace llvm {
+
+
+
+
+
+enum class AtomicOrderingCABI {
+  relaxed = 0,
+  consume = 1,
+  acquire = 2,
+  release = 3,
+  acq_rel = 4,
+  seq_cst = 5,
+};
+
+bool operator<(AtomicOrderingCABI, AtomicOrderingCABI) = delete;
+bool operator>(AtomicOrderingCABI, AtomicOrderingCABI) = delete;
+bool operator<=(AtomicOrderingCABI, AtomicOrderingCABI) = delete;
+bool operator>=(AtomicOrderingCABI, AtomicOrderingCABI) = delete;
+
+
+
+template <typename Int> inline bool isValidAtomicOrderingCABI(Int I) {
+  return (Int)AtomicOrderingCABI::relaxed <= I &&
+         I <= (Int)AtomicOrderingCABI::seq_cst;
+}
+enum class AtomicOrdering {
+  NotAtomic = 0,
+  Unordered = 1,
+  Monotonic = 2,
+
+  Acquire = 4,
+  Release = 5,
+  AcquireRelease = 6,
+  SequentiallyConsistent = 7
+};
+
+bool operator<(AtomicOrdering, AtomicOrdering) = delete;
+bool operator>(AtomicOrdering, AtomicOrdering) = delete;
+bool operator<=(AtomicOrdering, AtomicOrdering) = delete;
+bool operator>=(AtomicOrdering, AtomicOrdering) = delete;
+
+
+
+template <typename Int> inline bool isValidAtomicOrdering(Int I) {
+  return static_cast<Int>(AtomicOrdering::NotAtomic) <= I &&
+         I <= static_cast<Int>(AtomicOrdering::SequentiallyConsistent);
+}
+
+
+inline const char *toIRString(AtomicOrdering ao) {
+  static const char *names[8] = {"not_atomic", "unordered", "monotonic",
+                                 "consume", "acquire", "release",
+                                 "acq_rel", "seq_cst"};
+  return names[static_cast<size_t>(ao)];
+}
+
+
+
+inline bool isStrongerThan(AtomicOrdering ao, AtomicOrdering other) {
+  static const bool lookup[8][8] = {
+
+                      {false, false, false, false, false, false, false, false},
+                      { true, false, false, false, false, false, false, false},
+                      { true, true, false, false, false, false, false, false},
+                      { true, true, true, false, false, false, false, false},
+                      { true, true, true, true, false, false, false, false},
+                      { true, true, true, false, false, false, false, false},
+                      { true, true, true, true, true, true, false, false},
+                      { true, true, true, true, true, true, true, false},
+  };
+  return lookup[static_cast<size_t>(ao)][static_cast<size_t>(other)];
+}
+
+inline bool isAtLeastOrStrongerThan(AtomicOrdering ao, AtomicOrdering other) {
+  static const bool lookup[8][8] = {
+
+                      { true, false, false, false, false, false, false, false},
+                      { true, true, false, false, false, false, false, false},
+                      { true, true, true, false, false, false, false, false},
+                      { true, true, true, true, false, false, false, false},
+                      { true, true, true, true, true, false, false, false},
+                      { true, true, true, false, false, true, false, false},
+                      { true, true, true, true, true, true, true, false},
+                      { true, true, true, true, true, true, true, true},
+  };
+  return lookup[static_cast<size_t>(ao)][static_cast<size_t>(other)];
+}
+
+inline bool isStrongerThanUnordered(AtomicOrdering ao) {
+  return isStrongerThan(ao, AtomicOrdering::Unordered);
+}
+
+inline bool isStrongerThanMonotonic(AtomicOrdering ao) {
+  return isStrongerThan(ao, AtomicOrdering::Monotonic);
+}
+
+inline bool isAcquireOrStronger(AtomicOrdering ao) {
+  return isAtLeastOrStrongerThan(ao, AtomicOrdering::Acquire);
+}
+
+inline bool isReleaseOrStronger(AtomicOrdering ao) {
+  return isAtLeastOrStrongerThan(ao, AtomicOrdering::Release);
+}
+
+inline AtomicOrderingCABI toCABI(AtomicOrdering ao) {
+  static const AtomicOrderingCABI lookup[8] = {
+                      AtomicOrderingCABI::relaxed,
+                      AtomicOrderingCABI::relaxed,
+                      AtomicOrderingCABI::relaxed,
+                      AtomicOrderingCABI::consume,
+                      AtomicOrderingCABI::acquire,
+                      AtomicOrderingCABI::release,
+                      AtomicOrderingCABI::acq_rel,
+                      AtomicOrderingCABI::seq_cst,
+  };
+  return lookup[static_cast<size_t>(ao)];
+}
+
+}
+
+
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+
+namespace llvm {
+
+class APInt;
+class ConstantInt;
+class DataLayout;
+class LLVMContext;
+
+
+
+
+
+
+class AllocaInst : public UnaryInstruction {
+  Type *AllocatedType;
+
+protected:
+
+  friend class Instruction;
+
+  AllocaInst *cloneImpl() const;
+
+public:
+  explicit AllocaInst(Type *Ty, unsigned AddrSpace,
+                      Value *ArraySize = nullptr,
+                      const Twine &Name = "",
+                      Instruction *InsertBefore = nullptr);
+  AllocaInst(Type *Ty, unsigned AddrSpace, Value *ArraySize,
+             const Twine &Name, BasicBlock *InsertAtEnd);
+
+  AllocaInst(Type *Ty, unsigned AddrSpace,
+             const Twine &Name, Instruction *InsertBefore = nullptr);
+  AllocaInst(Type *Ty, unsigned AddrSpace,
+             const Twine &Name, BasicBlock *InsertAtEnd);
+
+  AllocaInst(Type *Ty, unsigned AddrSpace, Value *ArraySize, unsigned Align,
+             const Twine &Name = "", Instruction *InsertBefore = nullptr);
+  AllocaInst(Type *Ty, unsigned AddrSpace, Value *ArraySize, unsigned Align,
+             const Twine &Name, BasicBlock *InsertAtEnd);
+
+
+
+  bool isArrayAllocation() const;
+
+
+
+  const Value *getArraySize() const { return getOperand(0); }
+  Value *getArraySize() { return getOperand(0); }
+
+
+  PointerType *getType() const {
+    return cast<PointerType>(Instruction::getType());
+  }
+
+
+  Type *getAllocatedType() const { return AllocatedType; }
+
+
+  void setAllocatedType(Type *Ty) { AllocatedType = Ty; }
+
+
+
+  unsigned getAlignment() const {
+    return (1u << (getSubclassDataFromInstruction() & 31)) >> 1;
+  }
+  void setAlignment(unsigned Align);
+
+
+
+
+  bool isStaticAlloca() const;
+
+
+
+  bool isUsedWithInAlloca() const {
+    return getSubclassDataFromInstruction() & 32;
+  }
+
+
+  void setUsedWithInAlloca(bool V) {
+    setInstructionSubclassData((getSubclassDataFromInstruction() & ~32) |
+                               (V ? 32 : 0));
+  }
+
+
+  bool isSwiftError() const {
+    return getSubclassDataFromInstruction() & 64;
+  }
+
+
+  void setSwiftError(bool V) {
+    setInstructionSubclassData((getSubclassDataFromInstruction() & ~64) |
+                               (V ? 64 : 0));
+  }
+
+
+  static bool classof(const Instruction *I) {
+    return (I->getOpcode() == Instruction::Alloca);
+  }
+  static bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+
+private:
+
+
+  void setInstructionSubclassData(unsigned short D) {
+    Instruction::setInstructionSubclassData(D);
+  }
+};
+
+
+
+
+
+
+
+class LoadInst : public UnaryInstruction {
+  void AssertOK();
+
+protected:
+
+  friend class Instruction;
+
+  LoadInst *cloneImpl() const;
+
+public:
+  LoadInst(Value *Ptr, const Twine &NameStr, Instruction *InsertBefore);
+  LoadInst(Value *Ptr, const Twine &NameStr, BasicBlock *InsertAtEnd);
+  LoadInst(Type *Ty, Value *Ptr, const Twine &NameStr, bool isVolatile = false,
+           Instruction *InsertBefore = nullptr);
+  LoadInst(Value *Ptr, const Twine &NameStr, bool isVolatile = false,
+           Instruction *InsertBefore = nullptr)
+      : LoadInst(cast<PointerType>(Ptr->getType())->getElementType(), Ptr,
+                 NameStr, isVolatile, InsertBefore) {}
+  LoadInst(Value *Ptr, const Twine &NameStr, bool isVolatile,
+           BasicBlock *InsertAtEnd);
+  LoadInst(Value *Ptr, const Twine &NameStr, bool isVolatile, unsigned Align,
+           Instruction *InsertBefore = nullptr)
+      : LoadInst(cast<PointerType>(Ptr->getType())->getElementType(), Ptr,
+                 NameStr, isVolatile, Align, InsertBefore) {}
+  LoadInst(Type *Ty, Value *Ptr, const Twine &NameStr, bool isVolatile,
+           unsigned Align, Instruction *InsertBefore = nullptr);
+  LoadInst(Value *Ptr, const Twine &NameStr, bool isVolatile,
+           unsigned Align, BasicBlock *InsertAtEnd);
+  LoadInst(Value *Ptr, const Twine &NameStr, bool isVolatile, unsigned Align,
+           AtomicOrdering Order, SyncScope::ID SSID = SyncScope::System,
+           Instruction *InsertBefore = nullptr)
+      : LoadInst(cast<PointerType>(Ptr->getType())->getElementType(), Ptr,
+                 NameStr, isVolatile, Align, Order, SSID, InsertBefore) {}
+  LoadInst(Type *Ty, Value *Ptr, const Twine &NameStr, bool isVolatile,
+           unsigned Align, AtomicOrdering Order,
+           SyncScope::ID SSID = SyncScope::System,
+           Instruction *InsertBefore = nullptr);
+  LoadInst(Value *Ptr, const Twine &NameStr, bool isVolatile,
+           unsigned Align, AtomicOrdering Order, SyncScope::ID SSID,
+           BasicBlock *InsertAtEnd);
+  LoadInst(Value *Ptr, const char *NameStr, Instruction *InsertBefore);
+  LoadInst(Value *Ptr, const char *NameStr, BasicBlock *InsertAtEnd);
+  LoadInst(Type *Ty, Value *Ptr, const char *NameStr = nullptr,
+           bool isVolatile = false, Instruction *InsertBefore = nullptr);
+  explicit LoadInst(Value *Ptr, const char *NameStr = nullptr,
+                    bool isVolatile = false,
+                    Instruction *InsertBefore = nullptr)
+      : LoadInst(cast<PointerType>(Ptr->getType())->getElementType(), Ptr,
+                 NameStr, isVolatile, InsertBefore) {}
+  LoadInst(Value *Ptr, const char *NameStr, bool isVolatile,
+           BasicBlock *InsertAtEnd);
+
+
+  bool isVolatile() const { return getSubclassDataFromInstruction() & 1; }
+
+
+  void setVolatile(bool V) {
+    setInstructionSubclassData((getSubclassDataFromInstruction() & ~1) |
+                               (V ? 1 : 0));
+  }
+
+
+  unsigned getAlignment() const {
+    return (1 << ((getSubclassDataFromInstruction() >> 1) & 31)) >> 1;
+  }
+
+  void setAlignment(unsigned Align);
+
+
+  AtomicOrdering getOrdering() const {
+    return AtomicOrdering((getSubclassDataFromInstruction() >> 7) & 7);
+  }
+
+
+
+  void setOrdering(AtomicOrdering Ordering) {
+    setInstructionSubclassData((getSubclassDataFromInstruction() & ~(7 << 7)) |
+                               ((unsigned)Ordering << 7));
+  }
+
+
+  SyncScope::ID getSyncScopeID() const {
+    return SSID;
+  }
+
+
+  void setSyncScopeID(SyncScope::ID SSID) {
+    this->SSID = SSID;
+  }
+
+
+
+  void setAtomic(AtomicOrdering Ordering,
+                 SyncScope::ID SSID = SyncScope::System) {
+    setOrdering(Ordering);
+    setSyncScopeID(SSID);
+  }
+
+  bool isSimple() const { return !isAtomic() && !isVolatile(); }
+
+  bool isUnordered() const {
+    return (getOrdering() == AtomicOrdering::NotAtomic ||
+            getOrdering() == AtomicOrdering::Unordered) &&
+           !isVolatile();
+  }
+
+  Value *getPointerOperand() { return getOperand(0); }
+  const Value *getPointerOperand() const { return getOperand(0); }
+  static unsigned getPointerOperandIndex() { return 0U; }
+  Type *getPointerOperandType() const { return getPointerOperand()->getType(); }
+
+
+  unsigned getPointerAddressSpace() const {
+    return getPointerOperandType()->getPointerAddressSpace();
+  }
+
+
+  static bool classof(const Instruction *I) {
+    return I->getOpcode() == Instruction::Load;
+  }
+  static bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+
+private:
+
+
+  void setInstructionSubclassData(unsigned short D) {
+    Instruction::setInstructionSubclassData(D);
+  }
+
+
+
+
+  SyncScope::ID SSID;
+};
+
+
+
+
+
+
+class StoreInst : public Instruction {
+  void AssertOK();
+
+protected:
+
+  friend class Instruction;
+
+  StoreInst *cloneImpl() const;
+
+public:
+  StoreInst(Value *Val, Value *Ptr, Instruction *InsertBefore);
+  StoreInst(Value *Val, Value *Ptr, BasicBlock *InsertAtEnd);
+  StoreInst(Value *Val, Value *Ptr, bool isVolatile = false,
+            Instruction *InsertBefore = nullptr);
+  StoreInst(Value *Val, Value *Ptr, bool isVolatile, BasicBlock *InsertAtEnd);
+  StoreInst(Value *Val, Value *Ptr, bool isVolatile,
+            unsigned Align, Instruction *InsertBefore = nullptr);
+  StoreInst(Value *Val, Value *Ptr, bool isVolatile,
+            unsigned Align, BasicBlock *InsertAtEnd);
+  StoreInst(Value *Val, Value *Ptr, bool isVolatile,
+            unsigned Align, AtomicOrdering Order,
+            SyncScope::ID SSID = SyncScope::System,
+            Instruction *InsertBefore = nullptr);
+  StoreInst(Value *Val, Value *Ptr, bool isVolatile,
+            unsigned Align, AtomicOrdering Order, SyncScope::ID SSID,
+            BasicBlock *InsertAtEnd);
+
+
+  void *operator new(size_t s) {
+    return User::operator new(s, 2);
+  }
+
+
+  bool isVolatile() const { return getSubclassDataFromInstruction() & 1; }
+
+
+  void setVolatile(bool V) {
+    setInstructionSubclassData((getSubclassDataFromInstruction() & ~1) |
+                               (V ? 1 : 0));
+  }
+
+
+  public: inline Value *getOperand(unsigned) const; inline void setOperand(unsigned, Value*); inline op_iterator op_begin(); inline const_op_iterator op_begin() const; inline op_iterator op_end(); inline const_op_iterator op_end() const; protected: template <int> inline Use &Op(); template <int> inline const Use &Op() const; public: inline unsigned getNumOperands() const;
+
+
+  unsigned getAlignment() const {
+    return (1 << ((getSubclassDataFromInstruction() >> 1) & 31)) >> 1;
+  }
+
+  void setAlignment(unsigned Align);
+
+
+  AtomicOrdering getOrdering() const {
+    return AtomicOrdering((getSubclassDataFromInstruction() >> 7) & 7);
+  }
+
+
+
+  void setOrdering(AtomicOrdering Ordering) {
+    setInstructionSubclassData((getSubclassDataFromInstruction() & ~(7 << 7)) |
+                               ((unsigned)Ordering << 7));
+  }
+
+
+  SyncScope::ID getSyncScopeID() const {
+    return SSID;
+  }
+
+
+  void setSyncScopeID(SyncScope::ID SSID) {
+    this->SSID = SSID;
+  }
+
+
+
+  void setAtomic(AtomicOrdering Ordering,
+                 SyncScope::ID SSID = SyncScope::System) {
+    setOrdering(Ordering);
+    setSyncScopeID(SSID);
+  }
+
+  bool isSimple() const { return !isAtomic() && !isVolatile(); }
+
+  bool isUnordered() const {
+    return (getOrdering() == AtomicOrdering::NotAtomic ||
+            getOrdering() == AtomicOrdering::Unordered) &&
+           !isVolatile();
+  }
+
+  Value *getValueOperand() { return getOperand(0); }
+  const Value *getValueOperand() const { return getOperand(0); }
+
+  Value *getPointerOperand() { return getOperand(1); }
+  const Value *getPointerOperand() const { return getOperand(1); }
+  static unsigned getPointerOperandIndex() { return 1U; }
+  Type *getPointerOperandType() const { return getPointerOperand()->getType(); }
+
+
+  unsigned getPointerAddressSpace() const {
+    return getPointerOperandType()->getPointerAddressSpace();
+  }
+
+
+  static bool classof(const Instruction *I) {
+    return I->getOpcode() == Instruction::Store;
+  }
+  static bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+
+private:
+
+
+  void setInstructionSubclassData(unsigned short D) {
+    Instruction::setInstructionSubclassData(D);
+  }
+
+
+
+
+  SyncScope::ID SSID;
+};
+
+template <>
+struct OperandTraits<StoreInst> : public FixedNumOperandTraits<StoreInst, 2> {
+};
+
+StoreInst::op_iterator StoreInst::op_begin() { return OperandTraits<StoreInst>::op_begin(this); } StoreInst::const_op_iterator StoreInst::op_begin() const { return OperandTraits<StoreInst>::op_begin(const_cast<StoreInst*>(this)); } StoreInst::op_iterator StoreInst::op_end() { return OperandTraits<StoreInst>::op_end(this); } StoreInst::const_op_iterator StoreInst::op_end() const { return OperandTraits<StoreInst>::op_end(const_cast<StoreInst*>(this)); } Value *StoreInst::getOperand(unsigned i_nocapture) const { 
+((
+i_nocapture < OperandTraits<StoreInst>::operands(this) && "getOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<StoreInst>::operands(this) && \"getOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 433, __PRETTY_FUNCTION__))
+; return cast_or_null<Value>( OperandTraits<StoreInst>::op_begin(const_cast<StoreInst*>(this))[i_nocapture].get()); } void StoreInst::setOperand(unsigned i_nocapture, Value *Val_nocapture) { 
+((
+i_nocapture < OperandTraits<StoreInst>::operands(this) && "setOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<StoreInst>::operands(this) && \"setOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 433, __PRETTY_FUNCTION__))
+; OperandTraits<StoreInst>::op_begin(this)[i_nocapture] = Val_nocapture; } unsigned StoreInst::getNumOperands() const { return OperandTraits<StoreInst>::operands(this); } template <int Idx_nocapture> Use &StoreInst::Op() { return this->OpFrom<Idx_nocapture>(this); } template <int Idx_nocapture> const Use &StoreInst::Op() const { return this->OpFrom<Idx_nocapture>(this); }
+
+
+
+
+
+
+class FenceInst : public Instruction {
+  void Init(AtomicOrdering Ordering, SyncScope::ID SSID);
+
+protected:
+
+  friend class Instruction;
+
+  FenceInst *cloneImpl() const;
+
+public:
+
+
+  FenceInst(LLVMContext &C, AtomicOrdering Ordering,
+            SyncScope::ID SSID = SyncScope::System,
+            Instruction *InsertBefore = nullptr);
+  FenceInst(LLVMContext &C, AtomicOrdering Ordering, SyncScope::ID SSID,
+            BasicBlock *InsertAtEnd);
+
+
+  void *operator new(size_t s) {
+    return User::operator new(s, 0);
+  }
+
+
+  AtomicOrdering getOrdering() const {
+    return AtomicOrdering(getSubclassDataFromInstruction() >> 1);
+  }
+
+
+
+  void setOrdering(AtomicOrdering Ordering) {
+    setInstructionSubclassData((getSubclassDataFromInstruction() & 1) |
+                               ((unsigned)Ordering << 1));
+  }
+
+
+  SyncScope::ID getSyncScopeID() const {
+    return SSID;
+  }
+
+
+  void setSyncScopeID(SyncScope::ID SSID) {
+    this->SSID = SSID;
+  }
+
+
+  static bool classof(const Instruction *I) {
+    return I->getOpcode() == Instruction::Fence;
+  }
+  static bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+
+private:
+
+
+  void setInstructionSubclassData(unsigned short D) {
+    Instruction::setInstructionSubclassData(D);
+  }
+
+
+
+
+  SyncScope::ID SSID;
+};
+class AtomicCmpXchgInst : public Instruction {
+  void Init(Value *Ptr, Value *Cmp, Value *NewVal,
+            AtomicOrdering SuccessOrdering, AtomicOrdering FailureOrdering,
+            SyncScope::ID SSID);
+
+protected:
+
+  friend class Instruction;
+
+  AtomicCmpXchgInst *cloneImpl() const;
+
+public:
+  AtomicCmpXchgInst(Value *Ptr, Value *Cmp, Value *NewVal,
+                    AtomicOrdering SuccessOrdering,
+                    AtomicOrdering FailureOrdering,
+                    SyncScope::ID SSID, Instruction *InsertBefore = nullptr);
+  AtomicCmpXchgInst(Value *Ptr, Value *Cmp, Value *NewVal,
+                    AtomicOrdering SuccessOrdering,
+                    AtomicOrdering FailureOrdering,
+                    SyncScope::ID SSID, BasicBlock *InsertAtEnd);
+
+
+  void *operator new(size_t s) {
+    return User::operator new(s, 3);
+  }
+
+
+
+
+  bool isVolatile() const {
+    return getSubclassDataFromInstruction() & 1;
+  }
+
+
+
+  void setVolatile(bool V) {
+     setInstructionSubclassData((getSubclassDataFromInstruction() & ~1) |
+                                (unsigned)V);
+  }
+
+
+  bool isWeak() const {
+    return getSubclassDataFromInstruction() & 0x100;
+  }
+
+  void setWeak(bool IsWeak) {
+    setInstructionSubclassData((getSubclassDataFromInstruction() & ~0x100) |
+                               (IsWeak << 8));
+  }
+
+
+  public: inline Value *getOperand(unsigned) const; inline void setOperand(unsigned, Value*); inline op_iterator op_begin(); inline const_op_iterator op_begin() const; inline op_iterator op_end(); inline const_op_iterator op_end() const; protected: template <int> inline Use &Op(); template <int> inline const Use &Op() const; public: inline unsigned getNumOperands() const;
+
+
+  AtomicOrdering getSuccessOrdering() const {
+    return AtomicOrdering((getSubclassDataFromInstruction() >> 2) & 7);
+  }
+
+
+  void setSuccessOrdering(AtomicOrdering Ordering) {
+    
+   ((
+   Ordering != AtomicOrdering::NotAtomic && "CmpXchg instructions can only be atomic."
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Ordering != AtomicOrdering::NotAtomic && \"CmpXchg instructions can only be atomic.\""
+   ,
+                                                     "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h"
+    ,
+                                                     575
+    , __PRETTY_FUNCTION__))
+                                                      
+                                                     ;
+    setInstructionSubclassData((getSubclassDataFromInstruction() & ~0x1c) |
+                               ((unsigned)Ordering << 2));
+  }
+
+
+  AtomicOrdering getFailureOrdering() const {
+    return AtomicOrdering((getSubclassDataFromInstruction() >> 5) & 7);
+  }
+
+
+  void setFailureOrdering(AtomicOrdering Ordering) {
+    
+   ((
+   Ordering != AtomicOrdering::NotAtomic && "CmpXchg instructions can only be atomic."
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Ordering != AtomicOrdering::NotAtomic && \"CmpXchg instructions can only be atomic.\""
+   ,
+                                                     "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h"
+    ,
+                                                     588
+    , __PRETTY_FUNCTION__))
+                                                      
+                                                     ;
+    setInstructionSubclassData((getSubclassDataFromInstruction() & ~0xe0) |
+                               ((unsigned)Ordering << 5));
+  }
+
+
+  SyncScope::ID getSyncScopeID() const {
+    return SSID;
+  }
+
+
+  void setSyncScopeID(SyncScope::ID SSID) {
+    this->SSID = SSID;
+  }
+
+  Value *getPointerOperand() { return getOperand(0); }
+  const Value *getPointerOperand() const { return getOperand(0); }
+  static unsigned getPointerOperandIndex() { return 0U; }
+
+  Value *getCompareOperand() { return getOperand(1); }
+  const Value *getCompareOperand() const { return getOperand(1); }
+
+  Value *getNewValOperand() { return getOperand(2); }
+  const Value *getNewValOperand() const { return getOperand(2); }
+
+
+  unsigned getPointerAddressSpace() const {
+    return getPointerOperand()->getType()->getPointerAddressSpace();
+  }
+  static AtomicOrdering
+  getStrongestFailureOrdering(AtomicOrdering SuccessOrdering) {
+    switch (SuccessOrdering) {
+    default:
+      ::llvm::llvm_unreachable_internal("invalid cmpxchg success ordering", "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 629);
+    case AtomicOrdering::Release:
+    case AtomicOrdering::Monotonic:
+      return AtomicOrdering::Monotonic;
+    case AtomicOrdering::AcquireRelease:
+    case AtomicOrdering::Acquire:
+      return AtomicOrdering::Acquire;
+    case AtomicOrdering::SequentiallyConsistent:
+      return AtomicOrdering::SequentiallyConsistent;
+    }
+  }
+
+
+  static bool classof(const Instruction *I) {
+    return I->getOpcode() == Instruction::AtomicCmpXchg;
+  }
+  static bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+
+private:
+
+
+  void setInstructionSubclassData(unsigned short D) {
+    Instruction::setInstructionSubclassData(D);
+  }
+
+
+
+
+  SyncScope::ID SSID;
+};
+
+template <>
+struct OperandTraits<AtomicCmpXchgInst> :
+    public FixedNumOperandTraits<AtomicCmpXchgInst, 3> {
+};
+
+AtomicCmpXchgInst::op_iterator AtomicCmpXchgInst::op_begin() { return OperandTraits<AtomicCmpXchgInst>::op_begin(this); } AtomicCmpXchgInst::const_op_iterator AtomicCmpXchgInst::op_begin() const { return OperandTraits<AtomicCmpXchgInst>::op_begin(const_cast<AtomicCmpXchgInst*>(this)); } AtomicCmpXchgInst::op_iterator AtomicCmpXchgInst::op_end() { return OperandTraits<AtomicCmpXchgInst>::op_end(this); } AtomicCmpXchgInst::const_op_iterator AtomicCmpXchgInst::op_end() const { return OperandTraits<AtomicCmpXchgInst>::op_end(const_cast<AtomicCmpXchgInst*>(this)); } Value *AtomicCmpXchgInst::getOperand(unsigned i_nocapture) const { 
+((
+i_nocapture < OperandTraits<AtomicCmpXchgInst>::operands(this) && "getOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<AtomicCmpXchgInst>::operands(this) && \"getOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 667, __PRETTY_FUNCTION__))
+; return cast_or_null<Value>( OperandTraits<AtomicCmpXchgInst>::op_begin(const_cast<AtomicCmpXchgInst*>(this))[i_nocapture].get()); } void AtomicCmpXchgInst::setOperand(unsigned i_nocapture, Value *Val_nocapture) { 
+((
+i_nocapture < OperandTraits<AtomicCmpXchgInst>::operands(this) && "setOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<AtomicCmpXchgInst>::operands(this) && \"setOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 667, __PRETTY_FUNCTION__))
+; OperandTraits<AtomicCmpXchgInst>::op_begin(this)[i_nocapture] = Val_nocapture; } unsigned AtomicCmpXchgInst::getNumOperands() const { return OperandTraits<AtomicCmpXchgInst>::operands(this); } template <int Idx_nocapture> Use &AtomicCmpXchgInst::Op() { return this->OpFrom<Idx_nocapture>(this); } template <int Idx_nocapture> const Use &AtomicCmpXchgInst::Op() const { return this->OpFrom<Idx_nocapture>(this); }
+class AtomicRMWInst : public Instruction {
+protected:
+
+  friend class Instruction;
+
+  AtomicRMWInst *cloneImpl() const;
+
+public:
+
+
+
+
+  enum BinOp {
+
+    Xchg,
+
+    Add,
+
+    Sub,
+
+    And,
+
+    Nand,
+
+    Or,
+
+    Xor,
+
+    Max,
+
+    Min,
+
+    UMax,
+
+    UMin,
+
+    FIRST_BINOP = Xchg,
+    LAST_BINOP = UMin,
+    BAD_BINOP
+  };
+
+  AtomicRMWInst(BinOp Operation, Value *Ptr, Value *Val,
+                AtomicOrdering Ordering, SyncScope::ID SSID,
+                Instruction *InsertBefore = nullptr);
+  AtomicRMWInst(BinOp Operation, Value *Ptr, Value *Val,
+                AtomicOrdering Ordering, SyncScope::ID SSID,
+                BasicBlock *InsertAtEnd);
+
+
+  void *operator new(size_t s) {
+    return User::operator new(s, 2);
+  }
+
+  BinOp getOperation() const {
+    return static_cast<BinOp>(getSubclassDataFromInstruction() >> 5);
+  }
+
+  void setOperation(BinOp Operation) {
+    unsigned short SubclassData = getSubclassDataFromInstruction();
+    setInstructionSubclassData((SubclassData & 31) |
+                               (Operation << 5));
+  }
+
+
+
+  bool isVolatile() const {
+    return getSubclassDataFromInstruction() & 1;
+  }
+
+
+
+  void setVolatile(bool V) {
+     setInstructionSubclassData((getSubclassDataFromInstruction() & ~1) |
+                                (unsigned)V);
+  }
+
+
+  public: inline Value *getOperand(unsigned) const; inline void setOperand(unsigned, Value*); inline op_iterator op_begin(); inline const_op_iterator op_begin() const; inline op_iterator op_end(); inline const_op_iterator op_end() const; protected: template <int> inline Use &Op(); template <int> inline const Use &Op() const; public: inline unsigned getNumOperands() const;
+
+
+  AtomicOrdering getOrdering() const {
+    return AtomicOrdering((getSubclassDataFromInstruction() >> 2) & 7);
+  }
+
+
+  void setOrdering(AtomicOrdering Ordering) {
+    
+   ((
+   Ordering != AtomicOrdering::NotAtomic && "atomicrmw instructions can only be atomic."
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Ordering != AtomicOrdering::NotAtomic && \"atomicrmw instructions can only be atomic.\""
+   ,
+                                                       "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h"
+    ,
+                                                       764
+    , __PRETTY_FUNCTION__))
+                                                        
+                                                       ;
+    setInstructionSubclassData((getSubclassDataFromInstruction() & ~(7 << 2)) |
+                               ((unsigned)Ordering << 2));
+  }
+
+
+  SyncScope::ID getSyncScopeID() const {
+    return SSID;
+  }
+
+
+  void setSyncScopeID(SyncScope::ID SSID) {
+    this->SSID = SSID;
+  }
+
+  Value *getPointerOperand() { return getOperand(0); }
+  const Value *getPointerOperand() const { return getOperand(0); }
+  static unsigned getPointerOperandIndex() { return 0U; }
+
+  Value *getValOperand() { return getOperand(1); }
+  const Value *getValOperand() const { return getOperand(1); }
+
+
+  unsigned getPointerAddressSpace() const {
+    return getPointerOperand()->getType()->getPointerAddressSpace();
+  }
+
+
+  static bool classof(const Instruction *I) {
+    return I->getOpcode() == Instruction::AtomicRMW;
+  }
+  static bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+
+private:
+  void Init(BinOp Operation, Value *Ptr, Value *Val,
+            AtomicOrdering Ordering, SyncScope::ID SSID);
+
+
+
+  void setInstructionSubclassData(unsigned short D) {
+    Instruction::setInstructionSubclassData(D);
+  }
+
+
+
+
+  SyncScope::ID SSID;
+};
+
+template <>
+struct OperandTraits<AtomicRMWInst>
+    : public FixedNumOperandTraits<AtomicRMWInst,2> {
+};
+
+AtomicRMWInst::op_iterator AtomicRMWInst::op_begin() { return OperandTraits<AtomicRMWInst>::op_begin(this); } AtomicRMWInst::const_op_iterator AtomicRMWInst::op_begin() const { return OperandTraits<AtomicRMWInst>::op_begin(const_cast<AtomicRMWInst*>(this)); } AtomicRMWInst::op_iterator AtomicRMWInst::op_end() { return OperandTraits<AtomicRMWInst>::op_end(this); } AtomicRMWInst::const_op_iterator AtomicRMWInst::op_end() const { return OperandTraits<AtomicRMWInst>::op_end(const_cast<AtomicRMWInst*>(this)); } Value *AtomicRMWInst::getOperand(unsigned i_nocapture) const { 
+((
+i_nocapture < OperandTraits<AtomicRMWInst>::operands(this) && "getOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<AtomicRMWInst>::operands(this) && \"getOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 820, __PRETTY_FUNCTION__))
+; return cast_or_null<Value>( OperandTraits<AtomicRMWInst>::op_begin(const_cast<AtomicRMWInst*>(this))[i_nocapture].get()); } void AtomicRMWInst::setOperand(unsigned i_nocapture, Value *Val_nocapture) { 
+((
+i_nocapture < OperandTraits<AtomicRMWInst>::operands(this) && "setOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<AtomicRMWInst>::operands(this) && \"setOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 820, __PRETTY_FUNCTION__))
+; OperandTraits<AtomicRMWInst>::op_begin(this)[i_nocapture] = Val_nocapture; } unsigned AtomicRMWInst::getNumOperands() const { return OperandTraits<AtomicRMWInst>::operands(this); } template <int Idx_nocapture> Use &AtomicRMWInst::Op() { return this->OpFrom<Idx_nocapture>(this); } template <int Idx_nocapture> const Use &AtomicRMWInst::Op() const { return this->OpFrom<Idx_nocapture>(this); }
+inline Type *checkGEPType(Type *Ty) {
+  
+ ((
+ Ty && "Invalid GetElementPtrInst indices for type!"
+ ) ? static_cast<void> (0) : __assert_fail (
+ "Ty && \"Invalid GetElementPtrInst indices for type!\""
+ , "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 830, __PRETTY_FUNCTION__))
+                                                            ;
+  return Ty;
+}
+
+
+
+
+class GetElementPtrInst : public Instruction {
+  Type *SourceElementType;
+  Type *ResultElementType;
+
+  GetElementPtrInst(const GetElementPtrInst &GEPI);
+
+
+
+
+
+  inline GetElementPtrInst(Type *PointeeType, Value *Ptr,
+                           ArrayRef<Value *> IdxList, unsigned Values,
+                           const Twine &NameStr, Instruction *InsertBefore);
+  inline GetElementPtrInst(Type *PointeeType, Value *Ptr,
+                           ArrayRef<Value *> IdxList, unsigned Values,
+                           const Twine &NameStr, BasicBlock *InsertAtEnd);
+
+  void init(Value *Ptr, ArrayRef<Value *> IdxList, const Twine &NameStr);
+
+protected:
+
+  friend class Instruction;
+
+  GetElementPtrInst *cloneImpl() const;
+
+public:
+  static GetElementPtrInst *Create(Type *PointeeType, Value *Ptr,
+                                   ArrayRef<Value *> IdxList,
+                                   const Twine &NameStr = "",
+                                   Instruction *InsertBefore = nullptr) {
+    unsigned Values = 1 + unsigned(IdxList.size());
+    if (!PointeeType)
+      PointeeType =
+          cast<PointerType>(Ptr->getType()->getScalarType())->getElementType();
+    else
+      
+     ((
+     PointeeType == cast<PointerType>(Ptr->getType()->getScalarType())->getElementType()
+     ) ? static_cast<void> (0) : __assert_fail (
+     "PointeeType == cast<PointerType>(Ptr->getType()->getScalarType())->getElementType()"
+     ,
+
+                                                                              "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h"
+      ,
+
+                                                                              874
+      , __PRETTY_FUNCTION__))
+
+                                                                               
+                                                                              ;
+    return new (Values) GetElementPtrInst(PointeeType, Ptr, IdxList, Values,
+                                          NameStr, InsertBefore);
+  }
+
+  static GetElementPtrInst *Create(Type *PointeeType, Value *Ptr,
+                                   ArrayRef<Value *> IdxList,
+                                   const Twine &NameStr,
+                                   BasicBlock *InsertAtEnd) {
+    unsigned Values = 1 + unsigned(IdxList.size());
+    if (!PointeeType)
+      PointeeType =
+          cast<PointerType>(Ptr->getType()->getScalarType())->getElementType();
+    else
+      
+     ((
+     PointeeType == cast<PointerType>(Ptr->getType()->getScalarType())->getElementType()
+     ) ? static_cast<void> (0) : __assert_fail (
+     "PointeeType == cast<PointerType>(Ptr->getType()->getScalarType())->getElementType()"
+     ,
+
+                                                                              "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h"
+      ,
+
+                                                                              890
+      , __PRETTY_FUNCTION__))
+
+                                                                               
+                                                                              ;
+    return new (Values) GetElementPtrInst(PointeeType, Ptr, IdxList, Values,
+                                          NameStr, InsertAtEnd);
+  }
+
+
+
+  static GetElementPtrInst *CreateInBounds(Value *Ptr,
+                                           ArrayRef<Value *> IdxList,
+                                           const Twine &NameStr = "",
+                                           Instruction *InsertBefore = nullptr){
+    return CreateInBounds(nullptr, Ptr, IdxList, NameStr, InsertBefore);
+  }
+
+  static GetElementPtrInst *
+  CreateInBounds(Type *PointeeType, Value *Ptr, ArrayRef<Value *> IdxList,
+                 const Twine &NameStr = "",
+                 Instruction *InsertBefore = nullptr) {
+    GetElementPtrInst *GEP =
+        Create(PointeeType, Ptr, IdxList, NameStr, InsertBefore);
+    GEP->setIsInBounds(true);
+    return GEP;
+  }
+
+  static GetElementPtrInst *CreateInBounds(Value *Ptr,
+                                           ArrayRef<Value *> IdxList,
+                                           const Twine &NameStr,
+                                           BasicBlock *InsertAtEnd) {
+    return CreateInBounds(nullptr, Ptr, IdxList, NameStr, InsertAtEnd);
+  }
+
+  static GetElementPtrInst *CreateInBounds(Type *PointeeType, Value *Ptr,
+                                           ArrayRef<Value *> IdxList,
+                                           const Twine &NameStr,
+                                           BasicBlock *InsertAtEnd) {
+    GetElementPtrInst *GEP =
+        Create(PointeeType, Ptr, IdxList, NameStr, InsertAtEnd);
+    GEP->setIsInBounds(true);
+    return GEP;
+  }
+
+
+  public: inline Value *getOperand(unsigned) const; inline void setOperand(unsigned, Value*); inline op_iterator op_begin(); inline const_op_iterator op_begin() const; inline op_iterator op_end(); inline const_op_iterator op_end() const; protected: template <int> inline Use &Op(); template <int> inline const Use &Op() const; public: inline unsigned getNumOperands() const;
+
+  Type *getSourceElementType() const { return SourceElementType; }
+
+  void setSourceElementType(Type *Ty) { SourceElementType = Ty; }
+  void setResultElementType(Type *Ty) { ResultElementType = Ty; }
+
+  Type *getResultElementType() const {
+    
+   ((
+   ResultElementType == cast<PointerType>(getType()->getScalarType())->getElementType()
+   ) ? static_cast<void> (0) : __assert_fail (
+   "ResultElementType == cast<PointerType>(getType()->getScalarType())->getElementType()"
+   ,
+                                                                          "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h"
+    ,
+                                                                          941
+    , __PRETTY_FUNCTION__))
+                                                                           
+                                                                          ;
+    return ResultElementType;
+  }
+
+
+  unsigned getAddressSpace() const {
+
+
+    return getPointerAddressSpace();
+  }
+
+
+
+
+
+
+
+  static Type *getIndexedType(Type *Ty, ArrayRef<Value *> IdxList);
+  static Type *getIndexedType(Type *Ty, ArrayRef<Constant *> IdxList);
+  static Type *getIndexedType(Type *Ty, ArrayRef<uint64_t> IdxList);
+
+  inline op_iterator idx_begin() { return op_begin()+1; }
+  inline const_op_iterator idx_begin() const { return op_begin()+1; }
+  inline op_iterator idx_end() { return op_end(); }
+  inline const_op_iterator idx_end() const { return op_end(); }
+
+  inline iterator_range<op_iterator> indices() {
+    return make_range(idx_begin(), idx_end());
+  }
+
+  inline iterator_range<const_op_iterator> indices() const {
+    return make_range(idx_begin(), idx_end());
+  }
+
+  Value *getPointerOperand() {
+    return getOperand(0);
+  }
+  const Value *getPointerOperand() const {
+    return getOperand(0);
+  }
+  static unsigned getPointerOperandIndex() {
+    return 0U;
+  }
+
+
+
+  Type *getPointerOperandType() const {
+    return getPointerOperand()->getType();
+  }
+
+
+  unsigned getPointerAddressSpace() const {
+    return getPointerOperandType()->getPointerAddressSpace();
+  }
+
+
+
+  static Type *getGEPReturnType(Value *Ptr, ArrayRef<Value *> IdxList) {
+    return getGEPReturnType(
+      cast<PointerType>(Ptr->getType()->getScalarType())->getElementType(),
+      Ptr, IdxList);
+  }
+  static Type *getGEPReturnType(Type *ElTy, Value *Ptr,
+                                ArrayRef<Value *> IdxList) {
+    Type *PtrTy = PointerType::get(checkGEPType(getIndexedType(ElTy, IdxList)),
+                                   Ptr->getType()->getPointerAddressSpace());
+
+    if (Ptr->getType()->isVectorTy()) {
+      unsigned NumElem = Ptr->getType()->getVectorNumElements();
+      return VectorType::get(PtrTy, NumElem);
+    }
+    for (Value *Index : IdxList)
+      if (Index->getType()->isVectorTy()) {
+        unsigned NumElem = Index->getType()->getVectorNumElements();
+        return VectorType::get(PtrTy, NumElem);
+      }
+
+    return PtrTy;
+  }
+
+  unsigned getNumIndices() const {
+    return getNumOperands() - 1;
+  }
+
+  bool hasIndices() const {
+    return getNumOperands() > 1;
+  }
+
+
+
+
+  bool hasAllZeroIndices() const;
+
+
+
+
+  bool hasAllConstantIndices() const;
+
+
+
+  void setIsInBounds(bool b = true);
+
+
+  bool isInBounds() const;
+  bool accumulateConstantOffset(const DataLayout &DL, APInt &Offset) const;
+
+
+  static bool classof(const Instruction *I) {
+    return (I->getOpcode() == Instruction::GetElementPtr);
+  }
+  static bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+};
+
+template <>
+struct OperandTraits<GetElementPtrInst> :
+  public VariadicOperandTraits<GetElementPtrInst, 1> {
+};
+
+GetElementPtrInst::GetElementPtrInst(Type *PointeeType, Value *Ptr,
+                                     ArrayRef<Value *> IdxList, unsigned Values,
+                                     const Twine &NameStr,
+                                     Instruction *InsertBefore)
+    : Instruction(getGEPReturnType(PointeeType, Ptr, IdxList), GetElementPtr,
+                  OperandTraits<GetElementPtrInst>::op_end(this) - Values,
+                  Values, InsertBefore),
+      SourceElementType(PointeeType),
+      ResultElementType(getIndexedType(PointeeType, IdxList)) {
+  
+ ((
+ ResultElementType == cast<PointerType>(getType()->getScalarType())->getElementType()
+ ) ? static_cast<void> (0) : __assert_fail (
+ "ResultElementType == cast<PointerType>(getType()->getScalarType())->getElementType()"
+ ,
+                                                                        "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h"
+  ,
+                                                                        1080
+  , __PRETTY_FUNCTION__))
+                                                                         
+                                                                        ;
+  init(Ptr, IdxList, NameStr);
+}
+
+GetElementPtrInst::GetElementPtrInst(Type *PointeeType, Value *Ptr,
+                                     ArrayRef<Value *> IdxList, unsigned Values,
+                                     const Twine &NameStr,
+                                     BasicBlock *InsertAtEnd)
+    : Instruction(getGEPReturnType(PointeeType, Ptr, IdxList), GetElementPtr,
+                  OperandTraits<GetElementPtrInst>::op_end(this) - Values,
+                  Values, InsertAtEnd),
+      SourceElementType(PointeeType),
+      ResultElementType(getIndexedType(PointeeType, IdxList)) {
+  
+ ((
+ ResultElementType == cast<PointerType>(getType()->getScalarType())->getElementType()
+ ) ? static_cast<void> (0) : __assert_fail (
+ "ResultElementType == cast<PointerType>(getType()->getScalarType())->getElementType()"
+ ,
+                                                                        "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h"
+  ,
+                                                                        1094
+  , __PRETTY_FUNCTION__))
+                                                                         
+                                                                        ;
+  init(Ptr, IdxList, NameStr);
+}
+
+GetElementPtrInst::op_iterator GetElementPtrInst::op_begin() { return OperandTraits<GetElementPtrInst>::op_begin(this); } GetElementPtrInst::const_op_iterator GetElementPtrInst::op_begin() const { return OperandTraits<GetElementPtrInst>::op_begin(const_cast<GetElementPtrInst*>(this)); } GetElementPtrInst::op_iterator GetElementPtrInst::op_end() { return OperandTraits<GetElementPtrInst>::op_end(this); } GetElementPtrInst::const_op_iterator GetElementPtrInst::op_end() const { return OperandTraits<GetElementPtrInst>::op_end(const_cast<GetElementPtrInst*>(this)); } Value *GetElementPtrInst::getOperand(unsigned i_nocapture) const { 
+((
+i_nocapture < OperandTraits<GetElementPtrInst>::operands(this) && "getOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<GetElementPtrInst>::operands(this) && \"getOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 1098, __PRETTY_FUNCTION__))
+; return cast_or_null<Value>( OperandTraits<GetElementPtrInst>::op_begin(const_cast<GetElementPtrInst*>(this))[i_nocapture].get()); } void GetElementPtrInst::setOperand(unsigned i_nocapture, Value *Val_nocapture) { 
+((
+i_nocapture < OperandTraits<GetElementPtrInst>::operands(this) && "setOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<GetElementPtrInst>::operands(this) && \"setOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 1098, __PRETTY_FUNCTION__))
+; OperandTraits<GetElementPtrInst>::op_begin(this)[i_nocapture] = Val_nocapture; } unsigned GetElementPtrInst::getNumOperands() const { return OperandTraits<GetElementPtrInst>::operands(this); } template <int Idx_nocapture> Use &GetElementPtrInst::Op() { return this->OpFrom<Idx_nocapture>(this); } template <int Idx_nocapture> const Use &GetElementPtrInst::Op() const { return this->OpFrom<Idx_nocapture>(this); }
+class ICmpInst: public CmpInst {
+  void AssertOK() {
+    
+   ((
+   isIntPredicate() && "Invalid ICmp predicate value"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isIntPredicate() && \"Invalid ICmp predicate value\""
+   ,
+                                         "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h"
+    ,
+                                         1111
+    , __PRETTY_FUNCTION__))
+                                          
+                                         ;
+    
+   ((
+   getOperand(0)->getType() == getOperand(1)->getType() && "Both operands to ICmp instruction are not of the same type!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "getOperand(0)->getType() == getOperand(1)->getType() && \"Both operands to ICmp instruction are not of the same type!\""
+   ,
+                                                                       "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h"
+    ,
+                                                                       1113
+    , __PRETTY_FUNCTION__))
+                                                                        
+                                                                       ;
+
+    
+   ((
+   (getOperand(0)->getType()->isIntOrIntVectorTy() || getOperand(0)->getType()->isPtrOrPtrVectorTy()) && "Invalid operand types for ICmp instruction"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "(getOperand(0)->getType()->isIntOrIntVectorTy() || getOperand(0)->getType()->isPtrOrPtrVectorTy()) && \"Invalid operand types for ICmp instruction\""
+   ,
+
+                                                       "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h"
+    ,
+
+                                                       1117
+    , __PRETTY_FUNCTION__))
+
+                                                        
+                                                       ;
+  }
+
+protected:
+
+  friend class Instruction;
+
+
+  ICmpInst *cloneImpl() const;
+
+public:
+
+  ICmpInst(
+    Instruction *InsertBefore,
+    Predicate pred,
+    Value *LHS,
+    Value *RHS,
+    const Twine &NameStr = ""
+  ) : CmpInst(makeCmpResultType(LHS->getType()),
+              Instruction::ICmp, pred, LHS, RHS, NameStr,
+              InsertBefore) {
+
+  AssertOK();
+
+  }
+
+
+  ICmpInst(
+    BasicBlock &InsertAtEnd,
+    Predicate pred,
+    Value *LHS,
+    Value *RHS,
+    const Twine &NameStr = ""
+  ) : CmpInst(makeCmpResultType(LHS->getType()),
+              Instruction::ICmp, pred, LHS, RHS, NameStr,
+              &InsertAtEnd) {
+
+  AssertOK();
+
+  }
+
+
+  ICmpInst(
+    Predicate pred,
+    Value *LHS,
+    Value *RHS,
+    const Twine &NameStr = ""
+  ) : CmpInst(makeCmpResultType(LHS->getType()),
+              Instruction::ICmp, pred, LHS, RHS, NameStr) {
+
+  AssertOK();
+
+  }
+
+
+
+
+
+  Predicate getSignedPredicate() const {
+    return getSignedPredicate(getPredicate());
+  }
+
+
+
+  static Predicate getSignedPredicate(Predicate pred);
+
+
+
+
+
+  Predicate getUnsignedPredicate() const {
+    return getUnsignedPredicate(getPredicate());
+  }
+
+
+
+  static Predicate getUnsignedPredicate(Predicate pred);
+
+
+
+  static bool isEquality(Predicate P) {
+    return P == ICMP_EQ || P == ICMP_NE;
+  }
+
+
+
+  bool isEquality() const {
+    return isEquality(getPredicate());
+  }
+
+
+
+  bool isCommutative() const { return isEquality(); }
+
+
+
+  bool isRelational() const {
+    return !isEquality();
+  }
+
+
+
+  static bool isRelational(Predicate P) {
+    return !isEquality(P);
+  }
+
+
+
+
+
+
+  void swapOperands() {
+    setPredicate(getSwappedPredicate());
+    Op<0>().swap(Op<1>());
+  }
+
+
+  static bool classof(const Instruction *I) {
+    return I->getOpcode() == Instruction::ICmp;
+  }
+  static bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+};
+class FCmpInst: public CmpInst {
+  void AssertOK() {
+    
+   ((
+   isFPPredicate() && "Invalid FCmp predicate value"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isFPPredicate() && \"Invalid FCmp predicate value\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 1252, __PRETTY_FUNCTION__))
+                                                            ;
+    
+   ((
+   getOperand(0)->getType() == getOperand(1)->getType() && "Both operands to FCmp instruction are not of the same type!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "getOperand(0)->getType() == getOperand(1)->getType() && \"Both operands to FCmp instruction are not of the same type!\""
+   ,
+                                                                        "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h"
+    ,
+                                                                        1254
+    , __PRETTY_FUNCTION__))
+                                                                         
+                                                                        ;
+
+    
+   ((
+   getOperand(0)->getType()->isFPOrFPVectorTy() && "Invalid operand types for FCmp instruction"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "getOperand(0)->getType()->isFPOrFPVectorTy() && \"Invalid operand types for FCmp instruction\""
+   ,
+                                                       "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h"
+    ,
+                                                       1257
+    , __PRETTY_FUNCTION__))
+                                                        
+                                                       ;
+  }
+
+protected:
+
+  friend class Instruction;
+
+
+  FCmpInst *cloneImpl() const;
+
+public:
+
+  FCmpInst(
+    Instruction *InsertBefore,
+    Predicate pred,
+    Value *LHS,
+    Value *RHS,
+    const Twine &NameStr = ""
+  ) : CmpInst(makeCmpResultType(LHS->getType()),
+              Instruction::FCmp, pred, LHS, RHS, NameStr,
+              InsertBefore) {
+    AssertOK();
+  }
+
+
+  FCmpInst(
+    BasicBlock &InsertAtEnd,
+    Predicate pred,
+    Value *LHS,
+    Value *RHS,
+    const Twine &NameStr = ""
+  ) : CmpInst(makeCmpResultType(LHS->getType()),
+              Instruction::FCmp, pred, LHS, RHS, NameStr,
+              &InsertAtEnd) {
+    AssertOK();
+  }
+
+
+  FCmpInst(
+    Predicate pred,
+    Value *LHS,
+    Value *RHS,
+    const Twine &NameStr = ""
+  ) : CmpInst(makeCmpResultType(LHS->getType()),
+              Instruction::FCmp, pred, LHS, RHS, NameStr) {
+    AssertOK();
+  }
+
+
+
+  static bool isEquality(Predicate Pred) {
+    return Pred == FCMP_OEQ || Pred == FCMP_ONE || Pred == FCMP_UEQ ||
+           Pred == FCMP_UNE;
+  }
+
+
+
+  bool isEquality() const { return isEquality(getPredicate()); }
+
+
+
+  bool isCommutative() const {
+    return isEquality() ||
+           getPredicate() == FCMP_FALSE ||
+           getPredicate() == FCMP_TRUE ||
+           getPredicate() == FCMP_ORD ||
+           getPredicate() == FCMP_UNO;
+  }
+
+
+
+  bool isRelational() const { return !isEquality(); }
+
+
+
+
+
+
+  void swapOperands() {
+    setPredicate(getSwappedPredicate());
+    Op<0>().swap(Op<1>());
+  }
+
+
+  static bool classof(const Instruction *I) {
+    return I->getOpcode() == Instruction::FCmp;
+  }
+  static bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+};
+
+
+
+
+
+
+
+class CallInst : public Instruction,
+                 public OperandBundleUser<CallInst, User::op_iterator> {
+  friend class OperandBundleUser<CallInst, User::op_iterator>;
+
+  AttributeList Attrs;
+  FunctionType *FTy;
+
+  CallInst(const CallInst &CI);
+
+
+
+  inline CallInst(FunctionType *Ty, Value *Func, ArrayRef<Value *> Args,
+                  ArrayRef<OperandBundleDef> Bundles, const Twine &NameStr,
+                  Instruction *InsertBefore);
+
+  inline CallInst(Value *Func, ArrayRef<Value *> Args,
+                  ArrayRef<OperandBundleDef> Bundles, const Twine &NameStr,
+                  Instruction *InsertBefore)
+      : CallInst(cast<FunctionType>(
+                     cast<PointerType>(Func->getType())->getElementType()),
+                 Func, Args, Bundles, NameStr, InsertBefore) {}
+
+  inline CallInst(Value *Func, ArrayRef<Value *> Args, const Twine &NameStr,
+                  Instruction *InsertBefore)
+      : CallInst(Func, Args, None, NameStr, InsertBefore) {}
+
+
+
+  inline CallInst(Value *Func, ArrayRef<Value *> Args,
+                  ArrayRef<OperandBundleDef> Bundles, const Twine &NameStr,
+                  BasicBlock *InsertAtEnd);
+
+  explicit CallInst(Value *F, const Twine &NameStr,
+                    Instruction *InsertBefore);
+
+  CallInst(Value *F, const Twine &NameStr, BasicBlock *InsertAtEnd);
+
+  void init(Value *Func, ArrayRef<Value *> Args,
+            ArrayRef<OperandBundleDef> Bundles, const Twine &NameStr) {
+    init(cast<FunctionType>(
+             cast<PointerType>(Func->getType())->getElementType()),
+         Func, Args, Bundles, NameStr);
+  }
+  void init(FunctionType *FTy, Value *Func, ArrayRef<Value *> Args,
+            ArrayRef<OperandBundleDef> Bundles, const Twine &NameStr);
+  void init(Value *Func, const Twine &NameStr);
+
+  bool hasDescriptor() const { return HasDescriptor; }
+
+protected:
+
+  friend class Instruction;
+
+  CallInst *cloneImpl() const;
+
+public:
+  static CallInst *Create(Value *Func, ArrayRef<Value *> Args,
+                          ArrayRef<OperandBundleDef> Bundles = None,
+                          const Twine &NameStr = "",
+                          Instruction *InsertBefore = nullptr) {
+    return Create(cast<FunctionType>(
+                      cast<PointerType>(Func->getType())->getElementType()),
+                  Func, Args, Bundles, NameStr, InsertBefore);
+  }
+
+  static CallInst *Create(Value *Func, ArrayRef<Value *> Args,
+                          const Twine &NameStr,
+                          Instruction *InsertBefore = nullptr) {
+    return Create(cast<FunctionType>(
+                      cast<PointerType>(Func->getType())->getElementType()),
+                  Func, Args, None, NameStr, InsertBefore);
+  }
+
+  static CallInst *Create(FunctionType *Ty, Value *Func, ArrayRef<Value *> Args,
+                          const Twine &NameStr,
+                          Instruction *InsertBefore = nullptr) {
+    return new (unsigned(Args.size() + 1))
+        CallInst(Ty, Func, Args, None, NameStr, InsertBefore);
+  }
+
+  static CallInst *Create(FunctionType *Ty, Value *Func, ArrayRef<Value *> Args,
+                          ArrayRef<OperandBundleDef> Bundles = None,
+                          const Twine &NameStr = "",
+                          Instruction *InsertBefore = nullptr) {
+    const unsigned TotalOps =
+        unsigned(Args.size()) + CountBundleInputs(Bundles) + 1;
+    const unsigned DescriptorBytes = Bundles.size() * sizeof(BundleOpInfo);
+
+    return new (TotalOps, DescriptorBytes)
+        CallInst(Ty, Func, Args, Bundles, NameStr, InsertBefore);
+  }
+
+  static CallInst *Create(Value *Func, ArrayRef<Value *> Args,
+                          ArrayRef<OperandBundleDef> Bundles,
+                          const Twine &NameStr, BasicBlock *InsertAtEnd) {
+    const unsigned TotalOps =
+        unsigned(Args.size()) + CountBundleInputs(Bundles) + 1;
+    const unsigned DescriptorBytes = Bundles.size() * sizeof(BundleOpInfo);
+
+    return new (TotalOps, DescriptorBytes)
+        CallInst(Func, Args, Bundles, NameStr, InsertAtEnd);
+  }
+
+  static CallInst *Create(Value *Func, ArrayRef<Value *> Args,
+                          const Twine &NameStr, BasicBlock *InsertAtEnd) {
+    return new (unsigned(Args.size() + 1))
+        CallInst(Func, Args, None, NameStr, InsertAtEnd);
+  }
+
+  static CallInst *Create(Value *F, const Twine &NameStr = "",
+                          Instruction *InsertBefore = nullptr) {
+    return new(1) CallInst(F, NameStr, InsertBefore);
+  }
+
+  static CallInst *Create(Value *F, const Twine &NameStr,
+                          BasicBlock *InsertAtEnd) {
+    return new(1) CallInst(F, NameStr, InsertAtEnd);
+  }
+
+
+
+
+
+
+
+  static CallInst *Create(CallInst *CI, ArrayRef<OperandBundleDef> Bundles,
+                          Instruction *InsertPt = nullptr);
+
+
+
+
+
+
+
+  static Instruction *CreateMalloc(Instruction *InsertBefore,
+                                   Type *IntPtrTy, Type *AllocTy,
+                                   Value *AllocSize, Value *ArraySize = nullptr,
+                                   Function* MallocF = nullptr,
+                                   const Twine &Name = "");
+  static Instruction *CreateMalloc(BasicBlock *InsertAtEnd,
+                                   Type *IntPtrTy, Type *AllocTy,
+                                   Value *AllocSize, Value *ArraySize = nullptr,
+                                   Function* MallocF = nullptr,
+                                   const Twine &Name = "");
+  static Instruction *CreateMalloc(Instruction *InsertBefore,
+                                   Type *IntPtrTy, Type *AllocTy,
+                                   Value *AllocSize, Value *ArraySize = nullptr,
+                                   ArrayRef<OperandBundleDef> Bundles = None,
+                                   Function* MallocF = nullptr,
+                                   const Twine &Name = "");
+  static Instruction *CreateMalloc(BasicBlock *InsertAtEnd,
+                                   Type *IntPtrTy, Type *AllocTy,
+                                   Value *AllocSize, Value *ArraySize = nullptr,
+                                   ArrayRef<OperandBundleDef> Bundles = None,
+                                   Function* MallocF = nullptr,
+                                   const Twine &Name = "");
+
+  static Instruction *CreateFree(Value *Source,
+                                 Instruction *InsertBefore);
+  static Instruction *CreateFree(Value *Source,
+                                 BasicBlock *InsertAtEnd);
+  static Instruction *CreateFree(Value *Source,
+                                 ArrayRef<OperandBundleDef> Bundles,
+                                 Instruction *InsertBefore);
+  static Instruction *CreateFree(Value *Source,
+                                 ArrayRef<OperandBundleDef> Bundles,
+                                 BasicBlock *InsertAtEnd);
+
+  FunctionType *getFunctionType() const { return FTy; }
+
+  void mutateFunctionType(FunctionType *FTy) {
+    mutateType(FTy->getReturnType());
+    this->FTy = FTy;
+  }
+
+
+  enum TailCallKind { TCK_None = 0, TCK_Tail = 1, TCK_MustTail = 2,
+                      TCK_NoTail = 3 };
+  TailCallKind getTailCallKind() const {
+    return TailCallKind(getSubclassDataFromInstruction() & 3);
+  }
+
+  bool isTailCall() const {
+    unsigned Kind = getSubclassDataFromInstruction() & 3;
+    return Kind == TCK_Tail || Kind == TCK_MustTail;
+  }
+
+  bool isMustTailCall() const {
+    return (getSubclassDataFromInstruction() & 3) == TCK_MustTail;
+  }
+
+  bool isNoTailCall() const {
+    return (getSubclassDataFromInstruction() & 3) == TCK_NoTail;
+  }
+
+  void setTailCall(bool isTC = true) {
+    setInstructionSubclassData((getSubclassDataFromInstruction() & ~3) |
+                               unsigned(isTC ? TCK_Tail : TCK_None));
+  }
+
+  void setTailCallKind(TailCallKind TCK) {
+    setInstructionSubclassData((getSubclassDataFromInstruction() & ~3) |
+                               unsigned(TCK));
+  }
+
+
+  public: inline Value *getOperand(unsigned) const; inline void setOperand(unsigned, Value*); inline op_iterator op_begin(); inline const_op_iterator op_begin() const; inline op_iterator op_end(); inline const_op_iterator op_end() const; protected: template <int> inline Use &Op(); template <int> inline const Use &Op() const; public: inline unsigned getNumOperands() const;
+
+
+
+  unsigned getNumArgOperands() const {
+    return getNumOperands() - getNumTotalBundleOperands() - 1;
+  }
+
+
+
+  Value *getArgOperand(unsigned i) const {
+    
+   ((
+   i < getNumArgOperands() && "Out of bounds!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "i < getNumArgOperands() && \"Out of bounds!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 1572, __PRETTY_FUNCTION__))
+                                                      ;
+    return getOperand(i);
+  }
+  void setArgOperand(unsigned i, Value *v) {
+    
+   ((
+   i < getNumArgOperands() && "Out of bounds!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "i < getNumArgOperands() && \"Out of bounds!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 1576, __PRETTY_FUNCTION__))
+                                                      ;
+    setOperand(i, v);
+  }
+
+
+  op_iterator arg_begin() { return op_begin(); }
+
+
+  op_iterator arg_end() {
+
+    return op_end() - getNumTotalBundleOperands() - 1;
+  }
+
+
+  iterator_range<op_iterator> arg_operands() {
+    return make_range(arg_begin(), arg_end());
+  }
+
+
+  const_op_iterator arg_begin() const { return op_begin(); }
+
+
+  const_op_iterator arg_end() const {
+
+    return op_end() - getNumTotalBundleOperands() - 1;
+  }
+
+
+  iterator_range<const_op_iterator> arg_operands() const {
+    return make_range(arg_begin(), arg_end());
+  }
+
+
+  const Use &getArgOperandUse(unsigned i) const {
+    
+   ((
+   i < getNumArgOperands() && "Out of bounds!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "i < getNumArgOperands() && \"Out of bounds!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 1610, __PRETTY_FUNCTION__))
+                                                      ;
+    return getOperandUse(i);
+  }
+  Use &getArgOperandUse(unsigned i) {
+    
+   ((
+   i < getNumArgOperands() && "Out of bounds!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "i < getNumArgOperands() && \"Out of bounds!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 1614, __PRETTY_FUNCTION__))
+                                                      ;
+    return getOperandUse(i);
+  }
+
+
+
+  Value *getReturnedArgOperand() const;
+
+
+
+  CallingConv::ID getCallingConv() const {
+    return static_cast<CallingConv::ID>(getSubclassDataFromInstruction() >> 2);
+  }
+  void setCallingConv(CallingConv::ID CC) {
+    auto ID = static_cast<unsigned>(CC);
+    
+   ((
+   !(ID & ~CallingConv::MaxID) && "Unsupported calling convention"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!(ID & ~CallingConv::MaxID) && \"Unsupported calling convention\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 1629, __PRETTY_FUNCTION__))
+                                                                          ;
+    setInstructionSubclassData((getSubclassDataFromInstruction() & 3) |
+                               (ID << 2));
+  }
+
+
+
+  AttributeList getAttributes() const { return Attrs; }
+
+
+
+  void setAttributes(AttributeList A) { Attrs = A; }
+
+
+  void addAttribute(unsigned i, Attribute::AttrKind Kind);
+
+
+  void addAttribute(unsigned i, Attribute Attr);
+
+
+  void addParamAttr(unsigned ArgNo, Attribute::AttrKind Kind);
+
+
+  void addParamAttr(unsigned ArgNo, Attribute Attr);
+
+
+  void removeAttribute(unsigned i, Attribute::AttrKind Kind);
+
+
+  void removeAttribute(unsigned i, StringRef Kind);
+
+
+  void removeParamAttr(unsigned ArgNo, Attribute::AttrKind Kind);
+
+
+  void removeParamAttr(unsigned ArgNo, StringRef Kind);
+
+
+  void addDereferenceableAttr(unsigned i, uint64_t Bytes);
+
+
+
+  void addDereferenceableOrNullAttr(unsigned i, uint64_t Bytes);
+
+
+  bool hasFnAttr(Attribute::AttrKind Kind) const {
+    
+   ((
+   Kind != Attribute::NoBuiltin && "Use CallInst::isNoBuiltin() to check for Attribute::NoBuiltin"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Kind != Attribute::NoBuiltin && \"Use CallInst::isNoBuiltin() to check for Attribute::NoBuiltin\""
+   ,
+                                                                          "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h"
+    ,
+                                                                          1676
+    , __PRETTY_FUNCTION__))
+                                                                           
+                                                                          ;
+    return hasFnAttrImpl(Kind);
+  }
+
+
+  bool hasFnAttr(StringRef Kind) const {
+    return hasFnAttrImpl(Kind);
+  }
+
+
+  bool hasRetAttr(Attribute::AttrKind Kind) const;
+
+
+  bool paramHasAttr(unsigned ArgNo, Attribute::AttrKind Kind) const;
+
+
+  Attribute getAttribute(unsigned i, Attribute::AttrKind Kind) const {
+    return getAttributes().getAttribute(i, Kind);
+  }
+
+
+  Attribute getAttribute(unsigned i, StringRef Kind) const {
+    return getAttributes().getAttribute(i, Kind);
+  }
+
+
+  Attribute getParamAttr(unsigned ArgNo, Attribute::AttrKind Kind) const {
+    
+   ((
+   ArgNo < getNumArgOperands() && "Out of bounds"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "ArgNo < getNumArgOperands() && \"Out of bounds\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 1703, __PRETTY_FUNCTION__))
+                                                         ;
+    return getAttributes().getParamAttr(ArgNo, Kind);
+  }
+
+
+  Attribute getParamAttr(unsigned ArgNo, StringRef Kind) const {
+    
+   ((
+   ArgNo < getNumArgOperands() && "Out of bounds"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "ArgNo < getNumArgOperands() && \"Out of bounds\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 1709, __PRETTY_FUNCTION__))
+                                                         ;
+    return getAttributes().getParamAttr(ArgNo, Kind);
+  }
+  bool dataOperandHasImpliedAttr(unsigned i, Attribute::AttrKind Kind) const;
+
+
+  unsigned getRetAlignment() const { return Attrs.getRetAlignment(); }
+
+
+  unsigned getParamAlignment(unsigned ArgNo) const {
+    return Attrs.getParamAlignment(ArgNo);
+  }
+
+
+
+  uint64_t getDereferenceableBytes(unsigned i) const {
+    return Attrs.getDereferenceableBytes(i);
+  }
+
+
+
+  uint64_t getDereferenceableOrNullBytes(unsigned i) const {
+    return Attrs.getDereferenceableOrNullBytes(i);
+  }
+
+
+  bool returnDoesNotAlias() const {
+    return Attrs.hasAttribute(AttributeList::ReturnIndex, Attribute::NoAlias);
+  }
+
+
+
+  bool isNoBuiltin() const {
+    return hasFnAttrImpl(Attribute::NoBuiltin) &&
+      !hasFnAttrImpl(Attribute::Builtin);
+  }
+
+
+  bool isStrictFP() const { return hasFnAttr(Attribute::StrictFP); }
+
+
+  bool isNoInline() const { return hasFnAttr(Attribute::NoInline); }
+  void setIsNoInline() {
+    addAttribute(AttributeList::FunctionIndex, Attribute::NoInline);
+  }
+
+
+  bool canReturnTwice() const {
+    return hasFnAttr(Attribute::ReturnsTwice);
+  }
+  void setCanReturnTwice() {
+    addAttribute(AttributeList::FunctionIndex, Attribute::ReturnsTwice);
+  }
+
+
+  bool doesNotAccessMemory() const {
+    return hasFnAttr(Attribute::ReadNone);
+  }
+  void setDoesNotAccessMemory() {
+    addAttribute(AttributeList::FunctionIndex, Attribute::ReadNone);
+  }
+
+
+  bool onlyReadsMemory() const {
+    return doesNotAccessMemory() || hasFnAttr(Attribute::ReadOnly);
+  }
+  void setOnlyReadsMemory() {
+    addAttribute(AttributeList::FunctionIndex, Attribute::ReadOnly);
+  }
+
+
+  bool doesNotReadMemory() const {
+    return doesNotAccessMemory() || hasFnAttr(Attribute::WriteOnly);
+  }
+  void setDoesNotReadMemory() {
+    addAttribute(AttributeList::FunctionIndex, Attribute::WriteOnly);
+  }
+
+
+
+  bool onlyAccessesArgMemory() const {
+    return hasFnAttr(Attribute::ArgMemOnly);
+  }
+  void setOnlyAccessesArgMemory() {
+    addAttribute(AttributeList::FunctionIndex, Attribute::ArgMemOnly);
+  }
+
+
+
+  bool onlyAccessesInaccessibleMemory() const {
+    return hasFnAttr(Attribute::InaccessibleMemOnly);
+  }
+  void setOnlyAccessesInaccessibleMemory() {
+    addAttribute(AttributeList::FunctionIndex, Attribute::InaccessibleMemOnly);
+  }
+
+
+
+  bool onlyAccessesInaccessibleMemOrArgMem() const {
+    return hasFnAttr(Attribute::InaccessibleMemOrArgMemOnly);
+  }
+  void setOnlyAccessesInaccessibleMemOrArgMem() {
+    addAttribute(AttributeList::FunctionIndex, Attribute::InaccessibleMemOrArgMemOnly);
+  }
+
+
+  bool doesNotReturn() const { return hasFnAttr(Attribute::NoReturn); }
+  void setDoesNotReturn() {
+    addAttribute(AttributeList::FunctionIndex, Attribute::NoReturn);
+  }
+
+
+  bool doesNotThrow() const { return hasFnAttr(Attribute::NoUnwind); }
+  void setDoesNotThrow() {
+    addAttribute(AttributeList::FunctionIndex, Attribute::NoUnwind);
+  }
+
+
+  bool cannotDuplicate() const {return hasFnAttr(Attribute::NoDuplicate); }
+  void setCannotDuplicate() {
+    addAttribute(AttributeList::FunctionIndex, Attribute::NoDuplicate);
+  }
+
+
+  bool isConvergent() const { return hasFnAttr(Attribute::Convergent); }
+  void setConvergent() {
+    addAttribute(AttributeList::FunctionIndex, Attribute::Convergent);
+  }
+  void setNotConvergent() {
+    removeAttribute(AttributeList::FunctionIndex, Attribute::Convergent);
+  }
+
+
+
+  bool hasStructRetAttr() const {
+    if (getNumArgOperands() == 0)
+      return false;
+
+
+    return paramHasAttr(0, Attribute::StructRet);
+  }
+
+
+  bool hasByValArgument() const {
+    return Attrs.hasAttrSomewhere(Attribute::ByVal);
+  }
+
+
+
+
+  Function *getCalledFunction() const {
+    return dyn_cast<Function>(Op<-1>());
+  }
+
+
+
+  const Value *getCalledValue() const { return Op<-1>(); }
+        Value *getCalledValue() { return Op<-1>(); }
+
+
+  void setCalledFunction(Value* Fn) {
+    setCalledFunction(
+        cast<FunctionType>(cast<PointerType>(Fn->getType())->getElementType()),
+        Fn);
+  }
+  void setCalledFunction(FunctionType *FTy, Value *Fn) {
+    this->FTy = FTy;
+    
+   ((
+   FTy == cast<FunctionType>( cast<PointerType>(Fn->getType())->getElementType())
+   ) ? static_cast<void> (0) : __assert_fail (
+   "FTy == cast<FunctionType>( cast<PointerType>(Fn->getType())->getElementType())"
+   ,
+                                                                         "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h"
+    ,
+                                                                         1891
+    , __PRETTY_FUNCTION__))
+                                                                          
+                                                                         ;
+    Op<-1>() = Fn;
+  }
+
+
+  bool isInlineAsm() const {
+    return isa<InlineAsm>(Op<-1>());
+  }
+
+
+  static bool classof(const Instruction *I) {
+    return I->getOpcode() == Instruction::Call;
+  }
+  static bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+
+private:
+  template <typename AttrKind> bool hasFnAttrImpl(AttrKind Kind) const {
+    if (Attrs.hasAttribute(AttributeList::FunctionIndex, Kind))
+      return true;
+
+
+
+    if (isFnAttrDisallowedByOpBundle(Kind))
+      return false;
+
+    if (const Function *F = getCalledFunction())
+      return F->getAttributes().hasAttribute(AttributeList::FunctionIndex,
+                                             Kind);
+    return false;
+  }
+
+
+
+  void setInstructionSubclassData(unsigned short D) {
+    Instruction::setInstructionSubclassData(D);
+  }
+};
+
+template <>
+struct OperandTraits<CallInst> : public VariadicOperandTraits<CallInst, 1> {
+};
+
+CallInst::CallInst(Value *Func, ArrayRef<Value *> Args,
+                   ArrayRef<OperandBundleDef> Bundles, const Twine &NameStr,
+                   BasicBlock *InsertAtEnd)
+    : Instruction(
+          cast<FunctionType>(cast<PointerType>(Func->getType())
+                                 ->getElementType())->getReturnType(),
+          Instruction::Call, OperandTraits<CallInst>::op_end(this) -
+                                 (Args.size() + CountBundleInputs(Bundles) + 1),
+          unsigned(Args.size() + CountBundleInputs(Bundles) + 1), InsertAtEnd) {
+  init(Func, Args, Bundles, NameStr);
+}
+
+CallInst::CallInst(FunctionType *Ty, Value *Func, ArrayRef<Value *> Args,
+                   ArrayRef<OperandBundleDef> Bundles, const Twine &NameStr,
+                   Instruction *InsertBefore)
+    : Instruction(Ty->getReturnType(), Instruction::Call,
+                  OperandTraits<CallInst>::op_end(this) -
+                      (Args.size() + CountBundleInputs(Bundles) + 1),
+                  unsigned(Args.size() + CountBundleInputs(Bundles) + 1),
+                  InsertBefore) {
+  init(Ty, Func, Args, Bundles, NameStr);
+}
+
+
+
+
+CallInst::op_iterator CallInst::op_begin() { return OperandTraits<CallInst>::op_begin(this); } CallInst::const_op_iterator CallInst::op_begin() const { return OperandTraits<CallInst>::op_begin(const_cast<CallInst*>(this)); } CallInst::op_iterator CallInst::op_end() { return OperandTraits<CallInst>::op_end(this); } CallInst::const_op_iterator CallInst::op_end() const { return OperandTraits<CallInst>::op_end(const_cast<CallInst*>(this)); } Value *CallInst::getOperand(unsigned i_nocapture) const { 
+((
+i_nocapture < OperandTraits<CallInst>::operands(this) && "getOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<CallInst>::operands(this) && \"getOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 1961, __PRETTY_FUNCTION__))
+; return cast_or_null<Value>( OperandTraits<CallInst>::op_begin(const_cast<CallInst*>(this))[i_nocapture].get()); } void CallInst::setOperand(unsigned i_nocapture, Value *Val_nocapture) { 
+((
+i_nocapture < OperandTraits<CallInst>::operands(this) && "setOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<CallInst>::operands(this) && \"setOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 1961, __PRETTY_FUNCTION__))
+; OperandTraits<CallInst>::op_begin(this)[i_nocapture] = Val_nocapture; } unsigned CallInst::getNumOperands() const { return OperandTraits<CallInst>::operands(this); } template <int Idx_nocapture> Use &CallInst::Op() { return this->OpFrom<Idx_nocapture>(this); } template <int Idx_nocapture> const Use &CallInst::Op() const { return this->OpFrom<Idx_nocapture>(this); }
+
+
+
+
+
+
+
+class SelectInst : public Instruction {
+  SelectInst(Value *C, Value *S1, Value *S2, const Twine &NameStr,
+             Instruction *InsertBefore)
+    : Instruction(S1->getType(), Instruction::Select,
+                  &Op<0>(), 3, InsertBefore) {
+    init(C, S1, S2);
+    setName(NameStr);
+  }
+
+  SelectInst(Value *C, Value *S1, Value *S2, const Twine &NameStr,
+             BasicBlock *InsertAtEnd)
+    : Instruction(S1->getType(), Instruction::Select,
+                  &Op<0>(), 3, InsertAtEnd) {
+    init(C, S1, S2);
+    setName(NameStr);
+  }
+
+  void init(Value *C, Value *S1, Value *S2) {
+    
+   ((
+   !areInvalidOperands(C, S1, S2) && "Invalid operands for select"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!areInvalidOperands(C, S1, S2) && \"Invalid operands for select\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 1987, __PRETTY_FUNCTION__))
+                                                                          ;
+    Op<0>() = C;
+    Op<1>() = S1;
+    Op<2>() = S2;
+  }
+
+protected:
+
+  friend class Instruction;
+
+  SelectInst *cloneImpl() const;
+
+public:
+  static SelectInst *Create(Value *C, Value *S1, Value *S2,
+                            const Twine &NameStr = "",
+                            Instruction *InsertBefore = nullptr,
+                            Instruction *MDFrom = nullptr) {
+    SelectInst *Sel = new(3) SelectInst(C, S1, S2, NameStr, InsertBefore);
+    if (MDFrom)
+      Sel->copyMetadata(*MDFrom);
+    return Sel;
+  }
+
+  static SelectInst *Create(Value *C, Value *S1, Value *S2,
+                            const Twine &NameStr,
+                            BasicBlock *InsertAtEnd) {
+    return new(3) SelectInst(C, S1, S2, NameStr, InsertAtEnd);
+  }
+
+  const Value *getCondition() const { return Op<0>(); }
+  const Value *getTrueValue() const { return Op<1>(); }
+  const Value *getFalseValue() const { return Op<2>(); }
+  Value *getCondition() { return Op<0>(); }
+  Value *getTrueValue() { return Op<1>(); }
+  Value *getFalseValue() { return Op<2>(); }
+
+  void setCondition(Value *V) { Op<0>() = V; }
+  void setTrueValue(Value *V) { Op<1>() = V; }
+  void setFalseValue(Value *V) { Op<2>() = V; }
+
+
+
+  static const char *areInvalidOperands(Value *Cond, Value *True, Value *False);
+
+
+  public: inline Value *getOperand(unsigned) const; inline void setOperand(unsigned, Value*); inline op_iterator op_begin(); inline const_op_iterator op_begin() const; inline op_iterator op_end(); inline const_op_iterator op_end() const; protected: template <int> inline Use &Op(); template <int> inline const Use &Op() const; public: inline unsigned getNumOperands() const;
+
+  OtherOps getOpcode() const {
+    return static_cast<OtherOps>(Instruction::getOpcode());
+  }
+
+
+  static bool classof(const Instruction *I) {
+    return I->getOpcode() == Instruction::Select;
+  }
+  static bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+};
+
+template <>
+struct OperandTraits<SelectInst> : public FixedNumOperandTraits<SelectInst, 3> {
+};
+
+SelectInst::op_iterator SelectInst::op_begin() { return OperandTraits<SelectInst>::op_begin(this); } SelectInst::const_op_iterator SelectInst::op_begin() const { return OperandTraits<SelectInst>::op_begin(const_cast<SelectInst*>(this)); } SelectInst::op_iterator SelectInst::op_end() { return OperandTraits<SelectInst>::op_end(this); } SelectInst::const_op_iterator SelectInst::op_end() const { return OperandTraits<SelectInst>::op_end(const_cast<SelectInst*>(this)); } Value *SelectInst::getOperand(unsigned i_nocapture) const { 
+((
+i_nocapture < OperandTraits<SelectInst>::operands(this) && "getOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<SelectInst>::operands(this) && \"getOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 2051, __PRETTY_FUNCTION__))
+; return cast_or_null<Value>( OperandTraits<SelectInst>::op_begin(const_cast<SelectInst*>(this))[i_nocapture].get()); } void SelectInst::setOperand(unsigned i_nocapture, Value *Val_nocapture) { 
+((
+i_nocapture < OperandTraits<SelectInst>::operands(this) && "setOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<SelectInst>::operands(this) && \"setOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 2051, __PRETTY_FUNCTION__))
+; OperandTraits<SelectInst>::op_begin(this)[i_nocapture] = Val_nocapture; } unsigned SelectInst::getNumOperands() const { return OperandTraits<SelectInst>::operands(this); } template <int Idx_nocapture> Use &SelectInst::Op() { return this->OpFrom<Idx_nocapture>(this); } template <int Idx_nocapture> const Use &SelectInst::Op() const { return this->OpFrom<Idx_nocapture>(this); }
+class VAArgInst : public UnaryInstruction {
+protected:
+
+  friend class Instruction;
+
+  VAArgInst *cloneImpl() const;
+
+public:
+  VAArgInst(Value *List, Type *Ty, const Twine &NameStr = "",
+             Instruction *InsertBefore = nullptr)
+    : UnaryInstruction(Ty, VAArg, List, InsertBefore) {
+    setName(NameStr);
+  }
+
+  VAArgInst(Value *List, Type *Ty, const Twine &NameStr,
+            BasicBlock *InsertAtEnd)
+    : UnaryInstruction(Ty, VAArg, List, InsertAtEnd) {
+    setName(NameStr);
+  }
+
+  Value *getPointerOperand() { return getOperand(0); }
+  const Value *getPointerOperand() const { return getOperand(0); }
+  static unsigned getPointerOperandIndex() { return 0U; }
+
+
+  static bool classof(const Instruction *I) {
+    return I->getOpcode() == VAArg;
+  }
+  static bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+};
+class ExtractElementInst : public Instruction {
+  ExtractElementInst(Value *Vec, Value *Idx, const Twine &NameStr = "",
+                     Instruction *InsertBefore = nullptr);
+  ExtractElementInst(Value *Vec, Value *Idx, const Twine &NameStr,
+                     BasicBlock *InsertAtEnd);
+
+protected:
+
+  friend class Instruction;
+
+  ExtractElementInst *cloneImpl() const;
+
+public:
+  static ExtractElementInst *Create(Value *Vec, Value *Idx,
+                                   const Twine &NameStr = "",
+                                   Instruction *InsertBefore = nullptr) {
+    return new(2) ExtractElementInst(Vec, Idx, NameStr, InsertBefore);
+  }
+
+  static ExtractElementInst *Create(Value *Vec, Value *Idx,
+                                   const Twine &NameStr,
+                                   BasicBlock *InsertAtEnd) {
+    return new(2) ExtractElementInst(Vec, Idx, NameStr, InsertAtEnd);
+  }
+
+
+
+  static bool isValidOperands(const Value *Vec, const Value *Idx);
+
+  Value *getVectorOperand() { return Op<0>(); }
+  Value *getIndexOperand() { return Op<1>(); }
+  const Value *getVectorOperand() const { return Op<0>(); }
+  const Value *getIndexOperand() const { return Op<1>(); }
+
+  VectorType *getVectorOperandType() const {
+    return cast<VectorType>(getVectorOperand()->getType());
+  }
+
+
+  public: inline Value *getOperand(unsigned) const; inline void setOperand(unsigned, Value*); inline op_iterator op_begin(); inline const_op_iterator op_begin() const; inline op_iterator op_end(); inline const_op_iterator op_end() const; protected: template <int> inline Use &Op(); template <int> inline const Use &Op() const; public: inline unsigned getNumOperands() const;
+
+
+  static bool classof(const Instruction *I) {
+    return I->getOpcode() == Instruction::ExtractElement;
+  }
+  static bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+};
+
+template <>
+struct OperandTraits<ExtractElementInst> :
+  public FixedNumOperandTraits<ExtractElementInst, 2> {
+};
+
+ExtractElementInst::op_iterator ExtractElementInst::op_begin() { return OperandTraits<ExtractElementInst>::op_begin(this); } ExtractElementInst::const_op_iterator ExtractElementInst::op_begin() const { return OperandTraits<ExtractElementInst>::op_begin(const_cast<ExtractElementInst*>(this)); } ExtractElementInst::op_iterator ExtractElementInst::op_end() { return OperandTraits<ExtractElementInst>::op_end(this); } ExtractElementInst::const_op_iterator ExtractElementInst::op_end() const { return OperandTraits<ExtractElementInst>::op_end(const_cast<ExtractElementInst*>(this)); } Value *ExtractElementInst::getOperand(unsigned i_nocapture) const { 
+((
+i_nocapture < OperandTraits<ExtractElementInst>::operands(this) && "getOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<ExtractElementInst>::operands(this) && \"getOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 2155, __PRETTY_FUNCTION__))
+; return cast_or_null<Value>( OperandTraits<ExtractElementInst>::op_begin(const_cast<ExtractElementInst*>(this))[i_nocapture].get()); } void ExtractElementInst::setOperand(unsigned i_nocapture, Value *Val_nocapture) { 
+((
+i_nocapture < OperandTraits<ExtractElementInst>::operands(this) && "setOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<ExtractElementInst>::operands(this) && \"setOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 2155, __PRETTY_FUNCTION__))
+; OperandTraits<ExtractElementInst>::op_begin(this)[i_nocapture] = Val_nocapture; } unsigned ExtractElementInst::getNumOperands() const { return OperandTraits<ExtractElementInst>::operands(this); } template <int Idx_nocapture> Use &ExtractElementInst::Op() { return this->OpFrom<Idx_nocapture>(this); } template <int Idx_nocapture> const Use &ExtractElementInst::Op() const { return this->OpFrom<Idx_nocapture>(this); }
+class InsertElementInst : public Instruction {
+  InsertElementInst(Value *Vec, Value *NewElt, Value *Idx,
+                    const Twine &NameStr = "",
+                    Instruction *InsertBefore = nullptr);
+  InsertElementInst(Value *Vec, Value *NewElt, Value *Idx, const Twine &NameStr,
+                    BasicBlock *InsertAtEnd);
+
+protected:
+
+  friend class Instruction;
+
+  InsertElementInst *cloneImpl() const;
+
+public:
+  static InsertElementInst *Create(Value *Vec, Value *NewElt, Value *Idx,
+                                   const Twine &NameStr = "",
+                                   Instruction *InsertBefore = nullptr) {
+    return new(3) InsertElementInst(Vec, NewElt, Idx, NameStr, InsertBefore);
+  }
+
+  static InsertElementInst *Create(Value *Vec, Value *NewElt, Value *Idx,
+                                   const Twine &NameStr,
+                                   BasicBlock *InsertAtEnd) {
+    return new(3) InsertElementInst(Vec, NewElt, Idx, NameStr, InsertAtEnd);
+  }
+
+
+
+  static bool isValidOperands(const Value *Vec, const Value *NewElt,
+                              const Value *Idx);
+
+
+
+  VectorType *getType() const {
+    return cast<VectorType>(Instruction::getType());
+  }
+
+
+  public: inline Value *getOperand(unsigned) const; inline void setOperand(unsigned, Value*); inline op_iterator op_begin(); inline const_op_iterator op_begin() const; inline op_iterator op_end(); inline const_op_iterator op_end() const; protected: template <int> inline Use &Op(); template <int> inline const Use &Op() const; public: inline unsigned getNumOperands() const;
+
+
+  static bool classof(const Instruction *I) {
+    return I->getOpcode() == Instruction::InsertElement;
+  }
+  static bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+};
+
+template <>
+struct OperandTraits<InsertElementInst> :
+  public FixedNumOperandTraits<InsertElementInst, 3> {
+};
+
+InsertElementInst::op_iterator InsertElementInst::op_begin() { return OperandTraits<InsertElementInst>::op_begin(this); } InsertElementInst::const_op_iterator InsertElementInst::op_begin() const { return OperandTraits<InsertElementInst>::op_begin(const_cast<InsertElementInst*>(this)); } InsertElementInst::op_iterator InsertElementInst::op_end() { return OperandTraits<InsertElementInst>::op_end(this); } InsertElementInst::const_op_iterator InsertElementInst::op_end() const { return OperandTraits<InsertElementInst>::op_end(const_cast<InsertElementInst*>(this)); } Value *InsertElementInst::getOperand(unsigned i_nocapture) const { 
+((
+i_nocapture < OperandTraits<InsertElementInst>::operands(this) && "getOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<InsertElementInst>::operands(this) && \"getOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 2218, __PRETTY_FUNCTION__))
+; return cast_or_null<Value>( OperandTraits<InsertElementInst>::op_begin(const_cast<InsertElementInst*>(this))[i_nocapture].get()); } void InsertElementInst::setOperand(unsigned i_nocapture, Value *Val_nocapture) { 
+((
+i_nocapture < OperandTraits<InsertElementInst>::operands(this) && "setOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<InsertElementInst>::operands(this) && \"setOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 2218, __PRETTY_FUNCTION__))
+; OperandTraits<InsertElementInst>::op_begin(this)[i_nocapture] = Val_nocapture; } unsigned InsertElementInst::getNumOperands() const { return OperandTraits<InsertElementInst>::operands(this); } template <int Idx_nocapture> Use &InsertElementInst::Op() { return this->OpFrom<Idx_nocapture>(this); } template <int Idx_nocapture> const Use &InsertElementInst::Op() const { return this->OpFrom<Idx_nocapture>(this); }
+class ShuffleVectorInst : public Instruction {
+protected:
+
+  friend class Instruction;
+
+  ShuffleVectorInst *cloneImpl() const;
+
+public:
+  ShuffleVectorInst(Value *V1, Value *V2, Value *Mask,
+                    const Twine &NameStr = "",
+                    Instruction *InsertBefor = nullptr);
+  ShuffleVectorInst(Value *V1, Value *V2, Value *Mask,
+                    const Twine &NameStr, BasicBlock *InsertAtEnd);
+
+
+  void *operator new(size_t s) {
+    return User::operator new(s, 3);
+  }
+
+
+
+  static bool isValidOperands(const Value *V1, const Value *V2,
+                              const Value *Mask);
+
+
+
+  VectorType *getType() const {
+    return cast<VectorType>(Instruction::getType());
+  }
+
+
+  public: inline Value *getOperand(unsigned) const; inline void setOperand(unsigned, Value*); inline op_iterator op_begin(); inline const_op_iterator op_begin() const; inline op_iterator op_end(); inline const_op_iterator op_end() const; protected: template <int> inline Use &Op(); template <int> inline const Use &Op() const; public: inline unsigned getNumOperands() const;
+
+  Constant *getMask() const {
+    return cast<Constant>(getOperand(2));
+  }
+
+
+
+  static int getMaskValue(Constant *Mask, unsigned Elt);
+
+
+
+  int getMaskValue(unsigned Elt) const {
+    return getMaskValue(getMask(), Elt);
+  }
+
+
+
+  static void getShuffleMask(Constant *Mask, SmallVectorImpl<int> &Result);
+
+
+
+  void getShuffleMask(SmallVectorImpl<int> &Result) const {
+    return getShuffleMask(getMask(), Result);
+  }
+
+  SmallVector<int, 16> getShuffleMask() const {
+    SmallVector<int, 16> Mask;
+    getShuffleMask(Mask);
+    return Mask;
+  }
+
+
+
+  static void commuteShuffleMask(MutableArrayRef<int> Mask,
+                                 unsigned InVecNumElts) {
+    for (int &Idx : Mask) {
+      if (Idx == -1)
+        continue;
+      Idx = Idx < (int)InVecNumElts ? Idx + InVecNumElts : Idx - InVecNumElts;
+      
+     ((
+     Idx >= 0 && Idx < (int)InVecNumElts * 2 && "shufflevector mask index out of range"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "Idx >= 0 && Idx < (int)InVecNumElts * 2 && \"shufflevector mask index out of range\""
+     ,
+                                                    "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h"
+      ,
+                                                    2299
+      , __PRETTY_FUNCTION__))
+                                                     
+                                                    ;
+    }
+  }
+
+
+  static bool classof(const Instruction *I) {
+    return I->getOpcode() == Instruction::ShuffleVector;
+  }
+  static bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+};
+
+template <>
+struct OperandTraits<ShuffleVectorInst> :
+  public FixedNumOperandTraits<ShuffleVectorInst, 3> {
+};
+
+ShuffleVectorInst::op_iterator ShuffleVectorInst::op_begin() { return OperandTraits<ShuffleVectorInst>::op_begin(this); } ShuffleVectorInst::const_op_iterator ShuffleVectorInst::op_begin() const { return OperandTraits<ShuffleVectorInst>::op_begin(const_cast<ShuffleVectorInst*>(this)); } ShuffleVectorInst::op_iterator ShuffleVectorInst::op_end() { return OperandTraits<ShuffleVectorInst>::op_end(this); } ShuffleVectorInst::const_op_iterator ShuffleVectorInst::op_end() const { return OperandTraits<ShuffleVectorInst>::op_end(const_cast<ShuffleVectorInst*>(this)); } Value *ShuffleVectorInst::getOperand(unsigned i_nocapture) const { 
+((
+i_nocapture < OperandTraits<ShuffleVectorInst>::operands(this) && "getOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<ShuffleVectorInst>::operands(this) && \"getOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 2317, __PRETTY_FUNCTION__))
+; return cast_or_null<Value>( OperandTraits<ShuffleVectorInst>::op_begin(const_cast<ShuffleVectorInst*>(this))[i_nocapture].get()); } void ShuffleVectorInst::setOperand(unsigned i_nocapture, Value *Val_nocapture) { 
+((
+i_nocapture < OperandTraits<ShuffleVectorInst>::operands(this) && "setOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<ShuffleVectorInst>::operands(this) && \"setOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 2317, __PRETTY_FUNCTION__))
+; OperandTraits<ShuffleVectorInst>::op_begin(this)[i_nocapture] = Val_nocapture; } unsigned ShuffleVectorInst::getNumOperands() const { return OperandTraits<ShuffleVectorInst>::operands(this); } template <int Idx_nocapture> Use &ShuffleVectorInst::Op() { return this->OpFrom<Idx_nocapture>(this); } template <int Idx_nocapture> const Use &ShuffleVectorInst::Op() const { return this->OpFrom<Idx_nocapture>(this); }
+class ExtractValueInst : public UnaryInstruction {
+  SmallVector<unsigned, 4> Indices;
+
+  ExtractValueInst(const ExtractValueInst &EVI);
+
+
+
+
+
+  inline ExtractValueInst(Value *Agg,
+                          ArrayRef<unsigned> Idxs,
+                          const Twine &NameStr,
+                          Instruction *InsertBefore);
+  inline ExtractValueInst(Value *Agg,
+                          ArrayRef<unsigned> Idxs,
+                          const Twine &NameStr, BasicBlock *InsertAtEnd);
+
+  void init(ArrayRef<unsigned> Idxs, const Twine &NameStr);
+
+protected:
+
+  friend class Instruction;
+
+  ExtractValueInst *cloneImpl() const;
+
+public:
+  static ExtractValueInst *Create(Value *Agg,
+                                  ArrayRef<unsigned> Idxs,
+                                  const Twine &NameStr = "",
+                                  Instruction *InsertBefore = nullptr) {
+    return new
+      ExtractValueInst(Agg, Idxs, NameStr, InsertBefore);
+  }
+
+  static ExtractValueInst *Create(Value *Agg,
+                                  ArrayRef<unsigned> Idxs,
+                                  const Twine &NameStr,
+                                  BasicBlock *InsertAtEnd) {
+    return new ExtractValueInst(Agg, Idxs, NameStr, InsertAtEnd);
+  }
+
+
+
+
+
+  static Type *getIndexedType(Type *Agg, ArrayRef<unsigned> Idxs);
+
+  using idx_iterator = const unsigned*;
+
+  inline idx_iterator idx_begin() const { return Indices.begin(); }
+  inline idx_iterator idx_end() const { return Indices.end(); }
+  inline iterator_range<idx_iterator> indices() const {
+    return make_range(idx_begin(), idx_end());
+  }
+
+  Value *getAggregateOperand() {
+    return getOperand(0);
+  }
+  const Value *getAggregateOperand() const {
+    return getOperand(0);
+  }
+  static unsigned getAggregateOperandIndex() {
+    return 0U;
+  }
+
+  ArrayRef<unsigned> getIndices() const {
+    return Indices;
+  }
+
+  unsigned getNumIndices() const {
+    return (unsigned)Indices.size();
+  }
+
+  bool hasIndices() const {
+    return true;
+  }
+
+
+  static bool classof(const Instruction *I) {
+    return I->getOpcode() == Instruction::ExtractValue;
+  }
+  static bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+};
+
+ExtractValueInst::ExtractValueInst(Value *Agg,
+                                   ArrayRef<unsigned> Idxs,
+                                   const Twine &NameStr,
+                                   Instruction *InsertBefore)
+  : UnaryInstruction(checkGEPType(getIndexedType(Agg->getType(), Idxs)),
+                     ExtractValue, Agg, InsertBefore) {
+  init(Idxs, NameStr);
+}
+
+ExtractValueInst::ExtractValueInst(Value *Agg,
+                                   ArrayRef<unsigned> Idxs,
+                                   const Twine &NameStr,
+                                   BasicBlock *InsertAtEnd)
+  : UnaryInstruction(checkGEPType(getIndexedType(Agg->getType(), Idxs)),
+                     ExtractValue, Agg, InsertAtEnd) {
+  init(Idxs, NameStr);
+}
+class InsertValueInst : public Instruction {
+  SmallVector<unsigned, 4> Indices;
+
+  InsertValueInst(const InsertValueInst &IVI);
+
+
+
+
+
+  inline InsertValueInst(Value *Agg, Value *Val,
+                         ArrayRef<unsigned> Idxs,
+                         const Twine &NameStr,
+                         Instruction *InsertBefore);
+  inline InsertValueInst(Value *Agg, Value *Val,
+                         ArrayRef<unsigned> Idxs,
+                         const Twine &NameStr, BasicBlock *InsertAtEnd);
+
+
+
+  InsertValueInst(Value *Agg, Value *Val, unsigned Idx,
+                  const Twine &NameStr = "",
+                  Instruction *InsertBefore = nullptr);
+  InsertValueInst(Value *Agg, Value *Val, unsigned Idx, const Twine &NameStr,
+                  BasicBlock *InsertAtEnd);
+
+  void init(Value *Agg, Value *Val, ArrayRef<unsigned> Idxs,
+            const Twine &NameStr);
+
+protected:
+
+  friend class Instruction;
+
+  InsertValueInst *cloneImpl() const;
+
+public:
+
+  void *operator new(size_t s) {
+    return User::operator new(s, 2);
+  }
+
+  static InsertValueInst *Create(Value *Agg, Value *Val,
+                                 ArrayRef<unsigned> Idxs,
+                                 const Twine &NameStr = "",
+                                 Instruction *InsertBefore = nullptr) {
+    return new InsertValueInst(Agg, Val, Idxs, NameStr, InsertBefore);
+  }
+
+  static InsertValueInst *Create(Value *Agg, Value *Val,
+                                 ArrayRef<unsigned> Idxs,
+                                 const Twine &NameStr,
+                                 BasicBlock *InsertAtEnd) {
+    return new InsertValueInst(Agg, Val, Idxs, NameStr, InsertAtEnd);
+  }
+
+
+  public: inline Value *getOperand(unsigned) const; inline void setOperand(unsigned, Value*); inline op_iterator op_begin(); inline const_op_iterator op_begin() const; inline op_iterator op_end(); inline const_op_iterator op_end() const; protected: template <int> inline Use &Op(); template <int> inline const Use &Op() const; public: inline unsigned getNumOperands() const;
+
+  using idx_iterator = const unsigned*;
+
+  inline idx_iterator idx_begin() const { return Indices.begin(); }
+  inline idx_iterator idx_end() const { return Indices.end(); }
+  inline iterator_range<idx_iterator> indices() const {
+    return make_range(idx_begin(), idx_end());
+  }
+
+  Value *getAggregateOperand() {
+    return getOperand(0);
+  }
+  const Value *getAggregateOperand() const {
+    return getOperand(0);
+  }
+  static unsigned getAggregateOperandIndex() {
+    return 0U;
+  }
+
+  Value *getInsertedValueOperand() {
+    return getOperand(1);
+  }
+  const Value *getInsertedValueOperand() const {
+    return getOperand(1);
+  }
+  static unsigned getInsertedValueOperandIndex() {
+    return 1U;
+  }
+
+  ArrayRef<unsigned> getIndices() const {
+    return Indices;
+  }
+
+  unsigned getNumIndices() const {
+    return (unsigned)Indices.size();
+  }
+
+  bool hasIndices() const {
+    return true;
+  }
+
+
+  static bool classof(const Instruction *I) {
+    return I->getOpcode() == Instruction::InsertValue;
+  }
+  static bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+};
+
+template <>
+struct OperandTraits<InsertValueInst> :
+  public FixedNumOperandTraits<InsertValueInst, 2> {
+};
+
+InsertValueInst::InsertValueInst(Value *Agg,
+                                 Value *Val,
+                                 ArrayRef<unsigned> Idxs,
+                                 const Twine &NameStr,
+                                 Instruction *InsertBefore)
+  : Instruction(Agg->getType(), InsertValue,
+                OperandTraits<InsertValueInst>::op_begin(this),
+                2, InsertBefore) {
+  init(Agg, Val, Idxs, NameStr);
+}
+
+InsertValueInst::InsertValueInst(Value *Agg,
+                                 Value *Val,
+                                 ArrayRef<unsigned> Idxs,
+                                 const Twine &NameStr,
+                                 BasicBlock *InsertAtEnd)
+  : Instruction(Agg->getType(), InsertValue,
+                OperandTraits<InsertValueInst>::op_begin(this),
+                2, InsertAtEnd) {
+  init(Agg, Val, Idxs, NameStr);
+}
+
+InsertValueInst::op_iterator InsertValueInst::op_begin() { return OperandTraits<InsertValueInst>::op_begin(this); } InsertValueInst::const_op_iterator InsertValueInst::op_begin() const { return OperandTraits<InsertValueInst>::op_begin(const_cast<InsertValueInst*>(this)); } InsertValueInst::op_iterator InsertValueInst::op_end() { return OperandTraits<InsertValueInst>::op_end(this); } InsertValueInst::const_op_iterator InsertValueInst::op_end() const { return OperandTraits<InsertValueInst>::op_end(const_cast<InsertValueInst*>(this)); } Value *InsertValueInst::getOperand(unsigned i_nocapture) const { 
+((
+i_nocapture < OperandTraits<InsertValueInst>::operands(this) && "getOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<InsertValueInst>::operands(this) && \"getOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 2570, __PRETTY_FUNCTION__))
+; return cast_or_null<Value>( OperandTraits<InsertValueInst>::op_begin(const_cast<InsertValueInst*>(this))[i_nocapture].get()); } void InsertValueInst::setOperand(unsigned i_nocapture, Value *Val_nocapture) { 
+((
+i_nocapture < OperandTraits<InsertValueInst>::operands(this) && "setOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<InsertValueInst>::operands(this) && \"setOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 2570, __PRETTY_FUNCTION__))
+; OperandTraits<InsertValueInst>::op_begin(this)[i_nocapture] = Val_nocapture; } unsigned InsertValueInst::getNumOperands() const { return OperandTraits<InsertValueInst>::operands(this); } template <int Idx_nocapture> Use &InsertValueInst::Op() { return this->OpFrom<Idx_nocapture>(this); } template <int Idx_nocapture> const Use &InsertValueInst::Op() const { return this->OpFrom<Idx_nocapture>(this); }
+class PHINode : public Instruction {
+
+
+  unsigned ReservedSpace;
+
+  PHINode(const PHINode &PN);
+
+  explicit PHINode(Type *Ty, unsigned NumReservedValues,
+                   const Twine &NameStr = "",
+                   Instruction *InsertBefore = nullptr)
+    : Instruction(Ty, Instruction::PHI, nullptr, 0, InsertBefore),
+      ReservedSpace(NumReservedValues) {
+    setName(NameStr);
+    allocHungoffUses(ReservedSpace);
+  }
+
+  PHINode(Type *Ty, unsigned NumReservedValues, const Twine &NameStr,
+          BasicBlock *InsertAtEnd)
+    : Instruction(Ty, Instruction::PHI, nullptr, 0, InsertAtEnd),
+      ReservedSpace(NumReservedValues) {
+    setName(NameStr);
+    allocHungoffUses(ReservedSpace);
+  }
+
+protected:
+
+  friend class Instruction;
+
+  PHINode *cloneImpl() const;
+
+
+
+
+  void allocHungoffUses(unsigned N) {
+    User::allocHungoffUses(N, true);
+  }
+
+public:
+
+
+  static PHINode *Create(Type *Ty, unsigned NumReservedValues,
+                         const Twine &NameStr = "",
+                         Instruction *InsertBefore = nullptr) {
+    return new PHINode(Ty, NumReservedValues, NameStr, InsertBefore);
+  }
+
+  static PHINode *Create(Type *Ty, unsigned NumReservedValues,
+                         const Twine &NameStr, BasicBlock *InsertAtEnd) {
+    return new PHINode(Ty, NumReservedValues, NameStr, InsertAtEnd);
+  }
+
+
+  public: inline Value *getOperand(unsigned) const; inline void setOperand(unsigned, Value*); inline op_iterator op_begin(); inline const_op_iterator op_begin() const; inline op_iterator op_end(); inline const_op_iterator op_end() const; protected: template <int> inline Use &Op(); template <int> inline const Use &Op() const; public: inline unsigned getNumOperands() const;
+
+
+
+
+  using block_iterator = BasicBlock **;
+  using const_block_iterator = BasicBlock * const *;
+
+  block_iterator block_begin() {
+    Use::UserRef *ref =
+      reinterpret_cast<Use::UserRef*>(op_begin() + ReservedSpace);
+    return reinterpret_cast<block_iterator>(ref + 1);
+  }
+
+  const_block_iterator block_begin() const {
+    const Use::UserRef *ref =
+      reinterpret_cast<const Use::UserRef*>(op_begin() + ReservedSpace);
+    return reinterpret_cast<const_block_iterator>(ref + 1);
+  }
+
+  block_iterator block_end() {
+    return block_begin() + getNumOperands();
+  }
+
+  const_block_iterator block_end() const {
+    return block_begin() + getNumOperands();
+  }
+
+  iterator_range<block_iterator> blocks() {
+    return make_range(block_begin(), block_end());
+  }
+
+  iterator_range<const_block_iterator> blocks() const {
+    return make_range(block_begin(), block_end());
+  }
+
+  op_range incoming_values() { return operands(); }
+
+  const_op_range incoming_values() const { return operands(); }
+
+
+
+  unsigned getNumIncomingValues() const { return getNumOperands(); }
+
+
+
+  Value *getIncomingValue(unsigned i) const {
+    return getOperand(i);
+  }
+  void setIncomingValue(unsigned i, Value *V) {
+    
+   ((
+   V && "PHI node got a null value!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "V && \"PHI node got a null value!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 2682, __PRETTY_FUNCTION__))
+                                            ;
+    
+   ((
+   getType() == V->getType() && "All operands to PHI node must be the same type as the PHI node!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "getType() == V->getType() && \"All operands to PHI node must be the same type as the PHI node!\""
+   ,
+                                                                            "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h"
+    ,
+                                                                            2684
+    , __PRETTY_FUNCTION__))
+                                                                             
+                                                                            ;
+    setOperand(i, V);
+  }
+
+  static unsigned getOperandNumForIncomingValue(unsigned i) {
+    return i;
+  }
+
+  static unsigned getIncomingValueNumForOperand(unsigned i) {
+    return i;
+  }
+
+
+
+  BasicBlock *getIncomingBlock(unsigned i) const {
+    return block_begin()[i];
+  }
+
+
+
+
+  BasicBlock *getIncomingBlock(const Use &U) const {
+    
+   ((
+   this == U.getUser() && "Iterator doesn't point to PHI's Uses?"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "this == U.getUser() && \"Iterator doesn't point to PHI's Uses?\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 2706, __PRETTY_FUNCTION__))
+                                                                         ;
+    return getIncomingBlock(unsigned(&U - op_begin()));
+  }
+
+
+
+
+  BasicBlock *getIncomingBlock(Value::const_user_iterator I) const {
+    return getIncomingBlock(I.getUse());
+  }
+
+  void setIncomingBlock(unsigned i, BasicBlock *BB) {
+    
+   ((
+   BB && "PHI node got a null basic block!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "BB && \"PHI node got a null basic block!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 2718, __PRETTY_FUNCTION__))
+                                                   ;
+    block_begin()[i] = BB;
+  }
+
+
+
+  void addIncoming(Value *V, BasicBlock *BB) {
+    if (getNumOperands() == ReservedSpace)
+      growOperands();
+
+    setNumHungOffUseOperands(getNumOperands() + 1);
+    setIncomingValue(getNumOperands() - 1, V);
+    setIncomingBlock(getNumOperands() - 1, BB);
+  }
+  Value *removeIncomingValue(unsigned Idx, bool DeletePHIIfEmpty = true);
+
+  Value *removeIncomingValue(const BasicBlock *BB, bool DeletePHIIfEmpty=true) {
+    int Idx = getBasicBlockIndex(BB);
+    
+   ((
+   Idx >= 0 && "Invalid basic block argument to remove!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Idx >= 0 && \"Invalid basic block argument to remove!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 2745, __PRETTY_FUNCTION__))
+                                                                ;
+    return removeIncomingValue(Idx, DeletePHIIfEmpty);
+  }
+
+
+
+
+  int getBasicBlockIndex(const BasicBlock *BB) const {
+    for (unsigned i = 0, e = getNumOperands(); i != e; ++i)
+      if (block_begin()[i] == BB)
+        return i;
+    return -1;
+  }
+
+  Value *getIncomingValueForBlock(const BasicBlock *BB) const {
+    int Idx = getBasicBlockIndex(BB);
+    
+   ((
+   Idx >= 0 && "Invalid basic block argument!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Idx >= 0 && \"Invalid basic block argument!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 2761, __PRETTY_FUNCTION__))
+                                                      ;
+    return getIncomingValue(Idx);
+  }
+
+
+
+  Value *hasConstantValue() const;
+
+
+
+
+  bool hasConstantOrUndefValue() const;
+
+
+  static bool classof(const Instruction *I) {
+    return I->getOpcode() == Instruction::PHI;
+  }
+  static bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+
+private:
+  void growOperands();
+};
+
+template <>
+struct OperandTraits<PHINode> : public HungoffOperandTraits<2> {
+};
+
+PHINode::op_iterator PHINode::op_begin() { return OperandTraits<PHINode>::op_begin(this); } PHINode::const_op_iterator PHINode::op_begin() const { return OperandTraits<PHINode>::op_begin(const_cast<PHINode*>(this)); } PHINode::op_iterator PHINode::op_end() { return OperandTraits<PHINode>::op_end(this); } PHINode::const_op_iterator PHINode::op_end() const { return OperandTraits<PHINode>::op_end(const_cast<PHINode*>(this)); } Value *PHINode::getOperand(unsigned i_nocapture) const { 
+((
+i_nocapture < OperandTraits<PHINode>::operands(this) && "getOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<PHINode>::operands(this) && \"getOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 2790, __PRETTY_FUNCTION__))
+; return cast_or_null<Value>( OperandTraits<PHINode>::op_begin(const_cast<PHINode*>(this))[i_nocapture].get()); } void PHINode::setOperand(unsigned i_nocapture, Value *Val_nocapture) { 
+((
+i_nocapture < OperandTraits<PHINode>::operands(this) && "setOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<PHINode>::operands(this) && \"setOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 2790, __PRETTY_FUNCTION__))
+; OperandTraits<PHINode>::op_begin(this)[i_nocapture] = Val_nocapture; } unsigned PHINode::getNumOperands() const { return OperandTraits<PHINode>::operands(this); } template <int Idx_nocapture> Use &PHINode::Op() { return this->OpFrom<Idx_nocapture>(this); } template <int Idx_nocapture> const Use &PHINode::Op() const { return this->OpFrom<Idx_nocapture>(this); }
+class LandingPadInst : public Instruction {
+
+
+  unsigned ReservedSpace;
+
+  LandingPadInst(const LandingPadInst &LP);
+
+public:
+  enum ClauseType { Catch, Filter };
+
+private:
+  explicit LandingPadInst(Type *RetTy, unsigned NumReservedValues,
+                          const Twine &NameStr, Instruction *InsertBefore);
+  explicit LandingPadInst(Type *RetTy, unsigned NumReservedValues,
+                          const Twine &NameStr, BasicBlock *InsertAtEnd);
+
+
+  void *operator new(size_t s) {
+    return User::operator new(s);
+  }
+
+  void growOperands(unsigned Size);
+  void init(unsigned NumReservedValues, const Twine &NameStr);
+
+protected:
+
+  friend class Instruction;
+
+  LandingPadInst *cloneImpl() const;
+
+public:
+
+
+  static LandingPadInst *Create(Type *RetTy, unsigned NumReservedClauses,
+                                const Twine &NameStr = "",
+                                Instruction *InsertBefore = nullptr);
+  static LandingPadInst *Create(Type *RetTy, unsigned NumReservedClauses,
+                                const Twine &NameStr, BasicBlock *InsertAtEnd);
+
+
+  public: inline Value *getOperand(unsigned) const; inline void setOperand(unsigned, Value*); inline op_iterator op_begin(); inline const_op_iterator op_begin() const; inline op_iterator op_end(); inline const_op_iterator op_end() const; protected: template <int> inline Use &Op(); template <int> inline const Use &Op() const; public: inline unsigned getNumOperands() const;
+
+
+
+
+  bool isCleanup() const { return getSubclassDataFromInstruction() & 1; }
+
+
+  void setCleanup(bool V) {
+    setInstructionSubclassData((getSubclassDataFromInstruction() & ~1) |
+                               (V ? 1 : 0));
+  }
+
+
+  void addClause(Constant *ClauseVal);
+
+
+
+  Constant *getClause(unsigned Idx) const {
+    return cast<Constant>(getOperandList()[Idx]);
+  }
+
+
+  bool isCatch(unsigned Idx) const {
+    return !isa<ArrayType>(getOperandList()[Idx]->getType());
+  }
+
+
+  bool isFilter(unsigned Idx) const {
+    return isa<ArrayType>(getOperandList()[Idx]->getType());
+  }
+
+
+  unsigned getNumClauses() const { return getNumOperands(); }
+
+
+
+  void reserveClauses(unsigned Size) { growOperands(Size); }
+
+
+  static bool classof(const Instruction *I) {
+    return I->getOpcode() == Instruction::LandingPad;
+  }
+  static bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+};
+
+template <>
+struct OperandTraits<LandingPadInst> : public HungoffOperandTraits<1> {
+};
+
+LandingPadInst::op_iterator LandingPadInst::op_begin() { return OperandTraits<LandingPadInst>::op_begin(this); } LandingPadInst::const_op_iterator LandingPadInst::op_begin() const { return OperandTraits<LandingPadInst>::op_begin(const_cast<LandingPadInst*>(this)); } LandingPadInst::op_iterator LandingPadInst::op_end() { return OperandTraits<LandingPadInst>::op_end(this); } LandingPadInst::const_op_iterator LandingPadInst::op_end() const { return OperandTraits<LandingPadInst>::op_end(const_cast<LandingPadInst*>(this)); } Value *LandingPadInst::getOperand(unsigned i_nocapture) const { 
+((
+i_nocapture < OperandTraits<LandingPadInst>::operands(this) && "getOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<LandingPadInst>::operands(this) && \"getOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 2896, __PRETTY_FUNCTION__))
+; return cast_or_null<Value>( OperandTraits<LandingPadInst>::op_begin(const_cast<LandingPadInst*>(this))[i_nocapture].get()); } void LandingPadInst::setOperand(unsigned i_nocapture, Value *Val_nocapture) { 
+((
+i_nocapture < OperandTraits<LandingPadInst>::operands(this) && "setOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<LandingPadInst>::operands(this) && \"setOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 2896, __PRETTY_FUNCTION__))
+; OperandTraits<LandingPadInst>::op_begin(this)[i_nocapture] = Val_nocapture; } unsigned LandingPadInst::getNumOperands() const { return OperandTraits<LandingPadInst>::operands(this); } template <int Idx_nocapture> Use &LandingPadInst::Op() { return this->OpFrom<Idx_nocapture>(this); } template <int Idx_nocapture> const Use &LandingPadInst::Op() const { return this->OpFrom<Idx_nocapture>(this); }
+class ReturnInst : public TerminatorInst {
+  ReturnInst(const ReturnInst &RI);
+
+private:
+  explicit ReturnInst(LLVMContext &C, Value *retVal = nullptr,
+                      Instruction *InsertBefore = nullptr);
+  ReturnInst(LLVMContext &C, Value *retVal, BasicBlock *InsertAtEnd);
+  explicit ReturnInst(LLVMContext &C, BasicBlock *InsertAtEnd);
+
+protected:
+
+  friend class Instruction;
+
+  ReturnInst *cloneImpl() const;
+
+public:
+  static ReturnInst* Create(LLVMContext &C, Value *retVal = nullptr,
+                            Instruction *InsertBefore = nullptr) {
+    return new(!!retVal) ReturnInst(C, retVal, InsertBefore);
+  }
+
+  static ReturnInst* Create(LLVMContext &C, Value *retVal,
+                            BasicBlock *InsertAtEnd) {
+    return new(!!retVal) ReturnInst(C, retVal, InsertAtEnd);
+  }
+
+  static ReturnInst* Create(LLVMContext &C, BasicBlock *InsertAtEnd) {
+    return new(0) ReturnInst(C, InsertAtEnd);
+  }
+
+
+  public: inline Value *getOperand(unsigned) const; inline void setOperand(unsigned, Value*); inline op_iterator op_begin(); inline const_op_iterator op_begin() const; inline op_iterator op_end(); inline const_op_iterator op_end() const; protected: template <int> inline Use &Op(); template <int> inline const Use &Op() const; public: inline unsigned getNumOperands() const;
+
+
+  Value *getReturnValue() const {
+    return getNumOperands() != 0 ? getOperand(0) : nullptr;
+  }
+
+  unsigned getNumSuccessors() const { return 0; }
+
+
+  static bool classof(const Instruction *I) {
+    return (I->getOpcode() == Instruction::Ret);
+  }
+  static bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+
+private:
+  friend TerminatorInst;
+
+  BasicBlock *getSuccessor(unsigned idx) const {
+    ::llvm::llvm_unreachable_internal("ReturnInst has no successors!", "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 2969);
+  }
+
+  void setSuccessor(unsigned idx, BasicBlock *B) {
+    ::llvm::llvm_unreachable_internal("ReturnInst has no successors!", "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 2973);
+  }
+};
+
+template <>
+struct OperandTraits<ReturnInst> : public VariadicOperandTraits<ReturnInst> {
+};
+
+ReturnInst::op_iterator ReturnInst::op_begin() { return OperandTraits<ReturnInst>::op_begin(this); } ReturnInst::const_op_iterator ReturnInst::op_begin() const { return OperandTraits<ReturnInst>::op_begin(const_cast<ReturnInst*>(this)); } ReturnInst::op_iterator ReturnInst::op_end() { return OperandTraits<ReturnInst>::op_end(this); } ReturnInst::const_op_iterator ReturnInst::op_end() const { return OperandTraits<ReturnInst>::op_end(const_cast<ReturnInst*>(this)); } Value *ReturnInst::getOperand(unsigned i_nocapture) const { 
+((
+i_nocapture < OperandTraits<ReturnInst>::operands(this) && "getOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<ReturnInst>::operands(this) && \"getOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 2981, __PRETTY_FUNCTION__))
+; return cast_or_null<Value>( OperandTraits<ReturnInst>::op_begin(const_cast<ReturnInst*>(this))[i_nocapture].get()); } void ReturnInst::setOperand(unsigned i_nocapture, Value *Val_nocapture) { 
+((
+i_nocapture < OperandTraits<ReturnInst>::operands(this) && "setOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<ReturnInst>::operands(this) && \"setOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 2981, __PRETTY_FUNCTION__))
+; OperandTraits<ReturnInst>::op_begin(this)[i_nocapture] = Val_nocapture; } unsigned ReturnInst::getNumOperands() const { return OperandTraits<ReturnInst>::operands(this); } template <int Idx_nocapture> Use &ReturnInst::Op() { return this->OpFrom<Idx_nocapture>(this); } template <int Idx_nocapture> const Use &ReturnInst::Op() const { return this->OpFrom<Idx_nocapture>(this); }
+class BranchInst : public TerminatorInst {
+
+
+
+
+  BranchInst(const BranchInst &BI);
+
+
+
+
+
+
+
+  explicit BranchInst(BasicBlock *IfTrue, Instruction *InsertBefore = nullptr);
+  BranchInst(BasicBlock *IfTrue, BasicBlock *IfFalse, Value *Cond,
+             Instruction *InsertBefore = nullptr);
+  BranchInst(BasicBlock *IfTrue, BasicBlock *InsertAtEnd);
+  BranchInst(BasicBlock *IfTrue, BasicBlock *IfFalse, Value *Cond,
+             BasicBlock *InsertAtEnd);
+
+  void AssertOK();
+
+protected:
+
+  friend class Instruction;
+
+  BranchInst *cloneImpl() const;
+
+public:
+  static BranchInst *Create(BasicBlock *IfTrue,
+                            Instruction *InsertBefore = nullptr) {
+    return new(1) BranchInst(IfTrue, InsertBefore);
+  }
+
+  static BranchInst *Create(BasicBlock *IfTrue, BasicBlock *IfFalse,
+                            Value *Cond, Instruction *InsertBefore = nullptr) {
+    return new(3) BranchInst(IfTrue, IfFalse, Cond, InsertBefore);
+  }
+
+  static BranchInst *Create(BasicBlock *IfTrue, BasicBlock *InsertAtEnd) {
+    return new(1) BranchInst(IfTrue, InsertAtEnd);
+  }
+
+  static BranchInst *Create(BasicBlock *IfTrue, BasicBlock *IfFalse,
+                            Value *Cond, BasicBlock *InsertAtEnd) {
+    return new(3) BranchInst(IfTrue, IfFalse, Cond, InsertAtEnd);
+  }
+
+
+  public: inline Value *getOperand(unsigned) const; inline void setOperand(unsigned, Value*); inline op_iterator op_begin(); inline const_op_iterator op_begin() const; inline op_iterator op_end(); inline const_op_iterator op_end() const; protected: template <int> inline Use &Op(); template <int> inline const Use &Op() const; public: inline unsigned getNumOperands() const;
+
+  bool isUnconditional() const { return getNumOperands() == 1; }
+  bool isConditional() const { return getNumOperands() == 3; }
+
+  Value *getCondition() const {
+    
+   ((
+   isConditional() && "Cannot get condition of an uncond branch!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isConditional() && \"Cannot get condition of an uncond branch!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 3045, __PRETTY_FUNCTION__))
+                                                                         ;
+    return Op<-3>();
+  }
+
+  void setCondition(Value *V) {
+    
+   ((
+   isConditional() && "Cannot set condition of unconditional branch!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isConditional() && \"Cannot set condition of unconditional branch!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 3050, __PRETTY_FUNCTION__))
+                                                                             ;
+    Op<-3>() = V;
+  }
+
+  unsigned getNumSuccessors() const { return 1+isConditional(); }
+
+  BasicBlock *getSuccessor(unsigned i) const {
+    
+   ((
+   i < getNumSuccessors() && "Successor # out of range for Branch!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "i < getNumSuccessors() && \"Successor # out of range for Branch!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 3057, __PRETTY_FUNCTION__))
+                                                                           ;
+    return cast_or_null<BasicBlock>((&Op<-1>() - i)->get());
+  }
+
+  void setSuccessor(unsigned idx, BasicBlock *NewSucc) {
+    
+   ((
+   idx < getNumSuccessors() && "Successor # out of range for Branch!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "idx < getNumSuccessors() && \"Successor # out of range for Branch!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 3062, __PRETTY_FUNCTION__))
+                                                                             ;
+    *(&Op<-1>() - idx) = NewSucc;
+  }
+
+
+
+
+
+
+  void swapSuccessors();
+
+
+  static bool classof(const Instruction *I) {
+    return (I->getOpcode() == Instruction::Br);
+  }
+  static bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+};
+
+template <>
+struct OperandTraits<BranchInst> : public VariadicOperandTraits<BranchInst, 1> {
+};
+
+BranchInst::op_iterator BranchInst::op_begin() { return OperandTraits<BranchInst>::op_begin(this); } BranchInst::const_op_iterator BranchInst::op_begin() const { return OperandTraits<BranchInst>::op_begin(const_cast<BranchInst*>(this)); } BranchInst::op_iterator BranchInst::op_end() { return OperandTraits<BranchInst>::op_end(this); } BranchInst::const_op_iterator BranchInst::op_end() const { return OperandTraits<BranchInst>::op_end(const_cast<BranchInst*>(this)); } Value *BranchInst::getOperand(unsigned i_nocapture) const { 
+((
+i_nocapture < OperandTraits<BranchInst>::operands(this) && "getOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<BranchInst>::operands(this) && \"getOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 3086, __PRETTY_FUNCTION__))
+; return cast_or_null<Value>( OperandTraits<BranchInst>::op_begin(const_cast<BranchInst*>(this))[i_nocapture].get()); } void BranchInst::setOperand(unsigned i_nocapture, Value *Val_nocapture) { 
+((
+i_nocapture < OperandTraits<BranchInst>::operands(this) && "setOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<BranchInst>::operands(this) && \"setOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 3086, __PRETTY_FUNCTION__))
+; OperandTraits<BranchInst>::op_begin(this)[i_nocapture] = Val_nocapture; } unsigned BranchInst::getNumOperands() const { return OperandTraits<BranchInst>::operands(this); } template <int Idx_nocapture> Use &BranchInst::Op() { return this->OpFrom<Idx_nocapture>(this); } template <int Idx_nocapture> const Use &BranchInst::Op() const { return this->OpFrom<Idx_nocapture>(this); }
+class SwitchInst : public TerminatorInst {
+  unsigned ReservedSpace;
+
+
+
+
+
+  SwitchInst(const SwitchInst &SI);
+
+
+
+
+
+  SwitchInst(Value *Value, BasicBlock *Default, unsigned NumCases,
+             Instruction *InsertBefore);
+
+
+
+
+
+  SwitchInst(Value *Value, BasicBlock *Default, unsigned NumCases,
+             BasicBlock *InsertAtEnd);
+
+
+  void *operator new(size_t s) {
+    return User::operator new(s);
+  }
+
+  void init(Value *Value, BasicBlock *Default, unsigned NumReserved);
+  void growOperands();
+
+protected:
+
+  friend class Instruction;
+
+  SwitchInst *cloneImpl() const;
+
+public:
+
+  static const unsigned DefaultPseudoIndex = static_cast<unsigned>(~0L-1);
+
+  template <typename CaseHandleT> class CaseIteratorImpl;
+
+
+
+
+
+
+  template <typename SwitchInstT, typename ConstantIntT, typename BasicBlockT>
+  class CaseHandleImpl {
+
+    friend class SwitchInst::CaseIteratorImpl<
+        CaseHandleImpl<SwitchInstT, ConstantIntT, BasicBlockT>>;
+
+  protected:
+
+    using SwitchInstType = SwitchInstT;
+
+    SwitchInstT *SI;
+    ptrdiff_t Index;
+
+    CaseHandleImpl() = default;
+    CaseHandleImpl(SwitchInstT *SI, ptrdiff_t Index) : SI(SI), Index(Index) {}
+
+  public:
+
+    ConstantIntT *getCaseValue() const {
+      
+     ((
+     (unsigned)Index < SI->getNumCases() && "Index out the number of cases."
+     ) ? static_cast<void> (0) : __assert_fail (
+     "(unsigned)Index < SI->getNumCases() && \"Index out the number of cases.\""
+     ,
+                                             "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h"
+      ,
+                                             3163
+      , __PRETTY_FUNCTION__))
+                                              
+                                             ;
+      return reinterpret_cast<ConstantIntT *>(SI->getOperand(2 + Index * 2));
+    }
+
+
+    BasicBlockT *getCaseSuccessor() const {
+      
+     ((
+     ((unsigned)Index < SI->getNumCases() || (unsigned)Index == DefaultPseudoIndex) && "Index out the number of cases."
+     ) ? static_cast<void> (0) : __assert_fail (
+     "((unsigned)Index < SI->getNumCases() || (unsigned)Index == DefaultPseudoIndex) && \"Index out the number of cases.\""
+     ,
+
+                                             "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h"
+      ,
+
+                                             3171
+      , __PRETTY_FUNCTION__))
+
+                                              
+                                             ;
+      return SI->getSuccessor(getSuccessorIndex());
+    }
+
+
+    unsigned getCaseIndex() const { return Index; }
+
+
+    unsigned getSuccessorIndex() const {
+      
+     ((
+     ((unsigned)Index == DefaultPseudoIndex || (unsigned)Index < SI->getNumCases()) && "Index out the number of cases."
+     ) ? static_cast<void> (0) : __assert_fail (
+     "((unsigned)Index == DefaultPseudoIndex || (unsigned)Index < SI->getNumCases()) && \"Index out the number of cases.\""
+     ,
+
+                                             "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h"
+      ,
+
+                                             3182
+      , __PRETTY_FUNCTION__))
+
+                                              
+                                             ;
+      return (unsigned)Index != DefaultPseudoIndex ? Index + 1 : 0;
+    }
+
+    bool operator==(const CaseHandleImpl &RHS) const {
+      
+     ((
+     SI == RHS.SI && "Incompatible operators."
+     ) ? static_cast<void> (0) : __assert_fail (
+     "SI == RHS.SI && \"Incompatible operators.\""
+     , "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 3187, __PRETTY_FUNCTION__))
+                                                      ;
+      return Index == RHS.Index;
+    }
+  };
+
+  using ConstCaseHandle =
+      CaseHandleImpl<const SwitchInst, const ConstantInt, const BasicBlock>;
+
+  class CaseHandle
+      : public CaseHandleImpl<SwitchInst, ConstantInt, BasicBlock> {
+    friend class SwitchInst::CaseIteratorImpl<CaseHandle>;
+
+  public:
+    CaseHandle(SwitchInst *SI, ptrdiff_t Index) : CaseHandleImpl(SI, Index) {}
+
+
+    void setValue(ConstantInt *V) {
+      
+     ((
+     (unsigned)Index < SI->getNumCases() && "Index out the number of cases."
+     ) ? static_cast<void> (0) : __assert_fail (
+     "(unsigned)Index < SI->getNumCases() && \"Index out the number of cases.\""
+     ,
+                                             "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h"
+      ,
+                                             3205
+      , __PRETTY_FUNCTION__))
+                                              
+                                             ;
+      SI->setOperand(2 + Index*2, reinterpret_cast<Value*>(V));
+    }
+
+
+    void setSuccessor(BasicBlock *S) {
+      SI->setSuccessor(getSuccessorIndex(), S);
+    }
+  };
+
+  template <typename CaseHandleT>
+  class CaseIteratorImpl
+      : public iterator_facade_base<CaseIteratorImpl<CaseHandleT>,
+                                    std::random_access_iterator_tag,
+                                    CaseHandleT> {
+    using SwitchInstT = typename CaseHandleT::SwitchInstType;
+
+    CaseHandleT Case;
+
+  public:
+
+
+    CaseIteratorImpl() = default;
+
+
+
+    CaseIteratorImpl(SwitchInstT *SI, unsigned CaseNum) : Case(SI, CaseNum) {}
+
+
+
+    static CaseIteratorImpl fromSuccessorIndex(SwitchInstT *SI,
+                                               unsigned SuccessorIndex) {
+      
+     ((
+     SuccessorIndex < SI->getNumSuccessors() && "Successor index # out of range!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "SuccessorIndex < SI->getNumSuccessors() && \"Successor index # out of range!\""
+     ,
+                                              "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h"
+      ,
+                                              3238
+      , __PRETTY_FUNCTION__))
+                                               
+                                              ;
+      return SuccessorIndex != 0 ? CaseIteratorImpl(SI, SuccessorIndex - 1)
+                                 : CaseIteratorImpl(SI, DefaultPseudoIndex);
+    }
+
+
+
+    operator CaseIteratorImpl<ConstCaseHandle>() const {
+      return CaseIteratorImpl<ConstCaseHandle>(Case.SI, Case.Index);
+    }
+
+    CaseIteratorImpl &operator+=(ptrdiff_t N) {
+
+
+      
+     ((
+     Case.Index + N >= 0 && (unsigned)(Case.Index + N) <= Case.SI->getNumCases() && "Case.Index out the number of cases."
+     ) ? static_cast<void> (0) : __assert_fail (
+     "Case.Index + N >= 0 && (unsigned)(Case.Index + N) <= Case.SI->getNumCases() && \"Case.Index out the number of cases.\""
+     ,
+
+                                                  "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h"
+      ,
+
+                                                  3254
+      , __PRETTY_FUNCTION__))
+
+                                                   
+                                                  ;
+      Case.Index += N;
+      return *this;
+    }
+    CaseIteratorImpl &operator-=(ptrdiff_t N) {
+
+
+      
+     ((
+     Case.Index - N >= 0 && (unsigned)(Case.Index - N) <= Case.SI->getNumCases() && "Case.Index out the number of cases."
+     ) ? static_cast<void> (0) : __assert_fail (
+     "Case.Index - N >= 0 && (unsigned)(Case.Index - N) <= Case.SI->getNumCases() && \"Case.Index out the number of cases.\""
+     ,
+
+                                                  "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h"
+      ,
+
+                                                  3263
+      , __PRETTY_FUNCTION__))
+
+                                                   
+                                                  ;
+      Case.Index -= N;
+      return *this;
+    }
+    ptrdiff_t operator-(const CaseIteratorImpl &RHS) const {
+      
+     ((
+     Case.SI == RHS.Case.SI && "Incompatible operators."
+     ) ? static_cast<void> (0) : __assert_fail (
+     "Case.SI == RHS.Case.SI && \"Incompatible operators.\""
+     , "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 3268, __PRETTY_FUNCTION__))
+                                                                ;
+      return Case.Index - RHS.Case.Index;
+    }
+    bool operator==(const CaseIteratorImpl &RHS) const {
+      return Case == RHS.Case;
+    }
+    bool operator<(const CaseIteratorImpl &RHS) const {
+      
+     ((
+     Case.SI == RHS.Case.SI && "Incompatible operators."
+     ) ? static_cast<void> (0) : __assert_fail (
+     "Case.SI == RHS.Case.SI && \"Incompatible operators.\""
+     , "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 3275, __PRETTY_FUNCTION__))
+                                                                ;
+      return Case.Index < RHS.Case.Index;
+    }
+    CaseHandleT &operator*() { return Case; }
+    const CaseHandleT &operator*() const { return Case; }
+  };
+
+  using CaseIt = CaseIteratorImpl<CaseHandle>;
+  using ConstCaseIt = CaseIteratorImpl<ConstCaseHandle>;
+
+  static SwitchInst *Create(Value *Value, BasicBlock *Default,
+                            unsigned NumCases,
+                            Instruction *InsertBefore = nullptr) {
+    return new SwitchInst(Value, Default, NumCases, InsertBefore);
+  }
+
+  static SwitchInst *Create(Value *Value, BasicBlock *Default,
+                            unsigned NumCases, BasicBlock *InsertAtEnd) {
+    return new SwitchInst(Value, Default, NumCases, InsertAtEnd);
+  }
+
+
+  public: inline Value *getOperand(unsigned) const; inline void setOperand(unsigned, Value*); inline op_iterator op_begin(); inline const_op_iterator op_begin() const; inline op_iterator op_end(); inline const_op_iterator op_end() const; protected: template <int> inline Use &Op(); template <int> inline const Use &Op() const; public: inline unsigned getNumOperands() const;
+
+
+  Value *getCondition() const { return getOperand(0); }
+  void setCondition(Value *V) { setOperand(0, V); }
+
+  BasicBlock *getDefaultDest() const {
+    return cast<BasicBlock>(getOperand(1));
+  }
+
+  void setDefaultDest(BasicBlock *DefaultCase) {
+    setOperand(1, reinterpret_cast<Value*>(DefaultCase));
+  }
+
+
+
+  unsigned getNumCases() const {
+    return getNumOperands()/2 - 1;
+  }
+
+
+
+  CaseIt case_begin() {
+    return CaseIt(this, 0);
+  }
+
+
+
+  ConstCaseIt case_begin() const {
+    return ConstCaseIt(this, 0);
+  }
+
+
+
+  CaseIt case_end() {
+    return CaseIt(this, getNumCases());
+  }
+
+
+
+  ConstCaseIt case_end() const {
+    return ConstCaseIt(this, getNumCases());
+  }
+
+
+  iterator_range<CaseIt> cases() {
+    return make_range(case_begin(), case_end());
+  }
+
+
+  iterator_range<ConstCaseIt> cases() const {
+    return make_range(case_begin(), case_end());
+  }
+
+
+
+
+
+
+  CaseIt case_default() {
+    return CaseIt(this, DefaultPseudoIndex);
+  }
+  ConstCaseIt case_default() const {
+    return ConstCaseIt(this, DefaultPseudoIndex);
+  }
+
+
+
+
+
+  CaseIt findCaseValue(const ConstantInt *C) {
+    CaseIt I = llvm::find_if(
+        cases(), [C](CaseHandle &Case) { return Case.getCaseValue() == C; });
+    if (I != case_end())
+      return I;
+
+    return case_default();
+  }
+  ConstCaseIt findCaseValue(const ConstantInt *C) const {
+    ConstCaseIt I = llvm::find_if(cases(), [C](ConstCaseHandle &Case) {
+      return Case.getCaseValue() == C;
+    });
+    if (I != case_end())
+      return I;
+
+    return case_default();
+  }
+
+
+
+  ConstantInt *findCaseDest(BasicBlock *BB) {
+    if (BB == getDefaultDest())
+      return nullptr;
+
+    ConstantInt *CI = nullptr;
+    for (auto Case : cases()) {
+      if (Case.getCaseSuccessor() != BB)
+        continue;
+
+      if (CI)
+        return nullptr;
+
+      CI = Case.getCaseValue();
+    }
+
+    return CI;
+  }
+
+
+
+
+
+  void addCase(ConstantInt *OnVal, BasicBlock *Dest);
+  CaseIt removeCase(CaseIt I);
+
+  unsigned getNumSuccessors() const { return getNumOperands()/2; }
+  BasicBlock *getSuccessor(unsigned idx) const {
+    
+   ((
+   idx < getNumSuccessors() &&"Successor idx out of range for switch!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "idx < getNumSuccessors() &&\"Successor idx out of range for switch!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 3422, __PRETTY_FUNCTION__))
+                                                                              ;
+    return cast<BasicBlock>(getOperand(idx*2+1));
+  }
+  void setSuccessor(unsigned idx, BasicBlock *NewSucc) {
+    
+   ((
+   idx < getNumSuccessors() && "Successor # out of range for switch!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "idx < getNumSuccessors() && \"Successor # out of range for switch!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 3426, __PRETTY_FUNCTION__))
+                                                                             ;
+    setOperand(idx * 2 + 1, NewSucc);
+  }
+
+
+  static bool classof(const Instruction *I) {
+    return I->getOpcode() == Instruction::Switch;
+  }
+  static bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+};
+
+template <>
+struct OperandTraits<SwitchInst> : public HungoffOperandTraits<2> {
+};
+
+SwitchInst::op_iterator SwitchInst::op_begin() { return OperandTraits<SwitchInst>::op_begin(this); } SwitchInst::const_op_iterator SwitchInst::op_begin() const { return OperandTraits<SwitchInst>::op_begin(const_cast<SwitchInst*>(this)); } SwitchInst::op_iterator SwitchInst::op_end() { return OperandTraits<SwitchInst>::op_end(this); } SwitchInst::const_op_iterator SwitchInst::op_end() const { return OperandTraits<SwitchInst>::op_end(const_cast<SwitchInst*>(this)); } Value *SwitchInst::getOperand(unsigned i_nocapture) const { 
+((
+i_nocapture < OperandTraits<SwitchInst>::operands(this) && "getOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<SwitchInst>::operands(this) && \"getOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 3443, __PRETTY_FUNCTION__))
+; return cast_or_null<Value>( OperandTraits<SwitchInst>::op_begin(const_cast<SwitchInst*>(this))[i_nocapture].get()); } void SwitchInst::setOperand(unsigned i_nocapture, Value *Val_nocapture) { 
+((
+i_nocapture < OperandTraits<SwitchInst>::operands(this) && "setOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<SwitchInst>::operands(this) && \"setOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 3443, __PRETTY_FUNCTION__))
+; OperandTraits<SwitchInst>::op_begin(this)[i_nocapture] = Val_nocapture; } unsigned SwitchInst::getNumOperands() const { return OperandTraits<SwitchInst>::operands(this); } template <int Idx_nocapture> Use &SwitchInst::Op() { return this->OpFrom<Idx_nocapture>(this); } template <int Idx_nocapture> const Use &SwitchInst::Op() const { return this->OpFrom<Idx_nocapture>(this); }
+class IndirectBrInst : public TerminatorInst {
+  unsigned ReservedSpace;
+
+
+
+  IndirectBrInst(const IndirectBrInst &IBI);
+
+
+
+
+
+  IndirectBrInst(Value *Address, unsigned NumDests, Instruction *InsertBefore);
+
+
+
+
+
+  IndirectBrInst(Value *Address, unsigned NumDests, BasicBlock *InsertAtEnd);
+
+
+  void *operator new(size_t s) {
+    return User::operator new(s);
+  }
+
+  void init(Value *Address, unsigned NumDests);
+  void growOperands();
+
+protected:
+
+  friend class Instruction;
+
+  IndirectBrInst *cloneImpl() const;
+
+public:
+  static IndirectBrInst *Create(Value *Address, unsigned NumDests,
+                                Instruction *InsertBefore = nullptr) {
+    return new IndirectBrInst(Address, NumDests, InsertBefore);
+  }
+
+  static IndirectBrInst *Create(Value *Address, unsigned NumDests,
+                                BasicBlock *InsertAtEnd) {
+    return new IndirectBrInst(Address, NumDests, InsertAtEnd);
+  }
+
+
+  public: inline Value *getOperand(unsigned) const; inline void setOperand(unsigned, Value*); inline op_iterator op_begin(); inline const_op_iterator op_begin() const; inline op_iterator op_end(); inline const_op_iterator op_end() const; protected: template <int> inline Use &Op(); template <int> inline const Use &Op() const; public: inline unsigned getNumOperands() const;
+
+
+  Value *getAddress() { return getOperand(0); }
+  const Value *getAddress() const { return getOperand(0); }
+  void setAddress(Value *V) { setOperand(0, V); }
+
+
+
+  unsigned getNumDestinations() const { return getNumOperands()-1; }
+
+
+  BasicBlock *getDestination(unsigned i) { return getSuccessor(i); }
+  const BasicBlock *getDestination(unsigned i) const { return getSuccessor(i); }
+
+
+
+  void addDestination(BasicBlock *Dest);
+
+
+
+  void removeDestination(unsigned i);
+
+  unsigned getNumSuccessors() const { return getNumOperands()-1; }
+  BasicBlock *getSuccessor(unsigned i) const {
+    return cast<BasicBlock>(getOperand(i+1));
+  }
+  void setSuccessor(unsigned i, BasicBlock *NewSucc) {
+    setOperand(i + 1, NewSucc);
+  }
+
+
+  static bool classof(const Instruction *I) {
+    return I->getOpcode() == Instruction::IndirectBr;
+  }
+  static bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+};
+
+template <>
+struct OperandTraits<IndirectBrInst> : public HungoffOperandTraits<1> {
+};
+
+IndirectBrInst::op_iterator IndirectBrInst::op_begin() { return OperandTraits<IndirectBrInst>::op_begin(this); } IndirectBrInst::const_op_iterator IndirectBrInst::op_begin() const { return OperandTraits<IndirectBrInst>::op_begin(const_cast<IndirectBrInst*>(this)); } IndirectBrInst::op_iterator IndirectBrInst::op_end() { return OperandTraits<IndirectBrInst>::op_end(this); } IndirectBrInst::const_op_iterator IndirectBrInst::op_end() const { return OperandTraits<IndirectBrInst>::op_end(const_cast<IndirectBrInst*>(this)); } Value *IndirectBrInst::getOperand(unsigned i_nocapture) const { 
+((
+i_nocapture < OperandTraits<IndirectBrInst>::operands(this) && "getOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<IndirectBrInst>::operands(this) && \"getOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 3541, __PRETTY_FUNCTION__))
+; return cast_or_null<Value>( OperandTraits<IndirectBrInst>::op_begin(const_cast<IndirectBrInst*>(this))[i_nocapture].get()); } void IndirectBrInst::setOperand(unsigned i_nocapture, Value *Val_nocapture) { 
+((
+i_nocapture < OperandTraits<IndirectBrInst>::operands(this) && "setOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<IndirectBrInst>::operands(this) && \"setOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 3541, __PRETTY_FUNCTION__))
+; OperandTraits<IndirectBrInst>::op_begin(this)[i_nocapture] = Val_nocapture; } unsigned IndirectBrInst::getNumOperands() const { return OperandTraits<IndirectBrInst>::operands(this); } template <int Idx_nocapture> Use &IndirectBrInst::Op() { return this->OpFrom<Idx_nocapture>(this); } template <int Idx_nocapture> const Use &IndirectBrInst::Op() const { return this->OpFrom<Idx_nocapture>(this); }
+class InvokeInst : public TerminatorInst,
+                   public OperandBundleUser<InvokeInst, User::op_iterator> {
+  friend class OperandBundleUser<InvokeInst, User::op_iterator>;
+
+  AttributeList Attrs;
+  FunctionType *FTy;
+
+  InvokeInst(const InvokeInst &BI);
+
+
+
+
+  inline InvokeInst(Value *Func, BasicBlock *IfNormal, BasicBlock *IfException,
+                    ArrayRef<Value *> Args, ArrayRef<OperandBundleDef> Bundles,
+                    unsigned Values, const Twine &NameStr,
+                    Instruction *InsertBefore)
+      : InvokeInst(cast<FunctionType>(
+                       cast<PointerType>(Func->getType())->getElementType()),
+                   Func, IfNormal, IfException, Args, Bundles, Values, NameStr,
+                   InsertBefore) {}
+
+  inline InvokeInst(FunctionType *Ty, Value *Func, BasicBlock *IfNormal,
+                    BasicBlock *IfException, ArrayRef<Value *> Args,
+                    ArrayRef<OperandBundleDef> Bundles, unsigned Values,
+                    const Twine &NameStr, Instruction *InsertBefore);
+
+
+
+  inline InvokeInst(Value *Func, BasicBlock *IfNormal, BasicBlock *IfException,
+                    ArrayRef<Value *> Args, ArrayRef<OperandBundleDef> Bundles,
+                    unsigned Values, const Twine &NameStr,
+                    BasicBlock *InsertAtEnd);
+
+  bool hasDescriptor() const { return HasDescriptor; }
+
+  void init(Value *Func, BasicBlock *IfNormal, BasicBlock *IfException,
+            ArrayRef<Value *> Args, ArrayRef<OperandBundleDef> Bundles,
+            const Twine &NameStr) {
+    init(cast<FunctionType>(
+             cast<PointerType>(Func->getType())->getElementType()),
+         Func, IfNormal, IfException, Args, Bundles, NameStr);
+  }
+
+  void init(FunctionType *FTy, Value *Func, BasicBlock *IfNormal,
+            BasicBlock *IfException, ArrayRef<Value *> Args,
+            ArrayRef<OperandBundleDef> Bundles, const Twine &NameStr);
+
+protected:
+
+  friend class Instruction;
+
+  InvokeInst *cloneImpl() const;
+
+public:
+  static InvokeInst *Create(Value *Func, BasicBlock *IfNormal,
+                            BasicBlock *IfException, ArrayRef<Value *> Args,
+                            const Twine &NameStr,
+                            Instruction *InsertBefore = nullptr) {
+    return Create(cast<FunctionType>(
+                      cast<PointerType>(Func->getType())->getElementType()),
+                  Func, IfNormal, IfException, Args, None, NameStr,
+                  InsertBefore);
+  }
+
+  static InvokeInst *Create(Value *Func, BasicBlock *IfNormal,
+                            BasicBlock *IfException, ArrayRef<Value *> Args,
+                            ArrayRef<OperandBundleDef> Bundles = None,
+                            const Twine &NameStr = "",
+                            Instruction *InsertBefore = nullptr) {
+    return Create(cast<FunctionType>(
+                      cast<PointerType>(Func->getType())->getElementType()),
+                  Func, IfNormal, IfException, Args, Bundles, NameStr,
+                  InsertBefore);
+  }
+
+  static InvokeInst *Create(FunctionType *Ty, Value *Func, BasicBlock *IfNormal,
+                            BasicBlock *IfException, ArrayRef<Value *> Args,
+                            const Twine &NameStr,
+                            Instruction *InsertBefore = nullptr) {
+    unsigned Values = unsigned(Args.size()) + 3;
+    return new (Values) InvokeInst(Ty, Func, IfNormal, IfException, Args, None,
+                                   Values, NameStr, InsertBefore);
+  }
+
+  static InvokeInst *Create(FunctionType *Ty, Value *Func, BasicBlock *IfNormal,
+                            BasicBlock *IfException, ArrayRef<Value *> Args,
+                            ArrayRef<OperandBundleDef> Bundles = None,
+                            const Twine &NameStr = "",
+                            Instruction *InsertBefore = nullptr) {
+    unsigned Values = unsigned(Args.size()) + CountBundleInputs(Bundles) + 3;
+    unsigned DescriptorBytes = Bundles.size() * sizeof(BundleOpInfo);
+
+    return new (Values, DescriptorBytes)
+        InvokeInst(Ty, Func, IfNormal, IfException, Args, Bundles, Values,
+                   NameStr, InsertBefore);
+  }
+
+  static InvokeInst *Create(Value *Func,
+                            BasicBlock *IfNormal, BasicBlock *IfException,
+                            ArrayRef<Value *> Args, const Twine &NameStr,
+                            BasicBlock *InsertAtEnd) {
+    unsigned Values = unsigned(Args.size()) + 3;
+    return new (Values) InvokeInst(Func, IfNormal, IfException, Args, None,
+                                   Values, NameStr, InsertAtEnd);
+  }
+
+  static InvokeInst *Create(Value *Func, BasicBlock *IfNormal,
+                            BasicBlock *IfException, ArrayRef<Value *> Args,
+                            ArrayRef<OperandBundleDef> Bundles,
+                            const Twine &NameStr, BasicBlock *InsertAtEnd) {
+    unsigned Values = unsigned(Args.size()) + CountBundleInputs(Bundles) + 3;
+    unsigned DescriptorBytes = Bundles.size() * sizeof(BundleOpInfo);
+
+    return new (Values, DescriptorBytes)
+        InvokeInst(Func, IfNormal, IfException, Args, Bundles, Values, NameStr,
+                   InsertAtEnd);
+  }
+
+
+
+
+
+
+
+  static InvokeInst *Create(InvokeInst *II, ArrayRef<OperandBundleDef> Bundles,
+                            Instruction *InsertPt = nullptr);
+
+
+  public: inline Value *getOperand(unsigned) const; inline void setOperand(unsigned, Value*); inline op_iterator op_begin(); inline const_op_iterator op_begin() const; inline op_iterator op_end(); inline const_op_iterator op_end() const; protected: template <int> inline Use &Op(); template <int> inline const Use &Op() const; public: inline unsigned getNumOperands() const;
+
+  FunctionType *getFunctionType() const { return FTy; }
+
+  void mutateFunctionType(FunctionType *FTy) {
+    mutateType(FTy->getReturnType());
+    this->FTy = FTy;
+  }
+
+
+
+  unsigned getNumArgOperands() const {
+    return getNumOperands() - getNumTotalBundleOperands() - 3;
+  }
+
+
+
+  Value *getArgOperand(unsigned i) const {
+    
+   ((
+   i < getNumArgOperands() && "Out of bounds!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "i < getNumArgOperands() && \"Out of bounds!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 3696, __PRETTY_FUNCTION__))
+                                                      ;
+    return getOperand(i);
+  }
+  void setArgOperand(unsigned i, Value *v) {
+    
+   ((
+   i < getNumArgOperands() && "Out of bounds!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "i < getNumArgOperands() && \"Out of bounds!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 3700, __PRETTY_FUNCTION__))
+                                                      ;
+    setOperand(i, v);
+  }
+
+
+  op_iterator arg_begin() { return op_begin(); }
+
+
+  op_iterator arg_end() {
+
+    return op_end() - getNumTotalBundleOperands() - 3;
+  }
+
+
+  iterator_range<op_iterator> arg_operands() {
+    return make_range(arg_begin(), arg_end());
+  }
+
+
+  const_op_iterator arg_begin() const { return op_begin(); }
+
+
+  const_op_iterator arg_end() const {
+
+    return op_end() - getNumTotalBundleOperands() - 3;
+  }
+
+
+  iterator_range<const_op_iterator> arg_operands() const {
+    return make_range(arg_begin(), arg_end());
+  }
+
+
+  const Use &getArgOperandUse(unsigned i) const {
+    
+   ((
+   i < getNumArgOperands() && "Out of bounds!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "i < getNumArgOperands() && \"Out of bounds!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 3734, __PRETTY_FUNCTION__))
+                                                      ;
+    return getOperandUse(i);
+  }
+  Use &getArgOperandUse(unsigned i) {
+    
+   ((
+   i < getNumArgOperands() && "Out of bounds!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "i < getNumArgOperands() && \"Out of bounds!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 3738, __PRETTY_FUNCTION__))
+                                                      ;
+    return getOperandUse(i);
+  }
+
+
+
+  Value *getReturnedArgOperand() const;
+
+
+
+  CallingConv::ID getCallingConv() const {
+    return static_cast<CallingConv::ID>(getSubclassDataFromInstruction());
+  }
+  void setCallingConv(CallingConv::ID CC) {
+    auto ID = static_cast<unsigned>(CC);
+    
+   ((
+   !(ID & ~CallingConv::MaxID) && "Unsupported calling convention"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!(ID & ~CallingConv::MaxID) && \"Unsupported calling convention\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 3753, __PRETTY_FUNCTION__))
+                                                                          ;
+    setInstructionSubclassData(ID);
+  }
+
+
+
+  AttributeList getAttributes() const { return Attrs; }
+
+
+
+  void setAttributes(AttributeList A) { Attrs = A; }
+
+
+  void addAttribute(unsigned i, Attribute::AttrKind Kind);
+
+
+  void addAttribute(unsigned i, Attribute Attr);
+
+
+  void addParamAttr(unsigned ArgNo, Attribute::AttrKind Kind);
+
+
+  void removeAttribute(unsigned i, Attribute::AttrKind Kind);
+
+
+  void removeAttribute(unsigned i, StringRef Kind);
+
+
+  void removeParamAttr(unsigned ArgNo, Attribute::AttrKind Kind);
+
+
+  void addDereferenceableAttr(unsigned i, uint64_t Bytes);
+
+
+
+  void addDereferenceableOrNullAttr(unsigned i, uint64_t Bytes);
+
+
+  bool hasFnAttr(Attribute::AttrKind Kind) const {
+    
+   ((
+   Kind != Attribute::NoBuiltin && "Use CallInst::isNoBuiltin() to check for Attribute::NoBuiltin"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Kind != Attribute::NoBuiltin && \"Use CallInst::isNoBuiltin() to check for Attribute::NoBuiltin\""
+   ,
+                                                                          "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h"
+    ,
+                                                                          3793
+    , __PRETTY_FUNCTION__))
+                                                                           
+                                                                          ;
+    return hasFnAttrImpl(Kind);
+  }
+
+
+  bool hasFnAttr(StringRef Kind) const {
+    return hasFnAttrImpl(Kind);
+  }
+
+
+  bool hasRetAttr(Attribute::AttrKind Kind) const;
+
+
+  bool paramHasAttr(unsigned ArgNo, Attribute::AttrKind Kind) const;
+
+
+  Attribute getAttribute(unsigned i, Attribute::AttrKind Kind) const {
+    return getAttributes().getAttribute(i, Kind);
+  }
+
+
+  Attribute getAttribute(unsigned i, StringRef Kind) const {
+    return getAttributes().getAttribute(i, Kind);
+  }
+  bool dataOperandHasImpliedAttr(unsigned i, Attribute::AttrKind Kind) const;
+
+
+  unsigned getRetAlignment() const { return Attrs.getRetAlignment(); }
+
+
+  unsigned getParamAlignment(unsigned ArgNo) const {
+    return Attrs.getParamAlignment(ArgNo);
+  }
+
+
+
+  uint64_t getDereferenceableBytes(unsigned i) const {
+    return Attrs.getDereferenceableBytes(i);
+  }
+
+
+
+  uint64_t getDereferenceableOrNullBytes(unsigned i) const {
+    return Attrs.getDereferenceableOrNullBytes(i);
+  }
+
+
+  bool returnDoesNotAlias() const {
+    return Attrs.hasAttribute(AttributeList::ReturnIndex, Attribute::NoAlias);
+  }
+
+
+
+  bool isNoBuiltin() const {
+
+
+    return hasFnAttrImpl(Attribute::NoBuiltin) &&
+      !hasFnAttrImpl(Attribute::Builtin);
+  }
+
+
+  bool isStrictFP() const { return hasFnAttr(Attribute::StrictFP); }
+
+
+  bool isNoInline() const { return hasFnAttr(Attribute::NoInline); }
+  void setIsNoInline() {
+    addAttribute(AttributeList::FunctionIndex, Attribute::NoInline);
+  }
+
+
+  bool doesNotAccessMemory() const {
+    return hasFnAttr(Attribute::ReadNone);
+  }
+  void setDoesNotAccessMemory() {
+    addAttribute(AttributeList::FunctionIndex, Attribute::ReadNone);
+  }
+
+
+  bool onlyReadsMemory() const {
+    return doesNotAccessMemory() || hasFnAttr(Attribute::ReadOnly);
+  }
+  void setOnlyReadsMemory() {
+    addAttribute(AttributeList::FunctionIndex, Attribute::ReadOnly);
+  }
+
+
+  bool doesNotReadMemory() const {
+    return doesNotAccessMemory() || hasFnAttr(Attribute::WriteOnly);
+  }
+  void setDoesNotReadMemory() {
+    addAttribute(AttributeList::FunctionIndex, Attribute::WriteOnly);
+  }
+
+
+
+  bool onlyAccessesArgMemory() const {
+    return hasFnAttr(Attribute::ArgMemOnly);
+  }
+  void setOnlyAccessesArgMemory() {
+    addAttribute(AttributeList::FunctionIndex, Attribute::ArgMemOnly);
+  }
+
+
+
+  bool onlyAccessesInaccessibleMemory() const {
+    return hasFnAttr(Attribute::InaccessibleMemOnly);
+  }
+  void setOnlyAccessesInaccessibleMemory() {
+    addAttribute(AttributeList::FunctionIndex, Attribute::InaccessibleMemOnly);
+  }
+
+
+
+  bool onlyAccessesInaccessibleMemOrArgMem() const {
+    return hasFnAttr(Attribute::InaccessibleMemOrArgMemOnly);
+  }
+  void setOnlyAccessesInaccessibleMemOrArgMem() {
+    addAttribute(AttributeList::FunctionIndex, Attribute::InaccessibleMemOrArgMemOnly);
+  }
+
+
+  bool doesNotReturn() const { return hasFnAttr(Attribute::NoReturn); }
+  void setDoesNotReturn() {
+    addAttribute(AttributeList::FunctionIndex, Attribute::NoReturn);
+  }
+
+
+  bool doesNotThrow() const { return hasFnAttr(Attribute::NoUnwind); }
+  void setDoesNotThrow() {
+    addAttribute(AttributeList::FunctionIndex, Attribute::NoUnwind);
+  }
+
+
+  bool cannotDuplicate() const {return hasFnAttr(Attribute::NoDuplicate); }
+  void setCannotDuplicate() {
+    addAttribute(AttributeList::FunctionIndex, Attribute::NoDuplicate);
+  }
+
+
+  bool isConvergent() const { return hasFnAttr(Attribute::Convergent); }
+  void setConvergent() {
+    addAttribute(AttributeList::FunctionIndex, Attribute::Convergent);
+  }
+  void setNotConvergent() {
+    removeAttribute(AttributeList::FunctionIndex, Attribute::Convergent);
+  }
+
+
+
+  bool hasStructRetAttr() const {
+    if (getNumArgOperands() == 0)
+      return false;
+
+
+    return paramHasAttr(0, Attribute::StructRet);
+  }
+
+
+  bool hasByValArgument() const {
+    return Attrs.hasAttrSomewhere(Attribute::ByVal);
+  }
+
+
+
+
+  Function *getCalledFunction() const {
+    return dyn_cast<Function>(Op<-3>());
+  }
+
+
+
+  const Value *getCalledValue() const { return Op<-3>(); }
+        Value *getCalledValue() { return Op<-3>(); }
+
+
+  void setCalledFunction(Value* Fn) {
+    setCalledFunction(
+        cast<FunctionType>(cast<PointerType>(Fn->getType())->getElementType()),
+        Fn);
+  }
+  void setCalledFunction(FunctionType *FTy, Value *Fn) {
+    this->FTy = FTy;
+    
+   ((
+   FTy == cast<FunctionType>( cast<PointerType>(Fn->getType())->getElementType())
+   ) ? static_cast<void> (0) : __assert_fail (
+   "FTy == cast<FunctionType>( cast<PointerType>(Fn->getType())->getElementType())"
+   ,
+                                                                         "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h"
+    ,
+                                                                         3991
+    , __PRETTY_FUNCTION__))
+                                                                          
+                                                                         ;
+    Op<-3>() = Fn;
+  }
+
+
+  BasicBlock *getNormalDest() const {
+    return cast<BasicBlock>(Op<-2>());
+  }
+  BasicBlock *getUnwindDest() const {
+    return cast<BasicBlock>(Op<-1>());
+  }
+  void setNormalDest(BasicBlock *B) {
+    Op<-2>() = reinterpret_cast<Value*>(B);
+  }
+  void setUnwindDest(BasicBlock *B) {
+    Op<-1>() = reinterpret_cast<Value*>(B);
+  }
+
+
+
+  LandingPadInst *getLandingPadInst() const;
+
+  BasicBlock *getSuccessor(unsigned i) const {
+    
+   ((
+   i < 2 && "Successor # out of range for invoke!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "i < 2 && \"Successor # out of range for invoke!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 4014, __PRETTY_FUNCTION__))
+                                                          ;
+    return i == 0 ? getNormalDest() : getUnwindDest();
+  }
+
+  void setSuccessor(unsigned idx, BasicBlock *NewSucc) {
+    
+   ((
+   idx < 2 && "Successor # out of range for invoke!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "idx < 2 && \"Successor # out of range for invoke!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 4019, __PRETTY_FUNCTION__))
+                                                            ;
+    *(&Op<-2>() + idx) = reinterpret_cast<Value*>(NewSucc);
+  }
+
+  unsigned getNumSuccessors() const { return 2; }
+
+
+  static bool classof(const Instruction *I) {
+    return (I->getOpcode() == Instruction::Invoke);
+  }
+  static bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+
+private:
+  template <typename AttrKind> bool hasFnAttrImpl(AttrKind Kind) const {
+    if (Attrs.hasAttribute(AttributeList::FunctionIndex, Kind))
+      return true;
+
+
+
+    if (isFnAttrDisallowedByOpBundle(Kind))
+      return false;
+
+    if (const Function *F = getCalledFunction())
+      return F->getAttributes().hasAttribute(AttributeList::FunctionIndex,
+                                             Kind);
+    return false;
+  }
+
+
+
+  void setInstructionSubclassData(unsigned short D) {
+    Instruction::setInstructionSubclassData(D);
+  }
+};
+
+template <>
+struct OperandTraits<InvokeInst> : public VariadicOperandTraits<InvokeInst, 3> {
+};
+
+InvokeInst::InvokeInst(FunctionType *Ty, Value *Func, BasicBlock *IfNormal,
+                       BasicBlock *IfException, ArrayRef<Value *> Args,
+                       ArrayRef<OperandBundleDef> Bundles, unsigned Values,
+                       const Twine &NameStr, Instruction *InsertBefore)
+    : TerminatorInst(Ty->getReturnType(), Instruction::Invoke,
+                     OperandTraits<InvokeInst>::op_end(this) - Values, Values,
+                     InsertBefore) {
+  init(Ty, Func, IfNormal, IfException, Args, Bundles, NameStr);
+}
+
+InvokeInst::InvokeInst(Value *Func, BasicBlock *IfNormal,
+                       BasicBlock *IfException, ArrayRef<Value *> Args,
+                       ArrayRef<OperandBundleDef> Bundles, unsigned Values,
+                       const Twine &NameStr, BasicBlock *InsertAtEnd)
+    : TerminatorInst(
+          cast<FunctionType>(cast<PointerType>(Func->getType())
+                                 ->getElementType())->getReturnType(),
+          Instruction::Invoke, OperandTraits<InvokeInst>::op_end(this) - Values,
+          Values, InsertAtEnd) {
+  init(Func, IfNormal, IfException, Args, Bundles, NameStr);
+}
+
+InvokeInst::op_iterator InvokeInst::op_begin() { return OperandTraits<InvokeInst>::op_begin(this); } InvokeInst::const_op_iterator InvokeInst::op_begin() const { return OperandTraits<InvokeInst>::op_begin(const_cast<InvokeInst*>(this)); } InvokeInst::op_iterator InvokeInst::op_end() { return OperandTraits<InvokeInst>::op_end(this); } InvokeInst::const_op_iterator InvokeInst::op_end() const { return OperandTraits<InvokeInst>::op_end(const_cast<InvokeInst*>(this)); } Value *InvokeInst::getOperand(unsigned i_nocapture) const { 
+((
+i_nocapture < OperandTraits<InvokeInst>::operands(this) && "getOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<InvokeInst>::operands(this) && \"getOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 4082, __PRETTY_FUNCTION__))
+; return cast_or_null<Value>( OperandTraits<InvokeInst>::op_begin(const_cast<InvokeInst*>(this))[i_nocapture].get()); } void InvokeInst::setOperand(unsigned i_nocapture, Value *Val_nocapture) { 
+((
+i_nocapture < OperandTraits<InvokeInst>::operands(this) && "setOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<InvokeInst>::operands(this) && \"setOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 4082, __PRETTY_FUNCTION__))
+; OperandTraits<InvokeInst>::op_begin(this)[i_nocapture] = Val_nocapture; } unsigned InvokeInst::getNumOperands() const { return OperandTraits<InvokeInst>::operands(this); } template <int Idx_nocapture> Use &InvokeInst::Op() { return this->OpFrom<Idx_nocapture>(this); } template <int Idx_nocapture> const Use &InvokeInst::Op() const { return this->OpFrom<Idx_nocapture>(this); }
+class ResumeInst : public TerminatorInst {
+  ResumeInst(const ResumeInst &RI);
+
+  explicit ResumeInst(Value *Exn, Instruction *InsertBefore=nullptr);
+  ResumeInst(Value *Exn, BasicBlock *InsertAtEnd);
+
+protected:
+
+  friend class Instruction;
+
+  ResumeInst *cloneImpl() const;
+
+public:
+  static ResumeInst *Create(Value *Exn, Instruction *InsertBefore = nullptr) {
+    return new(1) ResumeInst(Exn, InsertBefore);
+  }
+
+  static ResumeInst *Create(Value *Exn, BasicBlock *InsertAtEnd) {
+    return new(1) ResumeInst(Exn, InsertAtEnd);
+  }
+
+
+  public: inline Value *getOperand(unsigned) const; inline void setOperand(unsigned, Value*); inline op_iterator op_begin(); inline const_op_iterator op_begin() const; inline op_iterator op_end(); inline const_op_iterator op_end() const; protected: template <int> inline Use &Op(); template <int> inline const Use &Op() const; public: inline unsigned getNumOperands() const;
+
+
+  Value *getValue() const { return Op<0>(); }
+
+  unsigned getNumSuccessors() const { return 0; }
+
+
+  static bool classof(const Instruction *I) {
+    return I->getOpcode() == Instruction::Resume;
+  }
+  static bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+
+private:
+  friend TerminatorInst;
+
+  BasicBlock *getSuccessor(unsigned idx) const {
+    ::llvm::llvm_unreachable_internal("ResumeInst has no successors!", "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 4132);
+  }
+
+  void setSuccessor(unsigned idx, BasicBlock *NewSucc) {
+    ::llvm::llvm_unreachable_internal("ResumeInst has no successors!", "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 4136);
+  }
+};
+
+template <>
+struct OperandTraits<ResumeInst> :
+    public FixedNumOperandTraits<ResumeInst, 1> {
+};
+
+ResumeInst::op_iterator ResumeInst::op_begin() { return OperandTraits<ResumeInst>::op_begin(this); } ResumeInst::const_op_iterator ResumeInst::op_begin() const { return OperandTraits<ResumeInst>::op_begin(const_cast<ResumeInst*>(this)); } ResumeInst::op_iterator ResumeInst::op_end() { return OperandTraits<ResumeInst>::op_end(this); } ResumeInst::const_op_iterator ResumeInst::op_end() const { return OperandTraits<ResumeInst>::op_end(const_cast<ResumeInst*>(this)); } Value *ResumeInst::getOperand(unsigned i_nocapture) const { 
+((
+i_nocapture < OperandTraits<ResumeInst>::operands(this) && "getOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<ResumeInst>::operands(this) && \"getOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 4145, __PRETTY_FUNCTION__))
+; return cast_or_null<Value>( OperandTraits<ResumeInst>::op_begin(const_cast<ResumeInst*>(this))[i_nocapture].get()); } void ResumeInst::setOperand(unsigned i_nocapture, Value *Val_nocapture) { 
+((
+i_nocapture < OperandTraits<ResumeInst>::operands(this) && "setOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<ResumeInst>::operands(this) && \"setOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 4145, __PRETTY_FUNCTION__))
+; OperandTraits<ResumeInst>::op_begin(this)[i_nocapture] = Val_nocapture; } unsigned ResumeInst::getNumOperands() const { return OperandTraits<ResumeInst>::operands(this); } template <int Idx_nocapture> Use &ResumeInst::Op() { return this->OpFrom<Idx_nocapture>(this); } template <int Idx_nocapture> const Use &ResumeInst::Op() const { return this->OpFrom<Idx_nocapture>(this); }
+
+
+
+
+class CatchSwitchInst : public TerminatorInst {
+
+
+  unsigned ReservedSpace;
+
+
+
+
+  CatchSwitchInst(const CatchSwitchInst &CSI);
+
+
+
+
+
+  CatchSwitchInst(Value *ParentPad, BasicBlock *UnwindDest,
+                  unsigned NumHandlers, const Twine &NameStr,
+                  Instruction *InsertBefore);
+
+
+
+
+
+  CatchSwitchInst(Value *ParentPad, BasicBlock *UnwindDest,
+                  unsigned NumHandlers, const Twine &NameStr,
+                  BasicBlock *InsertAtEnd);
+
+
+  void *operator new(size_t s) { return User::operator new(s); }
+
+  void init(Value *ParentPad, BasicBlock *UnwindDest, unsigned NumReserved);
+  void growOperands(unsigned Size);
+
+protected:
+
+  friend class Instruction;
+
+  CatchSwitchInst *cloneImpl() const;
+
+public:
+  static CatchSwitchInst *Create(Value *ParentPad, BasicBlock *UnwindDest,
+                                 unsigned NumHandlers,
+                                 const Twine &NameStr = "",
+                                 Instruction *InsertBefore = nullptr) {
+    return new CatchSwitchInst(ParentPad, UnwindDest, NumHandlers, NameStr,
+                               InsertBefore);
+  }
+
+  static CatchSwitchInst *Create(Value *ParentPad, BasicBlock *UnwindDest,
+                                 unsigned NumHandlers, const Twine &NameStr,
+                                 BasicBlock *InsertAtEnd) {
+    return new CatchSwitchInst(ParentPad, UnwindDest, NumHandlers, NameStr,
+                               InsertAtEnd);
+  }
+
+
+  public: inline Value *getOperand(unsigned) const; inline void setOperand(unsigned, Value*); inline op_iterator op_begin(); inline const_op_iterator op_begin() const; inline op_iterator op_end(); inline const_op_iterator op_end() const; protected: template <int> inline Use &Op(); template <int> inline const Use &Op() const; public: inline unsigned getNumOperands() const;
+
+
+  Value *getParentPad() const { return getOperand(0); }
+  void setParentPad(Value *ParentPad) { setOperand(0, ParentPad); }
+
+
+  bool hasUnwindDest() const { return getSubclassDataFromInstruction() & 1; }
+  bool unwindsToCaller() const { return !hasUnwindDest(); }
+  BasicBlock *getUnwindDest() const {
+    if (hasUnwindDest())
+      return cast<BasicBlock>(getOperand(1));
+    return nullptr;
+  }
+  void setUnwindDest(BasicBlock *UnwindDest) {
+    
+   ((
+   UnwindDest
+   ) ? static_cast<void> (0) : __assert_fail (
+   "UnwindDest"
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 4220, __PRETTY_FUNCTION__))
+                     ;
+    
+   ((
+   hasUnwindDest()
+   ) ? static_cast<void> (0) : __assert_fail (
+   "hasUnwindDest()"
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 4221, __PRETTY_FUNCTION__))
+                          ;
+    setOperand(1, UnwindDest);
+  }
+
+
+
+  unsigned getNumHandlers() const {
+    if (hasUnwindDest())
+      return getNumOperands() - 2;
+    return getNumOperands() - 1;
+  }
+
+private:
+  static BasicBlock *handler_helper(Value *V) { return cast<BasicBlock>(V); }
+  static const BasicBlock *handler_helper(const Value *V) {
+    return cast<BasicBlock>(V);
+  }
+
+public:
+  using DerefFnTy = BasicBlock *(*)(Value *);
+  using handler_iterator = mapped_iterator<op_iterator, DerefFnTy>;
+  using handler_range = iterator_range<handler_iterator>;
+  using ConstDerefFnTy = const BasicBlock *(*)(const Value *);
+  using const_handler_iterator =
+      mapped_iterator<const_op_iterator, ConstDerefFnTy>;
+  using const_handler_range = iterator_range<const_handler_iterator>;
+
+
+  handler_iterator handler_begin() {
+    op_iterator It = op_begin() + 1;
+    if (hasUnwindDest())
+      ++It;
+    return handler_iterator(It, DerefFnTy(handler_helper));
+  }
+
+
+
+  const_handler_iterator handler_begin() const {
+    const_op_iterator It = op_begin() + 1;
+    if (hasUnwindDest())
+      ++It;
+    return const_handler_iterator(It, ConstDerefFnTy(handler_helper));
+  }
+
+
+
+  handler_iterator handler_end() {
+    return handler_iterator(op_end(), DerefFnTy(handler_helper));
+  }
+
+
+
+  const_handler_iterator handler_end() const {
+    return const_handler_iterator(op_end(), ConstDerefFnTy(handler_helper));
+  }
+
+
+  handler_range handlers() {
+    return make_range(handler_begin(), handler_end());
+  }
+
+
+  const_handler_range handlers() const {
+    return make_range(handler_begin(), handler_end());
+  }
+
+
+
+
+
+  void addHandler(BasicBlock *Dest);
+
+  void removeHandler(handler_iterator HI);
+
+  unsigned getNumSuccessors() const { return getNumOperands() - 1; }
+  BasicBlock *getSuccessor(unsigned Idx) const {
+    
+   ((
+   Idx < getNumSuccessors() && "Successor # out of range for catchswitch!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Idx < getNumSuccessors() && \"Successor # out of range for catchswitch!\""
+   ,
+                                                      "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h"
+    ,
+                                                      4298
+    , __PRETTY_FUNCTION__))
+                                                       
+                                                      ;
+    return cast<BasicBlock>(getOperand(Idx + 1));
+  }
+  void setSuccessor(unsigned Idx, BasicBlock *NewSucc) {
+    
+   ((
+   Idx < getNumSuccessors() && "Successor # out of range for catchswitch!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Idx < getNumSuccessors() && \"Successor # out of range for catchswitch!\""
+   ,
+                                                      "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h"
+    ,
+                                                      4303
+    , __PRETTY_FUNCTION__))
+                                                       
+                                                      ;
+    setOperand(Idx + 1, NewSucc);
+  }
+
+
+  static bool classof(const Instruction *I) {
+    return I->getOpcode() == Instruction::CatchSwitch;
+  }
+  static bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+};
+
+template <>
+struct OperandTraits<CatchSwitchInst> : public HungoffOperandTraits<2> {};
+
+CatchSwitchInst::op_iterator CatchSwitchInst::op_begin() { return OperandTraits<CatchSwitchInst>::op_begin(this); } CatchSwitchInst::const_op_iterator CatchSwitchInst::op_begin() const { return OperandTraits<CatchSwitchInst>::op_begin(const_cast<CatchSwitchInst*>(this)); } CatchSwitchInst::op_iterator CatchSwitchInst::op_end() { return OperandTraits<CatchSwitchInst>::op_end(this); } CatchSwitchInst::const_op_iterator CatchSwitchInst::op_end() const { return OperandTraits<CatchSwitchInst>::op_end(const_cast<CatchSwitchInst*>(this)); } Value *CatchSwitchInst::getOperand(unsigned i_nocapture) const { 
+((
+i_nocapture < OperandTraits<CatchSwitchInst>::operands(this) && "getOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<CatchSwitchInst>::operands(this) && \"getOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 4319, __PRETTY_FUNCTION__))
+; return cast_or_null<Value>( OperandTraits<CatchSwitchInst>::op_begin(const_cast<CatchSwitchInst*>(this))[i_nocapture].get()); } void CatchSwitchInst::setOperand(unsigned i_nocapture, Value *Val_nocapture) { 
+((
+i_nocapture < OperandTraits<CatchSwitchInst>::operands(this) && "setOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<CatchSwitchInst>::operands(this) && \"setOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 4319, __PRETTY_FUNCTION__))
+; OperandTraits<CatchSwitchInst>::op_begin(this)[i_nocapture] = Val_nocapture; } unsigned CatchSwitchInst::getNumOperands() const { return OperandTraits<CatchSwitchInst>::operands(this); } template <int Idx_nocapture> Use &CatchSwitchInst::Op() { return this->OpFrom<Idx_nocapture>(this); } template <int Idx_nocapture> const Use &CatchSwitchInst::Op() const { return this->OpFrom<Idx_nocapture>(this); }
+
+
+
+
+class CleanupPadInst : public FuncletPadInst {
+private:
+  explicit CleanupPadInst(Value *ParentPad, ArrayRef<Value *> Args,
+                          unsigned Values, const Twine &NameStr,
+                          Instruction *InsertBefore)
+      : FuncletPadInst(Instruction::CleanupPad, ParentPad, Args, Values,
+                       NameStr, InsertBefore) {}
+  explicit CleanupPadInst(Value *ParentPad, ArrayRef<Value *> Args,
+                          unsigned Values, const Twine &NameStr,
+                          BasicBlock *InsertAtEnd)
+      : FuncletPadInst(Instruction::CleanupPad, ParentPad, Args, Values,
+                       NameStr, InsertAtEnd) {}
+
+public:
+  static CleanupPadInst *Create(Value *ParentPad, ArrayRef<Value *> Args = None,
+                                const Twine &NameStr = "",
+                                Instruction *InsertBefore = nullptr) {
+    unsigned Values = 1 + Args.size();
+    return new (Values)
+        CleanupPadInst(ParentPad, Args, Values, NameStr, InsertBefore);
+  }
+
+  static CleanupPadInst *Create(Value *ParentPad, ArrayRef<Value *> Args,
+                                const Twine &NameStr, BasicBlock *InsertAtEnd) {
+    unsigned Values = 1 + Args.size();
+    return new (Values)
+        CleanupPadInst(ParentPad, Args, Values, NameStr, InsertAtEnd);
+  }
+
+
+  static bool classof(const Instruction *I) {
+    return I->getOpcode() == Instruction::CleanupPad;
+  }
+  static bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+};
+
+
+
+
+class CatchPadInst : public FuncletPadInst {
+private:
+  explicit CatchPadInst(Value *CatchSwitch, ArrayRef<Value *> Args,
+                        unsigned Values, const Twine &NameStr,
+                        Instruction *InsertBefore)
+      : FuncletPadInst(Instruction::CatchPad, CatchSwitch, Args, Values,
+                       NameStr, InsertBefore) {}
+  explicit CatchPadInst(Value *CatchSwitch, ArrayRef<Value *> Args,
+                        unsigned Values, const Twine &NameStr,
+                        BasicBlock *InsertAtEnd)
+      : FuncletPadInst(Instruction::CatchPad, CatchSwitch, Args, Values,
+                       NameStr, InsertAtEnd) {}
+
+public:
+  static CatchPadInst *Create(Value *CatchSwitch, ArrayRef<Value *> Args,
+                              const Twine &NameStr = "",
+                              Instruction *InsertBefore = nullptr) {
+    unsigned Values = 1 + Args.size();
+    return new (Values)
+        CatchPadInst(CatchSwitch, Args, Values, NameStr, InsertBefore);
+  }
+
+  static CatchPadInst *Create(Value *CatchSwitch, ArrayRef<Value *> Args,
+                              const Twine &NameStr, BasicBlock *InsertAtEnd) {
+    unsigned Values = 1 + Args.size();
+    return new (Values)
+        CatchPadInst(CatchSwitch, Args, Values, NameStr, InsertAtEnd);
+  }
+
+
+  CatchSwitchInst *getCatchSwitch() const {
+    return cast<CatchSwitchInst>(Op<-1>());
+  }
+  void setCatchSwitch(Value *CatchSwitch) {
+    
+   ((
+   CatchSwitch
+   ) ? static_cast<void> (0) : __assert_fail (
+   "CatchSwitch"
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 4399, __PRETTY_FUNCTION__))
+                      ;
+    Op<-1>() = CatchSwitch;
+  }
+
+
+  static bool classof(const Instruction *I) {
+    return I->getOpcode() == Instruction::CatchPad;
+  }
+  static bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+};
+
+
+
+
+
+class CatchReturnInst : public TerminatorInst {
+  CatchReturnInst(const CatchReturnInst &RI);
+  CatchReturnInst(Value *CatchPad, BasicBlock *BB, Instruction *InsertBefore);
+  CatchReturnInst(Value *CatchPad, BasicBlock *BB, BasicBlock *InsertAtEnd);
+
+  void init(Value *CatchPad, BasicBlock *BB);
+
+protected:
+
+  friend class Instruction;
+
+  CatchReturnInst *cloneImpl() const;
+
+public:
+  static CatchReturnInst *Create(Value *CatchPad, BasicBlock *BB,
+                                 Instruction *InsertBefore = nullptr) {
+    
+   ((
+   CatchPad
+   ) ? static_cast<void> (0) : __assert_fail (
+   "CatchPad"
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 4432, __PRETTY_FUNCTION__))
+                   ;
+    
+   ((
+   BB
+   ) ? static_cast<void> (0) : __assert_fail (
+   "BB"
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 4433, __PRETTY_FUNCTION__))
+             ;
+    return new (2) CatchReturnInst(CatchPad, BB, InsertBefore);
+  }
+
+  static CatchReturnInst *Create(Value *CatchPad, BasicBlock *BB,
+                                 BasicBlock *InsertAtEnd) {
+    
+   ((
+   CatchPad
+   ) ? static_cast<void> (0) : __assert_fail (
+   "CatchPad"
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 4439, __PRETTY_FUNCTION__))
+                   ;
+    
+   ((
+   BB
+   ) ? static_cast<void> (0) : __assert_fail (
+   "BB"
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 4440, __PRETTY_FUNCTION__))
+             ;
+    return new (2) CatchReturnInst(CatchPad, BB, InsertAtEnd);
+  }
+
+
+  public: inline Value *getOperand(unsigned) const; inline void setOperand(unsigned, Value*); inline op_iterator op_begin(); inline const_op_iterator op_begin() const; inline op_iterator op_end(); inline const_op_iterator op_end() const; protected: template <int> inline Use &Op(); template <int> inline const Use &Op() const; public: inline unsigned getNumOperands() const;
+
+
+  CatchPadInst *getCatchPad() const { return cast<CatchPadInst>(Op<0>()); }
+  void setCatchPad(CatchPadInst *CatchPad) {
+    
+   ((
+   CatchPad
+   ) ? static_cast<void> (0) : __assert_fail (
+   "CatchPad"
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 4450, __PRETTY_FUNCTION__))
+                   ;
+    Op<0>() = CatchPad;
+  }
+
+  BasicBlock *getSuccessor() const { return cast<BasicBlock>(Op<1>()); }
+  void setSuccessor(BasicBlock *NewSucc) {
+    
+   ((
+   NewSucc
+   ) ? static_cast<void> (0) : __assert_fail (
+   "NewSucc"
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 4456, __PRETTY_FUNCTION__))
+                  ;
+    Op<1>() = NewSucc;
+  }
+  unsigned getNumSuccessors() const { return 1; }
+
+
+
+  Value *getCatchSwitchParentPad() const {
+    return getCatchPad()->getCatchSwitch()->getParentPad();
+  }
+
+
+  static bool classof(const Instruction *I) {
+    return (I->getOpcode() == Instruction::CatchRet);
+  }
+  static bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+
+private:
+  friend TerminatorInst;
+
+  BasicBlock *getSuccessor(unsigned Idx) const {
+    
+   ((
+   Idx < getNumSuccessors() && "Successor # out of range for catchret!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Idx < getNumSuccessors() && \"Successor # out of range for catchret!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 4479, __PRETTY_FUNCTION__))
+                                                                               ;
+    return getSuccessor();
+  }
+
+  void setSuccessor(unsigned Idx, BasicBlock *B) {
+    
+   ((
+   Idx < getNumSuccessors() && "Successor # out of range for catchret!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Idx < getNumSuccessors() && \"Successor # out of range for catchret!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 4484, __PRETTY_FUNCTION__))
+                                                                               ;
+    setSuccessor(B);
+  }
+};
+
+template <>
+struct OperandTraits<CatchReturnInst>
+    : public FixedNumOperandTraits<CatchReturnInst, 2> {};
+
+CatchReturnInst::op_iterator CatchReturnInst::op_begin() { return OperandTraits<CatchReturnInst>::op_begin(this); } CatchReturnInst::const_op_iterator CatchReturnInst::op_begin() const { return OperandTraits<CatchReturnInst>::op_begin(const_cast<CatchReturnInst*>(this)); } CatchReturnInst::op_iterator CatchReturnInst::op_end() { return OperandTraits<CatchReturnInst>::op_end(this); } CatchReturnInst::const_op_iterator CatchReturnInst::op_end() const { return OperandTraits<CatchReturnInst>::op_end(const_cast<CatchReturnInst*>(this)); } Value *CatchReturnInst::getOperand(unsigned i_nocapture) const { 
+((
+i_nocapture < OperandTraits<CatchReturnInst>::operands(this) && "getOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<CatchReturnInst>::operands(this) && \"getOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 4493, __PRETTY_FUNCTION__))
+; return cast_or_null<Value>( OperandTraits<CatchReturnInst>::op_begin(const_cast<CatchReturnInst*>(this))[i_nocapture].get()); } void CatchReturnInst::setOperand(unsigned i_nocapture, Value *Val_nocapture) { 
+((
+i_nocapture < OperandTraits<CatchReturnInst>::operands(this) && "setOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<CatchReturnInst>::operands(this) && \"setOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 4493, __PRETTY_FUNCTION__))
+; OperandTraits<CatchReturnInst>::op_begin(this)[i_nocapture] = Val_nocapture; } unsigned CatchReturnInst::getNumOperands() const { return OperandTraits<CatchReturnInst>::operands(this); } template <int Idx_nocapture> Use &CatchReturnInst::Op() { return this->OpFrom<Idx_nocapture>(this); } template <int Idx_nocapture> const Use &CatchReturnInst::Op() const { return this->OpFrom<Idx_nocapture>(this); }
+
+
+
+
+
+class CleanupReturnInst : public TerminatorInst {
+private:
+  CleanupReturnInst(const CleanupReturnInst &RI);
+  CleanupReturnInst(Value *CleanupPad, BasicBlock *UnwindBB, unsigned Values,
+                    Instruction *InsertBefore = nullptr);
+  CleanupReturnInst(Value *CleanupPad, BasicBlock *UnwindBB, unsigned Values,
+                    BasicBlock *InsertAtEnd);
+
+  void init(Value *CleanupPad, BasicBlock *UnwindBB);
+
+protected:
+
+  friend class Instruction;
+
+  CleanupReturnInst *cloneImpl() const;
+
+public:
+  static CleanupReturnInst *Create(Value *CleanupPad,
+                                   BasicBlock *UnwindBB = nullptr,
+                                   Instruction *InsertBefore = nullptr) {
+    
+   ((
+   CleanupPad
+   ) ? static_cast<void> (0) : __assert_fail (
+   "CleanupPad"
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 4519, __PRETTY_FUNCTION__))
+                     ;
+    unsigned Values = 1;
+    if (UnwindBB)
+      ++Values;
+    return new (Values)
+        CleanupReturnInst(CleanupPad, UnwindBB, Values, InsertBefore);
+  }
+
+  static CleanupReturnInst *Create(Value *CleanupPad, BasicBlock *UnwindBB,
+                                   BasicBlock *InsertAtEnd) {
+    
+   ((
+   CleanupPad
+   ) ? static_cast<void> (0) : __assert_fail (
+   "CleanupPad"
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 4529, __PRETTY_FUNCTION__))
+                     ;
+    unsigned Values = 1;
+    if (UnwindBB)
+      ++Values;
+    return new (Values)
+        CleanupReturnInst(CleanupPad, UnwindBB, Values, InsertAtEnd);
+  }
+
+
+  public: inline Value *getOperand(unsigned) const; inline void setOperand(unsigned, Value*); inline op_iterator op_begin(); inline const_op_iterator op_begin() const; inline op_iterator op_end(); inline const_op_iterator op_end() const; protected: template <int> inline Use &Op(); template <int> inline const Use &Op() const; public: inline unsigned getNumOperands() const;
+
+  bool hasUnwindDest() const { return getSubclassDataFromInstruction() & 1; }
+  bool unwindsToCaller() const { return !hasUnwindDest(); }
+
+
+  CleanupPadInst *getCleanupPad() const {
+    return cast<CleanupPadInst>(Op<0>());
+  }
+  void setCleanupPad(CleanupPadInst *CleanupPad) {
+    
+   ((
+   CleanupPad
+   ) ? static_cast<void> (0) : __assert_fail (
+   "CleanupPad"
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 4548, __PRETTY_FUNCTION__))
+                     ;
+    Op<0>() = CleanupPad;
+  }
+
+  unsigned getNumSuccessors() const { return hasUnwindDest() ? 1 : 0; }
+
+  BasicBlock *getUnwindDest() const {
+    return hasUnwindDest() ? cast<BasicBlock>(Op<1>()) : nullptr;
+  }
+  void setUnwindDest(BasicBlock *NewDest) {
+    
+   ((
+   NewDest
+   ) ? static_cast<void> (0) : __assert_fail (
+   "NewDest"
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 4558, __PRETTY_FUNCTION__))
+                  ;
+    
+   ((
+   hasUnwindDest()
+   ) ? static_cast<void> (0) : __assert_fail (
+   "hasUnwindDest()"
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 4559, __PRETTY_FUNCTION__))
+                          ;
+    Op<1>() = NewDest;
+  }
+
+
+  static bool classof(const Instruction *I) {
+    return (I->getOpcode() == Instruction::CleanupRet);
+  }
+  static bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+
+private:
+  friend TerminatorInst;
+
+  BasicBlock *getSuccessor(unsigned Idx) const {
+    
+   ((
+   Idx == 0
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Idx == 0"
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 4575, __PRETTY_FUNCTION__))
+                   ;
+    return getUnwindDest();
+  }
+
+  void setSuccessor(unsigned Idx, BasicBlock *B) {
+    
+   ((
+   Idx == 0
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Idx == 0"
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 4580, __PRETTY_FUNCTION__))
+                   ;
+    setUnwindDest(B);
+  }
+
+
+
+  void setInstructionSubclassData(unsigned short D) {
+    Instruction::setInstructionSubclassData(D);
+  }
+};
+
+template <>
+struct OperandTraits<CleanupReturnInst>
+    : public VariadicOperandTraits<CleanupReturnInst, 1> {};
+
+CleanupReturnInst::op_iterator CleanupReturnInst::op_begin() { return OperandTraits<CleanupReturnInst>::op_begin(this); } CleanupReturnInst::const_op_iterator CleanupReturnInst::op_begin() const { return OperandTraits<CleanupReturnInst>::op_begin(const_cast<CleanupReturnInst*>(this)); } CleanupReturnInst::op_iterator CleanupReturnInst::op_end() { return OperandTraits<CleanupReturnInst>::op_end(this); } CleanupReturnInst::const_op_iterator CleanupReturnInst::op_end() const { return OperandTraits<CleanupReturnInst>::op_end(const_cast<CleanupReturnInst*>(this)); } Value *CleanupReturnInst::getOperand(unsigned i_nocapture) const { 
+((
+i_nocapture < OperandTraits<CleanupReturnInst>::operands(this) && "getOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<CleanupReturnInst>::operands(this) && \"getOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 4595, __PRETTY_FUNCTION__))
+; return cast_or_null<Value>( OperandTraits<CleanupReturnInst>::op_begin(const_cast<CleanupReturnInst*>(this))[i_nocapture].get()); } void CleanupReturnInst::setOperand(unsigned i_nocapture, Value *Val_nocapture) { 
+((
+i_nocapture < OperandTraits<CleanupReturnInst>::operands(this) && "setOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<CleanupReturnInst>::operands(this) && \"setOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 4595, __PRETTY_FUNCTION__))
+; OperandTraits<CleanupReturnInst>::op_begin(this)[i_nocapture] = Val_nocapture; } unsigned CleanupReturnInst::getNumOperands() const { return OperandTraits<CleanupReturnInst>::operands(this); } template <int Idx_nocapture> Use &CleanupReturnInst::Op() { return this->OpFrom<Idx_nocapture>(this); } template <int Idx_nocapture> const Use &CleanupReturnInst::Op() const { return this->OpFrom<Idx_nocapture>(this); }
+class UnreachableInst : public TerminatorInst {
+protected:
+
+  friend class Instruction;
+
+  UnreachableInst *cloneImpl() const;
+
+public:
+  explicit UnreachableInst(LLVMContext &C, Instruction *InsertBefore = nullptr);
+  explicit UnreachableInst(LLVMContext &C, BasicBlock *InsertAtEnd);
+
+
+  void *operator new(size_t s) {
+    return User::operator new(s, 0);
+  }
+
+  unsigned getNumSuccessors() const { return 0; }
+
+
+  static bool classof(const Instruction *I) {
+    return I->getOpcode() == Instruction::Unreachable;
+  }
+  static bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+
+private:
+  friend TerminatorInst;
+
+  BasicBlock *getSuccessor(unsigned idx) const {
+    ::llvm::llvm_unreachable_internal("UnreachableInst has no successors!", "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 4636);
+  }
+
+  void setSuccessor(unsigned idx, BasicBlock *B) {
+    ::llvm::llvm_unreachable_internal("UnreachableInst has no successors!", "/home/trippels/llvm/llvm/include/llvm/IR/Instructions.h", 4640);
+  }
+};
+
+
+
+
+
+
+class TruncInst : public CastInst {
+protected:
+
+  friend class Instruction;
+
+
+  TruncInst *cloneImpl() const;
+
+public:
+
+  TruncInst(
+    Value *S,
+    Type *Ty,
+    const Twine &NameStr = "",
+    Instruction *InsertBefore = nullptr
+  );
+
+
+  TruncInst(
+    Value *S,
+    Type *Ty,
+    const Twine &NameStr,
+    BasicBlock *InsertAtEnd
+  );
+
+
+  static bool classof(const Instruction *I) {
+    return I->getOpcode() == Trunc;
+  }
+  static bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+};
+
+
+
+
+
+
+class ZExtInst : public CastInst {
+protected:
+
+  friend class Instruction;
+
+
+  ZExtInst *cloneImpl() const;
+
+public:
+
+  ZExtInst(
+    Value *S,
+    Type *Ty,
+    const Twine &NameStr = "",
+    Instruction *InsertBefore = nullptr
+  );
+
+
+  ZExtInst(
+    Value *S,
+    Type *Ty,
+    const Twine &NameStr,
+    BasicBlock *InsertAtEnd
+  );
+
+
+  static bool classof(const Instruction *I) {
+    return I->getOpcode() == ZExt;
+  }
+  static bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+};
+
+
+
+
+
+
+class SExtInst : public CastInst {
+protected:
+
+  friend class Instruction;
+
+
+  SExtInst *cloneImpl() const;
+
+public:
+
+  SExtInst(
+    Value *S,
+    Type *Ty,
+    const Twine &NameStr = "",
+    Instruction *InsertBefore = nullptr
+  );
+
+
+  SExtInst(
+    Value *S,
+    Type *Ty,
+    const Twine &NameStr,
+    BasicBlock *InsertAtEnd
+  );
+
+
+  static bool classof(const Instruction *I) {
+    return I->getOpcode() == SExt;
+  }
+  static bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+};
+
+
+
+
+
+
+class FPTruncInst : public CastInst {
+protected:
+
+  friend class Instruction;
+
+
+  FPTruncInst *cloneImpl() const;
+
+public:
+
+  FPTruncInst(
+    Value *S,
+    Type *Ty,
+    const Twine &NameStr = "",
+    Instruction *InsertBefore = nullptr
+  );
+
+
+  FPTruncInst(
+    Value *S,
+    Type *Ty,
+    const Twine &NameStr,
+    BasicBlock *InsertAtEnd
+  );
+
+
+  static bool classof(const Instruction *I) {
+    return I->getOpcode() == FPTrunc;
+  }
+  static bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+};
+
+
+
+
+
+
+class FPExtInst : public CastInst {
+protected:
+
+  friend class Instruction;
+
+
+  FPExtInst *cloneImpl() const;
+
+public:
+
+  FPExtInst(
+    Value *S,
+    Type *Ty,
+    const Twine &NameStr = "",
+    Instruction *InsertBefore = nullptr
+  );
+
+
+  FPExtInst(
+    Value *S,
+    Type *Ty,
+    const Twine &NameStr,
+    BasicBlock *InsertAtEnd
+  );
+
+
+  static bool classof(const Instruction *I) {
+    return I->getOpcode() == FPExt;
+  }
+  static bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+};
+
+
+
+
+
+
+class UIToFPInst : public CastInst {
+protected:
+
+  friend class Instruction;
+
+
+  UIToFPInst *cloneImpl() const;
+
+public:
+
+  UIToFPInst(
+    Value *S,
+    Type *Ty,
+    const Twine &NameStr = "",
+    Instruction *InsertBefore = nullptr
+  );
+
+
+  UIToFPInst(
+    Value *S,
+    Type *Ty,
+    const Twine &NameStr,
+    BasicBlock *InsertAtEnd
+  );
+
+
+  static bool classof(const Instruction *I) {
+    return I->getOpcode() == UIToFP;
+  }
+  static bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+};
+
+
+
+
+
+
+class SIToFPInst : public CastInst {
+protected:
+
+  friend class Instruction;
+
+
+  SIToFPInst *cloneImpl() const;
+
+public:
+
+  SIToFPInst(
+    Value *S,
+    Type *Ty,
+    const Twine &NameStr = "",
+    Instruction *InsertBefore = nullptr
+  );
+
+
+  SIToFPInst(
+    Value *S,
+    Type *Ty,
+    const Twine &NameStr,
+    BasicBlock *InsertAtEnd
+  );
+
+
+  static bool classof(const Instruction *I) {
+    return I->getOpcode() == SIToFP;
+  }
+  static bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+};
+
+
+
+
+
+
+class FPToUIInst : public CastInst {
+protected:
+
+  friend class Instruction;
+
+
+  FPToUIInst *cloneImpl() const;
+
+public:
+
+  FPToUIInst(
+    Value *S,
+    Type *Ty,
+    const Twine &NameStr = "",
+    Instruction *InsertBefore = nullptr
+  );
+
+
+  FPToUIInst(
+    Value *S,
+    Type *Ty,
+    const Twine &NameStr,
+    BasicBlock *InsertAtEnd
+  );
+
+
+  static bool classof(const Instruction *I) {
+    return I->getOpcode() == FPToUI;
+  }
+  static bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+};
+
+
+
+
+
+
+class FPToSIInst : public CastInst {
+protected:
+
+  friend class Instruction;
+
+
+  FPToSIInst *cloneImpl() const;
+
+public:
+
+  FPToSIInst(
+    Value *S,
+    Type *Ty,
+    const Twine &NameStr = "",
+    Instruction *InsertBefore = nullptr
+  );
+
+
+  FPToSIInst(
+    Value *S,
+    Type *Ty,
+    const Twine &NameStr,
+    BasicBlock *InsertAtEnd
+  );
+
+
+  static bool classof(const Instruction *I) {
+    return I->getOpcode() == FPToSI;
+  }
+  static bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+};
+
+
+
+
+
+
+class IntToPtrInst : public CastInst {
+public:
+
+  friend class Instruction;
+
+
+  IntToPtrInst(
+    Value *S,
+    Type *Ty,
+    const Twine &NameStr = "",
+    Instruction *InsertBefore = nullptr
+  );
+
+
+  IntToPtrInst(
+    Value *S,
+    Type *Ty,
+    const Twine &NameStr,
+    BasicBlock *InsertAtEnd
+  );
+
+
+  IntToPtrInst *cloneImpl() const;
+
+
+  unsigned getAddressSpace() const {
+    return getType()->getPointerAddressSpace();
+  }
+
+
+  static bool classof(const Instruction *I) {
+    return I->getOpcode() == IntToPtr;
+  }
+  static bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+};
+
+
+
+
+
+
+class PtrToIntInst : public CastInst {
+protected:
+
+  friend class Instruction;
+
+
+  PtrToIntInst *cloneImpl() const;
+
+public:
+
+  PtrToIntInst(
+    Value *S,
+    Type *Ty,
+    const Twine &NameStr = "",
+    Instruction *InsertBefore = nullptr
+  );
+
+
+  PtrToIntInst(
+    Value *S,
+    Type *Ty,
+    const Twine &NameStr,
+    BasicBlock *InsertAtEnd
+  );
+
+
+  Value *getPointerOperand() { return getOperand(0); }
+
+  const Value *getPointerOperand() const { return getOperand(0); }
+
+  static unsigned getPointerOperandIndex() { return 0U; }
+
+
+  unsigned getPointerAddressSpace() const {
+    return getPointerOperand()->getType()->getPointerAddressSpace();
+  }
+
+
+  static bool classof(const Instruction *I) {
+    return I->getOpcode() == PtrToInt;
+  }
+  static bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+};
+
+
+
+
+
+
+class BitCastInst : public CastInst {
+protected:
+
+  friend class Instruction;
+
+
+  BitCastInst *cloneImpl() const;
+
+public:
+
+  BitCastInst(
+    Value *S,
+    Type *Ty,
+    const Twine &NameStr = "",
+    Instruction *InsertBefore = nullptr
+  );
+
+
+  BitCastInst(
+    Value *S,
+    Type *Ty,
+    const Twine &NameStr,
+    BasicBlock *InsertAtEnd
+  );
+
+
+  static bool classof(const Instruction *I) {
+    return I->getOpcode() == BitCast;
+  }
+  static bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+};
+
+
+
+
+
+
+
+class AddrSpaceCastInst : public CastInst {
+protected:
+
+  friend class Instruction;
+
+
+  AddrSpaceCastInst *cloneImpl() const;
+
+public:
+
+  AddrSpaceCastInst(
+    Value *S,
+    Type *Ty,
+    const Twine &NameStr = "",
+    Instruction *InsertBefore = nullptr
+  );
+
+
+  AddrSpaceCastInst(
+    Value *S,
+    Type *Ty,
+    const Twine &NameStr,
+    BasicBlock *InsertAtEnd
+  );
+
+
+  static bool classof(const Instruction *I) {
+    return I->getOpcode() == AddrSpaceCast;
+  }
+  static bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+
+
+  Value *getPointerOperand() {
+    return getOperand(0);
+  }
+
+
+  const Value *getPointerOperand() const {
+    return getOperand(0);
+  }
+
+
+  static unsigned getPointerOperandIndex() {
+    return 0U;
+  }
+
+
+  unsigned getSrcAddressSpace() const {
+    return getPointerOperand()->getType()->getPointerAddressSpace();
+  }
+
+
+  unsigned getDestAddressSpace() const {
+    return getType()->getPointerAddressSpace();
+  }
+};
+
+}
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+
+namespace llvm {
+
+
+
+
+
+
+
+template <typename EltTy>
+class TinyPtrVector {
+public:
+  using VecTy = SmallVector<EltTy, 4>;
+  using value_type = typename VecTy::value_type;
+  using PtrUnion = PointerUnion<EltTy, VecTy *>;
+
+private:
+  PtrUnion Val;
+
+public:
+  TinyPtrVector() = default;
+
+  ~TinyPtrVector() {
+    if (VecTy *V = Val.template dyn_cast<VecTy*>())
+      delete V;
+  }
+
+  TinyPtrVector(const TinyPtrVector &RHS) : Val(RHS.Val) {
+    if (VecTy *V = Val.template dyn_cast<VecTy*>())
+      Val = new VecTy(*V);
+  }
+
+  TinyPtrVector &operator=(const TinyPtrVector &RHS) {
+    if (this == &RHS)
+      return *this;
+    if (RHS.empty()) {
+      this->clear();
+      return *this;
+    }
+
+
+
+    if (Val.template is<EltTy>()) {
+      if (RHS.size() == 1)
+        Val = RHS.front();
+      else
+        Val = new VecTy(*RHS.Val.template get<VecTy*>());
+      return *this;
+    }
+
+
+    if (RHS.Val.template is<EltTy>()) {
+      Val.template get<VecTy*>()->clear();
+      Val.template get<VecTy*>()->push_back(RHS.front());
+    } else {
+      *Val.template get<VecTy*>() = *RHS.Val.template get<VecTy*>();
+    }
+    return *this;
+  }
+
+  TinyPtrVector(TinyPtrVector &&RHS) : Val(RHS.Val) {
+    RHS.Val = (EltTy)nullptr;
+  }
+
+  TinyPtrVector &operator=(TinyPtrVector &&RHS) {
+    if (this == &RHS)
+      return *this;
+    if (RHS.empty()) {
+      this->clear();
+      return *this;
+    }
+
+
+
+
+    if (VecTy *V = Val.template dyn_cast<VecTy*>()) {
+      if (RHS.Val.template is<EltTy>()) {
+        V->clear();
+        V->push_back(RHS.front());
+        RHS.Val = (EltTy)nullptr;
+        return *this;
+      }
+      delete V;
+    }
+
+    Val = RHS.Val;
+    RHS.Val = (EltTy)nullptr;
+    return *this;
+  }
+
+
+
+
+
+  explicit TinyPtrVector(ArrayRef<EltTy> Elts)
+      : Val(Elts.empty()
+                ? PtrUnion()
+                : Elts.size() == 1
+                      ? PtrUnion(Elts[0])
+                      : PtrUnion(new VecTy(Elts.begin(), Elts.end()))) {}
+
+  TinyPtrVector(size_t Count, EltTy Value)
+      : Val(Count == 0 ? PtrUnion()
+                       : Count == 1 ? PtrUnion(Value)
+                                    : PtrUnion(new VecTy(Count, Value))) {}
+
+
+  operator ArrayRef<EltTy>() const {
+    if (Val.isNull())
+      return None;
+    if (Val.template is<EltTy>())
+      return *Val.getAddrOfPtr1();
+    return *Val.template get<VecTy*>();
+  }
+
+
+  operator MutableArrayRef<EltTy>() {
+    if (Val.isNull())
+      return None;
+    if (Val.template is<EltTy>())
+      return *Val.getAddrOfPtr1();
+    return *Val.template get<VecTy*>();
+  }
+
+
+  template<typename U,
+           typename std::enable_if<
+               std::is_convertible<ArrayRef<EltTy>, ArrayRef<U>>::value,
+               bool>::type = false>
+  operator ArrayRef<U>() const {
+    return operator ArrayRef<EltTy>();
+  }
+
+  bool empty() const {
+
+
+    if (Val.isNull()) return true;
+    if (VecTy *Vec = Val.template dyn_cast<VecTy*>())
+      return Vec->empty();
+    return false;
+  }
+
+  unsigned size() const {
+    if (empty())
+      return 0;
+    if (Val.template is<EltTy>())
+      return 1;
+    return Val.template get<VecTy*>()->size();
+  }
+
+  using iterator = EltTy *;
+  using const_iterator = const EltTy *;
+  using reverse_iterator = std::reverse_iterator<iterator>;
+  using const_reverse_iterator = std::reverse_iterator<const_iterator>;
+
+  iterator begin() {
+    if (Val.template is<EltTy>())
+      return Val.getAddrOfPtr1();
+
+    return Val.template get<VecTy *>()->begin();
+  }
+
+  iterator end() {
+    if (Val.template is<EltTy>())
+      return begin() + (Val.isNull() ? 0 : 1);
+
+    return Val.template get<VecTy *>()->end();
+  }
+
+  const_iterator begin() const {
+    return (const_iterator)const_cast<TinyPtrVector*>(this)->begin();
+  }
+
+  const_iterator end() const {
+    return (const_iterator)const_cast<TinyPtrVector*>(this)->end();
+  }
+
+  reverse_iterator rbegin() { return reverse_iterator(end()); }
+  reverse_iterator rend() { return reverse_iterator(begin()); }
+
+  const_reverse_iterator rbegin() const {
+    return const_reverse_iterator(end());
+  }
+
+  const_reverse_iterator rend() const {
+    return const_reverse_iterator(begin());
+  }
+
+  EltTy operator[](unsigned i) const {
+    
+   ((
+   !Val.isNull() && "can't index into an empty vector"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!Val.isNull() && \"can't index into an empty vector\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/TinyPtrVector.h", 210, __PRETTY_FUNCTION__))
+                                                              ;
+    if (EltTy V = Val.template dyn_cast<EltTy>()) {
+      
+     ((
+     i == 0 && "tinyvector index out of range"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "i == 0 && \"tinyvector index out of range\""
+     , "/home/trippels/llvm/llvm/include/llvm/ADT/TinyPtrVector.h", 212, __PRETTY_FUNCTION__))
+                                                      ;
+      return V;
+    }
+
+    
+   ((
+   i < Val.template get<VecTy*>()->size() && "tinyvector index out of range"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "i < Val.template get<VecTy*>()->size() && \"tinyvector index out of range\""
+   ,
+                                          "/home/trippels/llvm/llvm/include/llvm/ADT/TinyPtrVector.h"
+    ,
+                                          217
+    , __PRETTY_FUNCTION__))
+                                           
+                                          ;
+    return (*Val.template get<VecTy*>())[i];
+  }
+
+  EltTy front() const {
+    
+   ((
+   !empty() && "vector empty"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!empty() && \"vector empty\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/TinyPtrVector.h", 222, __PRETTY_FUNCTION__))
+                                     ;
+    if (EltTy V = Val.template dyn_cast<EltTy>())
+      return V;
+    return Val.template get<VecTy*>()->front();
+  }
+
+  EltTy back() const {
+    
+   ((
+   !empty() && "vector empty"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!empty() && \"vector empty\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/TinyPtrVector.h", 229, __PRETTY_FUNCTION__))
+                                     ;
+    if (EltTy V = Val.template dyn_cast<EltTy>())
+      return V;
+    return Val.template get<VecTy*>()->back();
+  }
+
+  void push_back(EltTy NewVal) {
+    
+   ((
+   NewVal && "Can't add a null value"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "NewVal && \"Can't add a null value\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/TinyPtrVector.h", 236, __PRETTY_FUNCTION__))
+                                             ;
+
+
+    if (Val.isNull()) {
+      Val = NewVal;
+      return;
+    }
+
+
+    if (EltTy V = Val.template dyn_cast<EltTy>()) {
+      Val = new VecTy();
+      Val.template get<VecTy*>()->push_back(V);
+    }
+
+
+    Val.template get<VecTy*>()->push_back(NewVal);
+  }
+
+  void pop_back() {
+
+    if (Val.template is<EltTy>())
+      Val = (EltTy)nullptr;
+    else if (VecTy *Vec = Val.template get<VecTy*>())
+      Vec->pop_back();
+  }
+
+  void clear() {
+
+    if (Val.template is<EltTy>()) {
+      Val = (EltTy)nullptr;
+    } else if (VecTy *Vec = Val.template dyn_cast<VecTy*>()) {
+
+      Vec->clear();
+    }
+
+  }
+
+  iterator erase(iterator I) {
+    
+   ((
+   I >= begin() && "Iterator to erase is out of bounds."
+   ) ? static_cast<void> (0) : __assert_fail (
+   "I >= begin() && \"Iterator to erase is out of bounds.\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/TinyPtrVector.h", 274, __PRETTY_FUNCTION__))
+                                                                ;
+    
+   ((
+   I < end() && "Erasing at past-the-end iterator."
+   ) ? static_cast<void> (0) : __assert_fail (
+   "I < end() && \"Erasing at past-the-end iterator.\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/TinyPtrVector.h", 275, __PRETTY_FUNCTION__))
+                                                           ;
+
+
+    if (Val.template is<EltTy>()) {
+      if (I == begin())
+        Val = (EltTy)nullptr;
+    } else if (VecTy *Vec = Val.template dyn_cast<VecTy*>()) {
+
+
+      return Vec->erase(I);
+    }
+    return end();
+  }
+
+  iterator erase(iterator S, iterator E) {
+    
+   ((
+   S >= begin() && "Range to erase is out of bounds."
+   ) ? static_cast<void> (0) : __assert_fail (
+   "S >= begin() && \"Range to erase is out of bounds.\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/TinyPtrVector.h", 290, __PRETTY_FUNCTION__))
+                                                             ;
+    
+   ((
+   S <= E && "Trying to erase invalid range."
+   ) ? static_cast<void> (0) : __assert_fail (
+   "S <= E && \"Trying to erase invalid range.\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/TinyPtrVector.h", 291, __PRETTY_FUNCTION__))
+                                                     ;
+    
+   ((
+   E <= end() && "Trying to erase past the end."
+   ) ? static_cast<void> (0) : __assert_fail (
+   "E <= end() && \"Trying to erase past the end.\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/TinyPtrVector.h", 292, __PRETTY_FUNCTION__))
+                                                        ;
+
+    if (Val.template is<EltTy>()) {
+      if (S == begin() && S != E)
+        Val = (EltTy)nullptr;
+    } else if (VecTy *Vec = Val.template dyn_cast<VecTy*>()) {
+      return Vec->erase(S, E);
+    }
+    return end();
+  }
+
+  iterator insert(iterator I, const EltTy &Elt) {
+    
+   ((
+   I >= this->begin() && "Insertion iterator is out of bounds."
+   ) ? static_cast<void> (0) : __assert_fail (
+   "I >= this->begin() && \"Insertion iterator is out of bounds.\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/TinyPtrVector.h", 304, __PRETTY_FUNCTION__))
+                                                                       ;
+    
+   ((
+   I <= this->end() && "Inserting past the end of the vector."
+   ) ? static_cast<void> (0) : __assert_fail (
+   "I <= this->end() && \"Inserting past the end of the vector.\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/TinyPtrVector.h", 305, __PRETTY_FUNCTION__))
+                                                                      ;
+    if (I == end()) {
+      push_back(Elt);
+      return std::prev(end());
+    }
+    
+   ((
+   !Val.isNull() && "Null value with non-end insert iterator."
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!Val.isNull() && \"Null value with non-end insert iterator.\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/TinyPtrVector.h", 310, __PRETTY_FUNCTION__))
+                                                                      ;
+    if (EltTy V = Val.template dyn_cast<EltTy>()) {
+      
+     ((
+     I == begin()
+     ) ? static_cast<void> (0) : __assert_fail (
+     "I == begin()"
+     , "/home/trippels/llvm/llvm/include/llvm/ADT/TinyPtrVector.h", 312, __PRETTY_FUNCTION__))
+                         ;
+      Val = Elt;
+      push_back(V);
+      return begin();
+    }
+
+    return Val.template get<VecTy*>()->insert(I, Elt);
+  }
+
+  template<typename ItTy>
+  iterator insert(iterator I, ItTy From, ItTy To) {
+    
+   ((
+   I >= this->begin() && "Insertion iterator is out of bounds."
+   ) ? static_cast<void> (0) : __assert_fail (
+   "I >= this->begin() && \"Insertion iterator is out of bounds.\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/TinyPtrVector.h", 323, __PRETTY_FUNCTION__))
+                                                                       ;
+    
+   ((
+   I <= this->end() && "Inserting past the end of the vector."
+   ) ? static_cast<void> (0) : __assert_fail (
+   "I <= this->end() && \"Inserting past the end of the vector.\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/TinyPtrVector.h", 324, __PRETTY_FUNCTION__))
+                                                                      ;
+    if (From == To)
+      return I;
+
+
+    ptrdiff_t Offset = I - begin();
+    if (Val.isNull()) {
+      if (std::next(From) == To) {
+        Val = *From;
+        return begin();
+      }
+
+      Val = new VecTy();
+    } else if (EltTy V = Val.template dyn_cast<EltTy>()) {
+      Val = new VecTy();
+      Val.template get<VecTy*>()->push_back(V);
+    }
+    return Val.template get<VecTy*>()->insert(begin() + Offset, From, To);
+  }
+};
+
+}
+
+namespace llvm {
+
+class raw_ostream;
+class StringRef;
+template <typename ValueTy> class StringMapEntry;
+
+
+
+
+
+class Comdat {
+public:
+  enum SelectionKind {
+    Any,
+    ExactMatch,
+    Largest,
+    NoDuplicates,
+    SameSize,
+  };
+
+  Comdat(const Comdat &) = delete;
+  Comdat(Comdat &&C);
+
+  SelectionKind getSelectionKind() const { return SK; }
+  void setSelectionKind(SelectionKind Val) { SK = Val; }
+  StringRef getName() const;
+  void print(raw_ostream &OS, bool IsForDebug = false) const;
+  void dump() const;
+
+private:
+  friend class Module;
+
+  Comdat();
+
+
+  StringMapEntry<Comdat> *Name = nullptr;
+  SelectionKind SK = Any;
+};
+
+inline raw_ostream &operator<<(raw_ostream &OS, const Comdat &C) {
+  C.print(OS);
+  return OS;
+}
+
+}
+namespace llvm {
+
+class AnalysisResolver;
+class AnalysisUsage;
+class BasicBlock;
+class Function;
+class ImmutablePass;
+class Module;
+class PassInfo;
+class PMDataManager;
+class PMStack;
+class raw_ostream;
+
+
+using AnalysisID = const void *;
+
+
+
+
+enum PassManagerType {
+  PMT_Unknown = 0,
+  PMT_ModulePassManager = 1,
+  PMT_CallGraphPassManager,
+  PMT_FunctionPassManager,
+  PMT_LoopPassManager,
+  PMT_RegionPassManager,
+  PMT_BasicBlockPassManager,
+  PMT_Last
+};
+
+
+enum PassKind {
+  PT_BasicBlock,
+  PT_Region,
+  PT_Loop,
+  PT_Function,
+  PT_CallGraphSCC,
+  PT_Module,
+  PT_PassManager
+};
+
+
+
+
+
+
+class Pass {
+  AnalysisResolver *Resolver = nullptr;
+  const void *PassID;
+  PassKind Kind;
+
+public:
+  explicit Pass(PassKind K, char &pid) : PassID(&pid), Kind(K) {}
+  Pass(const Pass &) = delete;
+  Pass &operator=(const Pass &) = delete;
+  virtual ~Pass();
+
+  PassKind getPassKind() const { return Kind; }
+
+
+
+
+  virtual StringRef getPassName() const;
+
+
+  AnalysisID getPassID() const {
+    return PassID;
+  }
+
+
+
+  virtual bool doInitialization(Module &) { return false; }
+
+
+
+  virtual bool doFinalization(Module &) { return false; }
+
+
+
+
+
+
+
+  virtual void print(raw_ostream &OS, const Module *M) const;
+
+  void dump() const;
+
+
+
+  virtual Pass *createPrinterPass(raw_ostream &OS,
+                                  const std::string &Banner) const = 0;
+
+
+
+  virtual void assignPassManager(PMStack &,
+                                 PassManagerType) {}
+
+
+  virtual void preparePassManager(PMStack &);
+
+
+  virtual PassManagerType getPotentialPassManagerType() const;
+
+
+  void setResolver(AnalysisResolver *AR);
+  AnalysisResolver *getResolver() const { return Resolver; }
+
+
+
+
+
+  virtual void getAnalysisUsage(AnalysisUsage &) const;
+  virtual void releaseMemory();
+
+
+
+
+
+  virtual void *getAdjustedAnalysisPointer(AnalysisID ID);
+  virtual ImmutablePass *getAsImmutablePass();
+  virtual PMDataManager *getAsPMDataManager();
+
+
+
+  virtual void verifyAnalysis() const;
+
+
+  virtual void dumpPassStructure(unsigned Offset = 0);
+
+
+
+  static const PassInfo *lookupPassInfo(const void *TI);
+
+
+
+  static const PassInfo *lookupPassInfo(StringRef Arg);
+
+
+
+  static Pass *createPass(AnalysisID ID);
+  template<typename AnalysisType> AnalysisType *
+    getAnalysisIfAvailable() const;
+
+
+
+
+
+
+  bool mustPreserveAnalysisID(char &AID) const;
+
+
+
+
+  template<typename AnalysisType>
+  AnalysisType &getAnalysis() const;
+
+  template<typename AnalysisType>
+  AnalysisType &getAnalysis(Function &F);
+
+  template<typename AnalysisType>
+  AnalysisType &getAnalysisID(AnalysisID PI) const;
+
+  template<typename AnalysisType>
+  AnalysisType &getAnalysisID(AnalysisID PI, Function &F);
+};
+
+
+
+
+
+
+class ModulePass : public Pass {
+public:
+  explicit ModulePass(char &pid) : Pass(PT_Module, pid) {}
+
+
+  ~ModulePass() override;
+
+
+  Pass *createPrinterPass(raw_ostream &OS,
+                          const std::string &Banner) const override;
+
+
+
+  virtual bool runOnModule(Module &M) = 0;
+
+  void assignPassManager(PMStack &PMS, PassManagerType T) override;
+
+
+  PassManagerType getPotentialPassManagerType() const override;
+
+protected:
+
+
+  bool skipModule(Module &M) const;
+};
+
+
+
+
+
+
+class ImmutablePass : public ModulePass {
+public:
+  explicit ImmutablePass(char &pid) : ModulePass(pid) {}
+
+
+  ~ImmutablePass() override;
+
+
+
+
+
+
+  virtual void initializePass();
+
+  ImmutablePass *getAsImmutablePass() override { return this; }
+
+
+  bool runOnModule(Module &) override { return false; }
+};
+class FunctionPass : public Pass {
+public:
+  explicit FunctionPass(char &pid) : Pass(PT_Function, pid) {}
+
+
+  Pass *createPrinterPass(raw_ostream &OS,
+                          const std::string &Banner) const override;
+
+
+
+  virtual bool runOnFunction(Function &F) = 0;
+
+  void assignPassManager(PMStack &PMS, PassManagerType T) override;
+
+
+  PassManagerType getPotentialPassManagerType() const override;
+
+protected:
+
+
+
+  bool skipFunction(const Function &F) const;
+};
+class BasicBlockPass : public Pass {
+public:
+  explicit BasicBlockPass(char &pid) : Pass(PT_BasicBlock, pid) {}
+
+
+  Pass *createPrinterPass(raw_ostream &OS,
+                          const std::string &Banner) const override;
+
+  using llvm::Pass::doInitialization;
+  using llvm::Pass::doFinalization;
+
+
+
+  virtual bool doInitialization(Function &);
+
+
+
+  virtual bool runOnBasicBlock(BasicBlock &BB) = 0;
+
+
+
+  virtual bool doFinalization(Function &);
+
+  void assignPassManager(PMStack &PMS, PassManagerType T) override;
+
+
+  PassManagerType getPotentialPassManagerType() const override;
+
+protected:
+
+
+
+  bool skipBasicBlock(const BasicBlock &BB) const;
+};
+
+
+
+
+extern bool TimePassesIsEnabled;
+
+
+
+
+extern bool isFunctionInPrintList(StringRef FunctionName);
+
+
+
+
+
+extern bool forcePrintModuleIR();
+
+}
+
+
+
+namespace llvm {
+
+class PassRegistry;
+
+
+void initializeCore(PassRegistry&);
+
+
+void initializeTransformUtils(PassRegistry&);
+
+
+void initializeScalarOpts(PassRegistry&);
+
+
+void initializeObjCARCOpts(PassRegistry&);
+
+
+void initializeVectorization(PassRegistry&);
+
+
+void initializeInstCombine(PassRegistry&);
+
+
+void initializeIPO(PassRegistry&);
+
+
+void initializeInstrumentation(PassRegistry&);
+
+
+void initializeAnalysis(PassRegistry&);
+
+
+void initializeCoroutines(PassRegistry&);
+
+
+void initializeCodeGen(PassRegistry&);
+
+
+void initializeGlobalISel(PassRegistry&);
+
+
+void initializeTarget(PassRegistry&);
+
+void initializeAAEvalLegacyPassPass(PassRegistry&);
+void initializeAAResultsWrapperPassPass(PassRegistry&);
+void initializeADCELegacyPassPass(PassRegistry&);
+void initializeAddDiscriminatorsLegacyPassPass(PassRegistry&);
+void initializeAddressSanitizerModulePass(PassRegistry&);
+void initializeAddressSanitizerPass(PassRegistry&);
+void initializeAliasSetPrinterPass(PassRegistry&);
+void initializeAlignmentFromAssumptionsPass(PassRegistry&);
+void initializeAlwaysInlinerLegacyPassPass(PassRegistry&);
+void initializeArgPromotionPass(PassRegistry&);
+void initializeAssumptionCacheTrackerPass(PassRegistry&);
+void initializeAtomicExpandPass(PassRegistry&);
+void initializeBDCELegacyPassPass(PassRegistry&);
+void initializeBarrierNoopPass(PassRegistry&);
+void initializeBasicAAWrapperPassPass(PassRegistry&);
+void initializeBlockExtractorPassPass(PassRegistry&);
+void initializeBlockFrequencyInfoWrapperPassPass(PassRegistry&);
+void initializeBoundsCheckingLegacyPassPass(PassRegistry&);
+void initializeBranchFolderPassPass(PassRegistry&);
+void initializeBranchProbabilityInfoWrapperPassPass(PassRegistry&);
+void initializeBranchRelaxationPass(PassRegistry&);
+void initializeBreakCriticalEdgesPass(PassRegistry&);
+void initializeCallSiteSplittingLegacyPassPass(PassRegistry&);
+void initializeCFGOnlyPrinterLegacyPassPass(PassRegistry&);
+void initializeCFGOnlyViewerLegacyPassPass(PassRegistry&);
+void initializeCFGPrinterLegacyPassPass(PassRegistry&);
+void initializeCFGSimplifyPassPass(PassRegistry&);
+void initializeCFGViewerLegacyPassPass(PassRegistry&);
+void initializeCFLAndersAAWrapperPassPass(PassRegistry&);
+void initializeCFLSteensAAWrapperPassPass(PassRegistry&);
+void initializeCallGraphDOTPrinterPass(PassRegistry&);
+void initializeCallGraphPrinterLegacyPassPass(PassRegistry&);
+void initializeCallGraphViewerPass(PassRegistry&);
+void initializeCallGraphWrapperPassPass(PassRegistry&);
+void initializeCodeGenPreparePass(PassRegistry&);
+void initializeConstantHoistingLegacyPassPass(PassRegistry&);
+void initializeCalledValuePropagationLegacyPassPass(PassRegistry &);
+void initializeConstantMergeLegacyPassPass(PassRegistry&);
+void initializeConstantPropagationPass(PassRegistry&);
+void initializeCorrelatedValuePropagationPass(PassRegistry&);
+void initializeCostModelAnalysisPass(PassRegistry&);
+void initializeEntryExitInstrumenterPass(PassRegistry&);
+void initializePostInlineEntryExitInstrumenterPass(PassRegistry&);
+void initializeCrossDSOCFIPass(PassRegistry&);
+void initializeDAEPass(PassRegistry&);
+void initializeDAHPass(PassRegistry&);
+void initializeDCELegacyPassPass(PassRegistry&);
+void initializeDSELegacyPassPass(PassRegistry&);
+void initializeDataFlowSanitizerPass(PassRegistry&);
+void initializeDeadInstEliminationPass(PassRegistry&);
+void initializeDeadMachineInstructionElimPass(PassRegistry&);
+void initializeDelinearizationPass(PassRegistry&);
+void initializeDemandedBitsWrapperPassPass(PassRegistry&);
+void initializeDependenceAnalysisPass(PassRegistry&);
+void initializeDependenceAnalysisWrapperPassPass(PassRegistry&);
+void initializeDetectDeadLanesPass(PassRegistry&);
+void initializeDivergenceAnalysisPass(PassRegistry&);
+void initializeDivRemPairsLegacyPassPass(PassRegistry&);
+void initializeDomOnlyPrinterPass(PassRegistry&);
+void initializeDomOnlyViewerPass(PassRegistry&);
+void initializeDomPrinterPass(PassRegistry&);
+void initializeDomViewerPass(PassRegistry&);
+void initializeDominanceFrontierWrapperPassPass(PassRegistry&);
+void initializeDominatorTreeWrapperPassPass(PassRegistry&);
+void initializeDwarfEHPreparePass(PassRegistry&);
+void initializeEarlyCSELegacyPassPass(PassRegistry&);
+void initializeEarlyCSEMemSSALegacyPassPass(PassRegistry&);
+void initializeEarlyIfConverterPass(PassRegistry&);
+void initializeEdgeBundlesPass(PassRegistry&);
+void initializeEfficiencySanitizerPass(PassRegistry&);
+void initializeEliminateAvailableExternallyLegacyPassPass(PassRegistry&);
+void initializeExpandISelPseudosPass(PassRegistry&);
+void initializeExpandMemCmpPassPass(PassRegistry&);
+void initializeExpandPostRAPass(PassRegistry&);
+void initializeExpandReductionsPass(PassRegistry&);
+void initializeExternalAAWrapperPassPass(PassRegistry&);
+void initializeFEntryInserterPass(PassRegistry&);
+void initializeFinalizeMachineBundlesPass(PassRegistry&);
+void initializeFlattenCFGPassPass(PassRegistry&);
+void initializeFloat2IntLegacyPassPass(PassRegistry&);
+void initializeForceFunctionAttrsLegacyPassPass(PassRegistry&);
+void initializeForwardControlFlowIntegrityPass(PassRegistry&);
+void initializeFuncletLayoutPass(PassRegistry&);
+void initializeFunctionImportLegacyPassPass(PassRegistry&);
+void initializeGCMachineCodeAnalysisPass(PassRegistry&);
+void initializeGCModuleInfoPass(PassRegistry&);
+void initializeGCOVProfilerLegacyPassPass(PassRegistry&);
+void initializeGVNHoistLegacyPassPass(PassRegistry&);
+void initializeGVNLegacyPassPass(PassRegistry&);
+void initializeGVNSinkLegacyPassPass(PassRegistry&);
+void initializeGlobalDCELegacyPassPass(PassRegistry&);
+void initializeGlobalMergePass(PassRegistry&);
+void initializeGlobalOptLegacyPassPass(PassRegistry&);
+void initializeGlobalSplitPass(PassRegistry&);
+void initializeGlobalsAAWrapperPassPass(PassRegistry&);
+void initializeGuardWideningLegacyPassPass(PassRegistry&);
+void initializeIPCPPass(PassRegistry&);
+void initializeIPSCCPLegacyPassPass(PassRegistry&);
+void initializeIRTranslatorPass(PassRegistry&);
+void initializeIVUsersWrapperPassPass(PassRegistry&);
+void initializeIfConverterPass(PassRegistry&);
+void initializeImplicitNullChecksPass(PassRegistry&);
+void initializeIndVarSimplifyLegacyPassPass(PassRegistry&);
+void initializeInductiveRangeCheckEliminationPass(PassRegistry&);
+void initializeInferAddressSpacesPass(PassRegistry&);
+void initializeInferFunctionAttrsLegacyPassPass(PassRegistry&);
+void initializeInlineCostAnalysisPass(PassRegistry&);
+void initializeInstCountPass(PassRegistry&);
+void initializeInstNamerPass(PassRegistry&);
+void initializeInstSimplifierPass(PassRegistry&);
+void initializeInstrProfilingLegacyPassPass(PassRegistry&);
+void initializeInstructionCombiningPassPass(PassRegistry&);
+void initializeInstructionSelectPass(PassRegistry&);
+void initializeInterleavedAccessPass(PassRegistry&);
+void initializeInternalizeLegacyPassPass(PassRegistry&);
+void initializeIntervalPartitionPass(PassRegistry&);
+void initializeJumpThreadingPass(PassRegistry&);
+void initializeLCSSAVerificationPassPass(PassRegistry&);
+void initializeLCSSAWrapperPassPass(PassRegistry&);
+void initializeLazyBlockFrequencyInfoPassPass(PassRegistry&);
+void initializeLazyBranchProbabilityInfoPassPass(PassRegistry&);
+void initializeLazyMachineBlockFrequencyInfoPassPass(PassRegistry&);
+void initializeLazyValueInfoPrinterPass(PassRegistry&);
+void initializeLazyValueInfoWrapperPassPass(PassRegistry&);
+void initializeLegacyLICMPassPass(PassRegistry&);
+void initializeLegacyLoopSinkPassPass(PassRegistry&);
+void initializeLegalizerPass(PassRegistry&);
+void initializeLibCallsShrinkWrapLegacyPassPass(PassRegistry&);
+void initializeLintPass(PassRegistry&);
+void initializeLiveDebugValuesPass(PassRegistry&);
+void initializeLiveDebugVariablesPass(PassRegistry&);
+void initializeLiveIntervalsPass(PassRegistry&);
+void initializeLiveRangeShrinkPass(PassRegistry&);
+void initializeLiveRegMatrixPass(PassRegistry&);
+void initializeLiveStacksPass(PassRegistry&);
+void initializeLiveVariablesPass(PassRegistry&);
+void initializeLoadStoreVectorizerPass(PassRegistry&);
+void initializeLoaderPassPass(PassRegistry&);
+void initializeLocalStackSlotPassPass(PassRegistry&);
+void initializeLocalizerPass(PassRegistry&);
+void initializeLoopAccessLegacyAnalysisPass(PassRegistry&);
+void initializeLoopDataPrefetchLegacyPassPass(PassRegistry&);
+void initializeLoopDeletionLegacyPassPass(PassRegistry&);
+void initializeLoopDistributeLegacyPass(PassRegistry&);
+void initializeLoopExtractorPass(PassRegistry&);
+void initializeLoopIdiomRecognizeLegacyPassPass(PassRegistry&);
+void initializeLoopInfoWrapperPassPass(PassRegistry&);
+void initializeLoopInstSimplifyLegacyPassPass(PassRegistry&);
+void initializeLoopInterchangePass(PassRegistry&);
+void initializeLoopLoadEliminationPass(PassRegistry&);
+void initializeLoopPassPass(PassRegistry&);
+void initializeLoopPredicationLegacyPassPass(PassRegistry&);
+void initializeLoopRerollPass(PassRegistry&);
+void initializeLoopRotateLegacyPassPass(PassRegistry&);
+void initializeLoopSimplifyCFGLegacyPassPass(PassRegistry&);
+void initializeLoopSimplifyPass(PassRegistry&);
+void initializeLoopStrengthReducePass(PassRegistry&);
+void initializeLoopUnrollPass(PassRegistry&);
+void initializeLoopUnswitchPass(PassRegistry&);
+void initializeLoopVectorizePass(PassRegistry&);
+void initializeLoopVersioningLICMPass(PassRegistry&);
+void initializeLoopVersioningPassPass(PassRegistry&);
+void initializeLowerAtomicLegacyPassPass(PassRegistry&);
+void initializeLowerEmuTLSPass(PassRegistry&);
+void initializeLowerExpectIntrinsicPass(PassRegistry&);
+void initializeLowerGuardIntrinsicLegacyPassPass(PassRegistry&);
+void initializeLowerIntrinsicsPass(PassRegistry&);
+void initializeLowerInvokeLegacyPassPass(PassRegistry&);
+void initializeLowerSwitchPass(PassRegistry&);
+void initializeLowerTypeTestsPass(PassRegistry&);
+void initializeMIRPrintingPassPass(PassRegistry&);
+void initializeMachineBlockFrequencyInfoPass(PassRegistry&);
+void initializeMachineBlockPlacementPass(PassRegistry&);
+void initializeMachineBlockPlacementStatsPass(PassRegistry&);
+void initializeMachineBranchProbabilityInfoPass(PassRegistry&);
+void initializeMachineCSEPass(PassRegistry&);
+void initializeMachineCombinerPass(PassRegistry&);
+void initializeMachineCopyPropagationPass(PassRegistry&);
+void initializeMachineDominanceFrontierPass(PassRegistry&);
+void initializeMachineDominatorTreePass(PassRegistry&);
+void initializeMachineFunctionPrinterPassPass(PassRegistry&);
+void initializeMachineLICMPass(PassRegistry&);
+void initializeMachineLoopInfoPass(PassRegistry&);
+void initializeMachineModuleInfoPass(PassRegistry&);
+void initializeMachineOptimizationRemarkEmitterPassPass(PassRegistry&);
+void initializeMachineOutlinerPass(PassRegistry&);
+void initializeMachinePipelinerPass(PassRegistry&);
+void initializeMachinePostDominatorTreePass(PassRegistry&);
+void initializeMachineRegionInfoPassPass(PassRegistry&);
+void initializeMachineSchedulerPass(PassRegistry&);
+void initializeMachineSinkingPass(PassRegistry&);
+void initializeMachineTraceMetricsPass(PassRegistry&);
+void initializeMachineVerifierPassPass(PassRegistry&);
+void initializeMemCpyOptLegacyPassPass(PassRegistry&);
+void initializeMemDepPrinterPass(PassRegistry&);
+void initializeMemDerefPrinterPass(PassRegistry&);
+void initializeMemoryDependenceWrapperPassPass(PassRegistry&);
+void initializeMemorySSAPrinterLegacyPassPass(PassRegistry&);
+void initializeMemorySSAWrapperPassPass(PassRegistry&);
+void initializeMemorySanitizerPass(PassRegistry&);
+void initializeMergeFunctionsPass(PassRegistry&);
+void initializeMergeICmpsPass(PassRegistry&);
+void initializeMergedLoadStoreMotionLegacyPassPass(PassRegistry&);
+void initializeMetaRenamerPass(PassRegistry&);
+void initializeModuleDebugInfoPrinterPass(PassRegistry&);
+void initializeModuleSummaryIndexWrapperPassPass(PassRegistry&);
+void initializeNameAnonGlobalLegacyPassPass(PassRegistry&);
+void initializeNaryReassociateLegacyPassPass(PassRegistry&);
+void initializeNewGVNLegacyPassPass(PassRegistry&);
+void initializeObjCARCAAWrapperPassPass(PassRegistry&);
+void initializeObjCARCAPElimPass(PassRegistry&);
+void initializeObjCARCContractPass(PassRegistry&);
+void initializeObjCARCExpandPass(PassRegistry&);
+void initializeObjCARCOptPass(PassRegistry&);
+void initializeOptimizationRemarkEmitterWrapperPassPass(PassRegistry&);
+void initializeOptimizePHIsPass(PassRegistry&);
+void initializePAEvalPass(PassRegistry&);
+void initializePEIPass(PassRegistry&);
+void initializePGOIndirectCallPromotionLegacyPassPass(PassRegistry&);
+void initializePGOInstrumentationGenLegacyPassPass(PassRegistry&);
+void initializePGOInstrumentationUseLegacyPassPass(PassRegistry&);
+void initializePGOMemOPSizeOptLegacyPassPass(PassRegistry&);
+void initializePHIEliminationPass(PassRegistry&);
+void initializePartialInlinerLegacyPassPass(PassRegistry&);
+void initializePartiallyInlineLibCallsLegacyPassPass(PassRegistry&);
+void initializePatchableFunctionPass(PassRegistry&);
+void initializePeepholeOptimizerPass(PassRegistry&);
+void initializePhysicalRegisterUsageInfoPass(PassRegistry&);
+void initializePlaceBackedgeSafepointsImplPass(PassRegistry&);
+void initializePlaceSafepointsPass(PassRegistry&);
+void initializePostDomOnlyPrinterPass(PassRegistry&);
+void initializePostDomOnlyViewerPass(PassRegistry&);
+void initializePostDomPrinterPass(PassRegistry&);
+void initializePostDomViewerPass(PassRegistry&);
+void initializePostDominatorTreeWrapperPassPass(PassRegistry&);
+void initializePostMachineSchedulerPass(PassRegistry&);
+void initializePostOrderFunctionAttrsLegacyPassPass(PassRegistry&);
+void initializePostRAHazardRecognizerPass(PassRegistry&);
+void initializePostRASchedulerPass(PassRegistry&);
+void initializePreISelIntrinsicLoweringLegacyPassPass(PassRegistry&);
+void initializePredicateInfoPrinterLegacyPassPass(PassRegistry&);
+void initializePrintBasicBlockPassPass(PassRegistry&);
+void initializePrintFunctionPassWrapperPass(PassRegistry&);
+void initializePrintModulePassWrapperPass(PassRegistry&);
+void initializeProcessImplicitDefsPass(PassRegistry&);
+void initializeProfileSummaryInfoWrapperPassPass(PassRegistry&);
+void initializePromoteLegacyPassPass(PassRegistry&);
+void initializePruneEHPass(PassRegistry&);
+void initializeRABasicPass(PassRegistry&);
+void initializeRegAllocFastPass(PassRegistry&);
+void initializeRAGreedyPass(PassRegistry&);
+void initializeReassociateLegacyPassPass(PassRegistry&);
+void initializeRegBankSelectPass(PassRegistry&);
+void initializeRegToMemPass(PassRegistry&);
+void initializeRegionInfoPassPass(PassRegistry&);
+void initializeRegionOnlyPrinterPass(PassRegistry&);
+void initializeRegionOnlyViewerPass(PassRegistry&);
+void initializeRegionPrinterPass(PassRegistry&);
+void initializeRegionViewerPass(PassRegistry&);
+void initializeRegisterCoalescerPass(PassRegistry&);
+void initializeRenameIndependentSubregsPass(PassRegistry&);
+void initializeResetMachineFunctionPass(PassRegistry&);
+void initializeReversePostOrderFunctionAttrsLegacyPassPass(PassRegistry&);
+void initializeRewriteStatepointsForGCLegacyPassPass(PassRegistry &);
+void initializeRewriteSymbolsLegacyPassPass(PassRegistry&);
+void initializeSafepointIRVerifierPass(PassRegistry&);
+void initializeSCCPLegacyPassPass(PassRegistry&);
+void initializeSCEVAAWrapperPassPass(PassRegistry&);
+void initializeSLPVectorizerPass(PassRegistry&);
+void initializeSROALegacyPassPass(PassRegistry&);
+void initializeSafeStackLegacyPassPass(PassRegistry&);
+void initializeSampleProfileLoaderLegacyPassPass(PassRegistry&);
+void initializeSanitizerCoverageModulePass(PassRegistry&);
+void initializeScalarEvolutionWrapperPassPass(PassRegistry&);
+void initializeScalarizeMaskedMemIntrinPass(PassRegistry&);
+void initializeScalarizerPass(PassRegistry&);
+void initializeScavengerTestPass(PassRegistry&);
+void initializeScopedNoAliasAAWrapperPassPass(PassRegistry&);
+void initializeSeparateConstOffsetFromGEPPass(PassRegistry&);
+void initializeShadowStackGCLoweringPass(PassRegistry&);
+void initializeShrinkWrapPass(PassRegistry&);
+void initializeSimpleInlinerPass(PassRegistry&);
+void initializeSimpleLoopUnswitchLegacyPassPass(PassRegistry&);
+void initializeSingleLoopExtractorPass(PassRegistry&);
+void initializeSinkingLegacyPassPass(PassRegistry&);
+void initializeSjLjEHPreparePass(PassRegistry&);
+void initializeSlotIndexesPass(PassRegistry&);
+void initializeSpeculativeExecutionLegacyPassPass(PassRegistry&);
+void initializeSpillPlacementPass(PassRegistry&);
+void initializeStackColoringPass(PassRegistry&);
+void initializeStackMapLivenessPass(PassRegistry&);
+void initializeStackProtectorPass(PassRegistry&);
+void initializeStackSlotColoringPass(PassRegistry&);
+void initializeStraightLineStrengthReducePass(PassRegistry&);
+void initializeStripDeadDebugInfoPass(PassRegistry&);
+void initializeStripDeadPrototypesLegacyPassPass(PassRegistry&);
+void initializeStripDebugDeclarePass(PassRegistry&);
+void initializeStripGCRelocatesPass(PassRegistry&);
+void initializeStripNonDebugSymbolsPass(PassRegistry&);
+void initializeStripNonLineTableDebugInfoPass(PassRegistry&);
+void initializeStripSymbolsPass(PassRegistry&);
+void initializeStructurizeCFGPass(PassRegistry&);
+void initializeHWAddressSanitizerPass(PassRegistry&);
+void initializeTailCallElimPass(PassRegistry&);
+void initializeTailDuplicatePassPass(PassRegistry&);
+void initializeTargetLibraryInfoWrapperPassPass(PassRegistry&);
+void initializeTargetPassConfigPass(PassRegistry&);
+void initializeTargetTransformInfoWrapperPassPass(PassRegistry&);
+void initializeThreadSanitizerPass(PassRegistry&);
+void initializeTwoAddressInstructionPassPass(PassRegistry&);
+void initializeTypeBasedAAWrapperPassPass(PassRegistry&);
+void initializeUnifyFunctionExitNodesPass(PassRegistry&);
+void initializeUnpackMachineBundlesPass(PassRegistry&);
+void initializeUnreachableBlockElimLegacyPassPass(PassRegistry&);
+void initializeUnreachableMachineBlockElimPass(PassRegistry&);
+void initializeVerifierLegacyPassPass(PassRegistry&);
+void initializeVirtRegMapPass(PassRegistry&);
+void initializeVirtRegRewriterPass(PassRegistry&);
+void initializeWholeProgramDevirtPass(PassRegistry&);
+void initializeWinEHPreparePass(PassRegistry&);
+void initializeWriteBitcodePassPass(PassRegistry&);
+void initializeWriteThinLTOBitcodePass(PassRegistry&);
+void initializeXRayInstrumentationPass(PassRegistry&);
+void initializeMIRCanonicalizerPass(PassRegistry &);
+
+}
+
+
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+namespace llvm {
+
+class Function;
+class Pass;
+class PMDataManager;
+class AnalysisUsage {
+public:
+  using VectorType = SmallVectorImpl<AnalysisID>;
+
+private:
+
+
+
+
+  SmallVector<AnalysisID, 8> Required;
+  SmallVector<AnalysisID, 2> RequiredTransitive;
+  SmallVector<AnalysisID, 2> Preserved;
+  SmallVector<AnalysisID, 0> Used;
+  bool PreservesAll = false;
+
+public:
+  AnalysisUsage() = default;
+
+
+
+  AnalysisUsage &addRequiredID(const void *ID);
+  AnalysisUsage &addRequiredID(char &ID);
+  template<class PassClass>
+  AnalysisUsage &addRequired() {
+    return addRequiredID(PassClass::ID);
+  }
+
+  AnalysisUsage &addRequiredTransitiveID(char &ID);
+  template<class PassClass>
+  AnalysisUsage &addRequiredTransitive() {
+    return addRequiredTransitiveID(PassClass::ID);
+  }
+
+
+
+
+  AnalysisUsage &addPreservedID(const void *ID) {
+    Preserved.push_back(ID);
+    return *this;
+  }
+  AnalysisUsage &addPreservedID(char &ID) {
+    Preserved.push_back(&ID);
+    return *this;
+  }
+
+  template<class PassClass>
+  AnalysisUsage &addPreserved() {
+    Preserved.push_back(&PassClass::ID);
+    return *this;
+  }
+
+
+
+
+
+  AnalysisUsage &addUsedIfAvailableID(const void *ID) {
+    Used.push_back(ID);
+    return *this;
+  }
+  AnalysisUsage &addUsedIfAvailableID(char &ID) {
+    Used.push_back(&ID);
+    return *this;
+  }
+
+  template<class PassClass>
+  AnalysisUsage &addUsedIfAvailable() {
+    Used.push_back(&PassClass::ID);
+    return *this;
+  }
+
+
+
+
+
+
+  AnalysisUsage &addPreserved(StringRef Arg);
+
+
+  void setPreservesAll() { PreservesAll = true; }
+
+
+  bool getPreservesAll() const { return PreservesAll; }
+  void setPreservesCFG();
+
+  const VectorType &getRequiredSet() const { return Required; }
+  const VectorType &getRequiredTransitiveSet() const {
+    return RequiredTransitive;
+  }
+  const VectorType &getPreservedSet() const { return Preserved; }
+  const VectorType &getUsedSet() const { return Used; }
+};
+
+
+
+
+
+
+class AnalysisResolver {
+public:
+  AnalysisResolver() = delete;
+  explicit AnalysisResolver(PMDataManager &P) : PM(P) {}
+
+  PMDataManager &getPMDataManager() { return PM; }
+
+
+  Pass *findImplPass(AnalysisID PI) {
+    Pass *ResultPass = nullptr;
+    for (const auto &AnalysisImpl : AnalysisImpls) {
+      if (AnalysisImpl.first == PI) {
+        ResultPass = AnalysisImpl.second;
+        break;
+      }
+    }
+    return ResultPass;
+  }
+
+
+  Pass *findImplPass(Pass *P, AnalysisID PI, Function &F);
+
+  void addAnalysisImplsPair(AnalysisID PI, Pass *P) {
+    if (findImplPass(PI) == P)
+      return;
+    std::pair<AnalysisID, Pass*> pir = std::make_pair(PI,P);
+    AnalysisImpls.push_back(pir);
+  }
+
+
+  void clearAnalysisImpls() {
+    AnalysisImpls.clear();
+  }
+
+
+  Pass *getAnalysisIfAvailable(AnalysisID ID, bool Direction) const;
+
+private:
+
+
+  std::vector<std::pair<AnalysisID, Pass *>> AnalysisImpls;
+
+
+  PMDataManager &PM;
+};
+template<typename AnalysisType>
+AnalysisType *Pass::getAnalysisIfAvailable() const {
+  
+ ((
+ Resolver && "Pass not resident in a PassManager object!"
+ ) ? static_cast<void> (0) : __assert_fail (
+ "Resolver && \"Pass not resident in a PassManager object!\""
+ , "/home/trippels/llvm/llvm/include/llvm/PassAnalysisSupport.h", 203, __PRETTY_FUNCTION__))
+                                                                 ;
+
+  const void *PI = &AnalysisType::ID;
+
+  Pass *ResultPass = Resolver->getAnalysisIfAvailable(PI, true);
+  if (!ResultPass) return nullptr;
+
+
+
+
+
+  return (AnalysisType*)ResultPass->getAdjustedAnalysisPointer(PI);
+}
+
+
+
+
+template<typename AnalysisType>
+AnalysisType &Pass::getAnalysis() const {
+  
+ ((
+ Resolver && "Pass has not been inserted into a PassManager object!"
+ ) ? static_cast<void> (0) : __assert_fail (
+ "Resolver && \"Pass has not been inserted into a PassManager object!\""
+ , "/home/trippels/llvm/llvm/include/llvm/PassAnalysisSupport.h", 222, __PRETTY_FUNCTION__))
+                                                                            ;
+  return getAnalysisID<AnalysisType>(&AnalysisType::ID);
+}
+
+template<typename AnalysisType>
+AnalysisType &Pass::getAnalysisID(AnalysisID PI) const {
+  
+ ((
+ PI && "getAnalysis for unregistered pass!"
+ ) ? static_cast<void> (0) : __assert_fail (
+ "PI && \"getAnalysis for unregistered pass!\""
+ , "/home/trippels/llvm/llvm/include/llvm/PassAnalysisSupport.h", 228, __PRETTY_FUNCTION__))
+                                                   ;
+  
+ ((
+ Resolver&&"Pass has not been inserted into a PassManager object!"
+ ) ? static_cast<void> (0) : __assert_fail (
+ "Resolver&&\"Pass has not been inserted into a PassManager object!\""
+ , "/home/trippels/llvm/llvm/include/llvm/PassAnalysisSupport.h", 229, __PRETTY_FUNCTION__))
+                                                                          ;
+
+
+
+  Pass *ResultPass = Resolver->findImplPass(PI);
+  
+ ((
+ ResultPass && "getAnalysis*() called on an analysis that was not " "'required' by pass!"
+ ) ? static_cast<void> (0) : __assert_fail (
+ "ResultPass && \"getAnalysis*() called on an analysis that was not \" \"'required' by pass!\""
+ ,
+
+                              "/home/trippels/llvm/llvm/include/llvm/PassAnalysisSupport.h"
+  ,
+
+                              236
+  , __PRETTY_FUNCTION__))
+
+                               
+                              ;
+
+
+
+
+
+  return *(AnalysisType*)ResultPass->getAdjustedAnalysisPointer(PI);
+}
+
+
+
+
+template<typename AnalysisType>
+AnalysisType &Pass::getAnalysis(Function &F) {
+  
+ ((
+ Resolver &&"Pass has not been inserted into a PassManager object!"
+ ) ? static_cast<void> (0) : __assert_fail (
+ "Resolver &&\"Pass has not been inserted into a PassManager object!\""
+ , "/home/trippels/llvm/llvm/include/llvm/PassAnalysisSupport.h", 250, __PRETTY_FUNCTION__))
+                                                                           ;
+
+  return getAnalysisID<AnalysisType>(&AnalysisType::ID, F);
+}
+
+template<typename AnalysisType>
+AnalysisType &Pass::getAnalysisID(AnalysisID PI, Function &F) {
+  
+ ((
+ PI && "getAnalysis for unregistered pass!"
+ ) ? static_cast<void> (0) : __assert_fail (
+ "PI && \"getAnalysis for unregistered pass!\""
+ , "/home/trippels/llvm/llvm/include/llvm/PassAnalysisSupport.h", 257, __PRETTY_FUNCTION__))
+                                                   ;
+  
+ ((
+ Resolver && "Pass has not been inserted into a PassManager object!"
+ ) ? static_cast<void> (0) : __assert_fail (
+ "Resolver && \"Pass has not been inserted into a PassManager object!\""
+ , "/home/trippels/llvm/llvm/include/llvm/PassAnalysisSupport.h", 258, __PRETTY_FUNCTION__))
+                                                                            ;
+
+
+
+  Pass *ResultPass = Resolver->findImplPass(this, PI, F);
+  
+ ((
+ ResultPass && "Unable to find requested analysis info"
+ ) ? static_cast<void> (0) : __assert_fail (
+ "ResultPass && \"Unable to find requested analysis info\""
+ , "/home/trippels/llvm/llvm/include/llvm/PassAnalysisSupport.h", 263, __PRETTY_FUNCTION__))
+                                                               ;
+
+
+
+
+
+  return *(AnalysisType*)ResultPass->getAdjustedAnalysisPointer(PI);
+}
+
+}
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+namespace llvm {
+
+class Pass;
+
+
+
+
+
+
+
+class PassInfo {
+public:
+  using NormalCtor_t = Pass* (*)();
+
+private:
+  StringRef PassName;
+  StringRef PassArgument;
+  const void *PassID;
+  const bool IsCFGOnlyPass = false;
+  const bool IsAnalysis;
+  const bool IsAnalysisGroup;
+  std::vector<const PassInfo *> ItfImpl;
+  NormalCtor_t NormalCtor = nullptr;
+
+public:
+
+
+  PassInfo(StringRef name, StringRef arg, const void *pi, NormalCtor_t normal,
+           bool isCFGOnly, bool is_analysis)
+      : PassName(name), PassArgument(arg), PassID(pi), IsCFGOnlyPass(isCFGOnly),
+        IsAnalysis(is_analysis), IsAnalysisGroup(false), NormalCtor(normal) {}
+
+
+
+
+  PassInfo(StringRef name, const void *pi)
+      : PassName(name), PassID(pi), IsAnalysis(false), IsAnalysisGroup(true) {}
+
+  PassInfo(const PassInfo &) = delete;
+  PassInfo &operator=(const PassInfo &) = delete;
+
+
+  StringRef getPassName() const { return PassName; }
+
+
+
+
+  StringRef getPassArgument() const { return PassArgument; }
+
+
+
+  const void *getTypeInfo() const { return PassID; }
+
+
+  bool isPassID(const void *IDPtr) const { return PassID == IDPtr; }
+
+
+
+  bool isAnalysisGroup() const { return IsAnalysisGroup; }
+  bool isAnalysis() const { return IsAnalysis; }
+
+
+
+  bool isCFGOnlyPass() const { return IsCFGOnlyPass; }
+
+
+
+
+  NormalCtor_t getNormalCtor() const {
+    return NormalCtor;
+  }
+  void setNormalCtor(NormalCtor_t Ctor) {
+    NormalCtor = Ctor;
+  }
+
+
+  Pass *createPass() const {
+    
+   ((
+   (!isAnalysisGroup() || NormalCtor) && "No default implementation found for analysis group!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "(!isAnalysisGroup() || NormalCtor) && \"No default implementation found for analysis group!\""
+   ,
+                                                                "/home/trippels/llvm/llvm/include/llvm/PassInfo.h"
+    ,
+                                                                99
+    , __PRETTY_FUNCTION__))
+                                                                 
+                                                                ;
+    
+   ((
+   NormalCtor && "Cannot call createPass on PassInfo without default ctor!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "NormalCtor && \"Cannot call createPass on PassInfo without default ctor!\""
+   ,
+                                                                     "/home/trippels/llvm/llvm/include/llvm/PassInfo.h"
+    ,
+                                                                     101
+    , __PRETTY_FUNCTION__))
+                                                                      
+                                                                     ;
+    return NormalCtor();
+  }
+
+
+
+
+  void addInterfaceImplemented(const PassInfo *ItfPI) {
+    ItfImpl.push_back(ItfPI);
+  }
+
+
+
+  const std::vector<const PassInfo*> &getInterfacesImplemented() const {
+    return ItfImpl;
+  }
+};
+
+}
+       
+       
+
+
+
+
+
+
+       
+
+
+
+
+
+       
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+  template<intmax_t _Pn>
+    struct __static_sign
+    : integral_constant<intmax_t, (_Pn < 0) ? -1 : 1>
+    { };
+
+  template<intmax_t _Pn>
+    struct __static_abs
+    : integral_constant<intmax_t, _Pn * __static_sign<_Pn>::value>
+    { };
+
+  template<intmax_t _Pn, intmax_t _Qn>
+    struct __static_gcd
+    : __static_gcd<_Qn, (_Pn % _Qn)>
+    { };
+
+  template<intmax_t _Pn>
+    struct __static_gcd<_Pn, 0>
+    : integral_constant<intmax_t, __static_abs<_Pn>::value>
+    { };
+
+  template<intmax_t _Qn>
+    struct __static_gcd<0, _Qn>
+    : integral_constant<intmax_t, __static_abs<_Qn>::value>
+    { };
+
+
+
+
+
+
+
+  template<intmax_t _Pn, intmax_t _Qn>
+    struct __safe_multiply
+    {
+    private:
+      static const uintmax_t __c = uintmax_t(1) << (sizeof(intmax_t) * 4);
+
+      static const uintmax_t __a0 = __static_abs<_Pn>::value % __c;
+      static const uintmax_t __a1 = __static_abs<_Pn>::value / __c;
+      static const uintmax_t __b0 = __static_abs<_Qn>::value % __c;
+      static const uintmax_t __b1 = __static_abs<_Qn>::value / __c;
+
+      static_assert(__a1 == 0 || __b1 == 0,
+      "overflow in multiplication");
+      static_assert(__a0 * __b1 + __b0 * __a1 < (__c >> 1),
+      "overflow in multiplication");
+      static_assert(__b0 * __a0 <= 0x7fffffffffffffffL,
+      "overflow in multiplication");
+      static_assert((__a0 * __b1 + __b0 * __a1) * __c
+      <= 0x7fffffffffffffffL - __b0 * __a0,
+      "overflow in multiplication");
+
+    public:
+      static const intmax_t value = _Pn * _Qn;
+    };
+
+
+
+  template<uintmax_t __hi1, uintmax_t __lo1, uintmax_t __hi2, uintmax_t __lo2>
+    struct __big_less
+    : integral_constant<bool, (__hi1 < __hi2
+          || (__hi1 == __hi2 && __lo1 < __lo2))>
+    { };
+
+  template<uintmax_t __hi1, uintmax_t __lo1, uintmax_t __hi2, uintmax_t __lo2>
+    struct __big_add
+    {
+      static constexpr uintmax_t __lo = __lo1 + __lo2;
+      static constexpr uintmax_t __hi = (__hi1 + __hi2 +
+      (__lo1 + __lo2 < __lo1));
+    };
+
+
+  template<uintmax_t __hi1, uintmax_t __lo1, uintmax_t __hi2, uintmax_t __lo2>
+    struct __big_sub
+    {
+      static_assert(!__big_less<__hi1, __lo1, __hi2, __lo2>::value,
+      "Internal library error");
+      static constexpr uintmax_t __lo = __lo1 - __lo2;
+      static constexpr uintmax_t __hi = (__hi1 - __hi2 -
+      (__lo1 < __lo2));
+    };
+
+
+  template<uintmax_t __x, uintmax_t __y>
+    struct __big_mul
+    {
+    private:
+      static constexpr uintmax_t __c = uintmax_t(1) << (sizeof(intmax_t) * 4);
+      static constexpr uintmax_t __x0 = __x % __c;
+      static constexpr uintmax_t __x1 = __x / __c;
+      static constexpr uintmax_t __y0 = __y % __c;
+      static constexpr uintmax_t __y1 = __y / __c;
+      static constexpr uintmax_t __x0y0 = __x0 * __y0;
+      static constexpr uintmax_t __x0y1 = __x0 * __y1;
+      static constexpr uintmax_t __x1y0 = __x1 * __y0;
+      static constexpr uintmax_t __x1y1 = __x1 * __y1;
+      static constexpr uintmax_t __mix = __x0y1 + __x1y0;
+      static constexpr uintmax_t __mix_lo = __mix * __c;
+      static constexpr uintmax_t __mix_hi
+      = __mix / __c + ((__mix < __x0y1) ? __c : 0);
+      typedef __big_add<__mix_hi, __mix_lo, __x1y1, __x0y0> _Res;
+    public:
+      static constexpr uintmax_t __hi = _Res::__hi;
+      static constexpr uintmax_t __lo = _Res::__lo;
+    };
+
+
+
+  template<uintmax_t __n1, uintmax_t __n0, uintmax_t __d>
+    struct __big_div_impl
+    {
+    private:
+      static_assert(__d >= (uintmax_t(1) << (sizeof(intmax_t) * 8 - 1)),
+      "Internal library error");
+      static_assert(__n1 < __d, "Internal library error");
+      static constexpr uintmax_t __c = uintmax_t(1) << (sizeof(intmax_t) * 4);
+      static constexpr uintmax_t __d1 = __d / __c;
+      static constexpr uintmax_t __d0 = __d % __c;
+
+      static constexpr uintmax_t __q1x = __n1 / __d1;
+      static constexpr uintmax_t __r1x = __n1 % __d1;
+      static constexpr uintmax_t __m = __q1x * __d0;
+      static constexpr uintmax_t __r1y = __r1x * __c + __n0 / __c;
+      static constexpr uintmax_t __r1z = __r1y + __d;
+      static constexpr uintmax_t __r1
+      = ((__r1y < __m) ? ((__r1z >= __d) && (__r1z < __m))
+  ? (__r1z + __d) : __r1z : __r1y) - __m;
+      static constexpr uintmax_t __q1
+      = __q1x - ((__r1y < __m)
+   ? ((__r1z >= __d) && (__r1z < __m)) ? 2 : 1 : 0);
+      static constexpr uintmax_t __q0x = __r1 / __d1;
+      static constexpr uintmax_t __r0x = __r1 % __d1;
+      static constexpr uintmax_t __n = __q0x * __d0;
+      static constexpr uintmax_t __r0y = __r0x * __c + __n0 % __c;
+      static constexpr uintmax_t __r0z = __r0y + __d;
+      static constexpr uintmax_t __r0
+      = ((__r0y < __n) ? ((__r0z >= __d) && (__r0z < __n))
+  ? (__r0z + __d) : __r0z : __r0y) - __n;
+      static constexpr uintmax_t __q0
+      = __q0x - ((__r0y < __n) ? ((__r0z >= __d)
+      && (__r0z < __n)) ? 2 : 1 : 0);
+
+    public:
+      static constexpr uintmax_t __quot = __q1 * __c + __q0;
+      static constexpr uintmax_t __rem = __r0;
+
+    private:
+      typedef __big_mul<__quot, __d> _Prod;
+      typedef __big_add<_Prod::__hi, _Prod::__lo, 0, __rem> _Sum;
+      static_assert(_Sum::__hi == __n1 && _Sum::__lo == __n0,
+      "Internal library error");
+  };
+
+  template<uintmax_t __n1, uintmax_t __n0, uintmax_t __d>
+    struct __big_div
+    {
+    private:
+      static_assert(__d != 0, "Internal library error");
+      static_assert(sizeof (uintmax_t) == sizeof (unsigned long long),
+      "This library calls __builtin_clzll on uintmax_t, which "
+      "is unsafe on your platform. Please complain to "
+      "http://gcc.gnu.org/bugzilla/");
+      static constexpr int __shift = __builtin_clzll(__d);
+      static constexpr int __coshift_ = sizeof(uintmax_t) * 8 - __shift;
+      static constexpr int __coshift = (__shift != 0) ? __coshift_ : 0;
+      static constexpr uintmax_t __c1 = uintmax_t(1) << __shift;
+      static constexpr uintmax_t __c2 = uintmax_t(1) << __coshift;
+      static constexpr uintmax_t __new_d = __d * __c1;
+      static constexpr uintmax_t __new_n0 = __n0 * __c1;
+      static constexpr uintmax_t __n1_shifted = (__n1 % __d) * __c1;
+      static constexpr uintmax_t __n0_top = (__shift != 0) ? (__n0 / __c2) : 0;
+      static constexpr uintmax_t __new_n1 = __n1_shifted + __n0_top;
+      typedef __big_div_impl<__new_n1, __new_n0, __new_d> _Res;
+
+    public:
+      static constexpr uintmax_t __quot_hi = __n1 / __d;
+      static constexpr uintmax_t __quot_lo = _Res::__quot;
+      static constexpr uintmax_t __rem = _Res::__rem / __c1;
+
+    private:
+      typedef __big_mul<__quot_lo, __d> _P0;
+      typedef __big_mul<__quot_hi, __d> _P1;
+      typedef __big_add<_P0::__hi, _P0::__lo, _P1::__lo, __rem> _Sum;
+
+      static_assert(_P1::__hi == 0, "Internal library error");
+      static_assert(_Sum::__hi >= _P0::__hi, "Internal library error");
+
+      static_assert(_Sum::__hi == __n1 && _Sum::__lo == __n0,
+      "Internal library error");
+      static_assert(__rem < __d, "Internal library error");
+    };
+  template<intmax_t _Num, intmax_t _Den = 1>
+    struct ratio
+    {
+      static_assert(_Den != 0, "denominator cannot be zero");
+      static_assert(_Num >= -0x7fffffffffffffffL && _Den >= -0x7fffffffffffffffL,
+      "out of range");
+
+
+      static constexpr intmax_t num =
+        _Num * __static_sign<_Den>::value / __static_gcd<_Num, _Den>::value;
+
+      static constexpr intmax_t den =
+        __static_abs<_Den>::value / __static_gcd<_Num, _Den>::value;
+
+      typedef ratio<num, den> type;
+    };
+
+  template<intmax_t _Num, intmax_t _Den>
+    constexpr intmax_t ratio<_Num, _Den>::num;
+
+  template<intmax_t _Num, intmax_t _Den>
+    constexpr intmax_t ratio<_Num, _Den>::den;
+
+  template<typename _R1, typename _R2>
+    struct __ratio_multiply
+    {
+    private:
+      static const intmax_t __gcd1 =
+        __static_gcd<_R1::num, _R2::den>::value;
+      static const intmax_t __gcd2 =
+        __static_gcd<_R2::num, _R1::den>::value;
+
+    public:
+      typedef ratio<
+        __safe_multiply<(_R1::num / __gcd1),
+                        (_R2::num / __gcd2)>::value,
+        __safe_multiply<(_R1::den / __gcd2),
+                        (_R2::den / __gcd1)>::value> type;
+
+      static constexpr intmax_t num = type::num;
+      static constexpr intmax_t den = type::den;
+    };
+
+  template<typename _R1, typename _R2>
+    constexpr intmax_t __ratio_multiply<_R1, _R2>::num;
+
+  template<typename _R1, typename _R2>
+    constexpr intmax_t __ratio_multiply<_R1, _R2>::den;
+
+
+  template<typename _R1, typename _R2>
+    using ratio_multiply = typename __ratio_multiply<_R1, _R2>::type;
+
+  template<typename _R1, typename _R2>
+    struct __ratio_divide
+    {
+      static_assert(_R2::num != 0, "division by 0");
+
+      typedef typename __ratio_multiply<
+        _R1,
+        ratio<_R2::den, _R2::num>>::type type;
+
+      static constexpr intmax_t num = type::num;
+      static constexpr intmax_t den = type::den;
+    };
+
+  template<typename _R1, typename _R2>
+    constexpr intmax_t __ratio_divide<_R1, _R2>::num;
+
+  template<typename _R1, typename _R2>
+    constexpr intmax_t __ratio_divide<_R1, _R2>::den;
+
+
+  template<typename _R1, typename _R2>
+    using ratio_divide = typename __ratio_divide<_R1, _R2>::type;
+
+
+  template<typename _R1, typename _R2>
+    struct ratio_equal
+    : integral_constant<bool, _R1::num == _R2::num && _R1::den == _R2::den>
+    { };
+
+
+  template<typename _R1, typename _R2>
+    struct ratio_not_equal
+    : integral_constant<bool, !ratio_equal<_R1, _R2>::value>
+    { };
+
+
+  template<typename _R1, typename _R2,
+           typename _Left = __big_mul<_R1::num,_R2::den>,
+           typename _Right = __big_mul<_R2::num,_R1::den> >
+    struct __ratio_less_impl_1
+    : integral_constant<bool, __big_less<_Left::__hi, _Left::__lo,
+           _Right::__hi, _Right::__lo>::value>
+    { };
+
+  template<typename _R1, typename _R2,
+    bool = (_R1::num == 0 || _R2::num == 0
+     || (__static_sign<_R1::num>::value
+         != __static_sign<_R2::num>::value)),
+    bool = (__static_sign<_R1::num>::value == -1
+     && __static_sign<_R2::num>::value == -1)>
+    struct __ratio_less_impl
+    : __ratio_less_impl_1<_R1, _R2>::type
+    { };
+
+  template<typename _R1, typename _R2>
+    struct __ratio_less_impl<_R1, _R2, true, false>
+    : integral_constant<bool, _R1::num < _R2::num>
+    { };
+
+  template<typename _R1, typename _R2>
+    struct __ratio_less_impl<_R1, _R2, false, true>
+    : __ratio_less_impl_1<ratio<-_R2::num, _R2::den>,
+           ratio<-_R1::num, _R1::den> >::type
+    { };
+
+
+  template<typename _R1, typename _R2>
+    struct ratio_less
+    : __ratio_less_impl<_R1, _R2>::type
+    { };
+
+
+  template<typename _R1, typename _R2>
+    struct ratio_less_equal
+    : integral_constant<bool, !ratio_less<_R2, _R1>::value>
+    { };
+
+
+  template<typename _R1, typename _R2>
+    struct ratio_greater
+    : integral_constant<bool, ratio_less<_R2, _R1>::value>
+    { };
+
+
+  template<typename _R1, typename _R2>
+    struct ratio_greater_equal
+    : integral_constant<bool, !ratio_less<_R1, _R2>::value>
+    { };
+  template<typename _R1, typename _R2,
+      bool = (_R1::num >= 0),
+      bool = (_R2::num >= 0),
+      bool = ratio_less<ratio<__static_abs<_R1::num>::value, _R1::den>,
+        ratio<__static_abs<_R2::num>::value, _R2::den> >::value>
+    struct __ratio_add_impl
+    {
+    private:
+      typedef typename __ratio_add_impl<
+        ratio<-_R1::num, _R1::den>,
+        ratio<-_R2::num, _R2::den> >::type __t;
+    public:
+      typedef ratio<-__t::num, __t::den> type;
+    };
+
+
+  template<typename _R1, typename _R2, bool __b>
+    struct __ratio_add_impl<_R1, _R2, true, true, __b>
+    {
+    private:
+      static constexpr uintmax_t __g = __static_gcd<_R1::den, _R2::den>::value;
+      static constexpr uintmax_t __d2 = _R2::den / __g;
+      typedef __big_mul<_R1::den, __d2> __d;
+      typedef __big_mul<_R1::num, _R2::den / __g> __x;
+      typedef __big_mul<_R2::num, _R1::den / __g> __y;
+      typedef __big_add<__x::__hi, __x::__lo, __y::__hi, __y::__lo> __n;
+      static_assert(__n::__hi >= __x::__hi, "Internal library error");
+      typedef __big_div<__n::__hi, __n::__lo, __g> __ng;
+      static constexpr uintmax_t __g2 = __static_gcd<__ng::__rem, __g>::value;
+      typedef __big_div<__n::__hi, __n::__lo, __g2> __n_final;
+      static_assert(__n_final::__rem == 0, "Internal library error");
+      static_assert(__n_final::__quot_hi == 0 &&
+        __n_final::__quot_lo <= 0x7fffffffffffffffL, "overflow in addition");
+      typedef __big_mul<_R1::den / __g2, __d2> __d_final;
+      static_assert(__d_final::__hi == 0 &&
+        __d_final::__lo <= 0x7fffffffffffffffL, "overflow in addition");
+    public:
+      typedef ratio<__n_final::__quot_lo, __d_final::__lo> type;
+    };
+
+  template<typename _R1, typename _R2>
+    struct __ratio_add_impl<_R1, _R2, false, true, true>
+    : __ratio_add_impl<_R2, _R1>
+    { };
+
+
+  template<typename _R1, typename _R2>
+    struct __ratio_add_impl<_R1, _R2, true, false, false>
+    {
+    private:
+      static constexpr uintmax_t __g = __static_gcd<_R1::den, _R2::den>::value;
+      static constexpr uintmax_t __d2 = _R2::den / __g;
+      typedef __big_mul<_R1::den, __d2> __d;
+      typedef __big_mul<_R1::num, _R2::den / __g> __x;
+      typedef __big_mul<-_R2::num, _R1::den / __g> __y;
+      typedef __big_sub<__x::__hi, __x::__lo, __y::__hi, __y::__lo> __n;
+      typedef __big_div<__n::__hi, __n::__lo, __g> __ng;
+      static constexpr uintmax_t __g2 = __static_gcd<__ng::__rem, __g>::value;
+      typedef __big_div<__n::__hi, __n::__lo, __g2> __n_final;
+      static_assert(__n_final::__rem == 0, "Internal library error");
+      static_assert(__n_final::__quot_hi == 0 &&
+        __n_final::__quot_lo <= 0x7fffffffffffffffL, "overflow in addition");
+      typedef __big_mul<_R1::den / __g2, __d2> __d_final;
+      static_assert(__d_final::__hi == 0 &&
+        __d_final::__lo <= 0x7fffffffffffffffL, "overflow in addition");
+    public:
+      typedef ratio<__n_final::__quot_lo, __d_final::__lo> type;
+    };
+
+  template<typename _R1, typename _R2>
+    struct __ratio_add
+    {
+      typedef typename __ratio_add_impl<_R1, _R2>::type type;
+      static constexpr intmax_t num = type::num;
+      static constexpr intmax_t den = type::den;
+    };
+
+  template<typename _R1, typename _R2>
+    constexpr intmax_t __ratio_add<_R1, _R2>::num;
+
+  template<typename _R1, typename _R2>
+    constexpr intmax_t __ratio_add<_R1, _R2>::den;
+
+
+  template<typename _R1, typename _R2>
+    using ratio_add = typename __ratio_add<_R1, _R2>::type;
+
+  template<typename _R1, typename _R2>
+    struct __ratio_subtract
+    {
+      typedef typename __ratio_add<
+        _R1,
+        ratio<-_R2::num, _R2::den>>::type type;
+
+      static constexpr intmax_t num = type::num;
+      static constexpr intmax_t den = type::den;
+    };
+
+  template<typename _R1, typename _R2>
+    constexpr intmax_t __ratio_subtract<_R1, _R2>::num;
+
+  template<typename _R1, typename _R2>
+    constexpr intmax_t __ratio_subtract<_R1, _R2>::den;
+
+
+  template<typename _R1, typename _R2>
+    using ratio_subtract = typename __ratio_subtract<_R1, _R2>::type;
+
+
+  typedef ratio<1, 1000000000000000000> atto;
+  typedef ratio<1, 1000000000000000> femto;
+  typedef ratio<1, 1000000000000> pico;
+  typedef ratio<1, 1000000000> nano;
+  typedef ratio<1, 1000000> micro;
+  typedef ratio<1, 1000> milli;
+  typedef ratio<1, 100> centi;
+  typedef ratio<1, 10> deci;
+  typedef ratio< 10, 1> deca;
+  typedef ratio< 100, 1> hecto;
+  typedef ratio< 1000, 1> kilo;
+  typedef ratio< 1000000, 1> mega;
+  typedef ratio< 1000000000, 1> giga;
+  typedef ratio< 1000000000000, 1> tera;
+  typedef ratio< 1000000000000000, 1> peta;
+  typedef ratio< 1000000000000000000, 1> exa;
+
+
+
+}
+
+
+       
+namespace std
+{
+  using ::clock_t;
+  using ::time_t;
+  using ::tm;
+
+  using ::clock;
+  using ::difftime;
+  using ::mktime;
+  using ::time;
+  using ::asctime;
+  using ::ctime;
+  using ::gmtime;
+  using ::localtime;
+  using ::strftime;
+}
+       
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+  namespace chrono
+  {
+    template<typename _Rep, typename _Period = ratio<1>>
+      struct duration;
+
+    template<typename _Clock, typename _Dur = typename _Clock::duration>
+      struct time_point;
+  }
+
+
+
+  template<typename _CT, typename _Period1, typename _Period2>
+    struct __duration_common_type_wrapper
+    {
+    private:
+      typedef __static_gcd<_Period1::num, _Period2::num> __gcd_num;
+      typedef __static_gcd<_Period1::den, _Period2::den> __gcd_den;
+      typedef typename _CT::type __cr;
+      typedef ratio<__gcd_num::value,
+        (_Period1::den / __gcd_den::value) * _Period2::den> __r;
+    public:
+      typedef __success_type<chrono::duration<__cr, __r>> type;
+    };
+
+  template<typename _Period1, typename _Period2>
+    struct __duration_common_type_wrapper<__failure_type, _Period1, _Period2>
+    { typedef __failure_type type; };
+
+  template<typename _Rep1, typename _Period1, typename _Rep2, typename _Period2>
+    struct common_type<chrono::duration<_Rep1, _Period1>,
+             chrono::duration<_Rep2, _Period2>>
+    : public __duration_common_type_wrapper<typename __member_type_wrapper<
+             common_type<_Rep1, _Rep2>>::type, _Period1, _Period2>::type
+    { };
+
+
+
+  template<typename _CT, typename _Clock>
+    struct __timepoint_common_type_wrapper
+    {
+      typedef __success_type<chrono::time_point<_Clock, typename _CT::type>>
+        type;
+    };
+
+  template<typename _Clock>
+    struct __timepoint_common_type_wrapper<__failure_type, _Clock>
+    { typedef __failure_type type; };
+
+  template<typename _Clock, typename _Duration1, typename _Duration2>
+    struct common_type<chrono::time_point<_Clock, _Duration1>,
+             chrono::time_point<_Clock, _Duration2>>
+    : public __timepoint_common_type_wrapper<typename __member_type_wrapper<
+             common_type<_Duration1, _Duration2>>::type, _Clock>::type
+    { };
+
+  namespace chrono
+  {
+
+    template<typename _ToDur, typename _CF, typename _CR,
+      bool _NumIsOne = false, bool _DenIsOne = false>
+      struct __duration_cast_impl
+      {
+ template<typename _Rep, typename _Period>
+   static constexpr _ToDur
+   __cast(const duration<_Rep, _Period>& __d)
+   {
+     typedef typename _ToDur::rep __to_rep;
+     return _ToDur(static_cast<__to_rep>(static_cast<_CR>(__d.count())
+       * static_cast<_CR>(_CF::num)
+       / static_cast<_CR>(_CF::den)));
+   }
+      };
+
+    template<typename _ToDur, typename _CF, typename _CR>
+      struct __duration_cast_impl<_ToDur, _CF, _CR, true, true>
+      {
+ template<typename _Rep, typename _Period>
+   static constexpr _ToDur
+   __cast(const duration<_Rep, _Period>& __d)
+   {
+     typedef typename _ToDur::rep __to_rep;
+     return _ToDur(static_cast<__to_rep>(__d.count()));
+   }
+      };
+
+    template<typename _ToDur, typename _CF, typename _CR>
+      struct __duration_cast_impl<_ToDur, _CF, _CR, true, false>
+      {
+ template<typename _Rep, typename _Period>
+   static constexpr _ToDur
+   __cast(const duration<_Rep, _Period>& __d)
+   {
+     typedef typename _ToDur::rep __to_rep;
+     return _ToDur(static_cast<__to_rep>(
+       static_cast<_CR>(__d.count()) / static_cast<_CR>(_CF::den)));
+   }
+      };
+
+    template<typename _ToDur, typename _CF, typename _CR>
+      struct __duration_cast_impl<_ToDur, _CF, _CR, false, true>
+      {
+ template<typename _Rep, typename _Period>
+   static constexpr _ToDur
+   __cast(const duration<_Rep, _Period>& __d)
+   {
+     typedef typename _ToDur::rep __to_rep;
+     return _ToDur(static_cast<__to_rep>(
+       static_cast<_CR>(__d.count()) * static_cast<_CR>(_CF::num)));
+   }
+      };
+
+    template<typename _Tp>
+      struct __is_duration
+      : std::false_type
+      { };
+
+    template<typename _Rep, typename _Period>
+      struct __is_duration<duration<_Rep, _Period>>
+      : std::true_type
+      { };
+
+    template<typename _Tp>
+      using __enable_if_is_duration
+ = typename enable_if<__is_duration<_Tp>::value, _Tp>::type;
+
+    template<typename _Tp>
+      using __disable_if_is_duration
+ = typename enable_if<!__is_duration<_Tp>::value, _Tp>::type;
+
+
+    template<typename _ToDur, typename _Rep, typename _Period>
+      constexpr __enable_if_is_duration<_ToDur>
+      duration_cast(const duration<_Rep, _Period>& __d)
+      {
+ typedef typename _ToDur::period __to_period;
+ typedef typename _ToDur::rep __to_rep;
+ typedef ratio_divide<_Period, __to_period> __cf;
+ typedef typename common_type<__to_rep, _Rep, intmax_t>::type
+          __cr;
+ typedef __duration_cast_impl<_ToDur, __cf, __cr,
+          __cf::num == 1, __cf::den == 1> __dc;
+ return __dc::__cast(__d);
+      }
+
+
+    template<typename _Rep>
+      struct treat_as_floating_point
+      : is_floating_point<_Rep>
+      { };
+    template<typename _Rep>
+      struct duration_values
+      {
+ static constexpr _Rep
+ zero()
+ { return _Rep(0); }
+
+ static constexpr _Rep
+ max()
+ { return numeric_limits<_Rep>::max(); }
+
+ static constexpr _Rep
+ min()
+ { return numeric_limits<_Rep>::lowest(); }
+      };
+
+    template<typename _Tp>
+      struct __is_ratio
+      : std::false_type
+      { };
+
+    template<intmax_t _Num, intmax_t _Den>
+      struct __is_ratio<ratio<_Num, _Den>>
+      : std::true_type
+      { };
+
+
+    template<typename _Rep, typename _Period>
+      struct duration
+      {
+      private:
+ template<typename _Rep2>
+   using __is_float = treat_as_floating_point<_Rep2>;
+
+
+ template<typename _Period2>
+   using __is_harmonic
+     = __bool_constant<ratio_divide<_Period2, _Period>::den == 1>;
+
+      public:
+
+ typedef _Rep rep;
+ typedef _Period period;
+
+ static_assert(!__is_duration<_Rep>::value, "rep cannot be a duration");
+ static_assert(__is_ratio<_Period>::value,
+        "period must be a specialization of ratio");
+ static_assert(_Period::num > 0, "period must be positive");
+
+
+ constexpr duration() = default;
+
+ duration(const duration&) = default;
+
+ template<typename _Rep2, typename = _Require<
+   is_convertible<_Rep2, rep>,
+   __or_<__is_float<rep>, __not_<__is_float<_Rep2>>>>>
+   constexpr explicit duration(const _Rep2& __rep)
+   : __r(static_cast<rep>(__rep)) { }
+
+ template<typename _Rep2, typename _Period2, typename = _Require<
+   __or_<__is_float<rep>,
+         __and_<__is_harmonic<_Period2>,
+         __not_<__is_float<_Rep2>>>>>>
+   constexpr duration(const duration<_Rep2, _Period2>& __d)
+   : __r(duration_cast<duration>(__d).count()) { }
+
+ ~duration() = default;
+ duration& operator=(const duration&) = default;
+
+
+ constexpr rep
+ count() const
+ { return __r; }
+
+
+ constexpr duration
+ operator+() const
+ { return *this; }
+
+ constexpr duration
+ operator-() const
+ { return duration(-__r); }
+
+ duration&
+ operator++()
+ {
+   ++__r;
+   return *this;
+ }
+
+ duration
+ operator++(int)
+ { return duration(__r++); }
+
+ duration&
+ operator--()
+ {
+   --__r;
+   return *this;
+ }
+
+ duration
+ operator--(int)
+ { return duration(__r--); }
+
+ duration&
+ operator+=(const duration& __d)
+ {
+   __r += __d.count();
+   return *this;
+ }
+
+ duration&
+ operator-=(const duration& __d)
+ {
+   __r -= __d.count();
+   return *this;
+ }
+
+ duration&
+ operator*=(const rep& __rhs)
+ {
+   __r *= __rhs;
+   return *this;
+ }
+
+ duration&
+ operator/=(const rep& __rhs)
+ {
+   __r /= __rhs;
+   return *this;
+ }
+
+
+ template<typename _Rep2 = rep>
+  
+   typename enable_if<!treat_as_floating_point<_Rep2>::value,
+        duration&>::type
+   operator%=(const rep& __rhs)
+   {
+     __r %= __rhs;
+     return *this;
+   }
+
+ template<typename _Rep2 = rep>
+  
+   typename enable_if<!treat_as_floating_point<_Rep2>::value,
+        duration&>::type
+   operator%=(const duration& __d)
+   {
+     __r %= __d.count();
+     return *this;
+   }
+
+
+ static constexpr duration
+ zero()
+ { return duration(duration_values<rep>::zero()); }
+
+ static constexpr duration
+ min()
+ { return duration(duration_values<rep>::min()); }
+
+ static constexpr duration
+ max()
+ { return duration(duration_values<rep>::max()); }
+
+      private:
+ rep __r;
+      };
+
+    template<typename _Rep1, typename _Period1,
+      typename _Rep2, typename _Period2>
+      constexpr typename common_type<duration<_Rep1, _Period1>,
+         duration<_Rep2, _Period2>>::type
+      operator+(const duration<_Rep1, _Period1>& __lhs,
+  const duration<_Rep2, _Period2>& __rhs)
+      {
+ typedef duration<_Rep1, _Period1> __dur1;
+ typedef duration<_Rep2, _Period2> __dur2;
+ typedef typename common_type<__dur1,__dur2>::type __cd;
+ return __cd(__cd(__lhs).count() + __cd(__rhs).count());
+      }
+
+    template<typename _Rep1, typename _Period1,
+      typename _Rep2, typename _Period2>
+      constexpr typename common_type<duration<_Rep1, _Period1>,
+         duration<_Rep2, _Period2>>::type
+      operator-(const duration<_Rep1, _Period1>& __lhs,
+  const duration<_Rep2, _Period2>& __rhs)
+      {
+ typedef duration<_Rep1, _Period1> __dur1;
+ typedef duration<_Rep2, _Period2> __dur2;
+ typedef typename common_type<__dur1,__dur2>::type __cd;
+ return __cd(__cd(__lhs).count() - __cd(__rhs).count());
+      }
+
+
+
+    template<typename _Rep1, typename _Rep2,
+      typename _CRep = typename common_type<_Rep1, _Rep2>::type>
+      using __common_rep_t
+ = typename enable_if<is_convertible<_Rep2, _CRep>::value, _CRep>::type;
+
+    template<typename _Rep1, typename _Period, typename _Rep2>
+      constexpr duration<__common_rep_t<_Rep1, _Rep2>, _Period>
+      operator*(const duration<_Rep1, _Period>& __d, const _Rep2& __s)
+      {
+ typedef duration<typename common_type<_Rep1, _Rep2>::type, _Period>
+   __cd;
+ return __cd(__cd(__d).count() * __s);
+      }
+
+    template<typename _Rep1, typename _Rep2, typename _Period>
+      constexpr duration<__common_rep_t<_Rep2, _Rep1>, _Period>
+      operator*(const _Rep1& __s, const duration<_Rep2, _Period>& __d)
+      { return __d * __s; }
+
+    template<typename _Rep1, typename _Period, typename _Rep2>
+      constexpr
+      duration<__common_rep_t<_Rep1, __disable_if_is_duration<_Rep2>>, _Period>
+      operator/(const duration<_Rep1, _Period>& __d, const _Rep2& __s)
+      {
+ typedef duration<typename common_type<_Rep1, _Rep2>::type, _Period>
+   __cd;
+ return __cd(__cd(__d).count() / __s);
+      }
+
+    template<typename _Rep1, typename _Period1,
+      typename _Rep2, typename _Period2>
+      constexpr typename common_type<_Rep1, _Rep2>::type
+      operator/(const duration<_Rep1, _Period1>& __lhs,
+  const duration<_Rep2, _Period2>& __rhs)
+      {
+ typedef duration<_Rep1, _Period1> __dur1;
+ typedef duration<_Rep2, _Period2> __dur2;
+ typedef typename common_type<__dur1,__dur2>::type __cd;
+ return __cd(__lhs).count() / __cd(__rhs).count();
+      }
+
+
+    template<typename _Rep1, typename _Period, typename _Rep2>
+      constexpr
+      duration<__common_rep_t<_Rep1, __disable_if_is_duration<_Rep2>>, _Period>
+      operator%(const duration<_Rep1, _Period>& __d, const _Rep2& __s)
+      {
+ typedef duration<typename common_type<_Rep1, _Rep2>::type, _Period>
+   __cd;
+ return __cd(__cd(__d).count() % __s);
+      }
+
+    template<typename _Rep1, typename _Period1,
+      typename _Rep2, typename _Period2>
+      constexpr typename common_type<duration<_Rep1, _Period1>,
+         duration<_Rep2, _Period2>>::type
+      operator%(const duration<_Rep1, _Period1>& __lhs,
+  const duration<_Rep2, _Period2>& __rhs)
+      {
+ typedef duration<_Rep1, _Period1> __dur1;
+ typedef duration<_Rep2, _Period2> __dur2;
+ typedef typename common_type<__dur1,__dur2>::type __cd;
+ return __cd(__cd(__lhs).count() % __cd(__rhs).count());
+      }
+
+
+    template<typename _Rep1, typename _Period1,
+      typename _Rep2, typename _Period2>
+      constexpr bool
+      operator==(const duration<_Rep1, _Period1>& __lhs,
+   const duration<_Rep2, _Period2>& __rhs)
+      {
+ typedef duration<_Rep1, _Period1> __dur1;
+ typedef duration<_Rep2, _Period2> __dur2;
+ typedef typename common_type<__dur1,__dur2>::type __ct;
+ return __ct(__lhs).count() == __ct(__rhs).count();
+      }
+
+    template<typename _Rep1, typename _Period1,
+      typename _Rep2, typename _Period2>
+      constexpr bool
+      operator<(const duration<_Rep1, _Period1>& __lhs,
+  const duration<_Rep2, _Period2>& __rhs)
+      {
+ typedef duration<_Rep1, _Period1> __dur1;
+ typedef duration<_Rep2, _Period2> __dur2;
+ typedef typename common_type<__dur1,__dur2>::type __ct;
+ return __ct(__lhs).count() < __ct(__rhs).count();
+      }
+
+    template<typename _Rep1, typename _Period1,
+      typename _Rep2, typename _Period2>
+      constexpr bool
+      operator!=(const duration<_Rep1, _Period1>& __lhs,
+   const duration<_Rep2, _Period2>& __rhs)
+      { return !(__lhs == __rhs); }
+
+    template<typename _Rep1, typename _Period1,
+      typename _Rep2, typename _Period2>
+      constexpr bool
+      operator<=(const duration<_Rep1, _Period1>& __lhs,
+   const duration<_Rep2, _Period2>& __rhs)
+      { return !(__rhs < __lhs); }
+
+    template<typename _Rep1, typename _Period1,
+      typename _Rep2, typename _Period2>
+      constexpr bool
+      operator>(const duration<_Rep1, _Period1>& __lhs,
+  const duration<_Rep2, _Period2>& __rhs)
+      { return __rhs < __lhs; }
+
+    template<typename _Rep1, typename _Period1,
+      typename _Rep2, typename _Period2>
+      constexpr bool
+      operator>=(const duration<_Rep1, _Period1>& __lhs,
+   const duration<_Rep2, _Period2>& __rhs)
+      { return !(__lhs < __rhs); }
+
+
+    typedef duration<int64_t, nano> nanoseconds;
+
+
+    typedef duration<int64_t, micro> microseconds;
+
+
+    typedef duration<int64_t, milli> milliseconds;
+
+
+    typedef duration<int64_t> seconds;
+
+
+    typedef duration<int64_t, ratio< 60>> minutes;
+
+
+    typedef duration<int64_t, ratio<3600>> hours;
+
+
+    template<typename _Clock, typename _Dur>
+      struct time_point
+      {
+ typedef _Clock clock;
+ typedef _Dur duration;
+ typedef typename duration::rep rep;
+ typedef typename duration::period period;
+
+ constexpr time_point() : __d(duration::zero())
+ { }
+
+ constexpr explicit time_point(const duration& __dur)
+ : __d(__dur)
+ { }
+
+
+ template<typename _Dur2,
+   typename = _Require<is_convertible<_Dur2, _Dur>>>
+   constexpr time_point(const time_point<clock, _Dur2>& __t)
+   : __d(__t.time_since_epoch())
+   { }
+
+
+ constexpr duration
+ time_since_epoch() const
+ { return __d; }
+
+
+ time_point&
+ operator+=(const duration& __dur)
+ {
+   __d += __dur;
+   return *this;
+ }
+
+ time_point&
+ operator-=(const duration& __dur)
+ {
+   __d -= __dur;
+   return *this;
+ }
+
+
+ static constexpr time_point
+ min()
+ { return time_point(duration::min()); }
+
+ static constexpr time_point
+ max()
+ { return time_point(duration::max()); }
+
+      private:
+ duration __d;
+      };
+
+
+    template<typename _ToDur, typename _Clock, typename _Dur>
+      constexpr typename enable_if<__is_duration<_ToDur>::value,
+       time_point<_Clock, _ToDur>>::type
+      time_point_cast(const time_point<_Clock, _Dur>& __t)
+      {
+ typedef time_point<_Clock, _ToDur> __time_point;
+ return __time_point(duration_cast<_ToDur>(__t.time_since_epoch()));
+      }
+    template<typename _Clock, typename _Dur1,
+      typename _Rep2, typename _Period2>
+      constexpr time_point<_Clock,
+ typename common_type<_Dur1, duration<_Rep2, _Period2>>::type>
+      operator+(const time_point<_Clock, _Dur1>& __lhs,
+  const duration<_Rep2, _Period2>& __rhs)
+      {
+ typedef duration<_Rep2, _Period2> __dur2;
+ typedef typename common_type<_Dur1,__dur2>::type __ct;
+ typedef time_point<_Clock, __ct> __time_point;
+ return __time_point(__lhs.time_since_epoch() + __rhs);
+      }
+
+    template<typename _Rep1, typename _Period1,
+      typename _Clock, typename _Dur2>
+      constexpr time_point<_Clock,
+ typename common_type<duration<_Rep1, _Period1>, _Dur2>::type>
+      operator+(const duration<_Rep1, _Period1>& __lhs,
+  const time_point<_Clock, _Dur2>& __rhs)
+      {
+ typedef duration<_Rep1, _Period1> __dur1;
+ typedef typename common_type<__dur1,_Dur2>::type __ct;
+ typedef time_point<_Clock, __ct> __time_point;
+ return __time_point(__rhs.time_since_epoch() + __lhs);
+      }
+
+    template<typename _Clock, typename _Dur1,
+      typename _Rep2, typename _Period2>
+      constexpr time_point<_Clock,
+ typename common_type<_Dur1, duration<_Rep2, _Period2>>::type>
+      operator-(const time_point<_Clock, _Dur1>& __lhs,
+  const duration<_Rep2, _Period2>& __rhs)
+      {
+ typedef duration<_Rep2, _Period2> __dur2;
+ typedef typename common_type<_Dur1,__dur2>::type __ct;
+ typedef time_point<_Clock, __ct> __time_point;
+ return __time_point(__lhs.time_since_epoch() -__rhs);
+      }
+
+    template<typename _Clock, typename _Dur1, typename _Dur2>
+      constexpr typename common_type<_Dur1, _Dur2>::type
+      operator-(const time_point<_Clock, _Dur1>& __lhs,
+  const time_point<_Clock, _Dur2>& __rhs)
+      { return __lhs.time_since_epoch() - __rhs.time_since_epoch(); }
+
+    template<typename _Clock, typename _Dur1, typename _Dur2>
+      constexpr bool
+      operator==(const time_point<_Clock, _Dur1>& __lhs,
+   const time_point<_Clock, _Dur2>& __rhs)
+      { return __lhs.time_since_epoch() == __rhs.time_since_epoch(); }
+
+    template<typename _Clock, typename _Dur1, typename _Dur2>
+      constexpr bool
+      operator!=(const time_point<_Clock, _Dur1>& __lhs,
+   const time_point<_Clock, _Dur2>& __rhs)
+      { return !(__lhs == __rhs); }
+
+    template<typename _Clock, typename _Dur1, typename _Dur2>
+      constexpr bool
+      operator<(const time_point<_Clock, _Dur1>& __lhs,
+  const time_point<_Clock, _Dur2>& __rhs)
+      { return __lhs.time_since_epoch() < __rhs.time_since_epoch(); }
+
+    template<typename _Clock, typename _Dur1, typename _Dur2>
+      constexpr bool
+      operator<=(const time_point<_Clock, _Dur1>& __lhs,
+   const time_point<_Clock, _Dur2>& __rhs)
+      { return !(__rhs < __lhs); }
+
+    template<typename _Clock, typename _Dur1, typename _Dur2>
+      constexpr bool
+      operator>(const time_point<_Clock, _Dur1>& __lhs,
+  const time_point<_Clock, _Dur2>& __rhs)
+      { return __rhs < __lhs; }
+
+    template<typename _Clock, typename _Dur1, typename _Dur2>
+      constexpr bool
+      operator>=(const time_point<_Clock, _Dur1>& __lhs,
+   const time_point<_Clock, _Dur2>& __rhs)
+      { return !(__lhs < __rhs); }
+    inline namespace _V2 {
+
+
+
+
+
+
+    struct system_clock
+    {
+      typedef chrono::nanoseconds duration;
+      typedef duration::rep rep;
+      typedef duration::period period;
+      typedef chrono::time_point<system_clock, duration> time_point;
+
+      static_assert(system_clock::duration::min()
+      < system_clock::duration::zero(),
+      "a clock's minimum duration cannot be less than its epoch");
+
+      static constexpr bool is_steady = false;
+
+      static time_point
+      now() noexcept;
+
+
+      static std::time_t
+      to_time_t(const time_point& __t) noexcept
+      {
+ return std::time_t(duration_cast<chrono::seconds>
+      (__t.time_since_epoch()).count());
+      }
+
+      static time_point
+      from_time_t(std::time_t __t) noexcept
+      {
+ typedef chrono::time_point<system_clock, seconds> __from;
+ return time_point_cast<system_clock::duration>
+        (__from(chrono::seconds(__t)));
+      }
+    };
+
+
+
+
+
+
+
+    struct steady_clock
+    {
+      typedef chrono::nanoseconds duration;
+      typedef duration::rep rep;
+      typedef duration::period period;
+      typedef chrono::time_point<steady_clock, duration> time_point;
+
+      static constexpr bool is_steady = true;
+
+      static time_point
+      now() noexcept;
+    };
+    using high_resolution_clock = system_clock;
+
+    }
+  }
+
+}
+
+
+
+       
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+  class __mutex_base
+  {
+  protected:
+    typedef __gthread_mutex_t __native_type;
+
+
+    __native_type _M_mutex = { { 0, 0, 0, 0, 0, 0, 0, { 0, 0 } } };
+
+    constexpr __mutex_base() noexcept = default;
+    __mutex_base(const __mutex_base&) = delete;
+    __mutex_base& operator=(const __mutex_base&) = delete;
+  };
+
+
+  class mutex : private __mutex_base
+  {
+  public:
+    typedef __native_type* native_handle_type;
+
+
+    constexpr
+
+    mutex() noexcept = default;
+    ~mutex() = default;
+
+    mutex(const mutex&) = delete;
+    mutex& operator=(const mutex&) = delete;
+
+    void
+    lock()
+    {
+      int __e = __gthread_mutex_lock(&_M_mutex);
+
+
+      if (__e)
+ __throw_system_error(__e);
+    }
+
+    bool
+    try_lock() noexcept
+    {
+
+      return !__gthread_mutex_trylock(&_M_mutex);
+    }
+
+    void
+    unlock()
+    {
+
+      __gthread_mutex_unlock(&_M_mutex);
+    }
+
+    native_handle_type
+    native_handle() noexcept
+    { return &_M_mutex; }
+  };
+
+
+
+
+  struct defer_lock_t { explicit defer_lock_t() = default; };
+
+
+  struct try_to_lock_t { explicit try_to_lock_t() = default; };
+
+
+
+  struct adopt_lock_t { explicit adopt_lock_t() = default; };
+
+
+  constexpr defer_lock_t defer_lock { };
+
+
+  constexpr try_to_lock_t try_to_lock { };
+
+
+  constexpr adopt_lock_t adopt_lock { };
+
+
+
+
+
+
+  template<typename _Mutex>
+    class lock_guard
+    {
+    public:
+      typedef _Mutex mutex_type;
+
+      explicit lock_guard(mutex_type& __m) : _M_device(__m)
+      { _M_device.lock(); }
+
+      lock_guard(mutex_type& __m, adopt_lock_t) noexcept : _M_device(__m)
+      { }
+
+      ~lock_guard()
+      { _M_device.unlock(); }
+
+      lock_guard(const lock_guard&) = delete;
+      lock_guard& operator=(const lock_guard&) = delete;
+
+    private:
+      mutex_type& _M_device;
+    };
+  template<typename _Mutex>
+    class unique_lock
+    {
+    public:
+      typedef _Mutex mutex_type;
+
+      unique_lock() noexcept
+      : _M_device(0), _M_owns(false)
+      { }
+
+      explicit unique_lock(mutex_type& __m)
+      : _M_device(std::__addressof(__m)), _M_owns(false)
+      {
+ lock();
+ _M_owns = true;
+      }
+
+      unique_lock(mutex_type& __m, defer_lock_t) noexcept
+      : _M_device(std::__addressof(__m)), _M_owns(false)
+      { }
+
+      unique_lock(mutex_type& __m, try_to_lock_t)
+      : _M_device(std::__addressof(__m)), _M_owns(_M_device->try_lock())
+      { }
+
+      unique_lock(mutex_type& __m, adopt_lock_t) noexcept
+      : _M_device(std::__addressof(__m)), _M_owns(true)
+      {
+
+      }
+
+      template<typename _Clock, typename _Duration>
+ unique_lock(mutex_type& __m,
+      const chrono::time_point<_Clock, _Duration>& __atime)
+ : _M_device(std::__addressof(__m)),
+   _M_owns(_M_device->try_lock_until(__atime))
+ { }
+
+      template<typename _Rep, typename _Period>
+ unique_lock(mutex_type& __m,
+      const chrono::duration<_Rep, _Period>& __rtime)
+ : _M_device(std::__addressof(__m)),
+   _M_owns(_M_device->try_lock_for(__rtime))
+ { }
+
+      ~unique_lock()
+      {
+ if (_M_owns)
+   unlock();
+      }
+
+      unique_lock(const unique_lock&) = delete;
+      unique_lock& operator=(const unique_lock&) = delete;
+
+      unique_lock(unique_lock&& __u) noexcept
+      : _M_device(__u._M_device), _M_owns(__u._M_owns)
+      {
+ __u._M_device = 0;
+ __u._M_owns = false;
+      }
+
+      unique_lock& operator=(unique_lock&& __u) noexcept
+      {
+ if(_M_owns)
+   unlock();
+
+ unique_lock(std::move(__u)).swap(*this);
+
+ __u._M_device = 0;
+ __u._M_owns = false;
+
+ return *this;
+      }
+
+      void
+      lock()
+      {
+ if (!_M_device)
+   __throw_system_error(int(errc::operation_not_permitted));
+ else if (_M_owns)
+   __throw_system_error(int(errc::resource_deadlock_would_occur));
+ else
+   {
+     _M_device->lock();
+     _M_owns = true;
+   }
+      }
+
+      bool
+      try_lock()
+      {
+ if (!_M_device)
+   __throw_system_error(int(errc::operation_not_permitted));
+ else if (_M_owns)
+   __throw_system_error(int(errc::resource_deadlock_would_occur));
+ else
+   {
+     _M_owns = _M_device->try_lock();
+     return _M_owns;
+   }
+      }
+
+      template<typename _Clock, typename _Duration>
+ bool
+ try_lock_until(const chrono::time_point<_Clock, _Duration>& __atime)
+ {
+   if (!_M_device)
+     __throw_system_error(int(errc::operation_not_permitted));
+   else if (_M_owns)
+     __throw_system_error(int(errc::resource_deadlock_would_occur));
+   else
+     {
+       _M_owns = _M_device->try_lock_until(__atime);
+       return _M_owns;
+     }
+ }
+
+      template<typename _Rep, typename _Period>
+ bool
+ try_lock_for(const chrono::duration<_Rep, _Period>& __rtime)
+ {
+   if (!_M_device)
+     __throw_system_error(int(errc::operation_not_permitted));
+   else if (_M_owns)
+     __throw_system_error(int(errc::resource_deadlock_would_occur));
+   else
+     {
+       _M_owns = _M_device->try_lock_for(__rtime);
+       return _M_owns;
+     }
+  }
+
+      void
+      unlock()
+      {
+ if (!_M_owns)
+   __throw_system_error(int(errc::operation_not_permitted));
+ else if (_M_device)
+   {
+     _M_device->unlock();
+     _M_owns = false;
+   }
+      }
+
+      void
+      swap(unique_lock& __u) noexcept
+      {
+ std::swap(_M_device, __u._M_device);
+ std::swap(_M_owns, __u._M_owns);
+      }
+
+      mutex_type*
+      release() noexcept
+      {
+ mutex_type* __ret = _M_device;
+ _M_device = 0;
+ _M_owns = false;
+ return __ret;
+      }
+
+      bool
+      owns_lock() const noexcept
+      { return _M_owns; }
+
+      explicit operator bool() const noexcept
+      { return owns_lock(); }
+
+      mutex_type*
+      mutex() const noexcept
+      { return _M_device; }
+
+    private:
+      mutex_type* _M_device;
+      bool _M_owns;
+    };
+
+
+  template<typename _Mutex>
+    inline void
+    swap(unique_lock<_Mutex>& __x, unique_lock<_Mutex>& __y) noexcept
+    { __x.swap(__y); }
+
+
+
+}
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+  class __recursive_mutex_base
+  {
+  protected:
+    typedef __gthread_recursive_mutex_t __native_type;
+
+    __recursive_mutex_base(const __recursive_mutex_base&) = delete;
+    __recursive_mutex_base& operator=(const __recursive_mutex_base&) = delete;
+
+
+    __native_type _M_mutex = { { 0, 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, 0, 0, { 0, 0 } } };
+
+    __recursive_mutex_base() = default;
+  };
+
+
+  class recursive_mutex : private __recursive_mutex_base
+  {
+  public:
+    typedef __native_type* native_handle_type;
+
+    recursive_mutex() = default;
+    ~recursive_mutex() = default;
+
+    recursive_mutex(const recursive_mutex&) = delete;
+    recursive_mutex& operator=(const recursive_mutex&) = delete;
+
+    void
+    lock()
+    {
+      int __e = __gthread_recursive_mutex_lock(&_M_mutex);
+
+
+      if (__e)
+ __throw_system_error(__e);
+    }
+
+    bool
+    try_lock() noexcept
+    {
+
+      return !__gthread_recursive_mutex_trylock(&_M_mutex);
+    }
+
+    void
+    unlock()
+    {
+
+      __gthread_recursive_mutex_unlock(&_M_mutex);
+    }
+
+    native_handle_type
+    native_handle() noexcept
+    { return &_M_mutex; }
+  };
+
+
+  template<typename _Derived>
+    class __timed_mutex_impl
+    {
+    protected:
+      typedef chrono::high_resolution_clock __clock_t;
+
+      template<typename _Rep, typename _Period>
+ bool
+ _M_try_lock_for(const chrono::duration<_Rep, _Period>& __rtime)
+ {
+   using chrono::steady_clock;
+   auto __rt = chrono::duration_cast<steady_clock::duration>(__rtime);
+   if (ratio_greater<steady_clock::period, _Period>())
+     ++__rt;
+   return _M_try_lock_until(steady_clock::now() + __rt);
+ }
+
+      template<typename _Duration>
+ bool
+ _M_try_lock_until(const chrono::time_point<__clock_t,
+         _Duration>& __atime)
+ {
+   auto __s = chrono::time_point_cast<chrono::seconds>(__atime);
+   auto __ns = chrono::duration_cast<chrono::nanoseconds>(__atime - __s);
+
+   __gthread_time_t __ts = {
+     static_cast<std::time_t>(__s.time_since_epoch().count()),
+     static_cast<long>(__ns.count())
+   };
+
+   return static_cast<_Derived*>(this)->_M_timedlock(__ts);
+ }
+
+      template<typename _Clock, typename _Duration>
+ bool
+ _M_try_lock_until(const chrono::time_point<_Clock, _Duration>& __atime)
+ {
+   auto __rtime = __atime - _Clock::now();
+   return _M_try_lock_until(__clock_t::now() + __rtime);
+ }
+    };
+
+
+  class timed_mutex
+  : private __mutex_base, public __timed_mutex_impl<timed_mutex>
+  {
+  public:
+    typedef __native_type* native_handle_type;
+
+    timed_mutex() = default;
+    ~timed_mutex() = default;
+
+    timed_mutex(const timed_mutex&) = delete;
+    timed_mutex& operator=(const timed_mutex&) = delete;
+
+    void
+    lock()
+    {
+      int __e = __gthread_mutex_lock(&_M_mutex);
+
+
+      if (__e)
+ __throw_system_error(__e);
+    }
+
+    bool
+    try_lock() noexcept
+    {
+
+      return !__gthread_mutex_trylock(&_M_mutex);
+    }
+
+    template <class _Rep, class _Period>
+      bool
+      try_lock_for(const chrono::duration<_Rep, _Period>& __rtime)
+      { return _M_try_lock_for(__rtime); }
+
+    template <class _Clock, class _Duration>
+      bool
+      try_lock_until(const chrono::time_point<_Clock, _Duration>& __atime)
+      { return _M_try_lock_until(__atime); }
+
+    void
+    unlock()
+    {
+
+      __gthread_mutex_unlock(&_M_mutex);
+    }
+
+    native_handle_type
+    native_handle() noexcept
+    { return &_M_mutex; }
+
+    private:
+      friend class __timed_mutex_impl<timed_mutex>;
+
+      bool
+      _M_timedlock(const __gthread_time_t& __ts)
+      { return !__gthread_mutex_timedlock(&_M_mutex, &__ts); }
+  };
+
+
+  class recursive_timed_mutex
+  : private __recursive_mutex_base,
+    public __timed_mutex_impl<recursive_timed_mutex>
+  {
+  public:
+    typedef __native_type* native_handle_type;
+
+    recursive_timed_mutex() = default;
+    ~recursive_timed_mutex() = default;
+
+    recursive_timed_mutex(const recursive_timed_mutex&) = delete;
+    recursive_timed_mutex& operator=(const recursive_timed_mutex&) = delete;
+
+    void
+    lock()
+    {
+      int __e = __gthread_recursive_mutex_lock(&_M_mutex);
+
+
+      if (__e)
+ __throw_system_error(__e);
+    }
+
+    bool
+    try_lock() noexcept
+    {
+
+      return !__gthread_recursive_mutex_trylock(&_M_mutex);
+    }
+
+    template <class _Rep, class _Period>
+      bool
+      try_lock_for(const chrono::duration<_Rep, _Period>& __rtime)
+      { return _M_try_lock_for(__rtime); }
+
+    template <class _Clock, class _Duration>
+      bool
+      try_lock_until(const chrono::time_point<_Clock, _Duration>& __atime)
+      { return _M_try_lock_until(__atime); }
+
+    void
+    unlock()
+    {
+
+      __gthread_recursive_mutex_unlock(&_M_mutex);
+    }
+
+    native_handle_type
+    native_handle() noexcept
+    { return &_M_mutex; }
+
+    private:
+      friend class __timed_mutex_impl<recursive_timed_mutex>;
+
+      bool
+      _M_timedlock(const __gthread_time_t& __ts)
+      { return !__gthread_recursive_mutex_timedlock(&_M_mutex, &__ts); }
+  };
+  template<typename _Lock>
+    inline unique_lock<_Lock>
+    __try_to_lock(_Lock& __l)
+    { return unique_lock<_Lock>{__l, try_to_lock}; }
+
+  template<int _Idx, bool _Continue = true>
+    struct __try_lock_impl
+    {
+      template<typename... _Lock>
+ static void
+ __do_try_lock(tuple<_Lock&...>& __locks, int& __idx)
+ {
+          __idx = _Idx;
+          auto __lock = std::__try_to_lock(std::get<_Idx>(__locks));
+          if (__lock.owns_lock())
+            {
+       constexpr bool __cont = _Idx + 2 < sizeof...(_Lock);
+       using __try_locker = __try_lock_impl<_Idx + 1, __cont>;
+       __try_locker::__do_try_lock(__locks, __idx);
+              if (__idx == -1)
+                __lock.release();
+            }
+ }
+    };
+
+  template<int _Idx>
+    struct __try_lock_impl<_Idx, false>
+    {
+      template<typename... _Lock>
+ static void
+ __do_try_lock(tuple<_Lock&...>& __locks, int& __idx)
+ {
+          __idx = _Idx;
+          auto __lock = std::__try_to_lock(std::get<_Idx>(__locks));
+          if (__lock.owns_lock())
+            {
+              __idx = -1;
+              __lock.release();
+            }
+ }
+    };
+  template<typename _Lock1, typename _Lock2, typename... _Lock3>
+    int
+    try_lock(_Lock1& __l1, _Lock2& __l2, _Lock3&... __l3)
+    {
+      int __idx;
+      auto __locks = std::tie(__l1, __l2, __l3...);
+      __try_lock_impl<0>::__do_try_lock(__locks, __idx);
+      return __idx;
+    }
+  template<typename _L1, typename _L2, typename... _L3>
+    void
+    lock(_L1& __l1, _L2& __l2, _L3&... __l3)
+    {
+      while (true)
+        {
+          using __try_locker = __try_lock_impl<0, sizeof...(_L3) != 0>;
+          unique_lock<_L1> __first(__l1);
+          int __idx;
+          auto __locks = std::tie(__l2, __l3...);
+          __try_locker::__do_try_lock(__locks, __idx);
+          if (__idx == -1)
+            {
+              __first.release();
+              return;
+            }
+        }
+    }
+  struct once_flag
+  {
+  private:
+    typedef __gthread_once_t __native_type;
+    __native_type _M_once = 0;
+
+  public:
+
+    constexpr once_flag() noexcept = default;
+
+
+    once_flag(const once_flag&) = delete;
+
+    once_flag& operator=(const once_flag&) = delete;
+
+    template<typename _Callable, typename... _Args>
+      friend void
+      call_once(once_flag& __once, _Callable&& __f, _Args&&... __args);
+  };
+
+
+  extern __thread void* __once_callable;
+  extern __thread void (*__once_call)();
+  extern "C" void __once_proxy(void);
+
+
+  template<typename _Callable, typename... _Args>
+    void
+    call_once(once_flag& __once, _Callable&& __f, _Args&&... __args)
+    {
+
+
+      auto __callable = [&] {
+   std::__invoke(std::forward<_Callable>(__f),
+   std::forward<_Args>(__args)...);
+      };
+
+      __once_callable = std::__addressof(__callable);
+      __once_call = []{ (*(decltype(__callable)*)__once_callable)(); };
+
+
+
+
+
+
+      int __e = __gthread_once(&__once._M_once, &__once_proxy);
+      if (__e)
+ __throw_system_error(__e);
+    }
+
+
+
+
+}
+
+
+
+
+
+namespace llvm {
+class Twine;
+
+
+
+bool llvm_is_multithreaded();
+void llvm_execute_on_thread(void (*UserFn)(void *), void *UserData,
+                            unsigned RequestedStackSize = 0);
+
+
+
+  typedef std::once_flag once_flag;
+  template <typename Function, typename... Args>
+  void call_once(once_flag &flag, Function &&F, Args &&... ArgList) {
+
+    std::call_once(flag, std::forward<Function>(F),
+                   std::forward<Args>(ArgList)...);
+  }
+
+
+
+
+
+
+  unsigned heavyweight_hardware_concurrency();
+
+
+
+
+
+
+
+  unsigned hardware_concurrency();
+
+
+
+
+
+  uint64_t get_threadid();
+
+
+
+  uint32_t get_max_thread_name_length();
+
+
+
+
+
+
+
+  void set_thread_name(const Twine &Name);
+
+
+
+
+
+
+
+  void get_thread_name(SmallVectorImpl<char> &Name);
+}
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+namespace llvm {
+namespace sys {
+
+
+    class RWMutexImpl
+    {
+
+
+    public:
+
+
+
+      explicit RWMutexImpl();
+
+
+
+
+      RWMutexImpl(const RWMutexImpl & original) = delete;
+      RWMutexImpl &operator=(const RWMutexImpl &) = delete;
+
+
+
+
+      ~RWMutexImpl();
+
+
+
+
+    public:
+
+
+
+
+
+
+      bool reader_acquire();
+
+
+
+
+      bool reader_release();
+
+
+
+
+
+
+      bool writer_acquire();
+
+
+
+
+      bool writer_release();
+
+
+
+
+    private:
+
+      void* data_ = nullptr;
+
+    };
+
+
+
+
+    template<bool mt_only>
+    class SmartRWMutex {
+      RWMutexImpl impl;
+      unsigned readers = 0;
+      unsigned writers = 0;
+
+    public:
+      explicit SmartRWMutex() = default;
+      SmartRWMutex(const SmartRWMutex<mt_only> & original) = delete;
+      SmartRWMutex<mt_only> &operator=(const SmartRWMutex<mt_only> &) = delete;
+
+      bool lock_shared() {
+        if (!mt_only || llvm_is_multithreaded())
+          return impl.reader_acquire();
+
+
+
+        ++readers;
+        return true;
+      }
+
+      bool unlock_shared() {
+        if (!mt_only || llvm_is_multithreaded())
+          return impl.reader_release();
+
+
+
+        
+       ((
+       readers > 0 && "Reader lock not acquired before release!"
+       ) ? static_cast<void> (0) : __assert_fail (
+       "readers > 0 && \"Reader lock not acquired before release!\""
+       , "/home/trippels/llvm/llvm/include/llvm/Support/RWMutex.h", 114, __PRETTY_FUNCTION__))
+                                                                        ;
+        --readers;
+        return true;
+      }
+
+      bool lock() {
+        if (!mt_only || llvm_is_multithreaded())
+          return impl.writer_acquire();
+
+
+
+        
+       ((
+       writers == 0 && "Writer lock already acquired!"
+       ) ? static_cast<void> (0) : __assert_fail (
+       "writers == 0 && \"Writer lock already acquired!\""
+       , "/home/trippels/llvm/llvm/include/llvm/Support/RWMutex.h", 125, __PRETTY_FUNCTION__))
+                                                              ;
+        ++writers;
+        return true;
+      }
+
+      bool unlock() {
+        if (!mt_only || llvm_is_multithreaded())
+          return impl.writer_release();
+
+
+
+        
+       ((
+       writers == 1 && "Writer lock not acquired before release!"
+       ) ? static_cast<void> (0) : __assert_fail (
+       "writers == 1 && \"Writer lock not acquired before release!\""
+       , "/home/trippels/llvm/llvm/include/llvm/Support/RWMutex.h", 136, __PRETTY_FUNCTION__))
+                                                                         ;
+        --writers;
+        return true;
+      }
+    };
+
+    typedef SmartRWMutex<false> RWMutex;
+
+
+    template<bool mt_only>
+    struct SmartScopedReader {
+      SmartRWMutex<mt_only>& mutex;
+
+      explicit SmartScopedReader(SmartRWMutex<mt_only>& m) : mutex(m) {
+        mutex.lock_shared();
+      }
+
+      ~SmartScopedReader() {
+        mutex.unlock_shared();
+      }
+    };
+
+    typedef SmartScopedReader<false> ScopedReader;
+
+
+    template<bool mt_only>
+    struct SmartScopedWriter {
+      SmartRWMutex<mt_only>& mutex;
+
+      explicit SmartScopedWriter(SmartRWMutex<mt_only>& m) : mutex(m) {
+        mutex.lock();
+      }
+
+      ~SmartScopedWriter() {
+        mutex.unlock();
+      }
+    };
+
+    typedef SmartScopedWriter<false> ScopedWriter;
+
+}
+}
+
+
+
+namespace llvm {
+
+class PassInfo;
+struct PassRegistrationListener;
+
+
+
+
+
+
+
+class PassRegistry {
+  mutable sys::SmartRWMutex<true> Lock;
+
+
+  using MapType = DenseMap<const void *, const PassInfo *>;
+  MapType PassInfoMap;
+
+  using StringMapType = StringMap<const PassInfo *>;
+  StringMapType PassInfoStringMap;
+
+  std::vector<std::unique_ptr<const PassInfo>> ToFree;
+  std::vector<PassRegistrationListener *> Listeners;
+
+public:
+  PassRegistry() = default;
+  ~PassRegistry();
+
+
+
+
+  static PassRegistry *getPassRegistry();
+
+
+
+  const PassInfo *getPassInfo(const void *TI) const;
+
+
+
+  const PassInfo *getPassInfo(StringRef Arg) const;
+
+
+
+  void registerPass(const PassInfo &PI, bool ShouldFree = false);
+
+
+
+
+  void registerAnalysisGroup(const void *InterfaceID, const void *PassID,
+                             PassInfo &Registeree, bool isDefault,
+                             bool ShouldFree = false);
+
+
+
+  void enumerateWith(PassRegistrationListener *L);
+
+
+
+  void addRegistrationListener(PassRegistrationListener *L);
+
+
+
+  void removeRegistrationListener(PassRegistrationListener *L);
+};
+
+
+inline PassRegistry *unwrap(LLVMPassRegistryRef P) { return reinterpret_cast<PassRegistry*>(P); } inline LLVMPassRegistryRef wrap(const PassRegistry *P) { return reinterpret_cast<LLVMPassRegistryRef>(const_cast<PassRegistry*>(P)); } template<typename T> inline T *unwrap(LLVMPassRegistryRef P) { T *Q = (T*)unwrap(P); 
+((
+Q && "Invalid cast!"
+) ? static_cast<void> (0) : __assert_fail (
+"Q && \"Invalid cast!\""
+, "/home/trippels/llvm/llvm/include/llvm/PassRegistry.h", 94, __PRETTY_FUNCTION__))
+; return Q; }
+
+}
+
+
+
+namespace llvm {
+
+class Pass;
+template <typename PassName> Pass *callDefaultCtor() { return new PassName(); }
+template <typename passName> struct RegisterPass : public PassInfo {
+
+  RegisterPass(StringRef PassArg, StringRef Name, bool CFGOnly = false,
+               bool is_analysis = false)
+      : PassInfo(Name, PassArg, &passName::ID,
+                 PassInfo::NormalCtor_t(callDefaultCtor<passName>), CFGOnly,
+                 is_analysis) {
+    PassRegistry::getPassRegistry()->registerPass(*this);
+  }
+};
+class RegisterAGBase : public PassInfo {
+public:
+  RegisterAGBase(StringRef Name, const void *InterfaceID,
+                 const void *PassID = nullptr, bool isDefault = false);
+};
+
+template <typename Interface, bool Default = false>
+struct RegisterAnalysisGroup : public RegisterAGBase {
+  explicit RegisterAnalysisGroup(PassInfo &RPB)
+      : RegisterAGBase(RPB.getPassName(), &Interface::ID, RPB.getTypeInfo(),
+                       Default) {}
+
+  explicit RegisterAnalysisGroup(const char *Name)
+      : RegisterAGBase(Name, &Interface::ID) {}
+};
+struct PassRegistrationListener {
+  PassRegistrationListener() = default;
+  virtual ~PassRegistrationListener() = default;
+
+
+
+  virtual void passRegistered(const PassInfo *) {}
+
+
+
+  void enumeratePasses();
+
+
+
+  virtual void passEnumerate(const PassInfo *) {}
+};
+
+}
+
+
+
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+
+
+using LLVMTargetDataRef = struct LLVMOpaqueTargetData *;
+
+namespace llvm {
+
+class GlobalVariable;
+class LLVMContext;
+class Module;
+class StructLayout;
+class Triple;
+class Value;
+
+
+enum AlignTypeEnum {
+  INVALID_ALIGN = 0,
+  INTEGER_ALIGN = 'i',
+  VECTOR_ALIGN = 'v',
+  FLOAT_ALIGN = 'f',
+  AGGREGATE_ALIGN = 'a'
+};
+struct LayoutAlignElem {
+
+  unsigned AlignType : 8;
+  unsigned TypeBitWidth : 24;
+  unsigned ABIAlign : 16;
+  unsigned PrefAlign : 16;
+
+  static LayoutAlignElem get(AlignTypeEnum align_type, unsigned abi_align,
+                             unsigned pref_align, uint32_t bit_width);
+
+  bool operator==(const LayoutAlignElem &rhs) const;
+};
+
+
+
+
+
+
+
+struct PointerAlignElem {
+  unsigned ABIAlign;
+  unsigned PrefAlign;
+  uint32_t TypeByteWidth;
+  uint32_t AddressSpace;
+
+
+  static PointerAlignElem get(uint32_t AddressSpace, unsigned ABIAlign,
+                              unsigned PrefAlign, uint32_t TypeByteWidth);
+
+  bool operator==(const PointerAlignElem &rhs) const;
+};
+
+
+
+
+
+
+
+class DataLayout {
+private:
+
+  bool BigEndian;
+
+  unsigned AllocaAddrSpace;
+  unsigned StackNaturalAlign;
+
+  enum ManglingModeT {
+    MM_None,
+    MM_ELF,
+    MM_MachO,
+    MM_WinCOFF,
+    MM_WinCOFFX86,
+    MM_Mips
+  };
+  ManglingModeT ManglingMode;
+
+  SmallVector<unsigned char, 8> LegalIntWidths;
+
+
+
+  using AlignmentsTy = SmallVector<LayoutAlignElem, 16>;
+  AlignmentsTy Alignments;
+
+  AlignmentsTy::const_iterator
+  findAlignmentLowerBound(AlignTypeEnum AlignType, uint32_t BitWidth) const {
+    return const_cast<DataLayout *>(this)->findAlignmentLowerBound(AlignType,
+                                                                   BitWidth);
+  }
+
+  AlignmentsTy::iterator
+  findAlignmentLowerBound(AlignTypeEnum AlignType, uint32_t BitWidth);
+
+
+  std::string StringRepresentation;
+
+  using PointersTy = SmallVector<PointerAlignElem, 8>;
+  PointersTy Pointers;
+
+  PointersTy::const_iterator
+  findPointerLowerBound(uint32_t AddressSpace) const {
+    return const_cast<DataLayout *>(this)->findPointerLowerBound(AddressSpace);
+  }
+
+  PointersTy::iterator findPointerLowerBound(uint32_t AddressSpace);
+
+
+  mutable void *LayoutMap = nullptr;
+
+
+
+  SmallVector<unsigned, 8> NonIntegralAddressSpaces;
+
+  void setAlignment(AlignTypeEnum align_type, unsigned abi_align,
+                    unsigned pref_align, uint32_t bit_width);
+  unsigned getAlignmentInfo(AlignTypeEnum align_type, uint32_t bit_width,
+                            bool ABIAlign, Type *Ty) const;
+  void setPointerAlignment(uint32_t AddrSpace, unsigned ABIAlign,
+                           unsigned PrefAlign, uint32_t TypeByteWidth);
+
+
+  unsigned getAlignment(Type *Ty, bool abi_or_pref) const;
+
+
+
+  void parseSpecifier(StringRef LayoutDescription);
+
+
+  void clear();
+
+public:
+
+  explicit DataLayout(StringRef LayoutDescription) {
+    reset(LayoutDescription);
+  }
+
+
+  explicit DataLayout(const Module *M);
+
+  DataLayout(const DataLayout &DL) { *this = DL; }
+
+  ~DataLayout();
+
+  DataLayout &operator=(const DataLayout &DL) {
+    clear();
+    StringRepresentation = DL.StringRepresentation;
+    BigEndian = DL.isBigEndian();
+    AllocaAddrSpace = DL.AllocaAddrSpace;
+    StackNaturalAlign = DL.StackNaturalAlign;
+    ManglingMode = DL.ManglingMode;
+    LegalIntWidths = DL.LegalIntWidths;
+    Alignments = DL.Alignments;
+    Pointers = DL.Pointers;
+    NonIntegralAddressSpaces = DL.NonIntegralAddressSpaces;
+    return *this;
+  }
+
+  bool operator==(const DataLayout &Other) const;
+  bool operator!=(const DataLayout &Other) const { return !(*this == Other); }
+
+  void init(const Module *M);
+
+
+  void reset(StringRef LayoutDescription);
+
+
+  bool isLittleEndian() const { return !BigEndian; }
+  bool isBigEndian() const { return BigEndian; }
+
+
+
+
+
+
+  const std::string &getStringRepresentation() const {
+    return StringRepresentation;
+  }
+
+
+  bool isDefault() const { return StringRepresentation.empty(); }
+  bool isLegalInteger(uint64_t Width) const {
+    for (unsigned LegalIntWidth : LegalIntWidths)
+      if (LegalIntWidth == Width)
+        return true;
+    return false;
+  }
+
+  bool isIllegalInteger(uint64_t Width) const { return !isLegalInteger(Width); }
+
+
+  bool exceedsNaturalStackAlignment(unsigned Align) const {
+    return (StackNaturalAlign != 0) && (Align > StackNaturalAlign);
+  }
+
+  unsigned getStackAlignment() const { return StackNaturalAlign; }
+  unsigned getAllocaAddrSpace() const { return AllocaAddrSpace; }
+
+  bool hasMicrosoftFastStdCallMangling() const {
+    return ManglingMode == MM_WinCOFFX86;
+  }
+
+  bool hasLinkerPrivateGlobalPrefix() const { return ManglingMode == MM_MachO; }
+
+  StringRef getLinkerPrivateGlobalPrefix() const {
+    if (ManglingMode == MM_MachO)
+      return "l";
+    return "";
+  }
+
+  char getGlobalPrefix() const {
+    switch (ManglingMode) {
+    case MM_None:
+    case MM_ELF:
+    case MM_Mips:
+    case MM_WinCOFF:
+      return '\0';
+    case MM_MachO:
+    case MM_WinCOFFX86:
+      return '_';
+    }
+    ::llvm::llvm_unreachable_internal("invalid mangling mode", "/home/trippels/llvm/llvm/include/llvm/IR/DataLayout.h", 278);
+  }
+
+  StringRef getPrivateGlobalPrefix() const {
+    switch (ManglingMode) {
+    case MM_None:
+      return "";
+    case MM_ELF:
+    case MM_WinCOFF:
+      return ".L";
+    case MM_Mips:
+      return "$";
+    case MM_MachO:
+    case MM_WinCOFFX86:
+      return "L";
+    }
+    ::llvm::llvm_unreachable_internal("invalid mangling mode", "/home/trippels/llvm/llvm/include/llvm/IR/DataLayout.h", 294);
+  }
+
+  static const char *getManglingComponent(const Triple &T);
+
+
+
+
+
+
+  bool fitsInLegalInteger(unsigned Width) const {
+    for (unsigned LegalIntWidth : LegalIntWidths)
+      if (Width <= LegalIntWidth)
+        return true;
+    return false;
+  }
+
+
+  unsigned getPointerABIAlignment(unsigned AS) const;
+
+
+
+
+  unsigned getPointerPrefAlignment(unsigned AS = 0) const;
+
+
+
+
+  unsigned getPointerSize(unsigned AS = 0) const;
+
+
+
+  ArrayRef<unsigned> getNonIntegralAddressSpaces() const {
+    return NonIntegralAddressSpaces;
+  }
+
+  bool isNonIntegralPointerType(PointerType *PT) const {
+    ArrayRef<unsigned> NonIntegralSpaces = getNonIntegralAddressSpaces();
+    return find(NonIntegralSpaces, PT->getAddressSpace()) !=
+           NonIntegralSpaces.end();
+  }
+
+  bool isNonIntegralPointerType(Type *Ty) const {
+    auto *PTy = dyn_cast<PointerType>(Ty);
+    return PTy && isNonIntegralPointerType(PTy);
+  }
+
+
+
+
+  unsigned getPointerSizeInBits(unsigned AS = 0) const {
+    return getPointerSize(AS) * 8;
+  }
+
+
+
+
+
+
+  unsigned getPointerTypeSizeInBits(Type *) const;
+
+  unsigned getPointerTypeSize(Type *Ty) const {
+    return getPointerTypeSizeInBits(Ty) / 8;
+  }
+  uint64_t getTypeSizeInBits(Type *Ty) const;
+
+
+
+
+
+  uint64_t getTypeStoreSize(Type *Ty) const {
+    return (getTypeSizeInBits(Ty) + 7) / 8;
+  }
+
+
+
+
+
+  uint64_t getTypeStoreSizeInBits(Type *Ty) const {
+    return 8 * getTypeStoreSize(Ty);
+  }
+
+
+
+
+
+
+  uint64_t getTypeAllocSize(Type *Ty) const {
+
+    return alignTo(getTypeStoreSize(Ty), getABITypeAlignment(Ty));
+  }
+
+
+
+
+
+
+  uint64_t getTypeAllocSizeInBits(Type *Ty) const {
+    return 8 * getTypeAllocSize(Ty);
+  }
+
+
+  unsigned getABITypeAlignment(Type *Ty) const;
+
+
+
+  unsigned getABIIntegerTypeAlignment(unsigned BitWidth) const;
+
+
+
+
+
+  unsigned getPrefTypeAlignment(Type *Ty) const;
+
+
+
+  unsigned getPreferredTypeAlignmentShift(Type *Ty) const;
+
+
+
+  IntegerType *getIntPtrType(LLVMContext &C, unsigned AddressSpace = 0) const;
+
+
+
+  Type *getIntPtrType(Type *) const;
+
+
+
+  Type *getSmallestLegalIntType(LLVMContext &C, unsigned Width = 0) const;
+
+
+  Type *getLargestLegalIntType(LLVMContext &C) const {
+    unsigned LargestSize = getLargestLegalIntTypeSizeInBits();
+    return (LargestSize == 0) ? nullptr : Type::getIntNTy(C, LargestSize);
+  }
+
+
+
+  unsigned getLargestLegalIntTypeSizeInBits() const;
+
+
+
+
+
+
+  int64_t getIndexedOffsetInType(Type *ElemTy, ArrayRef<Value *> Indices) const;
+
+
+
+
+
+  const StructLayout *getStructLayout(StructType *Ty) const;
+
+
+
+
+  unsigned getPreferredAlignment(const GlobalVariable *GV) const;
+
+
+
+
+
+  unsigned getPreferredAlignmentLog(const GlobalVariable *GV) const;
+};
+
+inline DataLayout *unwrap(LLVMTargetDataRef P) {
+  return reinterpret_cast<DataLayout *>(P);
+}
+
+inline LLVMTargetDataRef wrap(const DataLayout *P) {
+  return reinterpret_cast<LLVMTargetDataRef>(const_cast<DataLayout *>(P));
+}
+
+
+
+class StructLayout {
+  uint64_t StructSize;
+  unsigned StructAlignment;
+  unsigned IsPadded : 1;
+  unsigned NumElements : 31;
+  uint64_t MemberOffsets[1];
+
+public:
+  uint64_t getSizeInBytes() const { return StructSize; }
+
+  uint64_t getSizeInBits() const { return 8 * StructSize; }
+
+  unsigned getAlignment() const { return StructAlignment; }
+
+
+
+  bool hasPadding() const { return IsPadded; }
+
+
+
+  unsigned getElementContainingOffset(uint64_t Offset) const;
+
+  uint64_t getElementOffset(unsigned Idx) const {
+    
+   ((
+   Idx < NumElements && "Invalid element idx!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Idx < NumElements && \"Invalid element idx!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/DataLayout.h", 514, __PRETTY_FUNCTION__))
+                                                      ;
+    return MemberOffsets[Idx];
+  }
+
+  uint64_t getElementOffsetInBits(unsigned Idx) const {
+    return getElementOffset(Idx) * 8;
+  }
+
+private:
+  friend class DataLayout;
+
+  StructLayout(StructType *ST, const DataLayout &DL);
+};
+
+
+
+inline uint64_t DataLayout::getTypeSizeInBits(Type *Ty) const {
+  
+ ((
+ Ty->isSized() && "Cannot getTypeInfo() on a type that is unsized!"
+ ) ? static_cast<void> (0) : __assert_fail (
+ "Ty->isSized() && \"Cannot getTypeInfo() on a type that is unsized!\""
+ , "/home/trippels/llvm/llvm/include/llvm/IR/DataLayout.h", 531, __PRETTY_FUNCTION__))
+                                                                           ;
+  switch (Ty->getTypeID()) {
+  case Type::LabelTyID:
+    return getPointerSizeInBits(0);
+  case Type::PointerTyID:
+    return getPointerSizeInBits(Ty->getPointerAddressSpace());
+  case Type::ArrayTyID: {
+    ArrayType *ATy = cast<ArrayType>(Ty);
+    return ATy->getNumElements() *
+           getTypeAllocSizeInBits(ATy->getElementType());
+  }
+  case Type::StructTyID:
+
+    return getStructLayout(cast<StructType>(Ty))->getSizeInBits();
+  case Type::IntegerTyID:
+    return Ty->getIntegerBitWidth();
+  case Type::HalfTyID:
+    return 16;
+  case Type::FloatTyID:
+    return 32;
+  case Type::DoubleTyID:
+  case Type::X86_MMXTyID:
+    return 64;
+  case Type::PPC_FP128TyID:
+  case Type::FP128TyID:
+    return 128;
+
+
+  case Type::X86_FP80TyID:
+    return 80;
+  case Type::VectorTyID: {
+    VectorType *VTy = cast<VectorType>(Ty);
+    return VTy->getNumElements() * getTypeSizeInBits(VTy->getElementType());
+  }
+  default:
+    ::llvm::llvm_unreachable_internal("DataLayout::getTypeSizeInBits(): Unsupported type", "/home/trippels/llvm/llvm/include/llvm/IR/DataLayout.h", 566);
+  }
+}
+
+}
+
+namespace llvm {
+
+class GlobalIndirectSymbol : public GlobalValue {
+protected:
+  GlobalIndirectSymbol(Type *Ty, ValueTy VTy, unsigned AddressSpace,
+      LinkageTypes Linkage, const Twine &Name, Constant *Symbol);
+
+public:
+  GlobalIndirectSymbol(const GlobalIndirectSymbol &) = delete;
+  GlobalIndirectSymbol &operator=(const GlobalIndirectSymbol &) = delete;
+
+
+  void *operator new(size_t s) {
+    return User::operator new(s, 1);
+  }
+
+
+  public: inline Constant *getOperand(unsigned) const; inline void setOperand(unsigned, Constant*); inline op_iterator op_begin(); inline const_op_iterator op_begin() const; inline op_iterator op_end(); inline const_op_iterator op_end() const; protected: template <int> inline Use &Op(); template <int> inline const Use &Op() const; public: inline unsigned getNumOperands() const;
+
+
+  void setIndirectSymbol(Constant *Symbol) {
+    setOperand(0, Symbol);
+  }
+  const Constant *getIndirectSymbol() const {
+    return getOperand(0);
+  }
+  Constant *getIndirectSymbol() {
+    return const_cast<Constant *>(
+          static_cast<const GlobalIndirectSymbol *>(this)->getIndirectSymbol());
+  }
+
+  const GlobalObject *getBaseObject() const {
+    return dyn_cast<GlobalObject>(getIndirectSymbol()->stripInBoundsOffsets());
+  }
+  GlobalObject *getBaseObject() {
+    return const_cast<GlobalObject *>(
+              static_cast<const GlobalIndirectSymbol *>(this)->getBaseObject());
+  }
+
+  const GlobalObject *getBaseObject(const DataLayout &DL, APInt &Offset) const {
+    return dyn_cast<GlobalObject>(
+        getIndirectSymbol()->stripAndAccumulateInBoundsConstantOffsets(DL,
+                                                                       Offset));
+  }
+  GlobalObject *getBaseObject(const DataLayout &DL, APInt &Offset) {
+    return const_cast<GlobalObject *>(
+                                 static_cast<const GlobalIndirectSymbol *>(this)
+                                   ->getBaseObject(DL, Offset));
+  }
+
+
+  static bool classof(const Value *V) {
+    return V->getValueID() == Value::GlobalAliasVal ||
+           V->getValueID() == Value::GlobalIFuncVal;
+  }
+};
+
+template <>
+struct OperandTraits<GlobalIndirectSymbol> :
+  public FixedNumOperandTraits<GlobalIndirectSymbol, 1> {
+};
+
+GlobalIndirectSymbol::op_iterator GlobalIndirectSymbol::op_begin() { return OperandTraits<GlobalIndirectSymbol>::op_begin(this); } GlobalIndirectSymbol::const_op_iterator GlobalIndirectSymbol::op_begin() const { return OperandTraits<GlobalIndirectSymbol>::op_begin(const_cast<GlobalIndirectSymbol*>(this)); } GlobalIndirectSymbol::op_iterator GlobalIndirectSymbol::op_end() { return OperandTraits<GlobalIndirectSymbol>::op_end(this); } GlobalIndirectSymbol::const_op_iterator GlobalIndirectSymbol::op_end() const { return OperandTraits<GlobalIndirectSymbol>::op_end(const_cast<GlobalIndirectSymbol*>(this)); } Constant *GlobalIndirectSymbol::getOperand(unsigned i_nocapture) const { 
+((
+i_nocapture < OperandTraits<GlobalIndirectSymbol>::operands(this) && "getOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<GlobalIndirectSymbol>::operands(this) && \"getOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/GlobalIndirectSymbol.h", 89, __PRETTY_FUNCTION__))
+; return cast_or_null<Constant>( OperandTraits<GlobalIndirectSymbol>::op_begin(const_cast<GlobalIndirectSymbol*>(this))[i_nocapture].get()); } void GlobalIndirectSymbol::setOperand(unsigned i_nocapture, Constant *Val_nocapture) { 
+((
+i_nocapture < OperandTraits<GlobalIndirectSymbol>::operands(this) && "setOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<GlobalIndirectSymbol>::operands(this) && \"setOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/GlobalIndirectSymbol.h", 89, __PRETTY_FUNCTION__))
+; OperandTraits<GlobalIndirectSymbol>::op_begin(this)[i_nocapture] = Val_nocapture; } unsigned GlobalIndirectSymbol::getNumOperands() const { return OperandTraits<GlobalIndirectSymbol>::operands(this); } template <int Idx_nocapture> Use &GlobalIndirectSymbol::Op() { return this->OpFrom<Idx_nocapture>(this); } template <int Idx_nocapture> const Use &GlobalIndirectSymbol::Op() const { return this->OpFrom<Idx_nocapture>(this); }
+
+}
+
+
+namespace llvm {
+
+class Twine;
+class Module;
+template <typename ValueSubClass> class SymbolTableListTraits;
+
+class GlobalAlias : public GlobalIndirectSymbol,
+                    public ilist_node<GlobalAlias> {
+  friend class SymbolTableListTraits<GlobalAlias>;
+
+  GlobalAlias(Type *Ty, unsigned AddressSpace, LinkageTypes Linkage,
+              const Twine &Name, Constant *Aliasee, Module *Parent);
+
+public:
+  GlobalAlias(const GlobalAlias &) = delete;
+  GlobalAlias &operator=(const GlobalAlias &) = delete;
+
+
+
+  static GlobalAlias *create(Type *Ty, unsigned AddressSpace,
+                             LinkageTypes Linkage, const Twine &Name,
+                             Constant *Aliasee, Module *Parent);
+
+
+  static GlobalAlias *create(Type *Ty, unsigned AddressSpace,
+                             LinkageTypes Linkage, const Twine &Name,
+                             Module *Parent);
+
+
+  static GlobalAlias *create(Type *Ty, unsigned AddressSpace,
+                             LinkageTypes Linkage, const Twine &Name,
+                             GlobalValue *Aliasee);
+
+
+  static GlobalAlias *create(LinkageTypes Linkage, const Twine &Name,
+                             GlobalValue *Aliasee);
+
+
+  static GlobalAlias *create(const Twine &Name, GlobalValue *Aliasee);
+
+  void copyAttributesFrom(const GlobalValue *Src) {
+    GlobalValue::copyAttributesFrom(Src);
+  }
+
+
+
+
+  void removeFromParent();
+
+
+
+
+  void eraseFromParent();
+
+
+  void setAliasee(Constant *Aliasee);
+  const Constant *getAliasee() const {
+    return getIndirectSymbol();
+  }
+  Constant *getAliasee() {
+    return getIndirectSymbol();
+  }
+
+  static bool isValidLinkage(LinkageTypes L) {
+    return isExternalLinkage(L) || isLocalLinkage(L) ||
+      isWeakLinkage(L) || isLinkOnceLinkage(L);
+  }
+
+
+  static bool classof(const Value *V) {
+    return V->getValueID() == Value::GlobalAliasVal;
+  }
+};
+
+}
+namespace llvm {
+
+class Twine;
+class Module;
+
+
+template <typename ValueSubClass> class SymbolTableListTraits;
+
+class GlobalIFunc final : public GlobalIndirectSymbol,
+                          public ilist_node<GlobalIFunc> {
+  friend class SymbolTableListTraits<GlobalIFunc>;
+
+  GlobalIFunc(Type *Ty, unsigned AddressSpace, LinkageTypes Linkage,
+              const Twine &Name, Constant *Resolver, Module *Parent);
+
+public:
+  GlobalIFunc(const GlobalIFunc &) = delete;
+  GlobalIFunc &operator=(const GlobalIFunc &) = delete;
+
+
+
+  static GlobalIFunc *create(Type *Ty, unsigned AddressSpace,
+                             LinkageTypes Linkage, const Twine &Name,
+                             Constant *Resolver, Module *Parent);
+
+  void copyAttributesFrom(const GlobalIFunc *Src) {
+    GlobalValue::copyAttributesFrom(Src);
+  }
+
+
+
+  void removeFromParent();
+
+
+  void eraseFromParent();
+
+
+  void setResolver(Constant *Resolver) {
+    setIndirectSymbol(Resolver);
+  }
+  const Constant *getResolver() const {
+    return getIndirectSymbol();
+  }
+  Constant *getResolver() {
+    return getIndirectSymbol();
+  }
+
+
+  static bool classof(const Value *V) {
+    return V->getValueID() == Value::GlobalIFuncVal;
+  }
+};
+
+}
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+namespace llvm {
+
+class Constant;
+class Module;
+
+template <typename ValueSubClass> class SymbolTableListTraits;
+class DIGlobalVariable;
+class DIGlobalVariableExpression;
+
+class GlobalVariable : public GlobalObject, public ilist_node<GlobalVariable> {
+  friend class SymbolTableListTraits<GlobalVariable>;
+
+  AttributeSet Attrs;
+  bool isConstantGlobal : 1;
+  bool isExternallyInitializedConstant : 1;
+
+
+
+
+public:
+
+
+  GlobalVariable(Type *Ty, bool isConstant, LinkageTypes Linkage,
+                 Constant *Initializer = nullptr, const Twine &Name = "",
+                 ThreadLocalMode = NotThreadLocal, unsigned AddressSpace = 0,
+                 bool isExternallyInitialized = false);
+
+
+  GlobalVariable(Module &M, Type *Ty, bool isConstant,
+                 LinkageTypes Linkage, Constant *Initializer,
+                 const Twine &Name = "", GlobalVariable *InsertBefore = nullptr,
+                 ThreadLocalMode = NotThreadLocal, unsigned AddressSpace = 0,
+                 bool isExternallyInitialized = false);
+  GlobalVariable(const GlobalVariable &) = delete;
+  GlobalVariable &operator=(const GlobalVariable &) = delete;
+
+  ~GlobalVariable() {
+    dropAllReferences();
+
+
+    setGlobalVariableNumOperands(1);
+  }
+
+
+  void *operator new(size_t s) {
+    return User::operator new(s, 1);
+  }
+
+
+  public: inline Value *getOperand(unsigned) const; inline void setOperand(unsigned, Value*); inline op_iterator op_begin(); inline const_op_iterator op_begin() const; inline op_iterator op_end(); inline const_op_iterator op_end() const; protected: template <int> inline Use &Op(); template <int> inline const Use &Op() const; public: inline unsigned getNumOperands() const;
+
+
+
+  inline bool hasInitializer() const { return !isDeclaration(); }
+  inline bool hasDefinitiveInitializer() const {
+    return hasInitializer() &&
+
+
+      !isInterposable() &&
+
+
+      !isExternallyInitialized();
+  }
+
+
+
+  inline bool hasUniqueInitializer() const {
+    return
+
+        isStrongDefinitionForLinker() &&
+
+
+
+        !isExternallyInitialized();
+  }
+
+
+
+
+
+  inline const Constant *getInitializer() const {
+    
+   ((
+   hasInitializer() && "GV doesn't have initializer!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "hasInitializer() && \"GV doesn't have initializer!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/GlobalVariable.h", 131, __PRETTY_FUNCTION__))
+                                                             ;
+    return static_cast<Constant*>(Op<0>().get());
+  }
+  inline Constant *getInitializer() {
+    
+   ((
+   hasInitializer() && "GV doesn't have initializer!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "hasInitializer() && \"GV doesn't have initializer!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/GlobalVariable.h", 135, __PRETTY_FUNCTION__))
+                                                             ;
+    return static_cast<Constant*>(Op<0>().get());
+  }
+
+
+
+  void setInitializer(Constant *InitVal);
+
+
+
+
+
+  bool isConstant() const { return isConstantGlobal; }
+  void setConstant(bool Val) { isConstantGlobal = Val; }
+
+  bool isExternallyInitialized() const {
+    return isExternallyInitializedConstant;
+  }
+  void setExternallyInitialized(bool Val) {
+    isExternallyInitializedConstant = Val;
+  }
+
+
+
+  void copyAttributesFrom(const GlobalVariable *Src);
+
+
+
+
+  void removeFromParent();
+
+
+
+
+  void eraseFromParent();
+
+
+
+  void dropAllReferences();
+
+
+  void addDebugInfo(DIGlobalVariableExpression *GV);
+
+
+  void getDebugInfo(SmallVectorImpl<DIGlobalVariableExpression *> &GVs) const;
+
+
+  void addAttribute(Attribute::AttrKind Kind) {
+    Attrs = Attrs.addAttribute(getContext(), Kind);
+  }
+
+
+  void addAttribute(StringRef Kind, StringRef Val = StringRef()) {
+    Attrs = Attrs.addAttribute(getContext(), Kind, Val);
+  }
+
+
+  bool hasAttribute(Attribute::AttrKind Kind) const {
+    return Attrs.hasAttribute(Kind);
+  }
+
+
+  bool hasAttribute(StringRef Kind) const {
+    return Attrs.hasAttribute(Kind);
+  }
+
+
+  bool hasAttributes() const {
+    return Attrs.hasAttributes();
+  }
+
+
+  Attribute getAttribute(Attribute::AttrKind Kind) const {
+    return Attrs.getAttribute(Kind);
+  }
+
+
+  Attribute getAttribute(StringRef Kind) const {
+    return Attrs.getAttribute(Kind);
+  }
+
+
+  AttributeSet getAttributes() const {
+    return Attrs;
+  }
+
+
+
+
+  AttributeList getAttributesAsList(unsigned index) const {
+    if (!hasAttributes())
+      return AttributeList();
+    std::pair<unsigned, AttributeSet> AS[1] = {{index, Attrs}};
+    return AttributeList::get(getContext(), AS);
+  }
+
+
+  void setAttributes(AttributeSet A) {
+    Attrs = A;
+  }
+
+
+  bool hasImplicitSection() const {
+    return getAttributes().hasAttribute("bss-section") ||
+           getAttributes().hasAttribute("data-section") ||
+           getAttributes().hasAttribute("rodata-section");
+  }
+
+
+  static bool classof(const Value *V) {
+    return V->getValueID() == Value::GlobalVariableVal;
+  }
+};
+
+template <>
+struct OperandTraits<GlobalVariable> :
+  public OptionalOperandTraits<GlobalVariable> {
+};
+
+GlobalVariable::op_iterator GlobalVariable::op_begin() { return OperandTraits<GlobalVariable>::op_begin(this); } GlobalVariable::const_op_iterator GlobalVariable::op_begin() const { return OperandTraits<GlobalVariable>::op_begin(const_cast<GlobalVariable*>(this)); } GlobalVariable::op_iterator GlobalVariable::op_end() { return OperandTraits<GlobalVariable>::op_end(this); } GlobalVariable::const_op_iterator GlobalVariable::op_end() const { return OperandTraits<GlobalVariable>::op_end(const_cast<GlobalVariable*>(this)); } Value *GlobalVariable::getOperand(unsigned i_nocapture) const { 
+((
+i_nocapture < OperandTraits<GlobalVariable>::operands(this) && "getOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<GlobalVariable>::operands(this) && \"getOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/GlobalVariable.h", 254, __PRETTY_FUNCTION__))
+; return cast_or_null<Value>( OperandTraits<GlobalVariable>::op_begin(const_cast<GlobalVariable*>(this))[i_nocapture].get()); } void GlobalVariable::setOperand(unsigned i_nocapture, Value *Val_nocapture) { 
+((
+i_nocapture < OperandTraits<GlobalVariable>::operands(this) && "setOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<GlobalVariable>::operands(this) && \"setOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/GlobalVariable.h", 254, __PRETTY_FUNCTION__))
+; OperandTraits<GlobalVariable>::op_begin(this)[i_nocapture] = Val_nocapture; } unsigned GlobalVariable::getNumOperands() const { return OperandTraits<GlobalVariable>::operands(this); } template <int Idx_nocapture> Use &GlobalVariable::Op() { return this->OpFrom<Idx_nocapture>(this); } template <int Idx_nocapture> const Use &GlobalVariable::Op() const { return this->OpFrom<Idx_nocapture>(this); }
+
+}
+
+
+
+namespace llvm {
+
+
+  namespace Reloc {
+  enum Model { Static, PIC_, DynamicNoPIC, ROPI, RWPI, ROPI_RWPI };
+  }
+
+
+  namespace CodeModel {
+
+  enum Model { Small, Kernel, Medium, Large };
+  }
+
+  namespace PICLevel {
+
+    enum Level { NotPIC=0, SmallPIC=1, BigPIC=2 };
+  }
+
+  namespace PIELevel {
+    enum Level { Default=0, Small=1, Large=2 };
+  }
+
+
+  namespace TLSModel {
+    enum Model {
+      GeneralDynamic,
+      LocalDynamic,
+      InitialExec,
+      LocalExec
+    };
+  }
+
+
+  namespace CodeGenOpt {
+    enum Level {
+      None,
+      Less,
+      Default,
+      Aggressive
+    };
+  }
+
+}
+
+
+
+
+
+
+
+namespace llvm {
+
+class Error;
+class FunctionType;
+class GVMaterializer;
+class LLVMContext;
+class MemoryBuffer;
+class RandomNumberGenerator;
+template <class PtrType> class SmallPtrSetImpl;
+class StructType;
+class Module {
+
+
+public:
+
+  using GlobalListType = SymbolTableList<GlobalVariable>;
+
+  using FunctionListType = SymbolTableList<Function>;
+
+  using AliasListType = SymbolTableList<GlobalAlias>;
+
+  using IFuncListType = SymbolTableList<GlobalIFunc>;
+
+  using NamedMDListType = ilist<NamedMDNode>;
+
+  using ComdatSymTabType = StringMap<Comdat>;
+
+
+  using global_iterator = GlobalListType::iterator;
+
+  using const_global_iterator = GlobalListType::const_iterator;
+
+
+  using iterator = FunctionListType::iterator;
+
+  using const_iterator = FunctionListType::const_iterator;
+
+
+  using reverse_iterator = FunctionListType::reverse_iterator;
+
+  using const_reverse_iterator = FunctionListType::const_reverse_iterator;
+
+
+  using alias_iterator = AliasListType::iterator;
+
+  using const_alias_iterator = AliasListType::const_iterator;
+
+
+  using ifunc_iterator = IFuncListType::iterator;
+
+  using const_ifunc_iterator = IFuncListType::const_iterator;
+
+
+  using named_metadata_iterator = NamedMDListType::iterator;
+
+  using const_named_metadata_iterator = NamedMDListType::const_iterator;
+
+
+  enum ModFlagBehavior {
+
+
+    Error = 1,
+
+
+
+    Warning = 2,
+    Require = 3,
+
+
+
+
+    Override = 4,
+
+
+    Append = 5,
+
+
+
+
+    AppendUnique = 6,
+
+
+    Max = 7,
+
+
+    ModFlagBehaviorFirstVal = Error,
+    ModFlagBehaviorLastVal = Max
+  };
+
+
+
+  static bool isValidModFlagBehavior(Metadata *MD, ModFlagBehavior &MFB);
+
+  struct ModuleFlagEntry {
+    ModFlagBehavior Behavior;
+    MDString *Key;
+    Metadata *Val;
+
+    ModuleFlagEntry(ModFlagBehavior B, MDString *K, Metadata *V)
+        : Behavior(B), Key(K), Val(V) {}
+  };
+
+
+
+
+private:
+  LLVMContext &Context;
+
+  GlobalListType GlobalList;
+  FunctionListType FunctionList;
+  AliasListType AliasList;
+  IFuncListType IFuncList;
+  NamedMDListType NamedMDList;
+  std::string GlobalScopeAsm;
+  ValueSymbolTable *ValSymTab;
+  ComdatSymTabType ComdatSymTab;
+  std::unique_ptr<MemoryBuffer>
+  OwnedMemoryBuffer;
+
+  std::unique_ptr<GVMaterializer>
+  Materializer;
+  std::string ModuleID;
+  std::string SourceFileName;
+
+  std::string TargetTriple;
+
+  void *NamedMDSymTab;
+  DataLayout DL;
+
+  friend class Constant;
+
+
+
+
+public:
+
+
+  explicit Module(StringRef ModuleID, LLVMContext& C);
+
+  ~Module();
+
+
+
+
+
+
+
+  const std::string &getModuleIdentifier() const { return ModuleID; }
+
+
+
+
+
+  const std::string &getSourceFileName() const { return SourceFileName; }
+
+
+
+
+
+  StringRef getName() const { return ModuleID; }
+
+
+
+  const std::string &getDataLayoutStr() const {
+    return DL.getStringRepresentation();
+  }
+
+
+  const DataLayout &getDataLayout() const;
+
+
+
+  const std::string &getTargetTriple() const { return TargetTriple; }
+
+
+
+  LLVMContext &getContext() const { return Context; }
+
+
+
+  const std::string &getModuleInlineAsm() const { return GlobalScopeAsm; }
+  std::unique_ptr<RandomNumberGenerator> createRNG(const Pass* P) const;
+
+
+
+
+
+
+  void setModuleIdentifier(StringRef ID) { ModuleID = ID; }
+
+
+  void setSourceFileName(StringRef Name) { SourceFileName = Name; }
+
+
+  void setDataLayout(StringRef Desc);
+  void setDataLayout(const DataLayout &Other);
+
+
+  void setTargetTriple(StringRef T) { TargetTriple = T; }
+
+
+
+  void setModuleInlineAsm(StringRef Asm) {
+    GlobalScopeAsm = Asm;
+    if (!GlobalScopeAsm.empty() && GlobalScopeAsm.back() != '\n')
+      GlobalScopeAsm += '\n';
+  }
+
+
+
+  void appendModuleInlineAsm(StringRef Asm) {
+    GlobalScopeAsm += Asm;
+    if (!GlobalScopeAsm.empty() && GlobalScopeAsm.back() != '\n')
+      GlobalScopeAsm += '\n';
+  }
+  GlobalValue *getNamedValue(StringRef Name) const;
+
+
+
+  unsigned getMDKindID(StringRef Name) const;
+
+
+
+  void getMDKindNames(SmallVectorImpl<StringRef> &Result) const;
+
+
+
+
+  void getOperandBundleTags(SmallVectorImpl<StringRef> &Result) const;
+
+
+
+  StructType *getTypeByName(StringRef Name) const;
+
+  std::vector<StructType *> getIdentifiedStructTypes() const;
+  Constant *getOrInsertFunction(StringRef Name, FunctionType *T,
+                                AttributeList AttributeList);
+
+  Constant *getOrInsertFunction(StringRef Name, FunctionType *T);
+
+
+
+
+
+
+
+  template<typename... ArgsTy>
+  Constant *getOrInsertFunction(StringRef Name,
+                                AttributeList AttributeList,
+                                Type *RetTy, ArgsTy... Args)
+  {
+    SmallVector<Type*, sizeof...(ArgsTy)> ArgTys{Args...};
+    return getOrInsertFunction(Name,
+                               FunctionType::get(RetTy, ArgTys, false),
+                               AttributeList);
+  }
+
+
+  template<typename... ArgsTy>
+  Constant *getOrInsertFunction(StringRef Name, Type *RetTy, ArgsTy... Args) {
+    return getOrInsertFunction(Name, AttributeList{}, RetTy, Args...);
+  }
+
+
+
+  Function *getFunction(StringRef Name) const;
+  GlobalVariable *getGlobalVariable(StringRef Name) const {
+    return getGlobalVariable(Name, false);
+  }
+
+  GlobalVariable *getGlobalVariable(StringRef Name, bool AllowInternal) const;
+
+  GlobalVariable *getGlobalVariable(StringRef Name,
+                                    bool AllowInternal = false) {
+    return static_cast<const Module *>(this)->getGlobalVariable(Name,
+                                                                AllowInternal);
+  }
+
+
+
+
+  const GlobalVariable *getNamedGlobal(StringRef Name) const {
+    return getGlobalVariable(Name, true);
+  }
+  GlobalVariable *getNamedGlobal(StringRef Name) {
+    return const_cast<GlobalVariable *>(
+                       static_cast<const Module *>(this)->getNamedGlobal(Name));
+  }
+
+
+
+
+
+
+
+  Constant *getOrInsertGlobal(StringRef Name, Type *Ty);
+  GlobalAlias *getNamedAlias(StringRef Name) const;
+  GlobalIFunc *getNamedIFunc(StringRef Name) const;
+
+
+
+
+
+
+
+  NamedMDNode *getNamedMetadata(const Twine &Name) const;
+
+
+
+
+  NamedMDNode *getOrInsertNamedMetadata(StringRef Name);
+
+
+  void eraseNamedMetadata(NamedMDNode *NMD);
+
+
+
+
+
+
+
+  Comdat *getOrInsertComdat(StringRef Name);
+
+
+
+
+
+
+  void getModuleFlagsMetadata(SmallVectorImpl<ModuleFlagEntry> &Flags) const;
+
+
+
+  Metadata *getModuleFlag(StringRef Key) const;
+
+
+
+  NamedMDNode *getModuleFlagsMetadata() const;
+
+
+
+
+  NamedMDNode *getOrInsertModuleFlagsMetadata();
+
+
+
+  void addModuleFlag(ModFlagBehavior Behavior, StringRef Key, Metadata *Val);
+  void addModuleFlag(ModFlagBehavior Behavior, StringRef Key, Constant *Val);
+  void addModuleFlag(ModFlagBehavior Behavior, StringRef Key, uint32_t Val);
+  void addModuleFlag(MDNode *Node);
+  void setMaterializer(GVMaterializer *GVM);
+
+  GVMaterializer *getMaterializer() const { return Materializer.get(); }
+  bool isMaterialized() const { return !getMaterializer(); }
+
+
+  llvm::Error materialize(GlobalValue *GV);
+
+
+
+  llvm::Error materializeAll();
+
+  llvm::Error materializeMetadata();
+
+
+
+
+
+
+  const GlobalListType &getGlobalList() const { return GlobalList; }
+
+  GlobalListType &getGlobalList() { return GlobalList; }
+
+  static GlobalListType Module::*getSublistAccess(GlobalVariable*) {
+    return &Module::GlobalList;
+  }
+
+
+  const FunctionListType &getFunctionList() const { return FunctionList; }
+
+  FunctionListType &getFunctionList() { return FunctionList; }
+  static FunctionListType Module::*getSublistAccess(Function*) {
+    return &Module::FunctionList;
+  }
+
+
+  const AliasListType &getAliasList() const { return AliasList; }
+
+  AliasListType &getAliasList() { return AliasList; }
+
+  static AliasListType Module::*getSublistAccess(GlobalAlias*) {
+    return &Module::AliasList;
+  }
+
+
+  const IFuncListType &getIFuncList() const { return IFuncList; }
+
+  IFuncListType &getIFuncList() { return IFuncList; }
+
+  static IFuncListType Module::*getSublistAccess(GlobalIFunc*) {
+    return &Module::IFuncList;
+  }
+
+
+  const NamedMDListType &getNamedMDList() const { return NamedMDList; }
+
+  NamedMDListType &getNamedMDList() { return NamedMDList; }
+
+  static NamedMDListType Module::*getSublistAccess(NamedMDNode*) {
+    return &Module::NamedMDList;
+  }
+
+
+  const ValueSymbolTable &getValueSymbolTable() const { return *ValSymTab; }
+
+  ValueSymbolTable &getValueSymbolTable() { return *ValSymTab; }
+
+
+  const ComdatSymTabType &getComdatSymbolTable() const { return ComdatSymTab; }
+
+  ComdatSymTabType &getComdatSymbolTable() { return ComdatSymTab; }
+
+
+
+
+
+  global_iterator global_begin() { return GlobalList.begin(); }
+  const_global_iterator global_begin() const { return GlobalList.begin(); }
+  global_iterator global_end () { return GlobalList.end(); }
+  const_global_iterator global_end () const { return GlobalList.end(); }
+  bool global_empty() const { return GlobalList.empty(); }
+
+  iterator_range<global_iterator> globals() {
+    return make_range(global_begin(), global_end());
+  }
+  iterator_range<const_global_iterator> globals() const {
+    return make_range(global_begin(), global_end());
+  }
+
+
+
+
+
+  iterator begin() { return FunctionList.begin(); }
+  const_iterator begin() const { return FunctionList.begin(); }
+  iterator end () { return FunctionList.end(); }
+  const_iterator end () const { return FunctionList.end(); }
+  reverse_iterator rbegin() { return FunctionList.rbegin(); }
+  const_reverse_iterator rbegin() const{ return FunctionList.rbegin(); }
+  reverse_iterator rend() { return FunctionList.rend(); }
+  const_reverse_iterator rend() const { return FunctionList.rend(); }
+  size_t size() const { return FunctionList.size(); }
+  bool empty() const { return FunctionList.empty(); }
+
+  iterator_range<iterator> functions() {
+    return make_range(begin(), end());
+  }
+  iterator_range<const_iterator> functions() const {
+    return make_range(begin(), end());
+  }
+
+
+
+
+
+  alias_iterator alias_begin() { return AliasList.begin(); }
+  const_alias_iterator alias_begin() const { return AliasList.begin(); }
+  alias_iterator alias_end () { return AliasList.end(); }
+  const_alias_iterator alias_end () const { return AliasList.end(); }
+  size_t alias_size () const { return AliasList.size(); }
+  bool alias_empty() const { return AliasList.empty(); }
+
+  iterator_range<alias_iterator> aliases() {
+    return make_range(alias_begin(), alias_end());
+  }
+  iterator_range<const_alias_iterator> aliases() const {
+    return make_range(alias_begin(), alias_end());
+  }
+
+
+
+
+
+  ifunc_iterator ifunc_begin() { return IFuncList.begin(); }
+  const_ifunc_iterator ifunc_begin() const { return IFuncList.begin(); }
+  ifunc_iterator ifunc_end () { return IFuncList.end(); }
+  const_ifunc_iterator ifunc_end () const { return IFuncList.end(); }
+  size_t ifunc_size () const { return IFuncList.size(); }
+  bool ifunc_empty() const { return IFuncList.empty(); }
+
+  iterator_range<ifunc_iterator> ifuncs() {
+    return make_range(ifunc_begin(), ifunc_end());
+  }
+  iterator_range<const_ifunc_iterator> ifuncs() const {
+    return make_range(ifunc_begin(), ifunc_end());
+  }
+
+
+
+
+
+  using global_object_iterator =
+      concat_iterator<GlobalObject, iterator, global_iterator>;
+  using const_global_object_iterator =
+      concat_iterator<const GlobalObject, const_iterator,
+                      const_global_iterator>;
+
+  iterator_range<global_object_iterator> global_objects() {
+    return concat<GlobalObject>(functions(), globals());
+  }
+  iterator_range<const_global_object_iterator> global_objects() const {
+    return concat<const GlobalObject>(functions(), globals());
+  }
+
+  global_object_iterator global_object_begin() {
+    return global_objects().begin();
+  }
+  global_object_iterator global_object_end() { return global_objects().end(); }
+
+  const_global_object_iterator global_object_begin() const {
+    return global_objects().begin();
+  }
+  const_global_object_iterator global_object_end() const {
+    return global_objects().end();
+  }
+
+  using global_value_iterator =
+      concat_iterator<GlobalValue, iterator, global_iterator, alias_iterator,
+                      ifunc_iterator>;
+  using const_global_value_iterator =
+      concat_iterator<const GlobalValue, const_iterator, const_global_iterator,
+                      const_alias_iterator, const_ifunc_iterator>;
+
+  iterator_range<global_value_iterator> global_values() {
+    return concat<GlobalValue>(functions(), globals(), aliases(), ifuncs());
+  }
+  iterator_range<const_global_value_iterator> global_values() const {
+    return concat<const GlobalValue>(functions(), globals(), aliases(),
+                                     ifuncs());
+  }
+
+  global_value_iterator global_value_begin() { return global_values().begin(); }
+  global_value_iterator global_value_end() { return global_values().end(); }
+
+  const_global_value_iterator global_value_begin() const {
+    return global_values().begin();
+  }
+  const_global_value_iterator global_value_end() const {
+    return global_values().end();
+  }
+
+
+
+
+
+  named_metadata_iterator named_metadata_begin() { return NamedMDList.begin(); }
+  const_named_metadata_iterator named_metadata_begin() const {
+    return NamedMDList.begin();
+  }
+
+  named_metadata_iterator named_metadata_end() { return NamedMDList.end(); }
+  const_named_metadata_iterator named_metadata_end() const {
+    return NamedMDList.end();
+  }
+
+  size_t named_metadata_size() const { return NamedMDList.size(); }
+  bool named_metadata_empty() const { return NamedMDList.empty(); }
+
+  iterator_range<named_metadata_iterator> named_metadata() {
+    return make_range(named_metadata_begin(), named_metadata_end());
+  }
+  iterator_range<const_named_metadata_iterator> named_metadata() const {
+    return make_range(named_metadata_begin(), named_metadata_end());
+  }
+
+
+  class debug_compile_units_iterator
+      : public std::iterator<std::input_iterator_tag, DICompileUnit *> {
+    NamedMDNode *CUs;
+    unsigned Idx;
+
+    void SkipNoDebugCUs();
+
+  public:
+    explicit debug_compile_units_iterator(NamedMDNode *CUs, unsigned Idx)
+        : CUs(CUs), Idx(Idx) {
+      SkipNoDebugCUs();
+    }
+
+    debug_compile_units_iterator &operator++() {
+      ++Idx;
+      SkipNoDebugCUs();
+      return *this;
+    }
+
+    debug_compile_units_iterator operator++(int) {
+      debug_compile_units_iterator T(*this);
+      ++Idx;
+      return T;
+    }
+
+    bool operator==(const debug_compile_units_iterator &I) const {
+      return Idx == I.Idx;
+    }
+
+    bool operator!=(const debug_compile_units_iterator &I) const {
+      return Idx != I.Idx;
+    }
+
+    DICompileUnit *operator*() const;
+    DICompileUnit *operator->() const;
+  };
+
+  debug_compile_units_iterator debug_compile_units_begin() const {
+    auto *CUs = getNamedMetadata("llvm.dbg.cu");
+    return debug_compile_units_iterator(CUs, 0);
+  }
+
+  debug_compile_units_iterator debug_compile_units_end() const {
+    auto *CUs = getNamedMetadata("llvm.dbg.cu");
+    return debug_compile_units_iterator(CUs, CUs ? CUs->getNumOperands() : 0);
+  }
+
+
+
+
+  iterator_range<debug_compile_units_iterator> debug_compile_units() const {
+    auto *CUs = getNamedMetadata("llvm.dbg.cu");
+    return make_range(
+        debug_compile_units_iterator(CUs, 0),
+        debug_compile_units_iterator(CUs, CUs ? CUs->getNumOperands() : 0));
+  }
+  void dropTriviallyDeadConstantArrays();
+  void print(raw_ostream &OS, AssemblyAnnotationWriter *AAW,
+             bool ShouldPreserveUseListOrder = false,
+             bool IsForDebug = false) const;
+
+
+  void dump() const;
+
+
+
+
+
+
+
+  void dropAllReferences();
+
+
+
+
+
+
+
+  unsigned getNumberRegisterParameters() const;
+
+
+  unsigned getDwarfVersion() const;
+
+
+
+  unsigned getCodeViewFlag() const;
+
+
+
+
+
+
+  PICLevel::Level getPICLevel() const;
+
+
+  void setPICLevel(PICLevel::Level PL);
+
+
+
+
+
+
+
+  PIELevel::Level getPIELevel() const;
+
+
+  void setPIELevel(PIELevel::Level PL);
+
+
+
+
+
+
+  void setProfileSummary(Metadata *M);
+
+
+  Metadata *getProfileSummary();
+
+
+
+  void setOwnedMemoryBuffer(std::unique_ptr<MemoryBuffer> MB);
+};
+
+
+
+GlobalVariable *collectUsedGlobalVariables(const Module &M,
+                                           SmallPtrSetImpl<GlobalValue *> &Set,
+                                           bool CompilerUsed);
+
+
+inline raw_ostream &operator<<(raw_ostream &O, const Module &M) {
+  M.print(O, nullptr);
+  return O;
+}
+
+
+inline Module *unwrap(LLVMModuleRef P) { return reinterpret_cast<Module*>(P); } inline LLVMModuleRef wrap(const Module *P) { return reinterpret_cast<LLVMModuleRef>(const_cast<Module*>(P)); }
+
+
+
+
+inline Module *unwrap(LLVMModuleProviderRef MP) {
+  return reinterpret_cast<Module*>(MP);
+}
+
+}
+namespace llvm {
+
+template <typename IRUnitT> class AllAnalysesOn;
+template <typename IRUnitT, typename... ExtraArgTs> class AnalysisManager;
+class PreservedAnalyses;
+
+
+namespace detail {
+
+
+
+template <typename IRUnitT, typename AnalysisManagerT, typename... ExtraArgTs>
+struct PassConcept {
+
+  virtual ~PassConcept() = default;
+
+
+
+
+
+
+  virtual PreservedAnalyses run(IRUnitT &IR, AnalysisManagerT &AM,
+                                ExtraArgTs... ExtraArgs) = 0;
+
+
+  virtual StringRef name() = 0;
+};
+
+
+
+
+
+
+template <typename IRUnitT, typename PassT, typename PreservedAnalysesT,
+          typename AnalysisManagerT, typename... ExtraArgTs>
+struct PassModel : PassConcept<IRUnitT, AnalysisManagerT, ExtraArgTs...> {
+  explicit PassModel(PassT Pass) : Pass(std::move(Pass)) {}
+
+
+  PassModel(const PassModel &Arg) : Pass(Arg.Pass) {}
+  PassModel(PassModel &&Arg) : Pass(std::move(Arg.Pass)) {}
+
+  friend void swap(PassModel &LHS, PassModel &RHS) {
+    using std::swap;
+    swap(LHS.Pass, RHS.Pass);
+  }
+
+  PassModel &operator=(PassModel RHS) {
+    swap(*this, RHS);
+    return *this;
+  }
+
+  PreservedAnalysesT run(IRUnitT &IR, AnalysisManagerT &AM,
+                         ExtraArgTs... ExtraArgs) override {
+    return Pass.run(IR, AM, ExtraArgs...);
+  }
+
+  StringRef name() override { return PassT::name(); }
+
+  PassT Pass;
+};
+
+
+
+
+
+template <typename IRUnitT, typename PreservedAnalysesT, typename InvalidatorT>
+struct AnalysisResultConcept {
+  virtual ~AnalysisResultConcept() = default;
+  virtual bool invalidate(IRUnitT &IR, const PreservedAnalysesT &PA,
+                          InvalidatorT &Inv) = 0;
+};
+
+
+
+template <typename IRUnitT, typename ResultT> class ResultHasInvalidateMethod {
+  using EnabledType = char;
+  struct DisabledType {
+    char a, b;
+  };
+
+
+
+
+  template <typename T> struct Nonce { using Type = EnabledType; };
+  template <typename T>
+  static typename Nonce<decltype(std::declval<T>().invalidate(
+      std::declval<IRUnitT &>(), std::declval<PreservedAnalyses>()))>::Type
+      check(rank<2>);
+
+
+
+
+
+  template <typename T, typename U> static DisabledType NonceFunction(T U::*);
+  struct CheckerBase { int invalidate; };
+  template <typename T> struct Checker : CheckerBase, T {};
+  template <typename T>
+  static decltype(NonceFunction(&Checker<T>::invalidate)) check(rank<1>);
+
+
+
+  template <typename T>
+  static EnabledType check(rank<0>);
+
+public:
+  enum { Value = sizeof(check<ResultT>(rank<2>())) == sizeof(EnabledType) };
+};
+
+
+
+
+
+
+
+template <typename IRUnitT, typename PassT, typename ResultT,
+          typename PreservedAnalysesT, typename InvalidatorT,
+          bool HasInvalidateHandler =
+              ResultHasInvalidateMethod<IRUnitT, ResultT>::Value>
+struct AnalysisResultModel;
+
+
+
+template <typename IRUnitT, typename PassT, typename ResultT,
+          typename PreservedAnalysesT, typename InvalidatorT>
+struct AnalysisResultModel<IRUnitT, PassT, ResultT, PreservedAnalysesT,
+                           InvalidatorT, false>
+    : AnalysisResultConcept<IRUnitT, PreservedAnalysesT, InvalidatorT> {
+  explicit AnalysisResultModel(ResultT Result) : Result(std::move(Result)) {}
+
+
+  AnalysisResultModel(const AnalysisResultModel &Arg) : Result(Arg.Result) {}
+  AnalysisResultModel(AnalysisResultModel &&Arg)
+      : Result(std::move(Arg.Result)) {}
+
+  friend void swap(AnalysisResultModel &LHS, AnalysisResultModel &RHS) {
+    using std::swap;
+    swap(LHS.Result, RHS.Result);
+  }
+
+  AnalysisResultModel &operator=(AnalysisResultModel RHS) {
+    swap(*this, RHS);
+    return *this;
+  }
+
+
+
+
+
+
+  bool invalidate(IRUnitT &, const PreservedAnalysesT &PA,
+                  InvalidatorT &) override {
+    auto PAC = PA.template getChecker<PassT>();
+    return !PAC.preserved() &&
+           !PAC.template preservedSet<AllAnalysesOn<IRUnitT>>();
+  }
+
+  ResultT Result;
+};
+
+
+
+template <typename IRUnitT, typename PassT, typename ResultT,
+          typename PreservedAnalysesT, typename InvalidatorT>
+struct AnalysisResultModel<IRUnitT, PassT, ResultT, PreservedAnalysesT,
+                           InvalidatorT, true>
+    : AnalysisResultConcept<IRUnitT, PreservedAnalysesT, InvalidatorT> {
+  explicit AnalysisResultModel(ResultT Result) : Result(std::move(Result)) {}
+
+
+  AnalysisResultModel(const AnalysisResultModel &Arg) : Result(Arg.Result) {}
+  AnalysisResultModel(AnalysisResultModel &&Arg)
+      : Result(std::move(Arg.Result)) {}
+
+  friend void swap(AnalysisResultModel &LHS, AnalysisResultModel &RHS) {
+    using std::swap;
+    swap(LHS.Result, RHS.Result);
+  }
+
+  AnalysisResultModel &operator=(AnalysisResultModel RHS) {
+    swap(*this, RHS);
+    return *this;
+  }
+
+
+  bool invalidate(IRUnitT &IR, const PreservedAnalysesT &PA,
+                  InvalidatorT &Inv) override {
+    return Result.invalidate(IR, PA, Inv);
+  }
+
+  ResultT Result;
+};
+
+
+
+
+
+template <typename IRUnitT, typename PreservedAnalysesT, typename InvalidatorT,
+          typename... ExtraArgTs>
+struct AnalysisPassConcept {
+  virtual ~AnalysisPassConcept() = default;
+
+
+
+
+  virtual std::unique_ptr<
+      AnalysisResultConcept<IRUnitT, PreservedAnalysesT, InvalidatorT>>
+  run(IRUnitT &IR, AnalysisManager<IRUnitT, ExtraArgTs...> &AM,
+      ExtraArgTs... ExtraArgs) = 0;
+
+
+  virtual StringRef name() = 0;
+};
+
+
+
+
+
+
+template <typename IRUnitT, typename PassT, typename PreservedAnalysesT,
+          typename InvalidatorT, typename... ExtraArgTs>
+struct AnalysisPassModel : AnalysisPassConcept<IRUnitT, PreservedAnalysesT,
+                                               InvalidatorT, ExtraArgTs...> {
+  explicit AnalysisPassModel(PassT Pass) : Pass(std::move(Pass)) {}
+
+
+  AnalysisPassModel(const AnalysisPassModel &Arg) : Pass(Arg.Pass) {}
+  AnalysisPassModel(AnalysisPassModel &&Arg) : Pass(std::move(Arg.Pass)) {}
+
+  friend void swap(AnalysisPassModel &LHS, AnalysisPassModel &RHS) {
+    using std::swap;
+    swap(LHS.Pass, RHS.Pass);
+  }
+
+  AnalysisPassModel &operator=(AnalysisPassModel RHS) {
+    swap(*this, RHS);
+    return *this;
+  }
+
+
+  using ResultModelT =
+      AnalysisResultModel<IRUnitT, PassT, typename PassT::Result,
+                          PreservedAnalysesT, InvalidatorT>;
+
+
+
+
+  std::unique_ptr<
+      AnalysisResultConcept<IRUnitT, PreservedAnalysesT, InvalidatorT>>
+  run(IRUnitT &IR, AnalysisManager<IRUnitT, ExtraArgTs...> &AM,
+      ExtraArgTs... ExtraArgs) override {
+    return llvm::make_unique<ResultModelT>(Pass.run(IR, AM, ExtraArgs...));
+  }
+
+
+
+
+  StringRef name() override { return PassT::name(); }
+
+  PassT Pass;
+};
+
+}
+
+}
+namespace llvm {
+
+class raw_ostream;
+
+
+
+
+
+
+
+bool isCurrentDebugType(const char *Type);
+
+
+
+
+
+void setCurrentDebugType(const char *Type);
+
+
+
+
+
+void setCurrentDebugTypes(const char **Types, unsigned Count);
+extern bool DebugFlag;
+extern bool VerifyDomInfo;
+
+
+
+extern bool VerifyLoopInfo;
+extern bool EnableDebugBuffering;
+
+
+
+
+raw_ostream &dbgs();
+}
+namespace llvm {
+template <typename DesiredTypeName>
+inline StringRef getTypeName() {
+
+  StringRef Name = __PRETTY_FUNCTION__;
+
+  StringRef Key = "DesiredTypeName = ";
+  Name = Name.substr(Name.find(Key));
+  
+ ((
+ !Name.empty() && "Unable to find the template parameter!"
+ ) ? static_cast<void> (0) : __assert_fail (
+ "!Name.empty() && \"Unable to find the template parameter!\""
+ , "/home/trippels/llvm/llvm/include/llvm/Support/TypeName.h", 34, __PRETTY_FUNCTION__))
+                                                                  ;
+  Name = Name.drop_front(Key.size());
+
+  
+ ((
+ Name.endswith("]") && "Name doesn't end in the substitution key!"
+ ) ? static_cast<void> (0) : __assert_fail (
+ "Name.endswith(\"]\") && \"Name doesn't end in the substitution key!\""
+ , "/home/trippels/llvm/llvm/include/llvm/Support/TypeName.h", 37, __PRETTY_FUNCTION__))
+                                                                          ;
+  return Name.drop_back(1);
+}
+
+}
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+       
+
+
+
+
+namespace llvm {
+
+class formatv_object_base;
+class format_object_base;
+class FormattedString;
+class FormattedNumber;
+class FormattedBytes;
+
+namespace sys {
+namespace fs {
+enum OpenFlags : unsigned;
+}
+}
+
+
+
+
+
+class raw_ostream {
+private:
+  char *OutBufStart, *OutBufEnd, *OutBufCur;
+
+  enum BufferKind {
+    Unbuffered = 0,
+    InternalBuffer,
+    ExternalBuffer
+  } BufferMode;
+
+public:
+
+  enum Colors {
+    BLACK = 0,
+    RED,
+    GREEN,
+    YELLOW,
+    BLUE,
+    MAGENTA,
+    CYAN,
+    WHITE,
+    SAVEDCOLOR
+  };
+
+  explicit raw_ostream(bool unbuffered = false)
+      : BufferMode(unbuffered ? Unbuffered : InternalBuffer) {
+
+    OutBufStart = OutBufEnd = OutBufCur = nullptr;
+  }
+
+  raw_ostream(const raw_ostream &) = delete;
+  void operator=(const raw_ostream &) = delete;
+
+  virtual ~raw_ostream();
+
+
+  uint64_t tell() const { return current_pos() + GetNumBytesInBuffer(); }
+
+
+
+
+
+
+
+  void SetBuffered();
+
+
+  void SetBufferSize(size_t Size) {
+    flush();
+    SetBufferAndMode(new char[Size], Size, InternalBuffer);
+  }
+
+  size_t GetBufferSize() const {
+
+
+    if (BufferMode != Unbuffered && OutBufStart == nullptr)
+      return preferred_buffer_size();
+
+
+    return OutBufEnd - OutBufStart;
+  }
+
+
+
+
+  void SetUnbuffered() {
+    flush();
+    SetBufferAndMode(nullptr, 0, Unbuffered);
+  }
+
+  size_t GetNumBytesInBuffer() const {
+    return OutBufCur - OutBufStart;
+  }
+
+
+
+
+
+  void flush() {
+    if (OutBufCur != OutBufStart)
+      flush_nonempty();
+  }
+
+  raw_ostream &operator<<(char C) {
+    if (OutBufCur >= OutBufEnd)
+      return write(C);
+    *OutBufCur++ = C;
+    return *this;
+  }
+
+  raw_ostream &operator<<(unsigned char C) {
+    if (OutBufCur >= OutBufEnd)
+      return write(C);
+    *OutBufCur++ = C;
+    return *this;
+  }
+
+  raw_ostream &operator<<(signed char C) {
+    if (OutBufCur >= OutBufEnd)
+      return write(C);
+    *OutBufCur++ = C;
+    return *this;
+  }
+
+  raw_ostream &operator<<(StringRef Str) {
+
+    size_t Size = Str.size();
+
+
+    if (Size > (size_t)(OutBufEnd - OutBufCur))
+      return write(Str.data(), Size);
+
+    if (Size) {
+      memcpy(OutBufCur, Str.data(), Size);
+      OutBufCur += Size;
+    }
+    return *this;
+  }
+
+  raw_ostream &operator<<(const char *Str) {
+
+
+
+    return this->operator<<(StringRef(Str));
+  }
+
+  raw_ostream &operator<<(const std::string &Str) {
+
+    return write(Str.data(), Str.length());
+  }
+
+  raw_ostream &operator<<(const SmallVectorImpl<char> &Str) {
+    return write(Str.data(), Str.size());
+  }
+
+  raw_ostream &operator<<(unsigned long N);
+  raw_ostream &operator<<(long N);
+  raw_ostream &operator<<(unsigned long long N);
+  raw_ostream &operator<<(long long N);
+  raw_ostream &operator<<(const void *P);
+
+  raw_ostream &operator<<(unsigned int N) {
+    return this->operator<<(static_cast<unsigned long>(N));
+  }
+
+  raw_ostream &operator<<(int N) {
+    return this->operator<<(static_cast<long>(N));
+  }
+
+  raw_ostream &operator<<(double N);
+
+
+  raw_ostream &write_hex(unsigned long long N);
+
+
+  using uuid_t = uint8_t[16];
+  raw_ostream &write_uuid(const uuid_t UUID);
+
+
+
+  raw_ostream &write_escaped(StringRef Str, bool UseHexEscapes = false);
+
+  raw_ostream &write(unsigned char C);
+  raw_ostream &write(const char *Ptr, size_t Size);
+
+
+  raw_ostream &operator<<(const format_object_base &Fmt);
+
+
+  raw_ostream &operator<<(const FormattedString &);
+
+
+  raw_ostream &operator<<(const FormattedNumber &);
+
+
+  raw_ostream &operator<<(const formatv_object_base &);
+
+
+  raw_ostream &operator<<(const FormattedBytes &);
+
+
+  raw_ostream &indent(unsigned NumSpaces);
+  virtual raw_ostream &changeColor(enum Colors Color,
+                                   bool Bold = false,
+                                   bool BG = false) {
+    (void)Color;
+    (void)Bold;
+    (void)BG;
+    return *this;
+  }
+
+
+
+  virtual raw_ostream &resetColor() { return *this; }
+
+
+  virtual raw_ostream &reverseColor() { return *this; }
+
+
+
+
+  virtual bool is_displayed() const { return false; }
+
+
+  virtual bool has_colors() const { return is_displayed(); }
+
+
+
+
+
+private:
+  virtual void write_impl(const char *Ptr, size_t Size) = 0;
+
+
+  virtual void handle();
+
+
+
+  virtual uint64_t current_pos() const = 0;
+
+protected:
+
+
+
+  void SetBuffer(char *BufferStart, size_t Size) {
+    SetBufferAndMode(BufferStart, Size, ExternalBuffer);
+  }
+
+
+  virtual size_t preferred_buffer_size() const;
+
+
+
+  const char *getBufferStart() const { return OutBufStart; }
+
+
+
+
+private:
+
+  void SetBufferAndMode(char *BufferStart, size_t Size, BufferKind Mode);
+
+
+
+  void flush_nonempty();
+
+
+
+  void copy_to_buffer(const char *Ptr, size_t Size);
+};
+
+
+
+
+class raw_pwrite_stream : public raw_ostream {
+  virtual void pwrite_impl(const char *Ptr, size_t Size, uint64_t Offset) = 0;
+
+public:
+  explicit raw_pwrite_stream(bool Unbuffered = false)
+      : raw_ostream(Unbuffered) {}
+  void pwrite(const char *Ptr, size_t Size, uint64_t Offset) {
+
+    uint64_t Pos = tell();
+
+
+    if (Pos)
+      
+     ((
+     Size + Offset <= Pos && "We don't support extending the stream"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "Size + Offset <= Pos && \"We don't support extending the stream\""
+     , "/home/trippels/llvm/llvm/include/llvm/Support/raw_ostream.h", 349, __PRETTY_FUNCTION__))
+                                                                            ;
+
+    pwrite_impl(Ptr, Size, Offset);
+  }
+};
+
+
+
+
+
+
+
+class raw_fd_ostream : public raw_pwrite_stream {
+  int FD;
+  bool ShouldClose;
+
+  std::error_code EC;
+
+  uint64_t pos;
+
+  bool SupportsSeeking;
+
+
+  void write_impl(const char *Ptr, size_t Size) override;
+
+  void pwrite_impl(const char *Ptr, size_t Size, uint64_t Offset) override;
+
+
+
+  uint64_t current_pos() const override { return pos; }
+
+
+  size_t preferred_buffer_size() const override;
+
+
+  void error_detected(std::error_code EC) { this->EC = EC; }
+
+public:
+  raw_fd_ostream(StringRef Filename, std::error_code &EC,
+                 sys::fs::OpenFlags Flags);
+
+
+
+
+  raw_fd_ostream(int fd, bool shouldClose, bool unbuffered=false);
+
+  ~raw_fd_ostream() override;
+
+
+
+  void close();
+
+  bool supportsSeeking() { return SupportsSeeking; }
+
+
+
+  uint64_t seek(uint64_t off);
+
+  raw_ostream &changeColor(enum Colors colors, bool bold=false,
+                           bool bg=false) override;
+  raw_ostream &resetColor() override;
+
+  raw_ostream &reverseColor() override;
+
+  bool is_displayed() const override;
+
+  bool has_colors() const override;
+
+  std::error_code error() const { return EC; }
+
+
+
+
+
+  bool has_error() const { return bool(EC); }
+  void clear_error() { EC = std::error_code(); }
+};
+
+
+
+raw_ostream &outs();
+
+
+
+raw_ostream &errs();
+
+
+raw_ostream &nulls();
+
+
+
+
+
+
+
+class raw_string_ostream : public raw_ostream {
+  std::string &OS;
+
+
+  void write_impl(const char *Ptr, size_t Size) override;
+
+
+
+  uint64_t current_pos() const override { return OS.size(); }
+
+public:
+  explicit raw_string_ostream(std::string &O) : OS(O) {}
+  ~raw_string_ostream() override;
+
+
+
+  std::string& str() {
+    flush();
+    return OS;
+  }
+};
+
+
+
+
+
+
+class raw_svector_ostream : public raw_pwrite_stream {
+  SmallVectorImpl<char> &OS;
+
+
+  void write_impl(const char *Ptr, size_t Size) override;
+
+  void pwrite_impl(const char *Ptr, size_t Size, uint64_t Offset) override;
+
+
+  uint64_t current_pos() const override;
+
+public:
+
+
+
+
+  explicit raw_svector_ostream(SmallVectorImpl<char> &O) : OS(O) {
+    SetUnbuffered();
+  }
+
+  ~raw_svector_ostream() override = default;
+
+  void flush() = delete;
+
+
+  StringRef str() { return StringRef(OS.data(), OS.size()); }
+};
+
+
+class raw_null_ostream : public raw_pwrite_stream {
+
+  void write_impl(const char *Ptr, size_t size) override;
+  void pwrite_impl(const char *Ptr, size_t Size, uint64_t Offset) override;
+
+
+
+  uint64_t current_pos() const override;
+
+public:
+  explicit raw_null_ostream() = default;
+  ~raw_null_ostream() override;
+};
+
+class buffer_ostream : public raw_svector_ostream {
+  raw_ostream &OS;
+  SmallVector<char, 0> Buffer;
+
+public:
+  buffer_ostream(raw_ostream &OS) : raw_svector_ostream(Buffer), OS(OS) {}
+  ~buffer_ostream() override { OS << str(); }
+};
+
+}
+
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+       
+
+       
+
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+  namespace __detail
+  {
+
+
+
+
+
+
+
+    struct _List_node_base
+    {
+      _List_node_base* _M_next;
+      _List_node_base* _M_prev;
+
+      static void
+      swap(_List_node_base& __x, _List_node_base& __y) noexcept;
+
+      void
+      _M_transfer(_List_node_base* const __first,
+    _List_node_base* const __last) noexcept;
+
+      void
+      _M_reverse() noexcept;
+
+      void
+      _M_hook(_List_node_base* const __position) noexcept;
+
+      void
+      _M_unhook() noexcept;
+    };
+
+
+    struct _List_node_header : public _List_node_base
+    {
+
+      std::size_t _M_size;
+
+
+      _List_node_header() noexcept
+      { _M_init(); }
+
+
+      _List_node_header(_List_node_header&& __x) noexcept
+      : _List_node_base{ __x._M_next, __x._M_prev }
+
+      , _M_size(__x._M_size)
+
+      {
+ if (__x._M_base()->_M_next == __x._M_base())
+   this->_M_next = this->_M_prev = this;
+ else
+   {
+     this->_M_next->_M_prev = this->_M_prev->_M_next = this->_M_base();
+     __x._M_init();
+   }
+      }
+
+      void
+      _M_move_nodes(_List_node_header&& __x)
+      {
+ _List_node_base* const __xnode = __x._M_base();
+ if (__xnode->_M_next == __xnode)
+   _M_init();
+ else
+   {
+     _List_node_base* const __node = this->_M_base();
+     __node->_M_next = __xnode->_M_next;
+     __node->_M_prev = __xnode->_M_prev;
+     __node->_M_next->_M_prev = __node->_M_prev->_M_next = __node;
+
+     _M_size = __x._M_size;
+
+     __x._M_init();
+   }
+      }
+
+
+      void
+      _M_init() noexcept
+      {
+ this->_M_next = this->_M_prev = this;
+
+ this->_M_size = 0;
+
+      }
+
+    private:
+      _List_node_base* _M_base() { return this; }
+    };
+  }
+
+
+
+
+  template<typename _Tp>
+    struct _List_node : public __detail::_List_node_base
+    {
+
+      __gnu_cxx::__aligned_membuf<_Tp> _M_storage;
+      _Tp* _M_valptr() { return _M_storage._M_ptr(); }
+      _Tp const* _M_valptr() const { return _M_storage._M_ptr(); }
+
+
+
+
+
+    };
+
+
+
+
+
+
+  template<typename _Tp>
+    struct _List_iterator
+    {
+      typedef _List_iterator<_Tp> _Self;
+      typedef _List_node<_Tp> _Node;
+
+      typedef ptrdiff_t difference_type;
+      typedef std::bidirectional_iterator_tag iterator_category;
+      typedef _Tp value_type;
+      typedef _Tp* pointer;
+      typedef _Tp& reference;
+
+      _List_iterator() noexcept
+      : _M_node() { }
+
+      explicit
+      _List_iterator(__detail::_List_node_base* __x) noexcept
+      : _M_node(__x) { }
+
+      _Self
+      _M_const_cast() const noexcept
+      { return *this; }
+
+
+      reference
+      operator*() const noexcept
+      { return *static_cast<_Node*>(_M_node)->_M_valptr(); }
+
+      pointer
+      operator->() const noexcept
+      { return static_cast<_Node*>(_M_node)->_M_valptr(); }
+
+      _Self&
+      operator++() noexcept
+      {
+ _M_node = _M_node->_M_next;
+ return *this;
+      }
+
+      _Self
+      operator++(int) noexcept
+      {
+ _Self __tmp = *this;
+ _M_node = _M_node->_M_next;
+ return __tmp;
+      }
+
+      _Self&
+      operator--() noexcept
+      {
+ _M_node = _M_node->_M_prev;
+ return *this;
+      }
+
+      _Self
+      operator--(int) noexcept
+      {
+ _Self __tmp = *this;
+ _M_node = _M_node->_M_prev;
+ return __tmp;
+      }
+
+      bool
+      operator==(const _Self& __x) const noexcept
+      { return _M_node == __x._M_node; }
+
+      bool
+      operator!=(const _Self& __x) const noexcept
+      { return _M_node != __x._M_node; }
+
+
+      __detail::_List_node_base* _M_node;
+    };
+
+
+
+
+
+
+  template<typename _Tp>
+    struct _List_const_iterator
+    {
+      typedef _List_const_iterator<_Tp> _Self;
+      typedef const _List_node<_Tp> _Node;
+      typedef _List_iterator<_Tp> iterator;
+
+      typedef ptrdiff_t difference_type;
+      typedef std::bidirectional_iterator_tag iterator_category;
+      typedef _Tp value_type;
+      typedef const _Tp* pointer;
+      typedef const _Tp& reference;
+
+      _List_const_iterator() noexcept
+      : _M_node() { }
+
+      explicit
+      _List_const_iterator(const __detail::_List_node_base* __x)
+      noexcept
+      : _M_node(__x) { }
+
+      _List_const_iterator(const iterator& __x) noexcept
+      : _M_node(__x._M_node) { }
+
+      iterator
+      _M_const_cast() const noexcept
+      { return iterator(const_cast<__detail::_List_node_base*>(_M_node)); }
+
+
+      reference
+      operator*() const noexcept
+      { return *static_cast<_Node*>(_M_node)->_M_valptr(); }
+
+      pointer
+      operator->() const noexcept
+      { return static_cast<_Node*>(_M_node)->_M_valptr(); }
+
+      _Self&
+      operator++() noexcept
+      {
+ _M_node = _M_node->_M_next;
+ return *this;
+      }
+
+      _Self
+      operator++(int) noexcept
+      {
+ _Self __tmp = *this;
+ _M_node = _M_node->_M_next;
+ return __tmp;
+      }
+
+      _Self&
+      operator--() noexcept
+      {
+ _M_node = _M_node->_M_prev;
+ return *this;
+      }
+
+      _Self
+      operator--(int) noexcept
+      {
+ _Self __tmp = *this;
+ _M_node = _M_node->_M_prev;
+ return __tmp;
+      }
+
+      bool
+      operator==(const _Self& __x) const noexcept
+      { return _M_node == __x._M_node; }
+
+      bool
+      operator!=(const _Self& __x) const noexcept
+      { return _M_node != __x._M_node; }
+
+
+      const __detail::_List_node_base* _M_node;
+    };
+
+  template<typename _Val>
+    inline bool
+    operator==(const _List_iterator<_Val>& __x,
+        const _List_const_iterator<_Val>& __y) noexcept
+    { return __x._M_node == __y._M_node; }
+
+  template<typename _Val>
+    inline bool
+    operator!=(const _List_iterator<_Val>& __x,
+        const _List_const_iterator<_Val>& __y) noexcept
+    { return __x._M_node != __y._M_node; }
+
+namespace __cxx11 {
+
+  template<typename _Tp, typename _Alloc>
+    class _List_base
+    {
+    protected:
+      typedef typename __gnu_cxx::__alloc_traits<_Alloc>::template
+ rebind<_Tp>::other _Tp_alloc_type;
+      typedef __gnu_cxx::__alloc_traits<_Tp_alloc_type> _Tp_alloc_traits;
+      typedef typename _Tp_alloc_traits::template
+ rebind<_List_node<_Tp> >::other _Node_alloc_type;
+      typedef __gnu_cxx::__alloc_traits<_Node_alloc_type> _Node_alloc_traits;
+
+
+      static size_t
+      _S_distance(const __detail::_List_node_base* __first,
+    const __detail::_List_node_base* __last)
+      {
+ size_t __n = 0;
+ while (__first != __last)
+   {
+     __first = __first->_M_next;
+     ++__n;
+   }
+ return __n;
+      }
+
+
+      struct _List_impl
+      : public _Node_alloc_type
+      {
+ __detail::_List_node_header _M_node;
+
+ _List_impl() noexcept(noexcept(_Node_alloc_type()))
+ : _Node_alloc_type()
+ { }
+
+ _List_impl(const _Node_alloc_type& __a) noexcept
+ : _Node_alloc_type(__a)
+ { }
+
+
+ _List_impl(_List_impl&&) = default;
+
+ _List_impl(_Node_alloc_type&& __a, _List_impl&& __x)
+ : _Node_alloc_type(std::move(__a)), _M_node(std::move(__x._M_node))
+ { }
+
+ _List_impl(_Node_alloc_type&& __a) noexcept
+ : _Node_alloc_type(std::move(__a))
+ { }
+
+      };
+
+      _List_impl _M_impl;
+
+
+      size_t _M_get_size() const { return _M_impl._M_node._M_size; }
+
+      void _M_set_size(size_t __n) { _M_impl._M_node._M_size = __n; }
+
+      void _M_inc_size(size_t __n) { _M_impl._M_node._M_size += __n; }
+
+      void _M_dec_size(size_t __n) { _M_impl._M_node._M_size -= __n; }
+
+
+      size_t
+      _M_distance(const __detail::_List_node_base* __first,
+    const __detail::_List_node_base* __last) const
+      { return _S_distance(__first, __last); }
+
+
+      size_t _M_node_count() const { return _M_get_size(); }
+      typename _Node_alloc_traits::pointer
+      _M_get_node()
+      { return _Node_alloc_traits::allocate(_M_impl, 1); }
+
+      void
+      _M_put_node(typename _Node_alloc_traits::pointer __p) noexcept
+      { _Node_alloc_traits::deallocate(_M_impl, __p, 1); }
+
+  public:
+      typedef _Alloc allocator_type;
+
+      _Node_alloc_type&
+      _M_get_Node_allocator() noexcept
+      { return _M_impl; }
+
+      const _Node_alloc_type&
+      _M_get_Node_allocator() const noexcept
+      { return _M_impl; }
+
+
+      _List_base() = default;
+
+
+
+
+      _List_base(const _Node_alloc_type& __a) noexcept
+      : _M_impl(__a)
+      { }
+
+
+      _List_base(_List_base&&) = default;
+
+
+      _List_base(_List_base&& __x, _Node_alloc_type&& __a)
+      : _M_impl(std::move(__a))
+      {
+ if (__x._M_get_Node_allocator() == _M_get_Node_allocator())
+   _M_move_nodes(std::move(__x));
+
+      }
+
+
+
+      _List_base(_Node_alloc_type&& __a, _List_base&& __x)
+      : _M_impl(std::move(__a), std::move(__x._M_impl))
+      { }
+
+
+      _List_base(_Node_alloc_type&& __a)
+      : _M_impl(std::move(__a))
+      { }
+
+      void
+      _M_move_nodes(_List_base&& __x)
+      { _M_impl._M_node._M_move_nodes(std::move(__x._M_impl._M_node)); }
+
+
+
+      ~_List_base() noexcept
+      { _M_clear(); }
+
+      void
+      _M_clear() noexcept;
+
+      void
+      _M_init() noexcept
+      { this->_M_impl._M_node._M_init(); }
+    };
+  template<typename _Tp, typename _Alloc = std::allocator<_Tp> >
+    class list : protected _List_base<_Tp, _Alloc>
+    {
+      static_assert(is_same<typename remove_cv<_Tp>::type, _Tp>::value,
+   "std::list must have a non-const, non-volatile value_type");
+
+      static_assert(is_same<typename _Alloc::value_type, _Tp>::value,
+   "std::list must have the same value_type as its allocator");
+
+
+
+      typedef _List_base<_Tp, _Alloc> _Base;
+      typedef typename _Base::_Tp_alloc_type _Tp_alloc_type;
+      typedef typename _Base::_Tp_alloc_traits _Tp_alloc_traits;
+      typedef typename _Base::_Node_alloc_type _Node_alloc_type;
+      typedef typename _Base::_Node_alloc_traits _Node_alloc_traits;
+
+    public:
+      typedef _Tp value_type;
+      typedef typename _Tp_alloc_traits::pointer pointer;
+      typedef typename _Tp_alloc_traits::const_pointer const_pointer;
+      typedef typename _Tp_alloc_traits::reference reference;
+      typedef typename _Tp_alloc_traits::const_reference const_reference;
+      typedef _List_iterator<_Tp> iterator;
+      typedef _List_const_iterator<_Tp> const_iterator;
+      typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+      typedef std::reverse_iterator<iterator> reverse_iterator;
+      typedef size_t size_type;
+      typedef ptrdiff_t difference_type;
+      typedef _Alloc allocator_type;
+
+    protected:
+
+
+      typedef _List_node<_Tp> _Node;
+
+      using _Base::_M_impl;
+      using _Base::_M_put_node;
+      using _Base::_M_get_node;
+      using _Base::_M_get_Node_allocator;
+      template<typename... _Args>
+ _Node*
+ _M_create_node(_Args&&... __args)
+ {
+   auto __p = this->_M_get_node();
+   auto& __alloc = _M_get_Node_allocator();
+   __allocated_ptr<_Node_alloc_type> __guard{__alloc, __p};
+   _Node_alloc_traits::construct(__alloc, __p->_M_valptr(),
+     std::forward<_Args>(__args)...);
+   __guard = nullptr;
+   return __p;
+ }
+
+
+
+      static size_t
+      _S_distance(const_iterator __first, const_iterator __last)
+      { return std::distance(__first, __last); }
+
+
+      size_t
+      _M_node_count() const
+      { return this->_M_get_size(); }
+    public:
+
+
+
+
+
+
+
+      list() = default;
+      explicit
+      list(const allocator_type& __a) noexcept
+      : _Base(_Node_alloc_type(__a)) { }
+      explicit
+      list(size_type __n, const allocator_type& __a = allocator_type())
+      : _Base(_Node_alloc_type(__a))
+      { _M_default_initialize(__n); }
+      list(size_type __n, const value_type& __value,
+    const allocator_type& __a = allocator_type())
+      : _Base(_Node_alloc_type(__a))
+      { _M_fill_initialize(__n, __value); }
+      list(const list& __x)
+      : _Base(_Node_alloc_traits::
+       _S_select_on_copy(__x._M_get_Node_allocator()))
+      { _M_initialize_dispatch(__x.begin(), __x.end(), __false_type()); }
+      list(list&&) = default;
+      list(initializer_list<value_type> __l,
+    const allocator_type& __a = allocator_type())
+      : _Base(_Node_alloc_type(__a))
+      { _M_initialize_dispatch(__l.begin(), __l.end(), __false_type()); }
+
+      list(const list& __x, const allocator_type& __a)
+      : _Base(_Node_alloc_type(__a))
+      { _M_initialize_dispatch(__x.begin(), __x.end(), __false_type()); }
+
+    private:
+      list(list&& __x, const allocator_type& __a, true_type) noexcept
+      : _Base(_Node_alloc_type(__a), std::move(__x))
+      { }
+
+      list(list&& __x, const allocator_type& __a, false_type)
+      : _Base(_Node_alloc_type(__a))
+      {
+ if (__x._M_get_Node_allocator() == this->_M_get_Node_allocator())
+   this->_M_move_nodes(std::move(__x));
+ else
+   insert(begin(), std::__make_move_if_noexcept_iterator(__x.begin()),
+     std::__make_move_if_noexcept_iterator(__x.end()));
+      }
+
+    public:
+      list(list&& __x, const allocator_type& __a)
+      noexcept(_Node_alloc_traits::_S_always_equal())
+      : list(std::move(__x), __a,
+      typename _Node_alloc_traits::is_always_equal{})
+      { }
+      template<typename _InputIterator,
+        typename = std::_RequireInputIter<_InputIterator>>
+ list(_InputIterator __first, _InputIterator __last,
+      const allocator_type& __a = allocator_type())
+ : _Base(_Node_alloc_type(__a))
+ { _M_initialize_dispatch(__first, __last, __false_type()); }
+      ~list() = default;
+      list&
+      operator=(const list& __x);
+      list&
+      operator=(list&& __x)
+      noexcept(_Node_alloc_traits::_S_nothrow_move())
+      {
+ constexpr bool __move_storage =
+   _Node_alloc_traits::_S_propagate_on_move_assign()
+   || _Node_alloc_traits::_S_always_equal();
+ _M_move_assign(std::move(__x), __bool_constant<__move_storage>());
+ return *this;
+      }
+      list&
+      operator=(initializer_list<value_type> __l)
+      {
+ this->assign(__l.begin(), __l.end());
+ return *this;
+      }
+      void
+      assign(size_type __n, const value_type& __val)
+      { _M_fill_assign(__n, __val); }
+      template<typename _InputIterator,
+        typename = std::_RequireInputIter<_InputIterator>>
+ void
+ assign(_InputIterator __first, _InputIterator __last)
+ { _M_assign_dispatch(__first, __last, __false_type()); }
+      void
+      assign(initializer_list<value_type> __l)
+      { this->_M_assign_dispatch(__l.begin(), __l.end(), __false_type()); }
+
+
+
+      allocator_type
+      get_allocator() const noexcept
+      { return allocator_type(_Base::_M_get_Node_allocator()); }
+
+
+
+
+
+
+      iterator
+      begin() noexcept
+      { return iterator(this->_M_impl._M_node._M_next); }
+
+
+
+
+
+
+      const_iterator
+      begin() const noexcept
+      { return const_iterator(this->_M_impl._M_node._M_next); }
+
+
+
+
+
+
+      iterator
+      end() noexcept
+      { return iterator(&this->_M_impl._M_node); }
+
+
+
+
+
+
+      const_iterator
+      end() const noexcept
+      { return const_iterator(&this->_M_impl._M_node); }
+
+
+
+
+
+
+      reverse_iterator
+      rbegin() noexcept
+      { return reverse_iterator(end()); }
+
+
+
+
+
+
+      const_reverse_iterator
+      rbegin() const noexcept
+      { return const_reverse_iterator(end()); }
+
+
+
+
+
+
+      reverse_iterator
+      rend() noexcept
+      { return reverse_iterator(begin()); }
+
+
+
+
+
+
+      const_reverse_iterator
+      rend() const noexcept
+      { return const_reverse_iterator(begin()); }
+
+
+
+
+
+
+
+      const_iterator
+      cbegin() const noexcept
+      { return const_iterator(this->_M_impl._M_node._M_next); }
+
+
+
+
+
+
+      const_iterator
+      cend() const noexcept
+      { return const_iterator(&this->_M_impl._M_node); }
+
+
+
+
+
+
+      const_reverse_iterator
+      crbegin() const noexcept
+      { return const_reverse_iterator(end()); }
+
+
+
+
+
+
+      const_reverse_iterator
+      crend() const noexcept
+      { return const_reverse_iterator(begin()); }
+
+
+
+
+
+
+
+      bool
+      empty() const noexcept
+      { return this->_M_impl._M_node._M_next == &this->_M_impl._M_node; }
+
+
+      size_type
+      size() const noexcept
+      { return _M_node_count(); }
+
+
+      size_type
+      max_size() const noexcept
+      { return _Node_alloc_traits::max_size(_M_get_Node_allocator()); }
+      void
+      resize(size_type __new_size);
+      void
+      resize(size_type __new_size, const value_type& __x);
+      reference
+      front() noexcept
+      { return *begin(); }
+
+
+
+
+
+      const_reference
+      front() const noexcept
+      { return *begin(); }
+
+
+
+
+
+      reference
+      back() noexcept
+      {
+ iterator __tmp = end();
+ --__tmp;
+ return *__tmp;
+      }
+
+
+
+
+
+      const_reference
+      back() const noexcept
+      {
+ const_iterator __tmp = end();
+ --__tmp;
+ return *__tmp;
+      }
+      void
+      push_front(const value_type& __x)
+      { this->_M_insert(begin(), __x); }
+
+
+      void
+      push_front(value_type&& __x)
+      { this->_M_insert(begin(), std::move(__x)); }
+
+      template<typename... _Args>
+
+
+
+ void
+
+ emplace_front(_Args&&... __args)
+ {
+   this->_M_insert(begin(), std::forward<_Args>(__args)...);
+
+
+
+ }
+      void
+      pop_front() noexcept
+      { this->_M_erase(begin()); }
+      void
+      push_back(const value_type& __x)
+      { this->_M_insert(end(), __x); }
+
+
+      void
+      push_back(value_type&& __x)
+      { this->_M_insert(end(), std::move(__x)); }
+
+      template<typename... _Args>
+
+
+
+ void
+
+ emplace_back(_Args&&... __args)
+ {
+   this->_M_insert(end(), std::forward<_Args>(__args)...);
+
+
+
+ }
+      void
+      pop_back() noexcept
+      { this->_M_erase(iterator(this->_M_impl._M_node._M_prev)); }
+      template<typename... _Args>
+ iterator
+ emplace(const_iterator __position, _Args&&... __args);
+      iterator
+      insert(const_iterator __position, const value_type& __x);
+      iterator
+      insert(const_iterator __position, value_type&& __x)
+      { return emplace(__position, std::move(__x)); }
+      iterator
+      insert(const_iterator __p, initializer_list<value_type> __l)
+      { return this->insert(__p, __l.begin(), __l.end()); }
+      iterator
+      insert(const_iterator __position, size_type __n, const value_type& __x);
+      template<typename _InputIterator,
+        typename = std::_RequireInputIter<_InputIterator>>
+ iterator
+ insert(const_iterator __position, _InputIterator __first,
+        _InputIterator __last);
+      iterator
+
+      erase(const_iterator __position) noexcept;
+      iterator
+
+      erase(const_iterator __first, const_iterator __last) noexcept
+
+
+
+      {
+ while (__first != __last)
+   __first = erase(__first);
+ return __last._M_const_cast();
+      }
+      void
+      swap(list& __x) noexcept
+      {
+ __detail::_List_node_base::swap(this->_M_impl._M_node,
+     __x._M_impl._M_node);
+
+ size_t __xsize = __x._M_get_size();
+ __x._M_set_size(this->_M_get_size());
+ this->_M_set_size(__xsize);
+
+ _Node_alloc_traits::_S_on_swap(this->_M_get_Node_allocator(),
+           __x._M_get_Node_allocator());
+      }
+
+
+
+
+
+
+
+      void
+      clear() noexcept
+      {
+ _Base::_M_clear();
+ _Base::_M_init();
+      }
+      void
+
+      splice(const_iterator __position, list&& __x) noexcept
+
+
+
+      {
+ if (!__x.empty())
+   {
+     _M_check_equal_allocators(__x);
+
+     this->_M_transfer(__position._M_const_cast(),
+         __x.begin(), __x.end());
+
+     this->_M_inc_size(__x._M_get_size());
+     __x._M_set_size(0);
+   }
+      }
+
+
+      void
+      splice(const_iterator __position, list& __x) noexcept
+      { splice(__position, std::move(__x)); }
+      void
+      splice(const_iterator __position, list&& __x, const_iterator __i) noexcept
+      {
+ iterator __j = __i._M_const_cast();
+ ++__j;
+ if (__position == __i || __position == __j)
+   return;
+
+ if (this != std::__addressof(__x))
+   _M_check_equal_allocators(__x);
+
+ this->_M_transfer(__position._M_const_cast(),
+     __i._M_const_cast(), __j);
+
+ this->_M_inc_size(1);
+ __x._M_dec_size(1);
+      }
+      void
+      splice(const_iterator __position, list& __x, const_iterator __i) noexcept
+      { splice(__position, std::move(__x), __i); }
+      void
+      splice(const_iterator __position, list&& __x, const_iterator __first,
+      const_iterator __last) noexcept
+      {
+ if (__first != __last)
+   {
+     if (this != std::__addressof(__x))
+       _M_check_equal_allocators(__x);
+
+     size_t __n = _S_distance(__first, __last);
+     this->_M_inc_size(__n);
+     __x._M_dec_size(__n);
+
+     this->_M_transfer(__position._M_const_cast(),
+         __first._M_const_cast(),
+         __last._M_const_cast());
+   }
+      }
+      void
+      splice(const_iterator __position, list& __x, const_iterator __first,
+      const_iterator __last) noexcept
+      { splice(__position, std::move(__x), __first, __last); }
+      void
+      remove(const _Tp& __value);
+      template<typename _Predicate>
+ void
+ remove_if(_Predicate);
+      void
+      unique();
+      template<typename _BinaryPredicate>
+ void
+ unique(_BinaryPredicate);
+      void
+      merge(list&& __x);
+
+      void
+      merge(list& __x)
+      { merge(std::move(__x)); }
+      template<typename _StrictWeakOrdering>
+ void
+ merge(list&& __x, _StrictWeakOrdering __comp);
+
+      template<typename _StrictWeakOrdering>
+ void
+ merge(list& __x, _StrictWeakOrdering __comp)
+ { merge(std::move(__x), __comp); }
+      void
+      reverse() noexcept
+      { this->_M_impl._M_node._M_reverse(); }
+
+
+
+
+
+
+
+      void
+      sort();
+
+
+
+
+
+
+
+      template<typename _StrictWeakOrdering>
+ void
+ sort(_StrictWeakOrdering);
+
+    protected:
+
+
+
+
+
+
+      template<typename _Integer>
+ void
+ _M_initialize_dispatch(_Integer __n, _Integer __x, __true_type)
+ { _M_fill_initialize(static_cast<size_type>(__n), __x); }
+
+
+      template<typename _InputIterator>
+ void
+ _M_initialize_dispatch(_InputIterator __first, _InputIterator __last,
+          __false_type)
+ {
+   for (; __first != __last; ++__first)
+
+     emplace_back(*__first);
+
+
+
+ }
+
+
+
+      void
+      _M_fill_initialize(size_type __n, const value_type& __x)
+      {
+ for (; __n; --__n)
+   push_back(__x);
+      }
+
+
+
+      void
+      _M_default_initialize(size_type __n)
+      {
+ for (; __n; --__n)
+   emplace_back();
+      }
+
+
+      void
+      _M_default_append(size_type __n);
+      template<typename _Integer>
+ void
+ _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
+ { _M_fill_assign(__n, __val); }
+
+
+      template<typename _InputIterator>
+ void
+ _M_assign_dispatch(_InputIterator __first, _InputIterator __last,
+      __false_type);
+
+
+
+      void
+      _M_fill_assign(size_type __n, const value_type& __val);
+
+
+
+      void
+      _M_transfer(iterator __position, iterator __first, iterator __last)
+      { __position._M_node->_M_transfer(__first._M_node, __last._M_node); }
+     template<typename... _Args>
+       void
+       _M_insert(iterator __position, _Args&&... __args)
+       {
+  _Node* __tmp = _M_create_node(std::forward<_Args>(__args)...);
+  __tmp->_M_hook(__position._M_node);
+  this->_M_inc_size(1);
+       }
+
+
+
+      void
+      _M_erase(iterator __position) noexcept
+      {
+ this->_M_dec_size(1);
+ __position._M_node->_M_unhook();
+ _Node* __n = static_cast<_Node*>(__position._M_node);
+
+ _Node_alloc_traits::destroy(_M_get_Node_allocator(), __n->_M_valptr());
+
+
+
+
+ _M_put_node(__n);
+      }
+
+
+      void
+      _M_check_equal_allocators(list& __x) noexcept
+      {
+ if (std::__alloc_neq<typename _Base::_Node_alloc_type>::
+     _S_do_it(_M_get_Node_allocator(), __x._M_get_Node_allocator()))
+   __builtin_abort();
+      }
+
+
+      const_iterator
+      _M_resize_pos(size_type& __new_size) const;
+
+
+      void
+      _M_move_assign(list&& __x, true_type) noexcept
+      {
+ this->_M_clear();
+ this->_M_move_nodes(std::move(__x));
+ std::__alloc_on_move(this->_M_get_Node_allocator(),
+        __x._M_get_Node_allocator());
+      }
+
+      void
+      _M_move_assign(list&& __x, false_type)
+      {
+ if (__x._M_get_Node_allocator() == this->_M_get_Node_allocator())
+   _M_move_assign(std::move(__x), true_type{});
+ else
+
+
+   _M_assign_dispatch(std::__make_move_if_noexcept_iterator(__x.begin()),
+        std::__make_move_if_noexcept_iterator(__x.end()),
+        __false_type{});
+      }
+
+    };
+}
+  template<typename _Tp, typename _Alloc>
+    inline bool
+    operator==(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
+    {
+
+      if (__x.size() != __y.size())
+ return false;
+
+
+      typedef typename list<_Tp, _Alloc>::const_iterator const_iterator;
+      const_iterator __end1 = __x.end();
+      const_iterator __end2 = __y.end();
+
+      const_iterator __i1 = __x.begin();
+      const_iterator __i2 = __y.begin();
+      while (__i1 != __end1 && __i2 != __end2 && *__i1 == *__i2)
+ {
+   ++__i1;
+   ++__i2;
+ }
+      return __i1 == __end1 && __i2 == __end2;
+    }
+  template<typename _Tp, typename _Alloc>
+    inline bool
+    operator<(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
+    { return std::lexicographical_compare(__x.begin(), __x.end(),
+       __y.begin(), __y.end()); }
+
+
+  template<typename _Tp, typename _Alloc>
+    inline bool
+    operator!=(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
+    { return !(__x == __y); }
+
+
+  template<typename _Tp, typename _Alloc>
+    inline bool
+    operator>(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
+    { return __y < __x; }
+
+
+  template<typename _Tp, typename _Alloc>
+    inline bool
+    operator<=(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
+    { return !(__y < __x); }
+
+
+  template<typename _Tp, typename _Alloc>
+    inline bool
+    operator>=(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
+    { return !(__x < __y); }
+
+
+  template<typename _Tp, typename _Alloc>
+    inline void
+    swap(list<_Tp, _Alloc>& __x, list<_Tp, _Alloc>& __y)
+    noexcept(noexcept(__x.swap(__y)))
+    { __x.swap(__y); }
+
+
+
+
+
+
+  template<typename _Tp>
+    inline ptrdiff_t
+    __distance(std::_List_iterator<_Tp> __first,
+        std::_List_iterator<_Tp> __last,
+        input_iterator_tag __tag)
+    {
+      typedef std::_List_const_iterator<_Tp> _CIter;
+      return std::__distance(_CIter(__first), _CIter(__last), __tag);
+    }
+
+  template<typename _Tp>
+    inline ptrdiff_t
+    __distance(std::_List_const_iterator<_Tp> __first,
+        std::_List_const_iterator<_Tp> __last,
+        input_iterator_tag)
+    {
+      typedef __detail::_List_node_header _Sentinel;
+      std::_List_const_iterator<_Tp> __beyond = __last;
+      ++__beyond;
+      const bool __whole = __first == __beyond;
+      if (__builtin_constant_p (__whole) && __whole)
+ return static_cast<const _Sentinel*>(__last._M_node)->_M_size;
+
+      ptrdiff_t __n = 0;
+      while (__first != __last)
+ {
+   ++__first;
+   ++__n;
+ }
+      return __n;
+    }
+
+
+
+}
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+  template<typename _Tp, typename _Alloc>
+    void
+    _List_base<_Tp, _Alloc>::
+    _M_clear() noexcept
+    {
+      typedef _List_node<_Tp> _Node;
+      __detail::_List_node_base* __cur = _M_impl._M_node._M_next;
+      while (__cur != &_M_impl._M_node)
+ {
+   _Node* __tmp = static_cast<_Node*>(__cur);
+   __cur = __tmp->_M_next;
+   _Tp* __val = __tmp->_M_valptr();
+
+   _Node_alloc_traits::destroy(_M_get_Node_allocator(), __val);
+
+
+
+   _M_put_node(__tmp);
+ }
+    }
+
+
+  template<typename _Tp, typename _Alloc>
+    template<typename... _Args>
+      typename list<_Tp, _Alloc>::iterator
+      list<_Tp, _Alloc>::
+      emplace(const_iterator __position, _Args&&... __args)
+      {
+ _Node* __tmp = _M_create_node(std::forward<_Args>(__args)...);
+ __tmp->_M_hook(__position._M_const_cast()._M_node);
+ this->_M_inc_size(1);
+ return iterator(__tmp);
+      }
+
+
+  template<typename _Tp, typename _Alloc>
+    typename list<_Tp, _Alloc>::iterator
+    list<_Tp, _Alloc>::
+
+    insert(const_iterator __position, const value_type& __x)
+
+
+
+    {
+      _Node* __tmp = _M_create_node(__x);
+      __tmp->_M_hook(__position._M_const_cast()._M_node);
+      this->_M_inc_size(1);
+      return iterator(__tmp);
+    }
+
+
+  template<typename _Tp, typename _Alloc>
+    typename list<_Tp, _Alloc>::iterator
+    list<_Tp, _Alloc>::
+    insert(const_iterator __position, size_type __n, const value_type& __x)
+    {
+      if (__n)
+ {
+   list __tmp(__n, __x, get_allocator());
+   iterator __it = __tmp.begin();
+   splice(__position, __tmp);
+   return __it;
+ }
+      return __position._M_const_cast();
+    }
+
+  template<typename _Tp, typename _Alloc>
+    template<typename _InputIterator, typename>
+      typename list<_Tp, _Alloc>::iterator
+      list<_Tp, _Alloc>::
+      insert(const_iterator __position, _InputIterator __first,
+      _InputIterator __last)
+      {
+ list __tmp(__first, __last, get_allocator());
+ if (!__tmp.empty())
+   {
+     iterator __it = __tmp.begin();
+     splice(__position, __tmp);
+     return __it;
+   }
+ return __position._M_const_cast();
+      }
+
+
+  template<typename _Tp, typename _Alloc>
+    typename list<_Tp, _Alloc>::iterator
+    list<_Tp, _Alloc>::
+
+    erase(const_iterator __position) noexcept
+
+
+
+    {
+      iterator __ret = iterator(__position._M_node->_M_next);
+      _M_erase(__position._M_const_cast());
+      return __ret;
+    }
+  template<typename _Tp, typename _Alloc>
+    typename list<_Tp, _Alloc>::const_iterator
+    list<_Tp, _Alloc>::
+    _M_resize_pos(size_type& __new_size) const
+    {
+      const_iterator __i;
+
+      const size_type __len = size();
+      if (__new_size < __len)
+ {
+   if (__new_size <= __len / 2)
+     {
+       __i = begin();
+       std::advance(__i, __new_size);
+     }
+   else
+     {
+       __i = end();
+       ptrdiff_t __num_erase = __len - __new_size;
+       std::advance(__i, -__num_erase);
+     }
+   __new_size = 0;
+   return __i;
+ }
+      else
+ __i = end();
+
+
+
+
+
+      __new_size -= __len;
+      return __i;
+    }
+
+
+  template<typename _Tp, typename _Alloc>
+    void
+    list<_Tp, _Alloc>::
+    _M_default_append(size_type __n)
+    {
+      size_type __i = 0;
+      if (true)
+ {
+   for (; __i < __n; ++__i)
+     emplace_back();
+ }
+      if (false)
+ {
+   for (; __i; --__i)
+     pop_back();
+   ;
+ }
+    }
+
+  template<typename _Tp, typename _Alloc>
+    void
+    list<_Tp, _Alloc>::
+    resize(size_type __new_size)
+    {
+      const_iterator __i = _M_resize_pos(__new_size);
+      if (__new_size)
+ _M_default_append(__new_size);
+      else
+        erase(__i, end());
+    }
+
+  template<typename _Tp, typename _Alloc>
+    void
+    list<_Tp, _Alloc>::
+    resize(size_type __new_size, const value_type& __x)
+    {
+      const_iterator __i = _M_resize_pos(__new_size);
+      if (__new_size)
+        insert(end(), __new_size, __x);
+      else
+        erase(__i, end());
+    }
+  template<typename _Tp, typename _Alloc>
+    list<_Tp, _Alloc>&
+    list<_Tp, _Alloc>::
+    operator=(const list& __x)
+    {
+      if (this != std::__addressof(__x))
+ {
+
+   if (_Node_alloc_traits::_S_propagate_on_copy_assign())
+     {
+              auto& __this_alloc = this->_M_get_Node_allocator();
+              auto& __that_alloc = __x._M_get_Node_allocator();
+              if (!_Node_alloc_traits::_S_always_equal()
+           && __this_alloc != __that_alloc)
+         {
+
+    clear();
+  }
+       std::__alloc_on_copy(__this_alloc, __that_alloc);
+            }
+
+   _M_assign_dispatch(__x.begin(), __x.end(), __false_type());
+ }
+      return *this;
+    }
+
+  template<typename _Tp, typename _Alloc>
+    void
+    list<_Tp, _Alloc>::
+    _M_fill_assign(size_type __n, const value_type& __val)
+    {
+      iterator __i = begin();
+      for (; __i != end() && __n > 0; ++__i, --__n)
+        *__i = __val;
+      if (__n > 0)
+        insert(end(), __n, __val);
+      else
+        erase(__i, end());
+    }
+
+  template<typename _Tp, typename _Alloc>
+    template <typename _InputIterator>
+      void
+      list<_Tp, _Alloc>::
+      _M_assign_dispatch(_InputIterator __first2, _InputIterator __last2,
+    __false_type)
+      {
+        iterator __first1 = begin();
+        iterator __last1 = end();
+        for (; __first1 != __last1 && __first2 != __last2;
+      ++__first1, ++__first2)
+          *__first1 = *__first2;
+        if (__first2 == __last2)
+          erase(__first1, __last1);
+        else
+          insert(__last1, __first2, __last2);
+      }
+
+  template<typename _Tp, typename _Alloc>
+    void
+    list<_Tp, _Alloc>::
+    remove(const value_type& __value)
+    {
+      iterator __first = begin();
+      iterator __last = end();
+      iterator __extra = __last;
+      while (__first != __last)
+ {
+   iterator __next = __first;
+   ++__next;
+   if (*__first == __value)
+     {
+
+
+
+       if (std::__addressof(*__first) != std::__addressof(__value))
+  _M_erase(__first);
+       else
+  __extra = __first;
+     }
+   __first = __next;
+ }
+      if (__extra != __last)
+ _M_erase(__extra);
+    }
+
+  template<typename _Tp, typename _Alloc>
+    void
+    list<_Tp, _Alloc>::
+    unique()
+    {
+      iterator __first = begin();
+      iterator __last = end();
+      if (__first == __last)
+ return;
+      iterator __next = __first;
+      while (++__next != __last)
+ {
+   if (*__first == *__next)
+     _M_erase(__next);
+   else
+     __first = __next;
+   __next = __first;
+ }
+    }
+
+  template<typename _Tp, typename _Alloc>
+    void
+    list<_Tp, _Alloc>::
+
+    merge(list&& __x)
+
+
+
+    {
+
+
+      if (this != std::__addressof(__x))
+ {
+   _M_check_equal_allocators(__x);
+
+   iterator __first1 = begin();
+   iterator __last1 = end();
+   iterator __first2 = __x.begin();
+   iterator __last2 = __x.end();
+   const size_t __orig_size = __x.size();
+   if (true) {
+     while (__first1 != __last1 && __first2 != __last2)
+       if (*__first2 < *__first1)
+  {
+    iterator __next = __first2;
+    _M_transfer(__first1, __first2, ++__next);
+    __first2 = __next;
+  }
+       else
+  ++__first1;
+     if (__first2 != __last2)
+       _M_transfer(__last1, __first2, __last2);
+
+     this->_M_inc_size(__x._M_get_size());
+     __x._M_set_size(0);
+   }
+   if (false)
+     {
+       const size_t __dist = std::distance(__first2, __last2);
+       this->_M_inc_size(__orig_size - __dist);
+       __x._M_set_size(__dist);
+       ;
+     }
+ }
+    }
+
+  template<typename _Tp, typename _Alloc>
+    template <typename _StrictWeakOrdering>
+      void
+      list<_Tp, _Alloc>::
+
+      merge(list&& __x, _StrictWeakOrdering __comp)
+
+
+
+      {
+
+
+ if (this != std::__addressof(__x))
+   {
+     _M_check_equal_allocators(__x);
+
+     iterator __first1 = begin();
+     iterator __last1 = end();
+     iterator __first2 = __x.begin();
+     iterator __last2 = __x.end();
+     const size_t __orig_size = __x.size();
+     if (true)
+       {
+  while (__first1 != __last1 && __first2 != __last2)
+    if (__comp(*__first2, *__first1))
+      {
+        iterator __next = __first2;
+        _M_transfer(__first1, __first2, ++__next);
+        __first2 = __next;
+      }
+    else
+      ++__first1;
+  if (__first2 != __last2)
+    _M_transfer(__last1, __first2, __last2);
+
+  this->_M_inc_size(__x._M_get_size());
+  __x._M_set_size(0);
+       }
+     if (false)
+       {
+  const size_t __dist = std::distance(__first2, __last2);
+  this->_M_inc_size(__orig_size - __dist);
+  __x._M_set_size(__dist);
+  ;
+       }
+   }
+      }
+
+  template<typename _Tp, typename _Alloc>
+    void
+    list<_Tp, _Alloc>::
+    sort()
+    {
+
+      if (this->_M_impl._M_node._M_next != &this->_M_impl._M_node
+   && this->_M_impl._M_node._M_next->_M_next != &this->_M_impl._M_node)
+      {
+        list __carry;
+        list __tmp[64];
+        list * __fill = __tmp;
+        list * __counter;
+ if (true)
+   {
+     do
+       {
+  __carry.splice(__carry.begin(), *this, begin());
+
+  for(__counter = __tmp;
+      __counter != __fill && !__counter->empty();
+      ++__counter)
+    {
+      __counter->merge(__carry);
+      __carry.swap(*__counter);
+    }
+  __carry.swap(*__counter);
+  if (__counter == __fill)
+    ++__fill;
+       }
+     while ( !empty() );
+
+     for (__counter = __tmp + 1; __counter != __fill; ++__counter)
+       __counter->merge(*(__counter - 1));
+     swap( *(__fill - 1) );
+   }
+ if (false)
+   {
+     this->splice(this->end(), __carry);
+     for (int __i = 0; __i < sizeof(__tmp)/sizeof(__tmp[0]); ++__i)
+       this->splice(this->end(), __tmp[__i]);
+     ;
+   }
+      }
+    }
+
+  template<typename _Tp, typename _Alloc>
+    template <typename _Predicate>
+      void
+      list<_Tp, _Alloc>::
+      remove_if(_Predicate __pred)
+      {
+        iterator __first = begin();
+        iterator __last = end();
+        while (__first != __last)
+   {
+     iterator __next = __first;
+     ++__next;
+     if (__pred(*__first))
+       _M_erase(__first);
+     __first = __next;
+   }
+      }
+
+  template<typename _Tp, typename _Alloc>
+    template <typename _BinaryPredicate>
+      void
+      list<_Tp, _Alloc>::
+      unique(_BinaryPredicate __binary_pred)
+      {
+        iterator __first = begin();
+        iterator __last = end();
+        if (__first == __last)
+   return;
+        iterator __next = __first;
+        while (++__next != __last)
+   {
+     if (__binary_pred(*__first, *__next))
+       _M_erase(__next);
+     else
+       __first = __next;
+     __next = __first;
+   }
+      }
+
+  template<typename _Tp, typename _Alloc>
+    template <typename _StrictWeakOrdering>
+      void
+      list<_Tp, _Alloc>::
+      sort(_StrictWeakOrdering __comp)
+      {
+
+ if (this->_M_impl._M_node._M_next != &this->_M_impl._M_node
+     && this->_M_impl._M_node._M_next->_M_next != &this->_M_impl._M_node)
+   {
+     list __carry;
+     list __tmp[64];
+     list * __fill = __tmp;
+     list * __counter;
+     if (true)
+       {
+  do
+    {
+      __carry.splice(__carry.begin(), *this, begin());
+
+      for(__counter = __tmp;
+   __counter != __fill && !__counter->empty();
+   ++__counter)
+        {
+   __counter->merge(__carry, __comp);
+   __carry.swap(*__counter);
+        }
+      __carry.swap(*__counter);
+      if (__counter == __fill)
+        ++__fill;
+    }
+  while ( !empty() );
+
+  for (__counter = __tmp + 1; __counter != __fill; ++__counter)
+    __counter->merge(*(__counter - 1), __comp);
+  swap(*(__fill - 1));
+       }
+     if (false)
+       {
+  this->splice(this->end(), __carry);
+  for (int __i = 0; __i < sizeof(__tmp)/sizeof(__tmp[0]); ++__i)
+    this->splice(this->end(), __tmp[__i]);
+  ;
+       }
+   }
+      }
+
+
+
+}
+
+
+
+
+
+
+
+namespace llvm {
+
+
+
+
+
+
+
+struct alignas(8) AnalysisKey {};
+struct alignas(8) AnalysisSetKey {};
+template <typename IRUnitT> class AllAnalysesOn {
+public:
+  static AnalysisSetKey *ID() { return &SetKey; }
+
+private:
+  static AnalysisSetKey SetKey;
+};
+
+template <typename IRUnitT> AnalysisSetKey AllAnalysesOn<IRUnitT>::SetKey;
+
+extern template class AllAnalysesOn<Module>;
+extern template class AllAnalysesOn<Function>;
+class CFGAnalyses {
+public:
+  static AnalysisSetKey *ID() { return &SetKey; }
+
+private:
+  static AnalysisSetKey SetKey;
+};
+class PreservedAnalyses {
+public:
+
+  static PreservedAnalyses none() { return PreservedAnalyses(); }
+
+
+  static PreservedAnalyses all() {
+    PreservedAnalyses PA;
+    PA.PreservedIDs.insert(&AllAnalysesKey);
+    return PA;
+  }
+
+
+  template <typename AnalysisSetT>
+  static PreservedAnalyses allInSet() {
+    PreservedAnalyses PA;
+    PA.preserveSet<AnalysisSetT>();
+    return PA;
+  }
+
+
+  template <typename AnalysisT> void preserve() { preserve(AnalysisT::ID()); }
+
+
+
+  void preserve(AnalysisKey *ID) {
+
+    NotPreservedAnalysisIDs.erase(ID);
+
+
+
+    if (!areAllPreserved())
+      PreservedIDs.insert(ID);
+  }
+
+
+  template <typename AnalysisSetT> void preserveSet() {
+    preserveSet(AnalysisSetT::ID());
+  }
+
+
+  void preserveSet(AnalysisSetKey *ID) {
+
+    if (!areAllPreserved())
+      PreservedIDs.insert(ID);
+  }
+  template <typename AnalysisT> void abandon() { abandon(AnalysisT::ID()); }
+  void abandon(AnalysisKey *ID) {
+    PreservedIDs.erase(ID);
+    NotPreservedAnalysisIDs.insert(ID);
+  }
+
+
+
+
+
+  void intersect(const PreservedAnalyses &Arg) {
+    if (Arg.areAllPreserved())
+      return;
+    if (areAllPreserved()) {
+      *this = Arg;
+      return;
+    }
+
+
+    for (auto ID : Arg.NotPreservedAnalysisIDs) {
+      PreservedIDs.erase(ID);
+      NotPreservedAnalysisIDs.insert(ID);
+    }
+    for (auto ID : PreservedIDs)
+      if (!Arg.PreservedIDs.count(ID))
+        PreservedIDs.erase(ID);
+  }
+
+
+
+
+
+  void intersect(PreservedAnalyses &&Arg) {
+    if (Arg.areAllPreserved())
+      return;
+    if (areAllPreserved()) {
+      *this = std::move(Arg);
+      return;
+    }
+
+
+    for (auto ID : Arg.NotPreservedAnalysisIDs) {
+      PreservedIDs.erase(ID);
+      NotPreservedAnalysisIDs.insert(ID);
+    }
+    for (auto ID : PreservedIDs)
+      if (!Arg.PreservedIDs.count(ID))
+        PreservedIDs.erase(ID);
+  }
+
+
+
+  class PreservedAnalysisChecker {
+    friend class PreservedAnalyses;
+
+    const PreservedAnalyses &PA;
+    AnalysisKey *const ID;
+    const bool IsAbandoned;
+
+
+
+
+    PreservedAnalysisChecker(const PreservedAnalyses &PA, AnalysisKey *ID)
+        : PA(PA), ID(ID), IsAbandoned(PA.NotPreservedAnalysisIDs.count(ID)) {}
+
+  public:
+
+
+
+    bool preserved() {
+      return !IsAbandoned && (PA.PreservedIDs.count(&AllAnalysesKey) ||
+                              PA.PreservedIDs.count(ID));
+    }
+
+
+
+
+    template <typename AnalysisSetT> bool preservedSet() {
+      AnalysisSetKey *SetID = AnalysisSetT::ID();
+      return !IsAbandoned && (PA.PreservedIDs.count(&AllAnalysesKey) ||
+                              PA.PreservedIDs.count(SetID));
+    }
+  };
+
+
+
+
+
+
+  template <typename AnalysisT> PreservedAnalysisChecker getChecker() const {
+    return PreservedAnalysisChecker(*this, AnalysisT::ID());
+  }
+
+
+
+
+
+
+  PreservedAnalysisChecker getChecker(AnalysisKey *ID) const {
+    return PreservedAnalysisChecker(*this, ID);
+  }
+
+
+
+
+
+  bool areAllPreserved() const {
+    return NotPreservedAnalysisIDs.empty() &&
+           PreservedIDs.count(&AllAnalysesKey);
+  }
+
+
+
+
+  template <typename AnalysisSetT> bool allAnalysesInSetPreserved() const {
+    return allAnalysesInSetPreserved(AnalysisSetT::ID());
+  }
+
+
+
+
+  bool allAnalysesInSetPreserved(AnalysisSetKey *SetID) const {
+    return NotPreservedAnalysisIDs.empty() &&
+           (PreservedIDs.count(&AllAnalysesKey) || PreservedIDs.count(SetID));
+  }
+
+private:
+
+  static AnalysisSetKey AllAnalysesKey;
+
+
+  SmallPtrSet<void *, 2> PreservedIDs;
+  SmallPtrSet<AnalysisKey *, 2> NotPreservedAnalysisIDs;
+};
+
+
+template <typename IRUnitT, typename... ExtraArgTs> class AnalysisManager;
+
+
+
+
+
+template <typename DerivedT> struct PassInfoMixin {
+
+  static StringRef name() {
+    static_assert(std::is_base_of<PassInfoMixin, DerivedT>::value,
+                  "Must pass the derived type as the template argument!");
+    StringRef Name = getTypeName<DerivedT>();
+    if (Name.startswith("llvm::"))
+      Name = Name.drop_front(strlen("llvm::"));
+    return Name;
+  }
+};
+
+
+
+
+
+template <typename DerivedT>
+struct AnalysisInfoMixin : PassInfoMixin<DerivedT> {
+  static AnalysisKey *ID() {
+    static_assert(std::is_base_of<AnalysisInfoMixin, DerivedT>::value,
+                  "Must pass the derived type as the template argument!");
+    return &DerivedT::Key;
+  }
+};
+template <typename IRUnitT,
+          typename AnalysisManagerT = AnalysisManager<IRUnitT>,
+          typename... ExtraArgTs>
+class PassManager : public PassInfoMixin<
+                        PassManager<IRUnitT, AnalysisManagerT, ExtraArgTs...>> {
+public:
+
+
+
+  explicit PassManager(bool DebugLogging = false) : DebugLogging(DebugLogging) {}
+
+
+
+
+
+  PassManager(PassManager &&Arg)
+      : Passes(std::move(Arg.Passes)),
+        DebugLogging(std::move(Arg.DebugLogging)) {}
+
+  PassManager &operator=(PassManager &&RHS) {
+    Passes = std::move(RHS.Passes);
+    DebugLogging = std::move(RHS.DebugLogging);
+    return *this;
+  }
+
+
+
+  PreservedAnalyses run(IRUnitT &IR, AnalysisManagerT &AM,
+                        ExtraArgTs... ExtraArgs) {
+    PreservedAnalyses PA = PreservedAnalyses::all();
+
+    if (DebugLogging)
+      dbgs() << "Starting " << getTypeName<IRUnitT>() << " pass manager run.\n";
+
+    for (unsigned Idx = 0, Size = Passes.size(); Idx != Size; ++Idx) {
+      if (DebugLogging)
+        dbgs() << "Running pass: " << Passes[Idx]->name() << " on "
+               << IR.getName() << "\n";
+
+      PreservedAnalyses PassPA = Passes[Idx]->run(IR, AM, ExtraArgs...);
+
+
+
+      AM.invalidate(IR, PassPA);
+
+
+
+      PA.intersect(std::move(PassPA));
+
+
+
+
+
+
+    }
+
+
+
+
+
+    PA.preserveSet<AllAnalysesOn<IRUnitT>>();
+
+    if (DebugLogging)
+      dbgs() << "Finished " << getTypeName<IRUnitT>() << " pass manager run.\n";
+
+    return PA;
+  }
+
+  template <typename PassT> void addPass(PassT Pass) {
+    using PassModelT =
+        detail::PassModel<IRUnitT, PassT, PreservedAnalyses, AnalysisManagerT,
+                          ExtraArgTs...>;
+
+    Passes.emplace_back(new PassModelT(std::move(Pass)));
+  }
+
+private:
+  using PassConceptT =
+      detail::PassConcept<IRUnitT, AnalysisManagerT, ExtraArgTs...>;
+
+  std::vector<std::unique_ptr<PassConceptT>> Passes;
+
+
+  bool DebugLogging;
+};
+
+extern template class PassManager<Module>;
+
+
+using ModulePassManager = PassManager<Module>;
+
+extern template class PassManager<Function>;
+
+
+using FunctionPassManager = PassManager<Function>;
+
+
+
+
+
+
+template <typename IRUnitT, typename... ExtraArgTs> class AnalysisManager {
+public:
+  class Invalidator;
+
+private:
+
+  using ResultConceptT =
+      detail::AnalysisResultConcept<IRUnitT, PreservedAnalyses, Invalidator>;
+  using PassConceptT =
+      detail::AnalysisPassConcept<IRUnitT, PreservedAnalyses, Invalidator,
+                                  ExtraArgTs...>;
+
+
+
+
+
+
+
+  using AnalysisResultListT =
+      std::list<std::pair<AnalysisKey *, std::unique_ptr<ResultConceptT>>>;
+
+
+  using AnalysisResultListMapT = DenseMap<IRUnitT *, AnalysisResultListT>;
+
+
+
+
+  using AnalysisResultMapT =
+      DenseMap<std::pair<AnalysisKey *, IRUnitT *>,
+               typename AnalysisResultListT::iterator>;
+
+public:
+  class Invalidator {
+  public:
+    template <typename PassT>
+    bool invalidate(IRUnitT &IR, const PreservedAnalyses &PA) {
+      using ResultModelT =
+          detail::AnalysisResultModel<IRUnitT, PassT, typename PassT::Result,
+                                      PreservedAnalyses, Invalidator>;
+
+      return invalidateImpl<ResultModelT>(PassT::ID(), IR, PA);
+    }
+
+
+
+
+
+
+
+    bool invalidate(AnalysisKey *ID, IRUnitT &IR, const PreservedAnalyses &PA) {
+      return invalidateImpl<>(ID, IR, PA);
+    }
+
+  private:
+    friend class AnalysisManager;
+
+    template <typename ResultT = ResultConceptT>
+    bool invalidateImpl(AnalysisKey *ID, IRUnitT &IR,
+                        const PreservedAnalyses &PA) {
+
+
+      auto IMapI = IsResultInvalidated.find(ID);
+      if (IMapI != IsResultInvalidated.end())
+        return IMapI->second;
+
+
+      auto RI = Results.find({ID, &IR});
+      
+     ((
+     RI != Results.end() && "Trying to invalidate a dependent result that isn't in the " "manager's cache is always an error, likely due to a stale result " "handle!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "RI != Results.end() && \"Trying to invalidate a dependent result that isn't in the \" \"manager's cache is always an error, likely due to a stale result \" \"handle!\""
+     ,
+
+
+                      "/home/trippels/llvm/llvm/include/llvm/IR/PassManager.h"
+      ,
+
+
+                      612
+      , __PRETTY_FUNCTION__))
+
+
+                       
+                      ;
+
+      auto &Result = static_cast<ResultT &>(*RI->second->second);
+
+
+
+
+
+      bool Inserted;
+      std::tie(IMapI, Inserted) =
+          IsResultInvalidated.insert({ID, Result.invalidate(IR, PA, *this)});
+      (void)Inserted;
+      
+     ((
+     Inserted && "Should not have already inserted this ID, likely " "indicates a dependency cycle!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "Inserted && \"Should not have already inserted this ID, likely \" \"indicates a dependency cycle!\""
+     ,
+                                                        "/home/trippels/llvm/llvm/include/llvm/IR/PassManager.h"
+      ,
+                                                        625
+      , __PRETTY_FUNCTION__))
+                                                         
+                                                        ;
+      return IMapI->second;
+    }
+
+    Invalidator(SmallDenseMap<AnalysisKey *, bool, 8> &IsResultInvalidated,
+                const AnalysisResultMapT &Results)
+        : IsResultInvalidated(IsResultInvalidated), Results(Results) {}
+
+    SmallDenseMap<AnalysisKey *, bool, 8> &IsResultInvalidated;
+    const AnalysisResultMapT &Results;
+  };
+
+
+
+
+  AnalysisManager(bool DebugLogging = false) : DebugLogging(DebugLogging) {}
+  AnalysisManager(AnalysisManager &&) = default;
+  AnalysisManager &operator=(AnalysisManager &&) = default;
+
+
+  bool empty() const {
+    
+   ((
+   AnalysisResults.empty() == AnalysisResultLists.empty() && "The storage and index of analysis results disagree on how many " "there are!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "AnalysisResults.empty() == AnalysisResultLists.empty() && \"The storage and index of analysis results disagree on how many \" \"there are!\""
+   ,
+
+                       "/home/trippels/llvm/llvm/include/llvm/IR/PassManager.h"
+    ,
+
+                       648
+    , __PRETTY_FUNCTION__))
+
+                        
+                       ;
+    return AnalysisResults.empty();
+  }
+
+
+
+
+
+
+  void clear(IRUnitT &IR, llvm::StringRef Name) {
+    if (DebugLogging)
+      dbgs() << "Clearing all analysis results for: " << Name << "\n";
+
+    auto ResultsListI = AnalysisResultLists.find(&IR);
+    if (ResultsListI == AnalysisResultLists.end())
+      return;
+
+    for (auto &IDAndResult : ResultsListI->second)
+      AnalysisResults.erase({IDAndResult.first, &IR});
+
+
+    AnalysisResultLists.erase(ResultsListI);
+  }
+
+
+
+
+
+
+
+  void clear() {
+    AnalysisResults.clear();
+    AnalysisResultLists.clear();
+  }
+
+
+
+
+  template <typename PassT>
+  typename PassT::Result &getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs) {
+    
+   ((
+   AnalysisPasses.count(PassT::ID()) && "This analysis pass was not registered prior to being queried"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "AnalysisPasses.count(PassT::ID()) && \"This analysis pass was not registered prior to being queried\""
+   ,
+                                                                         "/home/trippels/llvm/llvm/include/llvm/IR/PassManager.h"
+    ,
+                                                                         689
+    , __PRETTY_FUNCTION__))
+                                                                          
+                                                                         ;
+    ResultConceptT &ResultConcept =
+        getResultImpl(PassT::ID(), IR, ExtraArgs...);
+
+    using ResultModelT =
+        detail::AnalysisResultModel<IRUnitT, PassT, typename PassT::Result,
+                                    PreservedAnalyses, Invalidator>;
+
+    return static_cast<ResultModelT &>(ResultConcept).Result;
+  }
+
+
+
+
+
+
+  template <typename PassT>
+  typename PassT::Result *getCachedResult(IRUnitT &IR) const {
+    
+   ((
+   AnalysisPasses.count(PassT::ID()) && "This analysis pass was not registered prior to being queried"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "AnalysisPasses.count(PassT::ID()) && \"This analysis pass was not registered prior to being queried\""
+   ,
+                                                                         "/home/trippels/llvm/llvm/include/llvm/IR/PassManager.h"
+    ,
+                                                                         708
+    , __PRETTY_FUNCTION__))
+                                                                          
+                                                                         ;
+
+    ResultConceptT *ResultConcept = getCachedResultImpl(PassT::ID(), IR);
+    if (!ResultConcept)
+      return nullptr;
+
+    using ResultModelT =
+        detail::AnalysisResultModel<IRUnitT, PassT, typename PassT::Result,
+                                    PreservedAnalyses, Invalidator>;
+
+    return &static_cast<ResultModelT *>(ResultConcept)->Result;
+  }
+  template <typename PassBuilderT>
+  bool registerPass(PassBuilderT &&PassBuilder) {
+    using PassT = decltype(PassBuilder());
+    using PassModelT =
+        detail::AnalysisPassModel<IRUnitT, PassT, PreservedAnalyses,
+                                  Invalidator, ExtraArgTs...>;
+
+    auto &PassPtr = AnalysisPasses[PassT::ID()];
+    if (PassPtr)
+
+      return false;
+
+
+    PassPtr.reset(new PassModelT(PassBuilder()));
+    return true;
+  }
+
+
+
+
+
+  template <typename PassT> void invalidate(IRUnitT &IR) {
+    
+   ((
+   AnalysisPasses.count(PassT::ID()) && "This analysis pass was not registered prior to being invalidated"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "AnalysisPasses.count(PassT::ID()) && \"This analysis pass was not registered prior to being invalidated\""
+   ,
+                                                                             "/home/trippels/llvm/llvm/include/llvm/IR/PassManager.h"
+    ,
+                                                                             761
+    , __PRETTY_FUNCTION__))
+                                                                              
+                                                                             ;
+    invalidateImpl(PassT::ID(), IR);
+  }
+
+
+
+
+
+  void invalidate(IRUnitT &IR, const PreservedAnalyses &PA) {
+
+    if (PA.allAnalysesInSetPreserved<AllAnalysesOn<IRUnitT>>())
+      return;
+
+    if (DebugLogging)
+      dbgs() << "Invalidating all non-preserved analyses for: " << IR.getName()
+             << "\n";
+
+
+
+    SmallDenseMap<AnalysisKey *, bool, 8> IsResultInvalidated;
+    Invalidator Inv(IsResultInvalidated, AnalysisResults);
+    AnalysisResultListT &ResultsList = AnalysisResultLists[&IR];
+    for (auto &AnalysisResultPair : ResultsList) {
+
+
+
+
+      AnalysisKey *ID = AnalysisResultPair.first;
+      auto &Result = *AnalysisResultPair.second;
+
+      auto IMapI = IsResultInvalidated.find(ID);
+      if (IMapI != IsResultInvalidated.end())
+
+        continue;
+
+
+
+
+
+
+      bool Inserted =
+          IsResultInvalidated.insert({ID, Result.invalidate(IR, PA, Inv)})
+              .second;
+      (void)Inserted;
+      
+     ((
+     Inserted && "Should never have already inserted this ID, likely " "indicates a cycle!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "Inserted && \"Should never have already inserted this ID, likely \" \"indicates a cycle!\""
+     ,
+                                             "/home/trippels/llvm/llvm/include/llvm/IR/PassManager.h"
+      ,
+                                             806
+      , __PRETTY_FUNCTION__))
+                                              
+                                             ;
+    }
+
+
+    if (!IsResultInvalidated.empty()) {
+      for (auto I = ResultsList.begin(), E = ResultsList.end(); I != E;) {
+        AnalysisKey *ID = I->first;
+        if (!IsResultInvalidated.lookup(ID)) {
+          ++I;
+          continue;
+        }
+
+        if (DebugLogging)
+          dbgs() << "Invalidating analysis: " << this->lookUpPass(ID).name()
+                 << " on " << IR.getName() << "\n";
+
+        I = ResultsList.erase(I);
+        AnalysisResults.erase({ID, &IR});
+      }
+    }
+
+    if (ResultsList.empty())
+      AnalysisResultLists.erase(&IR);
+  }
+
+private:
+
+  PassConceptT &lookUpPass(AnalysisKey *ID) {
+    typename AnalysisPassMapT::iterator PI = AnalysisPasses.find(ID);
+    
+   ((
+   PI != AnalysisPasses.end() && "Analysis passes must be registered prior to being queried!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "PI != AnalysisPasses.end() && \"Analysis passes must be registered prior to being queried!\""
+   ,
+                                                                       "/home/trippels/llvm/llvm/include/llvm/IR/PassManager.h"
+    ,
+                                                                       836
+    , __PRETTY_FUNCTION__))
+                                                                        
+                                                                       ;
+    return *PI->second;
+  }
+
+
+  const PassConceptT &lookUpPass(AnalysisKey *ID) const {
+    typename AnalysisPassMapT::const_iterator PI = AnalysisPasses.find(ID);
+    
+   ((
+   PI != AnalysisPasses.end() && "Analysis passes must be registered prior to being queried!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "PI != AnalysisPasses.end() && \"Analysis passes must be registered prior to being queried!\""
+   ,
+                                                                       "/home/trippels/llvm/llvm/include/llvm/IR/PassManager.h"
+    ,
+                                                                       844
+    , __PRETTY_FUNCTION__))
+                                                                        
+                                                                       ;
+    return *PI->second;
+  }
+
+
+  ResultConceptT &getResultImpl(AnalysisKey *ID, IRUnitT &IR,
+                                ExtraArgTs... ExtraArgs) {
+    typename AnalysisResultMapT::iterator RI;
+    bool Inserted;
+    std::tie(RI, Inserted) = AnalysisResults.insert(std::make_pair(
+        std::make_pair(ID, &IR), typename AnalysisResultListT::iterator()));
+
+
+
+    if (Inserted) {
+      auto &P = this->lookUpPass(ID);
+      if (DebugLogging)
+        dbgs() << "Running analysis: " << P.name() << " on " << IR.getName()
+               << "\n";
+      AnalysisResultListT &ResultList = AnalysisResultLists[&IR];
+      ResultList.emplace_back(ID, P.run(IR, *this, ExtraArgs...));
+
+
+
+      RI = AnalysisResults.find({ID, &IR});
+      
+     ((
+     RI != AnalysisResults.end() && "we just inserted it!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "RI != AnalysisResults.end() && \"we just inserted it!\""
+     , "/home/trippels/llvm/llvm/include/llvm/IR/PassManager.h", 869, __PRETTY_FUNCTION__))
+                                                                  ;
+
+      RI->second = std::prev(ResultList.end());
+    }
+
+    return *RI->second->second;
+  }
+
+
+  ResultConceptT *getCachedResultImpl(AnalysisKey *ID, IRUnitT &IR) const {
+    typename AnalysisResultMapT::const_iterator RI =
+        AnalysisResults.find({ID, &IR});
+    return RI == AnalysisResults.end() ? nullptr : &*RI->second->second;
+  }
+
+
+  void invalidateImpl(AnalysisKey *ID, IRUnitT &IR) {
+    typename AnalysisResultMapT::iterator RI =
+        AnalysisResults.find({ID, &IR});
+    if (RI == AnalysisResults.end())
+      return;
+
+    if (DebugLogging)
+      dbgs() << "Invalidating analysis: " << this->lookUpPass(ID).name()
+             << " on " << IR.getName() << "\n";
+    AnalysisResultLists[&IR].erase(RI->second);
+    AnalysisResults.erase(RI);
+  }
+
+
+  using AnalysisPassMapT =
+      DenseMap<AnalysisKey *, std::unique_ptr<PassConceptT>>;
+
+
+  AnalysisPassMapT AnalysisPasses;
+
+
+
+
+
+  AnalysisResultListMapT AnalysisResultLists;
+
+
+
+  AnalysisResultMapT AnalysisResults;
+
+
+  bool DebugLogging;
+};
+
+extern template class AnalysisManager<Module>;
+
+
+using ModuleAnalysisManager = AnalysisManager<Module>;
+
+extern template class AnalysisManager<Function>;
+
+
+using FunctionAnalysisManager = AnalysisManager<Function>;
+template <typename AnalysisManagerT, typename IRUnitT, typename... ExtraArgTs>
+class InnerAnalysisManagerProxy
+    : public AnalysisInfoMixin<
+          InnerAnalysisManagerProxy<AnalysisManagerT, IRUnitT>> {
+public:
+  class Result {
+  public:
+    explicit Result(AnalysisManagerT &InnerAM) : InnerAM(&InnerAM) {}
+
+    Result(Result &&Arg) : InnerAM(std::move(Arg.InnerAM)) {
+
+
+
+      Arg.InnerAM = nullptr;
+    }
+
+    ~Result() {
+
+      if (!InnerAM)
+        return;
+
+
+
+      InnerAM->clear();
+    }
+
+    Result &operator=(Result &&RHS) {
+      InnerAM = RHS.InnerAM;
+
+
+
+      RHS.InnerAM = nullptr;
+      return *this;
+    }
+
+
+    AnalysisManagerT &getManager() { return *InnerAM; }
+    bool invalidate(
+        IRUnitT &IR, const PreservedAnalyses &PA,
+        typename AnalysisManager<IRUnitT, ExtraArgTs...>::Invalidator &Inv);
+
+  private:
+    AnalysisManagerT *InnerAM;
+  };
+
+  explicit InnerAnalysisManagerProxy(AnalysisManagerT &InnerAM)
+      : InnerAM(&InnerAM) {}
+
+
+
+
+
+
+  Result run(IRUnitT &IR, AnalysisManager<IRUnitT, ExtraArgTs...> &AM,
+             ExtraArgTs...) {
+    return Result(*InnerAM);
+  }
+
+private:
+  friend AnalysisInfoMixin<
+      InnerAnalysisManagerProxy<AnalysisManagerT, IRUnitT>>;
+
+  static AnalysisKey Key;
+
+  AnalysisManagerT *InnerAM;
+};
+
+template <typename AnalysisManagerT, typename IRUnitT, typename... ExtraArgTs>
+AnalysisKey
+    InnerAnalysisManagerProxy<AnalysisManagerT, IRUnitT, ExtraArgTs...>::Key;
+
+
+using FunctionAnalysisManagerModuleProxy =
+    InnerAnalysisManagerProxy<FunctionAnalysisManager, Module>;
+
+
+
+template <>
+bool FunctionAnalysisManagerModuleProxy::Result::invalidate(
+    Module &M, const PreservedAnalyses &PA,
+    ModuleAnalysisManager::Invalidator &Inv);
+
+
+
+extern template class InnerAnalysisManagerProxy<FunctionAnalysisManager,
+                                                Module>;
+template <typename AnalysisManagerT, typename IRUnitT, typename... ExtraArgTs>
+class OuterAnalysisManagerProxy
+    : public AnalysisInfoMixin<
+          OuterAnalysisManagerProxy<AnalysisManagerT, IRUnitT, ExtraArgTs...>> {
+public:
+
+  class Result {
+  public:
+    explicit Result(const AnalysisManagerT &AM) : AM(&AM) {}
+
+    const AnalysisManagerT &getManager() const { return *AM; }
+
+
+    bool invalidate(
+        IRUnitT &IRUnit, const PreservedAnalyses &PA,
+        typename AnalysisManager<IRUnitT, ExtraArgTs...>::Invalidator &Inv) {
+
+
+      SmallVector<AnalysisKey *, 4> DeadKeys;
+      for (auto &KeyValuePair : OuterAnalysisInvalidationMap) {
+        AnalysisKey *OuterID = KeyValuePair.first;
+        auto &InnerIDs = KeyValuePair.second;
+        InnerIDs.erase(llvm::remove_if(InnerIDs, [&](AnalysisKey *InnerID) {
+          return Inv.invalidate(InnerID, IRUnit, PA); }),
+                       InnerIDs.end());
+        if (InnerIDs.empty())
+          DeadKeys.push_back(OuterID);
+      }
+
+      for (auto OuterID : DeadKeys)
+        OuterAnalysisInvalidationMap.erase(OuterID);
+
+
+      return false;
+    }
+
+
+
+    template <typename OuterAnalysisT, typename InvalidatedAnalysisT>
+    void registerOuterAnalysisInvalidation() {
+      AnalysisKey *OuterID = OuterAnalysisT::ID();
+      AnalysisKey *InvalidatedID = InvalidatedAnalysisT::ID();
+
+      auto &InvalidatedIDList = OuterAnalysisInvalidationMap[OuterID];
+
+
+
+
+      auto InvalidatedIt = std::find(InvalidatedIDList.begin(),
+                                     InvalidatedIDList.end(), InvalidatedID);
+      if (InvalidatedIt == InvalidatedIDList.end())
+        InvalidatedIDList.push_back(InvalidatedID);
+    }
+
+
+
+    const SmallDenseMap<AnalysisKey *, TinyPtrVector<AnalysisKey *>, 2> &
+    getOuterInvalidations() const {
+      return OuterAnalysisInvalidationMap;
+    }
+
+  private:
+    const AnalysisManagerT *AM;
+
+
+
+    SmallDenseMap<AnalysisKey *, TinyPtrVector<AnalysisKey *>, 2>
+        OuterAnalysisInvalidationMap;
+  };
+
+  OuterAnalysisManagerProxy(const AnalysisManagerT &AM) : AM(&AM) {}
+
+
+
+
+  Result run(IRUnitT &, AnalysisManager<IRUnitT, ExtraArgTs...> &,
+             ExtraArgTs...) {
+    return Result(*AM);
+  }
+
+private:
+  friend AnalysisInfoMixin<
+      OuterAnalysisManagerProxy<AnalysisManagerT, IRUnitT, ExtraArgTs...>>;
+
+  static AnalysisKey Key;
+
+  const AnalysisManagerT *AM;
+};
+
+template <typename AnalysisManagerT, typename IRUnitT, typename... ExtraArgTs>
+AnalysisKey
+    OuterAnalysisManagerProxy<AnalysisManagerT, IRUnitT, ExtraArgTs...>::Key;
+
+extern template class OuterAnalysisManagerProxy<ModuleAnalysisManager,
+                                                Function>;
+
+using ModuleAnalysisManagerFunctionProxy =
+    OuterAnalysisManagerProxy<ModuleAnalysisManager, Function>;
+template <typename FunctionPassT>
+class ModuleToFunctionPassAdaptor
+    : public PassInfoMixin<ModuleToFunctionPassAdaptor<FunctionPassT>> {
+public:
+  explicit ModuleToFunctionPassAdaptor(FunctionPassT Pass)
+      : Pass(std::move(Pass)) {}
+
+
+  PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM) {
+    FunctionAnalysisManager &FAM =
+        AM.getResult<FunctionAnalysisManagerModuleProxy>(M).getManager();
+
+    PreservedAnalyses PA = PreservedAnalyses::all();
+    for (Function &F : M) {
+      if (F.isDeclaration())
+        continue;
+
+      PreservedAnalyses PassPA = Pass.run(F, FAM);
+
+
+
+
+      FAM.invalidate(F, PassPA);
+
+
+
+      PA.intersect(std::move(PassPA));
+    }
+
+
+
+
+
+
+    PA.preserveSet<AllAnalysesOn<Function>>();
+    PA.preserve<FunctionAnalysisManagerModuleProxy>();
+    return PA;
+  }
+
+private:
+  FunctionPassT Pass;
+};
+
+
+
+template <typename FunctionPassT>
+ModuleToFunctionPassAdaptor<FunctionPassT>
+createModuleToFunctionPassAdaptor(FunctionPassT Pass) {
+  return ModuleToFunctionPassAdaptor<FunctionPassT>(std::move(Pass));
+}
+template <typename AnalysisT, typename IRUnitT,
+          typename AnalysisManagerT = AnalysisManager<IRUnitT>,
+          typename... ExtraArgTs>
+struct RequireAnalysisPass
+    : PassInfoMixin<RequireAnalysisPass<AnalysisT, IRUnitT, AnalysisManagerT,
+                                        ExtraArgTs...>> {
+
+
+
+
+
+
+  PreservedAnalyses run(IRUnitT &Arg, AnalysisManagerT &AM,
+                        ExtraArgTs &&... Args) {
+    (void)AM.template getResult<AnalysisT>(Arg,
+                                           std::forward<ExtraArgTs>(Args)...);
+
+    return PreservedAnalyses::all();
+  }
+};
+
+
+
+template <typename AnalysisT>
+struct InvalidateAnalysisPass
+    : PassInfoMixin<InvalidateAnalysisPass<AnalysisT>> {
+
+
+
+
+
+
+  template <typename IRUnitT, typename AnalysisManagerT, typename... ExtraArgTs>
+  PreservedAnalyses run(IRUnitT &Arg, AnalysisManagerT &AM, ExtraArgTs &&...) {
+    auto PA = PreservedAnalyses::all();
+    PA.abandon<AnalysisT>();
+    return PA;
+  }
+};
+
+
+
+
+
+struct InvalidateAllAnalysesPass : PassInfoMixin<InvalidateAllAnalysesPass> {
+
+  template <typename IRUnitT, typename AnalysisManagerT, typename... ExtraArgTs>
+  PreservedAnalyses run(IRUnitT &, AnalysisManagerT &, ExtraArgTs &&...) {
+    return PreservedAnalyses::none();
+  }
+};
+
+
+
+
+
+template <typename PassT>
+class RepeatedPass : public PassInfoMixin<RepeatedPass<PassT>> {
+public:
+  RepeatedPass(int Count, PassT P) : Count(Count), P(std::move(P)) {}
+
+  template <typename IRUnitT, typename AnalysisManagerT, typename... Ts>
+  PreservedAnalyses run(IRUnitT &Arg, AnalysisManagerT &AM, Ts &&... Args) {
+    auto PA = PreservedAnalyses::all();
+    for (int i = 0; i < Count; ++i)
+      PA.intersect(P.run(Arg, AM, std::forward<Ts>(Args)...));
+    return PA;
+  }
+
+private:
+  int Count;
+  PassT P;
+};
+
+template <typename PassT>
+RepeatedPass<PassT> createRepeatedPass(int Count, PassT P) {
+  return RepeatedPass<PassT>(Count, std::move(P));
+}
+
+}
+
+
+
+
+
+namespace llvm {
+
+class DominatorTree;
+class LoopInfo;
+class Loop;
+class MDNode;
+class PHINode;
+class raw_ostream;
+template <class N, bool IsPostDom> class DominatorTreeBase;
+template <class N, class M> class LoopInfoBase;
+template <class N, class M> class LoopBase;
+
+
+
+
+
+template <class BlockT, class LoopT> class LoopBase {
+  LoopT *ParentLoop;
+
+  std::vector<LoopT *> SubLoops;
+
+
+  std::vector<BlockT *> Blocks;
+
+  SmallPtrSet<const BlockT *, 8> DenseBlockSet;
+
+
+
+  bool IsInvalid = false;
+
+
+  LoopBase(const LoopBase<BlockT, LoopT> &) = delete;
+  const LoopBase<BlockT, LoopT> &
+  operator=(const LoopBase<BlockT, LoopT> &) = delete;
+
+public:
+
+
+
+  unsigned getLoopDepth() const {
+    
+   ((
+   !isInvalid() && "Loop not in a valid state!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!isInvalid() && \"Loop not in a valid state!\""
+   , "/home/trippels/llvm/llvm/include/llvm/Analysis/LoopInfo.h", 93, __PRETTY_FUNCTION__))
+                                                       ;
+    unsigned D = 1;
+    for (const LoopT *CurLoop = ParentLoop; CurLoop;
+         CurLoop = CurLoop->ParentLoop)
+      ++D;
+    return D;
+  }
+  BlockT *getHeader() const { return getBlocks().front(); }
+  LoopT *getParentLoop() const { return ParentLoop; }
+
+
+  void setParentLoop(LoopT *L) {
+    
+   ((
+   !isInvalid() && "Loop not in a valid state!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!isInvalid() && \"Loop not in a valid state!\""
+   , "/home/trippels/llvm/llvm/include/llvm/Analysis/LoopInfo.h", 105, __PRETTY_FUNCTION__))
+                                                       ;
+    ParentLoop = L;
+  }
+
+
+  bool contains(const LoopT *L) const {
+    
+   ((
+   !isInvalid() && "Loop not in a valid state!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!isInvalid() && \"Loop not in a valid state!\""
+   , "/home/trippels/llvm/llvm/include/llvm/Analysis/LoopInfo.h", 111, __PRETTY_FUNCTION__))
+                                                       ;
+    if (L == this)
+      return true;
+    if (!L)
+      return false;
+    return contains(L->getParentLoop());
+  }
+
+
+  bool contains(const BlockT *BB) const {
+    
+   ((
+   !isInvalid() && "Loop not in a valid state!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!isInvalid() && \"Loop not in a valid state!\""
+   , "/home/trippels/llvm/llvm/include/llvm/Analysis/LoopInfo.h", 121, __PRETTY_FUNCTION__))
+                                                       ;
+    return DenseBlockSet.count(BB);
+  }
+
+
+  template <class InstT> bool contains(const InstT *Inst) const {
+    return contains(Inst->getParent());
+  }
+
+
+  const std::vector<LoopT *> &getSubLoops() const {
+    
+   ((
+   !isInvalid() && "Loop not in a valid state!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!isInvalid() && \"Loop not in a valid state!\""
+   , "/home/trippels/llvm/llvm/include/llvm/Analysis/LoopInfo.h", 132, __PRETTY_FUNCTION__))
+                                                       ;
+    return SubLoops;
+  }
+  std::vector<LoopT *> &getSubLoopsVector() {
+    
+   ((
+   !isInvalid() && "Loop not in a valid state!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!isInvalid() && \"Loop not in a valid state!\""
+   , "/home/trippels/llvm/llvm/include/llvm/Analysis/LoopInfo.h", 136, __PRETTY_FUNCTION__))
+                                                       ;
+    return SubLoops;
+  }
+  typedef typename std::vector<LoopT *>::const_iterator iterator;
+  typedef
+      typename std::vector<LoopT *>::const_reverse_iterator reverse_iterator;
+  iterator begin() const { return getSubLoops().begin(); }
+  iterator end() const { return getSubLoops().end(); }
+  reverse_iterator rbegin() const { return getSubLoops().rbegin(); }
+  reverse_iterator rend() const { return getSubLoops().rend(); }
+  bool empty() const { return getSubLoops().empty(); }
+
+
+  ArrayRef<BlockT *> getBlocks() const {
+    
+   ((
+   !isInvalid() && "Loop not in a valid state!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!isInvalid() && \"Loop not in a valid state!\""
+   , "/home/trippels/llvm/llvm/include/llvm/Analysis/LoopInfo.h", 150, __PRETTY_FUNCTION__))
+                                                       ;
+    return Blocks;
+  }
+  typedef typename ArrayRef<BlockT *>::const_iterator block_iterator;
+  block_iterator block_begin() const { return getBlocks().begin(); }
+  block_iterator block_end() const { return getBlocks().end(); }
+  inline iterator_range<block_iterator> blocks() const {
+    
+   ((
+   !isInvalid() && "Loop not in a valid state!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!isInvalid() && \"Loop not in a valid state!\""
+   , "/home/trippels/llvm/llvm/include/llvm/Analysis/LoopInfo.h", 157, __PRETTY_FUNCTION__))
+                                                       ;
+    return make_range(block_begin(), block_end());
+  }
+
+
+
+  unsigned getNumBlocks() const {
+    
+   ((
+   !isInvalid() && "Loop not in a valid state!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!isInvalid() && \"Loop not in a valid state!\""
+   , "/home/trippels/llvm/llvm/include/llvm/Analysis/LoopInfo.h", 164, __PRETTY_FUNCTION__))
+                                                       ;
+    return Blocks.size();
+  }
+
+
+
+  std::vector<BlockT *> &getBlocksVector() {
+    
+   ((
+   !isInvalid() && "Loop not in a valid state!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!isInvalid() && \"Loop not in a valid state!\""
+   , "/home/trippels/llvm/llvm/include/llvm/Analysis/LoopInfo.h", 171, __PRETTY_FUNCTION__))
+                                                       ;
+    return Blocks;
+  }
+
+
+  SmallPtrSetImpl<const BlockT *> &getBlocksSet() {
+    
+   ((
+   !isInvalid() && "Loop not in a valid state!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!isInvalid() && \"Loop not in a valid state!\""
+   , "/home/trippels/llvm/llvm/include/llvm/Analysis/LoopInfo.h", 177, __PRETTY_FUNCTION__))
+                                                       ;
+    return DenseBlockSet;
+  }
+
+
+
+
+
+
+
+  bool isInvalid() const {
+
+    return IsInvalid;
+
+
+
+  }
+
+
+
+  bool isLoopExiting(const BlockT *BB) const {
+    
+   ((
+   !isInvalid() && "Loop not in a valid state!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!isInvalid() && \"Loop not in a valid state!\""
+   , "/home/trippels/llvm/llvm/include/llvm/Analysis/LoopInfo.h", 198, __PRETTY_FUNCTION__))
+                                                       ;
+    for (const auto &Succ : children<const BlockT *>(BB)) {
+      if (!contains(Succ))
+        return true;
+    }
+    return false;
+  }
+
+
+
+
+
+  bool isLoopLatch(const BlockT *BB) const {
+    
+   ((
+   !isInvalid() && "Loop not in a valid state!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!isInvalid() && \"Loop not in a valid state!\""
+   , "/home/trippels/llvm/llvm/include/llvm/Analysis/LoopInfo.h", 211, __PRETTY_FUNCTION__))
+                                                       ;
+    
+   ((
+   contains(BB) && "block does not belong to the loop"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "contains(BB) && \"block does not belong to the loop\""
+   , "/home/trippels/llvm/llvm/include/llvm/Analysis/LoopInfo.h", 212, __PRETTY_FUNCTION__))
+                                                              ;
+
+    BlockT *Header = getHeader();
+    auto PredBegin = GraphTraits<Inverse<BlockT *>>::child_begin(Header);
+    auto PredEnd = GraphTraits<Inverse<BlockT *>>::child_end(Header);
+    return std::find(PredBegin, PredEnd, BB) != PredEnd;
+  }
+
+
+  unsigned getNumBackEdges() const {
+    
+   ((
+   !isInvalid() && "Loop not in a valid state!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!isInvalid() && \"Loop not in a valid state!\""
+   , "/home/trippels/llvm/llvm/include/llvm/Analysis/LoopInfo.h", 222, __PRETTY_FUNCTION__))
+                                                       ;
+    unsigned NumBackEdges = 0;
+    BlockT *H = getHeader();
+
+    for (const auto Pred : children<Inverse<BlockT *>>(H))
+      if (contains(Pred))
+        ++NumBackEdges;
+
+    return NumBackEdges;
+  }
+  void getExitingBlocks(SmallVectorImpl<BlockT *> &ExitingBlocks) const;
+
+
+
+  BlockT *getExitingBlock() const;
+
+
+
+  void getExitBlocks(SmallVectorImpl<BlockT *> &ExitBlocks) const;
+
+
+
+  BlockT *getExitBlock() const;
+
+
+  typedef std::pair<const BlockT *, const BlockT *> Edge;
+
+
+  void getExitEdges(SmallVectorImpl<Edge> &ExitEdges) const;
+
+
+
+
+
+
+
+  BlockT *getLoopPreheader() const;
+
+
+
+
+
+  BlockT *getLoopPredecessor() const;
+
+
+
+  BlockT *getLoopLatch() const;
+
+
+
+  void getLoopLatches(SmallVectorImpl<BlockT *> &LoopLatches) const {
+    
+   ((
+   !isInvalid() && "Loop not in a valid state!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!isInvalid() && \"Loop not in a valid state!\""
+   , "/home/trippels/llvm/llvm/include/llvm/Analysis/LoopInfo.h", 285, __PRETTY_FUNCTION__))
+                                                       ;
+    BlockT *H = getHeader();
+    for (const auto Pred : children<Inverse<BlockT *>>(H))
+      if (contains(Pred))
+        LoopLatches.push_back(Pred);
+  }
+  void addBasicBlockToLoop(BlockT *NewBB, LoopInfoBase<BlockT, LoopT> &LI);
+
+
+
+
+
+  void replaceChildLoopWith(LoopT *OldChild, LoopT *NewChild);
+
+
+
+  void addChildLoop(LoopT *NewChild) {
+    
+   ((
+   !isInvalid() && "Loop not in a valid state!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!isInvalid() && \"Loop not in a valid state!\""
+   , "/home/trippels/llvm/llvm/include/llvm/Analysis/LoopInfo.h", 312, __PRETTY_FUNCTION__))
+                                                       ;
+    
+   ((
+   !NewChild->ParentLoop && "NewChild already has a parent!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!NewChild->ParentLoop && \"NewChild already has a parent!\""
+   , "/home/trippels/llvm/llvm/include/llvm/Analysis/LoopInfo.h", 313, __PRETTY_FUNCTION__))
+                                                                    ;
+    NewChild->ParentLoop = static_cast<LoopT *>(this);
+    SubLoops.push_back(NewChild);
+  }
+
+
+
+  LoopT *removeChildLoop(iterator I) {
+    
+   ((
+   !isInvalid() && "Loop not in a valid state!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!isInvalid() && \"Loop not in a valid state!\""
+   , "/home/trippels/llvm/llvm/include/llvm/Analysis/LoopInfo.h", 321, __PRETTY_FUNCTION__))
+                                                       ;
+    
+   ((
+   I != SubLoops.end() && "Cannot remove end iterator!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "I != SubLoops.end() && \"Cannot remove end iterator!\""
+   , "/home/trippels/llvm/llvm/include/llvm/Analysis/LoopInfo.h", 322, __PRETTY_FUNCTION__))
+                                                               ;
+    LoopT *Child = *I;
+    
+   ((
+   Child->ParentLoop == this && "Child is not a child of this loop!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Child->ParentLoop == this && \"Child is not a child of this loop!\""
+   , "/home/trippels/llvm/llvm/include/llvm/Analysis/LoopInfo.h", 324, __PRETTY_FUNCTION__))
+                                                                            ;
+    SubLoops.erase(SubLoops.begin() + (I - begin()));
+    Child->ParentLoop = nullptr;
+    return Child;
+  }
+
+
+
+  LoopT *removeChildLoop(LoopT *Child) {
+    return removeChildLoop(llvm::find(*this, Child));
+  }
+
+
+
+
+  void addBlockEntry(BlockT *BB) {
+    
+   ((
+   !isInvalid() && "Loop not in a valid state!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!isInvalid() && \"Loop not in a valid state!\""
+   , "/home/trippels/llvm/llvm/include/llvm/Analysis/LoopInfo.h", 340, __PRETTY_FUNCTION__))
+                                                       ;
+    Blocks.push_back(BB);
+    DenseBlockSet.insert(BB);
+  }
+
+
+  void reverseBlock(unsigned from) {
+    
+   ((
+   !isInvalid() && "Loop not in a valid state!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!isInvalid() && \"Loop not in a valid state!\""
+   , "/home/trippels/llvm/llvm/include/llvm/Analysis/LoopInfo.h", 347, __PRETTY_FUNCTION__))
+                                                       ;
+    std::reverse(Blocks.begin() + from, Blocks.end());
+  }
+
+
+  void reserveBlocks(unsigned size) {
+    
+   ((
+   !isInvalid() && "Loop not in a valid state!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!isInvalid() && \"Loop not in a valid state!\""
+   , "/home/trippels/llvm/llvm/include/llvm/Analysis/LoopInfo.h", 353, __PRETTY_FUNCTION__))
+                                                       ;
+    Blocks.reserve(size);
+  }
+
+
+
+  void moveToHeader(BlockT *BB) {
+    
+   ((
+   !isInvalid() && "Loop not in a valid state!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!isInvalid() && \"Loop not in a valid state!\""
+   , "/home/trippels/llvm/llvm/include/llvm/Analysis/LoopInfo.h", 360, __PRETTY_FUNCTION__))
+                                                       ;
+    if (Blocks[0] == BB)
+      return;
+    for (unsigned i = 0;; ++i) {
+      
+     ((
+     i != Blocks.size() && "Loop does not contain BB!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "i != Blocks.size() && \"Loop does not contain BB!\""
+     , "/home/trippels/llvm/llvm/include/llvm/Analysis/LoopInfo.h", 364, __PRETTY_FUNCTION__))
+                                                              ;
+      if (Blocks[i] == BB) {
+        Blocks[i] = Blocks[0];
+        Blocks[0] = BB;
+        return;
+      }
+    }
+  }
+
+
+
+
+  void removeBlockFromLoop(BlockT *BB) {
+    
+   ((
+   !isInvalid() && "Loop not in a valid state!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!isInvalid() && \"Loop not in a valid state!\""
+   , "/home/trippels/llvm/llvm/include/llvm/Analysis/LoopInfo.h", 377, __PRETTY_FUNCTION__))
+                                                       ;
+    auto I = find(Blocks, BB);
+    
+   ((
+   I != Blocks.end() && "N is not in this list!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "I != Blocks.end() && \"N is not in this list!\""
+   , "/home/trippels/llvm/llvm/include/llvm/Analysis/LoopInfo.h", 379, __PRETTY_FUNCTION__))
+                                                        ;
+    Blocks.erase(I);
+
+    DenseBlockSet.erase(BB);
+  }
+
+
+  void verifyLoop() const;
+
+
+  void verifyLoopNest(DenseSet<const LoopT *> *Loops) const;
+
+
+  void print(raw_ostream &OS, unsigned Depth = 0, bool Verbose = false) const;
+
+protected:
+  friend class LoopInfoBase<BlockT, LoopT>;
+
+
+  LoopBase() : ParentLoop(nullptr) {}
+
+  explicit LoopBase(BlockT *BB) : ParentLoop(nullptr) {
+    Blocks.push_back(BB);
+    DenseBlockSet.insert(BB);
+  }
+  ~LoopBase() {
+    for (auto *SubLoop : SubLoops)
+      SubLoop->~LoopT();
+
+
+    IsInvalid = true;
+
+    SubLoops.clear();
+    Blocks.clear();
+    DenseBlockSet.clear();
+    ParentLoop = nullptr;
+  }
+};
+
+template <class BlockT, class LoopT>
+raw_ostream &operator<<(raw_ostream &OS, const LoopBase<BlockT, LoopT> &Loop) {
+  Loop.print(OS);
+  return OS;
+}
+
+
+extern template class LoopBase<BasicBlock, Loop>;
+
+
+
+class Loop : public LoopBase<BasicBlock, Loop> {
+public:
+
+  class LocRange {
+    DebugLoc Start;
+    DebugLoc End;
+
+  public:
+    LocRange() {}
+    LocRange(DebugLoc Start) : Start(std::move(Start)), End(std::move(Start)) {}
+    LocRange(DebugLoc Start, DebugLoc End)
+        : Start(std::move(Start)), End(std::move(End)) {}
+
+    const DebugLoc &getStart() const { return Start; }
+    const DebugLoc &getEnd() const { return End; }
+
+
+
+    explicit operator bool() const { return Start && End; }
+  };
+
+
+  bool isLoopInvariant(const Value *V) const;
+
+
+
+  bool hasLoopInvariantOperands(const Instruction *I) const;
+  bool makeLoopInvariant(Value *V, bool &Changed,
+                         Instruction *InsertPt = nullptr) const;
+  bool makeLoopInvariant(Instruction *I, bool &Changed,
+                         Instruction *InsertPt = nullptr) const;
+  PHINode *getCanonicalInductionVariable() const;
+
+
+  bool isLCSSAForm(DominatorTree &DT) const;
+
+
+  bool isRecursivelyLCSSAForm(DominatorTree &DT, const LoopInfo &LI) const;
+
+
+
+  bool isLoopSimplifyForm() const;
+
+
+  bool isSafeToClone() const;
+  bool isAnnotatedParallel() const;
+
+
+
+
+
+
+
+  MDNode *getLoopID() const;
+
+
+
+
+
+
+
+  void setLoopID(MDNode *LoopID) const;
+
+
+
+
+
+
+
+  void setLoopAlreadyUnrolled();
+
+
+
+  bool hasDedicatedExits() const;
+
+
+
+
+
+  void getUniqueExitBlocks(SmallVectorImpl<BasicBlock *> &ExitBlocks) const;
+
+
+
+  BasicBlock *getUniqueExitBlock() const;
+
+  void dump() const;
+  void dumpVerbose() const;
+
+
+
+
+
+
+  DebugLoc getStartLoc() const;
+
+
+  LocRange getLocRange() const;
+
+  StringRef getName() const {
+    if (BasicBlock *Header = getHeader())
+      if (Header->hasName())
+        return Header->getName();
+    return "<unnamed loop>";
+  }
+
+private:
+  Loop() = default;
+
+  friend class LoopInfoBase<BasicBlock, Loop>;
+  friend class LoopBase<BasicBlock, Loop>;
+  explicit Loop(BasicBlock *BB) : LoopBase<BasicBlock, Loop>(BB) {}
+  ~Loop() = default;
+};
+
+
+
+
+
+
+template <class BlockT, class LoopT> class LoopInfoBase {
+
+  DenseMap<const BlockT *, LoopT *> BBMap;
+  std::vector<LoopT *> TopLevelLoops;
+  BumpPtrAllocator LoopAllocator;
+
+  friend class LoopBase<BlockT, LoopT>;
+  friend class LoopInfo;
+
+  void operator=(const LoopInfoBase &) = delete;
+  LoopInfoBase(const LoopInfoBase &) = delete;
+
+public:
+  LoopInfoBase() {}
+  ~LoopInfoBase() { releaseMemory(); }
+
+  LoopInfoBase(LoopInfoBase &&Arg)
+      : BBMap(std::move(Arg.BBMap)),
+        TopLevelLoops(std::move(Arg.TopLevelLoops)),
+        LoopAllocator(std::move(Arg.LoopAllocator)) {
+
+    Arg.TopLevelLoops.clear();
+  }
+  LoopInfoBase &operator=(LoopInfoBase &&RHS) {
+    BBMap = std::move(RHS.BBMap);
+
+    for (auto *L : TopLevelLoops)
+      L->~LoopT();
+
+    TopLevelLoops = std::move(RHS.TopLevelLoops);
+    LoopAllocator = std::move(RHS.LoopAllocator);
+    RHS.TopLevelLoops.clear();
+    return *this;
+  }
+
+  void releaseMemory() {
+    BBMap.clear();
+
+    for (auto *L : TopLevelLoops)
+      L->~LoopT();
+    TopLevelLoops.clear();
+    LoopAllocator.Reset();
+  }
+
+  template <typename... ArgsTy> LoopT *AllocateLoop(ArgsTy &&... Args) {
+    LoopT *Storage = LoopAllocator.Allocate<LoopT>();
+    return new (Storage) LoopT(std::forward<ArgsTy>(Args)...);
+  }
+
+
+
+
+  typedef typename std::vector<LoopT *>::const_iterator iterator;
+  typedef
+      typename std::vector<LoopT *>::const_reverse_iterator reverse_iterator;
+  iterator begin() const { return TopLevelLoops.begin(); }
+  iterator end() const { return TopLevelLoops.end(); }
+  reverse_iterator rbegin() const { return TopLevelLoops.rbegin(); }
+  reverse_iterator rend() const { return TopLevelLoops.rend(); }
+  bool empty() const { return TopLevelLoops.empty(); }
+
+
+
+
+
+
+  SmallVector<LoopT *, 4> getLoopsInPreorder();
+  SmallVector<LoopT *, 4> getLoopsInReverseSiblingPreorder();
+
+
+
+  LoopT *getLoopFor(const BlockT *BB) const { return BBMap.lookup(BB); }
+
+
+  const LoopT *operator[](const BlockT *BB) const { return getLoopFor(BB); }
+
+
+
+  unsigned getLoopDepth(const BlockT *BB) const {
+    const LoopT *L = getLoopFor(BB);
+    return L ? L->getLoopDepth() : 0;
+  }
+
+
+  bool isLoopHeader(const BlockT *BB) const {
+    const LoopT *L = getLoopFor(BB);
+    return L && L->getHeader() == BB;
+  }
+
+
+
+
+  LoopT *removeLoop(iterator I) {
+    
+   ((
+   I != end() && "Cannot remove end iterator!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "I != end() && \"Cannot remove end iterator!\""
+   , "/home/trippels/llvm/llvm/include/llvm/Analysis/LoopInfo.h", 700, __PRETTY_FUNCTION__))
+                                                      ;
+    LoopT *L = *I;
+    
+   ((
+   !L->getParentLoop() && "Not a top-level loop!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!L->getParentLoop() && \"Not a top-level loop!\""
+   , "/home/trippels/llvm/llvm/include/llvm/Analysis/LoopInfo.h", 702, __PRETTY_FUNCTION__))
+                                                         ;
+    TopLevelLoops.erase(TopLevelLoops.begin() + (I - begin()));
+    return L;
+  }
+
+
+
+
+  void changeLoopFor(BlockT *BB, LoopT *L) {
+    if (!L) {
+      BBMap.erase(BB);
+      return;
+    }
+    BBMap[BB] = L;
+  }
+
+
+
+  void changeTopLevelLoop(LoopT *OldLoop, LoopT *NewLoop) {
+    auto I = find(TopLevelLoops, OldLoop);
+    
+   ((
+   I != TopLevelLoops.end() && "Old loop not at top level!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "I != TopLevelLoops.end() && \"Old loop not at top level!\""
+   , "/home/trippels/llvm/llvm/include/llvm/Analysis/LoopInfo.h", 722, __PRETTY_FUNCTION__))
+                                                                   ;
+    *I = NewLoop;
+    
+   ((
+   !NewLoop->ParentLoop && !OldLoop->ParentLoop && "Loops already embedded into a subloop!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!NewLoop->ParentLoop && !OldLoop->ParentLoop && \"Loops already embedded into a subloop!\""
+   ,
+                                                   "/home/trippels/llvm/llvm/include/llvm/Analysis/LoopInfo.h"
+    ,
+                                                   725
+    , __PRETTY_FUNCTION__))
+                                                    
+                                                   ;
+  }
+
+
+  void addTopLevelLoop(LoopT *New) {
+    
+   ((
+   !New->getParentLoop() && "Loop already in subloop!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!New->getParentLoop() && \"Loop already in subloop!\""
+   , "/home/trippels/llvm/llvm/include/llvm/Analysis/LoopInfo.h", 730, __PRETTY_FUNCTION__))
+                                                              ;
+    TopLevelLoops.push_back(New);
+  }
+
+
+
+
+  void removeBlock(BlockT *BB) {
+    auto I = BBMap.find(BB);
+    if (I != BBMap.end()) {
+      for (LoopT *L = I->second; L; L = L->getParentLoop())
+        L->removeBlockFromLoop(BB);
+
+      BBMap.erase(I);
+    }
+  }
+
+
+
+  static bool isNotAlreadyContainedIn(const LoopT *SubLoop,
+                                      const LoopT *ParentLoop) {
+    if (!SubLoop)
+      return true;
+    if (SubLoop == ParentLoop)
+      return false;
+    return isNotAlreadyContainedIn(SubLoop->getParentLoop(), ParentLoop);
+  }
+
+
+  void analyze(const DominatorTreeBase<BlockT, false> &DomTree);
+
+
+  void print(raw_ostream &OS) const;
+
+  void verify(const DominatorTreeBase<BlockT, false> &DomTree) const;
+  void destroy(LoopT *L) {
+    L->~LoopT();
+
+
+
+    LoopAllocator.Deallocate(L);
+  }
+};
+
+
+extern template class LoopInfoBase<BasicBlock, Loop>;
+
+class LoopInfo : public LoopInfoBase<BasicBlock, Loop> {
+  typedef LoopInfoBase<BasicBlock, Loop> BaseT;
+
+  friend class LoopBase<BasicBlock, Loop>;
+
+  void operator=(const LoopInfo &) = delete;
+  LoopInfo(const LoopInfo &) = delete;
+
+public:
+  LoopInfo() {}
+  explicit LoopInfo(const DominatorTreeBase<BasicBlock, false> &DomTree);
+
+  LoopInfo(LoopInfo &&Arg) : BaseT(std::move(static_cast<BaseT &>(Arg))) {}
+  LoopInfo &operator=(LoopInfo &&RHS) {
+    BaseT::operator=(std::move(static_cast<BaseT &>(RHS)));
+    return *this;
+  }
+
+
+  bool invalidate(Function &F, const PreservedAnalyses &PA,
+                  FunctionAnalysisManager::Invalidator &);
+
+
+
+
+
+
+
+  void erase(Loop *L);
+
+
+
+  bool replacementPreservesLCSSAForm(Instruction *From, Value *To) {
+
+
+    Instruction *I = dyn_cast<Instruction>(To);
+    if (!I)
+      return true;
+
+
+    if (I->getParent() == From->getParent())
+      return true;
+
+
+    Loop *ToLoop = getLoopFor(I->getParent());
+    if (!ToLoop)
+      return true;
+
+
+
+    return ToLoop->contains(getLoopFor(From->getParent()));
+  }
+
+
+
+
+
+
+  bool movementPreservesLCSSAForm(Instruction *Inst, Instruction *NewLoc) {
+    
+   ((
+   Inst->getFunction() == NewLoc->getFunction() && "Can't reason about IPO!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Inst->getFunction() == NewLoc->getFunction() && \"Can't reason about IPO!\""
+   ,
+                                    "/home/trippels/llvm/llvm/include/llvm/Analysis/LoopInfo.h"
+    ,
+                                    848
+    , __PRETTY_FUNCTION__))
+                                     
+                                    ;
+
+    auto *OldBB = Inst->getParent();
+    auto *NewBB = NewLoc->getParent();
+
+
+
+    if (OldBB == NewBB)
+      return true;
+
+    auto *OldLoop = getLoopFor(OldBB);
+    auto *NewLoop = getLoopFor(NewBB);
+
+    if (OldLoop == NewLoop)
+      return true;
+
+
+
+    auto Contains = [](const Loop *Outer, const Loop *Inner) {
+      return !Outer || Outer->contains(Inner);
+    };
+    if (!Contains(NewLoop, OldLoop)) {
+      for (Use &U : Inst->uses()) {
+        auto *UI = cast<Instruction>(U.getUser());
+        auto *UBB = isa<PHINode>(UI) ? cast<PHINode>(UI)->getIncomingBlock(U)
+                                     : UI->getParent();
+        if (UBB != NewBB && getLoopFor(UBB) != NewLoop)
+          return false;
+      }
+    }
+
+
+
+
+    if (!Contains(OldLoop, NewLoop)) {
+
+      if (isa<PHINode>(Inst))
+        return false;
+
+      for (Use &U : Inst->operands()) {
+        auto *DefI = dyn_cast<Instruction>(U.get());
+        if (!DefI)
+          return false;
+
+
+
+
+        auto *DefBlock = DefI->getParent();
+        if (DefBlock != NewBB && getLoopFor(DefBlock) != NewLoop)
+          return false;
+      }
+    }
+
+    return true;
+  }
+};
+
+
+template <> struct GraphTraits<const Loop *> {
+  typedef const Loop *NodeRef;
+  typedef LoopInfo::iterator ChildIteratorType;
+
+  static NodeRef getEntryNode(const Loop *L) { return L; }
+  static ChildIteratorType child_begin(NodeRef N) { return N->begin(); }
+  static ChildIteratorType child_end(NodeRef N) { return N->end(); }
+};
+
+template <> struct GraphTraits<Loop *> {
+  typedef Loop *NodeRef;
+  typedef LoopInfo::iterator ChildIteratorType;
+
+  static NodeRef getEntryNode(Loop *L) { return L; }
+  static ChildIteratorType child_begin(NodeRef N) { return N->begin(); }
+  static ChildIteratorType child_end(NodeRef N) { return N->end(); }
+};
+
+
+class LoopAnalysis : public AnalysisInfoMixin<LoopAnalysis> {
+  friend AnalysisInfoMixin<LoopAnalysis>;
+  static AnalysisKey Key;
+
+public:
+  typedef LoopInfo Result;
+
+  LoopInfo run(Function &F, FunctionAnalysisManager &AM);
+};
+
+
+class LoopPrinterPass : public PassInfoMixin<LoopPrinterPass> {
+  raw_ostream &OS;
+
+public:
+  explicit LoopPrinterPass(raw_ostream &OS) : OS(OS) {}
+  PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
+};
+
+
+struct LoopVerifierPass : public PassInfoMixin<LoopVerifierPass> {
+  PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
+};
+
+
+class LoopInfoWrapperPass : public FunctionPass {
+  LoopInfo LI;
+
+public:
+  static char ID;
+
+  LoopInfoWrapperPass() : FunctionPass(ID) {
+    initializeLoopInfoWrapperPassPass(*PassRegistry::getPassRegistry());
+  }
+
+  LoopInfo &getLoopInfo() { return LI; }
+  const LoopInfo &getLoopInfo() const { return LI; }
+
+
+  bool runOnFunction(Function &F) override;
+
+  void verifyAnalysis() const override;
+
+  void releaseMemory() override { LI.releaseMemory(); }
+
+  void print(raw_ostream &O, const Module *M = nullptr) const override;
+
+  void getAnalysisUsage(AnalysisUsage &AU) const override;
+};
+
+
+void printLoop(Loop &L, raw_ostream &OS, const std::string &Banner = "");
+
+}
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+namespace llvm {
+
+class ArrayType;
+class IntegerType;
+class PointerType;
+class SequentialType;
+class StructType;
+class VectorType;
+template <class ConstantClass> struct ConstantAggrKeyType;
+
+
+
+
+
+
+class ConstantData : public Constant {
+  friend class Constant;
+
+  Value *handleOperandChangeImpl(Value *From, Value *To) {
+    ::llvm::llvm_unreachable_internal("Constant data does not have operands!", "/home/trippels/llvm/llvm/include/llvm/IR/Constants.h", 62);
+  }
+
+protected:
+  explicit ConstantData(Type *Ty, ValueTy VT) : Constant(Ty, VT, nullptr, 0) {}
+
+  void *operator new(size_t s) { return User::operator new(s, 0); }
+
+public:
+  ConstantData(const ConstantData &) = delete;
+
+
+  static bool classof(const Value *V) {
+    return V->getValueID() >= ConstantDataFirstVal &&
+           V->getValueID() <= ConstantDataLastVal;
+  }
+};
+
+
+
+
+
+class ConstantInt final : public ConstantData {
+  friend class Constant;
+
+  APInt Val;
+
+  ConstantInt(IntegerType *Ty, const APInt& V);
+
+  void destroyConstantImpl();
+
+public:
+  ConstantInt(const ConstantInt &) = delete;
+
+  static ConstantInt *getTrue(LLVMContext &Context);
+  static ConstantInt *getFalse(LLVMContext &Context);
+  static Constant *getTrue(Type *Ty);
+  static Constant *getFalse(Type *Ty);
+
+
+
+  static Constant *get(Type *Ty, uint64_t V, bool isSigned = false);
+
+
+
+
+
+
+
+  static ConstantInt *get(IntegerType *Ty, uint64_t V,
+                          bool isSigned = false);
+
+
+
+
+
+
+  static ConstantInt *getSigned(IntegerType *Ty, int64_t V);
+  static Constant *getSigned(Type *Ty, int64_t V);
+
+
+
+  static ConstantInt *get(LLVMContext &Context, const APInt &V);
+
+
+
+  static ConstantInt *get(IntegerType *Ty, StringRef Str,
+                          uint8_t radix);
+
+
+
+  static Constant *get(Type* Ty, const APInt& V);
+
+
+
+
+  inline const APInt &getValue() const {
+    return Val;
+  }
+
+
+  unsigned getBitWidth() const { return Val.getBitWidth(); }
+
+
+
+
+
+  inline uint64_t getZExtValue() const {
+    return Val.getZExtValue();
+  }
+
+
+
+
+
+  inline int64_t getSExtValue() const {
+    return Val.getSExtValue();
+  }
+
+
+
+
+
+  bool equalsInt(uint64_t V) const {
+    return Val == V;
+  }
+
+
+
+
+  inline IntegerType *getType() const {
+    return cast<IntegerType>(Value::getType());
+  }
+  static bool isValueValidForType(Type *Ty, uint64_t V);
+  static bool isValueValidForType(Type *Ty, int64_t V);
+
+  bool isNegative() const { return Val.isNegative(); }
+
+
+
+
+  bool isZero() const {
+    return Val.isNullValue();
+  }
+
+
+
+
+
+  bool isOne() const {
+    return Val.isOneValue();
+  }
+
+
+
+
+
+  bool isMinusOne() const {
+    return Val.isAllOnesValue();
+  }
+
+
+
+
+
+
+  bool isMaxValue(bool isSigned) const {
+    if (isSigned)
+      return Val.isMaxSignedValue();
+    else
+      return Val.isMaxValue();
+  }
+
+
+
+
+
+
+  bool isMinValue(bool isSigned) const {
+    if (isSigned)
+      return Val.isMinSignedValue();
+    else
+      return Val.isMinValue();
+  }
+
+
+
+
+
+
+  bool uge(uint64_t Num) const {
+    return Val.uge(Num);
+  }
+
+
+
+
+
+
+  uint64_t getLimitedValue(uint64_t Limit = ~0ULL) const {
+    return Val.getLimitedValue(Limit);
+  }
+
+
+  static bool classof(const Value *V) {
+    return V->getValueID() == ConstantIntVal;
+  }
+};
+
+
+
+
+class ConstantFP final : public ConstantData {
+  friend class Constant;
+
+  APFloat Val;
+
+  ConstantFP(Type *Ty, const APFloat& V);
+
+  void destroyConstantImpl();
+
+public:
+  ConstantFP(const ConstantFP &) = delete;
+
+
+
+
+  static Constant *getZeroValueForNegation(Type *Ty);
+
+
+
+
+
+  static Constant *get(Type* Ty, double V);
+  static Constant *get(Type* Ty, StringRef Str);
+  static ConstantFP *get(LLVMContext &Context, const APFloat &V);
+  static Constant *getNaN(Type *Ty, bool Negative = false, unsigned type = 0);
+  static Constant *getNegativeZero(Type *Ty);
+  static Constant *getInfinity(Type *Ty, bool Negative = false);
+
+
+  static bool isValueValidForType(Type *Ty, const APFloat &V);
+  inline const APFloat &getValueAPF() const { return Val; }
+
+
+  bool isZero() const { return Val.isZero(); }
+
+
+  bool isNegative() const { return Val.isNegative(); }
+
+
+  bool isInfinity() const { return Val.isInfinity(); }
+
+
+  bool isNaN() const { return Val.isNaN(); }
+
+
+
+
+
+
+
+  bool isExactlyValue(const APFloat &V) const;
+
+  bool isExactlyValue(double V) const {
+    bool ignored;
+    APFloat FV(V);
+    FV.convert(Val.getSemantics(), APFloat::rmNearestTiesToEven, &ignored);
+    return isExactlyValue(FV);
+  }
+
+
+  static bool classof(const Value *V) {
+    return V->getValueID() == ConstantFPVal;
+  }
+};
+
+
+
+
+class ConstantAggregateZero final : public ConstantData {
+  friend class Constant;
+
+  explicit ConstantAggregateZero(Type *Ty)
+      : ConstantData(Ty, ConstantAggregateZeroVal) {}
+
+  void destroyConstantImpl();
+
+public:
+  ConstantAggregateZero(const ConstantAggregateZero &) = delete;
+
+  static ConstantAggregateZero *get(Type *Ty);
+
+
+
+  Constant *getSequentialElement() const;
+
+
+
+  Constant *getStructElement(unsigned Elt) const;
+
+
+
+  Constant *getElementValue(Constant *C) const;
+
+
+  Constant *getElementValue(unsigned Idx) const;
+
+
+  unsigned getNumElements() const;
+
+
+
+  static bool classof(const Value *V) {
+    return V->getValueID() == ConstantAggregateZeroVal;
+  }
+};
+class ConstantAggregate : public Constant {
+protected:
+  ConstantAggregate(CompositeType *T, ValueTy VT, ArrayRef<Constant *> V);
+
+public:
+
+  public: inline Constant *getOperand(unsigned) const; inline void setOperand(unsigned, Constant*); inline op_iterator op_begin(); inline const_op_iterator op_begin() const; inline op_iterator op_end(); inline const_op_iterator op_end() const; protected: template <int> inline Use &Op(); template <int> inline const Use &Op() const; public: inline unsigned getNumOperands() const;
+
+
+  static bool classof(const Value *V) {
+    return V->getValueID() >= ConstantAggregateFirstVal &&
+           V->getValueID() <= ConstantAggregateLastVal;
+  }
+};
+
+template <>
+struct OperandTraits<ConstantAggregate>
+    : public VariadicOperandTraits<ConstantAggregate> {};
+
+ConstantAggregate::op_iterator ConstantAggregate::op_begin() { return OperandTraits<ConstantAggregate>::op_begin(this); } ConstantAggregate::const_op_iterator ConstantAggregate::op_begin() const { return OperandTraits<ConstantAggregate>::op_begin(const_cast<ConstantAggregate*>(this)); } ConstantAggregate::op_iterator ConstantAggregate::op_end() { return OperandTraits<ConstantAggregate>::op_end(this); } ConstantAggregate::const_op_iterator ConstantAggregate::op_end() const { return OperandTraits<ConstantAggregate>::op_end(const_cast<ConstantAggregate*>(this)); } Constant *ConstantAggregate::getOperand(unsigned i_nocapture) const { 
+((
+i_nocapture < OperandTraits<ConstantAggregate>::operands(this) && "getOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<ConstantAggregate>::operands(this) && \"getOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/Constants.h", 400, __PRETTY_FUNCTION__))
+; return cast_or_null<Constant>( OperandTraits<ConstantAggregate>::op_begin(const_cast<ConstantAggregate*>(this))[i_nocapture].get()); } void ConstantAggregate::setOperand(unsigned i_nocapture, Constant *Val_nocapture) { 
+((
+i_nocapture < OperandTraits<ConstantAggregate>::operands(this) && "setOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<ConstantAggregate>::operands(this) && \"setOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/Constants.h", 400, __PRETTY_FUNCTION__))
+; OperandTraits<ConstantAggregate>::op_begin(this)[i_nocapture] = Val_nocapture; } unsigned ConstantAggregate::getNumOperands() const { return OperandTraits<ConstantAggregate>::operands(this); } template <int Idx_nocapture> Use &ConstantAggregate::Op() { return this->OpFrom<Idx_nocapture>(this); } template <int Idx_nocapture> const Use &ConstantAggregate::Op() const { return this->OpFrom<Idx_nocapture>(this); }
+
+
+
+
+class ConstantArray final : public ConstantAggregate {
+  friend struct ConstantAggrKeyType<ConstantArray>;
+  friend class Constant;
+
+  ConstantArray(ArrayType *T, ArrayRef<Constant *> Val);
+
+  void destroyConstantImpl();
+  Value *handleOperandChangeImpl(Value *From, Value *To);
+
+public:
+
+  static Constant *get(ArrayType *T, ArrayRef<Constant*> V);
+
+private:
+  static Constant *getImpl(ArrayType *T, ArrayRef<Constant *> V);
+
+public:
+
+
+  inline ArrayType *getType() const {
+    return cast<ArrayType>(Value::getType());
+  }
+
+
+  static bool classof(const Value *V) {
+    return V->getValueID() == ConstantArrayVal;
+  }
+};
+
+
+
+
+class ConstantStruct final : public ConstantAggregate {
+  friend struct ConstantAggrKeyType<ConstantStruct>;
+  friend class Constant;
+
+  ConstantStruct(StructType *T, ArrayRef<Constant *> Val);
+
+  void destroyConstantImpl();
+  Value *handleOperandChangeImpl(Value *From, Value *To);
+
+public:
+
+  static Constant *get(StructType *T, ArrayRef<Constant*> V);
+
+  template <typename... Csts>
+  static typename std::enable_if<are_base_of<Constant, Csts...>::value,
+                                 Constant *>::type
+  get(StructType *T, Csts *... Vs) {
+    SmallVector<Constant *, 8> Values({Vs...});
+    return get(T, Values);
+  }
+
+
+
+  static Constant *getAnon(ArrayRef<Constant*> V, bool Packed = false) {
+    return get(getTypeForElements(V, Packed), V);
+  }
+  static Constant *getAnon(LLVMContext &Ctx,
+                           ArrayRef<Constant*> V, bool Packed = false) {
+    return get(getTypeForElements(Ctx, V, Packed), V);
+  }
+
+
+
+  static StructType *getTypeForElements(ArrayRef<Constant*> V,
+                                        bool Packed = false);
+
+  static StructType *getTypeForElements(LLVMContext &Ctx,
+                                        ArrayRef<Constant*> V,
+                                        bool Packed = false);
+
+
+  inline StructType *getType() const {
+    return cast<StructType>(Value::getType());
+  }
+
+
+  static bool classof(const Value *V) {
+    return V->getValueID() == ConstantStructVal;
+  }
+};
+
+
+
+
+class ConstantVector final : public ConstantAggregate {
+  friend struct ConstantAggrKeyType<ConstantVector>;
+  friend class Constant;
+
+  ConstantVector(VectorType *T, ArrayRef<Constant *> Val);
+
+  void destroyConstantImpl();
+  Value *handleOperandChangeImpl(Value *From, Value *To);
+
+public:
+
+  static Constant *get(ArrayRef<Constant*> V);
+
+private:
+  static Constant *getImpl(ArrayRef<Constant *> V);
+
+public:
+
+  static Constant *getSplat(unsigned NumElts, Constant *Elt);
+
+
+
+  inline VectorType *getType() const {
+    return cast<VectorType>(Value::getType());
+  }
+
+
+
+  Constant *getSplatValue() const;
+
+
+  static bool classof(const Value *V) {
+    return V->getValueID() == ConstantVectorVal;
+  }
+};
+
+
+
+
+class ConstantPointerNull final : public ConstantData {
+  friend class Constant;
+
+  explicit ConstantPointerNull(PointerType *T)
+      : ConstantData(T, Value::ConstantPointerNullVal) {}
+
+  void destroyConstantImpl();
+
+public:
+  ConstantPointerNull(const ConstantPointerNull &) = delete;
+
+
+  static ConstantPointerNull *get(PointerType *T);
+
+
+
+  inline PointerType *getType() const {
+    return cast<PointerType>(Value::getType());
+  }
+
+
+  static bool classof(const Value *V) {
+    return V->getValueID() == ConstantPointerNullVal;
+  }
+};
+class ConstantDataSequential : public ConstantData {
+  friend class LLVMContextImpl;
+  friend class Constant;
+
+
+
+  const char *DataElements;
+
+
+
+
+
+  ConstantDataSequential *Next;
+
+  void destroyConstantImpl();
+
+protected:
+  explicit ConstantDataSequential(Type *ty, ValueTy VT, const char *Data)
+      : ConstantData(ty, VT), DataElements(Data), Next(nullptr) {}
+  ~ConstantDataSequential() { delete Next; }
+
+  static Constant *getImpl(StringRef Bytes, Type *Ty);
+
+public:
+  ConstantDataSequential(const ConstantDataSequential &) = delete;
+
+
+
+
+
+  static bool isElementTypeCompatible(Type *Ty);
+
+
+
+  uint64_t getElementAsInteger(unsigned i) const;
+
+
+
+  APInt getElementAsAPInt(unsigned i) const;
+
+
+
+  APFloat getElementAsAPFloat(unsigned i) const;
+
+
+
+  float getElementAsFloat(unsigned i) const;
+
+
+
+  double getElementAsDouble(unsigned i) const;
+
+
+
+
+  Constant *getElementAsConstant(unsigned i) const;
+
+
+
+  inline SequentialType *getType() const {
+    return cast<SequentialType>(Value::getType());
+  }
+
+
+  Type *getElementType() const;
+
+
+  unsigned getNumElements() const;
+
+
+
+  uint64_t getElementByteSize() const;
+
+
+  bool isString(unsigned CharSize = 8) const;
+
+
+
+  bool isCString() const;
+
+
+
+  StringRef getAsString() const {
+    
+   ((
+   isString() && "Not a string"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isString() && \"Not a string\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Constants.h", 648, __PRETTY_FUNCTION__))
+                                       ;
+    return getRawDataValues();
+  }
+
+
+
+  StringRef getAsCString() const {
+    
+   ((
+   isCString() && "Isn't a C string"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isCString() && \"Isn't a C string\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/Constants.h", 655, __PRETTY_FUNCTION__))
+                                            ;
+    StringRef Str = getAsString();
+    return Str.substr(0, Str.size()-1);
+  }
+
+
+
+
+  StringRef getRawDataValues() const;
+
+
+  static bool classof(const Value *V) {
+    return V->getValueID() == ConstantDataArrayVal ||
+           V->getValueID() == ConstantDataVectorVal;
+  }
+
+private:
+  const char *getElementPointer(unsigned Elt) const;
+};
+
+
+
+
+
+
+
+class ConstantDataArray final : public ConstantDataSequential {
+  friend class ConstantDataSequential;
+
+  explicit ConstantDataArray(Type *ty, const char *Data)
+      : ConstantDataSequential(ty, ConstantDataArrayVal, Data) {}
+
+public:
+  ConstantDataArray(const ConstantDataArray &) = delete;
+
+
+
+
+  static Constant *get(LLVMContext &Context, ArrayRef<uint8_t> Elts);
+  static Constant *get(LLVMContext &Context, ArrayRef<uint16_t> Elts);
+  static Constant *get(LLVMContext &Context, ArrayRef<uint32_t> Elts);
+  static Constant *get(LLVMContext &Context, ArrayRef<uint64_t> Elts);
+  static Constant *get(LLVMContext &Context, ArrayRef<float> Elts);
+  static Constant *get(LLVMContext &Context, ArrayRef<double> Elts);
+
+
+
+
+
+
+  static Constant *getFP(LLVMContext &Context, ArrayRef<uint16_t> Elts);
+  static Constant *getFP(LLVMContext &Context, ArrayRef<uint32_t> Elts);
+  static Constant *getFP(LLVMContext &Context, ArrayRef<uint64_t> Elts);
+
+
+
+
+
+
+  static Constant *getString(LLVMContext &Context, StringRef Initializer,
+                             bool AddNull = true);
+
+
+
+  inline ArrayType *getType() const {
+    return cast<ArrayType>(Value::getType());
+  }
+
+
+  static bool classof(const Value *V) {
+    return V->getValueID() == ConstantDataArrayVal;
+  }
+};
+
+
+
+
+
+
+
+class ConstantDataVector final : public ConstantDataSequential {
+  friend class ConstantDataSequential;
+
+  explicit ConstantDataVector(Type *ty, const char *Data)
+      : ConstantDataSequential(ty, ConstantDataVectorVal, Data) {}
+
+public:
+  ConstantDataVector(const ConstantDataVector &) = delete;
+
+
+
+
+  static Constant *get(LLVMContext &Context, ArrayRef<uint8_t> Elts);
+  static Constant *get(LLVMContext &Context, ArrayRef<uint16_t> Elts);
+  static Constant *get(LLVMContext &Context, ArrayRef<uint32_t> Elts);
+  static Constant *get(LLVMContext &Context, ArrayRef<uint64_t> Elts);
+  static Constant *get(LLVMContext &Context, ArrayRef<float> Elts);
+  static Constant *get(LLVMContext &Context, ArrayRef<double> Elts);
+
+
+
+
+
+
+  static Constant *getFP(LLVMContext &Context, ArrayRef<uint16_t> Elts);
+  static Constant *getFP(LLVMContext &Context, ArrayRef<uint32_t> Elts);
+  static Constant *getFP(LLVMContext &Context, ArrayRef<uint64_t> Elts);
+
+
+
+
+  static Constant *getSplat(unsigned NumElts, Constant *Elt);
+
+
+
+  bool isSplat() const;
+
+
+
+  Constant *getSplatValue() const;
+
+
+
+  inline VectorType *getType() const {
+    return cast<VectorType>(Value::getType());
+  }
+
+
+  static bool classof(const Value *V) {
+    return V->getValueID() == ConstantDataVectorVal;
+  }
+};
+
+
+
+
+class ConstantTokenNone final : public ConstantData {
+  friend class Constant;
+
+  explicit ConstantTokenNone(LLVMContext &Context)
+      : ConstantData(Type::getTokenTy(Context), ConstantTokenNoneVal) {}
+
+  void destroyConstantImpl();
+
+public:
+  ConstantTokenNone(const ConstantTokenNone &) = delete;
+
+
+  static ConstantTokenNone *get(LLVMContext &Context);
+
+
+  static bool classof(const Value *V) {
+    return V->getValueID() == ConstantTokenNoneVal;
+  }
+};
+
+
+
+class BlockAddress final : public Constant {
+  friend class Constant;
+
+  BlockAddress(Function *F, BasicBlock *BB);
+
+  void *operator new(size_t s) { return User::operator new(s, 2); }
+
+  void destroyConstantImpl();
+  Value *handleOperandChangeImpl(Value *From, Value *To);
+
+public:
+
+  static BlockAddress *get(Function *F, BasicBlock *BB);
+
+
+
+  static BlockAddress *get(BasicBlock *BB);
+
+
+
+
+  static BlockAddress *lookup(const BasicBlock *BB);
+
+
+  public: inline Value *getOperand(unsigned) const; inline void setOperand(unsigned, Value*); inline op_iterator op_begin(); inline const_op_iterator op_begin() const; inline op_iterator op_end(); inline const_op_iterator op_end() const; protected: template <int> inline Use &Op(); template <int> inline const Use &Op() const; public: inline unsigned getNumOperands() const;
+
+  Function *getFunction() const { return (Function*)Op<0>().get(); }
+  BasicBlock *getBasicBlock() const { return (BasicBlock*)Op<1>().get(); }
+
+
+  static bool classof(const Value *V) {
+    return V->getValueID() == BlockAddressVal;
+  }
+};
+
+template <>
+struct OperandTraits<BlockAddress> :
+  public FixedNumOperandTraits<BlockAddress, 2> {
+};
+
+BlockAddress::op_iterator BlockAddress::op_begin() { return OperandTraits<BlockAddress>::op_begin(this); } BlockAddress::const_op_iterator BlockAddress::op_begin() const { return OperandTraits<BlockAddress>::op_begin(const_cast<BlockAddress*>(this)); } BlockAddress::op_iterator BlockAddress::op_end() { return OperandTraits<BlockAddress>::op_end(this); } BlockAddress::const_op_iterator BlockAddress::op_end() const { return OperandTraits<BlockAddress>::op_end(const_cast<BlockAddress*>(this)); } Value *BlockAddress::getOperand(unsigned i_nocapture) const { 
+((
+i_nocapture < OperandTraits<BlockAddress>::operands(this) && "getOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<BlockAddress>::operands(this) && \"getOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/Constants.h", 853, __PRETTY_FUNCTION__))
+; return cast_or_null<Value>( OperandTraits<BlockAddress>::op_begin(const_cast<BlockAddress*>(this))[i_nocapture].get()); } void BlockAddress::setOperand(unsigned i_nocapture, Value *Val_nocapture) { 
+((
+i_nocapture < OperandTraits<BlockAddress>::operands(this) && "setOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<BlockAddress>::operands(this) && \"setOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/Constants.h", 853, __PRETTY_FUNCTION__))
+; OperandTraits<BlockAddress>::op_begin(this)[i_nocapture] = Val_nocapture; } unsigned BlockAddress::getNumOperands() const { return OperandTraits<BlockAddress>::operands(this); } template <int Idx_nocapture> Use &BlockAddress::Op() { return this->OpFrom<Idx_nocapture>(this); } template <int Idx_nocapture> const Use &BlockAddress::Op() const { return this->OpFrom<Idx_nocapture>(this); }
+class ConstantExpr : public Constant {
+  friend struct ConstantExprKeyType;
+  friend class Constant;
+
+  void destroyConstantImpl();
+  Value *handleOperandChangeImpl(Value *From, Value *To);
+
+protected:
+  ConstantExpr(Type *ty, unsigned Opcode, Use *Ops, unsigned NumOps)
+      : Constant(ty, ConstantExprVal, Ops, NumOps) {
+
+    setValueSubclassData(Opcode);
+  }
+
+public:
+
+
+
+
+
+
+
+  static Constant *getAlignOf(Type *Ty);
+
+
+
+
+
+  static Constant *getSizeOf(Type *Ty);
+
+
+
+
+  static Constant *getOffsetOf(StructType *STy, unsigned FieldNo);
+
+
+
+
+  static Constant *getOffsetOf(Type *Ty, Constant *FieldNo);
+
+  static Constant *getNeg(Constant *C, bool HasNUW = false, bool HasNSW =false);
+  static Constant *getFNeg(Constant *C);
+  static Constant *getNot(Constant *C);
+  static Constant *getAdd(Constant *C1, Constant *C2,
+                          bool HasNUW = false, bool HasNSW = false);
+  static Constant *getFAdd(Constant *C1, Constant *C2);
+  static Constant *getSub(Constant *C1, Constant *C2,
+                          bool HasNUW = false, bool HasNSW = false);
+  static Constant *getFSub(Constant *C1, Constant *C2);
+  static Constant *getMul(Constant *C1, Constant *C2,
+                          bool HasNUW = false, bool HasNSW = false);
+  static Constant *getFMul(Constant *C1, Constant *C2);
+  static Constant *getUDiv(Constant *C1, Constant *C2, bool isExact = false);
+  static Constant *getSDiv(Constant *C1, Constant *C2, bool isExact = false);
+  static Constant *getFDiv(Constant *C1, Constant *C2);
+  static Constant *getURem(Constant *C1, Constant *C2);
+  static Constant *getSRem(Constant *C1, Constant *C2);
+  static Constant *getFRem(Constant *C1, Constant *C2);
+  static Constant *getAnd(Constant *C1, Constant *C2);
+  static Constant *getOr(Constant *C1, Constant *C2);
+  static Constant *getXor(Constant *C1, Constant *C2);
+  static Constant *getShl(Constant *C1, Constant *C2,
+                          bool HasNUW = false, bool HasNSW = false);
+  static Constant *getLShr(Constant *C1, Constant *C2, bool isExact = false);
+  static Constant *getAShr(Constant *C1, Constant *C2, bool isExact = false);
+  static Constant *getTrunc(Constant *C, Type *Ty, bool OnlyIfReduced = false);
+  static Constant *getSExt(Constant *C, Type *Ty, bool OnlyIfReduced = false);
+  static Constant *getZExt(Constant *C, Type *Ty, bool OnlyIfReduced = false);
+  static Constant *getFPTrunc(Constant *C, Type *Ty,
+                              bool OnlyIfReduced = false);
+  static Constant *getFPExtend(Constant *C, Type *Ty,
+                               bool OnlyIfReduced = false);
+  static Constant *getUIToFP(Constant *C, Type *Ty, bool OnlyIfReduced = false);
+  static Constant *getSIToFP(Constant *C, Type *Ty, bool OnlyIfReduced = false);
+  static Constant *getFPToUI(Constant *C, Type *Ty, bool OnlyIfReduced = false);
+  static Constant *getFPToSI(Constant *C, Type *Ty, bool OnlyIfReduced = false);
+  static Constant *getPtrToInt(Constant *C, Type *Ty,
+                               bool OnlyIfReduced = false);
+  static Constant *getIntToPtr(Constant *C, Type *Ty,
+                               bool OnlyIfReduced = false);
+  static Constant *getBitCast(Constant *C, Type *Ty,
+                              bool OnlyIfReduced = false);
+  static Constant *getAddrSpaceCast(Constant *C, Type *Ty,
+                                    bool OnlyIfReduced = false);
+
+  static Constant *getNSWNeg(Constant *C) { return getNeg(C, false, true); }
+  static Constant *getNUWNeg(Constant *C) { return getNeg(C, true, false); }
+
+  static Constant *getNSWAdd(Constant *C1, Constant *C2) {
+    return getAdd(C1, C2, false, true);
+  }
+
+  static Constant *getNUWAdd(Constant *C1, Constant *C2) {
+    return getAdd(C1, C2, true, false);
+  }
+
+  static Constant *getNSWSub(Constant *C1, Constant *C2) {
+    return getSub(C1, C2, false, true);
+  }
+
+  static Constant *getNUWSub(Constant *C1, Constant *C2) {
+    return getSub(C1, C2, true, false);
+  }
+
+  static Constant *getNSWMul(Constant *C1, Constant *C2) {
+    return getMul(C1, C2, false, true);
+  }
+
+  static Constant *getNUWMul(Constant *C1, Constant *C2) {
+    return getMul(C1, C2, true, false);
+  }
+
+  static Constant *getNSWShl(Constant *C1, Constant *C2) {
+    return getShl(C1, C2, false, true);
+  }
+
+  static Constant *getNUWShl(Constant *C1, Constant *C2) {
+    return getShl(C1, C2, true, false);
+  }
+
+  static Constant *getExactSDiv(Constant *C1, Constant *C2) {
+    return getSDiv(C1, C2, true);
+  }
+
+  static Constant *getExactUDiv(Constant *C1, Constant *C2) {
+    return getUDiv(C1, C2, true);
+  }
+
+  static Constant *getExactAShr(Constant *C1, Constant *C2) {
+    return getAShr(C1, C2, true);
+  }
+
+  static Constant *getExactLShr(Constant *C1, Constant *C2) {
+    return getLShr(C1, C2, true);
+  }
+
+
+
+
+  static Constant *getBinOpIdentity(unsigned Opcode, Type *Ty);
+
+
+
+
+
+  static Constant *getBinOpAbsorber(unsigned Opcode, Type *Ty);
+
+
+  public: inline Constant *getOperand(unsigned) const; inline void setOperand(unsigned, Constant*); inline op_iterator op_begin(); inline const_op_iterator op_begin() const; inline op_iterator op_end(); inline const_op_iterator op_end() const; protected: template <int> inline Use &Op(); template <int> inline const Use &Op() const; public: inline unsigned getNumOperands() const;
+
+
+
+
+
+
+
+  static Constant *getCast(unsigned ops, Constant *C, Type *Ty,
+                           bool OnlyIfReduced = false);
+
+
+  static Constant *getZExtOrBitCast(
+    Constant *C,
+    Type *Ty
+  );
+
+
+  static Constant *getSExtOrBitCast(
+    Constant *C,
+    Type *Ty
+  );
+
+
+  static Constant *getTruncOrBitCast(
+    Constant *C,
+    Type *Ty
+  );
+
+
+
+  static Constant *getPointerCast(
+    Constant *C,
+    Type *Ty
+  );
+
+
+
+  static Constant *getPointerBitCastOrAddrSpaceCast(
+    Constant *C,
+    Type *Ty
+  );
+
+
+  static Constant *getIntegerCast(
+    Constant *C,
+    Type *Ty,
+    bool isSigned
+  );
+
+
+  static Constant *getFPCast(
+    Constant *C,
+    Type *Ty
+  );
+
+
+  bool isCast() const;
+
+
+  bool isCompare() const;
+
+
+
+  bool hasIndices() const;
+
+
+
+
+
+
+  bool isGEPWithNoNotionalOverIndexing() const;
+
+
+
+
+  static Constant *getSelect(Constant *C, Constant *V1, Constant *V2,
+                             Type *OnlyIfReducedTy = nullptr);
+
+
+
+
+
+  static Constant *get(unsigned Opcode, Constant *C1, Constant *C2,
+                       unsigned Flags = 0, Type *OnlyIfReducedTy = nullptr);
+
+
+
+
+  static Constant *getCompare(unsigned short pred, Constant *C1, Constant *C2,
+                              bool OnlyIfReduced = false);
+
+
+
+
+  static Constant *getICmp(unsigned short pred, Constant *LHS, Constant *RHS,
+                           bool OnlyIfReduced = false);
+  static Constant *getFCmp(unsigned short pred, Constant *LHS, Constant *RHS,
+                           bool OnlyIfReduced = false);
+
+
+
+
+
+
+  static Constant *getGetElementPtr(Type *Ty, Constant *C,
+                                    ArrayRef<Constant *> IdxList,
+                                    bool InBounds = false,
+                                    Optional<unsigned> InRangeIndex = None,
+                                    Type *OnlyIfReducedTy = nullptr) {
+    return getGetElementPtr(
+        Ty, C, makeArrayRef((Value * const *)IdxList.data(), IdxList.size()),
+        InBounds, InRangeIndex, OnlyIfReducedTy);
+  }
+  static Constant *getGetElementPtr(Type *Ty, Constant *C, Constant *Idx,
+                                    bool InBounds = false,
+                                    Optional<unsigned> InRangeIndex = None,
+                                    Type *OnlyIfReducedTy = nullptr) {
+
+
+
+    return getGetElementPtr(Ty, C, cast<Value>(Idx), InBounds, InRangeIndex,
+                            OnlyIfReducedTy);
+  }
+  static Constant *getGetElementPtr(Type *Ty, Constant *C,
+                                    ArrayRef<Value *> IdxList,
+                                    bool InBounds = false,
+                                    Optional<unsigned> InRangeIndex = None,
+                                    Type *OnlyIfReducedTy = nullptr);
+
+
+
+  static Constant *getInBoundsGetElementPtr(Type *Ty, Constant *C,
+                                            ArrayRef<Constant *> IdxList) {
+    return getGetElementPtr(Ty, C, IdxList, true);
+  }
+  static Constant *getInBoundsGetElementPtr(Type *Ty, Constant *C,
+                                            Constant *Idx) {
+
+
+
+    return getGetElementPtr(Ty, C, Idx, true);
+  }
+  static Constant *getInBoundsGetElementPtr(Type *Ty, Constant *C,
+                                            ArrayRef<Value *> IdxList) {
+    return getGetElementPtr(Ty, C, IdxList, true);
+  }
+
+  static Constant *getExtractElement(Constant *Vec, Constant *Idx,
+                                     Type *OnlyIfReducedTy = nullptr);
+  static Constant *getInsertElement(Constant *Vec, Constant *Elt, Constant *Idx,
+                                    Type *OnlyIfReducedTy = nullptr);
+  static Constant *getShuffleVector(Constant *V1, Constant *V2, Constant *Mask,
+                                    Type *OnlyIfReducedTy = nullptr);
+  static Constant *getExtractValue(Constant *Agg, ArrayRef<unsigned> Idxs,
+                                   Type *OnlyIfReducedTy = nullptr);
+  static Constant *getInsertValue(Constant *Agg, Constant *Val,
+                                  ArrayRef<unsigned> Idxs,
+                                  Type *OnlyIfReducedTy = nullptr);
+
+
+  unsigned getOpcode() const { return getSubclassDataFromValue(); }
+
+
+
+  unsigned getPredicate() const;
+
+
+
+  ArrayRef<unsigned> getIndices() const;
+
+
+  const char *getOpcodeName() const;
+
+
+
+  Constant *getWithOperandReplaced(unsigned OpNo, Constant *Op) const;
+
+
+
+
+  Constant *getWithOperands(ArrayRef<Constant*> Ops) const {
+    return getWithOperands(Ops, getType());
+  }
+  Constant *getWithOperands(ArrayRef<Constant *> Ops, Type *Ty,
+                            bool OnlyIfReduced = false,
+                            Type *SrcTy = nullptr) const;
+  Instruction *getAsInstruction();
+
+
+  static bool classof(const Value *V) {
+    return V->getValueID() == ConstantExprVal;
+  }
+
+private:
+
+
+  void setValueSubclassData(unsigned short D) {
+    Value::setValueSubclassData(D);
+  }
+};
+
+template <>
+struct OperandTraits<ConstantExpr> :
+  public VariadicOperandTraits<ConstantExpr, 1> {
+};
+
+ConstantExpr::op_iterator ConstantExpr::op_begin() { return OperandTraits<ConstantExpr>::op_begin(this); } ConstantExpr::const_op_iterator ConstantExpr::op_begin() const { return OperandTraits<ConstantExpr>::op_begin(const_cast<ConstantExpr*>(this)); } ConstantExpr::op_iterator ConstantExpr::op_end() { return OperandTraits<ConstantExpr>::op_end(this); } ConstantExpr::const_op_iterator ConstantExpr::op_end() const { return OperandTraits<ConstantExpr>::op_end(const_cast<ConstantExpr*>(this)); } Constant *ConstantExpr::getOperand(unsigned i_nocapture) const { 
+((
+i_nocapture < OperandTraits<ConstantExpr>::operands(this) && "getOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<ConstantExpr>::operands(this) && \"getOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/Constants.h", 1235, __PRETTY_FUNCTION__))
+; return cast_or_null<Constant>( OperandTraits<ConstantExpr>::op_begin(const_cast<ConstantExpr*>(this))[i_nocapture].get()); } void ConstantExpr::setOperand(unsigned i_nocapture, Constant *Val_nocapture) { 
+((
+i_nocapture < OperandTraits<ConstantExpr>::operands(this) && "setOperand() out of range!"
+) ? static_cast<void> (0) : __assert_fail (
+"i_nocapture < OperandTraits<ConstantExpr>::operands(this) && \"setOperand() out of range!\""
+, "/home/trippels/llvm/llvm/include/llvm/IR/Constants.h", 1235, __PRETTY_FUNCTION__))
+; OperandTraits<ConstantExpr>::op_begin(this)[i_nocapture] = Val_nocapture; } unsigned ConstantExpr::getNumOperands() const { return OperandTraits<ConstantExpr>::operands(this); } template <int Idx_nocapture> Use &ConstantExpr::Op() { return this->OpFrom<Idx_nocapture>(this); } template <int Idx_nocapture> const Use &ConstantExpr::Op() const { return this->OpFrom<Idx_nocapture>(this); }
+class UndefValue final : public ConstantData {
+  friend class Constant;
+
+  explicit UndefValue(Type *T) : ConstantData(T, UndefValueVal) {}
+
+  void destroyConstantImpl();
+
+public:
+  UndefValue(const UndefValue &) = delete;
+
+
+  static UndefValue *get(Type *T);
+
+
+
+  UndefValue *getSequentialElement() const;
+
+
+
+  UndefValue *getStructElement(unsigned Elt) const;
+
+
+
+  UndefValue *getElementValue(Constant *C) const;
+
+
+  UndefValue *getElementValue(unsigned Idx) const;
+
+
+  unsigned getNumElements() const;
+
+
+  static bool classof(const Value *V) {
+    return V->getValueID() == UndefValueVal;
+  }
+};
+
+}
+
+
+
+
+
+
+namespace llvm {
+
+
+
+class Operator : public User {
+public:
+
+
+  Operator() = delete;
+  ~Operator() = delete;
+
+  void *operator new(size_t s) = delete;
+
+
+  unsigned getOpcode() const {
+    if (const Instruction *I = dyn_cast<Instruction>(this))
+      return I->getOpcode();
+    return cast<ConstantExpr>(this)->getOpcode();
+  }
+
+
+
+  static unsigned getOpcode(const Value *V) {
+    if (const Instruction *I = dyn_cast<Instruction>(V))
+      return I->getOpcode();
+    if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(V))
+      return CE->getOpcode();
+    return Instruction::UserOp1;
+  }
+
+  static bool classof(const Instruction *) { return true; }
+  static bool classof(const ConstantExpr *) { return true; }
+  static bool classof(const Value *V) {
+    return isa<Instruction>(V) || isa<ConstantExpr>(V);
+  }
+};
+
+
+
+
+class OverflowingBinaryOperator : public Operator {
+public:
+  enum {
+    NoUnsignedWrap = (1 << 0),
+    NoSignedWrap = (1 << 1)
+  };
+
+private:
+  friend class Instruction;
+  friend class ConstantExpr;
+
+  void setHasNoUnsignedWrap(bool B) {
+    SubclassOptionalData =
+      (SubclassOptionalData & ~NoUnsignedWrap) | (B * NoUnsignedWrap);
+  }
+  void setHasNoSignedWrap(bool B) {
+    SubclassOptionalData =
+      (SubclassOptionalData & ~NoSignedWrap) | (B * NoSignedWrap);
+  }
+
+public:
+
+
+  bool hasNoUnsignedWrap() const {
+    return SubclassOptionalData & NoUnsignedWrap;
+  }
+
+
+
+  bool hasNoSignedWrap() const {
+    return (SubclassOptionalData & NoSignedWrap) != 0;
+  }
+
+  static bool classof(const Instruction *I) {
+    return I->getOpcode() == Instruction::Add ||
+           I->getOpcode() == Instruction::Sub ||
+           I->getOpcode() == Instruction::Mul ||
+           I->getOpcode() == Instruction::Shl;
+  }
+  static bool classof(const ConstantExpr *CE) {
+    return CE->getOpcode() == Instruction::Add ||
+           CE->getOpcode() == Instruction::Sub ||
+           CE->getOpcode() == Instruction::Mul ||
+           CE->getOpcode() == Instruction::Shl;
+  }
+  static bool classof(const Value *V) {
+    return (isa<Instruction>(V) && classof(cast<Instruction>(V))) ||
+           (isa<ConstantExpr>(V) && classof(cast<ConstantExpr>(V)));
+  }
+};
+
+
+
+class PossiblyExactOperator : public Operator {
+public:
+  enum {
+    IsExact = (1 << 0)
+  };
+
+private:
+  friend class Instruction;
+  friend class ConstantExpr;
+
+  void setIsExact(bool B) {
+    SubclassOptionalData = (SubclassOptionalData & ~IsExact) | (B * IsExact);
+  }
+
+public:
+
+  bool isExact() const {
+    return SubclassOptionalData & IsExact;
+  }
+
+  static bool isPossiblyExactOpcode(unsigned OpC) {
+    return OpC == Instruction::SDiv ||
+           OpC == Instruction::UDiv ||
+           OpC == Instruction::AShr ||
+           OpC == Instruction::LShr;
+  }
+
+  static bool classof(const ConstantExpr *CE) {
+    return isPossiblyExactOpcode(CE->getOpcode());
+  }
+  static bool classof(const Instruction *I) {
+    return isPossiblyExactOpcode(I->getOpcode());
+  }
+  static bool classof(const Value *V) {
+    return (isa<Instruction>(V) && classof(cast<Instruction>(V))) ||
+           (isa<ConstantExpr>(V) && classof(cast<ConstantExpr>(V)));
+  }
+};
+
+
+class FastMathFlags {
+private:
+  friend class FPMathOperator;
+
+  unsigned Flags = 0;
+
+  FastMathFlags(unsigned F) {
+
+
+
+    if (F == 0x7F) Flags = ~0U;
+    else Flags = F;
+  }
+
+public:
+
+
+
+
+  enum {
+    AllowReassoc = (1 << 0),
+    NoNaNs = (1 << 1),
+    NoInfs = (1 << 2),
+    NoSignedZeros = (1 << 3),
+    AllowReciprocal = (1 << 4),
+    AllowContract = (1 << 5),
+    ApproxFunc = (1 << 6)
+  };
+
+  FastMathFlags() = default;
+
+  bool any() const { return Flags != 0; }
+  bool none() const { return Flags == 0; }
+  bool all() const { return Flags == ~0U; }
+
+  void clear() { Flags = 0; }
+  void set() { Flags = ~0U; }
+
+
+  bool allowReassoc() const { return 0 != (Flags & AllowReassoc); }
+  bool noNaNs() const { return 0 != (Flags & NoNaNs); }
+  bool noInfs() const { return 0 != (Flags & NoInfs); }
+  bool noSignedZeros() const { return 0 != (Flags & NoSignedZeros); }
+  bool allowReciprocal() const { return 0 != (Flags & AllowReciprocal); }
+  bool allowContract() const { return 0 != (Flags & AllowContract); }
+  bool approxFunc() const { return 0 != (Flags & ApproxFunc); }
+
+  bool isFast() const { return all(); }
+
+
+  void setAllowReassoc() { Flags |= AllowReassoc; }
+  void setNoNaNs() { Flags |= NoNaNs; }
+  void setNoInfs() { Flags |= NoInfs; }
+  void setNoSignedZeros() { Flags |= NoSignedZeros; }
+  void setAllowReciprocal() { Flags |= AllowReciprocal; }
+
+  void setAllowContract(bool B) {
+    Flags = (Flags & ~AllowContract) | B * AllowContract;
+  }
+  void setApproxFunc() { Flags |= ApproxFunc; }
+  void setFast() { set(); }
+
+  void operator&=(const FastMathFlags &OtherFlags) {
+    Flags &= OtherFlags.Flags;
+  }
+};
+
+
+
+class FPMathOperator : public Operator {
+private:
+  friend class Instruction;
+
+
+  void setFast(bool B) {
+    setHasAllowReassoc(B);
+    setHasNoNaNs(B);
+    setHasNoInfs(B);
+    setHasNoSignedZeros(B);
+    setHasAllowReciprocal(B);
+    setHasAllowContract(B);
+    setHasApproxFunc(B);
+  }
+
+  void setHasAllowReassoc(bool B) {
+    SubclassOptionalData =
+    (SubclassOptionalData & ~FastMathFlags::AllowReassoc) |
+    (B * FastMathFlags::AllowReassoc);
+  }
+
+  void setHasNoNaNs(bool B) {
+    SubclassOptionalData =
+      (SubclassOptionalData & ~FastMathFlags::NoNaNs) |
+      (B * FastMathFlags::NoNaNs);
+  }
+
+  void setHasNoInfs(bool B) {
+    SubclassOptionalData =
+      (SubclassOptionalData & ~FastMathFlags::NoInfs) |
+      (B * FastMathFlags::NoInfs);
+  }
+
+  void setHasNoSignedZeros(bool B) {
+    SubclassOptionalData =
+      (SubclassOptionalData & ~FastMathFlags::NoSignedZeros) |
+      (B * FastMathFlags::NoSignedZeros);
+  }
+
+  void setHasAllowReciprocal(bool B) {
+    SubclassOptionalData =
+      (SubclassOptionalData & ~FastMathFlags::AllowReciprocal) |
+      (B * FastMathFlags::AllowReciprocal);
+  }
+
+  void setHasAllowContract(bool B) {
+    SubclassOptionalData =
+        (SubclassOptionalData & ~FastMathFlags::AllowContract) |
+        (B * FastMathFlags::AllowContract);
+  }
+
+  void setHasApproxFunc(bool B) {
+    SubclassOptionalData =
+        (SubclassOptionalData & ~FastMathFlags::ApproxFunc) |
+        (B * FastMathFlags::ApproxFunc);
+  }
+
+
+
+  void setFastMathFlags(FastMathFlags FMF) {
+    SubclassOptionalData |= FMF.Flags;
+  }
+
+
+
+  void copyFastMathFlags(FastMathFlags FMF) {
+    SubclassOptionalData = FMF.Flags;
+  }
+
+public:
+
+  bool isFast() const {
+    return ((SubclassOptionalData & FastMathFlags::AllowReassoc) != 0 &&
+            (SubclassOptionalData & FastMathFlags::NoNaNs) != 0 &&
+            (SubclassOptionalData & FastMathFlags::NoInfs) != 0 &&
+            (SubclassOptionalData & FastMathFlags::NoSignedZeros) != 0 &&
+            (SubclassOptionalData & FastMathFlags::AllowReciprocal) != 0 &&
+            (SubclassOptionalData & FastMathFlags::AllowContract) != 0 &&
+            (SubclassOptionalData & FastMathFlags::ApproxFunc) != 0);
+  }
+
+
+  bool hasAllowReassoc() const {
+    return (SubclassOptionalData & FastMathFlags::AllowReassoc) != 0;
+  }
+
+
+  bool hasNoNaNs() const {
+    return (SubclassOptionalData & FastMathFlags::NoNaNs) != 0;
+  }
+
+
+  bool hasNoInfs() const {
+    return (SubclassOptionalData & FastMathFlags::NoInfs) != 0;
+  }
+
+
+  bool hasNoSignedZeros() const {
+    return (SubclassOptionalData & FastMathFlags::NoSignedZeros) != 0;
+  }
+
+
+  bool hasAllowReciprocal() const {
+    return (SubclassOptionalData & FastMathFlags::AllowReciprocal) != 0;
+  }
+
+
+  bool hasAllowContract() const {
+    return (SubclassOptionalData & FastMathFlags::AllowContract) != 0;
+  }
+
+
+
+  bool hasApproxFunc() const {
+    return (SubclassOptionalData & FastMathFlags::ApproxFunc) != 0;
+  }
+
+
+  FastMathFlags getFastMathFlags() const {
+    return FastMathFlags(SubclassOptionalData);
+  }
+
+
+
+
+  float getFPAccuracy() const;
+
+  static bool classof(const Instruction *I) {
+    return I->getType()->isFPOrFPVectorTy() ||
+      I->getOpcode() == Instruction::FCmp;
+  }
+
+  static bool classof(const ConstantExpr *CE) {
+    return CE->getType()->isFPOrFPVectorTy() ||
+           CE->getOpcode() == Instruction::FCmp;
+  }
+
+  static bool classof(const Value *V) {
+    return (isa<Instruction>(V) && classof(cast<Instruction>(V))) ||
+           (isa<ConstantExpr>(V) && classof(cast<ConstantExpr>(V)));
+  }
+};
+
+
+template<typename SuperClass, unsigned Opc>
+class ConcreteOperator : public SuperClass {
+public:
+  static bool classof(const Instruction *I) {
+    return I->getOpcode() == Opc;
+  }
+  static bool classof(const ConstantExpr *CE) {
+    return CE->getOpcode() == Opc;
+  }
+  static bool classof(const Value *V) {
+    return (isa<Instruction>(V) && classof(cast<Instruction>(V))) ||
+           (isa<ConstantExpr>(V) && classof(cast<ConstantExpr>(V)));
+  }
+};
+
+class AddOperator
+  : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Add> {
+};
+class SubOperator
+  : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Sub> {
+};
+class MulOperator
+  : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Mul> {
+};
+class ShlOperator
+  : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Shl> {
+};
+
+class SDivOperator
+  : public ConcreteOperator<PossiblyExactOperator, Instruction::SDiv> {
+};
+class UDivOperator
+  : public ConcreteOperator<PossiblyExactOperator, Instruction::UDiv> {
+};
+class AShrOperator
+  : public ConcreteOperator<PossiblyExactOperator, Instruction::AShr> {
+};
+class LShrOperator
+  : public ConcreteOperator<PossiblyExactOperator, Instruction::LShr> {
+};
+
+class ZExtOperator : public ConcreteOperator<Operator, Instruction::ZExt> {};
+
+class GEPOperator
+  : public ConcreteOperator<Operator, Instruction::GetElementPtr> {
+  friend class GetElementPtrInst;
+  friend class ConstantExpr;
+
+  enum {
+    IsInBounds = (1 << 0),
+
+  };
+
+  void setIsInBounds(bool B) {
+    SubclassOptionalData =
+      (SubclassOptionalData & ~IsInBounds) | (B * IsInBounds);
+  }
+
+public:
+
+  bool isInBounds() const {
+    return SubclassOptionalData & IsInBounds;
+  }
+
+
+
+  Optional<unsigned> getInRangeIndex() const {
+    if (SubclassOptionalData >> 1 == 0) return None;
+    return (SubclassOptionalData >> 1) - 1;
+  }
+
+  inline op_iterator idx_begin() { return op_begin()+1; }
+  inline const_op_iterator idx_begin() const { return op_begin()+1; }
+  inline op_iterator idx_end() { return op_end(); }
+  inline const_op_iterator idx_end() const { return op_end(); }
+
+  Value *getPointerOperand() {
+    return getOperand(0);
+  }
+  const Value *getPointerOperand() const {
+    return getOperand(0);
+  }
+  static unsigned getPointerOperandIndex() {
+    return 0U;
+  }
+
+
+  Type *getPointerOperandType() const {
+    return getPointerOperand()->getType();
+  }
+
+  Type *getSourceElementType() const;
+  Type *getResultElementType() const;
+
+
+  unsigned getPointerAddressSpace() const {
+    return getPointerOperandType()->getPointerAddressSpace();
+  }
+
+  unsigned getNumIndices() const {
+    return getNumOperands() - 1;
+  }
+
+  bool hasIndices() const {
+    return getNumOperands() > 1;
+  }
+
+
+
+
+  bool hasAllZeroIndices() const {
+    for (const_op_iterator I = idx_begin(), E = idx_end(); I != E; ++I) {
+      if (ConstantInt *C = dyn_cast<ConstantInt>(I))
+        if (C->isZero())
+          continue;
+      return false;
+    }
+    return true;
+  }
+
+
+
+
+  bool hasAllConstantIndices() const {
+    for (const_op_iterator I = idx_begin(), E = idx_end(); I != E; ++I) {
+      if (!isa<ConstantInt>(I))
+        return false;
+    }
+    return true;
+  }
+
+  unsigned countNonConstantIndices() const {
+    return count_if(make_range(idx_begin(), idx_end()), [](const Use& use) {
+        return !isa<ConstantInt>(*use);
+      });
+  }
+  bool accumulateConstantOffset(const DataLayout &DL, APInt &Offset) const;
+};
+
+class PtrToIntOperator
+    : public ConcreteOperator<Operator, Instruction::PtrToInt> {
+  friend class PtrToInt;
+  friend class ConstantExpr;
+
+public:
+  Value *getPointerOperand() {
+    return getOperand(0);
+  }
+  const Value *getPointerOperand() const {
+    return getOperand(0);
+  }
+
+  static unsigned getPointerOperandIndex() {
+    return 0U;
+  }
+
+
+  Type *getPointerOperandType() const {
+    return getPointerOperand()->getType();
+  }
+
+
+  unsigned getPointerAddressSpace() const {
+    return cast<PointerType>(getPointerOperandType())->getAddressSpace();
+  }
+};
+
+class BitCastOperator
+    : public ConcreteOperator<Operator, Instruction::BitCast> {
+  friend class BitCastInst;
+  friend class ConstantExpr;
+
+public:
+  Type *getSrcTy() const {
+    return getOperand(0)->getType();
+  }
+
+  Type *getDestTy() const {
+    return getType();
+  }
+};
+
+}
+
+
+
+
+
+
+namespace llvm {
+
+namespace Intrinsic {
+enum ID : unsigned;
+}
+
+class Function;
+class GlobalValue;
+class IntrinsicInst;
+class LoadInst;
+class Loop;
+class SCEV;
+class ScalarEvolution;
+class StoreInst;
+class SwitchInst;
+class Type;
+class User;
+class Value;
+
+
+struct MemIntrinsicInfo {
+
+
+
+
+  Value *PtrVal = nullptr;
+
+
+  AtomicOrdering Ordering = AtomicOrdering::NotAtomic;
+
+
+  unsigned short MatchingId = 0;
+
+  bool ReadMem = false;
+  bool WriteMem = false;
+  bool IsVolatile = false;
+
+  bool isUnordered() const {
+    return (Ordering == AtomicOrdering::NotAtomic ||
+            Ordering == AtomicOrdering::Unordered) && !IsVolatile;
+  }
+};
+
+
+
+class TargetTransformInfo {
+public:
+
+
+
+
+
+  template <typename T> TargetTransformInfo(T Impl);
+
+
+
+
+
+
+  explicit TargetTransformInfo(const DataLayout &DL);
+
+
+  TargetTransformInfo(TargetTransformInfo &&Arg);
+  TargetTransformInfo &operator=(TargetTransformInfo &&RHS);
+
+
+
+  ~TargetTransformInfo();
+
+
+
+
+
+
+  bool invalidate(Function &, const PreservedAnalyses &,
+                  FunctionAnalysisManager::Invalidator &) {
+
+
+    return false;
+  }
+  enum TargetCostKind {
+    TCK_RecipThroughput,
+    TCK_Latency,
+    TCK_CodeSize
+  };
+  int getInstructionCost(const Instruction *I, enum TargetCostKind kind) const {
+    switch (kind){
+    case TCK_RecipThroughput:
+      return getInstructionThroughput(I);
+
+    case TCK_Latency:
+      return getInstructionLatency(I);
+
+    case TCK_CodeSize:
+      return getUserCost(I);
+    }
+    ::llvm::llvm_unreachable_internal("Unknown instruction cost kind", "/home/trippels/llvm/llvm/include/llvm/Analysis/TargetTransformInfo.h", 145);
+  }
+  enum TargetCostConstants {
+    TCC_Free = 0,
+    TCC_Basic = 1,
+    TCC_Expensive = 4
+  };
+  int getOperationCost(unsigned Opcode, Type *Ty, Type *OpTy = nullptr) const;
+
+
+
+
+
+
+  int getGEPCost(Type *PointeeType, const Value *Ptr,
+                 ArrayRef<const Value *> Operands) const;
+
+
+
+
+
+
+  int getExtCost(const Instruction *I, const Value *Src) const;
+  int getCallCost(FunctionType *FTy, int NumArgs = -1) const;
+
+
+
+
+
+  int getCallCost(const Function *F, int NumArgs = -1) const;
+
+
+
+
+  int getCallCost(const Function *F, ArrayRef<const Value *> Arguments) const;
+
+
+
+
+
+
+
+  unsigned getInliningThresholdMultiplier() const;
+
+
+
+
+  int getIntrinsicCost(Intrinsic::ID IID, Type *RetTy,
+                       ArrayRef<Type *> ParamTys) const;
+
+
+
+
+  int getIntrinsicCost(Intrinsic::ID IID, Type *RetTy,
+                       ArrayRef<const Value *> Arguments) const;
+
+
+
+
+  unsigned getEstimatedNumberOfCaseClusters(const SwitchInst &SI,
+                                            unsigned &JTSize) const;
+  int getUserCost(const User *U, ArrayRef<const Value *> Operands) const;
+
+
+
+  int getUserCost(const User *U) const {
+    SmallVector<const Value *, 4> Operands(U->value_op_begin(),
+                                           U->value_op_end());
+    return getUserCost(U, Operands);
+  }
+
+
+
+
+
+
+  bool hasBranchDivergence() const;
+
+
+
+
+
+
+
+  bool isSourceOfDivergence(const Value *V) const;
+
+
+
+
+  bool isAlwaysUniform(const Value *V) const;
+  unsigned getFlatAddressSpace() const;
+  bool isLoweredToCall(const Function *F) const;
+
+  struct LSRCost {
+
+
+    unsigned Insns;
+    unsigned NumRegs;
+    unsigned AddRecCost;
+    unsigned NumIVMuls;
+    unsigned NumBaseAdds;
+    unsigned ImmCost;
+    unsigned SetupCost;
+    unsigned ScaleCost;
+  };
+
+
+  struct UnrollingPreferences {
+
+
+
+
+
+
+
+    unsigned Threshold;
+    unsigned MaxPercentThresholdBoost;
+
+
+    unsigned OptSizeThreshold;
+
+
+    unsigned PartialThreshold;
+
+
+
+    unsigned PartialOptSizeThreshold;
+
+
+
+
+    unsigned Count;
+
+
+
+
+    unsigned PeelCount;
+
+    unsigned DefaultUnrollRuntimeCount;
+
+
+
+
+    unsigned MaxCount;
+
+
+
+    unsigned FullUnrollMaxCount;
+
+
+
+
+    unsigned BEInsns;
+
+
+    bool Partial;
+
+
+
+    bool Runtime;
+
+    bool AllowRemainder;
+
+
+    bool AllowExpensiveTripCount;
+
+
+    bool Force;
+
+    bool UpperBound;
+
+    bool AllowPeeling;
+
+    bool UnrollRemainder;
+  };
+
+
+
+
+  void getUnrollingPreferences(Loop *L, ScalarEvolution &,
+                               UnrollingPreferences &UP) const;
+  enum PopcntSupportKind { PSK_Software, PSK_SlowHardware, PSK_FastHardware };
+
+
+
+
+  bool isLegalAddImmediate(int64_t Imm) const;
+
+
+
+
+
+  bool isLegalICmpImmediate(int64_t Imm) const;
+
+
+
+
+
+
+
+  bool isLegalAddressingMode(Type *Ty, GlobalValue *BaseGV, int64_t BaseOffset,
+                             bool HasBaseReg, int64_t Scale,
+                             unsigned AddrSpace = 0,
+                             Instruction *I = nullptr) const;
+
+
+  bool isLSRCostLess(TargetTransformInfo::LSRCost &C1,
+                     TargetTransformInfo::LSRCost &C2) const;
+
+
+
+  bool isLegalMaskedStore(Type *DataType) const;
+  bool isLegalMaskedLoad(Type *DataType) const;
+
+
+
+
+  bool isLegalMaskedScatter(Type *DataType) const;
+  bool isLegalMaskedGather(Type *DataType) const;
+
+
+
+
+
+
+  bool hasDivRemOp(Type *DataType, bool IsSigned) const;
+
+
+
+
+
+
+  bool hasVolatileVariant(Instruction *I, unsigned AddrSpace) const;
+
+
+  bool prefersVectorizedAddressing() const;
+
+
+
+
+
+
+
+  int getScalingFactorCost(Type *Ty, GlobalValue *BaseGV, int64_t BaseOffset,
+                           bool HasBaseReg, int64_t Scale,
+                           unsigned AddrSpace = 0) const;
+
+
+
+
+
+  bool LSRWithInstrQueries() const;
+
+
+
+
+  bool isTruncateFree(Type *Ty1, Type *Ty2) const;
+
+
+
+  bool isProfitableToHoist(Instruction *I) const;
+
+
+  bool isTypeLegal(Type *Ty) const;
+
+
+  unsigned getJumpBufAlignment() const;
+
+
+  unsigned getJumpBufSize() const;
+
+
+
+  bool shouldBuildLookupTables() const;
+
+
+
+  bool shouldBuildLookupTablesForConstant(Constant *C) const;
+
+  unsigned getScalarizationOverhead(Type *Ty, bool Insert, bool Extract) const;
+
+  unsigned getOperandsScalarizationOverhead(ArrayRef<const Value *> Args,
+                                            unsigned VF) const;
+
+
+
+
+  bool supportsEfficientVectorElementLoadStore() const;
+
+
+  bool enableAggressiveInterleaving(bool LoopHasReductions) const;
+
+
+
+  struct MemCmpExpansionOptions {
+
+    SmallVector<unsigned, 8> LoadSizes;
+  };
+  const MemCmpExpansionOptions *enableMemCmpExpansion(bool IsZeroCmp) const;
+
+
+  bool enableInterleavedAccessVectorization() const;
+  bool isFPVectorizationPotentiallyUnsafe() const;
+
+
+  bool allowsMisalignedMemoryAccesses(LLVMContext &Context,
+                                      unsigned BitWidth, unsigned AddressSpace = 0,
+                                      unsigned Alignment = 1,
+                                      bool *Fast = nullptr) const;
+
+
+  PopcntSupportKind getPopcntSupport(unsigned IntTyWidthInBit) const;
+
+
+  bool haveFastSqrt(Type *Ty) const;
+
+
+
+
+
+  bool isFCmpOrdCheaperThanFCmpZero(Type *Ty) const;
+
+
+
+  int getFPOpCost(Type *Ty) const;
+
+
+
+  int getIntImmCost(const APInt &Imm, Type *Ty) const;
+
+
+
+
+  int getIntImmCost(unsigned Opc, unsigned Idx, const APInt &Imm,
+                    Type *Ty) const;
+  int getIntImmCost(Intrinsic::ID IID, unsigned Idx, const APInt &Imm,
+                    Type *Ty) const;
+  int getIntImmCodeSizeCost(unsigned Opc, unsigned Idx, const APInt &Imm,
+                            Type *Ty) const;
+
+
+
+
+
+
+  enum ShuffleKind {
+    SK_Broadcast,
+    SK_Reverse,
+    SK_Alternate,
+    SK_InsertSubvector,
+    SK_ExtractSubvector,
+    SK_PermuteTwoSrc,
+
+    SK_PermuteSingleSrc
+
+  };
+
+
+  enum OperandValueKind {
+    OK_AnyValue,
+    OK_UniformValue,
+    OK_UniformConstantValue,
+    OK_NonUniformConstantValue
+  };
+
+
+  enum OperandValueProperties { OP_None = 0, OP_PowerOf2 = 1 };
+
+
+
+
+  unsigned getNumberOfRegisters(bool Vector) const;
+
+
+  unsigned getRegisterBitWidth(bool Vector) const;
+
+
+  unsigned getMinVectorRegisterBitWidth() const;
+
+
+
+
+  bool shouldConsiderAddressTypePromotion(
+      const Instruction &I, bool &AllowPromotionWithoutCommonHeader) const;
+
+
+  unsigned getCacheLineSize() const;
+
+
+  enum class CacheLevel {
+    L1D,
+    L2D,
+
+
+
+
+  };
+
+
+  llvm::Optional<unsigned> getCacheSize(CacheLevel Level) const;
+
+
+  llvm::Optional<unsigned> getCacheAssociativity(CacheLevel Level) const;
+
+
+
+  unsigned getPrefetchDistance() const;
+
+
+
+
+  unsigned getMinPrefetchStride() const;
+
+
+
+
+  unsigned getMaxPrefetchIterationsAhead() const;
+
+
+
+
+  unsigned getMaxInterleaveFactor(unsigned VF) const;
+
+
+
+
+
+  int getArithmeticInstrCost(
+      unsigned Opcode, Type *Ty, OperandValueKind Opd1Info = OK_AnyValue,
+      OperandValueKind Opd2Info = OK_AnyValue,
+      OperandValueProperties Opd1PropInfo = OP_None,
+      OperandValueProperties Opd2PropInfo = OP_None,
+      ArrayRef<const Value *> Args = ArrayRef<const Value *>()) const;
+
+
+
+
+  int getShuffleCost(ShuffleKind Kind, Type *Tp, int Index = 0,
+                     Type *SubTp = nullptr) const;
+
+
+
+
+  int getCastInstrCost(unsigned Opcode, Type *Dst, Type *Src,
+                       const Instruction *I = nullptr) const;
+
+
+
+  int getExtractWithExtendCost(unsigned Opcode, Type *Dst, VectorType *VecTy,
+                               unsigned Index = -1) const;
+
+
+
+  int getCFInstrCost(unsigned Opcode) const;
+
+
+
+
+  int getCmpSelInstrCost(unsigned Opcode, Type *ValTy,
+                 Type *CondTy = nullptr, const Instruction *I = nullptr) const;
+
+
+
+  int getVectorInstrCost(unsigned Opcode, Type *Val, unsigned Index = -1) const;
+
+
+  int getMemoryOpCost(unsigned Opcode, Type *Src, unsigned Alignment,
+                      unsigned AddressSpace, const Instruction *I = nullptr) const;
+
+
+  int getMaskedMemoryOpCost(unsigned Opcode, Type *Src, unsigned Alignment,
+                            unsigned AddressSpace) const;
+  int getGatherScatterOpCost(unsigned Opcode, Type *DataTy, Value *Ptr,
+                             bool VariableMask, unsigned Alignment) const;
+  int getInterleavedMemoryOpCost(unsigned Opcode, Type *VecTy, unsigned Factor,
+                                 ArrayRef<unsigned> Indices, unsigned Alignment,
+                                 unsigned AddressSpace) const;
+  int getArithmeticReductionCost(unsigned Opcode, Type *Ty,
+                                 bool IsPairwiseForm) const;
+  int getMinMaxReductionCost(Type *Ty, Type *CondTy, bool IsPairwiseForm,
+                             bool IsUnsigned) const;
+
+
+
+
+  int getIntrinsicInstrCost(Intrinsic::ID ID, Type *RetTy,
+                            ArrayRef<Value *> Args, FastMathFlags FMF,
+                            unsigned VF = 1) const;
+
+
+
+
+  int getIntrinsicInstrCost(Intrinsic::ID ID, Type *RetTy,
+                            ArrayRef<Type *> Tys, FastMathFlags FMF,
+                            unsigned ScalarizationCostPassed = 
+                                                              (0x7fffffff * 2U + 1U)
+                                                                      ) const;
+
+
+  int getCallInstrCost(Function *F, Type *RetTy, ArrayRef<Type *> Tys) const;
+
+
+
+  unsigned getNumberOfParts(Type *Tp) const;
+  int getAddressComputationCost(Type *Ty, ScalarEvolution *SE = nullptr,
+                                const SCEV *Ptr = nullptr) const;
+
+
+
+
+
+
+  unsigned getCostOfKeepingLiveOverCall(ArrayRef<Type *> Tys) const;
+
+
+
+
+
+  bool getTgtMemIntrinsic(IntrinsicInst *Inst, MemIntrinsicInfo &Info) const;
+
+
+
+  unsigned getAtomicMemIntrinsicMaxElementSize() const;
+
+
+
+
+
+  Value *getOrCreateResultFromMemIntrinsic(IntrinsicInst *Inst,
+                                           Type *ExpectedType) const;
+
+
+  Type *getMemcpyLoopLoweringType(LLVMContext &Context, Value *Length,
+                                  unsigned SrcAlign, unsigned DestAlign) const;
+
+
+
+
+
+
+
+  void getMemcpyLoopResidualLoweringType(SmallVectorImpl<Type *> &OpsOut,
+                                         LLVMContext &Context,
+                                         unsigned RemainingBytes,
+                                         unsigned SrcAlign,
+                                         unsigned DestAlign) const;
+
+
+
+  bool areInlineCompatible(const Function *Caller,
+                           const Function *Callee) const;
+
+
+
+  unsigned getLoadStoreVecRegBitWidth(unsigned AddrSpace) const;
+
+
+  bool isLegalToVectorizeLoad(LoadInst *LI) const;
+
+
+  bool isLegalToVectorizeStore(StoreInst *SI) const;
+
+
+  bool isLegalToVectorizeLoadChain(unsigned ChainSizeInBytes,
+                                   unsigned Alignment,
+                                   unsigned AddrSpace) const;
+
+
+  bool isLegalToVectorizeStoreChain(unsigned ChainSizeInBytes,
+                                    unsigned Alignment,
+                                    unsigned AddrSpace) const;
+
+
+
+  unsigned getLoadVectorFactor(unsigned VF, unsigned LoadSize,
+                               unsigned ChainSizeInBytes,
+                               VectorType *VecTy) const;
+
+
+
+  unsigned getStoreVectorFactor(unsigned VF, unsigned StoreSize,
+                                unsigned ChainSizeInBytes,
+                                VectorType *VecTy) const;
+
+
+  struct ReductionFlags {
+    ReductionFlags() : IsMaxOp(false), IsSigned(false), NoNaN(false) {}
+    bool IsMaxOp;
+    bool IsSigned;
+    bool NoNaN;
+  };
+
+
+
+  bool useReductionIntrinsic(unsigned Opcode, Type *Ty,
+                             ReductionFlags Flags) const;
+
+
+
+  bool shouldExpandReduction(const IntrinsicInst *II) const;
+
+
+private:
+
+
+  int getInstructionLatency(const Instruction *I) const;
+
+
+
+  int getInstructionThroughput(const Instruction *I) const;
+
+
+
+  class Concept;
+
+
+
+  template <typename T> class Model;
+
+  std::unique_ptr<Concept> TTIImpl;
+};
+
+class TargetTransformInfo::Concept {
+public:
+  virtual ~Concept() = 0;
+  virtual const DataLayout &getDataLayout() const = 0;
+  virtual int getOperationCost(unsigned Opcode, Type *Ty, Type *OpTy) = 0;
+  virtual int getGEPCost(Type *PointeeType, const Value *Ptr,
+                         ArrayRef<const Value *> Operands) = 0;
+  virtual int getExtCost(const Instruction *I, const Value *Src) = 0;
+  virtual int getCallCost(FunctionType *FTy, int NumArgs) = 0;
+  virtual int getCallCost(const Function *F, int NumArgs) = 0;
+  virtual int getCallCost(const Function *F,
+                          ArrayRef<const Value *> Arguments) = 0;
+  virtual unsigned getInliningThresholdMultiplier() = 0;
+  virtual int getIntrinsicCost(Intrinsic::ID IID, Type *RetTy,
+                               ArrayRef<Type *> ParamTys) = 0;
+  virtual int getIntrinsicCost(Intrinsic::ID IID, Type *RetTy,
+                               ArrayRef<const Value *> Arguments) = 0;
+  virtual unsigned getEstimatedNumberOfCaseClusters(const SwitchInst &SI,
+                                                    unsigned &JTSize) = 0;
+  virtual int
+  getUserCost(const User *U, ArrayRef<const Value *> Operands) = 0;
+  virtual bool hasBranchDivergence() = 0;
+  virtual bool isSourceOfDivergence(const Value *V) = 0;
+  virtual bool isAlwaysUniform(const Value *V) = 0;
+  virtual unsigned getFlatAddressSpace() = 0;
+  virtual bool isLoweredToCall(const Function *F) = 0;
+  virtual void getUnrollingPreferences(Loop *L, ScalarEvolution &,
+                                       UnrollingPreferences &UP) = 0;
+  virtual bool isLegalAddImmediate(int64_t Imm) = 0;
+  virtual bool isLegalICmpImmediate(int64_t Imm) = 0;
+  virtual bool isLegalAddressingMode(Type *Ty, GlobalValue *BaseGV,
+                                     int64_t BaseOffset, bool HasBaseReg,
+                                     int64_t Scale,
+                                     unsigned AddrSpace,
+                                     Instruction *I) = 0;
+  virtual bool isLSRCostLess(TargetTransformInfo::LSRCost &C1,
+                             TargetTransformInfo::LSRCost &C2) = 0;
+  virtual bool isLegalMaskedStore(Type *DataType) = 0;
+  virtual bool isLegalMaskedLoad(Type *DataType) = 0;
+  virtual bool isLegalMaskedScatter(Type *DataType) = 0;
+  virtual bool isLegalMaskedGather(Type *DataType) = 0;
+  virtual bool hasDivRemOp(Type *DataType, bool IsSigned) = 0;
+  virtual bool hasVolatileVariant(Instruction *I, unsigned AddrSpace) = 0;
+  virtual bool prefersVectorizedAddressing() = 0;
+  virtual int getScalingFactorCost(Type *Ty, GlobalValue *BaseGV,
+                                   int64_t BaseOffset, bool HasBaseReg,
+                                   int64_t Scale, unsigned AddrSpace) = 0;
+  virtual bool LSRWithInstrQueries() = 0;
+  virtual bool isTruncateFree(Type *Ty1, Type *Ty2) = 0;
+  virtual bool isProfitableToHoist(Instruction *I) = 0;
+  virtual bool isTypeLegal(Type *Ty) = 0;
+  virtual unsigned getJumpBufAlignment() = 0;
+  virtual unsigned getJumpBufSize() = 0;
+  virtual bool shouldBuildLookupTables() = 0;
+  virtual bool shouldBuildLookupTablesForConstant(Constant *C) = 0;
+  virtual unsigned
+  getScalarizationOverhead(Type *Ty, bool Insert, bool Extract) = 0;
+  virtual unsigned getOperandsScalarizationOverhead(ArrayRef<const Value *> Args,
+                                                    unsigned VF) = 0;
+  virtual bool supportsEfficientVectorElementLoadStore() = 0;
+  virtual bool enableAggressiveInterleaving(bool LoopHasReductions) = 0;
+  virtual const MemCmpExpansionOptions *enableMemCmpExpansion(
+      bool IsZeroCmp) const = 0;
+  virtual bool enableInterleavedAccessVectorization() = 0;
+  virtual bool isFPVectorizationPotentiallyUnsafe() = 0;
+  virtual bool allowsMisalignedMemoryAccesses(LLVMContext &Context,
+                                              unsigned BitWidth,
+                                              unsigned AddressSpace,
+                                              unsigned Alignment,
+                                              bool *Fast) = 0;
+  virtual PopcntSupportKind getPopcntSupport(unsigned IntTyWidthInBit) = 0;
+  virtual bool haveFastSqrt(Type *Ty) = 0;
+  virtual bool isFCmpOrdCheaperThanFCmpZero(Type *Ty) = 0;
+  virtual int getFPOpCost(Type *Ty) = 0;
+  virtual int getIntImmCodeSizeCost(unsigned Opc, unsigned Idx, const APInt &Imm,
+                                    Type *Ty) = 0;
+  virtual int getIntImmCost(const APInt &Imm, Type *Ty) = 0;
+  virtual int getIntImmCost(unsigned Opc, unsigned Idx, const APInt &Imm,
+                            Type *Ty) = 0;
+  virtual int getIntImmCost(Intrinsic::ID IID, unsigned Idx, const APInt &Imm,
+                            Type *Ty) = 0;
+  virtual unsigned getNumberOfRegisters(bool Vector) = 0;
+  virtual unsigned getRegisterBitWidth(bool Vector) const = 0;
+  virtual unsigned getMinVectorRegisterBitWidth() = 0;
+  virtual bool shouldConsiderAddressTypePromotion(
+      const Instruction &I, bool &AllowPromotionWithoutCommonHeader) = 0;
+  virtual unsigned getCacheLineSize() = 0;
+  virtual llvm::Optional<unsigned> getCacheSize(CacheLevel Level) = 0;
+  virtual llvm::Optional<unsigned> getCacheAssociativity(CacheLevel Level) = 0;
+  virtual unsigned getPrefetchDistance() = 0;
+  virtual unsigned getMinPrefetchStride() = 0;
+  virtual unsigned getMaxPrefetchIterationsAhead() = 0;
+  virtual unsigned getMaxInterleaveFactor(unsigned VF) = 0;
+  virtual unsigned
+  getArithmeticInstrCost(unsigned Opcode, Type *Ty, OperandValueKind Opd1Info,
+                         OperandValueKind Opd2Info,
+                         OperandValueProperties Opd1PropInfo,
+                         OperandValueProperties Opd2PropInfo,
+                         ArrayRef<const Value *> Args) = 0;
+  virtual int getShuffleCost(ShuffleKind Kind, Type *Tp, int Index,
+                             Type *SubTp) = 0;
+  virtual int getCastInstrCost(unsigned Opcode, Type *Dst, Type *Src,
+                               const Instruction *I) = 0;
+  virtual int getExtractWithExtendCost(unsigned Opcode, Type *Dst,
+                                       VectorType *VecTy, unsigned Index) = 0;
+  virtual int getCFInstrCost(unsigned Opcode) = 0;
+  virtual int getCmpSelInstrCost(unsigned Opcode, Type *ValTy,
+                                Type *CondTy, const Instruction *I) = 0;
+  virtual int getVectorInstrCost(unsigned Opcode, Type *Val,
+                                 unsigned Index) = 0;
+  virtual int getMemoryOpCost(unsigned Opcode, Type *Src, unsigned Alignment,
+                              unsigned AddressSpace, const Instruction *I) = 0;
+  virtual int getMaskedMemoryOpCost(unsigned Opcode, Type *Src,
+                                    unsigned Alignment,
+                                    unsigned AddressSpace) = 0;
+  virtual int getGatherScatterOpCost(unsigned Opcode, Type *DataTy,
+                                     Value *Ptr, bool VariableMask,
+                                     unsigned Alignment) = 0;
+  virtual int getInterleavedMemoryOpCost(unsigned Opcode, Type *VecTy,
+                                         unsigned Factor,
+                                         ArrayRef<unsigned> Indices,
+                                         unsigned Alignment,
+                                         unsigned AddressSpace) = 0;
+  virtual int getArithmeticReductionCost(unsigned Opcode, Type *Ty,
+                                         bool IsPairwiseForm) = 0;
+  virtual int getMinMaxReductionCost(Type *Ty, Type *CondTy,
+                                     bool IsPairwiseForm, bool IsUnsigned) = 0;
+  virtual int getIntrinsicInstrCost(Intrinsic::ID ID, Type *RetTy,
+                      ArrayRef<Type *> Tys, FastMathFlags FMF,
+                      unsigned ScalarizationCostPassed) = 0;
+  virtual int getIntrinsicInstrCost(Intrinsic::ID ID, Type *RetTy,
+         ArrayRef<Value *> Args, FastMathFlags FMF, unsigned VF) = 0;
+  virtual int getCallInstrCost(Function *F, Type *RetTy,
+                               ArrayRef<Type *> Tys) = 0;
+  virtual unsigned getNumberOfParts(Type *Tp) = 0;
+  virtual int getAddressComputationCost(Type *Ty, ScalarEvolution *SE,
+                                        const SCEV *Ptr) = 0;
+  virtual unsigned getCostOfKeepingLiveOverCall(ArrayRef<Type *> Tys) = 0;
+  virtual bool getTgtMemIntrinsic(IntrinsicInst *Inst,
+                                  MemIntrinsicInfo &Info) = 0;
+  virtual unsigned getAtomicMemIntrinsicMaxElementSize() const = 0;
+  virtual Value *getOrCreateResultFromMemIntrinsic(IntrinsicInst *Inst,
+                                                   Type *ExpectedType) = 0;
+  virtual Type *getMemcpyLoopLoweringType(LLVMContext &Context, Value *Length,
+                                          unsigned SrcAlign,
+                                          unsigned DestAlign) const = 0;
+  virtual void getMemcpyLoopResidualLoweringType(
+      SmallVectorImpl<Type *> &OpsOut, LLVMContext &Context,
+      unsigned RemainingBytes, unsigned SrcAlign, unsigned DestAlign) const = 0;
+  virtual bool areInlineCompatible(const Function *Caller,
+                                   const Function *Callee) const = 0;
+  virtual unsigned getLoadStoreVecRegBitWidth(unsigned AddrSpace) const = 0;
+  virtual bool isLegalToVectorizeLoad(LoadInst *LI) const = 0;
+  virtual bool isLegalToVectorizeStore(StoreInst *SI) const = 0;
+  virtual bool isLegalToVectorizeLoadChain(unsigned ChainSizeInBytes,
+                                           unsigned Alignment,
+                                           unsigned AddrSpace) const = 0;
+  virtual bool isLegalToVectorizeStoreChain(unsigned ChainSizeInBytes,
+                                            unsigned Alignment,
+                                            unsigned AddrSpace) const = 0;
+  virtual unsigned getLoadVectorFactor(unsigned VF, unsigned LoadSize,
+                                       unsigned ChainSizeInBytes,
+                                       VectorType *VecTy) const = 0;
+  virtual unsigned getStoreVectorFactor(unsigned VF, unsigned StoreSize,
+                                        unsigned ChainSizeInBytes,
+                                        VectorType *VecTy) const = 0;
+  virtual bool useReductionIntrinsic(unsigned Opcode, Type *Ty,
+                                     ReductionFlags) const = 0;
+  virtual bool shouldExpandReduction(const IntrinsicInst *II) const = 0;
+  virtual int getInstructionLatency(const Instruction *I) = 0;
+};
+
+template <typename T>
+class TargetTransformInfo::Model final : public TargetTransformInfo::Concept {
+  T Impl;
+
+public:
+  Model(T Impl) : Impl(std::move(Impl)) {}
+  ~Model() override {}
+
+  const DataLayout &getDataLayout() const override {
+    return Impl.getDataLayout();
+  }
+
+  int getOperationCost(unsigned Opcode, Type *Ty, Type *OpTy) override {
+    return Impl.getOperationCost(Opcode, Ty, OpTy);
+  }
+  int getGEPCost(Type *PointeeType, const Value *Ptr,
+                 ArrayRef<const Value *> Operands) override {
+    return Impl.getGEPCost(PointeeType, Ptr, Operands);
+  }
+  int getExtCost(const Instruction *I, const Value *Src) override {
+    return Impl.getExtCost(I, Src);
+  }
+  int getCallCost(FunctionType *FTy, int NumArgs) override {
+    return Impl.getCallCost(FTy, NumArgs);
+  }
+  int getCallCost(const Function *F, int NumArgs) override {
+    return Impl.getCallCost(F, NumArgs);
+  }
+  int getCallCost(const Function *F,
+                  ArrayRef<const Value *> Arguments) override {
+    return Impl.getCallCost(F, Arguments);
+  }
+  unsigned getInliningThresholdMultiplier() override {
+    return Impl.getInliningThresholdMultiplier();
+  }
+  int getIntrinsicCost(Intrinsic::ID IID, Type *RetTy,
+                       ArrayRef<Type *> ParamTys) override {
+    return Impl.getIntrinsicCost(IID, RetTy, ParamTys);
+  }
+  int getIntrinsicCost(Intrinsic::ID IID, Type *RetTy,
+                       ArrayRef<const Value *> Arguments) override {
+    return Impl.getIntrinsicCost(IID, RetTy, Arguments);
+  }
+  int getUserCost(const User *U, ArrayRef<const Value *> Operands) override {
+    return Impl.getUserCost(U, Operands);
+  }
+  bool hasBranchDivergence() override { return Impl.hasBranchDivergence(); }
+  bool isSourceOfDivergence(const Value *V) override {
+    return Impl.isSourceOfDivergence(V);
+  }
+
+  bool isAlwaysUniform(const Value *V) override {
+    return Impl.isAlwaysUniform(V);
+  }
+
+  unsigned getFlatAddressSpace() override {
+    return Impl.getFlatAddressSpace();
+  }
+
+  bool isLoweredToCall(const Function *F) override {
+    return Impl.isLoweredToCall(F);
+  }
+  void getUnrollingPreferences(Loop *L, ScalarEvolution &SE,
+                               UnrollingPreferences &UP) override {
+    return Impl.getUnrollingPreferences(L, SE, UP);
+  }
+  bool isLegalAddImmediate(int64_t Imm) override {
+    return Impl.isLegalAddImmediate(Imm);
+  }
+  bool isLegalICmpImmediate(int64_t Imm) override {
+    return Impl.isLegalICmpImmediate(Imm);
+  }
+  bool isLegalAddressingMode(Type *Ty, GlobalValue *BaseGV, int64_t BaseOffset,
+                             bool HasBaseReg, int64_t Scale,
+                             unsigned AddrSpace,
+                             Instruction *I) override {
+    return Impl.isLegalAddressingMode(Ty, BaseGV, BaseOffset, HasBaseReg,
+                                      Scale, AddrSpace, I);
+  }
+  bool isLSRCostLess(TargetTransformInfo::LSRCost &C1,
+                     TargetTransformInfo::LSRCost &C2) override {
+    return Impl.isLSRCostLess(C1, C2);
+  }
+  bool isLegalMaskedStore(Type *DataType) override {
+    return Impl.isLegalMaskedStore(DataType);
+  }
+  bool isLegalMaskedLoad(Type *DataType) override {
+    return Impl.isLegalMaskedLoad(DataType);
+  }
+  bool isLegalMaskedScatter(Type *DataType) override {
+    return Impl.isLegalMaskedScatter(DataType);
+  }
+  bool isLegalMaskedGather(Type *DataType) override {
+    return Impl.isLegalMaskedGather(DataType);
+  }
+  bool hasDivRemOp(Type *DataType, bool IsSigned) override {
+    return Impl.hasDivRemOp(DataType, IsSigned);
+  }
+  bool hasVolatileVariant(Instruction *I, unsigned AddrSpace) override {
+    return Impl.hasVolatileVariant(I, AddrSpace);
+  }
+  bool prefersVectorizedAddressing() override {
+    return Impl.prefersVectorizedAddressing();
+  }
+  int getScalingFactorCost(Type *Ty, GlobalValue *BaseGV, int64_t BaseOffset,
+                           bool HasBaseReg, int64_t Scale,
+                           unsigned AddrSpace) override {
+    return Impl.getScalingFactorCost(Ty, BaseGV, BaseOffset, HasBaseReg,
+                                     Scale, AddrSpace);
+  }
+  bool LSRWithInstrQueries() override {
+    return Impl.LSRWithInstrQueries();
+  }
+  bool isTruncateFree(Type *Ty1, Type *Ty2) override {
+    return Impl.isTruncateFree(Ty1, Ty2);
+  }
+  bool isProfitableToHoist(Instruction *I) override {
+    return Impl.isProfitableToHoist(I);
+  }
+  bool isTypeLegal(Type *Ty) override { return Impl.isTypeLegal(Ty); }
+  unsigned getJumpBufAlignment() override { return Impl.getJumpBufAlignment(); }
+  unsigned getJumpBufSize() override { return Impl.getJumpBufSize(); }
+  bool shouldBuildLookupTables() override {
+    return Impl.shouldBuildLookupTables();
+  }
+  bool shouldBuildLookupTablesForConstant(Constant *C) override {
+    return Impl.shouldBuildLookupTablesForConstant(C);
+  }
+  unsigned getScalarizationOverhead(Type *Ty, bool Insert,
+                                    bool Extract) override {
+    return Impl.getScalarizationOverhead(Ty, Insert, Extract);
+  }
+  unsigned getOperandsScalarizationOverhead(ArrayRef<const Value *> Args,
+                                            unsigned VF) override {
+    return Impl.getOperandsScalarizationOverhead(Args, VF);
+  }
+
+  bool supportsEfficientVectorElementLoadStore() override {
+    return Impl.supportsEfficientVectorElementLoadStore();
+  }
+
+  bool enableAggressiveInterleaving(bool LoopHasReductions) override {
+    return Impl.enableAggressiveInterleaving(LoopHasReductions);
+  }
+  const MemCmpExpansionOptions *enableMemCmpExpansion(
+      bool IsZeroCmp) const override {
+    return Impl.enableMemCmpExpansion(IsZeroCmp);
+  }
+  bool enableInterleavedAccessVectorization() override {
+    return Impl.enableInterleavedAccessVectorization();
+  }
+  bool isFPVectorizationPotentiallyUnsafe() override {
+    return Impl.isFPVectorizationPotentiallyUnsafe();
+  }
+  bool allowsMisalignedMemoryAccesses(LLVMContext &Context,
+                                      unsigned BitWidth, unsigned AddressSpace,
+                                      unsigned Alignment, bool *Fast) override {
+    return Impl.allowsMisalignedMemoryAccesses(Context, BitWidth, AddressSpace,
+                                               Alignment, Fast);
+  }
+  PopcntSupportKind getPopcntSupport(unsigned IntTyWidthInBit) override {
+    return Impl.getPopcntSupport(IntTyWidthInBit);
+  }
+  bool haveFastSqrt(Type *Ty) override { return Impl.haveFastSqrt(Ty); }
+
+  bool isFCmpOrdCheaperThanFCmpZero(Type *Ty) override {
+    return Impl.isFCmpOrdCheaperThanFCmpZero(Ty);
+  }
+
+  int getFPOpCost(Type *Ty) override { return Impl.getFPOpCost(Ty); }
+
+  int getIntImmCodeSizeCost(unsigned Opc, unsigned Idx, const APInt &Imm,
+                            Type *Ty) override {
+    return Impl.getIntImmCodeSizeCost(Opc, Idx, Imm, Ty);
+  }
+  int getIntImmCost(const APInt &Imm, Type *Ty) override {
+    return Impl.getIntImmCost(Imm, Ty);
+  }
+  int getIntImmCost(unsigned Opc, unsigned Idx, const APInt &Imm,
+                    Type *Ty) override {
+    return Impl.getIntImmCost(Opc, Idx, Imm, Ty);
+  }
+  int getIntImmCost(Intrinsic::ID IID, unsigned Idx, const APInt &Imm,
+                    Type *Ty) override {
+    return Impl.getIntImmCost(IID, Idx, Imm, Ty);
+  }
+  unsigned getNumberOfRegisters(bool Vector) override {
+    return Impl.getNumberOfRegisters(Vector);
+  }
+  unsigned getRegisterBitWidth(bool Vector) const override {
+    return Impl.getRegisterBitWidth(Vector);
+  }
+  unsigned getMinVectorRegisterBitWidth() override {
+    return Impl.getMinVectorRegisterBitWidth();
+  }
+  bool shouldConsiderAddressTypePromotion(
+      const Instruction &I, bool &AllowPromotionWithoutCommonHeader) override {
+    return Impl.shouldConsiderAddressTypePromotion(
+        I, AllowPromotionWithoutCommonHeader);
+  }
+  unsigned getCacheLineSize() override {
+    return Impl.getCacheLineSize();
+  }
+  llvm::Optional<unsigned> getCacheSize(CacheLevel Level) override {
+    return Impl.getCacheSize(Level);
+  }
+  llvm::Optional<unsigned> getCacheAssociativity(CacheLevel Level) override {
+    return Impl.getCacheAssociativity(Level);
+  }
+  unsigned getPrefetchDistance() override { return Impl.getPrefetchDistance(); }
+  unsigned getMinPrefetchStride() override {
+    return Impl.getMinPrefetchStride();
+  }
+  unsigned getMaxPrefetchIterationsAhead() override {
+    return Impl.getMaxPrefetchIterationsAhead();
+  }
+  unsigned getMaxInterleaveFactor(unsigned VF) override {
+    return Impl.getMaxInterleaveFactor(VF);
+  }
+  unsigned getEstimatedNumberOfCaseClusters(const SwitchInst &SI,
+                                            unsigned &JTSize) override {
+    return Impl.getEstimatedNumberOfCaseClusters(SI, JTSize);
+  }
+  unsigned
+  getArithmeticInstrCost(unsigned Opcode, Type *Ty, OperandValueKind Opd1Info,
+                         OperandValueKind Opd2Info,
+                         OperandValueProperties Opd1PropInfo,
+                         OperandValueProperties Opd2PropInfo,
+                         ArrayRef<const Value *> Args) override {
+    return Impl.getArithmeticInstrCost(Opcode, Ty, Opd1Info, Opd2Info,
+                                       Opd1PropInfo, Opd2PropInfo, Args);
+  }
+  int getShuffleCost(ShuffleKind Kind, Type *Tp, int Index,
+                     Type *SubTp) override {
+    return Impl.getShuffleCost(Kind, Tp, Index, SubTp);
+  }
+  int getCastInstrCost(unsigned Opcode, Type *Dst, Type *Src,
+                       const Instruction *I) override {
+    return Impl.getCastInstrCost(Opcode, Dst, Src, I);
+  }
+  int getExtractWithExtendCost(unsigned Opcode, Type *Dst, VectorType *VecTy,
+                               unsigned Index) override {
+    return Impl.getExtractWithExtendCost(Opcode, Dst, VecTy, Index);
+  }
+  int getCFInstrCost(unsigned Opcode) override {
+    return Impl.getCFInstrCost(Opcode);
+  }
+  int getCmpSelInstrCost(unsigned Opcode, Type *ValTy, Type *CondTy,
+                         const Instruction *I) override {
+    return Impl.getCmpSelInstrCost(Opcode, ValTy, CondTy, I);
+  }
+  int getVectorInstrCost(unsigned Opcode, Type *Val, unsigned Index) override {
+    return Impl.getVectorInstrCost(Opcode, Val, Index);
+  }
+  int getMemoryOpCost(unsigned Opcode, Type *Src, unsigned Alignment,
+                      unsigned AddressSpace, const Instruction *I) override {
+    return Impl.getMemoryOpCost(Opcode, Src, Alignment, AddressSpace, I);
+  }
+  int getMaskedMemoryOpCost(unsigned Opcode, Type *Src, unsigned Alignment,
+                            unsigned AddressSpace) override {
+    return Impl.getMaskedMemoryOpCost(Opcode, Src, Alignment, AddressSpace);
+  }
+  int getGatherScatterOpCost(unsigned Opcode, Type *DataTy,
+                             Value *Ptr, bool VariableMask,
+                             unsigned Alignment) override {
+    return Impl.getGatherScatterOpCost(Opcode, DataTy, Ptr, VariableMask,
+                                       Alignment);
+  }
+  int getInterleavedMemoryOpCost(unsigned Opcode, Type *VecTy, unsigned Factor,
+                                 ArrayRef<unsigned> Indices, unsigned Alignment,
+                                 unsigned AddressSpace) override {
+    return Impl.getInterleavedMemoryOpCost(Opcode, VecTy, Factor, Indices,
+                                           Alignment, AddressSpace);
+  }
+  int getArithmeticReductionCost(unsigned Opcode, Type *Ty,
+                                 bool IsPairwiseForm) override {
+    return Impl.getArithmeticReductionCost(Opcode, Ty, IsPairwiseForm);
+  }
+  int getMinMaxReductionCost(Type *Ty, Type *CondTy,
+                             bool IsPairwiseForm, bool IsUnsigned) override {
+    return Impl.getMinMaxReductionCost(Ty, CondTy, IsPairwiseForm, IsUnsigned);
+   }
+  int getIntrinsicInstrCost(Intrinsic::ID ID, Type *RetTy, ArrayRef<Type *> Tys,
+               FastMathFlags FMF, unsigned ScalarizationCostPassed) override {
+    return Impl.getIntrinsicInstrCost(ID, RetTy, Tys, FMF,
+                                      ScalarizationCostPassed);
+  }
+  int getIntrinsicInstrCost(Intrinsic::ID ID, Type *RetTy,
+       ArrayRef<Value *> Args, FastMathFlags FMF, unsigned VF) override {
+    return Impl.getIntrinsicInstrCost(ID, RetTy, Args, FMF, VF);
+  }
+  int getCallInstrCost(Function *F, Type *RetTy,
+                       ArrayRef<Type *> Tys) override {
+    return Impl.getCallInstrCost(F, RetTy, Tys);
+  }
+  unsigned getNumberOfParts(Type *Tp) override {
+    return Impl.getNumberOfParts(Tp);
+  }
+  int getAddressComputationCost(Type *Ty, ScalarEvolution *SE,
+                                const SCEV *Ptr) override {
+    return Impl.getAddressComputationCost(Ty, SE, Ptr);
+  }
+  unsigned getCostOfKeepingLiveOverCall(ArrayRef<Type *> Tys) override {
+    return Impl.getCostOfKeepingLiveOverCall(Tys);
+  }
+  bool getTgtMemIntrinsic(IntrinsicInst *Inst,
+                          MemIntrinsicInfo &Info) override {
+    return Impl.getTgtMemIntrinsic(Inst, Info);
+  }
+  unsigned getAtomicMemIntrinsicMaxElementSize() const override {
+    return Impl.getAtomicMemIntrinsicMaxElementSize();
+  }
+  Value *getOrCreateResultFromMemIntrinsic(IntrinsicInst *Inst,
+                                           Type *ExpectedType) override {
+    return Impl.getOrCreateResultFromMemIntrinsic(Inst, ExpectedType);
+  }
+  Type *getMemcpyLoopLoweringType(LLVMContext &Context, Value *Length,
+                                  unsigned SrcAlign,
+                                  unsigned DestAlign) const override {
+    return Impl.getMemcpyLoopLoweringType(Context, Length, SrcAlign, DestAlign);
+  }
+  void getMemcpyLoopResidualLoweringType(SmallVectorImpl<Type *> &OpsOut,
+                                         LLVMContext &Context,
+                                         unsigned RemainingBytes,
+                                         unsigned SrcAlign,
+                                         unsigned DestAlign) const override {
+    Impl.getMemcpyLoopResidualLoweringType(OpsOut, Context, RemainingBytes,
+                                           SrcAlign, DestAlign);
+  }
+  bool areInlineCompatible(const Function *Caller,
+                           const Function *Callee) const override {
+    return Impl.areInlineCompatible(Caller, Callee);
+  }
+  unsigned getLoadStoreVecRegBitWidth(unsigned AddrSpace) const override {
+    return Impl.getLoadStoreVecRegBitWidth(AddrSpace);
+  }
+  bool isLegalToVectorizeLoad(LoadInst *LI) const override {
+    return Impl.isLegalToVectorizeLoad(LI);
+  }
+  bool isLegalToVectorizeStore(StoreInst *SI) const override {
+    return Impl.isLegalToVectorizeStore(SI);
+  }
+  bool isLegalToVectorizeLoadChain(unsigned ChainSizeInBytes,
+                                   unsigned Alignment,
+                                   unsigned AddrSpace) const override {
+    return Impl.isLegalToVectorizeLoadChain(ChainSizeInBytes, Alignment,
+                                            AddrSpace);
+  }
+  bool isLegalToVectorizeStoreChain(unsigned ChainSizeInBytes,
+                                    unsigned Alignment,
+                                    unsigned AddrSpace) const override {
+    return Impl.isLegalToVectorizeStoreChain(ChainSizeInBytes, Alignment,
+                                             AddrSpace);
+  }
+  unsigned getLoadVectorFactor(unsigned VF, unsigned LoadSize,
+                               unsigned ChainSizeInBytes,
+                               VectorType *VecTy) const override {
+    return Impl.getLoadVectorFactor(VF, LoadSize, ChainSizeInBytes, VecTy);
+  }
+  unsigned getStoreVectorFactor(unsigned VF, unsigned StoreSize,
+                                unsigned ChainSizeInBytes,
+                                VectorType *VecTy) const override {
+    return Impl.getStoreVectorFactor(VF, StoreSize, ChainSizeInBytes, VecTy);
+  }
+  bool useReductionIntrinsic(unsigned Opcode, Type *Ty,
+                             ReductionFlags Flags) const override {
+    return Impl.useReductionIntrinsic(Opcode, Ty, Flags);
+  }
+  bool shouldExpandReduction(const IntrinsicInst *II) const override {
+    return Impl.shouldExpandReduction(II);
+  }
+  int getInstructionLatency(const Instruction *I) override {
+    return Impl.getInstructionLatency(I);
+  }
+};
+
+template <typename T>
+TargetTransformInfo::TargetTransformInfo(T Impl)
+    : TTIImpl(new Model<T>(Impl)) {}
+class TargetIRAnalysis : public AnalysisInfoMixin<TargetIRAnalysis> {
+public:
+  typedef TargetTransformInfo Result;
+
+
+
+
+
+  TargetIRAnalysis();
+
+
+
+
+
+  TargetIRAnalysis(std::function<Result(const Function &)> TTICallback);
+
+
+  TargetIRAnalysis(const TargetIRAnalysis &Arg)
+      : TTICallback(Arg.TTICallback) {}
+  TargetIRAnalysis(TargetIRAnalysis &&Arg)
+      : TTICallback(std::move(Arg.TTICallback)) {}
+  TargetIRAnalysis &operator=(const TargetIRAnalysis &RHS) {
+    TTICallback = RHS.TTICallback;
+    return *this;
+  }
+  TargetIRAnalysis &operator=(TargetIRAnalysis &&RHS) {
+    TTICallback = std::move(RHS.TTICallback);
+    return *this;
+  }
+
+  Result run(const Function &F, FunctionAnalysisManager &);
+
+private:
+  friend AnalysisInfoMixin<TargetIRAnalysis>;
+  static AnalysisKey Key;
+  std::function<Result(const Function &)> TTICallback;
+
+
+  static Result getDefaultTTI(const Function &F);
+};
+
+
+
+
+
+class TargetTransformInfoWrapperPass : public ImmutablePass {
+  TargetIRAnalysis TIRA;
+  Optional<TargetTransformInfo> TTI;
+
+  virtual void anchor();
+
+public:
+  static char ID;
+
+
+
+
+
+  TargetTransformInfoWrapperPass();
+
+  explicit TargetTransformInfoWrapperPass(TargetIRAnalysis TIRA);
+
+  TargetTransformInfo &getTTI(const Function &F);
+};
+
+
+
+
+
+ImmutablePass *createTargetTransformInfoWrapperPass(TargetIRAnalysis TIRA);
+
+}
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+namespace llvm {
+
+
+
+
+
+
+template <typename T, typename Vector = std::vector<T>,
+          typename Set = DenseSet<T>>
+class SetVector {
+public:
+  using value_type = T;
+  using key_type = T;
+  using reference = T&;
+  using const_reference = const T&;
+  using set_type = Set;
+  using vector_type = Vector;
+  using iterator = typename vector_type::const_iterator;
+  using const_iterator = typename vector_type::const_iterator;
+  using reverse_iterator = typename vector_type::const_reverse_iterator;
+  using const_reverse_iterator = typename vector_type::const_reverse_iterator;
+  using size_type = typename vector_type::size_type;
+
+
+  SetVector() = default;
+
+
+  template<typename It>
+  SetVector(It Start, It End) {
+    insert(Start, End);
+  }
+
+  ArrayRef<T> getArrayRef() const { return vector_; }
+
+
+  Vector takeVector() {
+    set_.clear();
+    return std::move(vector_);
+  }
+
+
+  bool empty() const {
+    return vector_.empty();
+  }
+
+
+  size_type size() const {
+    return vector_.size();
+  }
+
+
+  iterator begin() {
+    return vector_.begin();
+  }
+
+
+  const_iterator begin() const {
+    return vector_.begin();
+  }
+
+
+  iterator end() {
+    return vector_.end();
+  }
+
+
+  const_iterator end() const {
+    return vector_.end();
+  }
+
+
+  reverse_iterator rbegin() {
+    return vector_.rbegin();
+  }
+
+
+  const_reverse_iterator rbegin() const {
+    return vector_.rbegin();
+  }
+
+
+  reverse_iterator rend() {
+    return vector_.rend();
+  }
+
+
+  const_reverse_iterator rend() const {
+    return vector_.rend();
+  }
+
+
+  const T &front() const {
+    
+   ((
+   !empty() && "Cannot call front() on empty SetVector!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!empty() && \"Cannot call front() on empty SetVector!\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/SetVector.h", 124, __PRETTY_FUNCTION__))
+                                                                ;
+    return vector_.front();
+  }
+
+
+  const T &back() const {
+    
+   ((
+   !empty() && "Cannot call back() on empty SetVector!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!empty() && \"Cannot call back() on empty SetVector!\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/SetVector.h", 130, __PRETTY_FUNCTION__))
+                                                               ;
+    return vector_.back();
+  }
+
+
+  const_reference operator[](size_type n) const {
+    
+   ((
+   n < vector_.size() && "SetVector access out of range!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "n < vector_.size() && \"SetVector access out of range!\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/SetVector.h", 136, __PRETTY_FUNCTION__))
+                                                                 ;
+    return vector_[n];
+  }
+
+
+
+  bool insert(const value_type &X) {
+    bool result = set_.insert(X).second;
+    if (result)
+      vector_.push_back(X);
+    return result;
+  }
+
+
+  template<typename It>
+  void insert(It Start, It End) {
+    for (; Start != End; ++Start)
+      if (set_.insert(*Start).second)
+        vector_.push_back(*Start);
+  }
+
+
+  bool remove(const value_type& X) {
+    if (set_.erase(X)) {
+      typename vector_type::iterator I = find(vector_, X);
+      
+     ((
+     I != vector_.end() && "Corrupted SetVector instances!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "I != vector_.end() && \"Corrupted SetVector instances!\""
+     , "/home/trippels/llvm/llvm/include/llvm/ADT/SetVector.h", 161, __PRETTY_FUNCTION__))
+                                                                   ;
+      vector_.erase(I);
+      return true;
+    }
+    return false;
+  }
+
+
+
+
+
+  iterator erase(iterator I) {
+    const key_type &V = *I;
+    
+   ((
+   set_.count(V) && "Corrupted SetVector instances!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "set_.count(V) && \"Corrupted SetVector instances!\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/SetVector.h", 174, __PRETTY_FUNCTION__))
+                                                            ;
+    set_.erase(V);
+
+
+
+
+    auto NI = vector_.begin();
+    std::advance(NI, std::distance<iterator>(NI, I));
+
+    return vector_.erase(NI);
+  }
+  template <typename UnaryPredicate>
+  bool remove_if(UnaryPredicate P) {
+    typename vector_type::iterator I =
+        llvm::remove_if(vector_, TestAndEraseFromSet<UnaryPredicate>(P, set_));
+    if (I == vector_.end())
+      return false;
+    vector_.erase(I, vector_.end());
+    return true;
+  }
+
+
+
+  size_type count(const key_type &key) const {
+    return set_.count(key);
+  }
+
+
+  void clear() {
+    set_.clear();
+    vector_.clear();
+  }
+
+
+  void pop_back() {
+    
+   ((
+   !empty() && "Cannot remove an element from an empty SetVector!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!empty() && \"Cannot remove an element from an empty SetVector!\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/SetVector.h", 223, __PRETTY_FUNCTION__))
+                                                                          ;
+    set_.erase(back());
+    vector_.pop_back();
+  }
+
+  T pop_back_val() {
+    T Ret = back();
+    pop_back();
+    return Ret;
+  }
+
+  bool operator==(const SetVector &that) const {
+    return vector_ == that.vector_;
+  }
+
+  bool operator!=(const SetVector &that) const {
+    return vector_ != that.vector_;
+  }
+
+
+
+
+  template <class STy>
+  bool set_union(const STy &S) {
+    bool Changed = false;
+
+    for (typename STy::const_iterator SI = S.begin(), SE = S.end(); SI != SE;
+         ++SI)
+      if (insert(*SI))
+        Changed = true;
+
+    return Changed;
+  }
+
+
+
+
+  template <class STy>
+  void set_subtract(const STy &S) {
+    for (typename STy::const_iterator SI = S.begin(), SE = S.end(); SI != SE;
+         ++SI)
+      remove(*SI);
+  }
+
+private:
+
+
+
+
+  template <typename UnaryPredicate>
+  class TestAndEraseFromSet {
+    UnaryPredicate P;
+    set_type &set_;
+
+  public:
+    TestAndEraseFromSet(UnaryPredicate P, set_type &set_)
+        : P(std::move(P)), set_(set_) {}
+
+    template <typename ArgumentT>
+    bool operator()(const ArgumentT &Arg) {
+      if (P(Arg)) {
+        set_.erase(Arg);
+        return true;
+      }
+      return false;
+    }
+  };
+
+  set_type set_;
+  vector_type vector_;
+};
+
+
+
+template <typename T, unsigned N>
+class SmallSetVector
+    : public SetVector<T, SmallVector<T, N>, SmallDenseSet<T, N>> {
+public:
+  SmallSetVector() = default;
+
+
+  template<typename It>
+  SmallSetVector(It Start, It End) {
+    this->insert(Start, End);
+  }
+};
+
+}
+
+
+
+namespace llvm {
+
+class MDNode;
+class raw_ostream;
+
+
+class ConstantRange {
+  APInt Lower, Upper;
+
+public:
+
+  explicit ConstantRange(uint32_t BitWidth, bool isFullSet = true);
+
+
+  ConstantRange(APInt Value);
+
+
+
+
+  ConstantRange(APInt Lower, APInt Upper);
+  static ConstantRange makeAllowedICmpRegion(CmpInst::Predicate Pred,
+                                             const ConstantRange &Other);
+  static ConstantRange makeSatisfyingICmpRegion(CmpInst::Predicate Pred,
+                                                const ConstantRange &Other);
+  static ConstantRange makeExactICmpRegion(CmpInst::Predicate Pred,
+                                           const APInt &Other);
+  static ConstantRange makeGuaranteedNoWrapRegion(Instruction::BinaryOps BinOp,
+                                                  const ConstantRange &Other,
+                                                  unsigned NoWrapKind);
+
+
+
+
+  bool getEquivalentICmp(CmpInst::Predicate &Pred, APInt &RHS) const;
+
+
+  const APInt &getLower() const { return Lower; }
+
+
+  const APInt &getUpper() const { return Upper; }
+
+
+  uint32_t getBitWidth() const { return Lower.getBitWidth(); }
+
+
+
+  bool isFullSet() const;
+
+
+  bool isEmptySet() const;
+
+
+
+  bool isWrappedSet() const;
+
+
+
+  bool isSignWrappedSet() const;
+
+
+  bool contains(const APInt &Val) const;
+
+
+  bool contains(const ConstantRange &CR) const;
+
+
+  const APInt *getSingleElement() const {
+    if (Upper == Lower + 1)
+      return &Lower;
+    return nullptr;
+  }
+
+
+
+  const APInt *getSingleMissingElement() const {
+    if (Lower == Upper + 1)
+      return &Upper;
+    return nullptr;
+  }
+
+
+  bool isSingleElement() const { return getSingleElement() != nullptr; }
+
+
+  APInt getSetSize() const;
+
+
+  bool isSizeStrictlySmallerThan(const ConstantRange &CR) const;
+
+
+  bool isSizeLargerThan(uint64_t MaxSize) const;
+
+
+  APInt getUnsignedMax() const;
+
+
+  APInt getUnsignedMin() const;
+
+
+  APInt getSignedMax() const;
+
+
+  APInt getSignedMin() const;
+
+
+  bool operator==(const ConstantRange &CR) const {
+    return Lower == CR.Lower && Upper == CR.Upper;
+  }
+  bool operator!=(const ConstantRange &CR) const {
+    return !operator==(CR);
+  }
+
+
+  ConstantRange subtract(const APInt &CI) const;
+
+
+
+  ConstantRange difference(const ConstantRange &CR) const;
+
+
+
+
+
+
+
+  ConstantRange intersectWith(const ConstantRange &CR) const;
+
+
+
+
+
+
+  ConstantRange unionWith(const ConstantRange &CR) const;
+
+
+
+
+
+
+
+  ConstantRange castOp(Instruction::CastOps CastOp,
+                       uint32_t BitWidth) const;
+
+
+
+
+
+  ConstantRange zeroExtend(uint32_t BitWidth) const;
+
+
+
+
+
+  ConstantRange signExtend(uint32_t BitWidth) const;
+
+
+
+
+
+  ConstantRange truncate(uint32_t BitWidth) const;
+
+
+
+  ConstantRange zextOrTrunc(uint32_t BitWidth) const;
+
+
+
+  ConstantRange sextOrTrunc(uint32_t BitWidth) const;
+
+
+
+
+  ConstantRange binaryOp(Instruction::BinaryOps BinOp,
+                         const ConstantRange &Other) const;
+
+
+
+  ConstantRange add(const ConstantRange &Other) const;
+
+
+
+  ConstantRange addWithNoSignedWrap(const APInt &Other) const;
+
+
+
+  ConstantRange sub(const ConstantRange &Other) const;
+
+
+
+
+  ConstantRange multiply(const ConstantRange &Other) const;
+
+
+
+  ConstantRange smax(const ConstantRange &Other) const;
+
+
+
+  ConstantRange umax(const ConstantRange &Other) const;
+
+
+
+  ConstantRange smin(const ConstantRange &Other) const;
+
+
+
+  ConstantRange umin(const ConstantRange &Other) const;
+
+
+
+
+  ConstantRange udiv(const ConstantRange &Other) const;
+
+
+
+  ConstantRange binaryAnd(const ConstantRange &Other) const;
+
+
+
+  ConstantRange binaryOr(const ConstantRange &Other) const;
+
+
+
+
+  ConstantRange shl(const ConstantRange &Other) const;
+
+
+
+  ConstantRange lshr(const ConstantRange &Other) const;
+
+
+
+  ConstantRange ashr(const ConstantRange &Other) const;
+
+
+  ConstantRange inverse() const;
+
+
+  void print(raw_ostream &OS) const;
+
+
+  void dump() const;
+};
+
+inline raw_ostream &operator<<(raw_ostream &OS, const ConstantRange &CR) {
+  CR.print(OS);
+  return OS;
+}
+
+
+
+
+ConstantRange getConstantRangeFromMetadata(const MDNode &RangeMD);
+
+}
+
+
+
+
+
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+namespace llvm {
+
+
+
+
+
+
+class ValueHandleBase {
+  friend class Value;
+
+protected:
+
+
+
+
+  enum HandleBaseKind { Assert, Callback, Weak, WeakTracking };
+
+  ValueHandleBase(const ValueHandleBase &RHS)
+      : ValueHandleBase(RHS.PrevPair.getInt(), RHS) {}
+
+  ValueHandleBase(HandleBaseKind Kind, const ValueHandleBase &RHS)
+      : PrevPair(nullptr, Kind), Val(RHS.getValPtr()) {
+    if (isValid(getValPtr()))
+      AddToExistingUseList(RHS.getPrevPtr());
+  }
+
+private:
+  PointerIntPair<ValueHandleBase**, 2, HandleBaseKind> PrevPair;
+  ValueHandleBase *Next = nullptr;
+  Value *Val = nullptr;
+
+  void setValPtr(Value *V) { Val = V; }
+
+public:
+  explicit ValueHandleBase(HandleBaseKind Kind)
+      : PrevPair(nullptr, Kind) {}
+  ValueHandleBase(HandleBaseKind Kind, Value *V)
+      : PrevPair(nullptr, Kind), Val(V) {
+    if (isValid(getValPtr()))
+      AddToUseList();
+  }
+
+  ~ValueHandleBase() {
+    if (isValid(getValPtr()))
+      RemoveFromUseList();
+  }
+
+  Value *operator=(Value *RHS) {
+    if (getValPtr() == RHS)
+      return RHS;
+    if (isValid(getValPtr()))
+      RemoveFromUseList();
+    setValPtr(RHS);
+    if (isValid(getValPtr()))
+      AddToUseList();
+    return RHS;
+  }
+
+  Value *operator=(const ValueHandleBase &RHS) {
+    if (getValPtr() == RHS.getValPtr())
+      return RHS.getValPtr();
+    if (isValid(getValPtr()))
+      RemoveFromUseList();
+    setValPtr(RHS.getValPtr());
+    if (isValid(getValPtr()))
+      AddToExistingUseList(RHS.getPrevPtr());
+    return getValPtr();
+  }
+
+  Value *operator->() const { return getValPtr(); }
+  Value &operator*() const { return *getValPtr(); }
+
+protected:
+  Value *getValPtr() const { return Val; }
+
+  static bool isValid(Value *V) {
+    return V &&
+           V != DenseMapInfo<Value *>::getEmptyKey() &&
+           V != DenseMapInfo<Value *>::getTombstoneKey();
+  }
+
+
+  void RemoveFromUseList();
+
+
+
+
+
+  void clearValPtr() { setValPtr(nullptr); }
+
+public:
+
+  static void ValueIsDeleted(Value *V);
+  static void ValueIsRAUWd(Value *Old, Value *New);
+
+private:
+
+  ValueHandleBase **getPrevPtr() const { return PrevPair.getPointer(); }
+  HandleBaseKind getKind() const { return PrevPair.getInt(); }
+  void setPrevPtr(ValueHandleBase **Ptr) { PrevPair.setPointer(Ptr); }
+
+
+
+
+
+  void AddToExistingUseList(ValueHandleBase **List);
+
+
+  void AddToExistingUseListAfter(ValueHandleBase *Node);
+
+
+  void AddToUseList();
+};
+
+
+
+
+
+class WeakVH : public ValueHandleBase {
+public:
+  WeakVH() : ValueHandleBase(Weak) {}
+  WeakVH(Value *P) : ValueHandleBase(Weak, P) {}
+  WeakVH(const WeakVH &RHS)
+      : ValueHandleBase(Weak, RHS) {}
+
+  WeakVH &operator=(const WeakVH &RHS) = default;
+
+  Value *operator=(Value *RHS) {
+    return ValueHandleBase::operator=(RHS);
+  }
+  Value *operator=(const ValueHandleBase &RHS) {
+    return ValueHandleBase::operator=(RHS);
+  }
+
+  operator Value*() const {
+    return getValPtr();
+  }
+};
+
+
+
+template <> struct simplify_type<WeakVH> {
+  using SimpleType = Value *;
+
+  static SimpleType getSimplifiedValue(WeakVH &WVH) { return WVH; }
+};
+template <> struct simplify_type<const WeakVH> {
+  using SimpleType = Value *;
+
+  static SimpleType getSimplifiedValue(const WeakVH &WVH) { return WVH; }
+};
+class WeakTrackingVH : public ValueHandleBase {
+public:
+  WeakTrackingVH() : ValueHandleBase(WeakTracking) {}
+  WeakTrackingVH(Value *P) : ValueHandleBase(WeakTracking, P) {}
+  WeakTrackingVH(const WeakTrackingVH &RHS)
+      : ValueHandleBase(WeakTracking, RHS) {}
+
+  WeakTrackingVH &operator=(const WeakTrackingVH &RHS) = default;
+
+  Value *operator=(Value *RHS) {
+    return ValueHandleBase::operator=(RHS);
+  }
+  Value *operator=(const ValueHandleBase &RHS) {
+    return ValueHandleBase::operator=(RHS);
+  }
+
+  operator Value*() const {
+    return getValPtr();
+  }
+
+  bool pointsToAliveValue() const {
+    return ValueHandleBase::isValid(getValPtr());
+  }
+};
+
+
+
+template <> struct simplify_type<WeakTrackingVH> {
+  using SimpleType = Value *;
+
+  static SimpleType getSimplifiedValue(WeakTrackingVH &WVH) { return WVH; }
+};
+template <> struct simplify_type<const WeakTrackingVH> {
+  using SimpleType = Value *;
+
+  static SimpleType getSimplifiedValue(const WeakTrackingVH &WVH) {
+    return WVH;
+  }
+};
+template <typename ValueTy>
+class AssertingVH
+
+  : public ValueHandleBase
+
+  {
+  friend struct DenseMapInfo<AssertingVH<ValueTy>>;
+
+
+  Value *getRawValPtr() const { return ValueHandleBase::getValPtr(); }
+  void setRawValPtr(Value *P) { ValueHandleBase::operator=(P); }
+
+
+
+
+
+
+  static Value *GetAsValue(Value *V) { return V; }
+  static Value *GetAsValue(const Value *V) { return const_cast<Value*>(V); }
+
+  ValueTy *getValPtr() const { return static_cast<ValueTy *>(getRawValPtr()); }
+  void setValPtr(ValueTy *P) { setRawValPtr(GetAsValue(P)); }
+
+public:
+
+  AssertingVH() : ValueHandleBase(Assert) {}
+  AssertingVH(ValueTy *P) : ValueHandleBase(Assert, GetAsValue(P)) {}
+  AssertingVH(const AssertingVH &RHS) : ValueHandleBase(Assert, RHS) {}
+
+
+
+
+
+  operator ValueTy*() const {
+    return getValPtr();
+  }
+
+  ValueTy *operator=(ValueTy *RHS) {
+    setValPtr(RHS);
+    return getValPtr();
+  }
+  ValueTy *operator=(const AssertingVH<ValueTy> &RHS) {
+    setValPtr(RHS.getValPtr());
+    return getValPtr();
+  }
+
+  ValueTy *operator->() const { return getValPtr(); }
+  ValueTy &operator*() const { return *getValPtr(); }
+};
+
+
+template<typename T>
+struct DenseMapInfo<AssertingVH<T>> {
+  static inline AssertingVH<T> getEmptyKey() {
+    AssertingVH<T> Res;
+    Res.setRawValPtr(DenseMapInfo<Value *>::getEmptyKey());
+    return Res;
+  }
+
+  static inline AssertingVH<T> getTombstoneKey() {
+    AssertingVH<T> Res;
+    Res.setRawValPtr(DenseMapInfo<Value *>::getTombstoneKey());
+    return Res;
+  }
+
+  static unsigned getHashValue(const AssertingVH<T> &Val) {
+    return DenseMapInfo<Value *>::getHashValue(Val.getRawValPtr());
+  }
+
+  static bool isEqual(const AssertingVH<T> &LHS, const AssertingVH<T> &RHS) {
+    return DenseMapInfo<Value *>::isEqual(LHS.getRawValPtr(),
+                                          RHS.getRawValPtr());
+  }
+};
+
+template <typename T>
+struct isPodLike<AssertingVH<T>> {
+
+
+
+  static const bool value = false;
+
+};
+template <typename ValueTy> class TrackingVH {
+  WeakTrackingVH InnerHandle;
+
+public:
+  ValueTy *getValPtr() const {
+    
+   ((
+   InnerHandle.pointsToAliveValue() && "TrackingVH must be non-null and valid on dereference!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "InnerHandle.pointsToAliveValue() && \"TrackingVH must be non-null and valid on dereference!\""
+   ,
+                                                                  "/home/trippels/llvm/llvm/include/llvm/IR/ValueHandle.h"
+    ,
+                                                                  343
+    , __PRETTY_FUNCTION__))
+                                                                   
+                                                                  ;
+
+
+
+
+
+    
+   ((
+   isa<ValueTy>(InnerHandle) && "Tracked Value was replaced by one with an invalid type!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isa<ValueTy>(InnerHandle) && \"Tracked Value was replaced by one with an invalid type!\""
+   ,
+                                                                    "/home/trippels/llvm/llvm/include/llvm/IR/ValueHandle.h"
+    ,
+                                                                    350
+    , __PRETTY_FUNCTION__))
+                                                                     
+                                                                    ;
+    return cast<ValueTy>(InnerHandle);
+  }
+
+  void setValPtr(ValueTy *P) {
+
+
+    InnerHandle = GetAsValue(P);
+  }
+
+
+
+  static Value *GetAsValue(Value *V) { return V; }
+  static Value *GetAsValue(const Value *V) { return const_cast<Value*>(V); }
+
+public:
+  TrackingVH() = default;
+  TrackingVH(ValueTy *P) { setValPtr(P); }
+
+  operator ValueTy*() const {
+    return getValPtr();
+  }
+
+  ValueTy *operator=(ValueTy *RHS) {
+    setValPtr(RHS);
+    return getValPtr();
+  }
+
+  ValueTy *operator->() const { return getValPtr(); }
+  ValueTy &operator*() const { return *getValPtr(); }
+};
+class CallbackVH : public ValueHandleBase {
+  virtual void anchor();
+protected:
+  ~CallbackVH() = default;
+  CallbackVH(const CallbackVH &) = default;
+  CallbackVH &operator=(const CallbackVH &) = default;
+
+  void setValPtr(Value *P) {
+    ValueHandleBase::operator=(P);
+  }
+
+public:
+  CallbackVH() : ValueHandleBase(Callback) {}
+  CallbackVH(Value *P) : ValueHandleBase(Callback, P) {}
+
+  operator Value*() const {
+    return getValPtr();
+  }
+  virtual void deleted() { setValPtr(nullptr); }
+  virtual void allUsesReplacedWith(Value *) {}
+};
+template <typename ValueTy>
+class PoisoningVH
+
+    final : public CallbackVH
+
+{
+  friend struct DenseMapInfo<PoisoningVH<ValueTy>>;
+
+
+  static Value *GetAsValue(Value *V) { return V; }
+  static Value *GetAsValue(const Value *V) { return const_cast<Value *>(V); }
+  bool Poisoned = false;
+
+  Value *getRawValPtr() const { return ValueHandleBase::getValPtr(); }
+  void setRawValPtr(Value *P) { ValueHandleBase::operator=(P); }
+
+
+  void deleted() override {
+    
+   ((
+   !Poisoned && "Tried to delete an already poisoned handle!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!Poisoned && \"Tried to delete an already poisoned handle!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/ValueHandle.h", 475, __PRETTY_FUNCTION__))
+                                                                     ;
+    Poisoned = true;
+    RemoveFromUseList();
+  }
+
+
+  void allUsesReplacedWith(Value *) override {
+    
+   ((
+   !Poisoned && "Tried to RAUW an already poisoned handle!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!Poisoned && \"Tried to RAUW an already poisoned handle!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/ValueHandle.h", 482, __PRETTY_FUNCTION__))
+                                                                   ;
+    Poisoned = true;
+    RemoveFromUseList();
+  }
+
+
+
+
+
+
+
+  ValueTy *getValPtr() const {
+    
+   ((
+   !Poisoned && "Accessed a poisoned value handle!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!Poisoned && \"Accessed a poisoned value handle!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/ValueHandle.h", 494, __PRETTY_FUNCTION__))
+                                                           ;
+    return static_cast<ValueTy *>(getRawValPtr());
+  }
+  void setValPtr(ValueTy *P) { setRawValPtr(GetAsValue(P)); }
+
+public:
+  PoisoningVH() = default;
+
+  PoisoningVH(ValueTy *P) : CallbackVH(GetAsValue(P)) {}
+  PoisoningVH(const PoisoningVH &RHS)
+      : CallbackVH(RHS), Poisoned(RHS.Poisoned) {}
+
+  ~PoisoningVH() {
+    if (Poisoned)
+      clearValPtr();
+  }
+
+  PoisoningVH &operator=(const PoisoningVH &RHS) {
+    if (Poisoned)
+      clearValPtr();
+    CallbackVH::operator=(RHS);
+    Poisoned = RHS.Poisoned;
+    return *this;
+  }
+
+
+
+
+  operator ValueTy *() const { return getValPtr(); }
+
+  ValueTy *operator->() const { return getValPtr(); }
+  ValueTy &operator*() const { return *getValPtr(); }
+};
+
+
+template <typename T> struct DenseMapInfo<PoisoningVH<T>> {
+  static inline PoisoningVH<T> getEmptyKey() {
+    PoisoningVH<T> Res;
+    Res.setRawValPtr(DenseMapInfo<Value *>::getEmptyKey());
+    return Res;
+  }
+
+  static inline PoisoningVH<T> getTombstoneKey() {
+    PoisoningVH<T> Res;
+    Res.setRawValPtr(DenseMapInfo<Value *>::getTombstoneKey());
+    return Res;
+  }
+
+  static unsigned getHashValue(const PoisoningVH<T> &Val) {
+    return DenseMapInfo<Value *>::getHashValue(Val.getRawValPtr());
+  }
+
+  static bool isEqual(const PoisoningVH<T> &LHS, const PoisoningVH<T> &RHS) {
+    return DenseMapInfo<Value *>::isEqual(LHS.getRawValPtr(),
+                                          RHS.getRawValPtr());
+  }
+};
+
+template <typename T> struct isPodLike<PoisoningVH<T>> {
+
+
+
+  static const bool value = false;
+
+};
+
+}
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+namespace llvm
+{
+  namespace sys
+  {
+
+    class MutexImpl
+    {
+
+
+    public:
+
+
+
+
+
+
+      explicit MutexImpl(bool recursive = true);
+
+
+
+      ~MutexImpl();
+
+
+
+
+    public:
+
+
+
+
+
+      bool acquire();
+
+
+
+
+
+
+      bool release();
+
+
+
+
+
+
+
+      bool tryacquire();
+
+
+
+
+    private:
+
+      void* data_;
+
+
+
+
+
+    private:
+      MutexImpl(const MutexImpl &) = delete;
+      void operator=(const MutexImpl &) = delete;
+
+    };
+
+
+
+
+
+    template<bool mt_only>
+    class SmartMutex {
+      MutexImpl impl;
+      unsigned acquired;
+      bool recursive;
+    public:
+      explicit SmartMutex(bool rec = true) :
+        impl(rec), acquired(0), recursive(rec) { }
+
+      bool lock() {
+        if (!mt_only || llvm_is_multithreaded()) {
+          return impl.acquire();
+        } else {
+
+
+
+          
+         ((
+         (recursive || acquired == 0) && "Lock already acquired!!"
+         ) ? static_cast<void> (0) : __assert_fail (
+         "(recursive || acquired == 0) && \"Lock already acquired!!\""
+         , "/home/trippels/llvm/llvm/include/llvm/Support/Mutex.h", 106, __PRETTY_FUNCTION__))
+                                                                          ;
+          ++acquired;
+          return true;
+        }
+      }
+
+      bool unlock() {
+        if (!mt_only || llvm_is_multithreaded()) {
+          return impl.release();
+        } else {
+
+
+
+          
+         ((
+         ((recursive && acquired) || (acquired == 1)) && "Lock not acquired before release!"
+         ) ? static_cast<void> (0) : __assert_fail (
+         "((recursive && acquired) || (acquired == 1)) && \"Lock not acquired before release!\""
+         ,
+                                                    "/home/trippels/llvm/llvm/include/llvm/Support/Mutex.h"
+          ,
+                                                    120
+          , __PRETTY_FUNCTION__))
+                                                     
+                                                    ;
+          --acquired;
+          return true;
+        }
+      }
+
+      bool try_lock() {
+        if (!mt_only || llvm_is_multithreaded())
+          return impl.tryacquire();
+        else return true;
+      }
+
+      private:
+        SmartMutex(const SmartMutex<mt_only> & original);
+        void operator=(const SmartMutex<mt_only> &);
+    };
+
+
+    typedef SmartMutex<false> Mutex;
+
+    template<bool mt_only>
+    class SmartScopedLock {
+      SmartMutex<mt_only>& mtx;
+
+    public:
+      SmartScopedLock(SmartMutex<mt_only>& m) : mtx(m) {
+        mtx.lock();
+      }
+
+      ~SmartScopedLock() {
+        mtx.unlock();
+      }
+    };
+
+    typedef SmartScopedLock<false> ScopedLock;
+  }
+}
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+namespace llvm {
+
+
+
+
+
+
+
+  template<typename MutexT>
+  class unique_lock {
+    MutexT *M = nullptr;
+    bool locked = false;
+
+  public:
+    unique_lock() = default;
+    explicit unique_lock(MutexT &m) : M(&m), locked(true) { M->lock(); }
+    unique_lock(const unique_lock &) = delete;
+     unique_lock &operator=(const unique_lock &) = delete;
+
+    void operator=(unique_lock &&o) {
+      if (owns_lock())
+        M->unlock();
+      M = o.M;
+      locked = o.locked;
+      o.M = nullptr;
+      o.locked = false;
+    }
+
+    ~unique_lock() { if (owns_lock()) M->unlock(); }
+
+    void lock() {
+      
+     ((
+     !locked && "mutex already locked!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "!locked && \"mutex already locked!\""
+     , "/home/trippels/llvm/llvm/include/llvm/Support/UniqueLock.h", 51, __PRETTY_FUNCTION__))
+                                               ;
+      
+     ((
+     M && "no associated mutex!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "M && \"no associated mutex!\""
+     , "/home/trippels/llvm/llvm/include/llvm/Support/UniqueLock.h", 52, __PRETTY_FUNCTION__))
+                                        ;
+      M->lock();
+      locked = true;
+    }
+
+    void unlock() {
+      
+     ((
+     locked && "unlocking a mutex that isn't locked!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "locked && \"unlocking a mutex that isn't locked!\""
+     , "/home/trippels/llvm/llvm/include/llvm/Support/UniqueLock.h", 58, __PRETTY_FUNCTION__))
+                                                             ;
+      
+     ((
+     M && "no associated mutex!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "M && \"no associated mutex!\""
+     , "/home/trippels/llvm/llvm/include/llvm/Support/UniqueLock.h", 59, __PRETTY_FUNCTION__))
+                                        ;
+      M->unlock();
+      locked = false;
+    }
+
+    bool owns_lock() { return locked; }
+  };
+
+}
+
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+
+
+namespace llvm {
+
+template<typename KeyT, typename ValueT, typename Config>
+class ValueMapCallbackVH;
+template<typename DenseMapT, typename KeyT>
+class ValueMapIterator;
+template<typename DenseMapT, typename KeyT>
+class ValueMapConstIterator;
+
+
+
+
+template<typename KeyT, typename MutexT = sys::Mutex>
+struct ValueMapConfig {
+  using mutex_type = MutexT;
+
+
+
+  enum { FollowRAUW = true };
+
+
+
+
+
+  struct ExtraData {};
+
+  template<typename ExtraDataT>
+  static void onRAUW(const ExtraDataT & , KeyT , KeyT ) {}
+  template<typename ExtraDataT>
+  static void onDelete(const ExtraDataT & , KeyT ) {}
+
+
+
+
+
+  template<typename ExtraDataT>
+  static mutex_type *getMutex(const ExtraDataT & ) { return nullptr; }
+};
+
+
+template<typename KeyT, typename ValueT, typename Config =ValueMapConfig<KeyT>>
+class ValueMap {
+  friend class ValueMapCallbackVH<KeyT, ValueT, Config>;
+
+  using ValueMapCVH = ValueMapCallbackVH<KeyT, ValueT, Config>;
+  using MapT = DenseMap<ValueMapCVH, ValueT, DenseMapInfo<ValueMapCVH>>;
+  using MDMapT = DenseMap<const Metadata *, TrackingMDRef>;
+  using ExtraData = typename Config::ExtraData;
+
+  MapT Map;
+  Optional<MDMapT> MDMap;
+  ExtraData Data;
+  bool MayMapMetadata = true;
+
+public:
+  using key_type = KeyT;
+  using mapped_type = ValueT;
+  using value_type = std::pair<KeyT, ValueT>;
+  using size_type = unsigned;
+
+  explicit ValueMap(unsigned NumInitBuckets = 64)
+      : Map(NumInitBuckets), Data() {}
+  explicit ValueMap(const ExtraData &Data, unsigned NumInitBuckets = 64)
+      : Map(NumInitBuckets), Data(Data) {}
+  ValueMap(const ValueMap &) = delete;
+  ValueMap &operator=(const ValueMap &) = delete;
+
+  bool hasMD() const { return bool(MDMap); }
+  MDMapT &MD() {
+    if (!MDMap)
+      MDMap.emplace();
+    return *MDMap;
+  }
+  Optional<MDMapT> &getMDMap() { return MDMap; }
+
+  bool mayMapMetadata() const { return MayMapMetadata; }
+  void enableMapMetadata() { MayMapMetadata = true; }
+  void disableMapMetadata() { MayMapMetadata = false; }
+
+
+  Optional<Metadata *> getMappedMD(const Metadata *MD) const {
+    if (!MDMap)
+      return None;
+    auto Where = MDMap->find(MD);
+    if (Where == MDMap->end())
+      return None;
+    return Where->second.get();
+  }
+
+  using iterator = ValueMapIterator<MapT, KeyT>;
+  using const_iterator = ValueMapConstIterator<MapT, KeyT>;
+
+  inline iterator begin() { return iterator(Map.begin()); }
+  inline iterator end() { return iterator(Map.end()); }
+  inline const_iterator begin() const { return const_iterator(Map.begin()); }
+  inline const_iterator end() const { return const_iterator(Map.end()); }
+
+  bool empty() const { return Map.empty(); }
+  size_type size() const { return Map.size(); }
+
+
+  void resize(size_t Size) { Map.resize(Size); }
+
+  void clear() {
+    Map.clear();
+    MDMap.reset();
+  }
+
+
+  size_type count(const KeyT &Val) const {
+    return Map.find_as(Val) == Map.end() ? 0 : 1;
+  }
+
+  iterator find(const KeyT &Val) {
+    return iterator(Map.find_as(Val));
+  }
+  const_iterator find(const KeyT &Val) const {
+    return const_iterator(Map.find_as(Val));
+  }
+
+
+
+  ValueT lookup(const KeyT &Val) const {
+    typename MapT::const_iterator I = Map.find_as(Val);
+    return I != Map.end() ? I->second : ValueT();
+  }
+
+
+
+
+  std::pair<iterator, bool> insert(const std::pair<KeyT, ValueT> &KV) {
+    auto MapResult = Map.insert(std::make_pair(Wrap(KV.first), KV.second));
+    return std::make_pair(iterator(MapResult.first), MapResult.second);
+  }
+
+  std::pair<iterator, bool> insert(std::pair<KeyT, ValueT> &&KV) {
+    auto MapResult =
+        Map.insert(std::make_pair(Wrap(KV.first), std::move(KV.second)));
+    return std::make_pair(iterator(MapResult.first), MapResult.second);
+  }
+
+
+  template<typename InputIt>
+  void insert(InputIt I, InputIt E) {
+    for (; I != E; ++I)
+      insert(*I);
+  }
+
+  bool erase(const KeyT &Val) {
+    typename MapT::iterator I = Map.find_as(Val);
+    if (I == Map.end())
+      return false;
+
+    Map.erase(I);
+    return true;
+  }
+  void erase(iterator I) {
+    return Map.erase(I.base());
+  }
+
+  value_type& FindAndConstruct(const KeyT &Key) {
+    return Map.FindAndConstruct(Wrap(Key));
+  }
+
+  ValueT &operator[](const KeyT &Key) {
+    return Map[Wrap(Key)];
+  }
+
+
+
+
+  bool isPointerIntoBucketsArray(const void *Ptr) const {
+    return Map.isPointerIntoBucketsArray(Ptr);
+  }
+
+
+
+
+  const void *getPointerIntoBucketsArray() const {
+    return Map.getPointerIntoBucketsArray();
+  }
+
+private:
+
+
+
+  ValueMapCVH Wrap(KeyT key) const {
+
+
+
+
+    return ValueMapCVH(key, const_cast<ValueMap*>(this));
+  }
+};
+
+
+
+template <typename KeyT, typename ValueT, typename Config>
+class ValueMapCallbackVH final : public CallbackVH {
+  friend class ValueMap<KeyT, ValueT, Config>;
+  friend struct DenseMapInfo<ValueMapCallbackVH>;
+
+  using ValueMapT = ValueMap<KeyT, ValueT, Config>;
+  using KeySansPointerT = typename std::remove_pointer<KeyT>::type;
+
+  ValueMapT *Map;
+
+  ValueMapCallbackVH(KeyT Key, ValueMapT *Map)
+      : CallbackVH(const_cast<Value*>(static_cast<const Value*>(Key))),
+        Map(Map) {}
+
+
+  ValueMapCallbackVH(Value *V) : CallbackVH(V), Map(nullptr) {}
+
+public:
+  KeyT Unwrap() const { return cast_or_null<KeySansPointerT>(getValPtr()); }
+
+  void deleted() override {
+
+    ValueMapCallbackVH Copy(*this);
+    typename Config::mutex_type *M = Config::getMutex(Copy.Map->Data);
+    unique_lock<typename Config::mutex_type> Guard;
+    if (M)
+      Guard = unique_lock<typename Config::mutex_type>(*M);
+    Config::onDelete(Copy.Map->Data, Copy.Unwrap());
+    Copy.Map->Map.erase(Copy);
+  }
+
+  void allUsesReplacedWith(Value *new_key) override {
+    
+   ((
+   isa<KeySansPointerT>(new_key) && "Invalid RAUW on key of ValueMap<>"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isa<KeySansPointerT>(new_key) && \"Invalid RAUW on key of ValueMap<>\""
+   ,
+                                              "/home/trippels/llvm/llvm/include/llvm/IR/ValueMap.h"
+    ,
+                                              275
+    , __PRETTY_FUNCTION__))
+                                               
+                                              ;
+
+    ValueMapCallbackVH Copy(*this);
+    typename Config::mutex_type *M = Config::getMutex(Copy.Map->Data);
+    unique_lock<typename Config::mutex_type> Guard;
+    if (M)
+      Guard = unique_lock<typename Config::mutex_type>(*M);
+
+    KeyT typed_new_key = cast<KeySansPointerT>(new_key);
+
+    Config::onRAUW(Copy.Map->Data, Copy.Unwrap(), typed_new_key);
+    if (Config::FollowRAUW) {
+      typename ValueMapT::MapT::iterator I = Copy.Map->Map.find(Copy);
+
+
+      if (I != Copy.Map->Map.end()) {
+        ValueT Target(std::move(I->second));
+        Copy.Map->Map.erase(I);
+        Copy.Map->insert(std::make_pair(typed_new_key, std::move(Target)));
+      }
+    }
+  }
+};
+
+template<typename KeyT, typename ValueT, typename Config>
+struct DenseMapInfo<ValueMapCallbackVH<KeyT, ValueT, Config>> {
+  using VH = ValueMapCallbackVH<KeyT, ValueT, Config>;
+
+  static inline VH getEmptyKey() {
+    return VH(DenseMapInfo<Value *>::getEmptyKey());
+  }
+
+  static inline VH getTombstoneKey() {
+    return VH(DenseMapInfo<Value *>::getTombstoneKey());
+  }
+
+  static unsigned getHashValue(const VH &Val) {
+    return DenseMapInfo<KeyT>::getHashValue(Val.Unwrap());
+  }
+
+  static unsigned getHashValue(const KeyT &Val) {
+    return DenseMapInfo<KeyT>::getHashValue(Val);
+  }
+
+  static bool isEqual(const VH &LHS, const VH &RHS) {
+    return LHS == RHS;
+  }
+
+  static bool isEqual(const KeyT &LHS, const VH &RHS) {
+    return LHS == RHS.getValPtr();
+  }
+};
+
+template<typename DenseMapT, typename KeyT>
+class ValueMapIterator :
+    public std::iterator<std::forward_iterator_tag,
+                         std::pair<KeyT, typename DenseMapT::mapped_type>,
+                         ptrdiff_t> {
+  using BaseT = typename DenseMapT::iterator;
+  using ValueT = typename DenseMapT::mapped_type;
+
+  BaseT I;
+
+public:
+  ValueMapIterator() : I() {}
+  ValueMapIterator(BaseT I) : I(I) {}
+
+  BaseT base() const { return I; }
+
+  struct ValueTypeProxy {
+    const KeyT first;
+    ValueT& second;
+
+    ValueTypeProxy *operator->() { return this; }
+
+    operator std::pair<KeyT, ValueT>() const {
+      return std::make_pair(first, second);
+    }
+  };
+
+  ValueTypeProxy operator*() const {
+    ValueTypeProxy Result = {I->first.Unwrap(), I->second};
+    return Result;
+  }
+
+  ValueTypeProxy operator->() const {
+    return operator*();
+  }
+
+  bool operator==(const ValueMapIterator &RHS) const {
+    return I == RHS.I;
+  }
+  bool operator!=(const ValueMapIterator &RHS) const {
+    return I != RHS.I;
+  }
+
+  inline ValueMapIterator& operator++() {
+    ++I;
+    return *this;
+  }
+  ValueMapIterator operator++(int) {
+    ValueMapIterator tmp = *this; ++*this; return tmp;
+  }
+};
+
+template<typename DenseMapT, typename KeyT>
+class ValueMapConstIterator :
+    public std::iterator<std::forward_iterator_tag,
+                         std::pair<KeyT, typename DenseMapT::mapped_type>,
+                         ptrdiff_t> {
+  using BaseT = typename DenseMapT::const_iterator;
+  using ValueT = typename DenseMapT::mapped_type;
+
+  BaseT I;
+
+public:
+  ValueMapConstIterator() : I() {}
+  ValueMapConstIterator(BaseT I) : I(I) {}
+  ValueMapConstIterator(ValueMapIterator<DenseMapT, KeyT> Other)
+    : I(Other.base()) {}
+
+  BaseT base() const { return I; }
+
+  struct ValueTypeProxy {
+    const KeyT first;
+    const ValueT& second;
+    ValueTypeProxy *operator->() { return this; }
+    operator std::pair<KeyT, ValueT>() const {
+      return std::make_pair(first, second);
+    }
+  };
+
+  ValueTypeProxy operator*() const {
+    ValueTypeProxy Result = {I->first.Unwrap(), I->second};
+    return Result;
+  }
+
+  ValueTypeProxy operator->() const {
+    return operator*();
+  }
+
+  bool operator==(const ValueMapConstIterator &RHS) const {
+    return I == RHS.I;
+  }
+  bool operator!=(const ValueMapConstIterator &RHS) const {
+    return I != RHS.I;
+  }
+
+  inline ValueMapConstIterator& operator++() {
+    ++I;
+    return *this;
+  }
+  ValueMapConstIterator operator++(int) {
+    ValueMapConstIterator tmp = *this; ++*this; return tmp;
+  }
+};
+
+}
+
+
+
+
+
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+
+namespace llvm {
+
+class AssumptionCache;
+class BasicBlock;
+class Constant;
+class ConstantInt;
+class DataLayout;
+class DominatorTree;
+class GEPOperator;
+class Instruction;
+class LLVMContext;
+class raw_ostream;
+class ScalarEvolution;
+class SCEVAddRecExpr;
+class SCEVUnknown;
+class StructType;
+class TargetLibraryInfo;
+class Type;
+class Value;
+
+
+
+
+class SCEV : public FoldingSetNode {
+  friend struct FoldingSetTrait<SCEV>;
+
+
+
+  FoldingSetNodeIDRef FastID;
+
+
+  const unsigned short SCEVType;
+
+protected:
+
+
+  unsigned short SubclassData = 0;
+
+public:
+  enum NoWrapFlags {
+    FlagAnyWrap = 0,
+    FlagNW = (1 << 0),
+    FlagNUW = (1 << 1),
+    FlagNSW = (1 << 2),
+    NoWrapMask = (1 << 3) - 1
+  };
+
+  explicit SCEV(const FoldingSetNodeIDRef ID, unsigned SCEVTy)
+      : FastID(ID), SCEVType(SCEVTy) {}
+  SCEV(const SCEV &) = delete;
+  SCEV &operator=(const SCEV &) = delete;
+
+  unsigned getSCEVType() const { return SCEVType; }
+
+
+  Type *getType() const;
+
+
+  bool isZero() const;
+
+
+  bool isOne() const;
+
+
+  bool isAllOnesValue() const;
+
+
+  bool isNonConstantNegative() const;
+
+
+
+  void print(raw_ostream &OS) const;
+
+
+  void dump() const;
+};
+
+
+
+template <> struct FoldingSetTrait<SCEV> : DefaultFoldingSetTrait<SCEV> {
+  static void Profile(const SCEV &X, FoldingSetNodeID &ID) { ID = X.FastID; }
+
+  static bool Equals(const SCEV &X, const FoldingSetNodeID &ID, unsigned IDHash,
+                     FoldingSetNodeID &TempID) {
+    return ID == X.FastID;
+  }
+
+  static unsigned ComputeHash(const SCEV &X, FoldingSetNodeID &TempID) {
+    return X.FastID.ComputeHash();
+  }
+};
+
+inline raw_ostream &operator<<(raw_ostream &OS, const SCEV &S) {
+  S.print(OS);
+  return OS;
+}
+
+
+
+
+
+struct SCEVCouldNotCompute : public SCEV {
+  SCEVCouldNotCompute();
+
+
+  static bool classof(const SCEV *S);
+};
+
+
+
+class SCEVPredicate : public FoldingSetNode {
+  friend struct FoldingSetTrait<SCEVPredicate>;
+
+
+
+  FoldingSetNodeIDRef FastID;
+
+public:
+  enum SCEVPredicateKind { P_Union, P_Equal, P_Wrap };
+
+protected:
+  SCEVPredicateKind Kind;
+  ~SCEVPredicate() = default;
+  SCEVPredicate(const SCEVPredicate &) = default;
+  SCEVPredicate &operator=(const SCEVPredicate &) = default;
+
+public:
+  SCEVPredicate(const FoldingSetNodeIDRef ID, SCEVPredicateKind Kind);
+
+  SCEVPredicateKind getKind() const { return Kind; }
+
+
+
+  virtual unsigned getComplexity() const { return 1; }
+
+
+
+  virtual bool isAlwaysTrue() const = 0;
+
+
+  virtual bool implies(const SCEVPredicate *N) const = 0;
+
+
+
+  virtual void print(raw_ostream &OS, unsigned Depth = 0) const = 0;
+
+
+
+  virtual const SCEV *getExpr() const = 0;
+};
+
+inline raw_ostream &operator<<(raw_ostream &OS, const SCEVPredicate &P) {
+  P.print(OS);
+  return OS;
+}
+
+
+
+template <>
+struct FoldingSetTrait<SCEVPredicate> : DefaultFoldingSetTrait<SCEVPredicate> {
+  static void Profile(const SCEVPredicate &X, FoldingSetNodeID &ID) {
+    ID = X.FastID;
+  }
+
+  static bool Equals(const SCEVPredicate &X, const FoldingSetNodeID &ID,
+                     unsigned IDHash, FoldingSetNodeID &TempID) {
+    return ID == X.FastID;
+  }
+
+  static unsigned ComputeHash(const SCEVPredicate &X,
+                              FoldingSetNodeID &TempID) {
+    return X.FastID.ComputeHash();
+  }
+};
+
+
+
+class SCEVEqualPredicate final : public SCEVPredicate {
+
+  const SCEV *LHS;
+  const SCEV *RHS;
+
+public:
+  SCEVEqualPredicate(const FoldingSetNodeIDRef ID, const SCEV *LHS,
+                     const SCEV *RHS);
+
+
+  bool implies(const SCEVPredicate *N) const override;
+  void print(raw_ostream &OS, unsigned Depth = 0) const override;
+  bool isAlwaysTrue() const override;
+  const SCEV *getExpr() const override;
+
+
+  const SCEV *getLHS() const { return LHS; }
+
+
+  const SCEV *getRHS() const { return RHS; }
+
+
+  static bool classof(const SCEVPredicate *P) {
+    return P->getKind() == P_Equal;
+  }
+};
+class SCEVWrapPredicate final : public SCEVPredicate {
+public:
+  enum IncrementWrapFlags {
+    IncrementAnyWrap = 0,
+    IncrementNUSW = (1 << 0),
+    IncrementNSSW = (1 << 1),
+
+    IncrementNoWrapMask = (1 << 2) - 1
+  };
+
+
+  static SCEVWrapPredicate::IncrementWrapFlags
+  clearFlags(SCEVWrapPredicate::IncrementWrapFlags Flags,
+             SCEVWrapPredicate::IncrementWrapFlags OffFlags) {
+    
+   ((
+   (Flags & IncrementNoWrapMask) == Flags && "Invalid flags value!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "(Flags & IncrementNoWrapMask) == Flags && \"Invalid flags value!\""
+   , "/home/trippels/llvm/llvm/include/llvm/Analysis/ScalarEvolution.h", 322, __PRETTY_FUNCTION__))
+                                                                           ;
+    
+   ((
+   (OffFlags & IncrementNoWrapMask) == OffFlags && "Invalid flags value!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "(OffFlags & IncrementNoWrapMask) == OffFlags && \"Invalid flags value!\""
+   ,
+                                 "/home/trippels/llvm/llvm/include/llvm/Analysis/ScalarEvolution.h"
+    ,
+                                 324
+    , __PRETTY_FUNCTION__))
+                                  
+                                 ;
+    return (SCEVWrapPredicate::IncrementWrapFlags)(Flags & ~OffFlags);
+  }
+
+  static SCEVWrapPredicate::IncrementWrapFlags
+  maskFlags(SCEVWrapPredicate::IncrementWrapFlags Flags, int Mask) {
+    
+   ((
+   (Flags & IncrementNoWrapMask) == Flags && "Invalid flags value!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "(Flags & IncrementNoWrapMask) == Flags && \"Invalid flags value!\""
+   , "/home/trippels/llvm/llvm/include/llvm/Analysis/ScalarEvolution.h", 330, __PRETTY_FUNCTION__))
+                                                                           ;
+    
+   ((
+   (Mask & IncrementNoWrapMask) == Mask && "Invalid mask value!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "(Mask & IncrementNoWrapMask) == Mask && \"Invalid mask value!\""
+   , "/home/trippels/llvm/llvm/include/llvm/Analysis/ScalarEvolution.h", 331, __PRETTY_FUNCTION__))
+                                                                        ;
+
+    return (SCEVWrapPredicate::IncrementWrapFlags)(Flags & Mask);
+  }
+
+  static SCEVWrapPredicate::IncrementWrapFlags
+  setFlags(SCEVWrapPredicate::IncrementWrapFlags Flags,
+           SCEVWrapPredicate::IncrementWrapFlags OnFlags) {
+    
+   ((
+   (Flags & IncrementNoWrapMask) == Flags && "Invalid flags value!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "(Flags & IncrementNoWrapMask) == Flags && \"Invalid flags value!\""
+   , "/home/trippels/llvm/llvm/include/llvm/Analysis/ScalarEvolution.h", 339, __PRETTY_FUNCTION__))
+                                                                           ;
+    
+   ((
+   (OnFlags & IncrementNoWrapMask) == OnFlags && "Invalid flags value!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "(OnFlags & IncrementNoWrapMask) == OnFlags && \"Invalid flags value!\""
+   ,
+                                 "/home/trippels/llvm/llvm/include/llvm/Analysis/ScalarEvolution.h"
+    ,
+                                 341
+    , __PRETTY_FUNCTION__))
+                                  
+                                 ;
+
+    return (SCEVWrapPredicate::IncrementWrapFlags)(Flags | OnFlags);
+  }
+
+
+
+  static SCEVWrapPredicate::IncrementWrapFlags
+  getImpliedFlags(const SCEVAddRecExpr *AR, ScalarEvolution &SE);
+
+private:
+  const SCEVAddRecExpr *AR;
+  IncrementWrapFlags Flags;
+
+public:
+  explicit SCEVWrapPredicate(const FoldingSetNodeIDRef ID,
+                             const SCEVAddRecExpr *AR,
+                             IncrementWrapFlags Flags);
+
+
+  IncrementWrapFlags getFlags() const { return Flags; }
+
+
+  const SCEV *getExpr() const override;
+  bool implies(const SCEVPredicate *N) const override;
+  void print(raw_ostream &OS, unsigned Depth = 0) const override;
+  bool isAlwaysTrue() const override;
+
+
+  static bool classof(const SCEVPredicate *P) {
+    return P->getKind() == P_Wrap;
+  }
+};
+
+
+
+
+
+
+
+class SCEVUnionPredicate final : public SCEVPredicate {
+private:
+  using PredicateMap =
+      DenseMap<const SCEV *, SmallVector<const SCEVPredicate *, 4>>;
+
+
+  SmallVector<const SCEVPredicate *, 16> Preds;
+
+
+  PredicateMap SCEVToPreds;
+
+public:
+  SCEVUnionPredicate();
+
+  const SmallVectorImpl<const SCEVPredicate *> &getPredicates() const {
+    return Preds;
+  }
+
+
+  void add(const SCEVPredicate *N);
+
+
+
+  ArrayRef<const SCEVPredicate *> getPredicatesForExpr(const SCEV *Expr);
+
+
+  bool isAlwaysTrue() const override;
+  bool implies(const SCEVPredicate *N) const override;
+  void print(raw_ostream &OS, unsigned Depth) const override;
+  const SCEV *getExpr() const override;
+
+
+
+  unsigned getComplexity() const override { return Preds.size(); }
+
+
+  static bool classof(const SCEVPredicate *P) {
+    return P->getKind() == P_Union;
+  }
+};
+
+struct ExitLimitQuery {
+  ExitLimitQuery(const Loop *L, BasicBlock *ExitingBlock, bool AllowPredicates)
+      : L(L), ExitingBlock(ExitingBlock), AllowPredicates(AllowPredicates) {}
+
+  const Loop *L;
+  BasicBlock *ExitingBlock;
+  bool AllowPredicates;
+};
+
+template <> struct DenseMapInfo<ExitLimitQuery> {
+  static inline ExitLimitQuery getEmptyKey() {
+    return ExitLimitQuery(nullptr, nullptr, true);
+  }
+
+  static inline ExitLimitQuery getTombstoneKey() {
+    return ExitLimitQuery(nullptr, nullptr, false);
+  }
+
+  static unsigned getHashValue(ExitLimitQuery Val) {
+    return hash_combine(hash_combine(Val.L, Val.ExitingBlock),
+                        Val.AllowPredicates);
+  }
+
+  static bool isEqual(ExitLimitQuery LHS, ExitLimitQuery RHS) {
+    return LHS.L == RHS.L && LHS.ExitingBlock == RHS.ExitingBlock &&
+           LHS.AllowPredicates == RHS.AllowPredicates;
+  }
+};
+
+
+
+
+class ScalarEvolution {
+public:
+
+  enum LoopDisposition {
+    LoopVariant,
+    LoopInvariant,
+    LoopComputable
+  };
+
+
+  enum BlockDisposition {
+    DoesNotDominateBlock,
+    DominatesBlock,
+    ProperlyDominatesBlock
+  };
+
+
+
+  static SCEV::NoWrapFlags maskFlags(SCEV::NoWrapFlags Flags,
+                                                    int Mask) {
+    return (SCEV::NoWrapFlags)(Flags & Mask);
+  }
+  static SCEV::NoWrapFlags setFlags(SCEV::NoWrapFlags Flags,
+                                                   SCEV::NoWrapFlags OnFlags) {
+    return (SCEV::NoWrapFlags)(Flags | OnFlags);
+  }
+  static SCEV::NoWrapFlags
+  clearFlags(SCEV::NoWrapFlags Flags, SCEV::NoWrapFlags OffFlags) {
+    return (SCEV::NoWrapFlags)(Flags & ~OffFlags);
+  }
+
+  ScalarEvolution(Function &F, TargetLibraryInfo &TLI, AssumptionCache &AC,
+                  DominatorTree &DT, LoopInfo &LI);
+  ScalarEvolution(ScalarEvolution &&Arg);
+  ~ScalarEvolution();
+
+  LLVMContext &getContext() const { return F.getContext(); }
+
+
+
+
+
+  bool isSCEVable(Type *Ty) const;
+
+
+
+  uint64_t getTypeSizeInBits(Type *Ty) const;
+
+
+
+
+  Type *getEffectiveSCEVType(Type *Ty) const;
+
+
+  Type *getWiderType(Type *Ty1, Type *Ty2) const;
+
+
+
+  bool containsAddRecurrence(const SCEV *S);
+
+
+  void eraseValueFromMap(Value *V);
+
+
+
+  const SCEV *getSCEV(Value *V);
+
+  const SCEV *getConstant(ConstantInt *V);
+  const SCEV *getConstant(const APInt &Val);
+  const SCEV *getConstant(Type *Ty, uint64_t V, bool isSigned = false);
+  const SCEV *getTruncateExpr(const SCEV *Op, Type *Ty);
+  const SCEV *getZeroExtendExpr(const SCEV *Op, Type *Ty, unsigned Depth = 0);
+  const SCEV *getSignExtendExpr(const SCEV *Op, Type *Ty, unsigned Depth = 0);
+  const SCEV *getAnyExtendExpr(const SCEV *Op, Type *Ty);
+  const SCEV *getAddExpr(SmallVectorImpl<const SCEV *> &Ops,
+                         SCEV::NoWrapFlags Flags = SCEV::FlagAnyWrap,
+                         unsigned Depth = 0);
+  const SCEV *getAddExpr(const SCEV *LHS, const SCEV *RHS,
+                         SCEV::NoWrapFlags Flags = SCEV::FlagAnyWrap,
+                         unsigned Depth = 0) {
+    SmallVector<const SCEV *, 2> Ops = {LHS, RHS};
+    return getAddExpr(Ops, Flags, Depth);
+  }
+  const SCEV *getAddExpr(const SCEV *Op0, const SCEV *Op1, const SCEV *Op2,
+                         SCEV::NoWrapFlags Flags = SCEV::FlagAnyWrap,
+                         unsigned Depth = 0) {
+    SmallVector<const SCEV *, 3> Ops = {Op0, Op1, Op2};
+    return getAddExpr(Ops, Flags, Depth);
+  }
+  const SCEV *getMulExpr(SmallVectorImpl<const SCEV *> &Ops,
+                         SCEV::NoWrapFlags Flags = SCEV::FlagAnyWrap,
+                         unsigned Depth = 0);
+  const SCEV *getMulExpr(const SCEV *LHS, const SCEV *RHS,
+                         SCEV::NoWrapFlags Flags = SCEV::FlagAnyWrap,
+                         unsigned Depth = 0) {
+    SmallVector<const SCEV *, 2> Ops = {LHS, RHS};
+    return getMulExpr(Ops, Flags, Depth);
+  }
+  const SCEV *getMulExpr(const SCEV *Op0, const SCEV *Op1, const SCEV *Op2,
+                         SCEV::NoWrapFlags Flags = SCEV::FlagAnyWrap,
+                         unsigned Depth = 0) {
+    SmallVector<const SCEV *, 3> Ops = {Op0, Op1, Op2};
+    return getMulExpr(Ops, Flags, Depth);
+  }
+  const SCEV *getUDivExpr(const SCEV *LHS, const SCEV *RHS);
+  const SCEV *getUDivExactExpr(const SCEV *LHS, const SCEV *RHS);
+  const SCEV *getURemExpr(const SCEV *LHS, const SCEV *RHS);
+  const SCEV *getAddRecExpr(const SCEV *Start, const SCEV *Step, const Loop *L,
+                            SCEV::NoWrapFlags Flags);
+  const SCEV *getAddRecExpr(SmallVectorImpl<const SCEV *> &Operands,
+                            const Loop *L, SCEV::NoWrapFlags Flags);
+  const SCEV *getAddRecExpr(const SmallVectorImpl<const SCEV *> &Operands,
+                            const Loop *L, SCEV::NoWrapFlags Flags) {
+    SmallVector<const SCEV *, 4> NewOp(Operands.begin(), Operands.end());
+    return getAddRecExpr(NewOp, L, Flags);
+  }
+
+
+
+
+
+  Optional<std::pair<const SCEV *, SmallVector<const SCEVPredicate *, 3>>>
+  createAddRecFromPHIWithCasts(const SCEVUnknown *SymbolicPHI);
+
+
+
+
+
+
+  const SCEV *getGEPExpr(GEPOperator *GEP,
+                         const SmallVectorImpl<const SCEV *> &IndexExprs);
+  const SCEV *getSMaxExpr(const SCEV *LHS, const SCEV *RHS);
+  const SCEV *getSMaxExpr(SmallVectorImpl<const SCEV *> &Operands);
+  const SCEV *getUMaxExpr(const SCEV *LHS, const SCEV *RHS);
+  const SCEV *getUMaxExpr(SmallVectorImpl<const SCEV *> &Operands);
+  const SCEV *getSMinExpr(const SCEV *LHS, const SCEV *RHS);
+  const SCEV *getUMinExpr(const SCEV *LHS, const SCEV *RHS);
+  const SCEV *getUnknown(Value *V);
+  const SCEV *getCouldNotCompute();
+
+
+  const SCEV *getZero(Type *Ty) { return getConstant(Ty, 0); }
+
+
+  const SCEV *getOne(Type *Ty) { return getConstant(Ty, 1); }
+
+
+  const SCEV *getSizeOfExpr(Type *IntTy, Type *AllocTy);
+
+
+  const SCEV *getOffsetOfExpr(Type *IntTy, StructType *STy, unsigned FieldNo);
+
+
+  const SCEV *getNegativeSCEV(const SCEV *V,
+                              SCEV::NoWrapFlags Flags = SCEV::FlagAnyWrap);
+
+
+  const SCEV *getNotSCEV(const SCEV *V);
+
+
+  const SCEV *getMinusSCEV(const SCEV *LHS, const SCEV *RHS,
+                           SCEV::NoWrapFlags Flags = SCEV::FlagAnyWrap,
+                           unsigned Depth = 0);
+
+
+
+  const SCEV *getTruncateOrZeroExtend(const SCEV *V, Type *Ty);
+
+
+
+  const SCEV *getTruncateOrSignExtend(const SCEV *V, Type *Ty);
+
+
+
+
+  const SCEV *getNoopOrZeroExtend(const SCEV *V, Type *Ty);
+
+
+
+
+  const SCEV *getNoopOrSignExtend(const SCEV *V, Type *Ty);
+
+
+
+
+  const SCEV *getNoopOrAnyExtend(const SCEV *V, Type *Ty);
+
+
+
+  const SCEV *getTruncateOrNoop(const SCEV *V, Type *Ty);
+
+
+
+  const SCEV *getUMaxFromMismatchedTypes(const SCEV *LHS, const SCEV *RHS);
+
+
+
+  const SCEV *getUMinFromMismatchedTypes(const SCEV *LHS, const SCEV *RHS);
+
+
+
+
+
+  const SCEV *getPointerBase(const SCEV *V);
+  const SCEV *getSCEVAtScope(const SCEV *S, const Loop *L);
+
+
+  const SCEV *getSCEVAtScope(Value *V, const Loop *L);
+
+
+
+
+  bool isLoopEntryGuardedByCond(const Loop *L, ICmpInst::Predicate Pred,
+                                const SCEV *LHS, const SCEV *RHS);
+
+
+
+  bool isLoopBackedgeGuardedByCond(const Loop *L, ICmpInst::Predicate Pred,
+                                   const SCEV *LHS, const SCEV *RHS);
+
+
+
+
+
+
+  unsigned getSmallConstantTripCount(const Loop *L);
+  unsigned getSmallConstantTripCount(const Loop *L, BasicBlock *ExitingBlock);
+
+
+
+
+  unsigned getSmallConstantMaxTripCount(const Loop *L);
+
+
+
+
+
+
+
+  unsigned getSmallConstantTripMultiple(const Loop *L);
+
+
+
+
+
+
+
+  unsigned getSmallConstantTripMultiple(const Loop *L,
+                                        BasicBlock *ExitingBlock);
+
+
+
+
+  const SCEV *getExitCount(const Loop *L, BasicBlock *ExitingBlock);
+  const SCEV *getBackedgeTakenCount(const Loop *L);
+
+
+
+
+
+  const SCEV *getPredicatedBackedgeTakenCount(const Loop *L,
+                                              SCEVUnionPredicate &Predicates);
+
+
+
+
+
+  const SCEV *getMaxBackedgeTakenCount(const Loop *L);
+
+
+
+  bool isBackedgeTakenCountMaxOrZero(const Loop *L);
+
+
+
+  bool hasLoopInvariantBackedgeTakenCount(const Loop *L);
+
+
+
+
+
+  void forgetLoop(const Loop *L);
+
+
+
+
+  void forgetValue(Value *V);
+
+
+
+
+
+
+  void forgetLoopDispositions(const Loop *L) { LoopDispositions.clear(); }
+
+
+
+
+
+  uint32_t GetMinTrailingZeros(const SCEV *S);
+
+
+
+  ConstantRange getUnsignedRange(const SCEV *S) {
+    return getRangeRef(S, HINT_RANGE_UNSIGNED);
+  }
+
+
+  APInt getUnsignedRangeMin(const SCEV *S) {
+    return getRangeRef(S, HINT_RANGE_UNSIGNED).getUnsignedMin();
+  }
+
+
+  APInt getUnsignedRangeMax(const SCEV *S) {
+    return getRangeRef(S, HINT_RANGE_UNSIGNED).getUnsignedMax();
+  }
+
+
+
+  ConstantRange getSignedRange(const SCEV *S) {
+    return getRangeRef(S, HINT_RANGE_SIGNED);
+  }
+
+
+  APInt getSignedRangeMin(const SCEV *S) {
+    return getRangeRef(S, HINT_RANGE_SIGNED).getSignedMin();
+  }
+
+
+  APInt getSignedRangeMax(const SCEV *S) {
+    return getRangeRef(S, HINT_RANGE_SIGNED).getSignedMax();
+  }
+
+
+  bool isKnownNegative(const SCEV *S);
+
+
+  bool isKnownPositive(const SCEV *S);
+
+
+  bool isKnownNonNegative(const SCEV *S);
+
+
+  bool isKnownNonPositive(const SCEV *S);
+
+
+  bool isKnownNonZero(const SCEV *S);
+
+
+
+  bool isKnownPredicate(ICmpInst::Predicate Pred, const SCEV *LHS,
+                        const SCEV *RHS);
+  bool isMonotonicPredicate(const SCEVAddRecExpr *LHS, ICmpInst::Predicate Pred,
+                            bool &Increasing);
+
+
+
+
+
+  bool isLoopInvariantPredicate(ICmpInst::Predicate Pred, const SCEV *LHS,
+                                const SCEV *RHS, const Loop *L,
+                                ICmpInst::Predicate &InvariantPred,
+                                const SCEV *&InvariantLHS,
+                                const SCEV *&InvariantRHS);
+
+
+
+
+
+  bool SimplifyICmpOperands(ICmpInst::Predicate &Pred, const SCEV *&LHS,
+                            const SCEV *&RHS, unsigned Depth = 0);
+
+
+
+  LoopDisposition getLoopDisposition(const SCEV *S, const Loop *L);
+
+
+
+  bool isLoopInvariant(const SCEV *S, const Loop *L);
+
+
+
+
+  bool isAvailableAtLoopEntry(const SCEV *S, const Loop *L);
+
+
+
+
+
+  bool hasComputableLoopEvolution(const SCEV *S, const Loop *L);
+
+
+
+  BlockDisposition getBlockDisposition(const SCEV *S, const BasicBlock *BB);
+
+
+
+  bool dominates(const SCEV *S, const BasicBlock *BB);
+
+
+
+  bool properlyDominates(const SCEV *S, const BasicBlock *BB);
+
+
+  bool hasOperand(const SCEV *S, const SCEV *Op) const;
+
+
+  const SCEV *getElementSize(Instruction *Inst);
+
+
+
+
+  void findArrayDimensions(SmallVectorImpl<const SCEV *> &Terms,
+                           SmallVectorImpl<const SCEV *> &Sizes,
+                           const SCEV *ElementSize);
+
+  void print(raw_ostream &OS) const;
+  void verify() const;
+  bool invalidate(Function &F, const PreservedAnalyses &PA,
+                  FunctionAnalysisManager::Invalidator &Inv);
+
+
+
+  void collectParametricTerms(const SCEV *Expr,
+                              SmallVectorImpl<const SCEV *> &Terms);
+
+
+
+  void computeAccessFunctions(const SCEV *Expr,
+                              SmallVectorImpl<const SCEV *> &Subscripts,
+                              SmallVectorImpl<const SCEV *> &Sizes);
+  void delinearize(const SCEV *Expr, SmallVectorImpl<const SCEV *> &Subscripts,
+                   SmallVectorImpl<const SCEV *> &Sizes,
+                   const SCEV *ElementSize);
+
+
+
+  const DataLayout &getDataLayout() const {
+    return F.getParent()->getDataLayout();
+  }
+
+  const SCEVPredicate *getEqualPredicate(const SCEV *LHS, const SCEV *RHS);
+
+  const SCEVPredicate *
+  getWrapPredicate(const SCEVAddRecExpr *AR,
+                   SCEVWrapPredicate::IncrementWrapFlags AddedFlags);
+
+
+  const SCEV *rewriteUsingPredicate(const SCEV *S, const Loop *L,
+                                    SCEVUnionPredicate &A);
+
+
+  const SCEVAddRecExpr *convertSCEVToAddRecWithPredicates(
+      const SCEV *S, const Loop *L,
+      SmallPtrSetImpl<const SCEVPredicate *> &Preds);
+
+private:
+
+
+  class SCEVCallbackVH final : public CallbackVH {
+    ScalarEvolution *SE;
+
+    void deleted() override;
+    void allUsesReplacedWith(Value *New) override;
+
+  public:
+    SCEVCallbackVH(Value *V, ScalarEvolution *SE = nullptr);
+  };
+
+  friend class SCEVCallbackVH;
+  friend class SCEVExpander;
+  friend class SCEVUnknown;
+
+
+  Function &F;
+
+
+
+
+  bool HasGuards;
+
+
+  TargetLibraryInfo &TLI;
+
+
+  AssumptionCache &AC;
+
+
+  DominatorTree &DT;
+
+
+  LoopInfo &LI;
+
+
+  std::unique_ptr<SCEVCouldNotCompute> CouldNotCompute;
+
+
+  using HasRecMapType = DenseMap<const SCEV *, bool>;
+
+
+  HasRecMapType HasRecMap;
+
+
+  using ValueOffsetPair = std::pair<Value *, ConstantInt *>;
+  using ExprValueMapType = DenseMap<const SCEV *, SetVector<ValueOffsetPair>>;
+  ExprValueMapType ExprValueMap;
+
+
+  using ValueExprMapType =
+      DenseMap<SCEVCallbackVH, const SCEV *, DenseMapInfo<Value *>>;
+
+
+  ValueExprMapType ValueExprMap;
+
+
+  SmallPtrSet<Value *, 6> PendingLoopPredicates;
+
+
+
+  bool WalkingBEDominatingConds = false;
+
+
+
+  bool ProvingSplitPredicate = false;
+
+
+  DenseMap<const SCEV *, uint32_t> MinTrailingZerosCache;
+
+
+  SetVector<ValueOffsetPair> *getSCEVValues(const SCEV *S);
+
+
+  uint32_t GetMinTrailingZerosImpl(const SCEV *S);
+
+
+
+
+
+  struct ExitLimit {
+    const SCEV *ExactNotTaken;
+    const SCEV *MaxNotTaken;
+
+
+    bool MaxOrZero = false;
+
+
+
+
+    SmallPtrSet<const SCEVPredicate *, 4> Predicates;
+
+    void addPredicate(const SCEVPredicate *P) {
+      
+     ((
+     !isa<SCEVUnionPredicate>(P) && "Only add leaf predicates here!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "!isa<SCEVUnionPredicate>(P) && \"Only add leaf predicates here!\""
+     , "/home/trippels/llvm/llvm/include/llvm/Analysis/ScalarEvolution.h", 1131, __PRETTY_FUNCTION__))
+                                                                            ;
+      Predicates.insert(P);
+    }
+
+                 ExitLimit(const SCEV *E);
+
+    ExitLimit(
+        const SCEV *E, const SCEV *M, bool MaxOrZero,
+        ArrayRef<const SmallPtrSetImpl<const SCEVPredicate *> *> PredSetList);
+
+    ExitLimit(const SCEV *E, const SCEV *M, bool MaxOrZero,
+              const SmallPtrSetImpl<const SCEVPredicate *> &PredSet);
+
+    ExitLimit(const SCEV *E, const SCEV *M, bool MaxOrZero);
+
+
+
+    bool hasAnyInfo() const {
+      return !isa<SCEVCouldNotCompute>(ExactNotTaken) ||
+             !isa<SCEVCouldNotCompute>(MaxNotTaken);
+    }
+
+    bool hasOperand(const SCEV *S) const;
+
+
+    bool hasFullInfo() const {
+      return !isa<SCEVCouldNotCompute>(ExactNotTaken);
+    }
+  };
+
+
+
+  struct ExitNotTakenInfo {
+    PoisoningVH<BasicBlock> ExitingBlock;
+    const SCEV *ExactNotTaken;
+    std::unique_ptr<SCEVUnionPredicate> Predicate;
+
+    explicit ExitNotTakenInfo(PoisoningVH<BasicBlock> ExitingBlock,
+                              const SCEV *ExactNotTaken,
+                              std::unique_ptr<SCEVUnionPredicate> Predicate)
+        : ExitingBlock(ExitingBlock), ExactNotTaken(ExactNotTaken),
+          Predicate(std::move(Predicate)) {}
+
+    bool hasAlwaysTruePredicate() const {
+      return !Predicate || Predicate->isAlwaysTrue();
+    }
+  };
+
+
+
+
+  class BackedgeTakenInfo {
+
+
+    SmallVector<ExitNotTakenInfo, 1> ExitNotTaken;
+    PointerIntPair<const SCEV *, 1> MaxAndComplete;
+
+
+    bool MaxOrZero = false;
+
+
+
+    bool isComplete() const { return MaxAndComplete.getInt(); }
+    const SCEV *getMax() const { return MaxAndComplete.getPointer(); }
+
+
+  public:
+    BackedgeTakenInfo() : MaxAndComplete(nullptr, 0) {}
+    BackedgeTakenInfo(BackedgeTakenInfo &&) = default;
+    BackedgeTakenInfo &operator=(BackedgeTakenInfo &&) = default;
+
+    using EdgeExitInfo = std::pair<BasicBlock *, ExitLimit>;
+
+
+    BackedgeTakenInfo(SmallVectorImpl<EdgeExitInfo> &&ExitCounts, bool Complete,
+                      const SCEV *MaxCount, bool MaxOrZero);
+
+
+
+    bool hasAnyInfo() const {
+      return !ExitNotTaken.empty() || !isa<SCEVCouldNotCompute>(getMax());
+    }
+
+
+    bool hasFullInfo() const { return isComplete(); }
+    const SCEV *getExact(ScalarEvolution *SE,
+                         SCEVUnionPredicate *Predicates = nullptr) const;
+
+
+
+
+
+    const SCEV *getExact(BasicBlock *ExitingBlock, ScalarEvolution *SE) const;
+
+
+    const SCEV *getMax(ScalarEvolution *SE) const;
+
+
+
+    bool isMaxOrZero(ScalarEvolution *SE) const;
+
+
+
+    bool hasOperand(const SCEV *S, ScalarEvolution *SE) const;
+
+
+    void clear();
+  };
+
+
+
+  DenseMap<const Loop *, BackedgeTakenInfo> BackedgeTakenCounts;
+
+
+
+  DenseMap<const Loop *, BackedgeTakenInfo> PredicatedBackedgeTakenCounts;
+
+
+
+
+
+  DenseMap<PHINode *, Constant *> ConstantEvolutionLoopExitValue;
+
+
+
+
+  DenseMap<const SCEV *, SmallVector<std::pair<const Loop *, const SCEV *>, 2>>
+      ValuesAtScopes;
+
+
+  DenseMap<const SCEV *,
+           SmallVector<PointerIntPair<const Loop *, 2, LoopDisposition>, 2>>
+      LoopDispositions;
+
+  struct LoopProperties {
+
+
+    bool HasNoAbnormalExits;
+
+
+
+
+
+
+    bool HasNoSideEffects;
+  };
+
+
+  DenseMap<const Loop *, LoopProperties> LoopPropertiesCache;
+
+
+  LoopProperties getLoopProperties(const Loop *L);
+
+  bool loopHasNoSideEffects(const Loop *L) {
+    return getLoopProperties(L).HasNoSideEffects;
+  }
+
+  bool loopHasNoAbnormalExits(const Loop *L) {
+    return getLoopProperties(L).HasNoAbnormalExits;
+  }
+
+
+  LoopDisposition computeLoopDisposition(const SCEV *S, const Loop *L);
+
+
+  DenseMap<
+      const SCEV *,
+      SmallVector<PointerIntPair<const BasicBlock *, 2, BlockDisposition>, 2>>
+      BlockDispositions;
+
+
+  BlockDisposition computeBlockDisposition(const SCEV *S, const BasicBlock *BB);
+
+
+  DenseMap<const SCEV *, ConstantRange> UnsignedRanges;
+
+
+  DenseMap<const SCEV *, ConstantRange> SignedRanges;
+
+
+  enum RangeSignHint { HINT_RANGE_UNSIGNED, HINT_RANGE_SIGNED };
+
+
+  const ConstantRange &setRange(const SCEV *S, RangeSignHint Hint,
+                                ConstantRange CR) {
+    DenseMap<const SCEV *, ConstantRange> &Cache =
+        Hint == HINT_RANGE_UNSIGNED ? UnsignedRanges : SignedRanges;
+
+    auto Pair = Cache.try_emplace(S, std::move(CR));
+    if (!Pair.second)
+      Pair.first->second = std::move(CR);
+    return Pair.first->second;
+  }
+
+
+
+
+  const ConstantRange &getRangeRef(const SCEV *S, RangeSignHint Hint);
+
+
+
+  ConstantRange getRangeForAffineAR(const SCEV *Start, const SCEV *Stop,
+                                    const SCEV *MaxBECount, unsigned BitWidth);
+
+
+
+
+  ConstantRange getRangeViaFactoring(const SCEV *Start, const SCEV *Stop,
+                                     const SCEV *MaxBECount, unsigned BitWidth);
+
+
+
+  const SCEV *createSCEV(Value *V);
+
+
+  const SCEV *createNodeForPHI(PHINode *PN);
+
+
+  const SCEV *createAddRecFromPHI(PHINode *PN);
+
+
+  const SCEV *createSimpleAffineAddRec(PHINode *PN, Value *BEValueV,
+                                            Value *StartValueV);
+
+
+  const SCEV *createNodeFromSelectLikePHI(PHINode *PN);
+
+
+
+
+
+  const SCEV *createNodeForSelectOrPHI(Instruction *I, Value *Cond,
+                                       Value *TrueVal, Value *FalseVal);
+
+
+  const SCEV *createNodeForGEP(GEPOperator *GEP);
+
+
+
+  const SCEV *computeSCEVAtScope(const SCEV *S, const Loop *L);
+
+
+
+
+  void forgetSymbolicName(Instruction *I, const SCEV *SymName);
+
+
+
+
+  const BackedgeTakenInfo &getBackedgeTakenInfo(const Loop *L);
+
+
+
+  const BackedgeTakenInfo &getPredicatedBackedgeTakenInfo(const Loop *L);
+
+
+
+
+  BackedgeTakenInfo computeBackedgeTakenCount(const Loop *L,
+                                              bool AllowPredicates = false);
+
+
+
+
+
+  ExitLimit computeExitLimit(const Loop *L, BasicBlock *ExitingBlock,
+                             bool AllowPredicates = false);
+  ExitLimit computeExitLimitFromCond(const Loop *L, Value *ExitCond,
+                                     BasicBlock *TBB, BasicBlock *FBB,
+                                     bool ControlsExit,
+                                     bool AllowPredicates = false);
+
+
+
+
+  class ExitLimitCache {
+
+
+
+
+
+    SmallDenseMap<PointerIntPair<Value *, 1>, ExitLimit> TripCountMap;
+
+    const Loop *L;
+    BasicBlock *TBB;
+    BasicBlock *FBB;
+    bool AllowPredicates;
+
+  public:
+    ExitLimitCache(const Loop *L, BasicBlock *TBB, BasicBlock *FBB,
+                   bool AllowPredicates)
+        : L(L), TBB(TBB), FBB(FBB), AllowPredicates(AllowPredicates) {}
+
+    Optional<ExitLimit> find(const Loop *L, Value *ExitCond, BasicBlock *TBB,
+                             BasicBlock *FBB, bool ControlsExit,
+                             bool AllowPredicates);
+
+    void insert(const Loop *L, Value *ExitCond, BasicBlock *TBB,
+                BasicBlock *FBB, bool ControlsExit, bool AllowPredicates,
+                const ExitLimit &EL);
+  };
+
+  using ExitLimitCacheTy = ExitLimitCache;
+
+  ExitLimit computeExitLimitFromCondCached(ExitLimitCacheTy &Cache,
+                                           const Loop *L, Value *ExitCond,
+                                           BasicBlock *TBB, BasicBlock *FBB,
+                                           bool ControlsExit,
+                                           bool AllowPredicates);
+  ExitLimit computeExitLimitFromCondImpl(ExitLimitCacheTy &Cache, const Loop *L,
+                                         Value *ExitCond, BasicBlock *TBB,
+                                         BasicBlock *FBB, bool ControlsExit,
+                                         bool AllowPredicates);
+
+
+
+
+
+
+  ExitLimit computeExitLimitFromICmp(const Loop *L, ICmpInst *ExitCond,
+                                     BasicBlock *TBB, BasicBlock *FBB,
+                                     bool IsSubExpr,
+                                     bool AllowPredicates = false);
+
+
+
+
+  ExitLimit computeExitLimitFromSingleExitSwitch(const Loop *L,
+                                                 SwitchInst *Switch,
+                                                 BasicBlock *ExitingBB,
+                                                 bool IsSubExpr);
+
+
+
+  ExitLimit computeLoadConstantCompareExitLimit(LoadInst *LI, Constant *RHS,
+                                                const Loop *L,
+                                                ICmpInst::Predicate p);
+  ExitLimit computeShiftCompareExitLimit(Value *LHS, Value *RHS, const Loop *L,
+                                         ICmpInst::Predicate Pred);
+
+
+
+
+
+
+  const SCEV *computeExitCountExhaustively(const Loop *L, Value *Cond,
+                                           bool ExitWhen);
+
+
+
+
+
+  ExitLimit howFarToZero(const SCEV *V, const Loop *L, bool IsSubExpr,
+                         bool AllowPredicates = false);
+
+
+
+
+  ExitLimit howFarToNonZero(const SCEV *V, const Loop *L);
+  ExitLimit howManyLessThans(const SCEV *LHS, const SCEV *RHS, const Loop *L,
+                             bool isSigned, bool ControlsExit,
+                             bool AllowPredicates = false);
+
+  ExitLimit howManyGreaterThans(const SCEV *LHS, const SCEV *RHS, const Loop *L,
+                                bool isSigned, bool IsSubExpr,
+                                bool AllowPredicates = false);
+
+
+
+
+  std::pair<BasicBlock *, BasicBlock *>
+  getPredecessorWithUniqueSuccessorForBB(BasicBlock *BB);
+
+
+
+  bool isImpliedCond(ICmpInst::Predicate Pred, const SCEV *LHS, const SCEV *RHS,
+                     Value *FoundCondValue, bool Inverse);
+
+
+
+
+  bool isImpliedCond(ICmpInst::Predicate Pred, const SCEV *LHS, const SCEV *RHS,
+                     ICmpInst::Predicate FoundPred, const SCEV *FoundLHS,
+                     const SCEV *FoundRHS);
+
+
+
+
+  bool isImpliedCondOperands(ICmpInst::Predicate Pred, const SCEV *LHS,
+                             const SCEV *RHS, const SCEV *FoundLHS,
+                             const SCEV *FoundRHS);
+
+
+
+
+
+  bool isImpliedViaOperations(ICmpInst::Predicate Pred,
+                              const SCEV *LHS, const SCEV *RHS,
+                              const SCEV *FoundLHS, const SCEV *FoundRHS,
+                              unsigned Depth = 0);
+
+
+
+  bool isKnownViaSimpleReasoning(ICmpInst::Predicate Pred,
+                                 const SCEV *LHS, const SCEV *RHS);
+
+
+
+
+  bool isImpliedCondOperandsHelper(ICmpInst::Predicate Pred, const SCEV *LHS,
+                                   const SCEV *RHS, const SCEV *FoundLHS,
+                                   const SCEV *FoundRHS);
+
+
+
+
+
+  bool isImpliedCondOperandsViaRanges(ICmpInst::Predicate Pred, const SCEV *LHS,
+                                      const SCEV *RHS, const SCEV *FoundLHS,
+                                      const SCEV *FoundRHS);
+
+
+
+  bool isImpliedViaGuard(BasicBlock *BB, ICmpInst::Predicate Pred,
+                         const SCEV *LHS, const SCEV *RHS);
+
+
+
+
+
+
+
+  bool isImpliedCondOperandsViaNoOverflow(ICmpInst::Predicate Pred,
+                                          const SCEV *LHS, const SCEV *RHS,
+                                          const SCEV *FoundLHS,
+                                          const SCEV *FoundRHS);
+
+
+
+
+  Constant *getConstantEvolutionLoopExitValue(PHINode *PN, const APInt &BEs,
+                                              const Loop *L);
+
+
+
+  bool isKnownPredicateViaConstantRanges(ICmpInst::Predicate Pred,
+                                         const SCEV *LHS, const SCEV *RHS);
+
+
+
+
+
+
+  bool isKnownPredicateViaNoOverflow(ICmpInst::Predicate Pred, const SCEV *LHS,
+                                     const SCEV *RHS);
+
+
+
+  bool isKnownPredicateViaSplitting(ICmpInst::Predicate Pred, const SCEV *LHS,
+                                    const SCEV *RHS);
+
+
+  bool splitBinaryAdd(const SCEV *Expr, const SCEV *&L, const SCEV *&R,
+                      SCEV::NoWrapFlags &Flags);
+  Optional<APInt> computeConstantDifference(const SCEV *LHS, const SCEV *RHS);
+
+
+  void forgetMemoizedResults(const SCEV *S);
+
+
+  const SCEV *getExistingSCEV(Value *V);
+
+
+
+  bool checkValidity(const SCEV *S) const;
+
+
+
+
+
+
+  template <typename ExtendOpTy>
+  bool proveNoWrapByVaryingStart(const SCEV *Start, const SCEV *Step,
+                                 const Loop *L);
+
+
+  SCEV::NoWrapFlags proveNoWrapViaConstantRanges(const SCEVAddRecExpr *AR);
+
+  bool isMonotonicPredicateImpl(const SCEVAddRecExpr *LHS,
+                                ICmpInst::Predicate Pred, bool &Increasing);
+
+
+
+
+  SCEV::NoWrapFlags getNoWrapFlagsFromUB(const Value *V);
+  bool isSCEVExprNeverPoison(const Instruction *I);
+
+
+
+
+
+  bool isAddRecNeverPoison(const Instruction *I, const Loop *L);
+  Optional<std::pair<const SCEV *, SmallVector<const SCEVPredicate *, 3>>>
+  createAddRecFromPHIWithCastsImpl(const SCEVUnknown *SymbolicPHI);
+
+
+
+  const SCEV *computeBECount(const SCEV *Delta, const SCEV *Stride,
+                             bool Equality);
+
+
+
+
+
+
+
+  const SCEV *computeMaxBECountForLT(const SCEV *Start, const SCEV *Stride,
+                                     const SCEV *End, unsigned BitWidth,
+                                     bool IsSigned);
+
+
+
+
+  bool doesIVOverflowOnLT(const SCEV *RHS, const SCEV *Stride, bool IsSigned,
+                          bool NoWrap);
+
+
+
+
+  bool doesIVOverflowOnGT(const SCEV *RHS, const SCEV *Stride, bool IsSigned,
+                          bool NoWrap);
+
+
+  const SCEV *getOrCreateAddExpr(SmallVectorImpl<const SCEV *> &Ops,
+                                 SCEV::NoWrapFlags Flags);
+
+
+  const SCEV *getOrCreateMulExpr(SmallVectorImpl<const SCEV *> &Ops,
+                                 SCEV::NoWrapFlags Flags);
+
+
+
+  void addToLoopUseLists(const SCEV *S);
+
+  FoldingSet<SCEV> UniqueSCEVs;
+  FoldingSet<SCEVPredicate> UniquePreds;
+  BumpPtrAllocator SCEVAllocator;
+
+
+
+  DenseMap<const Loop *, SmallVector<const SCEV *, 4>> LoopUsers;
+
+
+
+  DenseMap<std::pair<const SCEVUnknown *, const Loop *>,
+           std::pair<const SCEV *, SmallVector<const SCEVPredicate *, 3>>>
+      PredicatedSCEVRewrites;
+
+
+
+
+  SCEVUnknown *FirstUnknown = nullptr;
+};
+
+
+class ScalarEvolutionAnalysis
+    : public AnalysisInfoMixin<ScalarEvolutionAnalysis> {
+  friend AnalysisInfoMixin<ScalarEvolutionAnalysis>;
+
+  static AnalysisKey Key;
+
+public:
+  using Result = ScalarEvolution;
+
+  ScalarEvolution run(Function &F, FunctionAnalysisManager &AM);
+};
+
+
+class ScalarEvolutionPrinterPass
+    : public PassInfoMixin<ScalarEvolutionPrinterPass> {
+  raw_ostream &OS;
+
+public:
+  explicit ScalarEvolutionPrinterPass(raw_ostream &OS) : OS(OS) {}
+
+  PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
+};
+
+class ScalarEvolutionWrapperPass : public FunctionPass {
+  std::unique_ptr<ScalarEvolution> SE;
+
+public:
+  static char ID;
+
+  ScalarEvolutionWrapperPass();
+
+  ScalarEvolution &getSE() { return *SE; }
+  const ScalarEvolution &getSE() const { return *SE; }
+
+  bool runOnFunction(Function &F) override;
+  void releaseMemory() override;
+  void getAnalysisUsage(AnalysisUsage &AU) const override;
+  void print(raw_ostream &OS, const Module * = nullptr) const override;
+  void verifyAnalysis() const override;
+};
+class PredicatedScalarEvolution {
+public:
+  PredicatedScalarEvolution(ScalarEvolution &SE, Loop &L);
+
+  const SCEVUnionPredicate &getUnionPredicate() const;
+
+
+
+
+
+  const SCEV *getSCEV(Value *V);
+
+
+  const SCEV *getBackedgeTakenCount();
+
+
+  void addPredicate(const SCEVPredicate &Pred);
+
+
+
+
+
+  const SCEVAddRecExpr *getAsAddRec(Value *V);
+
+
+  void setNoOverflow(Value *V, SCEVWrapPredicate::IncrementWrapFlags Flags);
+
+
+
+  bool hasNoOverflow(Value *V, SCEVWrapPredicate::IncrementWrapFlags Flags);
+
+
+  ScalarEvolution *getSE() const { return &SE; }
+
+
+  PredicatedScalarEvolution(const PredicatedScalarEvolution &);
+
+
+
+  void print(raw_ostream &OS, unsigned Depth) const;
+
+
+
+  bool areAddRecsEqualWithPreds(const SCEVAddRecExpr *AR1,
+                                const SCEVAddRecExpr *AR2) const;
+
+private:
+
+
+  void updateGeneration();
+
+
+
+  using RewriteEntry = std::pair<unsigned, const SCEV *>;
+
+
+
+
+
+
+  DenseMap<const SCEV *, RewriteEntry> RewriteMap;
+
+
+  ValueMap<Value *, SCEVWrapPredicate::IncrementWrapFlags> FlagsMap;
+
+
+  ScalarEvolution &SE;
+
+
+  const Loop &L;
+
+
+
+  SCEVUnionPredicate Preds;
+
+
+
+
+
+  unsigned Generation = 0;
+
+
+  const SCEV *BackedgeCount = nullptr;
+};
+
+}
+
+
+
+
+
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+namespace llvm {
+
+class APInt;
+class Constant;
+class ConstantRange;
+class Loop;
+class Type;
+
+  enum SCEVTypes {
+
+
+    scConstant, scTruncate, scZeroExtend, scSignExtend, scAddExpr, scMulExpr,
+    scUDivExpr, scAddRecExpr, scUMaxExpr, scSMaxExpr,
+    scUnknown, scCouldNotCompute
+  };
+
+
+  class SCEVConstant : public SCEV {
+    friend class ScalarEvolution;
+
+    ConstantInt *V;
+
+    SCEVConstant(const FoldingSetNodeIDRef ID, ConstantInt *v) :
+      SCEV(ID, scConstant), V(v) {}
+
+  public:
+    ConstantInt *getValue() const { return V; }
+    const APInt &getAPInt() const { return getValue()->getValue(); }
+
+    Type *getType() const { return V->getType(); }
+
+
+    static bool classof(const SCEV *S) {
+      return S->getSCEVType() == scConstant;
+    }
+  };
+
+
+  class SCEVCastExpr : public SCEV {
+  protected:
+    const SCEV *Op;
+    Type *Ty;
+
+    SCEVCastExpr(const FoldingSetNodeIDRef ID,
+                 unsigned SCEVTy, const SCEV *op, Type *ty);
+
+  public:
+    const SCEV *getOperand() const { return Op; }
+    Type *getType() const { return Ty; }
+
+
+    static bool classof(const SCEV *S) {
+      return S->getSCEVType() == scTruncate ||
+             S->getSCEVType() == scZeroExtend ||
+             S->getSCEVType() == scSignExtend;
+    }
+  };
+
+
+
+  class SCEVTruncateExpr : public SCEVCastExpr {
+    friend class ScalarEvolution;
+
+    SCEVTruncateExpr(const FoldingSetNodeIDRef ID,
+                     const SCEV *op, Type *ty);
+
+  public:
+
+    static bool classof(const SCEV *S) {
+      return S->getSCEVType() == scTruncate;
+    }
+  };
+
+
+
+  class SCEVZeroExtendExpr : public SCEVCastExpr {
+    friend class ScalarEvolution;
+
+    SCEVZeroExtendExpr(const FoldingSetNodeIDRef ID,
+                       const SCEV *op, Type *ty);
+
+  public:
+
+    static bool classof(const SCEV *S) {
+      return S->getSCEVType() == scZeroExtend;
+    }
+  };
+
+
+
+  class SCEVSignExtendExpr : public SCEVCastExpr {
+    friend class ScalarEvolution;
+
+    SCEVSignExtendExpr(const FoldingSetNodeIDRef ID,
+                       const SCEV *op, Type *ty);
+
+  public:
+
+    static bool classof(const SCEV *S) {
+      return S->getSCEVType() == scSignExtend;
+    }
+  };
+
+
+
+  class SCEVNAryExpr : public SCEV {
+  protected:
+
+
+
+
+    const SCEV *const *Operands;
+    size_t NumOperands;
+
+    SCEVNAryExpr(const FoldingSetNodeIDRef ID,
+                 enum SCEVTypes T, const SCEV *const *O, size_t N)
+      : SCEV(ID, T), Operands(O), NumOperands(N) {}
+
+  public:
+    size_t getNumOperands() const { return NumOperands; }
+
+    const SCEV *getOperand(unsigned i) const {
+      
+     ((
+     i < NumOperands && "Operand index out of range!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "i < NumOperands && \"Operand index out of range!\""
+     , "/home/trippels/llvm/llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h", 153, __PRETTY_FUNCTION__))
+                                                             ;
+      return Operands[i];
+    }
+
+    using op_iterator = const SCEV *const *;
+    using op_range = iterator_range<op_iterator>;
+
+    op_iterator op_begin() const { return Operands; }
+    op_iterator op_end() const { return Operands + NumOperands; }
+    op_range operands() const {
+      return make_range(op_begin(), op_end());
+    }
+
+    Type *getType() const { return getOperand(0)->getType(); }
+
+    NoWrapFlags getNoWrapFlags(NoWrapFlags Mask = NoWrapMask) const {
+      return (NoWrapFlags)(SubclassData & Mask);
+    }
+
+    bool hasNoUnsignedWrap() const {
+      return getNoWrapFlags(FlagNUW) != FlagAnyWrap;
+    }
+
+    bool hasNoSignedWrap() const {
+      return getNoWrapFlags(FlagNSW) != FlagAnyWrap;
+    }
+
+    bool hasNoSelfWrap() const {
+      return getNoWrapFlags(FlagNW) != FlagAnyWrap;
+    }
+
+
+    static bool classof(const SCEV *S) {
+      return S->getSCEVType() == scAddExpr ||
+             S->getSCEVType() == scMulExpr ||
+             S->getSCEVType() == scSMaxExpr ||
+             S->getSCEVType() == scUMaxExpr ||
+             S->getSCEVType() == scAddRecExpr;
+    }
+  };
+
+
+  class SCEVCommutativeExpr : public SCEVNAryExpr {
+  protected:
+    SCEVCommutativeExpr(const FoldingSetNodeIDRef ID,
+                        enum SCEVTypes T, const SCEV *const *O, size_t N)
+      : SCEVNAryExpr(ID, T, O, N) {}
+
+  public:
+
+    static bool classof(const SCEV *S) {
+      return S->getSCEVType() == scAddExpr ||
+             S->getSCEVType() == scMulExpr ||
+             S->getSCEVType() == scSMaxExpr ||
+             S->getSCEVType() == scUMaxExpr;
+    }
+
+
+    void setNoWrapFlags(NoWrapFlags Flags) {
+      SubclassData |= Flags;
+    }
+  };
+
+
+  class SCEVAddExpr : public SCEVCommutativeExpr {
+    friend class ScalarEvolution;
+
+    SCEVAddExpr(const FoldingSetNodeIDRef ID,
+                const SCEV *const *O, size_t N)
+      : SCEVCommutativeExpr(ID, scAddExpr, O, N) {}
+
+  public:
+    Type *getType() const {
+
+
+
+      return getOperand(getNumOperands() - 1)->getType();
+    }
+
+
+    static bool classof(const SCEV *S) {
+      return S->getSCEVType() == scAddExpr;
+    }
+  };
+
+
+  class SCEVMulExpr : public SCEVCommutativeExpr {
+    friend class ScalarEvolution;
+
+    SCEVMulExpr(const FoldingSetNodeIDRef ID,
+                const SCEV *const *O, size_t N)
+      : SCEVCommutativeExpr(ID, scMulExpr, O, N) {}
+
+  public:
+
+    static bool classof(const SCEV *S) {
+      return S->getSCEVType() == scMulExpr;
+    }
+  };
+
+
+  class SCEVUDivExpr : public SCEV {
+    friend class ScalarEvolution;
+
+    const SCEV *LHS;
+    const SCEV *RHS;
+
+    SCEVUDivExpr(const FoldingSetNodeIDRef ID, const SCEV *lhs, const SCEV *rhs)
+      : SCEV(ID, scUDivExpr), LHS(lhs), RHS(rhs) {}
+
+  public:
+    const SCEV *getLHS() const { return LHS; }
+    const SCEV *getRHS() const { return RHS; }
+
+    Type *getType() const {
+
+
+
+
+
+      return getRHS()->getType();
+    }
+
+
+    static bool classof(const SCEV *S) {
+      return S->getSCEVType() == scUDivExpr;
+    }
+  };
+  class SCEVAddRecExpr : public SCEVNAryExpr {
+    friend class ScalarEvolution;
+
+    const Loop *L;
+
+    SCEVAddRecExpr(const FoldingSetNodeIDRef ID,
+                   const SCEV *const *O, size_t N, const Loop *l)
+      : SCEVNAryExpr(ID, scAddRecExpr, O, N), L(l) {}
+
+  public:
+    const SCEV *getStart() const { return Operands[0]; }
+    const Loop *getLoop() const { return L; }
+
+
+
+
+
+    const SCEV *getStepRecurrence(ScalarEvolution &SE) const {
+      if (isAffine()) return getOperand(1);
+      return SE.getAddRecExpr(SmallVector<const SCEV *, 3>(op_begin()+1,
+                                                           op_end()),
+                              getLoop(), FlagAnyWrap);
+    }
+
+
+
+    bool isAffine() const {
+
+
+      return getNumOperands() == 2;
+    }
+
+
+
+
+    bool isQuadratic() const {
+      return getNumOperands() == 3;
+    }
+
+
+
+
+    void setNoWrapFlags(NoWrapFlags Flags) {
+      if (Flags & (FlagNUW | FlagNSW))
+        Flags = ScalarEvolution::setFlags(Flags, FlagNW);
+      SubclassData |= Flags;
+    }
+
+
+
+    const SCEV *evaluateAtIteration(const SCEV *It, ScalarEvolution &SE) const;
+
+
+
+
+
+
+
+    const SCEV *getNumIterationsInRange(const ConstantRange &Range,
+                                        ScalarEvolution &SE) const;
+
+
+
+    const SCEVAddRecExpr *getPostIncExpr(ScalarEvolution &SE) const {
+      return cast<SCEVAddRecExpr>(SE.getAddExpr(this, getStepRecurrence(SE)));
+    }
+
+
+    static bool classof(const SCEV *S) {
+      return S->getSCEVType() == scAddRecExpr;
+    }
+  };
+
+
+  class SCEVSMaxExpr : public SCEVCommutativeExpr {
+    friend class ScalarEvolution;
+
+    SCEVSMaxExpr(const FoldingSetNodeIDRef ID,
+                 const SCEV *const *O, size_t N)
+      : SCEVCommutativeExpr(ID, scSMaxExpr, O, N) {
+
+      setNoWrapFlags((NoWrapFlags)(FlagNUW | FlagNSW));
+    }
+
+  public:
+
+    static bool classof(const SCEV *S) {
+      return S->getSCEVType() == scSMaxExpr;
+    }
+  };
+
+
+  class SCEVUMaxExpr : public SCEVCommutativeExpr {
+    friend class ScalarEvolution;
+
+    SCEVUMaxExpr(const FoldingSetNodeIDRef ID,
+                 const SCEV *const *O, size_t N)
+      : SCEVCommutativeExpr(ID, scUMaxExpr, O, N) {
+
+      setNoWrapFlags((NoWrapFlags)(FlagNUW | FlagNSW));
+    }
+
+  public:
+
+    static bool classof(const SCEV *S) {
+      return S->getSCEVType() == scUMaxExpr;
+    }
+  };
+
+
+
+
+  class SCEVUnknown final : public SCEV, private CallbackVH {
+    friend class ScalarEvolution;
+
+
+
+
+    ScalarEvolution *SE;
+
+
+
+    SCEVUnknown *Next;
+
+    SCEVUnknown(const FoldingSetNodeIDRef ID, Value *V,
+                ScalarEvolution *se, SCEVUnknown *next) :
+      SCEV(ID, scUnknown), CallbackVH(V), SE(se), Next(next) {}
+
+
+    void deleted() override;
+    void allUsesReplacedWith(Value *New) override;
+
+  public:
+    Value *getValue() const { return getValPtr(); }
+    bool isSizeOf(Type *&AllocTy) const;
+    bool isAlignOf(Type *&AllocTy) const;
+    bool isOffsetOf(Type *&STy, Constant *&FieldNo) const;
+
+
+    Type *getType() const { return getValPtr()->getType(); }
+
+
+    static bool classof(const SCEV *S) {
+      return S->getSCEVType() == scUnknown;
+    }
+  };
+
+
+
+  template<typename SC, typename RetVal=void>
+  struct SCEVVisitor {
+    RetVal visit(const SCEV *S) {
+      switch (S->getSCEVType()) {
+      case scConstant:
+        return ((SC*)this)->visitConstant((const SCEVConstant*)S);
+      case scTruncate:
+        return ((SC*)this)->visitTruncateExpr((const SCEVTruncateExpr*)S);
+      case scZeroExtend:
+        return ((SC*)this)->visitZeroExtendExpr((const SCEVZeroExtendExpr*)S);
+      case scSignExtend:
+        return ((SC*)this)->visitSignExtendExpr((const SCEVSignExtendExpr*)S);
+      case scAddExpr:
+        return ((SC*)this)->visitAddExpr((const SCEVAddExpr*)S);
+      case scMulExpr:
+        return ((SC*)this)->visitMulExpr((const SCEVMulExpr*)S);
+      case scUDivExpr:
+        return ((SC*)this)->visitUDivExpr((const SCEVUDivExpr*)S);
+      case scAddRecExpr:
+        return ((SC*)this)->visitAddRecExpr((const SCEVAddRecExpr*)S);
+      case scSMaxExpr:
+        return ((SC*)this)->visitSMaxExpr((const SCEVSMaxExpr*)S);
+      case scUMaxExpr:
+        return ((SC*)this)->visitUMaxExpr((const SCEVUMaxExpr*)S);
+      case scUnknown:
+        return ((SC*)this)->visitUnknown((const SCEVUnknown*)S);
+      case scCouldNotCompute:
+        return ((SC*)this)->visitCouldNotCompute((const SCEVCouldNotCompute*)S);
+      default:
+        ::llvm::llvm_unreachable_internal("Unknown SCEV type!", "/home/trippels/llvm/llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h", 476);
+      }
+    }
+
+    RetVal visitCouldNotCompute(const SCEVCouldNotCompute *S) {
+      ::llvm::llvm_unreachable_internal("Invalid use of SCEVCouldNotCompute!", "/home/trippels/llvm/llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h", 481);
+    }
+  };
+  template<typename SV>
+  class SCEVTraversal {
+    SV &Visitor;
+    SmallVector<const SCEV *, 8> Worklist;
+    SmallPtrSet<const SCEV *, 8> Visited;
+
+    void push(const SCEV *S) {
+      if (Visited.insert(S).second && Visitor.follow(S))
+        Worklist.push_back(S);
+    }
+
+  public:
+    SCEVTraversal(SV& V): Visitor(V) {}
+
+    void visitAll(const SCEV *Root) {
+      push(Root);
+      while (!Worklist.empty() && !Visitor.isDone()) {
+        const SCEV *S = Worklist.pop_back_val();
+
+        switch (S->getSCEVType()) {
+        case scConstant:
+        case scUnknown:
+          break;
+        case scTruncate:
+        case scZeroExtend:
+        case scSignExtend:
+          push(cast<SCEVCastExpr>(S)->getOperand());
+          break;
+        case scAddExpr:
+        case scMulExpr:
+        case scSMaxExpr:
+        case scUMaxExpr:
+        case scAddRecExpr:
+          for (const auto *Op : cast<SCEVNAryExpr>(S)->operands())
+            push(Op);
+          break;
+        case scUDivExpr: {
+          const SCEVUDivExpr *UDiv = cast<SCEVUDivExpr>(S);
+          push(UDiv->getLHS());
+          push(UDiv->getRHS());
+          break;
+        }
+        case scCouldNotCompute:
+          ::llvm::llvm_unreachable_internal("Attempt to use a SCEVCouldNotCompute object!", "/home/trippels/llvm/llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h", 535);
+        default:
+          ::llvm::llvm_unreachable_internal("Unknown SCEV kind!", "/home/trippels/llvm/llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h", 537);
+        }
+      }
+    }
+  };
+
+
+  template<typename SV>
+  void visitAll(const SCEV *Root, SV& Visitor) {
+    SCEVTraversal<SV> T(Visitor);
+    T.visitAll(Root);
+  }
+
+
+  template <typename PredTy>
+  bool SCEVExprContains(const SCEV *Root, PredTy Pred) {
+    struct FindClosure {
+      bool Found = false;
+      PredTy Pred;
+
+      FindClosure(PredTy Pred) : Pred(Pred) {}
+
+      bool follow(const SCEV *S) {
+        if (!Pred(S))
+          return true;
+
+        Found = true;
+        return false;
+      }
+
+      bool isDone() const { return Found; }
+    };
+
+    FindClosure FC(Pred);
+    visitAll(Root, FC);
+    return FC.Found;
+  }
+
+
+
+
+  template<typename SC>
+  class SCEVRewriteVisitor : public SCEVVisitor<SC, const SCEV *> {
+  protected:
+    ScalarEvolution &SE;
+
+
+
+
+
+    DenseMap<const SCEV *, const SCEV *> RewriteResults;
+
+  public:
+    SCEVRewriteVisitor(ScalarEvolution &SE) : SE(SE) {}
+
+    const SCEV *visit(const SCEV *S) {
+      auto It = RewriteResults.find(S);
+      if (It != RewriteResults.end())
+        return It->second;
+      auto* Visited = SCEVVisitor<SC, const SCEV *>::visit(S);
+      auto Result = RewriteResults.try_emplace(S, Visited);
+      
+     ((
+     Result.second && "Should insert a new entry"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "Result.second && \"Should insert a new entry\""
+     , "/home/trippels/llvm/llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h", 598, __PRETTY_FUNCTION__))
+                                                         ;
+      return Result.first->second;
+    }
+
+    const SCEV *visitConstant(const SCEVConstant *Constant) {
+      return Constant;
+    }
+
+    const SCEV *visitTruncateExpr(const SCEVTruncateExpr *Expr) {
+      const SCEV *Operand = ((SC*)this)->visit(Expr->getOperand());
+      return Operand == Expr->getOperand()
+                 ? Expr
+                 : SE.getTruncateExpr(Operand, Expr->getType());
+    }
+
+    const SCEV *visitZeroExtendExpr(const SCEVZeroExtendExpr *Expr) {
+      const SCEV *Operand = ((SC*)this)->visit(Expr->getOperand());
+      return Operand == Expr->getOperand()
+                 ? Expr
+                 : SE.getZeroExtendExpr(Operand, Expr->getType());
+    }
+
+    const SCEV *visitSignExtendExpr(const SCEVSignExtendExpr *Expr) {
+      const SCEV *Operand = ((SC*)this)->visit(Expr->getOperand());
+      return Operand == Expr->getOperand()
+                 ? Expr
+                 : SE.getSignExtendExpr(Operand, Expr->getType());
+    }
+
+    const SCEV *visitAddExpr(const SCEVAddExpr *Expr) {
+      SmallVector<const SCEV *, 2> Operands;
+      bool Changed = false;
+      for (auto *Op : Expr->operands()) {
+        Operands.push_back(((SC*)this)->visit(Op));
+        Changed |= Op != Operands.back();
+      }
+      return !Changed ? Expr : SE.getAddExpr(Operands);
+    }
+
+    const SCEV *visitMulExpr(const SCEVMulExpr *Expr) {
+      SmallVector<const SCEV *, 2> Operands;
+      bool Changed = false;
+      for (auto *Op : Expr->operands()) {
+        Operands.push_back(((SC*)this)->visit(Op));
+        Changed |= Op != Operands.back();
+      }
+      return !Changed ? Expr : SE.getMulExpr(Operands);
+    }
+
+    const SCEV *visitUDivExpr(const SCEVUDivExpr *Expr) {
+      auto *LHS = ((SC *)this)->visit(Expr->getLHS());
+      auto *RHS = ((SC *)this)->visit(Expr->getRHS());
+      bool Changed = LHS != Expr->getLHS() || RHS != Expr->getRHS();
+      return !Changed ? Expr : SE.getUDivExpr(LHS, RHS);
+    }
+
+    const SCEV *visitAddRecExpr(const SCEVAddRecExpr *Expr) {
+      SmallVector<const SCEV *, 2> Operands;
+      bool Changed = false;
+      for (auto *Op : Expr->operands()) {
+        Operands.push_back(((SC*)this)->visit(Op));
+        Changed |= Op != Operands.back();
+      }
+      return !Changed ? Expr
+                      : SE.getAddRecExpr(Operands, Expr->getLoop(),
+                                         Expr->getNoWrapFlags());
+    }
+
+    const SCEV *visitSMaxExpr(const SCEVSMaxExpr *Expr) {
+      SmallVector<const SCEV *, 2> Operands;
+      bool Changed = false;
+      for (auto *Op : Expr->operands()) {
+        Operands.push_back(((SC *)this)->visit(Op));
+        Changed |= Op != Operands.back();
+      }
+      return !Changed ? Expr : SE.getSMaxExpr(Operands);
+    }
+
+    const SCEV *visitUMaxExpr(const SCEVUMaxExpr *Expr) {
+      SmallVector<const SCEV *, 2> Operands;
+      bool Changed = false;
+      for (auto *Op : Expr->operands()) {
+        Operands.push_back(((SC*)this)->visit(Op));
+        Changed |= Op != Operands.back();
+      }
+      return !Changed ? Expr : SE.getUMaxExpr(Operands);
+    }
+
+    const SCEV *visitUnknown(const SCEVUnknown *Expr) {
+      return Expr;
+    }
+
+    const SCEV *visitCouldNotCompute(const SCEVCouldNotCompute *Expr) {
+      return Expr;
+    }
+  };
+
+  using ValueToValueMap = DenseMap<const Value *, Value *>;
+
+
+
+  class SCEVParameterRewriter : public SCEVRewriteVisitor<SCEVParameterRewriter> {
+  public:
+    static const SCEV *rewrite(const SCEV *Scev, ScalarEvolution &SE,
+                               ValueToValueMap &Map,
+                               bool InterpretConsts = false) {
+      SCEVParameterRewriter Rewriter(SE, Map, InterpretConsts);
+      return Rewriter.visit(Scev);
+    }
+
+    SCEVParameterRewriter(ScalarEvolution &SE, ValueToValueMap &M, bool C)
+      : SCEVRewriteVisitor(SE), Map(M), InterpretConsts(C) {}
+
+    const SCEV *visitUnknown(const SCEVUnknown *Expr) {
+      Value *V = Expr->getValue();
+      if (Map.count(V)) {
+        Value *NV = Map[V];
+        if (InterpretConsts && isa<ConstantInt>(NV))
+          return SE.getConstant(cast<ConstantInt>(NV));
+        return SE.getUnknown(NV);
+      }
+      return Expr;
+    }
+
+  private:
+    ValueToValueMap &Map;
+    bool InterpretConsts;
+  };
+
+  using LoopToScevMapT = DenseMap<const Loop *, const SCEV *>;
+
+
+
+  class SCEVLoopAddRecRewriter
+      : public SCEVRewriteVisitor<SCEVLoopAddRecRewriter> {
+  public:
+    SCEVLoopAddRecRewriter(ScalarEvolution &SE, LoopToScevMapT &M)
+        : SCEVRewriteVisitor(SE), Map(M) {}
+
+    static const SCEV *rewrite(const SCEV *Scev, LoopToScevMapT &Map,
+                               ScalarEvolution &SE) {
+      SCEVLoopAddRecRewriter Rewriter(SE, Map);
+      return Rewriter.visit(Scev);
+    }
+
+    const SCEV *visitAddRecExpr(const SCEVAddRecExpr *Expr) {
+      SmallVector<const SCEV *, 2> Operands;
+      for (const SCEV *Op : Expr->operands())
+        Operands.push_back(visit(Op));
+
+      const Loop *L = Expr->getLoop();
+      const SCEV *Res = SE.getAddRecExpr(Operands, L, Expr->getNoWrapFlags());
+
+      if (0 == Map.count(L))
+        return Res;
+
+      const SCEVAddRecExpr *Rec = cast<SCEVAddRecExpr>(Res);
+      return Rec->evaluateAtIteration(Map[L], SE);
+    }
+
+  private:
+    LoopToScevMapT &Map;
+  };
+
+}
+
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+
+
+
+namespace llvm {
+
+
+
+
+template<typename KeyT, typename ValueT,
+         typename MapType = DenseMap<KeyT, unsigned>,
+         typename VectorType = std::vector<std::pair<KeyT, ValueT>>>
+class MapVector {
+  using value_type = typename VectorType::value_type;
+  using size_type = typename VectorType::size_type;
+
+  MapType Map;
+  VectorType Vector;
+
+public:
+  using iterator = typename VectorType::iterator;
+  using const_iterator = typename VectorType::const_iterator;
+  using reverse_iterator = typename VectorType::reverse_iterator;
+  using const_reverse_iterator = typename VectorType::const_reverse_iterator;
+
+
+  VectorType takeVector() {
+    Map.clear();
+    return std::move(Vector);
+  }
+
+  size_type size() const { return Vector.size(); }
+
+
+
+  void reserve(size_type NumEntries) {
+    Map.reserve(NumEntries);
+    Vector.reserve(NumEntries);
+  }
+
+  iterator begin() { return Vector.begin(); }
+  const_iterator begin() const { return Vector.begin(); }
+  iterator end() { return Vector.end(); }
+  const_iterator end() const { return Vector.end(); }
+
+  reverse_iterator rbegin() { return Vector.rbegin(); }
+  const_reverse_iterator rbegin() const { return Vector.rbegin(); }
+  reverse_iterator rend() { return Vector.rend(); }
+  const_reverse_iterator rend() const { return Vector.rend(); }
+
+  bool empty() const {
+    return Vector.empty();
+  }
+
+  std::pair<KeyT, ValueT> &front() { return Vector.front(); }
+  const std::pair<KeyT, ValueT> &front() const { return Vector.front(); }
+  std::pair<KeyT, ValueT> &back() { return Vector.back(); }
+  const std::pair<KeyT, ValueT> &back() const { return Vector.back(); }
+
+  void clear() {
+    Map.clear();
+    Vector.clear();
+  }
+
+  void swap(MapVector &RHS) {
+    std::swap(Map, RHS.Map);
+    std::swap(Vector, RHS.Vector);
+  }
+
+  ValueT &operator[](const KeyT &Key) {
+    std::pair<KeyT, unsigned> Pair = std::make_pair(Key, 0);
+    std::pair<typename MapType::iterator, bool> Result = Map.insert(Pair);
+    unsigned &I = Result.first->second;
+    if (Result.second) {
+      Vector.push_back(std::make_pair(Key, ValueT()));
+      I = Vector.size() - 1;
+    }
+    return Vector[I].second;
+  }
+
+
+  ValueT lookup(const KeyT &Key) const {
+    static_assert(std::is_copy_constructible<ValueT>::value,
+                  "Cannot call lookup() if ValueT is not copyable.");
+    typename MapType::const_iterator Pos = Map.find(Key);
+    return Pos == Map.end()? ValueT() : Vector[Pos->second].second;
+  }
+
+  std::pair<iterator, bool> insert(const std::pair<KeyT, ValueT> &KV) {
+    std::pair<KeyT, unsigned> Pair = std::make_pair(KV.first, 0);
+    std::pair<typename MapType::iterator, bool> Result = Map.insert(Pair);
+    unsigned &I = Result.first->second;
+    if (Result.second) {
+      Vector.push_back(std::make_pair(KV.first, KV.second));
+      I = Vector.size() - 1;
+      return std::make_pair(std::prev(end()), true);
+    }
+    return std::make_pair(begin() + I, false);
+  }
+
+  std::pair<iterator, bool> insert(std::pair<KeyT, ValueT> &&KV) {
+
+    std::pair<KeyT, unsigned> Pair = std::make_pair(KV.first, 0);
+    std::pair<typename MapType::iterator, bool> Result = Map.insert(Pair);
+    unsigned &I = Result.first->second;
+    if (Result.second) {
+      Vector.push_back(std::move(KV));
+      I = Vector.size() - 1;
+      return std::make_pair(std::prev(end()), true);
+    }
+    return std::make_pair(begin() + I, false);
+  }
+
+  size_type count(const KeyT &Key) const {
+    typename MapType::const_iterator Pos = Map.find(Key);
+    return Pos == Map.end()? 0 : 1;
+  }
+
+  iterator find(const KeyT &Key) {
+    typename MapType::const_iterator Pos = Map.find(Key);
+    return Pos == Map.end()? Vector.end() :
+                            (Vector.begin() + Pos->second);
+  }
+
+  const_iterator find(const KeyT &Key) const {
+    typename MapType::const_iterator Pos = Map.find(Key);
+    return Pos == Map.end()? Vector.end() :
+                            (Vector.begin() + Pos->second);
+  }
+
+
+  void pop_back() {
+    typename MapType::iterator Pos = Map.find(Vector.back().first);
+    Map.erase(Pos);
+    Vector.pop_back();
+  }
+  typename VectorType::iterator erase(typename VectorType::iterator Iterator) {
+    Map.erase(Iterator->first);
+    auto Next = Vector.erase(Iterator);
+    if (Next == Vector.end())
+      return Next;
+
+
+    size_t Index = Next - Vector.begin();
+    for (auto &I : Map) {
+      
+     ((
+     I.second != Index && "Index was already erased!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "I.second != Index && \"Index was already erased!\""
+     , "/home/trippels/llvm/llvm/include/llvm/ADT/MapVector.h", 179, __PRETTY_FUNCTION__))
+                                                             ;
+      if (I.second > Index)
+        --I.second;
+    }
+    return Next;
+  }
+
+
+
+
+  size_type erase(const KeyT &Key) {
+    auto Iterator = find(Key);
+    if (Iterator == end())
+      return 0;
+    erase(Iterator);
+    return 1;
+  }
+
+
+
+
+
+  template <class Predicate> void remove_if(Predicate Pred);
+};
+
+template <typename KeyT, typename ValueT, typename MapType, typename VectorType>
+template <class Function>
+void MapVector<KeyT, ValueT, MapType, VectorType>::remove_if(Function Pred) {
+  auto O = Vector.begin();
+  for (auto I = O, E = Vector.end(); I != E; ++I) {
+    if (Pred(*I)) {
+
+      Map.erase(I->first);
+      continue;
+    }
+
+    if (I != O) {
+
+      *O = std::move(*I);
+      Map[O->first] = O - Vector.begin();
+    }
+    ++O;
+  }
+
+  Vector.erase(O, Vector.end());
+}
+
+
+
+template <typename KeyT, typename ValueT, unsigned N>
+struct SmallMapVector
+    : MapVector<KeyT, ValueT, SmallDenseMap<KeyT, unsigned, N>,
+                SmallVector<std::pair<KeyT, ValueT>, N>> {
+};
+
+}
+namespace llvm {
+class Triple {
+public:
+  enum ArchType {
+    UnknownArch,
+
+    arm,
+    armeb,
+    aarch64,
+    aarch64_be,
+    arc,
+    avr,
+    bpfel,
+    bpfeb,
+    hexagon,
+    mips,
+    mipsel,
+    mips64,
+    mips64el,
+    msp430,
+    nios2,
+    ppc,
+    ppc64,
+    ppc64le,
+    r600,
+    amdgcn,
+    riscv32,
+    riscv64,
+    sparc,
+    sparcv9,
+    sparcel,
+    systemz,
+    tce,
+    tcele,
+    thumb,
+    thumbeb,
+    x86,
+    x86_64,
+    xcore,
+    nvptx,
+    nvptx64,
+    le32,
+    le64,
+    amdil,
+    amdil64,
+    hsail,
+    hsail64,
+    spir,
+    spir64,
+    kalimba,
+    shave,
+    lanai,
+    wasm32,
+    wasm64,
+    renderscript32,
+    renderscript64,
+    LastArchType = renderscript64
+  };
+  enum SubArchType {
+    NoSubArch,
+
+    ARMSubArch_v8_3a,
+    ARMSubArch_v8_2a,
+    ARMSubArch_v8_1a,
+    ARMSubArch_v8,
+    ARMSubArch_v8r,
+    ARMSubArch_v8m_baseline,
+    ARMSubArch_v8m_mainline,
+    ARMSubArch_v7,
+    ARMSubArch_v7em,
+    ARMSubArch_v7m,
+    ARMSubArch_v7s,
+    ARMSubArch_v7k,
+    ARMSubArch_v7ve,
+    ARMSubArch_v6,
+    ARMSubArch_v6m,
+    ARMSubArch_v6k,
+    ARMSubArch_v6t2,
+    ARMSubArch_v5,
+    ARMSubArch_v5te,
+    ARMSubArch_v4t,
+
+    KalimbaSubArch_v3,
+    KalimbaSubArch_v4,
+    KalimbaSubArch_v5
+  };
+  enum VendorType {
+    UnknownVendor,
+
+    Apple,
+    PC,
+    SCEI,
+    BGP,
+    BGQ,
+    Freescale,
+    IBM,
+    ImaginationTechnologies,
+    MipsTechnologies,
+    NVIDIA,
+    CSR,
+    Myriad,
+    AMD,
+    Mesa,
+    SUSE,
+    LastVendorType = SUSE
+  };
+  enum OSType {
+    UnknownOS,
+
+    Ananas,
+    CloudABI,
+    Darwin,
+    DragonFly,
+    FreeBSD,
+    Fuchsia,
+    IOS,
+    KFreeBSD,
+    Linux,
+    Lv2,
+    MacOSX,
+    NetBSD,
+    OpenBSD,
+    Solaris,
+    Win32,
+    Haiku,
+    Minix,
+    RTEMS,
+    NaCl,
+    CNK,
+    AIX,
+    CUDA,
+    NVCL,
+    AMDHSA,
+    PS4,
+    ELFIAMCU,
+    TvOS,
+    WatchOS,
+    Mesa3D,
+    Contiki,
+    AMDPAL,
+    LastOSType = AMDPAL
+  };
+  enum EnvironmentType {
+    UnknownEnvironment,
+
+    GNU,
+    GNUABIN32,
+    GNUABI64,
+    GNUEABI,
+    GNUEABIHF,
+    GNUX32,
+    CODE16,
+    EABI,
+    EABIHF,
+    Android,
+    Musl,
+    MuslEABI,
+    MuslEABIHF,
+
+    MSVC,
+    Itanium,
+    Cygnus,
+    AMDOpenCL,
+    CoreCLR,
+    OpenCL,
+    Simulator,
+    LastEnvironmentType = Simulator
+  };
+  enum ObjectFormatType {
+    UnknownObjectFormat,
+
+    COFF,
+    ELF,
+    MachO,
+    Wasm,
+  };
+
+private:
+  std::string Data;
+
+
+  ArchType Arch;
+
+
+  SubArchType SubArch;
+
+
+  VendorType Vendor;
+
+
+  OSType OS;
+
+
+  EnvironmentType Environment;
+
+
+  ObjectFormatType ObjectFormat;
+
+public:
+
+
+
+
+
+  Triple()
+      : Data(), Arch(), SubArch(), Vendor(), OS(), Environment(),
+        ObjectFormat() {}
+
+  explicit Triple(const Twine &Str);
+  Triple(const Twine &ArchStr, const Twine &VendorStr, const Twine &OSStr);
+  Triple(const Twine &ArchStr, const Twine &VendorStr, const Twine &OSStr,
+         const Twine &EnvironmentStr);
+
+  bool operator==(const Triple &Other) const {
+    return Arch == Other.Arch && SubArch == Other.SubArch &&
+           Vendor == Other.Vendor && OS == Other.OS &&
+           Environment == Other.Environment &&
+           ObjectFormat == Other.ObjectFormat;
+  }
+
+  bool operator!=(const Triple &Other) const {
+    return !(*this == Other);
+  }
+  static std::string normalize(StringRef Str);
+
+
+  std::string normalize() const { return normalize(Data); }
+
+
+
+
+
+
+  ArchType getArch() const { return Arch; }
+
+
+  SubArchType getSubArch() const { return SubArch; }
+
+
+  VendorType getVendor() const { return Vendor; }
+
+
+  OSType getOS() const { return OS; }
+
+
+
+  bool hasEnvironment() const {
+    return getEnvironmentName() != "";
+  }
+
+
+  EnvironmentType getEnvironment() const { return Environment; }
+
+
+
+
+
+
+
+  void getEnvironmentVersion(unsigned &Major, unsigned &Minor,
+                             unsigned &Micro) const;
+
+
+  ObjectFormatType getObjectFormat() const { return ObjectFormat; }
+
+
+
+
+
+
+
+  void getOSVersion(unsigned &Major, unsigned &Minor, unsigned &Micro) const;
+
+
+
+  unsigned getOSMajorVersion() const {
+    unsigned Maj, Min, Micro;
+    getOSVersion(Maj, Min, Micro);
+    return Maj;
+  }
+
+
+
+
+
+  bool getMacOSXVersion(unsigned &Major, unsigned &Minor,
+                        unsigned &Micro) const;
+
+
+
+  void getiOSVersion(unsigned &Major, unsigned &Minor,
+                     unsigned &Micro) const;
+
+
+
+  void getWatchOSVersion(unsigned &Major, unsigned &Minor,
+                         unsigned &Micro) const;
+
+
+
+
+
+  const std::string &str() const { return Data; }
+
+  const std::string &getTriple() const { return Data; }
+
+
+
+  StringRef getArchName() const;
+
+
+  StringRef getVendorName() const;
+
+
+
+  StringRef getOSName() const;
+
+
+
+  StringRef getEnvironmentName() const;
+
+
+
+
+  StringRef getOSAndEnvironmentName() const;
+  bool isArch64Bit() const;
+
+
+
+
+  bool isArch32Bit() const;
+
+
+
+
+  bool isArch16Bit() const;
+
+
+
+  bool isOSVersionLT(unsigned Major, unsigned Minor = 0,
+                     unsigned Micro = 0) const {
+    unsigned LHS[3];
+    getOSVersion(LHS[0], LHS[1], LHS[2]);
+
+    if (LHS[0] != Major)
+      return LHS[0] < Major;
+    if (LHS[1] != Minor)
+      return LHS[1] < Minor;
+    if (LHS[2] != Micro)
+      return LHS[1] < Micro;
+
+    return false;
+  }
+
+  bool isOSVersionLT(const Triple &Other) const {
+    unsigned RHS[3];
+    Other.getOSVersion(RHS[0], RHS[1], RHS[2]);
+    return isOSVersionLT(RHS[0], RHS[1], RHS[2]);
+  }
+
+
+
+
+  bool isMacOSXVersionLT(unsigned Major, unsigned Minor = 0,
+                         unsigned Micro = 0) const {
+    
+   ((
+   isMacOSX() && "Not an OS X triple!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isMacOSX() && \"Not an OS X triple!\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/Triple.h", 429, __PRETTY_FUNCTION__))
+                                              ;
+
+
+    if (getOS() == Triple::MacOSX)
+      return isOSVersionLT(Major, Minor, Micro);
+
+
+    
+   ((
+   Major == 10 && "Unexpected major version"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Major == 10 && \"Unexpected major version\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/Triple.h", 436, __PRETTY_FUNCTION__))
+                                                    ;
+    return isOSVersionLT(Minor + 4, Micro, 0);
+  }
+
+
+
+  bool isMacOSX() const {
+    return getOS() == Triple::Darwin || getOS() == Triple::MacOSX;
+  }
+
+
+
+
+
+
+  bool isiOS() const {
+    return getOS() == Triple::IOS || isTvOS();
+  }
+
+
+  bool isTvOS() const {
+    return getOS() == Triple::TvOS;
+  }
+
+
+  bool isWatchOS() const {
+    return getOS() == Triple::WatchOS;
+  }
+
+  bool isWatchABI() const {
+    return getSubArch() == Triple::ARMSubArch_v7k;
+  }
+
+
+  bool isOSDarwin() const {
+    return isMacOSX() || isiOS() || isWatchOS();
+  }
+
+  bool isSimulatorEnvironment() const {
+    return getEnvironment() == Triple::Simulator;
+  }
+
+  bool isOSNetBSD() const {
+    return getOS() == Triple::NetBSD;
+  }
+
+  bool isOSOpenBSD() const {
+    return getOS() == Triple::OpenBSD;
+  }
+
+  bool isOSFreeBSD() const {
+    return getOS() == Triple::FreeBSD;
+  }
+
+  bool isOSFuchsia() const {
+    return getOS() == Triple::Fuchsia;
+  }
+
+  bool isOSDragonFly() const { return getOS() == Triple::DragonFly; }
+
+  bool isOSSolaris() const {
+    return getOS() == Triple::Solaris;
+  }
+
+  bool isOSIAMCU() const {
+    return getOS() == Triple::ELFIAMCU;
+  }
+
+  bool isOSUnknown() const { return getOS() == Triple::UnknownOS; }
+
+  bool isGNUEnvironment() const {
+    EnvironmentType Env = getEnvironment();
+    return Env == Triple::GNU || Env == Triple::GNUABIN32 ||
+           Env == Triple::GNUABI64 || Env == Triple::GNUEABI ||
+           Env == Triple::GNUEABIHF || Env == Triple::GNUX32;
+  }
+
+  bool isOSContiki() const {
+    return getOS() == Triple::Contiki;
+  }
+
+
+  bool isOSHaiku() const {
+    return getOS() == Triple::Haiku;
+  }
+
+
+  bool isWindowsMSVCEnvironment() const {
+    return getOS() == Triple::Win32 &&
+           (getEnvironment() == Triple::UnknownEnvironment ||
+            getEnvironment() == Triple::MSVC);
+  }
+
+
+  bool isKnownWindowsMSVCEnvironment() const {
+    return getOS() == Triple::Win32 && getEnvironment() == Triple::MSVC;
+  }
+
+  bool isWindowsCoreCLREnvironment() const {
+    return getOS() == Triple::Win32 && getEnvironment() == Triple::CoreCLR;
+  }
+
+  bool isWindowsItaniumEnvironment() const {
+    return getOS() == Triple::Win32 && getEnvironment() == Triple::Itanium;
+  }
+
+  bool isWindowsCygwinEnvironment() const {
+    return getOS() == Triple::Win32 && getEnvironment() == Triple::Cygnus;
+  }
+
+  bool isWindowsGNUEnvironment() const {
+    return getOS() == Triple::Win32 && getEnvironment() == Triple::GNU;
+  }
+
+
+  bool isOSCygMing() const {
+    return isWindowsCygwinEnvironment() || isWindowsGNUEnvironment();
+  }
+
+
+  bool isOSMSVCRT() const {
+    return isWindowsMSVCEnvironment() || isWindowsGNUEnvironment() ||
+           isWindowsItaniumEnvironment();
+  }
+
+
+  bool isOSWindows() const {
+    return getOS() == Triple::Win32;
+  }
+
+
+  bool isOSNaCl() const {
+    return getOS() == Triple::NaCl;
+  }
+
+
+  bool isOSLinux() const {
+    return getOS() == Triple::Linux;
+  }
+
+
+  bool isOSKFreeBSD() const {
+    return getOS() == Triple::KFreeBSD;
+  }
+
+
+  bool isOSGlibc() const {
+    return (getOS() == Triple::Linux || getOS() == Triple::KFreeBSD) &&
+           !isAndroid();
+  }
+
+
+  bool isOSBinFormatELF() const {
+    return getObjectFormat() == Triple::ELF;
+  }
+
+
+  bool isOSBinFormatCOFF() const {
+    return getObjectFormat() == Triple::COFF;
+  }
+
+
+  bool isOSBinFormatMachO() const {
+    return getObjectFormat() == Triple::MachO;
+  }
+
+
+  bool isOSBinFormatWasm() const {
+    return getObjectFormat() == Triple::Wasm;
+  }
+
+
+  bool isPS4CPU() const {
+    return getArch() == Triple::x86_64 &&
+           getVendor() == Triple::SCEI &&
+           getOS() == Triple::PS4;
+  }
+
+
+  bool isPS4() const {
+    return getVendor() == Triple::SCEI &&
+           getOS() == Triple::PS4;
+  }
+
+
+  bool isAndroid() const { return getEnvironment() == Triple::Android; }
+
+  bool isAndroidVersionLT(unsigned Major) const {
+    
+   ((
+   isAndroid() && "Not an Android triple!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isAndroid() && \"Not an Android triple!\""
+   , "/home/trippels/llvm/llvm/include/llvm/ADT/Triple.h", 624, __PRETTY_FUNCTION__))
+                                                  ;
+
+    unsigned Env[3];
+    getEnvironmentVersion(Env[0], Env[1], Env[2]);
+
+
+    if (isArch64Bit() && Env[0] < 21)
+      Env[0] = 21;
+
+    return Env[0] < Major;
+  }
+
+
+  bool isMusl() const {
+    return getEnvironment() == Triple::Musl ||
+           getEnvironment() == Triple::MuslEABI ||
+           getEnvironment() == Triple::MuslEABIHF;
+  }
+
+
+  bool isNVPTX() const {
+    return getArch() == Triple::nvptx || getArch() == Triple::nvptx64;
+  }
+
+
+  bool isThumb() const {
+    return getArch() == Triple::thumb || getArch() == Triple::thumbeb;
+  }
+
+
+  bool isARM() const {
+    return getArch() == Triple::arm || getArch() == Triple::armeb;
+  }
+
+
+  bool isAArch64() const {
+    return getArch() == Triple::aarch64 || getArch() == Triple::aarch64_be;
+  }
+
+
+  bool supportsCOMDAT() const {
+    return !isOSBinFormatMachO();
+  }
+
+
+
+
+
+
+
+  void setArch(ArchType Kind);
+
+
+
+  void setVendor(VendorType Kind);
+
+
+
+  void setOS(OSType Kind);
+
+
+
+  void setEnvironment(EnvironmentType Kind);
+
+
+  void setObjectFormat(ObjectFormatType Kind);
+
+
+  void setTriple(const Twine &Str);
+
+
+
+  void setArchName(StringRef Str);
+
+
+
+  void setVendorName(StringRef Str);
+
+
+
+  void setOSName(StringRef Str);
+
+
+
+  void setEnvironmentName(StringRef Str);
+
+
+
+  void setOSAndEnvironmentName(StringRef Str);
+  llvm::Triple get32BitArchVariant() const;
+
+
+
+
+
+
+
+  llvm::Triple get64BitArchVariant() const;
+
+
+
+
+
+
+
+  llvm::Triple getBigEndianArchVariant() const;
+
+
+
+
+
+
+
+  llvm::Triple getLittleEndianArchVariant() const;
+
+
+
+
+
+  StringRef getARMCPUForArch(StringRef Arch = StringRef()) const;
+
+
+
+
+  bool isLittleEndian() const;
+
+
+  bool isCompatibleWith(const Triple &Other) const;
+
+
+  std::string merge(const Triple &Other) const;
+
+
+
+
+
+
+  static StringRef getArchTypeName(ArchType Kind);
+
+
+
+
+
+
+
+  static StringRef getArchTypePrefix(ArchType Kind);
+
+
+  static StringRef getVendorTypeName(VendorType Kind);
+
+
+  static StringRef getOSTypeName(OSType Kind);
+
+
+
+  static StringRef getEnvironmentTypeName(EnvironmentType Kind);
+
+
+
+
+
+
+
+  static ArchType getArchTypeForLLVMName(StringRef Str);
+
+
+};
+
+}
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+namespace llvm {
+
+namespace Intrinsic {
+enum ID : unsigned;
+}
+
+template <typename FunTy = const Function,
+          typename BBTy = const BasicBlock,
+          typename ValTy = const Value,
+          typename UserTy = const User,
+          typename UseTy = const Use,
+          typename InstrTy = const Instruction,
+          typename CallTy = const CallInst,
+          typename InvokeTy = const InvokeInst,
+          typename IterTy = User::const_op_iterator>
+class CallSiteBase {
+protected:
+  PointerIntPair<InstrTy*, 1, bool> I;
+
+  CallSiteBase() = default;
+  CallSiteBase(CallTy *CI) : I(CI, true) { 
+                                          ((
+                                          CI
+                                          ) ? static_cast<void> (0) : __assert_fail (
+                                          "CI"
+                                          , "/home/trippels/llvm/llvm/include/llvm/IR/CallSite.h", 66, __PRETTY_FUNCTION__))
+                                                    ; }
+  CallSiteBase(InvokeTy *II) : I(II, false) { 
+                                             ((
+                                             II
+                                             ) ? static_cast<void> (0) : __assert_fail (
+                                             "II"
+                                             , "/home/trippels/llvm/llvm/include/llvm/IR/CallSite.h", 67, __PRETTY_FUNCTION__))
+                                                       ; }
+  explicit CallSiteBase(ValTy *II) { *this = get(II); }
+
+private:
+
+
+
+  static CallSiteBase get(ValTy *V) {
+    if (InstrTy *II = dyn_cast<InstrTy>(V)) {
+      if (II->getOpcode() == Instruction::Call)
+        return CallSiteBase(static_cast<CallTy*>(II));
+      else if (II->getOpcode() == Instruction::Invoke)
+        return CallSiteBase(static_cast<InvokeTy*>(II));
+    }
+    return CallSiteBase();
+  }
+
+public:
+
+
+  bool isCall() const { return I.getInt(); }
+
+
+  bool isInvoke() const { return getInstruction() && !I.getInt(); }
+
+  InstrTy *getInstruction() const { return I.getPointer(); }
+  InstrTy *operator->() const { return I.getPointer(); }
+  explicit operator bool() const { return I.getPointer(); }
+
+
+  BBTy* getParent() const { return getInstruction()->getParent(); }
+
+
+  ValTy *getCalledValue() const {
+    
+   ((
+   getInstruction() && "Not a call or invoke instruction!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "getInstruction() && \"Not a call or invoke instruction!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/CallSite.h", 101, __PRETTY_FUNCTION__))
+                                                                  ;
+    return *getCallee();
+  }
+
+
+
+  FunTy *getCalledFunction() const {
+    return dyn_cast<FunTy>(getCalledValue());
+  }
+
+
+  bool isIndirectCall() const {
+    const Value *V = getCalledValue();
+    if (!V)
+      return false;
+    if (isa<FunTy>(V) || isa<Constant>(V))
+      return false;
+    if (const CallInst *CI = dyn_cast<CallInst>(getInstruction())) {
+      if (CI->isInlineAsm())
+        return false;
+    }
+    return true;
+  }
+
+
+  void setCalledFunction(Value *V) {
+    
+   ((
+   getInstruction() && "Not a call or invoke instruction!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "getInstruction() && \"Not a call or invoke instruction!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/CallSite.h", 127, __PRETTY_FUNCTION__))
+                                                                  ;
+    *getCallee() = V;
+  }
+
+
+
+
+  Intrinsic::ID getIntrinsicID() const {
+    if (auto *F = getCalledFunction())
+      return F->getIntrinsicID();
+
+
+    return static_cast<Intrinsic::ID>(0);
+  }
+
+
+  bool isCallee(Value::const_user_iterator UI) const {
+    return isCallee(&UI.getUse());
+  }
+
+
+  bool isCallee(const Use *U) const { return getCallee() == U; }
+
+
+  bool isArgOperand(Value::const_user_iterator UI) const {
+    return isArgOperand(&UI.getUse());
+  }
+
+
+  bool isArgOperand(const Use *U) const {
+    
+   ((
+   getInstruction() == U->getUser()
+   ) ? static_cast<void> (0) : __assert_fail (
+   "getInstruction() == U->getUser()"
+   , "/home/trippels/llvm/llvm/include/llvm/IR/CallSite.h", 157, __PRETTY_FUNCTION__))
+                                           ;
+    return arg_begin() <= U && U < arg_end();
+  }
+
+
+  bool isBundleOperand(Value::const_user_iterator UI) const {
+    return isBundleOperand(&UI.getUse());
+  }
+
+
+  bool isBundleOperand(const Use *U) const {
+    
+   ((
+   getInstruction() == U->getUser()
+   ) ? static_cast<void> (0) : __assert_fail (
+   "getInstruction() == U->getUser()"
+   , "/home/trippels/llvm/llvm/include/llvm/IR/CallSite.h", 168, __PRETTY_FUNCTION__))
+                                           ;
+    if (!hasOperandBundles())
+      return false;
+    unsigned OperandNo = U - (*this)->op_begin();
+    return getBundleOperandsStartIndex() <= OperandNo &&
+           OperandNo < getBundleOperandsEndIndex();
+  }
+
+
+  bool isDataOperand(Value::const_user_iterator UI) const {
+    return isDataOperand(&UI.getUse());
+  }
+
+
+  bool isDataOperand(const Use *U) const {
+    return data_operands_begin() <= U && U < data_operands_end();
+  }
+
+  ValTy *getArgument(unsigned ArgNo) const {
+    
+   ((
+   arg_begin() + ArgNo < arg_end() && "Argument # out of range!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "arg_begin() + ArgNo < arg_end() && \"Argument # out of range!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/CallSite.h", 187, __PRETTY_FUNCTION__))
+                                                                        ;
+    return *(arg_begin() + ArgNo);
+  }
+
+  void setArgument(unsigned ArgNo, Value* newVal) {
+    
+   ((
+   getInstruction() && "Not a call or invoke instruction!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "getInstruction() && \"Not a call or invoke instruction!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/CallSite.h", 192, __PRETTY_FUNCTION__))
+                                                                  ;
+    
+   ((
+   arg_begin() + ArgNo < arg_end() && "Argument # out of range!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "arg_begin() + ArgNo < arg_end() && \"Argument # out of range!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/CallSite.h", 193, __PRETTY_FUNCTION__))
+                                                                        ;
+    getInstruction()->setOperand(ArgNo, newVal);
+  }
+
+
+
+  unsigned getArgumentNo(Value::const_user_iterator I) const {
+    return getArgumentNo(&I.getUse());
+  }
+
+
+
+  unsigned getArgumentNo(const Use *U) const {
+    
+   ((
+   getInstruction() && "Not a call or invoke instruction!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "getInstruction() && \"Not a call or invoke instruction!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/CallSite.h", 206, __PRETTY_FUNCTION__))
+                                                                  ;
+    
+   ((
+   isArgOperand(U) && "Argument # out of range!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isArgOperand(U) && \"Argument # out of range!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/CallSite.h", 207, __PRETTY_FUNCTION__))
+                                                        ;
+    return U - arg_begin();
+  }
+
+
+
+  using arg_iterator = IterTy;
+
+  iterator_range<IterTy> args() const {
+    return make_range(arg_begin(), arg_end());
+  }
+  bool arg_empty() const { return arg_end() == arg_begin(); }
+  unsigned arg_size() const { return unsigned(arg_end() - arg_begin()); }
+
+
+
+  unsigned getDataOperandNo(Value::const_user_iterator UI) const {
+    return getDataOperandNo(&UI.getUse());
+  }
+
+
+
+  unsigned getDataOperandNo(const Use *U) const {
+    
+   ((
+   getInstruction() && "Not a call or invoke instruction!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "getInstruction() && \"Not a call or invoke instruction!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/CallSite.h", 230, __PRETTY_FUNCTION__))
+                                                                  ;
+    
+   ((
+   isDataOperand(U) && "Data operand # out of range!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isDataOperand(U) && \"Data operand # out of range!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/CallSite.h", 231, __PRETTY_FUNCTION__))
+                                                             ;
+    return U - data_operands_begin();
+  }
+
+
+
+  using data_operand_iterator = IterTy;
+
+
+
+
+
+
+
+  IterTy data_operands_begin() const {
+    
+   ((
+   getInstruction() && "Not a call or invoke instruction!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "getInstruction() && \"Not a call or invoke instruction!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/CallSite.h", 246, __PRETTY_FUNCTION__))
+                                                                  ;
+    return (*this)->op_begin();
+  }
+  IterTy data_operands_end() const {
+    
+   ((
+   getInstruction() && "Not a call or invoke instruction!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "getInstruction() && \"Not a call or invoke instruction!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/CallSite.h", 250, __PRETTY_FUNCTION__))
+                                                                  ;
+    return (*this)->op_end() - (isCall() ? 1 : 3);
+  }
+  iterator_range<IterTy> data_ops() const {
+    return make_range(data_operands_begin(), data_operands_end());
+  }
+  bool data_operands_empty() const {
+    return data_operands_end() == data_operands_begin();
+  }
+  unsigned data_operands_size() const {
+    return std::distance(data_operands_begin(), data_operands_end());
+  }
+
+
+  Type *getType() const { return (*this)->getType(); }
+
+
+  FunTy *getCaller() const { return (*this)->getParent()->getParent(); }
+
+
+
+  bool isMustTailCall() const {
+    return isCall() && cast<CallInst>(getInstruction())->isMustTailCall();
+  }
+
+
+  bool isTailCall() const {
+    return isCall() && cast<CallInst>(getInstruction())->isTailCall();
+  }
+  unsigned getNumArgOperands() const {
+    InstrTy *II = getInstruction(); return isCall() ? cast<CallInst>(II)->getNumArgOperands() : cast<InvokeInst>(II)->getNumArgOperands();
+  }
+
+  ValTy *getArgOperand(unsigned i) const {
+    InstrTy *II = getInstruction(); return isCall() ? cast<CallInst>(II)->getArgOperand(i) : cast<InvokeInst>(II)->getArgOperand(i);
+  }
+
+  ValTy *getReturnedArgOperand() const {
+    InstrTy *II = getInstruction(); return isCall() ? cast<CallInst>(II)->getReturnedArgOperand() : cast<InvokeInst>(II)->getReturnedArgOperand();
+  }
+
+  bool isInlineAsm() const {
+    if (isCall())
+      return cast<CallInst>(getInstruction())->isInlineAsm();
+    return false;
+  }
+
+
+  CallingConv::ID getCallingConv() const {
+    InstrTy *II = getInstruction(); return isCall() ? cast<CallInst>(II)->getCallingConv() : cast<InvokeInst>(II)->getCallingConv();
+  }
+
+  void setCallingConv(CallingConv::ID CC) {
+    InstrTy *II = getInstruction(); if (isCall()) cast<CallInst>(II)->setCallingConv(CC); else cast<InvokeInst>(II)->setCallingConv(CC);
+  }
+
+  FunctionType *getFunctionType() const {
+    InstrTy *II = getInstruction(); return isCall() ? cast<CallInst>(II)->getFunctionType() : cast<InvokeInst>(II)->getFunctionType();
+  }
+
+  void mutateFunctionType(FunctionType *Ty) const {
+    InstrTy *II = getInstruction(); if (isCall()) cast<CallInst>(II)->mutateFunctionType(Ty); else cast<InvokeInst>(II)->mutateFunctionType(Ty);
+  }
+
+
+  AttributeList getAttributes() const {
+    InstrTy *II = getInstruction(); return isCall() ? cast<CallInst>(II)->getAttributes() : cast<InvokeInst>(II)->getAttributes();
+  }
+
+  void setAttributes(AttributeList PAL) {
+    InstrTy *II = getInstruction(); if (isCall()) cast<CallInst>(II)->setAttributes(PAL); else cast<InvokeInst>(II)->setAttributes(PAL);
+  }
+
+  void addAttribute(unsigned i, Attribute::AttrKind Kind) {
+    InstrTy *II = getInstruction(); if (isCall()) cast<CallInst>(II)->addAttribute(i, Kind); else cast<InvokeInst>(II)->addAttribute(i, Kind);
+  }
+
+  void addAttribute(unsigned i, Attribute Attr) {
+    InstrTy *II = getInstruction(); if (isCall()) cast<CallInst>(II)->addAttribute(i, Attr); else cast<InvokeInst>(II)->addAttribute(i, Attr);
+  }
+
+  void addParamAttr(unsigned ArgNo, Attribute::AttrKind Kind) {
+    InstrTy *II = getInstruction(); if (isCall()) cast<CallInst>(II)->addParamAttr(ArgNo, Kind); else cast<InvokeInst>(II)->addParamAttr(ArgNo, Kind);
+  }
+
+  void removeAttribute(unsigned i, Attribute::AttrKind Kind) {
+    InstrTy *II = getInstruction(); if (isCall()) cast<CallInst>(II)->removeAttribute(i, Kind); else cast<InvokeInst>(II)->removeAttribute(i, Kind);
+  }
+
+  void removeAttribute(unsigned i, StringRef Kind) {
+    InstrTy *II = getInstruction(); if (isCall()) cast<CallInst>(II)->removeAttribute(i, Kind); else cast<InvokeInst>(II)->removeAttribute(i, Kind);
+  }
+
+  void removeParamAttr(unsigned ArgNo, Attribute::AttrKind Kind) {
+    InstrTy *II = getInstruction(); if (isCall()) cast<CallInst>(II)->removeParamAttr(ArgNo, Kind); else cast<InvokeInst>(II)->removeParamAttr(ArgNo, Kind);
+  }
+
+
+  bool hasFnAttr(Attribute::AttrKind Kind) const {
+    InstrTy *II = getInstruction(); return isCall() ? cast<CallInst>(II)->hasFnAttr(Kind) : cast<InvokeInst>(II)->hasFnAttr(Kind);
+  }
+
+
+  bool hasFnAttr(StringRef Kind) const {
+    InstrTy *II = getInstruction(); return isCall() ? cast<CallInst>(II)->hasFnAttr(Kind) : cast<InvokeInst>(II)->hasFnAttr(Kind);
+  }
+
+
+  bool hasRetAttr(Attribute::AttrKind Kind) const {
+    InstrTy *II = getInstruction(); return isCall() ? cast<CallInst>(II)->hasRetAttr(Kind) : cast<InvokeInst>(II)->hasRetAttr(Kind);
+  }
+
+
+  bool paramHasAttr(unsigned ArgNo, Attribute::AttrKind Kind) const {
+    InstrTy *II = getInstruction(); return isCall() ? cast<CallInst>(II)->paramHasAttr(ArgNo, Kind) : cast<InvokeInst>(II)->paramHasAttr(ArgNo, Kind);
+  }
+
+  Attribute getAttribute(unsigned i, Attribute::AttrKind Kind) const {
+    InstrTy *II = getInstruction(); return isCall() ? cast<CallInst>(II)->getAttribute(i, Kind) : cast<InvokeInst>(II)->getAttribute(i, Kind);
+  }
+
+  Attribute getAttribute(unsigned i, StringRef Kind) const {
+    InstrTy *II = getInstruction(); return isCall() ? cast<CallInst>(II)->getAttribute(i, Kind) : cast<InvokeInst>(II)->getAttribute(i, Kind);
+  }
+  bool dataOperandHasImpliedAttr(unsigned i, Attribute::AttrKind Kind) const {
+    InstrTy *II = getInstruction(); return isCall() ? cast<CallInst>(II)->dataOperandHasImpliedAttr(i, Kind) : cast<InvokeInst>(II)->dataOperandHasImpliedAttr(i, Kind);
+  }
+
+
+  unsigned getRetAlignment() const {
+    InstrTy *II = getInstruction(); return isCall() ? cast<CallInst>(II)->getRetAlignment() : cast<InvokeInst>(II)->getRetAlignment();
+  }
+
+
+  unsigned getParamAlignment(unsigned ArgNo) const {
+    InstrTy *II = getInstruction(); return isCall() ? cast<CallInst>(II)->getParamAlignment(ArgNo) : cast<InvokeInst>(II)->getParamAlignment(ArgNo);
+  }
+
+
+
+  uint64_t getDereferenceableBytes(unsigned i) const {
+    InstrTy *II = getInstruction(); return isCall() ? cast<CallInst>(II)->getDereferenceableBytes(i) : cast<InvokeInst>(II)->getDereferenceableBytes(i);
+  }
+
+
+
+  uint64_t getDereferenceableOrNullBytes(unsigned i) const {
+    InstrTy *II = getInstruction(); return isCall() ? cast<CallInst>(II)->getDereferenceableOrNullBytes(i) : cast<InvokeInst>(II)->getDereferenceableOrNullBytes(i);
+  }
+
+
+  bool returnDoesNotAlias() const {
+    InstrTy *II = getInstruction(); return isCall() ? cast<CallInst>(II)->returnDoesNotAlias() : cast<InvokeInst>(II)->returnDoesNotAlias();
+  }
+
+
+  bool isNoBuiltin() const {
+    InstrTy *II = getInstruction(); return isCall() ? cast<CallInst>(II)->isNoBuiltin() : cast<InvokeInst>(II)->isNoBuiltin();
+  }
+
+
+  bool isStrictFP() const {
+    InstrTy *II = getInstruction(); return isCall() ? cast<CallInst>(II)->isStrictFP() : cast<InvokeInst>(II)->isStrictFP();
+  }
+
+
+  bool isNoInline() const {
+    InstrTy *II = getInstruction(); return isCall() ? cast<CallInst>(II)->isNoInline() : cast<InvokeInst>(II)->isNoInline();
+  }
+  void setIsNoInline(bool Value = true) {
+    InstrTy *II = getInstruction(); if (isCall()) cast<CallInst>(II)->setIsNoInline(Value); else cast<InvokeInst>(II)->setIsNoInline(Value);
+  }
+
+
+  bool doesNotAccessMemory() const {
+    InstrTy *II = getInstruction(); return isCall() ? cast<CallInst>(II)->doesNotAccessMemory() : cast<InvokeInst>(II)->doesNotAccessMemory();
+  }
+  void setDoesNotAccessMemory() {
+    InstrTy *II = getInstruction(); if (isCall()) cast<CallInst>(II)->setDoesNotAccessMemory(); else cast<InvokeInst>(II)->setDoesNotAccessMemory();
+  }
+
+
+  bool onlyReadsMemory() const {
+    InstrTy *II = getInstruction(); return isCall() ? cast<CallInst>(II)->onlyReadsMemory() : cast<InvokeInst>(II)->onlyReadsMemory();
+  }
+  void setOnlyReadsMemory() {
+    InstrTy *II = getInstruction(); if (isCall()) cast<CallInst>(II)->setOnlyReadsMemory(); else cast<InvokeInst>(II)->setOnlyReadsMemory();
+  }
+
+
+  bool doesNotReadMemory() const {
+    InstrTy *II = getInstruction(); return isCall() ? cast<CallInst>(II)->doesNotReadMemory() : cast<InvokeInst>(II)->doesNotReadMemory();
+  }
+  void setDoesNotReadMemory() {
+    InstrTy *II = getInstruction(); if (isCall()) cast<CallInst>(II)->setDoesNotReadMemory(); else cast<InvokeInst>(II)->setDoesNotReadMemory();
+  }
+
+
+
+  bool onlyAccessesArgMemory() const {
+    InstrTy *II = getInstruction(); return isCall() ? cast<CallInst>(II)->onlyAccessesArgMemory() : cast<InvokeInst>(II)->onlyAccessesArgMemory();
+  }
+  void setOnlyAccessesArgMemory() {
+    InstrTy *II = getInstruction(); if (isCall()) cast<CallInst>(II)->setOnlyAccessesArgMemory(); else cast<InvokeInst>(II)->setOnlyAccessesArgMemory();
+  }
+
+
+
+  bool onlyAccessesInaccessibleMemory() const {
+    InstrTy *II = getInstruction(); return isCall() ? cast<CallInst>(II)->onlyAccessesInaccessibleMemory() : cast<InvokeInst>(II)->onlyAccessesInaccessibleMemory();
+  }
+  void setOnlyAccessesInaccessibleMemory() {
+    InstrTy *II = getInstruction(); if (isCall()) cast<CallInst>(II)->setOnlyAccessesInaccessibleMemory(); else cast<InvokeInst>(II)->setOnlyAccessesInaccessibleMemory();
+  }
+
+
+
+  bool onlyAccessesInaccessibleMemOrArgMem() const {
+    InstrTy *II = getInstruction(); return isCall() ? cast<CallInst>(II)->onlyAccessesInaccessibleMemOrArgMem() : cast<InvokeInst>(II)->onlyAccessesInaccessibleMemOrArgMem();
+  }
+  void setOnlyAccessesInaccessibleMemOrArgMem() {
+    InstrTy *II = getInstruction(); if (isCall()) cast<CallInst>(II)->setOnlyAccessesInaccessibleMemOrArgMem(); else cast<InvokeInst>(II)->setOnlyAccessesInaccessibleMemOrArgMem();
+  }
+
+
+  bool doesNotReturn() const {
+    InstrTy *II = getInstruction(); return isCall() ? cast<CallInst>(II)->doesNotReturn() : cast<InvokeInst>(II)->doesNotReturn();
+  }
+  void setDoesNotReturn() {
+    InstrTy *II = getInstruction(); if (isCall()) cast<CallInst>(II)->setDoesNotReturn(); else cast<InvokeInst>(II)->setDoesNotReturn();
+  }
+
+
+  bool doesNotThrow() const {
+    InstrTy *II = getInstruction(); return isCall() ? cast<CallInst>(II)->doesNotThrow() : cast<InvokeInst>(II)->doesNotThrow();
+  }
+  void setDoesNotThrow() {
+    InstrTy *II = getInstruction(); if (isCall()) cast<CallInst>(II)->setDoesNotThrow(); else cast<InvokeInst>(II)->setDoesNotThrow();
+  }
+
+
+  bool cannotDuplicate() const {
+    InstrTy *II = getInstruction(); return isCall() ? cast<CallInst>(II)->cannotDuplicate() : cast<InvokeInst>(II)->cannotDuplicate();
+  }
+  void setCannotDuplicate() {
+    InstrTy *II = getInstruction(); if (isCall()) cast<CallInst>(II)->setCannotDuplicate(); else cast<InvokeInst>(II)->setCannotDuplicate();
+  }
+
+
+  bool isConvergent() const {
+    InstrTy *II = getInstruction(); return isCall() ? cast<CallInst>(II)->isConvergent() : cast<InvokeInst>(II)->isConvergent();
+  }
+  void setConvergent() {
+    InstrTy *II = getInstruction(); if (isCall()) cast<CallInst>(II)->setConvergent(); else cast<InvokeInst>(II)->setConvergent();
+  }
+  void setNotConvergent() {
+    InstrTy *II = getInstruction(); if (isCall()) cast<CallInst>(II)->setNotConvergent(); else cast<InvokeInst>(II)->setNotConvergent();
+  }
+
+  unsigned getNumOperandBundles() const {
+    InstrTy *II = getInstruction(); return isCall() ? cast<CallInst>(II)->getNumOperandBundles() : cast<InvokeInst>(II)->getNumOperandBundles();
+  }
+
+  bool hasOperandBundles() const {
+    InstrTy *II = getInstruction(); return isCall() ? cast<CallInst>(II)->hasOperandBundles() : cast<InvokeInst>(II)->hasOperandBundles();
+  }
+
+  unsigned getBundleOperandsStartIndex() const {
+    InstrTy *II = getInstruction(); return isCall() ? cast<CallInst>(II)->getBundleOperandsStartIndex() : cast<InvokeInst>(II)->getBundleOperandsStartIndex();
+  }
+
+  unsigned getBundleOperandsEndIndex() const {
+    InstrTy *II = getInstruction(); return isCall() ? cast<CallInst>(II)->getBundleOperandsEndIndex() : cast<InvokeInst>(II)->getBundleOperandsEndIndex();
+  }
+
+  unsigned getNumTotalBundleOperands() const {
+    InstrTy *II = getInstruction(); return isCall() ? cast<CallInst>(II)->getNumTotalBundleOperands() : cast<InvokeInst>(II)->getNumTotalBundleOperands();
+  }
+
+  OperandBundleUse getOperandBundleAt(unsigned Index) const {
+    InstrTy *II = getInstruction(); return isCall() ? cast<CallInst>(II)->getOperandBundleAt(Index) : cast<InvokeInst>(II)->getOperandBundleAt(Index);
+  }
+
+  Optional<OperandBundleUse> getOperandBundle(StringRef Name) const {
+    InstrTy *II = getInstruction(); return isCall() ? cast<CallInst>(II)->getOperandBundle(Name) : cast<InvokeInst>(II)->getOperandBundle(Name);
+  }
+
+  Optional<OperandBundleUse> getOperandBundle(uint32_t ID) const {
+    InstrTy *II = getInstruction(); return isCall() ? cast<CallInst>(II)->getOperandBundle(ID) : cast<InvokeInst>(II)->getOperandBundle(ID);
+  }
+
+  unsigned countOperandBundlesOfType(uint32_t ID) const {
+    InstrTy *II = getInstruction(); return isCall() ? cast<CallInst>(II)->countOperandBundlesOfType(ID) : cast<InvokeInst>(II)->countOperandBundlesOfType(ID);
+  }
+
+  bool isBundleOperand(unsigned Idx) const {
+    InstrTy *II = getInstruction(); return isCall() ? cast<CallInst>(II)->isBundleOperand(Idx) : cast<InvokeInst>(II)->isBundleOperand(Idx);
+  }
+
+  IterTy arg_begin() const {
+    InstrTy *II = getInstruction(); return isCall() ? cast<CallInst>(II)->arg_begin() : cast<InvokeInst>(II)->arg_begin();
+  }
+
+  IterTy arg_end() const {
+    InstrTy *II = getInstruction(); return isCall() ? cast<CallInst>(II)->arg_end() : cast<InvokeInst>(II)->arg_end();
+  }
+
+
+
+
+  void getOperandBundlesAsDefs(SmallVectorImpl<OperandBundleDef> &Defs) const {
+    const Instruction *II = getInstruction();
+
+
+    if (isCall())
+      cast<CallInst>(II)->getOperandBundlesAsDefs(Defs);
+    else
+      cast<InvokeInst>(II)->getOperandBundlesAsDefs(Defs);
+  }
+
+
+  bool doesNotCapture(unsigned OpNo) const {
+    return dataOperandHasImpliedAttr(OpNo + 1, Attribute::NoCapture);
+  }
+
+
+  bool isByValArgument(unsigned ArgNo) const {
+    return paramHasAttr(ArgNo, Attribute::ByVal);
+  }
+
+
+  bool isInAllocaArgument(unsigned ArgNo) const {
+    return paramHasAttr(ArgNo, Attribute::InAlloca);
+  }
+
+
+  bool isByValOrInAllocaArgument(unsigned ArgNo) const {
+    return paramHasAttr(ArgNo, Attribute::ByVal) ||
+           paramHasAttr(ArgNo, Attribute::InAlloca);
+  }
+
+
+
+  bool hasInAllocaArgument() const {
+    return !arg_empty() && paramHasAttr(arg_size() - 1, Attribute::InAlloca);
+  }
+
+  bool doesNotAccessMemory(unsigned OpNo) const {
+    return dataOperandHasImpliedAttr(OpNo + 1, Attribute::ReadNone);
+  }
+
+  bool onlyReadsMemory(unsigned OpNo) const {
+    return dataOperandHasImpliedAttr(OpNo + 1, Attribute::ReadOnly) ||
+           dataOperandHasImpliedAttr(OpNo + 1, Attribute::ReadNone);
+  }
+
+  bool doesNotReadMemory(unsigned OpNo) const {
+    return dataOperandHasImpliedAttr(OpNo + 1, Attribute::WriteOnly) ||
+           dataOperandHasImpliedAttr(OpNo + 1, Attribute::ReadNone);
+  }
+
+
+
+
+  bool isReturnNonNull() const {
+    if (hasRetAttr(Attribute::NonNull))
+      return true;
+    else if (getDereferenceableBytes(AttributeList::ReturnIndex) > 0 &&
+             getType()->getPointerAddressSpace() == 0)
+      return true;
+
+    return false;
+  }
+
+
+
+  bool hasArgument(const Value *Arg) const {
+    for (arg_iterator AI = this->arg_begin(), E = this->arg_end(); AI != E;
+         ++AI)
+      if (AI->get() == Arg)
+        return true;
+    return false;
+  }
+
+private:
+  IterTy getCallee() const {
+    if (isCall())
+      return cast<CallInst>(getInstruction())->op_end() - 1;
+    else
+      return cast<InvokeInst>(getInstruction())->op_end() - 3;
+  }
+};
+
+class CallSite : public CallSiteBase<Function, BasicBlock, Value, User, Use,
+                                     Instruction, CallInst, InvokeInst,
+                                     User::op_iterator> {
+public:
+  CallSite() = default;
+  CallSite(CallSiteBase B) : CallSiteBase(B) {}
+  CallSite(CallInst *CI) : CallSiteBase(CI) {}
+  CallSite(InvokeInst *II) : CallSiteBase(II) {}
+  explicit CallSite(Instruction *II) : CallSiteBase(II) {}
+  explicit CallSite(Value *V) : CallSiteBase(V) {}
+
+  bool operator==(const CallSite &CS) const { return I == CS.I; }
+  bool operator!=(const CallSite &CS) const { return I != CS.I; }
+  bool operator<(const CallSite &CS) const {
+    return getInstruction() < CS.getInstruction();
+  }
+
+private:
+  friend struct DenseMapInfo<CallSite>;
+
+  User::op_iterator getCallee() const;
+};
+
+template <> struct DenseMapInfo<CallSite> {
+  using BaseInfo = DenseMapInfo<decltype(CallSite::I)>;
+
+  static CallSite getEmptyKey() {
+    CallSite CS;
+    CS.I = BaseInfo::getEmptyKey();
+    return CS;
+  }
+
+  static CallSite getTombstoneKey() {
+    CallSite CS;
+    CS.I = BaseInfo::getTombstoneKey();
+    return CS;
+  }
+
+  static unsigned getHashValue(const CallSite &CS) {
+    return BaseInfo::getHashValue(CS.I);
+  }
+
+  static bool isEqual(const CallSite &LHS, const CallSite &RHS) {
+    return LHS == RHS;
+  }
+};
+
+
+class ImmutableCallSite : public CallSiteBase<> {
+public:
+  ImmutableCallSite() = default;
+  ImmutableCallSite(const CallInst *CI) : CallSiteBase(CI) {}
+  ImmutableCallSite(const InvokeInst *II) : CallSiteBase(II) {}
+  explicit ImmutableCallSite(const Instruction *II) : CallSiteBase(II) {}
+  explicit ImmutableCallSite(const Value *V) : CallSiteBase(V) {}
+  ImmutableCallSite(CallSite CS) : CallSiteBase(CS.getInstruction()) {}
+};
+
+}
+
+
+
+
+
+namespace llvm {
+template <typename T> class ArrayRef;
+
+
+
+
+struct VecDesc {
+  StringRef ScalarFnName;
+  StringRef VectorFnName;
+  unsigned VectorizationFactor;
+};
+
+  enum LibFunc {
+
+LibFunc_msvc_new_int,
+
+
+
+LibFunc_msvc_new_int_nothrow,
+
+
+
+LibFunc_msvc_new_longlong,
+
+
+
+LibFunc_msvc_new_longlong_nothrow,
+
+
+
+LibFunc_msvc_delete_ptr32,
+
+
+
+LibFunc_msvc_delete_ptr32_nothrow,
+
+
+
+LibFunc_msvc_delete_ptr32_int,
+
+
+
+LibFunc_msvc_delete_ptr64,
+
+
+
+LibFunc_msvc_delete_ptr64_nothrow,
+
+
+
+LibFunc_msvc_delete_ptr64_longlong,
+
+
+
+LibFunc_msvc_new_array_int,
+
+
+
+LibFunc_msvc_new_array_int_nothrow,
+
+
+
+LibFunc_msvc_new_array_longlong,
+
+
+
+LibFunc_msvc_new_array_longlong_nothrow,
+
+
+
+LibFunc_msvc_delete_array_ptr32,
+
+
+
+LibFunc_msvc_delete_array_ptr32_nothrow,
+
+
+
+LibFunc_msvc_delete_array_ptr32_int,
+
+
+
+LibFunc_msvc_delete_array_ptr64,
+
+
+
+LibFunc_msvc_delete_array_ptr64_nothrow,
+
+
+
+LibFunc_msvc_delete_array_ptr64_longlong,
+
+
+
+LibFunc_under_IO_getc,
+
+
+LibFunc_under_IO_putc,
+
+
+LibFunc_ZdaPv,
+
+
+LibFunc_ZdaPvRKSt9nothrow_t,
+
+
+LibFunc_ZdaPvj,
+
+
+LibFunc_ZdaPvm,
+
+
+LibFunc_ZdlPv,
+
+
+LibFunc_ZdlPvRKSt9nothrow_t,
+
+
+LibFunc_ZdlPvj,
+
+
+LibFunc_ZdlPvm,
+
+
+LibFunc_Znaj,
+
+
+LibFunc_ZnajRKSt9nothrow_t,
+
+
+LibFunc_Znam,
+
+
+LibFunc_ZnamRKSt9nothrow_t,
+
+
+LibFunc_Znwj,
+
+
+LibFunc_ZnwjRKSt9nothrow_t,
+
+
+LibFunc_Znwm,
+
+
+LibFunc_ZnwmRKSt9nothrow_t,
+
+
+LibFunc_acos_finite,
+
+
+LibFunc_acosf_finite,
+
+
+LibFunc_acosh_finite,
+
+
+LibFunc_acoshf_finite,
+
+
+LibFunc_acoshl_finite,
+
+
+LibFunc_acosl_finite,
+
+
+LibFunc_asin_finite,
+
+
+LibFunc_asinf_finite,
+
+
+LibFunc_asinl_finite,
+
+
+LibFunc_atan2_finite,
+
+
+LibFunc_atan2f_finite,
+
+
+LibFunc_atan2l_finite,
+
+
+LibFunc_atanh_finite,
+
+
+LibFunc_atanhf_finite,
+
+
+LibFunc_atanhl_finite,
+
+
+LibFunc_cosh_finite,
+
+
+LibFunc_coshf_finite,
+
+
+LibFunc_coshl_finite,
+
+
+LibFunc_cospi,
+
+
+LibFunc_cospif,
+
+
+LibFunc_cxa_atexit,
+
+
+
+LibFunc_cxa_guard_abort,
+
+
+LibFunc_cxa_guard_acquire,
+
+
+LibFunc_cxa_guard_release,
+
+
+LibFunc_exp10_finite,
+
+
+LibFunc_exp10f_finite,
+
+
+LibFunc_exp10l_finite,
+
+
+LibFunc_exp2_finite,
+
+
+LibFunc_exp2f_finite,
+
+
+LibFunc_exp2l_finite,
+
+
+LibFunc_exp_finite,
+
+
+LibFunc_expf_finite,
+
+
+LibFunc_expl_finite,
+
+
+LibFunc_dunder_isoc99_scanf,
+
+
+LibFunc_dunder_isoc99_sscanf,
+
+
+LibFunc_log10_finite,
+
+
+LibFunc_log10f_finite,
+
+
+LibFunc_log10l_finite,
+
+
+LibFunc_log2_finite,
+
+
+LibFunc_log2f_finite,
+
+
+LibFunc_log2l_finite,
+
+
+LibFunc_log_finite,
+
+
+LibFunc_logf_finite,
+
+
+LibFunc_logl_finite,
+
+
+LibFunc_memcpy_chk,
+
+
+LibFunc_memmove_chk,
+
+
+LibFunc_memset_chk,
+
+
+
+LibFunc_nvvm_reflect,
+
+
+LibFunc_pow_finite,
+
+
+LibFunc_powf_finite,
+
+
+LibFunc_powl_finite,
+
+
+LibFunc_sincospi_stret,
+
+
+LibFunc_sincospif_stret,
+
+
+LibFunc_sinh_finite,
+
+
+LibFunc_sinhf_finite,
+
+
+LibFunc_sinhl_finite,
+
+
+LibFunc_sinpi,
+
+
+LibFunc_sinpif,
+
+
+LibFunc_sqrt_finite,
+
+
+LibFunc_sqrtf_finite,
+
+
+LibFunc_sqrtl_finite,
+
+
+LibFunc_stpcpy_chk,
+
+
+LibFunc_stpncpy_chk,
+
+
+LibFunc_strcpy_chk,
+
+
+LibFunc_dunder_strdup,
+
+
+LibFunc_strncpy_chk,
+
+
+LibFunc_dunder_strndup,
+
+
+LibFunc_dunder_strtok_r,
+
+
+LibFunc_abs,
+
+
+LibFunc_access,
+
+
+LibFunc_acos,
+
+
+LibFunc_acosf,
+
+
+LibFunc_acosh,
+
+
+LibFunc_acoshf,
+
+
+LibFunc_acoshl,
+
+
+LibFunc_acosl,
+
+
+LibFunc_asin,
+
+
+LibFunc_asinf,
+
+
+LibFunc_asinh,
+
+
+LibFunc_asinhf,
+
+
+LibFunc_asinhl,
+
+
+LibFunc_asinl,
+
+
+LibFunc_atan,
+
+
+LibFunc_atan2,
+
+
+LibFunc_atan2f,
+
+
+LibFunc_atan2l,
+
+
+LibFunc_atanf,
+
+
+LibFunc_atanh,
+
+
+LibFunc_atanhf,
+
+
+LibFunc_atanhl,
+
+
+LibFunc_atanl,
+
+
+LibFunc_atof,
+
+
+LibFunc_atoi,
+
+
+LibFunc_atol,
+
+
+LibFunc_atoll,
+
+
+LibFunc_bcmp,
+
+
+LibFunc_bcopy,
+
+
+LibFunc_bzero,
+
+
+LibFunc_cabs,
+
+
+LibFunc_cabsf,
+
+
+LibFunc_cabsl,
+
+
+LibFunc_calloc,
+
+
+LibFunc_cbrt,
+
+
+LibFunc_cbrtf,
+
+
+LibFunc_cbrtl,
+
+
+LibFunc_ceil,
+
+
+LibFunc_ceilf,
+
+
+LibFunc_ceill,
+
+
+LibFunc_chmod,
+
+
+LibFunc_chown,
+
+
+LibFunc_clearerr,
+
+
+LibFunc_closedir,
+
+
+LibFunc_copysign,
+
+
+LibFunc_copysignf,
+
+
+LibFunc_copysignl,
+
+
+LibFunc_cos,
+
+
+LibFunc_cosf,
+
+
+LibFunc_cosh,
+
+
+LibFunc_coshf,
+
+
+LibFunc_coshl,
+
+
+LibFunc_cosl,
+
+
+LibFunc_ctermid,
+
+
+LibFunc_exp,
+
+
+LibFunc_exp10,
+
+
+LibFunc_exp10f,
+
+
+LibFunc_exp10l,
+
+
+LibFunc_exp2,
+
+
+LibFunc_exp2f,
+
+
+LibFunc_exp2l,
+
+
+LibFunc_expf,
+
+
+LibFunc_expl,
+
+
+LibFunc_expm1,
+
+
+LibFunc_expm1f,
+
+
+LibFunc_expm1l,
+
+
+LibFunc_fabs,
+
+
+LibFunc_fabsf,
+
+
+LibFunc_fabsl,
+
+
+LibFunc_fclose,
+
+
+LibFunc_fdopen,
+
+
+LibFunc_feof,
+
+
+LibFunc_ferror,
+
+
+LibFunc_fflush,
+
+
+LibFunc_ffs,
+
+
+LibFunc_ffsl,
+
+
+LibFunc_ffsll,
+
+
+LibFunc_fgetc,
+
+
+LibFunc_fgetpos,
+
+
+LibFunc_fgets,
+
+
+LibFunc_fileno,
+
+
+LibFunc_fiprintf,
+
+
+LibFunc_flockfile,
+
+
+LibFunc_floor,
+
+
+LibFunc_floorf,
+
+
+LibFunc_floorl,
+
+
+LibFunc_fls,
+
+
+LibFunc_flsl,
+
+
+LibFunc_flsll,
+
+
+LibFunc_fmax,
+
+
+LibFunc_fmaxf,
+
+
+LibFunc_fmaxl,
+
+
+LibFunc_fmin,
+
+
+LibFunc_fminf,
+
+
+LibFunc_fminl,
+
+
+LibFunc_fmod,
+
+
+LibFunc_fmodf,
+
+
+LibFunc_fmodl,
+
+
+LibFunc_fopen,
+
+
+LibFunc_fopen64,
+
+
+LibFunc_fprintf,
+
+
+LibFunc_fputc,
+
+
+LibFunc_fputs,
+
+
+LibFunc_fread,
+
+
+LibFunc_free,
+
+
+LibFunc_frexp,
+
+
+LibFunc_frexpf,
+
+
+LibFunc_frexpl,
+
+
+LibFunc_fscanf,
+
+
+LibFunc_fseek,
+
+
+LibFunc_fseeko,
+
+
+LibFunc_fseeko64,
+
+
+LibFunc_fsetpos,
+
+
+LibFunc_fstat,
+
+
+LibFunc_fstat64,
+
+
+LibFunc_fstatvfs,
+
+
+LibFunc_fstatvfs64,
+
+
+LibFunc_ftell,
+
+
+LibFunc_ftello,
+
+
+LibFunc_ftello64,
+
+
+LibFunc_ftrylockfile,
+
+
+LibFunc_funlockfile,
+
+
+LibFunc_fwrite,
+
+
+LibFunc_getc,
+
+
+LibFunc_getc_unlocked,
+
+
+LibFunc_getchar,
+
+
+LibFunc_getenv,
+
+
+LibFunc_getitimer,
+
+
+LibFunc_getlogin_r,
+
+
+LibFunc_getpwnam,
+
+
+LibFunc_gets,
+
+
+LibFunc_gettimeofday,
+
+
+LibFunc_htonl,
+
+
+LibFunc_htons,
+
+
+LibFunc_iprintf,
+
+
+LibFunc_isascii,
+
+
+LibFunc_isdigit,
+
+
+LibFunc_labs,
+
+
+LibFunc_lchown,
+
+
+LibFunc_ldexp,
+
+
+LibFunc_ldexpf,
+
+
+LibFunc_ldexpl,
+
+
+LibFunc_llabs,
+
+
+LibFunc_log,
+
+
+LibFunc_log10,
+
+
+LibFunc_log10f,
+
+
+LibFunc_log10l,
+
+
+LibFunc_log1p,
+
+
+LibFunc_log1pf,
+
+
+LibFunc_log1pl,
+
+
+LibFunc_log2,
+
+
+LibFunc_log2f,
+
+
+LibFunc_log2l,
+
+
+LibFunc_logb,
+
+
+LibFunc_logbf,
+
+
+LibFunc_logbl,
+
+
+LibFunc_logf,
+
+
+LibFunc_logl,
+
+
+LibFunc_lstat,
+
+
+LibFunc_lstat64,
+
+
+LibFunc_malloc,
+
+
+LibFunc_memalign,
+
+
+LibFunc_memccpy,
+
+
+LibFunc_memchr,
+
+
+LibFunc_memcmp,
+
+
+LibFunc_memcpy,
+
+
+LibFunc_memmove,
+
+
+LibFunc_mempcpy,
+
+
+LibFunc_memrchr,
+
+
+LibFunc_memset,
+
+
+LibFunc_memset_pattern16,
+
+
+LibFunc_mkdir,
+
+
+LibFunc_mktime,
+
+
+LibFunc_modf,
+
+
+LibFunc_modff,
+
+
+LibFunc_modfl,
+
+
+
+LibFunc_nearbyint,
+
+
+LibFunc_nearbyintf,
+
+
+LibFunc_nearbyintl,
+
+
+LibFunc_ntohl,
+
+
+LibFunc_ntohs,
+
+
+LibFunc_open,
+
+
+LibFunc_open64,
+
+
+LibFunc_opendir,
+
+
+LibFunc_pclose,
+
+
+LibFunc_perror,
+
+
+LibFunc_popen,
+
+
+LibFunc_posix_memalign,
+
+
+LibFunc_pow,
+
+
+LibFunc_powf,
+
+
+LibFunc_powl,
+
+
+LibFunc_pread,
+
+
+LibFunc_printf,
+
+
+LibFunc_putc,
+
+
+LibFunc_putchar,
+
+
+LibFunc_puts,
+
+
+LibFunc_pwrite,
+
+
+
+LibFunc_qsort,
+
+
+LibFunc_read,
+
+
+LibFunc_readlink,
+
+
+LibFunc_realloc,
+
+
+LibFunc_reallocf,
+
+
+LibFunc_realpath,
+
+
+LibFunc_remove,
+
+
+LibFunc_rename,
+
+
+LibFunc_rewind,
+
+
+LibFunc_rint,
+
+
+LibFunc_rintf,
+
+
+LibFunc_rintl,
+
+
+LibFunc_rmdir,
+
+
+LibFunc_round,
+
+
+LibFunc_roundf,
+
+
+LibFunc_roundl,
+
+
+LibFunc_scanf,
+
+
+LibFunc_setbuf,
+
+
+
+LibFunc_setitimer,
+
+
+LibFunc_setvbuf,
+
+
+LibFunc_sin,
+
+
+LibFunc_sinf,
+
+
+LibFunc_sinh,
+
+
+LibFunc_sinhf,
+
+
+LibFunc_sinhl,
+
+
+LibFunc_sinl,
+
+
+LibFunc_siprintf,
+
+
+LibFunc_snprintf,
+
+
+LibFunc_sprintf,
+
+
+LibFunc_sqrt,
+
+
+LibFunc_sqrtf,
+
+
+LibFunc_sqrtl,
+
+
+LibFunc_sscanf,
+
+
+LibFunc_stat,
+
+
+LibFunc_stat64,
+
+
+LibFunc_statvfs,
+
+
+LibFunc_statvfs64,
+
+
+LibFunc_stpcpy,
+
+
+LibFunc_stpncpy,
+
+
+LibFunc_strcasecmp,
+
+
+LibFunc_strcat,
+
+
+LibFunc_strchr,
+
+
+LibFunc_strcmp,
+
+
+LibFunc_strcoll,
+
+
+LibFunc_strcpy,
+
+
+LibFunc_strcspn,
+
+
+LibFunc_strdup,
+
+
+LibFunc_strlen,
+
+
+LibFunc_strncasecmp,
+
+
+LibFunc_strncat,
+
+
+LibFunc_strncmp,
+
+
+LibFunc_strncpy,
+
+
+LibFunc_strndup,
+
+
+LibFunc_strnlen,
+
+
+LibFunc_strpbrk,
+
+
+LibFunc_strrchr,
+
+
+LibFunc_strspn,
+
+
+LibFunc_strstr,
+
+
+LibFunc_strtod,
+
+
+LibFunc_strtof,
+
+
+LibFunc_strtok,
+
+
+LibFunc_strtok_r,
+
+
+LibFunc_strtol,
+
+
+LibFunc_strtold,
+
+
+LibFunc_strtoll,
+
+
+LibFunc_strtoul,
+
+
+LibFunc_strtoull,
+
+
+LibFunc_strxfrm,
+
+
+LibFunc_system,
+
+
+LibFunc_tan,
+
+
+LibFunc_tanf,
+
+
+LibFunc_tanh,
+
+
+LibFunc_tanhf,
+
+
+LibFunc_tanhl,
+
+
+LibFunc_tanl,
+
+
+LibFunc_times,
+
+
+LibFunc_tmpfile,
+
+
+LibFunc_tmpfile64,
+
+
+LibFunc_toascii,
+
+
+LibFunc_trunc,
+
+
+LibFunc_truncf,
+
+
+LibFunc_truncl,
+
+
+LibFunc_uname,
+
+
+LibFunc_ungetc,
+
+
+LibFunc_unlink,
+
+
+LibFunc_unsetenv,
+
+
+LibFunc_utime,
+
+
+LibFunc_utimes,
+
+
+LibFunc_valloc,
+
+
+LibFunc_vfprintf,
+
+
+LibFunc_vfscanf,
+
+
+LibFunc_vprintf,
+
+
+LibFunc_vscanf,
+
+
+LibFunc_vsnprintf,
+
+
+LibFunc_vsprintf,
+
+
+LibFunc_vsscanf,
+
+
+LibFunc_wcslen,
+
+
+LibFunc_write,
+
+
+    NumLibFuncs
+  };
+
+
+
+
+
+
+
+class TargetLibraryInfoImpl {
+  friend class TargetLibraryInfo;
+
+  unsigned char AvailableArray[(NumLibFuncs+3)/4];
+  llvm::DenseMap<unsigned, std::string> CustomNames;
+  static StringRef const StandardNames[NumLibFuncs];
+  bool ShouldExtI32Param, ShouldExtI32Return, ShouldSignExtI32Param;
+
+  enum AvailabilityState {
+    StandardName = 3,
+    CustomName = 1,
+    Unavailable = 0
+  };
+  void setState(LibFunc F, AvailabilityState State) {
+    AvailableArray[F/4] &= ~(3 << 2*(F&3));
+    AvailableArray[F/4] |= State << 2*(F&3);
+  }
+  AvailabilityState getState(LibFunc F) const {
+    return static_cast<AvailabilityState>((AvailableArray[F/4] >> 2*(F&3)) & 3);
+  }
+
+
+  std::vector<VecDesc> VectorDescs;
+
+
+  std::vector<VecDesc> ScalarDescs;
+
+
+
+  bool isValidProtoForLibFunc(const FunctionType &FTy, LibFunc F,
+                              const DataLayout *DL) const;
+
+public:
+
+
+
+
+
+
+
+  enum VectorLibrary {
+    NoLibrary,
+    Accelerate,
+    SVML
+  };
+
+  TargetLibraryInfoImpl();
+  explicit TargetLibraryInfoImpl(const Triple &T);
+
+
+  TargetLibraryInfoImpl(const TargetLibraryInfoImpl &TLI);
+  TargetLibraryInfoImpl(TargetLibraryInfoImpl &&TLI);
+  TargetLibraryInfoImpl &operator=(const TargetLibraryInfoImpl &TLI);
+  TargetLibraryInfoImpl &operator=(TargetLibraryInfoImpl &&TLI);
+
+
+
+
+
+  bool getLibFunc(StringRef funcName, LibFunc &F) const;
+
+
+
+
+
+
+  bool getLibFunc(const Function &FDecl, LibFunc &F) const;
+
+
+  void setUnavailable(LibFunc F) {
+    setState(F, Unavailable);
+  }
+
+
+  void setAvailable(LibFunc F) {
+    setState(F, StandardName);
+  }
+
+
+
+  void setAvailableWithName(LibFunc F, StringRef Name) {
+    if (StandardNames[F] != Name) {
+      setState(F, CustomName);
+      CustomNames[F] = Name;
+      
+     ((
+     CustomNames.find(F) != CustomNames.end()
+     ) ? static_cast<void> (0) : __assert_fail (
+     "CustomNames.find(F) != CustomNames.end()"
+     , "/home/trippels/llvm/llvm/include/llvm/Analysis/TargetLibraryInfo.h", 131, __PRETTY_FUNCTION__))
+                                                     ;
+    } else {
+      setState(F, StandardName);
+    }
+  }
+
+
+
+
+  void disableAllFunctions();
+
+
+
+  void addVectorizableFunctions(ArrayRef<VecDesc> Fns);
+
+
+
+  void addVectorizableFunctionsFromVecLib(enum VectorLibrary VecLib);
+
+
+
+  bool isFunctionVectorizable(StringRef F, unsigned VF) const {
+    return !getVectorizedFunction(F, VF).empty();
+  }
+
+
+
+  bool isFunctionVectorizable(StringRef F) const;
+
+
+
+  StringRef getVectorizedFunction(StringRef F, unsigned VF) const;
+
+
+
+  bool isFunctionScalarizable(StringRef F, unsigned &VF) const {
+    return !getScalarizedFunction(F, VF).empty();
+  }
+
+
+
+
+
+  StringRef getScalarizedFunction(StringRef F, unsigned &VF) const;
+
+
+
+
+  void setShouldExtI32Param(bool Val) {
+    ShouldExtI32Param = Val;
+  }
+
+
+
+
+  void setShouldExtI32Return(bool Val) {
+    ShouldExtI32Return = Val;
+  }
+
+
+
+  void setShouldSignExtI32Param(bool Val) {
+    ShouldSignExtI32Param = Val;
+  }
+
+
+
+  unsigned getWCharSize(const Module &M) const;
+};
+
+
+
+
+
+
+class TargetLibraryInfo {
+  friend class TargetLibraryAnalysis;
+  friend class TargetLibraryInfoWrapperPass;
+
+  const TargetLibraryInfoImpl *Impl;
+
+public:
+  explicit TargetLibraryInfo(const TargetLibraryInfoImpl &Impl) : Impl(&Impl) {}
+
+
+  TargetLibraryInfo(const TargetLibraryInfo &TLI) : Impl(TLI.Impl) {}
+  TargetLibraryInfo(TargetLibraryInfo &&TLI) : Impl(TLI.Impl) {}
+  TargetLibraryInfo &operator=(const TargetLibraryInfo &TLI) {
+    Impl = TLI.Impl;
+    return *this;
+  }
+  TargetLibraryInfo &operator=(TargetLibraryInfo &&TLI) {
+    Impl = TLI.Impl;
+    return *this;
+  }
+
+
+
+
+
+  bool getLibFunc(StringRef funcName, LibFunc &F) const {
+    return Impl->getLibFunc(funcName, F);
+  }
+
+  bool getLibFunc(const Function &FDecl, LibFunc &F) const {
+    return Impl->getLibFunc(FDecl, F);
+  }
+
+
+
+  bool getLibFunc(ImmutableCallSite CS, LibFunc &F) const {
+    return !CS.isNoBuiltin() && CS.getCalledFunction() &&
+           getLibFunc(*(CS.getCalledFunction()), F);
+  }
+
+
+  bool has(LibFunc F) const {
+    return Impl->getState(F) != TargetLibraryInfoImpl::Unavailable;
+  }
+  bool isFunctionVectorizable(StringRef F, unsigned VF) const {
+    return Impl->isFunctionVectorizable(F, VF);
+  }
+  bool isFunctionVectorizable(StringRef F) const {
+    return Impl->isFunctionVectorizable(F);
+  }
+  StringRef getVectorizedFunction(StringRef F, unsigned VF) const {
+    return Impl->getVectorizedFunction(F, VF);
+  }
+
+
+
+  bool hasOptimizedCodeGen(LibFunc F) const {
+    if (Impl->getState(F) == TargetLibraryInfoImpl::Unavailable)
+      return false;
+    switch (F) {
+    default: break;
+    case LibFunc_copysign: case LibFunc_copysignf: case LibFunc_copysignl:
+    case LibFunc_fabs: case LibFunc_fabsf: case LibFunc_fabsl:
+    case LibFunc_sin: case LibFunc_sinf: case LibFunc_sinl:
+    case LibFunc_cos: case LibFunc_cosf: case LibFunc_cosl:
+    case LibFunc_sqrt: case LibFunc_sqrtf: case LibFunc_sqrtl:
+    case LibFunc_sqrt_finite: case LibFunc_sqrtf_finite:
+                                                   case LibFunc_sqrtl_finite:
+    case LibFunc_fmax: case LibFunc_fmaxf: case LibFunc_fmaxl:
+    case LibFunc_fmin: case LibFunc_fminf: case LibFunc_fminl:
+    case LibFunc_floor: case LibFunc_floorf: case LibFunc_floorl:
+    case LibFunc_nearbyint: case LibFunc_nearbyintf: case LibFunc_nearbyintl:
+    case LibFunc_ceil: case LibFunc_ceilf: case LibFunc_ceill:
+    case LibFunc_rint: case LibFunc_rintf: case LibFunc_rintl:
+    case LibFunc_round: case LibFunc_roundf: case LibFunc_roundl:
+    case LibFunc_trunc: case LibFunc_truncf: case LibFunc_truncl:
+    case LibFunc_log2: case LibFunc_log2f: case LibFunc_log2l:
+    case LibFunc_exp2: case LibFunc_exp2f: case LibFunc_exp2l:
+    case LibFunc_memcmp: case LibFunc_strcmp: case LibFunc_strcpy:
+    case LibFunc_stpcpy: case LibFunc_strlen: case LibFunc_strnlen:
+    case LibFunc_memchr: case LibFunc_mempcpy:
+      return true;
+    }
+    return false;
+  }
+
+  StringRef getName(LibFunc F) const {
+    auto State = Impl->getState(F);
+    if (State == TargetLibraryInfoImpl::Unavailable)
+      return StringRef();
+    if (State == TargetLibraryInfoImpl::StandardName)
+      return Impl->StandardNames[F];
+    
+   ((
+   State == TargetLibraryInfoImpl::CustomName
+   ) ? static_cast<void> (0) : __assert_fail (
+   "State == TargetLibraryInfoImpl::CustomName"
+   , "/home/trippels/llvm/llvm/include/llvm/Analysis/TargetLibraryInfo.h", 298, __PRETTY_FUNCTION__))
+                                                     ;
+    return Impl->CustomNames.find(F)->second;
+  }
+
+
+
+
+  Attribute::AttrKind getExtAttrForI32Param(bool Signed = true) const {
+    if (Impl->ShouldExtI32Param)
+      return Signed ? Attribute::SExt : Attribute::ZExt;
+    if (Impl->ShouldSignExtI32Param)
+      return Attribute::SExt;
+    return Attribute::None;
+  }
+
+
+
+
+  Attribute::AttrKind getExtAttrForI32Return(bool Signed = true) const {
+    if (Impl->ShouldExtI32Return)
+      return Signed ? Attribute::SExt : Attribute::ZExt;
+    return Attribute::None;
+  }
+
+
+  unsigned getWCharSize(const Module &M) const {
+    return Impl->getWCharSize(M);
+  }
+
+
+
+
+
+  bool invalidate(Module &, const PreservedAnalyses &,
+                  ModuleAnalysisManager::Invalidator &) {
+    return false;
+  }
+  bool invalidate(Function &, const PreservedAnalyses &,
+                  FunctionAnalysisManager::Invalidator &) {
+    return false;
+  }
+};
+
+
+
+
+
+class TargetLibraryAnalysis : public AnalysisInfoMixin<TargetLibraryAnalysis> {
+public:
+  typedef TargetLibraryInfo Result;
+
+
+
+
+
+  TargetLibraryAnalysis() {}
+
+
+
+
+
+  TargetLibraryAnalysis(TargetLibraryInfoImpl PresetInfoImpl)
+      : PresetInfoImpl(std::move(PresetInfoImpl)) {}
+
+  TargetLibraryInfo run(Module &M, ModuleAnalysisManager &);
+  TargetLibraryInfo run(Function &F, FunctionAnalysisManager &);
+
+private:
+  friend AnalysisInfoMixin<TargetLibraryAnalysis>;
+  static AnalysisKey Key;
+
+  Optional<TargetLibraryInfoImpl> PresetInfoImpl;
+
+  StringMap<std::unique_ptr<TargetLibraryInfoImpl>> Impls;
+
+  TargetLibraryInfoImpl &lookupInfoImpl(const Triple &T);
+};
+
+class TargetLibraryInfoWrapperPass : public ImmutablePass {
+  TargetLibraryInfoImpl TLIImpl;
+  TargetLibraryInfo TLI;
+
+  virtual void anchor();
+
+public:
+  static char ID;
+  TargetLibraryInfoWrapperPass();
+  explicit TargetLibraryInfoWrapperPass(const Triple &T);
+  explicit TargetLibraryInfoWrapperPass(const TargetLibraryInfoImpl &TLI);
+
+  TargetLibraryInfo &getTLI() { return TLI; }
+  const TargetLibraryInfo &getTLI() const { return TLI; }
+};
+
+}
+namespace llvm {
+
+
+class ConstantFolder {
+public:
+  explicit ConstantFolder() = default;
+
+
+
+
+
+  Constant *CreateAdd(Constant *LHS, Constant *RHS,
+                      bool HasNUW = false, bool HasNSW = false) const {
+    return ConstantExpr::getAdd(LHS, RHS, HasNUW, HasNSW);
+  }
+
+  Constant *CreateFAdd(Constant *LHS, Constant *RHS) const {
+    return ConstantExpr::getFAdd(LHS, RHS);
+  }
+
+  Constant *CreateSub(Constant *LHS, Constant *RHS,
+                      bool HasNUW = false, bool HasNSW = false) const {
+    return ConstantExpr::getSub(LHS, RHS, HasNUW, HasNSW);
+  }
+
+  Constant *CreateFSub(Constant *LHS, Constant *RHS) const {
+    return ConstantExpr::getFSub(LHS, RHS);
+  }
+
+  Constant *CreateMul(Constant *LHS, Constant *RHS,
+                      bool HasNUW = false, bool HasNSW = false) const {
+    return ConstantExpr::getMul(LHS, RHS, HasNUW, HasNSW);
+  }
+
+  Constant *CreateFMul(Constant *LHS, Constant *RHS) const {
+    return ConstantExpr::getFMul(LHS, RHS);
+  }
+
+  Constant *CreateUDiv(Constant *LHS, Constant *RHS,
+                       bool isExact = false) const {
+    return ConstantExpr::getUDiv(LHS, RHS, isExact);
+  }
+
+  Constant *CreateSDiv(Constant *LHS, Constant *RHS,
+                       bool isExact = false) const {
+    return ConstantExpr::getSDiv(LHS, RHS, isExact);
+  }
+
+  Constant *CreateFDiv(Constant *LHS, Constant *RHS) const {
+    return ConstantExpr::getFDiv(LHS, RHS);
+  }
+
+  Constant *CreateURem(Constant *LHS, Constant *RHS) const {
+    return ConstantExpr::getURem(LHS, RHS);
+  }
+
+  Constant *CreateSRem(Constant *LHS, Constant *RHS) const {
+    return ConstantExpr::getSRem(LHS, RHS);
+  }
+
+  Constant *CreateFRem(Constant *LHS, Constant *RHS) const {
+    return ConstantExpr::getFRem(LHS, RHS);
+  }
+
+  Constant *CreateShl(Constant *LHS, Constant *RHS,
+                      bool HasNUW = false, bool HasNSW = false) const {
+    return ConstantExpr::getShl(LHS, RHS, HasNUW, HasNSW);
+  }
+
+  Constant *CreateLShr(Constant *LHS, Constant *RHS,
+                       bool isExact = false) const {
+    return ConstantExpr::getLShr(LHS, RHS, isExact);
+  }
+
+  Constant *CreateAShr(Constant *LHS, Constant *RHS,
+                       bool isExact = false) const {
+    return ConstantExpr::getAShr(LHS, RHS, isExact);
+  }
+
+  Constant *CreateAnd(Constant *LHS, Constant *RHS) const {
+    return ConstantExpr::getAnd(LHS, RHS);
+  }
+
+  Constant *CreateOr(Constant *LHS, Constant *RHS) const {
+    return ConstantExpr::getOr(LHS, RHS);
+  }
+
+  Constant *CreateXor(Constant *LHS, Constant *RHS) const {
+    return ConstantExpr::getXor(LHS, RHS);
+  }
+
+  Constant *CreateBinOp(Instruction::BinaryOps Opc,
+                        Constant *LHS, Constant *RHS) const {
+    return ConstantExpr::get(Opc, LHS, RHS);
+  }
+
+
+
+
+
+  Constant *CreateNeg(Constant *C,
+                      bool HasNUW = false, bool HasNSW = false) const {
+    return ConstantExpr::getNeg(C, HasNUW, HasNSW);
+  }
+
+  Constant *CreateFNeg(Constant *C) const {
+    return ConstantExpr::getFNeg(C);
+  }
+
+  Constant *CreateNot(Constant *C) const {
+    return ConstantExpr::getNot(C);
+  }
+
+
+
+
+
+  Constant *CreateGetElementPtr(Type *Ty, Constant *C,
+                                ArrayRef<Constant *> IdxList) const {
+    return ConstantExpr::getGetElementPtr(Ty, C, IdxList);
+  }
+
+  Constant *CreateGetElementPtr(Type *Ty, Constant *C, Constant *Idx) const {
+
+
+
+    return ConstantExpr::getGetElementPtr(Ty, C, Idx);
+  }
+
+  Constant *CreateGetElementPtr(Type *Ty, Constant *C,
+                                ArrayRef<Value *> IdxList) const {
+    return ConstantExpr::getGetElementPtr(Ty, C, IdxList);
+  }
+
+  Constant *CreateInBoundsGetElementPtr(Type *Ty, Constant *C,
+                                        ArrayRef<Constant *> IdxList) const {
+    return ConstantExpr::getInBoundsGetElementPtr(Ty, C, IdxList);
+  }
+
+  Constant *CreateInBoundsGetElementPtr(Type *Ty, Constant *C,
+                                        Constant *Idx) const {
+
+
+
+    return ConstantExpr::getInBoundsGetElementPtr(Ty, C, Idx);
+  }
+
+  Constant *CreateInBoundsGetElementPtr(Type *Ty, Constant *C,
+                                        ArrayRef<Value *> IdxList) const {
+    return ConstantExpr::getInBoundsGetElementPtr(Ty, C, IdxList);
+  }
+
+
+
+
+
+  Constant *CreateCast(Instruction::CastOps Op, Constant *C,
+                       Type *DestTy) const {
+    return ConstantExpr::getCast(Op, C, DestTy);
+  }
+
+  Constant *CreatePointerCast(Constant *C, Type *DestTy) const {
+    return ConstantExpr::getPointerCast(C, DestTy);
+  }
+
+  Constant *CreatePointerBitCastOrAddrSpaceCast(Constant *C,
+                                                Type *DestTy) const {
+    return ConstantExpr::getPointerBitCastOrAddrSpaceCast(C, DestTy);
+  }
+
+  Constant *CreateIntCast(Constant *C, Type *DestTy,
+                          bool isSigned) const {
+    return ConstantExpr::getIntegerCast(C, DestTy, isSigned);
+  }
+
+  Constant *CreateFPCast(Constant *C, Type *DestTy) const {
+    return ConstantExpr::getFPCast(C, DestTy);
+  }
+
+  Constant *CreateBitCast(Constant *C, Type *DestTy) const {
+    return CreateCast(Instruction::BitCast, C, DestTy);
+  }
+
+  Constant *CreateIntToPtr(Constant *C, Type *DestTy) const {
+    return CreateCast(Instruction::IntToPtr, C, DestTy);
+  }
+
+  Constant *CreatePtrToInt(Constant *C, Type *DestTy) const {
+    return CreateCast(Instruction::PtrToInt, C, DestTy);
+  }
+
+  Constant *CreateZExtOrBitCast(Constant *C, Type *DestTy) const {
+    return ConstantExpr::getZExtOrBitCast(C, DestTy);
+  }
+
+  Constant *CreateSExtOrBitCast(Constant *C, Type *DestTy) const {
+    return ConstantExpr::getSExtOrBitCast(C, DestTy);
+  }
+
+  Constant *CreateTruncOrBitCast(Constant *C, Type *DestTy) const {
+    return ConstantExpr::getTruncOrBitCast(C, DestTy);
+  }
+
+
+
+
+
+  Constant *CreateICmp(CmpInst::Predicate P, Constant *LHS,
+                       Constant *RHS) const {
+    return ConstantExpr::getCompare(P, LHS, RHS);
+  }
+
+  Constant *CreateFCmp(CmpInst::Predicate P, Constant *LHS,
+                       Constant *RHS) const {
+    return ConstantExpr::getCompare(P, LHS, RHS);
+  }
+
+
+
+
+
+  Constant *CreateSelect(Constant *C, Constant *True, Constant *False) const {
+    return ConstantExpr::getSelect(C, True, False);
+  }
+
+  Constant *CreateExtractElement(Constant *Vec, Constant *Idx) const {
+    return ConstantExpr::getExtractElement(Vec, Idx);
+  }
+
+  Constant *CreateInsertElement(Constant *Vec, Constant *NewElt,
+                                Constant *Idx) const {
+    return ConstantExpr::getInsertElement(Vec, NewElt, Idx);
+  }
+
+  Constant *CreateShuffleVector(Constant *V1, Constant *V2,
+                                Constant *Mask) const {
+    return ConstantExpr::getShuffleVector(V1, V2, Mask);
+  }
+
+  Constant *CreateExtractValue(Constant *Agg,
+                               ArrayRef<unsigned> IdxList) const {
+    return ConstantExpr::getExtractValue(Agg, IdxList);
+  }
+
+  Constant *CreateInsertValue(Constant *Agg, Constant *Val,
+                              ArrayRef<unsigned> IdxList) const {
+    return ConstantExpr::getInsertValue(Agg, Val, IdxList);
+  }
+};
+
+}
+namespace llvm {
+
+class Type;
+class FunctionType;
+class Function;
+class LLVMContext;
+class Module;
+class AttributeList;
+
+
+
+
+namespace Intrinsic {
+  enum ID : unsigned {
+    not_intrinsic = 0,
+
+
+
+    addressofreturnaddress,
+    adjust_trampoline,
+    annotation,
+    assume,
+    bitreverse,
+    bswap,
+    canonicalize,
+    ceil,
+    clear_cache,
+    codeview_annotation,
+    convert_from_fp16,
+    convert_to_fp16,
+    copysign,
+    coro_alloc,
+    coro_begin,
+    coro_destroy,
+    coro_done,
+    coro_end,
+    coro_frame,
+    coro_free,
+    coro_id,
+    coro_param,
+    coro_promise,
+    coro_resume,
+    coro_save,
+    coro_size,
+    coro_subfn_addr,
+    coro_suspend,
+    cos,
+    ctlz,
+    ctpop,
+    cttz,
+    dbg_addr,
+    dbg_declare,
+    dbg_value,
+    debugtrap,
+    donothing,
+    eh_dwarf_cfa,
+    eh_exceptioncode,
+    eh_exceptionpointer,
+    eh_return_i32,
+    eh_return_i64,
+    eh_sjlj_callsite,
+    eh_sjlj_functioncontext,
+    eh_sjlj_longjmp,
+    eh_sjlj_lsda,
+    eh_sjlj_setjmp,
+    eh_sjlj_setup_dispatch,
+    eh_typeid_for,
+    eh_unwind_init,
+    exp,
+    exp2,
+    expect,
+    experimental_constrained_cos,
+    experimental_constrained_exp,
+    experimental_constrained_exp2,
+    experimental_constrained_fadd,
+    experimental_constrained_fdiv,
+    experimental_constrained_fma,
+    experimental_constrained_fmul,
+    experimental_constrained_frem,
+    experimental_constrained_fsub,
+    experimental_constrained_log,
+    experimental_constrained_log10,
+    experimental_constrained_log2,
+    experimental_constrained_nearbyint,
+    experimental_constrained_pow,
+    experimental_constrained_powi,
+    experimental_constrained_rint,
+    experimental_constrained_sin,
+    experimental_constrained_sqrt,
+    experimental_deoptimize,
+    experimental_gc_relocate,
+    experimental_gc_result,
+    experimental_gc_statepoint,
+    experimental_guard,
+    experimental_patchpoint_i64,
+    experimental_patchpoint_void,
+    experimental_stackmap,
+    experimental_vector_reduce_add,
+    experimental_vector_reduce_and,
+    experimental_vector_reduce_fadd,
+    experimental_vector_reduce_fmax,
+    experimental_vector_reduce_fmin,
+    experimental_vector_reduce_fmul,
+    experimental_vector_reduce_mul,
+    experimental_vector_reduce_or,
+    experimental_vector_reduce_smax,
+    experimental_vector_reduce_smin,
+    experimental_vector_reduce_umax,
+    experimental_vector_reduce_umin,
+    experimental_vector_reduce_xor,
+    fabs,
+    floor,
+    flt_rounds,
+    fma,
+    fmuladd,
+    frameaddress,
+    gcread,
+    gcroot,
+    gcwrite,
+    get_dynamic_area_offset,
+    init_trampoline,
+    instrprof_increment,
+    instrprof_increment_step,
+    instrprof_value_profile,
+    invariant_end,
+    invariant_group_barrier,
+    invariant_start,
+    lifetime_end,
+    lifetime_start,
+    load_relative,
+    localaddress,
+    localescape,
+    localrecover,
+    log,
+    log10,
+    log2,
+    longjmp,
+    masked_compressstore,
+    masked_expandload,
+    masked_gather,
+    masked_load,
+    masked_scatter,
+    masked_store,
+    maxnum,
+    memcpy,
+    memcpy_element_unordered_atomic,
+    memmove,
+    memmove_element_unordered_atomic,
+    memset,
+    memset_element_unordered_atomic,
+    minnum,
+    nearbyint,
+    objectsize,
+    pcmarker,
+    pow,
+    powi,
+    prefetch,
+    ptr_annotation,
+    read_register,
+    readcyclecounter,
+    returnaddress,
+    rint,
+    round,
+    sadd_with_overflow,
+    setjmp,
+    sideeffect,
+    siglongjmp,
+    sigsetjmp,
+    sin,
+    smul_with_overflow,
+    sqrt,
+    ssa_copy,
+    ssub_with_overflow,
+    stackguard,
+    stackprotector,
+    stackrestore,
+    stacksave,
+    thread_pointer,
+    trap,
+    trunc,
+    type_checked_load,
+    type_test,
+    uadd_with_overflow,
+    umul_with_overflow,
+    usub_with_overflow,
+    vacopy,
+    vaend,
+    vastart,
+    var_annotation,
+    write_register,
+    xray_customevent,
+    aarch64_clrex,
+    aarch64_crc32b,
+    aarch64_crc32cb,
+    aarch64_crc32ch,
+    aarch64_crc32cw,
+    aarch64_crc32cx,
+    aarch64_crc32h,
+    aarch64_crc32w,
+    aarch64_crc32x,
+    aarch64_crypto_aesd,
+    aarch64_crypto_aese,
+    aarch64_crypto_aesimc,
+    aarch64_crypto_aesmc,
+    aarch64_crypto_sha1c,
+    aarch64_crypto_sha1h,
+    aarch64_crypto_sha1m,
+    aarch64_crypto_sha1p,
+    aarch64_crypto_sha1su0,
+    aarch64_crypto_sha1su1,
+    aarch64_crypto_sha256h,
+    aarch64_crypto_sha256h2,
+    aarch64_crypto_sha256su0,
+    aarch64_crypto_sha256su1,
+    aarch64_dmb,
+    aarch64_dsb,
+    aarch64_hint,
+    aarch64_isb,
+    aarch64_ldaxp,
+    aarch64_ldaxr,
+    aarch64_ldxp,
+    aarch64_ldxr,
+    aarch64_neon_abs,
+    aarch64_neon_addhn,
+    aarch64_neon_addp,
+    aarch64_neon_cls,
+    aarch64_neon_fabd,
+    aarch64_neon_facge,
+    aarch64_neon_facgt,
+    aarch64_neon_faddv,
+    aarch64_neon_fcvtas,
+    aarch64_neon_fcvtau,
+    aarch64_neon_fcvtms,
+    aarch64_neon_fcvtmu,
+    aarch64_neon_fcvtns,
+    aarch64_neon_fcvtnu,
+    aarch64_neon_fcvtps,
+    aarch64_neon_fcvtpu,
+    aarch64_neon_fcvtxn,
+    aarch64_neon_fcvtzs,
+    aarch64_neon_fcvtzu,
+    aarch64_neon_fmax,
+    aarch64_neon_fmaxnm,
+    aarch64_neon_fmaxnmp,
+    aarch64_neon_fmaxnmv,
+    aarch64_neon_fmaxp,
+    aarch64_neon_fmaxv,
+    aarch64_neon_fmin,
+    aarch64_neon_fminnm,
+    aarch64_neon_fminnmp,
+    aarch64_neon_fminnmv,
+    aarch64_neon_fminp,
+    aarch64_neon_fminv,
+    aarch64_neon_fmulx,
+    aarch64_neon_frecpe,
+    aarch64_neon_frecps,
+    aarch64_neon_frecpx,
+    aarch64_neon_frintn,
+    aarch64_neon_frsqrte,
+    aarch64_neon_frsqrts,
+    aarch64_neon_ld1x2,
+    aarch64_neon_ld1x3,
+    aarch64_neon_ld1x4,
+    aarch64_neon_ld2,
+    aarch64_neon_ld2lane,
+    aarch64_neon_ld2r,
+    aarch64_neon_ld3,
+    aarch64_neon_ld3lane,
+    aarch64_neon_ld3r,
+    aarch64_neon_ld4,
+    aarch64_neon_ld4lane,
+    aarch64_neon_ld4r,
+    aarch64_neon_pmul,
+    aarch64_neon_pmull,
+    aarch64_neon_pmull64,
+    aarch64_neon_raddhn,
+    aarch64_neon_rbit,
+    aarch64_neon_rshrn,
+    aarch64_neon_rsubhn,
+    aarch64_neon_sabd,
+    aarch64_neon_saddlp,
+    aarch64_neon_saddlv,
+    aarch64_neon_saddv,
+    aarch64_neon_scalar_sqxtn,
+    aarch64_neon_scalar_sqxtun,
+    aarch64_neon_scalar_uqxtn,
+    aarch64_neon_shadd,
+    aarch64_neon_shll,
+    aarch64_neon_shsub,
+    aarch64_neon_smax,
+    aarch64_neon_smaxp,
+    aarch64_neon_smaxv,
+    aarch64_neon_smin,
+    aarch64_neon_sminp,
+    aarch64_neon_sminv,
+    aarch64_neon_smull,
+    aarch64_neon_sqabs,
+    aarch64_neon_sqadd,
+    aarch64_neon_sqdmulh,
+    aarch64_neon_sqdmull,
+    aarch64_neon_sqdmulls_scalar,
+    aarch64_neon_sqneg,
+    aarch64_neon_sqrdmulh,
+    aarch64_neon_sqrshl,
+    aarch64_neon_sqrshrn,
+    aarch64_neon_sqrshrun,
+    aarch64_neon_sqshl,
+    aarch64_neon_sqshlu,
+    aarch64_neon_sqshrn,
+    aarch64_neon_sqshrun,
+    aarch64_neon_sqsub,
+    aarch64_neon_sqxtn,
+    aarch64_neon_sqxtun,
+    aarch64_neon_srhadd,
+    aarch64_neon_srshl,
+    aarch64_neon_sshl,
+    aarch64_neon_sshll,
+    aarch64_neon_st1x2,
+    aarch64_neon_st1x3,
+    aarch64_neon_st1x4,
+    aarch64_neon_st2,
+    aarch64_neon_st2lane,
+    aarch64_neon_st3,
+    aarch64_neon_st3lane,
+    aarch64_neon_st4,
+    aarch64_neon_st4lane,
+    aarch64_neon_subhn,
+    aarch64_neon_suqadd,
+    aarch64_neon_tbl1,
+    aarch64_neon_tbl2,
+    aarch64_neon_tbl3,
+    aarch64_neon_tbl4,
+    aarch64_neon_tbx1,
+    aarch64_neon_tbx2,
+    aarch64_neon_tbx3,
+    aarch64_neon_tbx4,
+    aarch64_neon_uabd,
+    aarch64_neon_uaddlp,
+    aarch64_neon_uaddlv,
+    aarch64_neon_uaddv,
+    aarch64_neon_uhadd,
+    aarch64_neon_uhsub,
+    aarch64_neon_umax,
+    aarch64_neon_umaxp,
+    aarch64_neon_umaxv,
+    aarch64_neon_umin,
+    aarch64_neon_uminp,
+    aarch64_neon_uminv,
+    aarch64_neon_umull,
+    aarch64_neon_uqadd,
+    aarch64_neon_uqrshl,
+    aarch64_neon_uqrshrn,
+    aarch64_neon_uqshl,
+    aarch64_neon_uqshrn,
+    aarch64_neon_uqsub,
+    aarch64_neon_uqxtn,
+    aarch64_neon_urecpe,
+    aarch64_neon_urhadd,
+    aarch64_neon_urshl,
+    aarch64_neon_ursqrte,
+    aarch64_neon_ushl,
+    aarch64_neon_ushll,
+    aarch64_neon_usqadd,
+    aarch64_neon_vcopy_lane,
+    aarch64_neon_vcvtfp2fxs,
+    aarch64_neon_vcvtfp2fxu,
+    aarch64_neon_vcvtfp2hf,
+    aarch64_neon_vcvtfxs2fp,
+    aarch64_neon_vcvtfxu2fp,
+    aarch64_neon_vcvthf2fp,
+    aarch64_neon_vsli,
+    aarch64_neon_vsri,
+    aarch64_sdiv,
+    aarch64_sisd_fabd,
+    aarch64_sisd_fcvtxn,
+    aarch64_stlxp,
+    aarch64_stlxr,
+    aarch64_stxp,
+    aarch64_stxr,
+    aarch64_udiv,
+    amdgcn_alignbit,
+    amdgcn_alignbyte,
+    amdgcn_atomic_dec,
+    amdgcn_atomic_inc,
+    amdgcn_break,
+    amdgcn_buffer_atomic_add,
+    amdgcn_buffer_atomic_and,
+    amdgcn_buffer_atomic_cmpswap,
+    amdgcn_buffer_atomic_or,
+    amdgcn_buffer_atomic_smax,
+    amdgcn_buffer_atomic_smin,
+    amdgcn_buffer_atomic_sub,
+    amdgcn_buffer_atomic_swap,
+    amdgcn_buffer_atomic_umax,
+    amdgcn_buffer_atomic_umin,
+    amdgcn_buffer_atomic_xor,
+    amdgcn_buffer_load,
+    amdgcn_buffer_load_format,
+    amdgcn_buffer_store,
+    amdgcn_buffer_store_format,
+    amdgcn_buffer_wbinvl1,
+    amdgcn_buffer_wbinvl1_sc,
+    amdgcn_buffer_wbinvl1_vol,
+    amdgcn_class,
+    amdgcn_cos,
+    amdgcn_cubeid,
+    amdgcn_cubema,
+    amdgcn_cubesc,
+    amdgcn_cubetc,
+    amdgcn_cvt_pk_u8_f32,
+    amdgcn_cvt_pkrtz,
+    amdgcn_dispatch_id,
+    amdgcn_dispatch_ptr,
+    amdgcn_div_fixup,
+    amdgcn_div_fmas,
+    amdgcn_div_scale,
+    amdgcn_ds_bpermute,
+    amdgcn_ds_permute,
+    amdgcn_ds_swizzle,
+    amdgcn_else,
+    amdgcn_else_break,
+    amdgcn_end_cf,
+    amdgcn_exp,
+    amdgcn_exp_compr,
+    amdgcn_fcmp,
+    amdgcn_fdiv_fast,
+    amdgcn_fmed3,
+    amdgcn_fmul_legacy,
+    amdgcn_fract,
+    amdgcn_frexp_exp,
+    amdgcn_frexp_mant,
+    amdgcn_groupstaticsize,
+    amdgcn_icmp,
+    amdgcn_if,
+    amdgcn_if_break,
+    amdgcn_image_atomic_add,
+    amdgcn_image_atomic_and,
+    amdgcn_image_atomic_cmpswap,
+    amdgcn_image_atomic_dec,
+    amdgcn_image_atomic_inc,
+    amdgcn_image_atomic_or,
+    amdgcn_image_atomic_smax,
+    amdgcn_image_atomic_smin,
+    amdgcn_image_atomic_sub,
+    amdgcn_image_atomic_swap,
+    amdgcn_image_atomic_umax,
+    amdgcn_image_atomic_umin,
+    amdgcn_image_atomic_xor,
+    amdgcn_image_gather4,
+    amdgcn_image_gather4_b,
+    amdgcn_image_gather4_b_cl,
+    amdgcn_image_gather4_b_cl_o,
+    amdgcn_image_gather4_b_o,
+    amdgcn_image_gather4_c,
+    amdgcn_image_gather4_c_b,
+    amdgcn_image_gather4_c_b_cl,
+    amdgcn_image_gather4_c_b_cl_o,
+    amdgcn_image_gather4_c_b_o,
+    amdgcn_image_gather4_c_cl,
+    amdgcn_image_gather4_c_cl_o,
+    amdgcn_image_gather4_c_l,
+    amdgcn_image_gather4_c_l_o,
+    amdgcn_image_gather4_c_lz,
+    amdgcn_image_gather4_c_lz_o,
+    amdgcn_image_gather4_c_o,
+    amdgcn_image_gather4_cl,
+    amdgcn_image_gather4_cl_o,
+    amdgcn_image_gather4_l,
+    amdgcn_image_gather4_l_o,
+    amdgcn_image_gather4_lz,
+    amdgcn_image_gather4_lz_o,
+    amdgcn_image_gather4_o,
+    amdgcn_image_getlod,
+    amdgcn_image_getresinfo,
+    amdgcn_image_load,
+    amdgcn_image_load_mip,
+    amdgcn_image_sample,
+    amdgcn_image_sample_b,
+    amdgcn_image_sample_b_cl,
+    amdgcn_image_sample_b_cl_o,
+    amdgcn_image_sample_b_o,
+    amdgcn_image_sample_c,
+    amdgcn_image_sample_c_b,
+    amdgcn_image_sample_c_b_cl,
+    amdgcn_image_sample_c_b_cl_o,
+    amdgcn_image_sample_c_b_o,
+    amdgcn_image_sample_c_cd,
+    amdgcn_image_sample_c_cd_cl,
+    amdgcn_image_sample_c_cd_cl_o,
+    amdgcn_image_sample_c_cd_o,
+    amdgcn_image_sample_c_cl,
+    amdgcn_image_sample_c_cl_o,
+    amdgcn_image_sample_c_d,
+    amdgcn_image_sample_c_d_cl,
+    amdgcn_image_sample_c_d_cl_o,
+    amdgcn_image_sample_c_d_o,
+    amdgcn_image_sample_c_l,
+    amdgcn_image_sample_c_l_o,
+    amdgcn_image_sample_c_lz,
+    amdgcn_image_sample_c_lz_o,
+    amdgcn_image_sample_c_o,
+    amdgcn_image_sample_cd,
+    amdgcn_image_sample_cd_cl,
+    amdgcn_image_sample_cd_cl_o,
+    amdgcn_image_sample_cd_o,
+    amdgcn_image_sample_cl,
+    amdgcn_image_sample_cl_o,
+    amdgcn_image_sample_d,
+    amdgcn_image_sample_d_cl,
+    amdgcn_image_sample_d_cl_o,
+    amdgcn_image_sample_d_o,
+    amdgcn_image_sample_l,
+    amdgcn_image_sample_l_o,
+    amdgcn_image_sample_lz,
+    amdgcn_image_sample_lz_o,
+    amdgcn_image_sample_o,
+    amdgcn_image_store,
+    amdgcn_image_store_mip,
+    amdgcn_implicit_buffer_ptr,
+    amdgcn_implicitarg_ptr,
+    amdgcn_init_exec,
+    amdgcn_init_exec_from_input,
+    amdgcn_interp_mov,
+    amdgcn_interp_p1,
+    amdgcn_interp_p2,
+    amdgcn_kernarg_segment_ptr,
+    amdgcn_kill,
+    amdgcn_ldexp,
+    amdgcn_lerp,
+    amdgcn_log_clamp,
+    amdgcn_loop,
+    amdgcn_mbcnt_hi,
+    amdgcn_mbcnt_lo,
+    amdgcn_mov_dpp,
+    amdgcn_mqsad_pk_u16_u8,
+    amdgcn_mqsad_u32_u8,
+    amdgcn_msad_u8,
+    amdgcn_ps_live,
+    amdgcn_qsad_pk_u16_u8,
+    amdgcn_queue_ptr,
+    amdgcn_rcp,
+    amdgcn_rcp_legacy,
+    amdgcn_readfirstlane,
+    amdgcn_readlane,
+    amdgcn_rsq,
+    amdgcn_rsq_clamp,
+    amdgcn_rsq_legacy,
+    amdgcn_s_barrier,
+    amdgcn_s_dcache_inv,
+    amdgcn_s_dcache_inv_vol,
+    amdgcn_s_dcache_wb,
+    amdgcn_s_dcache_wb_vol,
+    amdgcn_s_decperflevel,
+    amdgcn_s_getpc,
+    amdgcn_s_getreg,
+    amdgcn_s_incperflevel,
+    amdgcn_s_memrealtime,
+    amdgcn_s_memtime,
+    amdgcn_s_sendmsg,
+    amdgcn_s_sendmsghalt,
+    amdgcn_s_sleep,
+    amdgcn_s_waitcnt,
+    amdgcn_sad_hi_u8,
+    amdgcn_sad_u16,
+    amdgcn_sad_u8,
+    amdgcn_sbfe,
+    amdgcn_set_inactive,
+    amdgcn_sffbh,
+    amdgcn_sin,
+    amdgcn_tbuffer_load,
+    amdgcn_tbuffer_store,
+    amdgcn_trig_preop,
+    amdgcn_ubfe,
+    amdgcn_unreachable,
+    amdgcn_update_dpp,
+    amdgcn_wave_barrier,
+    amdgcn_workgroup_id_x,
+    amdgcn_workgroup_id_y,
+    amdgcn_workgroup_id_z,
+    amdgcn_workitem_id_x,
+    amdgcn_workitem_id_y,
+    amdgcn_workitem_id_z,
+    amdgcn_wqm,
+    amdgcn_wqm_vote,
+    amdgcn_wwm,
+    arm_cdp,
+    arm_cdp2,
+    arm_clrex,
+    arm_crc32b,
+    arm_crc32cb,
+    arm_crc32ch,
+    arm_crc32cw,
+    arm_crc32h,
+    arm_crc32w,
+    arm_dbg,
+    arm_dmb,
+    arm_dsb,
+    arm_get_fpscr,
+    arm_hint,
+    arm_isb,
+    arm_ldaex,
+    arm_ldaexd,
+    arm_ldc,
+    arm_ldc2,
+    arm_ldc2l,
+    arm_ldcl,
+    arm_ldrex,
+    arm_ldrexd,
+    arm_mcr,
+    arm_mcr2,
+    arm_mcrr,
+    arm_mcrr2,
+    arm_mrc,
+    arm_mrc2,
+    arm_mrrc,
+    arm_mrrc2,
+    arm_neon_aesd,
+    arm_neon_aese,
+    arm_neon_aesimc,
+    arm_neon_aesmc,
+    arm_neon_sha1c,
+    arm_neon_sha1h,
+    arm_neon_sha1m,
+    arm_neon_sha1p,
+    arm_neon_sha1su0,
+    arm_neon_sha1su1,
+    arm_neon_sha256h,
+    arm_neon_sha256h2,
+    arm_neon_sha256su0,
+    arm_neon_sha256su1,
+    arm_neon_vabds,
+    arm_neon_vabdu,
+    arm_neon_vabs,
+    arm_neon_vacge,
+    arm_neon_vacgt,
+    arm_neon_vbsl,
+    arm_neon_vcls,
+    arm_neon_vcvtas,
+    arm_neon_vcvtau,
+    arm_neon_vcvtfp2fxs,
+    arm_neon_vcvtfp2fxu,
+    arm_neon_vcvtfp2hf,
+    arm_neon_vcvtfxs2fp,
+    arm_neon_vcvtfxu2fp,
+    arm_neon_vcvthf2fp,
+    arm_neon_vcvtms,
+    arm_neon_vcvtmu,
+    arm_neon_vcvtns,
+    arm_neon_vcvtnu,
+    arm_neon_vcvtps,
+    arm_neon_vcvtpu,
+    arm_neon_vhadds,
+    arm_neon_vhaddu,
+    arm_neon_vhsubs,
+    arm_neon_vhsubu,
+    arm_neon_vld1,
+    arm_neon_vld2,
+    arm_neon_vld2lane,
+    arm_neon_vld3,
+    arm_neon_vld3lane,
+    arm_neon_vld4,
+    arm_neon_vld4lane,
+    arm_neon_vmaxnm,
+    arm_neon_vmaxs,
+    arm_neon_vmaxu,
+    arm_neon_vminnm,
+    arm_neon_vmins,
+    arm_neon_vminu,
+    arm_neon_vmullp,
+    arm_neon_vmulls,
+    arm_neon_vmullu,
+    arm_neon_vmulp,
+    arm_neon_vpadals,
+    arm_neon_vpadalu,
+    arm_neon_vpadd,
+    arm_neon_vpaddls,
+    arm_neon_vpaddlu,
+    arm_neon_vpmaxs,
+    arm_neon_vpmaxu,
+    arm_neon_vpmins,
+    arm_neon_vpminu,
+    arm_neon_vqabs,
+    arm_neon_vqadds,
+    arm_neon_vqaddu,
+    arm_neon_vqdmulh,
+    arm_neon_vqdmull,
+    arm_neon_vqmovns,
+    arm_neon_vqmovnsu,
+    arm_neon_vqmovnu,
+    arm_neon_vqneg,
+    arm_neon_vqrdmulh,
+    arm_neon_vqrshiftns,
+    arm_neon_vqrshiftnsu,
+    arm_neon_vqrshiftnu,
+    arm_neon_vqrshifts,
+    arm_neon_vqrshiftu,
+    arm_neon_vqshiftns,
+    arm_neon_vqshiftnsu,
+    arm_neon_vqshiftnu,
+    arm_neon_vqshifts,
+    arm_neon_vqshiftsu,
+    arm_neon_vqshiftu,
+    arm_neon_vqsubs,
+    arm_neon_vqsubu,
+    arm_neon_vraddhn,
+    arm_neon_vrecpe,
+    arm_neon_vrecps,
+    arm_neon_vrhadds,
+    arm_neon_vrhaddu,
+    arm_neon_vrinta,
+    arm_neon_vrintm,
+    arm_neon_vrintn,
+    arm_neon_vrintp,
+    arm_neon_vrintx,
+    arm_neon_vrintz,
+    arm_neon_vrshiftn,
+    arm_neon_vrshifts,
+    arm_neon_vrshiftu,
+    arm_neon_vrsqrte,
+    arm_neon_vrsqrts,
+    arm_neon_vrsubhn,
+    arm_neon_vshiftins,
+    arm_neon_vshifts,
+    arm_neon_vshiftu,
+    arm_neon_vst1,
+    arm_neon_vst2,
+    arm_neon_vst2lane,
+    arm_neon_vst3,
+    arm_neon_vst3lane,
+    arm_neon_vst4,
+    arm_neon_vst4lane,
+    arm_neon_vtbl1,
+    arm_neon_vtbl2,
+    arm_neon_vtbl3,
+    arm_neon_vtbl4,
+    arm_neon_vtbx1,
+    arm_neon_vtbx2,
+    arm_neon_vtbx3,
+    arm_neon_vtbx4,
+    arm_qadd,
+    arm_qadd16,
+    arm_qadd8,
+    arm_qasx,
+    arm_qsax,
+    arm_qsub,
+    arm_qsub16,
+    arm_qsub8,
+    arm_sadd16,
+    arm_sadd8,
+    arm_sasx,
+    arm_sel,
+    arm_set_fpscr,
+    arm_shadd16,
+    arm_shadd8,
+    arm_shasx,
+    arm_shsax,
+    arm_shsub16,
+    arm_shsub8,
+    arm_smlabb,
+    arm_smlabt,
+    arm_smlad,
+    arm_smladx,
+    arm_smlald,
+    arm_smlaldx,
+    arm_smlatb,
+    arm_smlatt,
+    arm_smlawb,
+    arm_smlawt,
+    arm_smlsd,
+    arm_smlsdx,
+    arm_smlsld,
+    arm_smlsldx,
+    arm_smuad,
+    arm_smuadx,
+    arm_smulbb,
+    arm_smulbt,
+    arm_smultb,
+    arm_smultt,
+    arm_smulwb,
+    arm_smulwt,
+    arm_smusd,
+    arm_smusdx,
+    arm_space,
+    arm_ssat,
+    arm_ssat16,
+    arm_ssax,
+    arm_ssub16,
+    arm_ssub8,
+    arm_stc,
+    arm_stc2,
+    arm_stc2l,
+    arm_stcl,
+    arm_stlex,
+    arm_stlexd,
+    arm_strex,
+    arm_strexd,
+    arm_sxtab16,
+    arm_sxtb16,
+    arm_uadd16,
+    arm_uadd8,
+    arm_uasx,
+    arm_uhadd16,
+    arm_uhadd8,
+    arm_uhasx,
+    arm_uhsax,
+    arm_uhsub16,
+    arm_uhsub8,
+    arm_undefined,
+    arm_uqadd16,
+    arm_uqadd8,
+    arm_uqasx,
+    arm_uqsax,
+    arm_uqsub16,
+    arm_uqsub8,
+    arm_usad8,
+    arm_usada8,
+    arm_usat,
+    arm_usat16,
+    arm_usax,
+    arm_usub16,
+    arm_usub8,
+    arm_uxtab16,
+    arm_uxtb16,
+    arm_vcvtr,
+    arm_vcvtru,
+    bpf_load_byte,
+    bpf_load_half,
+    bpf_load_word,
+    bpf_pseudo,
+    hexagon_A2_abs,
+    hexagon_A2_absp,
+    hexagon_A2_abssat,
+    hexagon_A2_add,
+    hexagon_A2_addh_h16_hh,
+    hexagon_A2_addh_h16_hl,
+    hexagon_A2_addh_h16_lh,
+    hexagon_A2_addh_h16_ll,
+    hexagon_A2_addh_h16_sat_hh,
+    hexagon_A2_addh_h16_sat_hl,
+    hexagon_A2_addh_h16_sat_lh,
+    hexagon_A2_addh_h16_sat_ll,
+    hexagon_A2_addh_l16_hl,
+    hexagon_A2_addh_l16_ll,
+    hexagon_A2_addh_l16_sat_hl,
+    hexagon_A2_addh_l16_sat_ll,
+    hexagon_A2_addi,
+    hexagon_A2_addp,
+    hexagon_A2_addpsat,
+    hexagon_A2_addsat,
+    hexagon_A2_addsp,
+    hexagon_A2_and,
+    hexagon_A2_andir,
+    hexagon_A2_andp,
+    hexagon_A2_aslh,
+    hexagon_A2_asrh,
+    hexagon_A2_combine_hh,
+    hexagon_A2_combine_hl,
+    hexagon_A2_combine_lh,
+    hexagon_A2_combine_ll,
+    hexagon_A2_combineii,
+    hexagon_A2_combinew,
+    hexagon_A2_max,
+    hexagon_A2_maxp,
+    hexagon_A2_maxu,
+    hexagon_A2_maxup,
+    hexagon_A2_min,
+    hexagon_A2_minp,
+    hexagon_A2_minu,
+    hexagon_A2_minup,
+    hexagon_A2_neg,
+    hexagon_A2_negp,
+    hexagon_A2_negsat,
+    hexagon_A2_not,
+    hexagon_A2_notp,
+    hexagon_A2_or,
+    hexagon_A2_orir,
+    hexagon_A2_orp,
+    hexagon_A2_roundsat,
+    hexagon_A2_sat,
+    hexagon_A2_satb,
+    hexagon_A2_sath,
+    hexagon_A2_satub,
+    hexagon_A2_satuh,
+    hexagon_A2_sub,
+    hexagon_A2_subh_h16_hh,
+    hexagon_A2_subh_h16_hl,
+    hexagon_A2_subh_h16_lh,
+    hexagon_A2_subh_h16_ll,
+    hexagon_A2_subh_h16_sat_hh,
+    hexagon_A2_subh_h16_sat_hl,
+    hexagon_A2_subh_h16_sat_lh,
+    hexagon_A2_subh_h16_sat_ll,
+    hexagon_A2_subh_l16_hl,
+    hexagon_A2_subh_l16_ll,
+    hexagon_A2_subh_l16_sat_hl,
+    hexagon_A2_subh_l16_sat_ll,
+    hexagon_A2_subp,
+    hexagon_A2_subri,
+    hexagon_A2_subsat,
+    hexagon_A2_svaddh,
+    hexagon_A2_svaddhs,
+    hexagon_A2_svadduhs,
+    hexagon_A2_svavgh,
+    hexagon_A2_svavghs,
+    hexagon_A2_svnavgh,
+    hexagon_A2_svsubh,
+    hexagon_A2_svsubhs,
+    hexagon_A2_svsubuhs,
+    hexagon_A2_swiz,
+    hexagon_A2_sxtb,
+    hexagon_A2_sxth,
+    hexagon_A2_sxtw,
+    hexagon_A2_tfr,
+    hexagon_A2_tfrih,
+    hexagon_A2_tfril,
+    hexagon_A2_tfrp,
+    hexagon_A2_tfrpi,
+    hexagon_A2_tfrsi,
+    hexagon_A2_vabsh,
+    hexagon_A2_vabshsat,
+    hexagon_A2_vabsw,
+    hexagon_A2_vabswsat,
+    hexagon_A2_vaddb_map,
+    hexagon_A2_vaddh,
+    hexagon_A2_vaddhs,
+    hexagon_A2_vaddub,
+    hexagon_A2_vaddubs,
+    hexagon_A2_vadduhs,
+    hexagon_A2_vaddw,
+    hexagon_A2_vaddws,
+    hexagon_A2_vavgh,
+    hexagon_A2_vavghcr,
+    hexagon_A2_vavghr,
+    hexagon_A2_vavgub,
+    hexagon_A2_vavgubr,
+    hexagon_A2_vavguh,
+    hexagon_A2_vavguhr,
+    hexagon_A2_vavguw,
+    hexagon_A2_vavguwr,
+    hexagon_A2_vavgw,
+    hexagon_A2_vavgwcr,
+    hexagon_A2_vavgwr,
+    hexagon_A2_vcmpbeq,
+    hexagon_A2_vcmpbgtu,
+    hexagon_A2_vcmpheq,
+    hexagon_A2_vcmphgt,
+    hexagon_A2_vcmphgtu,
+    hexagon_A2_vcmpweq,
+    hexagon_A2_vcmpwgt,
+    hexagon_A2_vcmpwgtu,
+    hexagon_A2_vconj,
+    hexagon_A2_vmaxb,
+    hexagon_A2_vmaxh,
+    hexagon_A2_vmaxub,
+    hexagon_A2_vmaxuh,
+    hexagon_A2_vmaxuw,
+    hexagon_A2_vmaxw,
+    hexagon_A2_vminb,
+    hexagon_A2_vminh,
+    hexagon_A2_vminub,
+    hexagon_A2_vminuh,
+    hexagon_A2_vminuw,
+    hexagon_A2_vminw,
+    hexagon_A2_vnavgh,
+    hexagon_A2_vnavghcr,
+    hexagon_A2_vnavghr,
+    hexagon_A2_vnavgw,
+    hexagon_A2_vnavgwcr,
+    hexagon_A2_vnavgwr,
+    hexagon_A2_vraddub,
+    hexagon_A2_vraddub_acc,
+    hexagon_A2_vrsadub,
+    hexagon_A2_vrsadub_acc,
+    hexagon_A2_vsubb_map,
+    hexagon_A2_vsubh,
+    hexagon_A2_vsubhs,
+    hexagon_A2_vsubub,
+    hexagon_A2_vsububs,
+    hexagon_A2_vsubuhs,
+    hexagon_A2_vsubw,
+    hexagon_A2_vsubws,
+    hexagon_A2_xor,
+    hexagon_A2_xorp,
+    hexagon_A2_zxtb,
+    hexagon_A2_zxth,
+    hexagon_A4_andn,
+    hexagon_A4_andnp,
+    hexagon_A4_bitsplit,
+    hexagon_A4_bitspliti,
+    hexagon_A4_boundscheck,
+    hexagon_A4_cmpbeq,
+    hexagon_A4_cmpbeqi,
+    hexagon_A4_cmpbgt,
+    hexagon_A4_cmpbgti,
+    hexagon_A4_cmpbgtu,
+    hexagon_A4_cmpbgtui,
+    hexagon_A4_cmpheq,
+    hexagon_A4_cmpheqi,
+    hexagon_A4_cmphgt,
+    hexagon_A4_cmphgti,
+    hexagon_A4_cmphgtu,
+    hexagon_A4_cmphgtui,
+    hexagon_A4_combineir,
+    hexagon_A4_combineri,
+    hexagon_A4_cround_ri,
+    hexagon_A4_cround_rr,
+    hexagon_A4_modwrapu,
+    hexagon_A4_orn,
+    hexagon_A4_ornp,
+    hexagon_A4_rcmpeq,
+    hexagon_A4_rcmpeqi,
+    hexagon_A4_rcmpneq,
+    hexagon_A4_rcmpneqi,
+    hexagon_A4_round_ri,
+    hexagon_A4_round_ri_sat,
+    hexagon_A4_round_rr,
+    hexagon_A4_round_rr_sat,
+    hexagon_A4_tlbmatch,
+    hexagon_A4_vcmpbeq_any,
+    hexagon_A4_vcmpbeqi,
+    hexagon_A4_vcmpbgt,
+    hexagon_A4_vcmpbgti,
+    hexagon_A4_vcmpbgtui,
+    hexagon_A4_vcmpheqi,
+    hexagon_A4_vcmphgti,
+    hexagon_A4_vcmphgtui,
+    hexagon_A4_vcmpweqi,
+    hexagon_A4_vcmpwgti,
+    hexagon_A4_vcmpwgtui,
+    hexagon_A4_vrmaxh,
+    hexagon_A4_vrmaxuh,
+    hexagon_A4_vrmaxuw,
+    hexagon_A4_vrmaxw,
+    hexagon_A4_vrminh,
+    hexagon_A4_vrminuh,
+    hexagon_A4_vrminuw,
+    hexagon_A4_vrminw,
+    hexagon_A5_vaddhubs,
+    hexagon_A6_vcmpbeq_notany,
+    hexagon_A6_vcmpbeq_notany_128B,
+    hexagon_C2_all8,
+    hexagon_C2_and,
+    hexagon_C2_andn,
+    hexagon_C2_any8,
+    hexagon_C2_bitsclr,
+    hexagon_C2_bitsclri,
+    hexagon_C2_bitsset,
+    hexagon_C2_cmpeq,
+    hexagon_C2_cmpeqi,
+    hexagon_C2_cmpeqp,
+    hexagon_C2_cmpgei,
+    hexagon_C2_cmpgeui,
+    hexagon_C2_cmpgt,
+    hexagon_C2_cmpgti,
+    hexagon_C2_cmpgtp,
+    hexagon_C2_cmpgtu,
+    hexagon_C2_cmpgtui,
+    hexagon_C2_cmpgtup,
+    hexagon_C2_cmplt,
+    hexagon_C2_cmpltu,
+    hexagon_C2_mask,
+    hexagon_C2_mux,
+    hexagon_C2_muxii,
+    hexagon_C2_muxir,
+    hexagon_C2_muxri,
+    hexagon_C2_not,
+    hexagon_C2_or,
+    hexagon_C2_orn,
+    hexagon_C2_pxfer_map,
+    hexagon_C2_tfrpr,
+    hexagon_C2_tfrrp,
+    hexagon_C2_vitpack,
+    hexagon_C2_vmux,
+    hexagon_C2_xor,
+    hexagon_C4_and_and,
+    hexagon_C4_and_andn,
+    hexagon_C4_and_or,
+    hexagon_C4_and_orn,
+    hexagon_C4_cmplte,
+    hexagon_C4_cmpltei,
+    hexagon_C4_cmplteu,
+    hexagon_C4_cmplteui,
+    hexagon_C4_cmpneq,
+    hexagon_C4_cmpneqi,
+    hexagon_C4_fastcorner9,
+    hexagon_C4_fastcorner9_not,
+    hexagon_C4_nbitsclr,
+    hexagon_C4_nbitsclri,
+    hexagon_C4_nbitsset,
+    hexagon_C4_or_and,
+    hexagon_C4_or_andn,
+    hexagon_C4_or_or,
+    hexagon_C4_or_orn,
+    hexagon_F2_conv_d2df,
+    hexagon_F2_conv_d2sf,
+    hexagon_F2_conv_df2d,
+    hexagon_F2_conv_df2d_chop,
+    hexagon_F2_conv_df2sf,
+    hexagon_F2_conv_df2ud,
+    hexagon_F2_conv_df2ud_chop,
+    hexagon_F2_conv_df2uw,
+    hexagon_F2_conv_df2uw_chop,
+    hexagon_F2_conv_df2w,
+    hexagon_F2_conv_df2w_chop,
+    hexagon_F2_conv_sf2d,
+    hexagon_F2_conv_sf2d_chop,
+    hexagon_F2_conv_sf2df,
+    hexagon_F2_conv_sf2ud,
+    hexagon_F2_conv_sf2ud_chop,
+    hexagon_F2_conv_sf2uw,
+    hexagon_F2_conv_sf2uw_chop,
+    hexagon_F2_conv_sf2w,
+    hexagon_F2_conv_sf2w_chop,
+    hexagon_F2_conv_ud2df,
+    hexagon_F2_conv_ud2sf,
+    hexagon_F2_conv_uw2df,
+    hexagon_F2_conv_uw2sf,
+    hexagon_F2_conv_w2df,
+    hexagon_F2_conv_w2sf,
+    hexagon_F2_dfclass,
+    hexagon_F2_dfcmpeq,
+    hexagon_F2_dfcmpge,
+    hexagon_F2_dfcmpgt,
+    hexagon_F2_dfcmpuo,
+    hexagon_F2_dfimm_n,
+    hexagon_F2_dfimm_p,
+    hexagon_F2_sfadd,
+    hexagon_F2_sfclass,
+    hexagon_F2_sfcmpeq,
+    hexagon_F2_sfcmpge,
+    hexagon_F2_sfcmpgt,
+    hexagon_F2_sfcmpuo,
+    hexagon_F2_sffixupd,
+    hexagon_F2_sffixupn,
+    hexagon_F2_sffixupr,
+    hexagon_F2_sffma,
+    hexagon_F2_sffma_lib,
+    hexagon_F2_sffma_sc,
+    hexagon_F2_sffms,
+    hexagon_F2_sffms_lib,
+    hexagon_F2_sfimm_n,
+    hexagon_F2_sfimm_p,
+    hexagon_F2_sfmax,
+    hexagon_F2_sfmin,
+    hexagon_F2_sfmpy,
+    hexagon_F2_sfsub,
+    hexagon_L2_loadw_locked,
+    hexagon_L4_loadd_locked,
+    hexagon_M2_acci,
+    hexagon_M2_accii,
+    hexagon_M2_cmaci_s0,
+    hexagon_M2_cmacr_s0,
+    hexagon_M2_cmacs_s0,
+    hexagon_M2_cmacs_s1,
+    hexagon_M2_cmacsc_s0,
+    hexagon_M2_cmacsc_s1,
+    hexagon_M2_cmpyi_s0,
+    hexagon_M2_cmpyr_s0,
+    hexagon_M2_cmpyrs_s0,
+    hexagon_M2_cmpyrs_s1,
+    hexagon_M2_cmpyrsc_s0,
+    hexagon_M2_cmpyrsc_s1,
+    hexagon_M2_cmpys_s0,
+    hexagon_M2_cmpys_s1,
+    hexagon_M2_cmpysc_s0,
+    hexagon_M2_cmpysc_s1,
+    hexagon_M2_cnacs_s0,
+    hexagon_M2_cnacs_s1,
+    hexagon_M2_cnacsc_s0,
+    hexagon_M2_cnacsc_s1,
+    hexagon_M2_dpmpyss_acc_s0,
+    hexagon_M2_dpmpyss_nac_s0,
+    hexagon_M2_dpmpyss_rnd_s0,
+    hexagon_M2_dpmpyss_s0,
+    hexagon_M2_dpmpyuu_acc_s0,
+    hexagon_M2_dpmpyuu_nac_s0,
+    hexagon_M2_dpmpyuu_s0,
+    hexagon_M2_hmmpyh_rs1,
+    hexagon_M2_hmmpyh_s1,
+    hexagon_M2_hmmpyl_rs1,
+    hexagon_M2_hmmpyl_s1,
+    hexagon_M2_maci,
+    hexagon_M2_macsin,
+    hexagon_M2_macsip,
+    hexagon_M2_mmachs_rs0,
+    hexagon_M2_mmachs_rs1,
+    hexagon_M2_mmachs_s0,
+    hexagon_M2_mmachs_s1,
+    hexagon_M2_mmacls_rs0,
+    hexagon_M2_mmacls_rs1,
+    hexagon_M2_mmacls_s0,
+    hexagon_M2_mmacls_s1,
+    hexagon_M2_mmacuhs_rs0,
+    hexagon_M2_mmacuhs_rs1,
+    hexagon_M2_mmacuhs_s0,
+    hexagon_M2_mmacuhs_s1,
+    hexagon_M2_mmaculs_rs0,
+    hexagon_M2_mmaculs_rs1,
+    hexagon_M2_mmaculs_s0,
+    hexagon_M2_mmaculs_s1,
+    hexagon_M2_mmpyh_rs0,
+    hexagon_M2_mmpyh_rs1,
+    hexagon_M2_mmpyh_s0,
+    hexagon_M2_mmpyh_s1,
+    hexagon_M2_mmpyl_rs0,
+    hexagon_M2_mmpyl_rs1,
+    hexagon_M2_mmpyl_s0,
+    hexagon_M2_mmpyl_s1,
+    hexagon_M2_mmpyuh_rs0,
+    hexagon_M2_mmpyuh_rs1,
+    hexagon_M2_mmpyuh_s0,
+    hexagon_M2_mmpyuh_s1,
+    hexagon_M2_mmpyul_rs0,
+    hexagon_M2_mmpyul_rs1,
+    hexagon_M2_mmpyul_s0,
+    hexagon_M2_mmpyul_s1,
+    hexagon_M2_mpy_acc_hh_s0,
+    hexagon_M2_mpy_acc_hh_s1,
+    hexagon_M2_mpy_acc_hl_s0,
+    hexagon_M2_mpy_acc_hl_s1,
+    hexagon_M2_mpy_acc_lh_s0,
+    hexagon_M2_mpy_acc_lh_s1,
+    hexagon_M2_mpy_acc_ll_s0,
+    hexagon_M2_mpy_acc_ll_s1,
+    hexagon_M2_mpy_acc_sat_hh_s0,
+    hexagon_M2_mpy_acc_sat_hh_s1,
+    hexagon_M2_mpy_acc_sat_hl_s0,
+    hexagon_M2_mpy_acc_sat_hl_s1,
+    hexagon_M2_mpy_acc_sat_lh_s0,
+    hexagon_M2_mpy_acc_sat_lh_s1,
+    hexagon_M2_mpy_acc_sat_ll_s0,
+    hexagon_M2_mpy_acc_sat_ll_s1,
+    hexagon_M2_mpy_hh_s0,
+    hexagon_M2_mpy_hh_s1,
+    hexagon_M2_mpy_hl_s0,
+    hexagon_M2_mpy_hl_s1,
+    hexagon_M2_mpy_lh_s0,
+    hexagon_M2_mpy_lh_s1,
+    hexagon_M2_mpy_ll_s0,
+    hexagon_M2_mpy_ll_s1,
+    hexagon_M2_mpy_nac_hh_s0,
+    hexagon_M2_mpy_nac_hh_s1,
+    hexagon_M2_mpy_nac_hl_s0,
+    hexagon_M2_mpy_nac_hl_s1,
+    hexagon_M2_mpy_nac_lh_s0,
+    hexagon_M2_mpy_nac_lh_s1,
+    hexagon_M2_mpy_nac_ll_s0,
+    hexagon_M2_mpy_nac_ll_s1,
+    hexagon_M2_mpy_nac_sat_hh_s0,
+    hexagon_M2_mpy_nac_sat_hh_s1,
+    hexagon_M2_mpy_nac_sat_hl_s0,
+    hexagon_M2_mpy_nac_sat_hl_s1,
+    hexagon_M2_mpy_nac_sat_lh_s0,
+    hexagon_M2_mpy_nac_sat_lh_s1,
+    hexagon_M2_mpy_nac_sat_ll_s0,
+    hexagon_M2_mpy_nac_sat_ll_s1,
+    hexagon_M2_mpy_rnd_hh_s0,
+    hexagon_M2_mpy_rnd_hh_s1,
+    hexagon_M2_mpy_rnd_hl_s0,
+    hexagon_M2_mpy_rnd_hl_s1,
+    hexagon_M2_mpy_rnd_lh_s0,
+    hexagon_M2_mpy_rnd_lh_s1,
+    hexagon_M2_mpy_rnd_ll_s0,
+    hexagon_M2_mpy_rnd_ll_s1,
+    hexagon_M2_mpy_sat_hh_s0,
+    hexagon_M2_mpy_sat_hh_s1,
+    hexagon_M2_mpy_sat_hl_s0,
+    hexagon_M2_mpy_sat_hl_s1,
+    hexagon_M2_mpy_sat_lh_s0,
+    hexagon_M2_mpy_sat_lh_s1,
+    hexagon_M2_mpy_sat_ll_s0,
+    hexagon_M2_mpy_sat_ll_s1,
+    hexagon_M2_mpy_sat_rnd_hh_s0,
+    hexagon_M2_mpy_sat_rnd_hh_s1,
+    hexagon_M2_mpy_sat_rnd_hl_s0,
+    hexagon_M2_mpy_sat_rnd_hl_s1,
+    hexagon_M2_mpy_sat_rnd_lh_s0,
+    hexagon_M2_mpy_sat_rnd_lh_s1,
+    hexagon_M2_mpy_sat_rnd_ll_s0,
+    hexagon_M2_mpy_sat_rnd_ll_s1,
+    hexagon_M2_mpy_up,
+    hexagon_M2_mpy_up_s1,
+    hexagon_M2_mpy_up_s1_sat,
+    hexagon_M2_mpyd_acc_hh_s0,
+    hexagon_M2_mpyd_acc_hh_s1,
+    hexagon_M2_mpyd_acc_hl_s0,
+    hexagon_M2_mpyd_acc_hl_s1,
+    hexagon_M2_mpyd_acc_lh_s0,
+    hexagon_M2_mpyd_acc_lh_s1,
+    hexagon_M2_mpyd_acc_ll_s0,
+    hexagon_M2_mpyd_acc_ll_s1,
+    hexagon_M2_mpyd_hh_s0,
+    hexagon_M2_mpyd_hh_s1,
+    hexagon_M2_mpyd_hl_s0,
+    hexagon_M2_mpyd_hl_s1,
+    hexagon_M2_mpyd_lh_s0,
+    hexagon_M2_mpyd_lh_s1,
+    hexagon_M2_mpyd_ll_s0,
+    hexagon_M2_mpyd_ll_s1,
+    hexagon_M2_mpyd_nac_hh_s0,
+    hexagon_M2_mpyd_nac_hh_s1,
+    hexagon_M2_mpyd_nac_hl_s0,
+    hexagon_M2_mpyd_nac_hl_s1,
+    hexagon_M2_mpyd_nac_lh_s0,
+    hexagon_M2_mpyd_nac_lh_s1,
+    hexagon_M2_mpyd_nac_ll_s0,
+    hexagon_M2_mpyd_nac_ll_s1,
+    hexagon_M2_mpyd_rnd_hh_s0,
+    hexagon_M2_mpyd_rnd_hh_s1,
+    hexagon_M2_mpyd_rnd_hl_s0,
+    hexagon_M2_mpyd_rnd_hl_s1,
+    hexagon_M2_mpyd_rnd_lh_s0,
+    hexagon_M2_mpyd_rnd_lh_s1,
+    hexagon_M2_mpyd_rnd_ll_s0,
+    hexagon_M2_mpyd_rnd_ll_s1,
+    hexagon_M2_mpyi,
+    hexagon_M2_mpysmi,
+    hexagon_M2_mpysu_up,
+    hexagon_M2_mpyu_acc_hh_s0,
+    hexagon_M2_mpyu_acc_hh_s1,
+    hexagon_M2_mpyu_acc_hl_s0,
+    hexagon_M2_mpyu_acc_hl_s1,
+    hexagon_M2_mpyu_acc_lh_s0,
+    hexagon_M2_mpyu_acc_lh_s1,
+    hexagon_M2_mpyu_acc_ll_s0,
+    hexagon_M2_mpyu_acc_ll_s1,
+    hexagon_M2_mpyu_hh_s0,
+    hexagon_M2_mpyu_hh_s1,
+    hexagon_M2_mpyu_hl_s0,
+    hexagon_M2_mpyu_hl_s1,
+    hexagon_M2_mpyu_lh_s0,
+    hexagon_M2_mpyu_lh_s1,
+    hexagon_M2_mpyu_ll_s0,
+    hexagon_M2_mpyu_ll_s1,
+    hexagon_M2_mpyu_nac_hh_s0,
+    hexagon_M2_mpyu_nac_hh_s1,
+    hexagon_M2_mpyu_nac_hl_s0,
+    hexagon_M2_mpyu_nac_hl_s1,
+    hexagon_M2_mpyu_nac_lh_s0,
+    hexagon_M2_mpyu_nac_lh_s1,
+    hexagon_M2_mpyu_nac_ll_s0,
+    hexagon_M2_mpyu_nac_ll_s1,
+    hexagon_M2_mpyu_up,
+    hexagon_M2_mpyud_acc_hh_s0,
+    hexagon_M2_mpyud_acc_hh_s1,
+    hexagon_M2_mpyud_acc_hl_s0,
+    hexagon_M2_mpyud_acc_hl_s1,
+    hexagon_M2_mpyud_acc_lh_s0,
+    hexagon_M2_mpyud_acc_lh_s1,
+    hexagon_M2_mpyud_acc_ll_s0,
+    hexagon_M2_mpyud_acc_ll_s1,
+    hexagon_M2_mpyud_hh_s0,
+    hexagon_M2_mpyud_hh_s1,
+    hexagon_M2_mpyud_hl_s0,
+    hexagon_M2_mpyud_hl_s1,
+    hexagon_M2_mpyud_lh_s0,
+    hexagon_M2_mpyud_lh_s1,
+    hexagon_M2_mpyud_ll_s0,
+    hexagon_M2_mpyud_ll_s1,
+    hexagon_M2_mpyud_nac_hh_s0,
+    hexagon_M2_mpyud_nac_hh_s1,
+    hexagon_M2_mpyud_nac_hl_s0,
+    hexagon_M2_mpyud_nac_hl_s1,
+    hexagon_M2_mpyud_nac_lh_s0,
+    hexagon_M2_mpyud_nac_lh_s1,
+    hexagon_M2_mpyud_nac_ll_s0,
+    hexagon_M2_mpyud_nac_ll_s1,
+    hexagon_M2_mpyui,
+    hexagon_M2_nacci,
+    hexagon_M2_naccii,
+    hexagon_M2_subacc,
+    hexagon_M2_vabsdiffh,
+    hexagon_M2_vabsdiffw,
+    hexagon_M2_vcmac_s0_sat_i,
+    hexagon_M2_vcmac_s0_sat_r,
+    hexagon_M2_vcmpy_s0_sat_i,
+    hexagon_M2_vcmpy_s0_sat_r,
+    hexagon_M2_vcmpy_s1_sat_i,
+    hexagon_M2_vcmpy_s1_sat_r,
+    hexagon_M2_vdmacs_s0,
+    hexagon_M2_vdmacs_s1,
+    hexagon_M2_vdmpyrs_s0,
+    hexagon_M2_vdmpyrs_s1,
+    hexagon_M2_vdmpys_s0,
+    hexagon_M2_vdmpys_s1,
+    hexagon_M2_vmac2,
+    hexagon_M2_vmac2es,
+    hexagon_M2_vmac2es_s0,
+    hexagon_M2_vmac2es_s1,
+    hexagon_M2_vmac2s_s0,
+    hexagon_M2_vmac2s_s1,
+    hexagon_M2_vmac2su_s0,
+    hexagon_M2_vmac2su_s1,
+    hexagon_M2_vmpy2es_s0,
+    hexagon_M2_vmpy2es_s1,
+    hexagon_M2_vmpy2s_s0,
+    hexagon_M2_vmpy2s_s0pack,
+    hexagon_M2_vmpy2s_s1,
+    hexagon_M2_vmpy2s_s1pack,
+    hexagon_M2_vmpy2su_s0,
+    hexagon_M2_vmpy2su_s1,
+    hexagon_M2_vraddh,
+    hexagon_M2_vradduh,
+    hexagon_M2_vrcmaci_s0,
+    hexagon_M2_vrcmaci_s0c,
+    hexagon_M2_vrcmacr_s0,
+    hexagon_M2_vrcmacr_s0c,
+    hexagon_M2_vrcmpyi_s0,
+    hexagon_M2_vrcmpyi_s0c,
+    hexagon_M2_vrcmpyr_s0,
+    hexagon_M2_vrcmpyr_s0c,
+    hexagon_M2_vrcmpys_acc_s1,
+    hexagon_M2_vrcmpys_s1,
+    hexagon_M2_vrcmpys_s1rp,
+    hexagon_M2_vrmac_s0,
+    hexagon_M2_vrmpy_s0,
+    hexagon_M2_xor_xacc,
+    hexagon_M4_and_and,
+    hexagon_M4_and_andn,
+    hexagon_M4_and_or,
+    hexagon_M4_and_xor,
+    hexagon_M4_cmpyi_wh,
+    hexagon_M4_cmpyi_whc,
+    hexagon_M4_cmpyr_wh,
+    hexagon_M4_cmpyr_whc,
+    hexagon_M4_mac_up_s1_sat,
+    hexagon_M4_mpyri_addi,
+    hexagon_M4_mpyri_addr,
+    hexagon_M4_mpyri_addr_u2,
+    hexagon_M4_mpyrr_addi,
+    hexagon_M4_mpyrr_addr,
+    hexagon_M4_nac_up_s1_sat,
+    hexagon_M4_or_and,
+    hexagon_M4_or_andn,
+    hexagon_M4_or_or,
+    hexagon_M4_or_xor,
+    hexagon_M4_pmpyw,
+    hexagon_M4_pmpyw_acc,
+    hexagon_M4_vpmpyh,
+    hexagon_M4_vpmpyh_acc,
+    hexagon_M4_vrmpyeh_acc_s0,
+    hexagon_M4_vrmpyeh_acc_s1,
+    hexagon_M4_vrmpyeh_s0,
+    hexagon_M4_vrmpyeh_s1,
+    hexagon_M4_vrmpyoh_acc_s0,
+    hexagon_M4_vrmpyoh_acc_s1,
+    hexagon_M4_vrmpyoh_s0,
+    hexagon_M4_vrmpyoh_s1,
+    hexagon_M4_xor_and,
+    hexagon_M4_xor_andn,
+    hexagon_M4_xor_or,
+    hexagon_M4_xor_xacc,
+    hexagon_M5_vdmacbsu,
+    hexagon_M5_vdmpybsu,
+    hexagon_M5_vmacbsu,
+    hexagon_M5_vmacbuu,
+    hexagon_M5_vmpybsu,
+    hexagon_M5_vmpybuu,
+    hexagon_M5_vrmacbsu,
+    hexagon_M5_vrmacbuu,
+    hexagon_M5_vrmpybsu,
+    hexagon_M5_vrmpybuu,
+    hexagon_M6_vabsdiffb,
+    hexagon_M6_vabsdiffub,
+    hexagon_S2_addasl_rrri,
+    hexagon_S2_asl_i_p,
+    hexagon_S2_asl_i_p_acc,
+    hexagon_S2_asl_i_p_and,
+    hexagon_S2_asl_i_p_nac,
+    hexagon_S2_asl_i_p_or,
+    hexagon_S2_asl_i_p_xacc,
+    hexagon_S2_asl_i_r,
+    hexagon_S2_asl_i_r_acc,
+    hexagon_S2_asl_i_r_and,
+    hexagon_S2_asl_i_r_nac,
+    hexagon_S2_asl_i_r_or,
+    hexagon_S2_asl_i_r_sat,
+    hexagon_S2_asl_i_r_xacc,
+    hexagon_S2_asl_i_vh,
+    hexagon_S2_asl_i_vw,
+    hexagon_S2_asl_r_p,
+    hexagon_S2_asl_r_p_acc,
+    hexagon_S2_asl_r_p_and,
+    hexagon_S2_asl_r_p_nac,
+    hexagon_S2_asl_r_p_or,
+    hexagon_S2_asl_r_p_xor,
+    hexagon_S2_asl_r_r,
+    hexagon_S2_asl_r_r_acc,
+    hexagon_S2_asl_r_r_and,
+    hexagon_S2_asl_r_r_nac,
+    hexagon_S2_asl_r_r_or,
+    hexagon_S2_asl_r_r_sat,
+    hexagon_S2_asl_r_vh,
+    hexagon_S2_asl_r_vw,
+    hexagon_S2_asr_i_p,
+    hexagon_S2_asr_i_p_acc,
+    hexagon_S2_asr_i_p_and,
+    hexagon_S2_asr_i_p_nac,
+    hexagon_S2_asr_i_p_or,
+    hexagon_S2_asr_i_p_rnd,
+    hexagon_S2_asr_i_p_rnd_goodsyntax,
+    hexagon_S2_asr_i_r,
+    hexagon_S2_asr_i_r_acc,
+    hexagon_S2_asr_i_r_and,
+    hexagon_S2_asr_i_r_nac,
+    hexagon_S2_asr_i_r_or,
+    hexagon_S2_asr_i_r_rnd,
+    hexagon_S2_asr_i_r_rnd_goodsyntax,
+    hexagon_S2_asr_i_svw_trun,
+    hexagon_S2_asr_i_vh,
+    hexagon_S2_asr_i_vw,
+    hexagon_S2_asr_r_p,
+    hexagon_S2_asr_r_p_acc,
+    hexagon_S2_asr_r_p_and,
+    hexagon_S2_asr_r_p_nac,
+    hexagon_S2_asr_r_p_or,
+    hexagon_S2_asr_r_p_xor,
+    hexagon_S2_asr_r_r,
+    hexagon_S2_asr_r_r_acc,
+    hexagon_S2_asr_r_r_and,
+    hexagon_S2_asr_r_r_nac,
+    hexagon_S2_asr_r_r_or,
+    hexagon_S2_asr_r_r_sat,
+    hexagon_S2_asr_r_svw_trun,
+    hexagon_S2_asr_r_vh,
+    hexagon_S2_asr_r_vw,
+    hexagon_S2_brev,
+    hexagon_S2_brevp,
+    hexagon_S2_cabacencbin,
+    hexagon_S2_cl0,
+    hexagon_S2_cl0p,
+    hexagon_S2_cl1,
+    hexagon_S2_cl1p,
+    hexagon_S2_clb,
+    hexagon_S2_clbnorm,
+    hexagon_S2_clbp,
+    hexagon_S2_clrbit_i,
+    hexagon_S2_clrbit_r,
+    hexagon_S2_ct0,
+    hexagon_S2_ct0p,
+    hexagon_S2_ct1,
+    hexagon_S2_ct1p,
+    hexagon_S2_deinterleave,
+    hexagon_S2_extractu,
+    hexagon_S2_extractu_rp,
+    hexagon_S2_extractup,
+    hexagon_S2_extractup_rp,
+    hexagon_S2_insert,
+    hexagon_S2_insert_rp,
+    hexagon_S2_insertp,
+    hexagon_S2_insertp_rp,
+    hexagon_S2_interleave,
+    hexagon_S2_lfsp,
+    hexagon_S2_lsl_r_p,
+    hexagon_S2_lsl_r_p_acc,
+    hexagon_S2_lsl_r_p_and,
+    hexagon_S2_lsl_r_p_nac,
+    hexagon_S2_lsl_r_p_or,
+    hexagon_S2_lsl_r_p_xor,
+    hexagon_S2_lsl_r_r,
+    hexagon_S2_lsl_r_r_acc,
+    hexagon_S2_lsl_r_r_and,
+    hexagon_S2_lsl_r_r_nac,
+    hexagon_S2_lsl_r_r_or,
+    hexagon_S2_lsl_r_vh,
+    hexagon_S2_lsl_r_vw,
+    hexagon_S2_lsr_i_p,
+    hexagon_S2_lsr_i_p_acc,
+    hexagon_S2_lsr_i_p_and,
+    hexagon_S2_lsr_i_p_nac,
+    hexagon_S2_lsr_i_p_or,
+    hexagon_S2_lsr_i_p_xacc,
+    hexagon_S2_lsr_i_r,
+    hexagon_S2_lsr_i_r_acc,
+    hexagon_S2_lsr_i_r_and,
+    hexagon_S2_lsr_i_r_nac,
+    hexagon_S2_lsr_i_r_or,
+    hexagon_S2_lsr_i_r_xacc,
+    hexagon_S2_lsr_i_vh,
+    hexagon_S2_lsr_i_vw,
+    hexagon_S2_lsr_r_p,
+    hexagon_S2_lsr_r_p_acc,
+    hexagon_S2_lsr_r_p_and,
+    hexagon_S2_lsr_r_p_nac,
+    hexagon_S2_lsr_r_p_or,
+    hexagon_S2_lsr_r_p_xor,
+    hexagon_S2_lsr_r_r,
+    hexagon_S2_lsr_r_r_acc,
+    hexagon_S2_lsr_r_r_and,
+    hexagon_S2_lsr_r_r_nac,
+    hexagon_S2_lsr_r_r_or,
+    hexagon_S2_lsr_r_vh,
+    hexagon_S2_lsr_r_vw,
+    hexagon_S2_packhl,
+    hexagon_S2_parityp,
+    hexagon_S2_setbit_i,
+    hexagon_S2_setbit_r,
+    hexagon_S2_shuffeb,
+    hexagon_S2_shuffeh,
+    hexagon_S2_shuffob,
+    hexagon_S2_shuffoh,
+    hexagon_S2_storew_locked,
+    hexagon_S2_svsathb,
+    hexagon_S2_svsathub,
+    hexagon_S2_tableidxb_goodsyntax,
+    hexagon_S2_tableidxd_goodsyntax,
+    hexagon_S2_tableidxh_goodsyntax,
+    hexagon_S2_tableidxw_goodsyntax,
+    hexagon_S2_togglebit_i,
+    hexagon_S2_togglebit_r,
+    hexagon_S2_tstbit_i,
+    hexagon_S2_tstbit_r,
+    hexagon_S2_valignib,
+    hexagon_S2_valignrb,
+    hexagon_S2_vcnegh,
+    hexagon_S2_vcrotate,
+    hexagon_S2_vrcnegh,
+    hexagon_S2_vrndpackwh,
+    hexagon_S2_vrndpackwhs,
+    hexagon_S2_vsathb,
+    hexagon_S2_vsathb_nopack,
+    hexagon_S2_vsathub,
+    hexagon_S2_vsathub_nopack,
+    hexagon_S2_vsatwh,
+    hexagon_S2_vsatwh_nopack,
+    hexagon_S2_vsatwuh,
+    hexagon_S2_vsatwuh_nopack,
+    hexagon_S2_vsplatrb,
+    hexagon_S2_vsplatrh,
+    hexagon_S2_vspliceib,
+    hexagon_S2_vsplicerb,
+    hexagon_S2_vsxtbh,
+    hexagon_S2_vsxthw,
+    hexagon_S2_vtrunehb,
+    hexagon_S2_vtrunewh,
+    hexagon_S2_vtrunohb,
+    hexagon_S2_vtrunowh,
+    hexagon_S2_vzxtbh,
+    hexagon_S2_vzxthw,
+    hexagon_S4_addaddi,
+    hexagon_S4_addi_asl_ri,
+    hexagon_S4_addi_lsr_ri,
+    hexagon_S4_andi_asl_ri,
+    hexagon_S4_andi_lsr_ri,
+    hexagon_S4_clbaddi,
+    hexagon_S4_clbpaddi,
+    hexagon_S4_clbpnorm,
+    hexagon_S4_extract,
+    hexagon_S4_extract_rp,
+    hexagon_S4_extractp,
+    hexagon_S4_extractp_rp,
+    hexagon_S4_lsli,
+    hexagon_S4_ntstbit_i,
+    hexagon_S4_ntstbit_r,
+    hexagon_S4_or_andi,
+    hexagon_S4_or_andix,
+    hexagon_S4_or_ori,
+    hexagon_S4_ori_asl_ri,
+    hexagon_S4_ori_lsr_ri,
+    hexagon_S4_parity,
+    hexagon_S4_stored_locked,
+    hexagon_S4_subaddi,
+    hexagon_S4_subi_asl_ri,
+    hexagon_S4_subi_lsr_ri,
+    hexagon_S4_vrcrotate,
+    hexagon_S4_vrcrotate_acc,
+    hexagon_S4_vxaddsubh,
+    hexagon_S4_vxaddsubhr,
+    hexagon_S4_vxaddsubw,
+    hexagon_S4_vxsubaddh,
+    hexagon_S4_vxsubaddhr,
+    hexagon_S4_vxsubaddw,
+    hexagon_S5_asrhub_rnd_sat_goodsyntax,
+    hexagon_S5_asrhub_sat,
+    hexagon_S5_popcountp,
+    hexagon_S5_vasrhrnd_goodsyntax,
+    hexagon_S6_rol_i_p,
+    hexagon_S6_rol_i_p_acc,
+    hexagon_S6_rol_i_p_and,
+    hexagon_S6_rol_i_p_nac,
+    hexagon_S6_rol_i_p_or,
+    hexagon_S6_rol_i_p_xacc,
+    hexagon_S6_rol_i_r,
+    hexagon_S6_rol_i_r_acc,
+    hexagon_S6_rol_i_r_and,
+    hexagon_S6_rol_i_r_nac,
+    hexagon_S6_rol_i_r_or,
+    hexagon_S6_rol_i_r_xacc,
+    hexagon_S6_vsplatrbp,
+    hexagon_S6_vtrunehb_ppp,
+    hexagon_S6_vtrunohb_ppp,
+    hexagon_SI_to_SXTHI_asrh,
+    hexagon_V6_extractw,
+    hexagon_V6_extractw_128B,
+    hexagon_V6_hi,
+    hexagon_V6_hi_128B,
+    hexagon_V6_lo,
+    hexagon_V6_lo_128B,
+    hexagon_V6_lvsplatb,
+    hexagon_V6_lvsplatb_128B,
+    hexagon_V6_lvsplath,
+    hexagon_V6_lvsplath_128B,
+    hexagon_V6_lvsplatw,
+    hexagon_V6_lvsplatw_128B,
+    hexagon_V6_pred_and,
+    hexagon_V6_pred_and_128B,
+    hexagon_V6_pred_and_n,
+    hexagon_V6_pred_and_n_128B,
+    hexagon_V6_pred_not,
+    hexagon_V6_pred_not_128B,
+    hexagon_V6_pred_or,
+    hexagon_V6_pred_or_128B,
+    hexagon_V6_pred_or_n,
+    hexagon_V6_pred_or_n_128B,
+    hexagon_V6_pred_scalar2,
+    hexagon_V6_pred_scalar2_128B,
+    hexagon_V6_pred_scalar2v2,
+    hexagon_V6_pred_scalar2v2_128B,
+    hexagon_V6_pred_xor,
+    hexagon_V6_pred_xor_128B,
+    hexagon_V6_shuffeqh,
+    hexagon_V6_shuffeqh_128B,
+    hexagon_V6_shuffeqw,
+    hexagon_V6_shuffeqw_128B,
+    hexagon_V6_vS32b_nqpred_ai,
+    hexagon_V6_vS32b_nqpred_ai_128B,
+    hexagon_V6_vS32b_nt_nqpred_ai,
+    hexagon_V6_vS32b_nt_nqpred_ai_128B,
+    hexagon_V6_vS32b_nt_qpred_ai,
+    hexagon_V6_vS32b_nt_qpred_ai_128B,
+    hexagon_V6_vS32b_qpred_ai,
+    hexagon_V6_vS32b_qpred_ai_128B,
+    hexagon_V6_vabsb,
+    hexagon_V6_vabsb_128B,
+    hexagon_V6_vabsb_sat,
+    hexagon_V6_vabsb_sat_128B,
+    hexagon_V6_vabsdiffh,
+    hexagon_V6_vabsdiffh_128B,
+    hexagon_V6_vabsdiffub,
+    hexagon_V6_vabsdiffub_128B,
+    hexagon_V6_vabsdiffuh,
+    hexagon_V6_vabsdiffuh_128B,
+    hexagon_V6_vabsdiffw,
+    hexagon_V6_vabsdiffw_128B,
+    hexagon_V6_vabsh,
+    hexagon_V6_vabsh_128B,
+    hexagon_V6_vabsh_sat,
+    hexagon_V6_vabsh_sat_128B,
+    hexagon_V6_vabsw,
+    hexagon_V6_vabsw_128B,
+    hexagon_V6_vabsw_sat,
+    hexagon_V6_vabsw_sat_128B,
+    hexagon_V6_vaddb,
+    hexagon_V6_vaddb_128B,
+    hexagon_V6_vaddb_dv,
+    hexagon_V6_vaddb_dv_128B,
+    hexagon_V6_vaddbnq,
+    hexagon_V6_vaddbnq_128B,
+    hexagon_V6_vaddbq,
+    hexagon_V6_vaddbq_128B,
+    hexagon_V6_vaddbsat,
+    hexagon_V6_vaddbsat_128B,
+    hexagon_V6_vaddbsat_dv,
+    hexagon_V6_vaddbsat_dv_128B,
+    hexagon_V6_vaddcarry,
+    hexagon_V6_vaddcarry_128B,
+    hexagon_V6_vaddclbh,
+    hexagon_V6_vaddclbh_128B,
+    hexagon_V6_vaddclbw,
+    hexagon_V6_vaddclbw_128B,
+    hexagon_V6_vaddh,
+    hexagon_V6_vaddh_128B,
+    hexagon_V6_vaddh_dv,
+    hexagon_V6_vaddh_dv_128B,
+    hexagon_V6_vaddhnq,
+    hexagon_V6_vaddhnq_128B,
+    hexagon_V6_vaddhq,
+    hexagon_V6_vaddhq_128B,
+    hexagon_V6_vaddhsat,
+    hexagon_V6_vaddhsat_128B,
+    hexagon_V6_vaddhsat_dv,
+    hexagon_V6_vaddhsat_dv_128B,
+    hexagon_V6_vaddhw,
+    hexagon_V6_vaddhw_128B,
+    hexagon_V6_vaddhw_acc,
+    hexagon_V6_vaddhw_acc_128B,
+    hexagon_V6_vaddubh,
+    hexagon_V6_vaddubh_128B,
+    hexagon_V6_vaddubh_acc,
+    hexagon_V6_vaddubh_acc_128B,
+    hexagon_V6_vaddubsat,
+    hexagon_V6_vaddubsat_128B,
+    hexagon_V6_vaddubsat_dv,
+    hexagon_V6_vaddubsat_dv_128B,
+    hexagon_V6_vaddububb_sat,
+    hexagon_V6_vaddububb_sat_128B,
+    hexagon_V6_vadduhsat,
+    hexagon_V6_vadduhsat_128B,
+    hexagon_V6_vadduhsat_dv,
+    hexagon_V6_vadduhsat_dv_128B,
+    hexagon_V6_vadduhw,
+    hexagon_V6_vadduhw_128B,
+    hexagon_V6_vadduhw_acc,
+    hexagon_V6_vadduhw_acc_128B,
+    hexagon_V6_vadduwsat,
+    hexagon_V6_vadduwsat_128B,
+    hexagon_V6_vadduwsat_dv,
+    hexagon_V6_vadduwsat_dv_128B,
+    hexagon_V6_vaddw,
+    hexagon_V6_vaddw_128B,
+    hexagon_V6_vaddw_dv,
+    hexagon_V6_vaddw_dv_128B,
+    hexagon_V6_vaddwnq,
+    hexagon_V6_vaddwnq_128B,
+    hexagon_V6_vaddwq,
+    hexagon_V6_vaddwq_128B,
+    hexagon_V6_vaddwsat,
+    hexagon_V6_vaddwsat_128B,
+    hexagon_V6_vaddwsat_dv,
+    hexagon_V6_vaddwsat_dv_128B,
+    hexagon_V6_valignb,
+    hexagon_V6_valignb_128B,
+    hexagon_V6_valignbi,
+    hexagon_V6_valignbi_128B,
+    hexagon_V6_vand,
+    hexagon_V6_vand_128B,
+    hexagon_V6_vandnqrt,
+    hexagon_V6_vandnqrt_128B,
+    hexagon_V6_vandnqrt_acc,
+    hexagon_V6_vandnqrt_acc_128B,
+    hexagon_V6_vandqrt,
+    hexagon_V6_vandqrt_128B,
+    hexagon_V6_vandqrt_acc,
+    hexagon_V6_vandqrt_acc_128B,
+    hexagon_V6_vandvnqv,
+    hexagon_V6_vandvnqv_128B,
+    hexagon_V6_vandvqv,
+    hexagon_V6_vandvqv_128B,
+    hexagon_V6_vandvrt,
+    hexagon_V6_vandvrt_128B,
+    hexagon_V6_vandvrt_acc,
+    hexagon_V6_vandvrt_acc_128B,
+    hexagon_V6_vaslh,
+    hexagon_V6_vaslh_128B,
+    hexagon_V6_vaslh_acc,
+    hexagon_V6_vaslh_acc_128B,
+    hexagon_V6_vaslhv,
+    hexagon_V6_vaslhv_128B,
+    hexagon_V6_vaslw,
+    hexagon_V6_vaslw_128B,
+    hexagon_V6_vaslw_acc,
+    hexagon_V6_vaslw_acc_128B,
+    hexagon_V6_vaslwv,
+    hexagon_V6_vaslwv_128B,
+    hexagon_V6_vasrh,
+    hexagon_V6_vasrh_128B,
+    hexagon_V6_vasrh_acc,
+    hexagon_V6_vasrh_acc_128B,
+    hexagon_V6_vasrhbrndsat,
+    hexagon_V6_vasrhbrndsat_128B,
+    hexagon_V6_vasrhbsat,
+    hexagon_V6_vasrhbsat_128B,
+    hexagon_V6_vasrhubrndsat,
+    hexagon_V6_vasrhubrndsat_128B,
+    hexagon_V6_vasrhubsat,
+    hexagon_V6_vasrhubsat_128B,
+    hexagon_V6_vasrhv,
+    hexagon_V6_vasrhv_128B,
+    hexagon_V6_vasruhubrndsat,
+    hexagon_V6_vasruhubrndsat_128B,
+    hexagon_V6_vasruhubsat,
+    hexagon_V6_vasruhubsat_128B,
+    hexagon_V6_vasruwuhrndsat,
+    hexagon_V6_vasruwuhrndsat_128B,
+    hexagon_V6_vasruwuhsat,
+    hexagon_V6_vasruwuhsat_128B,
+    hexagon_V6_vasrw,
+    hexagon_V6_vasrw_128B,
+    hexagon_V6_vasrw_acc,
+    hexagon_V6_vasrw_acc_128B,
+    hexagon_V6_vasrwh,
+    hexagon_V6_vasrwh_128B,
+    hexagon_V6_vasrwhrndsat,
+    hexagon_V6_vasrwhrndsat_128B,
+    hexagon_V6_vasrwhsat,
+    hexagon_V6_vasrwhsat_128B,
+    hexagon_V6_vasrwuhrndsat,
+    hexagon_V6_vasrwuhrndsat_128B,
+    hexagon_V6_vasrwuhsat,
+    hexagon_V6_vasrwuhsat_128B,
+    hexagon_V6_vasrwv,
+    hexagon_V6_vasrwv_128B,
+    hexagon_V6_vassign,
+    hexagon_V6_vassign_128B,
+    hexagon_V6_vassignp,
+    hexagon_V6_vassignp_128B,
+    hexagon_V6_vavgb,
+    hexagon_V6_vavgb_128B,
+    hexagon_V6_vavgbrnd,
+    hexagon_V6_vavgbrnd_128B,
+    hexagon_V6_vavgh,
+    hexagon_V6_vavgh_128B,
+    hexagon_V6_vavghrnd,
+    hexagon_V6_vavghrnd_128B,
+    hexagon_V6_vavgub,
+    hexagon_V6_vavgub_128B,
+    hexagon_V6_vavgubrnd,
+    hexagon_V6_vavgubrnd_128B,
+    hexagon_V6_vavguh,
+    hexagon_V6_vavguh_128B,
+    hexagon_V6_vavguhrnd,
+    hexagon_V6_vavguhrnd_128B,
+    hexagon_V6_vavguw,
+    hexagon_V6_vavguw_128B,
+    hexagon_V6_vavguwrnd,
+    hexagon_V6_vavguwrnd_128B,
+    hexagon_V6_vavgw,
+    hexagon_V6_vavgw_128B,
+    hexagon_V6_vavgwrnd,
+    hexagon_V6_vavgwrnd_128B,
+    hexagon_V6_vcl0h,
+    hexagon_V6_vcl0h_128B,
+    hexagon_V6_vcl0w,
+    hexagon_V6_vcl0w_128B,
+    hexagon_V6_vcombine,
+    hexagon_V6_vcombine_128B,
+    hexagon_V6_vd0,
+    hexagon_V6_vd0_128B,
+    hexagon_V6_vdd0,
+    hexagon_V6_vdd0_128B,
+    hexagon_V6_vdealb,
+    hexagon_V6_vdealb_128B,
+    hexagon_V6_vdealb4w,
+    hexagon_V6_vdealb4w_128B,
+    hexagon_V6_vdealh,
+    hexagon_V6_vdealh_128B,
+    hexagon_V6_vdealvdd,
+    hexagon_V6_vdealvdd_128B,
+    hexagon_V6_vdelta,
+    hexagon_V6_vdelta_128B,
+    hexagon_V6_vdmpybus,
+    hexagon_V6_vdmpybus_128B,
+    hexagon_V6_vdmpybus_acc,
+    hexagon_V6_vdmpybus_acc_128B,
+    hexagon_V6_vdmpybus_dv,
+    hexagon_V6_vdmpybus_dv_128B,
+    hexagon_V6_vdmpybus_dv_acc,
+    hexagon_V6_vdmpybus_dv_acc_128B,
+    hexagon_V6_vdmpyhb,
+    hexagon_V6_vdmpyhb_128B,
+    hexagon_V6_vdmpyhb_acc,
+    hexagon_V6_vdmpyhb_acc_128B,
+    hexagon_V6_vdmpyhb_dv,
+    hexagon_V6_vdmpyhb_dv_128B,
+    hexagon_V6_vdmpyhb_dv_acc,
+    hexagon_V6_vdmpyhb_dv_acc_128B,
+    hexagon_V6_vdmpyhisat,
+    hexagon_V6_vdmpyhisat_128B,
+    hexagon_V6_vdmpyhisat_acc,
+    hexagon_V6_vdmpyhisat_acc_128B,
+    hexagon_V6_vdmpyhsat,
+    hexagon_V6_vdmpyhsat_128B,
+    hexagon_V6_vdmpyhsat_acc,
+    hexagon_V6_vdmpyhsat_acc_128B,
+    hexagon_V6_vdmpyhsuisat,
+    hexagon_V6_vdmpyhsuisat_128B,
+    hexagon_V6_vdmpyhsuisat_acc,
+    hexagon_V6_vdmpyhsuisat_acc_128B,
+    hexagon_V6_vdmpyhsusat,
+    hexagon_V6_vdmpyhsusat_128B,
+    hexagon_V6_vdmpyhsusat_acc,
+    hexagon_V6_vdmpyhsusat_acc_128B,
+    hexagon_V6_vdmpyhvsat,
+    hexagon_V6_vdmpyhvsat_128B,
+    hexagon_V6_vdmpyhvsat_acc,
+    hexagon_V6_vdmpyhvsat_acc_128B,
+    hexagon_V6_vdsaduh,
+    hexagon_V6_vdsaduh_128B,
+    hexagon_V6_vdsaduh_acc,
+    hexagon_V6_vdsaduh_acc_128B,
+    hexagon_V6_veqb,
+    hexagon_V6_veqb_128B,
+    hexagon_V6_veqb_and,
+    hexagon_V6_veqb_and_128B,
+    hexagon_V6_veqb_or,
+    hexagon_V6_veqb_or_128B,
+    hexagon_V6_veqb_xor,
+    hexagon_V6_veqb_xor_128B,
+    hexagon_V6_veqh,
+    hexagon_V6_veqh_128B,
+    hexagon_V6_veqh_and,
+    hexagon_V6_veqh_and_128B,
+    hexagon_V6_veqh_or,
+    hexagon_V6_veqh_or_128B,
+    hexagon_V6_veqh_xor,
+    hexagon_V6_veqh_xor_128B,
+    hexagon_V6_veqw,
+    hexagon_V6_veqw_128B,
+    hexagon_V6_veqw_and,
+    hexagon_V6_veqw_and_128B,
+    hexagon_V6_veqw_or,
+    hexagon_V6_veqw_or_128B,
+    hexagon_V6_veqw_xor,
+    hexagon_V6_veqw_xor_128B,
+    hexagon_V6_vgathermh,
+    hexagon_V6_vgathermh_128B,
+    hexagon_V6_vgathermhq,
+    hexagon_V6_vgathermhq_128B,
+    hexagon_V6_vgathermhw,
+    hexagon_V6_vgathermhw_128B,
+    hexagon_V6_vgathermhwq,
+    hexagon_V6_vgathermhwq_128B,
+    hexagon_V6_vgathermw,
+    hexagon_V6_vgathermw_128B,
+    hexagon_V6_vgathermwq,
+    hexagon_V6_vgathermwq_128B,
+    hexagon_V6_vgtb,
+    hexagon_V6_vgtb_128B,
+    hexagon_V6_vgtb_and,
+    hexagon_V6_vgtb_and_128B,
+    hexagon_V6_vgtb_or,
+    hexagon_V6_vgtb_or_128B,
+    hexagon_V6_vgtb_xor,
+    hexagon_V6_vgtb_xor_128B,
+    hexagon_V6_vgth,
+    hexagon_V6_vgth_128B,
+    hexagon_V6_vgth_and,
+    hexagon_V6_vgth_and_128B,
+    hexagon_V6_vgth_or,
+    hexagon_V6_vgth_or_128B,
+    hexagon_V6_vgth_xor,
+    hexagon_V6_vgth_xor_128B,
+    hexagon_V6_vgtub,
+    hexagon_V6_vgtub_128B,
+    hexagon_V6_vgtub_and,
+    hexagon_V6_vgtub_and_128B,
+    hexagon_V6_vgtub_or,
+    hexagon_V6_vgtub_or_128B,
+    hexagon_V6_vgtub_xor,
+    hexagon_V6_vgtub_xor_128B,
+    hexagon_V6_vgtuh,
+    hexagon_V6_vgtuh_128B,
+    hexagon_V6_vgtuh_and,
+    hexagon_V6_vgtuh_and_128B,
+    hexagon_V6_vgtuh_or,
+    hexagon_V6_vgtuh_or_128B,
+    hexagon_V6_vgtuh_xor,
+    hexagon_V6_vgtuh_xor_128B,
+    hexagon_V6_vgtuw,
+    hexagon_V6_vgtuw_128B,
+    hexagon_V6_vgtuw_and,
+    hexagon_V6_vgtuw_and_128B,
+    hexagon_V6_vgtuw_or,
+    hexagon_V6_vgtuw_or_128B,
+    hexagon_V6_vgtuw_xor,
+    hexagon_V6_vgtuw_xor_128B,
+    hexagon_V6_vgtw,
+    hexagon_V6_vgtw_128B,
+    hexagon_V6_vgtw_and,
+    hexagon_V6_vgtw_and_128B,
+    hexagon_V6_vgtw_or,
+    hexagon_V6_vgtw_or_128B,
+    hexagon_V6_vgtw_xor,
+    hexagon_V6_vgtw_xor_128B,
+    hexagon_V6_vinsertwr,
+    hexagon_V6_vinsertwr_128B,
+    hexagon_V6_vlalignb,
+    hexagon_V6_vlalignb_128B,
+    hexagon_V6_vlalignbi,
+    hexagon_V6_vlalignbi_128B,
+    hexagon_V6_vlsrb,
+    hexagon_V6_vlsrb_128B,
+    hexagon_V6_vlsrh,
+    hexagon_V6_vlsrh_128B,
+    hexagon_V6_vlsrhv,
+    hexagon_V6_vlsrhv_128B,
+    hexagon_V6_vlsrw,
+    hexagon_V6_vlsrw_128B,
+    hexagon_V6_vlsrwv,
+    hexagon_V6_vlsrwv_128B,
+    hexagon_V6_vlut4,
+    hexagon_V6_vlut4_128B,
+    hexagon_V6_vlutvvb,
+    hexagon_V6_vlutvvb_128B,
+    hexagon_V6_vlutvvb_nm,
+    hexagon_V6_vlutvvb_nm_128B,
+    hexagon_V6_vlutvvb_oracc,
+    hexagon_V6_vlutvvb_oracc_128B,
+    hexagon_V6_vlutvvb_oracci,
+    hexagon_V6_vlutvvb_oracci_128B,
+    hexagon_V6_vlutvvbi,
+    hexagon_V6_vlutvvbi_128B,
+    hexagon_V6_vlutvwh,
+    hexagon_V6_vlutvwh_128B,
+    hexagon_V6_vlutvwh_nm,
+    hexagon_V6_vlutvwh_nm_128B,
+    hexagon_V6_vlutvwh_oracc,
+    hexagon_V6_vlutvwh_oracc_128B,
+    hexagon_V6_vlutvwh_oracci,
+    hexagon_V6_vlutvwh_oracci_128B,
+    hexagon_V6_vlutvwhi,
+    hexagon_V6_vlutvwhi_128B,
+    hexagon_V6_vmaskedstorenq,
+    hexagon_V6_vmaskedstorenq_128B,
+    hexagon_V6_vmaskedstorentnq,
+    hexagon_V6_vmaskedstorentnq_128B,
+    hexagon_V6_vmaskedstorentq,
+    hexagon_V6_vmaskedstorentq_128B,
+    hexagon_V6_vmaskedstoreq,
+    hexagon_V6_vmaskedstoreq_128B,
+    hexagon_V6_vmaxb,
+    hexagon_V6_vmaxb_128B,
+    hexagon_V6_vmaxh,
+    hexagon_V6_vmaxh_128B,
+    hexagon_V6_vmaxub,
+    hexagon_V6_vmaxub_128B,
+    hexagon_V6_vmaxuh,
+    hexagon_V6_vmaxuh_128B,
+    hexagon_V6_vmaxw,
+    hexagon_V6_vmaxw_128B,
+    hexagon_V6_vminb,
+    hexagon_V6_vminb_128B,
+    hexagon_V6_vminh,
+    hexagon_V6_vminh_128B,
+    hexagon_V6_vminub,
+    hexagon_V6_vminub_128B,
+    hexagon_V6_vminuh,
+    hexagon_V6_vminuh_128B,
+    hexagon_V6_vminw,
+    hexagon_V6_vminw_128B,
+    hexagon_V6_vmpabus,
+    hexagon_V6_vmpabus_128B,
+    hexagon_V6_vmpabus_acc,
+    hexagon_V6_vmpabus_acc_128B,
+    hexagon_V6_vmpabusv,
+    hexagon_V6_vmpabusv_128B,
+    hexagon_V6_vmpabuu,
+    hexagon_V6_vmpabuu_128B,
+    hexagon_V6_vmpabuu_acc,
+    hexagon_V6_vmpabuu_acc_128B,
+    hexagon_V6_vmpabuuv,
+    hexagon_V6_vmpabuuv_128B,
+    hexagon_V6_vmpahb,
+    hexagon_V6_vmpahb_128B,
+    hexagon_V6_vmpahb_acc,
+    hexagon_V6_vmpahb_acc_128B,
+    hexagon_V6_vmpahhsat,
+    hexagon_V6_vmpahhsat_128B,
+    hexagon_V6_vmpauhb,
+    hexagon_V6_vmpauhb_128B,
+    hexagon_V6_vmpauhb_acc,
+    hexagon_V6_vmpauhb_acc_128B,
+    hexagon_V6_vmpauhuhsat,
+    hexagon_V6_vmpauhuhsat_128B,
+    hexagon_V6_vmpsuhuhsat,
+    hexagon_V6_vmpsuhuhsat_128B,
+    hexagon_V6_vmpybus,
+    hexagon_V6_vmpybus_128B,
+    hexagon_V6_vmpybus_acc,
+    hexagon_V6_vmpybus_acc_128B,
+    hexagon_V6_vmpybusv,
+    hexagon_V6_vmpybusv_128B,
+    hexagon_V6_vmpybusv_acc,
+    hexagon_V6_vmpybusv_acc_128B,
+    hexagon_V6_vmpybv,
+    hexagon_V6_vmpybv_128B,
+    hexagon_V6_vmpybv_acc,
+    hexagon_V6_vmpybv_acc_128B,
+    hexagon_V6_vmpyewuh,
+    hexagon_V6_vmpyewuh_128B,
+    hexagon_V6_vmpyewuh_64,
+    hexagon_V6_vmpyewuh_64_128B,
+    hexagon_V6_vmpyh,
+    hexagon_V6_vmpyh_128B,
+    hexagon_V6_vmpyh_acc,
+    hexagon_V6_vmpyh_acc_128B,
+    hexagon_V6_vmpyhsat_acc,
+    hexagon_V6_vmpyhsat_acc_128B,
+    hexagon_V6_vmpyhsrs,
+    hexagon_V6_vmpyhsrs_128B,
+    hexagon_V6_vmpyhss,
+    hexagon_V6_vmpyhss_128B,
+    hexagon_V6_vmpyhus,
+    hexagon_V6_vmpyhus_128B,
+    hexagon_V6_vmpyhus_acc,
+    hexagon_V6_vmpyhus_acc_128B,
+    hexagon_V6_vmpyhv,
+    hexagon_V6_vmpyhv_128B,
+    hexagon_V6_vmpyhv_acc,
+    hexagon_V6_vmpyhv_acc_128B,
+    hexagon_V6_vmpyhvsrs,
+    hexagon_V6_vmpyhvsrs_128B,
+    hexagon_V6_vmpyieoh,
+    hexagon_V6_vmpyieoh_128B,
+    hexagon_V6_vmpyiewh_acc,
+    hexagon_V6_vmpyiewh_acc_128B,
+    hexagon_V6_vmpyiewuh,
+    hexagon_V6_vmpyiewuh_128B,
+    hexagon_V6_vmpyiewuh_acc,
+    hexagon_V6_vmpyiewuh_acc_128B,
+    hexagon_V6_vmpyih,
+    hexagon_V6_vmpyih_128B,
+    hexagon_V6_vmpyih_acc,
+    hexagon_V6_vmpyih_acc_128B,
+    hexagon_V6_vmpyihb,
+    hexagon_V6_vmpyihb_128B,
+    hexagon_V6_vmpyihb_acc,
+    hexagon_V6_vmpyihb_acc_128B,
+    hexagon_V6_vmpyiowh,
+    hexagon_V6_vmpyiowh_128B,
+    hexagon_V6_vmpyiwb,
+    hexagon_V6_vmpyiwb_128B,
+    hexagon_V6_vmpyiwb_acc,
+    hexagon_V6_vmpyiwb_acc_128B,
+    hexagon_V6_vmpyiwh,
+    hexagon_V6_vmpyiwh_128B,
+    hexagon_V6_vmpyiwh_acc,
+    hexagon_V6_vmpyiwh_acc_128B,
+    hexagon_V6_vmpyiwub,
+    hexagon_V6_vmpyiwub_128B,
+    hexagon_V6_vmpyiwub_acc,
+    hexagon_V6_vmpyiwub_acc_128B,
+    hexagon_V6_vmpyowh,
+    hexagon_V6_vmpyowh_128B,
+    hexagon_V6_vmpyowh_64_acc,
+    hexagon_V6_vmpyowh_64_acc_128B,
+    hexagon_V6_vmpyowh_rnd,
+    hexagon_V6_vmpyowh_rnd_128B,
+    hexagon_V6_vmpyowh_rnd_sacc,
+    hexagon_V6_vmpyowh_rnd_sacc_128B,
+    hexagon_V6_vmpyowh_sacc,
+    hexagon_V6_vmpyowh_sacc_128B,
+    hexagon_V6_vmpyub,
+    hexagon_V6_vmpyub_128B,
+    hexagon_V6_vmpyub_acc,
+    hexagon_V6_vmpyub_acc_128B,
+    hexagon_V6_vmpyubv,
+    hexagon_V6_vmpyubv_128B,
+    hexagon_V6_vmpyubv_acc,
+    hexagon_V6_vmpyubv_acc_128B,
+    hexagon_V6_vmpyuh,
+    hexagon_V6_vmpyuh_128B,
+    hexagon_V6_vmpyuh_acc,
+    hexagon_V6_vmpyuh_acc_128B,
+    hexagon_V6_vmpyuhe,
+    hexagon_V6_vmpyuhe_128B,
+    hexagon_V6_vmpyuhe_acc,
+    hexagon_V6_vmpyuhe_acc_128B,
+    hexagon_V6_vmpyuhv,
+    hexagon_V6_vmpyuhv_128B,
+    hexagon_V6_vmpyuhv_acc,
+    hexagon_V6_vmpyuhv_acc_128B,
+    hexagon_V6_vmux,
+    hexagon_V6_vmux_128B,
+    hexagon_V6_vnavgb,
+    hexagon_V6_vnavgb_128B,
+    hexagon_V6_vnavgh,
+    hexagon_V6_vnavgh_128B,
+    hexagon_V6_vnavgub,
+    hexagon_V6_vnavgub_128B,
+    hexagon_V6_vnavgw,
+    hexagon_V6_vnavgw_128B,
+    hexagon_V6_vnormamth,
+    hexagon_V6_vnormamth_128B,
+    hexagon_V6_vnormamtw,
+    hexagon_V6_vnormamtw_128B,
+    hexagon_V6_vnot,
+    hexagon_V6_vnot_128B,
+    hexagon_V6_vor,
+    hexagon_V6_vor_128B,
+    hexagon_V6_vpackeb,
+    hexagon_V6_vpackeb_128B,
+    hexagon_V6_vpackeh,
+    hexagon_V6_vpackeh_128B,
+    hexagon_V6_vpackhb_sat,
+    hexagon_V6_vpackhb_sat_128B,
+    hexagon_V6_vpackhub_sat,
+    hexagon_V6_vpackhub_sat_128B,
+    hexagon_V6_vpackob,
+    hexagon_V6_vpackob_128B,
+    hexagon_V6_vpackoh,
+    hexagon_V6_vpackoh_128B,
+    hexagon_V6_vpackwh_sat,
+    hexagon_V6_vpackwh_sat_128B,
+    hexagon_V6_vpackwuh_sat,
+    hexagon_V6_vpackwuh_sat_128B,
+    hexagon_V6_vpopcounth,
+    hexagon_V6_vpopcounth_128B,
+    hexagon_V6_vprefixqb,
+    hexagon_V6_vprefixqb_128B,
+    hexagon_V6_vprefixqh,
+    hexagon_V6_vprefixqh_128B,
+    hexagon_V6_vprefixqw,
+    hexagon_V6_vprefixqw_128B,
+    hexagon_V6_vrdelta,
+    hexagon_V6_vrdelta_128B,
+    hexagon_V6_vrmpybub_rtt,
+    hexagon_V6_vrmpybub_rtt_128B,
+    hexagon_V6_vrmpybub_rtt_acc,
+    hexagon_V6_vrmpybub_rtt_acc_128B,
+    hexagon_V6_vrmpybus,
+    hexagon_V6_vrmpybus_128B,
+    hexagon_V6_vrmpybus_acc,
+    hexagon_V6_vrmpybus_acc_128B,
+    hexagon_V6_vrmpybusi,
+    hexagon_V6_vrmpybusi_128B,
+    hexagon_V6_vrmpybusi_acc,
+    hexagon_V6_vrmpybusi_acc_128B,
+    hexagon_V6_vrmpybusv,
+    hexagon_V6_vrmpybusv_128B,
+    hexagon_V6_vrmpybusv_acc,
+    hexagon_V6_vrmpybusv_acc_128B,
+    hexagon_V6_vrmpybv,
+    hexagon_V6_vrmpybv_128B,
+    hexagon_V6_vrmpybv_acc,
+    hexagon_V6_vrmpybv_acc_128B,
+    hexagon_V6_vrmpyub,
+    hexagon_V6_vrmpyub_128B,
+    hexagon_V6_vrmpyub_acc,
+    hexagon_V6_vrmpyub_acc_128B,
+    hexagon_V6_vrmpyub_rtt,
+    hexagon_V6_vrmpyub_rtt_128B,
+    hexagon_V6_vrmpyub_rtt_acc,
+    hexagon_V6_vrmpyub_rtt_acc_128B,
+    hexagon_V6_vrmpyubi,
+    hexagon_V6_vrmpyubi_128B,
+    hexagon_V6_vrmpyubi_acc,
+    hexagon_V6_vrmpyubi_acc_128B,
+    hexagon_V6_vrmpyubv,
+    hexagon_V6_vrmpyubv_128B,
+    hexagon_V6_vrmpyubv_acc,
+    hexagon_V6_vrmpyubv_acc_128B,
+    hexagon_V6_vror,
+    hexagon_V6_vror_128B,
+    hexagon_V6_vroundhb,
+    hexagon_V6_vroundhb_128B,
+    hexagon_V6_vroundhub,
+    hexagon_V6_vroundhub_128B,
+    hexagon_V6_vrounduhub,
+    hexagon_V6_vrounduhub_128B,
+    hexagon_V6_vrounduwuh,
+    hexagon_V6_vrounduwuh_128B,
+    hexagon_V6_vroundwh,
+    hexagon_V6_vroundwh_128B,
+    hexagon_V6_vroundwuh,
+    hexagon_V6_vroundwuh_128B,
+    hexagon_V6_vrsadubi,
+    hexagon_V6_vrsadubi_128B,
+    hexagon_V6_vrsadubi_acc,
+    hexagon_V6_vrsadubi_acc_128B,
+    hexagon_V6_vsathub,
+    hexagon_V6_vsathub_128B,
+    hexagon_V6_vsatuwuh,
+    hexagon_V6_vsatuwuh_128B,
+    hexagon_V6_vsatwh,
+    hexagon_V6_vsatwh_128B,
+    hexagon_V6_vsb,
+    hexagon_V6_vsb_128B,
+    hexagon_V6_vscattermh,
+    hexagon_V6_vscattermh_128B,
+    hexagon_V6_vscattermh_add,
+    hexagon_V6_vscattermh_add_128B,
+    hexagon_V6_vscattermhq,
+    hexagon_V6_vscattermhq_128B,
+    hexagon_V6_vscattermhw,
+    hexagon_V6_vscattermhw_128B,
+    hexagon_V6_vscattermhw_add,
+    hexagon_V6_vscattermhw_add_128B,
+    hexagon_V6_vscattermhwq,
+    hexagon_V6_vscattermhwq_128B,
+    hexagon_V6_vscattermw,
+    hexagon_V6_vscattermw_128B,
+    hexagon_V6_vscattermw_add,
+    hexagon_V6_vscattermw_add_128B,
+    hexagon_V6_vscattermwq,
+    hexagon_V6_vscattermwq_128B,
+    hexagon_V6_vsh,
+    hexagon_V6_vsh_128B,
+    hexagon_V6_vshufeh,
+    hexagon_V6_vshufeh_128B,
+    hexagon_V6_vshuffb,
+    hexagon_V6_vshuffb_128B,
+    hexagon_V6_vshuffeb,
+    hexagon_V6_vshuffeb_128B,
+    hexagon_V6_vshuffh,
+    hexagon_V6_vshuffh_128B,
+    hexagon_V6_vshuffob,
+    hexagon_V6_vshuffob_128B,
+    hexagon_V6_vshuffvdd,
+    hexagon_V6_vshuffvdd_128B,
+    hexagon_V6_vshufoeb,
+    hexagon_V6_vshufoeb_128B,
+    hexagon_V6_vshufoeh,
+    hexagon_V6_vshufoeh_128B,
+    hexagon_V6_vshufoh,
+    hexagon_V6_vshufoh_128B,
+    hexagon_V6_vsubb,
+    hexagon_V6_vsubb_128B,
+    hexagon_V6_vsubb_dv,
+    hexagon_V6_vsubb_dv_128B,
+    hexagon_V6_vsubbnq,
+    hexagon_V6_vsubbnq_128B,
+    hexagon_V6_vsubbq,
+    hexagon_V6_vsubbq_128B,
+    hexagon_V6_vsubbsat,
+    hexagon_V6_vsubbsat_128B,
+    hexagon_V6_vsubbsat_dv,
+    hexagon_V6_vsubbsat_dv_128B,
+    hexagon_V6_vsubcarry,
+    hexagon_V6_vsubcarry_128B,
+    hexagon_V6_vsubh,
+    hexagon_V6_vsubh_128B,
+    hexagon_V6_vsubh_dv,
+    hexagon_V6_vsubh_dv_128B,
+    hexagon_V6_vsubhnq,
+    hexagon_V6_vsubhnq_128B,
+    hexagon_V6_vsubhq,
+    hexagon_V6_vsubhq_128B,
+    hexagon_V6_vsubhsat,
+    hexagon_V6_vsubhsat_128B,
+    hexagon_V6_vsubhsat_dv,
+    hexagon_V6_vsubhsat_dv_128B,
+    hexagon_V6_vsubhw,
+    hexagon_V6_vsubhw_128B,
+    hexagon_V6_vsububh,
+    hexagon_V6_vsububh_128B,
+    hexagon_V6_vsububsat,
+    hexagon_V6_vsububsat_128B,
+    hexagon_V6_vsububsat_dv,
+    hexagon_V6_vsububsat_dv_128B,
+    hexagon_V6_vsubububb_sat,
+    hexagon_V6_vsubububb_sat_128B,
+    hexagon_V6_vsubuhsat,
+    hexagon_V6_vsubuhsat_128B,
+    hexagon_V6_vsubuhsat_dv,
+    hexagon_V6_vsubuhsat_dv_128B,
+    hexagon_V6_vsubuhw,
+    hexagon_V6_vsubuhw_128B,
+    hexagon_V6_vsubuwsat,
+    hexagon_V6_vsubuwsat_128B,
+    hexagon_V6_vsubuwsat_dv,
+    hexagon_V6_vsubuwsat_dv_128B,
+    hexagon_V6_vsubw,
+    hexagon_V6_vsubw_128B,
+    hexagon_V6_vsubw_dv,
+    hexagon_V6_vsubw_dv_128B,
+    hexagon_V6_vsubwnq,
+    hexagon_V6_vsubwnq_128B,
+    hexagon_V6_vsubwq,
+    hexagon_V6_vsubwq_128B,
+    hexagon_V6_vsubwsat,
+    hexagon_V6_vsubwsat_128B,
+    hexagon_V6_vsubwsat_dv,
+    hexagon_V6_vsubwsat_dv_128B,
+    hexagon_V6_vswap,
+    hexagon_V6_vswap_128B,
+    hexagon_V6_vtmpyb,
+    hexagon_V6_vtmpyb_128B,
+    hexagon_V6_vtmpyb_acc,
+    hexagon_V6_vtmpyb_acc_128B,
+    hexagon_V6_vtmpybus,
+    hexagon_V6_vtmpybus_128B,
+    hexagon_V6_vtmpybus_acc,
+    hexagon_V6_vtmpybus_acc_128B,
+    hexagon_V6_vtmpyhb,
+    hexagon_V6_vtmpyhb_128B,
+    hexagon_V6_vtmpyhb_acc,
+    hexagon_V6_vtmpyhb_acc_128B,
+    hexagon_V6_vunpackb,
+    hexagon_V6_vunpackb_128B,
+    hexagon_V6_vunpackh,
+    hexagon_V6_vunpackh_128B,
+    hexagon_V6_vunpackob,
+    hexagon_V6_vunpackob_128B,
+    hexagon_V6_vunpackoh,
+    hexagon_V6_vunpackoh_128B,
+    hexagon_V6_vunpackub,
+    hexagon_V6_vunpackub_128B,
+    hexagon_V6_vunpackuh,
+    hexagon_V6_vunpackuh_128B,
+    hexagon_V6_vxor,
+    hexagon_V6_vxor_128B,
+    hexagon_V6_vzb,
+    hexagon_V6_vzb_128B,
+    hexagon_V6_vzh,
+    hexagon_V6_vzh_128B,
+    hexagon_Y2_dccleana,
+    hexagon_Y2_dccleaninva,
+    hexagon_Y2_dcinva,
+    hexagon_Y2_dczeroa,
+    hexagon_Y4_l2fetch,
+    hexagon_Y5_l2fetch,
+    hexagon_brev_ldb,
+    hexagon_brev_ldd,
+    hexagon_brev_ldh,
+    hexagon_brev_ldub,
+    hexagon_brev_lduh,
+    hexagon_brev_ldw,
+    hexagon_brev_stb,
+    hexagon_brev_std,
+    hexagon_brev_sth,
+    hexagon_brev_sthhi,
+    hexagon_brev_stw,
+    hexagon_circ_ldb,
+    hexagon_circ_ldd,
+    hexagon_circ_ldh,
+    hexagon_circ_ldub,
+    hexagon_circ_lduh,
+    hexagon_circ_ldw,
+    hexagon_circ_stb,
+    hexagon_circ_std,
+    hexagon_circ_sth,
+    hexagon_circ_sthhi,
+    hexagon_circ_stw,
+    hexagon_mm256i_vaddw,
+    hexagon_prefetch,
+    mips_absq_s_ph,
+    mips_absq_s_qb,
+    mips_absq_s_w,
+    mips_add_a_b,
+    mips_add_a_d,
+    mips_add_a_h,
+    mips_add_a_w,
+    mips_addq_ph,
+    mips_addq_s_ph,
+    mips_addq_s_w,
+    mips_addqh_ph,
+    mips_addqh_r_ph,
+    mips_addqh_r_w,
+    mips_addqh_w,
+    mips_adds_a_b,
+    mips_adds_a_d,
+    mips_adds_a_h,
+    mips_adds_a_w,
+    mips_adds_s_b,
+    mips_adds_s_d,
+    mips_adds_s_h,
+    mips_adds_s_w,
+    mips_adds_u_b,
+    mips_adds_u_d,
+    mips_adds_u_h,
+    mips_adds_u_w,
+    mips_addsc,
+    mips_addu_ph,
+    mips_addu_qb,
+    mips_addu_s_ph,
+    mips_addu_s_qb,
+    mips_adduh_qb,
+    mips_adduh_r_qb,
+    mips_addv_b,
+    mips_addv_d,
+    mips_addv_h,
+    mips_addv_w,
+    mips_addvi_b,
+    mips_addvi_d,
+    mips_addvi_h,
+    mips_addvi_w,
+    mips_addwc,
+    mips_and_v,
+    mips_andi_b,
+    mips_append,
+    mips_asub_s_b,
+    mips_asub_s_d,
+    mips_asub_s_h,
+    mips_asub_s_w,
+    mips_asub_u_b,
+    mips_asub_u_d,
+    mips_asub_u_h,
+    mips_asub_u_w,
+    mips_ave_s_b,
+    mips_ave_s_d,
+    mips_ave_s_h,
+    mips_ave_s_w,
+    mips_ave_u_b,
+    mips_ave_u_d,
+    mips_ave_u_h,
+    mips_ave_u_w,
+    mips_aver_s_b,
+    mips_aver_s_d,
+    mips_aver_s_h,
+    mips_aver_s_w,
+    mips_aver_u_b,
+    mips_aver_u_d,
+    mips_aver_u_h,
+    mips_aver_u_w,
+    mips_balign,
+    mips_bclr_b,
+    mips_bclr_d,
+    mips_bclr_h,
+    mips_bclr_w,
+    mips_bclri_b,
+    mips_bclri_d,
+    mips_bclri_h,
+    mips_bclri_w,
+    mips_binsl_b,
+    mips_binsl_d,
+    mips_binsl_h,
+    mips_binsl_w,
+    mips_binsli_b,
+    mips_binsli_d,
+    mips_binsli_h,
+    mips_binsli_w,
+    mips_binsr_b,
+    mips_binsr_d,
+    mips_binsr_h,
+    mips_binsr_w,
+    mips_binsri_b,
+    mips_binsri_d,
+    mips_binsri_h,
+    mips_binsri_w,
+    mips_bitrev,
+    mips_bmnz_v,
+    mips_bmnzi_b,
+    mips_bmz_v,
+    mips_bmzi_b,
+    mips_bneg_b,
+    mips_bneg_d,
+    mips_bneg_h,
+    mips_bneg_w,
+    mips_bnegi_b,
+    mips_bnegi_d,
+    mips_bnegi_h,
+    mips_bnegi_w,
+    mips_bnz_b,
+    mips_bnz_d,
+    mips_bnz_h,
+    mips_bnz_v,
+    mips_bnz_w,
+    mips_bposge32,
+    mips_bsel_v,
+    mips_bseli_b,
+    mips_bset_b,
+    mips_bset_d,
+    mips_bset_h,
+    mips_bset_w,
+    mips_bseti_b,
+    mips_bseti_d,
+    mips_bseti_h,
+    mips_bseti_w,
+    mips_bz_b,
+    mips_bz_d,
+    mips_bz_h,
+    mips_bz_v,
+    mips_bz_w,
+    mips_ceq_b,
+    mips_ceq_d,
+    mips_ceq_h,
+    mips_ceq_w,
+    mips_ceqi_b,
+    mips_ceqi_d,
+    mips_ceqi_h,
+    mips_ceqi_w,
+    mips_cfcmsa,
+    mips_cle_s_b,
+    mips_cle_s_d,
+    mips_cle_s_h,
+    mips_cle_s_w,
+    mips_cle_u_b,
+    mips_cle_u_d,
+    mips_cle_u_h,
+    mips_cle_u_w,
+    mips_clei_s_b,
+    mips_clei_s_d,
+    mips_clei_s_h,
+    mips_clei_s_w,
+    mips_clei_u_b,
+    mips_clei_u_d,
+    mips_clei_u_h,
+    mips_clei_u_w,
+    mips_clt_s_b,
+    mips_clt_s_d,
+    mips_clt_s_h,
+    mips_clt_s_w,
+    mips_clt_u_b,
+    mips_clt_u_d,
+    mips_clt_u_h,
+    mips_clt_u_w,
+    mips_clti_s_b,
+    mips_clti_s_d,
+    mips_clti_s_h,
+    mips_clti_s_w,
+    mips_clti_u_b,
+    mips_clti_u_d,
+    mips_clti_u_h,
+    mips_clti_u_w,
+    mips_cmp_eq_ph,
+    mips_cmp_le_ph,
+    mips_cmp_lt_ph,
+    mips_cmpgdu_eq_qb,
+    mips_cmpgdu_le_qb,
+    mips_cmpgdu_lt_qb,
+    mips_cmpgu_eq_qb,
+    mips_cmpgu_le_qb,
+    mips_cmpgu_lt_qb,
+    mips_cmpu_eq_qb,
+    mips_cmpu_le_qb,
+    mips_cmpu_lt_qb,
+    mips_copy_s_b,
+    mips_copy_s_d,
+    mips_copy_s_h,
+    mips_copy_s_w,
+    mips_copy_u_b,
+    mips_copy_u_d,
+    mips_copy_u_h,
+    mips_copy_u_w,
+    mips_ctcmsa,
+    mips_div_s_b,
+    mips_div_s_d,
+    mips_div_s_h,
+    mips_div_s_w,
+    mips_div_u_b,
+    mips_div_u_d,
+    mips_div_u_h,
+    mips_div_u_w,
+    mips_dlsa,
+    mips_dotp_s_d,
+    mips_dotp_s_h,
+    mips_dotp_s_w,
+    mips_dotp_u_d,
+    mips_dotp_u_h,
+    mips_dotp_u_w,
+    mips_dpa_w_ph,
+    mips_dpadd_s_d,
+    mips_dpadd_s_h,
+    mips_dpadd_s_w,
+    mips_dpadd_u_d,
+    mips_dpadd_u_h,
+    mips_dpadd_u_w,
+    mips_dpaq_s_w_ph,
+    mips_dpaq_sa_l_w,
+    mips_dpaqx_s_w_ph,
+    mips_dpaqx_sa_w_ph,
+    mips_dpau_h_qbl,
+    mips_dpau_h_qbr,
+    mips_dpax_w_ph,
+    mips_dps_w_ph,
+    mips_dpsq_s_w_ph,
+    mips_dpsq_sa_l_w,
+    mips_dpsqx_s_w_ph,
+    mips_dpsqx_sa_w_ph,
+    mips_dpsu_h_qbl,
+    mips_dpsu_h_qbr,
+    mips_dpsub_s_d,
+    mips_dpsub_s_h,
+    mips_dpsub_s_w,
+    mips_dpsub_u_d,
+    mips_dpsub_u_h,
+    mips_dpsub_u_w,
+    mips_dpsx_w_ph,
+    mips_extp,
+    mips_extpdp,
+    mips_extr_r_w,
+    mips_extr_rs_w,
+    mips_extr_s_h,
+    mips_extr_w,
+    mips_fadd_d,
+    mips_fadd_w,
+    mips_fcaf_d,
+    mips_fcaf_w,
+    mips_fceq_d,
+    mips_fceq_w,
+    mips_fclass_d,
+    mips_fclass_w,
+    mips_fcle_d,
+    mips_fcle_w,
+    mips_fclt_d,
+    mips_fclt_w,
+    mips_fcne_d,
+    mips_fcne_w,
+    mips_fcor_d,
+    mips_fcor_w,
+    mips_fcueq_d,
+    mips_fcueq_w,
+    mips_fcule_d,
+    mips_fcule_w,
+    mips_fcult_d,
+    mips_fcult_w,
+    mips_fcun_d,
+    mips_fcun_w,
+    mips_fcune_d,
+    mips_fcune_w,
+    mips_fdiv_d,
+    mips_fdiv_w,
+    mips_fexdo_h,
+    mips_fexdo_w,
+    mips_fexp2_d,
+    mips_fexp2_w,
+    mips_fexupl_d,
+    mips_fexupl_w,
+    mips_fexupr_d,
+    mips_fexupr_w,
+    mips_ffint_s_d,
+    mips_ffint_s_w,
+    mips_ffint_u_d,
+    mips_ffint_u_w,
+    mips_ffql_d,
+    mips_ffql_w,
+    mips_ffqr_d,
+    mips_ffqr_w,
+    mips_fill_b,
+    mips_fill_d,
+    mips_fill_h,
+    mips_fill_w,
+    mips_flog2_d,
+    mips_flog2_w,
+    mips_fmadd_d,
+    mips_fmadd_w,
+    mips_fmax_a_d,
+    mips_fmax_a_w,
+    mips_fmax_d,
+    mips_fmax_w,
+    mips_fmin_a_d,
+    mips_fmin_a_w,
+    mips_fmin_d,
+    mips_fmin_w,
+    mips_fmsub_d,
+    mips_fmsub_w,
+    mips_fmul_d,
+    mips_fmul_w,
+    mips_frcp_d,
+    mips_frcp_w,
+    mips_frint_d,
+    mips_frint_w,
+    mips_frsqrt_d,
+    mips_frsqrt_w,
+    mips_fsaf_d,
+    mips_fsaf_w,
+    mips_fseq_d,
+    mips_fseq_w,
+    mips_fsle_d,
+    mips_fsle_w,
+    mips_fslt_d,
+    mips_fslt_w,
+    mips_fsne_d,
+    mips_fsne_w,
+    mips_fsor_d,
+    mips_fsor_w,
+    mips_fsqrt_d,
+    mips_fsqrt_w,
+    mips_fsub_d,
+    mips_fsub_w,
+    mips_fsueq_d,
+    mips_fsueq_w,
+    mips_fsule_d,
+    mips_fsule_w,
+    mips_fsult_d,
+    mips_fsult_w,
+    mips_fsun_d,
+    mips_fsun_w,
+    mips_fsune_d,
+    mips_fsune_w,
+    mips_ftint_s_d,
+    mips_ftint_s_w,
+    mips_ftint_u_d,
+    mips_ftint_u_w,
+    mips_ftq_h,
+    mips_ftq_w,
+    mips_ftrunc_s_d,
+    mips_ftrunc_s_w,
+    mips_ftrunc_u_d,
+    mips_ftrunc_u_w,
+    mips_hadd_s_d,
+    mips_hadd_s_h,
+    mips_hadd_s_w,
+    mips_hadd_u_d,
+    mips_hadd_u_h,
+    mips_hadd_u_w,
+    mips_hsub_s_d,
+    mips_hsub_s_h,
+    mips_hsub_s_w,
+    mips_hsub_u_d,
+    mips_hsub_u_h,
+    mips_hsub_u_w,
+    mips_ilvev_b,
+    mips_ilvev_d,
+    mips_ilvev_h,
+    mips_ilvev_w,
+    mips_ilvl_b,
+    mips_ilvl_d,
+    mips_ilvl_h,
+    mips_ilvl_w,
+    mips_ilvod_b,
+    mips_ilvod_d,
+    mips_ilvod_h,
+    mips_ilvod_w,
+    mips_ilvr_b,
+    mips_ilvr_d,
+    mips_ilvr_h,
+    mips_ilvr_w,
+    mips_insert_b,
+    mips_insert_d,
+    mips_insert_h,
+    mips_insert_w,
+    mips_insv,
+    mips_insve_b,
+    mips_insve_d,
+    mips_insve_h,
+    mips_insve_w,
+    mips_lbux,
+    mips_ld_b,
+    mips_ld_d,
+    mips_ld_h,
+    mips_ld_w,
+    mips_ldi_b,
+    mips_ldi_d,
+    mips_ldi_h,
+    mips_ldi_w,
+    mips_lhx,
+    mips_lsa,
+    mips_lwx,
+    mips_madd,
+    mips_madd_q_h,
+    mips_madd_q_w,
+    mips_maddr_q_h,
+    mips_maddr_q_w,
+    mips_maddu,
+    mips_maddv_b,
+    mips_maddv_d,
+    mips_maddv_h,
+    mips_maddv_w,
+    mips_maq_s_w_phl,
+    mips_maq_s_w_phr,
+    mips_maq_sa_w_phl,
+    mips_maq_sa_w_phr,
+    mips_max_a_b,
+    mips_max_a_d,
+    mips_max_a_h,
+    mips_max_a_w,
+    mips_max_s_b,
+    mips_max_s_d,
+    mips_max_s_h,
+    mips_max_s_w,
+    mips_max_u_b,
+    mips_max_u_d,
+    mips_max_u_h,
+    mips_max_u_w,
+    mips_maxi_s_b,
+    mips_maxi_s_d,
+    mips_maxi_s_h,
+    mips_maxi_s_w,
+    mips_maxi_u_b,
+    mips_maxi_u_d,
+    mips_maxi_u_h,
+    mips_maxi_u_w,
+    mips_min_a_b,
+    mips_min_a_d,
+    mips_min_a_h,
+    mips_min_a_w,
+    mips_min_s_b,
+    mips_min_s_d,
+    mips_min_s_h,
+    mips_min_s_w,
+    mips_min_u_b,
+    mips_min_u_d,
+    mips_min_u_h,
+    mips_min_u_w,
+    mips_mini_s_b,
+    mips_mini_s_d,
+    mips_mini_s_h,
+    mips_mini_s_w,
+    mips_mini_u_b,
+    mips_mini_u_d,
+    mips_mini_u_h,
+    mips_mini_u_w,
+    mips_mod_s_b,
+    mips_mod_s_d,
+    mips_mod_s_h,
+    mips_mod_s_w,
+    mips_mod_u_b,
+    mips_mod_u_d,
+    mips_mod_u_h,
+    mips_mod_u_w,
+    mips_modsub,
+    mips_move_v,
+    mips_msub,
+    mips_msub_q_h,
+    mips_msub_q_w,
+    mips_msubr_q_h,
+    mips_msubr_q_w,
+    mips_msubu,
+    mips_msubv_b,
+    mips_msubv_d,
+    mips_msubv_h,
+    mips_msubv_w,
+    mips_mthlip,
+    mips_mul_ph,
+    mips_mul_q_h,
+    mips_mul_q_w,
+    mips_mul_s_ph,
+    mips_muleq_s_w_phl,
+    mips_muleq_s_w_phr,
+    mips_muleu_s_ph_qbl,
+    mips_muleu_s_ph_qbr,
+    mips_mulq_rs_ph,
+    mips_mulq_rs_w,
+    mips_mulq_s_ph,
+    mips_mulq_s_w,
+    mips_mulr_q_h,
+    mips_mulr_q_w,
+    mips_mulsa_w_ph,
+    mips_mulsaq_s_w_ph,
+    mips_mult,
+    mips_multu,
+    mips_mulv_b,
+    mips_mulv_d,
+    mips_mulv_h,
+    mips_mulv_w,
+    mips_nloc_b,
+    mips_nloc_d,
+    mips_nloc_h,
+    mips_nloc_w,
+    mips_nlzc_b,
+    mips_nlzc_d,
+    mips_nlzc_h,
+    mips_nlzc_w,
+    mips_nor_v,
+    mips_nori_b,
+    mips_or_v,
+    mips_ori_b,
+    mips_packrl_ph,
+    mips_pckev_b,
+    mips_pckev_d,
+    mips_pckev_h,
+    mips_pckev_w,
+    mips_pckod_b,
+    mips_pckod_d,
+    mips_pckod_h,
+    mips_pckod_w,
+    mips_pcnt_b,
+    mips_pcnt_d,
+    mips_pcnt_h,
+    mips_pcnt_w,
+    mips_pick_ph,
+    mips_pick_qb,
+    mips_preceq_w_phl,
+    mips_preceq_w_phr,
+    mips_precequ_ph_qbl,
+    mips_precequ_ph_qbla,
+    mips_precequ_ph_qbr,
+    mips_precequ_ph_qbra,
+    mips_preceu_ph_qbl,
+    mips_preceu_ph_qbla,
+    mips_preceu_ph_qbr,
+    mips_preceu_ph_qbra,
+    mips_precr_qb_ph,
+    mips_precr_sra_ph_w,
+    mips_precr_sra_r_ph_w,
+    mips_precrq_ph_w,
+    mips_precrq_qb_ph,
+    mips_precrq_rs_ph_w,
+    mips_precrqu_s_qb_ph,
+    mips_prepend,
+    mips_raddu_w_qb,
+    mips_rddsp,
+    mips_repl_ph,
+    mips_repl_qb,
+    mips_sat_s_b,
+    mips_sat_s_d,
+    mips_sat_s_h,
+    mips_sat_s_w,
+    mips_sat_u_b,
+    mips_sat_u_d,
+    mips_sat_u_h,
+    mips_sat_u_w,
+    mips_shf_b,
+    mips_shf_h,
+    mips_shf_w,
+    mips_shilo,
+    mips_shll_ph,
+    mips_shll_qb,
+    mips_shll_s_ph,
+    mips_shll_s_w,
+    mips_shra_ph,
+    mips_shra_qb,
+    mips_shra_r_ph,
+    mips_shra_r_qb,
+    mips_shra_r_w,
+    mips_shrl_ph,
+    mips_shrl_qb,
+    mips_sld_b,
+    mips_sld_d,
+    mips_sld_h,
+    mips_sld_w,
+    mips_sldi_b,
+    mips_sldi_d,
+    mips_sldi_h,
+    mips_sldi_w,
+    mips_sll_b,
+    mips_sll_d,
+    mips_sll_h,
+    mips_sll_w,
+    mips_slli_b,
+    mips_slli_d,
+    mips_slli_h,
+    mips_slli_w,
+    mips_splat_b,
+    mips_splat_d,
+    mips_splat_h,
+    mips_splat_w,
+    mips_splati_b,
+    mips_splati_d,
+    mips_splati_h,
+    mips_splati_w,
+    mips_sra_b,
+    mips_sra_d,
+    mips_sra_h,
+    mips_sra_w,
+    mips_srai_b,
+    mips_srai_d,
+    mips_srai_h,
+    mips_srai_w,
+    mips_srar_b,
+    mips_srar_d,
+    mips_srar_h,
+    mips_srar_w,
+    mips_srari_b,
+    mips_srari_d,
+    mips_srari_h,
+    mips_srari_w,
+    mips_srl_b,
+    mips_srl_d,
+    mips_srl_h,
+    mips_srl_w,
+    mips_srli_b,
+    mips_srli_d,
+    mips_srli_h,
+    mips_srli_w,
+    mips_srlr_b,
+    mips_srlr_d,
+    mips_srlr_h,
+    mips_srlr_w,
+    mips_srlri_b,
+    mips_srlri_d,
+    mips_srlri_h,
+    mips_srlri_w,
+    mips_st_b,
+    mips_st_d,
+    mips_st_h,
+    mips_st_w,
+    mips_subq_ph,
+    mips_subq_s_ph,
+    mips_subq_s_w,
+    mips_subqh_ph,
+    mips_subqh_r_ph,
+    mips_subqh_r_w,
+    mips_subqh_w,
+    mips_subs_s_b,
+    mips_subs_s_d,
+    mips_subs_s_h,
+    mips_subs_s_w,
+    mips_subs_u_b,
+    mips_subs_u_d,
+    mips_subs_u_h,
+    mips_subs_u_w,
+    mips_subsus_u_b,
+    mips_subsus_u_d,
+    mips_subsus_u_h,
+    mips_subsus_u_w,
+    mips_subsuu_s_b,
+    mips_subsuu_s_d,
+    mips_subsuu_s_h,
+    mips_subsuu_s_w,
+    mips_subu_ph,
+    mips_subu_qb,
+    mips_subu_s_ph,
+    mips_subu_s_qb,
+    mips_subuh_qb,
+    mips_subuh_r_qb,
+    mips_subv_b,
+    mips_subv_d,
+    mips_subv_h,
+    mips_subv_w,
+    mips_subvi_b,
+    mips_subvi_d,
+    mips_subvi_h,
+    mips_subvi_w,
+    mips_vshf_b,
+    mips_vshf_d,
+    mips_vshf_h,
+    mips_vshf_w,
+    mips_wrdsp,
+    mips_xor_v,
+    mips_xori_b,
+    nvvm_add_rm_d,
+    nvvm_add_rm_f,
+    nvvm_add_rm_ftz_f,
+    nvvm_add_rn_d,
+    nvvm_add_rn_f,
+    nvvm_add_rn_ftz_f,
+    nvvm_add_rp_d,
+    nvvm_add_rp_f,
+    nvvm_add_rp_ftz_f,
+    nvvm_add_rz_d,
+    nvvm_add_rz_f,
+    nvvm_add_rz_ftz_f,
+    nvvm_atomic_add_gen_f_cta,
+    nvvm_atomic_add_gen_f_sys,
+    nvvm_atomic_add_gen_i_cta,
+    nvvm_atomic_add_gen_i_sys,
+    nvvm_atomic_and_gen_i_cta,
+    nvvm_atomic_and_gen_i_sys,
+    nvvm_atomic_cas_gen_i_cta,
+    nvvm_atomic_cas_gen_i_sys,
+    nvvm_atomic_dec_gen_i_cta,
+    nvvm_atomic_dec_gen_i_sys,
+    nvvm_atomic_exch_gen_i_cta,
+    nvvm_atomic_exch_gen_i_sys,
+    nvvm_atomic_inc_gen_i_cta,
+    nvvm_atomic_inc_gen_i_sys,
+    nvvm_atomic_load_add_f32,
+    nvvm_atomic_load_add_f64,
+    nvvm_atomic_load_dec_32,
+    nvvm_atomic_load_inc_32,
+    nvvm_atomic_max_gen_i_cta,
+    nvvm_atomic_max_gen_i_sys,
+    nvvm_atomic_min_gen_i_cta,
+    nvvm_atomic_min_gen_i_sys,
+    nvvm_atomic_or_gen_i_cta,
+    nvvm_atomic_or_gen_i_sys,
+    nvvm_atomic_xor_gen_i_cta,
+    nvvm_atomic_xor_gen_i_sys,
+    nvvm_bar_sync,
+    nvvm_bar_warp_sync,
+    nvvm_barrier,
+    nvvm_barrier_n,
+    nvvm_barrier_sync,
+    nvvm_barrier_sync_cnt,
+    nvvm_barrier0,
+    nvvm_barrier0_and,
+    nvvm_barrier0_or,
+    nvvm_barrier0_popc,
+    nvvm_bitcast_d2ll,
+    nvvm_bitcast_f2i,
+    nvvm_bitcast_i2f,
+    nvvm_bitcast_ll2d,
+    nvvm_ceil_d,
+    nvvm_ceil_f,
+    nvvm_ceil_ftz_f,
+    nvvm_compiler_error,
+    nvvm_compiler_warn,
+    nvvm_cos_approx_f,
+    nvvm_cos_approx_ftz_f,
+    nvvm_d2f_rm,
+    nvvm_d2f_rm_ftz,
+    nvvm_d2f_rn,
+    nvvm_d2f_rn_ftz,
+    nvvm_d2f_rp,
+    nvvm_d2f_rp_ftz,
+    nvvm_d2f_rz,
+    nvvm_d2f_rz_ftz,
+    nvvm_d2i_hi,
+    nvvm_d2i_lo,
+    nvvm_d2i_rm,
+    nvvm_d2i_rn,
+    nvvm_d2i_rp,
+    nvvm_d2i_rz,
+    nvvm_d2ll_rm,
+    nvvm_d2ll_rn,
+    nvvm_d2ll_rp,
+    nvvm_d2ll_rz,
+    nvvm_d2ui_rm,
+    nvvm_d2ui_rn,
+    nvvm_d2ui_rp,
+    nvvm_d2ui_rz,
+    nvvm_d2ull_rm,
+    nvvm_d2ull_rn,
+    nvvm_d2ull_rp,
+    nvvm_d2ull_rz,
+    nvvm_div_approx_f,
+    nvvm_div_approx_ftz_f,
+    nvvm_div_rm_d,
+    nvvm_div_rm_f,
+    nvvm_div_rm_ftz_f,
+    nvvm_div_rn_d,
+    nvvm_div_rn_f,
+    nvvm_div_rn_ftz_f,
+    nvvm_div_rp_d,
+    nvvm_div_rp_f,
+    nvvm_div_rp_ftz_f,
+    nvvm_div_rz_d,
+    nvvm_div_rz_f,
+    nvvm_div_rz_ftz_f,
+    nvvm_ex2_approx_d,
+    nvvm_ex2_approx_f,
+    nvvm_ex2_approx_ftz_f,
+    nvvm_f2h_rn,
+    nvvm_f2h_rn_ftz,
+    nvvm_f2i_rm,
+    nvvm_f2i_rm_ftz,
+    nvvm_f2i_rn,
+    nvvm_f2i_rn_ftz,
+    nvvm_f2i_rp,
+    nvvm_f2i_rp_ftz,
+    nvvm_f2i_rz,
+    nvvm_f2i_rz_ftz,
+    nvvm_f2ll_rm,
+    nvvm_f2ll_rm_ftz,
+    nvvm_f2ll_rn,
+    nvvm_f2ll_rn_ftz,
+    nvvm_f2ll_rp,
+    nvvm_f2ll_rp_ftz,
+    nvvm_f2ll_rz,
+    nvvm_f2ll_rz_ftz,
+    nvvm_f2ui_rm,
+    nvvm_f2ui_rm_ftz,
+    nvvm_f2ui_rn,
+    nvvm_f2ui_rn_ftz,
+    nvvm_f2ui_rp,
+    nvvm_f2ui_rp_ftz,
+    nvvm_f2ui_rz,
+    nvvm_f2ui_rz_ftz,
+    nvvm_f2ull_rm,
+    nvvm_f2ull_rm_ftz,
+    nvvm_f2ull_rn,
+    nvvm_f2ull_rn_ftz,
+    nvvm_f2ull_rp,
+    nvvm_f2ull_rp_ftz,
+    nvvm_f2ull_rz,
+    nvvm_f2ull_rz_ftz,
+    nvvm_fabs_d,
+    nvvm_fabs_f,
+    nvvm_fabs_ftz_f,
+    nvvm_floor_d,
+    nvvm_floor_f,
+    nvvm_floor_ftz_f,
+    nvvm_fma_rm_d,
+    nvvm_fma_rm_f,
+    nvvm_fma_rm_ftz_f,
+    nvvm_fma_rn_d,
+    nvvm_fma_rn_f,
+    nvvm_fma_rn_ftz_f,
+    nvvm_fma_rp_d,
+    nvvm_fma_rp_f,
+    nvvm_fma_rp_ftz_f,
+    nvvm_fma_rz_d,
+    nvvm_fma_rz_f,
+    nvvm_fma_rz_ftz_f,
+    nvvm_fmax_d,
+    nvvm_fmax_f,
+    nvvm_fmax_ftz_f,
+    nvvm_fmin_d,
+    nvvm_fmin_f,
+    nvvm_fmin_ftz_f,
+    nvvm_fns,
+    nvvm_i2d_rm,
+    nvvm_i2d_rn,
+    nvvm_i2d_rp,
+    nvvm_i2d_rz,
+    nvvm_i2f_rm,
+    nvvm_i2f_rn,
+    nvvm_i2f_rp,
+    nvvm_i2f_rz,
+    nvvm_isspacep_const,
+    nvvm_isspacep_global,
+    nvvm_isspacep_local,
+    nvvm_isspacep_shared,
+    nvvm_istypep_sampler,
+    nvvm_istypep_surface,
+    nvvm_istypep_texture,
+    nvvm_ldg_global_f,
+    nvvm_ldg_global_i,
+    nvvm_ldg_global_p,
+    nvvm_ldu_global_f,
+    nvvm_ldu_global_i,
+    nvvm_ldu_global_p,
+    nvvm_lg2_approx_d,
+    nvvm_lg2_approx_f,
+    nvvm_lg2_approx_ftz_f,
+    nvvm_ll2d_rm,
+    nvvm_ll2d_rn,
+    nvvm_ll2d_rp,
+    nvvm_ll2d_rz,
+    nvvm_ll2f_rm,
+    nvvm_ll2f_rn,
+    nvvm_ll2f_rp,
+    nvvm_ll2f_rz,
+    nvvm_lohi_i2d,
+    nvvm_match_all_sync_i32p,
+    nvvm_match_all_sync_i64p,
+    nvvm_match_any_sync_i32,
+    nvvm_match_any_sync_i64,
+    nvvm_membar_cta,
+    nvvm_membar_gl,
+    nvvm_membar_sys,
+    nvvm_move_double,
+    nvvm_move_float,
+    nvvm_move_i16,
+    nvvm_move_i32,
+    nvvm_move_i64,
+    nvvm_move_ptr,
+    nvvm_mul_rm_d,
+    nvvm_mul_rm_f,
+    nvvm_mul_rm_ftz_f,
+    nvvm_mul_rn_d,
+    nvvm_mul_rn_f,
+    nvvm_mul_rn_ftz_f,
+    nvvm_mul_rp_d,
+    nvvm_mul_rp_f,
+    nvvm_mul_rp_ftz_f,
+    nvvm_mul_rz_d,
+    nvvm_mul_rz_f,
+    nvvm_mul_rz_ftz_f,
+    nvvm_mul24_i,
+    nvvm_mul24_ui,
+    nvvm_mulhi_i,
+    nvvm_mulhi_ll,
+    nvvm_mulhi_ui,
+    nvvm_mulhi_ull,
+    nvvm_prmt,
+    nvvm_ptr_constant_to_gen,
+    nvvm_ptr_gen_to_constant,
+    nvvm_ptr_gen_to_global,
+    nvvm_ptr_gen_to_local,
+    nvvm_ptr_gen_to_param,
+    nvvm_ptr_gen_to_shared,
+    nvvm_ptr_global_to_gen,
+    nvvm_ptr_local_to_gen,
+    nvvm_ptr_shared_to_gen,
+    nvvm_rcp_approx_ftz_d,
+    nvvm_rcp_rm_d,
+    nvvm_rcp_rm_f,
+    nvvm_rcp_rm_ftz_f,
+    nvvm_rcp_rn_d,
+    nvvm_rcp_rn_f,
+    nvvm_rcp_rn_ftz_f,
+    nvvm_rcp_rp_d,
+    nvvm_rcp_rp_f,
+    nvvm_rcp_rp_ftz_f,
+    nvvm_rcp_rz_d,
+    nvvm_rcp_rz_f,
+    nvvm_rcp_rz_ftz_f,
+    nvvm_read_ptx_sreg_clock,
+    nvvm_read_ptx_sreg_clock64,
+    nvvm_read_ptx_sreg_ctaid_w,
+    nvvm_read_ptx_sreg_ctaid_x,
+    nvvm_read_ptx_sreg_ctaid_y,
+    nvvm_read_ptx_sreg_ctaid_z,
+    nvvm_read_ptx_sreg_envreg0,
+    nvvm_read_ptx_sreg_envreg1,
+    nvvm_read_ptx_sreg_envreg10,
+    nvvm_read_ptx_sreg_envreg11,
+    nvvm_read_ptx_sreg_envreg12,
+    nvvm_read_ptx_sreg_envreg13,
+    nvvm_read_ptx_sreg_envreg14,
+    nvvm_read_ptx_sreg_envreg15,
+    nvvm_read_ptx_sreg_envreg16,
+    nvvm_read_ptx_sreg_envreg17,
+    nvvm_read_ptx_sreg_envreg18,
+    nvvm_read_ptx_sreg_envreg19,
+    nvvm_read_ptx_sreg_envreg2,
+    nvvm_read_ptx_sreg_envreg20,
+    nvvm_read_ptx_sreg_envreg21,
+    nvvm_read_ptx_sreg_envreg22,
+    nvvm_read_ptx_sreg_envreg23,
+    nvvm_read_ptx_sreg_envreg24,
+    nvvm_read_ptx_sreg_envreg25,
+    nvvm_read_ptx_sreg_envreg26,
+    nvvm_read_ptx_sreg_envreg27,
+    nvvm_read_ptx_sreg_envreg28,
+    nvvm_read_ptx_sreg_envreg29,
+    nvvm_read_ptx_sreg_envreg3,
+    nvvm_read_ptx_sreg_envreg30,
+    nvvm_read_ptx_sreg_envreg31,
+    nvvm_read_ptx_sreg_envreg4,
+    nvvm_read_ptx_sreg_envreg5,
+    nvvm_read_ptx_sreg_envreg6,
+    nvvm_read_ptx_sreg_envreg7,
+    nvvm_read_ptx_sreg_envreg8,
+    nvvm_read_ptx_sreg_envreg9,
+    nvvm_read_ptx_sreg_gridid,
+    nvvm_read_ptx_sreg_laneid,
+    nvvm_read_ptx_sreg_lanemask_eq,
+    nvvm_read_ptx_sreg_lanemask_ge,
+    nvvm_read_ptx_sreg_lanemask_gt,
+    nvvm_read_ptx_sreg_lanemask_le,
+    nvvm_read_ptx_sreg_lanemask_lt,
+    nvvm_read_ptx_sreg_nctaid_w,
+    nvvm_read_ptx_sreg_nctaid_x,
+    nvvm_read_ptx_sreg_nctaid_y,
+    nvvm_read_ptx_sreg_nctaid_z,
+    nvvm_read_ptx_sreg_nsmid,
+    nvvm_read_ptx_sreg_ntid_w,
+    nvvm_read_ptx_sreg_ntid_x,
+    nvvm_read_ptx_sreg_ntid_y,
+    nvvm_read_ptx_sreg_ntid_z,
+    nvvm_read_ptx_sreg_nwarpid,
+    nvvm_read_ptx_sreg_pm0,
+    nvvm_read_ptx_sreg_pm1,
+    nvvm_read_ptx_sreg_pm2,
+    nvvm_read_ptx_sreg_pm3,
+    nvvm_read_ptx_sreg_smid,
+    nvvm_read_ptx_sreg_tid_w,
+    nvvm_read_ptx_sreg_tid_x,
+    nvvm_read_ptx_sreg_tid_y,
+    nvvm_read_ptx_sreg_tid_z,
+    nvvm_read_ptx_sreg_warpid,
+    nvvm_read_ptx_sreg_warpsize,
+    nvvm_reflect,
+    nvvm_rotate_b32,
+    nvvm_rotate_b64,
+    nvvm_rotate_right_b64,
+    nvvm_round_d,
+    nvvm_round_f,
+    nvvm_round_ftz_f,
+    nvvm_rsqrt_approx_d,
+    nvvm_rsqrt_approx_f,
+    nvvm_rsqrt_approx_ftz_f,
+    nvvm_sad_i,
+    nvvm_sad_ui,
+    nvvm_saturate_d,
+    nvvm_saturate_f,
+    nvvm_saturate_ftz_f,
+    nvvm_shfl_bfly_f32,
+    nvvm_shfl_bfly_i32,
+    nvvm_shfl_down_f32,
+    nvvm_shfl_down_i32,
+    nvvm_shfl_idx_f32,
+    nvvm_shfl_idx_i32,
+    nvvm_shfl_sync_bfly_f32,
+    nvvm_shfl_sync_bfly_i32,
+    nvvm_shfl_sync_down_f32,
+    nvvm_shfl_sync_down_i32,
+    nvvm_shfl_sync_idx_f32,
+    nvvm_shfl_sync_idx_i32,
+    nvvm_shfl_sync_up_f32,
+    nvvm_shfl_sync_up_i32,
+    nvvm_shfl_up_f32,
+    nvvm_shfl_up_i32,
+    nvvm_sin_approx_f,
+    nvvm_sin_approx_ftz_f,
+    nvvm_sqrt_approx_f,
+    nvvm_sqrt_approx_ftz_f,
+    nvvm_sqrt_f,
+    nvvm_sqrt_rm_d,
+    nvvm_sqrt_rm_f,
+    nvvm_sqrt_rm_ftz_f,
+    nvvm_sqrt_rn_d,
+    nvvm_sqrt_rn_f,
+    nvvm_sqrt_rn_ftz_f,
+    nvvm_sqrt_rp_d,
+    nvvm_sqrt_rp_f,
+    nvvm_sqrt_rp_ftz_f,
+    nvvm_sqrt_rz_d,
+    nvvm_sqrt_rz_f,
+    nvvm_sqrt_rz_ftz_f,
+    nvvm_suld_1d_array_i16_clamp,
+    nvvm_suld_1d_array_i16_trap,
+    nvvm_suld_1d_array_i16_zero,
+    nvvm_suld_1d_array_i32_clamp,
+    nvvm_suld_1d_array_i32_trap,
+    nvvm_suld_1d_array_i32_zero,
+    nvvm_suld_1d_array_i64_clamp,
+    nvvm_suld_1d_array_i64_trap,
+    nvvm_suld_1d_array_i64_zero,
+    nvvm_suld_1d_array_i8_clamp,
+    nvvm_suld_1d_array_i8_trap,
+    nvvm_suld_1d_array_i8_zero,
+    nvvm_suld_1d_array_v2i16_clamp,
+    nvvm_suld_1d_array_v2i16_trap,
+    nvvm_suld_1d_array_v2i16_zero,
+    nvvm_suld_1d_array_v2i32_clamp,
+    nvvm_suld_1d_array_v2i32_trap,
+    nvvm_suld_1d_array_v2i32_zero,
+    nvvm_suld_1d_array_v2i64_clamp,
+    nvvm_suld_1d_array_v2i64_trap,
+    nvvm_suld_1d_array_v2i64_zero,
+    nvvm_suld_1d_array_v2i8_clamp,
+    nvvm_suld_1d_array_v2i8_trap,
+    nvvm_suld_1d_array_v2i8_zero,
+    nvvm_suld_1d_array_v4i16_clamp,
+    nvvm_suld_1d_array_v4i16_trap,
+    nvvm_suld_1d_array_v4i16_zero,
+    nvvm_suld_1d_array_v4i32_clamp,
+    nvvm_suld_1d_array_v4i32_trap,
+    nvvm_suld_1d_array_v4i32_zero,
+    nvvm_suld_1d_array_v4i8_clamp,
+    nvvm_suld_1d_array_v4i8_trap,
+    nvvm_suld_1d_array_v4i8_zero,
+    nvvm_suld_1d_i16_clamp,
+    nvvm_suld_1d_i16_trap,
+    nvvm_suld_1d_i16_zero,
+    nvvm_suld_1d_i32_clamp,
+    nvvm_suld_1d_i32_trap,
+    nvvm_suld_1d_i32_zero,
+    nvvm_suld_1d_i64_clamp,
+    nvvm_suld_1d_i64_trap,
+    nvvm_suld_1d_i64_zero,
+    nvvm_suld_1d_i8_clamp,
+    nvvm_suld_1d_i8_trap,
+    nvvm_suld_1d_i8_zero,
+    nvvm_suld_1d_v2i16_clamp,
+    nvvm_suld_1d_v2i16_trap,
+    nvvm_suld_1d_v2i16_zero,
+    nvvm_suld_1d_v2i32_clamp,
+    nvvm_suld_1d_v2i32_trap,
+    nvvm_suld_1d_v2i32_zero,
+    nvvm_suld_1d_v2i64_clamp,
+    nvvm_suld_1d_v2i64_trap,
+    nvvm_suld_1d_v2i64_zero,
+    nvvm_suld_1d_v2i8_clamp,
+    nvvm_suld_1d_v2i8_trap,
+    nvvm_suld_1d_v2i8_zero,
+    nvvm_suld_1d_v4i16_clamp,
+    nvvm_suld_1d_v4i16_trap,
+    nvvm_suld_1d_v4i16_zero,
+    nvvm_suld_1d_v4i32_clamp,
+    nvvm_suld_1d_v4i32_trap,
+    nvvm_suld_1d_v4i32_zero,
+    nvvm_suld_1d_v4i8_clamp,
+    nvvm_suld_1d_v4i8_trap,
+    nvvm_suld_1d_v4i8_zero,
+    nvvm_suld_2d_array_i16_clamp,
+    nvvm_suld_2d_array_i16_trap,
+    nvvm_suld_2d_array_i16_zero,
+    nvvm_suld_2d_array_i32_clamp,
+    nvvm_suld_2d_array_i32_trap,
+    nvvm_suld_2d_array_i32_zero,
+    nvvm_suld_2d_array_i64_clamp,
+    nvvm_suld_2d_array_i64_trap,
+    nvvm_suld_2d_array_i64_zero,
+    nvvm_suld_2d_array_i8_clamp,
+    nvvm_suld_2d_array_i8_trap,
+    nvvm_suld_2d_array_i8_zero,
+    nvvm_suld_2d_array_v2i16_clamp,
+    nvvm_suld_2d_array_v2i16_trap,
+    nvvm_suld_2d_array_v2i16_zero,
+    nvvm_suld_2d_array_v2i32_clamp,
+    nvvm_suld_2d_array_v2i32_trap,
+    nvvm_suld_2d_array_v2i32_zero,
+    nvvm_suld_2d_array_v2i64_clamp,
+    nvvm_suld_2d_array_v2i64_trap,
+    nvvm_suld_2d_array_v2i64_zero,
+    nvvm_suld_2d_array_v2i8_clamp,
+    nvvm_suld_2d_array_v2i8_trap,
+    nvvm_suld_2d_array_v2i8_zero,
+    nvvm_suld_2d_array_v4i16_clamp,
+    nvvm_suld_2d_array_v4i16_trap,
+    nvvm_suld_2d_array_v4i16_zero,
+    nvvm_suld_2d_array_v4i32_clamp,
+    nvvm_suld_2d_array_v4i32_trap,
+    nvvm_suld_2d_array_v4i32_zero,
+    nvvm_suld_2d_array_v4i8_clamp,
+    nvvm_suld_2d_array_v4i8_trap,
+    nvvm_suld_2d_array_v4i8_zero,
+    nvvm_suld_2d_i16_clamp,
+    nvvm_suld_2d_i16_trap,
+    nvvm_suld_2d_i16_zero,
+    nvvm_suld_2d_i32_clamp,
+    nvvm_suld_2d_i32_trap,
+    nvvm_suld_2d_i32_zero,
+    nvvm_suld_2d_i64_clamp,
+    nvvm_suld_2d_i64_trap,
+    nvvm_suld_2d_i64_zero,
+    nvvm_suld_2d_i8_clamp,
+    nvvm_suld_2d_i8_trap,
+    nvvm_suld_2d_i8_zero,
+    nvvm_suld_2d_v2i16_clamp,
+    nvvm_suld_2d_v2i16_trap,
+    nvvm_suld_2d_v2i16_zero,
+    nvvm_suld_2d_v2i32_clamp,
+    nvvm_suld_2d_v2i32_trap,
+    nvvm_suld_2d_v2i32_zero,
+    nvvm_suld_2d_v2i64_clamp,
+    nvvm_suld_2d_v2i64_trap,
+    nvvm_suld_2d_v2i64_zero,
+    nvvm_suld_2d_v2i8_clamp,
+    nvvm_suld_2d_v2i8_trap,
+    nvvm_suld_2d_v2i8_zero,
+    nvvm_suld_2d_v4i16_clamp,
+    nvvm_suld_2d_v4i16_trap,
+    nvvm_suld_2d_v4i16_zero,
+    nvvm_suld_2d_v4i32_clamp,
+    nvvm_suld_2d_v4i32_trap,
+    nvvm_suld_2d_v4i32_zero,
+    nvvm_suld_2d_v4i8_clamp,
+    nvvm_suld_2d_v4i8_trap,
+    nvvm_suld_2d_v4i8_zero,
+    nvvm_suld_3d_i16_clamp,
+    nvvm_suld_3d_i16_trap,
+    nvvm_suld_3d_i16_zero,
+    nvvm_suld_3d_i32_clamp,
+    nvvm_suld_3d_i32_trap,
+    nvvm_suld_3d_i32_zero,
+    nvvm_suld_3d_i64_clamp,
+    nvvm_suld_3d_i64_trap,
+    nvvm_suld_3d_i64_zero,
+    nvvm_suld_3d_i8_clamp,
+    nvvm_suld_3d_i8_trap,
+    nvvm_suld_3d_i8_zero,
+    nvvm_suld_3d_v2i16_clamp,
+    nvvm_suld_3d_v2i16_trap,
+    nvvm_suld_3d_v2i16_zero,
+    nvvm_suld_3d_v2i32_clamp,
+    nvvm_suld_3d_v2i32_trap,
+    nvvm_suld_3d_v2i32_zero,
+    nvvm_suld_3d_v2i64_clamp,
+    nvvm_suld_3d_v2i64_trap,
+    nvvm_suld_3d_v2i64_zero,
+    nvvm_suld_3d_v2i8_clamp,
+    nvvm_suld_3d_v2i8_trap,
+    nvvm_suld_3d_v2i8_zero,
+    nvvm_suld_3d_v4i16_clamp,
+    nvvm_suld_3d_v4i16_trap,
+    nvvm_suld_3d_v4i16_zero,
+    nvvm_suld_3d_v4i32_clamp,
+    nvvm_suld_3d_v4i32_trap,
+    nvvm_suld_3d_v4i32_zero,
+    nvvm_suld_3d_v4i8_clamp,
+    nvvm_suld_3d_v4i8_trap,
+    nvvm_suld_3d_v4i8_zero,
+    nvvm_suq_array_size,
+    nvvm_suq_channel_data_type,
+    nvvm_suq_channel_order,
+    nvvm_suq_depth,
+    nvvm_suq_height,
+    nvvm_suq_width,
+    nvvm_sust_b_1d_array_i16_clamp,
+    nvvm_sust_b_1d_array_i16_trap,
+    nvvm_sust_b_1d_array_i16_zero,
+    nvvm_sust_b_1d_array_i32_clamp,
+    nvvm_sust_b_1d_array_i32_trap,
+    nvvm_sust_b_1d_array_i32_zero,
+    nvvm_sust_b_1d_array_i64_clamp,
+    nvvm_sust_b_1d_array_i64_trap,
+    nvvm_sust_b_1d_array_i64_zero,
+    nvvm_sust_b_1d_array_i8_clamp,
+    nvvm_sust_b_1d_array_i8_trap,
+    nvvm_sust_b_1d_array_i8_zero,
+    nvvm_sust_b_1d_array_v2i16_clamp,
+    nvvm_sust_b_1d_array_v2i16_trap,
+    nvvm_sust_b_1d_array_v2i16_zero,
+    nvvm_sust_b_1d_array_v2i32_clamp,
+    nvvm_sust_b_1d_array_v2i32_trap,
+    nvvm_sust_b_1d_array_v2i32_zero,
+    nvvm_sust_b_1d_array_v2i64_clamp,
+    nvvm_sust_b_1d_array_v2i64_trap,
+    nvvm_sust_b_1d_array_v2i64_zero,
+    nvvm_sust_b_1d_array_v2i8_clamp,
+    nvvm_sust_b_1d_array_v2i8_trap,
+    nvvm_sust_b_1d_array_v2i8_zero,
+    nvvm_sust_b_1d_array_v4i16_clamp,
+    nvvm_sust_b_1d_array_v4i16_trap,
+    nvvm_sust_b_1d_array_v4i16_zero,
+    nvvm_sust_b_1d_array_v4i32_clamp,
+    nvvm_sust_b_1d_array_v4i32_trap,
+    nvvm_sust_b_1d_array_v4i32_zero,
+    nvvm_sust_b_1d_array_v4i8_clamp,
+    nvvm_sust_b_1d_array_v4i8_trap,
+    nvvm_sust_b_1d_array_v4i8_zero,
+    nvvm_sust_b_1d_i16_clamp,
+    nvvm_sust_b_1d_i16_trap,
+    nvvm_sust_b_1d_i16_zero,
+    nvvm_sust_b_1d_i32_clamp,
+    nvvm_sust_b_1d_i32_trap,
+    nvvm_sust_b_1d_i32_zero,
+    nvvm_sust_b_1d_i64_clamp,
+    nvvm_sust_b_1d_i64_trap,
+    nvvm_sust_b_1d_i64_zero,
+    nvvm_sust_b_1d_i8_clamp,
+    nvvm_sust_b_1d_i8_trap,
+    nvvm_sust_b_1d_i8_zero,
+    nvvm_sust_b_1d_v2i16_clamp,
+    nvvm_sust_b_1d_v2i16_trap,
+    nvvm_sust_b_1d_v2i16_zero,
+    nvvm_sust_b_1d_v2i32_clamp,
+    nvvm_sust_b_1d_v2i32_trap,
+    nvvm_sust_b_1d_v2i32_zero,
+    nvvm_sust_b_1d_v2i64_clamp,
+    nvvm_sust_b_1d_v2i64_trap,
+    nvvm_sust_b_1d_v2i64_zero,
+    nvvm_sust_b_1d_v2i8_clamp,
+    nvvm_sust_b_1d_v2i8_trap,
+    nvvm_sust_b_1d_v2i8_zero,
+    nvvm_sust_b_1d_v4i16_clamp,
+    nvvm_sust_b_1d_v4i16_trap,
+    nvvm_sust_b_1d_v4i16_zero,
+    nvvm_sust_b_1d_v4i32_clamp,
+    nvvm_sust_b_1d_v4i32_trap,
+    nvvm_sust_b_1d_v4i32_zero,
+    nvvm_sust_b_1d_v4i8_clamp,
+    nvvm_sust_b_1d_v4i8_trap,
+    nvvm_sust_b_1d_v4i8_zero,
+    nvvm_sust_b_2d_array_i16_clamp,
+    nvvm_sust_b_2d_array_i16_trap,
+    nvvm_sust_b_2d_array_i16_zero,
+    nvvm_sust_b_2d_array_i32_clamp,
+    nvvm_sust_b_2d_array_i32_trap,
+    nvvm_sust_b_2d_array_i32_zero,
+    nvvm_sust_b_2d_array_i64_clamp,
+    nvvm_sust_b_2d_array_i64_trap,
+    nvvm_sust_b_2d_array_i64_zero,
+    nvvm_sust_b_2d_array_i8_clamp,
+    nvvm_sust_b_2d_array_i8_trap,
+    nvvm_sust_b_2d_array_i8_zero,
+    nvvm_sust_b_2d_array_v2i16_clamp,
+    nvvm_sust_b_2d_array_v2i16_trap,
+    nvvm_sust_b_2d_array_v2i16_zero,
+    nvvm_sust_b_2d_array_v2i32_clamp,
+    nvvm_sust_b_2d_array_v2i32_trap,
+    nvvm_sust_b_2d_array_v2i32_zero,
+    nvvm_sust_b_2d_array_v2i64_clamp,
+    nvvm_sust_b_2d_array_v2i64_trap,
+    nvvm_sust_b_2d_array_v2i64_zero,
+    nvvm_sust_b_2d_array_v2i8_clamp,
+    nvvm_sust_b_2d_array_v2i8_trap,
+    nvvm_sust_b_2d_array_v2i8_zero,
+    nvvm_sust_b_2d_array_v4i16_clamp,
+    nvvm_sust_b_2d_array_v4i16_trap,
+    nvvm_sust_b_2d_array_v4i16_zero,
+    nvvm_sust_b_2d_array_v4i32_clamp,
+    nvvm_sust_b_2d_array_v4i32_trap,
+    nvvm_sust_b_2d_array_v4i32_zero,
+    nvvm_sust_b_2d_array_v4i8_clamp,
+    nvvm_sust_b_2d_array_v4i8_trap,
+    nvvm_sust_b_2d_array_v4i8_zero,
+    nvvm_sust_b_2d_i16_clamp,
+    nvvm_sust_b_2d_i16_trap,
+    nvvm_sust_b_2d_i16_zero,
+    nvvm_sust_b_2d_i32_clamp,
+    nvvm_sust_b_2d_i32_trap,
+    nvvm_sust_b_2d_i32_zero,
+    nvvm_sust_b_2d_i64_clamp,
+    nvvm_sust_b_2d_i64_trap,
+    nvvm_sust_b_2d_i64_zero,
+    nvvm_sust_b_2d_i8_clamp,
+    nvvm_sust_b_2d_i8_trap,
+    nvvm_sust_b_2d_i8_zero,
+    nvvm_sust_b_2d_v2i16_clamp,
+    nvvm_sust_b_2d_v2i16_trap,
+    nvvm_sust_b_2d_v2i16_zero,
+    nvvm_sust_b_2d_v2i32_clamp,
+    nvvm_sust_b_2d_v2i32_trap,
+    nvvm_sust_b_2d_v2i32_zero,
+    nvvm_sust_b_2d_v2i64_clamp,
+    nvvm_sust_b_2d_v2i64_trap,
+    nvvm_sust_b_2d_v2i64_zero,
+    nvvm_sust_b_2d_v2i8_clamp,
+    nvvm_sust_b_2d_v2i8_trap,
+    nvvm_sust_b_2d_v2i8_zero,
+    nvvm_sust_b_2d_v4i16_clamp,
+    nvvm_sust_b_2d_v4i16_trap,
+    nvvm_sust_b_2d_v4i16_zero,
+    nvvm_sust_b_2d_v4i32_clamp,
+    nvvm_sust_b_2d_v4i32_trap,
+    nvvm_sust_b_2d_v4i32_zero,
+    nvvm_sust_b_2d_v4i8_clamp,
+    nvvm_sust_b_2d_v4i8_trap,
+    nvvm_sust_b_2d_v4i8_zero,
+    nvvm_sust_b_3d_i16_clamp,
+    nvvm_sust_b_3d_i16_trap,
+    nvvm_sust_b_3d_i16_zero,
+    nvvm_sust_b_3d_i32_clamp,
+    nvvm_sust_b_3d_i32_trap,
+    nvvm_sust_b_3d_i32_zero,
+    nvvm_sust_b_3d_i64_clamp,
+    nvvm_sust_b_3d_i64_trap,
+    nvvm_sust_b_3d_i64_zero,
+    nvvm_sust_b_3d_i8_clamp,
+    nvvm_sust_b_3d_i8_trap,
+    nvvm_sust_b_3d_i8_zero,
+    nvvm_sust_b_3d_v2i16_clamp,
+    nvvm_sust_b_3d_v2i16_trap,
+    nvvm_sust_b_3d_v2i16_zero,
+    nvvm_sust_b_3d_v2i32_clamp,
+    nvvm_sust_b_3d_v2i32_trap,
+    nvvm_sust_b_3d_v2i32_zero,
+    nvvm_sust_b_3d_v2i64_clamp,
+    nvvm_sust_b_3d_v2i64_trap,
+    nvvm_sust_b_3d_v2i64_zero,
+    nvvm_sust_b_3d_v2i8_clamp,
+    nvvm_sust_b_3d_v2i8_trap,
+    nvvm_sust_b_3d_v2i8_zero,
+    nvvm_sust_b_3d_v4i16_clamp,
+    nvvm_sust_b_3d_v4i16_trap,
+    nvvm_sust_b_3d_v4i16_zero,
+    nvvm_sust_b_3d_v4i32_clamp,
+    nvvm_sust_b_3d_v4i32_trap,
+    nvvm_sust_b_3d_v4i32_zero,
+    nvvm_sust_b_3d_v4i8_clamp,
+    nvvm_sust_b_3d_v4i8_trap,
+    nvvm_sust_b_3d_v4i8_zero,
+    nvvm_sust_p_1d_array_i16_trap,
+    nvvm_sust_p_1d_array_i32_trap,
+    nvvm_sust_p_1d_array_i8_trap,
+    nvvm_sust_p_1d_array_v2i16_trap,
+    nvvm_sust_p_1d_array_v2i32_trap,
+    nvvm_sust_p_1d_array_v2i8_trap,
+    nvvm_sust_p_1d_array_v4i16_trap,
+    nvvm_sust_p_1d_array_v4i32_trap,
+    nvvm_sust_p_1d_array_v4i8_trap,
+    nvvm_sust_p_1d_i16_trap,
+    nvvm_sust_p_1d_i32_trap,
+    nvvm_sust_p_1d_i8_trap,
+    nvvm_sust_p_1d_v2i16_trap,
+    nvvm_sust_p_1d_v2i32_trap,
+    nvvm_sust_p_1d_v2i8_trap,
+    nvvm_sust_p_1d_v4i16_trap,
+    nvvm_sust_p_1d_v4i32_trap,
+    nvvm_sust_p_1d_v4i8_trap,
+    nvvm_sust_p_2d_array_i16_trap,
+    nvvm_sust_p_2d_array_i32_trap,
+    nvvm_sust_p_2d_array_i8_trap,
+    nvvm_sust_p_2d_array_v2i16_trap,
+    nvvm_sust_p_2d_array_v2i32_trap,
+    nvvm_sust_p_2d_array_v2i8_trap,
+    nvvm_sust_p_2d_array_v4i16_trap,
+    nvvm_sust_p_2d_array_v4i32_trap,
+    nvvm_sust_p_2d_array_v4i8_trap,
+    nvvm_sust_p_2d_i16_trap,
+    nvvm_sust_p_2d_i32_trap,
+    nvvm_sust_p_2d_i8_trap,
+    nvvm_sust_p_2d_v2i16_trap,
+    nvvm_sust_p_2d_v2i32_trap,
+    nvvm_sust_p_2d_v2i8_trap,
+    nvvm_sust_p_2d_v4i16_trap,
+    nvvm_sust_p_2d_v4i32_trap,
+    nvvm_sust_p_2d_v4i8_trap,
+    nvvm_sust_p_3d_i16_trap,
+    nvvm_sust_p_3d_i32_trap,
+    nvvm_sust_p_3d_i8_trap,
+    nvvm_sust_p_3d_v2i16_trap,
+    nvvm_sust_p_3d_v2i32_trap,
+    nvvm_sust_p_3d_v2i8_trap,
+    nvvm_sust_p_3d_v4i16_trap,
+    nvvm_sust_p_3d_v4i32_trap,
+    nvvm_sust_p_3d_v4i8_trap,
+    nvvm_swap_lo_hi_b64,
+    nvvm_tex_1d_array_grad_v4f32_f32,
+    nvvm_tex_1d_array_grad_v4s32_f32,
+    nvvm_tex_1d_array_grad_v4u32_f32,
+    nvvm_tex_1d_array_level_v4f32_f32,
+    nvvm_tex_1d_array_level_v4s32_f32,
+    nvvm_tex_1d_array_level_v4u32_f32,
+    nvvm_tex_1d_array_v4f32_f32,
+    nvvm_tex_1d_array_v4f32_s32,
+    nvvm_tex_1d_array_v4s32_f32,
+    nvvm_tex_1d_array_v4s32_s32,
+    nvvm_tex_1d_array_v4u32_f32,
+    nvvm_tex_1d_array_v4u32_s32,
+    nvvm_tex_1d_grad_v4f32_f32,
+    nvvm_tex_1d_grad_v4s32_f32,
+    nvvm_tex_1d_grad_v4u32_f32,
+    nvvm_tex_1d_level_v4f32_f32,
+    nvvm_tex_1d_level_v4s32_f32,
+    nvvm_tex_1d_level_v4u32_f32,
+    nvvm_tex_1d_v4f32_f32,
+    nvvm_tex_1d_v4f32_s32,
+    nvvm_tex_1d_v4s32_f32,
+    nvvm_tex_1d_v4s32_s32,
+    nvvm_tex_1d_v4u32_f32,
+    nvvm_tex_1d_v4u32_s32,
+    nvvm_tex_2d_array_grad_v4f32_f32,
+    nvvm_tex_2d_array_grad_v4s32_f32,
+    nvvm_tex_2d_array_grad_v4u32_f32,
+    nvvm_tex_2d_array_level_v4f32_f32,
+    nvvm_tex_2d_array_level_v4s32_f32,
+    nvvm_tex_2d_array_level_v4u32_f32,
+    nvvm_tex_2d_array_v4f32_f32,
+    nvvm_tex_2d_array_v4f32_s32,
+    nvvm_tex_2d_array_v4s32_f32,
+    nvvm_tex_2d_array_v4s32_s32,
+    nvvm_tex_2d_array_v4u32_f32,
+    nvvm_tex_2d_array_v4u32_s32,
+    nvvm_tex_2d_grad_v4f32_f32,
+    nvvm_tex_2d_grad_v4s32_f32,
+    nvvm_tex_2d_grad_v4u32_f32,
+    nvvm_tex_2d_level_v4f32_f32,
+    nvvm_tex_2d_level_v4s32_f32,
+    nvvm_tex_2d_level_v4u32_f32,
+    nvvm_tex_2d_v4f32_f32,
+    nvvm_tex_2d_v4f32_s32,
+    nvvm_tex_2d_v4s32_f32,
+    nvvm_tex_2d_v4s32_s32,
+    nvvm_tex_2d_v4u32_f32,
+    nvvm_tex_2d_v4u32_s32,
+    nvvm_tex_3d_grad_v4f32_f32,
+    nvvm_tex_3d_grad_v4s32_f32,
+    nvvm_tex_3d_grad_v4u32_f32,
+    nvvm_tex_3d_level_v4f32_f32,
+    nvvm_tex_3d_level_v4s32_f32,
+    nvvm_tex_3d_level_v4u32_f32,
+    nvvm_tex_3d_v4f32_f32,
+    nvvm_tex_3d_v4f32_s32,
+    nvvm_tex_3d_v4s32_f32,
+    nvvm_tex_3d_v4s32_s32,
+    nvvm_tex_3d_v4u32_f32,
+    nvvm_tex_3d_v4u32_s32,
+    nvvm_tex_cube_array_level_v4f32_f32,
+    nvvm_tex_cube_array_level_v4s32_f32,
+    nvvm_tex_cube_array_level_v4u32_f32,
+    nvvm_tex_cube_array_v4f32_f32,
+    nvvm_tex_cube_array_v4s32_f32,
+    nvvm_tex_cube_array_v4u32_f32,
+    nvvm_tex_cube_level_v4f32_f32,
+    nvvm_tex_cube_level_v4s32_f32,
+    nvvm_tex_cube_level_v4u32_f32,
+    nvvm_tex_cube_v4f32_f32,
+    nvvm_tex_cube_v4s32_f32,
+    nvvm_tex_cube_v4u32_f32,
+    nvvm_tex_unified_1d_array_grad_v4f32_f32,
+    nvvm_tex_unified_1d_array_grad_v4s32_f32,
+    nvvm_tex_unified_1d_array_grad_v4u32_f32,
+    nvvm_tex_unified_1d_array_level_v4f32_f32,
+    nvvm_tex_unified_1d_array_level_v4s32_f32,
+    nvvm_tex_unified_1d_array_level_v4u32_f32,
+    nvvm_tex_unified_1d_array_v4f32_f32,
+    nvvm_tex_unified_1d_array_v4f32_s32,
+    nvvm_tex_unified_1d_array_v4s32_f32,
+    nvvm_tex_unified_1d_array_v4s32_s32,
+    nvvm_tex_unified_1d_array_v4u32_f32,
+    nvvm_tex_unified_1d_array_v4u32_s32,
+    nvvm_tex_unified_1d_grad_v4f32_f32,
+    nvvm_tex_unified_1d_grad_v4s32_f32,
+    nvvm_tex_unified_1d_grad_v4u32_f32,
+    nvvm_tex_unified_1d_level_v4f32_f32,
+    nvvm_tex_unified_1d_level_v4s32_f32,
+    nvvm_tex_unified_1d_level_v4u32_f32,
+    nvvm_tex_unified_1d_v4f32_f32,
+    nvvm_tex_unified_1d_v4f32_s32,
+    nvvm_tex_unified_1d_v4s32_f32,
+    nvvm_tex_unified_1d_v4s32_s32,
+    nvvm_tex_unified_1d_v4u32_f32,
+    nvvm_tex_unified_1d_v4u32_s32,
+    nvvm_tex_unified_2d_array_grad_v4f32_f32,
+    nvvm_tex_unified_2d_array_grad_v4s32_f32,
+    nvvm_tex_unified_2d_array_grad_v4u32_f32,
+    nvvm_tex_unified_2d_array_level_v4f32_f32,
+    nvvm_tex_unified_2d_array_level_v4s32_f32,
+    nvvm_tex_unified_2d_array_level_v4u32_f32,
+    nvvm_tex_unified_2d_array_v4f32_f32,
+    nvvm_tex_unified_2d_array_v4f32_s32,
+    nvvm_tex_unified_2d_array_v4s32_f32,
+    nvvm_tex_unified_2d_array_v4s32_s32,
+    nvvm_tex_unified_2d_array_v4u32_f32,
+    nvvm_tex_unified_2d_array_v4u32_s32,
+    nvvm_tex_unified_2d_grad_v4f32_f32,
+    nvvm_tex_unified_2d_grad_v4s32_f32,
+    nvvm_tex_unified_2d_grad_v4u32_f32,
+    nvvm_tex_unified_2d_level_v4f32_f32,
+    nvvm_tex_unified_2d_level_v4s32_f32,
+    nvvm_tex_unified_2d_level_v4u32_f32,
+    nvvm_tex_unified_2d_v4f32_f32,
+    nvvm_tex_unified_2d_v4f32_s32,
+    nvvm_tex_unified_2d_v4s32_f32,
+    nvvm_tex_unified_2d_v4s32_s32,
+    nvvm_tex_unified_2d_v4u32_f32,
+    nvvm_tex_unified_2d_v4u32_s32,
+    nvvm_tex_unified_3d_grad_v4f32_f32,
+    nvvm_tex_unified_3d_grad_v4s32_f32,
+    nvvm_tex_unified_3d_grad_v4u32_f32,
+    nvvm_tex_unified_3d_level_v4f32_f32,
+    nvvm_tex_unified_3d_level_v4s32_f32,
+    nvvm_tex_unified_3d_level_v4u32_f32,
+    nvvm_tex_unified_3d_v4f32_f32,
+    nvvm_tex_unified_3d_v4f32_s32,
+    nvvm_tex_unified_3d_v4s32_f32,
+    nvvm_tex_unified_3d_v4s32_s32,
+    nvvm_tex_unified_3d_v4u32_f32,
+    nvvm_tex_unified_3d_v4u32_s32,
+    nvvm_tex_unified_cube_array_level_v4f32_f32,
+    nvvm_tex_unified_cube_array_level_v4s32_f32,
+    nvvm_tex_unified_cube_array_level_v4u32_f32,
+    nvvm_tex_unified_cube_array_v4f32_f32,
+    nvvm_tex_unified_cube_array_v4s32_f32,
+    nvvm_tex_unified_cube_array_v4u32_f32,
+    nvvm_tex_unified_cube_level_v4f32_f32,
+    nvvm_tex_unified_cube_level_v4s32_f32,
+    nvvm_tex_unified_cube_level_v4u32_f32,
+    nvvm_tex_unified_cube_v4f32_f32,
+    nvvm_tex_unified_cube_v4s32_f32,
+    nvvm_tex_unified_cube_v4u32_f32,
+    nvvm_texsurf_handle,
+    nvvm_texsurf_handle_internal,
+    nvvm_tld4_a_2d_v4f32_f32,
+    nvvm_tld4_a_2d_v4s32_f32,
+    nvvm_tld4_a_2d_v4u32_f32,
+    nvvm_tld4_b_2d_v4f32_f32,
+    nvvm_tld4_b_2d_v4s32_f32,
+    nvvm_tld4_b_2d_v4u32_f32,
+    nvvm_tld4_g_2d_v4f32_f32,
+    nvvm_tld4_g_2d_v4s32_f32,
+    nvvm_tld4_g_2d_v4u32_f32,
+    nvvm_tld4_r_2d_v4f32_f32,
+    nvvm_tld4_r_2d_v4s32_f32,
+    nvvm_tld4_r_2d_v4u32_f32,
+    nvvm_tld4_unified_a_2d_v4f32_f32,
+    nvvm_tld4_unified_a_2d_v4s32_f32,
+    nvvm_tld4_unified_a_2d_v4u32_f32,
+    nvvm_tld4_unified_b_2d_v4f32_f32,
+    nvvm_tld4_unified_b_2d_v4s32_f32,
+    nvvm_tld4_unified_b_2d_v4u32_f32,
+    nvvm_tld4_unified_g_2d_v4f32_f32,
+    nvvm_tld4_unified_g_2d_v4s32_f32,
+    nvvm_tld4_unified_g_2d_v4u32_f32,
+    nvvm_tld4_unified_r_2d_v4f32_f32,
+    nvvm_tld4_unified_r_2d_v4s32_f32,
+    nvvm_tld4_unified_r_2d_v4u32_f32,
+    nvvm_trunc_d,
+    nvvm_trunc_f,
+    nvvm_trunc_ftz_f,
+    nvvm_txq_array_size,
+    nvvm_txq_channel_data_type,
+    nvvm_txq_channel_order,
+    nvvm_txq_depth,
+    nvvm_txq_height,
+    nvvm_txq_num_mipmap_levels,
+    nvvm_txq_num_samples,
+    nvvm_txq_width,
+    nvvm_ui2d_rm,
+    nvvm_ui2d_rn,
+    nvvm_ui2d_rp,
+    nvvm_ui2d_rz,
+    nvvm_ui2f_rm,
+    nvvm_ui2f_rn,
+    nvvm_ui2f_rp,
+    nvvm_ui2f_rz,
+    nvvm_ull2d_rm,
+    nvvm_ull2d_rn,
+    nvvm_ull2d_rp,
+    nvvm_ull2d_rz,
+    nvvm_ull2f_rm,
+    nvvm_ull2f_rn,
+    nvvm_ull2f_rp,
+    nvvm_ull2f_rz,
+    nvvm_vote_all,
+    nvvm_vote_all_sync,
+    nvvm_vote_any,
+    nvvm_vote_any_sync,
+    nvvm_vote_ballot,
+    nvvm_vote_ballot_sync,
+    nvvm_vote_uni,
+    nvvm_vote_uni_sync,
+    nvvm_wmma_load_a_f16_col,
+    nvvm_wmma_load_a_f16_col_global,
+    nvvm_wmma_load_a_f16_col_global_stride,
+    nvvm_wmma_load_a_f16_col_shared,
+    nvvm_wmma_load_a_f16_col_shared_stride,
+    nvvm_wmma_load_a_f16_col_stride,
+    nvvm_wmma_load_a_f16_row,
+    nvvm_wmma_load_a_f16_row_global,
+    nvvm_wmma_load_a_f16_row_global_stride,
+    nvvm_wmma_load_a_f16_row_shared,
+    nvvm_wmma_load_a_f16_row_shared_stride,
+    nvvm_wmma_load_a_f16_row_stride,
+    nvvm_wmma_load_b_f16_col,
+    nvvm_wmma_load_b_f16_col_global,
+    nvvm_wmma_load_b_f16_col_global_stride,
+    nvvm_wmma_load_b_f16_col_shared,
+    nvvm_wmma_load_b_f16_col_shared_stride,
+    nvvm_wmma_load_b_f16_col_stride,
+    nvvm_wmma_load_b_f16_row,
+    nvvm_wmma_load_b_f16_row_global,
+    nvvm_wmma_load_b_f16_row_global_stride,
+    nvvm_wmma_load_b_f16_row_shared,
+    nvvm_wmma_load_b_f16_row_shared_stride,
+    nvvm_wmma_load_b_f16_row_stride,
+    nvvm_wmma_load_c_f16_col,
+    nvvm_wmma_load_c_f32_col,
+    nvvm_wmma_load_c_f16_col_global,
+    nvvm_wmma_load_c_f32_col_global,
+    nvvm_wmma_load_c_f16_col_global_stride,
+    nvvm_wmma_load_c_f32_col_global_stride,
+    nvvm_wmma_load_c_f16_col_shared,
+    nvvm_wmma_load_c_f32_col_shared,
+    nvvm_wmma_load_c_f16_col_shared_stride,
+    nvvm_wmma_load_c_f32_col_shared_stride,
+    nvvm_wmma_load_c_f16_col_stride,
+    nvvm_wmma_load_c_f32_col_stride,
+    nvvm_wmma_load_c_f16_row,
+    nvvm_wmma_load_c_f32_row,
+    nvvm_wmma_load_c_f16_row_global,
+    nvvm_wmma_load_c_f32_row_global,
+    nvvm_wmma_load_c_f16_row_global_stride,
+    nvvm_wmma_load_c_f32_row_global_stride,
+    nvvm_wmma_load_c_f16_row_shared,
+    nvvm_wmma_load_c_f32_row_shared,
+    nvvm_wmma_load_c_f16_row_shared_stride,
+    nvvm_wmma_load_c_f32_row_shared_stride,
+    nvvm_wmma_load_c_f16_row_stride,
+    nvvm_wmma_load_c_f32_row_stride,
+    nvvm_wmma_mma_sync_col_col_f16_f16,
+    nvvm_wmma_mma_sync_col_col_f16_f16_satfinite,
+    nvvm_wmma_mma_sync_col_col_f16_f32,
+    nvvm_wmma_mma_sync_col_col_f16_f32_satfinite,
+    nvvm_wmma_mma_sync_col_col_f32_f16,
+    nvvm_wmma_mma_sync_col_col_f32_f16_satfinite,
+    nvvm_wmma_mma_sync_col_col_f32_f32,
+    nvvm_wmma_mma_sync_col_col_f32_f32_satfinite,
+    nvvm_wmma_mma_sync_col_row_f16_f16,
+    nvvm_wmma_mma_sync_col_row_f16_f16_satfinite,
+    nvvm_wmma_mma_sync_col_row_f16_f32,
+    nvvm_wmma_mma_sync_col_row_f16_f32_satfinite,
+    nvvm_wmma_mma_sync_col_row_f32_f16,
+    nvvm_wmma_mma_sync_col_row_f32_f16_satfinite,
+    nvvm_wmma_mma_sync_col_row_f32_f32,
+    nvvm_wmma_mma_sync_col_row_f32_f32_satfinite,
+    nvvm_wmma_mma_sync_row_col_f16_f16,
+    nvvm_wmma_mma_sync_row_col_f16_f16_satfinite,
+    nvvm_wmma_mma_sync_row_col_f16_f32,
+    nvvm_wmma_mma_sync_row_col_f16_f32_satfinite,
+    nvvm_wmma_mma_sync_row_col_f32_f16,
+    nvvm_wmma_mma_sync_row_col_f32_f16_satfinite,
+    nvvm_wmma_mma_sync_row_col_f32_f32,
+    nvvm_wmma_mma_sync_row_col_f32_f32_satfinite,
+    nvvm_wmma_mma_sync_row_row_f16_f16,
+    nvvm_wmma_mma_sync_row_row_f16_f16_satfinite,
+    nvvm_wmma_mma_sync_row_row_f16_f32,
+    nvvm_wmma_mma_sync_row_row_f16_f32_satfinite,
+    nvvm_wmma_mma_sync_row_row_f32_f16,
+    nvvm_wmma_mma_sync_row_row_f32_f16_satfinite,
+    nvvm_wmma_mma_sync_row_row_f32_f32,
+    nvvm_wmma_mma_sync_row_row_f32_f32_satfinite,
+    nvvm_wmma_store_d_f16_col,
+    nvvm_wmma_store_d_f32_col,
+    nvvm_wmma_store_d_f16_col_global,
+    nvvm_wmma_store_d_f32_col_global,
+    nvvm_wmma_store_d_f16_col_global_stride,
+    nvvm_wmma_store_d_f32_col_global_stride,
+    nvvm_wmma_store_d_f16_col_shared,
+    nvvm_wmma_store_d_f32_col_shared,
+    nvvm_wmma_store_d_f16_col_shared_stride,
+    nvvm_wmma_store_d_f32_col_shared_stride,
+    nvvm_wmma_store_d_f16_col_stride,
+    nvvm_wmma_store_d_f32_col_stride,
+    nvvm_wmma_store_d_f16_row,
+    nvvm_wmma_store_d_f32_row,
+    nvvm_wmma_store_d_f16_row_global,
+    nvvm_wmma_store_d_f32_row_global,
+    nvvm_wmma_store_d_f16_row_global_stride,
+    nvvm_wmma_store_d_f32_row_global_stride,
+    nvvm_wmma_store_d_f16_row_shared,
+    nvvm_wmma_store_d_f32_row_shared,
+    nvvm_wmma_store_d_f16_row_shared_stride,
+    nvvm_wmma_store_d_f32_row_shared_stride,
+    nvvm_wmma_store_d_f16_row_stride,
+    nvvm_wmma_store_d_f32_row_stride,
+    ppc_altivec_crypto_vcipher,
+    ppc_altivec_crypto_vcipherlast,
+    ppc_altivec_crypto_vncipher,
+    ppc_altivec_crypto_vncipherlast,
+    ppc_altivec_crypto_vpermxor,
+    ppc_altivec_crypto_vpmsumb,
+    ppc_altivec_crypto_vpmsumd,
+    ppc_altivec_crypto_vpmsumh,
+    ppc_altivec_crypto_vpmsumw,
+    ppc_altivec_crypto_vsbox,
+    ppc_altivec_crypto_vshasigmad,
+    ppc_altivec_crypto_vshasigmaw,
+    ppc_altivec_dss,
+    ppc_altivec_dssall,
+    ppc_altivec_dst,
+    ppc_altivec_dstst,
+    ppc_altivec_dststt,
+    ppc_altivec_dstt,
+    ppc_altivec_lvebx,
+    ppc_altivec_lvehx,
+    ppc_altivec_lvewx,
+    ppc_altivec_lvsl,
+    ppc_altivec_lvsr,
+    ppc_altivec_lvx,
+    ppc_altivec_lvxl,
+    ppc_altivec_mfvscr,
+    ppc_altivec_mtvscr,
+    ppc_altivec_stvebx,
+    ppc_altivec_stvehx,
+    ppc_altivec_stvewx,
+    ppc_altivec_stvx,
+    ppc_altivec_stvxl,
+    ppc_altivec_vabsdub,
+    ppc_altivec_vabsduh,
+    ppc_altivec_vabsduw,
+    ppc_altivec_vaddcuq,
+    ppc_altivec_vaddcuw,
+    ppc_altivec_vaddecuq,
+    ppc_altivec_vaddeuqm,
+    ppc_altivec_vaddsbs,
+    ppc_altivec_vaddshs,
+    ppc_altivec_vaddsws,
+    ppc_altivec_vaddubs,
+    ppc_altivec_vadduhs,
+    ppc_altivec_vadduws,
+    ppc_altivec_vavgsb,
+    ppc_altivec_vavgsh,
+    ppc_altivec_vavgsw,
+    ppc_altivec_vavgub,
+    ppc_altivec_vavguh,
+    ppc_altivec_vavguw,
+    ppc_altivec_vbpermq,
+    ppc_altivec_vcfsx,
+    ppc_altivec_vcfux,
+    ppc_altivec_vclzlsbb,
+    ppc_altivec_vcmpbfp,
+    ppc_altivec_vcmpbfp_p,
+    ppc_altivec_vcmpeqfp,
+    ppc_altivec_vcmpeqfp_p,
+    ppc_altivec_vcmpequb,
+    ppc_altivec_vcmpequb_p,
+    ppc_altivec_vcmpequd,
+    ppc_altivec_vcmpequd_p,
+    ppc_altivec_vcmpequh,
+    ppc_altivec_vcmpequh_p,
+    ppc_altivec_vcmpequw,
+    ppc_altivec_vcmpequw_p,
+    ppc_altivec_vcmpgefp,
+    ppc_altivec_vcmpgefp_p,
+    ppc_altivec_vcmpgtfp,
+    ppc_altivec_vcmpgtfp_p,
+    ppc_altivec_vcmpgtsb,
+    ppc_altivec_vcmpgtsb_p,
+    ppc_altivec_vcmpgtsd,
+    ppc_altivec_vcmpgtsd_p,
+    ppc_altivec_vcmpgtsh,
+    ppc_altivec_vcmpgtsh_p,
+    ppc_altivec_vcmpgtsw,
+    ppc_altivec_vcmpgtsw_p,
+    ppc_altivec_vcmpgtub,
+    ppc_altivec_vcmpgtub_p,
+    ppc_altivec_vcmpgtud,
+    ppc_altivec_vcmpgtud_p,
+    ppc_altivec_vcmpgtuh,
+    ppc_altivec_vcmpgtuh_p,
+    ppc_altivec_vcmpgtuw,
+    ppc_altivec_vcmpgtuw_p,
+    ppc_altivec_vcmpneb,
+    ppc_altivec_vcmpneb_p,
+    ppc_altivec_vcmpneh,
+    ppc_altivec_vcmpneh_p,
+    ppc_altivec_vcmpnew,
+    ppc_altivec_vcmpnew_p,
+    ppc_altivec_vcmpnezb,
+    ppc_altivec_vcmpnezb_p,
+    ppc_altivec_vcmpnezh,
+    ppc_altivec_vcmpnezh_p,
+    ppc_altivec_vcmpnezw,
+    ppc_altivec_vcmpnezw_p,
+    ppc_altivec_vctsxs,
+    ppc_altivec_vctuxs,
+    ppc_altivec_vctzlsbb,
+    ppc_altivec_vexptefp,
+    ppc_altivec_vgbbd,
+    ppc_altivec_vlogefp,
+    ppc_altivec_vmaddfp,
+    ppc_altivec_vmaxfp,
+    ppc_altivec_vmaxsb,
+    ppc_altivec_vmaxsd,
+    ppc_altivec_vmaxsh,
+    ppc_altivec_vmaxsw,
+    ppc_altivec_vmaxub,
+    ppc_altivec_vmaxud,
+    ppc_altivec_vmaxuh,
+    ppc_altivec_vmaxuw,
+    ppc_altivec_vmhaddshs,
+    ppc_altivec_vmhraddshs,
+    ppc_altivec_vminfp,
+    ppc_altivec_vminsb,
+    ppc_altivec_vminsd,
+    ppc_altivec_vminsh,
+    ppc_altivec_vminsw,
+    ppc_altivec_vminub,
+    ppc_altivec_vminud,
+    ppc_altivec_vminuh,
+    ppc_altivec_vminuw,
+    ppc_altivec_vmladduhm,
+    ppc_altivec_vmsummbm,
+    ppc_altivec_vmsumshm,
+    ppc_altivec_vmsumshs,
+    ppc_altivec_vmsumubm,
+    ppc_altivec_vmsumuhm,
+    ppc_altivec_vmsumuhs,
+    ppc_altivec_vmulesb,
+    ppc_altivec_vmulesh,
+    ppc_altivec_vmulesw,
+    ppc_altivec_vmuleub,
+    ppc_altivec_vmuleuh,
+    ppc_altivec_vmuleuw,
+    ppc_altivec_vmulosb,
+    ppc_altivec_vmulosh,
+    ppc_altivec_vmulosw,
+    ppc_altivec_vmuloub,
+    ppc_altivec_vmulouh,
+    ppc_altivec_vmulouw,
+    ppc_altivec_vnmsubfp,
+    ppc_altivec_vperm,
+    ppc_altivec_vpkpx,
+    ppc_altivec_vpksdss,
+    ppc_altivec_vpksdus,
+    ppc_altivec_vpkshss,
+    ppc_altivec_vpkshus,
+    ppc_altivec_vpkswss,
+    ppc_altivec_vpkswus,
+    ppc_altivec_vpkudus,
+    ppc_altivec_vpkuhus,
+    ppc_altivec_vpkuwus,
+    ppc_altivec_vprtybd,
+    ppc_altivec_vprtybq,
+    ppc_altivec_vprtybw,
+    ppc_altivec_vrefp,
+    ppc_altivec_vrfim,
+    ppc_altivec_vrfin,
+    ppc_altivec_vrfip,
+    ppc_altivec_vrfiz,
+    ppc_altivec_vrlb,
+    ppc_altivec_vrld,
+    ppc_altivec_vrldmi,
+    ppc_altivec_vrldnm,
+    ppc_altivec_vrlh,
+    ppc_altivec_vrlw,
+    ppc_altivec_vrlwmi,
+    ppc_altivec_vrlwnm,
+    ppc_altivec_vrsqrtefp,
+    ppc_altivec_vsel,
+    ppc_altivec_vsl,
+    ppc_altivec_vslb,
+    ppc_altivec_vslh,
+    ppc_altivec_vslo,
+    ppc_altivec_vslv,
+    ppc_altivec_vslw,
+    ppc_altivec_vsr,
+    ppc_altivec_vsrab,
+    ppc_altivec_vsrah,
+    ppc_altivec_vsraw,
+    ppc_altivec_vsrb,
+    ppc_altivec_vsrh,
+    ppc_altivec_vsro,
+    ppc_altivec_vsrv,
+    ppc_altivec_vsrw,
+    ppc_altivec_vsubcuq,
+    ppc_altivec_vsubcuw,
+    ppc_altivec_vsubecuq,
+    ppc_altivec_vsubeuqm,
+    ppc_altivec_vsubsbs,
+    ppc_altivec_vsubshs,
+    ppc_altivec_vsubsws,
+    ppc_altivec_vsububs,
+    ppc_altivec_vsubuhs,
+    ppc_altivec_vsubuws,
+    ppc_altivec_vsum2sws,
+    ppc_altivec_vsum4sbs,
+    ppc_altivec_vsum4shs,
+    ppc_altivec_vsum4ubs,
+    ppc_altivec_vsumsws,
+    ppc_altivec_vupkhpx,
+    ppc_altivec_vupkhsb,
+    ppc_altivec_vupkhsh,
+    ppc_altivec_vupkhsw,
+    ppc_altivec_vupklpx,
+    ppc_altivec_vupklsb,
+    ppc_altivec_vupklsh,
+    ppc_altivec_vupklsw,
+    ppc_bpermd,
+    ppc_cfence,
+    ppc_dcba,
+    ppc_dcbf,
+    ppc_dcbi,
+    ppc_dcbst,
+    ppc_dcbt,
+    ppc_dcbtst,
+    ppc_dcbz,
+    ppc_dcbzl,
+    ppc_divde,
+    ppc_divdeu,
+    ppc_divwe,
+    ppc_divweu,
+    ppc_get_texasr,
+    ppc_get_texasru,
+    ppc_get_tfhar,
+    ppc_get_tfiar,
+    ppc_is_decremented_ctr_nonzero,
+    ppc_lwsync,
+    ppc_mtctr,
+    ppc_qpx_qvfabs,
+    ppc_qpx_qvfadd,
+    ppc_qpx_qvfadds,
+    ppc_qpx_qvfcfid,
+    ppc_qpx_qvfcfids,
+    ppc_qpx_qvfcfidu,
+    ppc_qpx_qvfcfidus,
+    ppc_qpx_qvfcmpeq,
+    ppc_qpx_qvfcmpgt,
+    ppc_qpx_qvfcmplt,
+    ppc_qpx_qvfcpsgn,
+    ppc_qpx_qvfctid,
+    ppc_qpx_qvfctidu,
+    ppc_qpx_qvfctiduz,
+    ppc_qpx_qvfctidz,
+    ppc_qpx_qvfctiw,
+    ppc_qpx_qvfctiwu,
+    ppc_qpx_qvfctiwuz,
+    ppc_qpx_qvfctiwz,
+    ppc_qpx_qvflogical,
+    ppc_qpx_qvfmadd,
+    ppc_qpx_qvfmadds,
+    ppc_qpx_qvfmsub,
+    ppc_qpx_qvfmsubs,
+    ppc_qpx_qvfmul,
+    ppc_qpx_qvfmuls,
+    ppc_qpx_qvfnabs,
+    ppc_qpx_qvfneg,
+    ppc_qpx_qvfnmadd,
+    ppc_qpx_qvfnmadds,
+    ppc_qpx_qvfnmsub,
+    ppc_qpx_qvfnmsubs,
+    ppc_qpx_qvfperm,
+    ppc_qpx_qvfre,
+    ppc_qpx_qvfres,
+    ppc_qpx_qvfrim,
+    ppc_qpx_qvfrin,
+    ppc_qpx_qvfrip,
+    ppc_qpx_qvfriz,
+    ppc_qpx_qvfrsp,
+    ppc_qpx_qvfrsqrte,
+    ppc_qpx_qvfrsqrtes,
+    ppc_qpx_qvfsel,
+    ppc_qpx_qvfsub,
+    ppc_qpx_qvfsubs,
+    ppc_qpx_qvftstnan,
+    ppc_qpx_qvfxmadd,
+    ppc_qpx_qvfxmadds,
+    ppc_qpx_qvfxmul,
+    ppc_qpx_qvfxmuls,
+    ppc_qpx_qvfxxcpnmadd,
+    ppc_qpx_qvfxxcpnmadds,
+    ppc_qpx_qvfxxmadd,
+    ppc_qpx_qvfxxmadds,
+    ppc_qpx_qvfxxnpmadd,
+    ppc_qpx_qvfxxnpmadds,
+    ppc_qpx_qvgpci,
+    ppc_qpx_qvlfcd,
+    ppc_qpx_qvlfcda,
+    ppc_qpx_qvlfcs,
+    ppc_qpx_qvlfcsa,
+    ppc_qpx_qvlfd,
+    ppc_qpx_qvlfda,
+    ppc_qpx_qvlfiwa,
+    ppc_qpx_qvlfiwaa,
+    ppc_qpx_qvlfiwz,
+    ppc_qpx_qvlfiwza,
+    ppc_qpx_qvlfs,
+    ppc_qpx_qvlfsa,
+    ppc_qpx_qvlpcld,
+    ppc_qpx_qvlpcls,
+    ppc_qpx_qvlpcrd,
+    ppc_qpx_qvlpcrs,
+    ppc_qpx_qvstfcd,
+    ppc_qpx_qvstfcda,
+    ppc_qpx_qvstfcs,
+    ppc_qpx_qvstfcsa,
+    ppc_qpx_qvstfd,
+    ppc_qpx_qvstfda,
+    ppc_qpx_qvstfiw,
+    ppc_qpx_qvstfiwa,
+    ppc_qpx_qvstfs,
+    ppc_qpx_qvstfsa,
+    ppc_set_texasr,
+    ppc_set_texasru,
+    ppc_set_tfhar,
+    ppc_set_tfiar,
+    ppc_sync,
+    ppc_tabort,
+    ppc_tabortdc,
+    ppc_tabortdci,
+    ppc_tabortwc,
+    ppc_tabortwci,
+    ppc_tbegin,
+    ppc_tcheck,
+    ppc_tend,
+    ppc_tendall,
+    ppc_trechkpt,
+    ppc_treclaim,
+    ppc_tresume,
+    ppc_tsr,
+    ppc_tsuspend,
+    ppc_ttest,
+    ppc_vsx_lxvd2x,
+    ppc_vsx_lxvd2x_be,
+    ppc_vsx_lxvl,
+    ppc_vsx_lxvll,
+    ppc_vsx_lxvw4x,
+    ppc_vsx_lxvw4x_be,
+    ppc_vsx_stxvd2x,
+    ppc_vsx_stxvd2x_be,
+    ppc_vsx_stxvl,
+    ppc_vsx_stxvll,
+    ppc_vsx_stxvw4x,
+    ppc_vsx_stxvw4x_be,
+    ppc_vsx_xsmaxdp,
+    ppc_vsx_xsmindp,
+    ppc_vsx_xvcmpeqdp,
+    ppc_vsx_xvcmpeqdp_p,
+    ppc_vsx_xvcmpeqsp,
+    ppc_vsx_xvcmpeqsp_p,
+    ppc_vsx_xvcmpgedp,
+    ppc_vsx_xvcmpgedp_p,
+    ppc_vsx_xvcmpgesp,
+    ppc_vsx_xvcmpgesp_p,
+    ppc_vsx_xvcmpgtdp,
+    ppc_vsx_xvcmpgtdp_p,
+    ppc_vsx_xvcmpgtsp,
+    ppc_vsx_xvcmpgtsp_p,
+    ppc_vsx_xvcvdpsp,
+    ppc_vsx_xvcvdpsxws,
+    ppc_vsx_xvcvdpuxws,
+    ppc_vsx_xvcvhpsp,
+    ppc_vsx_xvcvspdp,
+    ppc_vsx_xvcvsphp,
+    ppc_vsx_xvcvsxdsp,
+    ppc_vsx_xvcvsxwdp,
+    ppc_vsx_xvcvuxdsp,
+    ppc_vsx_xvcvuxwdp,
+    ppc_vsx_xvdivdp,
+    ppc_vsx_xvdivsp,
+    ppc_vsx_xviexpdp,
+    ppc_vsx_xviexpsp,
+    ppc_vsx_xvmaxdp,
+    ppc_vsx_xvmaxsp,
+    ppc_vsx_xvmindp,
+    ppc_vsx_xvminsp,
+    ppc_vsx_xvrdpip,
+    ppc_vsx_xvredp,
+    ppc_vsx_xvresp,
+    ppc_vsx_xvrspip,
+    ppc_vsx_xvrsqrtedp,
+    ppc_vsx_xvrsqrtesp,
+    ppc_vsx_xvtstdcdp,
+    ppc_vsx_xvtstdcsp,
+    ppc_vsx_xvxexpdp,
+    ppc_vsx_xvxexpsp,
+    ppc_vsx_xvxsigdp,
+    ppc_vsx_xvxsigsp,
+    ppc_vsx_xxextractuw,
+    ppc_vsx_xxinsertw,
+    ppc_vsx_xxleqv,
+    r600_cube,
+    r600_group_barrier,
+    r600_implicitarg_ptr,
+    r600_rat_store_typed,
+    r600_read_global_size_x,
+    r600_read_global_size_y,
+    r600_read_global_size_z,
+    r600_read_local_size_x,
+    r600_read_local_size_y,
+    r600_read_local_size_z,
+    r600_read_ngroups_x,
+    r600_read_ngroups_y,
+    r600_read_ngroups_z,
+    r600_read_tgid_x,
+    r600_read_tgid_y,
+    r600_read_tgid_z,
+    r600_read_tidig_x,
+    r600_read_tidig_y,
+    r600_read_tidig_z,
+    r600_recipsqrt_clamped,
+    r600_recipsqrt_ieee,
+    s390_efpc,
+    s390_etnd,
+    s390_lcbb,
+    s390_ntstg,
+    s390_ppa_txassist,
+    s390_sfpc,
+    s390_tabort,
+    s390_tbegin,
+    s390_tbegin_nofloat,
+    s390_tbeginc,
+    s390_tdc,
+    s390_tend,
+    s390_vaccb,
+    s390_vacccq,
+    s390_vaccf,
+    s390_vaccg,
+    s390_vacch,
+    s390_vaccq,
+    s390_vacq,
+    s390_vaq,
+    s390_vavgb,
+    s390_vavgf,
+    s390_vavgg,
+    s390_vavgh,
+    s390_vavglb,
+    s390_vavglf,
+    s390_vavglg,
+    s390_vavglh,
+    s390_vbperm,
+    s390_vceqbs,
+    s390_vceqfs,
+    s390_vceqgs,
+    s390_vceqhs,
+    s390_vchbs,
+    s390_vchfs,
+    s390_vchgs,
+    s390_vchhs,
+    s390_vchlbs,
+    s390_vchlfs,
+    s390_vchlgs,
+    s390_vchlhs,
+    s390_vcksm,
+    s390_verimb,
+    s390_verimf,
+    s390_verimg,
+    s390_verimh,
+    s390_verllb,
+    s390_verllf,
+    s390_verllg,
+    s390_verllh,
+    s390_verllvb,
+    s390_verllvf,
+    s390_verllvg,
+    s390_verllvh,
+    s390_vfaeb,
+    s390_vfaebs,
+    s390_vfaef,
+    s390_vfaefs,
+    s390_vfaeh,
+    s390_vfaehs,
+    s390_vfaezb,
+    s390_vfaezbs,
+    s390_vfaezf,
+    s390_vfaezfs,
+    s390_vfaezh,
+    s390_vfaezhs,
+    s390_vfcedbs,
+    s390_vfcesbs,
+    s390_vfchdbs,
+    s390_vfchedbs,
+    s390_vfchesbs,
+    s390_vfchsbs,
+    s390_vfeeb,
+    s390_vfeebs,
+    s390_vfeef,
+    s390_vfeefs,
+    s390_vfeeh,
+    s390_vfeehs,
+    s390_vfeezb,
+    s390_vfeezbs,
+    s390_vfeezf,
+    s390_vfeezfs,
+    s390_vfeezh,
+    s390_vfeezhs,
+    s390_vfeneb,
+    s390_vfenebs,
+    s390_vfenef,
+    s390_vfenefs,
+    s390_vfeneh,
+    s390_vfenehs,
+    s390_vfenezb,
+    s390_vfenezbs,
+    s390_vfenezf,
+    s390_vfenezfs,
+    s390_vfenezh,
+    s390_vfenezhs,
+    s390_vfidb,
+    s390_vfisb,
+    s390_vfmaxdb,
+    s390_vfmaxsb,
+    s390_vfmindb,
+    s390_vfminsb,
+    s390_vftcidb,
+    s390_vftcisb,
+    s390_vgfmab,
+    s390_vgfmaf,
+    s390_vgfmag,
+    s390_vgfmah,
+    s390_vgfmb,
+    s390_vgfmf,
+    s390_vgfmg,
+    s390_vgfmh,
+    s390_vistrb,
+    s390_vistrbs,
+    s390_vistrf,
+    s390_vistrfs,
+    s390_vistrh,
+    s390_vistrhs,
+    s390_vlbb,
+    s390_vll,
+    s390_vlrl,
+    s390_vmaeb,
+    s390_vmaef,
+    s390_vmaeh,
+    s390_vmahb,
+    s390_vmahf,
+    s390_vmahh,
+    s390_vmaleb,
+    s390_vmalef,
+    s390_vmaleh,
+    s390_vmalhb,
+    s390_vmalhf,
+    s390_vmalhh,
+    s390_vmalob,
+    s390_vmalof,
+    s390_vmaloh,
+    s390_vmaob,
+    s390_vmaof,
+    s390_vmaoh,
+    s390_vmeb,
+    s390_vmef,
+    s390_vmeh,
+    s390_vmhb,
+    s390_vmhf,
+    s390_vmhh,
+    s390_vmleb,
+    s390_vmlef,
+    s390_vmleh,
+    s390_vmlhb,
+    s390_vmlhf,
+    s390_vmlhh,
+    s390_vmlob,
+    s390_vmlof,
+    s390_vmloh,
+    s390_vmob,
+    s390_vmof,
+    s390_vmoh,
+    s390_vmslg,
+    s390_vpdi,
+    s390_vperm,
+    s390_vpklsf,
+    s390_vpklsfs,
+    s390_vpklsg,
+    s390_vpklsgs,
+    s390_vpklsh,
+    s390_vpklshs,
+    s390_vpksf,
+    s390_vpksfs,
+    s390_vpksg,
+    s390_vpksgs,
+    s390_vpksh,
+    s390_vpkshs,
+    s390_vsbcbiq,
+    s390_vsbiq,
+    s390_vscbib,
+    s390_vscbif,
+    s390_vscbig,
+    s390_vscbih,
+    s390_vscbiq,
+    s390_vsl,
+    s390_vslb,
+    s390_vsldb,
+    s390_vsq,
+    s390_vsra,
+    s390_vsrab,
+    s390_vsrl,
+    s390_vsrlb,
+    s390_vstl,
+    s390_vstrcb,
+    s390_vstrcbs,
+    s390_vstrcf,
+    s390_vstrcfs,
+    s390_vstrch,
+    s390_vstrchs,
+    s390_vstrczb,
+    s390_vstrczbs,
+    s390_vstrczf,
+    s390_vstrczfs,
+    s390_vstrczh,
+    s390_vstrczhs,
+    s390_vstrl,
+    s390_vsumb,
+    s390_vsumgf,
+    s390_vsumgh,
+    s390_vsumh,
+    s390_vsumqf,
+    s390_vsumqg,
+    s390_vtm,
+    s390_vuphb,
+    s390_vuphf,
+    s390_vuphh,
+    s390_vuplb,
+    s390_vuplf,
+    s390_vuplhb,
+    s390_vuplhf,
+    s390_vuplhh,
+    s390_vuplhw,
+    s390_vupllb,
+    s390_vupllf,
+    s390_vupllh,
+    wasm_current_memory,
+    wasm_grow_memory,
+    wasm_rethrow,
+    wasm_throw,
+    x86_3dnow_pavgusb,
+    x86_3dnow_pf2id,
+    x86_3dnow_pfacc,
+    x86_3dnow_pfadd,
+    x86_3dnow_pfcmpeq,
+    x86_3dnow_pfcmpge,
+    x86_3dnow_pfcmpgt,
+    x86_3dnow_pfmax,
+    x86_3dnow_pfmin,
+    x86_3dnow_pfmul,
+    x86_3dnow_pfrcp,
+    x86_3dnow_pfrcpit1,
+    x86_3dnow_pfrcpit2,
+    x86_3dnow_pfrsqit1,
+    x86_3dnow_pfrsqrt,
+    x86_3dnow_pfsub,
+    x86_3dnow_pfsubr,
+    x86_3dnow_pi2fd,
+    x86_3dnow_pmulhrw,
+    x86_3dnowa_pf2iw,
+    x86_3dnowa_pfnacc,
+    x86_3dnowa_pfpnacc,
+    x86_3dnowa_pi2fw,
+    x86_3dnowa_pswapd,
+    x86_addcarry_u32,
+    x86_addcarry_u64,
+    x86_addcarryx_u32,
+    x86_addcarryx_u64,
+    x86_aesni_aesdec,
+    x86_aesni_aesdec_256,
+    x86_aesni_aesdec_512,
+    x86_aesni_aesdeclast,
+    x86_aesni_aesdeclast_256,
+    x86_aesni_aesdeclast_512,
+    x86_aesni_aesenc,
+    x86_aesni_aesenc_256,
+    x86_aesni_aesenc_512,
+    x86_aesni_aesenclast,
+    x86_aesni_aesenclast_256,
+    x86_aesni_aesenclast_512,
+    x86_aesni_aesimc,
+    x86_aesni_aeskeygenassist,
+    x86_avx_addsub_pd_256,
+    x86_avx_addsub_ps_256,
+    x86_avx_blendv_pd_256,
+    x86_avx_blendv_ps_256,
+    x86_avx_cmp_pd_256,
+    x86_avx_cmp_ps_256,
+    x86_avx_cvt_pd2_ps_256,
+    x86_avx_cvt_pd2dq_256,
+    x86_avx_cvt_ps2dq_256,
+    x86_avx_cvtdq2_ps_256,
+    x86_avx_cvtt_pd2dq_256,
+    x86_avx_cvtt_ps2dq_256,
+    x86_avx_dp_ps_256,
+    x86_avx_hadd_pd_256,
+    x86_avx_hadd_ps_256,
+    x86_avx_hsub_pd_256,
+    x86_avx_hsub_ps_256,
+    x86_avx_ldu_dq_256,
+    x86_avx_maskload_pd,
+    x86_avx_maskload_pd_256,
+    x86_avx_maskload_ps,
+    x86_avx_maskload_ps_256,
+    x86_avx_maskstore_pd,
+    x86_avx_maskstore_pd_256,
+    x86_avx_maskstore_ps,
+    x86_avx_maskstore_ps_256,
+    x86_avx_max_pd_256,
+    x86_avx_max_ps_256,
+    x86_avx_min_pd_256,
+    x86_avx_min_ps_256,
+    x86_avx_movmsk_pd_256,
+    x86_avx_movmsk_ps_256,
+    x86_avx_ptestc_256,
+    x86_avx_ptestnzc_256,
+    x86_avx_ptestz_256,
+    x86_avx_rcp_ps_256,
+    x86_avx_round_pd_256,
+    x86_avx_round_ps_256,
+    x86_avx_rsqrt_ps_256,
+    x86_avx_sqrt_pd_256,
+    x86_avx_sqrt_ps_256,
+    x86_avx_vpermilvar_pd,
+    x86_avx_vpermilvar_pd_256,
+    x86_avx_vpermilvar_ps,
+    x86_avx_vpermilvar_ps_256,
+    x86_avx_vtestc_pd,
+    x86_avx_vtestc_pd_256,
+    x86_avx_vtestc_ps,
+    x86_avx_vtestc_ps_256,
+    x86_avx_vtestnzc_pd,
+    x86_avx_vtestnzc_pd_256,
+    x86_avx_vtestnzc_ps,
+    x86_avx_vtestnzc_ps_256,
+    x86_avx_vtestz_pd,
+    x86_avx_vtestz_pd_256,
+    x86_avx_vtestz_ps,
+    x86_avx_vtestz_ps_256,
+    x86_avx_vzeroall,
+    x86_avx_vzeroupper,
+    x86_avx2_gather_d_d,
+    x86_avx2_gather_d_d_256,
+    x86_avx2_gather_d_pd,
+    x86_avx2_gather_d_pd_256,
+    x86_avx2_gather_d_ps,
+    x86_avx2_gather_d_ps_256,
+    x86_avx2_gather_d_q,
+    x86_avx2_gather_d_q_256,
+    x86_avx2_gather_q_d,
+    x86_avx2_gather_q_d_256,
+    x86_avx2_gather_q_pd,
+    x86_avx2_gather_q_pd_256,
+    x86_avx2_gather_q_ps,
+    x86_avx2_gather_q_ps_256,
+    x86_avx2_gather_q_q,
+    x86_avx2_gather_q_q_256,
+    x86_avx2_maskload_d,
+    x86_avx2_maskload_d_256,
+    x86_avx2_maskload_q,
+    x86_avx2_maskload_q_256,
+    x86_avx2_maskstore_d,
+    x86_avx2_maskstore_d_256,
+    x86_avx2_maskstore_q,
+    x86_avx2_maskstore_q_256,
+    x86_avx2_mpsadbw,
+    x86_avx2_packssdw,
+    x86_avx2_packsswb,
+    x86_avx2_packusdw,
+    x86_avx2_packuswb,
+    x86_avx2_padds_b,
+    x86_avx2_padds_w,
+    x86_avx2_paddus_b,
+    x86_avx2_paddus_w,
+    x86_avx2_pblendvb,
+    x86_avx2_permd,
+    x86_avx2_permps,
+    x86_avx2_phadd_d,
+    x86_avx2_phadd_sw,
+    x86_avx2_phadd_w,
+    x86_avx2_phsub_d,
+    x86_avx2_phsub_sw,
+    x86_avx2_phsub_w,
+    x86_avx2_pmadd_ub_sw,
+    x86_avx2_pmadd_wd,
+    x86_avx2_pmovmskb,
+    x86_avx2_pmul_dq,
+    x86_avx2_pmul_hr_sw,
+    x86_avx2_pmulh_w,
+    x86_avx2_pmulhu_w,
+    x86_avx2_pmulu_dq,
+    x86_avx2_psad_bw,
+    x86_avx2_pshuf_b,
+    x86_avx2_psign_b,
+    x86_avx2_psign_d,
+    x86_avx2_psign_w,
+    x86_avx2_psll_d,
+    x86_avx2_psll_q,
+    x86_avx2_psll_w,
+    x86_avx2_pslli_d,
+    x86_avx2_pslli_q,
+    x86_avx2_pslli_w,
+    x86_avx2_psllv_d,
+    x86_avx2_psllv_d_256,
+    x86_avx2_psllv_q,
+    x86_avx2_psllv_q_256,
+    x86_avx2_psra_d,
+    x86_avx2_psra_w,
+    x86_avx2_psrai_d,
+    x86_avx2_psrai_w,
+    x86_avx2_psrav_d,
+    x86_avx2_psrav_d_256,
+    x86_avx2_psrl_d,
+    x86_avx2_psrl_q,
+    x86_avx2_psrl_w,
+    x86_avx2_psrli_d,
+    x86_avx2_psrli_q,
+    x86_avx2_psrli_w,
+    x86_avx2_psrlv_d,
+    x86_avx2_psrlv_d_256,
+    x86_avx2_psrlv_q,
+    x86_avx2_psrlv_q_256,
+    x86_avx2_psubs_b,
+    x86_avx2_psubs_w,
+    x86_avx2_psubus_b,
+    x86_avx2_psubus_w,
+    x86_avx512_broadcastmb_128,
+    x86_avx512_broadcastmb_256,
+    x86_avx512_broadcastmb_512,
+    x86_avx512_broadcastmw_128,
+    x86_avx512_broadcastmw_256,
+    x86_avx512_broadcastmw_512,
+    x86_avx512_cvtsi2sd64,
+    x86_avx512_cvtsi2ss32,
+    x86_avx512_cvtsi2ss64,
+    x86_avx512_cvttsd2si,
+    x86_avx512_cvttsd2si64,
+    x86_avx512_cvttsd2usi,
+    x86_avx512_cvttsd2usi64,
+    x86_avx512_cvttss2si,
+    x86_avx512_cvttss2si64,
+    x86_avx512_cvttss2usi,
+    x86_avx512_cvttss2usi64,
+    x86_avx512_cvtusi2sd,
+    x86_avx512_cvtusi2ss,
+    x86_avx512_cvtusi642sd,
+    x86_avx512_cvtusi642ss,
+    x86_avx512_exp2_pd,
+    x86_avx512_exp2_ps,
+    x86_avx512_gather_dpd_512,
+    x86_avx512_gather_dpi_512,
+    x86_avx512_gather_dpq_512,
+    x86_avx512_gather_dps_512,
+    x86_avx512_gather_qpd_512,
+    x86_avx512_gather_qpi_512,
+    x86_avx512_gather_qpq_512,
+    x86_avx512_gather_qps_512,
+    x86_avx512_gather3div2_df,
+    x86_avx512_gather3div2_di,
+    x86_avx512_gather3div4_df,
+    x86_avx512_gather3div4_di,
+    x86_avx512_gather3div4_sf,
+    x86_avx512_gather3div4_si,
+    x86_avx512_gather3div8_sf,
+    x86_avx512_gather3div8_si,
+    x86_avx512_gather3siv2_df,
+    x86_avx512_gather3siv2_di,
+    x86_avx512_gather3siv4_df,
+    x86_avx512_gather3siv4_di,
+    x86_avx512_gather3siv4_sf,
+    x86_avx512_gather3siv4_si,
+    x86_avx512_gather3siv8_sf,
+    x86_avx512_gather3siv8_si,
+    x86_avx512_gatherpf_dpd_512,
+    x86_avx512_gatherpf_dps_512,
+    x86_avx512_gatherpf_qpd_512,
+    x86_avx512_gatherpf_qps_512,
+    x86_avx512_kand_w,
+    x86_avx512_kandn_w,
+    x86_avx512_knot_w,
+    x86_avx512_kor_w,
+    x86_avx512_kortestc_w,
+    x86_avx512_kortestz_w,
+    x86_avx512_kxnor_w,
+    x86_avx512_kxor_w,
+    x86_avx512_mask_add_pd_512,
+    x86_avx512_mask_add_ps_512,
+    x86_avx512_mask_add_sd_round,
+    x86_avx512_mask_add_ss_round,
+    x86_avx512_mask_cmp_pd_128,
+    x86_avx512_mask_cmp_pd_256,
+    x86_avx512_mask_cmp_pd_512,
+    x86_avx512_mask_cmp_ps_128,
+    x86_avx512_mask_cmp_ps_256,
+    x86_avx512_mask_cmp_ps_512,
+    x86_avx512_mask_cmp_sd,
+    x86_avx512_mask_cmp_ss,
+    x86_avx512_mask_compress_b_128,
+    x86_avx512_mask_compress_b_256,
+    x86_avx512_mask_compress_b_512,
+    x86_avx512_mask_compress_d_128,
+    x86_avx512_mask_compress_d_256,
+    x86_avx512_mask_compress_d_512,
+    x86_avx512_mask_compress_pd_128,
+    x86_avx512_mask_compress_pd_256,
+    x86_avx512_mask_compress_pd_512,
+    x86_avx512_mask_compress_ps_128,
+    x86_avx512_mask_compress_ps_256,
+    x86_avx512_mask_compress_ps_512,
+    x86_avx512_mask_compress_q_128,
+    x86_avx512_mask_compress_q_256,
+    x86_avx512_mask_compress_q_512,
+    x86_avx512_mask_compress_store_b_128,
+    x86_avx512_mask_compress_store_b_256,
+    x86_avx512_mask_compress_store_b_512,
+    x86_avx512_mask_compress_store_d_128,
+    x86_avx512_mask_compress_store_d_256,
+    x86_avx512_mask_compress_store_d_512,
+    x86_avx512_mask_compress_store_pd_128,
+    x86_avx512_mask_compress_store_pd_256,
+    x86_avx512_mask_compress_store_pd_512,
+    x86_avx512_mask_compress_store_ps_128,
+    x86_avx512_mask_compress_store_ps_256,
+    x86_avx512_mask_compress_store_ps_512,
+    x86_avx512_mask_compress_store_q_128,
+    x86_avx512_mask_compress_store_q_256,
+    x86_avx512_mask_compress_store_q_512,
+    x86_avx512_mask_compress_store_w_128,
+    x86_avx512_mask_compress_store_w_256,
+    x86_avx512_mask_compress_store_w_512,
+    x86_avx512_mask_compress_w_128,
+    x86_avx512_mask_compress_w_256,
+    x86_avx512_mask_compress_w_512,
+    x86_avx512_mask_conflict_d_128,
+    x86_avx512_mask_conflict_d_256,
+    x86_avx512_mask_conflict_d_512,
+    x86_avx512_mask_conflict_q_128,
+    x86_avx512_mask_conflict_q_256,
+    x86_avx512_mask_conflict_q_512,
+    x86_avx512_mask_cvtdq2ps_128,
+    x86_avx512_mask_cvtdq2ps_256,
+    x86_avx512_mask_cvtdq2ps_512,
+    x86_avx512_mask_cvtpd2dq_128,
+    x86_avx512_mask_cvtpd2dq_256,
+    x86_avx512_mask_cvtpd2dq_512,
+    x86_avx512_mask_cvtpd2ps,
+    x86_avx512_mask_cvtpd2ps_256,
+    x86_avx512_mask_cvtpd2ps_512,
+    x86_avx512_mask_cvtpd2qq_128,
+    x86_avx512_mask_cvtpd2qq_256,
+    x86_avx512_mask_cvtpd2qq_512,
+    x86_avx512_mask_cvtpd2udq_128,
+    x86_avx512_mask_cvtpd2udq_256,
+    x86_avx512_mask_cvtpd2udq_512,
+    x86_avx512_mask_cvtpd2uqq_128,
+    x86_avx512_mask_cvtpd2uqq_256,
+    x86_avx512_mask_cvtpd2uqq_512,
+    x86_avx512_mask_cvtps2dq_128,
+    x86_avx512_mask_cvtps2dq_256,
+    x86_avx512_mask_cvtps2dq_512,
+    x86_avx512_mask_cvtps2pd_128,
+    x86_avx512_mask_cvtps2pd_256,
+    x86_avx512_mask_cvtps2pd_512,
+    x86_avx512_mask_cvtps2qq_128,
+    x86_avx512_mask_cvtps2qq_256,
+    x86_avx512_mask_cvtps2qq_512,
+    x86_avx512_mask_cvtps2udq_128,
+    x86_avx512_mask_cvtps2udq_256,
+    x86_avx512_mask_cvtps2udq_512,
+    x86_avx512_mask_cvtps2uqq_128,
+    x86_avx512_mask_cvtps2uqq_256,
+    x86_avx512_mask_cvtps2uqq_512,
+    x86_avx512_mask_cvtqq2pd_128,
+    x86_avx512_mask_cvtqq2pd_256,
+    x86_avx512_mask_cvtqq2pd_512,
+    x86_avx512_mask_cvtqq2ps_128,
+    x86_avx512_mask_cvtqq2ps_256,
+    x86_avx512_mask_cvtqq2ps_512,
+    x86_avx512_mask_cvtsd2ss_round,
+    x86_avx512_mask_cvtss2sd_round,
+    x86_avx512_mask_cvttpd2dq_128,
+    x86_avx512_mask_cvttpd2dq_256,
+    x86_avx512_mask_cvttpd2dq_512,
+    x86_avx512_mask_cvttpd2qq_128,
+    x86_avx512_mask_cvttpd2qq_256,
+    x86_avx512_mask_cvttpd2qq_512,
+    x86_avx512_mask_cvttpd2udq_128,
+    x86_avx512_mask_cvttpd2udq_256,
+    x86_avx512_mask_cvttpd2udq_512,
+    x86_avx512_mask_cvttpd2uqq_128,
+    x86_avx512_mask_cvttpd2uqq_256,
+    x86_avx512_mask_cvttpd2uqq_512,
+    x86_avx512_mask_cvttps2dq_128,
+    x86_avx512_mask_cvttps2dq_256,
+    x86_avx512_mask_cvttps2dq_512,
+    x86_avx512_mask_cvttps2qq_128,
+    x86_avx512_mask_cvttps2qq_256,
+    x86_avx512_mask_cvttps2qq_512,
+    x86_avx512_mask_cvttps2udq_128,
+    x86_avx512_mask_cvttps2udq_256,
+    x86_avx512_mask_cvttps2udq_512,
+    x86_avx512_mask_cvttps2uqq_128,
+    x86_avx512_mask_cvttps2uqq_256,
+    x86_avx512_mask_cvttps2uqq_512,
+    x86_avx512_mask_cvtudq2ps_128,
+    x86_avx512_mask_cvtudq2ps_256,
+    x86_avx512_mask_cvtudq2ps_512,
+    x86_avx512_mask_cvtuqq2pd_128,
+    x86_avx512_mask_cvtuqq2pd_256,
+    x86_avx512_mask_cvtuqq2pd_512,
+    x86_avx512_mask_cvtuqq2ps_128,
+    x86_avx512_mask_cvtuqq2ps_256,
+    x86_avx512_mask_cvtuqq2ps_512,
+    x86_avx512_mask_dbpsadbw_128,
+    x86_avx512_mask_dbpsadbw_256,
+    x86_avx512_mask_dbpsadbw_512,
+    x86_avx512_mask_div_pd_512,
+    x86_avx512_mask_div_ps_512,
+    x86_avx512_mask_div_sd_round,
+    x86_avx512_mask_div_ss_round,
+    x86_avx512_mask_expand_b_128,
+    x86_avx512_mask_expand_b_256,
+    x86_avx512_mask_expand_b_512,
+    x86_avx512_mask_expand_d_128,
+    x86_avx512_mask_expand_d_256,
+    x86_avx512_mask_expand_d_512,
+    x86_avx512_mask_expand_load_b_128,
+    x86_avx512_mask_expand_load_b_256,
+    x86_avx512_mask_expand_load_b_512,
+    x86_avx512_mask_expand_load_d_128,
+    x86_avx512_mask_expand_load_d_256,
+    x86_avx512_mask_expand_load_d_512,
+    x86_avx512_mask_expand_load_pd_128,
+    x86_avx512_mask_expand_load_pd_256,
+    x86_avx512_mask_expand_load_pd_512,
+    x86_avx512_mask_expand_load_ps_128,
+    x86_avx512_mask_expand_load_ps_256,
+    x86_avx512_mask_expand_load_ps_512,
+    x86_avx512_mask_expand_load_q_128,
+    x86_avx512_mask_expand_load_q_256,
+    x86_avx512_mask_expand_load_q_512,
+    x86_avx512_mask_expand_load_w_128,
+    x86_avx512_mask_expand_load_w_256,
+    x86_avx512_mask_expand_load_w_512,
+    x86_avx512_mask_expand_pd_128,
+    x86_avx512_mask_expand_pd_256,
+    x86_avx512_mask_expand_pd_512,
+    x86_avx512_mask_expand_ps_128,
+    x86_avx512_mask_expand_ps_256,
+    x86_avx512_mask_expand_ps_512,
+    x86_avx512_mask_expand_q_128,
+    x86_avx512_mask_expand_q_256,
+    x86_avx512_mask_expand_q_512,
+    x86_avx512_mask_expand_w_128,
+    x86_avx512_mask_expand_w_256,
+    x86_avx512_mask_expand_w_512,
+    x86_avx512_mask_fixupimm_pd_128,
+    x86_avx512_mask_fixupimm_pd_256,
+    x86_avx512_mask_fixupimm_pd_512,
+    x86_avx512_mask_fixupimm_ps_128,
+    x86_avx512_mask_fixupimm_ps_256,
+    x86_avx512_mask_fixupimm_ps_512,
+    x86_avx512_mask_fixupimm_sd,
+    x86_avx512_mask_fixupimm_ss,
+    x86_avx512_mask_fpclass_pd_128,
+    x86_avx512_mask_fpclass_pd_256,
+    x86_avx512_mask_fpclass_pd_512,
+    x86_avx512_mask_fpclass_ps_128,
+    x86_avx512_mask_fpclass_ps_256,
+    x86_avx512_mask_fpclass_ps_512,
+    x86_avx512_mask_fpclass_sd,
+    x86_avx512_mask_fpclass_ss,
+    x86_avx512_mask_getexp_pd_128,
+    x86_avx512_mask_getexp_pd_256,
+    x86_avx512_mask_getexp_pd_512,
+    x86_avx512_mask_getexp_ps_128,
+    x86_avx512_mask_getexp_ps_256,
+    x86_avx512_mask_getexp_ps_512,
+    x86_avx512_mask_getexp_sd,
+    x86_avx512_mask_getexp_ss,
+    x86_avx512_mask_getmant_pd_128,
+    x86_avx512_mask_getmant_pd_256,
+    x86_avx512_mask_getmant_pd_512,
+    x86_avx512_mask_getmant_ps_128,
+    x86_avx512_mask_getmant_ps_256,
+    x86_avx512_mask_getmant_ps_512,
+    x86_avx512_mask_getmant_sd,
+    x86_avx512_mask_getmant_ss,
+    x86_avx512_mask_max_pd_512,
+    x86_avx512_mask_max_ps_512,
+    x86_avx512_mask_max_sd_round,
+    x86_avx512_mask_max_ss_round,
+    x86_avx512_mask_min_pd_512,
+    x86_avx512_mask_min_ps_512,
+    x86_avx512_mask_min_sd_round,
+    x86_avx512_mask_min_ss_round,
+    x86_avx512_mask_mul_pd_512,
+    x86_avx512_mask_mul_ps_512,
+    x86_avx512_mask_mul_sd_round,
+    x86_avx512_mask_mul_ss_round,
+    x86_avx512_mask_padds_b_128,
+    x86_avx512_mask_padds_b_256,
+    x86_avx512_mask_padds_b_512,
+    x86_avx512_mask_padds_w_128,
+    x86_avx512_mask_padds_w_256,
+    x86_avx512_mask_padds_w_512,
+    x86_avx512_mask_paddus_b_128,
+    x86_avx512_mask_paddus_b_256,
+    x86_avx512_mask_paddus_b_512,
+    x86_avx512_mask_paddus_w_128,
+    x86_avx512_mask_paddus_w_256,
+    x86_avx512_mask_paddus_w_512,
+    x86_avx512_mask_permvar_df_256,
+    x86_avx512_mask_permvar_df_512,
+    x86_avx512_mask_permvar_di_256,
+    x86_avx512_mask_permvar_di_512,
+    x86_avx512_mask_permvar_hi_128,
+    x86_avx512_mask_permvar_hi_256,
+    x86_avx512_mask_permvar_hi_512,
+    x86_avx512_mask_permvar_qi_128,
+    x86_avx512_mask_permvar_qi_256,
+    x86_avx512_mask_permvar_qi_512,
+    x86_avx512_mask_permvar_sf_256,
+    x86_avx512_mask_permvar_sf_512,
+    x86_avx512_mask_permvar_si_256,
+    x86_avx512_mask_permvar_si_512,
+    x86_avx512_mask_pmaddubs_w_128,
+    x86_avx512_mask_pmaddubs_w_256,
+    x86_avx512_mask_pmaddubs_w_512,
+    x86_avx512_mask_pmaddw_d_128,
+    x86_avx512_mask_pmaddw_d_256,
+    x86_avx512_mask_pmaddw_d_512,
+    x86_avx512_mask_pmov_db_128,
+    x86_avx512_mask_pmov_db_256,
+    x86_avx512_mask_pmov_db_512,
+    x86_avx512_mask_pmov_db_mem_128,
+    x86_avx512_mask_pmov_db_mem_256,
+    x86_avx512_mask_pmov_db_mem_512,
+    x86_avx512_mask_pmov_dw_128,
+    x86_avx512_mask_pmov_dw_256,
+    x86_avx512_mask_pmov_dw_512,
+    x86_avx512_mask_pmov_dw_mem_128,
+    x86_avx512_mask_pmov_dw_mem_256,
+    x86_avx512_mask_pmov_dw_mem_512,
+    x86_avx512_mask_pmov_qb_128,
+    x86_avx512_mask_pmov_qb_256,
+    x86_avx512_mask_pmov_qb_512,
+    x86_avx512_mask_pmov_qb_mem_128,
+    x86_avx512_mask_pmov_qb_mem_256,
+    x86_avx512_mask_pmov_qb_mem_512,
+    x86_avx512_mask_pmov_qd_128,
+    x86_avx512_mask_pmov_qd_256,
+    x86_avx512_mask_pmov_qd_512,
+    x86_avx512_mask_pmov_qd_mem_128,
+    x86_avx512_mask_pmov_qd_mem_256,
+    x86_avx512_mask_pmov_qd_mem_512,
+    x86_avx512_mask_pmov_qw_128,
+    x86_avx512_mask_pmov_qw_256,
+    x86_avx512_mask_pmov_qw_512,
+    x86_avx512_mask_pmov_qw_mem_128,
+    x86_avx512_mask_pmov_qw_mem_256,
+    x86_avx512_mask_pmov_qw_mem_512,
+    x86_avx512_mask_pmov_wb_128,
+    x86_avx512_mask_pmov_wb_256,
+    x86_avx512_mask_pmov_wb_512,
+    x86_avx512_mask_pmov_wb_mem_128,
+    x86_avx512_mask_pmov_wb_mem_256,
+    x86_avx512_mask_pmov_wb_mem_512,
+    x86_avx512_mask_pmovs_db_128,
+    x86_avx512_mask_pmovs_db_256,
+    x86_avx512_mask_pmovs_db_512,
+    x86_avx512_mask_pmovs_db_mem_128,
+    x86_avx512_mask_pmovs_db_mem_256,
+    x86_avx512_mask_pmovs_db_mem_512,
+    x86_avx512_mask_pmovs_dw_128,
+    x86_avx512_mask_pmovs_dw_256,
+    x86_avx512_mask_pmovs_dw_512,
+    x86_avx512_mask_pmovs_dw_mem_128,
+    x86_avx512_mask_pmovs_dw_mem_256,
+    x86_avx512_mask_pmovs_dw_mem_512,
+    x86_avx512_mask_pmovs_qb_128,
+    x86_avx512_mask_pmovs_qb_256,
+    x86_avx512_mask_pmovs_qb_512,
+    x86_avx512_mask_pmovs_qb_mem_128,
+    x86_avx512_mask_pmovs_qb_mem_256,
+    x86_avx512_mask_pmovs_qb_mem_512,
+    x86_avx512_mask_pmovs_qd_128,
+    x86_avx512_mask_pmovs_qd_256,
+    x86_avx512_mask_pmovs_qd_512,
+    x86_avx512_mask_pmovs_qd_mem_128,
+    x86_avx512_mask_pmovs_qd_mem_256,
+    x86_avx512_mask_pmovs_qd_mem_512,
+    x86_avx512_mask_pmovs_qw_128,
+    x86_avx512_mask_pmovs_qw_256,
+    x86_avx512_mask_pmovs_qw_512,
+    x86_avx512_mask_pmovs_qw_mem_128,
+    x86_avx512_mask_pmovs_qw_mem_256,
+    x86_avx512_mask_pmovs_qw_mem_512,
+    x86_avx512_mask_pmovs_wb_128,
+    x86_avx512_mask_pmovs_wb_256,
+    x86_avx512_mask_pmovs_wb_512,
+    x86_avx512_mask_pmovs_wb_mem_128,
+    x86_avx512_mask_pmovs_wb_mem_256,
+    x86_avx512_mask_pmovs_wb_mem_512,
+    x86_avx512_mask_pmovus_db_128,
+    x86_avx512_mask_pmovus_db_256,
+    x86_avx512_mask_pmovus_db_512,
+    x86_avx512_mask_pmovus_db_mem_128,
+    x86_avx512_mask_pmovus_db_mem_256,
+    x86_avx512_mask_pmovus_db_mem_512,
+    x86_avx512_mask_pmovus_dw_128,
+    x86_avx512_mask_pmovus_dw_256,
+    x86_avx512_mask_pmovus_dw_512,
+    x86_avx512_mask_pmovus_dw_mem_128,
+    x86_avx512_mask_pmovus_dw_mem_256,
+    x86_avx512_mask_pmovus_dw_mem_512,
+    x86_avx512_mask_pmovus_qb_128,
+    x86_avx512_mask_pmovus_qb_256,
+    x86_avx512_mask_pmovus_qb_512,
+    x86_avx512_mask_pmovus_qb_mem_128,
+    x86_avx512_mask_pmovus_qb_mem_256,
+    x86_avx512_mask_pmovus_qb_mem_512,
+    x86_avx512_mask_pmovus_qd_128,
+    x86_avx512_mask_pmovus_qd_256,
+    x86_avx512_mask_pmovus_qd_512,
+    x86_avx512_mask_pmovus_qd_mem_128,
+    x86_avx512_mask_pmovus_qd_mem_256,
+    x86_avx512_mask_pmovus_qd_mem_512,
+    x86_avx512_mask_pmovus_qw_128,
+    x86_avx512_mask_pmovus_qw_256,
+    x86_avx512_mask_pmovus_qw_512,
+    x86_avx512_mask_pmovus_qw_mem_128,
+    x86_avx512_mask_pmovus_qw_mem_256,
+    x86_avx512_mask_pmovus_qw_mem_512,
+    x86_avx512_mask_pmovus_wb_128,
+    x86_avx512_mask_pmovus_wb_256,
+    x86_avx512_mask_pmovus_wb_512,
+    x86_avx512_mask_pmovus_wb_mem_128,
+    x86_avx512_mask_pmovus_wb_mem_256,
+    x86_avx512_mask_pmovus_wb_mem_512,
+    x86_avx512_mask_pmul_hr_sw_128,
+    x86_avx512_mask_pmul_hr_sw_256,
+    x86_avx512_mask_pmul_hr_sw_512,
+    x86_avx512_mask_pmulh_w_128,
+    x86_avx512_mask_pmulh_w_256,
+    x86_avx512_mask_pmulh_w_512,
+    x86_avx512_mask_pmulhu_w_128,
+    x86_avx512_mask_pmulhu_w_256,
+    x86_avx512_mask_pmulhu_w_512,
+    x86_avx512_mask_pmultishift_qb_128,
+    x86_avx512_mask_pmultishift_qb_256,
+    x86_avx512_mask_pmultishift_qb_512,
+    x86_avx512_mask_prol_d_128,
+    x86_avx512_mask_prol_d_256,
+    x86_avx512_mask_prol_d_512,
+    x86_avx512_mask_prol_q_128,
+    x86_avx512_mask_prol_q_256,
+    x86_avx512_mask_prol_q_512,
+    x86_avx512_mask_prolv_d_128,
+    x86_avx512_mask_prolv_d_256,
+    x86_avx512_mask_prolv_d_512,
+    x86_avx512_mask_prolv_q_128,
+    x86_avx512_mask_prolv_q_256,
+    x86_avx512_mask_prolv_q_512,
+    x86_avx512_mask_pror_d_128,
+    x86_avx512_mask_pror_d_256,
+    x86_avx512_mask_pror_d_512,
+    x86_avx512_mask_pror_q_128,
+    x86_avx512_mask_pror_q_256,
+    x86_avx512_mask_pror_q_512,
+    x86_avx512_mask_prorv_d_128,
+    x86_avx512_mask_prorv_d_256,
+    x86_avx512_mask_prorv_d_512,
+    x86_avx512_mask_prorv_q_128,
+    x86_avx512_mask_prorv_q_256,
+    x86_avx512_mask_prorv_q_512,
+    x86_avx512_mask_psubs_b_128,
+    x86_avx512_mask_psubs_b_256,
+    x86_avx512_mask_psubs_b_512,
+    x86_avx512_mask_psubs_w_128,
+    x86_avx512_mask_psubs_w_256,
+    x86_avx512_mask_psubs_w_512,
+    x86_avx512_mask_psubus_b_128,
+    x86_avx512_mask_psubus_b_256,
+    x86_avx512_mask_psubus_b_512,
+    x86_avx512_mask_psubus_w_128,
+    x86_avx512_mask_psubus_w_256,
+    x86_avx512_mask_psubus_w_512,
+    x86_avx512_mask_pternlog_d_128,
+    x86_avx512_mask_pternlog_d_256,
+    x86_avx512_mask_pternlog_d_512,
+    x86_avx512_mask_pternlog_q_128,
+    x86_avx512_mask_pternlog_q_256,
+    x86_avx512_mask_pternlog_q_512,
+    x86_avx512_mask_range_pd_128,
+    x86_avx512_mask_range_pd_256,
+    x86_avx512_mask_range_pd_512,
+    x86_avx512_mask_range_ps_128,
+    x86_avx512_mask_range_ps_256,
+    x86_avx512_mask_range_ps_512,
+    x86_avx512_mask_range_sd,
+    x86_avx512_mask_range_ss,
+    x86_avx512_mask_reduce_pd_128,
+    x86_avx512_mask_reduce_pd_256,
+    x86_avx512_mask_reduce_pd_512,
+    x86_avx512_mask_reduce_ps_128,
+    x86_avx512_mask_reduce_ps_256,
+    x86_avx512_mask_reduce_ps_512,
+    x86_avx512_mask_reduce_sd,
+    x86_avx512_mask_reduce_ss,
+    x86_avx512_mask_rndscale_pd_128,
+    x86_avx512_mask_rndscale_pd_256,
+    x86_avx512_mask_rndscale_pd_512,
+    x86_avx512_mask_rndscale_ps_128,
+    x86_avx512_mask_rndscale_ps_256,
+    x86_avx512_mask_rndscale_ps_512,
+    x86_avx512_mask_rndscale_sd,
+    x86_avx512_mask_rndscale_ss,
+    x86_avx512_mask_scalef_pd_128,
+    x86_avx512_mask_scalef_pd_256,
+    x86_avx512_mask_scalef_pd_512,
+    x86_avx512_mask_scalef_ps_128,
+    x86_avx512_mask_scalef_ps_256,
+    x86_avx512_mask_scalef_ps_512,
+    x86_avx512_mask_scalef_sd,
+    x86_avx512_mask_scalef_ss,
+    x86_avx512_mask_sqrt_pd_128,
+    x86_avx512_mask_sqrt_pd_256,
+    x86_avx512_mask_sqrt_pd_512,
+    x86_avx512_mask_sqrt_ps_128,
+    x86_avx512_mask_sqrt_ps_256,
+    x86_avx512_mask_sqrt_ps_512,
+    x86_avx512_mask_sqrt_sd,
+    x86_avx512_mask_sqrt_ss,
+    x86_avx512_mask_store_ss,
+    x86_avx512_mask_sub_pd_512,
+    x86_avx512_mask_sub_ps_512,
+    x86_avx512_mask_sub_sd_round,
+    x86_avx512_mask_sub_ss_round,
+    x86_avx512_mask_vcvtph2ps_128,
+    x86_avx512_mask_vcvtph2ps_256,
+    x86_avx512_mask_vcvtph2ps_512,
+    x86_avx512_mask_vcvtps2ph_128,
+    x86_avx512_mask_vcvtps2ph_256,
+    x86_avx512_mask_vcvtps2ph_512,
+    x86_avx512_mask_vfmadd_pd_128,
+    x86_avx512_mask_vfmadd_pd_256,
+    x86_avx512_mask_vfmadd_pd_512,
+    x86_avx512_mask_vfmadd_ps_128,
+    x86_avx512_mask_vfmadd_ps_256,
+    x86_avx512_mask_vfmadd_ps_512,
+    x86_avx512_mask_vfmadd_sd,
+    x86_avx512_mask_vfmadd_ss,
+    x86_avx512_mask_vfmaddsub_pd_128,
+    x86_avx512_mask_vfmaddsub_pd_256,
+    x86_avx512_mask_vfmaddsub_pd_512,
+    x86_avx512_mask_vfmaddsub_ps_128,
+    x86_avx512_mask_vfmaddsub_ps_256,
+    x86_avx512_mask_vfmaddsub_ps_512,
+    x86_avx512_mask_vfnmadd_pd_128,
+    x86_avx512_mask_vfnmadd_pd_256,
+    x86_avx512_mask_vfnmadd_pd_512,
+    x86_avx512_mask_vfnmadd_ps_128,
+    x86_avx512_mask_vfnmadd_ps_256,
+    x86_avx512_mask_vfnmadd_ps_512,
+    x86_avx512_mask_vfnmsub_pd_128,
+    x86_avx512_mask_vfnmsub_pd_256,
+    x86_avx512_mask_vfnmsub_pd_512,
+    x86_avx512_mask_vfnmsub_ps_128,
+    x86_avx512_mask_vfnmsub_ps_256,
+    x86_avx512_mask_vfnmsub_ps_512,
+    x86_avx512_mask_vpdpbusd_128,
+    x86_avx512_mask_vpdpbusd_256,
+    x86_avx512_mask_vpdpbusd_512,
+    x86_avx512_mask_vpdpbusds_128,
+    x86_avx512_mask_vpdpbusds_256,
+    x86_avx512_mask_vpdpbusds_512,
+    x86_avx512_mask_vpdpwssd_128,
+    x86_avx512_mask_vpdpwssd_256,
+    x86_avx512_mask_vpdpwssd_512,
+    x86_avx512_mask_vpdpwssds_128,
+    x86_avx512_mask_vpdpwssds_256,
+    x86_avx512_mask_vpdpwssds_512,
+    x86_avx512_mask_vpermi2var_d_128,
+    x86_avx512_mask_vpermi2var_d_256,
+    x86_avx512_mask_vpermi2var_d_512,
+    x86_avx512_mask_vpermi2var_hi_128,
+    x86_avx512_mask_vpermi2var_hi_256,
+    x86_avx512_mask_vpermi2var_hi_512,
+    x86_avx512_mask_vpermi2var_pd_128,
+    x86_avx512_mask_vpermi2var_pd_256,
+    x86_avx512_mask_vpermi2var_pd_512,
+    x86_avx512_mask_vpermi2var_ps_128,
+    x86_avx512_mask_vpermi2var_ps_256,
+    x86_avx512_mask_vpermi2var_ps_512,
+    x86_avx512_mask_vpermi2var_q_128,
+    x86_avx512_mask_vpermi2var_q_256,
+    x86_avx512_mask_vpermi2var_q_512,
+    x86_avx512_mask_vpermi2var_qi_128,
+    x86_avx512_mask_vpermi2var_qi_256,
+    x86_avx512_mask_vpermi2var_qi_512,
+    x86_avx512_mask_vpermt2var_d_128,
+    x86_avx512_mask_vpermt2var_d_256,
+    x86_avx512_mask_vpermt2var_d_512,
+    x86_avx512_mask_vpermt2var_hi_128,
+    x86_avx512_mask_vpermt2var_hi_256,
+    x86_avx512_mask_vpermt2var_hi_512,
+    x86_avx512_mask_vpermt2var_pd_128,
+    x86_avx512_mask_vpermt2var_pd_256,
+    x86_avx512_mask_vpermt2var_pd_512,
+    x86_avx512_mask_vpermt2var_ps_128,
+    x86_avx512_mask_vpermt2var_ps_256,
+    x86_avx512_mask_vpermt2var_ps_512,
+    x86_avx512_mask_vpermt2var_q_128,
+    x86_avx512_mask_vpermt2var_q_256,
+    x86_avx512_mask_vpermt2var_q_512,
+    x86_avx512_mask_vpermt2var_qi_128,
+    x86_avx512_mask_vpermt2var_qi_256,
+    x86_avx512_mask_vpermt2var_qi_512,
+    x86_avx512_mask_vpmadd52h_uq_128,
+    x86_avx512_mask_vpmadd52h_uq_256,
+    x86_avx512_mask_vpmadd52h_uq_512,
+    x86_avx512_mask_vpmadd52l_uq_128,
+    x86_avx512_mask_vpmadd52l_uq_256,
+    x86_avx512_mask_vpmadd52l_uq_512,
+    x86_avx512_mask_vpshld_d_128,
+    x86_avx512_mask_vpshld_d_256,
+    x86_avx512_mask_vpshld_d_512,
+    x86_avx512_mask_vpshld_q_128,
+    x86_avx512_mask_vpshld_q_256,
+    x86_avx512_mask_vpshld_q_512,
+    x86_avx512_mask_vpshld_w_128,
+    x86_avx512_mask_vpshld_w_256,
+    x86_avx512_mask_vpshld_w_512,
+    x86_avx512_mask_vpshldv_d_128,
+    x86_avx512_mask_vpshldv_d_256,
+    x86_avx512_mask_vpshldv_d_512,
+    x86_avx512_mask_vpshldv_q_128,
+    x86_avx512_mask_vpshldv_q_256,
+    x86_avx512_mask_vpshldv_q_512,
+    x86_avx512_mask_vpshldv_w_128,
+    x86_avx512_mask_vpshldv_w_256,
+    x86_avx512_mask_vpshldv_w_512,
+    x86_avx512_mask_vpshrd_d_128,
+    x86_avx512_mask_vpshrd_d_256,
+    x86_avx512_mask_vpshrd_d_512,
+    x86_avx512_mask_vpshrd_q_128,
+    x86_avx512_mask_vpshrd_q_256,
+    x86_avx512_mask_vpshrd_q_512,
+    x86_avx512_mask_vpshrd_w_128,
+    x86_avx512_mask_vpshrd_w_256,
+    x86_avx512_mask_vpshrd_w_512,
+    x86_avx512_mask_vpshrdv_d_128,
+    x86_avx512_mask_vpshrdv_d_256,
+    x86_avx512_mask_vpshrdv_d_512,
+    x86_avx512_mask_vpshrdv_q_128,
+    x86_avx512_mask_vpshrdv_q_256,
+    x86_avx512_mask_vpshrdv_q_512,
+    x86_avx512_mask_vpshrdv_w_128,
+    x86_avx512_mask_vpshrdv_w_256,
+    x86_avx512_mask_vpshrdv_w_512,
+    x86_avx512_mask_vpshufbitqmb_128,
+    x86_avx512_mask_vpshufbitqmb_256,
+    x86_avx512_mask_vpshufbitqmb_512,
+    x86_avx512_mask3_vfmadd_pd_128,
+    x86_avx512_mask3_vfmadd_pd_256,
+    x86_avx512_mask3_vfmadd_pd_512,
+    x86_avx512_mask3_vfmadd_ps_128,
+    x86_avx512_mask3_vfmadd_ps_256,
+    x86_avx512_mask3_vfmadd_ps_512,
+    x86_avx512_mask3_vfmadd_sd,
+    x86_avx512_mask3_vfmadd_ss,
+    x86_avx512_mask3_vfmaddsub_pd_128,
+    x86_avx512_mask3_vfmaddsub_pd_256,
+    x86_avx512_mask3_vfmaddsub_pd_512,
+    x86_avx512_mask3_vfmaddsub_ps_128,
+    x86_avx512_mask3_vfmaddsub_ps_256,
+    x86_avx512_mask3_vfmaddsub_ps_512,
+    x86_avx512_mask3_vfmsub_pd_128,
+    x86_avx512_mask3_vfmsub_pd_256,
+    x86_avx512_mask3_vfmsub_pd_512,
+    x86_avx512_mask3_vfmsub_ps_128,
+    x86_avx512_mask3_vfmsub_ps_256,
+    x86_avx512_mask3_vfmsub_ps_512,
+    x86_avx512_mask3_vfmsub_sd,
+    x86_avx512_mask3_vfmsub_ss,
+    x86_avx512_mask3_vfmsubadd_pd_128,
+    x86_avx512_mask3_vfmsubadd_pd_256,
+    x86_avx512_mask3_vfmsubadd_pd_512,
+    x86_avx512_mask3_vfmsubadd_ps_128,
+    x86_avx512_mask3_vfmsubadd_ps_256,
+    x86_avx512_mask3_vfmsubadd_ps_512,
+    x86_avx512_mask3_vfnmsub_pd_128,
+    x86_avx512_mask3_vfnmsub_pd_256,
+    x86_avx512_mask3_vfnmsub_pd_512,
+    x86_avx512_mask3_vfnmsub_ps_128,
+    x86_avx512_mask3_vfnmsub_ps_256,
+    x86_avx512_mask3_vfnmsub_ps_512,
+    x86_avx512_mask3_vfnmsub_sd,
+    x86_avx512_mask3_vfnmsub_ss,
+    x86_avx512_maskz_fixupimm_pd_128,
+    x86_avx512_maskz_fixupimm_pd_256,
+    x86_avx512_maskz_fixupimm_pd_512,
+    x86_avx512_maskz_fixupimm_ps_128,
+    x86_avx512_maskz_fixupimm_ps_256,
+    x86_avx512_maskz_fixupimm_ps_512,
+    x86_avx512_maskz_fixupimm_sd,
+    x86_avx512_maskz_fixupimm_ss,
+    x86_avx512_maskz_pternlog_d_128,
+    x86_avx512_maskz_pternlog_d_256,
+    x86_avx512_maskz_pternlog_d_512,
+    x86_avx512_maskz_pternlog_q_128,
+    x86_avx512_maskz_pternlog_q_256,
+    x86_avx512_maskz_pternlog_q_512,
+    x86_avx512_maskz_vfmadd_pd_128,
+    x86_avx512_maskz_vfmadd_pd_256,
+    x86_avx512_maskz_vfmadd_pd_512,
+    x86_avx512_maskz_vfmadd_ps_128,
+    x86_avx512_maskz_vfmadd_ps_256,
+    x86_avx512_maskz_vfmadd_ps_512,
+    x86_avx512_maskz_vfmadd_sd,
+    x86_avx512_maskz_vfmadd_ss,
+    x86_avx512_maskz_vfmaddsub_pd_128,
+    x86_avx512_maskz_vfmaddsub_pd_256,
+    x86_avx512_maskz_vfmaddsub_pd_512,
+    x86_avx512_maskz_vfmaddsub_ps_128,
+    x86_avx512_maskz_vfmaddsub_ps_256,
+    x86_avx512_maskz_vfmaddsub_ps_512,
+    x86_avx512_maskz_vpdpbusd_128,
+    x86_avx512_maskz_vpdpbusd_256,
+    x86_avx512_maskz_vpdpbusd_512,
+    x86_avx512_maskz_vpdpbusds_128,
+    x86_avx512_maskz_vpdpbusds_256,
+    x86_avx512_maskz_vpdpbusds_512,
+    x86_avx512_maskz_vpdpwssd_128,
+    x86_avx512_maskz_vpdpwssd_256,
+    x86_avx512_maskz_vpdpwssd_512,
+    x86_avx512_maskz_vpdpwssds_128,
+    x86_avx512_maskz_vpdpwssds_256,
+    x86_avx512_maskz_vpdpwssds_512,
+    x86_avx512_maskz_vpermt2var_d_128,
+    x86_avx512_maskz_vpermt2var_d_256,
+    x86_avx512_maskz_vpermt2var_d_512,
+    x86_avx512_maskz_vpermt2var_hi_128,
+    x86_avx512_maskz_vpermt2var_hi_256,
+    x86_avx512_maskz_vpermt2var_hi_512,
+    x86_avx512_maskz_vpermt2var_pd_128,
+    x86_avx512_maskz_vpermt2var_pd_256,
+    x86_avx512_maskz_vpermt2var_pd_512,
+    x86_avx512_maskz_vpermt2var_ps_128,
+    x86_avx512_maskz_vpermt2var_ps_256,
+    x86_avx512_maskz_vpermt2var_ps_512,
+    x86_avx512_maskz_vpermt2var_q_128,
+    x86_avx512_maskz_vpermt2var_q_256,
+    x86_avx512_maskz_vpermt2var_q_512,
+    x86_avx512_maskz_vpermt2var_qi_128,
+    x86_avx512_maskz_vpermt2var_qi_256,
+    x86_avx512_maskz_vpermt2var_qi_512,
+    x86_avx512_maskz_vpmadd52h_uq_128,
+    x86_avx512_maskz_vpmadd52h_uq_256,
+    x86_avx512_maskz_vpmadd52h_uq_512,
+    x86_avx512_maskz_vpmadd52l_uq_128,
+    x86_avx512_maskz_vpmadd52l_uq_256,
+    x86_avx512_maskz_vpmadd52l_uq_512,
+    x86_avx512_maskz_vpshldv_d_128,
+    x86_avx512_maskz_vpshldv_d_256,
+    x86_avx512_maskz_vpshldv_d_512,
+    x86_avx512_maskz_vpshldv_q_128,
+    x86_avx512_maskz_vpshldv_q_256,
+    x86_avx512_maskz_vpshldv_q_512,
+    x86_avx512_maskz_vpshldv_w_128,
+    x86_avx512_maskz_vpshldv_w_256,
+    x86_avx512_maskz_vpshldv_w_512,
+    x86_avx512_maskz_vpshrdv_d_128,
+    x86_avx512_maskz_vpshrdv_d_256,
+    x86_avx512_maskz_vpshrdv_d_512,
+    x86_avx512_maskz_vpshrdv_q_128,
+    x86_avx512_maskz_vpshrdv_q_256,
+    x86_avx512_maskz_vpshrdv_q_512,
+    x86_avx512_maskz_vpshrdv_w_128,
+    x86_avx512_maskz_vpshrdv_w_256,
+    x86_avx512_maskz_vpshrdv_w_512,
+    x86_avx512_packssdw_512,
+    x86_avx512_packsswb_512,
+    x86_avx512_packusdw_512,
+    x86_avx512_packuswb_512,
+    x86_avx512_pmul_dq_512,
+    x86_avx512_pmulu_dq_512,
+    x86_avx512_psad_bw_512,
+    x86_avx512_pshuf_b_512,
+    x86_avx512_psll_d_512,
+    x86_avx512_psll_q_512,
+    x86_avx512_psll_w_512,
+    x86_avx512_pslli_d_512,
+    x86_avx512_pslli_q_512,
+    x86_avx512_pslli_w_512,
+    x86_avx512_psllv_d_512,
+    x86_avx512_psllv_q_512,
+    x86_avx512_psllv_w_128,
+    x86_avx512_psllv_w_256,
+    x86_avx512_psllv_w_512,
+    x86_avx512_psra_d_512,
+    x86_avx512_psra_q_128,
+    x86_avx512_psra_q_256,
+    x86_avx512_psra_q_512,
+    x86_avx512_psra_w_512,
+    x86_avx512_psrai_d_512,
+    x86_avx512_psrai_q_128,
+    x86_avx512_psrai_q_256,
+    x86_avx512_psrai_q_512,
+    x86_avx512_psrai_w_512,
+    x86_avx512_psrav_d_512,
+    x86_avx512_psrav_q_128,
+    x86_avx512_psrav_q_256,
+    x86_avx512_psrav_q_512,
+    x86_avx512_psrav_w_128,
+    x86_avx512_psrav_w_256,
+    x86_avx512_psrav_w_512,
+    x86_avx512_psrl_d_512,
+    x86_avx512_psrl_q_512,
+    x86_avx512_psrl_w_512,
+    x86_avx512_psrli_d_512,
+    x86_avx512_psrli_q_512,
+    x86_avx512_psrli_w_512,
+    x86_avx512_psrlv_d_512,
+    x86_avx512_psrlv_q_512,
+    x86_avx512_psrlv_w_128,
+    x86_avx512_psrlv_w_256,
+    x86_avx512_psrlv_w_512,
+    x86_avx512_rcp14_pd_128,
+    x86_avx512_rcp14_pd_256,
+    x86_avx512_rcp14_pd_512,
+    x86_avx512_rcp14_ps_128,
+    x86_avx512_rcp14_ps_256,
+    x86_avx512_rcp14_ps_512,
+    x86_avx512_rcp14_sd,
+    x86_avx512_rcp14_ss,
+    x86_avx512_rcp28_pd,
+    x86_avx512_rcp28_ps,
+    x86_avx512_rcp28_sd,
+    x86_avx512_rcp28_ss,
+    x86_avx512_rsqrt14_pd_128,
+    x86_avx512_rsqrt14_pd_256,
+    x86_avx512_rsqrt14_pd_512,
+    x86_avx512_rsqrt14_ps_128,
+    x86_avx512_rsqrt14_ps_256,
+    x86_avx512_rsqrt14_ps_512,
+    x86_avx512_rsqrt14_sd,
+    x86_avx512_rsqrt14_ss,
+    x86_avx512_rsqrt28_pd,
+    x86_avx512_rsqrt28_ps,
+    x86_avx512_rsqrt28_sd,
+    x86_avx512_rsqrt28_ss,
+    x86_avx512_scatter_dpd_512,
+    x86_avx512_scatter_dpi_512,
+    x86_avx512_scatter_dpq_512,
+    x86_avx512_scatter_dps_512,
+    x86_avx512_scatter_qpd_512,
+    x86_avx512_scatter_qpi_512,
+    x86_avx512_scatter_qpq_512,
+    x86_avx512_scatter_qps_512,
+    x86_avx512_scatterdiv2_df,
+    x86_avx512_scatterdiv2_di,
+    x86_avx512_scatterdiv4_df,
+    x86_avx512_scatterdiv4_di,
+    x86_avx512_scatterdiv4_sf,
+    x86_avx512_scatterdiv4_si,
+    x86_avx512_scatterdiv8_sf,
+    x86_avx512_scatterdiv8_si,
+    x86_avx512_scatterpf_dpd_512,
+    x86_avx512_scatterpf_dps_512,
+    x86_avx512_scatterpf_qpd_512,
+    x86_avx512_scatterpf_qps_512,
+    x86_avx512_scattersiv2_df,
+    x86_avx512_scattersiv2_di,
+    x86_avx512_scattersiv4_df,
+    x86_avx512_scattersiv4_di,
+    x86_avx512_scattersiv4_sf,
+    x86_avx512_scattersiv4_si,
+    x86_avx512_scattersiv8_sf,
+    x86_avx512_scattersiv8_si,
+    x86_avx512_vbroadcast_sd_512,
+    x86_avx512_vbroadcast_ss_512,
+    x86_avx512_vcomi_sd,
+    x86_avx512_vcomi_ss,
+    x86_avx512_vcvtsd2si32,
+    x86_avx512_vcvtsd2si64,
+    x86_avx512_vcvtsd2usi32,
+    x86_avx512_vcvtsd2usi64,
+    x86_avx512_vcvtss2si32,
+    x86_avx512_vcvtss2si64,
+    x86_avx512_vcvtss2usi32,
+    x86_avx512_vcvtss2usi64,
+    x86_avx512_vpermilvar_pd_512,
+    x86_avx512_vpermilvar_ps_512,
+    x86_bmi_bextr_32,
+    x86_bmi_bextr_64,
+    x86_bmi_bzhi_32,
+    x86_bmi_bzhi_64,
+    x86_bmi_pdep_32,
+    x86_bmi_pdep_64,
+    x86_bmi_pext_32,
+    x86_bmi_pext_64,
+    x86_clflushopt,
+    x86_clrssbsy,
+    x86_clwb,
+    x86_clzero,
+    x86_flags_read_u32,
+    x86_flags_read_u64,
+    x86_flags_write_u32,
+    x86_flags_write_u64,
+    x86_fma_vfmadd_pd,
+    x86_fma_vfmadd_pd_256,
+    x86_fma_vfmadd_ps,
+    x86_fma_vfmadd_ps_256,
+    x86_fma_vfmadd_sd,
+    x86_fma_vfmadd_ss,
+    x86_fma_vfmaddsub_pd,
+    x86_fma_vfmaddsub_pd_256,
+    x86_fma_vfmaddsub_ps,
+    x86_fma_vfmaddsub_ps_256,
+    x86_fma_vfmsub_pd,
+    x86_fma_vfmsub_pd_256,
+    x86_fma_vfmsub_ps,
+    x86_fma_vfmsub_ps_256,
+    x86_fma_vfmsub_sd,
+    x86_fma_vfmsub_ss,
+    x86_fma_vfmsubadd_pd,
+    x86_fma_vfmsubadd_pd_256,
+    x86_fma_vfmsubadd_ps,
+    x86_fma_vfmsubadd_ps_256,
+    x86_fma_vfnmadd_pd,
+    x86_fma_vfnmadd_pd_256,
+    x86_fma_vfnmadd_ps,
+    x86_fma_vfnmadd_ps_256,
+    x86_fma_vfnmadd_sd,
+    x86_fma_vfnmadd_ss,
+    x86_fma_vfnmsub_pd,
+    x86_fma_vfnmsub_pd_256,
+    x86_fma_vfnmsub_ps,
+    x86_fma_vfnmsub_ps_256,
+    x86_fma_vfnmsub_sd,
+    x86_fma_vfnmsub_ss,
+    x86_fma4_vfmadd_sd,
+    x86_fma4_vfmadd_ss,
+    x86_fxrstor,
+    x86_fxrstor64,
+    x86_fxsave,
+    x86_fxsave64,
+    x86_incsspd,
+    x86_incsspq,
+    x86_int,
+    x86_llwpcb,
+    x86_lwpins32,
+    x86_lwpins64,
+    x86_lwpval32,
+    x86_lwpval64,
+    x86_mmx_emms,
+    x86_mmx_femms,
+    x86_mmx_maskmovq,
+    x86_mmx_movnt_dq,
+    x86_mmx_packssdw,
+    x86_mmx_packsswb,
+    x86_mmx_packuswb,
+    x86_mmx_padd_b,
+    x86_mmx_padd_d,
+    x86_mmx_padd_q,
+    x86_mmx_padd_w,
+    x86_mmx_padds_b,
+    x86_mmx_padds_w,
+    x86_mmx_paddus_b,
+    x86_mmx_paddus_w,
+    x86_mmx_palignr_b,
+    x86_mmx_pand,
+    x86_mmx_pandn,
+    x86_mmx_pavg_b,
+    x86_mmx_pavg_w,
+    x86_mmx_pcmpeq_b,
+    x86_mmx_pcmpeq_d,
+    x86_mmx_pcmpeq_w,
+    x86_mmx_pcmpgt_b,
+    x86_mmx_pcmpgt_d,
+    x86_mmx_pcmpgt_w,
+    x86_mmx_pextr_w,
+    x86_mmx_pinsr_w,
+    x86_mmx_pmadd_wd,
+    x86_mmx_pmaxs_w,
+    x86_mmx_pmaxu_b,
+    x86_mmx_pmins_w,
+    x86_mmx_pminu_b,
+    x86_mmx_pmovmskb,
+    x86_mmx_pmulh_w,
+    x86_mmx_pmulhu_w,
+    x86_mmx_pmull_w,
+    x86_mmx_pmulu_dq,
+    x86_mmx_por,
+    x86_mmx_psad_bw,
+    x86_mmx_psll_d,
+    x86_mmx_psll_q,
+    x86_mmx_psll_w,
+    x86_mmx_pslli_d,
+    x86_mmx_pslli_q,
+    x86_mmx_pslli_w,
+    x86_mmx_psra_d,
+    x86_mmx_psra_w,
+    x86_mmx_psrai_d,
+    x86_mmx_psrai_w,
+    x86_mmx_psrl_d,
+    x86_mmx_psrl_q,
+    x86_mmx_psrl_w,
+    x86_mmx_psrli_d,
+    x86_mmx_psrli_q,
+    x86_mmx_psrli_w,
+    x86_mmx_psub_b,
+    x86_mmx_psub_d,
+    x86_mmx_psub_q,
+    x86_mmx_psub_w,
+    x86_mmx_psubs_b,
+    x86_mmx_psubs_w,
+    x86_mmx_psubus_b,
+    x86_mmx_psubus_w,
+    x86_mmx_punpckhbw,
+    x86_mmx_punpckhdq,
+    x86_mmx_punpckhwd,
+    x86_mmx_punpcklbw,
+    x86_mmx_punpckldq,
+    x86_mmx_punpcklwd,
+    x86_mmx_pxor,
+    x86_monitorx,
+    x86_mwaitx,
+    x86_pclmulqdq,
+    x86_pclmulqdq_256,
+    x86_pclmulqdq_512,
+    x86_rdfsbase_32,
+    x86_rdfsbase_64,
+    x86_rdgsbase_32,
+    x86_rdgsbase_64,
+    x86_rdpkru,
+    x86_rdpmc,
+    x86_rdrand_16,
+    x86_rdrand_32,
+    x86_rdrand_64,
+    x86_rdseed_16,
+    x86_rdseed_32,
+    x86_rdseed_64,
+    x86_rdsspd,
+    x86_rdsspq,
+    x86_rdtsc,
+    x86_rdtscp,
+    x86_rstorssp,
+    x86_saveprevssp,
+    x86_seh_ehguard,
+    x86_seh_ehregnode,
+    x86_seh_lsda,
+    x86_seh_recoverfp,
+    x86_setssbsy,
+    x86_sha1msg1,
+    x86_sha1msg2,
+    x86_sha1nexte,
+    x86_sha1rnds4,
+    x86_sha256msg1,
+    x86_sha256msg2,
+    x86_sha256rnds2,
+    x86_slwpcb,
+    x86_sse_cmp_ps,
+    x86_sse_cmp_ss,
+    x86_sse_comieq_ss,
+    x86_sse_comige_ss,
+    x86_sse_comigt_ss,
+    x86_sse_comile_ss,
+    x86_sse_comilt_ss,
+    x86_sse_comineq_ss,
+    x86_sse_cvtpd2pi,
+    x86_sse_cvtpi2pd,
+    x86_sse_cvtpi2ps,
+    x86_sse_cvtps2pi,
+    x86_sse_cvtsi2ss,
+    x86_sse_cvtsi642ss,
+    x86_sse_cvtss2si,
+    x86_sse_cvtss2si64,
+    x86_sse_cvttpd2pi,
+    x86_sse_cvttps2pi,
+    x86_sse_cvttss2si,
+    x86_sse_cvttss2si64,
+    x86_sse_ldmxcsr,
+    x86_sse_max_ps,
+    x86_sse_max_ss,
+    x86_sse_min_ps,
+    x86_sse_min_ss,
+    x86_sse_movmsk_ps,
+    x86_sse_pshuf_w,
+    x86_sse_rcp_ps,
+    x86_sse_rcp_ss,
+    x86_sse_rsqrt_ps,
+    x86_sse_rsqrt_ss,
+    x86_sse_sfence,
+    x86_sse_sqrt_ps,
+    x86_sse_sqrt_ss,
+    x86_sse_stmxcsr,
+    x86_sse_ucomieq_ss,
+    x86_sse_ucomige_ss,
+    x86_sse_ucomigt_ss,
+    x86_sse_ucomile_ss,
+    x86_sse_ucomilt_ss,
+    x86_sse_ucomineq_ss,
+    x86_sse2_clflush,
+    x86_sse2_cmp_pd,
+    x86_sse2_cmp_sd,
+    x86_sse2_comieq_sd,
+    x86_sse2_comige_sd,
+    x86_sse2_comigt_sd,
+    x86_sse2_comile_sd,
+    x86_sse2_comilt_sd,
+    x86_sse2_comineq_sd,
+    x86_sse2_cvtdq2ps,
+    x86_sse2_cvtpd2dq,
+    x86_sse2_cvtpd2ps,
+    x86_sse2_cvtps2dq,
+    x86_sse2_cvtsd2si,
+    x86_sse2_cvtsd2si64,
+    x86_sse2_cvtsd2ss,
+    x86_sse2_cvtsi2sd,
+    x86_sse2_cvtsi642sd,
+    x86_sse2_cvtss2sd,
+    x86_sse2_cvttpd2dq,
+    x86_sse2_cvttps2dq,
+    x86_sse2_cvttsd2si,
+    x86_sse2_cvttsd2si64,
+    x86_sse2_lfence,
+    x86_sse2_maskmov_dqu,
+    x86_sse2_max_pd,
+    x86_sse2_max_sd,
+    x86_sse2_mfence,
+    x86_sse2_min_pd,
+    x86_sse2_min_sd,
+    x86_sse2_movmsk_pd,
+    x86_sse2_packssdw_128,
+    x86_sse2_packsswb_128,
+    x86_sse2_packuswb_128,
+    x86_sse2_padds_b,
+    x86_sse2_padds_w,
+    x86_sse2_paddus_b,
+    x86_sse2_paddus_w,
+    x86_sse2_pause,
+    x86_sse2_pmadd_wd,
+    x86_sse2_pmovmskb_128,
+    x86_sse2_pmulh_w,
+    x86_sse2_pmulhu_w,
+    x86_sse2_pmulu_dq,
+    x86_sse2_psad_bw,
+    x86_sse2_psll_d,
+    x86_sse2_psll_q,
+    x86_sse2_psll_w,
+    x86_sse2_pslli_d,
+    x86_sse2_pslli_q,
+    x86_sse2_pslli_w,
+    x86_sse2_psra_d,
+    x86_sse2_psra_w,
+    x86_sse2_psrai_d,
+    x86_sse2_psrai_w,
+    x86_sse2_psrl_d,
+    x86_sse2_psrl_q,
+    x86_sse2_psrl_w,
+    x86_sse2_psrli_d,
+    x86_sse2_psrli_q,
+    x86_sse2_psrli_w,
+    x86_sse2_psubs_b,
+    x86_sse2_psubs_w,
+    x86_sse2_psubus_b,
+    x86_sse2_psubus_w,
+    x86_sse2_sqrt_pd,
+    x86_sse2_sqrt_sd,
+    x86_sse2_ucomieq_sd,
+    x86_sse2_ucomige_sd,
+    x86_sse2_ucomigt_sd,
+    x86_sse2_ucomile_sd,
+    x86_sse2_ucomilt_sd,
+    x86_sse2_ucomineq_sd,
+    x86_sse3_addsub_pd,
+    x86_sse3_addsub_ps,
+    x86_sse3_hadd_pd,
+    x86_sse3_hadd_ps,
+    x86_sse3_hsub_pd,
+    x86_sse3_hsub_ps,
+    x86_sse3_ldu_dq,
+    x86_sse3_monitor,
+    x86_sse3_mwait,
+    x86_sse41_blendvpd,
+    x86_sse41_blendvps,
+    x86_sse41_dppd,
+    x86_sse41_dpps,
+    x86_sse41_insertps,
+    x86_sse41_mpsadbw,
+    x86_sse41_packusdw,
+    x86_sse41_pblendvb,
+    x86_sse41_phminposuw,
+    x86_sse41_pmuldq,
+    x86_sse41_ptestc,
+    x86_sse41_ptestnzc,
+    x86_sse41_ptestz,
+    x86_sse41_round_pd,
+    x86_sse41_round_ps,
+    x86_sse41_round_sd,
+    x86_sse41_round_ss,
+    x86_sse42_crc32_32_16,
+    x86_sse42_crc32_32_32,
+    x86_sse42_crc32_32_8,
+    x86_sse42_crc32_64_64,
+    x86_sse42_pcmpestri128,
+    x86_sse42_pcmpestria128,
+    x86_sse42_pcmpestric128,
+    x86_sse42_pcmpestrio128,
+    x86_sse42_pcmpestris128,
+    x86_sse42_pcmpestriz128,
+    x86_sse42_pcmpestrm128,
+    x86_sse42_pcmpistri128,
+    x86_sse42_pcmpistria128,
+    x86_sse42_pcmpistric128,
+    x86_sse42_pcmpistrio128,
+    x86_sse42_pcmpistris128,
+    x86_sse42_pcmpistriz128,
+    x86_sse42_pcmpistrm128,
+    x86_sse4a_extrq,
+    x86_sse4a_extrqi,
+    x86_sse4a_insertq,
+    x86_sse4a_insertqi,
+    x86_ssse3_pabs_b,
+    x86_ssse3_pabs_d,
+    x86_ssse3_pabs_w,
+    x86_ssse3_phadd_d,
+    x86_ssse3_phadd_d_128,
+    x86_ssse3_phadd_sw,
+    x86_ssse3_phadd_sw_128,
+    x86_ssse3_phadd_w,
+    x86_ssse3_phadd_w_128,
+    x86_ssse3_phsub_d,
+    x86_ssse3_phsub_d_128,
+    x86_ssse3_phsub_sw,
+    x86_ssse3_phsub_sw_128,
+    x86_ssse3_phsub_w,
+    x86_ssse3_phsub_w_128,
+    x86_ssse3_pmadd_ub_sw,
+    x86_ssse3_pmadd_ub_sw_128,
+    x86_ssse3_pmul_hr_sw,
+    x86_ssse3_pmul_hr_sw_128,
+    x86_ssse3_pshuf_b,
+    x86_ssse3_pshuf_b_128,
+    x86_ssse3_psign_b,
+    x86_ssse3_psign_b_128,
+    x86_ssse3_psign_d,
+    x86_ssse3_psign_d_128,
+    x86_ssse3_psign_w,
+    x86_ssse3_psign_w_128,
+    x86_subborrow_u32,
+    x86_subborrow_u64,
+    x86_tbm_bextri_u32,
+    x86_tbm_bextri_u64,
+    x86_vcvtph2ps_128,
+    x86_vcvtph2ps_256,
+    x86_vcvtps2ph_128,
+    x86_vcvtps2ph_256,
+    x86_vgf2p8affineinvqb_128,
+    x86_vgf2p8affineinvqb_256,
+    x86_vgf2p8affineinvqb_512,
+    x86_vgf2p8affineqb_128,
+    x86_vgf2p8affineqb_256,
+    x86_vgf2p8affineqb_512,
+    x86_vgf2p8mulb_128,
+    x86_vgf2p8mulb_256,
+    x86_vgf2p8mulb_512,
+    x86_wrfsbase_32,
+    x86_wrfsbase_64,
+    x86_wrgsbase_32,
+    x86_wrgsbase_64,
+    x86_wrpkru,
+    x86_wrssd,
+    x86_wrssq,
+    x86_wrussd,
+    x86_wrussq,
+    x86_xabort,
+    x86_xbegin,
+    x86_xend,
+    x86_xgetbv,
+    x86_xop_vfrcz_pd,
+    x86_xop_vfrcz_pd_256,
+    x86_xop_vfrcz_ps,
+    x86_xop_vfrcz_ps_256,
+    x86_xop_vfrcz_sd,
+    x86_xop_vfrcz_ss,
+    x86_xop_vpcomb,
+    x86_xop_vpcomd,
+    x86_xop_vpcomq,
+    x86_xop_vpcomub,
+    x86_xop_vpcomud,
+    x86_xop_vpcomuq,
+    x86_xop_vpcomuw,
+    x86_xop_vpcomw,
+    x86_xop_vpermil2pd,
+    x86_xop_vpermil2pd_256,
+    x86_xop_vpermil2ps,
+    x86_xop_vpermil2ps_256,
+    x86_xop_vphaddbd,
+    x86_xop_vphaddbq,
+    x86_xop_vphaddbw,
+    x86_xop_vphadddq,
+    x86_xop_vphaddubd,
+    x86_xop_vphaddubq,
+    x86_xop_vphaddubw,
+    x86_xop_vphaddudq,
+    x86_xop_vphadduwd,
+    x86_xop_vphadduwq,
+    x86_xop_vphaddwd,
+    x86_xop_vphaddwq,
+    x86_xop_vphsubbw,
+    x86_xop_vphsubdq,
+    x86_xop_vphsubwd,
+    x86_xop_vpmacsdd,
+    x86_xop_vpmacsdqh,
+    x86_xop_vpmacsdql,
+    x86_xop_vpmacssdd,
+    x86_xop_vpmacssdqh,
+    x86_xop_vpmacssdql,
+    x86_xop_vpmacsswd,
+    x86_xop_vpmacssww,
+    x86_xop_vpmacswd,
+    x86_xop_vpmacsww,
+    x86_xop_vpmadcsswd,
+    x86_xop_vpmadcswd,
+    x86_xop_vpperm,
+    x86_xop_vprotb,
+    x86_xop_vprotbi,
+    x86_xop_vprotd,
+    x86_xop_vprotdi,
+    x86_xop_vprotq,
+    x86_xop_vprotqi,
+    x86_xop_vprotw,
+    x86_xop_vprotwi,
+    x86_xop_vpshab,
+    x86_xop_vpshad,
+    x86_xop_vpshaq,
+    x86_xop_vpshaw,
+    x86_xop_vpshlb,
+    x86_xop_vpshld,
+    x86_xop_vpshlq,
+    x86_xop_vpshlw,
+    x86_xrstor,
+    x86_xrstor64,
+    x86_xrstors,
+    x86_xrstors64,
+    x86_xsave,
+    x86_xsave64,
+    x86_xsavec,
+    x86_xsavec64,
+    x86_xsaveopt,
+    x86_xsaveopt64,
+    x86_xsaves,
+    x86_xsaves64,
+    x86_xsetbv,
+    x86_xtest,
+    xcore_bitrev,
+    xcore_checkevent,
+    xcore_chkct,
+    xcore_clre,
+    xcore_clrpt,
+    xcore_clrsr,
+    xcore_crc32,
+    xcore_crc8,
+    xcore_edu,
+    xcore_eeu,
+    xcore_endin,
+    xcore_freer,
+    xcore_geted,
+    xcore_getet,
+    xcore_getid,
+    xcore_getps,
+    xcore_getr,
+    xcore_getst,
+    xcore_getts,
+    xcore_in,
+    xcore_inct,
+    xcore_initcp,
+    xcore_initdp,
+    xcore_initlr,
+    xcore_initpc,
+    xcore_initsp,
+    xcore_inshr,
+    xcore_int,
+    xcore_mjoin,
+    xcore_msync,
+    xcore_out,
+    xcore_outct,
+    xcore_outshr,
+    xcore_outt,
+    xcore_peek,
+    xcore_setc,
+    xcore_setclk,
+    xcore_setd,
+    xcore_setev,
+    xcore_setps,
+    xcore_setpsc,
+    xcore_setpt,
+    xcore_setrdy,
+    xcore_setsr,
+    xcore_settw,
+    xcore_setv,
+    xcore_sext,
+    xcore_ssync,
+    xcore_syncr,
+    xcore_testct,
+    xcore_testwct,
+    xcore_waitevent,
+    xcore_zext
+
+    , num_intrinsics
+  };
+
+
+
+
+  StringRef getName(ID id);
+
+
+
+
+
+
+  std::string getName(ID id, ArrayRef<Type*> Tys);
+
+
+  FunctionType *getType(LLVMContext &Context, ID id,
+                        ArrayRef<Type*> Tys = None);
+
+
+  bool isOverloaded(ID id);
+
+
+
+
+  bool isLeaf(ID id);
+
+
+  AttributeList getAttributes(LLVMContext &C, ID id);
+  Function *getDeclaration(Module *M, ID id, ArrayRef<Type*> Tys = None);
+
+
+
+
+
+  int lookupLLVMIntrinsicByName(ArrayRef<const char *> NameTable,
+                                StringRef Name);
+
+
+  ID getIntrinsicForGCCBuiltin(const char *Prefix, StringRef BuiltinName);
+
+
+  ID getIntrinsicForMSBuiltin(const char *Prefix, StringRef BuiltinName);
+
+
+
+  struct IITDescriptor {
+    enum IITDescriptorKind {
+      Void, VarArg, MMX, Token, Metadata, Half, Float, Double,
+      Integer, Vector, Pointer, Struct,
+      Argument, ExtendArgument, TruncArgument, HalfVecArgument,
+      SameVecWidthArgument, PtrToArgument, PtrToElt, VecOfAnyPtrsToElt
+    } Kind;
+
+    union {
+      unsigned Integer_Width;
+      unsigned Float_Width;
+      unsigned Vector_Width;
+      unsigned Pointer_AddressSpace;
+      unsigned Struct_NumElements;
+      unsigned Argument_Info;
+    };
+
+    enum ArgKind {
+      AK_Any,
+      AK_AnyInteger,
+      AK_AnyFloat,
+      AK_AnyVector,
+      AK_AnyPointer
+    };
+
+    unsigned getArgumentNumber() const {
+      
+     ((
+     Kind == Argument || Kind == ExtendArgument || Kind == TruncArgument || Kind == HalfVecArgument || Kind == SameVecWidthArgument || Kind == PtrToArgument || Kind == PtrToElt
+     ) ? static_cast<void> (0) : __assert_fail (
+     "Kind == Argument || Kind == ExtendArgument || Kind == TruncArgument || Kind == HalfVecArgument || Kind == SameVecWidthArgument || Kind == PtrToArgument || Kind == PtrToElt"
+     ,
+
+
+                             "/home/trippels/llvm/llvm/include/llvm/IR/Intrinsics.h"
+      ,
+
+
+                             127
+      , __PRETTY_FUNCTION__))
+
+
+                              
+                             ;
+      return Argument_Info >> 3;
+    }
+    ArgKind getArgumentKind() const {
+      
+     ((
+     Kind == Argument || Kind == ExtendArgument || Kind == TruncArgument || Kind == HalfVecArgument || Kind == SameVecWidthArgument || Kind == PtrToArgument
+     ) ? static_cast<void> (0) : __assert_fail (
+     "Kind == Argument || Kind == ExtendArgument || Kind == TruncArgument || Kind == HalfVecArgument || Kind == SameVecWidthArgument || Kind == PtrToArgument"
+     ,
+
+                                                                  "/home/trippels/llvm/llvm/include/llvm/IR/Intrinsics.h"
+      ,
+
+                                                                  133
+      , __PRETTY_FUNCTION__))
+
+                                                                   
+                                                                  ;
+      return (ArgKind)(Argument_Info & 7);
+    }
+
+
+
+    unsigned getOverloadArgNumber() const {
+      
+     ((
+     Kind == VecOfAnyPtrsToElt
+     ) ? static_cast<void> (0) : __assert_fail (
+     "Kind == VecOfAnyPtrsToElt"
+     , "/home/trippels/llvm/llvm/include/llvm/IR/Intrinsics.h", 140, __PRETTY_FUNCTION__))
+                                      ;
+      return Argument_Info >> 16;
+    }
+    unsigned getRefArgNumber() const {
+      
+     ((
+     Kind == VecOfAnyPtrsToElt
+     ) ? static_cast<void> (0) : __assert_fail (
+     "Kind == VecOfAnyPtrsToElt"
+     , "/home/trippels/llvm/llvm/include/llvm/IR/Intrinsics.h", 144, __PRETTY_FUNCTION__))
+                                      ;
+      return Argument_Info & 0xFFFF;
+    }
+
+    static IITDescriptor get(IITDescriptorKind K, unsigned Field) {
+      IITDescriptor Result = { K, { Field } };
+      return Result;
+    }
+
+    static IITDescriptor get(IITDescriptorKind K, unsigned short Hi,
+                             unsigned short Lo) {
+      unsigned Field = Hi << 16 | Lo;
+      IITDescriptor Result = {K, {Field}};
+      return Result;
+    }
+  };
+
+
+
+  void getIntrinsicInfoTableEntries(ID id, SmallVectorImpl<IITDescriptor> &T);
+
+
+
+
+
+
+
+  bool matchIntrinsicType(Type *Ty, ArrayRef<IITDescriptor> &Infos,
+                          SmallVectorImpl<Type*> &ArgTys);
+
+
+
+
+
+  bool matchIntrinsicVarArg(bool isVarArg, ArrayRef<IITDescriptor> &Infos);
+
+
+
+  llvm::Optional<Function*> remangleIntrinsicFunction(Function *F);
+
+}
+
+}
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+
+namespace llvm {
+
+class APInt;
+class MDNode;
+class Module;
+class Use;
+
+
+
+
+
+
+class IRBuilderDefaultInserter {
+protected:
+  void InsertHelper(Instruction *I, const Twine &Name,
+                    BasicBlock *BB, BasicBlock::iterator InsertPt) const {
+    if (BB) BB->getInstList().insert(InsertPt, I);
+    I->setName(Name);
+  }
+};
+
+
+
+class IRBuilderCallbackInserter : IRBuilderDefaultInserter {
+  std::function<void(Instruction *)> Callback;
+
+public:
+  IRBuilderCallbackInserter(std::function<void(Instruction *)> Callback)
+      : Callback(std::move(Callback)) {}
+
+protected:
+  void InsertHelper(Instruction *I, const Twine &Name,
+                    BasicBlock *BB, BasicBlock::iterator InsertPt) const {
+    IRBuilderDefaultInserter::InsertHelper(I, Name, BB, InsertPt);
+    Callback(I);
+  }
+};
+
+
+class IRBuilderBase {
+  DebugLoc CurDbgLocation;
+
+protected:
+  BasicBlock *BB;
+  BasicBlock::iterator InsertPt;
+  LLVMContext &Context;
+
+  MDNode *DefaultFPMathTag;
+  FastMathFlags FMF;
+
+  ArrayRef<OperandBundleDef> DefaultOperandBundles;
+
+public:
+  IRBuilderBase(LLVMContext &context, MDNode *FPMathTag = nullptr,
+                ArrayRef<OperandBundleDef> OpBundles = None)
+      : Context(context), DefaultFPMathTag(FPMathTag),
+        DefaultOperandBundles(OpBundles) {
+    ClearInsertionPoint();
+  }
+
+
+
+
+
+
+
+  void ClearInsertionPoint() {
+    BB = nullptr;
+    InsertPt = BasicBlock::iterator();
+  }
+
+  BasicBlock *GetInsertBlock() const { return BB; }
+  BasicBlock::iterator GetInsertPoint() const { return InsertPt; }
+  LLVMContext &getContext() const { return Context; }
+
+
+
+  void SetInsertPoint(BasicBlock *TheBB) {
+    BB = TheBB;
+    InsertPt = BB->end();
+  }
+
+
+
+  void SetInsertPoint(Instruction *I) {
+    BB = I->getParent();
+    InsertPt = I->getIterator();
+    
+   ((
+   InsertPt != BB->end() && "Can't read debug loc from end()"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "InsertPt != BB->end() && \"Can't read debug loc from end()\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/IRBuilder.h", 138, __PRETTY_FUNCTION__))
+                                                                     ;
+    SetCurrentDebugLocation(I->getDebugLoc());
+  }
+
+
+
+  void SetInsertPoint(BasicBlock *TheBB, BasicBlock::iterator IP) {
+    BB = TheBB;
+    InsertPt = IP;
+    if (IP != TheBB->end())
+      SetCurrentDebugLocation(IP->getDebugLoc());
+  }
+
+
+  void SetCurrentDebugLocation(DebugLoc L) { CurDbgLocation = std::move(L); }
+
+
+  const DebugLoc &getCurrentDebugLocation() const { return CurDbgLocation; }
+
+
+
+  void SetInstDebugLocation(Instruction *I) const {
+    if (CurDbgLocation)
+      I->setDebugLoc(CurDbgLocation);
+  }
+
+
+
+  Type *getCurrentFunctionReturnType() const;
+
+
+  class InsertPoint {
+    BasicBlock *Block = nullptr;
+    BasicBlock::iterator Point;
+
+  public:
+
+    InsertPoint() = default;
+
+
+    InsertPoint(BasicBlock *InsertBlock, BasicBlock::iterator InsertPoint)
+      : Block(InsertBlock), Point(InsertPoint) {}
+
+
+    bool isSet() const { return (Block != nullptr); }
+
+    BasicBlock *getBlock() const { return Block; }
+    BasicBlock::iterator getPoint() const { return Point; }
+  };
+
+
+  InsertPoint saveIP() const {
+    return InsertPoint(GetInsertBlock(), GetInsertPoint());
+  }
+
+
+  InsertPoint saveAndClearIP() {
+    InsertPoint IP(GetInsertBlock(), GetInsertPoint());
+    ClearInsertionPoint();
+    return IP;
+  }
+
+
+  void restoreIP(InsertPoint IP) {
+    if (IP.isSet())
+      SetInsertPoint(IP.getBlock(), IP.getPoint());
+    else
+      ClearInsertionPoint();
+  }
+
+
+  MDNode *getDefaultFPMathTag() const { return DefaultFPMathTag; }
+
+
+  FastMathFlags getFastMathFlags() const { return FMF; }
+
+
+  void clearFastMathFlags() { FMF.clear(); }
+
+
+  void setDefaultFPMathTag(MDNode *FPMathTag) { DefaultFPMathTag = FPMathTag; }
+
+
+  void setFastMathFlags(FastMathFlags NewFMF) { FMF = NewFMF; }
+
+
+
+
+
+
+
+  class InsertPointGuard {
+    IRBuilderBase &Builder;
+    AssertingVH<BasicBlock> Block;
+    BasicBlock::iterator Point;
+    DebugLoc DbgLoc;
+
+  public:
+    InsertPointGuard(IRBuilderBase &B)
+        : Builder(B), Block(B.GetInsertBlock()), Point(B.GetInsertPoint()),
+          DbgLoc(B.getCurrentDebugLocation()) {}
+
+    InsertPointGuard(const InsertPointGuard &) = delete;
+    InsertPointGuard &operator=(const InsertPointGuard &) = delete;
+
+    ~InsertPointGuard() {
+      Builder.restoreIP(InsertPoint(Block, Point));
+      Builder.SetCurrentDebugLocation(DbgLoc);
+    }
+  };
+
+
+
+  class FastMathFlagGuard {
+    IRBuilderBase &Builder;
+    FastMathFlags FMF;
+    MDNode *FPMathTag;
+
+  public:
+    FastMathFlagGuard(IRBuilderBase &B)
+        : Builder(B), FMF(B.FMF), FPMathTag(B.DefaultFPMathTag) {}
+
+    FastMathFlagGuard(const FastMathFlagGuard &) = delete;
+    FastMathFlagGuard &operator=(const FastMathFlagGuard &) = delete;
+
+    ~FastMathFlagGuard() {
+      Builder.FMF = FMF;
+      Builder.DefaultFPMathTag = FPMathTag;
+    }
+  };
+  GlobalVariable *CreateGlobalString(StringRef Str, const Twine &Name = "",
+                                     unsigned AddressSpace = 0);
+
+
+  ConstantInt *getInt1(bool V) {
+    return ConstantInt::get(getInt1Ty(), V);
+  }
+
+
+  ConstantInt *getTrue() {
+    return ConstantInt::getTrue(Context);
+  }
+
+
+  ConstantInt *getFalse() {
+    return ConstantInt::getFalse(Context);
+  }
+
+
+  ConstantInt *getInt8(uint8_t C) {
+    return ConstantInt::get(getInt8Ty(), C);
+  }
+
+
+  ConstantInt *getInt16(uint16_t C) {
+    return ConstantInt::get(getInt16Ty(), C);
+  }
+
+
+  ConstantInt *getInt32(uint32_t C) {
+    return ConstantInt::get(getInt32Ty(), C);
+  }
+
+
+  ConstantInt *getInt64(uint64_t C) {
+    return ConstantInt::get(getInt64Ty(), C);
+  }
+
+
+
+  ConstantInt *getIntN(unsigned N, uint64_t C) {
+    return ConstantInt::get(getIntNTy(N), C);
+  }
+
+
+  ConstantInt *getInt(const APInt &AI) {
+    return ConstantInt::get(Context, AI);
+  }
+
+
+
+
+
+
+  IntegerType *getInt1Ty() {
+    return Type::getInt1Ty(Context);
+  }
+
+
+  IntegerType *getInt8Ty() {
+    return Type::getInt8Ty(Context);
+  }
+
+
+  IntegerType *getInt16Ty() {
+    return Type::getInt16Ty(Context);
+  }
+
+
+  IntegerType *getInt32Ty() {
+    return Type::getInt32Ty(Context);
+  }
+
+
+  IntegerType *getInt64Ty() {
+    return Type::getInt64Ty(Context);
+  }
+
+
+  IntegerType *getInt128Ty() { return Type::getInt128Ty(Context); }
+
+
+  IntegerType *getIntNTy(unsigned N) {
+    return Type::getIntNTy(Context, N);
+  }
+
+
+  Type *getHalfTy() {
+    return Type::getHalfTy(Context);
+  }
+
+
+  Type *getFloatTy() {
+    return Type::getFloatTy(Context);
+  }
+
+
+  Type *getDoubleTy() {
+    return Type::getDoubleTy(Context);
+  }
+
+
+  Type *getVoidTy() {
+    return Type::getVoidTy(Context);
+  }
+
+
+  PointerType *getInt8PtrTy(unsigned AddrSpace = 0) {
+    return Type::getInt8PtrTy(Context, AddrSpace);
+  }
+
+
+  IntegerType *getIntPtrTy(const DataLayout &DL, unsigned AddrSpace = 0) {
+    return DL.getIntPtrType(Context, AddrSpace);
+  }
+  CallInst *CreateMemSet(Value *Ptr, Value *Val, uint64_t Size, unsigned Align,
+                         bool isVolatile = false, MDNode *TBAATag = nullptr,
+                         MDNode *ScopeTag = nullptr,
+                         MDNode *NoAliasTag = nullptr) {
+    return CreateMemSet(Ptr, Val, getInt64(Size), Align, isVolatile,
+                        TBAATag, ScopeTag, NoAliasTag);
+  }
+
+  CallInst *CreateMemSet(Value *Ptr, Value *Val, Value *Size, unsigned Align,
+                         bool isVolatile = false, MDNode *TBAATag = nullptr,
+                         MDNode *ScopeTag = nullptr,
+                         MDNode *NoAliasTag = nullptr);
+
+
+
+
+
+
+  CallInst *CreateMemCpy(Value *Dst, Value *Src, uint64_t Size, unsigned Align,
+                         bool isVolatile = false, MDNode *TBAATag = nullptr,
+                         MDNode *TBAAStructTag = nullptr,
+                         MDNode *ScopeTag = nullptr,
+                         MDNode *NoAliasTag = nullptr) {
+    return CreateMemCpy(Dst, Src, getInt64(Size), Align, isVolatile, TBAATag,
+                        TBAAStructTag, ScopeTag, NoAliasTag);
+  }
+
+  CallInst *CreateMemCpy(Value *Dst, Value *Src, Value *Size, unsigned Align,
+                         bool isVolatile = false, MDNode *TBAATag = nullptr,
+                         MDNode *TBAAStructTag = nullptr,
+                         MDNode *ScopeTag = nullptr,
+                         MDNode *NoAliasTag = nullptr);
+  CallInst *CreateElementUnorderedAtomicMemCpy(
+      Value *Dst, unsigned DstAlign, Value *Src, unsigned SrcAlign,
+      uint64_t Size, uint32_t ElementSize, MDNode *TBAATag = nullptr,
+      MDNode *TBAAStructTag = nullptr, MDNode *ScopeTag = nullptr,
+      MDNode *NoAliasTag = nullptr) {
+    return CreateElementUnorderedAtomicMemCpy(
+        Dst, DstAlign, Src, SrcAlign, getInt64(Size), ElementSize, TBAATag,
+        TBAAStructTag, ScopeTag, NoAliasTag);
+  }
+
+  CallInst *CreateElementUnorderedAtomicMemCpy(
+      Value *Dst, unsigned DstAlign, Value *Src, unsigned SrcAlign, Value *Size,
+      uint32_t ElementSize, MDNode *TBAATag = nullptr,
+      MDNode *TBAAStructTag = nullptr, MDNode *ScopeTag = nullptr,
+      MDNode *NoAliasTag = nullptr);
+
+
+
+
+
+
+
+  CallInst *CreateMemMove(Value *Dst, Value *Src, uint64_t Size, unsigned Align,
+                          bool isVolatile = false, MDNode *TBAATag = nullptr,
+                          MDNode *ScopeTag = nullptr,
+                          MDNode *NoAliasTag = nullptr) {
+    return CreateMemMove(Dst, Src, getInt64(Size), Align, isVolatile,
+                         TBAATag, ScopeTag, NoAliasTag);
+  }
+
+  CallInst *CreateMemMove(Value *Dst, Value *Src, Value *Size, unsigned Align,
+                          bool isVolatile = false, MDNode *TBAATag = nullptr,
+                          MDNode *ScopeTag = nullptr,
+                          MDNode *NoAliasTag = nullptr);
+
+
+
+  CallInst *CreateFAddReduce(Value *Acc, Value *Src);
+
+
+
+  CallInst *CreateFMulReduce(Value *Acc, Value *Src);
+
+
+  CallInst *CreateAddReduce(Value *Src);
+
+
+  CallInst *CreateMulReduce(Value *Src);
+
+
+  CallInst *CreateAndReduce(Value *Src);
+
+
+  CallInst *CreateOrReduce(Value *Src);
+
+
+  CallInst *CreateXorReduce(Value *Src);
+
+
+
+  CallInst *CreateIntMaxReduce(Value *Src, bool IsSigned = false);
+
+
+
+  CallInst *CreateIntMinReduce(Value *Src, bool IsSigned = false);
+
+
+
+  CallInst *CreateFPMaxReduce(Value *Src, bool NoNaN = false);
+
+
+
+  CallInst *CreateFPMinReduce(Value *Src, bool NoNaN = false);
+
+
+
+
+  CallInst *CreateLifetimeStart(Value *Ptr, ConstantInt *Size = nullptr);
+
+
+
+
+  CallInst *CreateLifetimeEnd(Value *Ptr, ConstantInt *Size = nullptr);
+
+
+
+
+  CallInst *CreateInvariantStart(Value *Ptr, ConstantInt *Size = nullptr);
+
+
+  CallInst *CreateMaskedLoad(Value *Ptr, unsigned Align, Value *Mask,
+                             Value *PassThru = nullptr, const Twine &Name = "");
+
+
+  CallInst *CreateMaskedStore(Value *Val, Value *Ptr, unsigned Align,
+                              Value *Mask);
+
+
+  CallInst *CreateMaskedGather(Value *Ptrs, unsigned Align,
+                               Value *Mask = nullptr,
+                               Value *PassThru = nullptr,
+                               const Twine& Name = "");
+
+
+  CallInst *CreateMaskedScatter(Value *Val, Value *Ptrs, unsigned Align,
+                                Value *Mask = nullptr);
+
+
+
+  CallInst *CreateAssumption(Value *Cond);
+
+
+
+  CallInst *CreateGCStatepointCall(uint64_t ID, uint32_t NumPatchBytes,
+                                   Value *ActualCallee,
+                                   ArrayRef<Value *> CallArgs,
+                                   ArrayRef<Value *> DeoptArgs,
+                                   ArrayRef<Value *> GCArgs,
+                                   const Twine &Name = "");
+
+
+
+  CallInst *CreateGCStatepointCall(uint64_t ID, uint32_t NumPatchBytes,
+                                   Value *ActualCallee, uint32_t Flags,
+                                   ArrayRef<Use> CallArgs,
+                                   ArrayRef<Use> TransitionArgs,
+                                   ArrayRef<Use> DeoptArgs,
+                                   ArrayRef<Value *> GCArgs,
+                                   const Twine &Name = "");
+
+
+
+
+  CallInst *CreateGCStatepointCall(uint64_t ID, uint32_t NumPatchBytes,
+                                   Value *ActualCallee, ArrayRef<Use> CallArgs,
+                                   ArrayRef<Value *> DeoptArgs,
+                                   ArrayRef<Value *> GCArgs,
+                                   const Twine &Name = "");
+
+
+
+  InvokeInst *
+  CreateGCStatepointInvoke(uint64_t ID, uint32_t NumPatchBytes,
+                           Value *ActualInvokee, BasicBlock *NormalDest,
+                           BasicBlock *UnwindDest, ArrayRef<Value *> InvokeArgs,
+                           ArrayRef<Value *> DeoptArgs,
+                           ArrayRef<Value *> GCArgs, const Twine &Name = "");
+
+
+
+  InvokeInst *CreateGCStatepointInvoke(
+      uint64_t ID, uint32_t NumPatchBytes, Value *ActualInvokee,
+      BasicBlock *NormalDest, BasicBlock *UnwindDest, uint32_t Flags,
+      ArrayRef<Use> InvokeArgs, ArrayRef<Use> TransitionArgs,
+      ArrayRef<Use> DeoptArgs, ArrayRef<Value *> GCArgs,
+      const Twine &Name = "");
+
+
+
+
+  InvokeInst *
+  CreateGCStatepointInvoke(uint64_t ID, uint32_t NumPatchBytes,
+                           Value *ActualInvokee, BasicBlock *NormalDest,
+                           BasicBlock *UnwindDest, ArrayRef<Use> InvokeArgs,
+                           ArrayRef<Value *> DeoptArgs,
+                           ArrayRef<Value *> GCArgs, const Twine &Name = "");
+
+
+
+  CallInst *CreateGCResult(Instruction *Statepoint,
+                           Type *ResultType,
+                           const Twine &Name = "");
+
+
+
+  CallInst *CreateGCRelocate(Instruction *Statepoint,
+                             int BaseOffset,
+                             int DerivedOffset,
+                             Type *ResultType,
+                             const Twine &Name = "");
+
+
+
+  CallInst *CreateBinaryIntrinsic(Intrinsic::ID ID,
+                                  Value *LHS, Value *RHS,
+                                  const Twine &Name = "");
+
+
+  CallInst *CreateMinNum(Value *LHS, Value *RHS, const Twine &Name = "") {
+    return CreateBinaryIntrinsic(Intrinsic::minnum, LHS, RHS, Name);
+  }
+
+
+  CallInst *CreateMaxNum(Value *LHS, Value *RHS, const Twine &Name = "") {
+    return CreateBinaryIntrinsic(Intrinsic::minnum, LHS, RHS, Name);
+  }
+
+private:
+
+  CallInst *CreateMaskedIntrinsic(Intrinsic::ID Id, ArrayRef<Value *> Ops,
+                                  ArrayRef<Type *> OverloadedTypes,
+                                  const Twine &Name = "");
+
+  Value *getCastedInt8PtrValue(Value *Ptr);
+};
+template <typename T = ConstantFolder,
+          typename Inserter = IRBuilderDefaultInserter>
+class IRBuilder : public IRBuilderBase, public Inserter {
+  T Folder;
+
+public:
+  IRBuilder(LLVMContext &C, const T &F, Inserter I = Inserter(),
+            MDNode *FPMathTag = nullptr,
+            ArrayRef<OperandBundleDef> OpBundles = None)
+      : IRBuilderBase(C, FPMathTag, OpBundles), Inserter(std::move(I)),
+        Folder(F) {}
+
+  explicit IRBuilder(LLVMContext &C, MDNode *FPMathTag = nullptr,
+                     ArrayRef<OperandBundleDef> OpBundles = None)
+      : IRBuilderBase(C, FPMathTag, OpBundles), Folder() {}
+
+  explicit IRBuilder(BasicBlock *TheBB, const T &F, MDNode *FPMathTag = nullptr,
+                     ArrayRef<OperandBundleDef> OpBundles = None)
+      : IRBuilderBase(TheBB->getContext(), FPMathTag, OpBundles), Folder(F) {
+    SetInsertPoint(TheBB);
+  }
+
+  explicit IRBuilder(BasicBlock *TheBB, MDNode *FPMathTag = nullptr,
+                     ArrayRef<OperandBundleDef> OpBundles = None)
+      : IRBuilderBase(TheBB->getContext(), FPMathTag, OpBundles), Folder() {
+    SetInsertPoint(TheBB);
+  }
+
+  explicit IRBuilder(Instruction *IP, MDNode *FPMathTag = nullptr,
+                     ArrayRef<OperandBundleDef> OpBundles = None)
+      : IRBuilderBase(IP->getContext(), FPMathTag, OpBundles), Folder() {
+    SetInsertPoint(IP);
+  }
+
+  IRBuilder(BasicBlock *TheBB, BasicBlock::iterator IP, const T &F,
+            MDNode *FPMathTag = nullptr,
+            ArrayRef<OperandBundleDef> OpBundles = None)
+      : IRBuilderBase(TheBB->getContext(), FPMathTag, OpBundles), Folder(F) {
+    SetInsertPoint(TheBB, IP);
+  }
+
+  IRBuilder(BasicBlock *TheBB, BasicBlock::iterator IP,
+            MDNode *FPMathTag = nullptr,
+            ArrayRef<OperandBundleDef> OpBundles = None)
+      : IRBuilderBase(TheBB->getContext(), FPMathTag, OpBundles), Folder() {
+    SetInsertPoint(TheBB, IP);
+  }
+
+
+  const T &getFolder() { return Folder; }
+
+
+  template<typename InstTy>
+  InstTy *Insert(InstTy *I, const Twine &Name = "") const {
+    this->InsertHelper(I, Name, BB, InsertPt);
+    this->SetInstDebugLocation(I);
+    return I;
+  }
+
+
+  Constant *Insert(Constant *C, const Twine& = "") const {
+    return C;
+  }
+
+
+
+
+
+private:
+
+
+
+  template <typename InstTy>
+  InstTy *addBranchMetadata(InstTy *I, MDNode *Weights, MDNode *Unpredictable) {
+    if (Weights)
+      I->setMetadata(LLVMContext::MD_prof, Weights);
+    if (Unpredictable)
+      I->setMetadata(LLVMContext::MD_unpredictable, Unpredictable);
+    return I;
+  }
+
+public:
+
+  ReturnInst *CreateRetVoid() {
+    return Insert(ReturnInst::Create(Context));
+  }
+
+
+  ReturnInst *CreateRet(Value *V) {
+    return Insert(ReturnInst::Create(Context, V));
+  }
+  ReturnInst *CreateAggregateRet(Value *const *retVals, unsigned N) {
+    Value *V = UndefValue::get(getCurrentFunctionReturnType());
+    for (unsigned i = 0; i != N; ++i)
+      V = CreateInsertValue(V, retVals[i], i, "mrv");
+    return Insert(ReturnInst::Create(Context, V));
+  }
+
+
+  BranchInst *CreateBr(BasicBlock *Dest) {
+    return Insert(BranchInst::Create(Dest));
+  }
+
+
+
+  BranchInst *CreateCondBr(Value *Cond, BasicBlock *True, BasicBlock *False,
+                           MDNode *BranchWeights = nullptr,
+                           MDNode *Unpredictable = nullptr) {
+    return Insert(addBranchMetadata(BranchInst::Create(True, False, Cond),
+                                    BranchWeights, Unpredictable));
+  }
+
+
+
+  BranchInst *CreateCondBr(Value *Cond, BasicBlock *True, BasicBlock *False,
+                           Instruction *MDSrc) {
+    BranchInst *Br = BranchInst::Create(True, False, Cond);
+    if (MDSrc) {
+      unsigned WL[4] = {LLVMContext::MD_prof, LLVMContext::MD_unpredictable,
+                        LLVMContext::MD_make_implicit, LLVMContext::MD_dbg};
+      Br->copyMetadata(*MDSrc, makeArrayRef(&WL[0], 4));
+    }
+    return Insert(Br);
+  }
+
+
+
+
+  SwitchInst *CreateSwitch(Value *V, BasicBlock *Dest, unsigned NumCases = 10,
+                           MDNode *BranchWeights = nullptr,
+                           MDNode *Unpredictable = nullptr) {
+    return Insert(addBranchMetadata(SwitchInst::Create(V, Dest, NumCases),
+                                    BranchWeights, Unpredictable));
+  }
+
+
+
+
+  IndirectBrInst *CreateIndirectBr(Value *Addr, unsigned NumDests = 10) {
+    return Insert(IndirectBrInst::Create(Addr, NumDests));
+  }
+
+
+  InvokeInst *CreateInvoke(Value *Callee, BasicBlock *NormalDest,
+                           BasicBlock *UnwindDest,
+                           ArrayRef<Value *> Args = None,
+                           const Twine &Name = "") {
+    return Insert(InvokeInst::Create(Callee, NormalDest, UnwindDest, Args),
+                  Name);
+  }
+  InvokeInst *CreateInvoke(Value *Callee, BasicBlock *NormalDest,
+                           BasicBlock *UnwindDest, ArrayRef<Value *> Args,
+                           ArrayRef<OperandBundleDef> OpBundles,
+                           const Twine &Name = "") {
+    return Insert(InvokeInst::Create(Callee, NormalDest, UnwindDest, Args,
+                                     OpBundles), Name);
+  }
+
+  ResumeInst *CreateResume(Value *Exn) {
+    return Insert(ResumeInst::Create(Exn));
+  }
+
+  CleanupReturnInst *CreateCleanupRet(CleanupPadInst *CleanupPad,
+                                      BasicBlock *UnwindBB = nullptr) {
+    return Insert(CleanupReturnInst::Create(CleanupPad, UnwindBB));
+  }
+
+  CatchSwitchInst *CreateCatchSwitch(Value *ParentPad, BasicBlock *UnwindBB,
+                                     unsigned NumHandlers,
+                                     const Twine &Name = "") {
+    return Insert(CatchSwitchInst::Create(ParentPad, UnwindBB, NumHandlers),
+                  Name);
+  }
+
+  CatchPadInst *CreateCatchPad(Value *ParentPad, ArrayRef<Value *> Args,
+                               const Twine &Name = "") {
+    return Insert(CatchPadInst::Create(ParentPad, Args), Name);
+  }
+
+  CleanupPadInst *CreateCleanupPad(Value *ParentPad,
+                                   ArrayRef<Value *> Args = None,
+                                   const Twine &Name = "") {
+    return Insert(CleanupPadInst::Create(ParentPad, Args), Name);
+  }
+
+  CatchReturnInst *CreateCatchRet(CatchPadInst *CatchPad, BasicBlock *BB) {
+    return Insert(CatchReturnInst::Create(CatchPad, BB));
+  }
+
+  UnreachableInst *CreateUnreachable() {
+    return Insert(new UnreachableInst(Context));
+  }
+
+
+
+
+private:
+  BinaryOperator *CreateInsertNUWNSWBinOp(BinaryOperator::BinaryOps Opc,
+                                          Value *LHS, Value *RHS,
+                                          const Twine &Name,
+                                          bool HasNUW, bool HasNSW) {
+    BinaryOperator *BO = Insert(BinaryOperator::Create(Opc, LHS, RHS), Name);
+    if (HasNUW) BO->setHasNoUnsignedWrap();
+    if (HasNSW) BO->setHasNoSignedWrap();
+    return BO;
+  }
+
+  Instruction *AddFPMathAttributes(Instruction *I,
+                                   MDNode *FPMathTag,
+                                   FastMathFlags FMF) const {
+    if (!FPMathTag)
+      FPMathTag = DefaultFPMathTag;
+    if (FPMathTag)
+      I->setMetadata(LLVMContext::MD_fpmath, FPMathTag);
+    I->setFastMathFlags(FMF);
+    return I;
+  }
+
+public:
+  Value *CreateAdd(Value *LHS, Value *RHS, const Twine &Name = "",
+                   bool HasNUW = false, bool HasNSW = false) {
+    if (Constant *LC = dyn_cast<Constant>(LHS))
+      if (Constant *RC = dyn_cast<Constant>(RHS))
+        return Insert(Folder.CreateAdd(LC, RC, HasNUW, HasNSW), Name);
+    return CreateInsertNUWNSWBinOp(Instruction::Add, LHS, RHS, Name,
+                                   HasNUW, HasNSW);
+  }
+  Value *CreateNSWAdd(Value *LHS, Value *RHS, const Twine &Name = "") {
+    return CreateAdd(LHS, RHS, Name, false, true);
+  }
+  Value *CreateNUWAdd(Value *LHS, Value *RHS, const Twine &Name = "") {
+    return CreateAdd(LHS, RHS, Name, true, false);
+  }
+  Value *CreateFAdd(Value *LHS, Value *RHS, const Twine &Name = "",
+                    MDNode *FPMathTag = nullptr) {
+    if (Constant *LC = dyn_cast<Constant>(LHS))
+      if (Constant *RC = dyn_cast<Constant>(RHS))
+        return Insert(Folder.CreateFAdd(LC, RC), Name);
+    return Insert(AddFPMathAttributes(BinaryOperator::CreateFAdd(LHS, RHS),
+                                      FPMathTag, FMF), Name);
+  }
+  Value *CreateSub(Value *LHS, Value *RHS, const Twine &Name = "",
+                   bool HasNUW = false, bool HasNSW = false) {
+    if (Constant *LC = dyn_cast<Constant>(LHS))
+      if (Constant *RC = dyn_cast<Constant>(RHS))
+        return Insert(Folder.CreateSub(LC, RC, HasNUW, HasNSW), Name);
+    return CreateInsertNUWNSWBinOp(Instruction::Sub, LHS, RHS, Name,
+                                   HasNUW, HasNSW);
+  }
+  Value *CreateNSWSub(Value *LHS, Value *RHS, const Twine &Name = "") {
+    return CreateSub(LHS, RHS, Name, false, true);
+  }
+  Value *CreateNUWSub(Value *LHS, Value *RHS, const Twine &Name = "") {
+    return CreateSub(LHS, RHS, Name, true, false);
+  }
+  Value *CreateFSub(Value *LHS, Value *RHS, const Twine &Name = "",
+                    MDNode *FPMathTag = nullptr) {
+    if (Constant *LC = dyn_cast<Constant>(LHS))
+      if (Constant *RC = dyn_cast<Constant>(RHS))
+        return Insert(Folder.CreateFSub(LC, RC), Name);
+    return Insert(AddFPMathAttributes(BinaryOperator::CreateFSub(LHS, RHS),
+                                      FPMathTag, FMF), Name);
+  }
+  Value *CreateMul(Value *LHS, Value *RHS, const Twine &Name = "",
+                   bool HasNUW = false, bool HasNSW = false) {
+    if (Constant *LC = dyn_cast<Constant>(LHS))
+      if (Constant *RC = dyn_cast<Constant>(RHS))
+        return Insert(Folder.CreateMul(LC, RC, HasNUW, HasNSW), Name);
+    return CreateInsertNUWNSWBinOp(Instruction::Mul, LHS, RHS, Name,
+                                   HasNUW, HasNSW);
+  }
+  Value *CreateNSWMul(Value *LHS, Value *RHS, const Twine &Name = "") {
+    return CreateMul(LHS, RHS, Name, false, true);
+  }
+  Value *CreateNUWMul(Value *LHS, Value *RHS, const Twine &Name = "") {
+    return CreateMul(LHS, RHS, Name, true, false);
+  }
+  Value *CreateFMul(Value *LHS, Value *RHS, const Twine &Name = "",
+                    MDNode *FPMathTag = nullptr) {
+    if (Constant *LC = dyn_cast<Constant>(LHS))
+      if (Constant *RC = dyn_cast<Constant>(RHS))
+        return Insert(Folder.CreateFMul(LC, RC), Name);
+    return Insert(AddFPMathAttributes(BinaryOperator::CreateFMul(LHS, RHS),
+                                      FPMathTag, FMF), Name);
+  }
+  Value *CreateUDiv(Value *LHS, Value *RHS, const Twine &Name = "",
+                    bool isExact = false) {
+    if (Constant *LC = dyn_cast<Constant>(LHS))
+      if (Constant *RC = dyn_cast<Constant>(RHS))
+        return Insert(Folder.CreateUDiv(LC, RC, isExact), Name);
+    if (!isExact)
+      return Insert(BinaryOperator::CreateUDiv(LHS, RHS), Name);
+    return Insert(BinaryOperator::CreateExactUDiv(LHS, RHS), Name);
+  }
+  Value *CreateExactUDiv(Value *LHS, Value *RHS, const Twine &Name = "") {
+    return CreateUDiv(LHS, RHS, Name, true);
+  }
+  Value *CreateSDiv(Value *LHS, Value *RHS, const Twine &Name = "",
+                    bool isExact = false) {
+    if (Constant *LC = dyn_cast<Constant>(LHS))
+      if (Constant *RC = dyn_cast<Constant>(RHS))
+        return Insert(Folder.CreateSDiv(LC, RC, isExact), Name);
+    if (!isExact)
+      return Insert(BinaryOperator::CreateSDiv(LHS, RHS), Name);
+    return Insert(BinaryOperator::CreateExactSDiv(LHS, RHS), Name);
+  }
+  Value *CreateExactSDiv(Value *LHS, Value *RHS, const Twine &Name = "") {
+    return CreateSDiv(LHS, RHS, Name, true);
+  }
+  Value *CreateFDiv(Value *LHS, Value *RHS, const Twine &Name = "",
+                    MDNode *FPMathTag = nullptr) {
+    if (Constant *LC = dyn_cast<Constant>(LHS))
+      if (Constant *RC = dyn_cast<Constant>(RHS))
+        return Insert(Folder.CreateFDiv(LC, RC), Name);
+    return Insert(AddFPMathAttributes(BinaryOperator::CreateFDiv(LHS, RHS),
+                                      FPMathTag, FMF), Name);
+  }
+  Value *CreateURem(Value *LHS, Value *RHS, const Twine &Name = "") {
+    if (Constant *LC = dyn_cast<Constant>(LHS))
+      if (Constant *RC = dyn_cast<Constant>(RHS))
+        return Insert(Folder.CreateURem(LC, RC), Name);
+    return Insert(BinaryOperator::CreateURem(LHS, RHS), Name);
+  }
+  Value *CreateSRem(Value *LHS, Value *RHS, const Twine &Name = "") {
+    if (Constant *LC = dyn_cast<Constant>(LHS))
+      if (Constant *RC = dyn_cast<Constant>(RHS))
+        return Insert(Folder.CreateSRem(LC, RC), Name);
+    return Insert(BinaryOperator::CreateSRem(LHS, RHS), Name);
+  }
+  Value *CreateFRem(Value *LHS, Value *RHS, const Twine &Name = "",
+                    MDNode *FPMathTag = nullptr) {
+    if (Constant *LC = dyn_cast<Constant>(LHS))
+      if (Constant *RC = dyn_cast<Constant>(RHS))
+        return Insert(Folder.CreateFRem(LC, RC), Name);
+    return Insert(AddFPMathAttributes(BinaryOperator::CreateFRem(LHS, RHS),
+                                      FPMathTag, FMF), Name);
+  }
+
+  Value *CreateShl(Value *LHS, Value *RHS, const Twine &Name = "",
+                   bool HasNUW = false, bool HasNSW = false) {
+    if (Constant *LC = dyn_cast<Constant>(LHS))
+      if (Constant *RC = dyn_cast<Constant>(RHS))
+        return Insert(Folder.CreateShl(LC, RC, HasNUW, HasNSW), Name);
+    return CreateInsertNUWNSWBinOp(Instruction::Shl, LHS, RHS, Name,
+                                   HasNUW, HasNSW);
+  }
+  Value *CreateShl(Value *LHS, const APInt &RHS, const Twine &Name = "",
+                   bool HasNUW = false, bool HasNSW = false) {
+    return CreateShl(LHS, ConstantInt::get(LHS->getType(), RHS), Name,
+                     HasNUW, HasNSW);
+  }
+  Value *CreateShl(Value *LHS, uint64_t RHS, const Twine &Name = "",
+                   bool HasNUW = false, bool HasNSW = false) {
+    return CreateShl(LHS, ConstantInt::get(LHS->getType(), RHS), Name,
+                     HasNUW, HasNSW);
+  }
+
+  Value *CreateLShr(Value *LHS, Value *RHS, const Twine &Name = "",
+                    bool isExact = false) {
+    if (Constant *LC = dyn_cast<Constant>(LHS))
+      if (Constant *RC = dyn_cast<Constant>(RHS))
+        return Insert(Folder.CreateLShr(LC, RC, isExact), Name);
+    if (!isExact)
+      return Insert(BinaryOperator::CreateLShr(LHS, RHS), Name);
+    return Insert(BinaryOperator::CreateExactLShr(LHS, RHS), Name);
+  }
+  Value *CreateLShr(Value *LHS, const APInt &RHS, const Twine &Name = "",
+                    bool isExact = false) {
+    return CreateLShr(LHS, ConstantInt::get(LHS->getType(), RHS), Name,isExact);
+  }
+  Value *CreateLShr(Value *LHS, uint64_t RHS, const Twine &Name = "",
+                    bool isExact = false) {
+    return CreateLShr(LHS, ConstantInt::get(LHS->getType(), RHS), Name,isExact);
+  }
+
+  Value *CreateAShr(Value *LHS, Value *RHS, const Twine &Name = "",
+                    bool isExact = false) {
+    if (Constant *LC = dyn_cast<Constant>(LHS))
+      if (Constant *RC = dyn_cast<Constant>(RHS))
+        return Insert(Folder.CreateAShr(LC, RC, isExact), Name);
+    if (!isExact)
+      return Insert(BinaryOperator::CreateAShr(LHS, RHS), Name);
+    return Insert(BinaryOperator::CreateExactAShr(LHS, RHS), Name);
+  }
+  Value *CreateAShr(Value *LHS, const APInt &RHS, const Twine &Name = "",
+                    bool isExact = false) {
+    return CreateAShr(LHS, ConstantInt::get(LHS->getType(), RHS), Name,isExact);
+  }
+  Value *CreateAShr(Value *LHS, uint64_t RHS, const Twine &Name = "",
+                    bool isExact = false) {
+    return CreateAShr(LHS, ConstantInt::get(LHS->getType(), RHS), Name,isExact);
+  }
+
+  Value *CreateAnd(Value *LHS, Value *RHS, const Twine &Name = "") {
+    if (Constant *RC = dyn_cast<Constant>(RHS)) {
+      if (isa<ConstantInt>(RC) && cast<ConstantInt>(RC)->isMinusOne())
+        return LHS;
+      if (Constant *LC = dyn_cast<Constant>(LHS))
+        return Insert(Folder.CreateAnd(LC, RC), Name);
+    }
+    return Insert(BinaryOperator::CreateAnd(LHS, RHS), Name);
+  }
+  Value *CreateAnd(Value *LHS, const APInt &RHS, const Twine &Name = "") {
+    return CreateAnd(LHS, ConstantInt::get(LHS->getType(), RHS), Name);
+  }
+  Value *CreateAnd(Value *LHS, uint64_t RHS, const Twine &Name = "") {
+    return CreateAnd(LHS, ConstantInt::get(LHS->getType(), RHS), Name);
+  }
+
+  Value *CreateOr(Value *LHS, Value *RHS, const Twine &Name = "") {
+    if (Constant *RC = dyn_cast<Constant>(RHS)) {
+      if (RC->isNullValue())
+        return LHS;
+      if (Constant *LC = dyn_cast<Constant>(LHS))
+        return Insert(Folder.CreateOr(LC, RC), Name);
+    }
+    return Insert(BinaryOperator::CreateOr(LHS, RHS), Name);
+  }
+  Value *CreateOr(Value *LHS, const APInt &RHS, const Twine &Name = "") {
+    return CreateOr(LHS, ConstantInt::get(LHS->getType(), RHS), Name);
+  }
+  Value *CreateOr(Value *LHS, uint64_t RHS, const Twine &Name = "") {
+    return CreateOr(LHS, ConstantInt::get(LHS->getType(), RHS), Name);
+  }
+
+  Value *CreateXor(Value *LHS, Value *RHS, const Twine &Name = "") {
+    if (Constant *LC = dyn_cast<Constant>(LHS))
+      if (Constant *RC = dyn_cast<Constant>(RHS))
+        return Insert(Folder.CreateXor(LC, RC), Name);
+    return Insert(BinaryOperator::CreateXor(LHS, RHS), Name);
+  }
+  Value *CreateXor(Value *LHS, const APInt &RHS, const Twine &Name = "") {
+    return CreateXor(LHS, ConstantInt::get(LHS->getType(), RHS), Name);
+  }
+  Value *CreateXor(Value *LHS, uint64_t RHS, const Twine &Name = "") {
+    return CreateXor(LHS, ConstantInt::get(LHS->getType(), RHS), Name);
+  }
+
+  Value *CreateBinOp(Instruction::BinaryOps Opc,
+                     Value *LHS, Value *RHS, const Twine &Name = "",
+                     MDNode *FPMathTag = nullptr) {
+    if (Constant *LC = dyn_cast<Constant>(LHS))
+      if (Constant *RC = dyn_cast<Constant>(RHS))
+        return Insert(Folder.CreateBinOp(Opc, LC, RC), Name);
+    Instruction *BinOp = BinaryOperator::Create(Opc, LHS, RHS);
+    if (isa<FPMathOperator>(BinOp))
+      BinOp = AddFPMathAttributes(BinOp, FPMathTag, FMF);
+    return Insert(BinOp, Name);
+  }
+
+  Value *CreateNeg(Value *V, const Twine &Name = "",
+                   bool HasNUW = false, bool HasNSW = false) {
+    if (Constant *VC = dyn_cast<Constant>(V))
+      return Insert(Folder.CreateNeg(VC, HasNUW, HasNSW), Name);
+    BinaryOperator *BO = Insert(BinaryOperator::CreateNeg(V), Name);
+    if (HasNUW) BO->setHasNoUnsignedWrap();
+    if (HasNSW) BO->setHasNoSignedWrap();
+    return BO;
+  }
+  Value *CreateNSWNeg(Value *V, const Twine &Name = "") {
+    return CreateNeg(V, Name, false, true);
+  }
+  Value *CreateNUWNeg(Value *V, const Twine &Name = "") {
+    return CreateNeg(V, Name, true, false);
+  }
+  Value *CreateFNeg(Value *V, const Twine &Name = "",
+                    MDNode *FPMathTag = nullptr) {
+    if (Constant *VC = dyn_cast<Constant>(V))
+      return Insert(Folder.CreateFNeg(VC), Name);
+    return Insert(AddFPMathAttributes(BinaryOperator::CreateFNeg(V),
+                                      FPMathTag, FMF), Name);
+  }
+  Value *CreateNot(Value *V, const Twine &Name = "") {
+    if (Constant *VC = dyn_cast<Constant>(V))
+      return Insert(Folder.CreateNot(VC), Name);
+    return Insert(BinaryOperator::CreateNot(V), Name);
+  }
+
+
+
+
+
+  AllocaInst *CreateAlloca(Type *Ty, unsigned AddrSpace,
+                           Value *ArraySize = nullptr, const Twine &Name = "") {
+    return Insert(new AllocaInst(Ty, AddrSpace, ArraySize), Name);
+  }
+
+  AllocaInst *CreateAlloca(Type *Ty, Value *ArraySize = nullptr,
+                           const Twine &Name = "") {
+    const DataLayout &DL = BB->getParent()->getParent()->getDataLayout();
+    return Insert(new AllocaInst(Ty, DL.getAllocaAddrSpace(), ArraySize), Name);
+  }
+
+
+  LoadInst *CreateLoad(Value *Ptr, const char *Name) {
+    return Insert(new LoadInst(Ptr), Name);
+  }
+  LoadInst *CreateLoad(Value *Ptr, const Twine &Name = "") {
+    return Insert(new LoadInst(Ptr), Name);
+  }
+  LoadInst *CreateLoad(Type *Ty, Value *Ptr, const Twine &Name = "") {
+    return Insert(new LoadInst(Ty, Ptr), Name);
+  }
+  LoadInst *CreateLoad(Value *Ptr, bool isVolatile, const Twine &Name = "") {
+    return Insert(new LoadInst(Ptr, nullptr, isVolatile), Name);
+  }
+  StoreInst *CreateStore(Value *Val, Value *Ptr, bool isVolatile = false) {
+    return Insert(new StoreInst(Val, Ptr, isVolatile));
+  }
+
+
+
+  LoadInst *CreateAlignedLoad(Value *Ptr, unsigned Align, const char *Name) {
+    LoadInst *LI = CreateLoad(Ptr, Name);
+    LI->setAlignment(Align);
+    return LI;
+  }
+  LoadInst *CreateAlignedLoad(Value *Ptr, unsigned Align,
+                              const Twine &Name = "") {
+    LoadInst *LI = CreateLoad(Ptr, Name);
+    LI->setAlignment(Align);
+    return LI;
+  }
+  LoadInst *CreateAlignedLoad(Value *Ptr, unsigned Align, bool isVolatile,
+                              const Twine &Name = "") {
+    LoadInst *LI = CreateLoad(Ptr, isVolatile, Name);
+    LI->setAlignment(Align);
+    return LI;
+  }
+  StoreInst *CreateAlignedStore(Value *Val, Value *Ptr, unsigned Align,
+                                bool isVolatile = false) {
+    StoreInst *SI = CreateStore(Val, Ptr, isVolatile);
+    SI->setAlignment(Align);
+    return SI;
+  }
+  FenceInst *CreateFence(AtomicOrdering Ordering,
+                         SyncScope::ID SSID = SyncScope::System,
+                         const Twine &Name = "") {
+    return Insert(new FenceInst(Context, Ordering, SSID), Name);
+  }
+  AtomicCmpXchgInst *
+  CreateAtomicCmpXchg(Value *Ptr, Value *Cmp, Value *New,
+                      AtomicOrdering SuccessOrdering,
+                      AtomicOrdering FailureOrdering,
+                      SyncScope::ID SSID = SyncScope::System) {
+    return Insert(new AtomicCmpXchgInst(Ptr, Cmp, New, SuccessOrdering,
+                                        FailureOrdering, SSID));
+  }
+  AtomicRMWInst *CreateAtomicRMW(AtomicRMWInst::BinOp Op, Value *Ptr, Value *Val,
+                                 AtomicOrdering Ordering,
+                                 SyncScope::ID SSID = SyncScope::System) {
+    return Insert(new AtomicRMWInst(Op, Ptr, Val, Ordering, SSID));
+  }
+  Value *CreateGEP(Value *Ptr, ArrayRef<Value *> IdxList,
+                   const Twine &Name = "") {
+    return CreateGEP(nullptr, Ptr, IdxList, Name);
+  }
+  Value *CreateGEP(Type *Ty, Value *Ptr, ArrayRef<Value *> IdxList,
+                   const Twine &Name = "") {
+    if (Constant *PC = dyn_cast<Constant>(Ptr)) {
+
+      size_t i, e;
+      for (i = 0, e = IdxList.size(); i != e; ++i)
+        if (!isa<Constant>(IdxList[i]))
+          break;
+      if (i == e)
+        return Insert(Folder.CreateGetElementPtr(Ty, PC, IdxList), Name);
+    }
+    return Insert(GetElementPtrInst::Create(Ty, Ptr, IdxList), Name);
+  }
+  Value *CreateInBoundsGEP(Value *Ptr, ArrayRef<Value *> IdxList,
+                           const Twine &Name = "") {
+    return CreateInBoundsGEP(nullptr, Ptr, IdxList, Name);
+  }
+  Value *CreateInBoundsGEP(Type *Ty, Value *Ptr, ArrayRef<Value *> IdxList,
+                           const Twine &Name = "") {
+    if (Constant *PC = dyn_cast<Constant>(Ptr)) {
+
+      size_t i, e;
+      for (i = 0, e = IdxList.size(); i != e; ++i)
+        if (!isa<Constant>(IdxList[i]))
+          break;
+      if (i == e)
+        return Insert(Folder.CreateInBoundsGetElementPtr(Ty, PC, IdxList),
+                      Name);
+    }
+    return Insert(GetElementPtrInst::CreateInBounds(Ty, Ptr, IdxList), Name);
+  }
+  Value *CreateGEP(Value *Ptr, Value *Idx, const Twine &Name = "") {
+    return CreateGEP(nullptr, Ptr, Idx, Name);
+  }
+  Value *CreateGEP(Type *Ty, Value *Ptr, Value *Idx, const Twine &Name = "") {
+    if (Constant *PC = dyn_cast<Constant>(Ptr))
+      if (Constant *IC = dyn_cast<Constant>(Idx))
+        return Insert(Folder.CreateGetElementPtr(Ty, PC, IC), Name);
+    return Insert(GetElementPtrInst::Create(Ty, Ptr, Idx), Name);
+  }
+  Value *CreateInBoundsGEP(Type *Ty, Value *Ptr, Value *Idx,
+                           const Twine &Name = "") {
+    if (Constant *PC = dyn_cast<Constant>(Ptr))
+      if (Constant *IC = dyn_cast<Constant>(Idx))
+        return Insert(Folder.CreateInBoundsGetElementPtr(Ty, PC, IC), Name);
+    return Insert(GetElementPtrInst::CreateInBounds(Ty, Ptr, Idx), Name);
+  }
+  Value *CreateConstGEP1_32(Value *Ptr, unsigned Idx0, const Twine &Name = "") {
+    return CreateConstGEP1_32(nullptr, Ptr, Idx0, Name);
+  }
+  Value *CreateConstGEP1_32(Type *Ty, Value *Ptr, unsigned Idx0,
+                            const Twine &Name = "") {
+    Value *Idx = ConstantInt::get(Type::getInt32Ty(Context), Idx0);
+
+    if (Constant *PC = dyn_cast<Constant>(Ptr))
+      return Insert(Folder.CreateGetElementPtr(Ty, PC, Idx), Name);
+
+    return Insert(GetElementPtrInst::Create(Ty, Ptr, Idx), Name);
+  }
+  Value *CreateConstInBoundsGEP1_32(Type *Ty, Value *Ptr, unsigned Idx0,
+                                    const Twine &Name = "") {
+    Value *Idx = ConstantInt::get(Type::getInt32Ty(Context), Idx0);
+
+    if (Constant *PC = dyn_cast<Constant>(Ptr))
+      return Insert(Folder.CreateInBoundsGetElementPtr(Ty, PC, Idx), Name);
+
+    return Insert(GetElementPtrInst::CreateInBounds(Ty, Ptr, Idx), Name);
+  }
+  Value *CreateConstGEP2_32(Type *Ty, Value *Ptr, unsigned Idx0, unsigned Idx1,
+                            const Twine &Name = "") {
+    Value *Idxs[] = {
+      ConstantInt::get(Type::getInt32Ty(Context), Idx0),
+      ConstantInt::get(Type::getInt32Ty(Context), Idx1)
+    };
+
+    if (Constant *PC = dyn_cast<Constant>(Ptr))
+      return Insert(Folder.CreateGetElementPtr(Ty, PC, Idxs), Name);
+
+    return Insert(GetElementPtrInst::Create(Ty, Ptr, Idxs), Name);
+  }
+  Value *CreateConstInBoundsGEP2_32(Type *Ty, Value *Ptr, unsigned Idx0,
+                                    unsigned Idx1, const Twine &Name = "") {
+    Value *Idxs[] = {
+      ConstantInt::get(Type::getInt32Ty(Context), Idx0),
+      ConstantInt::get(Type::getInt32Ty(Context), Idx1)
+    };
+
+    if (Constant *PC = dyn_cast<Constant>(Ptr))
+      return Insert(Folder.CreateInBoundsGetElementPtr(Ty, PC, Idxs), Name);
+
+    return Insert(GetElementPtrInst::CreateInBounds(Ty, Ptr, Idxs), Name);
+  }
+  Value *CreateConstGEP1_64(Value *Ptr, uint64_t Idx0, const Twine &Name = "") {
+    Value *Idx = ConstantInt::get(Type::getInt64Ty(Context), Idx0);
+
+    if (Constant *PC = dyn_cast<Constant>(Ptr))
+      return Insert(Folder.CreateGetElementPtr(nullptr, PC, Idx), Name);
+
+    return Insert(GetElementPtrInst::Create(nullptr, Ptr, Idx), Name);
+  }
+  Value *CreateConstInBoundsGEP1_64(Value *Ptr, uint64_t Idx0,
+                                    const Twine &Name = "") {
+    Value *Idx = ConstantInt::get(Type::getInt64Ty(Context), Idx0);
+
+    if (Constant *PC = dyn_cast<Constant>(Ptr))
+      return Insert(Folder.CreateInBoundsGetElementPtr(nullptr, PC, Idx), Name);
+
+    return Insert(GetElementPtrInst::CreateInBounds(nullptr, Ptr, Idx), Name);
+  }
+  Value *CreateConstGEP2_64(Value *Ptr, uint64_t Idx0, uint64_t Idx1,
+                    const Twine &Name = "") {
+    Value *Idxs[] = {
+      ConstantInt::get(Type::getInt64Ty(Context), Idx0),
+      ConstantInt::get(Type::getInt64Ty(Context), Idx1)
+    };
+
+    if (Constant *PC = dyn_cast<Constant>(Ptr))
+      return Insert(Folder.CreateGetElementPtr(nullptr, PC, Idxs), Name);
+
+    return Insert(GetElementPtrInst::Create(nullptr, Ptr, Idxs), Name);
+  }
+  Value *CreateConstInBoundsGEP2_64(Value *Ptr, uint64_t Idx0, uint64_t Idx1,
+                                    const Twine &Name = "") {
+    Value *Idxs[] = {
+      ConstantInt::get(Type::getInt64Ty(Context), Idx0),
+      ConstantInt::get(Type::getInt64Ty(Context), Idx1)
+    };
+
+    if (Constant *PC = dyn_cast<Constant>(Ptr))
+      return Insert(Folder.CreateInBoundsGetElementPtr(nullptr, PC, Idxs),
+                    Name);
+
+    return Insert(GetElementPtrInst::CreateInBounds(nullptr, Ptr, Idxs), Name);
+  }
+  Value *CreateStructGEP(Type *Ty, Value *Ptr, unsigned Idx,
+                         const Twine &Name = "") {
+    return CreateConstInBoundsGEP2_32(Ty, Ptr, 0, Idx, Name);
+  }
+
+
+
+  Value *CreateGlobalStringPtr(StringRef Str, const Twine &Name = "",
+                               unsigned AddressSpace = 0) {
+    GlobalVariable *gv = CreateGlobalString(Str, Name, AddressSpace);
+    Value *zero = ConstantInt::get(Type::getInt32Ty(Context), 0);
+    Value *Args[] = { zero, zero };
+    return CreateInBoundsGEP(gv->getValueType(), gv, Args, Name);
+  }
+
+
+
+
+
+  Value *CreateTrunc(Value *V, Type *DestTy, const Twine &Name = "") {
+    return CreateCast(Instruction::Trunc, V, DestTy, Name);
+  }
+  Value *CreateZExt(Value *V, Type *DestTy, const Twine &Name = "") {
+    return CreateCast(Instruction::ZExt, V, DestTy, Name);
+  }
+  Value *CreateSExt(Value *V, Type *DestTy, const Twine &Name = "") {
+    return CreateCast(Instruction::SExt, V, DestTy, Name);
+  }
+
+
+  Value *CreateZExtOrTrunc(Value *V, Type *DestTy,
+                           const Twine &Name = "") {
+    
+   ((
+   V->getType()->isIntOrIntVectorTy() && DestTy->isIntOrIntVectorTy() && "Can only zero extend/truncate integers!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "V->getType()->isIntOrIntVectorTy() && DestTy->isIntOrIntVectorTy() && \"Can only zero extend/truncate integers!\""
+   ,
+
+                                                    "/home/trippels/llvm/llvm/include/llvm/IR/IRBuilder.h"
+    ,
+
+                                                    1399
+    , __PRETTY_FUNCTION__))
+
+                                                     
+                                                    ;
+    Type *VTy = V->getType();
+    if (VTy->getScalarSizeInBits() < DestTy->getScalarSizeInBits())
+      return CreateZExt(V, DestTy, Name);
+    if (VTy->getScalarSizeInBits() > DestTy->getScalarSizeInBits())
+      return CreateTrunc(V, DestTy, Name);
+    return V;
+  }
+
+
+  Value *CreateSExtOrTrunc(Value *V, Type *DestTy,
+                           const Twine &Name = "") {
+    
+   ((
+   V->getType()->isIntOrIntVectorTy() && DestTy->isIntOrIntVectorTy() && "Can only sign extend/truncate integers!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "V->getType()->isIntOrIntVectorTy() && DestTy->isIntOrIntVectorTy() && \"Can only sign extend/truncate integers!\""
+   ,
+
+                                                    "/home/trippels/llvm/llvm/include/llvm/IR/IRBuilder.h"
+    ,
+
+                                                    1413
+    , __PRETTY_FUNCTION__))
+
+                                                     
+                                                    ;
+    Type *VTy = V->getType();
+    if (VTy->getScalarSizeInBits() < DestTy->getScalarSizeInBits())
+      return CreateSExt(V, DestTy, Name);
+    if (VTy->getScalarSizeInBits() > DestTy->getScalarSizeInBits())
+      return CreateTrunc(V, DestTy, Name);
+    return V;
+  }
+  Value *CreateFPToUI(Value *V, Type *DestTy, const Twine &Name = ""){
+    return CreateCast(Instruction::FPToUI, V, DestTy, Name);
+  }
+  Value *CreateFPToSI(Value *V, Type *DestTy, const Twine &Name = ""){
+    return CreateCast(Instruction::FPToSI, V, DestTy, Name);
+  }
+  Value *CreateUIToFP(Value *V, Type *DestTy, const Twine &Name = ""){
+    return CreateCast(Instruction::UIToFP, V, DestTy, Name);
+  }
+  Value *CreateSIToFP(Value *V, Type *DestTy, const Twine &Name = ""){
+    return CreateCast(Instruction::SIToFP, V, DestTy, Name);
+  }
+  Value *CreateFPTrunc(Value *V, Type *DestTy,
+                       const Twine &Name = "") {
+    return CreateCast(Instruction::FPTrunc, V, DestTy, Name);
+  }
+  Value *CreateFPExt(Value *V, Type *DestTy, const Twine &Name = "") {
+    return CreateCast(Instruction::FPExt, V, DestTy, Name);
+  }
+  Value *CreatePtrToInt(Value *V, Type *DestTy,
+                        const Twine &Name = "") {
+    return CreateCast(Instruction::PtrToInt, V, DestTy, Name);
+  }
+  Value *CreateIntToPtr(Value *V, Type *DestTy,
+                        const Twine &Name = "") {
+    return CreateCast(Instruction::IntToPtr, V, DestTy, Name);
+  }
+  Value *CreateBitCast(Value *V, Type *DestTy,
+                       const Twine &Name = "") {
+    return CreateCast(Instruction::BitCast, V, DestTy, Name);
+  }
+  Value *CreateAddrSpaceCast(Value *V, Type *DestTy,
+                             const Twine &Name = "") {
+    return CreateCast(Instruction::AddrSpaceCast, V, DestTy, Name);
+  }
+  Value *CreateZExtOrBitCast(Value *V, Type *DestTy,
+                             const Twine &Name = "") {
+    if (V->getType() == DestTy)
+      return V;
+    if (Constant *VC = dyn_cast<Constant>(V))
+      return Insert(Folder.CreateZExtOrBitCast(VC, DestTy), Name);
+    return Insert(CastInst::CreateZExtOrBitCast(V, DestTy), Name);
+  }
+  Value *CreateSExtOrBitCast(Value *V, Type *DestTy,
+                             const Twine &Name = "") {
+    if (V->getType() == DestTy)
+      return V;
+    if (Constant *VC = dyn_cast<Constant>(V))
+      return Insert(Folder.CreateSExtOrBitCast(VC, DestTy), Name);
+    return Insert(CastInst::CreateSExtOrBitCast(V, DestTy), Name);
+  }
+  Value *CreateTruncOrBitCast(Value *V, Type *DestTy,
+                              const Twine &Name = "") {
+    if (V->getType() == DestTy)
+      return V;
+    if (Constant *VC = dyn_cast<Constant>(V))
+      return Insert(Folder.CreateTruncOrBitCast(VC, DestTy), Name);
+    return Insert(CastInst::CreateTruncOrBitCast(V, DestTy), Name);
+  }
+  Value *CreateCast(Instruction::CastOps Op, Value *V, Type *DestTy,
+                    const Twine &Name = "") {
+    if (V->getType() == DestTy)
+      return V;
+    if (Constant *VC = dyn_cast<Constant>(V))
+      return Insert(Folder.CreateCast(Op, VC, DestTy), Name);
+    return Insert(CastInst::Create(Op, V, DestTy), Name);
+  }
+  Value *CreatePointerCast(Value *V, Type *DestTy,
+                           const Twine &Name = "") {
+    if (V->getType() == DestTy)
+      return V;
+    if (Constant *VC = dyn_cast<Constant>(V))
+      return Insert(Folder.CreatePointerCast(VC, DestTy), Name);
+    return Insert(CastInst::CreatePointerCast(V, DestTy), Name);
+  }
+
+  Value *CreatePointerBitCastOrAddrSpaceCast(Value *V, Type *DestTy,
+                                             const Twine &Name = "") {
+    if (V->getType() == DestTy)
+      return V;
+
+    if (Constant *VC = dyn_cast<Constant>(V)) {
+      return Insert(Folder.CreatePointerBitCastOrAddrSpaceCast(VC, DestTy),
+                    Name);
+    }
+
+    return Insert(CastInst::CreatePointerBitCastOrAddrSpaceCast(V, DestTy),
+                  Name);
+  }
+
+  Value *CreateIntCast(Value *V, Type *DestTy, bool isSigned,
+                       const Twine &Name = "") {
+    if (V->getType() == DestTy)
+      return V;
+    if (Constant *VC = dyn_cast<Constant>(V))
+      return Insert(Folder.CreateIntCast(VC, DestTy, isSigned), Name);
+    return Insert(CastInst::CreateIntegerCast(V, DestTy, isSigned), Name);
+  }
+
+  Value *CreateBitOrPointerCast(Value *V, Type *DestTy,
+                                const Twine &Name = "") {
+    if (V->getType() == DestTy)
+      return V;
+    if (V->getType()->isPtrOrPtrVectorTy() && DestTy->isIntOrIntVectorTy())
+      return CreatePtrToInt(V, DestTy, Name);
+    if (V->getType()->isIntOrIntVectorTy() && DestTy->isPtrOrPtrVectorTy())
+      return CreateIntToPtr(V, DestTy, Name);
+
+    return CreateBitCast(V, DestTy, Name);
+  }
+
+public:
+  Value *CreateFPCast(Value *V, Type *DestTy, const Twine &Name = "") {
+    if (V->getType() == DestTy)
+      return V;
+    if (Constant *VC = dyn_cast<Constant>(V))
+      return Insert(Folder.CreateFPCast(VC, DestTy), Name);
+    return Insert(CastInst::CreateFPCast(V, DestTy), Name);
+  }
+
+
+
+
+  Value *CreateIntCast(Value *, Type *, const char *) = delete;
+
+
+
+
+
+  Value *CreateICmpEQ(Value *LHS, Value *RHS, const Twine &Name = "") {
+    return CreateICmp(ICmpInst::ICMP_EQ, LHS, RHS, Name);
+  }
+  Value *CreateICmpNE(Value *LHS, Value *RHS, const Twine &Name = "") {
+    return CreateICmp(ICmpInst::ICMP_NE, LHS, RHS, Name);
+  }
+  Value *CreateICmpUGT(Value *LHS, Value *RHS, const Twine &Name = "") {
+    return CreateICmp(ICmpInst::ICMP_UGT, LHS, RHS, Name);
+  }
+  Value *CreateICmpUGE(Value *LHS, Value *RHS, const Twine &Name = "") {
+    return CreateICmp(ICmpInst::ICMP_UGE, LHS, RHS, Name);
+  }
+  Value *CreateICmpULT(Value *LHS, Value *RHS, const Twine &Name = "") {
+    return CreateICmp(ICmpInst::ICMP_ULT, LHS, RHS, Name);
+  }
+  Value *CreateICmpULE(Value *LHS, Value *RHS, const Twine &Name = "") {
+    return CreateICmp(ICmpInst::ICMP_ULE, LHS, RHS, Name);
+  }
+  Value *CreateICmpSGT(Value *LHS, Value *RHS, const Twine &Name = "") {
+    return CreateICmp(ICmpInst::ICMP_SGT, LHS, RHS, Name);
+  }
+  Value *CreateICmpSGE(Value *LHS, Value *RHS, const Twine &Name = "") {
+    return CreateICmp(ICmpInst::ICMP_SGE, LHS, RHS, Name);
+  }
+  Value *CreateICmpSLT(Value *LHS, Value *RHS, const Twine &Name = "") {
+    return CreateICmp(ICmpInst::ICMP_SLT, LHS, RHS, Name);
+  }
+  Value *CreateICmpSLE(Value *LHS, Value *RHS, const Twine &Name = "") {
+    return CreateICmp(ICmpInst::ICMP_SLE, LHS, RHS, Name);
+  }
+
+  Value *CreateFCmpOEQ(Value *LHS, Value *RHS, const Twine &Name = "",
+                       MDNode *FPMathTag = nullptr) {
+    return CreateFCmp(FCmpInst::FCMP_OEQ, LHS, RHS, Name, FPMathTag);
+  }
+  Value *CreateFCmpOGT(Value *LHS, Value *RHS, const Twine &Name = "",
+                       MDNode *FPMathTag = nullptr) {
+    return CreateFCmp(FCmpInst::FCMP_OGT, LHS, RHS, Name, FPMathTag);
+  }
+  Value *CreateFCmpOGE(Value *LHS, Value *RHS, const Twine &Name = "",
+                       MDNode *FPMathTag = nullptr) {
+    return CreateFCmp(FCmpInst::FCMP_OGE, LHS, RHS, Name, FPMathTag);
+  }
+  Value *CreateFCmpOLT(Value *LHS, Value *RHS, const Twine &Name = "",
+                       MDNode *FPMathTag = nullptr) {
+    return CreateFCmp(FCmpInst::FCMP_OLT, LHS, RHS, Name, FPMathTag);
+  }
+  Value *CreateFCmpOLE(Value *LHS, Value *RHS, const Twine &Name = "",
+                       MDNode *FPMathTag = nullptr) {
+    return CreateFCmp(FCmpInst::FCMP_OLE, LHS, RHS, Name, FPMathTag);
+  }
+  Value *CreateFCmpONE(Value *LHS, Value *RHS, const Twine &Name = "",
+                       MDNode *FPMathTag = nullptr) {
+    return CreateFCmp(FCmpInst::FCMP_ONE, LHS, RHS, Name, FPMathTag);
+  }
+  Value *CreateFCmpORD(Value *LHS, Value *RHS, const Twine &Name = "",
+                       MDNode *FPMathTag = nullptr) {
+    return CreateFCmp(FCmpInst::FCMP_ORD, LHS, RHS, Name, FPMathTag);
+  }
+  Value *CreateFCmpUNO(Value *LHS, Value *RHS, const Twine &Name = "",
+                       MDNode *FPMathTag = nullptr) {
+    return CreateFCmp(FCmpInst::FCMP_UNO, LHS, RHS, Name, FPMathTag);
+  }
+  Value *CreateFCmpUEQ(Value *LHS, Value *RHS, const Twine &Name = "",
+                       MDNode *FPMathTag = nullptr) {
+    return CreateFCmp(FCmpInst::FCMP_UEQ, LHS, RHS, Name, FPMathTag);
+  }
+  Value *CreateFCmpUGT(Value *LHS, Value *RHS, const Twine &Name = "",
+                       MDNode *FPMathTag = nullptr) {
+    return CreateFCmp(FCmpInst::FCMP_UGT, LHS, RHS, Name, FPMathTag);
+  }
+  Value *CreateFCmpUGE(Value *LHS, Value *RHS, const Twine &Name = "",
+                       MDNode *FPMathTag = nullptr) {
+    return CreateFCmp(FCmpInst::FCMP_UGE, LHS, RHS, Name, FPMathTag);
+  }
+  Value *CreateFCmpULT(Value *LHS, Value *RHS, const Twine &Name = "",
+                       MDNode *FPMathTag = nullptr) {
+    return CreateFCmp(FCmpInst::FCMP_ULT, LHS, RHS, Name, FPMathTag);
+  }
+  Value *CreateFCmpULE(Value *LHS, Value *RHS, const Twine &Name = "",
+                       MDNode *FPMathTag = nullptr) {
+    return CreateFCmp(FCmpInst::FCMP_ULE, LHS, RHS, Name, FPMathTag);
+  }
+  Value *CreateFCmpUNE(Value *LHS, Value *RHS, const Twine &Name = "",
+                       MDNode *FPMathTag = nullptr) {
+    return CreateFCmp(FCmpInst::FCMP_UNE, LHS, RHS, Name, FPMathTag);
+  }
+
+  Value *CreateICmp(CmpInst::Predicate P, Value *LHS, Value *RHS,
+                    const Twine &Name = "") {
+    if (Constant *LC = dyn_cast<Constant>(LHS))
+      if (Constant *RC = dyn_cast<Constant>(RHS))
+        return Insert(Folder.CreateICmp(P, LC, RC), Name);
+    return Insert(new ICmpInst(P, LHS, RHS), Name);
+  }
+  Value *CreateFCmp(CmpInst::Predicate P, Value *LHS, Value *RHS,
+                    const Twine &Name = "", MDNode *FPMathTag = nullptr) {
+    if (Constant *LC = dyn_cast<Constant>(LHS))
+      if (Constant *RC = dyn_cast<Constant>(RHS))
+        return Insert(Folder.CreateFCmp(P, LC, RC), Name);
+    return Insert(AddFPMathAttributes(new FCmpInst(P, LHS, RHS),
+                                      FPMathTag, FMF), Name);
+  }
+
+
+
+
+
+  PHINode *CreatePHI(Type *Ty, unsigned NumReservedValues,
+                     const Twine &Name = "") {
+    return Insert(PHINode::Create(Ty, NumReservedValues), Name);
+  }
+
+  CallInst *CreateCall(Value *Callee, ArrayRef<Value *> Args = None,
+                       const Twine &Name = "", MDNode *FPMathTag = nullptr) {
+    PointerType *PTy = cast<PointerType>(Callee->getType());
+    FunctionType *FTy = cast<FunctionType>(PTy->getElementType());
+    return CreateCall(FTy, Callee, Args, Name, FPMathTag);
+  }
+
+  CallInst *CreateCall(FunctionType *FTy, Value *Callee,
+                       ArrayRef<Value *> Args, const Twine &Name = "",
+                       MDNode *FPMathTag = nullptr) {
+    CallInst *CI = CallInst::Create(FTy, Callee, Args, DefaultOperandBundles);
+    if (isa<FPMathOperator>(CI))
+      CI = cast<CallInst>(AddFPMathAttributes(CI, FPMathTag, FMF));
+    return Insert(CI, Name);
+  }
+
+  CallInst *CreateCall(Value *Callee, ArrayRef<Value *> Args,
+                       ArrayRef<OperandBundleDef> OpBundles,
+                       const Twine &Name = "", MDNode *FPMathTag = nullptr) {
+    CallInst *CI = CallInst::Create(Callee, Args, OpBundles);
+    if (isa<FPMathOperator>(CI))
+      CI = cast<CallInst>(AddFPMathAttributes(CI, FPMathTag, FMF));
+    return Insert(CI, Name);
+  }
+
+  CallInst *CreateCall(Function *Callee, ArrayRef<Value *> Args,
+                       const Twine &Name = "", MDNode *FPMathTag = nullptr) {
+    return CreateCall(Callee->getFunctionType(), Callee, Args, Name, FPMathTag);
+  }
+
+  Value *CreateSelect(Value *C, Value *True, Value *False,
+                      const Twine &Name = "", Instruction *MDFrom = nullptr) {
+    if (Constant *CC = dyn_cast<Constant>(C))
+      if (Constant *TC = dyn_cast<Constant>(True))
+        if (Constant *FC = dyn_cast<Constant>(False))
+          return Insert(Folder.CreateSelect(CC, TC, FC), Name);
+
+    SelectInst *Sel = SelectInst::Create(C, True, False);
+    if (MDFrom) {
+      MDNode *Prof = MDFrom->getMetadata(LLVMContext::MD_prof);
+      MDNode *Unpred = MDFrom->getMetadata(LLVMContext::MD_unpredictable);
+      Sel = addBranchMetadata(Sel, Prof, Unpred);
+    }
+    return Insert(Sel, Name);
+  }
+
+  VAArgInst *CreateVAArg(Value *List, Type *Ty, const Twine &Name = "") {
+    return Insert(new VAArgInst(List, Ty), Name);
+  }
+
+  Value *CreateExtractElement(Value *Vec, Value *Idx,
+                              const Twine &Name = "") {
+    if (Constant *VC = dyn_cast<Constant>(Vec))
+      if (Constant *IC = dyn_cast<Constant>(Idx))
+        return Insert(Folder.CreateExtractElement(VC, IC), Name);
+    return Insert(ExtractElementInst::Create(Vec, Idx), Name);
+  }
+
+  Value *CreateExtractElement(Value *Vec, uint64_t Idx,
+                              const Twine &Name = "") {
+    return CreateExtractElement(Vec, getInt64(Idx), Name);
+  }
+
+  Value *CreateInsertElement(Value *Vec, Value *NewElt, Value *Idx,
+                             const Twine &Name = "") {
+    if (Constant *VC = dyn_cast<Constant>(Vec))
+      if (Constant *NC = dyn_cast<Constant>(NewElt))
+        if (Constant *IC = dyn_cast<Constant>(Idx))
+          return Insert(Folder.CreateInsertElement(VC, NC, IC), Name);
+    return Insert(InsertElementInst::Create(Vec, NewElt, Idx), Name);
+  }
+
+  Value *CreateInsertElement(Value *Vec, Value *NewElt, uint64_t Idx,
+                             const Twine &Name = "") {
+    return CreateInsertElement(Vec, NewElt, getInt64(Idx), Name);
+  }
+
+  Value *CreateShuffleVector(Value *V1, Value *V2, Value *Mask,
+                             const Twine &Name = "") {
+    if (Constant *V1C = dyn_cast<Constant>(V1))
+      if (Constant *V2C = dyn_cast<Constant>(V2))
+        if (Constant *MC = dyn_cast<Constant>(Mask))
+          return Insert(Folder.CreateShuffleVector(V1C, V2C, MC), Name);
+    return Insert(new ShuffleVectorInst(V1, V2, Mask), Name);
+  }
+
+  Value *CreateShuffleVector(Value *V1, Value *V2, ArrayRef<uint32_t> IntMask,
+                             const Twine &Name = "") {
+    Value *Mask = ConstantDataVector::get(Context, IntMask);
+    return CreateShuffleVector(V1, V2, Mask, Name);
+  }
+
+  Value *CreateExtractValue(Value *Agg,
+                            ArrayRef<unsigned> Idxs,
+                            const Twine &Name = "") {
+    if (Constant *AggC = dyn_cast<Constant>(Agg))
+      return Insert(Folder.CreateExtractValue(AggC, Idxs), Name);
+    return Insert(ExtractValueInst::Create(Agg, Idxs), Name);
+  }
+
+  Value *CreateInsertValue(Value *Agg, Value *Val,
+                           ArrayRef<unsigned> Idxs,
+                           const Twine &Name = "") {
+    if (Constant *AggC = dyn_cast<Constant>(Agg))
+      if (Constant *ValC = dyn_cast<Constant>(Val))
+        return Insert(Folder.CreateInsertValue(AggC, ValC, Idxs), Name);
+    return Insert(InsertValueInst::Create(Agg, Val, Idxs), Name);
+  }
+
+  LandingPadInst *CreateLandingPad(Type *Ty, unsigned NumClauses,
+                                   const Twine &Name = "") {
+    return Insert(LandingPadInst::Create(Ty, NumClauses), Name);
+  }
+
+
+
+
+
+
+  Value *CreateIsNull(Value *Arg, const Twine &Name = "") {
+    return CreateICmpEQ(Arg, Constant::getNullValue(Arg->getType()),
+                        Name);
+  }
+
+
+  Value *CreateIsNotNull(Value *Arg, const Twine &Name = "") {
+    return CreateICmpNE(Arg, Constant::getNullValue(Arg->getType()),
+                        Name);
+  }
+
+
+
+
+
+
+
+  Value *CreatePtrDiff(Value *LHS, Value *RHS, const Twine &Name = "") {
+    
+   ((
+   LHS->getType() == RHS->getType() && "Pointer subtraction operand types must match!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "LHS->getType() == RHS->getType() && \"Pointer subtraction operand types must match!\""
+   ,
+                                                          "/home/trippels/llvm/llvm/include/llvm/IR/IRBuilder.h"
+    ,
+                                                          1801
+    , __PRETTY_FUNCTION__))
+                                                           
+                                                          ;
+    PointerType *ArgType = cast<PointerType>(LHS->getType());
+    Value *LHS_int = CreatePtrToInt(LHS, Type::getInt64Ty(Context));
+    Value *RHS_int = CreatePtrToInt(RHS, Type::getInt64Ty(Context));
+    Value *Difference = CreateSub(LHS_int, RHS_int);
+    return CreateExactSDiv(Difference,
+                           ConstantExpr::getSizeOf(ArgType->getElementType()),
+                           Name);
+  }
+
+
+
+
+
+
+  Value *CreateInvariantGroupBarrier(Value *Ptr) {
+    
+   ((
+   isa<PointerType>(Ptr->getType()) && "invariant.group.barrier only applies to pointers."
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isa<PointerType>(Ptr->getType()) && \"invariant.group.barrier only applies to pointers.\""
+   ,
+                                                              "/home/trippels/llvm/llvm/include/llvm/IR/IRBuilder.h"
+    ,
+                                                              1818
+    , __PRETTY_FUNCTION__))
+                                                               
+                                                              ;
+    auto *PtrType = Ptr->getType();
+    auto *Int8PtrTy = getInt8PtrTy(PtrType->getPointerAddressSpace());
+    if (PtrType != Int8PtrTy)
+      Ptr = CreateBitCast(Ptr, Int8PtrTy);
+    Module *M = BB->getParent()->getParent();
+    Function *FnInvariantGroupBarrier = Intrinsic::getDeclaration(
+        M, Intrinsic::invariant_group_barrier, {Int8PtrTy});
+
+    
+   ((
+   FnInvariantGroupBarrier->getReturnType() == Int8PtrTy && FnInvariantGroupBarrier->getFunctionType()->getParamType(0) == Int8PtrTy && "InvariantGroupBarrier should take and return the same type"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "FnInvariantGroupBarrier->getReturnType() == Int8PtrTy && FnInvariantGroupBarrier->getFunctionType()->getParamType(0) == Int8PtrTy && \"InvariantGroupBarrier should take and return the same type\""
+   ,
+
+
+                                                                       "/home/trippels/llvm/llvm/include/llvm/IR/IRBuilder.h"
+    ,
+
+
+                                                                       1830
+    , __PRETTY_FUNCTION__))
+
+
+                                                                        
+                                                                       ;
+
+    CallInst *Fn = CreateCall(FnInvariantGroupBarrier, {Ptr});
+
+    if (PtrType != Int8PtrTy)
+      return CreateBitCast(Fn, PtrType);
+    return Fn;
+  }
+
+
+
+  Value *CreateVectorSplat(unsigned NumElts, Value *V, const Twine &Name = "") {
+    
+   ((
+   NumElts > 0 && "Cannot splat to an empty vector!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "NumElts > 0 && \"Cannot splat to an empty vector!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/IRBuilder.h", 1842, __PRETTY_FUNCTION__))
+                                                            ;
+
+
+    Type *I32Ty = getInt32Ty();
+    Value *Undef = UndefValue::get(VectorType::get(V->getType(), NumElts));
+    V = CreateInsertElement(Undef, V, ConstantInt::get(I32Ty, 0),
+                            Name + ".splatinsert");
+
+
+    Value *Zeros = ConstantAggregateZero::get(VectorType::get(I32Ty, NumElts));
+    return CreateShuffleVector(V, Undef, Zeros, Name + ".splat");
+  }
+
+
+  Value *CreateExtractInteger(const DataLayout &DL, Value *From,
+                              IntegerType *ExtractedTy, uint64_t Offset,
+                              const Twine &Name) {
+    IntegerType *IntTy = cast<IntegerType>(From->getType());
+    
+   ((
+   DL.getTypeStoreSize(ExtractedTy) + Offset <= DL.getTypeStoreSize(IntTy) && "Element extends past full value"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "DL.getTypeStoreSize(ExtractedTy) + Offset <= DL.getTypeStoreSize(IntTy) && \"Element extends past full value\""
+   ,
+
+                                            "/home/trippels/llvm/llvm/include/llvm/IR/IRBuilder.h"
+    ,
+
+                                            1862
+    , __PRETTY_FUNCTION__))
+
+                                             
+                                            ;
+    uint64_t ShAmt = 8 * Offset;
+    Value *V = From;
+    if (DL.isBigEndian())
+      ShAmt = 8 * (DL.getTypeStoreSize(IntTy) -
+                   DL.getTypeStoreSize(ExtractedTy) - Offset);
+    if (ShAmt) {
+      V = CreateLShr(V, ShAmt, Name + ".shift");
+    }
+    
+   ((
+   ExtractedTy->getBitWidth() <= IntTy->getBitWidth() && "Cannot extract to a larger integer!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "ExtractedTy->getBitWidth() <= IntTy->getBitWidth() && \"Cannot extract to a larger integer!\""
+   ,
+                                                "/home/trippels/llvm/llvm/include/llvm/IR/IRBuilder.h"
+    ,
+                                                1872
+    , __PRETTY_FUNCTION__))
+                                                 
+                                                ;
+    if (ExtractedTy != IntTy) {
+      V = CreateTrunc(V, ExtractedTy, Name + ".trunc");
+    }
+    return V;
+  }
+
+private:
+
+
+
+  CallInst *CreateAlignmentAssumptionHelper(const DataLayout &DL,
+                                            Value *PtrValue, Value *Mask,
+                                            Type *IntPtrTy,
+                                            Value *OffsetValue) {
+    Value *PtrIntValue = CreatePtrToInt(PtrValue, IntPtrTy, "ptrint");
+
+    if (OffsetValue) {
+      bool IsOffsetZero = false;
+      if (ConstantInt *CI = dyn_cast<ConstantInt>(OffsetValue))
+        IsOffsetZero = CI->isZero();
+
+      if (!IsOffsetZero) {
+        if (OffsetValue->getType() != IntPtrTy)
+          OffsetValue = CreateIntCast(OffsetValue, IntPtrTy, true,
+                                      "offsetcast");
+        PtrIntValue = CreateSub(PtrIntValue, OffsetValue, "offsetptr");
+      }
+    }
+
+    Value *Zero = ConstantInt::get(IntPtrTy, 0);
+    Value *MaskedPtr = CreateAnd(PtrIntValue, Mask, "maskedptr");
+    Value *InvCond = CreateICmpEQ(MaskedPtr, Zero, "maskcond");
+    return CreateAssumption(InvCond);
+  }
+
+public:
+
+
+
+
+
+
+  CallInst *CreateAlignmentAssumption(const DataLayout &DL, Value *PtrValue,
+                                      unsigned Alignment,
+                                      Value *OffsetValue = nullptr) {
+    
+   ((
+   isa<PointerType>(PtrValue->getType()) && "trying to create an alignment assumption on a non-pointer?"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isa<PointerType>(PtrValue->getType()) && \"trying to create an alignment assumption on a non-pointer?\""
+   ,
+                                                                       "/home/trippels/llvm/llvm/include/llvm/IR/IRBuilder.h"
+    ,
+                                                                       1919
+    , __PRETTY_FUNCTION__))
+                                                                        
+                                                                       ;
+    PointerType *PtrTy = cast<PointerType>(PtrValue->getType());
+    Type *IntPtrTy = getIntPtrTy(DL, PtrTy->getAddressSpace());
+
+    Value *Mask = ConstantInt::get(IntPtrTy, Alignment > 0 ? Alignment - 1 : 0);
+    return CreateAlignmentAssumptionHelper(DL, PtrValue, Mask, IntPtrTy,
+                                           OffsetValue);
+  }
+  CallInst *CreateAlignmentAssumption(const DataLayout &DL, Value *PtrValue,
+                                      Value *Alignment,
+                                      Value *OffsetValue = nullptr) {
+    
+   ((
+   isa<PointerType>(PtrValue->getType()) && "trying to create an alignment assumption on a non-pointer?"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isa<PointerType>(PtrValue->getType()) && \"trying to create an alignment assumption on a non-pointer?\""
+   ,
+                                                                       "/home/trippels/llvm/llvm/include/llvm/IR/IRBuilder.h"
+    ,
+                                                                       1941
+    , __PRETTY_FUNCTION__))
+                                                                        
+                                                                       ;
+    PointerType *PtrTy = cast<PointerType>(PtrValue->getType());
+    Type *IntPtrTy = getIntPtrTy(DL, PtrTy->getAddressSpace());
+
+    if (Alignment->getType() != IntPtrTy)
+      Alignment = CreateIntCast(Alignment, IntPtrTy, true,
+                                "alignmentcast");
+    Value *IsPositive =
+        CreateICmp(CmpInst::ICMP_SGT, Alignment,
+                   ConstantInt::get(Alignment->getType(), 0), "ispositive");
+    Value *PositiveMask =
+        CreateSub(Alignment, ConstantInt::get(IntPtrTy, 1), "positivemask");
+    Value *Mask = CreateSelect(IsPositive, PositiveMask,
+                               ConstantInt::get(IntPtrTy, 0), "mask");
+
+    return CreateAlignmentAssumptionHelper(DL, PtrValue, Mask, IntPtrTy,
+                                           OffsetValue);
+  }
+};
+
+
+inline IRBuilder<> *unwrap(LLVMBuilderRef P) { return reinterpret_cast<IRBuilder<>*>(P); } inline LLVMBuilderRef wrap(const IRBuilder<> *P) { return reinterpret_cast<LLVMBuilderRef>(const_cast<IRBuilder<>*>(P)); }
+
+}
+
+namespace llvm {
+
+template <typename T> class ArrayRef;
+class DemandedBits;
+class GetElementPtrInst;
+class Loop;
+class ScalarEvolution;
+class TargetTransformInfo;
+class Type;
+class Value;
+
+namespace Intrinsic {
+enum ID : unsigned;
+}
+
+
+
+
+
+bool isTriviallyVectorizable(Intrinsic::ID ID);
+
+
+
+bool hasVectorInstrinsicScalarOpd(Intrinsic::ID ID, unsigned ScalarOpdIdx);
+
+
+
+
+Intrinsic::ID getVectorIntrinsicIDForCall(const CallInst *CI,
+                                          const TargetLibraryInfo *TLI);
+
+
+
+
+unsigned getGEPInductionOperand(const GetElementPtrInst *Gep);
+
+
+
+
+Value *stripGetElementPtr(Value *Ptr, ScalarEvolution *SE, Loop *Lp);
+
+
+Value *getUniqueCastUse(Value *Ptr, Loop *Lp, Type *Ty);
+
+
+
+Value *getStrideFromPointer(Value *Ptr, ScalarEvolution *SE, Loop *Lp);
+
+
+
+
+Value *findScalarElement(Value *V, unsigned EltNo);
+
+
+
+
+const Value *getSplatValue(const Value *V);
+MapVector<Instruction*, uint64_t>
+computeMinimumValueSizes(ArrayRef<BasicBlock*> Blocks,
+                         DemandedBits &DB,
+                         const TargetTransformInfo *TTI=nullptr);
+Instruction *propagateMetadata(Instruction *I, ArrayRef<Value *> VL);
+Constant *createInterleaveMask(IRBuilder<> &Builder, unsigned VF,
+                               unsigned NumVecs);
+Constant *createStrideMask(IRBuilder<> &Builder, unsigned Start,
+                           unsigned Stride, unsigned VF);
+Constant *createSequentialMask(IRBuilder<> &Builder, unsigned Start,
+                               unsigned NumInts, unsigned NumUndefs);
+Value *concatenateVectors(IRBuilder<> &Builder, ArrayRef<Value *> Vecs);
+
+}
+
+
+
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+
+namespace llvm {
+
+  template<typename ItTy = User::const_op_iterator>
+  class generic_gep_type_iterator
+    : public std::iterator<std::forward_iterator_tag, Type *, ptrdiff_t> {
+    using super = std::iterator<std::forward_iterator_tag, Type *, ptrdiff_t>;
+
+    ItTy OpIt;
+    PointerUnion<StructType *, Type *> CurTy;
+    enum : uint64_t { Unbounded = -1ull };
+    uint64_t NumElements = Unbounded;
+
+    generic_gep_type_iterator() = default;
+
+  public:
+    static generic_gep_type_iterator begin(Type *Ty, ItTy It) {
+      generic_gep_type_iterator I;
+      I.CurTy = Ty;
+      I.OpIt = It;
+      return I;
+    }
+
+    static generic_gep_type_iterator end(ItTy It) {
+      generic_gep_type_iterator I;
+      I.OpIt = It;
+      return I;
+    }
+
+    bool operator==(const generic_gep_type_iterator& x) const {
+      return OpIt == x.OpIt;
+    }
+
+    bool operator!=(const generic_gep_type_iterator& x) const {
+      return !operator==(x);
+    }
+
+
+
+
+
+    Type *getIndexedType() const {
+      if (auto *T = CurTy.dyn_cast<Type *>())
+        return T;
+      return CurTy.get<StructType *>()->getTypeAtIndex(getOperand());
+    }
+
+    Value *getOperand() const { return const_cast<Value *>(&**OpIt); }
+
+    generic_gep_type_iterator& operator++() {
+      Type *Ty = getIndexedType();
+      if (auto *STy = dyn_cast<SequentialType>(Ty)) {
+        CurTy = STy->getElementType();
+        NumElements = STy->getNumElements();
+      } else
+        CurTy = dyn_cast<StructType>(Ty);
+      ++OpIt;
+      return *this;
+    }
+
+    generic_gep_type_iterator operator++(int) {
+      generic_gep_type_iterator tmp = *this; ++*this; return tmp;
+    }
+    bool isStruct() const { return CurTy.is<StructType *>(); }
+    bool isSequential() const { return CurTy.is<Type *>(); }
+
+    StructType *getStructType() const { return CurTy.get<StructType *>(); }
+
+    StructType *getStructTypeOrNull() const {
+      return CurTy.dyn_cast<StructType *>();
+    }
+
+    bool isBoundedSequential() const {
+      return isSequential() && NumElements != Unbounded;
+    }
+
+    uint64_t getSequentialNumElements() const {
+      
+     ((
+     isBoundedSequential()
+     ) ? static_cast<void> (0) : __assert_fail (
+     "isBoundedSequential()"
+     , "/home/trippels/llvm/llvm/include/llvm/IR/GetElementPtrTypeIterator.h", 121, __PRETTY_FUNCTION__))
+                                  ;
+      return NumElements;
+    }
+  };
+
+  using gep_type_iterator = generic_gep_type_iterator<>;
+
+  inline gep_type_iterator gep_type_begin(const User *GEP) {
+    auto *GEPOp = cast<GEPOperator>(GEP);
+    return gep_type_iterator::begin(
+        GEPOp->getSourceElementType(),
+        GEP->op_begin() + 1);
+  }
+
+  inline gep_type_iterator gep_type_end(const User *GEP) {
+    return gep_type_iterator::end(GEP->op_end());
+  }
+
+  inline gep_type_iterator gep_type_begin(const User &GEP) {
+    auto &GEPOp = cast<GEPOperator>(GEP);
+    return gep_type_iterator::begin(
+        GEPOp.getSourceElementType(),
+        GEP.op_begin() + 1);
+  }
+
+  inline gep_type_iterator gep_type_end(const User &GEP) {
+    return gep_type_iterator::end(GEP.op_end());
+  }
+
+  template<typename T>
+  inline generic_gep_type_iterator<const T *>
+  gep_type_begin(Type *Op0, ArrayRef<T> A) {
+    return generic_gep_type_iterator<const T *>::begin(Op0, A.begin());
+  }
+
+  template<typename T>
+  inline generic_gep_type_iterator<const T *>
+  gep_type_end(Type * , ArrayRef<T> A) {
+    return generic_gep_type_iterator<const T *>::end(A.end());
+  }
+
+}
+
+
+
+namespace llvm {
+
+
+
+class TargetTransformInfoImplBase {
+protected:
+  typedef TargetTransformInfo TTI;
+
+  const DataLayout &DL;
+
+  explicit TargetTransformInfoImplBase(const DataLayout &DL) : DL(DL) {}
+
+public:
+
+  TargetTransformInfoImplBase(const TargetTransformInfoImplBase &Arg)
+      : DL(Arg.DL) {}
+  TargetTransformInfoImplBase(TargetTransformInfoImplBase &&Arg) : DL(Arg.DL) {}
+
+  const DataLayout &getDataLayout() const { return DL; }
+
+  unsigned getOperationCost(unsigned Opcode, Type *Ty, Type *OpTy) {
+    switch (Opcode) {
+    default:
+
+      return TTI::TCC_Basic;
+
+    case Instruction::GetElementPtr:
+      ::llvm::llvm_unreachable_internal("Use getGEPCost for GEP operations!", "/home/trippels/llvm/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h", 55);
+
+    case Instruction::BitCast:
+      
+     ((
+     OpTy && "Cast instructions must provide the operand type"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "OpTy && \"Cast instructions must provide the operand type\""
+     , "/home/trippels/llvm/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h", 58, __PRETTY_FUNCTION__))
+                                                                      ;
+      if (Ty == OpTy || (Ty->isPointerTy() && OpTy->isPointerTy()))
+
+        return TTI::TCC_Free;
+
+
+      return TTI::TCC_Basic;
+
+    case Instruction::FDiv:
+    case Instruction::FRem:
+    case Instruction::SDiv:
+    case Instruction::SRem:
+    case Instruction::UDiv:
+    case Instruction::URem:
+      return TTI::TCC_Expensive;
+
+    case Instruction::IntToPtr: {
+
+
+      unsigned OpSize = OpTy->getScalarSizeInBits();
+      if (DL.isLegalInteger(OpSize) &&
+          OpSize <= DL.getPointerTypeSizeInBits(Ty))
+        return TTI::TCC_Free;
+
+
+      return TTI::TCC_Basic;
+    }
+    case Instruction::PtrToInt: {
+
+
+      unsigned DestSize = Ty->getScalarSizeInBits();
+      if (DL.isLegalInteger(DestSize) &&
+          DestSize >= DL.getPointerTypeSizeInBits(OpTy))
+        return TTI::TCC_Free;
+
+
+      return TTI::TCC_Basic;
+    }
+    case Instruction::Trunc:
+
+
+      if (DL.isLegalInteger(DL.getTypeSizeInBits(Ty)))
+        return TTI::TCC_Free;
+
+      return TTI::TCC_Basic;
+    }
+  }
+
+  int getGEPCost(Type *PointeeType, const Value *Ptr,
+                 ArrayRef<const Value *> Operands) {
+
+
+    for (unsigned Idx = 0, Size = Operands.size(); Idx != Size; ++Idx)
+      if (!isa<Constant>(Operands[Idx]))
+        return TTI::TCC_Basic;
+
+    return TTI::TCC_Free;
+  }
+
+  unsigned getEstimatedNumberOfCaseClusters(const SwitchInst &SI,
+                                            unsigned &JTSize) {
+    JTSize = 0;
+    return SI.getNumCases();
+  }
+
+  int getExtCost(const Instruction *I, const Value *Src) {
+    return TTI::TCC_Basic;
+  }
+
+  unsigned getCallCost(FunctionType *FTy, int NumArgs) {
+    
+   ((
+   FTy && "FunctionType must be provided to this routine."
+   ) ? static_cast<void> (0) : __assert_fail (
+   "FTy && \"FunctionType must be provided to this routine.\""
+   , "/home/trippels/llvm/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h", 128, __PRETTY_FUNCTION__))
+                                                                  ;
+
+
+
+
+
+    if (NumArgs < 0)
+
+
+      NumArgs = FTy->getNumParams();
+
+    return TTI::TCC_Basic * (NumArgs + 1);
+  }
+
+  unsigned getInliningThresholdMultiplier() { return 1; }
+
+  unsigned getIntrinsicCost(Intrinsic::ID IID, Type *RetTy,
+                            ArrayRef<Type *> ParamTys) {
+    switch (IID) {
+    default:
+
+
+
+      return TTI::TCC_Basic;
+
+    case Intrinsic::annotation:
+    case Intrinsic::assume:
+    case Intrinsic::sideeffect:
+    case Intrinsic::dbg_declare:
+    case Intrinsic::dbg_value:
+    case Intrinsic::invariant_start:
+    case Intrinsic::invariant_end:
+    case Intrinsic::lifetime_start:
+    case Intrinsic::lifetime_end:
+    case Intrinsic::objectsize:
+    case Intrinsic::ptr_annotation:
+    case Intrinsic::var_annotation:
+    case Intrinsic::experimental_gc_result:
+    case Intrinsic::experimental_gc_relocate:
+    case Intrinsic::coro_alloc:
+    case Intrinsic::coro_begin:
+    case Intrinsic::coro_free:
+    case Intrinsic::coro_end:
+    case Intrinsic::coro_frame:
+    case Intrinsic::coro_size:
+    case Intrinsic::coro_suspend:
+    case Intrinsic::coro_param:
+    case Intrinsic::coro_subfn_addr:
+
+      return TTI::TCC_Free;
+    }
+  }
+
+  bool hasBranchDivergence() { return false; }
+
+  bool isSourceOfDivergence(const Value *V) { return false; }
+
+  bool isAlwaysUniform(const Value *V) { return false; }
+
+  unsigned getFlatAddressSpace () {
+    return -1;
+  }
+
+  bool isLoweredToCall(const Function *F) {
+    
+   ((
+   F && "A concrete function must be provided to this routine."
+   ) ? static_cast<void> (0) : __assert_fail (
+   "F && \"A concrete function must be provided to this routine.\""
+   , "/home/trippels/llvm/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h", 192, __PRETTY_FUNCTION__))
+                                                                       ;
+
+
+
+
+
+
+    if (F->isIntrinsic())
+      return false;
+
+    if (F->hasLocalLinkage() || !F->hasName())
+      return true;
+
+    StringRef Name = F->getName();
+
+
+    if (Name == "copysign" || Name == "copysignf" || Name == "copysignl" ||
+        Name == "fabs" || Name == "fabsf" || Name == "fabsl" || Name == "sin" ||
+        Name == "fmin" || Name == "fminf" || Name == "fminl" ||
+        Name == "fmax" || Name == "fmaxf" || Name == "fmaxl" ||
+        Name == "sinf" || Name == "sinl" || Name == "cos" || Name == "cosf" ||
+        Name == "cosl" || Name == "sqrt" || Name == "sqrtf" || Name == "sqrtl")
+      return false;
+
+
+    if (Name == "pow" || Name == "powf" || Name == "powl" || Name == "exp2" ||
+        Name == "exp2l" || Name == "exp2f" || Name == "floor" ||
+        Name == "floorf" || Name == "ceil" || Name == "round" ||
+        Name == "ffs" || Name == "ffsl" || Name == "abs" || Name == "labs" ||
+        Name == "llabs")
+      return false;
+
+    return true;
+  }
+
+  void getUnrollingPreferences(Loop *, ScalarEvolution &,
+                               TTI::UnrollingPreferences &) {}
+
+  bool isLegalAddImmediate(int64_t Imm) { return false; }
+
+  bool isLegalICmpImmediate(int64_t Imm) { return false; }
+
+  bool isLegalAddressingMode(Type *Ty, GlobalValue *BaseGV, int64_t BaseOffset,
+                             bool HasBaseReg, int64_t Scale,
+                             unsigned AddrSpace, Instruction *I = nullptr) {
+
+
+    return !BaseGV && BaseOffset == 0 && (Scale == 0 || Scale == 1);
+  }
+
+  bool isLSRCostLess(TTI::LSRCost &C1, TTI::LSRCost &C2) {
+    return std::tie(C1.NumRegs, C1.AddRecCost, C1.NumIVMuls, C1.NumBaseAdds,
+                    C1.ScaleCost, C1.ImmCost, C1.SetupCost) <
+           std::tie(C2.NumRegs, C2.AddRecCost, C2.NumIVMuls, C2.NumBaseAdds,
+                    C2.ScaleCost, C2.ImmCost, C2.SetupCost);
+  }
+
+  bool isLegalMaskedStore(Type *DataType) { return false; }
+
+  bool isLegalMaskedLoad(Type *DataType) { return false; }
+
+  bool isLegalMaskedScatter(Type *DataType) { return false; }
+
+  bool isLegalMaskedGather(Type *DataType) { return false; }
+
+  bool hasDivRemOp(Type *DataType, bool IsSigned) { return false; }
+
+  bool hasVolatileVariant(Instruction *I, unsigned AddrSpace) { return false; }
+
+  bool prefersVectorizedAddressing() { return true; }
+
+  int getScalingFactorCost(Type *Ty, GlobalValue *BaseGV, int64_t BaseOffset,
+                           bool HasBaseReg, int64_t Scale, unsigned AddrSpace) {
+
+    if (isLegalAddressingMode(Ty, BaseGV, BaseOffset, HasBaseReg,
+                              Scale, AddrSpace))
+      return 0;
+    return -1;
+  }
+
+  bool LSRWithInstrQueries() { return false; }
+
+  bool isTruncateFree(Type *Ty1, Type *Ty2) { return false; }
+
+  bool isProfitableToHoist(Instruction *I) { return true; }
+
+  bool isTypeLegal(Type *Ty) { return false; }
+
+  unsigned getJumpBufAlignment() { return 0; }
+
+  unsigned getJumpBufSize() { return 0; }
+
+  bool shouldBuildLookupTables() { return true; }
+  bool shouldBuildLookupTablesForConstant(Constant *C) { return true; }
+
+  unsigned getScalarizationOverhead(Type *Ty, bool Insert, bool Extract) {
+    return 0;
+  }
+
+  unsigned getOperandsScalarizationOverhead(ArrayRef<const Value *> Args,
+                                            unsigned VF) { return 0; }
+
+  bool supportsEfficientVectorElementLoadStore() { return false; }
+
+  bool enableAggressiveInterleaving(bool LoopHasReductions) { return false; }
+
+  const TTI::MemCmpExpansionOptions *enableMemCmpExpansion(
+      bool IsZeroCmp) const {
+    return nullptr;
+  }
+
+  bool enableInterleavedAccessVectorization() { return false; }
+
+  bool isFPVectorizationPotentiallyUnsafe() { return false; }
+
+  bool allowsMisalignedMemoryAccesses(LLVMContext &Context,
+                                      unsigned BitWidth,
+                                      unsigned AddressSpace,
+                                      unsigned Alignment,
+                                      bool *Fast) { return false; }
+
+  TTI::PopcntSupportKind getPopcntSupport(unsigned IntTyWidthInBit) {
+    return TTI::PSK_Software;
+  }
+
+  bool haveFastSqrt(Type *Ty) { return false; }
+
+  bool isFCmpOrdCheaperThanFCmpZero(Type *Ty) { return true; }
+
+  unsigned getFPOpCost(Type *Ty) { return TargetTransformInfo::TCC_Basic; }
+
+  int getIntImmCodeSizeCost(unsigned Opcode, unsigned Idx, const APInt &Imm,
+                            Type *Ty) {
+    return 0;
+  }
+
+  unsigned getIntImmCost(const APInt &Imm, Type *Ty) { return TTI::TCC_Basic; }
+
+  unsigned getIntImmCost(unsigned Opcode, unsigned Idx, const APInt &Imm,
+                         Type *Ty) {
+    return TTI::TCC_Free;
+  }
+
+  unsigned getIntImmCost(Intrinsic::ID IID, unsigned Idx, const APInt &Imm,
+                         Type *Ty) {
+    return TTI::TCC_Free;
+  }
+
+  unsigned getNumberOfRegisters(bool Vector) { return 8; }
+
+  unsigned getRegisterBitWidth(bool Vector) const { return 32; }
+
+  unsigned getMinVectorRegisterBitWidth() { return 128; }
+
+  bool
+  shouldConsiderAddressTypePromotion(const Instruction &I,
+                                     bool &AllowPromotionWithoutCommonHeader) {
+    AllowPromotionWithoutCommonHeader = false;
+    return false;
+  }
+
+  unsigned getCacheLineSize() { return 0; }
+
+  llvm::Optional<unsigned> getCacheSize(TargetTransformInfo::CacheLevel Level) {
+    switch (Level) {
+    case TargetTransformInfo::CacheLevel::L1D:
+      [[gnu::fallthrough]];
+    case TargetTransformInfo::CacheLevel::L2D:
+      return llvm::Optional<unsigned>();
+    }
+
+    ::llvm::llvm_unreachable_internal("Unknown TargetTransformInfo::CacheLevel", "/home/trippels/llvm/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h", 363);
+  }
+
+  llvm::Optional<unsigned> getCacheAssociativity(
+    TargetTransformInfo::CacheLevel Level) {
+    switch (Level) {
+    case TargetTransformInfo::CacheLevel::L1D:
+      [[gnu::fallthrough]];
+    case TargetTransformInfo::CacheLevel::L2D:
+      return llvm::Optional<unsigned>();
+    }
+
+    ::llvm::llvm_unreachable_internal("Unknown TargetTransformInfo::CacheLevel", "/home/trippels/llvm/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h", 375);
+  }
+
+  unsigned getPrefetchDistance() { return 0; }
+
+  unsigned getMinPrefetchStride() { return 1; }
+
+  unsigned getMaxPrefetchIterationsAhead() { return 
+                                                   (0x7fffffff * 2U + 1U)
+                                                           ; }
+
+  unsigned getMaxInterleaveFactor(unsigned VF) { return 1; }
+
+  unsigned getArithmeticInstrCost(unsigned Opcode, Type *Ty,
+                                  TTI::OperandValueKind Opd1Info,
+                                  TTI::OperandValueKind Opd2Info,
+                                  TTI::OperandValueProperties Opd1PropInfo,
+                                  TTI::OperandValueProperties Opd2PropInfo,
+                                  ArrayRef<const Value *> Args) {
+    return 1;
+  }
+
+  unsigned getShuffleCost(TTI::ShuffleKind Kind, Type *Ty, int Index,
+                          Type *SubTp) {
+    return 1;
+  }
+
+  unsigned getCastInstrCost(unsigned Opcode, Type *Dst, Type *Src,
+                            const Instruction *I) { return 1; }
+
+  unsigned getExtractWithExtendCost(unsigned Opcode, Type *Dst,
+                                    VectorType *VecTy, unsigned Index) {
+    return 1;
+  }
+
+  unsigned getCFInstrCost(unsigned Opcode) { return 1; }
+
+  unsigned getCmpSelInstrCost(unsigned Opcode, Type *ValTy, Type *CondTy,
+                              const Instruction *I) {
+    return 1;
+  }
+
+  unsigned getVectorInstrCost(unsigned Opcode, Type *Val, unsigned Index) {
+    return 1;
+  }
+
+  unsigned getMemoryOpCost(unsigned Opcode, Type *Src, unsigned Alignment,
+                           unsigned AddressSpace, const Instruction *I) {
+    return 1;
+  }
+
+  unsigned getMaskedMemoryOpCost(unsigned Opcode, Type *Src, unsigned Alignment,
+                                 unsigned AddressSpace) {
+    return 1;
+  }
+
+  unsigned getGatherScatterOpCost(unsigned Opcode, Type *DataTy, Value *Ptr,
+                                  bool VariableMask,
+                                  unsigned Alignment) {
+    return 1;
+  }
+
+  unsigned getInterleavedMemoryOpCost(unsigned Opcode, Type *VecTy,
+                                      unsigned Factor,
+                                      ArrayRef<unsigned> Indices,
+                                      unsigned Alignment,
+                                      unsigned AddressSpace) {
+    return 1;
+  }
+
+  unsigned getIntrinsicInstrCost(Intrinsic::ID ID, Type *RetTy,
+                                 ArrayRef<Type *> Tys, FastMathFlags FMF,
+                                 unsigned ScalarizationCostPassed) {
+    return 1;
+  }
+  unsigned getIntrinsicInstrCost(Intrinsic::ID ID, Type *RetTy,
+            ArrayRef<Value *> Args, FastMathFlags FMF, unsigned VF) {
+    return 1;
+  }
+
+  unsigned getCallInstrCost(Function *F, Type *RetTy, ArrayRef<Type *> Tys) {
+    return 1;
+  }
+
+  unsigned getNumberOfParts(Type *Tp) { return 0; }
+
+  unsigned getAddressComputationCost(Type *Tp, ScalarEvolution *,
+                                     const SCEV *) {
+    return 0;
+  }
+
+  unsigned getArithmeticReductionCost(unsigned, Type *, bool) { return 1; }
+
+  unsigned getMinMaxReductionCost(Type *, Type *, bool, bool) { return 1; }
+
+  unsigned getCostOfKeepingLiveOverCall(ArrayRef<Type *> Tys) { return 0; }
+
+  bool getTgtMemIntrinsic(IntrinsicInst *Inst, MemIntrinsicInfo &Info) {
+    return false;
+  }
+
+  unsigned getAtomicMemIntrinsicMaxElementSize() const {
+
+
+
+
+
+    return 0;
+  }
+
+  Value *getOrCreateResultFromMemIntrinsic(IntrinsicInst *Inst,
+                                           Type *ExpectedType) {
+    return nullptr;
+  }
+
+  Type *getMemcpyLoopLoweringType(LLVMContext &Context, Value *Length,
+                                  unsigned SrcAlign, unsigned DestAlign) const {
+    return Type::getInt8Ty(Context);
+  }
+
+  void getMemcpyLoopResidualLoweringType(SmallVectorImpl<Type *> &OpsOut,
+                                         LLVMContext &Context,
+                                         unsigned RemainingBytes,
+                                         unsigned SrcAlign,
+                                         unsigned DestAlign) const {
+    for (unsigned i = 0; i != RemainingBytes; ++i)
+      OpsOut.push_back(Type::getInt8Ty(Context));
+  }
+
+  bool areInlineCompatible(const Function *Caller,
+                           const Function *Callee) const {
+    return (Caller->getFnAttribute("target-cpu") ==
+            Callee->getFnAttribute("target-cpu")) &&
+           (Caller->getFnAttribute("target-features") ==
+            Callee->getFnAttribute("target-features"));
+  }
+
+  unsigned getLoadStoreVecRegBitWidth(unsigned AddrSpace) const { return 128; }
+
+  bool isLegalToVectorizeLoad(LoadInst *LI) const { return true; }
+
+  bool isLegalToVectorizeStore(StoreInst *SI) const { return true; }
+
+  bool isLegalToVectorizeLoadChain(unsigned ChainSizeInBytes,
+                                   unsigned Alignment,
+                                   unsigned AddrSpace) const {
+    return true;
+  }
+
+  bool isLegalToVectorizeStoreChain(unsigned ChainSizeInBytes,
+                                    unsigned Alignment,
+                                    unsigned AddrSpace) const {
+    return true;
+  }
+
+  unsigned getLoadVectorFactor(unsigned VF, unsigned LoadSize,
+                               unsigned ChainSizeInBytes,
+                               VectorType *VecTy) const {
+    return VF;
+  }
+
+  unsigned getStoreVectorFactor(unsigned VF, unsigned StoreSize,
+                                unsigned ChainSizeInBytes,
+                                VectorType *VecTy) const {
+    return VF;
+  }
+
+  bool useReductionIntrinsic(unsigned Opcode, Type *Ty,
+                             TTI::ReductionFlags Flags) const {
+    return false;
+  }
+
+  bool shouldExpandReduction(const IntrinsicInst *II) const {
+    return true;
+  }
+
+protected:
+
+
+  unsigned minRequiredElementSize(const Value* Val, bool &isSigned) {
+    if (isa<ConstantDataVector>(Val) || isa<ConstantVector>(Val)) {
+      const auto* VectorValue = cast<Constant>(Val);
+
+
+
+      auto *VT = cast<VectorType>(Val->getType());
+
+
+      isSigned = false;
+
+
+
+      unsigned MaxRequiredSize = VT->getBitWidth() / VT->getNumElements();
+
+      unsigned MinRequiredSize = 0;
+      for(unsigned i = 0, e = VT->getNumElements(); i < e; ++i) {
+        if (auto* IntElement =
+              dyn_cast<ConstantInt>(VectorValue->getAggregateElement(i))) {
+          bool signedElement = IntElement->getValue().isNegative();
+
+          unsigned ElementMinRequiredSize =
+            IntElement->getValue().getMinSignedBits() - 1;
+
+          isSigned |= signedElement;
+
+          MinRequiredSize = std::max(MinRequiredSize, ElementMinRequiredSize);
+        }
+        else {
+
+          return MaxRequiredSize;
+        }
+      }
+      return MinRequiredSize;
+    }
+
+    if (const auto* CI = dyn_cast<ConstantInt>(Val)) {
+      isSigned = CI->getValue().isNegative();
+      return CI->getValue().getMinSignedBits() - 1;
+    }
+
+    if (const auto* Cast = dyn_cast<SExtInst>(Val)) {
+      isSigned = true;
+      return Cast->getSrcTy()->getScalarSizeInBits() - 1;
+    }
+
+    if (const auto* Cast = dyn_cast<ZExtInst>(Val)) {
+      isSigned = false;
+      return Cast->getSrcTy()->getScalarSizeInBits();
+    }
+
+    isSigned = false;
+    return Val->getType()->getScalarSizeInBits();
+  }
+
+  bool isStridedAccess(const SCEV *Ptr) {
+    return Ptr && isa<SCEVAddRecExpr>(Ptr);
+  }
+
+  const SCEVConstant *getConstantStrideStep(ScalarEvolution *SE,
+                                            const SCEV *Ptr) {
+    if (!isStridedAccess(Ptr))
+      return nullptr;
+    const SCEVAddRecExpr *AddRec = cast<SCEVAddRecExpr>(Ptr);
+    return dyn_cast<SCEVConstant>(AddRec->getStepRecurrence(*SE));
+  }
+
+  bool isConstantStridedAccessLessThan(ScalarEvolution *SE, const SCEV *Ptr,
+                                       int64_t MergeDistance) {
+    const SCEVConstant *Step = getConstantStrideStep(SE, Ptr);
+    if (!Step)
+      return false;
+    APInt StrideVal = Step->getAPInt();
+    if (StrideVal.getBitWidth() > 64)
+      return false;
+
+    return StrideVal.getSExtValue() < MergeDistance;
+  }
+};
+
+
+
+template <typename T>
+class TargetTransformInfoImplCRTPBase : public TargetTransformInfoImplBase {
+private:
+  typedef TargetTransformInfoImplBase BaseT;
+
+protected:
+  explicit TargetTransformInfoImplCRTPBase(const DataLayout &DL) : BaseT(DL) {}
+
+public:
+  using BaseT::getCallCost;
+
+  unsigned getCallCost(const Function *F, int NumArgs) {
+    
+   ((
+   F && "A concrete function must be provided to this routine."
+   ) ? static_cast<void> (0) : __assert_fail (
+   "F && \"A concrete function must be provided to this routine.\""
+   , "/home/trippels/llvm/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h", 646, __PRETTY_FUNCTION__))
+                                                                       ;
+
+    if (NumArgs < 0)
+
+
+      NumArgs = F->arg_size();
+
+    if (Intrinsic::ID IID = F->getIntrinsicID()) {
+      FunctionType *FTy = F->getFunctionType();
+      SmallVector<Type *, 8> ParamTys(FTy->param_begin(), FTy->param_end());
+      return static_cast<T *>(this)
+          ->getIntrinsicCost(IID, FTy->getReturnType(), ParamTys);
+    }
+
+    if (!static_cast<T *>(this)->isLoweredToCall(F))
+      return TTI::TCC_Basic;
+
+
+    return static_cast<T *>(this)->getCallCost(F->getFunctionType(), NumArgs);
+  }
+
+  unsigned getCallCost(const Function *F, ArrayRef<const Value *> Arguments) {
+
+
+
+    return static_cast<T *>(this)->getCallCost(F, Arguments.size());
+  }
+
+  using BaseT::getGEPCost;
+
+  int getGEPCost(Type *PointeeType, const Value *Ptr,
+                 ArrayRef<const Value *> Operands) {
+    const GlobalValue *BaseGV = nullptr;
+    if (Ptr != nullptr) {
+
+      
+     ((
+     Ptr->getType()->getScalarType()->getPointerElementType() == PointeeType && "explicit pointee type doesn't match operand's pointee type"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "Ptr->getType()->getScalarType()->getPointerElementType() == PointeeType && \"explicit pointee type doesn't match operand's pointee type\""
+     ,
+
+                                                                         "/home/trippels/llvm/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h"
+      ,
+
+                                                                         683
+      , __PRETTY_FUNCTION__))
+
+                                                                          
+                                                                         ;
+      BaseGV = dyn_cast<GlobalValue>(Ptr->stripPointerCasts());
+    }
+    bool HasBaseReg = (BaseGV == nullptr);
+
+    auto PtrSizeBits = DL.getPointerTypeSizeInBits(Ptr->getType());
+    APInt BaseOffset(PtrSizeBits, 0);
+    int64_t Scale = 0;
+
+    auto GTI = gep_type_begin(PointeeType, Operands);
+    Type *TargetType = nullptr;
+
+
+
+    if (Operands.empty())
+      return !BaseGV ? TTI::TCC_Free : TTI::TCC_Basic;
+
+    for (auto I = Operands.begin(); I != Operands.end(); ++I, ++GTI) {
+      TargetType = GTI.getIndexedType();
+
+
+      const ConstantInt *ConstIdx = dyn_cast<ConstantInt>(*I);
+      if (!ConstIdx)
+        if (auto Splat = getSplatValue(*I))
+          ConstIdx = dyn_cast<ConstantInt>(Splat);
+      if (StructType *STy = GTI.getStructTypeOrNull()) {
+
+        
+       ((
+       ConstIdx && "Unexpected GEP index"
+       ) ? static_cast<void> (0) : __assert_fail (
+       "ConstIdx && \"Unexpected GEP index\""
+       , "/home/trippels/llvm/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h", 710, __PRETTY_FUNCTION__))
+                                                 ;
+        uint64_t Field = ConstIdx->getZExtValue();
+        BaseOffset += DL.getStructLayout(STy)->getElementOffset(Field);
+      } else {
+        int64_t ElementSize = DL.getTypeAllocSize(GTI.getIndexedType());
+        if (ConstIdx) {
+          BaseOffset +=
+              ConstIdx->getValue().sextOrTrunc(PtrSizeBits) * ElementSize;
+        } else {
+
+          if (Scale != 0)
+
+            return TTI::TCC_Basic;
+          Scale = ElementSize;
+        }
+      }
+    }
+
+
+    unsigned AS =
+        (Ptr == nullptr ? 0 : Ptr->getType()->getPointerAddressSpace());
+
+    if (static_cast<T *>(this)->isLegalAddressingMode(
+            TargetType, const_cast<GlobalValue *>(BaseGV),
+            BaseOffset.sextOrTrunc(64).getSExtValue(), HasBaseReg, Scale, AS))
+      return TTI::TCC_Free;
+    return TTI::TCC_Basic;
+  }
+
+  using BaseT::getIntrinsicCost;
+
+  unsigned getIntrinsicCost(Intrinsic::ID IID, Type *RetTy,
+                            ArrayRef<const Value *> Arguments) {
+
+
+
+    SmallVector<Type *, 8> ParamTys;
+    ParamTys.reserve(Arguments.size());
+    for (unsigned Idx = 0, Size = Arguments.size(); Idx != Size; ++Idx)
+      ParamTys.push_back(Arguments[Idx]->getType());
+    return static_cast<T *>(this)->getIntrinsicCost(IID, RetTy, ParamTys);
+  }
+
+  unsigned getUserCost(const User *U, ArrayRef<const Value *> Operands) {
+    if (isa<PHINode>(U))
+      return TTI::TCC_Free;
+
+
+    if (auto *A = dyn_cast<AllocaInst>(U))
+      if (A->isStaticAlloca())
+        return TTI::TCC_Free;
+
+    if (const GEPOperator *GEP = dyn_cast<GEPOperator>(U)) {
+      return static_cast<T *>(this)->getGEPCost(GEP->getSourceElementType(),
+                                                GEP->getPointerOperand(),
+                                                Operands.drop_front());
+    }
+
+    if (auto CS = ImmutableCallSite(U)) {
+      const Function *F = CS.getCalledFunction();
+      if (!F) {
+
+        Type *FTy = CS.getCalledValue()->getType()->getPointerElementType();
+        return static_cast<T *>(this)
+            ->getCallCost(cast<FunctionType>(FTy), CS.arg_size());
+      }
+
+      SmallVector<const Value *, 8> Arguments(CS.arg_begin(), CS.arg_end());
+      return static_cast<T *>(this)->getCallCost(F, Arguments);
+    }
+
+    if (const CastInst *CI = dyn_cast<CastInst>(U)) {
+
+
+
+      if (isa<CmpInst>(CI->getOperand(0)))
+        return TTI::TCC_Free;
+      if (isa<SExtInst>(CI) || isa<ZExtInst>(CI) || isa<FPExtInst>(CI))
+        return static_cast<T *>(this)->getExtCost(CI, Operands.back());
+    }
+
+    return static_cast<T *>(this)->getOperationCost(
+        Operator::getOpcode(U), U->getType(),
+        U->getNumOperands() == 1 ? U->getOperand(0)->getType() : nullptr);
+  }
+
+  int getInstructionLatency(const Instruction *I) {
+    SmallVector<const Value *, 4> Operands(I->value_op_begin(),
+                                           I->value_op_end());
+    if (getUserCost(I, Operands) == TTI::TCC_Free)
+      return 0;
+
+    if (isa<LoadInst>(I))
+      return 4;
+
+    Type *DstTy = I->getType();
+
+
+
+    if (auto *CI = dyn_cast<CallInst>(I)) {
+      const Function *F = CI->getCalledFunction();
+      if (!F || static_cast<T *>(this)->isLoweredToCall(F))
+        return 40;
+
+
+      if (StructType* StructTy = dyn_cast<StructType>(DstTy))
+        DstTy = StructTy->getElementType(0);
+
+    }
+
+    if (VectorType *VectorTy = dyn_cast<VectorType>(DstTy))
+      DstTy = VectorTy->getElementType();
+    if (DstTy->isFloatingPointTy())
+      return 3;
+
+    return 1;
+  }
+};
+}
+namespace llvm {
+
+
+
+
+namespace ISD {
+  enum NodeType {
+
+
+    DELETED_NODE,
+
+
+    EntryToken,
+
+
+
+
+    TokenFactor,
+
+
+
+
+
+
+    AssertSext, AssertZext,
+
+
+    BasicBlock, VALUETYPE, CONDCODE, Register, RegisterMask,
+    Constant, ConstantFP,
+    GlobalAddress, GlobalTLSAddress, FrameIndex,
+    JumpTable, ConstantPool, ExternalSymbol, BlockAddress,
+
+
+    GLOBAL_OFFSET_TABLE,
+
+
+
+
+
+
+    FRAMEADDR, RETURNADDR, ADDROFRETURNADDR,
+
+
+
+
+
+
+
+    LOCAL_RECOVER,
+
+
+
+    READ_REGISTER,
+    WRITE_REGISTER,
+
+
+
+
+    FRAME_TO_ARGS_OFFSET,
+
+
+
+
+    EH_DWARF_CFA,
+
+
+
+
+
+    EH_RETURN,
+
+
+
+
+
+    EH_SJLJ_SETJMP,
+
+
+
+
+
+    EH_SJLJ_LONGJMP,
+
+
+
+    EH_SJLJ_SETUP_DISPATCH,
+
+
+
+
+
+
+    TargetConstant,
+    TargetConstantFP,
+
+
+
+
+    TargetGlobalAddress,
+    TargetGlobalTLSAddress,
+    TargetFrameIndex,
+    TargetJumpTable,
+    TargetConstantPool,
+    TargetExternalSymbol,
+    TargetBlockAddress,
+
+    MCSymbol,
+
+
+
+
+    TargetIndex,
+
+
+
+
+
+
+    INTRINSIC_WO_CHAIN,
+
+
+
+
+
+
+
+    INTRINSIC_W_CHAIN,
+
+
+
+
+
+
+    INTRINSIC_VOID,
+
+
+
+    CopyToReg,
+
+
+
+
+    CopyFromReg,
+
+
+    UNDEF,
+
+
+
+
+
+    EXTRACT_ELEMENT,
+
+
+
+
+
+
+    BUILD_PAIR,
+
+
+
+
+
+
+    MERGE_VALUES,
+
+
+    ADD, SUB, MUL, SDIV, UDIV, SREM, UREM,
+
+
+
+
+    SMUL_LOHI, UMUL_LOHI,
+
+
+
+    SDIVREM, UDIVREM,
+
+
+
+    CARRY_FALSE,
+    ADDC, SUBC,
+    ADDE, SUBE,
+    ADDCARRY, SUBCARRY,
+    SADDO, UADDO,
+
+
+    SSUBO, USUBO,
+
+
+    SMULO, UMULO,
+
+
+    FADD, FSUB, FMUL, FDIV, FREM,
+
+
+
+
+
+    STRICT_FADD, STRICT_FSUB, STRICT_FMUL, STRICT_FDIV, STRICT_FREM,
+    STRICT_FMA,
+
+
+
+
+
+    STRICT_FSQRT, STRICT_FPOW, STRICT_FPOWI, STRICT_FSIN, STRICT_FCOS,
+    STRICT_FEXP, STRICT_FEXP2, STRICT_FLOG, STRICT_FLOG10, STRICT_FLOG2,
+    STRICT_FRINT, STRICT_FNEARBYINT,
+
+
+    FMA,
+
+
+
+    FMAD,
+
+
+
+
+
+    FCOPYSIGN,
+
+
+
+    FGETSIGN,
+
+
+    FCANONICALIZE,
+
+
+
+
+
+
+
+    BUILD_VECTOR,
+
+
+
+
+    INSERT_VECTOR_ELT,
+
+
+
+
+
+
+    EXTRACT_VECTOR_ELT,
+
+
+
+
+
+    CONCAT_VECTORS,
+
+
+
+
+
+
+
+    INSERT_SUBVECTOR,
+
+
+
+
+    EXTRACT_SUBVECTOR,
+    VECTOR_SHUFFLE,
+
+
+
+
+
+
+
+    SCALAR_TO_VECTOR,
+
+
+
+
+    MULHU, MULHS,
+
+
+
+    SMIN, SMAX, UMIN, UMAX,
+
+
+    AND, OR, XOR,
+
+
+
+
+
+    ABS,
+    SHL, SRA, SRL, ROTL, ROTR,
+
+
+    BSWAP, CTTZ, CTLZ, CTPOP, BITREVERSE,
+
+
+    CTTZ_ZERO_UNDEF, CTLZ_ZERO_UNDEF,
+
+
+
+    SELECT,
+    VSELECT,
+
+
+
+
+
+    SELECT_CC,
+
+
+
+
+
+
+
+    SETCC,
+    SETCCE,
+
+
+
+
+
+
+    SETCCCARRY,
+
+
+
+
+    SHL_PARTS, SRA_PARTS, SRL_PARTS,
+    SIGN_EXTEND,
+
+
+    ZERO_EXTEND,
+
+
+    ANY_EXTEND,
+
+
+    TRUNCATE,
+
+
+
+    SINT_TO_FP,
+    UINT_TO_FP,
+
+
+
+
+
+
+    SIGN_EXTEND_INREG,
+    ANY_EXTEND_VECTOR_INREG,
+    SIGN_EXTEND_VECTOR_INREG,
+    ZERO_EXTEND_VECTOR_INREG,
+
+
+
+    FP_TO_SINT,
+    FP_TO_UINT,
+    FP_ROUND,
+
+
+
+
+
+
+
+    FLT_ROUNDS_,
+
+
+
+
+
+
+    FP_ROUND_INREG,
+
+
+    FP_EXTEND,
+    BITCAST,
+
+
+
+    ADDRSPACECAST,
+
+
+
+
+
+    FP16_TO_FP, FP_TO_FP16,
+
+
+
+
+
+    FNEG, FABS, FSQRT, FSIN, FCOS, FPOWI, FPOW,
+    FLOG, FLOG2, FLOG10, FEXP, FEXP2,
+    FCEIL, FTRUNC, FRINT, FNEARBYINT, FROUND, FFLOOR,
+
+
+
+
+
+    FMINNUM, FMAXNUM,
+
+
+    FMINNAN, FMAXNAN,
+
+
+    FSINCOS,
+
+
+
+
+
+    LOAD, STORE,
+    DYNAMIC_STACKALLOC,
+
+
+
+
+
+    BR,
+
+
+
+
+    BRIND,
+
+
+
+    BR_JT,
+
+
+
+
+
+    BRCOND,
+
+
+
+
+
+    BR_CC,
+    INLINEASM,
+
+
+
+
+    EH_LABEL,
+
+
+
+
+
+    ANNOTATION_LABEL,
+
+
+    CATCHPAD,
+
+
+
+
+    CATCHRET,
+
+
+
+    CLEANUPRET,
+
+
+
+
+    STACKSAVE,
+
+
+
+    STACKRESTORE,
+    CALLSEQ_START,
+    CALLSEQ_END,
+
+
+
+
+    VAARG,
+
+
+
+
+    VACOPY,
+
+
+
+    VAEND, VASTART,
+
+
+
+    SRCVALUE,
+
+
+
+    MDNODE_SDNODE,
+
+
+    PCMARKER,
+
+
+
+
+
+
+
+    READCYCLECOUNTER,
+
+
+    HANDLENODE,
+
+
+
+
+
+
+
+    INIT_TRAMPOLINE,
+
+
+
+
+
+    ADJUST_TRAMPOLINE,
+
+
+    TRAP,
+
+
+    DEBUGTRAP,
+
+
+
+
+
+    PREFETCH,
+
+
+
+
+    ATOMIC_FENCE,
+
+
+
+    ATOMIC_LOAD,
+
+
+
+    ATOMIC_STORE,
+
+
+
+
+
+
+    ATOMIC_CMP_SWAP,
+
+
+
+
+
+    ATOMIC_CMP_SWAP_WITH_SUCCESS,
+
+
+
+
+
+
+
+    ATOMIC_SWAP,
+    ATOMIC_LOAD_ADD,
+    ATOMIC_LOAD_SUB,
+    ATOMIC_LOAD_AND,
+    ATOMIC_LOAD_OR,
+    ATOMIC_LOAD_XOR,
+    ATOMIC_LOAD_NAND,
+    ATOMIC_LOAD_MIN,
+    ATOMIC_LOAD_MAX,
+    ATOMIC_LOAD_UMIN,
+    ATOMIC_LOAD_UMAX,
+
+
+
+
+    MLOAD, MSTORE,
+
+
+
+
+    MGATHER, MSCATTER,
+
+
+
+    LIFETIME_START, LIFETIME_END,
+
+
+
+
+
+
+
+    GC_TRANSITION_START,
+    GC_TRANSITION_END,
+
+
+
+
+
+    GET_DYNAMIC_AREA_OFFSET,
+
+
+
+
+
+
+    VECREDUCE_STRICT_FADD, VECREDUCE_STRICT_FMUL,
+
+    VECREDUCE_FADD, VECREDUCE_FMUL,
+    VECREDUCE_ADD, VECREDUCE_MUL,
+    VECREDUCE_AND, VECREDUCE_OR, VECREDUCE_XOR,
+    VECREDUCE_SMAX, VECREDUCE_SMIN, VECREDUCE_UMAX, VECREDUCE_UMIN,
+
+    VECREDUCE_FMAX, VECREDUCE_FMIN,
+
+
+
+    BUILTIN_OP_END
+  };
+
+
+
+
+
+  static const int FIRST_TARGET_MEMORY_OPCODE = BUILTIN_OP_END+400;
+  enum MemIndexedMode {
+    UNINDEXED = 0,
+    PRE_INC,
+    PRE_DEC,
+    POST_INC,
+    POST_DEC
+  };
+
+  static const int LAST_INDEXED_MODE = POST_DEC + 1;
+  enum LoadExtType {
+    NON_EXTLOAD = 0,
+    EXTLOAD,
+    SEXTLOAD,
+    ZEXTLOAD
+  };
+
+  static const int LAST_LOADEXT_TYPE = ZEXTLOAD + 1;
+
+  NodeType getExtForLoadExtType(bool IsFP, LoadExtType);
+  enum CondCode {
+
+    SETFALSE,
+    SETOEQ,
+    SETOGT,
+    SETOGE,
+    SETOLT,
+    SETOLE,
+    SETONE,
+    SETO,
+    SETUO,
+    SETUEQ,
+    SETUGT,
+    SETUGE,
+    SETULT,
+    SETULE,
+    SETUNE,
+    SETTRUE,
+
+    SETFALSE2,
+    SETEQ,
+    SETGT,
+    SETGE,
+    SETLT,
+    SETLE,
+    SETNE,
+    SETTRUE2,
+
+    SETCC_INVALID
+  };
+
+
+
+  inline bool isSignedIntSetCC(CondCode Code) {
+    return Code == SETGT || Code == SETGE || Code == SETLT || Code == SETLE;
+  }
+
+
+
+  inline bool isUnsignedIntSetCC(CondCode Code) {
+    return Code == SETUGT || Code == SETUGE || Code == SETULT || Code == SETULE;
+  }
+
+
+
+
+  inline bool isTrueWhenEqual(CondCode Cond) {
+    return ((int)Cond & 1) != 0;
+  }
+
+
+
+
+  inline unsigned getUnorderedFlavor(CondCode Cond) {
+    return ((int)Cond >> 3) & 3;
+  }
+
+
+
+  CondCode getSetCCInverse(CondCode Operation, bool isInteger);
+
+
+
+  CondCode getSetCCSwappedOperands(CondCode Operation);
+
+
+
+
+  CondCode getSetCCOrOperation(CondCode Op1, CondCode Op2, bool isInteger);
+
+
+
+
+  CondCode getSetCCAndOperation(CondCode Op1, CondCode Op2, bool isInteger);
+
+}
+
+}
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+namespace llvm {
+
+  class Type;
+
+
+
+
+  class MVT {
+  public:
+    enum SimpleValueType : uint8_t {
+
+
+      INVALID_SIMPLE_VALUE_TYPE = 0,
+
+
+
+      Other = 1,
+      i1 = 2,
+      i8 = 3,
+      i16 = 4,
+      i32 = 5,
+      i64 = 6,
+      i128 = 7,
+
+      FIRST_INTEGER_VALUETYPE = i1,
+      LAST_INTEGER_VALUETYPE = i128,
+
+      f16 = 8,
+      f32 = 9,
+      f64 = 10,
+      f80 = 11,
+      f128 = 12,
+      ppcf128 = 13,
+
+      FIRST_FP_VALUETYPE = f16,
+      LAST_FP_VALUETYPE = ppcf128,
+
+      v1i1 = 14,
+      v2i1 = 15,
+      v4i1 = 16,
+      v8i1 = 17,
+      v16i1 = 18,
+      v32i1 = 19,
+      v64i1 = 20,
+      v128i1 = 21,
+      v512i1 = 22,
+      v1024i1 = 23,
+
+      v1i8 = 24,
+      v2i8 = 25,
+      v4i8 = 26,
+      v8i8 = 27,
+      v16i8 = 28,
+      v32i8 = 29,
+      v64i8 = 30,
+      v128i8 = 31,
+      v256i8 = 32,
+
+      v1i16 = 33,
+      v2i16 = 34,
+      v4i16 = 35,
+      v8i16 = 36,
+      v16i16 = 37,
+      v32i16 = 38,
+      v64i16 = 39,
+      v128i16 = 40,
+
+      v1i32 = 41,
+      v2i32 = 42,
+      v4i32 = 43,
+      v8i32 = 44,
+      v16i32 = 45,
+      v32i32 = 46,
+      v64i32 = 47,
+
+      v1i64 = 48,
+      v2i64 = 49,
+      v4i64 = 50,
+      v8i64 = 51,
+      v16i64 = 52,
+      v32i64 = 53,
+
+      v1i128 = 54,
+
+
+      nxv1i1 = 55,
+      nxv2i1 = 56,
+      nxv4i1 = 57,
+      nxv8i1 = 58,
+      nxv16i1 = 59,
+      nxv32i1 = 60,
+
+      nxv1i8 = 61,
+      nxv2i8 = 62,
+      nxv4i8 = 63,
+      nxv8i8 = 64,
+      nxv16i8 = 65,
+      nxv32i8 = 66,
+
+      nxv1i16 = 67,
+      nxv2i16 = 68,
+      nxv4i16 = 69,
+      nxv8i16 = 70,
+      nxv16i16 = 71,
+      nxv32i16 = 72,
+
+      nxv1i32 = 73,
+      nxv2i32 = 74,
+      nxv4i32 = 75,
+      nxv8i32 = 76,
+      nxv16i32 = 77,
+      nxv32i32 = 78,
+
+      nxv1i64 = 79,
+      nxv2i64 = 80,
+      nxv4i64 = 81,
+      nxv8i64 = 82,
+      nxv16i64 = 83,
+      nxv32i64 = 84,
+
+      FIRST_INTEGER_VECTOR_VALUETYPE = v1i1,
+      LAST_INTEGER_VECTOR_VALUETYPE = nxv32i64,
+
+      FIRST_INTEGER_SCALABLE_VALUETYPE = nxv1i1,
+      LAST_INTEGER_SCALABLE_VALUETYPE = nxv32i64,
+
+      v2f16 = 85,
+      v4f16 = 86,
+      v8f16 = 87,
+      v1f32 = 88,
+      v2f32 = 89,
+      v4f32 = 90,
+      v8f32 = 91,
+      v16f32 = 92,
+      v1f64 = 93,
+      v2f64 = 94,
+      v4f64 = 95,
+      v8f64 = 96,
+
+      nxv2f16 = 97,
+      nxv4f16 = 98,
+      nxv8f16 = 99,
+      nxv1f32 = 100,
+      nxv2f32 = 101,
+      nxv4f32 = 102,
+      nxv8f32 = 103,
+      nxv16f32 = 104,
+      nxv1f64 = 105,
+      nxv2f64 = 106,
+      nxv4f64 = 107,
+      nxv8f64 = 108,
+
+      FIRST_FP_VECTOR_VALUETYPE = v2f16,
+      LAST_FP_VECTOR_VALUETYPE = nxv8f64,
+
+      FIRST_FP_SCALABLE_VALUETYPE = nxv2f16,
+      LAST_FP_SCALABLE_VALUETYPE = nxv8f64,
+
+      FIRST_VECTOR_VALUETYPE = v1i1,
+      LAST_VECTOR_VALUETYPE = nxv8f64,
+
+      x86mmx = 109,
+
+      Glue = 110,
+
+      isVoid = 111,
+
+      Untyped = 112,
+
+
+
+      FIRST_VALUETYPE = 1,
+      LAST_VALUETYPE = 113,
+
+
+
+
+      MAX_ALLOWED_VALUETYPE = 128,
+
+
+      token = 248,
+
+
+      Metadata = 249,
+
+
+
+
+      iPTRAny = 250,
+
+
+
+
+      vAny = 251,
+
+
+
+
+      fAny = 252,
+
+
+
+
+      iAny = 253,
+
+
+
+      iPTR = 254,
+
+
+
+      Any = 255
+    };
+
+    SimpleValueType SimpleTy = INVALID_SIMPLE_VALUE_TYPE;
+
+
+
+
+
+    class ElementCount {
+    public:
+      unsigned Min;
+      bool Scalable;
+
+      ElementCount(unsigned Min, bool Scalable)
+      : Min(Min), Scalable(Scalable) {}
+
+      ElementCount operator*(unsigned RHS) {
+        return { Min * RHS, Scalable };
+      }
+
+      ElementCount& operator*=(unsigned RHS) {
+        Min *= RHS;
+        return *this;
+      }
+
+      ElementCount operator/(unsigned RHS) {
+        return { Min / RHS, Scalable };
+      }
+
+      ElementCount& operator/=(unsigned RHS) {
+        Min /= RHS;
+        return *this;
+      }
+
+      bool operator==(const ElementCount& RHS) {
+        return Min == RHS.Min && Scalable == RHS.Scalable;
+      }
+    };
+
+    constexpr MVT() = default;
+    constexpr MVT(SimpleValueType SVT) : SimpleTy(SVT) {}
+
+    bool operator>(const MVT& S) const { return SimpleTy > S.SimpleTy; }
+    bool operator<(const MVT& S) const { return SimpleTy < S.SimpleTy; }
+    bool operator==(const MVT& S) const { return SimpleTy == S.SimpleTy; }
+    bool operator!=(const MVT& S) const { return SimpleTy != S.SimpleTy; }
+    bool operator>=(const MVT& S) const { return SimpleTy >= S.SimpleTy; }
+    bool operator<=(const MVT& S) const { return SimpleTy <= S.SimpleTy; }
+
+
+    bool isValid() const {
+      return (SimpleTy >= MVT::FIRST_VALUETYPE &&
+              SimpleTy < MVT::LAST_VALUETYPE);
+    }
+
+
+    bool isFloatingPoint() const {
+      return ((SimpleTy >= MVT::FIRST_FP_VALUETYPE &&
+               SimpleTy <= MVT::LAST_FP_VALUETYPE) ||
+              (SimpleTy >= MVT::FIRST_FP_VECTOR_VALUETYPE &&
+               SimpleTy <= MVT::LAST_FP_VECTOR_VALUETYPE));
+    }
+
+
+    bool isInteger() const {
+      return ((SimpleTy >= MVT::FIRST_INTEGER_VALUETYPE &&
+               SimpleTy <= MVT::LAST_INTEGER_VALUETYPE) ||
+              (SimpleTy >= MVT::FIRST_INTEGER_VECTOR_VALUETYPE &&
+               SimpleTy <= MVT::LAST_INTEGER_VECTOR_VALUETYPE));
+    }
+
+
+    bool isScalarInteger() const {
+      return (SimpleTy >= MVT::FIRST_INTEGER_VALUETYPE &&
+              SimpleTy <= MVT::LAST_INTEGER_VALUETYPE);
+    }
+
+
+    bool isVector() const {
+      return (SimpleTy >= MVT::FIRST_VECTOR_VALUETYPE &&
+              SimpleTy <= MVT::LAST_VECTOR_VALUETYPE);
+    }
+
+
+
+    bool isScalableVector() const {
+      return ((SimpleTy >= MVT::FIRST_INTEGER_SCALABLE_VALUETYPE &&
+               SimpleTy <= MVT::LAST_INTEGER_SCALABLE_VALUETYPE) ||
+              (SimpleTy >= MVT::FIRST_FP_SCALABLE_VALUETYPE &&
+               SimpleTy <= MVT::LAST_FP_SCALABLE_VALUETYPE));
+    }
+
+
+    bool is16BitVector() const {
+      return (SimpleTy == MVT::v2i8 || SimpleTy == MVT::v1i16 ||
+              SimpleTy == MVT::v16i1);
+    }
+
+
+    bool is32BitVector() const {
+      return (SimpleTy == MVT::v32i1 || SimpleTy == MVT::v4i8 ||
+              SimpleTy == MVT::v2i16 || SimpleTy == MVT::v1i32 ||
+              SimpleTy == MVT::v2f16 || SimpleTy == MVT::v1f32);
+    }
+
+
+    bool is64BitVector() const {
+      return (SimpleTy == MVT::v64i1 || SimpleTy == MVT::v8i8 ||
+              SimpleTy == MVT::v4i16 || SimpleTy == MVT::v2i32 ||
+              SimpleTy == MVT::v1i64 || SimpleTy == MVT::v4f16 ||
+              SimpleTy == MVT::v2f32 || SimpleTy == MVT::v1f64);
+    }
+
+
+    bool is128BitVector() const {
+      return (SimpleTy == MVT::v128i1 || SimpleTy == MVT::v16i8 ||
+              SimpleTy == MVT::v8i16 || SimpleTy == MVT::v4i32 ||
+              SimpleTy == MVT::v2i64 || SimpleTy == MVT::v1i128 ||
+              SimpleTy == MVT::v8f16 || SimpleTy == MVT::v4f32 ||
+              SimpleTy == MVT::v2f64);
+    }
+
+
+    bool is256BitVector() const {
+      return (SimpleTy == MVT::v8f32 || SimpleTy == MVT::v4f64 ||
+              SimpleTy == MVT::v32i8 || SimpleTy == MVT::v16i16 ||
+              SimpleTy == MVT::v8i32 || SimpleTy == MVT::v4i64);
+    }
+
+
+    bool is512BitVector() const {
+      return (SimpleTy == MVT::v16f32 || SimpleTy == MVT::v8f64 ||
+              SimpleTy == MVT::v512i1 || SimpleTy == MVT::v64i8 ||
+              SimpleTy == MVT::v32i16 || SimpleTy == MVT::v16i32 ||
+              SimpleTy == MVT::v8i64);
+    }
+
+
+    bool is1024BitVector() const {
+      return (SimpleTy == MVT::v1024i1 || SimpleTy == MVT::v128i8 ||
+              SimpleTy == MVT::v64i16 || SimpleTy == MVT::v32i32 ||
+              SimpleTy == MVT::v16i64);
+    }
+
+
+    bool is2048BitVector() const {
+      return (SimpleTy == MVT::v256i8 || SimpleTy == MVT::v128i16 ||
+              SimpleTy == MVT::v64i32 || SimpleTy == MVT::v32i64);
+    }
+
+
+    bool isOverloaded() const {
+      return (SimpleTy==MVT::Any ||
+              SimpleTy==MVT::iAny || SimpleTy==MVT::fAny ||
+              SimpleTy==MVT::vAny || SimpleTy==MVT::iPTRAny);
+    }
+
+
+    bool isPow2VectorType() const {
+      unsigned NElts = getVectorNumElements();
+      return !(NElts & (NElts - 1));
+    }
+
+
+
+    MVT getPow2VectorType() const {
+      if (isPow2VectorType())
+        return *this;
+
+      unsigned NElts = getVectorNumElements();
+      unsigned Pow2NElts = 1 << Log2_32_Ceil(NElts);
+      return MVT::getVectorVT(getVectorElementType(), Pow2NElts);
+    }
+
+
+    MVT getScalarType() const {
+      return isVector() ? getVectorElementType() : *this;
+    }
+
+    MVT getVectorElementType() const {
+      switch (SimpleTy) {
+      default:
+        ::llvm::llvm_unreachable_internal("Not a vector MVT!", "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineValueType.h", 417);
+      case v1i1:
+      case v2i1:
+      case v4i1:
+      case v8i1:
+      case v16i1:
+      case v32i1:
+      case v64i1:
+      case v128i1:
+      case v512i1:
+      case v1024i1:
+      case nxv1i1:
+      case nxv2i1:
+      case nxv4i1:
+      case nxv8i1:
+      case nxv16i1:
+      case nxv32i1: return i1;
+      case v1i8:
+      case v2i8:
+      case v4i8:
+      case v8i8:
+      case v16i8:
+      case v32i8:
+      case v64i8:
+      case v128i8:
+      case v256i8:
+      case nxv1i8:
+      case nxv2i8:
+      case nxv4i8:
+      case nxv8i8:
+      case nxv16i8:
+      case nxv32i8: return i8;
+      case v1i16:
+      case v2i16:
+      case v4i16:
+      case v8i16:
+      case v16i16:
+      case v32i16:
+      case v64i16:
+      case v128i16:
+      case nxv1i16:
+      case nxv2i16:
+      case nxv4i16:
+      case nxv8i16:
+      case nxv16i16:
+      case nxv32i16: return i16;
+      case v1i32:
+      case v2i32:
+      case v4i32:
+      case v8i32:
+      case v16i32:
+      case v32i32:
+      case v64i32:
+      case nxv1i32:
+      case nxv2i32:
+      case nxv4i32:
+      case nxv8i32:
+      case nxv16i32:
+      case nxv32i32: return i32;
+      case v1i64:
+      case v2i64:
+      case v4i64:
+      case v8i64:
+      case v16i64:
+      case v32i64:
+      case nxv1i64:
+      case nxv2i64:
+      case nxv4i64:
+      case nxv8i64:
+      case nxv16i64:
+      case nxv32i64: return i64;
+      case v1i128: return i128;
+      case v2f16:
+      case v4f16:
+      case v8f16:
+      case nxv2f16:
+      case nxv4f16:
+      case nxv8f16: return f16;
+      case v1f32:
+      case v2f32:
+      case v4f32:
+      case v8f32:
+      case v16f32:
+      case nxv1f32:
+      case nxv2f32:
+      case nxv4f32:
+      case nxv8f32:
+      case nxv16f32: return f32;
+      case v1f64:
+      case v2f64:
+      case v4f64:
+      case v8f64:
+      case nxv1f64:
+      case nxv2f64:
+      case nxv4f64:
+      case nxv8f64: return f64;
+      }
+    }
+
+    unsigned getVectorNumElements() const {
+      switch (SimpleTy) {
+      default:
+        ::llvm::llvm_unreachable_internal("Not a vector MVT!", "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineValueType.h", 519);
+      case v1024i1: return 1024;
+      case v512i1: return 512;
+      case v256i8: return 256;
+      case v128i1:
+      case v128i8:
+      case v128i16: return 128;
+      case v64i1:
+      case v64i8:
+      case v64i16:
+      case v64i32: return 64;
+      case v32i1:
+      case v32i8:
+      case v32i16:
+      case v32i32:
+      case v32i64:
+      case nxv32i1:
+      case nxv32i8:
+      case nxv32i16:
+      case nxv32i32:
+      case nxv32i64: return 32;
+      case v16i1:
+      case v16i8:
+      case v16i16:
+      case v16i32:
+      case v16i64:
+      case v16f32:
+      case nxv16i1:
+      case nxv16i8:
+      case nxv16i16:
+      case nxv16i32:
+      case nxv16i64:
+      case nxv16f32: return 16;
+      case v8i1:
+      case v8i8:
+      case v8i16:
+      case v8i32:
+      case v8i64:
+      case v8f16:
+      case v8f32:
+      case v8f64:
+      case nxv8i1:
+      case nxv8i8:
+      case nxv8i16:
+      case nxv8i32:
+      case nxv8i64:
+      case nxv8f16:
+      case nxv8f32:
+      case nxv8f64: return 8;
+      case v4i1:
+      case v4i8:
+      case v4i16:
+      case v4i32:
+      case v4i64:
+      case v4f16:
+      case v4f32:
+      case v4f64:
+      case nxv4i1:
+      case nxv4i8:
+      case nxv4i16:
+      case nxv4i32:
+      case nxv4i64:
+      case nxv4f16:
+      case nxv4f32:
+      case nxv4f64: return 4;
+      case v2i1:
+      case v2i8:
+      case v2i16:
+      case v2i32:
+      case v2i64:
+      case v2f16:
+      case v2f32:
+      case v2f64:
+      case nxv2i1:
+      case nxv2i8:
+      case nxv2i16:
+      case nxv2i32:
+      case nxv2i64:
+      case nxv2f16:
+      case nxv2f32:
+      case nxv2f64: return 2;
+      case v1i1:
+      case v1i8:
+      case v1i16:
+      case v1i32:
+      case v1i64:
+      case v1i128:
+      case v1f32:
+      case v1f64:
+      case nxv1i1:
+      case nxv1i8:
+      case nxv1i16:
+      case nxv1i32:
+      case nxv1i64:
+      case nxv1f32:
+      case nxv1f64: return 1;
+      }
+    }
+
+    MVT::ElementCount getVectorElementCount() const {
+      return { getVectorNumElements(), isScalableVector() };
+    }
+
+    unsigned getSizeInBits() const {
+      switch (SimpleTy) {
+      default:
+        ::llvm::llvm_unreachable_internal("getSizeInBits called on extended MVT.", "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineValueType.h", 625);
+      case Other:
+        ::llvm::llvm_unreachable_internal("Value type is non-standard value, Other.", "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineValueType.h", 627);
+      case iPTR:
+        ::llvm::llvm_unreachable_internal("Value type size is target-dependent. Ask TLI.", "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineValueType.h", 629);
+      case iPTRAny:
+      case iAny:
+      case fAny:
+      case vAny:
+      case Any:
+        ::llvm::llvm_unreachable_internal("Value type is overloaded.", "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineValueType.h", 635);
+      case token:
+        ::llvm::llvm_unreachable_internal("Token type is a sentinel that cannot be used " "in codegen and has no size",
+                                                     "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineValueType.h"
+        ,
+                                                     638
+        )
+                                                      ;
+      case Metadata:
+        ::llvm::llvm_unreachable_internal("Value type is metadata.", "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineValueType.h", 640);
+      case i1:
+      case v1i1:
+      case nxv1i1: return 1;
+      case v2i1:
+      case nxv2i1: return 2;
+      case v4i1:
+      case nxv4i1: return 4;
+      case i8 :
+      case v1i8:
+      case v8i1:
+      case nxv1i8:
+      case nxv8i1: return 8;
+      case i16 :
+      case f16:
+      case v16i1:
+      case v2i8:
+      case v1i16:
+      case nxv16i1:
+      case nxv2i8:
+      case nxv1i16: return 16;
+      case f32 :
+      case i32 :
+      case v32i1:
+      case v4i8:
+      case v2i16:
+      case v2f16:
+      case v1f32:
+      case v1i32:
+      case nxv32i1:
+      case nxv4i8:
+      case nxv2i16:
+      case nxv1i32:
+      case nxv2f16:
+      case nxv1f32: return 32;
+      case x86mmx:
+      case f64 :
+      case i64 :
+      case v64i1:
+      case v8i8:
+      case v4i16:
+      case v2i32:
+      case v1i64:
+      case v4f16:
+      case v2f32:
+      case v1f64:
+      case nxv8i8:
+      case nxv4i16:
+      case nxv2i32:
+      case nxv1i64:
+      case nxv4f16:
+      case nxv2f32:
+      case nxv1f64: return 64;
+      case f80 : return 80;
+      case f128:
+      case ppcf128:
+      case i128:
+      case v128i1:
+      case v16i8:
+      case v8i16:
+      case v4i32:
+      case v2i64:
+      case v1i128:
+      case v8f16:
+      case v4f32:
+      case v2f64:
+      case nxv16i8:
+      case nxv8i16:
+      case nxv4i32:
+      case nxv2i64:
+      case nxv8f16:
+      case nxv4f32:
+      case nxv2f64: return 128;
+      case v32i8:
+      case v16i16:
+      case v8i32:
+      case v4i64:
+      case v8f32:
+      case v4f64:
+      case nxv32i8:
+      case nxv16i16:
+      case nxv8i32:
+      case nxv4i64:
+      case nxv8f32:
+      case nxv4f64: return 256;
+      case v512i1:
+      case v64i8:
+      case v32i16:
+      case v16i32:
+      case v8i64:
+      case v16f32:
+      case v8f64:
+      case nxv32i16:
+      case nxv16i32:
+      case nxv8i64:
+      case nxv16f32:
+      case nxv8f64: return 512;
+      case v1024i1:
+      case v128i8:
+      case v64i16:
+      case v32i32:
+      case v16i64:
+      case nxv32i32:
+      case nxv16i64: return 1024;
+      case v256i8:
+      case v128i16:
+      case v64i32:
+      case v32i64:
+      case nxv32i64: return 2048;
+      }
+    }
+
+    unsigned getScalarSizeInBits() const {
+      return getScalarType().getSizeInBits();
+    }
+
+
+
+    unsigned getStoreSize() const {
+      return (getSizeInBits() + 7) / 8;
+    }
+
+
+
+    unsigned getStoreSizeInBits() const {
+      return getStoreSize() * 8;
+    }
+
+
+    bool bitsGT(MVT VT) const {
+      return getSizeInBits() > VT.getSizeInBits();
+    }
+
+
+    bool bitsGE(MVT VT) const {
+      return getSizeInBits() >= VT.getSizeInBits();
+    }
+
+
+    bool bitsLT(MVT VT) const {
+      return getSizeInBits() < VT.getSizeInBits();
+    }
+
+
+    bool bitsLE(MVT VT) const {
+      return getSizeInBits() <= VT.getSizeInBits();
+    }
+
+    static MVT getFloatingPointVT(unsigned BitWidth) {
+      switch (BitWidth) {
+      default:
+        ::llvm::llvm_unreachable_internal("Bad bit width!", "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineValueType.h", 791);
+      case 16:
+        return MVT::f16;
+      case 32:
+        return MVT::f32;
+      case 64:
+        return MVT::f64;
+      case 80:
+        return MVT::f80;
+      case 128:
+        return MVT::f128;
+      }
+    }
+
+    static MVT getIntegerVT(unsigned BitWidth) {
+      switch (BitWidth) {
+      default:
+        return (MVT::SimpleValueType)(MVT::INVALID_SIMPLE_VALUE_TYPE);
+      case 1:
+        return MVT::i1;
+      case 8:
+        return MVT::i8;
+      case 16:
+        return MVT::i16;
+      case 32:
+        return MVT::i32;
+      case 64:
+        return MVT::i64;
+      case 128:
+        return MVT::i128;
+      }
+    }
+
+    static MVT getVectorVT(MVT VT, unsigned NumElements) {
+      switch (VT.SimpleTy) {
+      default:
+        break;
+      case MVT::i1:
+        if (NumElements == 1) return MVT::v1i1;
+        if (NumElements == 2) return MVT::v2i1;
+        if (NumElements == 4) return MVT::v4i1;
+        if (NumElements == 8) return MVT::v8i1;
+        if (NumElements == 16) return MVT::v16i1;
+        if (NumElements == 32) return MVT::v32i1;
+        if (NumElements == 64) return MVT::v64i1;
+        if (NumElements == 128) return MVT::v128i1;
+        if (NumElements == 512) return MVT::v512i1;
+        if (NumElements == 1024) return MVT::v1024i1;
+        break;
+      case MVT::i8:
+        if (NumElements == 1) return MVT::v1i8;
+        if (NumElements == 2) return MVT::v2i8;
+        if (NumElements == 4) return MVT::v4i8;
+        if (NumElements == 8) return MVT::v8i8;
+        if (NumElements == 16) return MVT::v16i8;
+        if (NumElements == 32) return MVT::v32i8;
+        if (NumElements == 64) return MVT::v64i8;
+        if (NumElements == 128) return MVT::v128i8;
+        if (NumElements == 256) return MVT::v256i8;
+        break;
+      case MVT::i16:
+        if (NumElements == 1) return MVT::v1i16;
+        if (NumElements == 2) return MVT::v2i16;
+        if (NumElements == 4) return MVT::v4i16;
+        if (NumElements == 8) return MVT::v8i16;
+        if (NumElements == 16) return MVT::v16i16;
+        if (NumElements == 32) return MVT::v32i16;
+        if (NumElements == 64) return MVT::v64i16;
+        if (NumElements == 128) return MVT::v128i16;
+        break;
+      case MVT::i32:
+        if (NumElements == 1) return MVT::v1i32;
+        if (NumElements == 2) return MVT::v2i32;
+        if (NumElements == 4) return MVT::v4i32;
+        if (NumElements == 8) return MVT::v8i32;
+        if (NumElements == 16) return MVT::v16i32;
+        if (NumElements == 32) return MVT::v32i32;
+        if (NumElements == 64) return MVT::v64i32;
+        break;
+      case MVT::i64:
+        if (NumElements == 1) return MVT::v1i64;
+        if (NumElements == 2) return MVT::v2i64;
+        if (NumElements == 4) return MVT::v4i64;
+        if (NumElements == 8) return MVT::v8i64;
+        if (NumElements == 16) return MVT::v16i64;
+        if (NumElements == 32) return MVT::v32i64;
+        break;
+      case MVT::i128:
+        if (NumElements == 1) return MVT::v1i128;
+        break;
+      case MVT::f16:
+        if (NumElements == 2) return MVT::v2f16;
+        if (NumElements == 4) return MVT::v4f16;
+        if (NumElements == 8) return MVT::v8f16;
+        break;
+      case MVT::f32:
+        if (NumElements == 1) return MVT::v1f32;
+        if (NumElements == 2) return MVT::v2f32;
+        if (NumElements == 4) return MVT::v4f32;
+        if (NumElements == 8) return MVT::v8f32;
+        if (NumElements == 16) return MVT::v16f32;
+        break;
+      case MVT::f64:
+        if (NumElements == 1) return MVT::v1f64;
+        if (NumElements == 2) return MVT::v2f64;
+        if (NumElements == 4) return MVT::v4f64;
+        if (NumElements == 8) return MVT::v8f64;
+        break;
+      }
+      return (MVT::SimpleValueType)(MVT::INVALID_SIMPLE_VALUE_TYPE);
+    }
+
+    static MVT getScalableVectorVT(MVT VT, unsigned NumElements) {
+      switch(VT.SimpleTy) {
+        default:
+          break;
+        case MVT::i1:
+          if (NumElements == 1) return MVT::nxv1i1;
+          if (NumElements == 2) return MVT::nxv2i1;
+          if (NumElements == 4) return MVT::nxv4i1;
+          if (NumElements == 8) return MVT::nxv8i1;
+          if (NumElements == 16) return MVT::nxv16i1;
+          if (NumElements == 32) return MVT::nxv32i1;
+          break;
+        case MVT::i8:
+          if (NumElements == 1) return MVT::nxv1i8;
+          if (NumElements == 2) return MVT::nxv2i8;
+          if (NumElements == 4) return MVT::nxv4i8;
+          if (NumElements == 8) return MVT::nxv8i8;
+          if (NumElements == 16) return MVT::nxv16i8;
+          if (NumElements == 32) return MVT::nxv32i8;
+          break;
+        case MVT::i16:
+          if (NumElements == 1) return MVT::nxv1i16;
+          if (NumElements == 2) return MVT::nxv2i16;
+          if (NumElements == 4) return MVT::nxv4i16;
+          if (NumElements == 8) return MVT::nxv8i16;
+          if (NumElements == 16) return MVT::nxv16i16;
+          if (NumElements == 32) return MVT::nxv32i16;
+          break;
+        case MVT::i32:
+          if (NumElements == 1) return MVT::nxv1i32;
+          if (NumElements == 2) return MVT::nxv2i32;
+          if (NumElements == 4) return MVT::nxv4i32;
+          if (NumElements == 8) return MVT::nxv8i32;
+          if (NumElements == 16) return MVT::nxv16i32;
+          if (NumElements == 32) return MVT::nxv32i32;
+          break;
+        case MVT::i64:
+          if (NumElements == 1) return MVT::nxv1i64;
+          if (NumElements == 2) return MVT::nxv2i64;
+          if (NumElements == 4) return MVT::nxv4i64;
+          if (NumElements == 8) return MVT::nxv8i64;
+          if (NumElements == 16) return MVT::nxv16i64;
+          if (NumElements == 32) return MVT::nxv32i64;
+          break;
+        case MVT::f16:
+          if (NumElements == 2) return MVT::nxv2f16;
+          if (NumElements == 4) return MVT::nxv4f16;
+          if (NumElements == 8) return MVT::nxv8f16;
+          break;
+        case MVT::f32:
+          if (NumElements == 1) return MVT::nxv1f32;
+          if (NumElements == 2) return MVT::nxv2f32;
+          if (NumElements == 4) return MVT::nxv4f32;
+          if (NumElements == 8) return MVT::nxv8f32;
+          if (NumElements == 16) return MVT::nxv16f32;
+          break;
+        case MVT::f64:
+          if (NumElements == 1) return MVT::nxv1f64;
+          if (NumElements == 2) return MVT::nxv2f64;
+          if (NumElements == 4) return MVT::nxv4f64;
+          if (NumElements == 8) return MVT::nxv8f64;
+          break;
+      }
+      return (MVT::SimpleValueType)(MVT::INVALID_SIMPLE_VALUE_TYPE);
+    }
+
+    static MVT getVectorVT(MVT VT, unsigned NumElements, bool IsScalable) {
+      if (IsScalable)
+        return getScalableVectorVT(VT, NumElements);
+      return getVectorVT(VT, NumElements);
+    }
+
+    static MVT getVectorVT(MVT VT, MVT::ElementCount EC) {
+      if (EC.Scalable)
+        return getScalableVectorVT(VT, EC.Min);
+      return getVectorVT(VT, EC.Min);
+    }
+
+
+
+
+    static MVT getVT(Type *Ty, bool HandleUnknown = false);
+
+  private:
+
+    struct mvt_iterator {
+      SimpleValueType VT;
+
+      mvt_iterator(SimpleValueType VT) : VT(VT) {}
+
+      MVT operator*() const { return VT; }
+      bool operator!=(const mvt_iterator &LHS) const { return VT != LHS.VT; }
+
+      mvt_iterator& operator++() {
+        VT = (MVT::SimpleValueType)((int)VT + 1);
+        
+       ((
+       (int)VT <= MVT::MAX_ALLOWED_VALUETYPE && "MVT iterator overflowed."
+       ) ? static_cast<void> (0) : __assert_fail (
+       "(int)VT <= MVT::MAX_ALLOWED_VALUETYPE && \"MVT iterator overflowed.\""
+       ,
+                                         "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineValueType.h"
+        ,
+                                         999
+        , __PRETTY_FUNCTION__))
+                                          
+                                         ;
+        return *this;
+      }
+    };
+
+
+    using mvt_range = iterator_range<mvt_iterator>;
+
+  public:
+
+
+    static mvt_range all_valuetypes() {
+      return mvt_range(MVT::FIRST_VALUETYPE, MVT::LAST_VALUETYPE);
+    }
+
+    static mvt_range integer_valuetypes() {
+      return mvt_range(MVT::FIRST_INTEGER_VALUETYPE,
+                       (MVT::SimpleValueType)(MVT::LAST_INTEGER_VALUETYPE + 1));
+    }
+
+    static mvt_range fp_valuetypes() {
+      return mvt_range(MVT::FIRST_FP_VALUETYPE,
+                       (MVT::SimpleValueType)(MVT::LAST_FP_VALUETYPE + 1));
+    }
+
+    static mvt_range vector_valuetypes() {
+      return mvt_range(MVT::FIRST_VECTOR_VALUETYPE,
+                       (MVT::SimpleValueType)(MVT::LAST_VECTOR_VALUETYPE + 1));
+    }
+
+    static mvt_range integer_vector_valuetypes() {
+      return mvt_range(
+          MVT::FIRST_INTEGER_VECTOR_VALUETYPE,
+          (MVT::SimpleValueType)(MVT::LAST_INTEGER_VECTOR_VALUETYPE + 1));
+    }
+
+    static mvt_range fp_vector_valuetypes() {
+      return mvt_range(
+          MVT::FIRST_FP_VECTOR_VALUETYPE,
+          (MVT::SimpleValueType)(MVT::LAST_FP_VECTOR_VALUETYPE + 1));
+    }
+
+    static mvt_range integer_scalable_vector_valuetypes() {
+      return mvt_range(MVT::FIRST_INTEGER_SCALABLE_VALUETYPE,
+              (MVT::SimpleValueType)(MVT::LAST_INTEGER_SCALABLE_VALUETYPE + 1));
+    }
+
+    static mvt_range fp_scalable_vector_valuetypes() {
+      return mvt_range(MVT::FIRST_FP_SCALABLE_VALUETYPE,
+                   (MVT::SimpleValueType)(MVT::LAST_FP_SCALABLE_VALUETYPE + 1));
+    }
+
+  };
+
+}
+namespace llvm {
+
+enum CombineLevel {
+  BeforeLegalizeTypes,
+  AfterLegalizeTypes,
+  AfterLegalizeVectorOps,
+  AfterLegalizeDAG
+};
+
+}
+
+
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+namespace llvm {
+
+  class LLVMContext;
+  class Type;
+
+
+
+
+  struct EVT {
+  private:
+    MVT V = MVT::INVALID_SIMPLE_VALUE_TYPE;
+    Type *LLVMTy = nullptr;
+
+  public:
+    constexpr EVT() = default;
+    constexpr EVT(MVT::SimpleValueType SVT) : V(SVT) {}
+    constexpr EVT(MVT S) : V(S) {}
+
+    bool operator==(EVT VT) const {
+      return !(*this != VT);
+    }
+    bool operator!=(EVT VT) const {
+      if (V.SimpleTy != VT.V.SimpleTy)
+        return true;
+      if (V.SimpleTy == MVT::INVALID_SIMPLE_VALUE_TYPE)
+        return LLVMTy != VT.LLVMTy;
+      return false;
+    }
+
+
+
+
+    static EVT getFloatingPointVT(unsigned BitWidth) {
+      return MVT::getFloatingPointVT(BitWidth);
+    }
+
+
+
+    static EVT getIntegerVT(LLVMContext &Context, unsigned BitWidth) {
+      MVT M = MVT::getIntegerVT(BitWidth);
+      if (M.SimpleTy != MVT::INVALID_SIMPLE_VALUE_TYPE)
+        return M;
+      return getExtendedIntegerVT(Context, BitWidth);
+    }
+
+
+
+    static EVT getVectorVT(LLVMContext &Context, EVT VT, unsigned NumElements,
+                           bool IsScalable = false) {
+      MVT M = MVT::getVectorVT(VT.V, NumElements, IsScalable);
+      if (M.SimpleTy != MVT::INVALID_SIMPLE_VALUE_TYPE)
+        return M;
+
+      
+     ((
+     !IsScalable && "We don't support extended scalable types yet"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "!IsScalable && \"We don't support extended scalable types yet\""
+     , "/home/trippels/llvm/llvm/include/llvm/CodeGen/ValueTypes.h", 79, __PRETTY_FUNCTION__))
+                                                                          ;
+      return getExtendedVectorVT(Context, VT, NumElements);
+    }
+
+
+
+    static EVT getVectorVT(LLVMContext &Context, EVT VT, MVT::ElementCount EC) {
+      MVT M = MVT::getVectorVT(VT.V, EC);
+      if (M.SimpleTy != MVT::INVALID_SIMPLE_VALUE_TYPE)
+        return M;
+      
+     ((
+     !EC.Scalable && "We don't support extended scalable types yet"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "!EC.Scalable && \"We don't support extended scalable types yet\""
+     , "/home/trippels/llvm/llvm/include/llvm/CodeGen/ValueTypes.h", 89, __PRETTY_FUNCTION__))
+                                                                            ;
+      return getExtendedVectorVT(Context, VT, EC.Min);
+    }
+
+
+
+
+    EVT changeVectorElementTypeToInteger() const {
+      if (!isSimple()) {
+        
+       ((
+       !isScalableVector() && "We don't support extended scalable types yet"
+       ) ? static_cast<void> (0) : __assert_fail (
+       "!isScalableVector() && \"We don't support extended scalable types yet\""
+       ,
+                                                              "/home/trippels/llvm/llvm/include/llvm/CodeGen/ValueTypes.h"
+        ,
+                                                              99
+        , __PRETTY_FUNCTION__))
+                                                               
+                                                              ;
+        return changeExtendedVectorElementTypeToInteger();
+      }
+      MVT EltTy = getSimpleVT().getVectorElementType();
+      unsigned BitWidth = EltTy.getSizeInBits();
+      MVT IntTy = MVT::getIntegerVT(BitWidth);
+      MVT VecTy = MVT::getVectorVT(IntTy, getVectorNumElements(),
+                                   isScalableVector());
+      
+     ((
+     VecTy.SimpleTy != MVT::INVALID_SIMPLE_VALUE_TYPE && "Simple vector VT not representable by simple integer vector VT!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "VecTy.SimpleTy != MVT::INVALID_SIMPLE_VALUE_TYPE && \"Simple vector VT not representable by simple integer vector VT!\""
+     ,
+                                                                              "/home/trippels/llvm/llvm/include/llvm/CodeGen/ValueTypes.h"
+      ,
+                                                                              108
+      , __PRETTY_FUNCTION__))
+                                                                               
+                                                                              ;
+      return VecTy;
+    }
+
+
+
+
+    EVT changeTypeToInteger() {
+      if (isVector())
+        return changeVectorElementTypeToInteger();
+
+      if (isSimple())
+        return MVT::getIntegerVT(getSizeInBits());
+
+      return changeExtendedTypeToInteger();
+    }
+
+
+    bool isSimple() const {
+      return V.SimpleTy != MVT::INVALID_SIMPLE_VALUE_TYPE;
+    }
+
+
+    bool isExtended() const {
+      return !isSimple();
+    }
+
+
+    bool isFloatingPoint() const {
+      return isSimple() ? V.isFloatingPoint() : isExtendedFloatingPoint();
+    }
+
+
+    bool isInteger() const {
+      return isSimple() ? V.isInteger() : isExtendedInteger();
+    }
+
+
+    bool isScalarInteger() const {
+      return isSimple() ? V.isScalarInteger() : isExtendedScalarInteger();
+    }
+
+
+    bool isVector() const {
+      return isSimple() ? V.isVector() : isExtendedVector();
+    }
+
+
+
+    bool isScalableVector() const {
+
+
+
+      if (!isSimple())
+        return false;
+      return V.isScalableVector();
+    }
+
+
+    bool is16BitVector() const {
+      return isSimple() ? V.is16BitVector() : isExtended16BitVector();
+    }
+
+
+    bool is32BitVector() const {
+      return isSimple() ? V.is32BitVector() : isExtended32BitVector();
+    }
+
+
+    bool is64BitVector() const {
+      return isSimple() ? V.is64BitVector() : isExtended64BitVector();
+    }
+
+
+    bool is128BitVector() const {
+      return isSimple() ? V.is128BitVector() : isExtended128BitVector();
+    }
+
+
+    bool is256BitVector() const {
+      return isSimple() ? V.is256BitVector() : isExtended256BitVector();
+    }
+
+
+    bool is512BitVector() const {
+      return isSimple() ? V.is512BitVector() : isExtended512BitVector();
+    }
+
+
+    bool is1024BitVector() const {
+      return isSimple() ? V.is1024BitVector() : isExtended1024BitVector();
+    }
+
+
+    bool is2048BitVector() const {
+      return isSimple() ? V.is2048BitVector() : isExtended2048BitVector();
+    }
+
+
+    bool isOverloaded() const {
+      return (V==MVT::iAny || V==MVT::fAny || V==MVT::vAny || V==MVT::iPTRAny);
+    }
+
+
+    bool isByteSized() const {
+      return (getSizeInBits() & 7) == 0;
+    }
+
+
+    bool isRound() const {
+      unsigned BitSize = getSizeInBits();
+      return BitSize >= 8 && !(BitSize & (BitSize - 1));
+    }
+
+
+    bool bitsEq(EVT VT) const {
+      if (EVT::operator==(VT)) return true;
+      return getSizeInBits() == VT.getSizeInBits();
+    }
+
+
+    bool bitsGT(EVT VT) const {
+      if (EVT::operator==(VT)) return false;
+      return getSizeInBits() > VT.getSizeInBits();
+    }
+
+
+    bool bitsGE(EVT VT) const {
+      if (EVT::operator==(VT)) return true;
+      return getSizeInBits() >= VT.getSizeInBits();
+    }
+
+
+    bool bitsLT(EVT VT) const {
+      if (EVT::operator==(VT)) return false;
+      return getSizeInBits() < VT.getSizeInBits();
+    }
+
+
+    bool bitsLE(EVT VT) const {
+      if (EVT::operator==(VT)) return true;
+      return getSizeInBits() <= VT.getSizeInBits();
+    }
+
+
+    MVT getSimpleVT() const {
+      
+     ((
+     isSimple() && "Expected a SimpleValueType!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "isSimple() && \"Expected a SimpleValueType!\""
+     , "/home/trippels/llvm/llvm/include/llvm/CodeGen/ValueTypes.h", 254, __PRETTY_FUNCTION__))
+                                                        ;
+      return V;
+    }
+
+
+
+    EVT getScalarType() const {
+      return isVector() ? getVectorElementType() : *this;
+    }
+
+
+    EVT getVectorElementType() const {
+      
+     ((
+     isVector() && "Invalid vector type!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "isVector() && \"Invalid vector type!\""
+     , "/home/trippels/llvm/llvm/include/llvm/CodeGen/ValueTypes.h", 266, __PRETTY_FUNCTION__))
+                                                 ;
+      if (isSimple())
+        return V.getVectorElementType();
+      return getExtendedVectorElementType();
+    }
+
+
+    unsigned getVectorNumElements() const {
+      
+     ((
+     isVector() && "Invalid vector type!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "isVector() && \"Invalid vector type!\""
+     , "/home/trippels/llvm/llvm/include/llvm/CodeGen/ValueTypes.h", 274, __PRETTY_FUNCTION__))
+                                                 ;
+      if (isSimple())
+        return V.getVectorNumElements();
+      return getExtendedVectorNumElements();
+    }
+
+
+    MVT::ElementCount getVectorElementCount() const {
+      
+     ((
+     (isVector()) && "Invalid vector type!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "(isVector()) && \"Invalid vector type!\""
+     , "/home/trippels/llvm/llvm/include/llvm/CodeGen/ValueTypes.h", 282, __PRETTY_FUNCTION__))
+                                                   ;
+      if (isSimple())
+        return V.getVectorElementCount();
+
+      
+     ((
+     !isScalableVector() && "We don't support extended scalable types yet"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "!isScalableVector() && \"We don't support extended scalable types yet\""
+     ,
+                                                           "/home/trippels/llvm/llvm/include/llvm/CodeGen/ValueTypes.h"
+      ,
+                                                           287
+      , __PRETTY_FUNCTION__))
+                                                            
+                                                           ;
+      return {getExtendedVectorNumElements(), false};
+    }
+
+
+    unsigned getSizeInBits() const {
+      if (isSimple())
+        return V.getSizeInBits();
+      return getExtendedSizeInBits();
+    }
+
+    unsigned getScalarSizeInBits() const {
+      return getScalarType().getSizeInBits();
+    }
+
+
+
+    unsigned getStoreSize() const {
+      return (getSizeInBits() + 7) / 8;
+    }
+
+
+
+    unsigned getStoreSizeInBits() const {
+      return getStoreSize() * 8;
+    }
+
+
+
+
+    EVT getRoundIntegerType(LLVMContext &Context) const {
+      
+     ((
+     isInteger() && !isVector() && "Invalid integer type!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "isInteger() && !isVector() && \"Invalid integer type!\""
+     , "/home/trippels/llvm/llvm/include/llvm/CodeGen/ValueTypes.h", 318, __PRETTY_FUNCTION__))
+                                                                  ;
+      unsigned BitWidth = getSizeInBits();
+      if (BitWidth <= 8)
+        return EVT(MVT::i8);
+      return getIntegerVT(Context, 1 << Log2_32_Ceil(BitWidth));
+    }
+
+
+
+
+    EVT getHalfSizedIntegerVT(LLVMContext &Context) const {
+      
+     ((
+     isInteger() && !isVector() && "Invalid integer type!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "isInteger() && !isVector() && \"Invalid integer type!\""
+     , "/home/trippels/llvm/llvm/include/llvm/CodeGen/ValueTypes.h", 329, __PRETTY_FUNCTION__))
+                                                                  ;
+      unsigned EVTSize = getSizeInBits();
+      for (unsigned IntVT = MVT::FIRST_INTEGER_VALUETYPE;
+          IntVT <= MVT::LAST_INTEGER_VALUETYPE; ++IntVT) {
+        EVT HalfVT = EVT((MVT::SimpleValueType)IntVT);
+        if (HalfVT.getSizeInBits() * 2 >= EVTSize)
+          return HalfVT;
+      }
+      return getIntegerVT(Context, (EVTSize + 1) / 2);
+    }
+
+
+
+    EVT widenIntegerVectorElementType(LLVMContext &Context) const {
+      EVT EltVT = getVectorElementType();
+      EltVT = EVT::getIntegerVT(Context, 2 * EltVT.getSizeInBits());
+      return EVT::getVectorVT(Context, EltVT, getVectorElementCount());
+    }
+
+
+
+
+    EVT getHalfNumVectorElementsVT(LLVMContext &Context) const {
+      EVT EltVT = getVectorElementType();
+      auto EltCnt = getVectorElementCount();
+      
+     ((
+     !(EltCnt.Min & 1) && "Splitting vector, but not in half!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "!(EltCnt.Min & 1) && \"Splitting vector, but not in half!\""
+     , "/home/trippels/llvm/llvm/include/llvm/CodeGen/ValueTypes.h", 354, __PRETTY_FUNCTION__))
+                                                                      ;
+      return EVT::getVectorVT(Context, EltVT, EltCnt / 2);
+    }
+
+
+    bool isPow2VectorType() const {
+      unsigned NElts = getVectorNumElements();
+      return !(NElts & (NElts - 1));
+    }
+
+
+
+    EVT getPow2VectorType(LLVMContext &Context) const {
+      if (!isPow2VectorType()) {
+        unsigned NElts = getVectorNumElements();
+        unsigned Pow2NElts = 1 << Log2_32_Ceil(NElts);
+        return EVT::getVectorVT(Context, getVectorElementType(), Pow2NElts,
+                                isScalableVector());
+      }
+      else {
+        return *this;
+      }
+    }
+
+
+    std::string getEVTString() const;
+
+
+
+
+    Type *getTypeForEVT(LLVMContext &Context) const;
+
+
+
+
+    static EVT getEVT(Type *Ty, bool HandleUnknown = false);
+
+    intptr_t getRawBits() const {
+      if (isSimple())
+        return V.SimpleTy;
+      else
+        return (intptr_t)(LLVMTy);
+    }
+
+
+
+    struct compareRawBits {
+      bool operator()(EVT L, EVT R) const {
+        if (L.V.SimpleTy == R.V.SimpleTy)
+          return L.LLVMTy < R.LLVMTy;
+        else
+          return L.V.SimpleTy < R.V.SimpleTy;
+      }
+    };
+
+  private:
+
+
+
+    EVT changeExtendedTypeToInteger() const;
+    EVT changeExtendedVectorElementTypeToInteger() const;
+    static EVT getExtendedIntegerVT(LLVMContext &C, unsigned BitWidth);
+    static EVT getExtendedVectorVT(LLVMContext &C, EVT VT,
+                                   unsigned NumElements);
+    bool isExtendedFloatingPoint() const __attribute__((__pure__));
+    bool isExtendedInteger() const __attribute__((__pure__));
+    bool isExtendedScalarInteger() const __attribute__((__pure__));
+    bool isExtendedVector() const __attribute__((__pure__));
+    bool isExtended16BitVector() const __attribute__((__pure__));
+    bool isExtended32BitVector() const __attribute__((__pure__));
+    bool isExtended64BitVector() const __attribute__((__pure__));
+    bool isExtended128BitVector() const __attribute__((__pure__));
+    bool isExtended256BitVector() const __attribute__((__pure__));
+    bool isExtended512BitVector() const __attribute__((__pure__));
+    bool isExtended1024BitVector() const __attribute__((__pure__));
+    bool isExtended2048BitVector() const __attribute__((__pure__));
+    EVT getExtendedVectorElementType() const;
+    unsigned getExtendedVectorNumElements() const __attribute__((__pure__));
+    unsigned getExtendedSizeInBits() const __attribute__((__pure__));
+  };
+
+}
+
+namespace llvm {
+namespace RTLIB {
+  enum Libcall {
+
+SHL_I16,
+SHL_I32,
+SHL_I64,
+SHL_I128,
+SRL_I16,
+SRL_I32,
+SRL_I64,
+SRL_I128,
+SRA_I16,
+SRA_I32,
+SRA_I64,
+SRA_I128,
+MUL_I8,
+MUL_I16,
+MUL_I32,
+MUL_I64,
+MUL_I128,
+MULO_I32,
+MULO_I64,
+MULO_I128,
+SDIV_I8,
+SDIV_I16,
+SDIV_I32,
+SDIV_I64,
+SDIV_I128,
+UDIV_I8,
+UDIV_I16,
+UDIV_I32,
+UDIV_I64,
+UDIV_I128,
+SREM_I8,
+SREM_I16,
+SREM_I32,
+SREM_I64,
+SREM_I128,
+UREM_I8,
+UREM_I16,
+UREM_I32,
+UREM_I64,
+UREM_I128,
+SDIVREM_I8,
+SDIVREM_I16,
+SDIVREM_I32,
+SDIVREM_I64,
+SDIVREM_I128,
+UDIVREM_I8,
+UDIVREM_I16,
+UDIVREM_I32,
+UDIVREM_I64,
+UDIVREM_I128,
+NEG_I32,
+NEG_I64,
+
+
+ADD_F32,
+ADD_F64,
+ADD_F80,
+ADD_F128,
+ADD_PPCF128,
+SUB_F32,
+SUB_F64,
+SUB_F80,
+SUB_F128,
+SUB_PPCF128,
+MUL_F32,
+MUL_F64,
+MUL_F80,
+MUL_F128,
+MUL_PPCF128,
+DIV_F32,
+DIV_F64,
+DIV_F80,
+DIV_F128,
+DIV_PPCF128,
+REM_F32,
+REM_F64,
+REM_F80,
+REM_F128,
+REM_PPCF128,
+FMA_F32,
+FMA_F64,
+FMA_F80,
+FMA_F128,
+FMA_PPCF128,
+POWI_F32,
+POWI_F64,
+POWI_F80,
+POWI_F128,
+POWI_PPCF128,
+SQRT_F32,
+SQRT_F64,
+SQRT_F80,
+SQRT_F128,
+SQRT_PPCF128,
+LOG_F32,
+LOG_F64,
+LOG_F80,
+LOG_F128,
+LOG_PPCF128,
+LOG_FINITE_F32,
+LOG_FINITE_F64,
+LOG_FINITE_F80,
+LOG_FINITE_F128,
+LOG_FINITE_PPCF128,
+LOG2_F32,
+LOG2_F64,
+LOG2_F80,
+LOG2_F128,
+LOG2_PPCF128,
+LOG2_FINITE_F32,
+LOG2_FINITE_F64,
+LOG2_FINITE_F80,
+LOG2_FINITE_F128,
+LOG2_FINITE_PPCF128,
+LOG10_F32,
+LOG10_F64,
+LOG10_F80,
+LOG10_F128,
+LOG10_PPCF128,
+LOG10_FINITE_F32,
+LOG10_FINITE_F64,
+LOG10_FINITE_F80,
+LOG10_FINITE_F128,
+LOG10_FINITE_PPCF128,
+EXP_F32,
+EXP_F64,
+EXP_F80,
+EXP_F128,
+EXP_PPCF128,
+EXP_FINITE_F32,
+EXP_FINITE_F64,
+EXP_FINITE_F80,
+EXP_FINITE_F128,
+EXP_FINITE_PPCF128,
+EXP2_F32,
+EXP2_F64,
+EXP2_F80,
+EXP2_F128,
+EXP2_PPCF128,
+EXP2_FINITE_F32,
+EXP2_FINITE_F64,
+EXP2_FINITE_F80,
+EXP2_FINITE_F128,
+EXP2_FINITE_PPCF128,
+SIN_F32,
+SIN_F64,
+SIN_F80,
+SIN_F128,
+SIN_PPCF128,
+COS_F32,
+COS_F64,
+COS_F80,
+COS_F128,
+COS_PPCF128,
+SINCOS_F32,
+SINCOS_F64,
+SINCOS_F80,
+SINCOS_F128,
+SINCOS_PPCF128,
+SINCOS_STRET_F32,
+SINCOS_STRET_F64,
+POW_F32,
+POW_F64,
+POW_F80,
+POW_F128,
+POW_PPCF128,
+POW_FINITE_F32,
+POW_FINITE_F64,
+POW_FINITE_F80,
+POW_FINITE_F128,
+POW_FINITE_PPCF128,
+CEIL_F32,
+CEIL_F64,
+CEIL_F80,
+CEIL_F128,
+CEIL_PPCF128,
+TRUNC_F32,
+TRUNC_F64,
+TRUNC_F80,
+TRUNC_F128,
+TRUNC_PPCF128,
+RINT_F32,
+RINT_F64,
+RINT_F80,
+RINT_F128,
+RINT_PPCF128,
+NEARBYINT_F32,
+NEARBYINT_F64,
+NEARBYINT_F80,
+NEARBYINT_F128,
+NEARBYINT_PPCF128,
+ROUND_F32,
+ROUND_F64,
+ROUND_F80,
+ROUND_F128,
+ROUND_PPCF128,
+FLOOR_F32,
+FLOOR_F64,
+FLOOR_F80,
+FLOOR_F128,
+FLOOR_PPCF128,
+COPYSIGN_F32,
+COPYSIGN_F64,
+COPYSIGN_F80,
+COPYSIGN_F128,
+COPYSIGN_PPCF128,
+FMIN_F32,
+FMIN_F64,
+FMIN_F80,
+FMIN_F128,
+FMIN_PPCF128,
+FMAX_F32,
+FMAX_F64,
+FMAX_F80,
+FMAX_F128,
+FMAX_PPCF128,
+
+
+FPEXT_F32_PPCF128,
+FPEXT_F64_PPCF128,
+FPEXT_F64_F128,
+FPEXT_F32_F128,
+FPEXT_F32_F64,
+FPEXT_F16_F32,
+FPROUND_F32_F16,
+FPROUND_F64_F16,
+FPROUND_F80_F16,
+FPROUND_F128_F16,
+FPROUND_PPCF128_F16,
+FPROUND_F64_F32,
+FPROUND_F80_F32,
+FPROUND_F128_F32,
+FPROUND_PPCF128_F32,
+FPROUND_F80_F64,
+FPROUND_F128_F64,
+FPROUND_PPCF128_F64,
+FPTOSINT_F32_I32,
+FPTOSINT_F32_I64,
+FPTOSINT_F32_I128,
+FPTOSINT_F64_I32,
+FPTOSINT_F64_I64,
+FPTOSINT_F64_I128,
+FPTOSINT_F80_I32,
+FPTOSINT_F80_I64,
+FPTOSINT_F80_I128,
+FPTOSINT_F128_I32,
+FPTOSINT_F128_I64,
+FPTOSINT_F128_I128,
+FPTOSINT_PPCF128_I32,
+FPTOSINT_PPCF128_I64,
+FPTOSINT_PPCF128_I128,
+FPTOUINT_F32_I32,
+FPTOUINT_F32_I64,
+FPTOUINT_F32_I128,
+FPTOUINT_F64_I32,
+FPTOUINT_F64_I64,
+FPTOUINT_F64_I128,
+FPTOUINT_F80_I32,
+FPTOUINT_F80_I64,
+FPTOUINT_F80_I128,
+FPTOUINT_F128_I32,
+FPTOUINT_F128_I64,
+FPTOUINT_F128_I128,
+FPTOUINT_PPCF128_I32,
+FPTOUINT_PPCF128_I64,
+FPTOUINT_PPCF128_I128,
+SINTTOFP_I32_F32,
+SINTTOFP_I32_F64,
+SINTTOFP_I32_F80,
+SINTTOFP_I32_F128,
+SINTTOFP_I32_PPCF128,
+SINTTOFP_I64_F32,
+SINTTOFP_I64_F64,
+SINTTOFP_I64_F80,
+SINTTOFP_I64_F128,
+SINTTOFP_I64_PPCF128,
+SINTTOFP_I128_F32,
+SINTTOFP_I128_F64,
+SINTTOFP_I128_F80,
+SINTTOFP_I128_F128,
+SINTTOFP_I128_PPCF128,
+UINTTOFP_I32_F32,
+UINTTOFP_I32_F64,
+UINTTOFP_I32_F80,
+UINTTOFP_I32_F128,
+UINTTOFP_I32_PPCF128,
+UINTTOFP_I64_F32,
+UINTTOFP_I64_F64,
+UINTTOFP_I64_F80,
+UINTTOFP_I64_F128,
+UINTTOFP_I64_PPCF128,
+UINTTOFP_I128_F32,
+UINTTOFP_I128_F64,
+UINTTOFP_I128_F80,
+UINTTOFP_I128_F128,
+UINTTOFP_I128_PPCF128,
+
+
+OEQ_F32,
+OEQ_F64,
+OEQ_F128,
+OEQ_PPCF128,
+UNE_F32,
+UNE_F64,
+UNE_F128,
+UNE_PPCF128,
+OGE_F32,
+OGE_F64,
+OGE_F128,
+OGE_PPCF128,
+OLT_F32,
+OLT_F64,
+OLT_F128,
+OLT_PPCF128,
+OLE_F32,
+OLE_F64,
+OLE_F128,
+OLE_PPCF128,
+OGT_F32,
+OGT_F64,
+OGT_F128,
+OGT_PPCF128,
+UO_F32,
+UO_F64,
+UO_F128,
+UO_PPCF128,
+O_F32,
+O_F64,
+O_F128,
+O_PPCF128,
+
+
+MEMCPY,
+MEMMOVE,
+MEMSET,
+BZERO,
+
+
+MEMCPY_ELEMENT_UNORDERED_ATOMIC_1,
+MEMCPY_ELEMENT_UNORDERED_ATOMIC_2,
+MEMCPY_ELEMENT_UNORDERED_ATOMIC_4,
+MEMCPY_ELEMENT_UNORDERED_ATOMIC_8,
+MEMCPY_ELEMENT_UNORDERED_ATOMIC_16,
+MEMMOVE_ELEMENT_UNORDERED_ATOMIC_1,
+MEMMOVE_ELEMENT_UNORDERED_ATOMIC_2,
+MEMMOVE_ELEMENT_UNORDERED_ATOMIC_4,
+MEMMOVE_ELEMENT_UNORDERED_ATOMIC_8,
+MEMMOVE_ELEMENT_UNORDERED_ATOMIC_16,
+MEMSET_ELEMENT_UNORDERED_ATOMIC_1,
+MEMSET_ELEMENT_UNORDERED_ATOMIC_2,
+MEMSET_ELEMENT_UNORDERED_ATOMIC_4,
+MEMSET_ELEMENT_UNORDERED_ATOMIC_8,
+MEMSET_ELEMENT_UNORDERED_ATOMIC_16,
+
+
+UNWIND_RESUME,
+
+
+
+
+
+
+SYNC_VAL_COMPARE_AND_SWAP_1,
+SYNC_VAL_COMPARE_AND_SWAP_2,
+SYNC_VAL_COMPARE_AND_SWAP_4,
+SYNC_VAL_COMPARE_AND_SWAP_8,
+SYNC_VAL_COMPARE_AND_SWAP_16,
+SYNC_LOCK_TEST_AND_SET_1,
+SYNC_LOCK_TEST_AND_SET_2,
+SYNC_LOCK_TEST_AND_SET_4,
+SYNC_LOCK_TEST_AND_SET_8,
+SYNC_LOCK_TEST_AND_SET_16,
+SYNC_FETCH_AND_ADD_1,
+SYNC_FETCH_AND_ADD_2,
+SYNC_FETCH_AND_ADD_4,
+SYNC_FETCH_AND_ADD_8,
+SYNC_FETCH_AND_ADD_16,
+SYNC_FETCH_AND_SUB_1,
+SYNC_FETCH_AND_SUB_2,
+SYNC_FETCH_AND_SUB_4,
+SYNC_FETCH_AND_SUB_8,
+SYNC_FETCH_AND_SUB_16,
+SYNC_FETCH_AND_AND_1,
+SYNC_FETCH_AND_AND_2,
+SYNC_FETCH_AND_AND_4,
+SYNC_FETCH_AND_AND_8,
+SYNC_FETCH_AND_AND_16,
+SYNC_FETCH_AND_OR_1,
+SYNC_FETCH_AND_OR_2,
+SYNC_FETCH_AND_OR_4,
+SYNC_FETCH_AND_OR_8,
+SYNC_FETCH_AND_OR_16,
+SYNC_FETCH_AND_XOR_1,
+SYNC_FETCH_AND_XOR_2,
+SYNC_FETCH_AND_XOR_4,
+SYNC_FETCH_AND_XOR_8,
+SYNC_FETCH_AND_XOR_16,
+SYNC_FETCH_AND_NAND_1,
+SYNC_FETCH_AND_NAND_2,
+SYNC_FETCH_AND_NAND_4,
+SYNC_FETCH_AND_NAND_8,
+SYNC_FETCH_AND_NAND_16,
+SYNC_FETCH_AND_MAX_1,
+SYNC_FETCH_AND_MAX_2,
+SYNC_FETCH_AND_MAX_4,
+SYNC_FETCH_AND_MAX_8,
+SYNC_FETCH_AND_MAX_16,
+SYNC_FETCH_AND_UMAX_1,
+SYNC_FETCH_AND_UMAX_2,
+SYNC_FETCH_AND_UMAX_4,
+SYNC_FETCH_AND_UMAX_8,
+SYNC_FETCH_AND_UMAX_16,
+SYNC_FETCH_AND_MIN_1,
+SYNC_FETCH_AND_MIN_2,
+SYNC_FETCH_AND_MIN_4,
+SYNC_FETCH_AND_MIN_8,
+SYNC_FETCH_AND_MIN_16,
+SYNC_FETCH_AND_UMIN_1,
+SYNC_FETCH_AND_UMIN_2,
+SYNC_FETCH_AND_UMIN_4,
+SYNC_FETCH_AND_UMIN_8,
+SYNC_FETCH_AND_UMIN_16,
+
+
+ATOMIC_LOAD,
+ATOMIC_LOAD_1,
+ATOMIC_LOAD_2,
+ATOMIC_LOAD_4,
+ATOMIC_LOAD_8,
+ATOMIC_LOAD_16,
+
+ATOMIC_STORE,
+ATOMIC_STORE_1,
+ATOMIC_STORE_2,
+ATOMIC_STORE_4,
+ATOMIC_STORE_8,
+ATOMIC_STORE_16,
+
+ATOMIC_EXCHANGE,
+ATOMIC_EXCHANGE_1,
+ATOMIC_EXCHANGE_2,
+ATOMIC_EXCHANGE_4,
+ATOMIC_EXCHANGE_8,
+ATOMIC_EXCHANGE_16,
+
+ATOMIC_COMPARE_EXCHANGE,
+ATOMIC_COMPARE_EXCHANGE_1,
+ATOMIC_COMPARE_EXCHANGE_2,
+ATOMIC_COMPARE_EXCHANGE_4,
+ATOMIC_COMPARE_EXCHANGE_8,
+ATOMIC_COMPARE_EXCHANGE_16,
+
+ATOMIC_FETCH_ADD_1,
+ATOMIC_FETCH_ADD_2,
+ATOMIC_FETCH_ADD_4,
+ATOMIC_FETCH_ADD_8,
+ATOMIC_FETCH_ADD_16,
+ATOMIC_FETCH_SUB_1,
+ATOMIC_FETCH_SUB_2,
+ATOMIC_FETCH_SUB_4,
+ATOMIC_FETCH_SUB_8,
+ATOMIC_FETCH_SUB_16,
+ATOMIC_FETCH_AND_1,
+ATOMIC_FETCH_AND_2,
+ATOMIC_FETCH_AND_4,
+ATOMIC_FETCH_AND_8,
+ATOMIC_FETCH_AND_16,
+ATOMIC_FETCH_OR_1,
+ATOMIC_FETCH_OR_2,
+ATOMIC_FETCH_OR_4,
+ATOMIC_FETCH_OR_8,
+ATOMIC_FETCH_OR_16,
+ATOMIC_FETCH_XOR_1,
+ATOMIC_FETCH_XOR_2,
+ATOMIC_FETCH_XOR_4,
+ATOMIC_FETCH_XOR_8,
+ATOMIC_FETCH_XOR_16,
+ATOMIC_FETCH_NAND_1,
+ATOMIC_FETCH_NAND_2,
+ATOMIC_FETCH_NAND_4,
+ATOMIC_FETCH_NAND_8,
+ATOMIC_FETCH_NAND_16,
+
+
+STACKPROTECTOR_CHECK_FAIL,
+
+
+DEOPTIMIZE,
+
+UNKNOWN_LIBCALL,
+
+  };
+
+
+
+  Libcall getFPEXT(EVT OpVT, EVT RetVT);
+
+
+
+  Libcall getFPROUND(EVT OpVT, EVT RetVT);
+
+
+
+  Libcall getFPTOSINT(EVT OpVT, EVT RetVT);
+
+
+
+  Libcall getFPTOUINT(EVT OpVT, EVT RetVT);
+
+
+
+  Libcall getSINTTOFP(EVT OpVT, EVT RetVT);
+
+
+
+  Libcall getUINTTOFP(EVT OpVT, EVT RetVT);
+
+
+
+  Libcall getSYNC(unsigned Opc, MVT VT);
+
+
+
+
+  Libcall getMEMCPY_ELEMENT_UNORDERED_ATOMIC(uint64_t ElementSize);
+
+
+
+
+  Libcall getMEMMOVE_ELEMENT_UNORDERED_ATOMIC(uint64_t ElementSize);
+
+
+
+
+  Libcall getMEMSET_ELEMENT_UNORDERED_ATOMIC(uint64_t ElementSize);
+
+}
+}
+namespace llvm {
+
+class LoadInst;
+class StoreInst;
+class MemTransferInst;
+class MemIntrinsic;
+class TargetLibraryInfo;
+class MemoryLocation {
+public:
+
+
+
+  enum : uint64_t { UnknownSize = ~0UL };
+
+
+  const Value *Ptr;
+  uint64_t Size;
+
+
+
+  AAMDNodes AATags;
+
+
+
+  static MemoryLocation get(const LoadInst *LI);
+  static MemoryLocation get(const StoreInst *SI);
+  static MemoryLocation get(const VAArgInst *VI);
+  static MemoryLocation get(const AtomicCmpXchgInst *CXI);
+  static MemoryLocation get(const AtomicRMWInst *RMWI);
+  static MemoryLocation get(const Instruction *Inst) {
+    return *MemoryLocation::getOrNone(Inst);
+  }
+  static Optional<MemoryLocation> getOrNone(const Instruction *Inst) {
+    switch (Inst->getOpcode()) {
+    case Instruction::Load:
+      return get(cast<LoadInst>(Inst));
+    case Instruction::Store:
+      return get(cast<StoreInst>(Inst));
+    case Instruction::VAArg:
+      return get(cast<VAArgInst>(Inst));
+    case Instruction::AtomicCmpXchg:
+      return get(cast<AtomicCmpXchgInst>(Inst));
+    case Instruction::AtomicRMW:
+      return get(cast<AtomicRMWInst>(Inst));
+    default:
+      return None;
+    }
+  }
+
+
+  static MemoryLocation getForSource(const MemTransferInst *MTI);
+
+
+
+  static MemoryLocation getForDest(const MemIntrinsic *MI);
+
+
+  static MemoryLocation getForArgument(ImmutableCallSite CS, unsigned ArgIdx,
+                                       const TargetLibraryInfo &TLI);
+
+  explicit MemoryLocation(const Value *Ptr = nullptr,
+                          uint64_t Size = UnknownSize,
+                          const AAMDNodes &AATags = AAMDNodes())
+      : Ptr(Ptr), Size(Size), AATags(AATags) {}
+
+  MemoryLocation getWithNewPtr(const Value *NewPtr) const {
+    MemoryLocation Copy(*this);
+    Copy.Ptr = NewPtr;
+    return Copy;
+  }
+
+  MemoryLocation getWithNewSize(uint64_t NewSize) const {
+    MemoryLocation Copy(*this);
+    Copy.Size = NewSize;
+    return Copy;
+  }
+
+  MemoryLocation getWithoutAATags() const {
+    MemoryLocation Copy(*this);
+    Copy.AATags = AAMDNodes();
+    return Copy;
+  }
+
+  bool operator==(const MemoryLocation &Other) const {
+    return Ptr == Other.Ptr && Size == Other.Size && AATags == Other.AATags;
+  }
+};
+
+
+template <> struct DenseMapInfo<MemoryLocation> {
+  static inline MemoryLocation getEmptyKey() {
+    return MemoryLocation(DenseMapInfo<const Value *>::getEmptyKey(), 0);
+  }
+  static inline MemoryLocation getTombstoneKey() {
+    return MemoryLocation(DenseMapInfo<const Value *>::getTombstoneKey(), 0);
+  }
+  static unsigned getHashValue(const MemoryLocation &Val) {
+    return DenseMapInfo<const Value *>::getHashValue(Val.Ptr) ^
+           DenseMapInfo<uint64_t>::getHashValue(Val.Size) ^
+           DenseMapInfo<AAMDNodes>::getHashValue(Val.AATags);
+  }
+  static bool isEqual(const MemoryLocation &LHS, const MemoryLocation &RHS) {
+    return LHS == RHS;
+  }
+};
+}
+namespace llvm {
+
+class AnalysisUsage;
+class BasicAAResult;
+class BasicBlock;
+class DominatorTree;
+class OrderedBasicBlock;
+class Value;
+enum AliasResult {
+
+
+
+
+
+  NoAlias = 0,
+
+  MayAlias,
+
+  PartialAlias,
+
+  MustAlias,
+};
+
+
+
+
+
+
+
+enum class ModRefInfo {
+
+
+  Must = 0,
+
+
+  MustRef = 1,
+
+
+  MustMod = 2,
+
+
+  MustModRef = MustRef | MustMod,
+
+  NoModRef = 4,
+
+  Ref = NoModRef | MustRef,
+
+  Mod = NoModRef | MustMod,
+
+  ModRef = Ref | Mod,
+};
+
+ inline bool isNoModRef(const ModRefInfo MRI) {
+  return (static_cast<int>(MRI) & static_cast<int>(ModRefInfo::MustModRef)) ==
+         static_cast<int>(ModRefInfo::Must);
+}
+ inline bool isModOrRefSet(const ModRefInfo MRI) {
+  return static_cast<int>(MRI) & static_cast<int>(ModRefInfo::MustModRef);
+}
+ inline bool isModAndRefSet(const ModRefInfo MRI) {
+  return (static_cast<int>(MRI) & static_cast<int>(ModRefInfo::MustModRef)) ==
+         static_cast<int>(ModRefInfo::MustModRef);
+}
+ inline bool isModSet(const ModRefInfo MRI) {
+  return static_cast<int>(MRI) & static_cast<int>(ModRefInfo::MustMod);
+}
+ inline bool isRefSet(const ModRefInfo MRI) {
+  return static_cast<int>(MRI) & static_cast<int>(ModRefInfo::MustRef);
+}
+ inline bool isMustSet(const ModRefInfo MRI) {
+  return !(static_cast<int>(MRI) & static_cast<int>(ModRefInfo::NoModRef));
+}
+
+ inline ModRefInfo setMod(const ModRefInfo MRI) {
+  return ModRefInfo(static_cast<int>(MRI) |
+                    static_cast<int>(ModRefInfo::MustMod));
+}
+ inline ModRefInfo setRef(const ModRefInfo MRI) {
+  return ModRefInfo(static_cast<int>(MRI) |
+                    static_cast<int>(ModRefInfo::MustRef));
+}
+ inline ModRefInfo setMust(const ModRefInfo MRI) {
+  return ModRefInfo(static_cast<int>(MRI) &
+                    static_cast<int>(ModRefInfo::MustModRef));
+}
+ inline ModRefInfo setModAndRef(const ModRefInfo MRI) {
+  return ModRefInfo(static_cast<int>(MRI) |
+                    static_cast<int>(ModRefInfo::MustModRef));
+}
+ inline ModRefInfo clearMod(const ModRefInfo MRI) {
+  return ModRefInfo(static_cast<int>(MRI) & static_cast<int>(ModRefInfo::Ref));
+}
+ inline ModRefInfo clearRef(const ModRefInfo MRI) {
+  return ModRefInfo(static_cast<int>(MRI) & static_cast<int>(ModRefInfo::Mod));
+}
+ inline ModRefInfo clearMust(const ModRefInfo MRI) {
+  return ModRefInfo(static_cast<int>(MRI) |
+                    static_cast<int>(ModRefInfo::NoModRef));
+}
+ inline ModRefInfo unionModRef(const ModRefInfo MRI1,
+                                             const ModRefInfo MRI2) {
+  return ModRefInfo(static_cast<int>(MRI1) | static_cast<int>(MRI2));
+}
+ inline ModRefInfo intersectModRef(const ModRefInfo MRI1,
+                                                 const ModRefInfo MRI2) {
+  return ModRefInfo(static_cast<int>(MRI1) & static_cast<int>(MRI2));
+}
+
+
+
+
+
+
+enum FunctionModRefLocation {
+
+  FMRL_Nowhere = 0,
+
+  FMRL_ArgumentPointees = 8,
+
+  FMRL_InaccessibleMem = 16,
+
+  FMRL_Anywhere = 32 | FMRL_InaccessibleMem | FMRL_ArgumentPointees
+};
+
+
+
+
+
+
+enum FunctionModRefBehavior {
+
+
+
+
+
+  FMRB_DoesNotAccessMemory =
+      FMRL_Nowhere | static_cast<int>(ModRefInfo::NoModRef),
+
+
+
+
+
+
+  FMRB_OnlyReadsArgumentPointees =
+      FMRL_ArgumentPointees | static_cast<int>(ModRefInfo::Ref),
+
+
+
+
+
+
+  FMRB_OnlyAccessesArgumentPointees =
+      FMRL_ArgumentPointees | static_cast<int>(ModRefInfo::ModRef),
+
+
+
+
+
+  FMRB_OnlyAccessesInaccessibleMem =
+      FMRL_InaccessibleMem | static_cast<int>(ModRefInfo::ModRef),
+  FMRB_OnlyAccessesInaccessibleOrArgMem = FMRL_InaccessibleMem |
+                                          FMRL_ArgumentPointees |
+                                          static_cast<int>(ModRefInfo::ModRef),
+
+
+
+
+
+
+
+  FMRB_OnlyReadsMemory = FMRL_Anywhere | static_cast<int>(ModRefInfo::Ref),
+
+
+
+
+
+
+  FMRB_DoesNotReadMemory = FMRL_Anywhere | static_cast<int>(ModRefInfo::Mod),
+
+
+
+  FMRB_UnknownModRefBehavior =
+      FMRL_Anywhere | static_cast<int>(ModRefInfo::ModRef)
+};
+
+
+
+
+
+ inline ModRefInfo
+createModRefInfo(const FunctionModRefBehavior FMRB) {
+  return ModRefInfo(FMRB & static_cast<int>(ModRefInfo::ModRef));
+}
+
+class AAResults {
+public:
+
+
+  AAResults(const TargetLibraryInfo &TLI) : TLI(TLI) {}
+  AAResults(AAResults &&Arg);
+  ~AAResults();
+
+
+  template <typename AAResultT> void addAAResult(AAResultT &AAResult) {
+
+
+
+    AAs.emplace_back(new Model<AAResultT>(AAResult, *this));
+  }
+
+
+
+
+
+
+  void addAADependencyID(AnalysisKey *ID) { AADeps.push_back(ID); }
+
+
+
+
+
+  bool invalidate(Function &F, const PreservedAnalyses &PA,
+                  FunctionAnalysisManager::Invalidator &Inv);
+  AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB);
+
+
+  AliasResult alias(const Value *V1, uint64_t V1Size, const Value *V2,
+                    uint64_t V2Size) {
+    return alias(MemoryLocation(V1, V1Size), MemoryLocation(V2, V2Size));
+  }
+
+
+  AliasResult alias(const Value *V1, const Value *V2) {
+    return alias(V1, MemoryLocation::UnknownSize, V2,
+                 MemoryLocation::UnknownSize);
+  }
+
+
+
+  bool isNoAlias(const MemoryLocation &LocA, const MemoryLocation &LocB) {
+    return alias(LocA, LocB) == NoAlias;
+  }
+
+
+  bool isNoAlias(const Value *V1, uint64_t V1Size, const Value *V2,
+                 uint64_t V2Size) {
+    return isNoAlias(MemoryLocation(V1, V1Size), MemoryLocation(V2, V2Size));
+  }
+
+
+  bool isNoAlias(const Value *V1, const Value *V2) {
+    return isNoAlias(MemoryLocation(V1), MemoryLocation(V2));
+  }
+
+
+
+  bool isMustAlias(const MemoryLocation &LocA, const MemoryLocation &LocB) {
+    return alias(LocA, LocB) == MustAlias;
+  }
+
+
+  bool isMustAlias(const Value *V1, const Value *V2) {
+    return alias(V1, 1, V2, 1) == MustAlias;
+  }
+
+
+
+  bool pointsToConstantMemory(const MemoryLocation &Loc, bool OrLocal = false);
+
+
+
+  bool pointsToConstantMemory(const Value *P, bool OrLocal = false) {
+    return pointsToConstantMemory(MemoryLocation(P), OrLocal);
+  }
+  ModRefInfo getArgModRefInfo(ImmutableCallSite CS, unsigned ArgIdx);
+
+
+  FunctionModRefBehavior getModRefBehavior(ImmutableCallSite CS);
+
+
+  FunctionModRefBehavior getModRefBehavior(const Function *F);
+  bool doesNotAccessMemory(ImmutableCallSite CS) {
+    return getModRefBehavior(CS) == FMRB_DoesNotAccessMemory;
+  }
+  bool doesNotAccessMemory(const Function *F) {
+    return getModRefBehavior(F) == FMRB_DoesNotAccessMemory;
+  }
+  bool onlyReadsMemory(ImmutableCallSite CS) {
+    return onlyReadsMemory(getModRefBehavior(CS));
+  }
+  bool onlyReadsMemory(const Function *F) {
+    return onlyReadsMemory(getModRefBehavior(F));
+  }
+
+
+
+  static bool onlyReadsMemory(FunctionModRefBehavior MRB) {
+    return !isModSet(createModRefInfo(MRB));
+  }
+
+
+
+  static bool doesNotReadMemory(FunctionModRefBehavior MRB) {
+    return !isRefSet(createModRefInfo(MRB));
+  }
+
+
+
+
+  static bool onlyAccessesArgPointees(FunctionModRefBehavior MRB) {
+    return !(MRB & FMRL_Anywhere & ~FMRL_ArgumentPointees);
+  }
+
+
+
+
+  static bool doesAccessArgPointees(FunctionModRefBehavior MRB) {
+    return isModOrRefSet(createModRefInfo(MRB)) &&
+           (MRB & FMRL_ArgumentPointees);
+  }
+
+
+
+  static bool onlyAccessesInaccessibleMem(FunctionModRefBehavior MRB) {
+    return !(MRB & FMRL_Anywhere & ~FMRL_InaccessibleMem);
+  }
+
+
+
+  static bool doesAccessInaccessibleMem(FunctionModRefBehavior MRB) {
+    return isModOrRefSet(createModRefInfo(MRB)) && (MRB & FMRL_InaccessibleMem);
+  }
+
+
+
+
+  static bool onlyAccessesInaccessibleOrArgMem(FunctionModRefBehavior MRB) {
+    return !(MRB & FMRL_Anywhere &
+             ~(FMRL_InaccessibleMem | FMRL_ArgumentPointees));
+  }
+
+
+
+  ModRefInfo getModRefInfo(ImmutableCallSite CS, const MemoryLocation &Loc);
+
+
+  ModRefInfo getModRefInfo(ImmutableCallSite CS, const Value *P,
+                           uint64_t Size) {
+    return getModRefInfo(CS, MemoryLocation(P, Size));
+  }
+
+
+
+  ModRefInfo getModRefInfo(const CallInst *C, const MemoryLocation &Loc) {
+    return getModRefInfo(ImmutableCallSite(C), Loc);
+  }
+
+
+  ModRefInfo getModRefInfo(const CallInst *C, const Value *P, uint64_t Size) {
+    return getModRefInfo(C, MemoryLocation(P, Size));
+  }
+
+
+
+  ModRefInfo getModRefInfo(const InvokeInst *I, const MemoryLocation &Loc) {
+    return getModRefInfo(ImmutableCallSite(I), Loc);
+  }
+
+
+  ModRefInfo getModRefInfo(const InvokeInst *I, const Value *P, uint64_t Size) {
+    return getModRefInfo(I, MemoryLocation(P, Size));
+  }
+
+
+
+  ModRefInfo getModRefInfo(const LoadInst *L, const MemoryLocation &Loc);
+
+
+  ModRefInfo getModRefInfo(const LoadInst *L, const Value *P, uint64_t Size) {
+    return getModRefInfo(L, MemoryLocation(P, Size));
+  }
+
+
+
+  ModRefInfo getModRefInfo(const StoreInst *S, const MemoryLocation &Loc);
+
+
+  ModRefInfo getModRefInfo(const StoreInst *S, const Value *P, uint64_t Size) {
+    return getModRefInfo(S, MemoryLocation(P, Size));
+  }
+
+
+
+  ModRefInfo getModRefInfo(const FenceInst *S, const MemoryLocation &Loc);
+
+
+  ModRefInfo getModRefInfo(const FenceInst *S, const Value *P, uint64_t Size) {
+    return getModRefInfo(S, MemoryLocation(P, Size));
+  }
+
+
+
+  ModRefInfo getModRefInfo(const AtomicCmpXchgInst *CX,
+                           const MemoryLocation &Loc);
+
+
+  ModRefInfo getModRefInfo(const AtomicCmpXchgInst *CX, const Value *P,
+                           unsigned Size) {
+    return getModRefInfo(CX, MemoryLocation(P, Size));
+  }
+
+
+
+  ModRefInfo getModRefInfo(const AtomicRMWInst *RMW, const MemoryLocation &Loc);
+
+
+  ModRefInfo getModRefInfo(const AtomicRMWInst *RMW, const Value *P,
+                           unsigned Size) {
+    return getModRefInfo(RMW, MemoryLocation(P, Size));
+  }
+
+
+
+  ModRefInfo getModRefInfo(const VAArgInst *I, const MemoryLocation &Loc);
+
+
+  ModRefInfo getModRefInfo(const VAArgInst *I, const Value *P, uint64_t Size) {
+    return getModRefInfo(I, MemoryLocation(P, Size));
+  }
+
+
+
+  ModRefInfo getModRefInfo(const CatchPadInst *I, const MemoryLocation &Loc);
+
+
+  ModRefInfo getModRefInfo(const CatchPadInst *I, const Value *P,
+                           uint64_t Size) {
+    return getModRefInfo(I, MemoryLocation(P, Size));
+  }
+
+
+
+  ModRefInfo getModRefInfo(const CatchReturnInst *I, const MemoryLocation &Loc);
+
+
+  ModRefInfo getModRefInfo(const CatchReturnInst *I, const Value *P,
+                           uint64_t Size) {
+    return getModRefInfo(I, MemoryLocation(P, Size));
+  }
+  ModRefInfo getModRefInfo(const Instruction *I,
+                           const Optional<MemoryLocation> &OptLoc) {
+    if (OptLoc == None) {
+      if (auto CS = ImmutableCallSite(I)) {
+        return createModRefInfo(getModRefBehavior(CS));
+      }
+    }
+
+    const MemoryLocation &Loc = OptLoc.getValueOr(MemoryLocation());
+
+    switch (I->getOpcode()) {
+    case Instruction::VAArg: return getModRefInfo((const VAArgInst*)I, Loc);
+    case Instruction::Load: return getModRefInfo((const LoadInst*)I, Loc);
+    case Instruction::Store: return getModRefInfo((const StoreInst*)I, Loc);
+    case Instruction::Fence: return getModRefInfo((const FenceInst*)I, Loc);
+    case Instruction::AtomicCmpXchg:
+      return getModRefInfo((const AtomicCmpXchgInst*)I, Loc);
+    case Instruction::AtomicRMW:
+      return getModRefInfo((const AtomicRMWInst*)I, Loc);
+    case Instruction::Call: return getModRefInfo((const CallInst*)I, Loc);
+    case Instruction::Invoke: return getModRefInfo((const InvokeInst*)I,Loc);
+    case Instruction::CatchPad:
+      return getModRefInfo((const CatchPadInst *)I, Loc);
+    case Instruction::CatchRet:
+      return getModRefInfo((const CatchReturnInst *)I, Loc);
+    default:
+      return ModRefInfo::NoModRef;
+    }
+  }
+
+
+  ModRefInfo getModRefInfo(const Instruction *I, const Value *P,
+                           uint64_t Size) {
+    return getModRefInfo(I, MemoryLocation(P, Size));
+  }
+
+
+
+  ModRefInfo getModRefInfo(Instruction *I, ImmutableCallSite Call);
+
+
+
+
+  ModRefInfo getModRefInfo(ImmutableCallSite CS1, ImmutableCallSite CS2);
+
+
+
+
+
+
+
+  ModRefInfo callCapturesBefore(const Instruction *I,
+                                const MemoryLocation &MemLoc, DominatorTree *DT,
+                                OrderedBasicBlock *OBB = nullptr);
+
+
+  ModRefInfo callCapturesBefore(const Instruction *I, const Value *P,
+                                uint64_t Size, DominatorTree *DT,
+                                OrderedBasicBlock *OBB = nullptr) {
+    return callCapturesBefore(I, MemoryLocation(P, Size), DT, OBB);
+  }
+  bool canBasicBlockModify(const BasicBlock &BB, const MemoryLocation &Loc);
+
+
+  bool canBasicBlockModify(const BasicBlock &BB, const Value *P,
+                           uint64_t Size) {
+    return canBasicBlockModify(BB, MemoryLocation(P, Size));
+  }
+
+
+
+
+
+
+  bool canInstructionRangeModRef(const Instruction &I1, const Instruction &I2,
+                                 const MemoryLocation &Loc,
+                                 const ModRefInfo Mode);
+
+
+  bool canInstructionRangeModRef(const Instruction &I1, const Instruction &I2,
+                                 const Value *Ptr, uint64_t Size,
+                                 const ModRefInfo Mode) {
+    return canInstructionRangeModRef(I1, I2, MemoryLocation(Ptr, Size), Mode);
+  }
+
+private:
+  class Concept;
+
+  template <typename T> class Model;
+
+  template <typename T> friend class AAResultBase;
+
+  const TargetLibraryInfo &TLI;
+
+  std::vector<std::unique_ptr<Concept>> AAs;
+
+  std::vector<AnalysisKey *> AADeps;
+};
+
+
+
+using AliasAnalysis = AAResults;
+class AAResults::Concept {
+public:
+  virtual ~Concept() = 0;
+
+
+
+  virtual void setAAResults(AAResults *NewAAR) = 0;
+  virtual AliasResult alias(const MemoryLocation &LocA,
+                            const MemoryLocation &LocB) = 0;
+
+
+
+  virtual bool pointsToConstantMemory(const MemoryLocation &Loc,
+                                      bool OrLocal) = 0;
+  virtual ModRefInfo getArgModRefInfo(ImmutableCallSite CS,
+                                      unsigned ArgIdx) = 0;
+
+
+  virtual FunctionModRefBehavior getModRefBehavior(ImmutableCallSite CS) = 0;
+
+
+  virtual FunctionModRefBehavior getModRefBehavior(const Function *F) = 0;
+
+
+
+  virtual ModRefInfo getModRefInfo(ImmutableCallSite CS,
+                                   const MemoryLocation &Loc) = 0;
+
+
+
+
+  virtual ModRefInfo getModRefInfo(ImmutableCallSite CS1,
+                                   ImmutableCallSite CS2) = 0;
+
+
+};
+
+
+
+
+
+
+
+template <typename AAResultT> class AAResults::Model final : public Concept {
+  AAResultT &Result;
+
+public:
+  explicit Model(AAResultT &Result, AAResults &AAR) : Result(Result) {
+    Result.setAAResults(&AAR);
+  }
+  ~Model() override = default;
+
+  void setAAResults(AAResults *NewAAR) override { Result.setAAResults(NewAAR); }
+
+  AliasResult alias(const MemoryLocation &LocA,
+                    const MemoryLocation &LocB) override {
+    return Result.alias(LocA, LocB);
+  }
+
+  bool pointsToConstantMemory(const MemoryLocation &Loc,
+                              bool OrLocal) override {
+    return Result.pointsToConstantMemory(Loc, OrLocal);
+  }
+
+  ModRefInfo getArgModRefInfo(ImmutableCallSite CS, unsigned ArgIdx) override {
+    return Result.getArgModRefInfo(CS, ArgIdx);
+  }
+
+  FunctionModRefBehavior getModRefBehavior(ImmutableCallSite CS) override {
+    return Result.getModRefBehavior(CS);
+  }
+
+  FunctionModRefBehavior getModRefBehavior(const Function *F) override {
+    return Result.getModRefBehavior(F);
+  }
+
+  ModRefInfo getModRefInfo(ImmutableCallSite CS,
+                           const MemoryLocation &Loc) override {
+    return Result.getModRefInfo(CS, Loc);
+  }
+
+  ModRefInfo getModRefInfo(ImmutableCallSite CS1,
+                           ImmutableCallSite CS2) override {
+    return Result.getModRefInfo(CS1, CS2);
+  }
+};
+template <typename DerivedT> class AAResultBase {
+
+
+
+  friend class AAResults::Model<DerivedT>;
+
+
+
+  AAResults *AAR;
+
+
+  DerivedT &derived() { return static_cast<DerivedT &>(*this); }
+
+
+
+  void setAAResults(AAResults *NewAAR) { AAR = NewAAR; }
+
+protected:
+
+
+
+  class AAResultsProxy {
+    AAResults *AAR;
+    DerivedT &CurrentResult;
+
+  public:
+    AAResultsProxy(AAResults *AAR, DerivedT &CurrentResult)
+        : AAR(AAR), CurrentResult(CurrentResult) {}
+
+    AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB) {
+      return AAR ? AAR->alias(LocA, LocB) : CurrentResult.alias(LocA, LocB);
+    }
+
+    bool pointsToConstantMemory(const MemoryLocation &Loc, bool OrLocal) {
+      return AAR ? AAR->pointsToConstantMemory(Loc, OrLocal)
+                 : CurrentResult.pointsToConstantMemory(Loc, OrLocal);
+    }
+
+    ModRefInfo getArgModRefInfo(ImmutableCallSite CS, unsigned ArgIdx) {
+      return AAR ? AAR->getArgModRefInfo(CS, ArgIdx) : CurrentResult.getArgModRefInfo(CS, ArgIdx);
+    }
+
+    FunctionModRefBehavior getModRefBehavior(ImmutableCallSite CS) {
+      return AAR ? AAR->getModRefBehavior(CS) : CurrentResult.getModRefBehavior(CS);
+    }
+
+    FunctionModRefBehavior getModRefBehavior(const Function *F) {
+      return AAR ? AAR->getModRefBehavior(F) : CurrentResult.getModRefBehavior(F);
+    }
+
+    ModRefInfo getModRefInfo(ImmutableCallSite CS, const MemoryLocation &Loc) {
+      return AAR ? AAR->getModRefInfo(CS, Loc)
+                 : CurrentResult.getModRefInfo(CS, Loc);
+    }
+
+    ModRefInfo getModRefInfo(ImmutableCallSite CS1, ImmutableCallSite CS2) {
+      return AAR ? AAR->getModRefInfo(CS1, CS2) : CurrentResult.getModRefInfo(CS1, CS2);
+    }
+  };
+
+  explicit AAResultBase() = default;
+
+
+
+  AAResultBase(const AAResultBase &Arg) {}
+  AAResultBase(AAResultBase &&Arg) {}
+  AAResultsProxy getBestAAResults() { return AAResultsProxy(AAR, derived()); }
+
+public:
+  AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB) {
+    return MayAlias;
+  }
+
+  bool pointsToConstantMemory(const MemoryLocation &Loc, bool OrLocal) {
+    return false;
+  }
+
+  ModRefInfo getArgModRefInfo(ImmutableCallSite CS, unsigned ArgIdx) {
+    return ModRefInfo::ModRef;
+  }
+
+  FunctionModRefBehavior getModRefBehavior(ImmutableCallSite CS) {
+    return FMRB_UnknownModRefBehavior;
+  }
+
+  FunctionModRefBehavior getModRefBehavior(const Function *F) {
+    return FMRB_UnknownModRefBehavior;
+  }
+
+  ModRefInfo getModRefInfo(ImmutableCallSite CS, const MemoryLocation &Loc) {
+    return ModRefInfo::ModRef;
+  }
+
+  ModRefInfo getModRefInfo(ImmutableCallSite CS1, ImmutableCallSite CS2) {
+    return ModRefInfo::ModRef;
+  }
+};
+
+
+bool isNoAliasCall(const Value *V);
+
+
+bool isNoAliasArgument(const Value *V);
+bool isIdentifiedObject(const Value *V);
+
+
+
+
+
+
+bool isIdentifiedFunctionLocal(const Value *V);
+class AAManager : public AnalysisInfoMixin<AAManager> {
+public:
+  using Result = AAResults;
+
+
+  template <typename AnalysisT> void registerFunctionAnalysis() {
+    ResultGetters.push_back(&getFunctionAAResultImpl<AnalysisT>);
+  }
+
+
+  template <typename AnalysisT> void registerModuleAnalysis() {
+    ResultGetters.push_back(&getModuleAAResultImpl<AnalysisT>);
+  }
+
+  Result run(Function &F, FunctionAnalysisManager &AM) {
+    Result R(AM.getResult<TargetLibraryAnalysis>(F));
+    for (auto &Getter : ResultGetters)
+      (*Getter)(F, AM, R);
+    return R;
+  }
+
+private:
+  friend AnalysisInfoMixin<AAManager>;
+
+  static AnalysisKey Key;
+
+  SmallVector<void (*)(Function &F, FunctionAnalysisManager &AM,
+                       AAResults &AAResults),
+              4> ResultGetters;
+
+  template <typename AnalysisT>
+  static void getFunctionAAResultImpl(Function &F,
+                                      FunctionAnalysisManager &AM,
+                                      AAResults &AAResults) {
+    AAResults.addAAResult(AM.template getResult<AnalysisT>(F));
+    AAResults.addAADependencyID(AnalysisT::ID());
+  }
+
+  template <typename AnalysisT>
+  static void getModuleAAResultImpl(Function &F, FunctionAnalysisManager &AM,
+                                    AAResults &AAResults) {
+    auto &MAMProxy = AM.getResult<ModuleAnalysisManagerFunctionProxy>(F);
+    auto &MAM = MAMProxy.getManager();
+    if (auto *R = MAM.template getCachedResult<AnalysisT>(*F.getParent())) {
+      AAResults.addAAResult(*R);
+      MAMProxy
+          .template registerOuterAnalysisInvalidation<AnalysisT, AAManager>();
+    }
+  }
+};
+
+
+
+class AAResultsWrapperPass : public FunctionPass {
+  std::unique_ptr<AAResults> AAR;
+
+public:
+  static char ID;
+
+  AAResultsWrapperPass();
+
+  AAResults &getAAResults() { return *AAR; }
+  const AAResults &getAAResults() const { return *AAR; }
+
+  bool runOnFunction(Function &F) override;
+
+  void getAnalysisUsage(AnalysisUsage &AU) const override;
+};
+
+FunctionPass *createAAResultsWrapperPass();
+ImmutablePass *createExternalAAWrapperPass(
+    std::function<void(Pass &, Function &, AAResults &)> Callback);
+AAResults createLegacyPMAAResults(Pass &P, Function &F, BasicAAResult &BAR);
+
+
+
+void getAAResultsAnalysisUsage(AnalysisUsage &AU);
+
+}
+
+
+namespace llvm {
+class BasicBlock;
+class Function;
+class Value;
+
+enum class EHPersonality {
+  Unknown,
+  GNU_Ada,
+  GNU_C,
+  GNU_C_SjLj,
+  GNU_CXX,
+  GNU_CXX_SjLj,
+  GNU_ObjC,
+  MSVC_X86SEH,
+  MSVC_Win64SEH,
+  MSVC_CXX,
+  CoreCLR,
+  Rust
+};
+
+
+
+
+EHPersonality classifyEHPersonality(const Value *Pers);
+
+StringRef getEHPersonalityName(EHPersonality Pers);
+
+EHPersonality getDefaultEHPersonality(const Triple &T);
+
+
+
+inline bool isAsynchronousEHPersonality(EHPersonality Pers) {
+
+
+  switch (Pers) {
+  case EHPersonality::MSVC_X86SEH:
+  case EHPersonality::MSVC_Win64SEH:
+    return true;
+  default:
+    return false;
+  }
+  ::llvm::llvm_unreachable_internal("invalid enum", "/home/trippels/llvm/llvm/include/llvm/Analysis/EHPersonalities.h", 59);
+}
+
+
+
+inline bool isFuncletEHPersonality(EHPersonality Pers) {
+  switch (Pers) {
+  case EHPersonality::MSVC_CXX:
+  case EHPersonality::MSVC_X86SEH:
+  case EHPersonality::MSVC_Win64SEH:
+  case EHPersonality::CoreCLR:
+    return true;
+  default:
+    return false;
+  }
+  ::llvm::llvm_unreachable_internal("invalid enum", "/home/trippels/llvm/llvm/include/llvm/Analysis/EHPersonalities.h", 74);
+}
+
+
+
+inline bool isNoOpWithoutInvoke(EHPersonality Pers) {
+  switch (Pers) {
+  case EHPersonality::Unknown:
+    return false;
+
+  default:
+    return true;
+  }
+  ::llvm::llvm_unreachable_internal("invalid enum", "/home/trippels/llvm/llvm/include/llvm/Analysis/EHPersonalities.h", 87);
+}
+
+bool canSimplifyInvokeNoUnwind(const Function *F);
+
+typedef TinyPtrVector<BasicBlock *> ColorVector;
+
+
+
+
+
+DenseMap<BasicBlock *, ColorVector> colorEHFunclets(Function &F);
+
+}
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+namespace llvm {
+
+class DataLayout;
+class Type;
+class raw_ostream;
+
+class LLT {
+public:
+
+  static LLT scalar(unsigned SizeInBits) {
+    
+   ((
+   SizeInBits > 0 && "invalid scalar size"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "SizeInBits > 0 && \"invalid scalar size\""
+   , "/home/trippels/llvm/llvm/include/llvm/Support/LowLevelTypeImpl.h", 44, __PRETTY_FUNCTION__))
+                                                  ;
+    return LLT{ false, false, 0,
+               SizeInBits, 0};
+  }
+
+
+  static LLT pointer(uint16_t AddressSpace, unsigned SizeInBits) {
+    
+   ((
+   SizeInBits > 0 && "invalid pointer size"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "SizeInBits > 0 && \"invalid pointer size\""
+   , "/home/trippels/llvm/llvm/include/llvm/Support/LowLevelTypeImpl.h", 51, __PRETTY_FUNCTION__))
+                                                   ;
+    return LLT{ true, false, 0,
+               SizeInBits, AddressSpace};
+  }
+
+
+
+  static LLT vector(uint16_t NumElements, unsigned ScalarSizeInBits) {
+    
+   ((
+   NumElements > 1 && "invalid number of vector elements"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "NumElements > 1 && \"invalid number of vector elements\""
+   , "/home/trippels/llvm/llvm/include/llvm/Support/LowLevelTypeImpl.h", 59, __PRETTY_FUNCTION__))
+                                                                 ;
+    
+   ((
+   ScalarSizeInBits > 0 && "invalid vector element size"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "ScalarSizeInBits > 0 && \"invalid vector element size\""
+   , "/home/trippels/llvm/llvm/include/llvm/Support/LowLevelTypeImpl.h", 60, __PRETTY_FUNCTION__))
+                                                                ;
+    return LLT{ false, true, NumElements,
+               ScalarSizeInBits, 0};
+  }
+
+
+  static LLT vector(uint16_t NumElements, LLT ScalarTy) {
+    
+   ((
+   NumElements > 1 && "invalid number of vector elements"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "NumElements > 1 && \"invalid number of vector elements\""
+   , "/home/trippels/llvm/llvm/include/llvm/Support/LowLevelTypeImpl.h", 67, __PRETTY_FUNCTION__))
+                                                                 ;
+    
+   ((
+   !ScalarTy.isVector() && "invalid vector element type"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!ScalarTy.isVector() && \"invalid vector element type\""
+   , "/home/trippels/llvm/llvm/include/llvm/Support/LowLevelTypeImpl.h", 68, __PRETTY_FUNCTION__))
+                                                                ;
+    return LLT{ScalarTy.isPointer(), true, NumElements,
+               ScalarTy.getSizeInBits(),
+               ScalarTy.isPointer() ? ScalarTy.getAddressSpace() : 0};
+  }
+
+  explicit LLT(bool isPointer, bool isVector, uint16_t NumElements,
+               unsigned SizeInBits, unsigned AddressSpace) {
+    init(isPointer, isVector, NumElements, SizeInBits, AddressSpace);
+  }
+  explicit LLT() : IsPointer(false), IsVector(false), RawData(0) {}
+
+  explicit LLT(MVT VT);
+
+  bool isValid() const { return RawData != 0; }
+
+  bool isScalar() const { return isValid() && !IsPointer && !IsVector; }
+
+  bool isPointer() const { return isValid() && IsPointer && !IsVector; }
+
+  bool isVector() const { return isValid() && IsVector; }
+
+
+
+  uint16_t getNumElements() const {
+    
+   ((
+   IsVector && "cannot get number of elements on scalar/aggregate"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "IsVector && \"cannot get number of elements on scalar/aggregate\""
+   , "/home/trippels/llvm/llvm/include/llvm/Support/LowLevelTypeImpl.h", 93, __PRETTY_FUNCTION__))
+                                                                          ;
+    if (!IsPointer)
+      return getFieldValue(VectorElementsFieldInfo);
+    else
+      return getFieldValue(PointerVectorElementsFieldInfo);
+  }
+
+
+  unsigned getSizeInBits() const {
+    if (isPointer() || isScalar())
+      return getScalarSizeInBits();
+    return getScalarSizeInBits() * getNumElements();
+  }
+
+  unsigned getScalarSizeInBits() const {
+    
+   ((
+   RawData != 0 && "Invalid Type"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "RawData != 0 && \"Invalid Type\""
+   , "/home/trippels/llvm/llvm/include/llvm/Support/LowLevelTypeImpl.h", 108, __PRETTY_FUNCTION__))
+                                         ;
+    if (!IsVector) {
+      if (!IsPointer)
+        return getFieldValue(ScalarSizeFieldInfo);
+      else
+        return getFieldValue(PointerSizeFieldInfo);
+    } else {
+      if (!IsPointer)
+        return getFieldValue(VectorSizeFieldInfo);
+      else
+        return getFieldValue(PointerVectorSizeFieldInfo);
+    }
+  }
+
+  unsigned getAddressSpace() const {
+    
+   ((
+   RawData != 0 && "Invalid Type"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "RawData != 0 && \"Invalid Type\""
+   , "/home/trippels/llvm/llvm/include/llvm/Support/LowLevelTypeImpl.h", 123, __PRETTY_FUNCTION__))
+                                         ;
+    
+   ((
+   IsPointer && "cannot get address space of non-pointer type"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "IsPointer && \"cannot get address space of non-pointer type\""
+   , "/home/trippels/llvm/llvm/include/llvm/Support/LowLevelTypeImpl.h", 124, __PRETTY_FUNCTION__))
+                                                                      ;
+    if (!IsVector)
+      return getFieldValue(PointerAddressSpaceFieldInfo);
+    else
+      return getFieldValue(PointerVectorAddressSpaceFieldInfo);
+  }
+
+
+  LLT getElementType() const {
+    
+   ((
+   isVector() && "cannot get element type of scalar/aggregate"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isVector() && \"cannot get element type of scalar/aggregate\""
+   , "/home/trippels/llvm/llvm/include/llvm/Support/LowLevelTypeImpl.h", 133, __PRETTY_FUNCTION__))
+                                                                      ;
+    if (IsPointer)
+      return pointer(getAddressSpace(), getScalarSizeInBits());
+    else
+      return scalar(getScalarSizeInBits());
+  }
+
+  void print(raw_ostream &OS) const;
+
+  bool operator==(const LLT &RHS) const {
+    return IsPointer == RHS.IsPointer && IsVector == RHS.IsVector &&
+           RHS.RawData == RawData;
+  }
+
+  bool operator!=(const LLT &RHS) const { return !(*this == RHS); }
+
+  friend struct DenseMapInfo<LLT>;
+
+private:
+  typedef int BitFieldInfo[2];
+
+
+
+
+
+
+
+  static const constexpr BitFieldInfo ScalarSizeFieldInfo{32, 0};
+
+
+
+  static const constexpr BitFieldInfo PointerSizeFieldInfo{16, 0};
+  static const constexpr BitFieldInfo PointerAddressSpaceFieldInfo{
+      23, PointerSizeFieldInfo[0] + PointerSizeFieldInfo[1]};
+
+
+
+  static const constexpr BitFieldInfo VectorElementsFieldInfo{16, 0};
+  static const constexpr BitFieldInfo VectorSizeFieldInfo{
+      32, VectorElementsFieldInfo[0] + VectorElementsFieldInfo[1]};
+
+
+
+
+  static const constexpr BitFieldInfo PointerVectorElementsFieldInfo{16, 0};
+  static const constexpr BitFieldInfo PointerVectorSizeFieldInfo{
+      16,
+      PointerVectorElementsFieldInfo[1] + PointerVectorElementsFieldInfo[0]};
+  static const constexpr BitFieldInfo PointerVectorAddressSpaceFieldInfo{
+      23, PointerVectorSizeFieldInfo[1] + PointerVectorSizeFieldInfo[0]};
+
+  uint64_t IsPointer : 1;
+  uint64_t IsVector : 1;
+  uint64_t RawData : 62;
+
+  static uint64_t getMask(const BitFieldInfo FieldInfo) {
+    const int FieldSizeInBits = FieldInfo[0];
+    return (((uint64_t)1) << FieldSizeInBits) - 1;
+  }
+  static uint64_t maskAndShift(uint64_t Val, uint64_t Mask, uint8_t Shift) {
+    
+   ((
+   Val <= Mask && "Value too large for field"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Val <= Mask && \"Value too large for field\""
+   , "/home/trippels/llvm/llvm/include/llvm/Support/LowLevelTypeImpl.h", 202, __PRETTY_FUNCTION__))
+                                                     ;
+    return (Val & Mask) << Shift;
+  }
+  static uint64_t maskAndShift(uint64_t Val, const BitFieldInfo FieldInfo) {
+    return maskAndShift(Val, getMask(FieldInfo), FieldInfo[1]);
+  }
+  uint64_t getFieldValue(const BitFieldInfo FieldInfo) const {
+    return getMask(FieldInfo) & (RawData >> FieldInfo[1]);
+  }
+
+  void init(bool IsPointer, bool IsVector, uint16_t NumElements,
+            unsigned SizeInBits, unsigned AddressSpace) {
+    this->IsPointer = IsPointer;
+    this->IsVector = IsVector;
+    if (!IsVector) {
+      if (!IsPointer)
+        RawData = maskAndShift(SizeInBits, ScalarSizeFieldInfo);
+      else
+        RawData = maskAndShift(SizeInBits, PointerSizeFieldInfo) |
+                  maskAndShift(AddressSpace, PointerAddressSpaceFieldInfo);
+    } else {
+      
+     ((
+     NumElements > 1 && "invalid number of vector elements"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "NumElements > 1 && \"invalid number of vector elements\""
+     , "/home/trippels/llvm/llvm/include/llvm/Support/LowLevelTypeImpl.h", 223, __PRETTY_FUNCTION__))
+                                                                   ;
+      if (!IsPointer)
+        RawData = maskAndShift(NumElements, VectorElementsFieldInfo) |
+                  maskAndShift(SizeInBits, VectorSizeFieldInfo);
+      else
+        RawData =
+            maskAndShift(NumElements, PointerVectorElementsFieldInfo) |
+            maskAndShift(SizeInBits, PointerVectorSizeFieldInfo) |
+            maskAndShift(AddressSpace, PointerVectorAddressSpaceFieldInfo);
+    }
+  }
+};
+
+inline raw_ostream& operator<<(raw_ostream &OS, const LLT &Ty) {
+  Ty.print(OS);
+  return OS;
+}
+
+template<> struct DenseMapInfo<LLT> {
+  static inline LLT getEmptyKey() {
+    LLT Invalid;
+    Invalid.IsPointer = true;
+    return Invalid;
+  }
+  static inline LLT getTombstoneKey() {
+    LLT Invalid;
+    Invalid.IsVector = true;
+    return Invalid;
+  }
+  static inline unsigned getHashValue(const LLT &Ty) {
+    uint64_t Val = ((uint64_t)Ty.RawData) << 2 | ((uint64_t)Ty.IsPointer) << 1 |
+                   ((uint64_t)Ty.IsVector);
+    return DenseMapInfo<uint64_t>::getHashValue(Val);
+  }
+  static bool isEqual(const LLT &LHS, const LLT &RHS) {
+    return LHS == RHS;
+  }
+};
+
+}
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+namespace llvm {
+
+class BlockAddress;
+class ConstantFP;
+class ConstantInt;
+class GlobalValue;
+class MachineBasicBlock;
+class MachineInstr;
+class MachineRegisterInfo;
+class MCCFIInstruction;
+class MDNode;
+class ModuleSlotTracker;
+class TargetMachine;
+class TargetIntrinsicInfo;
+class TargetRegisterInfo;
+class hash_code;
+class raw_ostream;
+class MCSymbol;
+class MachineOperand {
+public:
+  enum MachineOperandType : unsigned char {
+    MO_Register,
+    MO_Immediate,
+    MO_CImmediate,
+    MO_FPImmediate,
+    MO_MachineBasicBlock,
+    MO_FrameIndex,
+    MO_ConstantPoolIndex,
+    MO_TargetIndex,
+    MO_JumpTableIndex,
+    MO_ExternalSymbol,
+    MO_GlobalAddress,
+    MO_BlockAddress,
+    MO_RegisterMask,
+    MO_RegisterLiveOut,
+    MO_Metadata,
+    MO_MCSymbol,
+    MO_CFIIndex,
+    MO_IntrinsicID,
+    MO_Predicate,
+    MO_Last = MO_Predicate,
+  };
+
+private:
+
+
+  MachineOperandType OpKind : 8;
+
+
+
+
+
+  unsigned SubReg_TargetFlags : 12;
+
+
+
+
+  unsigned char TiedTo : 4;
+
+
+
+
+  bool IsDef : 1;
+
+
+
+
+  bool IsImp : 1;
+
+
+
+
+
+
+
+  bool IsDeadOrKill : 1;
+
+
+
+
+
+
+  bool IsRenamable : 1;
+  bool IsUndef : 1;
+  bool IsInternalRead : 1;
+
+
+
+
+  bool IsEarlyClobber : 1;
+
+
+
+  bool IsDebug : 1;
+
+
+
+
+
+  union {
+    unsigned RegNo;
+    unsigned OffsetLo;
+  } SmallContents;
+
+
+
+  MachineInstr *ParentMI;
+
+
+  union {
+    MachineBasicBlock *MBB;
+    const ConstantFP *CFP;
+    const ConstantInt *CI;
+    int64_t ImmVal;
+    const uint32_t *RegMask;
+    const MDNode *MD;
+    MCSymbol *Sym;
+    unsigned CFIIndex;
+    Intrinsic::ID IntrinsicID;
+    unsigned Pred;
+
+    struct {
+
+      MachineOperand *Prev;
+      MachineOperand *Next;
+    } Reg;
+
+
+
+    struct {
+      union {
+        int Index;
+        const char *SymbolName;
+        const GlobalValue *GV;
+        const BlockAddress *BA;
+      } Val;
+
+      int OffsetHi;
+    } OffsetedInfo;
+  } Contents;
+
+  explicit MachineOperand(MachineOperandType K)
+    : OpKind(K), SubReg_TargetFlags(0), ParentMI(nullptr) {}
+public:
+
+
+  MachineOperandType getType() const { return (MachineOperandType)OpKind; }
+
+  unsigned getTargetFlags() const {
+    return isReg() ? 0 : SubReg_TargetFlags;
+  }
+  void setTargetFlags(unsigned F) {
+    
+   ((
+   !isReg() && "Register operands can't have target flags"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!isReg() && \"Register operands can't have target flags\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h", 211, __PRETTY_FUNCTION__))
+                                                                  ;
+    SubReg_TargetFlags = F;
+    
+   ((
+   SubReg_TargetFlags == F && "Target flags out of range"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "SubReg_TargetFlags == F && \"Target flags out of range\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h", 213, __PRETTY_FUNCTION__))
+                                                                 ;
+  }
+  void addTargetFlag(unsigned F) {
+    
+   ((
+   !isReg() && "Register operands can't have target flags"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!isReg() && \"Register operands can't have target flags\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h", 216, __PRETTY_FUNCTION__))
+                                                                  ;
+    SubReg_TargetFlags |= F;
+    
+   ((
+   (SubReg_TargetFlags & F) && "Target flags out of range"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "(SubReg_TargetFlags & F) && \"Target flags out of range\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h", 218, __PRETTY_FUNCTION__))
+                                                                  ;
+  }
+
+
+
+
+  MachineInstr *getParent() { return ParentMI; }
+  const MachineInstr *getParent() const { return ParentMI; }
+  void clearParent() { ParentMI = nullptr; }
+
+
+
+
+
+  static void printSubregIdx(raw_ostream &OS, uint64_t Index,
+                             const TargetRegisterInfo *TRI);
+
+
+  static void printTargetFlags(raw_ostream& OS, const MachineOperand &Op);
+
+
+  static void printSymbol(raw_ostream &OS, MCSymbol &Sym);
+
+
+  static void printStackObjectReference(raw_ostream &OS, unsigned FrameIndex,
+                                        bool IsFixed, StringRef Name);
+
+
+  static void printOperandOffset(raw_ostream &OS, int64_t Offset);
+
+
+  static void printIRSlotNumber(raw_ostream &OS, int Slot);
+
+
+
+
+
+  void print(raw_ostream &os, const TargetRegisterInfo *TRI = nullptr,
+             const TargetIntrinsicInfo *IntrinsicInfo = nullptr) const;
+  void print(raw_ostream &os, ModuleSlotTracker &MST, LLT TypeToPrint,
+             bool PrintDef, bool ShouldPrintRegisterTies,
+             unsigned TiedOperandIdx, const TargetRegisterInfo *TRI,
+             const TargetIntrinsicInfo *IntrinsicInfo) const;
+
+  void dump() const;
+
+
+
+
+
+
+  bool isReg() const { return OpKind == MO_Register; }
+
+  bool isImm() const { return OpKind == MO_Immediate; }
+
+  bool isCImm() const { return OpKind == MO_CImmediate; }
+
+  bool isFPImm() const { return OpKind == MO_FPImmediate; }
+
+  bool isMBB() const { return OpKind == MO_MachineBasicBlock; }
+
+  bool isFI() const { return OpKind == MO_FrameIndex; }
+
+  bool isCPI() const { return OpKind == MO_ConstantPoolIndex; }
+
+  bool isTargetIndex() const { return OpKind == MO_TargetIndex; }
+
+  bool isJTI() const { return OpKind == MO_JumpTableIndex; }
+
+  bool isGlobal() const { return OpKind == MO_GlobalAddress; }
+
+  bool isSymbol() const { return OpKind == MO_ExternalSymbol; }
+
+  bool isBlockAddress() const { return OpKind == MO_BlockAddress; }
+
+  bool isRegMask() const { return OpKind == MO_RegisterMask; }
+
+  bool isRegLiveOut() const { return OpKind == MO_RegisterLiveOut; }
+
+  bool isMetadata() const { return OpKind == MO_Metadata; }
+  bool isMCSymbol() const { return OpKind == MO_MCSymbol; }
+  bool isCFIIndex() const { return OpKind == MO_CFIIndex; }
+  bool isIntrinsicID() const { return OpKind == MO_IntrinsicID; }
+  bool isPredicate() const { return OpKind == MO_Predicate; }
+
+
+
+
+
+  unsigned getReg() const {
+    
+   ((
+   isReg() && "This is not a register operand!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isReg() && \"This is not a register operand!\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h", 333, __PRETTY_FUNCTION__))
+                                                       ;
+    return SmallContents.RegNo;
+  }
+
+  unsigned getSubReg() const {
+    
+   ((
+   isReg() && "Wrong MachineOperand accessor"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isReg() && \"Wrong MachineOperand accessor\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h", 338, __PRETTY_FUNCTION__))
+                                                     ;
+    return SubReg_TargetFlags;
+  }
+
+  bool isUse() const {
+    
+   ((
+   isReg() && "Wrong MachineOperand accessor"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isReg() && \"Wrong MachineOperand accessor\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h", 343, __PRETTY_FUNCTION__))
+                                                     ;
+    return !IsDef;
+  }
+
+  bool isDef() const {
+    
+   ((
+   isReg() && "Wrong MachineOperand accessor"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isReg() && \"Wrong MachineOperand accessor\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h", 348, __PRETTY_FUNCTION__))
+                                                     ;
+    return IsDef;
+  }
+
+  bool isImplicit() const {
+    
+   ((
+   isReg() && "Wrong MachineOperand accessor"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isReg() && \"Wrong MachineOperand accessor\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h", 353, __PRETTY_FUNCTION__))
+                                                     ;
+    return IsImp;
+  }
+
+  bool isDead() const {
+    
+   ((
+   isReg() && "Wrong MachineOperand accessor"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isReg() && \"Wrong MachineOperand accessor\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h", 358, __PRETTY_FUNCTION__))
+                                                     ;
+    return IsDeadOrKill & IsDef;
+  }
+
+  bool isKill() const {
+    
+   ((
+   isReg() && "Wrong MachineOperand accessor"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isReg() && \"Wrong MachineOperand accessor\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h", 363, __PRETTY_FUNCTION__))
+                                                     ;
+    return IsDeadOrKill & !IsDef;
+  }
+
+  bool isUndef() const {
+    
+   ((
+   isReg() && "Wrong MachineOperand accessor"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isReg() && \"Wrong MachineOperand accessor\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h", 368, __PRETTY_FUNCTION__))
+                                                     ;
+    return IsUndef;
+  }
+
+  bool isRenamable() const;
+
+  bool isInternalRead() const {
+    
+   ((
+   isReg() && "Wrong MachineOperand accessor"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isReg() && \"Wrong MachineOperand accessor\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h", 375, __PRETTY_FUNCTION__))
+                                                     ;
+    return IsInternalRead;
+  }
+
+  bool isEarlyClobber() const {
+    
+   ((
+   isReg() && "Wrong MachineOperand accessor"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isReg() && \"Wrong MachineOperand accessor\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h", 380, __PRETTY_FUNCTION__))
+                                                     ;
+    return IsEarlyClobber;
+  }
+
+  bool isTied() const {
+    
+   ((
+   isReg() && "Wrong MachineOperand accessor"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isReg() && \"Wrong MachineOperand accessor\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h", 385, __PRETTY_FUNCTION__))
+                                                     ;
+    return TiedTo;
+  }
+
+  bool isDebug() const {
+    
+   ((
+   isReg() && "Wrong MachineOperand accessor"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isReg() && \"Wrong MachineOperand accessor\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h", 390, __PRETTY_FUNCTION__))
+                                                     ;
+    return IsDebug;
+  }
+  bool readsReg() const {
+    
+   ((
+   isReg() && "Wrong MachineOperand accessor"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isReg() && \"Wrong MachineOperand accessor\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h", 402, __PRETTY_FUNCTION__))
+                                                     ;
+    return !isUndef() && !isInternalRead() && (isUse() || getSubReg());
+  }
+
+
+
+
+
+
+
+  void setReg(unsigned Reg);
+
+  void setSubReg(unsigned subReg) {
+    
+   ((
+   isReg() && "Wrong MachineOperand mutator"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isReg() && \"Wrong MachineOperand mutator\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h", 415, __PRETTY_FUNCTION__))
+                                                    ;
+    SubReg_TargetFlags = subReg;
+    
+   ((
+   SubReg_TargetFlags == subReg && "SubReg out of range"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "SubReg_TargetFlags == subReg && \"SubReg out of range\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h", 417, __PRETTY_FUNCTION__))
+                                                                ;
+  }
+
+
+
+
+
+
+  void substVirtReg(unsigned Reg, unsigned SubIdx, const TargetRegisterInfo&);
+
+
+
+
+
+  void substPhysReg(unsigned Reg, const TargetRegisterInfo&);
+
+  void setIsUse(bool Val = true) { setIsDef(!Val); }
+
+
+  void setIsDef(bool Val = true);
+
+  void setImplicit(bool Val = true) {
+    
+   ((
+   isReg() && "Wrong MachineOperand mutator"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isReg() && \"Wrong MachineOperand mutator\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h", 439, __PRETTY_FUNCTION__))
+                                                    ;
+    IsImp = Val;
+  }
+
+  void setIsKill(bool Val = true) {
+    
+   ((
+   isReg() && !IsDef && "Wrong MachineOperand mutator"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isReg() && !IsDef && \"Wrong MachineOperand mutator\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h", 444, __PRETTY_FUNCTION__))
+                                                              ;
+    
+   ((
+   (!Val || !isDebug()) && "Marking a debug operation as kill"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "(!Val || !isDebug()) && \"Marking a debug operation as kill\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h", 445, __PRETTY_FUNCTION__))
+                                                                      ;
+    IsDeadOrKill = Val;
+  }
+
+  void setIsDead(bool Val = true) {
+    
+   ((
+   isReg() && IsDef && "Wrong MachineOperand mutator"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isReg() && IsDef && \"Wrong MachineOperand mutator\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h", 450, __PRETTY_FUNCTION__))
+                                                             ;
+    IsDeadOrKill = Val;
+  }
+
+  void setIsUndef(bool Val = true) {
+    
+   ((
+   isReg() && "Wrong MachineOperand mutator"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isReg() && \"Wrong MachineOperand mutator\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h", 455, __PRETTY_FUNCTION__))
+                                                    ;
+    IsUndef = Val;
+  }
+
+  void setIsRenamable(bool Val = true);
+
+
+
+  void setIsRenamableIfNoExtraRegAllocReq();
+
+  void setIsInternalRead(bool Val = true) {
+    
+   ((
+   isReg() && "Wrong MachineOperand mutator"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isReg() && \"Wrong MachineOperand mutator\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h", 466, __PRETTY_FUNCTION__))
+                                                    ;
+    IsInternalRead = Val;
+  }
+
+  void setIsEarlyClobber(bool Val = true) {
+    
+   ((
+   isReg() && IsDef && "Wrong MachineOperand mutator"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isReg() && IsDef && \"Wrong MachineOperand mutator\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h", 471, __PRETTY_FUNCTION__))
+                                                             ;
+    IsEarlyClobber = Val;
+  }
+
+  void setIsDebug(bool Val = true) {
+    
+   ((
+   isReg() && !IsDef && "Wrong MachineOperand mutator"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isReg() && !IsDef && \"Wrong MachineOperand mutator\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h", 476, __PRETTY_FUNCTION__))
+                                                              ;
+    IsDebug = Val;
+  }
+
+
+
+
+
+  int64_t getImm() const {
+    
+   ((
+   isImm() && "Wrong MachineOperand accessor"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isImm() && \"Wrong MachineOperand accessor\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h", 485, __PRETTY_FUNCTION__))
+                                                     ;
+    return Contents.ImmVal;
+  }
+
+  const ConstantInt *getCImm() const {
+    
+   ((
+   isCImm() && "Wrong MachineOperand accessor"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isCImm() && \"Wrong MachineOperand accessor\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h", 490, __PRETTY_FUNCTION__))
+                                                      ;
+    return Contents.CI;
+  }
+
+  const ConstantFP *getFPImm() const {
+    
+   ((
+   isFPImm() && "Wrong MachineOperand accessor"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isFPImm() && \"Wrong MachineOperand accessor\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h", 495, __PRETTY_FUNCTION__))
+                                                       ;
+    return Contents.CFP;
+  }
+
+  MachineBasicBlock *getMBB() const {
+    
+   ((
+   isMBB() && "Wrong MachineOperand accessor"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isMBB() && \"Wrong MachineOperand accessor\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h", 500, __PRETTY_FUNCTION__))
+                                                     ;
+    return Contents.MBB;
+  }
+
+  int getIndex() const {
+    
+   ((
+   (isFI() || isCPI() || isTargetIndex() || isJTI()) && "Wrong MachineOperand accessor"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "(isFI() || isCPI() || isTargetIndex() || isJTI()) && \"Wrong MachineOperand accessor\""
+   ,
+                                          "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h"
+    ,
+                                          506
+    , __PRETTY_FUNCTION__))
+                                           
+                                          ;
+    return Contents.OffsetedInfo.Val.Index;
+  }
+
+  const GlobalValue *getGlobal() const {
+    
+   ((
+   isGlobal() && "Wrong MachineOperand accessor"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isGlobal() && \"Wrong MachineOperand accessor\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h", 511, __PRETTY_FUNCTION__))
+                                                        ;
+    return Contents.OffsetedInfo.Val.GV;
+  }
+
+  const BlockAddress *getBlockAddress() const {
+    
+   ((
+   isBlockAddress() && "Wrong MachineOperand accessor"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isBlockAddress() && \"Wrong MachineOperand accessor\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h", 516, __PRETTY_FUNCTION__))
+                                                              ;
+    return Contents.OffsetedInfo.Val.BA;
+  }
+
+  MCSymbol *getMCSymbol() const {
+    
+   ((
+   isMCSymbol() && "Wrong MachineOperand accessor"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isMCSymbol() && \"Wrong MachineOperand accessor\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h", 521, __PRETTY_FUNCTION__))
+                                                          ;
+    return Contents.Sym;
+  }
+
+  unsigned getCFIIndex() const {
+    
+   ((
+   isCFIIndex() && "Wrong MachineOperand accessor"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isCFIIndex() && \"Wrong MachineOperand accessor\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h", 526, __PRETTY_FUNCTION__))
+                                                          ;
+    return Contents.CFIIndex;
+  }
+
+  Intrinsic::ID getIntrinsicID() const {
+    
+   ((
+   isIntrinsicID() && "Wrong MachineOperand accessor"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isIntrinsicID() && \"Wrong MachineOperand accessor\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h", 531, __PRETTY_FUNCTION__))
+                                                             ;
+    return Contents.IntrinsicID;
+  }
+
+  unsigned getPredicate() const {
+    
+   ((
+   isPredicate() && "Wrong MachineOperand accessor"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isPredicate() && \"Wrong MachineOperand accessor\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h", 536, __PRETTY_FUNCTION__))
+                                                           ;
+    return Contents.Pred;
+  }
+
+
+
+  int64_t getOffset() const {
+    
+   ((
+   (isGlobal() || isSymbol() || isMCSymbol() || isCPI() || isTargetIndex() || isBlockAddress()) && "Wrong MachineOperand accessor"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "(isGlobal() || isSymbol() || isMCSymbol() || isCPI() || isTargetIndex() || isBlockAddress()) && \"Wrong MachineOperand accessor\""
+   ,
+
+                                          "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h"
+    ,
+
+                                          545
+    , __PRETTY_FUNCTION__))
+
+                                           
+                                          ;
+    return int64_t(uint64_t(Contents.OffsetedInfo.OffsetHi) << 32) |
+           SmallContents.OffsetLo;
+  }
+
+  const char *getSymbolName() const {
+    
+   ((
+   isSymbol() && "Wrong MachineOperand accessor"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isSymbol() && \"Wrong MachineOperand accessor\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h", 551, __PRETTY_FUNCTION__))
+                                                        ;
+    return Contents.OffsetedInfo.Val.SymbolName;
+  }
+
+
+
+
+
+  static bool clobbersPhysReg(const uint32_t *RegMask, unsigned PhysReg) {
+
+    
+   ((
+   PhysReg < (1u << 30) && "Not a physical register"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "PhysReg < (1u << 30) && \"Not a physical register\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h", 561, __PRETTY_FUNCTION__))
+                                                            ;
+    return !(RegMask[PhysReg / 32] & (1u << PhysReg % 32));
+  }
+
+
+  bool clobbersPhysReg(unsigned PhysReg) const {
+     return clobbersPhysReg(getRegMask(), PhysReg);
+  }
+
+
+
+  const uint32_t *getRegMask() const {
+    
+   ((
+   isRegMask() && "Wrong MachineOperand accessor"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isRegMask() && \"Wrong MachineOperand accessor\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h", 573, __PRETTY_FUNCTION__))
+                                                         ;
+    return Contents.RegMask;
+  }
+
+
+  const uint32_t *getRegLiveOut() const {
+    
+   ((
+   isRegLiveOut() && "Wrong MachineOperand accessor"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isRegLiveOut() && \"Wrong MachineOperand accessor\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h", 579, __PRETTY_FUNCTION__))
+                                                            ;
+    return Contents.RegMask;
+  }
+
+  const MDNode *getMetadata() const {
+    
+   ((
+   isMetadata() && "Wrong MachineOperand accessor"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isMetadata() && \"Wrong MachineOperand accessor\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h", 584, __PRETTY_FUNCTION__))
+                                                          ;
+    return Contents.MD;
+  }
+
+
+
+
+
+  void setImm(int64_t immVal) {
+    
+   ((
+   isImm() && "Wrong MachineOperand mutator"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isImm() && \"Wrong MachineOperand mutator\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h", 593, __PRETTY_FUNCTION__))
+                                                    ;
+    Contents.ImmVal = immVal;
+  }
+
+  void setFPImm(const ConstantFP *CFP) {
+    
+   ((
+   isFPImm() && "Wrong MachineOperand mutator"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isFPImm() && \"Wrong MachineOperand mutator\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h", 598, __PRETTY_FUNCTION__))
+                                                      ;
+    Contents.CFP = CFP;
+  }
+
+  void setOffset(int64_t Offset) {
+    
+   ((
+   (isGlobal() || isSymbol() || isMCSymbol() || isCPI() || isTargetIndex() || isBlockAddress()) && "Wrong MachineOperand mutator"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "(isGlobal() || isSymbol() || isMCSymbol() || isCPI() || isTargetIndex() || isBlockAddress()) && \"Wrong MachineOperand mutator\""
+   ,
+
+                                         "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h"
+    ,
+
+                                         605
+    , __PRETTY_FUNCTION__))
+
+                                          
+                                         ;
+    SmallContents.OffsetLo = unsigned(Offset);
+    Contents.OffsetedInfo.OffsetHi = int(Offset >> 32);
+  }
+
+  void setIndex(int Idx) {
+    
+   ((
+   (isFI() || isCPI() || isTargetIndex() || isJTI()) && "Wrong MachineOperand mutator"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "(isFI() || isCPI() || isTargetIndex() || isJTI()) && \"Wrong MachineOperand mutator\""
+   ,
+                                         "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h"
+    ,
+                                         612
+    , __PRETTY_FUNCTION__))
+                                          
+                                         ;
+    Contents.OffsetedInfo.Val.Index = Idx;
+  }
+
+  void setMetadata(const MDNode *MD) {
+    
+   ((
+   isMetadata() && "Wrong MachineOperand mutator"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isMetadata() && \"Wrong MachineOperand mutator\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h", 617, __PRETTY_FUNCTION__))
+                                                         ;
+    Contents.MD = MD;
+  }
+
+  void setMBB(MachineBasicBlock *MBB) {
+    
+   ((
+   isMBB() && "Wrong MachineOperand mutator"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isMBB() && \"Wrong MachineOperand mutator\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h", 622, __PRETTY_FUNCTION__))
+                                                    ;
+    Contents.MBB = MBB;
+  }
+
+
+
+
+
+  void setRegMask(const uint32_t *RegMaskPtr) {
+    
+   ((
+   isRegMask() && "Wrong MachineOperand mutator"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isRegMask() && \"Wrong MachineOperand mutator\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h", 631, __PRETTY_FUNCTION__))
+                                                        ;
+    Contents.RegMask = RegMaskPtr;
+  }
+  bool isIdenticalTo(const MachineOperand &Other) const;
+
+
+
+
+
+
+
+  friend hash_code hash_value(const MachineOperand &MO);
+
+
+
+
+  void ChangeToImmediate(int64_t ImmVal);
+
+
+
+
+  void ChangeToFPImmediate(const ConstantFP *FPImm);
+
+
+  void ChangeToES(const char *SymName, unsigned char TargetFlags = 0);
+
+
+  void ChangeToMCSymbol(MCSymbol *Sym);
+
+
+  void ChangeToFrameIndex(int Idx);
+
+
+  void ChangeToTargetIndex(unsigned Idx, int64_t Offset,
+                           unsigned char TargetFlags = 0);
+
+
+
+
+  void ChangeToRegister(unsigned Reg, bool isDef, bool isImp = false,
+                        bool isKill = false, bool isDead = false,
+                        bool isUndef = false, bool isDebug = false);
+
+
+
+
+
+  static MachineOperand CreateImm(int64_t Val) {
+    MachineOperand Op(MachineOperand::MO_Immediate);
+    Op.setImm(Val);
+    return Op;
+  }
+
+  static MachineOperand CreateCImm(const ConstantInt *CI) {
+    MachineOperand Op(MachineOperand::MO_CImmediate);
+    Op.Contents.CI = CI;
+    return Op;
+  }
+
+  static MachineOperand CreateFPImm(const ConstantFP *CFP) {
+    MachineOperand Op(MachineOperand::MO_FPImmediate);
+    Op.Contents.CFP = CFP;
+    return Op;
+  }
+
+  static MachineOperand CreateReg(unsigned Reg, bool isDef, bool isImp = false,
+                                  bool isKill = false, bool isDead = false,
+                                  bool isUndef = false,
+                                  bool isEarlyClobber = false,
+                                  unsigned SubReg = 0, bool isDebug = false,
+                                  bool isInternalRead = false,
+                                  bool isRenamable = false) {
+    
+   ((
+   !(isDead && !isDef) && "Dead flag on non-def"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!(isDead && !isDef) && \"Dead flag on non-def\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h", 711, __PRETTY_FUNCTION__))
+                                                        ;
+    
+   ((
+   !(isKill && isDef) && "Kill flag on def"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!(isKill && isDef) && \"Kill flag on def\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h", 712, __PRETTY_FUNCTION__))
+                                                   ;
+    MachineOperand Op(MachineOperand::MO_Register);
+    Op.IsDef = isDef;
+    Op.IsImp = isImp;
+    Op.IsDeadOrKill = isKill | isDead;
+    Op.IsRenamable = isRenamable;
+    Op.IsUndef = isUndef;
+    Op.IsInternalRead = isInternalRead;
+    Op.IsEarlyClobber = isEarlyClobber;
+    Op.TiedTo = 0;
+    Op.IsDebug = isDebug;
+    Op.SmallContents.RegNo = Reg;
+    Op.Contents.Reg.Prev = nullptr;
+    Op.Contents.Reg.Next = nullptr;
+    Op.setSubReg(SubReg);
+    return Op;
+  }
+  static MachineOperand CreateMBB(MachineBasicBlock *MBB,
+                                  unsigned char TargetFlags = 0) {
+    MachineOperand Op(MachineOperand::MO_MachineBasicBlock);
+    Op.setMBB(MBB);
+    Op.setTargetFlags(TargetFlags);
+    return Op;
+  }
+  static MachineOperand CreateFI(int Idx) {
+    MachineOperand Op(MachineOperand::MO_FrameIndex);
+    Op.setIndex(Idx);
+    return Op;
+  }
+  static MachineOperand CreateCPI(unsigned Idx, int Offset,
+                                  unsigned char TargetFlags = 0) {
+    MachineOperand Op(MachineOperand::MO_ConstantPoolIndex);
+    Op.setIndex(Idx);
+    Op.setOffset(Offset);
+    Op.setTargetFlags(TargetFlags);
+    return Op;
+  }
+  static MachineOperand CreateTargetIndex(unsigned Idx, int64_t Offset,
+                                          unsigned char TargetFlags = 0) {
+    MachineOperand Op(MachineOperand::MO_TargetIndex);
+    Op.setIndex(Idx);
+    Op.setOffset(Offset);
+    Op.setTargetFlags(TargetFlags);
+    return Op;
+  }
+  static MachineOperand CreateJTI(unsigned Idx, unsigned char TargetFlags = 0) {
+    MachineOperand Op(MachineOperand::MO_JumpTableIndex);
+    Op.setIndex(Idx);
+    Op.setTargetFlags(TargetFlags);
+    return Op;
+  }
+  static MachineOperand CreateGA(const GlobalValue *GV, int64_t Offset,
+                                 unsigned char TargetFlags = 0) {
+    MachineOperand Op(MachineOperand::MO_GlobalAddress);
+    Op.Contents.OffsetedInfo.Val.GV = GV;
+    Op.setOffset(Offset);
+    Op.setTargetFlags(TargetFlags);
+    return Op;
+  }
+  static MachineOperand CreateES(const char *SymName,
+                                 unsigned char TargetFlags = 0) {
+    MachineOperand Op(MachineOperand::MO_ExternalSymbol);
+    Op.Contents.OffsetedInfo.Val.SymbolName = SymName;
+    Op.setOffset(0);
+    Op.setTargetFlags(TargetFlags);
+    return Op;
+  }
+  static MachineOperand CreateBA(const BlockAddress *BA, int64_t Offset,
+                                 unsigned char TargetFlags = 0) {
+    MachineOperand Op(MachineOperand::MO_BlockAddress);
+    Op.Contents.OffsetedInfo.Val.BA = BA;
+    Op.setOffset(Offset);
+    Op.setTargetFlags(TargetFlags);
+    return Op;
+  }
+  static MachineOperand CreateRegMask(const uint32_t *Mask) {
+    
+   ((
+   Mask && "Missing register mask"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Mask && \"Missing register mask\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h", 800, __PRETTY_FUNCTION__))
+                                          ;
+    MachineOperand Op(MachineOperand::MO_RegisterMask);
+    Op.Contents.RegMask = Mask;
+    return Op;
+  }
+  static MachineOperand CreateRegLiveOut(const uint32_t *Mask) {
+    
+   ((
+   Mask && "Missing live-out register mask"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Mask && \"Missing live-out register mask\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h", 806, __PRETTY_FUNCTION__))
+                                                   ;
+    MachineOperand Op(MachineOperand::MO_RegisterLiveOut);
+    Op.Contents.RegMask = Mask;
+    return Op;
+  }
+  static MachineOperand CreateMetadata(const MDNode *Meta) {
+    MachineOperand Op(MachineOperand::MO_Metadata);
+    Op.Contents.MD = Meta;
+    return Op;
+  }
+
+  static MachineOperand CreateMCSymbol(MCSymbol *Sym,
+                                       unsigned char TargetFlags = 0) {
+    MachineOperand Op(MachineOperand::MO_MCSymbol);
+    Op.Contents.Sym = Sym;
+    Op.setOffset(0);
+    Op.setTargetFlags(TargetFlags);
+    return Op;
+  }
+
+  static MachineOperand CreateCFIIndex(unsigned CFIIndex) {
+    MachineOperand Op(MachineOperand::MO_CFIIndex);
+    Op.Contents.CFIIndex = CFIIndex;
+    return Op;
+  }
+
+  static MachineOperand CreateIntrinsicID(Intrinsic::ID ID) {
+    MachineOperand Op(MachineOperand::MO_IntrinsicID);
+    Op.Contents.IntrinsicID = ID;
+    return Op;
+  }
+
+  static MachineOperand CreatePredicate(unsigned Pred) {
+    MachineOperand Op(MachineOperand::MO_Predicate);
+    Op.Contents.Pred = Pred;
+    return Op;
+  }
+
+  friend class MachineInstr;
+  friend class MachineRegisterInfo;
+
+private:
+
+
+  void removeRegFromUses();
+
+
+  enum : unsigned char {
+    MO_Empty = MO_Last + 1,
+    MO_Tombstone,
+  };
+
+  friend struct DenseMapInfo<MachineOperand>;
+  bool isOnRegUseList() const {
+    
+   ((
+   isReg() && "Can only add reg operand to use lists"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isReg() && \"Can only add reg operand to use lists\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineOperand.h", 868, __PRETTY_FUNCTION__))
+                                                             ;
+    return Contents.Reg.Prev != nullptr;
+  }
+};
+
+template <> struct DenseMapInfo<MachineOperand> {
+  static MachineOperand getEmptyKey() {
+    return MachineOperand(static_cast<MachineOperand::MachineOperandType>(
+        MachineOperand::MO_Empty));
+  }
+  static MachineOperand getTombstoneKey() {
+    return MachineOperand(static_cast<MachineOperand::MachineOperandType>(
+        MachineOperand::MO_Tombstone));
+  }
+  static unsigned getHashValue(const MachineOperand &MO) {
+    return hash_value(MO);
+  }
+  static bool isEqual(const MachineOperand &LHS, const MachineOperand &RHS) {
+    if (LHS.getType() == static_cast<MachineOperand::MachineOperandType>(
+                             MachineOperand::MO_Empty) ||
+        LHS.getType() == static_cast<MachineOperand::MachineOperandType>(
+                             MachineOperand::MO_Tombstone))
+      return LHS.getType() == RHS.getType();
+    return LHS.isIdenticalTo(RHS);
+  }
+};
+
+inline raw_ostream &operator<<(raw_ostream &OS, const MachineOperand &MO) {
+  MO.print(OS);
+  return OS;
+}
+
+
+
+hash_code hash_value(const MachineOperand &MO);
+}
+namespace llvm {
+
+
+
+namespace TargetOpcode {
+enum {
+
+
+PHI,
+INLINEASM,
+CFI_INSTRUCTION,
+EH_LABEL,
+GC_LABEL,
+ANNOTATION_LABEL,
+
+
+
+
+KILL,
+
+
+
+
+
+EXTRACT_SUBREG,
+
+
+
+
+
+
+
+INSERT_SUBREG,
+
+
+IMPLICIT_DEF,
+SUBREG_TO_REG,
+
+
+
+
+
+
+
+  COPY_TO_REGCLASS,
+
+
+DBG_VALUE,
+  REG_SEQUENCE,
+
+
+
+  COPY,
+
+
+
+
+BUNDLE,
+
+
+LIFETIME_START,
+LIFETIME_END,
+
+
+
+
+STACKMAP,
+
+
+FENTRY_CALL,
+
+
+
+
+
+
+PATCHPOINT,
+
+
+
+
+
+LOAD_STACK_GUARD,
+
+
+
+
+
+STATEPOINT,
+
+
+
+
+LOCAL_ESCAPE,
+
+
+
+
+
+
+
+FAULTING_OP,
+PATCHABLE_OP,
+
+
+
+PATCHABLE_FUNCTION_ENTER,
+
+
+
+
+
+PATCHABLE_RET,
+PATCHABLE_FUNCTION_EXIT,
+
+
+
+
+PATCHABLE_TAIL_CALL,
+
+
+
+PATCHABLE_EVENT_CALL,
+
+
+
+
+
+
+G_ADD,
+PRE_ISEL_GENERIC_OPCODE_START = G_ADD,
+
+
+G_SUB,
+
+
+G_MUL,
+
+
+G_SDIV,
+
+
+G_UDIV,
+
+
+G_SREM,
+
+
+G_UREM,
+
+
+G_AND,
+
+
+G_OR,
+
+
+G_XOR,
+
+
+G_IMPLICIT_DEF,
+
+
+G_PHI,
+
+
+
+G_FRAME_INDEX,
+
+
+G_GLOBAL_VALUE,
+
+
+
+G_EXTRACT,
+
+G_UNMERGE_VALUES,
+
+
+
+G_INSERT,
+
+
+
+G_MERGE_VALUES,
+
+
+G_PTRTOINT,
+
+
+G_INTTOPTR,
+
+
+
+G_BITCAST,
+
+
+G_LOAD,
+
+
+G_STORE,
+
+
+G_ATOMIC_CMPXCHG_WITH_SUCCESS,
+
+
+G_ATOMIC_CMPXCHG,
+
+
+G_ATOMICRMW_XCHG,
+G_ATOMICRMW_ADD,
+G_ATOMICRMW_SUB,
+G_ATOMICRMW_AND,
+G_ATOMICRMW_NAND,
+G_ATOMICRMW_OR,
+G_ATOMICRMW_XOR,
+G_ATOMICRMW_MAX,
+G_ATOMICRMW_MIN,
+G_ATOMICRMW_UMAX,
+G_ATOMICRMW_UMIN,
+
+
+G_BRCOND,
+
+
+G_BRINDIRECT,
+
+
+G_INTRINSIC,
+
+
+G_INTRINSIC_W_SIDE_EFFECTS,
+
+
+G_ANYEXT,
+
+
+
+
+
+G_TRUNC,
+
+
+G_CONSTANT,
+
+
+G_FCONSTANT,
+
+
+G_VASTART,
+
+
+G_VAARG,
+
+
+G_SEXT,
+
+
+G_ZEXT,
+
+
+G_SHL,
+
+
+G_LSHR,
+
+
+G_ASHR,
+
+
+G_ICMP,
+
+
+G_FCMP,
+
+
+G_SELECT,
+
+
+
+G_UADDE,
+
+
+
+G_USUBE,
+
+
+
+G_SADDO,
+
+
+
+G_SSUBO,
+
+
+
+G_UMULO,
+
+
+
+G_SMULO,
+
+
+
+G_UMULH,
+
+
+
+G_SMULH,
+
+
+G_FADD,
+
+
+G_FSUB,
+
+
+G_FMUL,
+
+
+G_FMA,
+
+
+G_FDIV,
+
+
+G_FREM,
+
+
+G_FPOW,
+
+
+G_FEXP,
+
+
+G_FEXP2,
+
+
+G_FLOG,
+
+
+G_FLOG2,
+
+
+G_FNEG,
+
+
+G_FPEXT,
+
+
+G_FPTRUNC,
+
+
+G_FPTOSI,
+
+
+G_FPTOUI,
+
+
+G_SITOFP,
+
+
+G_UITOFP,
+
+
+G_GEP,
+
+
+
+G_PTR_MASK,
+
+
+G_BR,
+
+
+G_INSERT_VECTOR_ELT,
+
+
+G_EXTRACT_VECTOR_ELT,
+
+
+G_SHUFFLE_VECTOR,
+
+
+G_BSWAP,
+
+
+
+
+
+
+PRE_ISEL_GENERIC_OPCODE_END = G_BSWAP,
+
+
+
+GENERIC_OP_END = PRE_ISEL_GENERIC_OPCODE_END,
+};
+}
+
+
+
+inline bool isPreISelGenericOpcode(unsigned Opcode) {
+  return Opcode >= TargetOpcode::PRE_ISEL_GENERIC_OPCODE_START &&
+         Opcode <= TargetOpcode::PRE_ISEL_GENERIC_OPCODE_END;
+}
+
+
+inline bool isTargetSpecificOpcode(unsigned Opcode) {
+  return Opcode > TargetOpcode::PRE_ISEL_GENERIC_OPCODE_END;
+}
+}
+
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+namespace llvm {
+
+class FunctionType;
+class PointerType;
+template <class ConstantClass> class ConstantUniqueMap;
+
+class InlineAsm final : public Value {
+public:
+  enum AsmDialect {
+    AD_ATT,
+    AD_Intel
+  };
+
+private:
+  friend struct InlineAsmKeyType;
+  friend class ConstantUniqueMap<InlineAsm>;
+
+  std::string AsmString, Constraints;
+  FunctionType *FTy;
+  bool HasSideEffects;
+  bool IsAlignStack;
+  AsmDialect Dialect;
+
+  InlineAsm(FunctionType *Ty, const std::string &AsmString,
+            const std::string &Constraints, bool hasSideEffects,
+            bool isAlignStack, AsmDialect asmDialect);
+
+
+
+  void destroyConstant();
+
+public:
+  InlineAsm(const InlineAsm &) = delete;
+  InlineAsm &operator=(const InlineAsm &) = delete;
+
+
+
+  static InlineAsm *get(FunctionType *Ty, StringRef AsmString,
+                        StringRef Constraints, bool hasSideEffects,
+                        bool isAlignStack = false,
+                        AsmDialect asmDialect = AD_ATT);
+
+  bool hasSideEffects() const { return HasSideEffects; }
+  bool isAlignStack() const { return IsAlignStack; }
+  AsmDialect getDialect() const { return Dialect; }
+
+
+
+  PointerType *getType() const {
+    return reinterpret_cast<PointerType*>(Value::getType());
+  }
+
+
+
+  FunctionType *getFunctionType() const;
+
+  const std::string &getAsmString() const { return AsmString; }
+  const std::string &getConstraintString() const { return Constraints; }
+
+
+
+
+
+  static bool Verify(FunctionType *Ty, StringRef Constraints);
+
+
+  enum ConstraintPrefix {
+    isInput,
+    isOutput,
+    isClobber
+  };
+
+  using ConstraintCodeVector = std::vector<std::string>;
+
+  struct SubConstraintInfo {
+
+
+
+
+    int MatchingInput = -1;
+
+
+
+    ConstraintCodeVector Codes;
+
+
+    SubConstraintInfo() = default;
+  };
+
+  using SubConstraintInfoVector = std::vector<SubConstraintInfo>;
+  struct ConstraintInfo;
+  using ConstraintInfoVector = std::vector<ConstraintInfo>;
+
+  struct ConstraintInfo {
+
+
+    ConstraintPrefix Type = isInput;
+
+
+
+    bool isEarlyClobber = false;
+
+
+
+
+
+    int MatchingInput = -1;
+
+
+
+    bool hasMatchingInput() const { return MatchingInput != -1; }
+
+
+
+    bool isCommutative = false;
+
+
+
+
+
+    bool isIndirect = false;
+
+
+
+    ConstraintCodeVector Codes;
+
+
+    bool isMultipleAlternative = false;
+
+
+
+    SubConstraintInfoVector multipleAlternatives;
+
+
+    unsigned currentAlternativeIndex = 0;
+
+
+    ConstraintInfo() = default;
+
+
+
+
+    bool Parse(StringRef Str, ConstraintInfoVector &ConstraintsSoFar);
+
+
+
+    void selectAlternative(unsigned index);
+  };
+
+
+
+
+  static ConstraintInfoVector ParseConstraints(StringRef ConstraintString);
+
+
+
+  ConstraintInfoVector ParseConstraints() const {
+    return ParseConstraints(Constraints);
+  }
+
+
+  static bool classof(const Value *V) {
+    return V->getValueID() == Value::InlineAsmVal;
+  }
+  enum : uint32_t {
+
+    Op_InputChain = 0,
+    Op_AsmString = 1,
+    Op_MDNode = 2,
+    Op_ExtraInfo = 3,
+    Op_FirstOperand = 4,
+
+
+    MIOp_AsmString = 0,
+    MIOp_ExtraInfo = 1,
+    MIOp_FirstOperand = 2,
+
+
+    Extra_HasSideEffects = 1,
+    Extra_IsAlignStack = 2,
+    Extra_AsmDialect = 4,
+    Extra_MayLoad = 8,
+    Extra_MayStore = 16,
+    Extra_IsConvergent = 32,
+
+
+
+
+    Kind_RegUse = 1,
+    Kind_RegDef = 2,
+    Kind_RegDefEarlyClobber = 3,
+    Kind_Clobber = 4,
+    Kind_Imm = 5,
+    Kind_Mem = 6,
+
+
+
+
+
+    Constraint_Unknown = 0,
+    Constraint_es,
+    Constraint_i,
+    Constraint_m,
+    Constraint_o,
+    Constraint_v,
+    Constraint_Q,
+    Constraint_R,
+    Constraint_S,
+    Constraint_T,
+    Constraint_Um,
+    Constraint_Un,
+    Constraint_Uq,
+    Constraint_Us,
+    Constraint_Ut,
+    Constraint_Uv,
+    Constraint_Uy,
+    Constraint_X,
+    Constraint_Z,
+    Constraint_ZC,
+    Constraint_Zy,
+    Constraints_Max = Constraint_Zy,
+    Constraints_ShiftAmount = 16,
+
+    Flag_MatchingOperand = 0x80000000
+  };
+
+  static unsigned getFlagWord(unsigned Kind, unsigned NumOps) {
+    
+   ((
+   ((NumOps << 3) & ~0xffff) == 0 && "Too many inline asm operands!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "((NumOps << 3) & ~0xffff) == 0 && \"Too many inline asm operands!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/InlineAsm.h", 270, __PRETTY_FUNCTION__))
+                                                                            ;
+    
+   ((
+   Kind >= Kind_RegUse && Kind <= Kind_Mem && "Invalid Kind"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Kind >= Kind_RegUse && Kind <= Kind_Mem && \"Invalid Kind\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/InlineAsm.h", 271, __PRETTY_FUNCTION__))
+                                                                    ;
+    return Kind | (NumOps << 3);
+  }
+
+  static bool isRegDefKind(unsigned Flag){ return getKind(Flag) == Kind_RegDef;}
+  static bool isImmKind(unsigned Flag) { return getKind(Flag) == Kind_Imm; }
+  static bool isMemKind(unsigned Flag) { return getKind(Flag) == Kind_Mem; }
+  static bool isRegDefEarlyClobberKind(unsigned Flag) {
+    return getKind(Flag) == Kind_RegDefEarlyClobber;
+  }
+  static bool isClobberKind(unsigned Flag) {
+    return getKind(Flag) == Kind_Clobber;
+  }
+
+
+
+
+  static unsigned getFlagWordForMatchingOp(unsigned InputFlag,
+                                           unsigned MatchedOperandNo) {
+    
+   ((
+   MatchedOperandNo <= 0x7fff && "Too big matched operand"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "MatchedOperandNo <= 0x7fff && \"Too big matched operand\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/InlineAsm.h", 290, __PRETTY_FUNCTION__))
+                                                                  ;
+    
+   ((
+   (InputFlag & ~0xffff) == 0 && "High bits already contain data"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "(InputFlag & ~0xffff) == 0 && \"High bits already contain data\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/InlineAsm.h", 291, __PRETTY_FUNCTION__))
+                                                                         ;
+    return InputFlag | Flag_MatchingOperand | (MatchedOperandNo << 16);
+  }
+
+
+
+
+
+
+  static unsigned getFlagWordForRegClass(unsigned InputFlag, unsigned RC) {
+
+    ++RC;
+    
+   ((
+   !isImmKind(InputFlag) && "Immediates cannot have a register class"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!isImmKind(InputFlag) && \"Immediates cannot have a register class\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/InlineAsm.h", 303, __PRETTY_FUNCTION__))
+                                                                             ;
+    
+   ((
+   !isMemKind(InputFlag) && "Memory operand cannot have a register class"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!isMemKind(InputFlag) && \"Memory operand cannot have a register class\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/InlineAsm.h", 304, __PRETTY_FUNCTION__))
+                                                                                 ;
+    
+   ((
+   RC <= 0x7fff && "Too large register class ID"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "RC <= 0x7fff && \"Too large register class ID\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/InlineAsm.h", 305, __PRETTY_FUNCTION__))
+                                                        ;
+    
+   ((
+   (InputFlag & ~0xffff) == 0 && "High bits already contain data"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "(InputFlag & ~0xffff) == 0 && \"High bits already contain data\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/InlineAsm.h", 306, __PRETTY_FUNCTION__))
+                                                                         ;
+    return InputFlag | (RC << 16);
+  }
+
+
+
+  static unsigned getFlagWordForMem(unsigned InputFlag, unsigned Constraint) {
+    
+   ((
+   isMemKind(InputFlag) && "InputFlag is not a memory constraint!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isMemKind(InputFlag) && \"InputFlag is not a memory constraint!\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/InlineAsm.h", 313, __PRETTY_FUNCTION__))
+                                                                          ;
+    
+   ((
+   Constraint <= 0x7fff && "Too large a memory constraint ID"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Constraint <= 0x7fff && \"Too large a memory constraint ID\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/InlineAsm.h", 314, __PRETTY_FUNCTION__))
+                                                                     ;
+    
+   ((
+   Constraint <= Constraints_Max && "Unknown constraint ID"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Constraint <= Constraints_Max && \"Unknown constraint ID\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/InlineAsm.h", 315, __PRETTY_FUNCTION__))
+                                                                   ;
+    
+   ((
+   (InputFlag & ~0xffff) == 0 && "High bits already contain data"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "(InputFlag & ~0xffff) == 0 && \"High bits already contain data\""
+   , "/home/trippels/llvm/llvm/include/llvm/IR/InlineAsm.h", 316, __PRETTY_FUNCTION__))
+                                                                         ;
+    return InputFlag | (Constraint << Constraints_ShiftAmount);
+  }
+
+  static unsigned convertMemFlagWordToMatchingFlagWord(unsigned InputFlag) {
+    
+   ((
+   isMemKind(InputFlag)
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isMemKind(InputFlag)"
+   , "/home/trippels/llvm/llvm/include/llvm/IR/InlineAsm.h", 321, __PRETTY_FUNCTION__))
+                               ;
+    return InputFlag & ~(0x7fff << Constraints_ShiftAmount);
+  }
+
+  static unsigned getKind(unsigned Flags) {
+    return Flags & 7;
+  }
+
+  static unsigned getMemoryConstraintID(unsigned Flag) {
+    
+   ((
+   isMemKind(Flag)
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isMemKind(Flag)"
+   , "/home/trippels/llvm/llvm/include/llvm/IR/InlineAsm.h", 330, __PRETTY_FUNCTION__))
+                          ;
+    return (Flag >> Constraints_ShiftAmount) & 0x7fff;
+  }
+
+
+
+  static unsigned getNumOperandRegisters(unsigned Flag) {
+    return (Flag & 0xffff) >> 3;
+  }
+
+
+
+  static bool isUseOperandTiedToDef(unsigned Flag, unsigned &Idx) {
+    if ((Flag & Flag_MatchingOperand) == 0)
+      return false;
+    Idx = (Flag & ~Flag_MatchingOperand) >> 16;
+    return true;
+  }
+
+
+
+  static bool hasRegClassConstraint(unsigned Flag, unsigned &RC) {
+    if (Flag & Flag_MatchingOperand)
+      return false;
+    unsigned High = Flag >> 16;
+
+
+    if (!High)
+      return false;
+    RC = High - 1;
+    return true;
+  }
+};
+
+}
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+       
+
+
+
+namespace llvm {
+
+
+
+class format_object_base {
+protected:
+  const char *Fmt;
+  ~format_object_base() = default;
+  format_object_base(const format_object_base &) = default;
+  virtual void home();
+
+
+  virtual int snprint(char *Buffer, unsigned BufferSize) const = 0;
+
+public:
+  format_object_base(const char *fmt) : Fmt(fmt) {}
+
+
+
+
+  unsigned print(char *Buffer, unsigned BufferSize) const {
+    
+   ((
+   BufferSize && "Invalid buffer size!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "BufferSize && \"Invalid buffer size!\""
+   , "/home/trippels/llvm/llvm/include/llvm/Support/Format.h", 55, __PRETTY_FUNCTION__))
+                                               ;
+
+
+    int N = snprint(Buffer, BufferSize);
+
+
+    if (N < 0)
+      return BufferSize * 2;
+
+
+
+    if (unsigned(N) >= BufferSize)
+      return N + 1;
+
+
+    return N;
+  }
+};
+
+
+
+
+
+
+
+template <typename... Args> struct validate_format_parameters;
+template <typename Arg, typename... Args>
+struct validate_format_parameters<Arg, Args...> {
+  static_assert(std::is_scalar<Arg>::value,
+                "format can't be used with non fundamental / non pointer type");
+  validate_format_parameters() { validate_format_parameters<Args...>(); }
+};
+template <> struct validate_format_parameters<> {};
+
+template <typename... Ts>
+class format_object final : public format_object_base {
+  std::tuple<Ts...> Vals;
+
+  template <std::size_t... Is>
+  int snprint_tuple(char *Buffer, unsigned BufferSize,
+                    index_sequence<Is...>) const {
+
+
+
+    return snprintf(Buffer, BufferSize, Fmt, std::get<Is>(Vals)...);
+
+  }
+
+public:
+  format_object(const char *fmt, const Ts &... vals)
+      : format_object_base(fmt), Vals(vals...) {
+    validate_format_parameters<Ts...>();
+  }
+
+  int snprint(char *Buffer, unsigned BufferSize) const override {
+    return snprint_tuple(Buffer, BufferSize, index_sequence_for<Ts...>());
+  }
+};
+template <typename... Ts>
+inline format_object<Ts...> format(const char *Fmt, const Ts &... Vals) {
+  return format_object<Ts...>(Fmt, Vals...);
+}
+
+
+class FormattedString {
+public:
+  enum Justification { JustifyNone, JustifyLeft, JustifyRight, JustifyCenter };
+  FormattedString(StringRef S, unsigned W, Justification J)
+      : Str(S), Width(W), Justify(J) {}
+
+private:
+  StringRef Str;
+  unsigned Width;
+  Justification Justify;
+  friend class raw_ostream;
+};
+
+
+
+
+inline FormattedString left_justify(StringRef Str, unsigned Width) {
+  return FormattedString(Str, Width, FormattedString::JustifyLeft);
+}
+
+
+
+
+inline FormattedString right_justify(StringRef Str, unsigned Width) {
+  return FormattedString(Str, Width, FormattedString::JustifyRight);
+}
+
+
+
+
+inline FormattedString center_justify(StringRef Str, unsigned Width) {
+  return FormattedString(Str, Width, FormattedString::JustifyCenter);
+}
+
+
+class FormattedNumber {
+  uint64_t HexValue;
+  int64_t DecValue;
+  unsigned Width;
+  bool Hex;
+  bool Upper;
+  bool HexPrefix;
+  friend class raw_ostream;
+
+public:
+  FormattedNumber(uint64_t HV, int64_t DV, unsigned W, bool H, bool U,
+                  bool Prefix)
+      : HexValue(HV), DecValue(DV), Width(W), Hex(H), Upper(U),
+        HexPrefix(Prefix) {}
+};
+
+
+
+
+
+
+
+inline FormattedNumber format_hex(uint64_t N, unsigned Width,
+                                  bool Upper = false) {
+  
+ ((
+ Width <= 18 && "hex width must be <= 18"
+ ) ? static_cast<void> (0) : __assert_fail (
+ "Width <= 18 && \"hex width must be <= 18\""
+ , "/home/trippels/llvm/llvm/include/llvm/Support/Format.h", 188, __PRETTY_FUNCTION__))
+                                                 ;
+  return FormattedNumber(N, 0, Width, true, Upper, true);
+}
+inline FormattedNumber format_hex_no_prefix(uint64_t N, unsigned Width,
+                                            bool Upper = false) {
+  
+ ((
+ Width <= 16 && "hex width must be <= 16"
+ ) ? static_cast<void> (0) : __assert_fail (
+ "Width <= 16 && \"hex width must be <= 16\""
+ , "/home/trippels/llvm/llvm/include/llvm/Support/Format.h", 201, __PRETTY_FUNCTION__))
+                                                 ;
+  return FormattedNumber(N, 0, Width, true, Upper, false);
+}
+
+
+
+
+
+
+
+inline FormattedNumber format_decimal(int64_t N, unsigned Width) {
+  return FormattedNumber(0, N, Width, false, false, false);
+}
+
+class FormattedBytes {
+  ArrayRef<uint8_t> Bytes;
+
+
+  Optional<uint64_t> FirstByteOffset;
+  uint32_t IndentLevel;
+  uint32_t NumPerLine;
+  uint8_t ByteGroupSize;
+  bool Upper;
+  bool ASCII;
+  friend class raw_ostream;
+
+public:
+  FormattedBytes(ArrayRef<uint8_t> B, uint32_t IL, Optional<uint64_t> O,
+                 uint32_t NPL, uint8_t BGS, bool U, bool A)
+      : Bytes(B), FirstByteOffset(O), IndentLevel(IL), NumPerLine(NPL),
+        ByteGroupSize(BGS), Upper(U), ASCII(A) {
+
+    if (ByteGroupSize > NumPerLine)
+      ByteGroupSize = NumPerLine;
+  }
+};
+
+inline FormattedBytes
+format_bytes(ArrayRef<uint8_t> Bytes, Optional<uint64_t> FirstByteOffset = None,
+             uint32_t NumPerLine = 16, uint8_t ByteGroupSize = 4,
+             uint32_t IndentLevel = 0, bool Upper = false) {
+  return FormattedBytes(Bytes, IndentLevel, FirstByteOffset, NumPerLine,
+                        ByteGroupSize, Upper, false);
+}
+
+inline FormattedBytes
+format_bytes_with_ascii(ArrayRef<uint8_t> Bytes,
+                        Optional<uint64_t> FirstByteOffset = None,
+                        uint32_t NumPerLine = 16, uint8_t ByteGroupSize = 4,
+                        uint32_t IndentLevel = 0, bool Upper = false) {
+  return FormattedBytes(Bytes, IndentLevel, FirstByteOffset, NumPerLine,
+                        ByteGroupSize, Upper, true);
+}
+
+}
+namespace llvm {
+
+class raw_ostream;
+class Printable {
+public:
+  std::function<void(raw_ostream &OS)> Print;
+  Printable(std::function<void(raw_ostream &OS)> Print)
+      : Print(std::move(Print)) {}
+};
+
+inline raw_ostream &operator<<(raw_ostream &OS, const Printable &P) {
+  P.Print(OS);
+  return OS;
+}
+
+}
+
+
+namespace llvm {
+
+  struct LaneBitmask {
+
+    using Type = unsigned;
+    enum : unsigned { BitWidth = 8*sizeof(Type) };
+    constexpr static const char *const FormatStr = "%08X";
+
+    constexpr LaneBitmask() = default;
+    explicit constexpr LaneBitmask(Type V) : Mask(V) {}
+
+    constexpr bool operator== (LaneBitmask M) const { return Mask == M.Mask; }
+    constexpr bool operator!= (LaneBitmask M) const { return Mask != M.Mask; }
+    constexpr bool operator< (LaneBitmask M) const { return Mask < M.Mask; }
+    constexpr bool none() const { return Mask == 0; }
+    constexpr bool any() const { return Mask != 0; }
+    constexpr bool all() const { return ~Mask == 0; }
+
+    constexpr LaneBitmask operator~() const {
+      return LaneBitmask(~Mask);
+    }
+    constexpr LaneBitmask operator|(LaneBitmask M) const {
+      return LaneBitmask(Mask | M.Mask);
+    }
+    constexpr LaneBitmask operator&(LaneBitmask M) const {
+      return LaneBitmask(Mask & M.Mask);
+    }
+    LaneBitmask &operator|=(LaneBitmask M) {
+      Mask |= M.Mask;
+      return *this;
+    }
+    LaneBitmask &operator&=(LaneBitmask M) {
+      Mask &= M.Mask;
+      return *this;
+    }
+
+    constexpr Type getAsInteger() const { return Mask; }
+
+    unsigned getNumLanes() const {
+      return countPopulation(Mask);
+    }
+    unsigned getHighestLane() const {
+      return Log2_32(Mask);
+    }
+
+    static constexpr LaneBitmask getNone() { return LaneBitmask(0); }
+    static constexpr LaneBitmask getAll() { return ~LaneBitmask(0); }
+    static constexpr LaneBitmask getLane(unsigned Lane) {
+      return LaneBitmask(Type(1) << Lane);
+    }
+
+  private:
+    Type Mask = 0;
+  };
+
+
+  inline Printable PrintLaneMask(LaneBitmask LaneMask) {
+    return Printable([LaneMask](raw_ostream &OS) {
+      OS << format(LaneBitmask::FormatStr, LaneMask.getAsInteger());
+    });
+  }
+
+}
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+namespace llvm {
+
+
+
+using MCPhysReg = uint16_t;
+
+
+class MCRegisterClass {
+public:
+  using iterator = const MCPhysReg*;
+  using const_iterator = const MCPhysReg*;
+
+  const iterator RegsBegin;
+  const uint8_t *const RegSet;
+  const uint32_t NameIdx;
+  const uint16_t RegsSize;
+  const uint16_t RegSetSize;
+  const uint16_t ID;
+  const uint16_t PhysRegSize;
+  const int8_t CopyCost;
+  const bool Allocatable;
+
+
+
+  unsigned getID() const { return ID; }
+
+
+
+  iterator begin() const { return RegsBegin; }
+  iterator end() const { return RegsBegin + RegsSize; }
+
+
+
+  unsigned getNumRegs() const { return RegsSize; }
+
+
+
+  unsigned getRegister(unsigned i) const {
+    
+   ((
+   i < getNumRegs() && "Register number out of range!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "i < getNumRegs() && \"Register number out of range!\""
+   , "/home/trippels/llvm/llvm/include/llvm/MC/MCRegisterInfo.h", 64, __PRETTY_FUNCTION__))
+                                                              ;
+    return RegsBegin[i];
+  }
+
+
+
+  bool contains(unsigned Reg) const {
+    unsigned InByte = Reg % 8;
+    unsigned Byte = Reg / 8;
+    if (Byte >= RegSetSize)
+      return false;
+    return (RegSet[Byte] & (1 << InByte)) != 0;
+  }
+
+
+  bool contains(unsigned Reg1, unsigned Reg2) const {
+    return contains(Reg1) && contains(Reg2);
+  }
+
+
+  unsigned getPhysRegSize() const { return PhysRegSize; }
+
+  unsigned getSize() const { return getPhysRegSize(); }
+
+
+
+
+  int getCopyCost() const { return CopyCost; }
+
+
+
+  bool isAllocatable() const { return Allocatable; }
+};
+struct MCRegisterDesc {
+  uint32_t Name;
+  uint32_t SubRegs;
+  uint32_t SuperRegs;
+
+
+
+  uint32_t SubRegIndices;
+
+
+
+  uint32_t RegUnits;
+
+
+
+  uint16_t RegUnitLaneMasks;
+};
+class MCRegisterInfo {
+public:
+  using regclass_iterator = const MCRegisterClass *;
+
+
+
+  struct DwarfLLVMRegPair {
+    unsigned FromReg;
+    unsigned ToReg;
+
+    bool operator<(DwarfLLVMRegPair RHS) const { return FromReg < RHS.FromReg; }
+  };
+
+
+
+  struct SubRegCoveredBits {
+    uint16_t Offset;
+    uint16_t Size;
+  };
+
+private:
+  const MCRegisterDesc *Desc;
+  unsigned NumRegs;
+  unsigned RAReg;
+  unsigned PCReg;
+  const MCRegisterClass *Classes;
+  unsigned NumClasses;
+  unsigned NumRegUnits;
+  const MCPhysReg (*RegUnitRoots)[2];
+  const MCPhysReg *DiffLists;
+  const LaneBitmask *RegUnitMaskSequences;
+
+  const char *RegStrings;
+  const char *RegClassStrings;
+  const uint16_t *SubRegIndices;
+
+  const SubRegCoveredBits *SubRegIdxRanges;
+
+  unsigned NumSubRegIndices;
+  const uint16_t *RegEncodingTable;
+
+
+  unsigned L2DwarfRegsSize;
+  unsigned EHL2DwarfRegsSize;
+  unsigned Dwarf2LRegsSize;
+  unsigned EHDwarf2LRegsSize;
+  const DwarfLLVMRegPair *L2DwarfRegs;
+  const DwarfLLVMRegPair *EHL2DwarfRegs;
+  const DwarfLLVMRegPair *Dwarf2LRegs;
+  const DwarfLLVMRegPair *EHDwarf2LRegs;
+  DenseMap<unsigned, int> L2SEHRegs;
+  DenseMap<unsigned, int> L2CVRegs;
+
+public:
+
+
+
+
+  class DiffListIterator {
+    uint16_t Val = 0;
+    const MCPhysReg *List = nullptr;
+
+  protected:
+
+    DiffListIterator() = default;
+
+
+
+
+    void init(MCPhysReg InitVal, const MCPhysReg *DiffList) {
+      Val = InitVal;
+      List = DiffList;
+    }
+
+
+
+
+    unsigned advance() {
+      
+     ((
+     isValid() && "Cannot move off the end of the list."
+     ) ? static_cast<void> (0) : __assert_fail (
+     "isValid() && \"Cannot move off the end of the list.\""
+     , "/home/trippels/llvm/llvm/include/llvm/MC/MCRegisterInfo.h", 213, __PRETTY_FUNCTION__))
+                                                                ;
+      MCPhysReg D = *List++;
+      Val += D;
+      return D;
+    }
+
+  public:
+
+    bool isValid() const { return List; }
+
+
+    unsigned operator*() const { return Val; }
+
+
+    void operator++() {
+
+      if (!advance())
+        List = nullptr;
+    }
+  };
+
+
+
+  friend class MCSubRegIterator;
+  friend class MCSubRegIndexIterator;
+  friend class MCSuperRegIterator;
+  friend class MCRegUnitIterator;
+  friend class MCRegUnitMaskIterator;
+  friend class MCRegUnitRootIterator;
+
+
+
+  void InitMCRegisterInfo(const MCRegisterDesc *D, unsigned NR, unsigned RA,
+                          unsigned PC,
+                          const MCRegisterClass *C, unsigned NC,
+                          const MCPhysReg (*RURoots)[2],
+                          unsigned NRU,
+                          const MCPhysReg *DL,
+                          const LaneBitmask *RUMS,
+                          const char *Strings,
+                          const char *ClassStrings,
+                          const uint16_t *SubIndices,
+                          unsigned NumIndices,
+                          const SubRegCoveredBits *SubIdxRanges,
+                          const uint16_t *RET) {
+    Desc = D;
+    NumRegs = NR;
+    RAReg = RA;
+    PCReg = PC;
+    Classes = C;
+    DiffLists = DL;
+    RegUnitMaskSequences = RUMS;
+    RegStrings = Strings;
+    RegClassStrings = ClassStrings;
+    NumClasses = NC;
+    RegUnitRoots = RURoots;
+    NumRegUnits = NRU;
+    SubRegIndices = SubIndices;
+    NumSubRegIndices = NumIndices;
+    SubRegIdxRanges = SubIdxRanges;
+    RegEncodingTable = RET;
+
+
+    EHL2DwarfRegs = nullptr;
+    EHL2DwarfRegsSize = 0;
+    L2DwarfRegs = nullptr;
+    L2DwarfRegsSize = 0;
+    EHDwarf2LRegs = nullptr;
+    EHDwarf2LRegsSize = 0;
+    Dwarf2LRegs = nullptr;
+    Dwarf2LRegsSize = 0;
+  }
+
+
+
+
+  void mapLLVMRegsToDwarfRegs(const DwarfLLVMRegPair *Map, unsigned Size,
+                              bool isEH) {
+    if (isEH) {
+      EHL2DwarfRegs = Map;
+      EHL2DwarfRegsSize = Size;
+    } else {
+      L2DwarfRegs = Map;
+      L2DwarfRegsSize = Size;
+    }
+  }
+
+
+
+
+  void mapDwarfRegsToLLVMRegs(const DwarfLLVMRegPair *Map, unsigned Size,
+                              bool isEH) {
+    if (isEH) {
+      EHDwarf2LRegs = Map;
+      EHDwarf2LRegsSize = Size;
+    } else {
+      Dwarf2LRegs = Map;
+      Dwarf2LRegsSize = Size;
+    }
+  }
+
+
+
+
+
+
+  void mapLLVMRegToSEHReg(unsigned LLVMReg, int SEHReg) {
+    L2SEHRegs[LLVMReg] = SEHReg;
+  }
+
+  void mapLLVMRegToCVReg(unsigned LLVMReg, int CVReg) {
+    L2CVRegs[LLVMReg] = CVReg;
+  }
+
+
+
+  unsigned getRARegister() const {
+    return RAReg;
+  }
+
+
+  unsigned getProgramCounter() const {
+    return PCReg;
+  }
+
+  const MCRegisterDesc &operator[](unsigned RegNo) const {
+    
+   ((
+   RegNo < NumRegs && "Attempting to access record for invalid register number!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "RegNo < NumRegs && \"Attempting to access record for invalid register number!\""
+   ,
+                                                                     "/home/trippels/llvm/llvm/include/llvm/MC/MCRegisterInfo.h"
+    ,
+                                                                     340
+    , __PRETTY_FUNCTION__))
+                                                                      
+                                                                     ;
+    return Desc[RegNo];
+  }
+
+
+
+  const MCRegisterDesc &get(unsigned RegNo) const {
+    return operator[](RegNo);
+  }
+
+
+
+
+  unsigned getSubReg(unsigned Reg, unsigned Idx) const;
+
+
+
+  unsigned getMatchingSuperReg(unsigned Reg, unsigned SubIdx,
+                               const MCRegisterClass *RC) const;
+
+
+
+
+  unsigned getSubRegIndex(unsigned RegNo, unsigned SubRegNo) const;
+
+
+
+
+  unsigned getSubRegIdxSize(unsigned Idx) const;
+
+
+
+
+  unsigned getSubRegIdxOffset(unsigned Idx) const;
+
+
+
+  const char *getName(unsigned RegNo) const {
+    return RegStrings + get(RegNo).Name;
+  }
+
+
+
+  unsigned getNumRegs() const {
+    return NumRegs;
+  }
+
+
+
+
+  unsigned getNumSubRegIndices() const {
+    return NumSubRegIndices;
+  }
+
+
+
+
+  unsigned getNumRegUnits() const {
+    return NumRegUnits;
+  }
+
+
+
+
+
+  int getDwarfRegNum(unsigned RegNum, bool isEH) const;
+
+
+  int getLLVMRegNum(unsigned RegNum, bool isEH) const;
+
+
+
+
+  int getLLVMRegNumFromEH(unsigned RegNum) const;
+
+
+
+  int getDwarfRegNumFromDwarfEHRegNum(unsigned RegNum) const;
+
+
+
+  int getSEHRegNum(unsigned RegNum) const;
+
+
+
+  int getCodeViewRegNum(unsigned RegNum) const;
+
+  regclass_iterator regclass_begin() const { return Classes; }
+  regclass_iterator regclass_end() const { return Classes+NumClasses; }
+  iterator_range<regclass_iterator> regclasses() const {
+    return make_range(regclass_begin(), regclass_end());
+  }
+
+  unsigned getNumRegClasses() const {
+    return (unsigned)(regclass_end()-regclass_begin());
+  }
+
+
+
+  const MCRegisterClass& getRegClass(unsigned i) const {
+    
+   ((
+   i < getNumRegClasses() && "Register Class ID out of range"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "i < getNumRegClasses() && \"Register Class ID out of range\""
+   , "/home/trippels/llvm/llvm/include/llvm/MC/MCRegisterInfo.h", 440, __PRETTY_FUNCTION__))
+                                                                     ;
+    return Classes[i];
+  }
+
+  const char *getRegClassName(const MCRegisterClass *Class) const {
+    return RegClassStrings + Class->NameIdx;
+  }
+
+
+  uint16_t getEncodingValue(unsigned RegNo) const {
+    
+   ((
+   RegNo < NumRegs && "Attempting to get encoding for invalid register number!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "RegNo < NumRegs && \"Attempting to get encoding for invalid register number!\""
+   ,
+                                                                    "/home/trippels/llvm/llvm/include/llvm/MC/MCRegisterInfo.h"
+    ,
+                                                                    451
+    , __PRETTY_FUNCTION__))
+                                                                     
+                                                                    ;
+    return RegEncodingTable[RegNo];
+  }
+
+
+  bool isSubRegister(unsigned RegA, unsigned RegB) const {
+    return isSuperRegister(RegB, RegA);
+  }
+
+
+  bool isSuperRegister(unsigned RegA, unsigned RegB) const;
+
+
+  bool isSubRegisterEq(unsigned RegA, unsigned RegB) const {
+    return isSuperRegisterEq(RegB, RegA);
+  }
+
+
+
+  bool isSuperRegisterEq(unsigned RegA, unsigned RegB) const {
+    return RegA == RegB || isSuperRegister(RegA, RegB);
+  }
+
+
+
+  bool isSuperOrSubRegisterEq(unsigned RegA, unsigned RegB) const {
+    return isSubRegisterEq(RegA, RegB) || isSuperRegister(RegA, RegB);
+  }
+};
+class MCSubRegIterator : public MCRegisterInfo::DiffListIterator {
+public:
+  MCSubRegIterator(unsigned Reg, const MCRegisterInfo *MCRI,
+                     bool IncludeSelf = false) {
+    init(Reg, MCRI->DiffLists + MCRI->get(Reg).SubRegs);
+
+    if (!IncludeSelf)
+      ++*this;
+  }
+};
+
+
+
+class MCSubRegIndexIterator {
+  MCSubRegIterator SRIter;
+  const uint16_t *SRIndex;
+
+public:
+
+
+  MCSubRegIndexIterator(unsigned Reg, const MCRegisterInfo *MCRI)
+    : SRIter(Reg, MCRI) {
+    SRIndex = MCRI->SubRegIndices + MCRI->get(Reg).SubRegIndices;
+  }
+
+
+  unsigned getSubReg() const {
+    return *SRIter;
+  }
+
+
+  unsigned getSubRegIndex() const {
+    return *SRIndex;
+  }
+
+
+  bool isValid() const { return SRIter.isValid(); }
+
+
+  void operator++() {
+    ++SRIter;
+    ++SRIndex;
+  }
+};
+
+
+
+class MCSuperRegIterator : public MCRegisterInfo::DiffListIterator {
+public:
+  MCSuperRegIterator() = default;
+
+  MCSuperRegIterator(unsigned Reg, const MCRegisterInfo *MCRI,
+                     bool IncludeSelf = false) {
+    init(Reg, MCRI->DiffLists + MCRI->get(Reg).SuperRegs);
+
+    if (!IncludeSelf)
+      ++*this;
+  }
+};
+
+
+
+inline bool MCRegisterInfo::isSuperRegister(unsigned RegA, unsigned RegB) const{
+  for (MCSuperRegIterator I(RegA, this); I.isValid(); ++I)
+    if (*I == RegB)
+      return true;
+  return false;
+}
+class MCRegUnitIterator : public MCRegisterInfo::DiffListIterator {
+public:
+
+
+  MCRegUnitIterator() = default;
+
+  MCRegUnitIterator(unsigned Reg, const MCRegisterInfo *MCRI) {
+    
+   ((
+   Reg && "Null register has no regunits"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Reg && \"Null register has no regunits\""
+   , "/home/trippels/llvm/llvm/include/llvm/MC/MCRegisterInfo.h", 580, __PRETTY_FUNCTION__))
+                                                 ;
+
+    unsigned RU = MCRI->get(Reg).RegUnits;
+    unsigned Scale = RU & 15;
+    unsigned Offset = RU >> 4;
+
+
+
+    init(Reg * Scale, MCRI->DiffLists + Offset);
+
+
+
+
+
+    advance();
+  }
+};
+
+
+
+
+class MCRegUnitMaskIterator {
+  MCRegUnitIterator RUIter;
+  const LaneBitmask *MaskListIter;
+
+public:
+  MCRegUnitMaskIterator() = default;
+
+
+
+  MCRegUnitMaskIterator(unsigned Reg, const MCRegisterInfo *MCRI)
+    : RUIter(Reg, MCRI) {
+      uint16_t Idx = MCRI->get(Reg).RegUnitLaneMasks;
+      MaskListIter = &MCRI->RegUnitMaskSequences[Idx];
+  }
+
+
+  std::pair<unsigned,LaneBitmask> operator*() const {
+    return std::make_pair(*RUIter, *MaskListIter);
+  }
+
+
+  bool isValid() const { return RUIter.isValid(); }
+
+
+  void operator++() {
+    ++MaskListIter;
+    ++RUIter;
+  }
+};
+class MCRegUnitRootIterator {
+  uint16_t Reg0 = 0;
+  uint16_t Reg1 = 0;
+
+public:
+  MCRegUnitRootIterator() = default;
+
+  MCRegUnitRootIterator(unsigned RegUnit, const MCRegisterInfo *MCRI) {
+    
+   ((
+   RegUnit < MCRI->getNumRegUnits() && "Invalid register unit"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "RegUnit < MCRI->getNumRegUnits() && \"Invalid register unit\""
+   , "/home/trippels/llvm/llvm/include/llvm/MC/MCRegisterInfo.h", 649, __PRETTY_FUNCTION__))
+                                                                      ;
+    Reg0 = MCRI->RegUnitRoots[RegUnit][0];
+    Reg1 = MCRI->RegUnitRoots[RegUnit][1];
+  }
+
+
+  unsigned operator*() const {
+    return Reg0;
+  }
+
+
+  bool isValid() const {
+    return Reg0;
+  }
+
+
+  void operator++() {
+    
+   ((
+   isValid() && "Cannot move off the end of the list."
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isValid() && \"Cannot move off the end of the list.\""
+   , "/home/trippels/llvm/llvm/include/llvm/MC/MCRegisterInfo.h", 666, __PRETTY_FUNCTION__))
+                                                              ;
+    Reg0 = Reg1;
+    Reg1 = 0;
+  }
+};
+
+
+
+
+class MCRegAliasIterator {
+private:
+  unsigned Reg;
+  const MCRegisterInfo *MCRI;
+  bool IncludeSelf;
+
+  MCRegUnitIterator RI;
+  MCRegUnitRootIterator RRI;
+  MCSuperRegIterator SI;
+
+public:
+  MCRegAliasIterator(unsigned Reg, const MCRegisterInfo *MCRI,
+                     bool IncludeSelf)
+    : Reg(Reg), MCRI(MCRI), IncludeSelf(IncludeSelf) {
+
+    for (RI = MCRegUnitIterator(Reg, MCRI); RI.isValid(); ++RI) {
+      for (RRI = MCRegUnitRootIterator(*RI, MCRI); RRI.isValid(); ++RRI) {
+        for (SI = MCSuperRegIterator(*RRI, MCRI, true); SI.isValid(); ++SI) {
+          if (!(!IncludeSelf && Reg == *SI))
+            return;
+        }
+      }
+    }
+  }
+
+  bool isValid() const { return RI.isValid(); }
+
+  unsigned operator*() const {
+    
+   ((
+   SI.isValid() && "Cannot dereference an invalid iterator."
+   ) ? static_cast<void> (0) : __assert_fail (
+   "SI.isValid() && \"Cannot dereference an invalid iterator.\""
+   , "/home/trippels/llvm/llvm/include/llvm/MC/MCRegisterInfo.h", 703, __PRETTY_FUNCTION__))
+                                                                    ;
+    return *SI;
+  }
+
+  void advance() {
+
+    ++SI;
+    if (SI.isValid()) return;
+
+    ++RRI;
+    if (RRI.isValid()) {
+      SI = MCSuperRegIterator(*RRI, MCRI, true);
+      return;
+    }
+
+    ++RI;
+    if (RI.isValid()) {
+      RRI = MCRegUnitRootIterator(*RI, MCRI);
+      SI = MCSuperRegIterator(*RRI, MCRI, true);
+    }
+  }
+
+  void operator++() {
+    
+   ((
+   isValid() && "Cannot move off the end of the list."
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isValid() && \"Cannot move off the end of the list.\""
+   , "/home/trippels/llvm/llvm/include/llvm/MC/MCRegisterInfo.h", 726, __PRETTY_FUNCTION__))
+                                                              ;
+    do advance();
+    while (!IncludeSelf && isValid() && *SI == Reg);
+  }
+};
+
+}
+
+
+
+namespace llvm {
+  class MCInst;
+  class MCSubtargetInfo;
+  class FeatureBitset;
+
+
+
+
+
+namespace MCOI {
+
+enum OperandConstraint {
+  TIED_TO = 0,
+  EARLY_CLOBBER
+};
+
+
+
+
+enum OperandFlags { LookupPtrRegClass = 0, Predicate, OptionalDef };
+
+
+enum OperandType {
+  OPERAND_UNKNOWN = 0,
+  OPERAND_IMMEDIATE = 1,
+  OPERAND_REGISTER = 2,
+  OPERAND_MEMORY = 3,
+  OPERAND_PCREL = 4,
+
+  OPERAND_FIRST_GENERIC = 6,
+  OPERAND_GENERIC_0 = 6,
+  OPERAND_GENERIC_1 = 7,
+  OPERAND_GENERIC_2 = 8,
+  OPERAND_GENERIC_3 = 9,
+  OPERAND_GENERIC_4 = 10,
+  OPERAND_GENERIC_5 = 11,
+  OPERAND_LAST_GENERIC = 11,
+
+  OPERAND_FIRST_TARGET = 12,
+};
+
+enum GenericOperandType {
+};
+
+}
+
+
+
+class MCOperandInfo {
+public:
+
+
+
+
+  int16_t RegClass;
+
+
+  uint8_t Flags;
+
+
+  uint8_t OperandType;
+
+
+
+  uint32_t Constraints;
+
+
+
+  bool isLookupPtrRegClass() const {
+    return Flags & (1 << MCOI::LookupPtrRegClass);
+  }
+
+
+
+  bool isPredicate() const { return Flags & (1 << MCOI::Predicate); }
+
+
+  bool isOptionalDef() const { return Flags & (1 << MCOI::OptionalDef); }
+
+  bool isGenericType() const {
+    return OperandType >= MCOI::OPERAND_FIRST_GENERIC &&
+           OperandType <= MCOI::OPERAND_LAST_GENERIC;
+  }
+
+  unsigned getGenericTypeIndex() const {
+    
+   ((
+   isGenericType() && "non-generic types don't have an index"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isGenericType() && \"non-generic types don't have an index\""
+   , "/home/trippels/llvm/llvm/include/llvm/MC/MCInstrDesc.h", 107, __PRETTY_FUNCTION__))
+                                                                     ;
+    return OperandType - MCOI::OPERAND_FIRST_GENERIC;
+  }
+};
+
+
+
+
+
+namespace MCID {
+
+
+
+
+enum Flag {
+  Variadic = 0,
+  HasOptionalDef,
+  Pseudo,
+  Return,
+  Call,
+  Barrier,
+  Terminator,
+  Branch,
+  IndirectBranch,
+  Compare,
+  MoveImm,
+  Bitcast,
+  Select,
+  DelaySlot,
+  FoldableAsLoad,
+  MayLoad,
+  MayStore,
+  Predicable,
+  NotDuplicable,
+  UnmodeledSideEffects,
+  Commutable,
+  ConvertibleTo3Addr,
+  UsesCustomInserter,
+  HasPostISelHook,
+  Rematerializable,
+  CheapAsAMove,
+  ExtraSrcRegAllocReq,
+  ExtraDefRegAllocReq,
+  RegSequence,
+  ExtractSubreg,
+  InsertSubreg,
+  Convergent,
+  Add
+};
+}
+
+
+
+
+
+
+class MCInstrDesc {
+public:
+  unsigned short Opcode;
+  unsigned short NumOperands;
+  unsigned char NumDefs;
+  unsigned char Size;
+  unsigned short SchedClass;
+  uint64_t Flags;
+  uint64_t TSFlags;
+  const MCPhysReg *ImplicitUses;
+  const MCPhysReg *ImplicitDefs;
+  const MCOperandInfo *OpInfo;
+
+
+
+  int64_t DeprecatedFeature;
+
+
+
+  bool (*ComplexDeprecationInfo)(MCInst &, const MCSubtargetInfo &,
+                                 std::string &);
+
+
+
+  int getOperandConstraint(unsigned OpNum,
+                           MCOI::OperandConstraint Constraint) const {
+    if (OpNum < NumOperands &&
+        (OpInfo[OpNum].Constraints & (1 << Constraint))) {
+      unsigned Pos = 16 + Constraint * 4;
+      return (int)(OpInfo[OpNum].Constraints >> Pos) & 0xf;
+    }
+    return -1;
+  }
+
+
+
+  bool getDeprecatedInfo(MCInst &MI, const MCSubtargetInfo &STI,
+                         std::string &Info) const;
+
+
+  unsigned getOpcode() const { return Opcode; }
+
+
+
+
+
+
+  unsigned getNumOperands() const { return NumOperands; }
+
+  using const_opInfo_iterator = const MCOperandInfo *;
+
+  const_opInfo_iterator opInfo_begin() const { return OpInfo; }
+  const_opInfo_iterator opInfo_end() const { return OpInfo + NumOperands; }
+
+  iterator_range<const_opInfo_iterator> operands() const {
+    return make_range(opInfo_begin(), opInfo_end());
+  }
+
+
+
+
+
+  unsigned getNumDefs() const { return NumDefs; }
+
+
+  uint64_t getFlags() const { return Flags; }
+
+
+
+
+
+  bool isVariadic() const { return Flags & (1ULL << MCID::Variadic); }
+
+
+
+  bool hasOptionalDef() const { return Flags & (1ULL << MCID::HasOptionalDef); }
+
+
+
+  bool isPseudo() const { return Flags & (1ULL << MCID::Pseudo); }
+
+
+  bool isReturn() const { return Flags & (1ULL << MCID::Return); }
+
+
+  bool isAdd() const { return Flags & (1ULL << MCID::Add); }
+
+
+  bool isCall() const { return Flags & (1ULL << MCID::Call); }
+
+
+
+
+  bool isBarrier() const { return Flags & (1ULL << MCID::Barrier); }
+
+
+
+
+
+
+
+  bool isTerminator() const { return Flags & (1ULL << MCID::Terminator); }
+
+
+
+
+
+  bool isBranch() const { return Flags & (1ULL << MCID::Branch); }
+
+
+
+  bool isIndirectBranch() const { return Flags & (1ULL << MCID::IndirectBranch); }
+
+
+
+
+
+  bool isConditionalBranch() const {
+    return isBranch() & !isBarrier() & !isIndirectBranch();
+  }
+
+
+
+
+
+  bool isUnconditionalBranch() const {
+    return isBranch() & isBarrier() & !isIndirectBranch();
+  }
+
+
+
+
+  bool mayAffectControlFlow(const MCInst &MI, const MCRegisterInfo &RI) const;
+
+
+
+
+
+  bool isPredicable() const { return Flags & (1ULL << MCID::Predicable); }
+
+
+  bool isCompare() const { return Flags & (1ULL << MCID::Compare); }
+
+
+
+  bool isMoveImmediate() const { return Flags & (1ULL << MCID::MoveImm); }
+
+
+  bool isBitcast() const { return Flags & (1ULL << MCID::Bitcast); }
+
+
+  bool isSelect() const { return Flags & (1ULL << MCID::Select); }
+
+
+
+
+  bool isNotDuplicable() const { return Flags & (1ULL << MCID::NotDuplicable); }
+
+
+
+  bool hasDelaySlot() const { return Flags & (1ULL << MCID::DelaySlot); }
+  bool canFoldAsLoad() const { return Flags & (1ULL << MCID::FoldableAsLoad); }
+  bool isRegSequenceLike() const { return Flags & (1ULL << MCID::RegSequence); }
+  bool isExtractSubregLike() const {
+    return Flags & (1ULL << MCID::ExtractSubreg);
+  }
+  bool isInsertSubregLike() const { return Flags & (1ULL << MCID::InsertSubreg); }
+
+
+
+
+
+
+  bool isConvergent() const { return Flags & (1ULL << MCID::Convergent); }
+  bool mayLoad() const { return Flags & (1ULL << MCID::MayLoad); }
+
+
+
+
+
+  bool mayStore() const { return Flags & (1ULL << MCID::MayStore); }
+  bool hasUnmodeledSideEffects() const {
+    return Flags & (1ULL << MCID::UnmodeledSideEffects);
+  }
+  bool isCommutable() const { return Flags & (1ULL << MCID::Commutable); }
+  bool isConvertibleTo3Addr() const {
+    return Flags & (1ULL << MCID::ConvertibleTo3Addr);
+  }
+  bool usesCustomInsertionHook() const {
+    return Flags & (1ULL << MCID::UsesCustomInserter);
+  }
+
+
+
+
+
+  bool hasPostISelHook() const { return Flags & (1ULL << MCID::HasPostISelHook); }
+
+
+
+
+
+
+
+  bool isRematerializable() const {
+    return Flags & (1ULL << MCID::Rematerializable);
+  }
+  bool isAsCheapAsAMove() const { return Flags & (1ULL << MCID::CheapAsAMove); }
+
+
+
+
+
+
+
+  bool hasExtraSrcRegAllocReq() const {
+    return Flags & (1ULL << MCID::ExtraSrcRegAllocReq);
+  }
+
+
+
+
+
+
+
+  bool hasExtraDefRegAllocReq() const {
+    return Flags & (1ULL << MCID::ExtraDefRegAllocReq);
+  }
+  const MCPhysReg *getImplicitUses() const { return ImplicitUses; }
+
+
+  unsigned getNumImplicitUses() const {
+    if (!ImplicitUses)
+      return 0;
+    unsigned i = 0;
+    for (; ImplicitUses[i]; ++i)
+      ;
+    return i;
+  }
+  const MCPhysReg *getImplicitDefs() const { return ImplicitDefs; }
+
+
+  unsigned getNumImplicitDefs() const {
+    if (!ImplicitDefs)
+      return 0;
+    unsigned i = 0;
+    for (; ImplicitDefs[i]; ++i)
+      ;
+    return i;
+  }
+
+
+
+  bool hasImplicitUseOfPhysReg(unsigned Reg) const {
+    if (const MCPhysReg *ImpUses = ImplicitUses)
+      for (; *ImpUses; ++ImpUses)
+        if (*ImpUses == Reg)
+          return true;
+    return false;
+  }
+
+
+
+  bool hasImplicitDefOfPhysReg(unsigned Reg,
+                               const MCRegisterInfo *MRI = nullptr) const;
+
+
+
+
+
+  unsigned getSchedClass() const { return SchedClass; }
+
+
+
+  unsigned getSize() const { return Size; }
+
+
+
+
+  int findFirstPredOperandIdx() const {
+    if (isPredicable()) {
+      for (unsigned i = 0, e = getNumOperands(); i != e; ++i)
+        if (OpInfo[i].isPredicate())
+          return i;
+    }
+    return -1;
+  }
+
+
+
+  bool hasDefOfPhysReg(const MCInst &MI, unsigned Reg,
+                       const MCRegisterInfo &RI) const;
+};
+
+}
+namespace llvm {
+
+
+
+
+
+
+template <class T, size_t Align = alignof(T)> class ArrayRecycler {
+
+
+  struct FreeList {
+    FreeList *Next;
+  };
+
+  static_assert(Align >= alignof(FreeList), "Object underaligned");
+  static_assert(sizeof(T) >= sizeof(FreeList), "Objects are too small");
+
+
+  SmallVector<FreeList*, 8> Bucket;
+
+
+
+  T *pop(unsigned Idx) {
+    if (Idx >= Bucket.size())
+      return nullptr;
+    FreeList *Entry = Bucket[Idx];
+    if (!Entry)
+      return nullptr;
+    ;
+    Bucket[Idx] = Entry->Next;
+    ;
+    return reinterpret_cast<T*>(Entry);
+  }
+
+
+  void push(unsigned Idx, T *Ptr) {
+    
+   ((
+   Ptr && "Cannot recycle NULL pointer"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Ptr && \"Cannot recycle NULL pointer\""
+   , "/home/trippels/llvm/llvm/include/llvm/Support/ArrayRecycler.h", 58, __PRETTY_FUNCTION__))
+                                               ;
+    FreeList *Entry = reinterpret_cast<FreeList*>(Ptr);
+    if (Idx >= Bucket.size())
+      Bucket.resize(size_t(Idx) + 1);
+    Entry->Next = Bucket[Idx];
+    Bucket[Idx] = Entry;
+    ;
+  }
+
+public:
+
+
+
+
+  class Capacity {
+    uint8_t Index;
+    explicit Capacity(uint8_t idx) : Index(idx) {}
+
+  public:
+    Capacity() : Index(0) {}
+
+
+    static Capacity get(size_t N) {
+      return Capacity(N ? Log2_64_Ceil(N) : 0);
+    }
+
+
+    size_t getSize() const { return size_t(1u) << Index; }
+
+
+    unsigned getBucket() const { return Index; }
+
+
+
+
+    Capacity getNext() const { return Capacity(Index + 1); }
+  };
+
+  ~ArrayRecycler() {
+
+
+    
+   ((
+   Bucket.empty() && "Non-empty ArrayRecycler deleted!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Bucket.empty() && \"Non-empty ArrayRecycler deleted!\""
+   , "/home/trippels/llvm/llvm/include/llvm/Support/ArrayRecycler.h", 99, __PRETTY_FUNCTION__))
+                                                               ;
+  }
+
+
+
+  template<class AllocatorType>
+  void clear(AllocatorType &Allocator) {
+    for (; !Bucket.empty(); Bucket.pop_back())
+      while (T *Ptr = pop(Bucket.size() - 1))
+        Allocator.Deallocate(Ptr);
+  }
+
+
+
+
+
+
+  void clear(BumpPtrAllocator&) {
+    Bucket.clear();
+  }
+
+
+
+
+
+
+  template<class AllocatorType>
+  T *allocate(Capacity Cap, AllocatorType &Allocator) {
+
+    if (T *Ptr = pop(Cap.getBucket()))
+      return Ptr;
+
+    return static_cast<T*>(Allocator.Allocate(sizeof(T)*Cap.getSize(), Align));
+  }
+
+
+
+
+
+  void deallocate(Capacity Cap, T *Ptr) {
+    push(Cap.getBucket(), Ptr);
+  }
+};
+
+}
+
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+namespace llvm {
+
+template <typename T> class ArrayRef;
+class DIExpression;
+class DILocalVariable;
+class MachineBasicBlock;
+class MachineFunction;
+class MachineMemOperand;
+class MachineRegisterInfo;
+class ModuleSlotTracker;
+class raw_ostream;
+template <typename T> class SmallVectorImpl;
+class SmallBitVector;
+class StringRef;
+class TargetInstrInfo;
+class TargetRegisterClass;
+class TargetRegisterInfo;
+class MachineInstr
+    : public ilist_node_with_parent<MachineInstr, MachineBasicBlock,
+                                    ilist_sentinel_tracking<true>> {
+public:
+  using mmo_iterator = MachineMemOperand **;
+
+
+
+
+
+  enum CommentFlag {
+    ReloadReuse = 0x1,
+    NoSchedComment = 0x2,
+    TAsmComments = 0x4
+  };
+
+  enum MIFlag {
+    NoFlags = 0,
+    FrameSetup = 1 << 0,
+
+    FrameDestroy = 1 << 1,
+
+    BundledPred = 1 << 2,
+    BundledSucc = 1 << 3
+  };
+
+private:
+  const MCInstrDesc *MCID;
+  MachineBasicBlock *Parent = nullptr;
+
+
+  MachineOperand *Operands = nullptr;
+  unsigned NumOperands = 0;
+  using OperandCapacity = ArrayRecycler<MachineOperand>::Capacity;
+  OperandCapacity CapOperands;
+
+  uint8_t Flags = 0;
+
+
+
+  uint8_t AsmPrinterFlags = 0;
+
+
+
+
+
+
+  uint8_t NumMemRefs = 0;
+
+
+
+
+
+
+  mmo_iterator MemRefs = nullptr;
+
+  DebugLoc debugLoc;
+
+
+  friend struct ilist_traits<MachineInstr>;
+  friend struct ilist_callback_traits<MachineBasicBlock>;
+  void setParent(MachineBasicBlock *P) { Parent = P; }
+
+
+
+  MachineInstr(MachineFunction &, const MachineInstr &);
+
+
+
+
+  MachineInstr(MachineFunction &, const MCInstrDesc &MCID, DebugLoc dl,
+               bool NoImp = false);
+
+
+  friend class MachineFunction;
+
+public:
+  MachineInstr(const MachineInstr &) = delete;
+  MachineInstr &operator=(const MachineInstr &) = delete;
+
+  ~MachineInstr() = delete;
+
+  const MachineBasicBlock* getParent() const { return Parent; }
+  MachineBasicBlock* getParent() { return Parent; }
+
+
+
+
+
+
+  const MachineFunction *getMF() const;
+  MachineFunction *getMF() {
+    return const_cast<MachineFunction *>(
+        static_cast<const MachineInstr *>(this)->getMF());
+  }
+
+
+  uint8_t getAsmPrinterFlags() const { return AsmPrinterFlags; }
+
+
+  void clearAsmPrinterFlags() { AsmPrinterFlags = 0; }
+
+
+  bool getAsmPrinterFlag(CommentFlag Flag) const {
+    return AsmPrinterFlags & Flag;
+  }
+
+
+  void setAsmPrinterFlag(uint8_t Flag) {
+    AsmPrinterFlags |= Flag;
+  }
+
+
+  void clearAsmPrinterFlag(CommentFlag Flag) {
+    AsmPrinterFlags &= ~Flag;
+  }
+
+
+  uint8_t getFlags() const {
+    return Flags;
+  }
+
+
+  bool getFlag(MIFlag Flag) const {
+    return Flags & Flag;
+  }
+
+
+  void setFlag(MIFlag Flag) {
+    Flags |= (uint8_t)Flag;
+  }
+
+  void setFlags(unsigned flags) {
+
+    unsigned Mask = BundledPred | BundledSucc;
+    Flags = (Flags & Mask) | (flags & ~Mask);
+  }
+
+
+  void clearFlag(MIFlag Flag) {
+    Flags &= ~((uint8_t)Flag);
+  }
+  bool isInsideBundle() const {
+    return getFlag(BundledPred);
+  }
+
+
+
+  bool isBundled() const {
+    return isBundledWithPred() || isBundledWithSucc();
+  }
+
+
+
+  bool isBundledWithPred() const { return getFlag(BundledPred); }
+
+
+
+  bool isBundledWithSucc() const { return getFlag(BundledSucc); }
+
+
+
+  void bundleWithPred();
+
+
+
+  void bundleWithSucc();
+
+
+  void unbundleFromPred();
+
+
+  void unbundleFromSucc();
+
+
+  const DebugLoc &getDebugLoc() const { return debugLoc; }
+
+
+
+  const DILocalVariable *getDebugVariable() const;
+
+
+
+  const DIExpression *getDebugExpression() const;
+
+
+
+
+
+
+
+  void emitError(StringRef Msg) const;
+
+
+  const MCInstrDesc &getDesc() const { return *MCID; }
+
+
+  unsigned getOpcode() const { return MCID->Opcode; }
+
+
+  unsigned getNumOperands() const { return NumOperands; }
+
+  const MachineOperand& getOperand(unsigned i) const {
+    
+   ((
+   i < getNumOperands() && "getOperand() out of range!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "i < getNumOperands() && \"getOperand() out of range!\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineInstr.h", 299, __PRETTY_FUNCTION__))
+                                                               ;
+    return Operands[i];
+  }
+  MachineOperand& getOperand(unsigned i) {
+    
+   ((
+   i < getNumOperands() && "getOperand() out of range!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "i < getNumOperands() && \"getOperand() out of range!\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineInstr.h", 303, __PRETTY_FUNCTION__))
+                                                               ;
+    return Operands[i];
+  }
+
+
+  bool isOperandSubregIdx(unsigned OpIdx) const {
+    
+   ((
+   getOperand(OpIdx).getType() == MachineOperand::MO_Immediate && "Expected MO_Immediate operand type."
+   ) ? static_cast<void> (0) : __assert_fail (
+   "getOperand(OpIdx).getType() == MachineOperand::MO_Immediate && \"Expected MO_Immediate operand type.\""
+   ,
+                                                "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineInstr.h"
+    ,
+                                                310
+    , __PRETTY_FUNCTION__))
+                                                 
+                                                ;
+    if (isExtractSubreg() && OpIdx == 2)
+      return true;
+    if (isInsertSubreg() && OpIdx == 3)
+      return true;
+    if (isRegSequence() && OpIdx > 1 && (OpIdx % 2) == 0)
+      return true;
+    if (isSubregToReg() && OpIdx == 3)
+      return true;
+    return false;
+  }
+
+
+  unsigned getNumExplicitOperands() const;
+
+
+  using mop_iterator = MachineOperand *;
+  using const_mop_iterator = const MachineOperand *;
+
+  mop_iterator operands_begin() { return Operands; }
+  mop_iterator operands_end() { return Operands + NumOperands; }
+
+  const_mop_iterator operands_begin() const { return Operands; }
+  const_mop_iterator operands_end() const { return Operands + NumOperands; }
+
+  iterator_range<mop_iterator> operands() {
+    return make_range(operands_begin(), operands_end());
+  }
+  iterator_range<const_mop_iterator> operands() const {
+    return make_range(operands_begin(), operands_end());
+  }
+  iterator_range<mop_iterator> explicit_operands() {
+    return make_range(operands_begin(),
+                      operands_begin() + getNumExplicitOperands());
+  }
+  iterator_range<const_mop_iterator> explicit_operands() const {
+    return make_range(operands_begin(),
+                      operands_begin() + getNumExplicitOperands());
+  }
+  iterator_range<mop_iterator> implicit_operands() {
+    return make_range(explicit_operands().end(), operands_end());
+  }
+  iterator_range<const_mop_iterator> implicit_operands() const {
+    return make_range(explicit_operands().end(), operands_end());
+  }
+
+
+  iterator_range<mop_iterator> defs() {
+    return make_range(operands_begin(),
+                      operands_begin() + getDesc().getNumDefs());
+  }
+
+  iterator_range<const_mop_iterator> defs() const {
+    return make_range(operands_begin(),
+                      operands_begin() + getDesc().getNumDefs());
+  }
+
+
+  iterator_range<mop_iterator> uses() {
+    return make_range(operands_begin() + getDesc().getNumDefs(),
+                      operands_end());
+  }
+
+  iterator_range<const_mop_iterator> uses() const {
+    return make_range(operands_begin() + getDesc().getNumDefs(),
+                      operands_end());
+  }
+  iterator_range<mop_iterator> explicit_uses() {
+    return make_range(operands_begin() + getDesc().getNumDefs(),
+                      operands_begin() + getNumExplicitOperands() );
+  }
+  iterator_range<const_mop_iterator> explicit_uses() const {
+    return make_range(operands_begin() + getDesc().getNumDefs(),
+                      operands_begin() + getNumExplicitOperands() );
+  }
+
+
+  unsigned getOperandNo(const_mop_iterator I) const {
+    return I - operands_begin();
+  }
+
+
+  mmo_iterator memoperands_begin() const { return MemRefs; }
+  mmo_iterator memoperands_end() const { return MemRefs + NumMemRefs; }
+
+
+
+  bool memoperands_empty() const { return NumMemRefs == 0; }
+
+  iterator_range<mmo_iterator> memoperands() {
+    return make_range(memoperands_begin(), memoperands_end());
+  }
+  iterator_range<mmo_iterator> memoperands() const {
+    return make_range(memoperands_begin(), memoperands_end());
+  }
+
+
+  bool hasOneMemOperand() const {
+    return NumMemRefs == 1;
+  }
+
+
+  unsigned getNumMemOperands() const { return NumMemRefs; }
+
+
+
+
+  enum QueryType {
+    IgnoreBundle,
+    AnyInBundle,
+    AllInBundle
+  };
+
+
+
+
+
+
+  bool hasProperty(unsigned MCFlag, QueryType Type = AnyInBundle) const {
+
+    if (Type == IgnoreBundle || !isBundled() || isBundledWithPred())
+      return getDesc().getFlags() & (1ULL << MCFlag);
+
+
+    return hasPropertyInBundle(1ULL << MCFlag, Type);
+  }
+
+
+
+
+
+  bool isVariadic(QueryType Type = IgnoreBundle) const {
+    return hasProperty(MCID::Variadic, Type);
+  }
+
+
+
+  bool hasOptionalDef(QueryType Type = IgnoreBundle) const {
+    return hasProperty(MCID::HasOptionalDef, Type);
+  }
+
+
+
+  bool isPseudo(QueryType Type = IgnoreBundle) const {
+    return hasProperty(MCID::Pseudo, Type);
+  }
+
+  bool isReturn(QueryType Type = AnyInBundle) const {
+    return hasProperty(MCID::Return, Type);
+  }
+
+  bool isCall(QueryType Type = AnyInBundle) const {
+    return hasProperty(MCID::Call, Type);
+  }
+
+
+
+
+  bool isBarrier(QueryType Type = AnyInBundle) const {
+    return hasProperty(MCID::Barrier, Type);
+  }
+
+
+
+
+
+
+  bool isTerminator(QueryType Type = AnyInBundle) const {
+    return hasProperty(MCID::Terminator, Type);
+  }
+
+
+
+
+
+  bool isBranch(QueryType Type = AnyInBundle) const {
+    return hasProperty(MCID::Branch, Type);
+  }
+
+
+
+  bool isIndirectBranch(QueryType Type = AnyInBundle) const {
+    return hasProperty(MCID::IndirectBranch, Type);
+  }
+
+
+
+
+
+  bool isConditionalBranch(QueryType Type = AnyInBundle) const {
+    return isBranch(Type) & !isBarrier(Type) & !isIndirectBranch(Type);
+  }
+
+
+
+
+
+  bool isUnconditionalBranch(QueryType Type = AnyInBundle) const {
+    return isBranch(Type) & isBarrier(Type) & !isIndirectBranch(Type);
+  }
+
+
+
+
+
+  bool isPredicable(QueryType Type = AllInBundle) const {
+
+
+    return hasProperty(MCID::Predicable, Type);
+  }
+
+
+  bool isCompare(QueryType Type = IgnoreBundle) const {
+    return hasProperty(MCID::Compare, Type);
+  }
+
+
+
+  bool isMoveImmediate(QueryType Type = IgnoreBundle) const {
+    return hasProperty(MCID::MoveImm, Type);
+  }
+
+
+  bool isBitcast(QueryType Type = IgnoreBundle) const {
+    return hasProperty(MCID::Bitcast, Type);
+  }
+
+
+  bool isSelect(QueryType Type = IgnoreBundle) const {
+    return hasProperty(MCID::Select, Type);
+  }
+
+
+
+
+  bool isNotDuplicable(QueryType Type = AnyInBundle) const {
+    return hasProperty(MCID::NotDuplicable, Type);
+  }
+
+
+
+
+  bool isConvergent(QueryType Type = AnyInBundle) const {
+    if (isInlineAsm()) {
+      unsigned ExtraInfo = getOperand(InlineAsm::MIOp_ExtraInfo).getImm();
+      if (ExtraInfo & InlineAsm::Extra_IsConvergent)
+        return true;
+    }
+    return hasProperty(MCID::Convergent, Type);
+  }
+
+
+
+  bool hasDelaySlot(QueryType Type = AnyInBundle) const {
+    return hasProperty(MCID::DelaySlot, Type);
+  }
+  bool canFoldAsLoad(QueryType Type = IgnoreBundle) const {
+    return hasProperty(MCID::FoldableAsLoad, Type);
+  }
+  bool isRegSequenceLike(QueryType Type = IgnoreBundle) const {
+    return hasProperty(MCID::RegSequence, Type);
+  }
+  bool isExtractSubregLike(QueryType Type = IgnoreBundle) const {
+    return hasProperty(MCID::ExtractSubreg, Type);
+  }
+  bool isInsertSubregLike(QueryType Type = IgnoreBundle) const {
+    return hasProperty(MCID::InsertSubreg, Type);
+  }
+  bool mayLoad(QueryType Type = AnyInBundle) const {
+    if (isInlineAsm()) {
+      unsigned ExtraInfo = getOperand(InlineAsm::MIOp_ExtraInfo).getImm();
+      if (ExtraInfo & InlineAsm::Extra_MayLoad)
+        return true;
+    }
+    return hasProperty(MCID::MayLoad, Type);
+  }
+
+
+
+
+
+  bool mayStore(QueryType Type = AnyInBundle) const {
+    if (isInlineAsm()) {
+      unsigned ExtraInfo = getOperand(InlineAsm::MIOp_ExtraInfo).getImm();
+      if (ExtraInfo & InlineAsm::Extra_MayStore)
+        return true;
+    }
+    return hasProperty(MCID::MayStore, Type);
+  }
+
+
+  bool mayLoadOrStore(QueryType Type = AnyInBundle) const {
+    return mayLoad(Type) || mayStore(Type);
+  }
+  bool isCommutable(QueryType Type = IgnoreBundle) const {
+    return hasProperty(MCID::Commutable, Type);
+  }
+  bool isConvertibleTo3Addr(QueryType Type = IgnoreBundle) const {
+    return hasProperty(MCID::ConvertibleTo3Addr, Type);
+  }
+  bool usesCustomInsertionHook(QueryType Type = IgnoreBundle) const {
+    return hasProperty(MCID::UsesCustomInserter, Type);
+  }
+
+
+
+
+
+  bool hasPostISelHook(QueryType Type = IgnoreBundle) const {
+    return hasProperty(MCID::HasPostISelHook, Type);
+  }
+
+
+
+
+
+  bool isRematerializable(QueryType Type = AllInBundle) const {
+
+
+    return hasProperty(MCID::Rematerializable, Type);
+  }
+
+
+
+
+
+
+
+  bool isAsCheapAsAMove(QueryType Type = AllInBundle) const {
+
+    return hasProperty(MCID::CheapAsAMove, Type);
+  }
+
+
+
+
+
+
+
+  bool hasExtraSrcRegAllocReq(QueryType Type = AnyInBundle) const {
+    return hasProperty(MCID::ExtraSrcRegAllocReq, Type);
+  }
+
+
+
+
+
+
+
+  bool hasExtraDefRegAllocReq(QueryType Type = AnyInBundle) const {
+    return hasProperty(MCID::ExtraDefRegAllocReq, Type);
+  }
+
+  enum MICheckType {
+    CheckDefs,
+    CheckKillDead,
+    IgnoreDefs,
+    IgnoreVRegDefs
+  };
+
+
+
+
+
+
+  bool isIdenticalTo(const MachineInstr &Other,
+                     MICheckType Check = CheckDefs) const;
+
+
+
+
+
+
+  MachineInstr *removeFromParent();
+
+
+
+
+
+
+  MachineInstr *removeFromBundle();
+
+
+
+
+
+
+  void eraseFromParent();
+
+
+
+
+
+  void eraseFromParentAndMarkDBGValuesForRemoval();
+
+
+
+
+
+  void eraseFromBundle();
+
+  bool isEHLabel() const { return getOpcode() == TargetOpcode::EH_LABEL; }
+  bool isGCLabel() const { return getOpcode() == TargetOpcode::GC_LABEL; }
+  bool isAnnotationLabel() const {
+    return getOpcode() == TargetOpcode::ANNOTATION_LABEL;
+  }
+
+
+  bool isLabel() const {
+    return isEHLabel() || isGCLabel() || isAnnotationLabel();
+  }
+
+  bool isCFIInstruction() const {
+    return getOpcode() == TargetOpcode::CFI_INSTRUCTION;
+  }
+
+
+  bool isPosition() const { return isLabel() || isCFIInstruction(); }
+
+  bool isDebugValue() const { return getOpcode() == TargetOpcode::DBG_VALUE; }
+
+
+
+  bool isIndirectDebugValue() const {
+    return isDebugValue()
+      && getOperand(0).isReg()
+      && getOperand(1).isImm();
+  }
+
+  bool isPHI() const {
+    return getOpcode() == TargetOpcode::PHI ||
+           getOpcode() == TargetOpcode::G_PHI;
+  }
+  bool isKill() const { return getOpcode() == TargetOpcode::KILL; }
+  bool isImplicitDef() const { return getOpcode()==TargetOpcode::IMPLICIT_DEF; }
+  bool isInlineAsm() const { return getOpcode() == TargetOpcode::INLINEASM; }
+
+  bool isMSInlineAsm() const {
+    return getOpcode() == TargetOpcode::INLINEASM && getInlineAsmDialect();
+  }
+
+  bool isStackAligningInlineAsm() const;
+  InlineAsm::AsmDialect getInlineAsmDialect() const;
+
+  bool isInsertSubreg() const {
+    return getOpcode() == TargetOpcode::INSERT_SUBREG;
+  }
+
+  bool isSubregToReg() const {
+    return getOpcode() == TargetOpcode::SUBREG_TO_REG;
+  }
+
+  bool isRegSequence() const {
+    return getOpcode() == TargetOpcode::REG_SEQUENCE;
+  }
+
+  bool isBundle() const {
+    return getOpcode() == TargetOpcode::BUNDLE;
+  }
+
+  bool isCopy() const {
+    return getOpcode() == TargetOpcode::COPY;
+  }
+
+  bool isFullCopy() const {
+    return isCopy() && !getOperand(0).getSubReg() && !getOperand(1).getSubReg();
+  }
+
+  bool isExtractSubreg() const {
+    return getOpcode() == TargetOpcode::EXTRACT_SUBREG;
+  }
+
+
+
+  bool isCopyLike() const {
+    return isCopy() || isSubregToReg();
+  }
+
+
+  bool isIdentityCopy() const {
+    return isCopy() && getOperand(0).getReg() == getOperand(1).getReg() &&
+      getOperand(0).getSubReg() == getOperand(1).getSubReg();
+  }
+
+
+
+  bool isMetaInstruction() const {
+    switch (getOpcode()) {
+    default:
+      return false;
+    case TargetOpcode::IMPLICIT_DEF:
+    case TargetOpcode::KILL:
+    case TargetOpcode::CFI_INSTRUCTION:
+    case TargetOpcode::EH_LABEL:
+    case TargetOpcode::GC_LABEL:
+    case TargetOpcode::DBG_VALUE:
+      return true;
+    }
+  }
+
+
+
+
+  bool isTransient() const {
+    switch (getOpcode()) {
+    default:
+      return isMetaInstruction();
+
+    case TargetOpcode::PHI:
+    case TargetOpcode::G_PHI:
+    case TargetOpcode::COPY:
+    case TargetOpcode::INSERT_SUBREG:
+    case TargetOpcode::SUBREG_TO_REG:
+    case TargetOpcode::REG_SEQUENCE:
+      return true;
+    }
+  }
+
+
+
+
+
+
+  unsigned getBundleSize() const;
+
+
+
+
+
+
+  bool readsRegister(unsigned Reg,
+                     const TargetRegisterInfo *TRI = nullptr) const {
+    return findRegisterUseOperandIdx(Reg, false, TRI) != -1;
+  }
+
+
+
+
+  bool readsVirtualRegister(unsigned Reg) const {
+    return readsWritesVirtualRegister(Reg).first;
+  }
+
+
+
+
+  std::pair<bool,bool> readsWritesVirtualRegister(unsigned Reg,
+                                SmallVectorImpl<unsigned> *Ops = nullptr) const;
+
+
+
+
+  bool killsRegister(unsigned Reg,
+                     const TargetRegisterInfo *TRI = nullptr) const {
+    return findRegisterUseOperandIdx(Reg, true, TRI) != -1;
+  }
+
+
+
+
+
+  bool definesRegister(unsigned Reg,
+                       const TargetRegisterInfo *TRI = nullptr) const {
+    return findRegisterDefOperandIdx(Reg, false, false, TRI) != -1;
+  }
+
+
+
+
+  bool modifiesRegister(unsigned Reg, const TargetRegisterInfo *TRI) const {
+    return findRegisterDefOperandIdx(Reg, false, true, TRI) != -1;
+  }
+
+
+
+
+  bool registerDefIsDead(unsigned Reg,
+                         const TargetRegisterInfo *TRI = nullptr) const {
+    return findRegisterDefOperandIdx(Reg, true, false, TRI) != -1;
+  }
+
+
+
+  bool hasRegisterImplicitUseOperand(unsigned Reg) const;
+
+
+
+
+  int findRegisterUseOperandIdx(unsigned Reg, bool isKill = false,
+                                const TargetRegisterInfo *TRI = nullptr) const;
+
+
+
+  MachineOperand *findRegisterUseOperand(unsigned Reg, bool isKill = false,
+                                      const TargetRegisterInfo *TRI = nullptr) {
+    int Idx = findRegisterUseOperandIdx(Reg, isKill, TRI);
+    return (Idx == -1) ? nullptr : &getOperand(Idx);
+  }
+
+  const MachineOperand *findRegisterUseOperand(
+    unsigned Reg, bool isKill = false,
+    const TargetRegisterInfo *TRI = nullptr) const {
+    return const_cast<MachineInstr *>(this)->
+      findRegisterUseOperand(Reg, isKill, TRI);
+  }
+
+
+
+
+
+
+
+  int findRegisterDefOperandIdx(unsigned Reg,
+                                bool isDead = false, bool Overlap = false,
+                                const TargetRegisterInfo *TRI = nullptr) const;
+
+
+
+  MachineOperand *findRegisterDefOperand(unsigned Reg, bool isDead = false,
+                                      const TargetRegisterInfo *TRI = nullptr) {
+    int Idx = findRegisterDefOperandIdx(Reg, isDead, false, TRI);
+    return (Idx == -1) ? nullptr : &getOperand(Idx);
+  }
+
+
+
+
+  int findFirstPredOperandIdx() const;
+  int findInlineAsmFlagIdx(unsigned OpIdx, unsigned *GroupNo = nullptr) const;
+
+
+
+
+
+
+
+  const TargetRegisterClass*
+  getRegClassConstraint(unsigned OpIdx,
+                        const TargetInstrInfo *TII,
+                        const TargetRegisterInfo *TRI) const;
+  const TargetRegisterClass *getRegClassConstraintEffectForVReg(
+      unsigned Reg, const TargetRegisterClass *CurRC,
+      const TargetInstrInfo *TII, const TargetRegisterInfo *TRI,
+      bool ExploreBundle = false) const;
+  const TargetRegisterClass *
+  getRegClassConstraintEffect(unsigned OpIdx, const TargetRegisterClass *CurRC,
+                              const TargetInstrInfo *TII,
+                              const TargetRegisterInfo *TRI) const;
+
+
+
+
+
+
+
+  void tieOperands(unsigned DefIdx, unsigned UseIdx);
+
+
+
+
+  unsigned findTiedOperandIdx(unsigned OpIdx) const;
+
+
+
+
+
+  bool isRegTiedToUseOperand(unsigned DefOpIdx,
+                             unsigned *UseOpIdx = nullptr) const {
+    const MachineOperand &MO = getOperand(DefOpIdx);
+    if (!MO.isReg() || !MO.isDef() || !MO.isTied())
+      return false;
+    if (UseOpIdx)
+      *UseOpIdx = findTiedOperandIdx(DefOpIdx);
+    return true;
+  }
+
+
+
+
+  bool isRegTiedToDefOperand(unsigned UseOpIdx,
+                             unsigned *DefOpIdx = nullptr) const {
+    const MachineOperand &MO = getOperand(UseOpIdx);
+    if (!MO.isReg() || !MO.isUse() || !MO.isTied())
+      return false;
+    if (DefOpIdx)
+      *DefOpIdx = findTiedOperandIdx(UseOpIdx);
+    return true;
+  }
+
+
+  void clearKillInfo();
+
+
+
+  void substituteRegister(unsigned FromReg, unsigned ToReg, unsigned SubIdx,
+                          const TargetRegisterInfo &RegInfo);
+
+
+
+
+
+  bool addRegisterKilled(unsigned IncomingReg,
+                         const TargetRegisterInfo *RegInfo,
+                         bool AddIfNotFound = false);
+
+
+
+  void clearRegisterKills(unsigned Reg, const TargetRegisterInfo *RegInfo);
+
+
+
+
+
+  bool addRegisterDead(unsigned Reg, const TargetRegisterInfo *RegInfo,
+                       bool AddIfNotFound = false);
+
+
+  void clearRegisterDeads(unsigned Reg);
+
+
+
+
+  void setRegisterDefReadUndef(unsigned Reg, bool IsUndef = true);
+
+
+
+  void addRegisterDefined(unsigned Reg,
+                          const TargetRegisterInfo *RegInfo = nullptr);
+
+
+
+
+
+
+  void setPhysRegsDeadExcept(ArrayRef<unsigned> UsedRegs,
+                             const TargetRegisterInfo &TRI);
+
+
+
+
+  bool isSafeToMove(AliasAnalysis *AA, bool &SawStore) const;
+  bool mayAlias(AliasAnalysis *AA, MachineInstr &Other, bool UseTBAA);
+
+
+
+
+
+  bool hasOrderedMemoryRef() const;
+  bool isDereferenceableInvariantLoad(AliasAnalysis *AA) const;
+
+
+
+  unsigned isConstantValuePHI() const;
+  bool hasUnmodeledSideEffects() const;
+
+
+  bool isLoadFoldBarrier() const;
+
+
+  bool allDefsAreDead() const;
+
+
+
+  void copyImplicitOps(MachineFunction &MF, const MachineInstr &MI);
+
+
+
+
+  LLT getTypeToPrint(unsigned OpIdx, SmallBitVector &PrintedTypes,
+                     const MachineRegisterInfo &MRI) const;
+
+
+
+
+  bool hasComplexRegisterTies() const;
+
+
+
+
+
+
+
+  void print(raw_ostream &OS, bool SkipOpers = false, bool SkipDebugLoc = false,
+             const TargetInstrInfo *TII = nullptr) const;
+  void print(raw_ostream &OS, ModuleSlotTracker &MST, bool SkipOpers = false,
+             bool SkipDebugLoc = false,
+             const TargetInstrInfo *TII = nullptr) const;
+  void dump() const;
+  void addOperand(MachineFunction &MF, const MachineOperand &Op);
+
+
+
+
+
+
+  void addOperand(const MachineOperand &Op);
+
+
+
+  void setDesc(const MCInstrDesc &tid) { MCID = &tid; }
+
+
+
+  void setDebugLoc(DebugLoc dl) {
+    debugLoc = std::move(dl);
+    
+   ((
+   debugLoc.hasTrivialDestructor() && "Expected trivial destructor"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "debugLoc.hasTrivialDestructor() && \"Expected trivial destructor\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineInstr.h", 1279, __PRETTY_FUNCTION__))
+                                                                           ;
+  }
+
+
+
+  void RemoveOperand(unsigned i);
+
+
+
+
+  void addMemOperand(MachineFunction &MF, MachineMemOperand *MO);
+
+
+
+  void setMemRefs(mmo_iterator NewMemRefs, mmo_iterator NewMemRefsEnd) {
+    setMemRefs(std::make_pair(NewMemRefs, NewMemRefsEnd-NewMemRefs));
+  }
+
+
+
+
+
+  void setMemRefs(std::pair<mmo_iterator, unsigned> NewMemRefs) {
+    MemRefs = NewMemRefs.first;
+    NumMemRefs = uint8_t(NewMemRefs.second);
+    
+   ((
+   NumMemRefs == NewMemRefs.second && "Too many memrefs - must drop memory operands"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "NumMemRefs == NewMemRefs.second && \"Too many memrefs - must drop memory operands\""
+   ,
+                                                         "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineInstr.h"
+    ,
+                                                         1305
+    , __PRETTY_FUNCTION__))
+                                                          
+                                                         ;
+  }
+
+
+
+
+
+  std::pair<mmo_iterator, unsigned> mergeMemRefsWith(const MachineInstr& Other);
+
+
+
+
+
+  void dropMemRefs() {
+    MemRefs = nullptr;
+    NumMemRefs = 0;
+  }
+
+
+  void untieRegOperand(unsigned OpIdx) {
+    MachineOperand &MO = getOperand(OpIdx);
+    if (MO.isReg() && MO.isTied()) {
+      getOperand(findTiedOperandIdx(OpIdx)).TiedTo = 0;
+      MO.TiedTo = 0;
+    }
+  }
+
+
+  void addImplicitDefUseOperands(MachineFunction &MF);
+
+private:
+
+
+
+  MachineRegisterInfo *getRegInfo();
+
+
+
+
+  void RemoveRegOperandsFromUseLists(MachineRegisterInfo&);
+
+
+
+
+  void AddRegOperandsToUseLists(MachineRegisterInfo&);
+
+
+  bool hasPropertyInBundle(unsigned Mask, QueryType Type) const;
+
+
+
+
+  const TargetRegisterClass *getRegClassConstraintEffectForVRegImpl(
+      unsigned OpIdx, unsigned Reg, const TargetRegisterClass *CurRC,
+      const TargetInstrInfo *TII, const TargetRegisterInfo *TRI) const;
+};
+
+
+
+
+
+struct MachineInstrExpressionTrait : DenseMapInfo<MachineInstr*> {
+  static inline MachineInstr *getEmptyKey() {
+    return nullptr;
+  }
+
+  static inline MachineInstr *getTombstoneKey() {
+    return reinterpret_cast<MachineInstr*>(-1);
+  }
+
+  static unsigned getHashValue(const MachineInstr* const &MI);
+
+  static bool isEqual(const MachineInstr* const &LHS,
+                      const MachineInstr* const &RHS) {
+    if (RHS == getEmptyKey() || RHS == getTombstoneKey() ||
+        LHS == getEmptyKey() || LHS == getTombstoneKey())
+      return LHS == RHS;
+    return LHS->isIdenticalTo(*RHS, MachineInstr::IgnoreVRegDefs);
+  }
+};
+
+
+
+
+inline raw_ostream& operator<<(raw_ostream &OS, const MachineInstr &MI) {
+  MI.print(OS);
+  return OS;
+}
+
+}
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+namespace llvm {
+
+template <class T, bool IsReverse> struct MachineInstrBundleIteratorTraits;
+template <class T> struct MachineInstrBundleIteratorTraits<T, false> {
+  using list_type = simple_ilist<T, ilist_sentinel_tracking<true>>;
+  using instr_iterator = typename list_type::iterator;
+  using nonconst_instr_iterator = typename list_type::iterator;
+  using const_instr_iterator = typename list_type::const_iterator;
+};
+template <class T> struct MachineInstrBundleIteratorTraits<T, true> {
+  using list_type = simple_ilist<T, ilist_sentinel_tracking<true>>;
+  using instr_iterator = typename list_type::reverse_iterator;
+  using nonconst_instr_iterator = typename list_type::reverse_iterator;
+  using const_instr_iterator = typename list_type::const_reverse_iterator;
+};
+template <class T> struct MachineInstrBundleIteratorTraits<const T, false> {
+  using list_type = simple_ilist<T, ilist_sentinel_tracking<true>>;
+  using instr_iterator = typename list_type::const_iterator;
+  using nonconst_instr_iterator = typename list_type::iterator;
+  using const_instr_iterator = typename list_type::const_iterator;
+};
+template <class T> struct MachineInstrBundleIteratorTraits<const T, true> {
+  using list_type = simple_ilist<T, ilist_sentinel_tracking<true>>;
+  using instr_iterator = typename list_type::const_reverse_iterator;
+  using nonconst_instr_iterator = typename list_type::reverse_iterator;
+  using const_instr_iterator = typename list_type::const_reverse_iterator;
+};
+
+template <bool IsReverse> struct MachineInstrBundleIteratorHelper;
+template <> struct MachineInstrBundleIteratorHelper<false> {
+
+  template <class Iterator> static Iterator getBundleBegin(Iterator I) {
+    if (!I.isEnd())
+      while (I->isBundledWithPred())
+        --I;
+    return I;
+  }
+
+
+  template <class Iterator> static Iterator getBundleFinal(Iterator I) {
+    if (!I.isEnd())
+      while (I->isBundledWithSucc())
+        ++I;
+    return I;
+  }
+
+
+  template <class Iterator> static void increment(Iterator &I) {
+    I = std::next(getBundleFinal(I));
+  }
+
+
+  template <class Iterator> static void decrement(Iterator &I) {
+    I = getBundleBegin(std::prev(I));
+  }
+};
+
+template <> struct MachineInstrBundleIteratorHelper<true> {
+
+  template <class Iterator> static Iterator getBundleBegin(Iterator I) {
+    return MachineInstrBundleIteratorHelper<false>::getBundleBegin(
+               I.getReverse())
+        .getReverse();
+  }
+
+
+  template <class Iterator> static Iterator getBundleFinal(Iterator I) {
+    return MachineInstrBundleIteratorHelper<false>::getBundleFinal(
+               I.getReverse())
+        .getReverse();
+  }
+
+
+  template <class Iterator> static void increment(Iterator &I) {
+    I = getBundleBegin(std::next(I));
+  }
+
+
+  template <class Iterator> static void decrement(Iterator &I) {
+    I = std::prev(getBundleFinal(I));
+  }
+};
+
+
+
+template <typename Ty, bool IsReverse = false>
+class MachineInstrBundleIterator : MachineInstrBundleIteratorHelper<IsReverse> {
+  using Traits = MachineInstrBundleIteratorTraits<Ty, IsReverse>;
+  using instr_iterator = typename Traits::instr_iterator;
+
+  instr_iterator MII;
+
+public:
+  using value_type = typename instr_iterator::value_type;
+  using difference_type = typename instr_iterator::difference_type;
+  using pointer = typename instr_iterator::pointer;
+  using reference = typename instr_iterator::reference;
+  using const_pointer = typename instr_iterator::const_pointer;
+  using const_reference = typename instr_iterator::const_reference;
+  using iterator_category = std::bidirectional_iterator_tag;
+
+private:
+  using nonconst_instr_iterator = typename Traits::nonconst_instr_iterator;
+  using const_instr_iterator = typename Traits::const_instr_iterator;
+  using nonconst_iterator =
+      MachineInstrBundleIterator<typename nonconst_instr_iterator::value_type,
+                                 IsReverse>;
+  using reverse_iterator = MachineInstrBundleIterator<Ty, !IsReverse>;
+
+public:
+  MachineInstrBundleIterator(instr_iterator MI) : MII(MI) {
+    
+   ((
+   (!MI.getNodePtr() || MI.isEnd() || !MI->isBundledWithPred()) && "It's not legal to initialize MachineInstrBundleIterator with a " "bundled MI"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "(!MI.getNodePtr() || MI.isEnd() || !MI->isBundledWithPred()) && \"It's not legal to initialize MachineInstrBundleIterator with a \" \"bundled MI\""
+   ,
+
+                       "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineInstrBundleIterator.h"
+    ,
+
+                       136
+    , __PRETTY_FUNCTION__))
+
+                        
+                       ;
+  }
+
+  MachineInstrBundleIterator(reference MI) : MII(MI) {
+    
+   ((
+   !MI.isBundledWithPred() && "It's not legal to initialize " "MachineInstrBundleIterator with a " "bundled MI"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!MI.isBundledWithPred() && \"It's not legal to initialize \" \"MachineInstrBundleIterator with a \" \"bundled MI\""
+   ,
+
+                                                  "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineInstrBundleIterator.h"
+    ,
+
+                                                  142
+    , __PRETTY_FUNCTION__))
+
+                                                   
+                                                  ;
+  }
+
+  MachineInstrBundleIterator(pointer MI) : MII(MI) {
+
+    
+   ((
+   (!MI || !MI->isBundledWithPred()) && "It's not legal to initialize " "MachineInstrBundleIterator " "with a bundled MI"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "(!MI || !MI->isBundledWithPred()) && \"It's not legal to initialize \" \"MachineInstrBundleIterator \" \"with a bundled MI\""
+   ,
+
+                                                                   "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineInstrBundleIterator.h"
+    ,
+
+                                                                   149
+    , __PRETTY_FUNCTION__))
+
+                                                                    
+                                                                   ;
+  }
+
+
+  template <class OtherTy>
+  MachineInstrBundleIterator(
+      const MachineInstrBundleIterator<OtherTy, IsReverse> &I,
+      typename std::enable_if<std::is_convertible<OtherTy *, Ty *>::value,
+                              void *>::type = nullptr)
+      : MII(I.getInstrIterator()) {}
+
+  MachineInstrBundleIterator() : MII(nullptr) {}
+  explicit MachineInstrBundleIterator(
+      const MachineInstrBundleIterator<Ty, !IsReverse> &I)
+      : MachineInstrBundleIterator(++I.getReverse()) {}
+
+
+  static MachineInstrBundleIterator getAtBundleBegin(instr_iterator MI) {
+    return MachineInstrBundleIteratorHelper<IsReverse>::getBundleBegin(MI);
+  }
+
+  reference operator*() const { return *MII; }
+  pointer operator->() const { return &operator*(); }
+
+
+  bool isValid() const { return MII.getNodePtr(); }
+
+  friend bool operator==(const MachineInstrBundleIterator &L,
+                         const MachineInstrBundleIterator &R) {
+    return L.MII == R.MII;
+  }
+  friend bool operator==(const MachineInstrBundleIterator &L,
+                         const const_instr_iterator &R) {
+    return L.MII == R;
+  }
+  friend bool operator==(const const_instr_iterator &L,
+                         const MachineInstrBundleIterator &R) {
+    return L == R.MII;
+  }
+  friend bool operator==(const MachineInstrBundleIterator &L,
+                         const nonconst_instr_iterator &R) {
+    return L.MII == R;
+  }
+  friend bool operator==(const nonconst_instr_iterator &L,
+                         const MachineInstrBundleIterator &R) {
+    return L == R.MII;
+  }
+  friend bool operator==(const MachineInstrBundleIterator &L, const_pointer R) {
+    return L == const_instr_iterator(R);
+  }
+  friend bool operator==(const_pointer L, const MachineInstrBundleIterator &R) {
+    return const_instr_iterator(L) == R;
+  }
+  friend bool operator==(const MachineInstrBundleIterator &L,
+                         const_reference R) {
+    return L == &R;
+  }
+  friend bool operator==(const_reference L,
+                         const MachineInstrBundleIterator &R) {
+    return &L == R;
+  }
+
+  friend bool operator!=(const MachineInstrBundleIterator &L,
+                         const MachineInstrBundleIterator &R) {
+    return !(L == R);
+  }
+  friend bool operator!=(const MachineInstrBundleIterator &L,
+                         const const_instr_iterator &R) {
+    return !(L == R);
+  }
+  friend bool operator!=(const const_instr_iterator &L,
+                         const MachineInstrBundleIterator &R) {
+    return !(L == R);
+  }
+  friend bool operator!=(const MachineInstrBundleIterator &L,
+                         const nonconst_instr_iterator &R) {
+    return !(L == R);
+  }
+  friend bool operator!=(const nonconst_instr_iterator &L,
+                         const MachineInstrBundleIterator &R) {
+    return !(L == R);
+  }
+  friend bool operator!=(const MachineInstrBundleIterator &L, const_pointer R) {
+    return !(L == R);
+  }
+  friend bool operator!=(const_pointer L, const MachineInstrBundleIterator &R) {
+    return !(L == R);
+  }
+  friend bool operator!=(const MachineInstrBundleIterator &L,
+                         const_reference R) {
+    return !(L == R);
+  }
+  friend bool operator!=(const_reference L,
+                         const MachineInstrBundleIterator &R) {
+    return !(L == R);
+  }
+
+
+  MachineInstrBundleIterator &operator--() {
+    this->decrement(MII);
+    return *this;
+  }
+  MachineInstrBundleIterator &operator++() {
+    this->increment(MII);
+    return *this;
+  }
+  MachineInstrBundleIterator operator--(int) {
+    MachineInstrBundleIterator Temp = *this;
+    --*this;
+    return Temp;
+  }
+  MachineInstrBundleIterator operator++(int) {
+    MachineInstrBundleIterator Temp = *this;
+    ++*this;
+    return Temp;
+  }
+
+  instr_iterator getInstrIterator() const { return MII; }
+
+  nonconst_iterator getNonConstIterator() const { return MII.getNonConst(); }
+
+
+
+
+
+
+  reverse_iterator getReverse() const { return MII.getReverse(); }
+};
+
+}
+
+
+
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+       
+
+
+       
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+  template<typename _ForwardIterator, typename _Tp>
+    void
+    iota(_ForwardIterator __first, _ForwardIterator __last, _Tp __value)
+    {
+
+     
+
+     
+
+      ;
+
+      for (; __first != __last; ++__first)
+ {
+   *__first = __value;
+   ++__value;
+ }
+    }
+
+
+}
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+  template<typename _InputIterator, typename _Tp>
+    inline _Tp
+    accumulate(_InputIterator __first, _InputIterator __last, _Tp __init)
+    {
+
+     
+      ;
+
+      for (; __first != __last; ++__first)
+ __init = __init + *__first;
+      return __init;
+    }
+  template<typename _InputIterator, typename _Tp, typename _BinaryOperation>
+    inline _Tp
+    accumulate(_InputIterator __first, _InputIterator __last, _Tp __init,
+        _BinaryOperation __binary_op)
+    {
+
+     
+      ;
+
+      for (; __first != __last; ++__first)
+ __init = __binary_op(__init, *__first);
+      return __init;
+    }
+  template<typename _InputIterator1, typename _InputIterator2, typename _Tp>
+    inline _Tp
+    inner_product(_InputIterator1 __first1, _InputIterator1 __last1,
+    _InputIterator2 __first2, _Tp __init)
+    {
+
+     
+     
+      ;
+
+      for (; __first1 != __last1; ++__first1, (void)++__first2)
+ __init = __init + (*__first1 * *__first2);
+      return __init;
+    }
+  template<typename _InputIterator1, typename _InputIterator2, typename _Tp,
+    typename _BinaryOperation1, typename _BinaryOperation2>
+    inline _Tp
+    inner_product(_InputIterator1 __first1, _InputIterator1 __last1,
+    _InputIterator2 __first2, _Tp __init,
+    _BinaryOperation1 __binary_op1,
+    _BinaryOperation2 __binary_op2)
+    {
+
+     
+     
+      ;
+
+      for (; __first1 != __last1; ++__first1, (void)++__first2)
+ __init = __binary_op1(__init, __binary_op2(*__first1, *__first2));
+      return __init;
+    }
+  template<typename _InputIterator, typename _OutputIterator>
+    _OutputIterator
+    partial_sum(_InputIterator __first, _InputIterator __last,
+  _OutputIterator __result)
+    {
+      typedef typename iterator_traits<_InputIterator>::value_type _ValueType;
+
+
+     
+     
+
+      ;
+
+      if (__first == __last)
+ return __result;
+      _ValueType __value = *__first;
+      *__result = __value;
+      while (++__first != __last)
+ {
+   __value = __value + *__first;
+   *++__result = __value;
+ }
+      return ++__result;
+    }
+  template<typename _InputIterator, typename _OutputIterator,
+    typename _BinaryOperation>
+    _OutputIterator
+    partial_sum(_InputIterator __first, _InputIterator __last,
+  _OutputIterator __result, _BinaryOperation __binary_op)
+    {
+      typedef typename iterator_traits<_InputIterator>::value_type _ValueType;
+
+
+     
+     
+
+      ;
+
+      if (__first == __last)
+ return __result;
+      _ValueType __value = *__first;
+      *__result = __value;
+      while (++__first != __last)
+ {
+   __value = __binary_op(__value, *__first);
+   *++__result = __value;
+ }
+      return ++__result;
+    }
+  template<typename _InputIterator, typename _OutputIterator>
+    _OutputIterator
+    adjacent_difference(_InputIterator __first,
+   _InputIterator __last, _OutputIterator __result)
+    {
+      typedef typename iterator_traits<_InputIterator>::value_type _ValueType;
+
+
+     
+     
+
+      ;
+
+      if (__first == __last)
+ return __result;
+      _ValueType __value = *__first;
+      *__result = __value;
+      while (++__first != __last)
+ {
+   _ValueType __tmp = *__first;
+   *++__result = __tmp - __value;
+   __value = std::move(__tmp);
+ }
+      return ++__result;
+    }
+  template<typename _InputIterator, typename _OutputIterator,
+    typename _BinaryOperation>
+    _OutputIterator
+    adjacent_difference(_InputIterator __first, _InputIterator __last,
+   _OutputIterator __result, _BinaryOperation __binary_op)
+    {
+      typedef typename iterator_traits<_InputIterator>::value_type _ValueType;
+
+
+     
+     
+
+      ;
+
+      if (__first == __last)
+ return __result;
+      _ValueType __value = *__first;
+      *__result = __value;
+      while (++__first != __last)
+ {
+   _ValueType __tmp = *__first;
+   *++__result = __binary_op(__tmp, __value);
+   __value = std::move(__tmp);
+ }
+      return ++__result;
+    }
+
+
+}
+
+
+namespace llvm {
+
+class raw_ostream;
+
+
+
+
+
+class BranchProbability {
+
+  uint32_t N;
+
+
+  static const uint32_t D = 1u << 31;
+  static const uint32_t UnknownN = 
+                                  (4294967295U)
+                                            ;
+
+
+
+  explicit BranchProbability(uint32_t n) : N(n) {}
+
+public:
+  BranchProbability() : N(UnknownN) {}
+  BranchProbability(uint32_t Numerator, uint32_t Denominator);
+
+  bool isZero() const { return N == 0; }
+  bool isUnknown() const { return N == UnknownN; }
+
+  static BranchProbability getZero() { return BranchProbability(0); }
+  static BranchProbability getOne() { return BranchProbability(D); }
+  static BranchProbability getUnknown() { return BranchProbability(UnknownN); }
+
+
+  static BranchProbability getRaw(uint32_t N) { return BranchProbability(N); }
+
+  static BranchProbability getBranchProbability(uint64_t Numerator,
+                                                uint64_t Denominator);
+
+
+
+  template <class ProbabilityIter>
+  static void normalizeProbabilities(ProbabilityIter Begin,
+                                     ProbabilityIter End);
+
+  uint32_t getNumerator() const { return N; }
+  static uint32_t getDenominator() { return D; }
+
+
+  BranchProbability getCompl() const { return BranchProbability(D - N); }
+
+  raw_ostream &print(raw_ostream &OS) const;
+
+  void dump() const;
+
+
+
+
+
+
+
+  uint64_t scale(uint64_t Num) const;
+
+
+
+
+
+
+
+  uint64_t scaleByInverse(uint64_t Num) const;
+
+  BranchProbability &operator+=(BranchProbability RHS) {
+    
+   ((
+   N != UnknownN && RHS.N != UnknownN && "Unknown probability cannot participate in arithmetics."
+   ) ? static_cast<void> (0) : __assert_fail (
+   "N != UnknownN && RHS.N != UnknownN && \"Unknown probability cannot participate in arithmetics.\""
+   ,
+                                                                   "/home/trippels/llvm/llvm/include/llvm/Support/BranchProbability.h"
+    ,
+                                                                   94
+    , __PRETTY_FUNCTION__))
+                                                                    
+                                                                   ;
+
+    N = (uint64_t(N) + RHS.N > D) ? D : N + RHS.N;
+    return *this;
+  }
+
+  BranchProbability &operator-=(BranchProbability RHS) {
+    
+   ((
+   N != UnknownN && RHS.N != UnknownN && "Unknown probability cannot participate in arithmetics."
+   ) ? static_cast<void> (0) : __assert_fail (
+   "N != UnknownN && RHS.N != UnknownN && \"Unknown probability cannot participate in arithmetics.\""
+   ,
+                                                                   "/home/trippels/llvm/llvm/include/llvm/Support/BranchProbability.h"
+    ,
+                                                                   102
+    , __PRETTY_FUNCTION__))
+                                                                    
+                                                                   ;
+
+    N = N < RHS.N ? 0 : N - RHS.N;
+    return *this;
+  }
+
+  BranchProbability &operator*=(BranchProbability RHS) {
+    
+   ((
+   N != UnknownN && RHS.N != UnknownN && "Unknown probability cannot participate in arithmetics."
+   ) ? static_cast<void> (0) : __assert_fail (
+   "N != UnknownN && RHS.N != UnknownN && \"Unknown probability cannot participate in arithmetics.\""
+   ,
+                                                                   "/home/trippels/llvm/llvm/include/llvm/Support/BranchProbability.h"
+    ,
+                                                                   110
+    , __PRETTY_FUNCTION__))
+                                                                    
+                                                                   ;
+    N = (static_cast<uint64_t>(N) * RHS.N + D / 2) / D;
+    return *this;
+  }
+
+  BranchProbability &operator*=(uint32_t RHS) {
+    
+   ((
+   N != UnknownN && "Unknown probability cannot participate in arithmetics."
+   ) ? static_cast<void> (0) : __assert_fail (
+   "N != UnknownN && \"Unknown probability cannot participate in arithmetics.\""
+   ,
+                                                                   "/home/trippels/llvm/llvm/include/llvm/Support/BranchProbability.h"
+    ,
+                                                                   117
+    , __PRETTY_FUNCTION__))
+                                                                    
+                                                                   ;
+    N = (uint64_t(N) * RHS > D) ? D : N * RHS;
+    return *this;
+  }
+
+  BranchProbability &operator/=(uint32_t RHS) {
+    
+   ((
+   N != UnknownN && "Unknown probability cannot participate in arithmetics."
+   ) ? static_cast<void> (0) : __assert_fail (
+   "N != UnknownN && \"Unknown probability cannot participate in arithmetics.\""
+   ,
+                                                                   "/home/trippels/llvm/llvm/include/llvm/Support/BranchProbability.h"
+    ,
+                                                                   124
+    , __PRETTY_FUNCTION__))
+                                                                    
+                                                                   ;
+    
+   ((
+   RHS > 0 && "The divider cannot be zero."
+   ) ? static_cast<void> (0) : __assert_fail (
+   "RHS > 0 && \"The divider cannot be zero.\""
+   , "/home/trippels/llvm/llvm/include/llvm/Support/BranchProbability.h", 125, __PRETTY_FUNCTION__))
+                                                   ;
+    N /= RHS;
+    return *this;
+  }
+
+  BranchProbability operator+(BranchProbability RHS) const {
+    BranchProbability Prob(*this);
+    return Prob += RHS;
+  }
+
+  BranchProbability operator-(BranchProbability RHS) const {
+    BranchProbability Prob(*this);
+    return Prob -= RHS;
+  }
+
+  BranchProbability operator*(BranchProbability RHS) const {
+    BranchProbability Prob(*this);
+    return Prob *= RHS;
+  }
+
+  BranchProbability operator*(uint32_t RHS) const {
+    BranchProbability Prob(*this);
+    return Prob *= RHS;
+  }
+
+  BranchProbability operator/(uint32_t RHS) const {
+    BranchProbability Prob(*this);
+    return Prob /= RHS;
+  }
+
+  bool operator==(BranchProbability RHS) const { return N == RHS.N; }
+  bool operator!=(BranchProbability RHS) const { return !(*this == RHS); }
+
+  bool operator<(BranchProbability RHS) const {
+    
+   ((
+   N != UnknownN && RHS.N != UnknownN && "Unknown probability cannot participate in comparisons."
+   ) ? static_cast<void> (0) : __assert_fail (
+   "N != UnknownN && RHS.N != UnknownN && \"Unknown probability cannot participate in comparisons.\""
+   ,
+                                                                   "/home/trippels/llvm/llvm/include/llvm/Support/BranchProbability.h"
+    ,
+                                                                   160
+    , __PRETTY_FUNCTION__))
+                                                                    
+                                                                   ;
+    return N < RHS.N;
+  }
+
+  bool operator>(BranchProbability RHS) const {
+    
+   ((
+   N != UnknownN && RHS.N != UnknownN && "Unknown probability cannot participate in comparisons."
+   ) ? static_cast<void> (0) : __assert_fail (
+   "N != UnknownN && RHS.N != UnknownN && \"Unknown probability cannot participate in comparisons.\""
+   ,
+                                                                   "/home/trippels/llvm/llvm/include/llvm/Support/BranchProbability.h"
+    ,
+                                                                   166
+    , __PRETTY_FUNCTION__))
+                                                                    
+                                                                   ;
+    return RHS < *this;
+  }
+
+  bool operator<=(BranchProbability RHS) const {
+    
+   ((
+   N != UnknownN && RHS.N != UnknownN && "Unknown probability cannot participate in comparisons."
+   ) ? static_cast<void> (0) : __assert_fail (
+   "N != UnknownN && RHS.N != UnknownN && \"Unknown probability cannot participate in comparisons.\""
+   ,
+                                                                   "/home/trippels/llvm/llvm/include/llvm/Support/BranchProbability.h"
+    ,
+                                                                   172
+    , __PRETTY_FUNCTION__))
+                                                                    
+                                                                   ;
+    return !(RHS < *this);
+  }
+
+  bool operator>=(BranchProbability RHS) const {
+    
+   ((
+   N != UnknownN && RHS.N != UnknownN && "Unknown probability cannot participate in comparisons."
+   ) ? static_cast<void> (0) : __assert_fail (
+   "N != UnknownN && RHS.N != UnknownN && \"Unknown probability cannot participate in comparisons.\""
+   ,
+                                                                   "/home/trippels/llvm/llvm/include/llvm/Support/BranchProbability.h"
+    ,
+                                                                   178
+    , __PRETTY_FUNCTION__))
+                                                                    
+                                                                   ;
+    return !(*this < RHS);
+  }
+};
+
+inline raw_ostream &operator<<(raw_ostream &OS, BranchProbability Prob) {
+  return Prob.print(OS);
+}
+
+template <class ProbabilityIter>
+void BranchProbability::normalizeProbabilities(ProbabilityIter Begin,
+                                               ProbabilityIter End) {
+  if (Begin == End)
+    return;
+
+  unsigned UnknownProbCount = 0;
+  uint64_t Sum = std::accumulate(Begin, End, uint64_t(0),
+                                 [&](uint64_t S, const BranchProbability &BP) {
+                                   if (!BP.isUnknown())
+                                     return S + BP.N;
+                                   UnknownProbCount++;
+                                   return S;
+                                 });
+
+  if (UnknownProbCount > 0) {
+    BranchProbability ProbForUnknown = BranchProbability::getZero();
+
+
+
+    if (Sum < BranchProbability::getDenominator())
+      ProbForUnknown = BranchProbability::getRaw(
+          (BranchProbability::getDenominator() - Sum) / UnknownProbCount);
+
+    std::replace_if(Begin, End,
+                    [](const BranchProbability &BP) { return BP.isUnknown(); },
+                    ProbForUnknown);
+
+    if (Sum <= BranchProbability::getDenominator())
+      return;
+  }
+
+  if (Sum == 0) {
+    BranchProbability BP(1, std::distance(Begin, End));
+    std::fill(Begin, End, BP);
+    return;
+  }
+
+  for (auto I = Begin; I != End; ++I)
+    I->N = (I->N * uint64_t(D) + Sum / 2) / Sum;
+}
+
+}
+
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+
+
+
+namespace llvm {
+
+class BasicBlock;
+class MachineFunction;
+class MCSymbol;
+class ModuleSlotTracker;
+class Pass;
+class SlotIndexes;
+class StringRef;
+class raw_ostream;
+class TargetRegisterClass;
+class TargetRegisterInfo;
+
+template <> struct ilist_traits<MachineInstr> {
+private:
+  friend class MachineBasicBlock;
+
+  MachineBasicBlock *Parent;
+
+  using instr_iterator =
+      simple_ilist<MachineInstr, ilist_sentinel_tracking<true>>::iterator;
+
+public:
+  void addNodeToList(MachineInstr *N);
+  void removeNodeFromList(MachineInstr *N);
+  void transferNodesFromList(ilist_traits &OldList, instr_iterator First,
+                             instr_iterator Last);
+  void deleteNode(MachineInstr *MI);
+};
+
+class MachineBasicBlock
+    : public ilist_node_with_parent<MachineBasicBlock, MachineFunction> {
+public:
+
+
+
+  struct RegisterMaskPair {
+  public:
+    MCPhysReg PhysReg;
+    LaneBitmask LaneMask;
+
+    RegisterMaskPair(MCPhysReg PhysReg, LaneBitmask LaneMask)
+        : PhysReg(PhysReg), LaneMask(LaneMask) {}
+  };
+
+private:
+  using Instructions = ilist<MachineInstr, ilist_sentinel_tracking<true>>;
+
+  Instructions Insts;
+  const BasicBlock *BB;
+  int Number;
+  MachineFunction *xParent;
+
+
+  std::vector<MachineBasicBlock *> Predecessors;
+  std::vector<MachineBasicBlock *> Successors;
+
+
+
+
+  std::vector<BranchProbability> Probs;
+  using probability_iterator = std::vector<BranchProbability>::iterator;
+  using const_probability_iterator =
+      std::vector<BranchProbability>::const_iterator;
+
+  Optional<uint64_t> IrrLoopHeaderWeight;
+
+
+  using LiveInVector = std::vector<RegisterMaskPair>;
+  LiveInVector LiveIns;
+
+
+
+  unsigned Alignment = 0;
+
+
+  bool IsEHPad = false;
+
+
+
+  bool AddressTaken = false;
+
+
+  bool IsEHFuncletEntry = false;
+
+
+  bool IsCleanupFuncletEntry = false;
+
+
+
+  mutable MCSymbol *CachedMCSymbol = nullptr;
+
+
+  MachineBasicBlock() = default;
+
+  explicit MachineBasicBlock(MachineFunction &MF, const BasicBlock *BB);
+
+  ~MachineBasicBlock();
+
+
+  friend class MachineFunction;
+
+public:
+
+
+
+  const BasicBlock *getBasicBlock() const { return BB; }
+
+
+  StringRef getName() const;
+
+
+  std::string getFullName() const;
+
+
+  bool hasAddressTaken() const { return AddressTaken; }
+
+
+
+  void setHasAddressTaken() { AddressTaken = true; }
+
+
+  const MachineFunction *getParent() const { return xParent; }
+  MachineFunction *getParent() { return xParent; }
+
+  using instr_iterator = Instructions::iterator;
+  using const_instr_iterator = Instructions::const_iterator;
+  using reverse_instr_iterator = Instructions::reverse_iterator;
+  using const_reverse_instr_iterator = Instructions::const_reverse_iterator;
+
+  using iterator = MachineInstrBundleIterator<MachineInstr>;
+  using const_iterator = MachineInstrBundleIterator<const MachineInstr>;
+  using reverse_iterator = MachineInstrBundleIterator<MachineInstr, true>;
+  using const_reverse_iterator =
+      MachineInstrBundleIterator<const MachineInstr, true>;
+
+  unsigned size() const { return (unsigned)Insts.size(); }
+  bool empty() const { return Insts.empty(); }
+
+  MachineInstr &instr_front() { return Insts.front(); }
+  MachineInstr &instr_back() { return Insts.back(); }
+  const MachineInstr &instr_front() const { return Insts.front(); }
+  const MachineInstr &instr_back() const { return Insts.back(); }
+
+  MachineInstr &front() { return Insts.front(); }
+  MachineInstr &back() { return *--end(); }
+  const MachineInstr &front() const { return Insts.front(); }
+  const MachineInstr &back() const { return *--end(); }
+
+  instr_iterator instr_begin() { return Insts.begin(); }
+  const_instr_iterator instr_begin() const { return Insts.begin(); }
+  instr_iterator instr_end() { return Insts.end(); }
+  const_instr_iterator instr_end() const { return Insts.end(); }
+  reverse_instr_iterator instr_rbegin() { return Insts.rbegin(); }
+  const_reverse_instr_iterator instr_rbegin() const { return Insts.rbegin(); }
+  reverse_instr_iterator instr_rend () { return Insts.rend(); }
+  const_reverse_instr_iterator instr_rend () const { return Insts.rend(); }
+
+  using instr_range = iterator_range<instr_iterator>;
+  using const_instr_range = iterator_range<const_instr_iterator>;
+  instr_range instrs() { return instr_range(instr_begin(), instr_end()); }
+  const_instr_range instrs() const {
+    return const_instr_range(instr_begin(), instr_end());
+  }
+
+  iterator begin() { return instr_begin(); }
+  const_iterator begin() const { return instr_begin(); }
+  iterator end () { return instr_end(); }
+  const_iterator end () const { return instr_end(); }
+  reverse_iterator rbegin() {
+    return reverse_iterator::getAtBundleBegin(instr_rbegin());
+  }
+  const_reverse_iterator rbegin() const {
+    return const_reverse_iterator::getAtBundleBegin(instr_rbegin());
+  }
+  reverse_iterator rend() { return reverse_iterator(instr_rend()); }
+  const_reverse_iterator rend() const {
+    return const_reverse_iterator(instr_rend());
+  }
+
+
+  static Instructions MachineBasicBlock::*getSublistAccess(MachineInstr *) {
+    return &MachineBasicBlock::Insts;
+  }
+
+  inline iterator_range<iterator> terminators() {
+    return make_range(getFirstTerminator(), end());
+  }
+  inline iterator_range<const_iterator> terminators() const {
+    return make_range(getFirstTerminator(), end());
+  }
+
+
+  inline iterator_range<iterator> phis() {
+    return make_range(begin(), getFirstNonPHI());
+  }
+  inline iterator_range<const_iterator> phis() const {
+    return const_cast<MachineBasicBlock *>(this)->phis();
+  }
+
+
+  using pred_iterator = std::vector<MachineBasicBlock *>::iterator;
+  using const_pred_iterator = std::vector<MachineBasicBlock *>::const_iterator;
+  using succ_iterator = std::vector<MachineBasicBlock *>::iterator;
+  using const_succ_iterator = std::vector<MachineBasicBlock *>::const_iterator;
+  using pred_reverse_iterator =
+      std::vector<MachineBasicBlock *>::reverse_iterator;
+  using const_pred_reverse_iterator =
+      std::vector<MachineBasicBlock *>::const_reverse_iterator;
+  using succ_reverse_iterator =
+      std::vector<MachineBasicBlock *>::reverse_iterator;
+  using const_succ_reverse_iterator =
+      std::vector<MachineBasicBlock *>::const_reverse_iterator;
+  pred_iterator pred_begin() { return Predecessors.begin(); }
+  const_pred_iterator pred_begin() const { return Predecessors.begin(); }
+  pred_iterator pred_end() { return Predecessors.end(); }
+  const_pred_iterator pred_end() const { return Predecessors.end(); }
+  pred_reverse_iterator pred_rbegin()
+                                          { return Predecessors.rbegin();}
+  const_pred_reverse_iterator pred_rbegin() const
+                                          { return Predecessors.rbegin();}
+  pred_reverse_iterator pred_rend()
+                                          { return Predecessors.rend(); }
+  const_pred_reverse_iterator pred_rend() const
+                                          { return Predecessors.rend(); }
+  unsigned pred_size() const {
+    return (unsigned)Predecessors.size();
+  }
+  bool pred_empty() const { return Predecessors.empty(); }
+  succ_iterator succ_begin() { return Successors.begin(); }
+  const_succ_iterator succ_begin() const { return Successors.begin(); }
+  succ_iterator succ_end() { return Successors.end(); }
+  const_succ_iterator succ_end() const { return Successors.end(); }
+  succ_reverse_iterator succ_rbegin()
+                                          { return Successors.rbegin(); }
+  const_succ_reverse_iterator succ_rbegin() const
+                                          { return Successors.rbegin(); }
+  succ_reverse_iterator succ_rend()
+                                          { return Successors.rend(); }
+  const_succ_reverse_iterator succ_rend() const
+                                          { return Successors.rend(); }
+  unsigned succ_size() const {
+    return (unsigned)Successors.size();
+  }
+  bool succ_empty() const { return Successors.empty(); }
+
+  inline iterator_range<pred_iterator> predecessors() {
+    return make_range(pred_begin(), pred_end());
+  }
+  inline iterator_range<const_pred_iterator> predecessors() const {
+    return make_range(pred_begin(), pred_end());
+  }
+  inline iterator_range<succ_iterator> successors() {
+    return make_range(succ_begin(), succ_end());
+  }
+  inline iterator_range<const_succ_iterator> successors() const {
+    return make_range(succ_begin(), succ_end());
+  }
+
+
+
+
+
+
+  void addLiveIn(MCPhysReg PhysReg,
+                 LaneBitmask LaneMask = LaneBitmask::getAll()) {
+    LiveIns.push_back(RegisterMaskPair(PhysReg, LaneMask));
+  }
+  void addLiveIn(const RegisterMaskPair &RegMaskPair) {
+    LiveIns.push_back(RegMaskPair);
+  }
+
+
+
+
+  void sortUniqueLiveIns();
+
+
+  void clearLiveIns();
+
+
+
+
+  unsigned addLiveIn(MCPhysReg PhysReg, const TargetRegisterClass *RC);
+
+
+  void removeLiveIn(MCPhysReg Reg,
+                    LaneBitmask LaneMask = LaneBitmask::getAll());
+
+
+  bool isLiveIn(MCPhysReg Reg,
+                LaneBitmask LaneMask = LaneBitmask::getAll()) const;
+
+
+
+  using livein_iterator = LiveInVector::const_iterator;
+
+
+
+
+
+  livein_iterator livein_begin_dbg() const { return LiveIns.begin(); }
+  iterator_range<livein_iterator> liveins_dbg() const {
+    return make_range(livein_begin_dbg(), livein_end());
+  }
+
+  livein_iterator livein_begin() const;
+  livein_iterator livein_end() const { return LiveIns.end(); }
+  bool livein_empty() const { return LiveIns.empty(); }
+  iterator_range<livein_iterator> liveins() const {
+    return make_range(livein_begin(), livein_end());
+  }
+
+
+  livein_iterator removeLiveIn(livein_iterator I);
+
+
+
+  const uint32_t *getBeginClobberMask(const TargetRegisterInfo *TRI) const;
+
+
+
+  const uint32_t *getEndClobberMask(const TargetRegisterInfo *TRI) const;
+
+
+
+  unsigned getAlignment() const { return Alignment; }
+
+
+
+  void setAlignment(unsigned Align) { Alignment = Align; }
+
+
+
+  bool isEHPad() const { return IsEHPad; }
+
+
+
+  void setIsEHPad(bool V = true) { IsEHPad = V; }
+
+  bool hasEHPadSuccessor() const;
+
+
+  bool isEHFuncletEntry() const { return IsEHFuncletEntry; }
+
+
+  void setIsEHFuncletEntry(bool V = true) { IsEHFuncletEntry = V; }
+
+
+  bool isCleanupFuncletEntry() const { return IsCleanupFuncletEntry; }
+
+
+  void setIsCleanupFuncletEntry(bool V = true) { IsCleanupFuncletEntry = V; }
+
+
+  bool isLegalToHoistInto() const;
+
+
+
+
+
+
+  void moveBefore(MachineBasicBlock *NewAfter);
+  void moveAfter(MachineBasicBlock *NewBefore);
+
+
+
+
+
+  void updateTerminator();
+  void addSuccessor(MachineBasicBlock *Succ,
+                    BranchProbability Prob = BranchProbability::getUnknown());
+
+
+
+
+
+  void addSuccessorWithoutProb(MachineBasicBlock *Succ);
+
+
+  void setSuccProbability(succ_iterator I, BranchProbability Prob);
+
+
+
+
+
+
+  void normalizeSuccProbs() {
+    BranchProbability::normalizeProbabilities(Probs.begin(), Probs.end());
+  }
+
+
+
+  void validateSuccProbs() const;
+
+
+
+
+
+  void removeSuccessor(MachineBasicBlock *Succ,
+                       bool NormalizeSuccProbs = false);
+
+
+
+
+
+
+  succ_iterator removeSuccessor(succ_iterator I,
+                                bool NormalizeSuccProbs = false);
+
+
+  void replaceSuccessor(MachineBasicBlock *Old, MachineBasicBlock *New);
+
+
+
+
+  void transferSuccessors(MachineBasicBlock *FromMBB);
+
+
+
+  void transferSuccessorsAndUpdatePHIs(MachineBasicBlock *FromMBB);
+
+
+  bool hasSuccessorProbabilities() const { return !Probs.empty(); }
+
+
+  bool isPredecessor(const MachineBasicBlock *MBB) const;
+
+
+  bool isSuccessor(const MachineBasicBlock *MBB) const;
+
+
+
+
+
+
+  bool isLayoutSuccessor(const MachineBasicBlock *MBB) const;
+
+
+
+
+
+
+  MachineBasicBlock *getFallThrough();
+
+
+
+
+
+
+  bool canFallThrough();
+
+
+
+
+
+
+  iterator getFirstNonPHI();
+
+
+
+
+  iterator SkipPHIsAndLabels(iterator I);
+
+
+
+
+  iterator SkipPHIsLabelsAndDebug(iterator I);
+
+
+
+  iterator getFirstTerminator();
+  const_iterator getFirstTerminator() const {
+    return const_cast<MachineBasicBlock *>(this)->getFirstTerminator();
+  }
+
+
+
+  instr_iterator getFirstInstrTerminator();
+
+
+
+  iterator getFirstNonDebugInstr();
+  const_iterator getFirstNonDebugInstr() const {
+    return const_cast<MachineBasicBlock *>(this)->getFirstNonDebugInstr();
+  }
+
+
+
+  iterator getLastNonDebugInstr();
+  const_iterator getLastNonDebugInstr() const {
+    return const_cast<MachineBasicBlock *>(this)->getLastNonDebugInstr();
+  }
+
+
+
+  bool isReturnBlock() const {
+    return !empty() && back().isReturn();
+  }
+
+
+
+
+
+
+  MachineBasicBlock *SplitCriticalEdge(MachineBasicBlock *Succ, Pass &P);
+
+
+
+
+
+  bool canSplitCriticalEdge(const MachineBasicBlock *Succ) const;
+
+  void pop_front() { Insts.pop_front(); }
+  void pop_back() { Insts.pop_back(); }
+  void push_back(MachineInstr *MI) { Insts.push_back(MI); }
+
+
+
+
+
+
+
+  instr_iterator insert(instr_iterator I, MachineInstr *M);
+
+
+  template<typename IT>
+  void insert(iterator I, IT S, IT E) {
+    
+   ((
+   (I == end() || I->getParent() == this) && "iterator points outside of basic block"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "(I == end() || I->getParent() == this) && \"iterator points outside of basic block\""
+   ,
+                                                   "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineBasicBlock.h"
+    ,
+                                                   576
+    , __PRETTY_FUNCTION__))
+                                                    
+                                                   ;
+    Insts.insert(I.getInstrIterator(), S, E);
+  }
+
+
+  iterator insert(iterator I, MachineInstr *MI) {
+    
+   ((
+   (I == end() || I->getParent() == this) && "iterator points outside of basic block"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "(I == end() || I->getParent() == this) && \"iterator points outside of basic block\""
+   ,
+                                                   "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineBasicBlock.h"
+    ,
+                                                   583
+    , __PRETTY_FUNCTION__))
+                                                    
+                                                   ;
+    
+   ((
+   !MI->isBundledWithPred() && !MI->isBundledWithSucc() && "Cannot insert instruction with bundle flags"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!MI->isBundledWithPred() && !MI->isBundledWithSucc() && \"Cannot insert instruction with bundle flags\""
+   ,
+                                                        "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineBasicBlock.h"
+    ,
+                                                        585
+    , __PRETTY_FUNCTION__))
+                                                         
+                                                        ;
+    return Insts.insert(I.getInstrIterator(), MI);
+  }
+
+
+  iterator insertAfter(iterator I, MachineInstr *MI) {
+    
+   ((
+   (I == end() || I->getParent() == this) && "iterator points outside of basic block"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "(I == end() || I->getParent() == this) && \"iterator points outside of basic block\""
+   ,
+                                                   "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineBasicBlock.h"
+    ,
+                                                   592
+    , __PRETTY_FUNCTION__))
+                                                    
+                                                   ;
+    
+   ((
+   !MI->isBundledWithPred() && !MI->isBundledWithSucc() && "Cannot insert instruction with bundle flags"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!MI->isBundledWithPred() && !MI->isBundledWithSucc() && \"Cannot insert instruction with bundle flags\""
+   ,
+                                                        "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineBasicBlock.h"
+    ,
+                                                        594
+    , __PRETTY_FUNCTION__))
+                                                         
+                                                        ;
+    return Insts.insertAfter(I.getInstrIterator(), MI);
+  }
+
+
+
+
+
+  instr_iterator erase(instr_iterator I);
+
+
+
+
+
+  instr_iterator erase_instr(MachineInstr *I) {
+    return erase(instr_iterator(I));
+  }
+
+
+  iterator erase(iterator I, iterator E) {
+    return Insts.erase(I.getInstrIterator(), E.getInstrIterator());
+  }
+
+
+
+
+  iterator erase(iterator I) {
+    return erase(I, std::next(I));
+  }
+
+
+
+
+
+  iterator erase(MachineInstr *I) {
+    return erase(iterator(I));
+  }
+
+
+
+
+
+
+  MachineInstr *remove(MachineInstr *I) {
+    
+   ((
+   !I->isBundled() && "Cannot remove bundled instructions"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!I->isBundled() && \"Cannot remove bundled instructions\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineBasicBlock.h", 638, __PRETTY_FUNCTION__))
+                                                                  ;
+    return Insts.remove(instr_iterator(I));
+  }
+
+
+
+
+
+
+  MachineInstr *remove_instr(MachineInstr *I);
+
+  void clear() {
+    Insts.clear();
+  }
+
+
+
+
+
+  void splice(iterator Where, MachineBasicBlock *Other, iterator From) {
+
+    if (Where != From)
+      splice(Where, Other, From, std::next(From));
+  }
+
+
+
+
+
+
+  void splice(iterator Where, MachineBasicBlock *Other,
+              iterator From, iterator To) {
+    Insts.splice(Where.getInstrIterator(), Other->Insts,
+                 From.getInstrIterator(), To.getInstrIterator());
+  }
+
+
+
+  MachineBasicBlock *removeFromParent();
+
+
+  void eraseFromParent();
+
+
+
+  void ReplaceUsesOfBlockWith(MachineBasicBlock *Old, MachineBasicBlock *New);
+
+
+
+
+
+
+
+  bool CorrectExtraCFGEdges(MachineBasicBlock *DestA,
+                            MachineBasicBlock *DestB,
+                            bool IsCond);
+
+
+
+  DebugLoc findDebugLoc(instr_iterator MBBI);
+  DebugLoc findDebugLoc(iterator MBBI) {
+    return findDebugLoc(MBBI.getInstrIterator());
+  }
+
+
+
+  DebugLoc findBranchDebugLoc();
+
+
+  enum LivenessQueryResult {
+    LQR_Live,
+    LQR_Dead,
+    LQR_Unknown
+  };
+  LivenessQueryResult computeRegisterLiveness(const TargetRegisterInfo *TRI,
+                                              unsigned Reg,
+                                              const_iterator Before,
+                                              unsigned Neighborhood = 10) const;
+
+
+  void dump() const;
+  void print(raw_ostream &OS, const SlotIndexes* = nullptr) const;
+  void print(raw_ostream &OS, ModuleSlotTracker &MST,
+             const SlotIndexes* = nullptr) const;
+
+
+  void printAsOperand(raw_ostream &OS, bool PrintType = true) const;
+
+
+
+  int getNumber() const { return Number; }
+  void setNumber(int N) { Number = N; }
+
+
+  MCSymbol *getSymbol() const;
+
+  Optional<uint64_t> getIrrLoopHeaderWeight() const {
+    return IrrLoopHeaderWeight;
+  }
+
+  void setIrrLoopHeaderWeight(uint64_t Weight) {
+    IrrLoopHeaderWeight = Weight;
+  }
+
+private:
+
+  probability_iterator getProbabilityIterator(succ_iterator I);
+  const_probability_iterator
+  getProbabilityIterator(const_succ_iterator I) const;
+
+  friend class MachineBranchProbabilityInfo;
+  friend class MIPrinter;
+
+
+
+
+  BranchProbability getSuccProbability(const_succ_iterator Succ) const;
+
+
+  friend struct ilist_callback_traits<MachineBasicBlock>;
+
+
+
+
+
+
+  void addPredecessor(MachineBasicBlock *Pred);
+
+
+
+
+  void removePredecessor(MachineBasicBlock *Pred);
+};
+
+raw_ostream& operator<<(raw_ostream &OS, const MachineBasicBlock &MBB);
+
+
+
+
+
+
+
+Printable printMBBReference(const MachineBasicBlock &MBB);
+
+
+struct MBB2NumberFunctor {
+  using argument_type = const MachineBasicBlock *;
+  unsigned operator()(const MachineBasicBlock *MBB) const {
+    return MBB->getNumber();
+  }
+};
+template <> struct GraphTraits<MachineBasicBlock *> {
+  using NodeRef = MachineBasicBlock *;
+  using ChildIteratorType = MachineBasicBlock::succ_iterator;
+
+  static NodeRef getEntryNode(MachineBasicBlock *BB) { return BB; }
+  static ChildIteratorType child_begin(NodeRef N) { return N->succ_begin(); }
+  static ChildIteratorType child_end(NodeRef N) { return N->succ_end(); }
+};
+
+template <> struct GraphTraits<const MachineBasicBlock *> {
+  using NodeRef = const MachineBasicBlock *;
+  using ChildIteratorType = MachineBasicBlock::const_succ_iterator;
+
+  static NodeRef getEntryNode(const MachineBasicBlock *BB) { return BB; }
+  static ChildIteratorType child_begin(NodeRef N) { return N->succ_begin(); }
+  static ChildIteratorType child_end(NodeRef N) { return N->succ_end(); }
+};
+
+
+
+
+
+
+
+template <> struct GraphTraits<Inverse<MachineBasicBlock*>> {
+  using NodeRef = MachineBasicBlock *;
+  using ChildIteratorType = MachineBasicBlock::pred_iterator;
+
+  static NodeRef getEntryNode(Inverse<MachineBasicBlock *> G) {
+    return G.Graph;
+  }
+
+  static ChildIteratorType child_begin(NodeRef N) { return N->pred_begin(); }
+  static ChildIteratorType child_end(NodeRef N) { return N->pred_end(); }
+};
+
+template <> struct GraphTraits<Inverse<const MachineBasicBlock*>> {
+  using NodeRef = const MachineBasicBlock *;
+  using ChildIteratorType = MachineBasicBlock::const_pred_iterator;
+
+  static NodeRef getEntryNode(Inverse<const MachineBasicBlock *> G) {
+    return G.Graph;
+  }
+
+  static ChildIteratorType child_begin(NodeRef N) { return N->pred_begin(); }
+  static ChildIteratorType child_end(NodeRef N) { return N->pred_end(); }
+};
+
+
+
+
+
+class MachineInstrSpan {
+  MachineBasicBlock &MBB;
+  MachineBasicBlock::iterator I, B, E;
+
+public:
+  MachineInstrSpan(MachineBasicBlock::iterator I)
+    : MBB(*I->getParent()),
+      I(I),
+      B(I == MBB.begin() ? MBB.end() : std::prev(I)),
+      E(std::next(I)) {}
+
+  MachineBasicBlock::iterator begin() {
+    return B == MBB.end() ? MBB.begin() : std::next(B);
+  }
+  MachineBasicBlock::iterator end() { return E; }
+  bool empty() { return begin() == end(); }
+
+  MachineBasicBlock::iterator getInitial() { return I; }
+};
+
+
+
+
+
+template<typename IterT>
+inline IterT skipDebugInstructionsForward(IterT It, IterT End) {
+  while (It != End && It->isDebugValue())
+    It++;
+  return It;
+}
+
+
+
+
+
+template<class IterT>
+inline IterT skipDebugInstructionsBackward(IterT It, IterT Begin) {
+  while (It != Begin && It->isDebugValue())
+    It--;
+  return It;
+}
+
+}
+
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+namespace llvm {
+
+
+
+template <typename E, typename Enable = void>
+struct is_bitmask_enum : std::false_type {};
+
+template <typename E>
+struct is_bitmask_enum<
+    E, typename std::enable_if<sizeof(E::LLVM_BITMASK_LARGEST_ENUMERATOR) >=
+                               0>::type> : std::true_type {};
+namespace BitmaskEnumDetail {
+
+
+
+template <typename E> typename std::underlying_type<E>::type Mask() {
+
+
+  return NextPowerOf2(static_cast<typename std::underlying_type<E>::type>(
+             E::LLVM_BITMASK_LARGEST_ENUMERATOR)) -
+         1;
+}
+
+
+
+template <typename E> typename std::underlying_type<E>::type Underlying(E Val) {
+  auto U = static_cast<typename std::underlying_type<E>::type>(Val);
+  
+ ((
+ U >= 0 && "Negative enum values are not allowed."
+ ) ? static_cast<void> (0) : __assert_fail (
+ "U >= 0 && \"Negative enum values are not allowed.\""
+ , "/home/trippels/llvm/llvm/include/llvm/ADT/BitmaskEnum.h", 93, __PRETTY_FUNCTION__))
+                                                          ;
+  
+ ((
+ U <= Mask<E>() && "Enum value too large (or largest val too small?)"
+ ) ? static_cast<void> (0) : __assert_fail (
+ "U <= Mask<E>() && \"Enum value too large (or largest val too small?)\""
+ , "/home/trippels/llvm/llvm/include/llvm/ADT/BitmaskEnum.h", 94, __PRETTY_FUNCTION__))
+                                                                             ;
+  return U;
+}
+
+template <typename E,
+          typename = typename std::enable_if<is_bitmask_enum<E>::value>::type>
+E operator~(E Val) {
+  return static_cast<E>(~Underlying(Val) & Mask<E>());
+}
+
+template <typename E,
+          typename = typename std::enable_if<is_bitmask_enum<E>::value>::type>
+E operator|(E LHS, E RHS) {
+  return static_cast<E>(Underlying(LHS) | Underlying(RHS));
+}
+
+template <typename E,
+          typename = typename std::enable_if<is_bitmask_enum<E>::value>::type>
+E operator&(E LHS, E RHS) {
+  return static_cast<E>(Underlying(LHS) & Underlying(RHS));
+}
+
+template <typename E,
+          typename = typename std::enable_if<is_bitmask_enum<E>::value>::type>
+E operator^(E LHS, E RHS) {
+  return static_cast<E>(Underlying(LHS) ^ Underlying(RHS));
+}
+
+
+
+
+template <typename E,
+          typename = typename std::enable_if<is_bitmask_enum<E>::value>::type>
+E &operator|=(E &LHS, E RHS) {
+  LHS = LHS | RHS;
+  return LHS;
+}
+
+template <typename E,
+          typename = typename std::enable_if<is_bitmask_enum<E>::value>::type>
+E &operator&=(E &LHS, E RHS) {
+  LHS = LHS & RHS;
+  return LHS;
+}
+
+template <typename E,
+          typename = typename std::enable_if<is_bitmask_enum<E>::value>::type>
+E &operator^=(E &LHS, E RHS) {
+  LHS = LHS ^ RHS;
+  return LHS;
+}
+
+}
+
+
+using ::llvm::BitmaskEnumDetail::operator~; using ::llvm::BitmaskEnumDetail::operator|; using ::llvm::BitmaskEnumDetail::operator&; using ::llvm::BitmaskEnumDetail::operator^; using ::llvm::BitmaskEnumDetail::operator|=; using ::llvm::BitmaskEnumDetail::operator&=; using ::llvm::BitmaskEnumDetail::operator^=;
+
+}
+
+namespace llvm {
+
+class MachineFrameInfo;
+class MachineMemOperand;
+class raw_ostream;
+class TargetInstrInfo;
+
+raw_ostream &operator<<(raw_ostream &OS, const MachineMemOperand &MMO);
+class PseudoSourceValue;
+raw_ostream &operator<<(raw_ostream &OS, const PseudoSourceValue* PSV);
+
+
+
+
+class PseudoSourceValue {
+public:
+  enum PSVKind {
+    Stack,
+    GOT,
+    JumpTable,
+    ConstantPool,
+    FixedStack,
+    GlobalValueCallEntry,
+    ExternalSymbolCallEntry,
+    TargetCustom
+  };
+
+private:
+  PSVKind Kind;
+  unsigned AddressSpace;
+  friend raw_ostream &llvm::operator<<(raw_ostream &OS,
+                                       const PseudoSourceValue* PSV);
+
+  friend class MachineMemOperand;
+
+
+
+  virtual void printCustom(raw_ostream &O) const;
+
+public:
+  explicit PseudoSourceValue(PSVKind Kind, const TargetInstrInfo &TII);
+
+  virtual ~PseudoSourceValue();
+
+  PSVKind kind() const { return Kind; }
+
+  bool isStack() const { return Kind == Stack; }
+  bool isGOT() const { return Kind == GOT; }
+  bool isConstantPool() const { return Kind == ConstantPool; }
+  bool isJumpTable() const { return Kind == JumpTable; }
+
+  unsigned getAddressSpace() const { return AddressSpace; }
+
+  unsigned getTargetCustom() const {
+    return (Kind >= TargetCustom) ? ((Kind+1) - TargetCustom) : 0;
+  }
+
+
+
+  virtual bool isConstant(const MachineFrameInfo *) const;
+
+
+
+  virtual bool isAliased(const MachineFrameInfo *) const;
+
+
+
+  virtual bool mayAlias(const MachineFrameInfo *) const;
+};
+
+
+
+class FixedStackPseudoSourceValue : public PseudoSourceValue {
+  const int FI;
+
+public:
+  explicit FixedStackPseudoSourceValue(int FI, const TargetInstrInfo &TII)
+      : PseudoSourceValue(FixedStack, TII), FI(FI) {}
+
+  static bool classof(const PseudoSourceValue *V) {
+    return V->kind() == FixedStack;
+  }
+
+  bool isConstant(const MachineFrameInfo *MFI) const override;
+
+  bool isAliased(const MachineFrameInfo *MFI) const override;
+
+  bool mayAlias(const MachineFrameInfo *) const override;
+
+  void printCustom(raw_ostream &OS) const override;
+
+  int getFrameIndex() const { return FI; }
+};
+
+class CallEntryPseudoSourceValue : public PseudoSourceValue {
+protected:
+  CallEntryPseudoSourceValue(PSVKind Kind, const TargetInstrInfo &TII);
+
+public:
+  bool isConstant(const MachineFrameInfo *) const override;
+  bool isAliased(const MachineFrameInfo *) const override;
+  bool mayAlias(const MachineFrameInfo *) const override;
+};
+
+
+class GlobalValuePseudoSourceValue : public CallEntryPseudoSourceValue {
+  const GlobalValue *GV;
+
+public:
+  GlobalValuePseudoSourceValue(const GlobalValue *GV,
+                               const TargetInstrInfo &TII);
+
+  static bool classof(const PseudoSourceValue *V) {
+    return V->kind() == GlobalValueCallEntry;
+  }
+
+  const GlobalValue *getValue() const { return GV; }
+};
+
+
+class ExternalSymbolPseudoSourceValue : public CallEntryPseudoSourceValue {
+  const char *ES;
+
+public:
+  ExternalSymbolPseudoSourceValue(const char *ES, const TargetInstrInfo &TII);
+
+  static bool classof(const PseudoSourceValue *V) {
+    return V->kind() == ExternalSymbolCallEntry;
+  }
+
+  const char *getSymbol() const { return ES; }
+};
+
+
+class PseudoSourceValueManager {
+  const TargetInstrInfo &TII;
+  const PseudoSourceValue StackPSV, GOTPSV, JumpTablePSV, ConstantPoolPSV;
+  std::map<int, std::unique_ptr<FixedStackPseudoSourceValue>> FSValues;
+  StringMap<std::unique_ptr<const ExternalSymbolPseudoSourceValue>>
+      ExternalCallEntries;
+  ValueMap<const GlobalValue *,
+           std::unique_ptr<const GlobalValuePseudoSourceValue>>
+      GlobalCallEntries;
+
+public:
+  PseudoSourceValueManager(const TargetInstrInfo &TII);
+
+
+
+  const PseudoSourceValue *getStack();
+
+
+
+  const PseudoSourceValue *getGOT();
+
+
+
+
+  const PseudoSourceValue *getConstantPool();
+
+
+
+  const PseudoSourceValue *getJumpTable();
+
+
+
+  const PseudoSourceValue *getFixedStack(int FI);
+
+  const PseudoSourceValue *getGlobalValueCallEntry(const GlobalValue *GV);
+
+  const PseudoSourceValue *getExternalSymbolCallEntry(const char *ES);
+};
+
+}
+
+
+
+
+
+
+namespace llvm {
+
+class FoldingSetNodeID;
+class MDNode;
+class raw_ostream;
+class MachineFunction;
+class ModuleSlotTracker;
+
+
+
+
+struct MachinePointerInfo {
+
+
+
+  PointerUnion<const Value *, const PseudoSourceValue *> V;
+
+
+  int64_t Offset;
+
+  uint8_t StackID;
+
+  unsigned AddrSpace = 0;
+
+  explicit MachinePointerInfo(const Value *v, int64_t offset = 0,
+                              uint8_t ID = 0)
+      : V(v), Offset(offset), StackID(ID) {
+    AddrSpace = v ? v->getType()->getPointerAddressSpace() : 0;
+  }
+
+  explicit MachinePointerInfo(const PseudoSourceValue *v, int64_t offset = 0,
+                              uint8_t ID = 0)
+      : V(v), Offset(offset), StackID(ID) {
+    AddrSpace = v ? v->getAddressSpace() : 0;
+  }
+
+  explicit MachinePointerInfo(unsigned AddressSpace = 0)
+      : V((const Value *)nullptr), Offset(0), StackID(0),
+        AddrSpace(AddressSpace) {}
+
+  explicit MachinePointerInfo(
+    PointerUnion<const Value *, const PseudoSourceValue *> v,
+    int64_t offset = 0,
+    uint8_t ID = 0)
+    : V(v), Offset(offset), StackID(ID) {
+    if (V) {
+      if (const auto *ValPtr = V.dyn_cast<const Value*>())
+        AddrSpace = ValPtr->getType()->getPointerAddressSpace();
+      else
+        AddrSpace = V.get<const PseudoSourceValue*>()->getAddressSpace();
+    }
+  }
+
+  MachinePointerInfo getWithOffset(int64_t O) const {
+    if (V.isNull())
+      return MachinePointerInfo(AddrSpace);
+    if (V.is<const Value*>())
+      return MachinePointerInfo(V.get<const Value*>(), Offset+O, StackID);
+    return MachinePointerInfo(V.get<const PseudoSourceValue*>(), Offset+O,
+                              StackID);
+  }
+
+
+
+  bool isDereferenceable(unsigned Size, LLVMContext &C,
+                         const DataLayout &DL) const;
+
+
+  unsigned getAddrSpace() const;
+
+
+  static MachinePointerInfo getConstantPool(MachineFunction &MF);
+
+
+
+  static MachinePointerInfo getFixedStack(MachineFunction &MF, int FI,
+                                          int64_t Offset = 0);
+
+
+  static MachinePointerInfo getJumpTable(MachineFunction &MF);
+
+
+  static MachinePointerInfo getGOT(MachineFunction &MF);
+
+
+  static MachinePointerInfo getStack(MachineFunction &MF, int64_t Offset,
+                                     uint8_t ID = 0);
+
+
+  static MachinePointerInfo getUnknownStack(MachineFunction &MF);
+};
+class MachineMemOperand {
+public:
+
+  enum Flags : uint16_t {
+
+    MONone = 0,
+
+    MOLoad = 1u << 0,
+
+    MOStore = 1u << 1,
+
+    MOVolatile = 1u << 2,
+
+    MONonTemporal = 1u << 3,
+
+    MODereferenceable = 1u << 4,
+
+    MOInvariant = 1u << 5,
+
+
+
+
+
+    MOTargetFlag1 = 1u << 6,
+    MOTargetFlag2 = 1u << 7,
+    MOTargetFlag3 = 1u << 8,
+
+    LLVM_BITMASK_LARGEST_ENUMERATOR = MOTargetFlag3
+  };
+
+private:
+
+  struct MachineAtomicInfo {
+
+    unsigned SSID : 8;
+
+
+    unsigned Ordering : 4;
+
+
+    unsigned FailureOrdering : 4;
+  };
+
+  MachinePointerInfo PtrInfo;
+  uint64_t Size;
+  Flags FlagVals;
+  uint16_t BaseAlignLog2;
+  MachineAtomicInfo AtomicInfo;
+  AAMDNodes AAInfo;
+  const MDNode *Ranges;
+
+public:
+
+
+
+
+
+  MachineMemOperand(MachinePointerInfo PtrInfo, Flags flags, uint64_t s,
+                    unsigned base_alignment,
+                    const AAMDNodes &AAInfo = AAMDNodes(),
+                    const MDNode *Ranges = nullptr,
+                    SyncScope::ID SSID = SyncScope::System,
+                    AtomicOrdering Ordering = AtomicOrdering::NotAtomic,
+                    AtomicOrdering FailureOrdering = AtomicOrdering::NotAtomic);
+
+  const MachinePointerInfo &getPointerInfo() const { return PtrInfo; }
+  const Value *getValue() const { return PtrInfo.V.dyn_cast<const Value*>(); }
+
+  const PseudoSourceValue *getPseudoValue() const {
+    return PtrInfo.V.dyn_cast<const PseudoSourceValue*>();
+  }
+
+  const void *getOpaqueValue() const { return PtrInfo.V.getOpaqueValue(); }
+
+
+  Flags getFlags() const { return FlagVals; }
+
+
+  void setFlags(Flags f) { FlagVals |= f; }
+
+
+
+  int64_t getOffset() const { return PtrInfo.Offset; }
+
+  unsigned getAddrSpace() const { return PtrInfo.getAddrSpace(); }
+
+
+  uint64_t getSize() const { return Size; }
+
+
+
+  uint64_t getAlignment() const;
+
+
+
+  uint64_t getBaseAlignment() const { return (1u << BaseAlignLog2) >> 1; }
+
+
+  AAMDNodes getAAInfo() const { return AAInfo; }
+
+
+  const MDNode *getRanges() const { return Ranges; }
+
+
+  SyncScope::ID getSyncScopeID() const {
+    return static_cast<SyncScope::ID>(AtomicInfo.SSID);
+  }
+
+
+
+
+  AtomicOrdering getOrdering() const {
+    return static_cast<AtomicOrdering>(AtomicInfo.Ordering);
+  }
+
+
+
+  AtomicOrdering getFailureOrdering() const {
+    return static_cast<AtomicOrdering>(AtomicInfo.FailureOrdering);
+  }
+
+  bool isLoad() const { return FlagVals & MOLoad; }
+  bool isStore() const { return FlagVals & MOStore; }
+  bool isVolatile() const { return FlagVals & MOVolatile; }
+  bool isNonTemporal() const { return FlagVals & MONonTemporal; }
+  bool isDereferenceable() const { return FlagVals & MODereferenceable; }
+  bool isInvariant() const { return FlagVals & MOInvariant; }
+
+
+
+  bool isAtomic() const { return getOrdering() != AtomicOrdering::NotAtomic; }
+  bool isUnordered() const { return !isVolatile(); }
+
+
+
+
+  void refineAlignment(const MachineMemOperand *MMO);
+
+
+
+
+  void setValue(const Value *NewSV) { PtrInfo.V = NewSV; }
+  void setValue(const PseudoSourceValue *NewSV) { PtrInfo.V = NewSV; }
+  void setOffset(int64_t NewOffset) { PtrInfo.Offset = NewOffset; }
+
+
+
+  void Profile(FoldingSetNodeID &ID) const;
+
+
+
+  void print(raw_ostream &OS) const;
+  void print(raw_ostream &OS, ModuleSlotTracker &MST) const;
+
+
+  friend bool operator==(const MachineMemOperand &LHS,
+                         const MachineMemOperand &RHS) {
+    return LHS.getValue() == RHS.getValue() &&
+           LHS.getPseudoValue() == RHS.getPseudoValue() &&
+           LHS.getSize() == RHS.getSize() &&
+           LHS.getOffset() == RHS.getOffset() &&
+           LHS.getFlags() == RHS.getFlags() &&
+           LHS.getAAInfo() == RHS.getAAInfo() &&
+           LHS.getRanges() == RHS.getRanges() &&
+           LHS.getAlignment() == RHS.getAlignment() &&
+           LHS.getAddrSpace() == RHS.getAddrSpace();
+  }
+
+  friend bool operator!=(const MachineMemOperand &LHS,
+                         const MachineMemOperand &RHS) {
+    return !(LHS == RHS);
+  }
+};
+
+inline raw_ostream &operator<<(raw_ostream &OS, const MachineMemOperand &MRO) {
+  MRO.print(OS);
+  return OS;
+}
+
+}
+
+
+
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+namespace llvm {
+
+
+class SMLoc {
+  const char *Ptr = nullptr;
+
+public:
+  SMLoc() = default;
+
+  bool isValid() const { return Ptr != nullptr; }
+
+  bool operator==(const SMLoc &RHS) const { return RHS.Ptr == Ptr; }
+  bool operator!=(const SMLoc &RHS) const { return RHS.Ptr != Ptr; }
+
+  const char *getPointer() const { return Ptr; }
+
+  static SMLoc getFromPointer(const char *Ptr) {
+    SMLoc L;
+    L.Ptr = Ptr;
+    return L;
+  }
+};
+
+
+
+
+
+
+class SMRange {
+public:
+  SMLoc Start, End;
+
+  SMRange() = default;
+  SMRange(NoneType) {}
+  SMRange(SMLoc St, SMLoc En) : Start(St), End(En) {
+    
+   ((
+   Start.isValid() == End.isValid() && "Start and end should either both be valid or both be invalid!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Start.isValid() == End.isValid() && \"Start and end should either both be valid or both be invalid!\""
+   ,
+                                                                          "/home/trippels/llvm/llvm/include/llvm/Support/SMLoc.h"
+    ,
+                                                                          57
+    , __PRETTY_FUNCTION__))
+                                                                           
+                                                                          ;
+  }
+
+  bool isValid() const { return Start.isValid(); }
+};
+
+}
+
+
+namespace llvm {
+
+class MCAsmInfo;
+class MCAsmLayout;
+class MCAssembler;
+class MCContext;
+class MCFixup;
+class MCFragment;
+class MCSection;
+class MCStreamer;
+class MCSymbol;
+class MCValue;
+class raw_ostream;
+class StringRef;
+
+using SectionAddrMap = DenseMap<const MCSection *, uint64_t>;
+
+
+
+class MCExpr {
+public:
+  enum ExprKind {
+    Binary,
+    Constant,
+    SymbolRef,
+    Unary,
+    Target
+  };
+
+private:
+  ExprKind Kind;
+  SMLoc Loc;
+
+  bool evaluateAsAbsolute(int64_t &Res, const MCAssembler *Asm,
+                          const MCAsmLayout *Layout,
+                          const SectionAddrMap *Addrs) const;
+
+  bool evaluateAsAbsolute(int64_t &Res, const MCAssembler *Asm,
+                          const MCAsmLayout *Layout,
+                          const SectionAddrMap *Addrs, bool InSet) const;
+
+protected:
+  explicit MCExpr(ExprKind Kind, SMLoc Loc) : Kind(Kind), Loc(Loc) {}
+
+  bool evaluateAsRelocatableImpl(MCValue &Res, const MCAssembler *Asm,
+                                 const MCAsmLayout *Layout,
+                                 const MCFixup *Fixup,
+                                 const SectionAddrMap *Addrs, bool InSet) const;
+
+public:
+  MCExpr(const MCExpr &) = delete;
+  MCExpr &operator=(const MCExpr &) = delete;
+
+
+
+
+  ExprKind getKind() const { return Kind; }
+  SMLoc getLoc() const { return Loc; }
+
+
+
+
+
+  void print(raw_ostream &OS, const MCAsmInfo *MAI,
+             bool InParens = false) const;
+  void dump() const;
+  bool evaluateAsAbsolute(int64_t &Res, const MCAsmLayout &Layout,
+                          const SectionAddrMap &Addrs) const;
+  bool evaluateAsAbsolute(int64_t &Res) const;
+  bool evaluateAsAbsolute(int64_t &Res, const MCAssembler &Asm) const;
+  bool evaluateAsAbsolute(int64_t &Res, const MCAsmLayout &Layout) const;
+
+  bool evaluateKnownAbsolute(int64_t &Res, const MCAsmLayout &Layout) const;
+  bool evaluateAsRelocatable(MCValue &Res, const MCAsmLayout *Layout,
+                             const MCFixup *Fixup) const;
+
+
+
+
+
+
+  bool evaluateAsValue(MCValue &Res, const MCAsmLayout &Layout) const;
+
+
+
+
+
+  MCFragment *findAssociatedFragment() const;
+
+
+};
+
+inline raw_ostream &operator<<(raw_ostream &OS, const MCExpr &E) {
+  E.print(OS, nullptr);
+  return OS;
+}
+
+
+class MCConstantExpr : public MCExpr {
+  int64_t Value;
+
+  explicit MCConstantExpr(int64_t Value)
+      : MCExpr(MCExpr::Constant, SMLoc()), Value(Value) {}
+
+public:
+
+
+
+  static const MCConstantExpr *create(int64_t Value, MCContext &Ctx);
+
+
+
+
+
+  int64_t getValue() const { return Value; }
+
+
+
+  static bool classof(const MCExpr *E) {
+    return E->getKind() == MCExpr::Constant;
+  }
+};
+
+
+
+
+
+
+class MCSymbolRefExpr : public MCExpr {
+public:
+  enum VariantKind : uint16_t {
+    VK_None,
+    VK_Invalid,
+
+    VK_GOT,
+    VK_GOTOFF,
+    VK_GOTREL,
+    VK_GOTPCREL,
+    VK_GOTTPOFF,
+    VK_INDNTPOFF,
+    VK_NTPOFF,
+    VK_GOTNTPOFF,
+    VK_PLT,
+    VK_TLSGD,
+    VK_TLSLD,
+    VK_TLSLDM,
+    VK_TPOFF,
+    VK_DTPOFF,
+    VK_TLSCALL,
+    VK_TLSDESC,
+    VK_TLVP,
+    VK_TLVPPAGE,
+    VK_TLVPPAGEOFF,
+    VK_PAGE,
+    VK_PAGEOFF,
+    VK_GOTPAGE,
+    VK_GOTPAGEOFF,
+    VK_SECREL,
+    VK_SIZE,
+    VK_WEAKREF,
+
+    VK_X86_ABS8,
+
+    VK_ARM_NONE,
+    VK_ARM_GOT_PREL,
+    VK_ARM_TARGET1,
+    VK_ARM_TARGET2,
+    VK_ARM_PREL31,
+    VK_ARM_SBREL,
+    VK_ARM_TLSLDO,
+    VK_ARM_TLSDESCSEQ,
+
+    VK_AVR_NONE,
+    VK_AVR_LO8,
+    VK_AVR_HI8,
+    VK_AVR_HLO8,
+    VK_AVR_DIFF8,
+    VK_AVR_DIFF16,
+    VK_AVR_DIFF32,
+
+    VK_PPC_LO,
+    VK_PPC_HI,
+    VK_PPC_HA,
+    VK_PPC_HIGHER,
+    VK_PPC_HIGHERA,
+    VK_PPC_HIGHEST,
+    VK_PPC_HIGHESTA,
+    VK_PPC_GOT_LO,
+    VK_PPC_GOT_HI,
+    VK_PPC_GOT_HA,
+    VK_PPC_TOCBASE,
+    VK_PPC_TOC,
+    VK_PPC_TOC_LO,
+    VK_PPC_TOC_HI,
+    VK_PPC_TOC_HA,
+    VK_PPC_DTPMOD,
+    VK_PPC_TPREL_LO,
+    VK_PPC_TPREL_HI,
+    VK_PPC_TPREL_HA,
+    VK_PPC_TPREL_HIGHER,
+    VK_PPC_TPREL_HIGHERA,
+    VK_PPC_TPREL_HIGHEST,
+    VK_PPC_TPREL_HIGHESTA,
+    VK_PPC_DTPREL_LO,
+    VK_PPC_DTPREL_HI,
+    VK_PPC_DTPREL_HA,
+    VK_PPC_DTPREL_HIGHER,
+    VK_PPC_DTPREL_HIGHERA,
+    VK_PPC_DTPREL_HIGHEST,
+    VK_PPC_DTPREL_HIGHESTA,
+    VK_PPC_GOT_TPREL,
+    VK_PPC_GOT_TPREL_LO,
+    VK_PPC_GOT_TPREL_HI,
+    VK_PPC_GOT_TPREL_HA,
+    VK_PPC_GOT_DTPREL,
+    VK_PPC_GOT_DTPREL_LO,
+    VK_PPC_GOT_DTPREL_HI,
+    VK_PPC_GOT_DTPREL_HA,
+    VK_PPC_TLS,
+    VK_PPC_GOT_TLSGD,
+    VK_PPC_GOT_TLSGD_LO,
+    VK_PPC_GOT_TLSGD_HI,
+    VK_PPC_GOT_TLSGD_HA,
+    VK_PPC_TLSGD,
+    VK_PPC_GOT_TLSLD,
+    VK_PPC_GOT_TLSLD_LO,
+    VK_PPC_GOT_TLSLD_HI,
+    VK_PPC_GOT_TLSLD_HA,
+    VK_PPC_TLSLD,
+    VK_PPC_LOCAL,
+
+    VK_COFF_IMGREL32,
+
+    VK_Hexagon_PCREL,
+    VK_Hexagon_LO16,
+    VK_Hexagon_HI16,
+    VK_Hexagon_GPREL,
+    VK_Hexagon_GD_GOT,
+    VK_Hexagon_LD_GOT,
+    VK_Hexagon_GD_PLT,
+    VK_Hexagon_LD_PLT,
+    VK_Hexagon_IE,
+    VK_Hexagon_IE_GOT,
+
+    VK_WebAssembly_FUNCTION,
+    VK_WebAssembly_TYPEINDEX,
+
+    VK_AMDGPU_GOTPCREL32_LO,
+    VK_AMDGPU_GOTPCREL32_HI,
+    VK_AMDGPU_REL32_LO,
+    VK_AMDGPU_REL32_HI,
+
+    VK_TPREL,
+    VK_DTPREL
+  };
+
+private:
+
+  const VariantKind Kind;
+
+
+  const unsigned UseParensForSymbolVariant : 1;
+
+
+  const unsigned HasSubsectionsViaSymbols : 1;
+
+
+  const MCSymbol *Symbol;
+
+  explicit MCSymbolRefExpr(const MCSymbol *Symbol, VariantKind Kind,
+                           const MCAsmInfo *MAI, SMLoc Loc = SMLoc());
+
+public:
+
+
+
+  static const MCSymbolRefExpr *create(const MCSymbol *Symbol, MCContext &Ctx) {
+    return MCSymbolRefExpr::create(Symbol, VK_None, Ctx);
+  }
+
+  static const MCSymbolRefExpr *create(const MCSymbol *Symbol, VariantKind Kind,
+                                       MCContext &Ctx, SMLoc Loc = SMLoc());
+  static const MCSymbolRefExpr *create(StringRef Name, VariantKind Kind,
+                                       MCContext &Ctx);
+
+
+
+
+
+  const MCSymbol &getSymbol() const { return *Symbol; }
+
+  VariantKind getKind() const { return Kind; }
+
+  void printVariantKind(raw_ostream &OS) const;
+
+  bool hasSubsectionsViaSymbols() const { return HasSubsectionsViaSymbols; }
+
+
+
+
+
+  static StringRef getVariantKindName(VariantKind Kind);
+
+  static VariantKind getVariantKindForName(StringRef Name);
+
+
+
+  static bool classof(const MCExpr *E) {
+    return E->getKind() == MCExpr::SymbolRef;
+  }
+};
+
+
+class MCUnaryExpr : public MCExpr {
+public:
+  enum Opcode {
+    LNot,
+    Minus,
+    Not,
+    Plus
+  };
+
+private:
+  Opcode Op;
+  const MCExpr *Expr;
+
+  MCUnaryExpr(Opcode Op, const MCExpr *Expr, SMLoc Loc)
+      : MCExpr(MCExpr::Unary, Loc), Op(Op), Expr(Expr) {}
+
+public:
+
+
+
+  static const MCUnaryExpr *create(Opcode Op, const MCExpr *Expr,
+                                   MCContext &Ctx, SMLoc Loc = SMLoc());
+
+  static const MCUnaryExpr *createLNot(const MCExpr *Expr, MCContext &Ctx, SMLoc Loc = SMLoc()) {
+    return create(LNot, Expr, Ctx, Loc);
+  }
+
+  static const MCUnaryExpr *createMinus(const MCExpr *Expr, MCContext &Ctx, SMLoc Loc = SMLoc()) {
+    return create(Minus, Expr, Ctx, Loc);
+  }
+
+  static const MCUnaryExpr *createNot(const MCExpr *Expr, MCContext &Ctx, SMLoc Loc = SMLoc()) {
+    return create(Not, Expr, Ctx, Loc);
+  }
+
+  static const MCUnaryExpr *createPlus(const MCExpr *Expr, MCContext &Ctx, SMLoc Loc = SMLoc()) {
+    return create(Plus, Expr, Ctx, Loc);
+  }
+
+
+
+
+
+
+  Opcode getOpcode() const { return Op; }
+
+
+  const MCExpr *getSubExpr() const { return Expr; }
+
+
+
+  static bool classof(const MCExpr *E) {
+    return E->getKind() == MCExpr::Unary;
+  }
+};
+
+
+class MCBinaryExpr : public MCExpr {
+public:
+  enum Opcode {
+    Add,
+    And,
+    Div,
+    EQ,
+    GT,
+
+    GTE,
+
+    LAnd,
+    LOr,
+    LT,
+
+    LTE,
+
+    Mod,
+    Mul,
+    NE,
+    Or,
+    Shl,
+    AShr,
+    LShr,
+    Sub,
+    Xor
+  };
+
+private:
+  Opcode Op;
+  const MCExpr *LHS, *RHS;
+
+  MCBinaryExpr(Opcode Op, const MCExpr *LHS, const MCExpr *RHS,
+               SMLoc Loc = SMLoc())
+      : MCExpr(MCExpr::Binary, Loc), Op(Op), LHS(LHS), RHS(RHS) {}
+
+public:
+
+
+
+  static const MCBinaryExpr *create(Opcode Op, const MCExpr *LHS,
+                                    const MCExpr *RHS, MCContext &Ctx,
+                                    SMLoc Loc = SMLoc());
+
+  static const MCBinaryExpr *createAdd(const MCExpr *LHS, const MCExpr *RHS,
+                                       MCContext &Ctx) {
+    return create(Add, LHS, RHS, Ctx);
+  }
+
+  static const MCBinaryExpr *createAnd(const MCExpr *LHS, const MCExpr *RHS,
+                                       MCContext &Ctx) {
+    return create(And, LHS, RHS, Ctx);
+  }
+
+  static const MCBinaryExpr *createDiv(const MCExpr *LHS, const MCExpr *RHS,
+                                       MCContext &Ctx) {
+    return create(Div, LHS, RHS, Ctx);
+  }
+
+  static const MCBinaryExpr *createEQ(const MCExpr *LHS, const MCExpr *RHS,
+                                      MCContext &Ctx) {
+    return create(EQ, LHS, RHS, Ctx);
+  }
+
+  static const MCBinaryExpr *createGT(const MCExpr *LHS, const MCExpr *RHS,
+                                      MCContext &Ctx) {
+    return create(GT, LHS, RHS, Ctx);
+  }
+
+  static const MCBinaryExpr *createGTE(const MCExpr *LHS, const MCExpr *RHS,
+                                       MCContext &Ctx) {
+    return create(GTE, LHS, RHS, Ctx);
+  }
+
+  static const MCBinaryExpr *createLAnd(const MCExpr *LHS, const MCExpr *RHS,
+                                        MCContext &Ctx) {
+    return create(LAnd, LHS, RHS, Ctx);
+  }
+
+  static const MCBinaryExpr *createLOr(const MCExpr *LHS, const MCExpr *RHS,
+                                       MCContext &Ctx) {
+    return create(LOr, LHS, RHS, Ctx);
+  }
+
+  static const MCBinaryExpr *createLT(const MCExpr *LHS, const MCExpr *RHS,
+                                      MCContext &Ctx) {
+    return create(LT, LHS, RHS, Ctx);
+  }
+
+  static const MCBinaryExpr *createLTE(const MCExpr *LHS, const MCExpr *RHS,
+                                       MCContext &Ctx) {
+    return create(LTE, LHS, RHS, Ctx);
+  }
+
+  static const MCBinaryExpr *createMod(const MCExpr *LHS, const MCExpr *RHS,
+                                       MCContext &Ctx) {
+    return create(Mod, LHS, RHS, Ctx);
+  }
+
+  static const MCBinaryExpr *createMul(const MCExpr *LHS, const MCExpr *RHS,
+                                       MCContext &Ctx) {
+    return create(Mul, LHS, RHS, Ctx);
+  }
+
+  static const MCBinaryExpr *createNE(const MCExpr *LHS, const MCExpr *RHS,
+                                      MCContext &Ctx) {
+    return create(NE, LHS, RHS, Ctx);
+  }
+
+  static const MCBinaryExpr *createOr(const MCExpr *LHS, const MCExpr *RHS,
+                                      MCContext &Ctx) {
+    return create(Or, LHS, RHS, Ctx);
+  }
+
+  static const MCBinaryExpr *createShl(const MCExpr *LHS, const MCExpr *RHS,
+                                       MCContext &Ctx) {
+    return create(Shl, LHS, RHS, Ctx);
+  }
+
+  static const MCBinaryExpr *createAShr(const MCExpr *LHS, const MCExpr *RHS,
+                                       MCContext &Ctx) {
+    return create(AShr, LHS, RHS, Ctx);
+  }
+
+  static const MCBinaryExpr *createLShr(const MCExpr *LHS, const MCExpr *RHS,
+                                       MCContext &Ctx) {
+    return create(LShr, LHS, RHS, Ctx);
+  }
+
+  static const MCBinaryExpr *createSub(const MCExpr *LHS, const MCExpr *RHS,
+                                       MCContext &Ctx) {
+    return create(Sub, LHS, RHS, Ctx);
+  }
+
+  static const MCBinaryExpr *createXor(const MCExpr *LHS, const MCExpr *RHS,
+                                       MCContext &Ctx) {
+    return create(Xor, LHS, RHS, Ctx);
+  }
+
+
+
+
+
+
+  Opcode getOpcode() const { return Op; }
+
+
+  const MCExpr *getLHS() const { return LHS; }
+
+
+  const MCExpr *getRHS() const { return RHS; }
+
+
+
+  static bool classof(const MCExpr *E) {
+    return E->getKind() == MCExpr::Binary;
+  }
+};
+
+
+
+
+
+
+class MCTargetExpr : public MCExpr {
+  virtual void anchor();
+
+protected:
+  MCTargetExpr() : MCExpr(Target, SMLoc()) {}
+  virtual ~MCTargetExpr() = default;
+
+public:
+  virtual void printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const = 0;
+  virtual bool evaluateAsRelocatableImpl(MCValue &Res,
+                                         const MCAsmLayout *Layout,
+                                         const MCFixup *Fixup) const = 0;
+  virtual void visitUsedExpr(MCStreamer& Streamer) const = 0;
+  virtual MCFragment *findAssociatedFragment() const = 0;
+
+  virtual void fixELFSymbolsInTLSFixups(MCAssembler &) const = 0;
+
+  static bool classof(const MCExpr *E) {
+    return E->getKind() == MCExpr::Target;
+  }
+};
+
+}
+
+
+
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+namespace llvm {
+class MCExpr;
+
+
+enum MCFixupKind {
+  FK_Data_1 = 0,
+  FK_Data_2,
+  FK_Data_4,
+  FK_Data_8,
+  FK_PCRel_1,
+  FK_PCRel_2,
+  FK_PCRel_4,
+  FK_PCRel_8,
+  FK_GPRel_1,
+  FK_GPRel_2,
+  FK_GPRel_4,
+  FK_GPRel_8,
+  FK_DTPRel_4,
+  FK_DTPRel_8,
+  FK_TPRel_4,
+  FK_TPRel_8,
+  FK_SecRel_1,
+  FK_SecRel_2,
+  FK_SecRel_4,
+  FK_SecRel_8,
+
+  FirstTargetFixupKind = 128,
+
+
+
+  MaxTargetFixupKind = (1 << 8)
+};
+class MCFixup {
+
+
+
+  const MCExpr *Value;
+
+
+  uint32_t Offset;
+
+
+
+  unsigned Kind;
+
+
+  SMLoc Loc;
+public:
+  static MCFixup create(uint32_t Offset, const MCExpr *Value,
+                        MCFixupKind Kind, SMLoc Loc = SMLoc()) {
+    
+   ((
+   unsigned(Kind) < MaxTargetFixupKind && "Kind out of range!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "unsigned(Kind) < MaxTargetFixupKind && \"Kind out of range!\""
+   , "/home/trippels/llvm/llvm/include/llvm/MC/MCFixup.h", 84, __PRETTY_FUNCTION__))
+                                                                      ;
+    MCFixup FI;
+    FI.Value = Value;
+    FI.Offset = Offset;
+    FI.Kind = unsigned(Kind);
+    FI.Loc = Loc;
+    return FI;
+  }
+
+  MCFixupKind getKind() const { return MCFixupKind(Kind); }
+
+  uint32_t getOffset() const { return Offset; }
+  void setOffset(uint32_t Value) { Offset = Value; }
+
+  const MCExpr *getValue() const { return Value; }
+
+
+
+  static MCFixupKind getKindForSize(unsigned Size, bool isPCRel) {
+    switch (Size) {
+    default: ::llvm::llvm_unreachable_internal("Invalid generic fixup size!", "/home/trippels/llvm/llvm/include/llvm/MC/MCFixup.h", 104);
+    case 1: return isPCRel ? FK_PCRel_1 : FK_Data_1;
+    case 2: return isPCRel ? FK_PCRel_2 : FK_Data_2;
+    case 4: return isPCRel ? FK_PCRel_4 : FK_Data_4;
+    case 8: return isPCRel ? FK_PCRel_8 : FK_Data_8;
+    }
+  }
+
+  SMLoc getLoc() const { return Loc; }
+};
+
+}
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+namespace llvm {
+
+class MCExpr;
+class MCInst;
+class MCInstPrinter;
+class raw_ostream;
+
+
+
+class MCOperand {
+  enum MachineOperandType : unsigned char {
+    kInvalid,
+    kRegister,
+    kImmediate,
+    kFPImmediate,
+    kExpr,
+    kInst
+  };
+  MachineOperandType Kind = kInvalid;
+
+  union {
+    unsigned RegVal;
+    int64_t ImmVal;
+    double FPImmVal;
+    const MCExpr *ExprVal;
+    const MCInst *InstVal;
+  };
+
+public:
+  MCOperand() : FPImmVal(0.0) {}
+
+  bool isValid() const { return Kind != kInvalid; }
+  bool isReg() const { return Kind == kRegister; }
+  bool isImm() const { return Kind == kImmediate; }
+  bool isFPImm() const { return Kind == kFPImmediate; }
+  bool isExpr() const { return Kind == kExpr; }
+  bool isInst() const { return Kind == kInst; }
+
+
+  unsigned getReg() const {
+    
+   ((
+   isReg() && "This is not a register operand!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isReg() && \"This is not a register operand!\""
+   , "/home/trippels/llvm/llvm/include/llvm/MC/MCInst.h", 66, __PRETTY_FUNCTION__))
+                                                       ;
+    return RegVal;
+  }
+
+
+  void setReg(unsigned Reg) {
+    
+   ((
+   isReg() && "This is not a register operand!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isReg() && \"This is not a register operand!\""
+   , "/home/trippels/llvm/llvm/include/llvm/MC/MCInst.h", 72, __PRETTY_FUNCTION__))
+                                                       ;
+    RegVal = Reg;
+  }
+
+  int64_t getImm() const {
+    
+   ((
+   isImm() && "This is not an immediate"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isImm() && \"This is not an immediate\""
+   , "/home/trippels/llvm/llvm/include/llvm/MC/MCInst.h", 77, __PRETTY_FUNCTION__))
+                                                ;
+    return ImmVal;
+  }
+
+  void setImm(int64_t Val) {
+    
+   ((
+   isImm() && "This is not an immediate"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isImm() && \"This is not an immediate\""
+   , "/home/trippels/llvm/llvm/include/llvm/MC/MCInst.h", 82, __PRETTY_FUNCTION__))
+                                                ;
+    ImmVal = Val;
+  }
+
+  double getFPImm() const {
+    
+   ((
+   isFPImm() && "This is not an FP immediate"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isFPImm() && \"This is not an FP immediate\""
+   , "/home/trippels/llvm/llvm/include/llvm/MC/MCInst.h", 87, __PRETTY_FUNCTION__))
+                                                     ;
+    return FPImmVal;
+  }
+
+  void setFPImm(double Val) {
+    
+   ((
+   isFPImm() && "This is not an FP immediate"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isFPImm() && \"This is not an FP immediate\""
+   , "/home/trippels/llvm/llvm/include/llvm/MC/MCInst.h", 92, __PRETTY_FUNCTION__))
+                                                     ;
+    FPImmVal = Val;
+  }
+
+  const MCExpr *getExpr() const {
+    
+   ((
+   isExpr() && "This is not an expression"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isExpr() && \"This is not an expression\""
+   , "/home/trippels/llvm/llvm/include/llvm/MC/MCInst.h", 97, __PRETTY_FUNCTION__))
+                                                  ;
+    return ExprVal;
+  }
+
+  void setExpr(const MCExpr *Val) {
+    
+   ((
+   isExpr() && "This is not an expression"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isExpr() && \"This is not an expression\""
+   , "/home/trippels/llvm/llvm/include/llvm/MC/MCInst.h", 102, __PRETTY_FUNCTION__))
+                                                  ;
+    ExprVal = Val;
+  }
+
+  const MCInst *getInst() const {
+    
+   ((
+   isInst() && "This is not a sub-instruction"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isInst() && \"This is not a sub-instruction\""
+   , "/home/trippels/llvm/llvm/include/llvm/MC/MCInst.h", 107, __PRETTY_FUNCTION__))
+                                                      ;
+    return InstVal;
+  }
+
+  void setInst(const MCInst *Val) {
+    
+   ((
+   isInst() && "This is not a sub-instruction"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isInst() && \"This is not a sub-instruction\""
+   , "/home/trippels/llvm/llvm/include/llvm/MC/MCInst.h", 112, __PRETTY_FUNCTION__))
+                                                      ;
+    InstVal = Val;
+  }
+
+  static MCOperand createReg(unsigned Reg) {
+    MCOperand Op;
+    Op.Kind = kRegister;
+    Op.RegVal = Reg;
+    return Op;
+  }
+
+  static MCOperand createImm(int64_t Val) {
+    MCOperand Op;
+    Op.Kind = kImmediate;
+    Op.ImmVal = Val;
+    return Op;
+  }
+
+  static MCOperand createFPImm(double Val) {
+    MCOperand Op;
+    Op.Kind = kFPImmediate;
+    Op.FPImmVal = Val;
+    return Op;
+  }
+
+  static MCOperand createExpr(const MCExpr *Val) {
+    MCOperand Op;
+    Op.Kind = kExpr;
+    Op.ExprVal = Val;
+    return Op;
+  }
+
+  static MCOperand createInst(const MCInst *Val) {
+    MCOperand Op;
+    Op.Kind = kInst;
+    Op.InstVal = Val;
+    return Op;
+  }
+
+  void print(raw_ostream &OS) const;
+  void dump() const;
+};
+
+template <> struct isPodLike<MCOperand> { static const bool value = true; };
+
+
+
+class MCInst {
+  unsigned Opcode = 0;
+  SMLoc Loc;
+  SmallVector<MCOperand, 8> Operands;
+
+
+
+  unsigned Flags = 0;
+
+public:
+  MCInst() = default;
+
+  void setOpcode(unsigned Op) { Opcode = Op; }
+  unsigned getOpcode() const { return Opcode; }
+
+  void setFlags(unsigned F) { Flags = F; }
+  unsigned getFlags() const { return Flags; }
+
+  void setLoc(SMLoc loc) { Loc = loc; }
+  SMLoc getLoc() const { return Loc; }
+
+  const MCOperand &getOperand(unsigned i) const { return Operands[i]; }
+  MCOperand &getOperand(unsigned i) { return Operands[i]; }
+  unsigned getNumOperands() const { return Operands.size(); }
+
+  void addOperand(const MCOperand &Op) { Operands.push_back(Op); }
+
+  using iterator = SmallVectorImpl<MCOperand>::iterator;
+  using const_iterator = SmallVectorImpl<MCOperand>::const_iterator;
+
+  void clear() { Operands.clear(); }
+  void erase(iterator I) { Operands.erase(I); }
+  size_t size() const { return Operands.size(); }
+  iterator begin() { return Operands.begin(); }
+  const_iterator begin() const { return Operands.begin(); }
+  iterator end() { return Operands.end(); }
+  const_iterator end() const { return Operands.end(); }
+
+  iterator insert(iterator I, const MCOperand &Op) {
+    return Operands.insert(I, Op);
+  }
+
+  void print(raw_ostream &OS) const;
+  void dump() const;
+
+
+
+
+  void dump_pretty(raw_ostream &OS, const MCInstPrinter *Printer = nullptr,
+                   StringRef Separator = " ") const;
+};
+
+inline raw_ostream& operator<<(raw_ostream &OS, const MCOperand &MO) {
+  MO.print(OS);
+  return OS;
+}
+
+inline raw_ostream& operator<<(raw_ostream &OS, const MCInst &MI) {
+  MI.print(OS);
+  return OS;
+}
+
+}
+
+
+
+
+
+namespace llvm {
+
+class MCSection;
+class MCSubtargetInfo;
+class MCSymbol;
+
+class MCFragment : public ilist_node_with_parent<MCFragment, MCSection> {
+  friend class MCAsmLayout;
+
+public:
+  enum FragmentType : uint8_t {
+    FT_Align,
+    FT_Data,
+    FT_CompactEncodedInst,
+    FT_Fill,
+    FT_Relaxable,
+    FT_Org,
+    FT_Dwarf,
+    FT_DwarfFrame,
+    FT_LEB,
+    FT_Padding,
+    FT_SymbolId,
+    FT_CVInlineLines,
+    FT_CVDefRange,
+    FT_Dummy
+  };
+
+private:
+  FragmentType Kind;
+
+protected:
+  bool HasInstructions;
+
+private:
+
+  bool AlignToBundleEnd;
+
+  uint8_t BundlePadding;
+
+
+  unsigned LayoutOrder;
+
+
+  MCSection *Parent;
+
+
+
+  const MCSymbol *Atom;
+  uint64_t Offset;
+
+
+
+protected:
+  MCFragment(FragmentType Kind, bool HasInstructions,
+             uint8_t BundlePadding, MCSection *Parent = nullptr);
+
+  ~MCFragment();
+
+public:
+  MCFragment() = delete;
+  MCFragment(const MCFragment &) = delete;
+  MCFragment &operator=(const MCFragment &) = delete;
+
+
+
+
+
+  void destroy();
+
+  FragmentType getKind() const { return Kind; }
+
+  MCSection *getParent() const { return Parent; }
+  void setParent(MCSection *Value) { Parent = Value; }
+
+  const MCSymbol *getAtom() const { return Atom; }
+  void setAtom(const MCSymbol *Value) { Atom = Value; }
+
+  unsigned getLayoutOrder() const { return LayoutOrder; }
+  void setLayoutOrder(unsigned Value) { LayoutOrder = Value; }
+
+
+
+  bool hasInstructions() const { return HasInstructions; }
+
+
+  bool alignToBundleEnd() const { return AlignToBundleEnd; }
+  void setAlignToBundleEnd(bool V) { AlignToBundleEnd = V; }
+
+
+
+
+
+
+  uint8_t getBundlePadding() const { return BundlePadding; }
+
+
+
+  void setBundlePadding(uint8_t N) { BundlePadding = N; }
+
+
+  bool isDummy() const { return Kind == FT_Dummy; }
+
+  void dump() const;
+};
+
+class MCDummyFragment : public MCFragment {
+public:
+  explicit MCDummyFragment(MCSection *Sec)
+      : MCFragment(FT_Dummy, false, 0, Sec) {}
+
+  static bool classof(const MCFragment *F) { return F->getKind() == FT_Dummy; }
+};
+
+
+
+
+class MCEncodedFragment : public MCFragment {
+protected:
+  MCEncodedFragment(MCFragment::FragmentType FType, bool HasInstructions,
+                    MCSection *Sec)
+      : MCFragment(FType, HasInstructions, 0, Sec) {}
+
+public:
+  static bool classof(const MCFragment *F) {
+    MCFragment::FragmentType Kind = F->getKind();
+    switch (Kind) {
+    default:
+      return false;
+    case MCFragment::FT_Relaxable:
+    case MCFragment::FT_CompactEncodedInst:
+    case MCFragment::FT_Data:
+      return true;
+    }
+  }
+};
+
+
+
+
+template<unsigned ContentsSize>
+class MCEncodedFragmentWithContents : public MCEncodedFragment {
+  SmallVector<char, ContentsSize> Contents;
+
+protected:
+  MCEncodedFragmentWithContents(MCFragment::FragmentType FType,
+                                bool HasInstructions,
+                                MCSection *Sec)
+      : MCEncodedFragment(FType, HasInstructions, Sec) {}
+
+public:
+  SmallVectorImpl<char> &getContents() { return Contents; }
+  const SmallVectorImpl<char> &getContents() const { return Contents; }
+};
+
+
+
+
+template<unsigned ContentsSize, unsigned FixupsSize>
+class MCEncodedFragmentWithFixups :
+  public MCEncodedFragmentWithContents<ContentsSize> {
+
+
+  SmallVector<MCFixup, FixupsSize> Fixups;
+
+protected:
+  MCEncodedFragmentWithFixups(MCFragment::FragmentType FType,
+                              bool HasInstructions,
+                              MCSection *Sec)
+      : MCEncodedFragmentWithContents<ContentsSize>(FType, HasInstructions,
+                                                    Sec) {}
+
+public:
+  using const_fixup_iterator = SmallVectorImpl<MCFixup>::const_iterator;
+  using fixup_iterator = SmallVectorImpl<MCFixup>::iterator;
+
+  SmallVectorImpl<MCFixup> &getFixups() { return Fixups; }
+  const SmallVectorImpl<MCFixup> &getFixups() const { return Fixups; }
+
+  fixup_iterator fixup_begin() { return Fixups.begin(); }
+  const_fixup_iterator fixup_begin() const { return Fixups.begin(); }
+
+  fixup_iterator fixup_end() { return Fixups.end(); }
+  const_fixup_iterator fixup_end() const { return Fixups.end(); }
+
+  static bool classof(const MCFragment *F) {
+    MCFragment::FragmentType Kind = F->getKind();
+    return Kind == MCFragment::FT_Relaxable || Kind == MCFragment::FT_Data ||
+           Kind == MCFragment::FT_CVDefRange;
+  }
+};
+
+
+
+class MCDataFragment : public MCEncodedFragmentWithFixups<32, 4> {
+public:
+  MCDataFragment(MCSection *Sec = nullptr)
+      : MCEncodedFragmentWithFixups<32, 4>(FT_Data, false, Sec) {}
+
+  void setHasInstructions(bool V) { HasInstructions = V; }
+
+  static bool classof(const MCFragment *F) {
+    return F->getKind() == MCFragment::FT_Data;
+  }
+};
+
+
+
+
+
+
+class MCCompactEncodedInstFragment : public MCEncodedFragmentWithContents<4> {
+public:
+  MCCompactEncodedInstFragment(MCSection *Sec = nullptr)
+      : MCEncodedFragmentWithContents(FT_CompactEncodedInst, true, Sec) {
+  }
+
+  static bool classof(const MCFragment *F) {
+    return F->getKind() == MCFragment::FT_CompactEncodedInst;
+  }
+};
+
+
+
+
+class MCRelaxableFragment : public MCEncodedFragmentWithFixups<8, 1> {
+
+
+  MCInst Inst;
+
+
+  const MCSubtargetInfo &STI;
+
+public:
+  MCRelaxableFragment(const MCInst &Inst, const MCSubtargetInfo &STI,
+                      MCSection *Sec = nullptr)
+      : MCEncodedFragmentWithFixups(FT_Relaxable, true, Sec),
+        Inst(Inst), STI(STI) {}
+
+  const MCInst &getInst() const { return Inst; }
+  void setInst(const MCInst &Value) { Inst = Value; }
+
+  const MCSubtargetInfo &getSubtargetInfo() { return STI; }
+
+  static bool classof(const MCFragment *F) {
+    return F->getKind() == MCFragment::FT_Relaxable;
+  }
+};
+
+class MCAlignFragment : public MCFragment {
+
+  unsigned Alignment;
+
+
+
+
+  bool EmitNops : 1;
+
+
+  int64_t Value;
+
+
+  unsigned ValueSize;
+
+
+
+  unsigned MaxBytesToEmit;
+
+public:
+  MCAlignFragment(unsigned Alignment, int64_t Value, unsigned ValueSize,
+                  unsigned MaxBytesToEmit, MCSection *Sec = nullptr)
+      : MCFragment(FT_Align, false, 0, Sec), Alignment(Alignment),
+        EmitNops(false), Value(Value),
+        ValueSize(ValueSize), MaxBytesToEmit(MaxBytesToEmit) {}
+
+
+
+
+  unsigned getAlignment() const { return Alignment; }
+
+  int64_t getValue() const { return Value; }
+
+  unsigned getValueSize() const { return ValueSize; }
+
+  unsigned getMaxBytesToEmit() const { return MaxBytesToEmit; }
+
+  bool hasEmitNops() const { return EmitNops; }
+  void setEmitNops(bool Value) { EmitNops = Value; }
+
+
+
+  static bool classof(const MCFragment *F) {
+    return F->getKind() == MCFragment::FT_Align;
+  }
+};
+
+
+
+
+
+
+class MCPaddingFragment : public MCFragment {
+
+
+  uint64_t PaddingPoliciesMask;
+
+
+
+  bool IsInsertionPoint;
+
+  uint64_t Size;
+
+  struct MCInstInfo {
+    bool IsInitialized;
+    MCInst Inst;
+
+
+
+    bool IsImmutableSizedInst;
+    union {
+
+      size_t InstSize;
+
+      MCRelaxableFragment *InstFragment;
+    };
+  };
+  MCInstInfo InstInfo;
+
+public:
+  static const uint64_t PFK_None = 0UL;
+
+  enum MCPaddingFragmentKind {
+
+
+    FirstTargetPerfNopFragmentKind = 8,
+
+
+    MaxTargetPerfNopFragmentKind = 63
+  };
+
+  MCPaddingFragment(MCSection *Sec = nullptr)
+      : MCFragment(FT_Padding, false, 0, Sec), PaddingPoliciesMask(PFK_None),
+        IsInsertionPoint(false), Size(0UL),
+        InstInfo({false, MCInst(), false, {0}}) {}
+
+  bool isInsertionPoint() const { return IsInsertionPoint; }
+  void setAsInsertionPoint() { IsInsertionPoint = true; }
+  uint64_t getPaddingPoliciesMask() const { return PaddingPoliciesMask; }
+  void setPaddingPoliciesMask(uint64_t Value) { PaddingPoliciesMask = Value; }
+  bool hasPaddingPolicy(uint64_t PolicyMask) const {
+    
+   ((
+   isPowerOf2_64(PolicyMask) && "Policy mask must contain exactly one policy"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isPowerOf2_64(PolicyMask) && \"Policy mask must contain exactly one policy\""
+   ,
+                                                        "/home/trippels/llvm/llvm/include/llvm/MC/MCFragment.h"
+    ,
+                                                        383
+    , __PRETTY_FUNCTION__))
+                                                         
+                                                        ;
+    return (getPaddingPoliciesMask() & PolicyMask) != PFK_None;
+  }
+  const MCInst &getInst() const {
+    
+   ((
+   isInstructionInitialized() && "Fragment has no instruction!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isInstructionInitialized() && \"Fragment has no instruction!\""
+   , "/home/trippels/llvm/llvm/include/llvm/MC/MCFragment.h", 387, __PRETTY_FUNCTION__))
+                                                                       ;
+    return InstInfo.Inst;
+  }
+  size_t getInstSize() const {
+    
+   ((
+   isInstructionInitialized() && "Fragment has no instruction!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isInstructionInitialized() && \"Fragment has no instruction!\""
+   , "/home/trippels/llvm/llvm/include/llvm/MC/MCFragment.h", 391, __PRETTY_FUNCTION__))
+                                                                       ;
+    if (InstInfo.IsImmutableSizedInst)
+      return InstInfo.InstSize;
+    
+   ((
+   InstInfo.InstFragment != nullptr && "Must have a valid InstFragment to retrieve InstSize from"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "InstInfo.InstFragment != nullptr && \"Must have a valid InstFragment to retrieve InstSize from\""
+   ,
+                                                                     "/home/trippels/llvm/llvm/include/llvm/MC/MCFragment.h"
+    ,
+                                                                     395
+    , __PRETTY_FUNCTION__))
+                                                                      
+                                                                     ;
+    return InstInfo.InstFragment->getContents().size();
+  }
+  void setInstAndInstSize(const MCInst &Inst, size_t InstSize) {
+ InstInfo.IsInitialized = true;
+    InstInfo.IsImmutableSizedInst = true;
+    InstInfo.Inst = Inst;
+    InstInfo.InstSize = InstSize;
+  }
+  void setInstAndInstFragment(const MCInst &Inst,
+                              MCRelaxableFragment *InstFragment) {
+    InstInfo.IsInitialized = true;
+    InstInfo.IsImmutableSizedInst = false;
+    InstInfo.Inst = Inst;
+    InstInfo.InstFragment = InstFragment;
+  }
+  uint64_t getSize() const { return Size; }
+  void setSize(uint64_t Value) { Size = Value; }
+  bool isInstructionInitialized() const { return InstInfo.IsInitialized; }
+
+  static bool classof(const MCFragment *F) {
+    return F->getKind() == MCFragment::FT_Padding;
+  }
+};
+
+class MCFillFragment : public MCFragment {
+
+  uint8_t Value;
+
+
+  const MCExpr &Size;
+
+
+  SMLoc Loc;
+
+public:
+  MCFillFragment(uint8_t Value, const MCExpr &Size, SMLoc Loc,
+                 MCSection *Sec = nullptr)
+      : MCFragment(FT_Fill, false, 0, Sec), Value(Value), Size(Size), Loc(Loc) {
+  }
+
+  uint8_t getValue() const { return Value; }
+  const MCExpr &getSize() const { return Size; }
+
+  SMLoc getLoc() const { return Loc; }
+
+  static bool classof(const MCFragment *F) {
+    return F->getKind() == MCFragment::FT_Fill;
+  }
+};
+
+class MCOrgFragment : public MCFragment {
+
+  const MCExpr *Offset;
+
+
+  int8_t Value;
+
+
+  SMLoc Loc;
+
+public:
+  MCOrgFragment(const MCExpr &Offset, int8_t Value, SMLoc Loc,
+                MCSection *Sec = nullptr)
+      : MCFragment(FT_Org, false, 0, Sec), Offset(&Offset), Value(Value), Loc(Loc) {}
+
+
+
+
+  const MCExpr &getOffset() const { return *Offset; }
+
+  uint8_t getValue() const { return Value; }
+
+  SMLoc getLoc() const { return Loc; }
+
+
+
+  static bool classof(const MCFragment *F) {
+    return F->getKind() == MCFragment::FT_Org;
+  }
+};
+
+class MCLEBFragment : public MCFragment {
+
+  const MCExpr *Value;
+
+
+  bool IsSigned;
+
+  SmallString<8> Contents;
+
+public:
+  MCLEBFragment(const MCExpr &Value_, bool IsSigned_, MCSection *Sec = nullptr)
+      : MCFragment(FT_LEB, false, 0, Sec), Value(&Value_), IsSigned(IsSigned_) {
+    Contents.push_back(0);
+  }
+
+
+
+
+  const MCExpr &getValue() const { return *Value; }
+
+  bool isSigned() const { return IsSigned; }
+
+  SmallString<8> &getContents() { return Contents; }
+  const SmallString<8> &getContents() const { return Contents; }
+
+
+
+  static bool classof(const MCFragment *F) {
+    return F->getKind() == MCFragment::FT_LEB;
+  }
+};
+
+class MCDwarfLineAddrFragment : public MCFragment {
+
+
+  int64_t LineDelta;
+
+
+
+  const MCExpr *AddrDelta;
+
+  SmallString<8> Contents;
+
+public:
+  MCDwarfLineAddrFragment(int64_t LineDelta, const MCExpr &AddrDelta,
+                          MCSection *Sec = nullptr)
+      : MCFragment(FT_Dwarf, false, 0, Sec), LineDelta(LineDelta),
+        AddrDelta(&AddrDelta) {
+    Contents.push_back(0);
+  }
+
+
+
+
+  int64_t getLineDelta() const { return LineDelta; }
+
+  const MCExpr &getAddrDelta() const { return *AddrDelta; }
+
+  SmallString<8> &getContents() { return Contents; }
+  const SmallString<8> &getContents() const { return Contents; }
+
+
+
+  static bool classof(const MCFragment *F) {
+    return F->getKind() == MCFragment::FT_Dwarf;
+  }
+};
+
+class MCDwarfCallFrameFragment : public MCFragment {
+
+
+  const MCExpr *AddrDelta;
+
+  SmallString<8> Contents;
+
+public:
+  MCDwarfCallFrameFragment(const MCExpr &AddrDelta, MCSection *Sec = nullptr)
+      : MCFragment(FT_DwarfFrame, false, 0, Sec), AddrDelta(&AddrDelta) {
+    Contents.push_back(0);
+  }
+
+
+
+
+  const MCExpr &getAddrDelta() const { return *AddrDelta; }
+
+  SmallString<8> &getContents() { return Contents; }
+  const SmallString<8> &getContents() const { return Contents; }
+
+
+
+  static bool classof(const MCFragment *F) {
+    return F->getKind() == MCFragment::FT_DwarfFrame;
+  }
+};
+
+
+class MCSymbolIdFragment : public MCFragment {
+  const MCSymbol *Sym;
+
+public:
+  MCSymbolIdFragment(const MCSymbol *Sym, MCSection *Sec = nullptr)
+      : MCFragment(FT_SymbolId, false, 0, Sec), Sym(Sym) {}
+
+
+
+
+  const MCSymbol *getSymbol() { return Sym; }
+  const MCSymbol *getSymbol() const { return Sym; }
+
+
+
+  static bool classof(const MCFragment *F) {
+    return F->getKind() == MCFragment::FT_SymbolId;
+  }
+};
+
+
+
+class MCCVInlineLineTableFragment : public MCFragment {
+  unsigned SiteFuncId;
+  unsigned StartFileId;
+  unsigned StartLineNum;
+  const MCSymbol *FnStartSym;
+  const MCSymbol *FnEndSym;
+  SmallString<8> Contents;
+
+
+
+  friend class CodeViewContext;
+
+public:
+  MCCVInlineLineTableFragment(unsigned SiteFuncId, unsigned StartFileId,
+                              unsigned StartLineNum, const MCSymbol *FnStartSym,
+                              const MCSymbol *FnEndSym,
+                              MCSection *Sec = nullptr)
+      : MCFragment(FT_CVInlineLines, false, 0, Sec), SiteFuncId(SiteFuncId),
+        StartFileId(StartFileId), StartLineNum(StartLineNum),
+        FnStartSym(FnStartSym), FnEndSym(FnEndSym) {}
+
+
+
+
+  const MCSymbol *getFnStartSym() const { return FnStartSym; }
+  const MCSymbol *getFnEndSym() const { return FnEndSym; }
+
+  SmallString<8> &getContents() { return Contents; }
+  const SmallString<8> &getContents() const { return Contents; }
+
+
+
+  static bool classof(const MCFragment *F) {
+    return F->getKind() == MCFragment::FT_CVInlineLines;
+  }
+};
+
+
+class MCCVDefRangeFragment : public MCEncodedFragmentWithFixups<32, 4> {
+  SmallVector<std::pair<const MCSymbol *, const MCSymbol *>, 2> Ranges;
+  SmallString<32> FixedSizePortion;
+
+
+
+  friend class CodeViewContext;
+
+public:
+  MCCVDefRangeFragment(
+      ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
+      StringRef FixedSizePortion, MCSection *Sec = nullptr)
+      : MCEncodedFragmentWithFixups<32, 4>(FT_CVDefRange, false, Sec),
+        Ranges(Ranges.begin(), Ranges.end()),
+        FixedSizePortion(FixedSizePortion) {}
+
+
+
+  ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> getRanges() const {
+    return Ranges;
+  }
+
+  StringRef getFixedSizePortion() const { return FixedSizePortion; }
+
+
+  static bool classof(const MCFragment *F) {
+    return F->getKind() == MCFragment::FT_CVDefRange;
+  }
+};
+
+}
+namespace llvm {
+class SectionKind {
+  enum Kind {
+
+    Metadata,
+
+
+    Text,
+
+
+           ExecuteOnly,
+
+
+
+
+    ReadOnly,
+
+
+
+
+
+
+
+           Mergeable1ByteCString,
+
+
+           Mergeable2ByteCString,
+
+
+           Mergeable4ByteCString,
+
+
+
+
+
+
+
+            MergeableConst4,
+
+
+
+            MergeableConst8,
+
+
+
+            MergeableConst16,
+
+
+
+            MergeableConst32,
+           ThreadBSS,
+
+
+           ThreadData,
+
+
+
+
+
+           BSS,
+
+
+
+               BSSLocal,
+
+
+               BSSExtern,
+
+
+
+
+           Common,
+
+
+           Data,
+
+
+
+
+
+
+
+           ReadOnlyWithRel
+  } K : 8;
+public:
+
+  bool isMetadata() const { return K == Metadata; }
+
+  bool isText() const { return K == Text || K == ExecuteOnly; }
+
+  bool isExecuteOnly() const { return K == ExecuteOnly; }
+
+  bool isReadOnly() const {
+    return K == ReadOnly || isMergeableCString() ||
+           isMergeableConst();
+  }
+
+  bool isMergeableCString() const {
+    return K == Mergeable1ByteCString || K == Mergeable2ByteCString ||
+           K == Mergeable4ByteCString;
+  }
+  bool isMergeable1ByteCString() const { return K == Mergeable1ByteCString; }
+  bool isMergeable2ByteCString() const { return K == Mergeable2ByteCString; }
+  bool isMergeable4ByteCString() const { return K == Mergeable4ByteCString; }
+
+  bool isMergeableConst() const {
+    return K == MergeableConst4 || K == MergeableConst8 ||
+           K == MergeableConst16 || K == MergeableConst32;
+  }
+  bool isMergeableConst4() const { return K == MergeableConst4; }
+  bool isMergeableConst8() const { return K == MergeableConst8; }
+  bool isMergeableConst16() const { return K == MergeableConst16; }
+  bool isMergeableConst32() const { return K == MergeableConst32; }
+
+  bool isWriteable() const {
+    return isThreadLocal() || isGlobalWriteableData();
+  }
+
+  bool isThreadLocal() const {
+    return K == ThreadData || K == ThreadBSS;
+  }
+
+  bool isThreadBSS() const { return K == ThreadBSS; }
+  bool isThreadData() const { return K == ThreadData; }
+
+  bool isGlobalWriteableData() const {
+    return isBSS() || isCommon() || isData() || isReadOnlyWithRel();
+  }
+
+  bool isBSS() const { return K == BSS || K == BSSLocal || K == BSSExtern; }
+  bool isBSSLocal() const { return K == BSSLocal; }
+  bool isBSSExtern() const { return K == BSSExtern; }
+
+  bool isCommon() const { return K == Common; }
+
+  bool isData() const { return K == Data; }
+
+  bool isReadOnlyWithRel() const {
+    return K == ReadOnlyWithRel;
+  }
+private:
+  static SectionKind get(Kind K) {
+    SectionKind Res;
+    Res.K = K;
+    return Res;
+  }
+public:
+
+  static SectionKind getMetadata() { return get(Metadata); }
+  static SectionKind getText() { return get(Text); }
+  static SectionKind getExecuteOnly() { return get(ExecuteOnly); }
+  static SectionKind getReadOnly() { return get(ReadOnly); }
+  static SectionKind getMergeable1ByteCString() {
+    return get(Mergeable1ByteCString);
+  }
+  static SectionKind getMergeable2ByteCString() {
+    return get(Mergeable2ByteCString);
+  }
+  static SectionKind getMergeable4ByteCString() {
+    return get(Mergeable4ByteCString);
+  }
+  static SectionKind getMergeableConst4() { return get(MergeableConst4); }
+  static SectionKind getMergeableConst8() { return get(MergeableConst8); }
+  static SectionKind getMergeableConst16() { return get(MergeableConst16); }
+  static SectionKind getMergeableConst32() { return get(MergeableConst32); }
+  static SectionKind getThreadBSS() { return get(ThreadBSS); }
+  static SectionKind getThreadData() { return get(ThreadData); }
+  static SectionKind getBSS() { return get(BSS); }
+  static SectionKind getBSSLocal() { return get(BSSLocal); }
+  static SectionKind getBSSExtern() { return get(BSSExtern); }
+  static SectionKind getCommon() { return get(Common); }
+  static SectionKind getData() { return get(Data); }
+  static SectionKind getReadOnlyWithRel() { return get(ReadOnlyWithRel); }
+};
+
+}
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+namespace llvm {
+
+class MCAsmInfo;
+class MCContext;
+class MCExpr;
+class MCSymbol;
+class raw_ostream;
+class Triple;
+
+template <> struct ilist_alloc_traits<MCFragment> {
+  static void deleteNode(MCFragment *V);
+};
+
+
+
+class MCSection {
+public:
+  enum SectionVariant { SV_COFF = 0, SV_ELF, SV_MachO, SV_Wasm };
+
+
+  enum BundleLockStateType {
+    NotBundleLocked,
+    BundleLocked,
+    BundleLockedAlignToEnd
+  };
+
+  using FragmentListType = iplist<MCFragment>;
+
+  using const_iterator = FragmentListType::const_iterator;
+  using iterator = FragmentListType::iterator;
+
+  using const_reverse_iterator = FragmentListType::const_reverse_iterator;
+  using reverse_iterator = FragmentListType::reverse_iterator;
+
+private:
+  MCSymbol *Begin;
+  MCSymbol *End = nullptr;
+
+  unsigned Alignment = 1;
+
+  unsigned Ordinal = 0;
+
+  unsigned LayoutOrder;
+
+
+  BundleLockStateType BundleLockState = NotBundleLocked;
+
+
+  unsigned BundleLockNestingDepth = 0;
+
+
+
+  bool BundleGroupBeforeFirstInst : 1;
+
+
+  bool HasInstructions : 1;
+
+  bool IsRegistered : 1;
+
+  MCDummyFragment DummyFragment;
+
+  FragmentListType Fragments;
+
+
+
+  SmallVector<std::pair<unsigned, MCFragment *>, 1> SubsectionFragmentMap;
+
+protected:
+  SectionVariant Variant;
+  SectionKind Kind;
+
+  MCSection(SectionVariant V, SectionKind K, MCSymbol *Begin);
+  ~MCSection();
+
+public:
+  MCSection(const MCSection &) = delete;
+  MCSection &operator=(const MCSection &) = delete;
+
+  SectionKind getKind() const { return Kind; }
+
+  SectionVariant getVariant() const { return Variant; }
+
+  MCSymbol *getBeginSymbol() { return Begin; }
+  const MCSymbol *getBeginSymbol() const {
+    return const_cast<MCSection *>(this)->getBeginSymbol();
+  }
+  void setBeginSymbol(MCSymbol *Sym) {
+    
+   ((
+   !Begin
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!Begin"
+   , "/home/trippels/llvm/llvm/include/llvm/MC/MCSection.h", 111, __PRETTY_FUNCTION__))
+                 ;
+    Begin = Sym;
+  }
+  MCSymbol *getEndSymbol(MCContext &Ctx);
+  bool hasEnded() const;
+
+  unsigned getAlignment() const { return Alignment; }
+  void setAlignment(unsigned Value) { Alignment = Value; }
+
+  unsigned getOrdinal() const { return Ordinal; }
+  void setOrdinal(unsigned Value) { Ordinal = Value; }
+
+  unsigned getLayoutOrder() const { return LayoutOrder; }
+  void setLayoutOrder(unsigned Value) { LayoutOrder = Value; }
+
+  BundleLockStateType getBundleLockState() const { return BundleLockState; }
+  void setBundleLockState(BundleLockStateType NewState);
+  bool isBundleLocked() const { return BundleLockState != NotBundleLocked; }
+
+  bool isBundleGroupBeforeFirstInst() const {
+    return BundleGroupBeforeFirstInst;
+  }
+  void setBundleGroupBeforeFirstInst(bool IsFirst) {
+    BundleGroupBeforeFirstInst = IsFirst;
+  }
+
+  bool hasInstructions() const { return HasInstructions; }
+  void setHasInstructions(bool Value) { HasInstructions = Value; }
+
+  bool isRegistered() const { return IsRegistered; }
+  void setIsRegistered(bool Value) { IsRegistered = Value; }
+
+  MCSection::FragmentListType &getFragmentList() { return Fragments; }
+  const MCSection::FragmentListType &getFragmentList() const {
+    return const_cast<MCSection *>(this)->getFragmentList();
+  }
+
+
+  static FragmentListType MCSection::*getSublistAccess(MCFragment *) {
+    return &MCSection::Fragments;
+  }
+
+  const MCDummyFragment &getDummyFragment() const { return DummyFragment; }
+  MCDummyFragment &getDummyFragment() { return DummyFragment; }
+
+  iterator begin() { return Fragments.begin(); }
+  const_iterator begin() const { return Fragments.begin(); }
+
+  iterator end() { return Fragments.end(); }
+  const_iterator end() const { return Fragments.end(); }
+
+  reverse_iterator rbegin() { return Fragments.rbegin(); }
+  const_reverse_iterator rbegin() const { return Fragments.rbegin(); }
+
+  reverse_iterator rend() { return Fragments.rend(); }
+  const_reverse_iterator rend() const { return Fragments.rend(); }
+
+  MCSection::iterator getSubsectionInsertionPoint(unsigned Subsection);
+
+  void dump() const;
+
+  virtual void PrintSwitchToSection(const MCAsmInfo &MAI, const Triple &T,
+                                    raw_ostream &OS,
+                                    const MCExpr *Subsection) const = 0;
+
+
+
+  virtual bool UseCodeAlign() const = 0;
+
+
+
+  virtual bool isVirtualSection() const = 0;
+};
+
+}
+
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+
+
+namespace llvm {
+
+template <typename T> class ArrayRef;
+class MCAsmBackend;
+class MCContext;
+class MCObjectStreamer;
+class MCStreamer;
+class MCSymbol;
+class raw_ostream;
+class SMLoc;
+class SourceMgr;
+
+
+
+
+
+
+struct MCDwarfFile {
+
+
+  std::string Name;
+
+
+  unsigned DirIndex;
+
+
+
+  MD5::MD5Result *Checksum = nullptr;
+};
+
+
+
+class MCDwarfLoc {
+  uint32_t FileNum;
+  uint32_t Line;
+  uint16_t Column;
+
+  uint8_t Flags;
+  uint8_t Isa;
+  uint32_t Discriminator;
+private:
+  friend class MCContext;
+  friend class MCDwarfLineEntry;
+
+  MCDwarfLoc(unsigned fileNum, unsigned line, unsigned column, unsigned flags,
+             unsigned isa, unsigned discriminator)
+      : FileNum(fileNum), Line(line), Column(column), Flags(flags), Isa(isa),
+        Discriminator(discriminator) {}
+
+
+
+
+public:
+
+  unsigned getFileNum() const { return FileNum; }
+
+
+  unsigned getLine() const { return Line; }
+
+
+  unsigned getColumn() const { return Column; }
+
+
+  unsigned getFlags() const { return Flags; }
+
+
+  unsigned getIsa() const { return Isa; }
+
+
+  unsigned getDiscriminator() const { return Discriminator; }
+
+
+  void setFileNum(unsigned fileNum) { FileNum = fileNum; }
+
+
+  void setLine(unsigned line) { Line = line; }
+
+
+  void setColumn(unsigned column) {
+    
+   ((
+   column <= 
+   (65535)) ? static_cast<void> (0) : __assert_fail (
+   "column <= (65535)"
+   , "/home/trippels/llvm/llvm/include/llvm/MC/MCDwarf.h", 118, __PRETTY_FUNCTION__))
+                               ;
+    Column = column;
+  }
+
+
+  void setFlags(unsigned flags) {
+    
+   ((
+   flags <= 
+   (255)) ? static_cast<void> (0) : __assert_fail (
+   "flags <= (255)"
+   , "/home/trippels/llvm/llvm/include/llvm/MC/MCDwarf.h", 124, __PRETTY_FUNCTION__))
+                             ;
+    Flags = flags;
+  }
+
+
+  void setIsa(unsigned isa) {
+    
+   ((
+   isa <= 
+   (255)) ? static_cast<void> (0) : __assert_fail (
+   "isa <= (255)"
+   , "/home/trippels/llvm/llvm/include/llvm/MC/MCDwarf.h", 130, __PRETTY_FUNCTION__))
+                           ;
+    Isa = isa;
+  }
+
+
+  void setDiscriminator(unsigned discriminator) {
+    Discriminator = discriminator;
+  }
+};
+
+
+
+
+
+
+class MCDwarfLineEntry : public MCDwarfLoc {
+  MCSymbol *Label;
+
+private:
+
+
+
+public:
+
+  MCDwarfLineEntry(MCSymbol *label, const MCDwarfLoc loc)
+      : MCDwarfLoc(loc), Label(label) {}
+
+  MCSymbol *getLabel() const { return Label; }
+
+
+
+
+  static void Make(MCObjectStreamer *MCOS, MCSection *Section);
+};
+
+
+
+
+
+class MCLineSection {
+public:
+
+  void addLineEntry(const MCDwarfLineEntry &LineEntry, MCSection *Sec) {
+    MCLineDivisions[Sec].push_back(LineEntry);
+  }
+
+  using MCDwarfLineEntryCollection = std::vector<MCDwarfLineEntry>;
+  using iterator = MCDwarfLineEntryCollection::iterator;
+  using const_iterator = MCDwarfLineEntryCollection::const_iterator;
+  using MCLineDivisionMap = MapVector<MCSection *, MCDwarfLineEntryCollection>;
+
+private:
+
+  MCLineDivisionMap MCLineDivisions;
+
+public:
+
+  const MCLineDivisionMap &getMCLineEntries() const {
+    return MCLineDivisions;
+  }
+};
+
+struct MCDwarfLineTableParams {
+
+
+
+
+  uint8_t DWARF2LineOpcodeBase = 13;
+
+
+  int8_t DWARF2LineBase = -5;
+
+  uint8_t DWARF2LineRange = 14;
+};
+
+struct MCDwarfLineTableHeader {
+  MCSymbol *Label = nullptr;
+  SmallVector<std::string, 3> MCDwarfDirs;
+  SmallVector<MCDwarfFile, 3> MCDwarfFiles;
+  StringMap<unsigned> SourceIdMap;
+  StringRef CompilationDir;
+  bool HasMD5 = false;
+
+  MCDwarfLineTableHeader() = default;
+
+  unsigned getFile(StringRef &Directory, StringRef &FileName,
+                   MD5::MD5Result *Checksum, unsigned FileNumber = 0);
+  std::pair<MCSymbol *, MCSymbol *> Emit(MCStreamer *MCOS,
+                                         MCDwarfLineTableParams Params) const;
+  std::pair<MCSymbol *, MCSymbol *>
+  Emit(MCStreamer *MCOS, MCDwarfLineTableParams Params,
+       ArrayRef<char> SpecialOpcodeLengths) const;
+};
+
+class MCDwarfDwoLineTable {
+  MCDwarfLineTableHeader Header;
+
+public:
+  void setCompilationDir(StringRef CompilationDir) {
+    Header.CompilationDir = CompilationDir;
+  }
+
+  unsigned getFile(StringRef Directory, StringRef FileName,
+                   MD5::MD5Result *Checksum) {
+    return Header.getFile(Directory, FileName, Checksum);
+  }
+
+  void Emit(MCStreamer &MCOS, MCDwarfLineTableParams Params) const;
+};
+
+class MCDwarfLineTable {
+  MCDwarfLineTableHeader Header;
+  MCLineSection MCLineSections;
+
+public:
+
+  static void Emit(MCObjectStreamer *MCOS, MCDwarfLineTableParams Params);
+
+
+  void EmitCU(MCObjectStreamer *MCOS, MCDwarfLineTableParams Params) const;
+
+  unsigned getFile(StringRef &Directory, StringRef &FileName,
+                   MD5::MD5Result *Checksum, unsigned FileNumber = 0);
+
+  MCSymbol *getLabel() const {
+    return Header.Label;
+  }
+
+  void setLabel(MCSymbol *Label) {
+    Header.Label = Label;
+  }
+
+  void setCompilationDir(StringRef CompilationDir) {
+    Header.CompilationDir = CompilationDir;
+  }
+
+  const SmallVectorImpl<std::string> &getMCDwarfDirs() const {
+    return Header.MCDwarfDirs;
+  }
+
+  SmallVectorImpl<std::string> &getMCDwarfDirs() {
+    return Header.MCDwarfDirs;
+  }
+
+  const SmallVectorImpl<MCDwarfFile> &getMCDwarfFiles() const {
+    return Header.MCDwarfFiles;
+  }
+
+  SmallVectorImpl<MCDwarfFile> &getMCDwarfFiles() {
+    return Header.MCDwarfFiles;
+  }
+
+  const MCLineSection &getMCLineSections() const {
+    return MCLineSections;
+  }
+  MCLineSection &getMCLineSections() {
+    return MCLineSections;
+  }
+};
+
+class MCDwarfLineAddr {
+public:
+
+  static void Encode(MCContext &Context, MCDwarfLineTableParams Params,
+                     int64_t LineDelta, uint64_t AddrDelta, raw_ostream &OS);
+
+
+  static void Emit(MCStreamer *MCOS, MCDwarfLineTableParams Params,
+                   int64_t LineDelta, uint64_t AddrDelta);
+};
+
+class MCGenDwarfInfo {
+public:
+
+
+
+
+  static void Emit(MCStreamer *MCOS);
+};
+
+
+
+class MCGenDwarfLabelEntry {
+private:
+
+  StringRef Name;
+
+  unsigned FileNumber;
+
+  unsigned LineNumber;
+
+  MCSymbol *Label;
+
+public:
+  MCGenDwarfLabelEntry(StringRef name, unsigned fileNumber, unsigned lineNumber,
+                       MCSymbol *label)
+      : Name(name), FileNumber(fileNumber), LineNumber(lineNumber),
+        Label(label) {}
+
+  StringRef getName() const { return Name; }
+  unsigned getFileNumber() const { return FileNumber; }
+  unsigned getLineNumber() const { return LineNumber; }
+  MCSymbol *getLabel() const { return Label; }
+
+
+
+  static void Make(MCSymbol *Symbol, MCStreamer *MCOS, SourceMgr &SrcMgr,
+                   SMLoc &Loc);
+};
+
+class MCCFIInstruction {
+public:
+  enum OpType {
+    OpSameValue,
+    OpRememberState,
+    OpRestoreState,
+    OpOffset,
+    OpDefCfaRegister,
+    OpDefCfaOffset,
+    OpDefCfa,
+    OpRelOffset,
+    OpAdjustCfaOffset,
+    OpEscape,
+    OpRestore,
+    OpUndefined,
+    OpRegister,
+    OpWindowSave,
+    OpGnuArgsSize
+  };
+
+private:
+  OpType Operation;
+  MCSymbol *Label;
+  unsigned Register;
+  union {
+    int Offset;
+    unsigned Register2;
+  };
+  std::vector<char> Values;
+
+  MCCFIInstruction(OpType Op, MCSymbol *L, unsigned R, int O, StringRef V)
+      : Operation(Op), Label(L), Register(R), Offset(O),
+        Values(V.begin(), V.end()) {
+    
+   ((
+   Op != OpRegister
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Op != OpRegister"
+   , "/home/trippels/llvm/llvm/include/llvm/MC/MCDwarf.h", 373, __PRETTY_FUNCTION__))
+                           ;
+  }
+
+  MCCFIInstruction(OpType Op, MCSymbol *L, unsigned R1, unsigned R2)
+      : Operation(Op), Label(L), Register(R1), Register2(R2) {
+    
+   ((
+   Op == OpRegister
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Op == OpRegister"
+   , "/home/trippels/llvm/llvm/include/llvm/MC/MCDwarf.h", 378, __PRETTY_FUNCTION__))
+                           ;
+  }
+
+public:
+
+
+  static MCCFIInstruction createDefCfa(MCSymbol *L, unsigned Register,
+                                       int Offset) {
+    return MCCFIInstruction(OpDefCfa, L, Register, -Offset, "");
+  }
+
+
+
+  static MCCFIInstruction createDefCfaRegister(MCSymbol *L, unsigned Register) {
+    return MCCFIInstruction(OpDefCfaRegister, L, Register, 0, "");
+  }
+
+
+
+
+  static MCCFIInstruction createDefCfaOffset(MCSymbol *L, int Offset) {
+    return MCCFIInstruction(OpDefCfaOffset, L, 0, -Offset, "");
+  }
+
+
+
+
+  static MCCFIInstruction createAdjustCfaOffset(MCSymbol *L, int Adjustment) {
+    return MCCFIInstruction(OpAdjustCfaOffset, L, 0, Adjustment, "");
+  }
+
+
+
+  static MCCFIInstruction createOffset(MCSymbol *L, unsigned Register,
+                                       int Offset) {
+    return MCCFIInstruction(OpOffset, L, Register, Offset, "");
+  }
+
+
+
+
+  static MCCFIInstruction createRelOffset(MCSymbol *L, unsigned Register,
+                                          int Offset) {
+    return MCCFIInstruction(OpRelOffset, L, Register, Offset, "");
+  }
+
+
+
+  static MCCFIInstruction createRegister(MCSymbol *L, unsigned Register1,
+                                         unsigned Register2) {
+    return MCCFIInstruction(OpRegister, L, Register1, Register2);
+  }
+
+
+  static MCCFIInstruction createWindowSave(MCSymbol *L) {
+    return MCCFIInstruction(OpWindowSave, L, 0, 0, "");
+  }
+
+
+
+
+  static MCCFIInstruction createRestore(MCSymbol *L, unsigned Register) {
+    return MCCFIInstruction(OpRestore, L, Register, 0, "");
+  }
+
+
+
+  static MCCFIInstruction createUndefined(MCSymbol *L, unsigned Register) {
+    return MCCFIInstruction(OpUndefined, L, Register, 0, "");
+  }
+
+
+
+  static MCCFIInstruction createSameValue(MCSymbol *L, unsigned Register) {
+    return MCCFIInstruction(OpSameValue, L, Register, 0, "");
+  }
+
+
+  static MCCFIInstruction createRememberState(MCSymbol *L) {
+    return MCCFIInstruction(OpRememberState, L, 0, 0, "");
+  }
+
+
+  static MCCFIInstruction createRestoreState(MCSymbol *L) {
+    return MCCFIInstruction(OpRestoreState, L, 0, 0, "");
+  }
+
+
+
+  static MCCFIInstruction createEscape(MCSymbol *L, StringRef Vals) {
+    return MCCFIInstruction(OpEscape, L, 0, 0, Vals);
+  }
+
+
+  static MCCFIInstruction createGnuArgsSize(MCSymbol *L, int Size) {
+    return MCCFIInstruction(OpGnuArgsSize, L, 0, Size, "");
+  }
+
+  OpType getOperation() const { return Operation; }
+  MCSymbol *getLabel() const { return Label; }
+
+  unsigned getRegister() const {
+    
+   ((
+   Operation == OpDefCfa || Operation == OpOffset || Operation == OpRestore || Operation == OpUndefined || Operation == OpSameValue || Operation == OpDefCfaRegister || Operation == OpRelOffset || Operation == OpRegister
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Operation == OpDefCfa || Operation == OpOffset || Operation == OpRestore || Operation == OpUndefined || Operation == OpSameValue || Operation == OpDefCfaRegister || Operation == OpRelOffset || Operation == OpRegister"
+   ,
+
+
+                                                              "/home/trippels/llvm/llvm/include/llvm/MC/MCDwarf.h"
+    ,
+
+
+                                                              483
+    , __PRETTY_FUNCTION__))
+
+
+                                                               
+                                                              ;
+    return Register;
+  }
+
+  unsigned getRegister2() const {
+    
+   ((
+   Operation == OpRegister
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Operation == OpRegister"
+   , "/home/trippels/llvm/llvm/include/llvm/MC/MCDwarf.h", 488, __PRETTY_FUNCTION__))
+                                  ;
+    return Register2;
+  }
+
+  int getOffset() const {
+    
+   ((
+   Operation == OpDefCfa || Operation == OpOffset || Operation == OpRelOffset || Operation == OpDefCfaOffset || Operation == OpAdjustCfaOffset || Operation == OpGnuArgsSize
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Operation == OpDefCfa || Operation == OpOffset || Operation == OpRelOffset || Operation == OpDefCfaOffset || Operation == OpAdjustCfaOffset || Operation == OpGnuArgsSize"
+   ,
+
+                                                                       "/home/trippels/llvm/llvm/include/llvm/MC/MCDwarf.h"
+    ,
+
+                                                                       495
+    , __PRETTY_FUNCTION__))
+
+                                                                        
+                                                                       ;
+    return Offset;
+  }
+
+  StringRef getValues() const {
+    
+   ((
+   Operation == OpEscape
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Operation == OpEscape"
+   , "/home/trippels/llvm/llvm/include/llvm/MC/MCDwarf.h", 500, __PRETTY_FUNCTION__))
+                                ;
+    return StringRef(&Values[0], Values.size());
+  }
+};
+
+struct MCDwarfFrameInfo {
+  MCDwarfFrameInfo() = default;
+
+  MCSymbol *Begin = nullptr;
+  MCSymbol *End = nullptr;
+  const MCSymbol *Personality = nullptr;
+  const MCSymbol *Lsda = nullptr;
+  std::vector<MCCFIInstruction> Instructions;
+  unsigned CurrentCfaRegister = 0;
+  unsigned PersonalityEncoding = 0;
+  unsigned LsdaEncoding = 0;
+  uint32_t CompactUnwindEncoding = 0;
+  bool IsSignalFrame = false;
+  bool IsSimple = false;
+  unsigned RAReg = static_cast<unsigned>(0x7fffffff);
+};
+
+class MCDwarfFrameEmitter {
+public:
+
+
+
+  static void Emit(MCObjectStreamer &streamer, MCAsmBackend *MAB, bool isEH);
+  static void EmitAdvanceLoc(MCObjectStreamer &Streamer, uint64_t AddrDelta);
+  static void EncodeAdvanceLoc(MCContext &Context, uint64_t AddrDelta,
+                               raw_ostream &OS);
+};
+
+}
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+namespace llvm {
+
+class MCAsmInfo;
+class MCContext;
+class MCExpr;
+class MCSection;
+class raw_ostream;
+class MCSymbol {
+protected:
+
+
+  enum SymbolKind {
+    SymbolKindUnset,
+    SymbolKindCOFF,
+    SymbolKindELF,
+    SymbolKindMachO,
+    SymbolKindWasm,
+  };
+
+
+
+  enum Contents : uint8_t {
+    SymContentsUnset,
+    SymContentsOffset,
+    SymContentsVariable,
+    SymContentsCommon,
+  };
+
+
+  static MCFragment *AbsolutePseudoFragment;
+  mutable PointerIntPair<MCFragment *, 1> FragmentAndHasName;
+
+
+
+
+  unsigned IsTemporary : 1;
+
+
+  unsigned IsRedefinable : 1;
+
+
+  mutable unsigned IsUsed : 1;
+
+  mutable unsigned IsRegistered : 1;
+
+
+  mutable unsigned IsExternal : 1;
+
+
+  mutable unsigned IsPrivateExtern : 1;
+
+
+
+  unsigned Kind : 3;
+
+
+  mutable unsigned IsUsedInReloc : 1;
+
+
+
+  unsigned SymbolContents : 2;
+
+
+
+
+
+
+  enum : unsigned { NumCommonAlignmentBits = 5 };
+  unsigned CommonAlignLog2 : NumCommonAlignmentBits;
+
+
+
+  enum : unsigned { NumFlagsBits = 16 };
+  mutable uint32_t Flags : NumFlagsBits;
+
+
+  mutable uint32_t Index = 0;
+
+  union {
+
+    uint64_t Offset;
+
+
+    uint64_t CommonSize;
+
+
+    const MCExpr *Value;
+  };
+
+
+  friend class MCExpr;
+  friend class MCContext;
+
+
+
+
+
+  using NameEntryStorageTy = union {
+    const StringMapEntry<bool> *NameEntry;
+    uint64_t AlignmentPadding;
+  };
+
+  MCSymbol(SymbolKind Kind, const StringMapEntry<bool> *Name, bool isTemporary)
+      : IsTemporary(isTemporary), IsRedefinable(false), IsUsed(false),
+        IsRegistered(false), IsExternal(false), IsPrivateExtern(false),
+        Kind(Kind), IsUsedInReloc(false), SymbolContents(SymContentsUnset),
+        CommonAlignLog2(0), Flags(0) {
+    Offset = 0;
+    FragmentAndHasName.setInt(!!Name);
+    if (Name)
+      getNameEntryPtr() = Name;
+  }
+
+
+
+  void *operator new(size_t s, const StringMapEntry<bool> *Name,
+                     MCContext &Ctx);
+
+private:
+  void operator delete(void *);
+
+  void operator delete(void*, unsigned) {
+    ::llvm::llvm_unreachable_internal("Constructor throws?", "/home/trippels/llvm/llvm/include/llvm/MC/MCSymbol.h", 173);
+  }
+
+  void operator delete(void*, unsigned, bool) {
+    ::llvm::llvm_unreachable_internal("Constructor throws?", "/home/trippels/llvm/llvm/include/llvm/MC/MCSymbol.h", 177);
+  }
+
+  MCSection *getSectionPtr(bool SetUsed = true) const {
+    if (MCFragment *F = getFragment(SetUsed)) {
+      
+     ((
+     F != AbsolutePseudoFragment
+     ) ? static_cast<void> (0) : __assert_fail (
+     "F != AbsolutePseudoFragment"
+     , "/home/trippels/llvm/llvm/include/llvm/MC/MCSymbol.h", 182, __PRETTY_FUNCTION__))
+                                        ;
+      return F->getParent();
+    }
+    return nullptr;
+  }
+
+
+  const StringMapEntry<bool> *&getNameEntryPtr() {
+    
+   ((
+   FragmentAndHasName.getInt() && "Name is required"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "FragmentAndHasName.getInt() && \"Name is required\""
+   , "/home/trippels/llvm/llvm/include/llvm/MC/MCSymbol.h", 190, __PRETTY_FUNCTION__))
+                                                            ;
+    NameEntryStorageTy *Name = reinterpret_cast<NameEntryStorageTy *>(this);
+    return (*(Name - 1)).NameEntry;
+  }
+  const StringMapEntry<bool> *&getNameEntryPtr() const {
+    return const_cast<MCSymbol*>(this)->getNameEntryPtr();
+  }
+
+public:
+  MCSymbol(const MCSymbol &) = delete;
+  MCSymbol &operator=(const MCSymbol &) = delete;
+
+
+  StringRef getName() const {
+    if (!FragmentAndHasName.getInt())
+      return StringRef();
+
+    return getNameEntryPtr()->first();
+  }
+
+  bool isRegistered() const { return IsRegistered; }
+  void setIsRegistered(bool Value) const { IsRegistered = Value; }
+
+  void setUsedInReloc() const { IsUsedInReloc = true; }
+  bool isUsedInReloc() const { return IsUsedInReloc; }
+
+
+
+
+
+  bool isTemporary() const { return IsTemporary; }
+
+
+  bool isUsed() const { return IsUsed; }
+  void setUsed(bool Value) const { IsUsed |= Value; }
+
+
+  bool isRedefinable() const { return IsRedefinable; }
+
+  void setRedefinable(bool Value) { IsRedefinable = Value; }
+
+  void redefineIfPossible() {
+    if (IsRedefinable) {
+      if (SymbolContents == SymContentsVariable) {
+        Value = nullptr;
+        SymbolContents = SymContentsUnset;
+      }
+      setUndefined();
+      IsRedefinable = false;
+    }
+  }
+  bool isDefined(bool SetUsed = true) const {
+    return getFragment(SetUsed) != nullptr;
+  }
+
+
+
+  bool isInSection(bool SetUsed = true) const {
+    return isDefined(SetUsed) && !isAbsolute(SetUsed);
+  }
+
+
+  bool isUndefined(bool SetUsed = true) const { return !isDefined(SetUsed); }
+
+
+  bool isAbsolute(bool SetUsed = true) const {
+    return getFragment(SetUsed) == AbsolutePseudoFragment;
+  }
+
+
+  MCSection &getSection(bool SetUsed = true) const {
+    
+   ((
+   isInSection(SetUsed) && "Invalid accessor!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isInSection(SetUsed) && \"Invalid accessor!\""
+   , "/home/trippels/llvm/llvm/include/llvm/MC/MCSymbol.h", 269, __PRETTY_FUNCTION__))
+                                                      ;
+    return *getSectionPtr(SetUsed);
+  }
+
+
+  void setFragment(MCFragment *F) const {
+    
+   ((
+   !isVariable() && "Cannot set fragment of variable"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!isVariable() && \"Cannot set fragment of variable\""
+   , "/home/trippels/llvm/llvm/include/llvm/MC/MCSymbol.h", 275, __PRETTY_FUNCTION__))
+                                                             ;
+    FragmentAndHasName.setPointer(F);
+  }
+
+
+  void setUndefined() { FragmentAndHasName.setPointer(nullptr); }
+
+  bool isELF() const { return Kind == SymbolKindELF; }
+
+  bool isCOFF() const { return Kind == SymbolKindCOFF; }
+
+  bool isMachO() const { return Kind == SymbolKindMachO; }
+
+  bool isWasm() const { return Kind == SymbolKindWasm; }
+
+
+
+
+
+
+  bool isVariable() const {
+    return SymbolContents == SymContentsVariable;
+  }
+
+
+  const MCExpr *getVariableValue(bool SetUsed = true) const {
+    
+   ((
+   isVariable() && "Invalid accessor!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isVariable() && \"Invalid accessor!\""
+   , "/home/trippels/llvm/llvm/include/llvm/MC/MCSymbol.h", 301, __PRETTY_FUNCTION__))
+                                              ;
+    IsUsed |= SetUsed;
+    return Value;
+  }
+
+  void setVariableValue(const MCExpr *Value);
+
+
+
+
+  uint32_t getIndex() const {
+    return Index;
+  }
+
+
+  void setIndex(uint32_t Value) const {
+    Index = Value;
+  }
+
+  uint64_t getOffset() const {
+    
+   ((
+   (SymbolContents == SymContentsUnset || SymbolContents == SymContentsOffset) && "Cannot get offset for a common/variable symbol"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "(SymbolContents == SymContentsUnset || SymbolContents == SymContentsOffset) && \"Cannot get offset for a common/variable symbol\""
+   ,
+
+                                                           "/home/trippels/llvm/llvm/include/llvm/MC/MCSymbol.h"
+    ,
+
+                                                           323
+    , __PRETTY_FUNCTION__))
+
+                                                            
+                                                           ;
+    return Offset;
+  }
+  void setOffset(uint64_t Value) {
+    
+   ((
+   (SymbolContents == SymContentsUnset || SymbolContents == SymContentsOffset) && "Cannot set offset for a common/variable symbol"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "(SymbolContents == SymContentsUnset || SymbolContents == SymContentsOffset) && \"Cannot set offset for a common/variable symbol\""
+   ,
+
+                                                           "/home/trippels/llvm/llvm/include/llvm/MC/MCSymbol.h"
+    ,
+
+                                                           329
+    , __PRETTY_FUNCTION__))
+
+                                                            
+                                                           ;
+    Offset = Value;
+    SymbolContents = SymContentsOffset;
+  }
+
+
+  uint64_t getCommonSize() const {
+    
+   ((
+   isCommon() && "Not a 'common' symbol!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isCommon() && \"Not a 'common' symbol!\""
+   , "/home/trippels/llvm/llvm/include/llvm/MC/MCSymbol.h", 336, __PRETTY_FUNCTION__))
+                                                 ;
+    return CommonSize;
+  }
+
+
+
+
+
+  void setCommon(uint64_t Size, unsigned Align) {
+    
+   ((
+   getOffset() == 0
+   ) ? static_cast<void> (0) : __assert_fail (
+   "getOffset() == 0"
+   , "/home/trippels/llvm/llvm/include/llvm/MC/MCSymbol.h", 345, __PRETTY_FUNCTION__))
+                           ;
+    CommonSize = Size;
+    SymbolContents = SymContentsCommon;
+
+    
+   ((
+   (!Align || isPowerOf2_32(Align)) && "Alignment must be a power of 2"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "(!Align || isPowerOf2_32(Align)) && \"Alignment must be a power of 2\""
+   ,
+                                           "/home/trippels/llvm/llvm/include/llvm/MC/MCSymbol.h"
+    ,
+                                           350
+    , __PRETTY_FUNCTION__))
+                                            
+                                           ;
+    unsigned Log2Align = Log2_32(Align) + 1;
+    
+   ((
+   Log2Align < (1U << NumCommonAlignmentBits) && "Out of range alignment"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Log2Align < (1U << NumCommonAlignmentBits) && \"Out of range alignment\""
+   ,
+                                   "/home/trippels/llvm/llvm/include/llvm/MC/MCSymbol.h"
+    ,
+                                   353
+    , __PRETTY_FUNCTION__))
+                                    
+                                   ;
+    CommonAlignLog2 = Log2Align;
+  }
+
+
+  unsigned getCommonAlignment() const {
+    
+   ((
+   isCommon() && "Not a 'common' symbol!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isCommon() && \"Not a 'common' symbol!\""
+   , "/home/trippels/llvm/llvm/include/llvm/MC/MCSymbol.h", 359, __PRETTY_FUNCTION__))
+                                                 ;
+    return CommonAlignLog2 ? (1U << (CommonAlignLog2 - 1)) : 0;
+  }
+
+
+
+
+
+
+  bool declareCommon(uint64_t Size, unsigned Align) {
+    
+   ((
+   isCommon() || getOffset() == 0
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isCommon() || getOffset() == 0"
+   , "/home/trippels/llvm/llvm/include/llvm/MC/MCSymbol.h", 369, __PRETTY_FUNCTION__))
+                                         ;
+    if(isCommon()) {
+      if(CommonSize != Size || getCommonAlignment() != Align)
+       return true;
+    } else
+      setCommon(Size, Align);
+    return false;
+  }
+
+
+  bool isCommon() const {
+    return SymbolContents == SymContentsCommon;
+  }
+
+  MCFragment *getFragment(bool SetUsed = true) const {
+    MCFragment *Fragment = FragmentAndHasName.getPointer();
+    if (Fragment || !isVariable())
+      return Fragment;
+    Fragment = getVariableValue(SetUsed)->findAssociatedFragment();
+    FragmentAndHasName.setPointer(Fragment);
+    return Fragment;
+  }
+
+  bool isExternal() const { return IsExternal; }
+  void setExternal(bool Value) const { IsExternal = Value; }
+
+  bool isPrivateExtern() const { return IsPrivateExtern; }
+  void setPrivateExtern(bool Value) { IsPrivateExtern = Value; }
+
+
+  void print(raw_ostream &OS, const MCAsmInfo *MAI) const;
+
+
+  void dump() const;
+
+protected:
+
+  uint32_t getFlags() const { return Flags; }
+
+
+  void setFlags(uint32_t Value) const {
+    
+   ((
+   Value < (1U << NumFlagsBits) && "Out of range flags"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Value < (1U << NumFlagsBits) && \"Out of range flags\""
+   , "/home/trippels/llvm/llvm/include/llvm/MC/MCSymbol.h", 410, __PRETTY_FUNCTION__))
+                                                               ;
+    Flags = Value;
+  }
+
+
+  void modifyFlags(uint32_t Value, uint32_t Mask) const {
+    
+   ((
+   Value < (1U << NumFlagsBits) && "Out of range flags"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Value < (1U << NumFlagsBits) && \"Out of range flags\""
+   , "/home/trippels/llvm/llvm/include/llvm/MC/MCSymbol.h", 416, __PRETTY_FUNCTION__))
+                                                               ;
+    Flags = (Flags & ~Mask) | Value;
+  }
+};
+
+inline raw_ostream &operator<<(raw_ostream &OS, const MCSymbol &Sym) {
+  Sym.print(OS, nullptr);
+  return OS;
+}
+
+}
+
+
+
+
+
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+namespace llvm {
+
+
+
+
+void PrintRecyclerStats(size_t Size, size_t Align, size_t FreeListSize);
+
+
+
+
+
+template <class T, size_t Size = sizeof(T), size_t Align = alignof(T)>
+class Recycler {
+  struct FreeNode {
+    FreeNode *Next;
+  };
+
+
+  FreeNode *FreeList = nullptr;
+
+  FreeNode *pop_val() {
+    auto *Val = FreeList;
+    ;
+    FreeList = FreeList->Next;
+    ;
+    return Val;
+  }
+
+  void push(FreeNode *N) {
+    N->Next = FreeList;
+    FreeList = N;
+    ;
+  }
+
+public:
+  ~Recycler() {
+
+
+
+    
+   ((
+   !FreeList && "Non-empty recycler deleted!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!FreeList && \"Non-empty recycler deleted!\""
+   , "/home/trippels/llvm/llvm/include/llvm/Support/Recycler.h", 62, __PRETTY_FUNCTION__))
+                                                     ;
+  }
+
+
+
+
+  template<class AllocatorType>
+  void clear(AllocatorType &Allocator) {
+    while (FreeList) {
+      T *t = reinterpret_cast<T *>(pop_val());
+      Allocator.Deallocate(t);
+    }
+  }
+
+
+
+
+
+
+  void clear(BumpPtrAllocator &) { FreeList = nullptr; }
+
+  template<class SubClass, class AllocatorType>
+  SubClass *Allocate(AllocatorType &Allocator) {
+    static_assert(alignof(SubClass) <= Align,
+                  "Recycler allocation alignment is less than object align!");
+    static_assert(sizeof(SubClass) <= Size,
+                  "Recycler allocation size is less than object size!");
+    return FreeList ? reinterpret_cast<SubClass *>(pop_val())
+                    : static_cast<SubClass *>(Allocator.Allocate(Size, Align));
+  }
+
+  template<class AllocatorType>
+  T *Allocate(AllocatorType &Allocator) {
+    return Allocate<T>(Allocator);
+  }
+
+  template<class SubClass, class AllocatorType>
+  void Deallocate(AllocatorType & , SubClass* Element) {
+    push(reinterpret_cast<FreeNode *>(Element));
+  }
+
+  void PrintStats();
+};
+
+template <class T, size_t Size, size_t Align>
+void Recycler<T, Size, Align>::PrintStats() {
+  size_t S = 0;
+  for (auto *I = FreeList; I; I = I->Next)
+    ++S;
+  PrintRecyclerStats(Size, Align, S);
+}
+
+}
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+
+
+namespace llvm {
+
+class BasicBlock;
+class BlockAddress;
+class DataLayout;
+class DIExpression;
+class DILocalVariable;
+class DILocation;
+class Function;
+class GlobalValue;
+class MachineConstantPool;
+class MachineFrameInfo;
+class MachineFunction;
+class MachineJumpTableInfo;
+class MachineModuleInfo;
+class MachineRegisterInfo;
+class MCContext;
+class MCInstrDesc;
+class Pass;
+class PseudoSourceValueManager;
+class raw_ostream;
+class SlotIndexes;
+class TargetMachine;
+class TargetRegisterClass;
+class TargetSubtargetInfo;
+struct WinEHFuncInfo;
+
+template <> struct ilist_alloc_traits<MachineBasicBlock> {
+  void deleteNode(MachineBasicBlock *MBB);
+};
+
+template <> struct ilist_callback_traits<MachineBasicBlock> {
+  void addNodeToList(MachineBasicBlock* MBB);
+  void removeNodeFromList(MachineBasicBlock* MBB);
+
+  template <class Iterator>
+  void transferNodesFromList(ilist_callback_traits &OldList, Iterator, Iterator) {
+    ::llvm::llvm_unreachable_internal("Never transfer between lists", "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineFunction.h", 88);
+  }
+};
+
+
+
+
+
+struct MachineFunctionInfo {
+  virtual ~MachineFunctionInfo();
+
+
+
+
+
+  template<typename Ty>
+  static Ty *create(BumpPtrAllocator &Allocator, MachineFunction &MF) {
+    return new (Allocator.Allocate<Ty>()) Ty(MF);
+  }
+};
+
+
+
+
+class MachineFunctionProperties {
+
+
+
+
+
+public:
+  enum class Property : unsigned {
+    IsSSA,
+    NoPHIs,
+    TracksLiveness,
+    NoVRegs,
+    FailedISel,
+    Legalized,
+    RegBankSelected,
+    Selected,
+    LastProperty = Selected,
+  };
+
+  bool hasProperty(Property P) const {
+    return Properties[static_cast<unsigned>(P)];
+  }
+
+  MachineFunctionProperties &set(Property P) {
+    Properties.set(static_cast<unsigned>(P));
+    return *this;
+  }
+
+  MachineFunctionProperties &reset(Property P) {
+    Properties.reset(static_cast<unsigned>(P));
+    return *this;
+  }
+
+
+  MachineFunctionProperties &reset() {
+    Properties.reset();
+    return *this;
+  }
+
+  MachineFunctionProperties &set(const MachineFunctionProperties &MFP) {
+    Properties |= MFP.Properties;
+    return *this;
+  }
+
+  MachineFunctionProperties &reset(const MachineFunctionProperties &MFP) {
+    Properties.reset(MFP.Properties);
+    return *this;
+  }
+
+
+
+  bool verifyRequiredProperties(const MachineFunctionProperties &V) const {
+    return !V.Properties.test(Properties);
+  }
+
+
+  void print(raw_ostream &OS) const;
+
+private:
+  BitVector Properties =
+      BitVector(static_cast<unsigned>(Property::LastProperty)+1);
+};
+
+struct SEHHandler {
+
+  const Function *FilterOrFinally;
+
+
+  const BlockAddress *RecoverBA;
+};
+
+
+struct LandingPadInfo {
+  MachineBasicBlock *LandingPadBlock;
+  SmallVector<MCSymbol *, 1> BeginLabels;
+  SmallVector<MCSymbol *, 1> EndLabels;
+  SmallVector<SEHHandler, 1> SEHHandlers;
+  MCSymbol *LandingPadLabel = nullptr;
+  std::vector<int> TypeIds;
+
+  explicit LandingPadInfo(MachineBasicBlock *MBB)
+      : LandingPadBlock(MBB) {}
+};
+
+class MachineFunction {
+  const Function &F;
+  const TargetMachine &Target;
+  const TargetSubtargetInfo *STI;
+  MCContext &Ctx;
+  MachineModuleInfo &MMI;
+
+
+  MachineRegisterInfo *RegInfo;
+
+
+
+  MachineFunctionInfo *MFInfo;
+
+
+  MachineFrameInfo *FrameInfo;
+
+
+  MachineConstantPool *ConstantPool;
+
+
+  MachineJumpTableInfo *JumpTableInfo;
+
+
+
+  WinEHFuncInfo *WinEHInfo = nullptr;
+
+
+
+
+  std::vector<MachineBasicBlock*> MBBNumbering;
+
+
+  BumpPtrAllocator Allocator;
+
+
+  Recycler<MachineInstr> InstructionRecycler;
+
+
+  ArrayRecycler<MachineOperand> OperandRecycler;
+
+
+  Recycler<MachineBasicBlock> BasicBlockRecycler;
+
+
+  using BasicBlockListType = ilist<MachineBasicBlock>;
+  BasicBlockListType BasicBlocks;
+
+
+
+
+  unsigned FunctionNumber;
+
+
+  unsigned Alignment;
+
+
+
+
+
+
+  bool ExposesReturnsTwice = false;
+
+
+  bool HasInlineAsm = false;
+
+
+  Optional<bool> HasWinCFI;
+
+
+
+  MachineFunctionProperties Properties;
+
+
+  std::unique_ptr<PseudoSourceValueManager> PSVManager;
+
+
+
+  std::vector<MCCFIInstruction> FrameInstructions;
+
+
+
+
+
+  std::vector<LandingPadInfo> LandingPads;
+
+
+  DenseMap<MCSymbol*, SmallVector<unsigned, 4>> LPadToCallSiteMap;
+
+
+  DenseMap<MCSymbol*, unsigned> CallSiteMap;
+
+
+  std::vector<std::pair<MCSymbol *, MDNode *>> CodeViewAnnotations;
+
+  bool CallsEHReturn = false;
+  bool CallsUnwindInit = false;
+  bool HasEHFunclets = false;
+
+
+  std::vector<const GlobalValue *> TypeInfos;
+
+
+  std::vector<unsigned> FilterIds;
+
+
+  std::vector<unsigned> FilterEnds;
+
+  EHPersonality PersonalityTypeCache = EHPersonality::Unknown;
+  void clear();
+
+
+
+  void init();
+
+public:
+  struct VariableDbgInfo {
+    const DILocalVariable *Var;
+    const DIExpression *Expr;
+    unsigned Slot;
+    const DILocation *Loc;
+
+    VariableDbgInfo(const DILocalVariable *Var, const DIExpression *Expr,
+                    unsigned Slot, const DILocation *Loc)
+        : Var(Var), Expr(Expr), Slot(Slot), Loc(Loc) {}
+  };
+  using VariableDbgInfoMapTy = SmallVector<VariableDbgInfo, 4>;
+  VariableDbgInfoMapTy VariableDbgInfos;
+
+  MachineFunction(const Function &F, const TargetMachine &TM,
+                  const TargetSubtargetInfo &STI, unsigned FunctionNum,
+                  MachineModuleInfo &MMI);
+  MachineFunction(const MachineFunction &) = delete;
+  MachineFunction &operator=(const MachineFunction &) = delete;
+  ~MachineFunction();
+
+
+  void reset() {
+    clear();
+    init();
+  }
+
+  MachineModuleInfo &getMMI() const { return MMI; }
+  MCContext &getContext() const { return Ctx; }
+
+  PseudoSourceValueManager &getPSVManager() const { return *PSVManager; }
+
+
+  const DataLayout &getDataLayout() const;
+
+
+  const Function &getFunction() const { return F; }
+
+
+  StringRef getName() const;
+
+
+  unsigned getFunctionNumber() const { return FunctionNumber; }
+
+
+  const TargetMachine &getTarget() const { return Target; }
+
+
+
+  const TargetSubtargetInfo &getSubtarget() const { return *STI; }
+  void setSubtarget(const TargetSubtargetInfo *ST) { STI = ST; }
+
+
+
+
+  template<typename STC> const STC &getSubtarget() const {
+    return *static_cast<const STC *>(STI);
+  }
+
+
+  MachineRegisterInfo &getRegInfo() { return *RegInfo; }
+  const MachineRegisterInfo &getRegInfo() const { return *RegInfo; }
+
+
+
+
+  MachineFrameInfo &getFrameInfo() { return *FrameInfo; }
+  const MachineFrameInfo &getFrameInfo() const { return *FrameInfo; }
+
+
+
+
+
+  const MachineJumpTableInfo *getJumpTableInfo() const { return JumpTableInfo; }
+  MachineJumpTableInfo *getJumpTableInfo() { return JumpTableInfo; }
+
+
+
+  MachineJumpTableInfo *getOrCreateJumpTableInfo(unsigned JTEntryKind);
+
+
+
+  MachineConstantPool *getConstantPool() { return ConstantPool; }
+  const MachineConstantPool *getConstantPool() const { return ConstantPool; }
+
+
+
+
+  const WinEHFuncInfo *getWinEHFuncInfo() const { return WinEHInfo; }
+  WinEHFuncInfo *getWinEHFuncInfo() { return WinEHInfo; }
+
+
+  unsigned getAlignment() const { return Alignment; }
+
+
+  void setAlignment(unsigned A) { Alignment = A; }
+
+
+  void ensureAlignment(unsigned A) {
+    if (Alignment < A) Alignment = A;
+  }
+
+
+
+
+  bool exposesReturnsTwice() const {
+    return ExposesReturnsTwice;
+  }
+
+
+
+  void setExposesReturnsTwice(bool B) {
+    ExposesReturnsTwice = B;
+  }
+
+
+  bool hasInlineAsm() const {
+    return HasInlineAsm;
+  }
+
+
+  void setHasInlineAsm(bool B) {
+    HasInlineAsm = B;
+  }
+
+  bool hasWinCFI() const {
+    
+   ((
+   HasWinCFI.hasValue() && "HasWinCFI not set yet!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "HasWinCFI.hasValue() && \"HasWinCFI not set yet!\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineFunction.h", 474, __PRETTY_FUNCTION__))
+                                                           ;
+    return *HasWinCFI;
+  }
+  void setHasWinCFI(bool v) { HasWinCFI = v; }
+
+
+  const MachineFunctionProperties &getProperties() const { return Properties; }
+  MachineFunctionProperties &getProperties() { return Properties; }
+
+
+
+
+  template<typename Ty>
+  Ty *getInfo() {
+    if (!MFInfo)
+      MFInfo = Ty::template create<Ty>(Allocator, *this);
+    return static_cast<Ty*>(MFInfo);
+  }
+
+  template<typename Ty>
+  const Ty *getInfo() const {
+     return const_cast<MachineFunction*>(this)->getInfo<Ty>();
+  }
+
+
+
+
+
+  MachineBasicBlock *getBlockNumbered(unsigned N) const {
+    
+   ((
+   N < MBBNumbering.size() && "Illegal block number"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "N < MBBNumbering.size() && \"Illegal block number\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineFunction.h", 503, __PRETTY_FUNCTION__))
+                                                            ;
+    
+   ((
+   MBBNumbering[N] && "Block was removed from the machine function!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "MBBNumbering[N] && \"Block was removed from the machine function!\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineFunction.h", 504, __PRETTY_FUNCTION__))
+                                                                            ;
+    return MBBNumbering[N];
+  }
+
+
+  bool shouldSplitStack() const;
+
+
+  unsigned getNumBlockIDs() const { return (unsigned)MBBNumbering.size(); }
+
+
+
+
+
+
+  void RenumberBlocks(MachineBasicBlock *MBBFrom = nullptr);
+
+
+
+  void print(raw_ostream &OS, const SlotIndexes* = nullptr) const;
+
+
+
+
+
+
+  void viewCFG() const;
+
+
+
+
+
+
+  void viewCFGOnly() const;
+
+
+  void dump() const;
+
+
+
+
+  bool verify(Pass *p = nullptr, const char *Banner = nullptr,
+              bool AbortOnError = true) const;
+
+
+  using iterator = BasicBlockListType::iterator;
+  using const_iterator = BasicBlockListType::const_iterator;
+  using const_reverse_iterator = BasicBlockListType::const_reverse_iterator;
+  using reverse_iterator = BasicBlockListType::reverse_iterator;
+
+
+  static BasicBlockListType MachineFunction::*
+  getSublistAccess(MachineBasicBlock *) {
+    return &MachineFunction::BasicBlocks;
+  }
+
+
+
+  unsigned addLiveIn(unsigned PReg, const TargetRegisterClass *RC);
+
+
+
+
+  iterator begin() { return BasicBlocks.begin(); }
+  const_iterator begin() const { return BasicBlocks.begin(); }
+  iterator end () { return BasicBlocks.end(); }
+  const_iterator end () const { return BasicBlocks.end(); }
+
+  reverse_iterator rbegin() { return BasicBlocks.rbegin(); }
+  const_reverse_iterator rbegin() const { return BasicBlocks.rbegin(); }
+  reverse_iterator rend () { return BasicBlocks.rend(); }
+  const_reverse_iterator rend () const { return BasicBlocks.rend(); }
+
+  unsigned size() const { return (unsigned)BasicBlocks.size();}
+  bool empty() const { return BasicBlocks.empty(); }
+  const MachineBasicBlock &front() const { return BasicBlocks.front(); }
+        MachineBasicBlock &front() { return BasicBlocks.front(); }
+  const MachineBasicBlock & back() const { return BasicBlocks.back(); }
+        MachineBasicBlock & back() { return BasicBlocks.back(); }
+
+  void push_back (MachineBasicBlock *MBB) { BasicBlocks.push_back (MBB); }
+  void push_front(MachineBasicBlock *MBB) { BasicBlocks.push_front(MBB); }
+  void insert(iterator MBBI, MachineBasicBlock *MBB) {
+    BasicBlocks.insert(MBBI, MBB);
+  }
+  void splice(iterator InsertPt, iterator MBBI) {
+    BasicBlocks.splice(InsertPt, BasicBlocks, MBBI);
+  }
+  void splice(iterator InsertPt, MachineBasicBlock *MBB) {
+    BasicBlocks.splice(InsertPt, BasicBlocks, MBB);
+  }
+  void splice(iterator InsertPt, iterator MBBI, iterator MBBE) {
+    BasicBlocks.splice(InsertPt, BasicBlocks, MBBI, MBBE);
+  }
+
+  void remove(iterator MBBI) { BasicBlocks.remove(MBBI); }
+  void remove(MachineBasicBlock *MBBI) { BasicBlocks.remove(MBBI); }
+  void erase(iterator MBBI) { BasicBlocks.erase(MBBI); }
+  void erase(MachineBasicBlock *MBBI) { BasicBlocks.erase(MBBI); }
+
+  template <typename Comp>
+  void sort(Comp comp) {
+    BasicBlocks.sort(comp);
+  }
+
+
+
+
+
+
+  unsigned addToMBBNumbering(MachineBasicBlock *MBB) {
+    MBBNumbering.push_back(MBB);
+    return (unsigned)MBBNumbering.size()-1;
+  }
+
+
+
+
+  void removeFromMBBNumbering(unsigned N) {
+    
+   ((
+   N < MBBNumbering.size() && "Illegal basic block #"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "N < MBBNumbering.size() && \"Illegal basic block #\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineFunction.h", 623, __PRETTY_FUNCTION__))
+                                                             ;
+    MBBNumbering[N] = nullptr;
+  }
+
+
+
+  MachineInstr *CreateMachineInstr(const MCInstrDesc &MCID, const DebugLoc &DL,
+                                   bool NoImp = false);
+  MachineInstr *CloneMachineInstr(const MachineInstr *Orig);
+
+
+
+
+
+
+  MachineInstr &CloneMachineInstrBundle(MachineBasicBlock &MBB,
+      MachineBasicBlock::iterator InsertBefore, const MachineInstr &Orig);
+
+
+  void DeleteMachineInstr(MachineInstr *MI);
+
+
+
+  MachineBasicBlock *CreateMachineBasicBlock(const BasicBlock *bb = nullptr);
+
+
+  void DeleteMachineBasicBlock(MachineBasicBlock *MBB);
+
+
+
+
+  MachineMemOperand *getMachineMemOperand(
+      MachinePointerInfo PtrInfo, MachineMemOperand::Flags f, uint64_t s,
+      unsigned base_alignment, const AAMDNodes &AAInfo = AAMDNodes(),
+      const MDNode *Ranges = nullptr,
+      SyncScope::ID SSID = SyncScope::System,
+      AtomicOrdering Ordering = AtomicOrdering::NotAtomic,
+      AtomicOrdering FailureOrdering = AtomicOrdering::NotAtomic);
+
+
+
+
+
+  MachineMemOperand *getMachineMemOperand(const MachineMemOperand *MMO,
+                                          int64_t Offset, uint64_t Size);
+
+
+
+
+  MachineMemOperand *getMachineMemOperand(const MachineMemOperand *MMO,
+                                          const AAMDNodes &AAInfo);
+
+  using OperandCapacity = ArrayRecycler<MachineOperand>::Capacity;
+
+
+
+  MachineOperand *allocateOperandArray(OperandCapacity Cap) {
+    return OperandRecycler.allocate(Cap, Allocator);
+  }
+
+
+
+
+  void deallocateOperandArray(OperandCapacity Cap, MachineOperand *Array) {
+    OperandRecycler.deallocate(Cap, Array);
+  }
+
+
+  uint32_t *allocateRegisterMask(unsigned NumRegister) {
+    unsigned Size = (NumRegister + 31) / 32;
+    uint32_t *Mask = Allocator.Allocate<uint32_t>(Size);
+    for (unsigned i = 0; i != Size; ++i)
+      Mask[i] = 0;
+    return Mask;
+  }
+
+
+
+  MachineInstr::mmo_iterator allocateMemRefsArray(unsigned long Num);
+
+
+
+  std::pair<MachineInstr::mmo_iterator,
+            MachineInstr::mmo_iterator>
+    extractLoadMemRefs(MachineInstr::mmo_iterator Begin,
+                       MachineInstr::mmo_iterator End);
+
+
+
+  std::pair<MachineInstr::mmo_iterator,
+            MachineInstr::mmo_iterator>
+    extractStoreMemRefs(MachineInstr::mmo_iterator Begin,
+                        MachineInstr::mmo_iterator End);
+
+
+  const char *createExternalSymbolName(StringRef Name);
+
+
+
+
+
+
+
+  MCSymbol *getJTISymbol(unsigned JTI, MCContext &Ctx,
+                         bool isLinkerPrivate = false) const;
+
+
+
+  MCSymbol *getPICBaseSymbol() const;
+
+
+
+
+  const std::vector<MCCFIInstruction> &getFrameInstructions() const {
+    return FrameInstructions;
+  }
+
+  unsigned addFrameInst(const MCCFIInstruction &Inst) {
+    FrameInstructions.push_back(Inst);
+    return FrameInstructions.size() - 1;
+  }
+
+
+
+
+  bool callsEHReturn() const { return CallsEHReturn; }
+  void setCallsEHReturn(bool b) { CallsEHReturn = b; }
+
+  bool callsUnwindInit() const { return CallsUnwindInit; }
+  void setCallsUnwindInit(bool b) { CallsUnwindInit = b; }
+
+  bool hasEHFunclets() const { return HasEHFunclets; }
+  void setHasEHFunclets(bool V) { HasEHFunclets = V; }
+
+
+  LandingPadInfo &getOrCreateLandingPadInfo(MachineBasicBlock *LandingPad);
+
+
+  void tidyLandingPads(DenseMap<MCSymbol*, uintptr_t> *LPMap = nullptr);
+
+
+  const std::vector<LandingPadInfo> &getLandingPads() const {
+    return LandingPads;
+  }
+
+
+
+  void addInvoke(MachineBasicBlock *LandingPad,
+                 MCSymbol *BeginLabel, MCSymbol *EndLabel);
+
+
+  MCSymbol *addLandingPad(MachineBasicBlock *LandingPad);
+
+
+  void addCatchTypeInfo(MachineBasicBlock *LandingPad,
+                        ArrayRef<const GlobalValue *> TyInfo);
+
+
+  void addFilterTypeInfo(MachineBasicBlock *LandingPad,
+                         ArrayRef<const GlobalValue *> TyInfo);
+
+
+  void addCleanup(MachineBasicBlock *LandingPad);
+
+  void addSEHCatchHandler(MachineBasicBlock *LandingPad, const Function *Filter,
+                          const BlockAddress *RecoverLabel);
+
+  void addSEHCleanupHandler(MachineBasicBlock *LandingPad,
+                            const Function *Cleanup);
+
+
+  unsigned getTypeIDFor(const GlobalValue *TI);
+
+
+  int getFilterIDFor(std::vector<unsigned> &TyIds);
+
+
+  void setCallSiteLandingPad(MCSymbol *Sym, ArrayRef<unsigned> Sites);
+
+
+  SmallVectorImpl<unsigned> &getCallSiteLandingPad(MCSymbol *Sym) {
+    
+   ((
+   hasCallSiteLandingPad(Sym) && "missing call site number for landing pad!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "hasCallSiteLandingPad(Sym) && \"missing call site number for landing pad!\""
+   ,
+                                                      "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineFunction.h"
+    ,
+                                                      813
+    , __PRETTY_FUNCTION__))
+                                                       
+                                                      ;
+    return LPadToCallSiteMap[Sym];
+  }
+
+
+  bool hasCallSiteLandingPad(MCSymbol *Sym) {
+    return !LPadToCallSiteMap[Sym].empty();
+  }
+
+
+  void setCallSiteBeginLabel(MCSymbol *BeginLabel, unsigned Site) {
+    CallSiteMap[BeginLabel] = Site;
+  }
+
+
+  unsigned getCallSiteBeginLabel(MCSymbol *BeginLabel) const {
+    
+   ((
+   hasCallSiteBeginLabel(BeginLabel) && "Missing call site number for EH_LABEL!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "hasCallSiteBeginLabel(BeginLabel) && \"Missing call site number for EH_LABEL!\""
+   ,
+                                                   "/home/trippels/llvm/llvm/include/llvm/CodeGen/MachineFunction.h"
+    ,
+                                                   830
+    , __PRETTY_FUNCTION__))
+                                                    
+                                                   ;
+    return CallSiteMap.lookup(BeginLabel);
+  }
+
+
+  bool hasCallSiteBeginLabel(MCSymbol *BeginLabel) const {
+    return CallSiteMap.count(BeginLabel);
+  }
+
+
+  void addCodeViewAnnotation(MCSymbol *Label, MDNode *MD) {
+    CodeViewAnnotations.push_back({Label, MD});
+  }
+
+  ArrayRef<std::pair<MCSymbol *, MDNode *>> getCodeViewAnnotations() const {
+    return CodeViewAnnotations;
+  }
+
+
+  const std::vector<const GlobalValue *> &getTypeInfos() const {
+    return TypeInfos;
+  }
+
+
+
+  const std::vector<unsigned> &getFilterIds() const {
+    return FilterIds;
+  }
+
+
+
+
+  void setVariableDbgInfo(const DILocalVariable *Var, const DIExpression *Expr,
+                          unsigned Slot, const DILocation *Loc) {
+    VariableDbgInfos.emplace_back(Var, Expr, Slot, Loc);
+  }
+
+  VariableDbgInfoMapTy &getVariableDbgInfo() { return VariableDbgInfos; }
+  const VariableDbgInfoMapTy &getVariableDbgInfo() const {
+    return VariableDbgInfos;
+  }
+};
+
+
+
+
+
+
+void addLandingPadInfo(const LandingPadInst &I, MachineBasicBlock &MBB);
+template <> struct GraphTraits<MachineFunction*> :
+  public GraphTraits<MachineBasicBlock*> {
+  static NodeRef getEntryNode(MachineFunction *F) { return &F->front(); }
+
+
+  using nodes_iterator = pointer_iterator<MachineFunction::iterator>;
+
+  static nodes_iterator nodes_begin(MachineFunction *F) {
+    return nodes_iterator(F->begin());
+  }
+
+  static nodes_iterator nodes_end(MachineFunction *F) {
+    return nodes_iterator(F->end());
+  }
+
+  static unsigned size (MachineFunction *F) { return F->size(); }
+};
+template <> struct GraphTraits<const MachineFunction*> :
+  public GraphTraits<const MachineBasicBlock*> {
+  static NodeRef getEntryNode(const MachineFunction *F) { return &F->front(); }
+
+
+  using nodes_iterator = pointer_iterator<MachineFunction::const_iterator>;
+
+  static nodes_iterator nodes_begin(const MachineFunction *F) {
+    return nodes_iterator(F->begin());
+  }
+
+  static nodes_iterator nodes_end (const MachineFunction *F) {
+    return nodes_iterator(F->end());
+  }
+
+  static unsigned size (const MachineFunction *F) {
+    return F->size();
+  }
+};
+
+
+
+
+
+
+template <> struct GraphTraits<Inverse<MachineFunction*>> :
+  public GraphTraits<Inverse<MachineBasicBlock*>> {
+  static NodeRef getEntryNode(Inverse<MachineFunction *> G) {
+    return &G.Graph->front();
+  }
+};
+template <> struct GraphTraits<Inverse<const MachineFunction*>> :
+  public GraphTraits<Inverse<const MachineBasicBlock*>> {
+  static NodeRef getEntryNode(Inverse<const MachineFunction *> G) {
+    return &G.Graph->front();
+  }
+};
+
+}
+
+
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+       
+
+
+
+
+       
+
+
+
+
+
+namespace llvm {
+
+class APInt;
+class Constant;
+template <typename T> struct DenseMapInfo;
+class GlobalValue;
+class MachineBasicBlock;
+class MachineConstantPoolValue;
+class MCSymbol;
+class raw_ostream;
+class SDNode;
+class SelectionDAG;
+class Type;
+class Value;
+
+void checkForCycles(const SDNode *N, const SelectionDAG *DAG = nullptr,
+                    bool force = false);
+
+
+
+
+
+struct SDVTList {
+  const EVT *VTs;
+  unsigned int NumVTs;
+};
+
+namespace ISD {
+
+
+
+
+
+  bool isConstantSplatVector(const SDNode *N, APInt &SplatValue);
+
+
+
+  bool isBuildVectorAllOnes(const SDNode *N);
+
+
+
+  bool isBuildVectorAllZeros(const SDNode *N);
+
+
+
+  bool isBuildVectorOfConstantSDNodes(const SDNode *N);
+
+
+
+  bool isBuildVectorOfConstantFPSDNodes(const SDNode *N);
+
+
+
+  bool allOperandsUndef(const SDNode *N);
+
+}
+class SDValue {
+  friend struct DenseMapInfo<SDValue>;
+
+  SDNode *Node = nullptr;
+  unsigned ResNo = 0;
+
+public:
+  SDValue() = default;
+  SDValue(SDNode *node, unsigned resno);
+
+
+  unsigned getResNo() const { return ResNo; }
+
+
+  SDNode *getNode() const { return Node; }
+
+
+  void setNode(SDNode *N) { Node = N; }
+
+  inline SDNode *operator->() const { return Node; }
+
+  bool operator==(const SDValue &O) const {
+    return Node == O.Node && ResNo == O.ResNo;
+  }
+  bool operator!=(const SDValue &O) const {
+    return !operator==(O);
+  }
+  bool operator<(const SDValue &O) const {
+    return std::tie(Node, ResNo) < std::tie(O.Node, O.ResNo);
+  }
+  explicit operator bool() const {
+    return Node != nullptr;
+  }
+
+  SDValue getValue(unsigned R) const {
+    return SDValue(Node, R);
+  }
+
+
+  bool isOperandOf(const SDNode *N) const;
+
+
+  inline EVT getValueType() const;
+
+
+  MVT getSimpleValueType() const {
+    return getValueType().getSimpleVT();
+  }
+
+
+  unsigned getValueSizeInBits() const {
+    return getValueType().getSizeInBits();
+  }
+
+  unsigned getScalarValueSizeInBits() const {
+    return getValueType().getScalarType().getSizeInBits();
+  }
+
+
+  inline unsigned getOpcode() const;
+  inline unsigned getNumOperands() const;
+  inline const SDValue &getOperand(unsigned i) const;
+  inline uint64_t getConstantOperandVal(unsigned i) const;
+  inline bool isTargetMemoryOpcode() const;
+  inline bool isTargetOpcode() const;
+  inline bool isMachineOpcode() const;
+  inline bool isUndef() const;
+  inline unsigned getMachineOpcode() const;
+  inline const DebugLoc &getDebugLoc() const;
+  inline void dump(const SelectionDAG *G = nullptr) const;
+  inline void dumpr(const SelectionDAG *G = nullptr) const;
+
+
+
+
+
+
+  bool reachesChainWithoutSideEffects(SDValue Dest,
+                                      unsigned Depth = 2) const;
+
+
+  inline bool use_empty() const;
+
+
+  inline bool hasOneUse() const;
+};
+
+template<> struct DenseMapInfo<SDValue> {
+  static inline SDValue getEmptyKey() {
+    SDValue V;
+    V.ResNo = -1U;
+    return V;
+  }
+
+  static inline SDValue getTombstoneKey() {
+    SDValue V;
+    V.ResNo = -2U;
+    return V;
+  }
+
+  static unsigned getHashValue(const SDValue &Val) {
+    return ((unsigned)((uintptr_t)Val.getNode() >> 4) ^
+            (unsigned)((uintptr_t)Val.getNode() >> 9)) + Val.getResNo();
+  }
+
+  static bool isEqual(const SDValue &LHS, const SDValue &RHS) {
+    return LHS == RHS;
+  }
+};
+template <> struct isPodLike<SDValue> { static const bool value = true; };
+
+
+
+template<> struct simplify_type<SDValue> {
+  using SimpleType = SDNode *;
+
+  static SimpleType getSimplifiedValue(SDValue &Val) {
+    return Val.getNode();
+  }
+};
+template<> struct simplify_type<const SDValue> {
+  using SimpleType = SDNode *;
+
+  static SimpleType getSimplifiedValue(const SDValue &Val) {
+    return Val.getNode();
+  }
+};
+
+
+
+
+
+
+class SDUse {
+
+  SDValue Val;
+
+  SDNode *User = nullptr;
+
+
+  SDUse **Prev = nullptr;
+  SDUse *Next = nullptr;
+
+public:
+  SDUse() = default;
+  SDUse(const SDUse &U) = delete;
+  SDUse &operator=(const SDUse &) = delete;
+
+
+  operator const SDValue&() const { return Val; }
+
+
+
+  const SDValue &get() const { return Val; }
+
+
+  SDNode *getUser() { return User; }
+
+
+  SDUse *getNext() const { return Next; }
+
+
+  SDNode *getNode() const { return Val.getNode(); }
+
+  unsigned getResNo() const { return Val.getResNo(); }
+
+  EVT getValueType() const { return Val.getValueType(); }
+
+
+  bool operator==(const SDValue &V) const {
+    return Val == V;
+  }
+
+
+  bool operator!=(const SDValue &V) const {
+    return Val != V;
+  }
+
+
+  bool operator<(const SDValue &V) const {
+    return Val < V;
+  }
+
+private:
+  friend class SelectionDAG;
+  friend class SDNode;
+
+  friend class HandleSDNode;
+
+  void setUser(SDNode *p) { User = p; }
+
+
+
+  inline void set(const SDValue &V);
+
+
+  inline void setInitial(const SDValue &V);
+
+
+  inline void setNode(SDNode *N);
+
+  void addToList(SDUse **List) {
+    Next = *List;
+    if (Next) Next->Prev = &Next;
+    Prev = List;
+    *List = this;
+  }
+
+  void removeFromList() {
+    *Prev = Next;
+    if (Next) Next->Prev = Prev;
+  }
+};
+
+
+
+template<> struct simplify_type<SDUse> {
+  using SimpleType = SDNode *;
+
+  static SimpleType getSimplifiedValue(SDUse &Val) {
+    return Val.getNode();
+  }
+};
+
+
+
+
+struct SDNodeFlags {
+private:
+
+
+
+  bool AnyDefined : 1;
+
+  bool NoUnsignedWrap : 1;
+  bool NoSignedWrap : 1;
+  bool Exact : 1;
+  bool UnsafeAlgebra : 1;
+  bool NoNaNs : 1;
+  bool NoInfs : 1;
+  bool NoSignedZeros : 1;
+  bool AllowReciprocal : 1;
+  bool VectorReduction : 1;
+  bool AllowContract : 1;
+
+public:
+
+  SDNodeFlags()
+      : AnyDefined(false), NoUnsignedWrap(false), NoSignedWrap(false),
+        Exact(false), UnsafeAlgebra(false), NoNaNs(false), NoInfs(false),
+        NoSignedZeros(false), AllowReciprocal(false), VectorReduction(false),
+        AllowContract(false) {}
+
+
+  void setDefined() { AnyDefined = true; }
+
+  bool isDefined() const { return AnyDefined; }
+
+
+  void setNoUnsignedWrap(bool b) {
+    setDefined();
+    NoUnsignedWrap = b;
+  }
+  void setNoSignedWrap(bool b) {
+    setDefined();
+    NoSignedWrap = b;
+  }
+  void setExact(bool b) {
+    setDefined();
+    Exact = b;
+  }
+  void setUnsafeAlgebra(bool b) {
+    setDefined();
+    UnsafeAlgebra = b;
+  }
+  void setNoNaNs(bool b) {
+    setDefined();
+    NoNaNs = b;
+  }
+  void setNoInfs(bool b) {
+    setDefined();
+    NoInfs = b;
+  }
+  void setNoSignedZeros(bool b) {
+    setDefined();
+    NoSignedZeros = b;
+  }
+  void setAllowReciprocal(bool b) {
+    setDefined();
+    AllowReciprocal = b;
+  }
+  void setVectorReduction(bool b) {
+    setDefined();
+    VectorReduction = b;
+  }
+  void setAllowContract(bool b) {
+    setDefined();
+    AllowContract = b;
+  }
+
+
+  bool hasNoUnsignedWrap() const { return NoUnsignedWrap; }
+  bool hasNoSignedWrap() const { return NoSignedWrap; }
+  bool hasExact() const { return Exact; }
+  bool hasUnsafeAlgebra() const { return UnsafeAlgebra; }
+  bool hasNoNaNs() const { return NoNaNs; }
+  bool hasNoInfs() const { return NoInfs; }
+  bool hasNoSignedZeros() const { return NoSignedZeros; }
+  bool hasAllowReciprocal() const { return AllowReciprocal; }
+  bool hasVectorReduction() const { return VectorReduction; }
+  bool hasAllowContract() const { return AllowContract; }
+
+
+
+  void intersectWith(const SDNodeFlags Flags) {
+    if (!Flags.isDefined())
+      return;
+    NoUnsignedWrap &= Flags.NoUnsignedWrap;
+    NoSignedWrap &= Flags.NoSignedWrap;
+    Exact &= Flags.Exact;
+    UnsafeAlgebra &= Flags.UnsafeAlgebra;
+    NoNaNs &= Flags.NoNaNs;
+    NoInfs &= Flags.NoInfs;
+    NoSignedZeros &= Flags.NoSignedZeros;
+    AllowReciprocal &= Flags.AllowReciprocal;
+    VectorReduction &= Flags.VectorReduction;
+    AllowContract &= Flags.AllowContract;
+  }
+};
+
+
+
+class SDNode : public FoldingSetNode, public ilist_node<SDNode> {
+private:
+
+  int16_t NodeType;
+
+protected:
+
+
+
+
+  class SDNodeBitfields {
+    friend class SDNode;
+    friend class MemIntrinsicSDNode;
+    friend class MemSDNode;
+
+    uint16_t HasDebugValue : 1;
+    uint16_t IsMemIntrinsic : 1;
+  };
+  enum { NumSDNodeBits = 2 };
+
+  class ConstantSDNodeBitfields {
+    friend class ConstantSDNode;
+
+    uint16_t : NumSDNodeBits;
+
+    uint16_t IsOpaque : 1;
+  };
+
+  class MemSDNodeBitfields {
+    friend class MemSDNode;
+    friend class MemIntrinsicSDNode;
+    friend class AtomicSDNode;
+
+    uint16_t : NumSDNodeBits;
+
+    uint16_t IsVolatile : 1;
+    uint16_t IsNonTemporal : 1;
+    uint16_t IsDereferenceable : 1;
+    uint16_t IsInvariant : 1;
+  };
+  enum { NumMemSDNodeBits = NumSDNodeBits + 4 };
+
+  class LSBaseSDNodeBitfields {
+    friend class LSBaseSDNode;
+
+    uint16_t : NumMemSDNodeBits;
+
+    uint16_t AddressingMode : 3;
+  };
+  enum { NumLSBaseSDNodeBits = NumMemSDNodeBits + 3 };
+
+  class LoadSDNodeBitfields {
+    friend class LoadSDNode;
+    friend class MaskedLoadSDNode;
+
+    uint16_t : NumLSBaseSDNodeBits;
+
+    uint16_t ExtTy : 2;
+    uint16_t IsExpanding : 1;
+  };
+
+  class StoreSDNodeBitfields {
+    friend class StoreSDNode;
+    friend class MaskedStoreSDNode;
+
+    uint16_t : NumLSBaseSDNodeBits;
+
+    uint16_t IsTruncating : 1;
+    uint16_t IsCompressing : 1;
+  };
+
+  union {
+    char RawSDNodeBits[sizeof(uint16_t)];
+    SDNodeBitfields SDNodeBits;
+    ConstantSDNodeBitfields ConstantSDNodeBits;
+    MemSDNodeBitfields MemSDNodeBits;
+    LSBaseSDNodeBitfields LSBaseSDNodeBits;
+    LoadSDNodeBitfields LoadSDNodeBits;
+    StoreSDNodeBitfields StoreSDNodeBits;
+  };
+
+
+
+
+  static_assert(sizeof(SDNodeBitfields) <= 2, "field too wide");
+  static_assert(sizeof(ConstantSDNodeBitfields) <= 2, "field too wide");
+  static_assert(sizeof(MemSDNodeBitfields) <= 2, "field too wide");
+  static_assert(sizeof(LSBaseSDNodeBitfields) <= 2, "field too wide");
+  static_assert(sizeof(LoadSDNodeBitfields) <= 4, "field too wide");
+  static_assert(sizeof(StoreSDNodeBitfields) <= 2, "field too wide");
+
+private:
+  friend class SelectionDAG;
+
+  friend class HandleSDNode;
+
+
+  int NodeId = -1;
+
+
+  SDUse *OperandList = nullptr;
+
+
+
+  const EVT *ValueList;
+
+
+  SDUse *UseList = nullptr;
+
+
+  unsigned short NumOperands = 0;
+  unsigned short NumValues;
+
+
+
+
+
+
+  unsigned IROrder;
+
+
+  DebugLoc debugLoc;
+
+
+  static const EVT *getValueTypeList(EVT VT);
+
+  SDNodeFlags Flags;
+
+public:
+
+
+  uint16_t PersistentId;
+  unsigned getOpcode() const { return (unsigned short)NodeType; }
+
+
+
+  bool isTargetOpcode() const { return NodeType >= ISD::BUILTIN_OP_END; }
+
+
+
+
+  bool isTargetMemoryOpcode() const {
+    return NodeType >= ISD::FIRST_TARGET_MEMORY_OPCODE;
+  }
+
+
+  bool isUndef() const { return NodeType == ISD::UNDEF; }
+
+
+
+
+
+
+  bool isMemIntrinsic() const {
+    return (NodeType == ISD::INTRINSIC_W_CHAIN ||
+            NodeType == ISD::INTRINSIC_VOID) &&
+           SDNodeBits.IsMemIntrinsic;
+  }
+
+
+  bool isStrictFPOpcode() {
+    switch (NodeType) {
+      default:
+        return false;
+      case ISD::STRICT_FADD:
+      case ISD::STRICT_FSUB:
+      case ISD::STRICT_FMUL:
+      case ISD::STRICT_FDIV:
+      case ISD::STRICT_FREM:
+      case ISD::STRICT_FMA:
+      case ISD::STRICT_FSQRT:
+      case ISD::STRICT_FPOW:
+      case ISD::STRICT_FPOWI:
+      case ISD::STRICT_FSIN:
+      case ISD::STRICT_FCOS:
+      case ISD::STRICT_FEXP:
+      case ISD::STRICT_FEXP2:
+      case ISD::STRICT_FLOG:
+      case ISD::STRICT_FLOG10:
+      case ISD::STRICT_FLOG2:
+      case ISD::STRICT_FRINT:
+      case ISD::STRICT_FNEARBYINT:
+        return true;
+    }
+  }
+
+
+
+  bool isMachineOpcode() const { return NodeType < 0; }
+
+
+
+
+  unsigned getMachineOpcode() const {
+    
+   ((
+   isMachineOpcode() && "Not a MachineInstr opcode!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isMachineOpcode() && \"Not a MachineInstr opcode!\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/SelectionDAGNodes.h", 658, __PRETTY_FUNCTION__))
+                                                            ;
+    return ~NodeType;
+  }
+
+  bool getHasDebugValue() const { return SDNodeBits.HasDebugValue; }
+  void setHasDebugValue(bool b) { SDNodeBits.HasDebugValue = b; }
+
+
+  bool use_empty() const { return UseList == nullptr; }
+
+
+  bool hasOneUse() const {
+    return !use_empty() && std::next(use_begin()) == use_end();
+  }
+
+
+
+  size_t use_size() const { return std::distance(use_begin(), use_end()); }
+
+
+  int getNodeId() const { return NodeId; }
+
+
+  void setNodeId(int Id) { NodeId = Id; }
+
+
+  unsigned getIROrder() const { return IROrder; }
+
+
+  void setIROrder(unsigned Order) { IROrder = Order; }
+
+
+  const DebugLoc &getDebugLoc() const { return debugLoc; }
+
+
+
+  void setDebugLoc(DebugLoc dl) { debugLoc = std::move(dl); }
+
+
+
+  class use_iterator
+    : public std::iterator<std::forward_iterator_tag, SDUse, ptrdiff_t> {
+    friend class SDNode;
+
+    SDUse *Op = nullptr;
+
+    explicit use_iterator(SDUse *op) : Op(op) {}
+
+  public:
+    using reference = std::iterator<std::forward_iterator_tag,
+                                    SDUse, ptrdiff_t>::reference;
+    using pointer = std::iterator<std::forward_iterator_tag,
+                                  SDUse, ptrdiff_t>::pointer;
+
+    use_iterator() = default;
+    use_iterator(const use_iterator &I) : Op(I.Op) {}
+
+    bool operator==(const use_iterator &x) const {
+      return Op == x.Op;
+    }
+    bool operator!=(const use_iterator &x) const {
+      return !operator==(x);
+    }
+
+
+    bool atEnd() const { return Op == nullptr; }
+
+
+    use_iterator &operator++() {
+      
+     ((
+     Op && "Cannot increment end iterator!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "Op && \"Cannot increment end iterator!\""
+     , "/home/trippels/llvm/llvm/include/llvm/CodeGen/SelectionDAGNodes.h", 727, __PRETTY_FUNCTION__))
+                                                   ;
+      Op = Op->getNext();
+      return *this;
+    }
+
+    use_iterator operator++(int) {
+      use_iterator tmp = *this; ++*this; return tmp;
+    }
+
+
+    SDNode *operator*() const {
+      
+     ((
+     Op && "Cannot dereference end iterator!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "Op && \"Cannot dereference end iterator!\""
+     , "/home/trippels/llvm/llvm/include/llvm/CodeGen/SelectionDAGNodes.h", 738, __PRETTY_FUNCTION__))
+                                                     ;
+      return Op->getUser();
+    }
+
+    SDNode *operator->() const { return operator*(); }
+
+    SDUse &getUse() const { return *Op; }
+
+
+    unsigned getOperandNo() const {
+      
+     ((
+     Op && "Cannot dereference end iterator!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "Op && \"Cannot dereference end iterator!\""
+     , "/home/trippels/llvm/llvm/include/llvm/CodeGen/SelectionDAGNodes.h", 748, __PRETTY_FUNCTION__))
+                                                     ;
+      return (unsigned)(Op - Op->getUser()->OperandList);
+    }
+  };
+
+
+  use_iterator use_begin() const {
+    return use_iterator(UseList);
+  }
+
+  static use_iterator use_end() { return use_iterator(nullptr); }
+
+  inline iterator_range<use_iterator> uses() {
+    return make_range(use_begin(), use_end());
+  }
+  inline iterator_range<use_iterator> uses() const {
+    return make_range(use_begin(), use_end());
+  }
+
+
+
+  bool hasNUsesOfValue(unsigned NUses, unsigned Value) const;
+
+
+
+  bool hasAnyUseOfValue(unsigned Value) const;
+
+
+  bool isOnlyUserOf(const SDNode *N) const;
+
+
+  bool isOperandOf(const SDNode *N) const;
+
+
+
+
+  bool isPredecessorOf(const SDNode *N) const {
+    return N->hasPredecessor(this);
+  }
+
+
+
+
+
+  bool hasPredecessor(const SDNode *N) const;
+
+
+
+
+
+
+
+  static bool hasPredecessorHelper(const SDNode *N,
+                                   SmallPtrSetImpl<const SDNode *> &Visited,
+                                   SmallVectorImpl<const SDNode *> &Worklist,
+                                   unsigned int MaxSteps = 0) {
+    if (Visited.count(N))
+      return true;
+    while (!Worklist.empty()) {
+      const SDNode *M = Worklist.pop_back_val();
+      bool Found = false;
+      for (const SDValue &OpV : M->op_values()) {
+        SDNode *Op = OpV.getNode();
+        if (Visited.insert(Op).second)
+          Worklist.push_back(Op);
+        if (Op == N)
+          Found = true;
+      }
+      if (Found)
+        return true;
+      if (MaxSteps != 0 && Visited.size() >= MaxSteps)
+        return false;
+    }
+    return false;
+  }
+
+
+
+  static bool areOnlyUsersOf(ArrayRef<const SDNode *> Nodes, const SDNode *N);
+
+
+  unsigned getNumOperands() const { return NumOperands; }
+
+
+  inline uint64_t getConstantOperandVal(unsigned Num) const;
+
+  const SDValue &getOperand(unsigned Num) const {
+    
+   ((
+   Num < NumOperands && "Invalid child # of SDNode!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Num < NumOperands && \"Invalid child # of SDNode!\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/SelectionDAGNodes.h", 835, __PRETTY_FUNCTION__))
+                                                            ;
+    return OperandList[Num];
+  }
+
+  using op_iterator = SDUse *;
+
+  op_iterator op_begin() const { return OperandList; }
+  op_iterator op_end() const { return OperandList+NumOperands; }
+  ArrayRef<SDUse> ops() const { return makeArrayRef(op_begin(), op_end()); }
+
+
+  struct value_op_iterator
+      : iterator_adaptor_base<value_op_iterator, op_iterator,
+                              std::random_access_iterator_tag, SDValue,
+                              ptrdiff_t, value_op_iterator *,
+                              value_op_iterator *> {
+    explicit value_op_iterator(SDUse *U = nullptr)
+      : iterator_adaptor_base(U) {}
+
+    const SDValue &operator*() const { return I->get(); }
+  };
+
+  iterator_range<value_op_iterator> op_values() const {
+    return make_range(value_op_iterator(op_begin()),
+                      value_op_iterator(op_end()));
+  }
+
+  SDVTList getVTList() const {
+    SDVTList X = { ValueList, NumValues };
+    return X;
+  }
+
+
+
+  SDNode *getGluedNode() const {
+    if (getNumOperands() != 0 &&
+        getOperand(getNumOperands()-1).getValueType() == MVT::Glue)
+      return getOperand(getNumOperands()-1).getNode();
+    return nullptr;
+  }
+
+
+
+  SDNode *getGluedUser() const {
+    for (use_iterator UI = use_begin(), UE = use_end(); UI != UE; ++UI)
+      if (UI.getUse().get().getValueType() == MVT::Glue)
+        return *UI;
+    return nullptr;
+  }
+
+  const SDNodeFlags getFlags() const { return Flags; }
+  void setFlags(SDNodeFlags NewFlags) { Flags = NewFlags; }
+
+
+
+  void intersectFlagsWith(const SDNodeFlags Flags);
+
+
+  unsigned getNumValues() const { return NumValues; }
+
+
+  EVT getValueType(unsigned ResNo) const {
+    
+   ((
+   ResNo < NumValues && "Illegal result number!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "ResNo < NumValues && \"Illegal result number!\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/SelectionDAGNodes.h", 897, __PRETTY_FUNCTION__))
+                                                        ;
+    return ValueList[ResNo];
+  }
+
+
+  MVT getSimpleValueType(unsigned ResNo) const {
+    return getValueType(ResNo).getSimpleVT();
+  }
+
+
+  unsigned getValueSizeInBits(unsigned ResNo) const {
+    return getValueType(ResNo).getSizeInBits();
+  }
+
+  using value_iterator = const EVT *;
+
+  value_iterator value_begin() const { return ValueList; }
+  value_iterator value_end() const { return ValueList+NumValues; }
+
+
+  std::string getOperationName(const SelectionDAG *G = nullptr) const;
+  static const char* getIndexedModeName(ISD::MemIndexedMode AM);
+  void print_types(raw_ostream &OS, const SelectionDAG *G) const;
+  void print_details(raw_ostream &OS, const SelectionDAG *G) const;
+  void print(raw_ostream &OS, const SelectionDAG *G = nullptr) const;
+  void printr(raw_ostream &OS, const SelectionDAG *G = nullptr) const;
+
+
+
+
+
+
+
+  void printrFull(raw_ostream &O, const SelectionDAG *G = nullptr) const;
+
+
+
+
+
+
+
+  void printrWithDepth(raw_ostream &O, const SelectionDAG *G = nullptr,
+                       unsigned depth = 100) const;
+
+
+  void dump() const;
+
+
+  void dumpr() const;
+
+
+
+
+  void dump(const SelectionDAG *G) const;
+
+
+
+
+  void dumpr(const SelectionDAG *G) const;
+
+
+
+
+
+  void dumprFull(const SelectionDAG *G = nullptr) const;
+
+
+
+
+
+
+  void dumprWithDepth(const SelectionDAG *G = nullptr,
+                      unsigned depth = 100) const;
+
+
+  void Profile(FoldingSetNodeID &ID) const;
+
+
+  void addUse(SDUse &U) { U.addToList(&UseList); }
+
+protected:
+  static SDVTList getSDVTList(EVT VT) {
+    SDVTList Ret = { getValueTypeList(VT), 1 };
+    return Ret;
+  }
+
+
+
+
+
+  SDNode(unsigned Opc, unsigned Order, DebugLoc dl, SDVTList VTs)
+      : NodeType(Opc), ValueList(VTs.VTs), NumValues(VTs.NumVTs),
+        IROrder(Order), debugLoc(std::move(dl)) {
+    memset(&RawSDNodeBits, 0, sizeof(RawSDNodeBits));
+    
+   ((
+   debugLoc.hasTrivialDestructor() && "Expected trivial destructor"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "debugLoc.hasTrivialDestructor() && \"Expected trivial destructor\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/SelectionDAGNodes.h", 991, __PRETTY_FUNCTION__))
+                                                                           ;
+    
+   ((
+   NumValues == VTs.NumVTs && "NumValues wasn't wide enough for its operands!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "NumValues == VTs.NumVTs && \"NumValues wasn't wide enough for its operands!\""
+   ,
+                                                           "/home/trippels/llvm/llvm/include/llvm/CodeGen/SelectionDAGNodes.h"
+    ,
+                                                           993
+    , __PRETTY_FUNCTION__))
+                                                            
+                                                           ;
+  }
+
+
+  void DropOperands();
+};
+class SDLoc {
+private:
+  DebugLoc DL;
+  int IROrder = 0;
+
+public:
+  SDLoc() = default;
+  SDLoc(const SDNode *N) : DL(N->getDebugLoc()), IROrder(N->getIROrder()) {}
+  SDLoc(const SDValue V) : SDLoc(V.getNode()) {}
+  SDLoc(const Instruction *I, int Order) : IROrder(Order) {
+    
+   ((
+   Order >= 0 && "bad IROrder"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Order >= 0 && \"bad IROrder\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/SelectionDAGNodes.h", 1019, __PRETTY_FUNCTION__))
+                                      ;
+    if (I)
+      DL = I->getDebugLoc();
+  }
+
+  unsigned getIROrder() const { return IROrder; }
+  const DebugLoc &getDebugLoc() const { return DL; }
+};
+
+
+
+inline SDValue::SDValue(SDNode *node, unsigned resno)
+    : Node(node), ResNo(resno) {
+
+
+
+  
+ ((
+ (!Node || !ResNo || ResNo < Node->getNumValues()) && "Invalid result number for the given node!"
+ ) ? static_cast<void> (0) : __assert_fail (
+ "(!Node || !ResNo || ResNo < Node->getNumValues()) && \"Invalid result number for the given node!\""
+ ,
+                                                    "/home/trippels/llvm/llvm/include/llvm/CodeGen/SelectionDAGNodes.h"
+  ,
+                                                    1036
+  , __PRETTY_FUNCTION__))
+                                                     
+                                                    ;
+  
+ ((
+ ResNo < -2U && "Cannot use result numbers reserved for DenseMaps."
+ ) ? static_cast<void> (0) : __assert_fail (
+ "ResNo < -2U && \"Cannot use result numbers reserved for DenseMaps.\""
+ , "/home/trippels/llvm/llvm/include/llvm/CodeGen/SelectionDAGNodes.h", 1037, __PRETTY_FUNCTION__))
+                                                                           ;
+}
+
+inline unsigned SDValue::getOpcode() const {
+  return Node->getOpcode();
+}
+
+inline EVT SDValue::getValueType() const {
+  return Node->getValueType(ResNo);
+}
+
+inline unsigned SDValue::getNumOperands() const {
+  return Node->getNumOperands();
+}
+
+inline const SDValue &SDValue::getOperand(unsigned i) const {
+  return Node->getOperand(i);
+}
+
+inline uint64_t SDValue::getConstantOperandVal(unsigned i) const {
+  return Node->getConstantOperandVal(i);
+}
+
+inline bool SDValue::isTargetOpcode() const {
+  return Node->isTargetOpcode();
+}
+
+inline bool SDValue::isTargetMemoryOpcode() const {
+  return Node->isTargetMemoryOpcode();
+}
+
+inline bool SDValue::isMachineOpcode() const {
+  return Node->isMachineOpcode();
+}
+
+inline unsigned SDValue::getMachineOpcode() const {
+  return Node->getMachineOpcode();
+}
+
+inline bool SDValue::isUndef() const {
+  return Node->isUndef();
+}
+
+inline bool SDValue::use_empty() const {
+  return !Node->hasAnyUseOfValue(ResNo);
+}
+
+inline bool SDValue::hasOneUse() const {
+  return Node->hasNUsesOfValue(1, ResNo);
+}
+
+inline const DebugLoc &SDValue::getDebugLoc() const {
+  return Node->getDebugLoc();
+}
+
+inline void SDValue::dump(const SelectionDAG *G) const {
+  return Node->dump(G);
+}
+
+inline void SDValue::dumpr(const SelectionDAG *G) const {
+  return Node->dumpr(G);
+}
+
+
+
+inline void SDUse::set(const SDValue &V) {
+  if (Val.getNode()) removeFromList();
+  Val = V;
+  if (V.getNode()) V.getNode()->addUse(*this);
+}
+
+inline void SDUse::setInitial(const SDValue &V) {
+  Val = V;
+  V.getNode()->addUse(*this);
+}
+
+inline void SDUse::setNode(SDNode *N) {
+  if (Val.getNode()) removeFromList();
+  Val.setNode(N);
+  if (N) N->addUse(*this);
+}
+
+
+
+
+
+class HandleSDNode : public SDNode {
+  SDUse Op;
+
+public:
+  explicit HandleSDNode(SDValue X)
+    : SDNode(ISD::HANDLENODE, 0, DebugLoc(), getSDVTList(MVT::Other)) {
+
+
+    PersistentId = 0xffff;
+
+
+
+
+
+    Op.setUser(this);
+    Op.setInitial(X);
+    NumOperands = 1;
+    OperandList = &Op;
+  }
+  ~HandleSDNode();
+
+  const SDValue &getValue() const { return Op; }
+};
+
+class AddrSpaceCastSDNode : public SDNode {
+private:
+  unsigned SrcAddrSpace;
+  unsigned DestAddrSpace;
+
+public:
+  AddrSpaceCastSDNode(unsigned Order, const DebugLoc &dl, EVT VT,
+                      unsigned SrcAS, unsigned DestAS);
+
+  unsigned getSrcAddressSpace() const { return SrcAddrSpace; }
+  unsigned getDestAddressSpace() const { return DestAddrSpace; }
+
+  static bool classof(const SDNode *N) {
+    return N->getOpcode() == ISD::ADDRSPACECAST;
+  }
+};
+
+
+class MemSDNode : public SDNode {
+private:
+
+  EVT MemoryVT;
+
+protected:
+
+  MachineMemOperand *MMO;
+
+public:
+  MemSDNode(unsigned Opc, unsigned Order, const DebugLoc &dl, SDVTList VTs,
+            EVT MemoryVT, MachineMemOperand *MMO);
+
+  bool readMem() const { return MMO->isLoad(); }
+  bool writeMem() const { return MMO->isStore(); }
+
+
+  unsigned getOriginalAlignment() const {
+    return MMO->getBaseAlignment();
+  }
+  unsigned getAlignment() const {
+    return MMO->getAlignment();
+  }
+
+
+
+
+
+
+  unsigned getRawSubclassData() const {
+    uint16_t Data;
+    union {
+      char RawSDNodeBits[sizeof(uint16_t)];
+      SDNodeBitfields SDNodeBits;
+    };
+    memcpy(&RawSDNodeBits, &this->RawSDNodeBits, sizeof(this->RawSDNodeBits));
+    SDNodeBits.HasDebugValue = 0;
+    memcpy(&Data, &RawSDNodeBits, sizeof(RawSDNodeBits));
+    return Data;
+  }
+
+  bool isVolatile() const { return MemSDNodeBits.IsVolatile; }
+  bool isNonTemporal() const { return MemSDNodeBits.IsNonTemporal; }
+  bool isDereferenceable() const { return MemSDNodeBits.IsDereferenceable; }
+  bool isInvariant() const { return MemSDNodeBits.IsInvariant; }
+
+
+  int64_t getSrcValueOffset() const { return MMO->getOffset(); }
+
+
+  AAMDNodes getAAInfo() const { return MMO->getAAInfo(); }
+
+
+  const MDNode *getRanges() const { return MMO->getRanges(); }
+
+
+  SyncScope::ID getSyncScopeID() const { return MMO->getSyncScopeID(); }
+
+
+
+
+  AtomicOrdering getOrdering() const { return MMO->getOrdering(); }
+
+
+  EVT getMemoryVT() const { return MemoryVT; }
+
+
+
+  MachineMemOperand *getMemOperand() const { return MMO; }
+
+  const MachinePointerInfo &getPointerInfo() const {
+    return MMO->getPointerInfo();
+  }
+
+
+  unsigned getAddressSpace() const {
+    return getPointerInfo().getAddrSpace();
+  }
+
+
+
+
+
+  void refineAlignment(const MachineMemOperand *NewMMO) {
+    MMO->refineAlignment(NewMMO);
+  }
+
+  const SDValue &getChain() const { return getOperand(0); }
+  const SDValue &getBasePtr() const {
+    return getOperand(getOpcode() == ISD::STORE ? 2 : 1);
+  }
+
+
+  static bool classof(const SDNode *N) {
+
+
+    return N->getOpcode() == ISD::LOAD ||
+           N->getOpcode() == ISD::STORE ||
+           N->getOpcode() == ISD::PREFETCH ||
+           N->getOpcode() == ISD::ATOMIC_CMP_SWAP ||
+           N->getOpcode() == ISD::ATOMIC_CMP_SWAP_WITH_SUCCESS ||
+           N->getOpcode() == ISD::ATOMIC_SWAP ||
+           N->getOpcode() == ISD::ATOMIC_LOAD_ADD ||
+           N->getOpcode() == ISD::ATOMIC_LOAD_SUB ||
+           N->getOpcode() == ISD::ATOMIC_LOAD_AND ||
+           N->getOpcode() == ISD::ATOMIC_LOAD_OR ||
+           N->getOpcode() == ISD::ATOMIC_LOAD_XOR ||
+           N->getOpcode() == ISD::ATOMIC_LOAD_NAND ||
+           N->getOpcode() == ISD::ATOMIC_LOAD_MIN ||
+           N->getOpcode() == ISD::ATOMIC_LOAD_MAX ||
+           N->getOpcode() == ISD::ATOMIC_LOAD_UMIN ||
+           N->getOpcode() == ISD::ATOMIC_LOAD_UMAX ||
+           N->getOpcode() == ISD::ATOMIC_LOAD ||
+           N->getOpcode() == ISD::ATOMIC_STORE ||
+           N->getOpcode() == ISD::MLOAD ||
+           N->getOpcode() == ISD::MSTORE ||
+           N->getOpcode() == ISD::MGATHER ||
+           N->getOpcode() == ISD::MSCATTER ||
+           N->isMemIntrinsic() ||
+           N->isTargetMemoryOpcode();
+  }
+};
+
+
+class AtomicSDNode : public MemSDNode {
+public:
+  AtomicSDNode(unsigned Opc, unsigned Order, const DebugLoc &dl, SDVTList VTL,
+               EVT MemVT, MachineMemOperand *MMO)
+      : MemSDNode(Opc, Order, dl, VTL, MemVT, MMO) {}
+
+  const SDValue &getBasePtr() const { return getOperand(1); }
+  const SDValue &getVal() const { return getOperand(2); }
+
+
+
+  bool isCompareAndSwap() const {
+    unsigned Op = getOpcode();
+    return Op == ISD::ATOMIC_CMP_SWAP ||
+           Op == ISD::ATOMIC_CMP_SWAP_WITH_SUCCESS;
+  }
+
+
+
+  AtomicOrdering getFailureOrdering() const {
+    
+   ((
+   isCompareAndSwap() && "Must be cmpxchg operation"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isCompareAndSwap() && \"Must be cmpxchg operation\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/SelectionDAGNodes.h", 1309, __PRETTY_FUNCTION__))
+                                                            ;
+    return MMO->getFailureOrdering();
+  }
+
+
+  static bool classof(const SDNode *N) {
+    return N->getOpcode() == ISD::ATOMIC_CMP_SWAP ||
+           N->getOpcode() == ISD::ATOMIC_CMP_SWAP_WITH_SUCCESS ||
+           N->getOpcode() == ISD::ATOMIC_SWAP ||
+           N->getOpcode() == ISD::ATOMIC_LOAD_ADD ||
+           N->getOpcode() == ISD::ATOMIC_LOAD_SUB ||
+           N->getOpcode() == ISD::ATOMIC_LOAD_AND ||
+           N->getOpcode() == ISD::ATOMIC_LOAD_OR ||
+           N->getOpcode() == ISD::ATOMIC_LOAD_XOR ||
+           N->getOpcode() == ISD::ATOMIC_LOAD_NAND ||
+           N->getOpcode() == ISD::ATOMIC_LOAD_MIN ||
+           N->getOpcode() == ISD::ATOMIC_LOAD_MAX ||
+           N->getOpcode() == ISD::ATOMIC_LOAD_UMIN ||
+           N->getOpcode() == ISD::ATOMIC_LOAD_UMAX ||
+           N->getOpcode() == ISD::ATOMIC_LOAD ||
+           N->getOpcode() == ISD::ATOMIC_STORE;
+  }
+};
+
+
+
+
+
+class MemIntrinsicSDNode : public MemSDNode {
+public:
+  MemIntrinsicSDNode(unsigned Opc, unsigned Order, const DebugLoc &dl,
+                     SDVTList VTs, EVT MemoryVT, MachineMemOperand *MMO)
+      : MemSDNode(Opc, Order, dl, VTs, MemoryVT, MMO) {
+    SDNodeBits.IsMemIntrinsic = true;
+  }
+
+
+  static bool classof(const SDNode *N) {
+
+
+    return N->isMemIntrinsic() ||
+           N->getOpcode() == ISD::PREFETCH ||
+           N->isTargetMemoryOpcode();
+  }
+};
+class ShuffleVectorSDNode : public SDNode {
+
+
+  const int *Mask;
+
+protected:
+  friend class SelectionDAG;
+
+  ShuffleVectorSDNode(EVT VT, unsigned Order, const DebugLoc &dl, const int *M)
+      : SDNode(ISD::VECTOR_SHUFFLE, Order, dl, getSDVTList(VT)), Mask(M) {}
+
+public:
+  ArrayRef<int> getMask() const {
+    EVT VT = getValueType(0);
+    return makeArrayRef(Mask, VT.getVectorNumElements());
+  }
+
+  int getMaskElt(unsigned Idx) const {
+    
+   ((
+   Idx < getValueType(0).getVectorNumElements() && "Idx out of range!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Idx < getValueType(0).getVectorNumElements() && \"Idx out of range!\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/SelectionDAGNodes.h", 1381, __PRETTY_FUNCTION__))
+                                                                              ;
+    return Mask[Idx];
+  }
+
+  bool isSplat() const { return isSplatMask(Mask, getValueType(0)); }
+
+  int getSplatIndex() const {
+    
+   ((
+   isSplat() && "Cannot get splat index for non-splat!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isSplat() && \"Cannot get splat index for non-splat!\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/SelectionDAGNodes.h", 1388, __PRETTY_FUNCTION__))
+                                                               ;
+    EVT VT = getValueType(0);
+    for (unsigned i = 0, e = VT.getVectorNumElements(); i != e; ++i) {
+      if (Mask[i] >= 0)
+        return Mask[i];
+    }
+    ::llvm::llvm_unreachable_internal("Splat with all undef indices?", "/home/trippels/llvm/llvm/include/llvm/CodeGen/SelectionDAGNodes.h", 1394);
+  }
+
+  static bool isSplatMask(const int *Mask, EVT VT);
+
+
+
+  static void commuteMask(MutableArrayRef<int> Mask) {
+    unsigned NumElems = Mask.size();
+    for (unsigned i = 0; i != NumElems; ++i) {
+      int idx = Mask[i];
+      if (idx < 0)
+        continue;
+      else if (idx < (int)NumElems)
+        Mask[i] = idx + NumElems;
+      else
+        Mask[i] = idx - NumElems;
+    }
+  }
+
+  static bool classof(const SDNode *N) {
+    return N->getOpcode() == ISD::VECTOR_SHUFFLE;
+  }
+};
+
+class ConstantSDNode : public SDNode {
+  friend class SelectionDAG;
+
+  const ConstantInt *Value;
+
+  ConstantSDNode(bool isTarget, bool isOpaque, const ConstantInt *val,
+                 const DebugLoc &DL, EVT VT)
+      : SDNode(isTarget ? ISD::TargetConstant : ISD::Constant, 0, DL,
+               getSDVTList(VT)),
+        Value(val) {
+    ConstantSDNodeBits.IsOpaque = isOpaque;
+  }
+
+public:
+  const ConstantInt *getConstantIntValue() const { return Value; }
+  const APInt &getAPIntValue() const { return Value->getValue(); }
+  uint64_t getZExtValue() const { return Value->getZExtValue(); }
+  int64_t getSExtValue() const { return Value->getSExtValue(); }
+  uint64_t getLimitedValue(uint64_t Limit = 
+                                           (18446744073709551615UL)
+                                                     ) {
+    return Value->getLimitedValue(Limit);
+  }
+
+  bool isOne() const { return Value->isOne(); }
+  bool isNullValue() const { return Value->isZero(); }
+  bool isAllOnesValue() const { return Value->isMinusOne(); }
+
+  bool isOpaque() const { return ConstantSDNodeBits.IsOpaque; }
+
+  static bool classof(const SDNode *N) {
+    return N->getOpcode() == ISD::Constant ||
+           N->getOpcode() == ISD::TargetConstant;
+  }
+};
+
+uint64_t SDNode::getConstantOperandVal(unsigned Num) const {
+  return cast<ConstantSDNode>(getOperand(Num))->getZExtValue();
+}
+
+class ConstantFPSDNode : public SDNode {
+  friend class SelectionDAG;
+
+  const ConstantFP *Value;
+
+  ConstantFPSDNode(bool isTarget, const ConstantFP *val, const DebugLoc &DL,
+                   EVT VT)
+      : SDNode(isTarget ? ISD::TargetConstantFP : ISD::ConstantFP, 0, DL,
+               getSDVTList(VT)),
+        Value(val) {}
+
+public:
+  const APFloat& getValueAPF() const { return Value->getValueAPF(); }
+  const ConstantFP *getConstantFPValue() const { return Value; }
+
+
+  bool isZero() const { return Value->isZero(); }
+
+
+  bool isNaN() const { return Value->isNaN(); }
+
+
+  bool isInfinity() const { return Value->isInfinity(); }
+
+
+  bool isNegative() const { return Value->isNegative(); }
+  bool isExactlyValue(double V) const {
+    return Value->getValueAPF().isExactlyValue(V);
+  }
+  bool isExactlyValue(const APFloat& V) const;
+
+  static bool isValueValidForType(EVT VT, const APFloat& Val);
+
+  static bool classof(const SDNode *N) {
+    return N->getOpcode() == ISD::ConstantFP ||
+           N->getOpcode() == ISD::TargetConstantFP;
+  }
+};
+
+
+bool isNullConstant(SDValue V);
+
+
+bool isNullFPConstant(SDValue V);
+
+
+bool isAllOnesConstant(SDValue V);
+
+
+bool isOneConstant(SDValue V);
+
+
+
+bool isBitwiseNot(SDValue V);
+
+
+ConstantSDNode *isConstOrConstSplat(SDValue V);
+
+
+ConstantFPSDNode *isConstOrConstSplatFP(SDValue V);
+
+class GlobalAddressSDNode : public SDNode {
+  friend class SelectionDAG;
+
+  const GlobalValue *TheGlobal;
+  int64_t Offset;
+  unsigned char TargetFlags;
+
+  GlobalAddressSDNode(unsigned Opc, unsigned Order, const DebugLoc &DL,
+                      const GlobalValue *GA, EVT VT, int64_t o,
+                      unsigned char TargetFlags);
+
+public:
+  const GlobalValue *getGlobal() const { return TheGlobal; }
+  int64_t getOffset() const { return Offset; }
+  unsigned char getTargetFlags() const { return TargetFlags; }
+
+  unsigned getAddressSpace() const;
+
+  static bool classof(const SDNode *N) {
+    return N->getOpcode() == ISD::GlobalAddress ||
+           N->getOpcode() == ISD::TargetGlobalAddress ||
+           N->getOpcode() == ISD::GlobalTLSAddress ||
+           N->getOpcode() == ISD::TargetGlobalTLSAddress;
+  }
+};
+
+class FrameIndexSDNode : public SDNode {
+  friend class SelectionDAG;
+
+  int FI;
+
+  FrameIndexSDNode(int fi, EVT VT, bool isTarg)
+    : SDNode(isTarg ? ISD::TargetFrameIndex : ISD::FrameIndex,
+      0, DebugLoc(), getSDVTList(VT)), FI(fi) {
+  }
+
+public:
+  int getIndex() const { return FI; }
+
+  static bool classof(const SDNode *N) {
+    return N->getOpcode() == ISD::FrameIndex ||
+           N->getOpcode() == ISD::TargetFrameIndex;
+  }
+};
+
+class JumpTableSDNode : public SDNode {
+  friend class SelectionDAG;
+
+  int JTI;
+  unsigned char TargetFlags;
+
+  JumpTableSDNode(int jti, EVT VT, bool isTarg, unsigned char TF)
+    : SDNode(isTarg ? ISD::TargetJumpTable : ISD::JumpTable,
+      0, DebugLoc(), getSDVTList(VT)), JTI(jti), TargetFlags(TF) {
+  }
+
+public:
+  int getIndex() const { return JTI; }
+  unsigned char getTargetFlags() const { return TargetFlags; }
+
+  static bool classof(const SDNode *N) {
+    return N->getOpcode() == ISD::JumpTable ||
+           N->getOpcode() == ISD::TargetJumpTable;
+  }
+};
+
+class ConstantPoolSDNode : public SDNode {
+  friend class SelectionDAG;
+
+  union {
+    const Constant *ConstVal;
+    MachineConstantPoolValue *MachineCPVal;
+  } Val;
+  int Offset;
+  unsigned Alignment;
+  unsigned char TargetFlags;
+
+  ConstantPoolSDNode(bool isTarget, const Constant *c, EVT VT, int o,
+                     unsigned Align, unsigned char TF)
+    : SDNode(isTarget ? ISD::TargetConstantPool : ISD::ConstantPool, 0,
+             DebugLoc(), getSDVTList(VT)), Offset(o), Alignment(Align),
+             TargetFlags(TF) {
+    
+   ((
+   Offset >= 0 && "Offset is too large"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Offset >= 0 && \"Offset is too large\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/SelectionDAGNodes.h", 1609, __PRETTY_FUNCTION__))
+                                               ;
+    Val.ConstVal = c;
+  }
+
+  ConstantPoolSDNode(bool isTarget, MachineConstantPoolValue *v,
+                     EVT VT, int o, unsigned Align, unsigned char TF)
+    : SDNode(isTarget ? ISD::TargetConstantPool : ISD::ConstantPool, 0,
+             DebugLoc(), getSDVTList(VT)), Offset(o), Alignment(Align),
+             TargetFlags(TF) {
+    
+   ((
+   Offset >= 0 && "Offset is too large"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Offset >= 0 && \"Offset is too large\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/SelectionDAGNodes.h", 1618, __PRETTY_FUNCTION__))
+                                               ;
+    Val.MachineCPVal = v;
+    Offset |= 1 << (sizeof(unsigned)*8 -1);
+  }
+
+public:
+  bool isMachineConstantPoolEntry() const {
+    return Offset < 0;
+  }
+
+  const Constant *getConstVal() const {
+    
+   ((
+   !isMachineConstantPoolEntry() && "Wrong constantpool type"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!isMachineConstantPoolEntry() && \"Wrong constantpool type\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/SelectionDAGNodes.h", 1629, __PRETTY_FUNCTION__))
+                                                                     ;
+    return Val.ConstVal;
+  }
+
+  MachineConstantPoolValue *getMachineCPVal() const {
+    
+   ((
+   isMachineConstantPoolEntry() && "Wrong constantpool type"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "isMachineConstantPoolEntry() && \"Wrong constantpool type\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/SelectionDAGNodes.h", 1634, __PRETTY_FUNCTION__))
+                                                                    ;
+    return Val.MachineCPVal;
+  }
+
+  int getOffset() const {
+    return Offset & ~(1 << (sizeof(unsigned)*8 -1));
+  }
+
+
+
+  unsigned getAlignment() const { return Alignment; }
+  unsigned char getTargetFlags() const { return TargetFlags; }
+
+  Type *getType() const;
+
+  static bool classof(const SDNode *N) {
+    return N->getOpcode() == ISD::ConstantPool ||
+           N->getOpcode() == ISD::TargetConstantPool;
+  }
+};
+
+
+class TargetIndexSDNode : public SDNode {
+  friend class SelectionDAG;
+
+  unsigned char TargetFlags;
+  int Index;
+  int64_t Offset;
+
+public:
+  TargetIndexSDNode(int Idx, EVT VT, int64_t Ofs, unsigned char TF)
+    : SDNode(ISD::TargetIndex, 0, DebugLoc(), getSDVTList(VT)),
+      TargetFlags(TF), Index(Idx), Offset(Ofs) {}
+
+  unsigned char getTargetFlags() const { return TargetFlags; }
+  int getIndex() const { return Index; }
+  int64_t getOffset() const { return Offset; }
+
+  static bool classof(const SDNode *N) {
+    return N->getOpcode() == ISD::TargetIndex;
+  }
+};
+
+class BasicBlockSDNode : public SDNode {
+  friend class SelectionDAG;
+
+  MachineBasicBlock *MBB;
+
+
+
+
+  explicit BasicBlockSDNode(MachineBasicBlock *mbb)
+    : SDNode(ISD::BasicBlock, 0, DebugLoc(), getSDVTList(MVT::Other)), MBB(mbb)
+  {}
+
+public:
+  MachineBasicBlock *getBasicBlock() const { return MBB; }
+
+  static bool classof(const SDNode *N) {
+    return N->getOpcode() == ISD::BasicBlock;
+  }
+};
+
+
+class BuildVectorSDNode : public SDNode {
+public:
+
+  explicit BuildVectorSDNode() = delete;
+  bool isConstantSplat(APInt &SplatValue, APInt &SplatUndef,
+                       unsigned &SplatBitSize, bool &HasAnyUndefs,
+                       unsigned MinSplatBits = 0,
+                       bool isBigEndian = false) const;
+
+
+
+
+
+  SDValue getSplatValue(BitVector *UndefElements = nullptr) const;
+
+
+
+
+
+
+  ConstantSDNode *
+  getConstantSplatNode(BitVector *UndefElements = nullptr) const;
+
+
+
+
+
+
+  ConstantFPSDNode *
+  getConstantFPSplatNode(BitVector *UndefElements = nullptr) const;
+
+
+
+
+
+
+  int32_t getConstantFPSplatPow2ToLog2Int(BitVector *UndefElements,
+                                          uint32_t BitWidth) const;
+
+  bool isConstant() const;
+
+  static bool classof(const SDNode *N) {
+    return N->getOpcode() == ISD::BUILD_VECTOR;
+  }
+};
+
+
+
+
+
+class SrcValueSDNode : public SDNode {
+  friend class SelectionDAG;
+
+  const Value *V;
+
+
+  explicit SrcValueSDNode(const Value *v)
+    : SDNode(ISD::SRCVALUE, 0, DebugLoc(), getSDVTList(MVT::Other)), V(v) {}
+
+public:
+
+  const Value *getValue() const { return V; }
+
+  static bool classof(const SDNode *N) {
+    return N->getOpcode() == ISD::SRCVALUE;
+  }
+};
+
+class MDNodeSDNode : public SDNode {
+  friend class SelectionDAG;
+
+  const MDNode *MD;
+
+  explicit MDNodeSDNode(const MDNode *md)
+  : SDNode(ISD::MDNODE_SDNODE, 0, DebugLoc(), getSDVTList(MVT::Other)), MD(md)
+  {}
+
+public:
+  const MDNode *getMD() const { return MD; }
+
+  static bool classof(const SDNode *N) {
+    return N->getOpcode() == ISD::MDNODE_SDNODE;
+  }
+};
+
+class RegisterSDNode : public SDNode {
+  friend class SelectionDAG;
+
+  unsigned Reg;
+
+  RegisterSDNode(unsigned reg, EVT VT)
+    : SDNode(ISD::Register, 0, DebugLoc(), getSDVTList(VT)), Reg(reg) {}
+
+public:
+  unsigned getReg() const { return Reg; }
+
+  static bool classof(const SDNode *N) {
+    return N->getOpcode() == ISD::Register;
+  }
+};
+
+class RegisterMaskSDNode : public SDNode {
+  friend class SelectionDAG;
+
+
+  const uint32_t *RegMask;
+
+  RegisterMaskSDNode(const uint32_t *mask)
+    : SDNode(ISD::RegisterMask, 0, DebugLoc(), getSDVTList(MVT::Untyped)),
+      RegMask(mask) {}
+
+public:
+  const uint32_t *getRegMask() const { return RegMask; }
+
+  static bool classof(const SDNode *N) {
+    return N->getOpcode() == ISD::RegisterMask;
+  }
+};
+
+class BlockAddressSDNode : public SDNode {
+  friend class SelectionDAG;
+
+  const BlockAddress *BA;
+  int64_t Offset;
+  unsigned char TargetFlags;
+
+  BlockAddressSDNode(unsigned NodeTy, EVT VT, const BlockAddress *ba,
+                     int64_t o, unsigned char Flags)
+    : SDNode(NodeTy, 0, DebugLoc(), getSDVTList(VT)),
+             BA(ba), Offset(o), TargetFlags(Flags) {}
+
+public:
+  const BlockAddress *getBlockAddress() const { return BA; }
+  int64_t getOffset() const { return Offset; }
+  unsigned char getTargetFlags() const { return TargetFlags; }
+
+  static bool classof(const SDNode *N) {
+    return N->getOpcode() == ISD::BlockAddress ||
+           N->getOpcode() == ISD::TargetBlockAddress;
+  }
+};
+
+class LabelSDNode : public SDNode {
+  friend class SelectionDAG;
+
+  MCSymbol *Label;
+
+  LabelSDNode(unsigned Order, const DebugLoc &dl, MCSymbol *L)
+      : SDNode(ISD::EH_LABEL, Order, dl, getSDVTList(MVT::Other)), Label(L) {}
+
+public:
+  MCSymbol *getLabel() const { return Label; }
+
+  static bool classof(const SDNode *N) {
+    return N->getOpcode() == ISD::EH_LABEL ||
+           N->getOpcode() == ISD::ANNOTATION_LABEL;
+  }
+};
+
+class ExternalSymbolSDNode : public SDNode {
+  friend class SelectionDAG;
+
+  const char *Symbol;
+  unsigned char TargetFlags;
+
+  ExternalSymbolSDNode(bool isTarget, const char *Sym, unsigned char TF, EVT VT)
+    : SDNode(isTarget ? ISD::TargetExternalSymbol : ISD::ExternalSymbol,
+             0, DebugLoc(), getSDVTList(VT)), Symbol(Sym), TargetFlags(TF) {}
+
+public:
+  const char *getSymbol() const { return Symbol; }
+  unsigned char getTargetFlags() const { return TargetFlags; }
+
+  static bool classof(const SDNode *N) {
+    return N->getOpcode() == ISD::ExternalSymbol ||
+           N->getOpcode() == ISD::TargetExternalSymbol;
+  }
+};
+
+class MCSymbolSDNode : public SDNode {
+  friend class SelectionDAG;
+
+  MCSymbol *Symbol;
+
+  MCSymbolSDNode(MCSymbol *Symbol, EVT VT)
+      : SDNode(ISD::MCSymbol, 0, DebugLoc(), getSDVTList(VT)), Symbol(Symbol) {}
+
+public:
+  MCSymbol *getMCSymbol() const { return Symbol; }
+
+  static bool classof(const SDNode *N) {
+    return N->getOpcode() == ISD::MCSymbol;
+  }
+};
+
+class CondCodeSDNode : public SDNode {
+  friend class SelectionDAG;
+
+  ISD::CondCode Condition;
+
+  explicit CondCodeSDNode(ISD::CondCode Cond)
+    : SDNode(ISD::CONDCODE, 0, DebugLoc(), getSDVTList(MVT::Other)),
+      Condition(Cond) {}
+
+public:
+  ISD::CondCode get() const { return Condition; }
+
+  static bool classof(const SDNode *N) {
+    return N->getOpcode() == ISD::CONDCODE;
+  }
+};
+
+
+
+class VTSDNode : public SDNode {
+  friend class SelectionDAG;
+
+  EVT ValueType;
+
+  explicit VTSDNode(EVT VT)
+    : SDNode(ISD::VALUETYPE, 0, DebugLoc(), getSDVTList(MVT::Other)),
+      ValueType(VT) {}
+
+public:
+  EVT getVT() const { return ValueType; }
+
+  static bool classof(const SDNode *N) {
+    return N->getOpcode() == ISD::VALUETYPE;
+  }
+};
+
+
+class LSBaseSDNode : public MemSDNode {
+public:
+  LSBaseSDNode(ISD::NodeType NodeTy, unsigned Order, const DebugLoc &dl,
+               SDVTList VTs, ISD::MemIndexedMode AM, EVT MemVT,
+               MachineMemOperand *MMO)
+      : MemSDNode(NodeTy, Order, dl, VTs, MemVT, MMO) {
+    LSBaseSDNodeBits.AddressingMode = AM;
+    
+   ((
+   getAddressingMode() == AM && "Value truncated"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "getAddressingMode() == AM && \"Value truncated\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/SelectionDAGNodes.h", 1947, __PRETTY_FUNCTION__))
+                                                         ;
+  }
+
+  const SDValue &getOffset() const {
+    return getOperand(getOpcode() == ISD::LOAD ? 2 : 3);
+  }
+
+
+
+  ISD::MemIndexedMode getAddressingMode() const {
+    return static_cast<ISD::MemIndexedMode>(LSBaseSDNodeBits.AddressingMode);
+  }
+
+
+  bool isIndexed() const { return getAddressingMode() != ISD::UNINDEXED; }
+
+
+  bool isUnindexed() const { return getAddressingMode() == ISD::UNINDEXED; }
+
+  static bool classof(const SDNode *N) {
+    return N->getOpcode() == ISD::LOAD ||
+           N->getOpcode() == ISD::STORE;
+  }
+};
+
+
+class LoadSDNode : public LSBaseSDNode {
+  friend class SelectionDAG;
+
+  LoadSDNode(unsigned Order, const DebugLoc &dl, SDVTList VTs,
+             ISD::MemIndexedMode AM, ISD::LoadExtType ETy, EVT MemVT,
+             MachineMemOperand *MMO)
+      : LSBaseSDNode(ISD::LOAD, Order, dl, VTs, AM, MemVT, MMO) {
+    LoadSDNodeBits.ExtTy = ETy;
+    
+   ((
+   readMem() && "Load MachineMemOperand is not a load!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "readMem() && \"Load MachineMemOperand is not a load!\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/SelectionDAGNodes.h", 1981, __PRETTY_FUNCTION__))
+                                                               ;
+    
+   ((
+   !writeMem() && "Load MachineMemOperand is a store!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!writeMem() && \"Load MachineMemOperand is a store!\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/SelectionDAGNodes.h", 1982, __PRETTY_FUNCTION__))
+                                                              ;
+  }
+
+public:
+
+
+  ISD::LoadExtType getExtensionType() const {
+    return static_cast<ISD::LoadExtType>(LoadSDNodeBits.ExtTy);
+  }
+
+  const SDValue &getBasePtr() const { return getOperand(1); }
+  const SDValue &getOffset() const { return getOperand(2); }
+
+  static bool classof(const SDNode *N) {
+    return N->getOpcode() == ISD::LOAD;
+  }
+};
+
+
+class StoreSDNode : public LSBaseSDNode {
+  friend class SelectionDAG;
+
+  StoreSDNode(unsigned Order, const DebugLoc &dl, SDVTList VTs,
+              ISD::MemIndexedMode AM, bool isTrunc, EVT MemVT,
+              MachineMemOperand *MMO)
+      : LSBaseSDNode(ISD::STORE, Order, dl, VTs, AM, MemVT, MMO) {
+    StoreSDNodeBits.IsTruncating = isTrunc;
+    
+   ((
+   !readMem() && "Store MachineMemOperand is a load!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!readMem() && \"Store MachineMemOperand is a load!\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/SelectionDAGNodes.h", 2009, __PRETTY_FUNCTION__))
+                                                             ;
+    
+   ((
+   writeMem() && "Store MachineMemOperand is not a store!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "writeMem() && \"Store MachineMemOperand is not a store!\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/SelectionDAGNodes.h", 2010, __PRETTY_FUNCTION__))
+                                                                  ;
+  }
+
+public:
+
+
+
+  bool isTruncatingStore() const { return StoreSDNodeBits.IsTruncating; }
+  void setTruncatingStore(bool Truncating) {
+    StoreSDNodeBits.IsTruncating = Truncating;
+  }
+
+  const SDValue &getValue() const { return getOperand(1); }
+  const SDValue &getBasePtr() const { return getOperand(2); }
+  const SDValue &getOffset() const { return getOperand(3); }
+
+  static bool classof(const SDNode *N) {
+    return N->getOpcode() == ISD::STORE;
+  }
+};
+
+
+class MaskedLoadStoreSDNode : public MemSDNode {
+public:
+  friend class SelectionDAG;
+
+  MaskedLoadStoreSDNode(ISD::NodeType NodeTy, unsigned Order,
+                        const DebugLoc &dl, SDVTList VTs, EVT MemVT,
+                        MachineMemOperand *MMO)
+      : MemSDNode(NodeTy, Order, dl, VTs, MemVT, MMO) {}
+
+
+
+
+
+  const SDValue &getBasePtr() const { return getOperand(1); }
+  const SDValue &getMask() const { return getOperand(2); }
+
+  static bool classof(const SDNode *N) {
+    return N->getOpcode() == ISD::MLOAD ||
+           N->getOpcode() == ISD::MSTORE;
+  }
+};
+
+
+class MaskedLoadSDNode : public MaskedLoadStoreSDNode {
+public:
+  friend class SelectionDAG;
+
+  MaskedLoadSDNode(unsigned Order, const DebugLoc &dl, SDVTList VTs,
+                   ISD::LoadExtType ETy, bool IsExpanding, EVT MemVT,
+                   MachineMemOperand *MMO)
+      : MaskedLoadStoreSDNode(ISD::MLOAD, Order, dl, VTs, MemVT, MMO) {
+    LoadSDNodeBits.ExtTy = ETy;
+    LoadSDNodeBits.IsExpanding = IsExpanding;
+  }
+
+  ISD::LoadExtType getExtensionType() const {
+    return static_cast<ISD::LoadExtType>(LoadSDNodeBits.ExtTy);
+  }
+
+  const SDValue &getSrc0() const { return getOperand(3); }
+  static bool classof(const SDNode *N) {
+    return N->getOpcode() == ISD::MLOAD;
+  }
+
+  bool isExpandingLoad() const { return LoadSDNodeBits.IsExpanding; }
+};
+
+
+class MaskedStoreSDNode : public MaskedLoadStoreSDNode {
+public:
+  friend class SelectionDAG;
+
+  MaskedStoreSDNode(unsigned Order, const DebugLoc &dl, SDVTList VTs,
+                    bool isTrunc, bool isCompressing, EVT MemVT,
+                    MachineMemOperand *MMO)
+      : MaskedLoadStoreSDNode(ISD::MSTORE, Order, dl, VTs, MemVT, MMO) {
+    StoreSDNodeBits.IsTruncating = isTrunc;
+    StoreSDNodeBits.IsCompressing = isCompressing;
+  }
+
+
+
+
+  bool isTruncatingStore() const { return StoreSDNodeBits.IsTruncating; }
+
+
+
+
+
+  bool isCompressingStore() const { return StoreSDNodeBits.IsCompressing; }
+
+  const SDValue &getValue() const { return getOperand(3); }
+
+  static bool classof(const SDNode *N) {
+    return N->getOpcode() == ISD::MSTORE;
+  }
+};
+
+
+
+
+class MaskedGatherScatterSDNode : public MemSDNode {
+public:
+  friend class SelectionDAG;
+
+  MaskedGatherScatterSDNode(ISD::NodeType NodeTy, unsigned Order,
+                            const DebugLoc &dl, SDVTList VTs, EVT MemVT,
+                            MachineMemOperand *MMO)
+      : MemSDNode(NodeTy, Order, dl, VTs, MemVT, MMO) {}
+
+
+
+
+
+  const SDValue &getBasePtr() const { return getOperand(3); }
+  const SDValue &getIndex() const { return getOperand(4); }
+  const SDValue &getMask() const { return getOperand(2); }
+  const SDValue &getValue() const { return getOperand(1); }
+  const SDValue &getScale() const { return getOperand(5); }
+
+  static bool classof(const SDNode *N) {
+    return N->getOpcode() == ISD::MGATHER ||
+           N->getOpcode() == ISD::MSCATTER;
+  }
+};
+
+
+
+class MaskedGatherSDNode : public MaskedGatherScatterSDNode {
+public:
+  friend class SelectionDAG;
+
+  MaskedGatherSDNode(unsigned Order, const DebugLoc &dl, SDVTList VTs,
+                     EVT MemVT, MachineMemOperand *MMO)
+      : MaskedGatherScatterSDNode(ISD::MGATHER, Order, dl, VTs, MemVT, MMO) {}
+
+  static bool classof(const SDNode *N) {
+    return N->getOpcode() == ISD::MGATHER;
+  }
+};
+
+
+
+class MaskedScatterSDNode : public MaskedGatherScatterSDNode {
+public:
+  friend class SelectionDAG;
+
+  MaskedScatterSDNode(unsigned Order, const DebugLoc &dl, SDVTList VTs,
+                      EVT MemVT, MachineMemOperand *MMO)
+      : MaskedGatherScatterSDNode(ISD::MSCATTER, Order, dl, VTs, MemVT, MMO) {}
+
+  static bool classof(const SDNode *N) {
+    return N->getOpcode() == ISD::MSCATTER;
+  }
+};
+
+
+
+
+class MachineSDNode : public SDNode {
+public:
+  using mmo_iterator = MachineMemOperand **;
+
+private:
+  friend class SelectionDAG;
+
+  MachineSDNode(unsigned Opc, unsigned Order, const DebugLoc &DL, SDVTList VTs)
+      : SDNode(Opc, Order, DL, VTs) {}
+
+
+  mmo_iterator MemRefs = nullptr;
+  mmo_iterator MemRefsEnd = nullptr;
+
+public:
+  mmo_iterator memoperands_begin() const { return MemRefs; }
+  mmo_iterator memoperands_end() const { return MemRefsEnd; }
+  bool memoperands_empty() const { return MemRefsEnd == MemRefs; }
+
+
+
+  void setMemRefs(mmo_iterator NewMemRefs, mmo_iterator NewMemRefsEnd) {
+    for (mmo_iterator MMI = NewMemRefs, MME = NewMemRefsEnd; MMI != MME; ++MMI)
+      
+     ((
+     *MMI && "Null mem ref detected!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "*MMI && \"Null mem ref detected!\""
+     , "/home/trippels/llvm/llvm/include/llvm/CodeGen/SelectionDAGNodes.h", 2194, __PRETTY_FUNCTION__))
+                                             ;
+    MemRefs = NewMemRefs;
+    MemRefsEnd = NewMemRefsEnd;
+  }
+
+  static bool classof(const SDNode *N) {
+    return N->isMachineOpcode();
+  }
+};
+
+class SDNodeIterator : public std::iterator<std::forward_iterator_tag,
+                                            SDNode, ptrdiff_t> {
+  const SDNode *Node;
+  unsigned Operand;
+
+  SDNodeIterator(const SDNode *N, unsigned Op) : Node(N), Operand(Op) {}
+
+public:
+  bool operator==(const SDNodeIterator& x) const {
+    return Operand == x.Operand;
+  }
+  bool operator!=(const SDNodeIterator& x) const { return !operator==(x); }
+
+  pointer operator*() const {
+    return Node->getOperand(Operand).getNode();
+  }
+  pointer operator->() const { return operator*(); }
+
+  SDNodeIterator& operator++() {
+    ++Operand;
+    return *this;
+  }
+  SDNodeIterator operator++(int) {
+    SDNodeIterator tmp = *this; ++*this; return tmp;
+  }
+  size_t operator-(SDNodeIterator Other) const {
+    
+   ((
+   Node == Other.Node && "Cannot compare iterators of two different nodes!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Node == Other.Node && \"Cannot compare iterators of two different nodes!\""
+   ,
+                                                             "/home/trippels/llvm/llvm/include/llvm/CodeGen/SelectionDAGNodes.h"
+    ,
+                                                             2231
+    , __PRETTY_FUNCTION__))
+                                                              
+                                                             ;
+    return Operand - Other.Operand;
+  }
+
+  static SDNodeIterator begin(const SDNode *N) { return SDNodeIterator(N, 0); }
+  static SDNodeIterator end (const SDNode *N) {
+    return SDNodeIterator(N, N->getNumOperands());
+  }
+
+  unsigned getOperand() const { return Operand; }
+  const SDNode *getNode() const { return Node; }
+};
+
+template <> struct GraphTraits<SDNode*> {
+  using NodeRef = SDNode *;
+  using ChildIteratorType = SDNodeIterator;
+
+  static NodeRef getEntryNode(SDNode *N) { return N; }
+
+  static ChildIteratorType child_begin(NodeRef N) {
+    return SDNodeIterator::begin(N);
+  }
+
+  static ChildIteratorType child_end(NodeRef N) {
+    return SDNodeIterator::end(N);
+  }
+};
+
+
+
+
+
+using LargestSDNode = AlignedCharArrayUnion<AtomicSDNode, TargetIndexSDNode,
+                                            BlockAddressSDNode,
+                                            GlobalAddressSDNode>;
+
+
+using MostAlignedSDNode = GlobalAddressSDNode;
+
+namespace ISD {
+
+
+  inline bool isNormalLoad(const SDNode *N) {
+    const LoadSDNode *Ld = dyn_cast<LoadSDNode>(N);
+    return Ld && Ld->getExtensionType() == ISD::NON_EXTLOAD &&
+      Ld->getAddressingMode() == ISD::UNINDEXED;
+  }
+
+
+  inline bool isNON_EXTLoad(const SDNode *N) {
+    return isa<LoadSDNode>(N) &&
+      cast<LoadSDNode>(N)->getExtensionType() == ISD::NON_EXTLOAD;
+  }
+
+
+  inline bool isEXTLoad(const SDNode *N) {
+    return isa<LoadSDNode>(N) &&
+      cast<LoadSDNode>(N)->getExtensionType() == ISD::EXTLOAD;
+  }
+
+
+  inline bool isSEXTLoad(const SDNode *N) {
+    return isa<LoadSDNode>(N) &&
+      cast<LoadSDNode>(N)->getExtensionType() == ISD::SEXTLOAD;
+  }
+
+
+  inline bool isZEXTLoad(const SDNode *N) {
+    return isa<LoadSDNode>(N) &&
+      cast<LoadSDNode>(N)->getExtensionType() == ISD::ZEXTLOAD;
+  }
+
+
+  inline bool isUNINDEXEDLoad(const SDNode *N) {
+    return isa<LoadSDNode>(N) &&
+      cast<LoadSDNode>(N)->getAddressingMode() == ISD::UNINDEXED;
+  }
+
+
+
+  inline bool isNormalStore(const SDNode *N) {
+    const StoreSDNode *St = dyn_cast<StoreSDNode>(N);
+    return St && !St->isTruncatingStore() &&
+      St->getAddressingMode() == ISD::UNINDEXED;
+  }
+
+
+  inline bool isNON_TRUNCStore(const SDNode *N) {
+    return isa<StoreSDNode>(N) && !cast<StoreSDNode>(N)->isTruncatingStore();
+  }
+
+
+  inline bool isTRUNCStore(const SDNode *N) {
+    return isa<StoreSDNode>(N) && cast<StoreSDNode>(N)->isTruncatingStore();
+  }
+
+
+  inline bool isUNINDEXEDStore(const SDNode *N) {
+    return isa<StoreSDNode>(N) &&
+      cast<StoreSDNode>(N)->getAddressingMode() == ISD::UNINDEXED;
+  }
+
+}
+
+}
+namespace llvm {
+
+
+
+
+template <class AllocatorType, class T, size_t Size = sizeof(T),
+          size_t Align = alignof(T)>
+class RecyclingAllocator {
+private:
+
+
+  Recycler<T, Size, Align> Base;
+
+
+
+  AllocatorType Allocator;
+
+public:
+  ~RecyclingAllocator() { Base.clear(Allocator); }
+
+
+
+
+  template<class SubClass>
+  SubClass *Allocate() { return Base.template Allocate<SubClass>(Allocator); }
+
+  T *Allocate() { return Base.Allocate(Allocator); }
+
+
+
+
+  template<class SubClass>
+  void Deallocate(SubClass* E) { return Base.Deallocate(Allocator, E); }
+
+  void PrintStats() {
+    Allocator.PrintStats();
+    Base.PrintStats();
+  }
+};
+
+}
+
+template<class AllocatorType, class T, size_t Size, size_t Align>
+inline void *operator new(size_t size,
+                          llvm::RecyclingAllocator<AllocatorType,
+                                                   T, Size, Align> &Allocator) {
+  
+ ((
+ size <= Size && "allocation size exceeded"
+ ) ? static_cast<void> (0) : __assert_fail (
+ "size <= Size && \"allocation size exceeded\""
+ , "/home/trippels/llvm/llvm/include/llvm/Support/RecyclingAllocator.h", 66, __PRETTY_FUNCTION__))
+                                                   ;
+  return Allocator.Allocate();
+}
+
+template<class AllocatorType, class T, size_t Size, size_t Align>
+inline void operator delete(void *E,
+                            llvm::RecyclingAllocator<AllocatorType,
+                                                     T, Size, Align> &A) {
+  A.Deallocate(E);
+}
+
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+namespace llvm {
+
+class BlockAddress;
+class Constant;
+class ConstantFP;
+class ConstantInt;
+class DataLayout;
+struct fltSemantics;
+class GlobalValue;
+struct KnownBits;
+class LLVMContext;
+class MachineBasicBlock;
+class MachineConstantPoolValue;
+class MCSymbol;
+class OptimizationRemarkEmitter;
+class SDDbgValue;
+class SelectionDAG;
+class SelectionDAGTargetInfo;
+class TargetLibraryInfo;
+class TargetLowering;
+class TargetMachine;
+class TargetSubtargetInfo;
+class Value;
+
+class SDVTListNode : public FoldingSetNode {
+  friend struct FoldingSetTrait<SDVTListNode>;
+
+
+
+
+
+
+  FoldingSetNodeIDRef FastID;
+  const EVT *VTs;
+  unsigned int NumVTs;
+
+
+  unsigned HashValue;
+
+public:
+  SDVTListNode(const FoldingSetNodeIDRef ID, const EVT *VT, unsigned int Num) :
+      FastID(ID), VTs(VT), NumVTs(Num) {
+    HashValue = ID.ComputeHash();
+  }
+
+  SDVTList getSDVTList() {
+    SDVTList result = {VTs, NumVTs};
+    return result;
+  }
+};
+
+
+
+template<> struct FoldingSetTrait<SDVTListNode> : DefaultFoldingSetTrait<SDVTListNode> {
+  static void Profile(const SDVTListNode &X, FoldingSetNodeID& ID) {
+    ID = X.FastID;
+  }
+
+  static bool Equals(const SDVTListNode &X, const FoldingSetNodeID &ID,
+                     unsigned IDHash, FoldingSetNodeID &TempID) {
+    if (X.HashValue != IDHash)
+      return false;
+    return ID == X.FastID;
+  }
+
+  static unsigned ComputeHash(const SDVTListNode &X, FoldingSetNodeID &TempID) {
+    return X.HashValue;
+  }
+};
+
+template <> struct ilist_alloc_traits<SDNode> {
+  static void deleteNode(SDNode *) {
+    ::llvm::llvm_unreachable_internal("ilist_traits<SDNode> shouldn't see a deleteNode call!", "/home/trippels/llvm/llvm/include/llvm/CodeGen/SelectionDAG.h", 130);
+  }
+};
+class SDDbgInfo {
+  BumpPtrAllocator Alloc;
+  SmallVector<SDDbgValue*, 32> DbgValues;
+  SmallVector<SDDbgValue*, 32> ByvalParmDbgValues;
+  using DbgValMapType = DenseMap<const SDNode *, SmallVector<SDDbgValue *, 2>>;
+  DbgValMapType DbgValMap;
+
+public:
+  SDDbgInfo() = default;
+  SDDbgInfo(const SDDbgInfo &) = delete;
+  SDDbgInfo &operator=(const SDDbgInfo &) = delete;
+
+  void add(SDDbgValue *V, const SDNode *Node, bool isParameter) {
+    if (isParameter) {
+      ByvalParmDbgValues.push_back(V);
+    } else DbgValues.push_back(V);
+    if (Node)
+      DbgValMap[Node].push_back(V);
+  }
+
+
+
+  void erase(const SDNode *Node);
+
+  void clear() {
+    DbgValMap.clear();
+    DbgValues.clear();
+    ByvalParmDbgValues.clear();
+    Alloc.Reset();
+  }
+
+  BumpPtrAllocator &getAlloc() { return Alloc; }
+
+  bool empty() const {
+    return DbgValues.empty() && ByvalParmDbgValues.empty();
+  }
+
+  ArrayRef<SDDbgValue*> getSDDbgValues(const SDNode *Node) {
+    DbgValMapType::iterator I = DbgValMap.find(Node);
+    if (I != DbgValMap.end())
+      return I->second;
+    return ArrayRef<SDDbgValue*>();
+  }
+
+  using DbgIterator = SmallVectorImpl<SDDbgValue*>::iterator;
+
+  DbgIterator DbgBegin() { return DbgValues.begin(); }
+  DbgIterator DbgEnd() { return DbgValues.end(); }
+  DbgIterator ByvalParmDbgBegin() { return ByvalParmDbgValues.begin(); }
+  DbgIterator ByvalParmDbgEnd() { return ByvalParmDbgValues.end(); }
+};
+
+void checkForCycles(const SelectionDAG *DAG, bool force = false);
+class SelectionDAG {
+  const TargetMachine &TM;
+  const SelectionDAGTargetInfo *TSI = nullptr;
+  const TargetLowering *TLI = nullptr;
+  const TargetLibraryInfo *LibInfo = nullptr;
+  MachineFunction *MF;
+  Pass *SDAGISelPass = nullptr;
+  LLVMContext *Context;
+  CodeGenOpt::Level OptLevel;
+
+
+
+  OptimizationRemarkEmitter *ORE;
+
+
+  SDNode EntryNode;
+
+
+  SDValue Root;
+
+
+  ilist<SDNode> AllNodes;
+
+
+
+  using NodeAllocatorType = RecyclingAllocator<BumpPtrAllocator, SDNode,
+                                               sizeof(LargestSDNode),
+                                               alignof(MostAlignedSDNode)>;
+
+
+  NodeAllocatorType NodeAllocator;
+
+
+
+  FoldingSet<SDNode> CSEMap;
+
+
+  BumpPtrAllocator OperandAllocator;
+  ArrayRecycler<SDUse> OperandRecycler;
+
+
+  BumpPtrAllocator Allocator;
+
+
+  SDDbgInfo *DbgInfo;
+
+  uint16_t NextPersistentId = 0;
+
+public:
+
+
+
+
+
+
+  struct DAGUpdateListener {
+    DAGUpdateListener *const Next;
+    SelectionDAG &DAG;
+
+    explicit DAGUpdateListener(SelectionDAG &D)
+      : Next(D.UpdateListeners), DAG(D) {
+      DAG.UpdateListeners = this;
+    }
+
+    virtual ~DAGUpdateListener() {
+      
+     ((
+     DAG.UpdateListeners == this && "DAGUpdateListeners must be destroyed in LIFO order"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "DAG.UpdateListeners == this && \"DAGUpdateListeners must be destroyed in LIFO order\""
+     ,
+                                                                 "/home/trippels/llvm/llvm/include/llvm/CodeGen/SelectionDAG.h"
+      ,
+                                                                 276
+      , __PRETTY_FUNCTION__))
+                                                                  
+                                                                 ;
+      DAG.UpdateListeners = Next;
+    }
+
+
+
+    virtual void NodeDeleted(SDNode *N, SDNode *E);
+
+
+    virtual void NodeUpdated(SDNode *N);
+  };
+
+  struct DAGNodeDeletedListener : public DAGUpdateListener {
+    std::function<void(SDNode *, SDNode *)> Callback;
+
+    DAGNodeDeletedListener(SelectionDAG &DAG,
+                           std::function<void(SDNode *, SDNode *)> Callback)
+        : DAGUpdateListener(DAG), Callback(std::move(Callback)) {}
+
+    void NodeDeleted(SDNode *N, SDNode *E) override { Callback(N, E); }
+  };
+
+
+
+
+
+
+  bool NewNodesMustHaveLegalTypes = false;
+
+private:
+
+  friend struct DAGUpdateListener;
+
+
+
+  DAGUpdateListener *UpdateListeners = nullptr;
+
+
+
+  bool setSubgraphColorHelper(SDNode *N, const char *Color,
+                              DenseSet<SDNode *> &visited,
+                              int level, bool &printed);
+
+  template <typename SDNodeT, typename... ArgTypes>
+  SDNodeT *newSDNode(ArgTypes &&... Args) {
+    return new (NodeAllocator.template Allocate<SDNodeT>())
+        SDNodeT(std::forward<ArgTypes>(Args)...);
+  }
+
+
+
+
+
+
+
+  template <typename SDNodeT, typename... ArgTypes>
+  static uint16_t getSyntheticNodeSubclassData(unsigned IROrder,
+                                               ArgTypes &&... Args) {
+
+
+
+    return SDNodeT(IROrder, DebugLoc(), std::forward<ArgTypes>(Args)...)
+        .getRawSubclassData();
+  }
+
+  template <typename SDNodeTy>
+  static uint16_t getSyntheticNodeSubclassData(unsigned Opc, unsigned Order,
+                                                SDVTList VTs, EVT MemoryVT,
+                                                MachineMemOperand *MMO) {
+    return SDNodeTy(Opc, Order, DebugLoc(), VTs, MemoryVT, MMO)
+         .getRawSubclassData();
+  }
+
+  void createOperands(SDNode *Node, ArrayRef<SDValue> Vals) {
+    
+   ((
+   !Node->OperandList && "Node already has operands"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!Node->OperandList && \"Node already has operands\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/SelectionDAG.h", 350, __PRETTY_FUNCTION__))
+                                                            ;
+    SDUse *Ops = OperandRecycler.allocate(
+        ArrayRecycler<SDUse>::Capacity::get(Vals.size()), OperandAllocator);
+
+    for (unsigned I = 0; I != Vals.size(); ++I) {
+      Ops[I].setUser(Node);
+      Ops[I].setInitial(Vals[I]);
+    }
+    Node->NumOperands = Vals.size();
+    Node->OperandList = Ops;
+    checkForCycles(Node);
+  }
+
+  void removeOperands(SDNode *Node) {
+    if (!Node->OperandList)
+      return;
+    OperandRecycler.deallocate(
+        ArrayRecycler<SDUse>::Capacity::get(Node->NumOperands),
+        Node->OperandList);
+    Node->NumOperands = 0;
+    Node->OperandList = nullptr;
+  }
+
+public:
+  explicit SelectionDAG(const TargetMachine &TM, CodeGenOpt::Level);
+  SelectionDAG(const SelectionDAG &) = delete;
+  SelectionDAG &operator=(const SelectionDAG &) = delete;
+  ~SelectionDAG();
+
+
+  void init(MachineFunction &NewMF, OptimizationRemarkEmitter &NewORE,
+            Pass *PassPtr, const TargetLibraryInfo *LibraryInfo);
+
+
+
+  void clear();
+
+  MachineFunction &getMachineFunction() const { return *MF; }
+  const Pass *getPass() const { return SDAGISelPass; }
+
+  const DataLayout &getDataLayout() const { return MF->getDataLayout(); }
+  const TargetMachine &getTarget() const { return TM; }
+  const TargetSubtargetInfo &getSubtarget() const { return MF->getSubtarget(); }
+  const TargetLowering &getTargetLoweringInfo() const { return *TLI; }
+  const TargetLibraryInfo &getLibInfo() const { return *LibInfo; }
+  const SelectionDAGTargetInfo &getSelectionDAGInfo() const { return *TSI; }
+  LLVMContext *getContext() const {return Context; }
+  OptimizationRemarkEmitter &getORE() const { return *ORE; }
+
+
+  void viewGraph(const std::string &Title);
+  void viewGraph();
+
+
+  std::map<const SDNode *, std::string> NodeGraphAttrs;
+
+
+
+
+  void clearGraphAttrs();
+
+
+  void setGraphAttrs(const SDNode *N, const char *Attrs);
+
+
+
+  const std::string getGraphAttrs(const SDNode *N) const;
+
+
+  void setGraphColor(const SDNode *N, const char *Color);
+
+
+  void setSubgraphColor(SDNode *N, const char *Color);
+
+  using allnodes_const_iterator = ilist<SDNode>::const_iterator;
+
+  allnodes_const_iterator allnodes_begin() const { return AllNodes.begin(); }
+  allnodes_const_iterator allnodes_end() const { return AllNodes.end(); }
+
+  using allnodes_iterator = ilist<SDNode>::iterator;
+
+  allnodes_iterator allnodes_begin() { return AllNodes.begin(); }
+  allnodes_iterator allnodes_end() { return AllNodes.end(); }
+
+  ilist<SDNode>::size_type allnodes_size() const {
+    return AllNodes.size();
+  }
+
+  iterator_range<allnodes_iterator> allnodes() {
+    return make_range(allnodes_begin(), allnodes_end());
+  }
+  iterator_range<allnodes_const_iterator> allnodes() const {
+    return make_range(allnodes_begin(), allnodes_end());
+  }
+
+
+  const SDValue &getRoot() const { return Root; }
+
+
+  SDValue getEntryNode() const {
+    return SDValue(const_cast<SDNode *>(&EntryNode), 0);
+  }
+
+
+
+  const SDValue &setRoot(SDValue N) {
+    
+   ((
+   (!N.getNode() || N.getValueType() == MVT::Other) && "DAG root value is not a chain!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "(!N.getNode() || N.getValueType() == MVT::Other) && \"DAG root value is not a chain!\""
+   ,
+                                           "/home/trippels/llvm/llvm/include/llvm/CodeGen/SelectionDAG.h"
+    ,
+                                           457
+    , __PRETTY_FUNCTION__))
+                                            
+                                           ;
+    if (N.getNode())
+      checkForCycles(N.getNode(), this);
+    Root = N;
+    if (N.getNode())
+      checkForCycles(this);
+    return Root;
+  }
+
+
+
+
+
+  void Combine(CombineLevel Level, AliasAnalysis *AA,
+               CodeGenOpt::Level OptLevel);
+
+
+
+
+
+
+
+  bool LegalizeTypes();
+
+
+
+
+
+
+
+  void Legalize();
+  bool LegalizeOp(SDNode *N, SmallSetVector<SDNode *, 16> &UpdatedNodes);
+  bool LegalizeVectors();
+
+
+  void RemoveDeadNodes();
+
+
+
+  void DeleteNode(SDNode *N);
+
+
+  SDVTList getVTList(EVT VT);
+  SDVTList getVTList(EVT VT1, EVT VT2);
+  SDVTList getVTList(EVT VT1, EVT VT2, EVT VT3);
+  SDVTList getVTList(EVT VT1, EVT VT2, EVT VT3, EVT VT4);
+  SDVTList getVTList(ArrayRef<EVT> VTs);
+  SDValue getConstant(uint64_t Val, const SDLoc &DL, EVT VT,
+                      bool isTarget = false, bool isOpaque = false);
+  SDValue getConstant(const APInt &Val, const SDLoc &DL, EVT VT,
+                      bool isTarget = false, bool isOpaque = false);
+
+  SDValue getAllOnesConstant(const SDLoc &DL, EVT VT, bool IsTarget = false,
+                             bool IsOpaque = false) {
+    return getConstant(APInt::getAllOnesValue(VT.getScalarSizeInBits()), DL,
+                       VT, IsTarget, IsOpaque);
+  }
+
+  SDValue getConstant(const ConstantInt &Val, const SDLoc &DL, EVT VT,
+                      bool isTarget = false, bool isOpaque = false);
+  SDValue getIntPtrConstant(uint64_t Val, const SDLoc &DL,
+                            bool isTarget = false);
+  SDValue getTargetConstant(uint64_t Val, const SDLoc &DL, EVT VT,
+                            bool isOpaque = false) {
+    return getConstant(Val, DL, VT, true, isOpaque);
+  }
+  SDValue getTargetConstant(const APInt &Val, const SDLoc &DL, EVT VT,
+                            bool isOpaque = false) {
+    return getConstant(Val, DL, VT, true, isOpaque);
+  }
+  SDValue getTargetConstant(const ConstantInt &Val, const SDLoc &DL, EVT VT,
+                            bool isOpaque = false) {
+    return getConstant(Val, DL, VT, true, isOpaque);
+  }
+  SDValue getConstantFP(double Val, const SDLoc &DL, EVT VT,
+                        bool isTarget = false);
+  SDValue getConstantFP(const APFloat &Val, const SDLoc &DL, EVT VT,
+                        bool isTarget = false);
+  SDValue getConstantFP(const ConstantFP &CF, const SDLoc &DL, EVT VT,
+                        bool isTarget = false);
+  SDValue getTargetConstantFP(double Val, const SDLoc &DL, EVT VT) {
+    return getConstantFP(Val, DL, VT, true);
+  }
+  SDValue getTargetConstantFP(const APFloat &Val, const SDLoc &DL, EVT VT) {
+    return getConstantFP(Val, DL, VT, true);
+  }
+  SDValue getTargetConstantFP(const ConstantFP &Val, const SDLoc &DL, EVT VT) {
+    return getConstantFP(Val, DL, VT, true);
+  }
+
+
+  SDValue getGlobalAddress(const GlobalValue *GV, const SDLoc &DL, EVT VT,
+                           int64_t offset = 0, bool isTargetGA = false,
+                           unsigned char TargetFlags = 0);
+  SDValue getTargetGlobalAddress(const GlobalValue *GV, const SDLoc &DL, EVT VT,
+                                 int64_t offset = 0,
+                                 unsigned char TargetFlags = 0) {
+    return getGlobalAddress(GV, DL, VT, offset, true, TargetFlags);
+  }
+  SDValue getFrameIndex(int FI, EVT VT, bool isTarget = false);
+  SDValue getTargetFrameIndex(int FI, EVT VT) {
+    return getFrameIndex(FI, VT, true);
+  }
+  SDValue getJumpTable(int JTI, EVT VT, bool isTarget = false,
+                       unsigned char TargetFlags = 0);
+  SDValue getTargetJumpTable(int JTI, EVT VT, unsigned char TargetFlags = 0) {
+    return getJumpTable(JTI, VT, true, TargetFlags);
+  }
+  SDValue getConstantPool(const Constant *C, EVT VT,
+                          unsigned Align = 0, int Offs = 0, bool isT=false,
+                          unsigned char TargetFlags = 0);
+  SDValue getTargetConstantPool(const Constant *C, EVT VT,
+                                unsigned Align = 0, int Offset = 0,
+                                unsigned char TargetFlags = 0) {
+    return getConstantPool(C, VT, Align, Offset, true, TargetFlags);
+  }
+  SDValue getConstantPool(MachineConstantPoolValue *C, EVT VT,
+                          unsigned Align = 0, int Offs = 0, bool isT=false,
+                          unsigned char TargetFlags = 0);
+  SDValue getTargetConstantPool(MachineConstantPoolValue *C,
+                                  EVT VT, unsigned Align = 0,
+                                  int Offset = 0, unsigned char TargetFlags=0) {
+    return getConstantPool(C, VT, Align, Offset, true, TargetFlags);
+  }
+  SDValue getTargetIndex(int Index, EVT VT, int64_t Offset = 0,
+                         unsigned char TargetFlags = 0);
+
+
+  SDValue getBasicBlock(MachineBasicBlock *MBB);
+  SDValue getBasicBlock(MachineBasicBlock *MBB, SDLoc dl);
+  SDValue getExternalSymbol(const char *Sym, EVT VT);
+  SDValue getExternalSymbol(const char *Sym, const SDLoc &dl, EVT VT);
+  SDValue getTargetExternalSymbol(const char *Sym, EVT VT,
+                                  unsigned char TargetFlags = 0);
+  SDValue getMCSymbol(MCSymbol *Sym, EVT VT);
+
+  SDValue getValueType(EVT);
+  SDValue getRegister(unsigned Reg, EVT VT);
+  SDValue getRegisterMask(const uint32_t *RegMask);
+  SDValue getEHLabel(const SDLoc &dl, SDValue Root, MCSymbol *Label);
+  SDValue getLabelNode(unsigned Opcode, const SDLoc &dl, SDValue Root,
+                       MCSymbol *Label);
+  SDValue getBlockAddress(const BlockAddress *BA, EVT VT,
+                          int64_t Offset = 0, bool isTarget = false,
+                          unsigned char TargetFlags = 0);
+  SDValue getTargetBlockAddress(const BlockAddress *BA, EVT VT,
+                                int64_t Offset = 0,
+                                unsigned char TargetFlags = 0) {
+    return getBlockAddress(BA, VT, Offset, true, TargetFlags);
+  }
+
+  SDValue getCopyToReg(SDValue Chain, const SDLoc &dl, unsigned Reg,
+                       SDValue N) {
+    return getNode(ISD::CopyToReg, dl, MVT::Other, Chain,
+                   getRegister(Reg, N.getValueType()), N);
+  }
+
+
+
+
+  SDValue getCopyToReg(SDValue Chain, const SDLoc &dl, unsigned Reg, SDValue N,
+                       SDValue Glue) {
+    SDVTList VTs = getVTList(MVT::Other, MVT::Glue);
+    SDValue Ops[] = { Chain, getRegister(Reg, N.getValueType()), N, Glue };
+    return getNode(ISD::CopyToReg, dl, VTs,
+                   makeArrayRef(Ops, Glue.getNode() ? 4 : 3));
+  }
+
+
+  SDValue getCopyToReg(SDValue Chain, const SDLoc &dl, SDValue Reg, SDValue N,
+                       SDValue Glue) {
+    SDVTList VTs = getVTList(MVT::Other, MVT::Glue);
+    SDValue Ops[] = { Chain, Reg, N, Glue };
+    return getNode(ISD::CopyToReg, dl, VTs,
+                   makeArrayRef(Ops, Glue.getNode() ? 4 : 3));
+  }
+
+  SDValue getCopyFromReg(SDValue Chain, const SDLoc &dl, unsigned Reg, EVT VT) {
+    SDVTList VTs = getVTList(VT, MVT::Other);
+    SDValue Ops[] = { Chain, getRegister(Reg, VT) };
+    return getNode(ISD::CopyFromReg, dl, VTs, Ops);
+  }
+
+
+
+
+  SDValue getCopyFromReg(SDValue Chain, const SDLoc &dl, unsigned Reg, EVT VT,
+                         SDValue Glue) {
+    SDVTList VTs = getVTList(VT, MVT::Other, MVT::Glue);
+    SDValue Ops[] = { Chain, getRegister(Reg, VT), Glue };
+    return getNode(ISD::CopyFromReg, dl, VTs,
+                   makeArrayRef(Ops, Glue.getNode() ? 3 : 2));
+  }
+
+  SDValue getCondCode(ISD::CondCode Cond);
+
+
+
+
+  SDValue getVectorShuffle(EVT VT, const SDLoc &dl, SDValue N1, SDValue N2,
+                           ArrayRef<int> Mask);
+
+
+
+
+
+  SDValue getBuildVector(EVT VT, const SDLoc &DL, ArrayRef<SDValue> Ops) {
+
+    return getNode(ISD::BUILD_VECTOR, DL, VT, Ops);
+  }
+
+
+
+
+
+  SDValue getBuildVector(EVT VT, const SDLoc &DL, ArrayRef<SDUse> Ops) {
+
+    return getNode(ISD::BUILD_VECTOR, DL, VT, Ops);
+  }
+
+
+
+
+  SDValue getSplatBuildVector(EVT VT, const SDLoc &DL, SDValue Op) {
+
+    if (Op.getOpcode() == ISD::UNDEF) {
+      
+     ((
+     (VT.getVectorElementType() == Op.getValueType() || (VT.isInteger() && VT.getVectorElementType().bitsLE(Op.getValueType()))) && "A splatted value must have a width equal or (for integers) " "greater than the vector element type!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "(VT.getVectorElementType() == Op.getValueType() || (VT.isInteger() && VT.getVectorElementType().bitsLE(Op.getValueType()))) && \"A splatted value must have a width equal or (for integers) \" \"greater than the vector element type!\""
+     ,
+
+
+
+                                                    "/home/trippels/llvm/llvm/include/llvm/CodeGen/SelectionDAG.h"
+      ,
+
+
+
+                                                    739
+      , __PRETTY_FUNCTION__))
+
+
+
+                                                     
+                                                    ;
+      return getNode(ISD::UNDEF, SDLoc(), VT);
+    }
+
+    SmallVector<SDValue, 16> Ops(VT.getVectorNumElements(), Op);
+    return getNode(ISD::BUILD_VECTOR, DL, VT, Ops);
+  }
+
+
+
+
+
+  SDValue getCommutedVectorShuffle(const ShuffleVectorSDNode &SV);
+
+
+
+  SDValue getFPExtendOrRound(SDValue Op, const SDLoc &DL, EVT VT);
+
+
+
+  SDValue getAnyExtOrTrunc(SDValue Op, const SDLoc &DL, EVT VT);
+
+
+
+  SDValue getSExtOrTrunc(SDValue Op, const SDLoc &DL, EVT VT);
+
+
+
+  SDValue getZExtOrTrunc(SDValue Op, const SDLoc &DL, EVT VT);
+
+
+
+  SDValue getZeroExtendInReg(SDValue Op, const SDLoc &DL, EVT SrcTy);
+
+
+
+
+
+  SDValue getAnyExtendVectorInReg(SDValue Op, const SDLoc &DL, EVT VT);
+
+
+
+
+
+  SDValue getSignExtendVectorInReg(SDValue Op, const SDLoc &DL, EVT VT);
+
+
+
+
+
+  SDValue getZeroExtendVectorInReg(SDValue Op, const SDLoc &DL, EVT VT);
+
+
+
+
+  SDValue getBoolExtOrTrunc(SDValue Op, const SDLoc &SL, EVT VT, EVT OpVT);
+
+
+  SDValue getNOT(const SDLoc &DL, SDValue Val, EVT VT);
+
+
+  SDValue getLogicalNOT(const SDLoc &DL, SDValue Val, EVT VT);
+
+
+
+
+  SDValue getObjectPtrOffset(const SDLoc &SL, SDValue Op, int64_t Offset) {
+    EVT VT = Op.getValueType();
+    return getObjectPtrOffset(SL, Op, getConstant(Offset, SL, VT));
+  }
+
+  SDValue getObjectPtrOffset(const SDLoc &SL, SDValue Op, SDValue Offset) {
+    EVT VT = Op.getValueType();
+
+
+
+    SDNodeFlags Flags;
+    Flags.setNoUnsignedWrap(true);
+    return getNode(ISD::ADD, SL, VT, Op, Offset, Flags);
+  }
+
+
+
+
+  SDValue getCALLSEQ_START(SDValue Chain, uint64_t InSize, uint64_t OutSize,
+                           const SDLoc &DL) {
+    SDVTList VTs = getVTList(MVT::Other, MVT::Glue);
+    SDValue Ops[] = { Chain,
+                      getIntPtrConstant(InSize, DL, true),
+                      getIntPtrConstant(OutSize, DL, true) };
+    return getNode(ISD::CALLSEQ_START, DL, VTs, Ops);
+  }
+
+
+
+
+  SDValue getCALLSEQ_END(SDValue Chain, SDValue Op1, SDValue Op2,
+                         SDValue InGlue, const SDLoc &DL) {
+    SDVTList NodeTys = getVTList(MVT::Other, MVT::Glue);
+    SmallVector<SDValue, 4> Ops;
+    Ops.push_back(Chain);
+    Ops.push_back(Op1);
+    Ops.push_back(Op2);
+    if (InGlue.getNode())
+      Ops.push_back(InGlue);
+    return getNode(ISD::CALLSEQ_END, DL, NodeTys, Ops);
+  }
+
+
+  bool isUndef(unsigned Opcode, ArrayRef<SDValue> Ops);
+
+
+  SDValue getUNDEF(EVT VT) {
+    return getNode(ISD::UNDEF, SDLoc(), VT);
+  }
+
+
+  SDValue getGLOBAL_OFFSET_TABLE(EVT VT) {
+    return getNode(ISD::GLOBAL_OFFSET_TABLE, SDLoc(), VT);
+  }
+
+
+
+  SDValue getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
+                  ArrayRef<SDUse> Ops);
+  SDValue getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
+                  ArrayRef<SDValue> Ops, const SDNodeFlags Flags = SDNodeFlags());
+  SDValue getNode(unsigned Opcode, const SDLoc &DL, ArrayRef<EVT> ResultTys,
+                  ArrayRef<SDValue> Ops);
+  SDValue getNode(unsigned Opcode, const SDLoc &DL, SDVTList VTs,
+                  ArrayRef<SDValue> Ops);
+
+
+  SDValue getNode(unsigned Opcode, const SDLoc &DL, EVT VT);
+  SDValue getNode(unsigned Opcode, const SDLoc &DL, EVT VT, SDValue N,
+                  const SDNodeFlags Flags = SDNodeFlags());
+  SDValue getNode(unsigned Opcode, const SDLoc &DL, EVT VT, SDValue N1,
+                  SDValue N2, const SDNodeFlags Flags = SDNodeFlags());
+  SDValue getNode(unsigned Opcode, const SDLoc &DL, EVT VT, SDValue N1,
+                  SDValue N2, SDValue N3);
+  SDValue getNode(unsigned Opcode, const SDLoc &DL, EVT VT, SDValue N1,
+                  SDValue N2, SDValue N3, SDValue N4);
+  SDValue getNode(unsigned Opcode, const SDLoc &DL, EVT VT, SDValue N1,
+                  SDValue N2, SDValue N3, SDValue N4, SDValue N5);
+
+
+
+  SDValue getNode(unsigned Opcode, const SDLoc &DL, SDVTList VTs);
+  SDValue getNode(unsigned Opcode, const SDLoc &DL, SDVTList VTs, SDValue N);
+  SDValue getNode(unsigned Opcode, const SDLoc &DL, SDVTList VTs, SDValue N1,
+                  SDValue N2);
+  SDValue getNode(unsigned Opcode, const SDLoc &DL, SDVTList VTs, SDValue N1,
+                  SDValue N2, SDValue N3);
+  SDValue getNode(unsigned Opcode, const SDLoc &DL, SDVTList VTs, SDValue N1,
+                  SDValue N2, SDValue N3, SDValue N4);
+  SDValue getNode(unsigned Opcode, const SDLoc &DL, SDVTList VTs, SDValue N1,
+                  SDValue N2, SDValue N3, SDValue N4, SDValue N5);
+
+
+
+
+  SDValue getStackArgumentTokenFactor(SDValue Chain);
+
+  SDValue getMemcpy(SDValue Chain, const SDLoc &dl, SDValue Dst, SDValue Src,
+                    SDValue Size, unsigned Align, bool isVol, bool AlwaysInline,
+                    bool isTailCall, MachinePointerInfo DstPtrInfo,
+                    MachinePointerInfo SrcPtrInfo);
+
+  SDValue getMemmove(SDValue Chain, const SDLoc &dl, SDValue Dst, SDValue Src,
+                     SDValue Size, unsigned Align, bool isVol, bool isTailCall,
+                     MachinePointerInfo DstPtrInfo,
+                     MachinePointerInfo SrcPtrInfo);
+
+  SDValue getMemset(SDValue Chain, const SDLoc &dl, SDValue Dst, SDValue Src,
+                    SDValue Size, unsigned Align, bool isVol, bool isTailCall,
+                    MachinePointerInfo DstPtrInfo);
+
+
+
+
+  SDValue getSetCC(const SDLoc &DL, EVT VT, SDValue LHS, SDValue RHS,
+                   ISD::CondCode Cond) {
+    
+   ((
+   LHS.getValueType().isVector() == RHS.getValueType().isVector() && "Cannot compare scalars to vectors"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "LHS.getValueType().isVector() == RHS.getValueType().isVector() && \"Cannot compare scalars to vectors\""
+   ,
+                                         "/home/trippels/llvm/llvm/include/llvm/CodeGen/SelectionDAG.h"
+    ,
+                                         922
+    , __PRETTY_FUNCTION__))
+                                          
+                                         ;
+    
+   ((
+   LHS.getValueType().isVector() == VT.isVector() && "Cannot compare scalars to vectors"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "LHS.getValueType().isVector() == VT.isVector() && \"Cannot compare scalars to vectors\""
+   ,
+                                         "/home/trippels/llvm/llvm/include/llvm/CodeGen/SelectionDAG.h"
+    ,
+                                         924
+    , __PRETTY_FUNCTION__))
+                                          
+                                         ;
+    
+   ((
+   Cond != ISD::SETCC_INVALID && "Cannot create a setCC of an invalid node."
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Cond != ISD::SETCC_INVALID && \"Cannot create a setCC of an invalid node.\""
+   ,
+                                                   "/home/trippels/llvm/llvm/include/llvm/CodeGen/SelectionDAG.h"
+    ,
+                                                   926
+    , __PRETTY_FUNCTION__))
+                                                    
+                                                   ;
+    return getNode(ISD::SETCC, DL, VT, LHS, RHS, getCondCode(Cond));
+  }
+
+
+
+  SDValue getSelect(const SDLoc &DL, EVT VT, SDValue Cond, SDValue LHS,
+                    SDValue RHS) {
+    
+   ((
+   LHS.getValueType() == RHS.getValueType() && "Cannot use select on differing types"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "LHS.getValueType() == RHS.getValueType() && \"Cannot use select on differing types\""
+   ,
+                                                 "/home/trippels/llvm/llvm/include/llvm/CodeGen/SelectionDAG.h"
+    ,
+                                                 935
+    , __PRETTY_FUNCTION__))
+                                                  
+                                                 ;
+    
+   ((
+   VT.isVector() == LHS.getValueType().isVector() && "Cannot mix vectors and scalars"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "VT.isVector() == LHS.getValueType().isVector() && \"Cannot mix vectors and scalars\""
+   ,
+                                           "/home/trippels/llvm/llvm/include/llvm/CodeGen/SelectionDAG.h"
+    ,
+                                           937
+    , __PRETTY_FUNCTION__))
+                                            
+                                           ;
+    return getNode(Cond.getValueType().isVector() ? ISD::VSELECT : ISD::SELECT, DL, VT,
+                   Cond, LHS, RHS);
+  }
+
+
+
+
+  SDValue getSelectCC(const SDLoc &DL, SDValue LHS, SDValue RHS, SDValue True,
+                      SDValue False, ISD::CondCode Cond) {
+    return getNode(ISD::SELECT_CC, DL, True.getValueType(),
+                   LHS, RHS, True, False, getCondCode(Cond));
+  }
+
+
+
+  SDValue getVAArg(EVT VT, const SDLoc &dl, SDValue Chain, SDValue Ptr,
+                   SDValue SV, unsigned Align);
+
+
+
+
+
+  SDValue getAtomicCmpSwap(unsigned Opcode, const SDLoc &dl, EVT MemVT,
+                           SDVTList VTs, SDValue Chain, SDValue Ptr,
+                           SDValue Cmp, SDValue Swp, MachinePointerInfo PtrInfo,
+                           unsigned Alignment, AtomicOrdering SuccessOrdering,
+                           AtomicOrdering FailureOrdering,
+                           SyncScope::ID SSID);
+  SDValue getAtomicCmpSwap(unsigned Opcode, const SDLoc &dl, EVT MemVT,
+                           SDVTList VTs, SDValue Chain, SDValue Ptr,
+                           SDValue Cmp, SDValue Swp, MachineMemOperand *MMO);
+
+
+
+  SDValue getAtomic(unsigned Opcode, const SDLoc &dl, EVT MemVT, SDValue Chain,
+                    SDValue Ptr, SDValue Val, const Value *PtrVal,
+                    unsigned Alignment, AtomicOrdering Ordering,
+                    SyncScope::ID SSID);
+  SDValue getAtomic(unsigned Opcode, const SDLoc &dl, EVT MemVT, SDValue Chain,
+                    SDValue Ptr, SDValue Val, MachineMemOperand *MMO);
+
+
+
+  SDValue getAtomic(unsigned Opcode, const SDLoc &dl, EVT MemVT, EVT VT,
+                    SDValue Chain, SDValue Ptr, MachineMemOperand *MMO);
+
+
+
+  SDValue getAtomic(unsigned Opcode, const SDLoc &dl, EVT MemVT,
+                    SDVTList VTList, ArrayRef<SDValue> Ops,
+                    MachineMemOperand *MMO);
+
+
+
+
+
+  SDValue getMemIntrinsicNode(
+    unsigned Opcode, const SDLoc &dl, SDVTList VTList,
+    ArrayRef<SDValue> Ops, EVT MemVT,
+    MachinePointerInfo PtrInfo,
+    unsigned Align = 0,
+    MachineMemOperand::Flags Flags
+    = MachineMemOperand::MOLoad | MachineMemOperand::MOStore,
+    unsigned Size = 0);
+
+  SDValue getMemIntrinsicNode(unsigned Opcode, const SDLoc &dl, SDVTList VTList,
+                              ArrayRef<SDValue> Ops, EVT MemVT,
+                              MachineMemOperand *MMO);
+
+
+  SDValue getMergeValues(ArrayRef<SDValue> Ops, const SDLoc &dl);
+
+
+
+
+
+
+  SDValue getLoad(EVT VT, const SDLoc &dl, SDValue Chain, SDValue Ptr,
+                  MachinePointerInfo PtrInfo, unsigned Alignment = 0,
+                  MachineMemOperand::Flags MMOFlags = MachineMemOperand::MONone,
+                  const AAMDNodes &AAInfo = AAMDNodes(),
+                  const MDNode *Ranges = nullptr);
+  SDValue getLoad(EVT VT, const SDLoc &dl, SDValue Chain, SDValue Ptr,
+                  MachineMemOperand *MMO);
+  SDValue
+  getExtLoad(ISD::LoadExtType ExtType, const SDLoc &dl, EVT VT, SDValue Chain,
+             SDValue Ptr, MachinePointerInfo PtrInfo, EVT MemVT,
+             unsigned Alignment = 0,
+             MachineMemOperand::Flags MMOFlags = MachineMemOperand::MONone,
+             const AAMDNodes &AAInfo = AAMDNodes());
+  SDValue getExtLoad(ISD::LoadExtType ExtType, const SDLoc &dl, EVT VT,
+                     SDValue Chain, SDValue Ptr, EVT MemVT,
+                     MachineMemOperand *MMO);
+  SDValue getIndexedLoad(SDValue OrigLoad, const SDLoc &dl, SDValue Base,
+                         SDValue Offset, ISD::MemIndexedMode AM);
+  SDValue getLoad(ISD::MemIndexedMode AM, ISD::LoadExtType ExtType, EVT VT,
+                  const SDLoc &dl, SDValue Chain, SDValue Ptr, SDValue Offset,
+                  MachinePointerInfo PtrInfo, EVT MemVT, unsigned Alignment = 0,
+                  MachineMemOperand::Flags MMOFlags = MachineMemOperand::MONone,
+                  const AAMDNodes &AAInfo = AAMDNodes(),
+                  const MDNode *Ranges = nullptr);
+  SDValue getLoad(ISD::MemIndexedMode AM, ISD::LoadExtType ExtType, EVT VT,
+                  const SDLoc &dl, SDValue Chain, SDValue Ptr, SDValue Offset,
+                  EVT MemVT, MachineMemOperand *MMO);
+
+
+
+
+
+  SDValue
+  getStore(SDValue Chain, const SDLoc &dl, SDValue Val, SDValue Ptr,
+           MachinePointerInfo PtrInfo, unsigned Alignment = 0,
+           MachineMemOperand::Flags MMOFlags = MachineMemOperand::MONone,
+           const AAMDNodes &AAInfo = AAMDNodes());
+  SDValue getStore(SDValue Chain, const SDLoc &dl, SDValue Val, SDValue Ptr,
+                   MachineMemOperand *MMO);
+  SDValue
+  getTruncStore(SDValue Chain, const SDLoc &dl, SDValue Val, SDValue Ptr,
+                MachinePointerInfo PtrInfo, EVT TVT, unsigned Alignment = 0,
+                MachineMemOperand::Flags MMOFlags = MachineMemOperand::MONone,
+                const AAMDNodes &AAInfo = AAMDNodes());
+  SDValue getTruncStore(SDValue Chain, const SDLoc &dl, SDValue Val,
+                        SDValue Ptr, EVT TVT, MachineMemOperand *MMO);
+  SDValue getIndexedStore(SDValue OrigStoe, const SDLoc &dl, SDValue Base,
+                          SDValue Offset, ISD::MemIndexedMode AM);
+
+
+  SDValue getMemBasePlusOffset(SDValue Base, unsigned Offset, const SDLoc &DL);
+
+  SDValue getMaskedLoad(EVT VT, const SDLoc &dl, SDValue Chain, SDValue Ptr,
+                        SDValue Mask, SDValue Src0, EVT MemVT,
+                        MachineMemOperand *MMO, ISD::LoadExtType,
+                        bool IsExpanding = false);
+  SDValue getMaskedStore(SDValue Chain, const SDLoc &dl, SDValue Val,
+                         SDValue Ptr, SDValue Mask, EVT MemVT,
+                         MachineMemOperand *MMO, bool IsTruncating = false,
+                         bool IsCompressing = false);
+  SDValue getMaskedGather(SDVTList VTs, EVT VT, const SDLoc &dl,
+                          ArrayRef<SDValue> Ops, MachineMemOperand *MMO);
+  SDValue getMaskedScatter(SDVTList VTs, EVT VT, const SDLoc &dl,
+                           ArrayRef<SDValue> Ops, MachineMemOperand *MMO);
+
+
+
+  template <class TargetMemSDNode>
+  SDValue getTargetMemSDNode(SDVTList VTs, ArrayRef<SDValue> Ops,
+                             const SDLoc &dl, EVT MemVT,
+                             MachineMemOperand *MMO);
+
+
+  SDValue getSrcValue(const Value *v);
+
+
+  SDValue getMDNode(const MDNode *MD);
+
+
+
+  SDValue getBitcast(EVT VT, SDValue V);
+
+
+  SDValue getAddrSpaceCast(const SDLoc &dl, EVT VT, SDValue Ptr, unsigned SrcAS,
+                           unsigned DestAS);
+
+
+
+  SDValue getShiftAmountOperand(EVT LHSTy, SDValue Op);
+
+
+  SDValue expandVAArg(SDNode *Node);
+
+
+  SDValue expandVACopy(SDNode *Node);
+
+
+
+
+
+
+
+  SDNode *UpdateNodeOperands(SDNode *N, SDValue Op);
+  SDNode *UpdateNodeOperands(SDNode *N, SDValue Op1, SDValue Op2);
+  SDNode *UpdateNodeOperands(SDNode *N, SDValue Op1, SDValue Op2,
+                               SDValue Op3);
+  SDNode *UpdateNodeOperands(SDNode *N, SDValue Op1, SDValue Op2,
+                               SDValue Op3, SDValue Op4);
+  SDNode *UpdateNodeOperands(SDNode *N, SDValue Op1, SDValue Op2,
+                               SDValue Op3, SDValue Op4, SDValue Op5);
+  SDNode *UpdateNodeOperands(SDNode *N, ArrayRef<SDValue> Ops);
+
+
+
+
+
+  SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, EVT VT);
+  SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, EVT VT, SDValue Op1);
+  SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, EVT VT,
+                       SDValue Op1, SDValue Op2);
+  SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, EVT VT,
+                       SDValue Op1, SDValue Op2, SDValue Op3);
+  SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, EVT VT,
+                       ArrayRef<SDValue> Ops);
+  SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, EVT VT1, EVT VT2);
+  SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, EVT VT1,
+                       EVT VT2, ArrayRef<SDValue> Ops);
+  SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, EVT VT1,
+                       EVT VT2, EVT VT3, ArrayRef<SDValue> Ops);
+  SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, EVT VT1,
+                       EVT VT2, SDValue Op1);
+  SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, EVT VT1,
+                       EVT VT2, SDValue Op1, SDValue Op2);
+  SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, SDVTList VTs,
+                       ArrayRef<SDValue> Ops);
+
+
+
+  SDNode *MorphNodeTo(SDNode *N, unsigned Opc, SDVTList VTs,
+                      ArrayRef<SDValue> Ops);
+
+
+
+
+  SDNode *mutateStrictFPToFP(SDNode *Node);
+
+
+
+
+
+
+
+  MachineSDNode *getMachineNode(unsigned Opcode, const SDLoc &dl, EVT VT);
+  MachineSDNode *getMachineNode(unsigned Opcode, const SDLoc &dl, EVT VT,
+                                SDValue Op1);
+  MachineSDNode *getMachineNode(unsigned Opcode, const SDLoc &dl, EVT VT,
+                                SDValue Op1, SDValue Op2);
+  MachineSDNode *getMachineNode(unsigned Opcode, const SDLoc &dl, EVT VT,
+                                SDValue Op1, SDValue Op2, SDValue Op3);
+  MachineSDNode *getMachineNode(unsigned Opcode, const SDLoc &dl, EVT VT,
+                                ArrayRef<SDValue> Ops);
+  MachineSDNode *getMachineNode(unsigned Opcode, const SDLoc &dl, EVT VT1,
+                                EVT VT2, SDValue Op1, SDValue Op2);
+  MachineSDNode *getMachineNode(unsigned Opcode, const SDLoc &dl, EVT VT1,
+                                EVT VT2, SDValue Op1, SDValue Op2, SDValue Op3);
+  MachineSDNode *getMachineNode(unsigned Opcode, const SDLoc &dl, EVT VT1,
+                                EVT VT2, ArrayRef<SDValue> Ops);
+  MachineSDNode *getMachineNode(unsigned Opcode, const SDLoc &dl, EVT VT1,
+                                EVT VT2, EVT VT3, SDValue Op1, SDValue Op2);
+  MachineSDNode *getMachineNode(unsigned Opcode, const SDLoc &dl, EVT VT1,
+                                EVT VT2, EVT VT3, SDValue Op1, SDValue Op2,
+                                SDValue Op3);
+  MachineSDNode *getMachineNode(unsigned Opcode, const SDLoc &dl, EVT VT1,
+                                EVT VT2, EVT VT3, ArrayRef<SDValue> Ops);
+  MachineSDNode *getMachineNode(unsigned Opcode, const SDLoc &dl,
+                                ArrayRef<EVT> ResultTys, ArrayRef<SDValue> Ops);
+  MachineSDNode *getMachineNode(unsigned Opcode, const SDLoc &dl, SDVTList VTs,
+                                ArrayRef<SDValue> Ops);
+
+
+  SDValue getTargetExtractSubreg(int SRIdx, const SDLoc &DL, EVT VT,
+                                 SDValue Operand);
+
+
+  SDValue getTargetInsertSubreg(int SRIdx, const SDLoc &DL, EVT VT,
+                                SDValue Operand, SDValue Subreg);
+
+
+  SDNode *getNodeIfExists(unsigned Opcode, SDVTList VTs, ArrayRef<SDValue> Ops,
+                          const SDNodeFlags Flags = SDNodeFlags());
+
+
+  SDDbgValue *getDbgValue(DIVariable *Var, DIExpression *Expr, SDNode *N,
+                          unsigned R, bool IsIndirect, const DebugLoc &DL,
+                          unsigned O);
+
+
+  SDDbgValue *getConstantDbgValue(DIVariable *Var, DIExpression *Expr,
+                                  const Value *C, const DebugLoc &DL,
+                                  unsigned O);
+
+
+  SDDbgValue *getFrameIndexDbgValue(DIVariable *Var, DIExpression *Expr,
+                                    unsigned FI, const DebugLoc &DL,
+                                    unsigned O);
+
+
+
+
+  void transferDbgValues(SDValue From, SDValue To, unsigned OffsetInBits = 0,
+                         unsigned SizeInBits = 0, bool InvalidateDbg = true);
+
+
+
+
+  void RemoveDeadNode(SDNode *N);
+
+
+
+  void RemoveDeadNodes(SmallVectorImpl<SDNode *> &DeadNodes);
+  void ReplaceAllUsesWith(SDValue From, SDValue Op);
+  void ReplaceAllUsesWith(SDNode *From, SDNode *To);
+  void ReplaceAllUsesWith(SDNode *From, const SDValue *To);
+
+
+
+  void ReplaceAllUsesOfValueWith(SDValue From, SDValue To);
+
+
+
+
+  void ReplaceAllUsesOfValuesWith(const SDValue *From, const SDValue *To,
+                                  unsigned Num);
+
+
+
+
+
+
+  SDValue makeEquivalentMemoryOrdering(LoadSDNode *Old, SDValue New);
+
+
+
+
+  unsigned AssignTopologicalOrder();
+
+
+
+
+  void RepositionNode(allnodes_iterator Position, SDNode *N) {
+    AllNodes.insert(Position, AllNodes.remove(N));
+  }
+
+
+
+  static const fltSemantics &EVTToAPFloatSemantics(EVT VT) {
+    switch (VT.getScalarType().getSimpleVT().SimpleTy) {
+    default: ::llvm::llvm_unreachable_internal("Unknown FP format", "/home/trippels/llvm/llvm/include/llvm/CodeGen/SelectionDAG.h", 1288);
+    case MVT::f16: return APFloat::IEEEhalf();
+    case MVT::f32: return APFloat::IEEEsingle();
+    case MVT::f64: return APFloat::IEEEdouble();
+    case MVT::f80: return APFloat::x87DoubleExtended();
+    case MVT::f128: return APFloat::IEEEquad();
+    case MVT::ppcf128: return APFloat::PPCDoubleDouble();
+    }
+  }
+
+
+
+  void AddDbgValue(SDDbgValue *DB, SDNode *SD, bool isParameter);
+
+
+  ArrayRef<SDDbgValue*> GetDbgValues(const SDNode* SD) {
+    return DbgInfo->getSDDbgValues(SD);
+  }
+
+public:
+
+
+  bool hasDebugValues() const { return !DbgInfo->empty(); }
+
+  SDDbgInfo::DbgIterator DbgBegin() { return DbgInfo->DbgBegin(); }
+  SDDbgInfo::DbgIterator DbgEnd() { return DbgInfo->DbgEnd(); }
+
+  SDDbgInfo::DbgIterator ByvalParmDbgBegin() {
+    return DbgInfo->ByvalParmDbgBegin();
+  }
+
+  SDDbgInfo::DbgIterator ByvalParmDbgEnd() {
+    return DbgInfo->ByvalParmDbgEnd();
+  }
+
+
+
+  void salvageDebugInfo(SDNode &N);
+
+  void dump() const;
+
+
+
+  SDValue CreateStackTemporary(EVT VT, unsigned minAlign = 1);
+
+
+
+  SDValue CreateStackTemporary(EVT VT1, EVT VT2);
+
+  SDValue FoldSymbolOffset(unsigned Opcode, EVT VT,
+                           const GlobalAddressSDNode *GA,
+                           const SDNode *N2);
+
+  SDValue FoldConstantArithmetic(unsigned Opcode, const SDLoc &DL, EVT VT,
+                                 SDNode *Cst1, SDNode *Cst2);
+
+  SDValue FoldConstantArithmetic(unsigned Opcode, const SDLoc &DL, EVT VT,
+                                 const ConstantSDNode *Cst1,
+                                 const ConstantSDNode *Cst2);
+
+  SDValue FoldConstantVectorArithmetic(unsigned Opcode, const SDLoc &DL, EVT VT,
+                                       ArrayRef<SDValue> Ops,
+                                       const SDNodeFlags Flags = SDNodeFlags());
+
+
+  SDValue FoldSetCC(EVT VT, SDValue N1, SDValue N2, ISD::CondCode Cond,
+                    const SDLoc &dl);
+
+
+
+
+
+
+
+  SDValue GetDemandedBits(SDValue V, const APInt &Mask);
+
+
+
+  bool SignBitIsZero(SDValue Op, unsigned Depth = 0) const;
+
+
+
+
+  bool MaskedValueIsZero(SDValue Op, const APInt &Mask, unsigned Depth = 0)
+    const;
+
+
+
+
+
+
+  void computeKnownBits(SDValue Op, KnownBits &Known, unsigned Depth = 0) const;
+
+
+
+
+
+
+  void computeKnownBits(SDValue Op, KnownBits &Known, const APInt &DemandedElts,
+                        unsigned Depth = 0) const;
+
+
+
+
+
+  enum OverflowKind {
+    OFK_Never,
+    OFK_Sometime,
+    OFK_Always,
+  };
+
+
+  OverflowKind computeOverflowKind(SDValue N0, SDValue N1) const;
+
+
+
+
+  bool isKnownToBeAPowerOfTwo(SDValue Val) const;
+  unsigned ComputeNumSignBits(SDValue Op, unsigned Depth = 0) const;
+  unsigned ComputeNumSignBits(SDValue Op, const APInt &DemandedElts,
+                              unsigned Depth = 0) const;
+
+
+
+
+
+
+  bool isBaseWithConstantOffset(SDValue Op) const;
+
+
+  bool isKnownNeverNaN(SDValue Op) const;
+
+
+
+  bool isKnownNeverZero(SDValue Op) const;
+
+
+
+
+  bool isEqualTo(SDValue A, SDValue B) const;
+
+
+
+  bool haveNoCommonBitsSet(SDValue A, SDValue B) const;
+
+
+
+
+
+
+
+  SDValue UnrollVectorOp(SDNode *N, unsigned ResNE = 0);
+
+
+
+
+
+  bool areNonVolatileConsecutiveLoads(LoadSDNode *LD, LoadSDNode *Base,
+                                      unsigned Bytes, int Dist) const;
+
+
+
+  unsigned InferPtrAlignment(SDValue Ptr) const;
+
+
+
+  std::pair<EVT, EVT> GetSplitDestVTs(const EVT &VT) const;
+
+
+
+  std::pair<SDValue, SDValue> SplitVector(const SDValue &N, const SDLoc &DL,
+                                          const EVT &LoVT, const EVT &HiVT);
+
+
+  std::pair<SDValue, SDValue> SplitVector(const SDValue &N, const SDLoc &DL) {
+    EVT LoVT, HiVT;
+    std::tie(LoVT, HiVT) = GetSplitDestVTs(N.getValueType());
+    return SplitVector(N, DL, LoVT, HiVT);
+  }
+
+
+
+  std::pair<SDValue, SDValue> SplitVectorOperand(const SDNode *N, unsigned OpNo)
+  {
+    return SplitVector(N->getOperand(OpNo), SDLoc(N));
+  }
+
+
+
+  void ExtractVectorElements(SDValue Op, SmallVectorImpl<SDValue> &Args,
+                             unsigned Start = 0, unsigned Count = 0);
+
+
+  unsigned getEVTAlignment(EVT MemoryVT) const;
+
+
+  SDNode *isConstantIntBuildVectorOrConstantInt(SDValue N);
+
+
+  SDNode *isConstantFPBuildVectorOrConstantFP(SDValue N);
+
+
+
+  inline bool isConstantValueOfAnyType(SDValue N) {
+    return isConstantIntBuildVectorOrConstantInt(N) ||
+           isConstantFPBuildVectorOrConstantFP(N);
+  }
+
+private:
+  void InsertNode(SDNode *N);
+  bool RemoveNodeFromCSEMaps(SDNode *N);
+  void AddModifiedNodeToCSEMaps(SDNode *N);
+  SDNode *FindModifiedNodeSlot(SDNode *N, SDValue Op, void *&InsertPos);
+  SDNode *FindModifiedNodeSlot(SDNode *N, SDValue Op1, SDValue Op2,
+                               void *&InsertPos);
+  SDNode *FindModifiedNodeSlot(SDNode *N, ArrayRef<SDValue> Ops,
+                               void *&InsertPos);
+  SDNode *UpdateSDLocOnMergeSDNode(SDNode *N, const SDLoc &loc);
+
+  void DeleteNodeNotInCSEMaps(SDNode *N);
+  void DeallocateNode(SDNode *N);
+
+  void allnodes_clear();
+
+
+
+
+
+  SDNode *FindNodeOrInsertPos(const FoldingSetNodeID &ID, void *&InsertPos);
+
+
+
+
+  SDNode *FindNodeOrInsertPos(const FoldingSetNodeID &ID, const SDLoc &DL,
+                              void *&InsertPos);
+
+
+  FoldingSet<SDVTListNode> VTListMap;
+
+
+  std::vector<CondCodeSDNode*> CondCodeNodes;
+
+  std::vector<SDNode*> ValueTypeNodes;
+  std::map<EVT, SDNode*, EVT::compareRawBits> ExtendedValueTypeNodes;
+  StringMap<SDNode*> ExternalSymbols;
+
+  std::map<std::pair<std::string, unsigned char>,SDNode*> TargetExternalSymbols;
+  DenseMap<MCSymbol *, SDNode *> MCSymbols;
+};
+
+template <> struct GraphTraits<SelectionDAG*> : public GraphTraits<SDNode*> {
+  using nodes_iterator = pointer_iterator<SelectionDAG::allnodes_iterator>;
+
+  static nodes_iterator nodes_begin(SelectionDAG *G) {
+    return nodes_iterator(G->allnodes_begin());
+  }
+
+  static nodes_iterator nodes_end(SelectionDAG *G) {
+    return nodes_iterator(G->allnodes_end());
+  }
+};
+
+template <class TargetMemSDNode>
+SDValue SelectionDAG::getTargetMemSDNode(SDVTList VTs,
+                                         ArrayRef<SDValue> Ops,
+                                         const SDLoc &dl, EVT MemVT,
+                                         MachineMemOperand *MMO) {
+
+  FoldingSetNodeID ID;
+  unsigned Opcode =
+    TargetMemSDNode(dl.getIROrder(), DebugLoc(), VTs, MemVT, MMO).getOpcode();
+  ID.AddInteger(Opcode);
+  ID.AddPointer(VTs.VTs);
+  for (auto& Op : Ops) {
+    ID.AddPointer(Op.getNode());
+    ID.AddInteger(Op.getResNo());
+  }
+  ID.AddInteger(MemVT.getRawBits());
+  ID.AddInteger(MMO->getPointerInfo().getAddrSpace());
+  ID.AddInteger(getSyntheticNodeSubclassData<TargetMemSDNode>(
+    dl.getIROrder(), VTs, MemVT, MMO));
+
+  void *IP = nullptr;
+  if (SDNode *E = FindNodeOrInsertPos(ID, dl, IP)) {
+    cast<TargetMemSDNode>(E)->refineAlignment(MMO);
+    return SDValue(E, 0);
+  }
+
+
+  auto *N = newSDNode<TargetMemSDNode>(dl.getIROrder(), dl.getDebugLoc(), VTs,
+                                       MemVT, MMO);
+  createOperands(N, Ops);
+  CSEMap.InsertNode(N, IP);
+  InsertNode(N);
+  return SDValue(N, 0);
+}
+
+}
+
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+       
+
+
+
+
+
+namespace llvm {
+namespace ISD {
+
+  struct ArgFlagsTy {
+  private:
+    unsigned IsZExt : 1;
+    unsigned IsSExt : 1;
+    unsigned IsInReg : 1;
+    unsigned IsSRet : 1;
+    unsigned IsByVal : 1;
+    unsigned IsNest : 1;
+    unsigned IsReturned : 1;
+    unsigned IsSplit : 1;
+    unsigned IsInAlloca : 1;
+    unsigned IsSplitEnd : 1;
+    unsigned IsSwiftSelf : 1;
+    unsigned IsSwiftError : 1;
+    unsigned IsHva : 1;
+    unsigned IsHvaStart : 1;
+    unsigned IsSecArgPass : 1;
+    unsigned ByValAlign : 4;
+    unsigned OrigAlign : 5;
+    unsigned IsInConsecutiveRegsLast : 1;
+    unsigned IsInConsecutiveRegs : 1;
+    unsigned IsCopyElisionCandidate : 1;
+
+    unsigned ByValSize;
+
+  public:
+    ArgFlagsTy()
+        : IsZExt(0), IsSExt(0), IsInReg(0), IsSRet(0), IsByVal(0), IsNest(0),
+          IsReturned(0), IsSplit(0), IsInAlloca(0), IsSplitEnd(0),
+          IsSwiftSelf(0), IsSwiftError(0), IsHva(0), IsHvaStart(0),
+          IsSecArgPass(0), ByValAlign(0), OrigAlign(0),
+          IsInConsecutiveRegsLast(0), IsInConsecutiveRegs(0),
+          IsCopyElisionCandidate(0), ByValSize(0) {
+      static_assert(sizeof(*this) == 2 * sizeof(unsigned), "flags are too big");
+    }
+
+    bool isZExt() const { return IsZExt; }
+    void setZExt() { IsZExt = 1; }
+
+    bool isSExt() const { return IsSExt; }
+    void setSExt() { IsSExt = 1; }
+
+    bool isInReg() const { return IsInReg; }
+    void setInReg() { IsInReg = 1; }
+
+    bool isSRet() const { return IsSRet; }
+    void setSRet() { IsSRet = 1; }
+
+    bool isByVal() const { return IsByVal; }
+    void setByVal() { IsByVal = 1; }
+
+    bool isInAlloca() const { return IsInAlloca; }
+    void setInAlloca() { IsInAlloca = 1; }
+
+    bool isSwiftSelf() const { return IsSwiftSelf; }
+    void setSwiftSelf() { IsSwiftSelf = 1; }
+
+    bool isSwiftError() const { return IsSwiftError; }
+    void setSwiftError() { IsSwiftError = 1; }
+
+    bool isHva() const { return IsHva; }
+    void setHva() { IsHva = 1; }
+
+    bool isHvaStart() const { return IsHvaStart; }
+    void setHvaStart() { IsHvaStart = 1; }
+
+    bool isSecArgPass() const { return IsSecArgPass; }
+    void setSecArgPass() { IsSecArgPass = 1; }
+
+    bool isNest() const { return IsNest; }
+    void setNest() { IsNest = 1; }
+
+    bool isReturned() const { return IsReturned; }
+    void setReturned() { IsReturned = 1; }
+
+    bool isInConsecutiveRegs() const { return IsInConsecutiveRegs; }
+    void setInConsecutiveRegs() { IsInConsecutiveRegs = 1; }
+
+    bool isInConsecutiveRegsLast() const { return IsInConsecutiveRegsLast; }
+    void setInConsecutiveRegsLast() { IsInConsecutiveRegsLast = 1; }
+
+    bool isSplit() const { return IsSplit; }
+    void setSplit() { IsSplit = 1; }
+
+    bool isSplitEnd() const { return IsSplitEnd; }
+    void setSplitEnd() { IsSplitEnd = 1; }
+
+    bool isCopyElisionCandidate() const { return IsCopyElisionCandidate; }
+    void setCopyElisionCandidate() { IsCopyElisionCandidate = 1; }
+
+    unsigned getByValAlign() const { return (1U << ByValAlign) / 2; }
+    void setByValAlign(unsigned A) {
+      ByValAlign = Log2_32(A) + 1;
+      
+     ((
+     getByValAlign() == A && "bitfield overflow"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "getByValAlign() == A && \"bitfield overflow\""
+     , "/home/trippels/llvm/llvm/include/llvm/CodeGen/TargetCallingConv.h", 120, __PRETTY_FUNCTION__))
+                                                        ;
+    }
+
+    unsigned getOrigAlign() const { return (1U << OrigAlign) / 2; }
+    void setOrigAlign(unsigned A) {
+      OrigAlign = Log2_32(A) + 1;
+      
+     ((
+     getOrigAlign() == A && "bitfield overflow"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "getOrigAlign() == A && \"bitfield overflow\""
+     , "/home/trippels/llvm/llvm/include/llvm/CodeGen/TargetCallingConv.h", 126, __PRETTY_FUNCTION__))
+                                                       ;
+    }
+
+    unsigned getByValSize() const { return ByValSize; }
+    void setByValSize(unsigned S) { ByValSize = S; }
+  };
+
+
+
+
+
+  struct InputArg {
+    ArgFlagsTy Flags;
+    MVT VT = MVT::Other;
+    EVT ArgVT;
+    bool Used = false;
+
+
+    unsigned OrigArgIndex;
+
+    static const unsigned NoArgIndex = 
+                                      (0x7fffffff * 2U + 1U)
+                                              ;
+
+
+
+
+    unsigned PartOffset;
+
+    InputArg() = default;
+    InputArg(ArgFlagsTy flags, EVT vt, EVT argvt, bool used,
+             unsigned origIdx, unsigned partOffs)
+      : Flags(flags), Used(used), OrigArgIndex(origIdx), PartOffset(partOffs) {
+      VT = vt.getSimpleVT();
+      ArgVT = argvt;
+    }
+
+    bool isOrigArg() const {
+      return OrigArgIndex != NoArgIndex;
+    }
+
+    unsigned getOrigArgIndex() const {
+      
+     ((
+     OrigArgIndex != NoArgIndex && "Implicit machine-level argument"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "OrigArgIndex != NoArgIndex && \"Implicit machine-level argument\""
+     , "/home/trippels/llvm/llvm/include/llvm/CodeGen/TargetCallingConv.h", 166, __PRETTY_FUNCTION__))
+                                                                            ;
+      return OrigArgIndex;
+    }
+  };
+
+
+
+
+
+  struct OutputArg {
+    ArgFlagsTy Flags;
+    MVT VT;
+    EVT ArgVT;
+
+
+    bool IsFixed = false;
+
+
+    unsigned OrigArgIndex;
+
+
+
+
+    unsigned PartOffset;
+
+    OutputArg() = default;
+    OutputArg(ArgFlagsTy flags, EVT vt, EVT argvt, bool isfixed,
+              unsigned origIdx, unsigned partOffs)
+      : Flags(flags), IsFixed(isfixed), OrigArgIndex(origIdx),
+        PartOffset(partOffs) {
+      VT = vt.getSimpleVT();
+      ArgVT = argvt;
+    }
+  };
+
+}
+}
+namespace llvm {
+
+enum class ExceptionHandling {
+  None,
+  DwarfCFI,
+  SjLj,
+  ARM,
+  WinEH,
+};
+
+enum class DebugCompressionType {
+  None,
+  GNU,
+  Z,
+};
+
+class StringRef;
+
+class MCTargetOptions {
+public:
+  enum AsmInstrumentation {
+    AsmInstrumentationNone,
+    AsmInstrumentationAddress
+  };
+
+
+  bool SanitizeAddress : 1;
+
+  bool MCRelaxAll : 1;
+  bool MCNoExecStack : 1;
+  bool MCFatalWarnings : 1;
+  bool MCNoWarn : 1;
+  bool MCNoDeprecatedWarn : 1;
+  bool MCSaveTempLabels : 1;
+  bool MCUseDwarfDirectory : 1;
+  bool MCIncrementalLinkerCompatible : 1;
+  bool MCPIECopyRelocations : 1;
+  bool ShowMCEncoding : 1;
+  bool ShowMCInst : 1;
+  bool AsmVerbose : 1;
+
+
+  bool PreserveAsmComments : 1;
+
+  int DwarfVersion = 0;
+
+  std::string ABIName;
+  std::string SplitDwarfFile;
+
+
+
+  std::vector<std::string> IASSearchPaths;
+
+  MCTargetOptions();
+
+
+
+
+  StringRef getABIName() const;
+};
+
+}
+
+namespace llvm {
+  class MachineFunction;
+  class Module;
+
+  namespace FloatABI {
+    enum ABIType {
+      Default,
+      Soft,
+      Hard
+    };
+  }
+
+  namespace FPOpFusion {
+    enum FPOpFusionMode {
+      Fast,
+      Standard,
+      Strict
+    };
+  }
+
+  namespace JumpTable {
+    enum JumpTableType {
+      Single,
+      Arity,
+      Simplified,
+
+
+      Full
+    };
+  }
+
+  namespace ThreadModel {
+    enum Model {
+      POSIX,
+      Single
+    };
+  }
+
+  namespace FPDenormal {
+    enum DenormalMode {
+      IEEE,
+      PreserveSign,
+
+      PositiveZero
+    };
+  }
+
+  enum class EABI {
+    Unknown,
+    Default,
+    EABI4,
+    EABI5,
+    GNU
+  };
+  enum class DebuggerKind {
+    Default,
+    GDB,
+    LLDB,
+    SCE
+  };
+
+  class TargetOptions {
+  public:
+    TargetOptions()
+        : PrintMachineCode(false), UnsafeFPMath(false), NoInfsFPMath(false),
+          NoNaNsFPMath(false), NoTrappingFPMath(false),
+          NoSignedZerosFPMath(false),
+          HonorSignDependentRoundingFPMathOption(false), NoZerosInBSS(false),
+          GuaranteedTailCallOpt(false), StackSymbolOrdering(true),
+          EnableFastISel(false), UseInitArray(false),
+          DisableIntegratedAS(false), RelaxELFRelocations(false),
+          FunctionSections(false), DataSections(false),
+          UniqueSectionNames(true), TrapUnreachable(false), EmulatedTLS(false),
+          EnableIPRA(false), EmitStackSizeSection(false) {}
+
+
+
+
+    unsigned PrintMachineCode : 1;
+
+
+
+    bool DisableFramePointerElim(const MachineFunction &MF) const;
+
+
+
+
+
+
+    unsigned UnsafeFPMath : 1;
+
+
+
+
+
+    unsigned NoInfsFPMath : 1;
+
+
+
+
+
+    unsigned NoNaNsFPMath : 1;
+
+
+
+
+    unsigned NoTrappingFPMath : 1;
+
+
+
+
+
+    unsigned NoSignedZerosFPMath : 1;
+    unsigned HonorSignDependentRoundingFPMathOption : 1;
+    bool HonorSignDependentRoundingFPMath() const;
+
+
+
+
+    unsigned NoZerosInBSS : 1;
+
+
+
+
+
+
+
+    unsigned GuaranteedTailCallOpt : 1;
+
+
+    unsigned StackAlignmentOverride = 0;
+
+
+
+
+
+    unsigned StackSymbolOrdering : 1;
+
+
+
+
+    unsigned EnableFastISel : 1;
+
+
+
+    unsigned UseInitArray : 1;
+
+
+    unsigned DisableIntegratedAS : 1;
+
+
+    DebugCompressionType CompressDebugSections = DebugCompressionType::None;
+
+    unsigned RelaxELFRelocations : 1;
+
+
+    unsigned FunctionSections : 1;
+
+
+    unsigned DataSections : 1;
+
+    unsigned UniqueSectionNames : 1;
+
+
+    unsigned TrapUnreachable : 1;
+
+
+
+    unsigned EmulatedTLS : 1;
+
+
+    unsigned EnableIPRA : 1;
+
+
+    unsigned EmitStackSizeSection : 1;
+
+
+
+
+
+
+
+    FloatABI::ABIType FloatABIType = FloatABI::Default;
+    FPOpFusion::FPOpFusionMode AllowFPOpFusion = FPOpFusion::Standard;
+
+
+
+    ThreadModel::Model ThreadModel = ThreadModel::POSIX;
+
+
+    EABI EABIVersion = EABI::Default;
+
+
+    DebuggerKind DebuggerTuning = DebuggerKind::Default;
+
+
+
+    FPDenormal::DenormalMode FPDenormalMode = FPDenormal::IEEE;
+
+
+    ExceptionHandling ExceptionModel = ExceptionHandling::None;
+
+
+    MCTargetOptions MCOptions;
+  };
+
+}
+
+
+namespace llvm {
+
+class Function;
+class GlobalValue;
+class MachineModuleInfo;
+class Mangler;
+class MCAsmInfo;
+class MCContext;
+class MCInstrInfo;
+class MCRegisterInfo;
+class MCSubtargetInfo;
+class MCSymbol;
+class raw_pwrite_stream;
+class PassManagerBuilder;
+class Target;
+class TargetIntrinsicInfo;
+class TargetIRAnalysis;
+class TargetTransformInfo;
+class TargetLoweringObjectFile;
+class TargetPassConfig;
+class TargetSubtargetInfo;
+
+
+namespace legacy {
+class PassManagerBase;
+}
+using legacy::PassManagerBase;
+
+
+
+
+
+
+
+class TargetMachine {
+protected:
+  TargetMachine(const Target &T, StringRef DataLayoutString,
+                const Triple &TargetTriple, StringRef CPU, StringRef FS,
+                const TargetOptions &Options);
+
+
+  const Target &TheTarget;
+
+
+
+
+
+
+
+  const DataLayout DL;
+
+
+
+  Triple TargetTriple;
+  std::string TargetCPU;
+  std::string TargetFS;
+
+  Reloc::Model RM = Reloc::Static;
+  CodeModel::Model CMModel = CodeModel::Small;
+  CodeGenOpt::Level OptLevel = CodeGenOpt::Default;
+
+
+  const MCAsmInfo *AsmInfo;
+
+  const MCRegisterInfo *MRI;
+  const MCInstrInfo *MII;
+  const MCSubtargetInfo *STI;
+
+  unsigned RequireStructuredCFG : 1;
+  unsigned O0WantsFastISel : 1;
+
+public:
+  const TargetOptions DefaultOptions;
+  mutable TargetOptions Options;
+
+  TargetMachine(const TargetMachine &) = delete;
+  void operator=(const TargetMachine &) = delete;
+  virtual ~TargetMachine();
+
+  const Target &getTarget() const { return TheTarget; }
+
+  const Triple &getTargetTriple() const { return TargetTriple; }
+  StringRef getTargetCPU() const { return TargetCPU; }
+  StringRef getTargetFeatureString() const { return TargetFS; }
+
+
+
+  virtual const TargetSubtargetInfo *getSubtargetImpl(const Function &) const {
+    return nullptr;
+  }
+  virtual TargetLoweringObjectFile *getObjFileLowering() const {
+    return nullptr;
+  }
+
+
+
+
+  template <typename STC> const STC &getSubtarget(const Function &F) const {
+    return *static_cast<const STC*>(getSubtargetImpl(F));
+  }
+
+
+  const DataLayout createDataLayout() const { return DL; }
+
+
+
+
+
+
+  bool isCompatibleDataLayout(const DataLayout &Candidate) const {
+    return DL == Candidate;
+  }
+
+
+
+
+  unsigned getPointerSize() const { return DL.getPointerSize(); }
+
+
+
+
+  void resetTargetOptions(const Function &F) const;
+
+
+  const MCAsmInfo *getMCAsmInfo() const { return AsmInfo; }
+
+  const MCRegisterInfo *getMCRegisterInfo() const { return MRI; }
+  const MCInstrInfo *getMCInstrInfo() const { return MII; }
+  const MCSubtargetInfo *getMCSubtargetInfo() const { return STI; }
+
+
+  virtual const TargetIntrinsicInfo *getIntrinsicInfo() const {
+    return nullptr;
+  }
+
+  bool requiresStructuredCFG() const { return RequireStructuredCFG; }
+  void setRequiresStructuredCFG(bool Value) { RequireStructuredCFG = Value; }
+
+
+
+  Reloc::Model getRelocationModel() const;
+
+
+
+  CodeModel::Model getCodeModel() const;
+
+  bool isPositionIndependent() const;
+
+  bool shouldAssumeDSOLocal(const Module &M, const GlobalValue *GV) const;
+
+
+  TLSModel::Model getTLSModel(const GlobalValue *GV) const;
+
+
+  CodeGenOpt::Level getOptLevel() const;
+
+
+  void setOptLevel(CodeGenOpt::Level Level);
+
+  void setFastISel(bool Enable) { Options.EnableFastISel = Enable; }
+  bool getO0WantsFastISel() { return O0WantsFastISel; }
+  void setO0WantsFastISel(bool Enable) { O0WantsFastISel = Enable; }
+
+  bool shouldPrintMachineCode() const { return Options.PrintMachineCode; }
+
+  bool getUniqueSectionNames() const { return Options.UniqueSectionNames; }
+
+
+
+  bool getDataSections() const {
+    return Options.DataSections;
+  }
+
+
+
+  bool getFunctionSections() const {
+    return Options.FunctionSections;
+  }
+
+
+
+
+
+
+  TargetIRAnalysis getTargetIRAnalysis();
+
+
+
+
+
+  virtual TargetTransformInfo getTargetTransformInfo(const Function &F);
+
+
+
+  virtual void adjustPassManager(PassManagerBuilder &) {}
+
+
+
+
+  enum CodeGenFileType {
+    CGFT_AssemblyFile,
+    CGFT_ObjectFile,
+    CGFT_Null
+  };
+
+
+
+
+
+
+
+  virtual bool addPassesToEmitFile(PassManagerBase &, raw_pwrite_stream &,
+                                   CodeGenFileType,
+                                   bool = true,
+                                   MachineModuleInfo *MMI = nullptr) {
+    return true;
+  }
+
+
+
+
+
+
+  virtual bool addPassesToEmitMC(PassManagerBase &, MCContext *&,
+                                 raw_pwrite_stream &,
+                                 bool = true) {
+    return true;
+  }
+
+
+
+
+
+
+  virtual bool targetSchedulesPostRAScheduling() const { return false; };
+
+  void getNameWithPrefix(SmallVectorImpl<char> &Name, const GlobalValue *GV,
+                         Mangler &Mang, bool MayAlwaysUsePrivate = false) const;
+  MCSymbol *getSymbol(const GlobalValue *GV) const;
+
+
+
+
+
+  virtual bool usesPhysRegsForPEI() const { return true; }
+
+
+
+  virtual bool useIPRA() const {
+    return false;
+  }
+};
+
+
+
+
+class LLVMTargetMachine : public TargetMachine {
+protected:
+  LLVMTargetMachine(const Target &T, StringRef DataLayoutString,
+                    const Triple &TargetTriple, StringRef CPU, StringRef FS,
+                    const TargetOptions &Options, Reloc::Model RM,
+                    CodeModel::Model CM, CodeGenOpt::Level OL);
+
+  void initAsmInfo();
+
+public:
+
+
+
+
+  TargetTransformInfo getTargetTransformInfo(const Function &F) override;
+
+
+
+  virtual TargetPassConfig *createPassConfig(PassManagerBase &PM);
+
+
+
+
+
+  bool addPassesToEmitFile(PassManagerBase &PM, raw_pwrite_stream &Out,
+                           CodeGenFileType FileType, bool DisableVerify = true,
+                           MachineModuleInfo *MMI = nullptr) override;
+
+
+
+
+
+  bool addPassesToEmitMC(PassManagerBase &PM, MCContext *&Ctx,
+                         raw_pwrite_stream &OS,
+                         bool DisableVerify = true) override;
+
+
+
+
+
+  virtual bool isMachineVerifierClean() const { return true; }
+
+
+
+  bool addAsmPrinter(PassManagerBase &PM, raw_pwrite_stream &Out,
+                     CodeGenFileType FileTYpe, MCContext &Context);
+};
+
+}
+
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+       
+
+
+
+
+
+
+
+
+
+
+namespace llvm {
+
+class BranchProbability;
+class CCState;
+class CCValAssign;
+class Constant;
+class FastISel;
+class FunctionLoweringInfo;
+class GlobalValue;
+class IntrinsicInst;
+struct KnownBits;
+class LLVMContext;
+class MachineBasicBlock;
+class MachineFunction;
+class MachineInstr;
+class MachineJumpTableInfo;
+class MachineLoop;
+class MachineRegisterInfo;
+class MCContext;
+class MCExpr;
+class Module;
+class TargetRegisterClass;
+class TargetLibraryInfo;
+class TargetRegisterInfo;
+class Value;
+
+namespace Sched {
+
+  enum Preference {
+    None,
+    Source,
+    RegPressure,
+    Hybrid,
+    ILP,
+    VLIW
+  };
+
+}
+
+
+
+class TargetLoweringBase {
+public:
+
+
+  enum LegalizeAction : uint8_t {
+    Legal,
+    Promote,
+    Expand,
+    LibCall,
+    Custom
+  };
+
+
+
+  enum LegalizeTypeAction : uint8_t {
+    TypeLegal,
+    TypePromoteInteger,
+    TypeExpandInteger,
+    TypeSoftenFloat,
+
+    TypeExpandFloat,
+    TypeScalarizeVector,
+    TypeSplitVector,
+    TypeWidenVector,
+    TypePromoteFloat
+  };
+
+
+
+  using LegalizeKind = std::pair<LegalizeTypeAction, EVT>;
+
+
+  enum BooleanContent {
+    UndefinedBooleanContent,
+    ZeroOrOneBooleanContent,
+    ZeroOrNegativeOneBooleanContent
+  };
+
+
+  enum SelectSupportKind {
+    ScalarValSelect,
+    ScalarCondVectorVal,
+
+    VectorMaskSelect
+
+  };
+
+
+
+
+
+  enum class AtomicExpansionKind {
+    None,
+    LLSC,
+
+    LLOnly,
+
+    CmpXChg,
+  };
+
+
+  enum class MulExpansionKind {
+    Always,
+    OnlyLegalOrCustom,
+
+  };
+
+  class ArgListEntry {
+  public:
+    Value *Val = nullptr;
+    SDValue Node = SDValue();
+    Type *Ty = nullptr;
+    bool IsSExt : 1;
+    bool IsZExt : 1;
+    bool IsInReg : 1;
+    bool IsSRet : 1;
+    bool IsNest : 1;
+    bool IsByVal : 1;
+    bool IsInAlloca : 1;
+    bool IsReturned : 1;
+    bool IsSwiftSelf : 1;
+    bool IsSwiftError : 1;
+    uint16_t Alignment = 0;
+
+    ArgListEntry()
+        : IsSExt(false), IsZExt(false), IsInReg(false), IsSRet(false),
+          IsNest(false), IsByVal(false), IsInAlloca(false), IsReturned(false),
+          IsSwiftSelf(false), IsSwiftError(false) {}
+
+    void setAttributes(ImmutableCallSite *CS, unsigned ArgIdx);
+  };
+  using ArgListTy = std::vector<ArgListEntry>;
+
+  virtual void markLibCallAttributes(MachineFunction *MF, unsigned CC,
+                                     ArgListTy &Args) const {};
+
+  static ISD::NodeType getExtendForContent(BooleanContent Content) {
+    switch (Content) {
+    case UndefinedBooleanContent:
+
+      return ISD::ANY_EXTEND;
+    case ZeroOrOneBooleanContent:
+
+      return ISD::ZERO_EXTEND;
+    case ZeroOrNegativeOneBooleanContent:
+
+      return ISD::SIGN_EXTEND;
+    }
+    ::llvm::llvm_unreachable_internal("Invalid content kind", "/home/trippels/llvm/llvm/include/llvm/CodeGen/TargetLowering.h", 215);
+  }
+
+
+  explicit TargetLoweringBase(const TargetMachine &TM);
+  TargetLoweringBase(const TargetLoweringBase &) = delete;
+  TargetLoweringBase &operator=(const TargetLoweringBase &) = delete;
+  virtual ~TargetLoweringBase() = default;
+
+protected:
+
+  void initActions();
+
+public:
+  const TargetMachine &getTargetMachine() const { return TM; }
+
+  virtual bool useSoftFloat() const { return false; }
+
+
+
+
+  MVT getPointerTy(const DataLayout &DL, uint32_t AS = 0) const {
+    return MVT::getIntegerVT(DL.getPointerSizeInBits(AS));
+  }
+
+
+
+  MVT getFrameIndexTy(const DataLayout &DL) const {
+    return getPointerTy(DL, DL.getAllocaAddrSpace());
+  }
+
+
+
+  virtual MVT getFenceOperandTy(const DataLayout &DL) const {
+    return getPointerTy(DL);
+  }
+
+
+
+  virtual MVT getScalarShiftAmountTy(const DataLayout &, EVT) const;
+
+  EVT getShiftAmountTy(EVT LHSTy, const DataLayout &DL) const;
+
+
+
+
+  virtual MVT getVectorIdxTy(const DataLayout &DL) const {
+    return getPointerTy(DL);
+  }
+
+  virtual bool isSelectSupported(SelectSupportKind ) const {
+    return true;
+  }
+
+
+  bool hasMultipleConditionRegisters() const {
+    return HasMultipleConditionRegisters;
+  }
+
+
+  bool hasExtractBitsInsn() const { return HasExtractBitsInsn; }
+
+
+  virtual TargetLoweringBase::LegalizeTypeAction
+  getPreferredVectorAction(EVT VT) const {
+
+    if (VT.getVectorNumElements() == 1)
+      return TypeScalarizeVector;
+
+    return TypePromoteInteger;
+  }
+  virtual bool
+  shouldExpandBuildVectorWithShuffles(EVT ,
+                                      unsigned DefinedValues) const {
+    return DefinedValues < 3;
+  }
+
+
+
+
+
+  virtual bool isIntDivCheap(EVT VT, AttributeList Attr) const { return false; }
+
+
+  virtual bool hasStandaloneRem(EVT VT) const {
+    return true;
+  }
+
+
+  virtual bool isFsqrtCheap(SDValue X, SelectionDAG &DAG) const {
+
+    return false;
+  }
+
+
+  enum ReciprocalEstimate : int {
+    Unspecified = -1,
+    Disabled = 0,
+    Enabled = 1
+  };
+
+
+
+
+
+  int getRecipEstimateSqrtEnabled(EVT VT, MachineFunction &MF) const;
+
+
+
+
+
+  int getRecipEstimateDivEnabled(EVT VT, MachineFunction &MF) const;
+
+
+
+
+
+  int getSqrtRefinementSteps(EVT VT, MachineFunction &MF) const;
+
+
+
+
+
+  int getDivRefinementSteps(EVT VT, MachineFunction &MF) const;
+
+
+  bool isSlowDivBypassed() const { return !BypassSlowDivWidths.empty(); }
+
+
+
+  const DenseMap<unsigned int, unsigned int> &getBypassSlowDivWidths() const {
+    return BypassSlowDivWidths;
+  }
+
+
+
+  bool isJumpExpensive() const { return JumpIsExpensive; }
+
+
+
+  bool isPredictableSelectExpensive() const {
+    return PredictableSelectIsExpensive;
+  }
+
+
+
+  virtual BranchProbability getPredictableBranchThreshold() const;
+
+
+
+
+
+
+
+  virtual bool isLoadBitCastBeneficial(EVT LoadVT,
+                                       EVT BitcastVT) const {
+
+
+    if (!LoadVT.isSimple() || !BitcastVT.isSimple())
+      return true;
+
+    MVT LoadMVT = LoadVT.getSimpleVT();
+
+
+
+    if (getOperationAction(ISD::LOAD, LoadMVT) == Promote &&
+        getTypeToPromoteTo(ISD::LOAD, LoadMVT) == BitcastVT.getSimpleVT())
+      return false;
+
+    return true;
+  }
+
+
+
+  virtual bool isStoreBitCastBeneficial(EVT StoreVT, EVT BitcastVT) const {
+
+    return isLoadBitCastBeneficial(StoreVT, BitcastVT);
+  }
+
+
+
+
+  virtual bool storeOfVectorConstantIsCheap(EVT MemVT,
+                                            unsigned NumElem,
+                                            unsigned AddrSpace) const {
+    return false;
+  }
+
+
+
+
+  virtual bool mergeStoresAfterLegalization() const { return true; }
+
+
+  virtual bool canMergeStoresTo(unsigned AS, EVT MemVT,
+                                const SelectionDAG &DAG) const {
+    return true;
+  }
+
+
+  virtual bool isCheapToSpeculateCttz() const {
+    return false;
+  }
+
+
+  virtual bool isCheapToSpeculateCtlz() const {
+    return false;
+  }
+
+
+  virtual bool isCtlzFast() const {
+    return false;
+  }
+
+
+
+
+
+  virtual bool hasBitPreservingFPLogic(EVT VT) const {
+    return false;
+  }
+
+
+
+  virtual bool isMultiStoresCheaperThanBitsMerge(EVT LTy, EVT HTy) const {
+    return false;
+  }
+  virtual bool isMaskAndCmp0FoldingBeneficial(const Instruction &AndI) const {
+    return false;
+  }
+
+
+
+
+
+
+  virtual bool convertSetCCLogicToBitwiseLogic(EVT VT) const {
+    return false;
+  }
+
+
+
+
+
+  virtual MVT hasFastEqualityCompare(unsigned NumBits) const {
+    MVT VT = MVT::getIntegerVT(NumBits);
+    return isTypeLegal(VT) ? VT : MVT::INVALID_SIMPLE_VALUE_TYPE;
+  }
+  virtual bool hasAndNotCompare(SDValue Y) const {
+    return false;
+  }
+
+
+
+
+  virtual bool hasAndNot(SDValue X) const {
+
+
+    return hasAndNotCompare(X);
+  }
+
+
+
+
+  bool enableExtLdPromotion() const { return EnableExtLdPromotion; }
+
+
+
+
+  virtual bool canCombineStoreAndExtract(Type *VectorTy, Value *Idx,
+                                         unsigned &Cost) const {
+    return false;
+  }
+
+
+  bool hasFloatingPointExceptions() const {
+    return HasFloatingPointExceptions;
+  }
+
+
+
+
+  virtual bool enableAggressiveFMAFusion(EVT VT) const {
+    return false;
+  }
+
+
+  virtual EVT getSetCCResultType(const DataLayout &DL, LLVMContext &Context,
+                                 EVT VT) const;
+
+
+
+
+  virtual
+  MVT::SimpleValueType getCmpLibcallReturnType() const;
+  BooleanContent getBooleanContents(bool isVec, bool isFloat) const {
+    if (isVec)
+      return BooleanVectorContents;
+    return isFloat ? BooleanFloatContents : BooleanContents;
+  }
+
+  BooleanContent getBooleanContents(EVT Type) const {
+    return getBooleanContents(Type.isVector(), Type.isFloatingPoint());
+  }
+
+
+  Sched::Preference getSchedulingPreference() const {
+    return SchedPreferenceInfo;
+  }
+
+
+
+
+  virtual Sched::Preference getSchedulingPreference(SDNode *) const {
+    return Sched::None;
+  }
+
+
+
+  virtual const TargetRegisterClass *getRegClassFor(MVT VT) const {
+    const TargetRegisterClass *RC = RegClassForVT[VT.SimpleTy];
+    
+   ((
+   RC && "This value type is not natively supported!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "RC && \"This value type is not natively supported!\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/TargetLowering.h", 584, __PRETTY_FUNCTION__))
+                                                             ;
+    return RC;
+  }
+  virtual const TargetRegisterClass *getRepRegClassFor(MVT VT) const {
+    const TargetRegisterClass *RC = RepRegClassForVT[VT.SimpleTy];
+    return RC;
+  }
+
+
+
+  virtual uint8_t getRepRegClassCostFor(MVT VT) const {
+    return RepRegClassCostForVT[VT.SimpleTy];
+  }
+
+
+
+
+  bool isTypeLegal(EVT VT) const {
+    
+   ((
+   !VT.isSimple() || (unsigned)VT.getSimpleVT().SimpleTy < array_lengthof(RegClassForVT)
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!VT.isSimple() || (unsigned)VT.getSimpleVT().SimpleTy < array_lengthof(RegClassForVT)"
+   ,
+                                                                              "/home/trippels/llvm/llvm/include/llvm/CodeGen/TargetLowering.h"
+    ,
+                                                                              611
+    , __PRETTY_FUNCTION__))
+                                                                               
+                                                                              ;
+    return VT.isSimple() && RegClassForVT[VT.getSimpleVT().SimpleTy] != nullptr;
+  }
+
+  class ValueTypeActionImpl {
+
+
+    LegalizeTypeAction ValueTypeActions[MVT::LAST_VALUETYPE];
+
+  public:
+    ValueTypeActionImpl() {
+      std::fill(std::begin(ValueTypeActions), std::end(ValueTypeActions),
+                TypeLegal);
+    }
+
+    LegalizeTypeAction getTypeAction(MVT VT) const {
+      return ValueTypeActions[VT.SimpleTy];
+    }
+
+    void setTypeAction(MVT VT, LegalizeTypeAction Action) {
+      ValueTypeActions[VT.SimpleTy] = Action;
+    }
+  };
+
+  const ValueTypeActionImpl &getValueTypeActions() const {
+    return ValueTypeActions;
+  }
+
+
+
+
+
+  LegalizeTypeAction getTypeAction(LLVMContext &Context, EVT VT) const {
+    return getTypeConversion(Context, VT).first;
+  }
+  LegalizeTypeAction getTypeAction(MVT VT) const {
+    return ValueTypeActions.getTypeAction(VT);
+  }
+
+
+
+
+
+
+
+  EVT getTypeToTransformTo(LLVMContext &Context, EVT VT) const {
+    return getTypeConversion(Context, VT).second;
+  }
+
+
+
+
+
+  EVT getTypeToExpandTo(LLVMContext &Context, EVT VT) const {
+    
+   ((
+   !VT.isVector()
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!VT.isVector()"
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/TargetLowering.h", 665, __PRETTY_FUNCTION__))
+                         ;
+    while (true) {
+      switch (getTypeAction(Context, VT)) {
+      case TypeLegal:
+        return VT;
+      case TypeExpandInteger:
+        VT = getTypeToTransformTo(Context, VT);
+        break;
+      default:
+        ::llvm::llvm_unreachable_internal("Type is not legal nor is it to be expanded!", "/home/trippels/llvm/llvm/include/llvm/CodeGen/TargetLowering.h", 674);
+      }
+    }
+  }
+  unsigned getVectorTypeBreakdown(LLVMContext &Context, EVT VT,
+                                  EVT &IntermediateVT,
+                                  unsigned &NumIntermediates,
+                                  MVT &RegisterVT) const;
+
+
+
+
+  virtual unsigned getVectorTypeBreakdownForCallingConv(
+      LLVMContext &Context, EVT VT, EVT &IntermediateVT,
+      unsigned &NumIntermediates, MVT &RegisterVT) const {
+    return getVectorTypeBreakdown(Context, VT, IntermediateVT, NumIntermediates,
+                                  RegisterVT);
+  }
+
+  struct IntrinsicInfo {
+    unsigned opc = 0;
+    EVT memVT;
+
+
+    PointerUnion<const Value *, const PseudoSourceValue *> ptrVal;
+
+    int offset = 0;
+    unsigned size = 0;
+
+    unsigned align = 1;
+
+    MachineMemOperand::Flags flags = MachineMemOperand::MONone;
+    IntrinsicInfo() = default;
+  };
+
+
+
+
+
+  virtual bool getTgtMemIntrinsic(IntrinsicInfo &, const CallInst &,
+                                  MachineFunction &,
+                                  unsigned ) const {
+    return false;
+  }
+
+
+
+
+  virtual bool isFPImmLegal(const APFloat & , EVT ) const {
+    return false;
+  }
+
+
+
+
+
+  virtual bool isShuffleMaskLegal(ArrayRef<int> , EVT ) const {
+    return true;
+  }
+
+
+
+
+
+  virtual bool canOpTrap(unsigned Op, EVT VT) const;
+
+
+
+
+  virtual bool isVectorClearMaskLegal(const SmallVectorImpl<int> & ,
+                                      EVT ) const {
+    return false;
+  }
+
+
+
+
+  LegalizeAction getOperationAction(unsigned Op, EVT VT) const {
+    if (VT.isExtended()) return Expand;
+
+
+    if (Op >= array_lengthof(OpActions[0])) return Custom;
+    return OpActions[(unsigned)VT.getSimpleVT().SimpleTy][Op];
+  }
+
+
+
+
+  bool isOperationLegalOrCustom(unsigned Op, EVT VT) const {
+    return (VT == MVT::Other || isTypeLegal(VT)) &&
+      (getOperationAction(Op, VT) == Legal ||
+       getOperationAction(Op, VT) == Custom);
+  }
+
+
+
+
+  bool isOperationLegalOrPromote(unsigned Op, EVT VT) const {
+    return (VT == MVT::Other || isTypeLegal(VT)) &&
+      (getOperationAction(Op, VT) == Legal ||
+       getOperationAction(Op, VT) == Promote);
+  }
+
+
+
+
+  bool isOperationLegalOrCustomOrPromote(unsigned Op, EVT VT) const {
+    return (VT == MVT::Other || isTypeLegal(VT)) &&
+      (getOperationAction(Op, VT) == Legal ||
+       getOperationAction(Op, VT) == Custom ||
+       getOperationAction(Op, VT) == Promote);
+  }
+
+
+
+  bool isOperationCustom(unsigned Op, EVT VT) const {
+    return getOperationAction(Op, VT) == Custom;
+  }
+
+
+  bool areJTsAllowed(const Function *Fn) const {
+    if (Fn->getFnAttribute("no-jump-tables").getValueAsString() == "true")
+      return false;
+
+    return isOperationLegalOrCustom(ISD::BR_JT, MVT::Other) ||
+           isOperationLegalOrCustom(ISD::BRIND, MVT::Other);
+  }
+
+
+  bool rangeFitsInWord(const APInt &Low, const APInt &High,
+                       const DataLayout &DL) const {
+
+    uint64_t BW = DL.getPointerSizeInBits();
+    uint64_t Range = (High - Low).getLimitedValue(
+                                                 (18446744073709551615UL) 
+                                                            - 1) + 1;
+    return Range <= BW;
+  }
+  virtual bool isSuitableForJumpTable(const SwitchInst *SI, uint64_t NumCases,
+                                      uint64_t Range) const {
+    const bool OptForSize = SI->getParent()->getParent()->optForSize();
+    const unsigned MinDensity = getMinimumJumpTableDensity(OptForSize);
+    const unsigned MaxJumpTableSize =
+        OptForSize || getMaximumJumpTableSize() == 0
+            ? 
+             (0x7fffffff * 2U + 1U)
+            
+           : getMaximumJumpTableSize();
+
+    if (Range <= MaxJumpTableSize &&
+        (NumCases * 100 >= Range * MinDensity)) {
+      return true;
+    }
+    return false;
+  }
+
+
+
+
+
+
+  bool isSuitableForBitTests(unsigned NumDests, unsigned NumCmps,
+                             const APInt &Low, const APInt &High,
+                             const DataLayout &DL) const {
+
+
+
+
+
+
+
+    if (!rangeFitsInWord(Low, High, DL))
+      return false;
+
+
+
+
+
+
+    return (NumDests == 1 && NumCmps >= 3) || (NumDests == 2 && NumCmps >= 5) ||
+           (NumDests == 3 && NumCmps >= 6);
+  }
+
+
+
+
+  bool isOperationExpand(unsigned Op, EVT VT) const {
+    return (!isTypeLegal(VT) || getOperationAction(Op, VT) == Expand);
+  }
+
+
+  bool isOperationLegal(unsigned Op, EVT VT) const {
+    return (VT == MVT::Other || isTypeLegal(VT)) &&
+           getOperationAction(Op, VT) == Legal;
+  }
+
+
+
+
+  LegalizeAction getLoadExtAction(unsigned ExtType, EVT ValVT,
+                                  EVT MemVT) const {
+    if (ValVT.isExtended() || MemVT.isExtended()) return Expand;
+    unsigned ValI = (unsigned) ValVT.getSimpleVT().SimpleTy;
+    unsigned MemI = (unsigned) MemVT.getSimpleVT().SimpleTy;
+    
+   ((
+   ExtType < ISD::LAST_LOADEXT_TYPE && ValI < MVT::LAST_VALUETYPE && MemI < MVT::LAST_VALUETYPE && "Table isn't big enough!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "ExtType < ISD::LAST_LOADEXT_TYPE && ValI < MVT::LAST_VALUETYPE && MemI < MVT::LAST_VALUETYPE && \"Table isn't big enough!\""
+   ,
+                                                                  "/home/trippels/llvm/llvm/include/llvm/CodeGen/TargetLowering.h"
+    ,
+                                                                  892
+    , __PRETTY_FUNCTION__))
+                                                                   
+                                                                  ;
+    unsigned Shift = 4 * ExtType;
+    return (LegalizeAction)((LoadExtActions[ValI][MemI] >> Shift) & 0xf);
+  }
+
+
+  bool isLoadExtLegal(unsigned ExtType, EVT ValVT, EVT MemVT) const {
+    return getLoadExtAction(ExtType, ValVT, MemVT) == Legal;
+  }
+
+
+
+  bool isLoadExtLegalOrCustom(unsigned ExtType, EVT ValVT, EVT MemVT) const {
+    return getLoadExtAction(ExtType, ValVT, MemVT) == Legal ||
+           getLoadExtAction(ExtType, ValVT, MemVT) == Custom;
+  }
+
+
+
+
+  LegalizeAction getTruncStoreAction(EVT ValVT, EVT MemVT) const {
+    if (ValVT.isExtended() || MemVT.isExtended()) return Expand;
+    unsigned ValI = (unsigned) ValVT.getSimpleVT().SimpleTy;
+    unsigned MemI = (unsigned) MemVT.getSimpleVT().SimpleTy;
+    
+   ((
+   ValI < MVT::LAST_VALUETYPE && MemI < MVT::LAST_VALUETYPE && "Table isn't big enough!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "ValI < MVT::LAST_VALUETYPE && MemI < MVT::LAST_VALUETYPE && \"Table isn't big enough!\""
+   ,
+                                    "/home/trippels/llvm/llvm/include/llvm/CodeGen/TargetLowering.h"
+    ,
+                                    917
+    , __PRETTY_FUNCTION__))
+                                     
+                                    ;
+    return TruncStoreActions[ValI][MemI];
+  }
+
+
+
+  bool isTruncStoreLegal(EVT ValVT, EVT MemVT) const {
+    return isTypeLegal(ValVT) && getTruncStoreAction(ValVT, MemVT) == Legal;
+  }
+
+
+
+  bool isTruncStoreLegalOrCustom(EVT ValVT, EVT MemVT) const {
+    return isTypeLegal(ValVT) &&
+      (getTruncStoreAction(ValVT, MemVT) == Legal ||
+       getTruncStoreAction(ValVT, MemVT) == Custom);
+  }
+
+
+
+
+  LegalizeAction
+  getIndexedLoadAction(unsigned IdxMode, MVT VT) const {
+    
+   ((
+   IdxMode < ISD::LAST_INDEXED_MODE && VT.isValid() && "Table isn't big enough!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "IdxMode < ISD::LAST_INDEXED_MODE && VT.isValid() && \"Table isn't big enough!\""
+   ,
+                                    "/home/trippels/llvm/llvm/include/llvm/CodeGen/TargetLowering.h"
+    ,
+                                    941
+    , __PRETTY_FUNCTION__))
+                                     
+                                    ;
+    unsigned Ty = (unsigned)VT.SimpleTy;
+    return (LegalizeAction)((IndexedModeActions[Ty][IdxMode] & 0xf0) >> 4);
+  }
+
+
+  bool isIndexedLoadLegal(unsigned IdxMode, EVT VT) const {
+    return VT.isSimple() &&
+      (getIndexedLoadAction(IdxMode, VT.getSimpleVT()) == Legal ||
+       getIndexedLoadAction(IdxMode, VT.getSimpleVT()) == Custom);
+  }
+
+
+
+
+  LegalizeAction
+  getIndexedStoreAction(unsigned IdxMode, MVT VT) const {
+    
+   ((
+   IdxMode < ISD::LAST_INDEXED_MODE && VT.isValid() && "Table isn't big enough!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "IdxMode < ISD::LAST_INDEXED_MODE && VT.isValid() && \"Table isn't big enough!\""
+   ,
+                                    "/home/trippels/llvm/llvm/include/llvm/CodeGen/TargetLowering.h"
+    ,
+                                    959
+    , __PRETTY_FUNCTION__))
+                                     
+                                    ;
+    unsigned Ty = (unsigned)VT.SimpleTy;
+    return (LegalizeAction)(IndexedModeActions[Ty][IdxMode] & 0x0f);
+  }
+
+
+  bool isIndexedStoreLegal(unsigned IdxMode, EVT VT) const {
+    return VT.isSimple() &&
+      (getIndexedStoreAction(IdxMode, VT.getSimpleVT()) == Legal ||
+       getIndexedStoreAction(IdxMode, VT.getSimpleVT()) == Custom);
+  }
+
+
+
+
+  LegalizeAction
+  getCondCodeAction(ISD::CondCode CC, MVT VT) const {
+    
+   ((
+   (unsigned)CC < array_lengthof(CondCodeActions) && ((unsigned)VT.SimpleTy >> 3) < array_lengthof(CondCodeActions[0]) && "Table isn't big enough!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "(unsigned)CC < array_lengthof(CondCodeActions) && ((unsigned)VT.SimpleTy >> 3) < array_lengthof(CondCodeActions[0]) && \"Table isn't big enough!\""
+   ,
+
+                                    "/home/trippels/llvm/llvm/include/llvm/CodeGen/TargetLowering.h"
+    ,
+
+                                    978
+    , __PRETTY_FUNCTION__))
+
+                                     
+                                    ;
+
+    uint32_t Shift = 4 * (VT.SimpleTy & 0x7);
+    uint32_t Value = CondCodeActions[CC][VT.SimpleTy >> 3];
+    LegalizeAction Action = (LegalizeAction) ((Value >> Shift) & 0xF);
+    
+   ((
+   Action != Promote && "Can't promote condition code!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Action != Promote && \"Can't promote condition code!\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/TargetLowering.h", 983, __PRETTY_FUNCTION__))
+                                                               ;
+    return Action;
+  }
+
+
+  bool isCondCodeLegal(ISD::CondCode CC, MVT VT) const {
+    return
+      getCondCodeAction(CC, VT) == Legal ||
+      getCondCodeAction(CC, VT) == Custom;
+  }
+
+
+
+  MVT getTypeToPromoteTo(unsigned Op, MVT VT) const {
+    
+   ((
+   getOperationAction(Op, VT) == Promote && "This operation isn't promoted!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "getOperationAction(Op, VT) == Promote && \"This operation isn't promoted!\""
+   ,
+                                           "/home/trippels/llvm/llvm/include/llvm/CodeGen/TargetLowering.h"
+    ,
+                                           998
+    , __PRETTY_FUNCTION__))
+                                            
+                                           ;
+
+
+    std::map<std::pair<unsigned, MVT::SimpleValueType>,
+             MVT::SimpleValueType>::const_iterator PTTI =
+      PromoteToType.find(std::make_pair(Op, VT.SimpleTy));
+    if (PTTI != PromoteToType.end()) return PTTI->second;
+
+    
+   ((
+   (VT.isInteger() || VT.isFloatingPoint()) && "Cannot autopromote this type, add it with AddPromotedToType."
+   ) ? static_cast<void> (0) : __assert_fail (
+   "(VT.isInteger() || VT.isFloatingPoint()) && \"Cannot autopromote this type, add it with AddPromotedToType.\""
+   ,
+                                                                         "/home/trippels/llvm/llvm/include/llvm/CodeGen/TargetLowering.h"
+    ,
+                                                                         1007
+    , __PRETTY_FUNCTION__))
+                                                                          
+                                                                         ;
+
+    MVT NVT = VT;
+    do {
+      NVT = (MVT::SimpleValueType)(NVT.SimpleTy+1);
+      
+     ((
+     NVT.isInteger() == VT.isInteger() && NVT != MVT::isVoid && "Didn't find type to promote to!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "NVT.isInteger() == VT.isInteger() && NVT != MVT::isVoid && \"Didn't find type to promote to!\""
+     ,
+                                              "/home/trippels/llvm/llvm/include/llvm/CodeGen/TargetLowering.h"
+      ,
+                                              1013
+      , __PRETTY_FUNCTION__))
+                                               
+                                              ;
+    } while (!isTypeLegal(NVT) ||
+              getOperationAction(Op, NVT) == Promote);
+    return NVT;
+  }
+
+
+
+
+
+  EVT getValueType(const DataLayout &DL, Type *Ty,
+                   bool AllowUnknown = false) const {
+
+    if (PointerType *PTy = dyn_cast<PointerType>(Ty))
+      return getPointerTy(DL, PTy->getAddressSpace());
+
+    if (Ty->isVectorTy()) {
+      VectorType *VTy = cast<VectorType>(Ty);
+      Type *Elm = VTy->getElementType();
+
+      if (PointerType *PT = dyn_cast<PointerType>(Elm)) {
+        EVT PointerTy(getPointerTy(DL, PT->getAddressSpace()));
+        Elm = PointerTy.getTypeForEVT(Ty->getContext());
+      }
+
+      return EVT::getVectorVT(Ty->getContext(), EVT::getEVT(Elm, false),
+                       VTy->getNumElements());
+    }
+    return EVT::getEVT(Ty, AllowUnknown);
+  }
+
+
+  MVT getSimpleValueType(const DataLayout &DL, Type *Ty,
+                         bool AllowUnknown = false) const {
+    return getValueType(DL, Ty, AllowUnknown).getSimpleVT();
+  }
+
+
+
+
+  virtual unsigned getByValTypeAlignment(Type *Ty, const DataLayout &DL) const;
+
+
+  MVT getRegisterType(MVT VT) const {
+    
+   ((
+   (unsigned)VT.SimpleTy < array_lengthof(RegisterTypeForVT)
+   ) ? static_cast<void> (0) : __assert_fail (
+   "(unsigned)VT.SimpleTy < array_lengthof(RegisterTypeForVT)"
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/TargetLowering.h", 1057, __PRETTY_FUNCTION__))
+                                                                    ;
+    return RegisterTypeForVT[VT.SimpleTy];
+  }
+
+
+  MVT getRegisterType(LLVMContext &Context, EVT VT) const {
+    if (VT.isSimple()) {
+      
+     ((
+     (unsigned)VT.getSimpleVT().SimpleTy < array_lengthof(RegisterTypeForVT)
+     ) ? static_cast<void> (0) : __assert_fail (
+     "(unsigned)VT.getSimpleVT().SimpleTy < array_lengthof(RegisterTypeForVT)"
+     ,
+                                                 "/home/trippels/llvm/llvm/include/llvm/CodeGen/TargetLowering.h"
+      ,
+                                                 1065
+      , __PRETTY_FUNCTION__))
+                                                  
+                                                 ;
+      return RegisterTypeForVT[VT.getSimpleVT().SimpleTy];
+    }
+    if (VT.isVector()) {
+      EVT VT1;
+      MVT RegisterVT;
+      unsigned NumIntermediates;
+      (void)getVectorTypeBreakdown(Context, VT, VT1,
+                                   NumIntermediates, RegisterVT);
+      return RegisterVT;
+    }
+    if (VT.isInteger()) {
+      return getRegisterType(Context, getTypeToTransformTo(Context, VT));
+    }
+    ::llvm::llvm_unreachable_internal("Unsupported extended type!", "/home/trippels/llvm/llvm/include/llvm/CodeGen/TargetLowering.h", 1079);
+  }
+  unsigned getNumRegisters(LLVMContext &Context, EVT VT) const {
+    if (VT.isSimple()) {
+      
+     ((
+     (unsigned)VT.getSimpleVT().SimpleTy < array_lengthof(NumRegistersForVT)
+     ) ? static_cast<void> (0) : __assert_fail (
+     "(unsigned)VT.getSimpleVT().SimpleTy < array_lengthof(NumRegistersForVT)"
+     ,
+                                                 "/home/trippels/llvm/llvm/include/llvm/CodeGen/TargetLowering.h"
+      ,
+                                                 1093
+      , __PRETTY_FUNCTION__))
+                                                  
+                                                 ;
+      return NumRegistersForVT[VT.getSimpleVT().SimpleTy];
+    }
+    if (VT.isVector()) {
+      EVT VT1;
+      MVT VT2;
+      unsigned NumIntermediates;
+      return getVectorTypeBreakdown(Context, VT, VT1, NumIntermediates, VT2);
+    }
+    if (VT.isInteger()) {
+      unsigned BitWidth = VT.getSizeInBits();
+      unsigned RegWidth = getRegisterType(Context, VT).getSizeInBits();
+      return (BitWidth + RegWidth - 1) / RegWidth;
+    }
+    ::llvm::llvm_unreachable_internal("Unsupported extended type!", "/home/trippels/llvm/llvm/include/llvm/CodeGen/TargetLowering.h", 1107);
+  }
+
+
+
+
+  virtual MVT getRegisterTypeForCallingConv(MVT VT) const {
+    return getRegisterType(VT);
+  }
+
+  virtual MVT getRegisterTypeForCallingConv(LLVMContext &Context,
+                                            EVT VT) const {
+    return getRegisterType(Context, VT);
+  }
+
+
+
+
+  virtual unsigned getNumRegistersForCallingConv(LLVMContext &Context,
+                                                 EVT VT) const {
+    return getNumRegisters(Context, VT);
+  }
+
+
+
+  virtual unsigned getABIAlignmentForCallingConv(Type *ArgTy,
+                                                 DataLayout DL) const {
+    return DL.getABITypeAlignment(ArgTy);
+  }
+
+
+
+
+  virtual bool ShouldShrinkFPConstant(EVT) const { return true; }
+
+
+
+
+
+  virtual bool shouldReduceLoadWidth(SDNode *Load,
+                                     ISD::LoadExtType ExtTy,
+                                     EVT NewVT) const {
+    return true;
+  }
+
+
+
+
+  bool hasBigEndianPartOrdering(EVT VT, const DataLayout &DL) const {
+    return DL.isBigEndian() || VT == MVT::ppcf128;
+  }
+
+
+
+  bool hasTargetDAGCombine(ISD::NodeType NT) const {
+    
+   ((
+   unsigned(NT >> 3) < array_lengthof(TargetDAGCombineArray)
+   ) ? static_cast<void> (0) : __assert_fail (
+   "unsigned(NT >> 3) < array_lengthof(TargetDAGCombineArray)"
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/TargetLowering.h", 1162, __PRETTY_FUNCTION__))
+                                                                    ;
+    return TargetDAGCombineArray[NT >> 3] & (1 << (NT&7));
+  }
+
+  unsigned getGatherAllAliasesMaxDepth() const {
+    return GatherAllAliasesMaxDepth;
+  }
+
+
+  virtual unsigned getVaListSizeInBits(const DataLayout &DL) const {
+    return getPointerTy(DL).getSizeInBits();
+  }
+
+
+
+
+
+
+
+  unsigned getMaxStoresPerMemset(bool OptSize) const {
+    return OptSize ? MaxStoresPerMemsetOptSize : MaxStoresPerMemset;
+  }
+
+
+
+
+
+
+
+  unsigned getMaxStoresPerMemcpy(bool OptSize) const {
+    return OptSize ? MaxStoresPerMemcpyOptSize : MaxStoresPerMemcpy;
+  }
+
+
+
+
+
+
+
+  unsigned getMaxExpandSizeMemcmp(bool OptSize) const {
+    return OptSize ? MaxLoadsPerMemcmpOptSize : MaxLoadsPerMemcmp;
+  }
+  virtual unsigned getMemcmpEqZeroLoadsPerBlock() const {
+    return 1;
+  }
+
+
+
+
+
+
+
+  unsigned getMaxStoresPerMemmove(bool OptSize) const {
+    return OptSize ? MaxStoresPerMemmoveOptSize : MaxStoresPerMemmove;
+  }
+  virtual bool allowsMisalignedMemoryAccesses(EVT,
+                                              unsigned AddrSpace = 0,
+                                              unsigned Align = 1,
+                                              bool * = nullptr) const {
+    return false;
+  }
+
+
+
+
+
+  bool allowsMemoryAccess(LLVMContext &Context, const DataLayout &DL, EVT VT,
+                          unsigned AddrSpace = 0, unsigned Alignment = 1,
+                          bool *Fast = nullptr) const;
+  virtual EVT getOptimalMemOpType(uint64_t ,
+                                  unsigned , unsigned ,
+                                  bool ,
+                                  bool ,
+                                  bool ,
+                                  MachineFunction & ) const {
+    return MVT::Other;
+  }
+  virtual bool isSafeMemOpType(MVT ) const { return true; }
+
+
+  bool usesUnderscoreSetJmp() const {
+    return UseUnderscoreSetJmp;
+  }
+
+
+  bool usesUnderscoreLongJmp() const {
+    return UseUnderscoreLongJmp;
+  }
+
+
+  virtual unsigned getMinimumJumpTableEntries() const;
+
+
+  unsigned getMinimumJumpTableDensity(bool OptForSize) const;
+
+
+
+  unsigned getMaximumJumpTableSize() const;
+
+  virtual bool isJumpTableRelative() const {
+    return TM.isPositionIndependent();
+  }
+
+
+
+  unsigned getStackPointerRegisterToSaveRestore() const {
+    return StackPointerRegisterToSaveRestore;
+  }
+
+
+
+  virtual unsigned
+  getExceptionPointerRegister(const Constant *PersonalityFn) const {
+
+    return 0;
+  }
+
+
+
+  virtual unsigned
+  getExceptionSelectorRegister(const Constant *PersonalityFn) const {
+
+    return 0;
+  }
+
+  virtual bool needsFixedCatchObjects() const {
+    report_fatal_error("Funclet EH is not implemented for this target");
+  }
+
+
+
+  unsigned getJumpBufSize() const {
+    return JumpBufSize;
+  }
+
+
+
+  unsigned getJumpBufAlignment() const {
+    return JumpBufAlignment;
+  }
+
+
+  unsigned getMinStackArgumentAlignment() const {
+    return MinStackArgumentAlignment;
+  }
+
+
+  unsigned getMinFunctionAlignment() const {
+    return MinFunctionAlignment;
+  }
+
+
+  unsigned getPrefFunctionAlignment() const {
+    return PrefFunctionAlignment;
+  }
+
+
+  virtual unsigned getPrefLoopAlignment(MachineLoop *ML = nullptr) const {
+    return PrefLoopAlignment;
+  }
+
+
+
+
+
+  virtual Value *getIRStackGuard(IRBuilder<> &IRB) const;
+
+
+
+  virtual void insertSSPDeclarations(Module &M) const;
+
+
+
+
+  virtual Value *getSDagStackGuard(const Module &M) const;
+
+
+
+
+
+  virtual bool useStackGuardXorFP() const { return false; }
+
+
+
+
+
+  virtual Value *getSSPStackGuardCheck(const Module &M) const;
+
+protected:
+  Value *getDefaultSafeStackPointerLocation(IRBuilder<> &IRB,
+                                            bool UseTLS) const;
+
+public:
+
+  virtual Value *getSafeStackPointerLocation(IRBuilder<> &IRB) const;
+
+
+
+  virtual StringRef getStackProbeSymbolName(MachineFunction &MF) const {
+    return "";
+  }
+
+
+  virtual bool isNoopAddrSpaceCast(unsigned SrcAS, unsigned DestAS) const {
+    return false;
+  }
+
+
+
+  virtual bool isCheapAddrSpaceCast(unsigned SrcAS, unsigned DestAS) const {
+    return isNoopAddrSpaceCast(SrcAS, DestAS);
+  }
+
+
+
+
+
+  virtual bool shouldAlignPointerArgs(CallInst * , unsigned & ,
+                                      unsigned & ) const {
+    return false;
+  }
+
+
+
+
+
+
+  int InstructionOpcodeToISD(unsigned Opcode) const;
+
+
+  std::pair<int, MVT> getTypeLegalizationCost(const DataLayout &DL,
+                                              Type *Ty) const;
+  unsigned getMaxAtomicSizeInBitsSupported() const {
+    return MaxAtomicSizeInBitsSupported;
+  }
+  unsigned getMinCmpXchgSizeInBits() const { return MinCmpXchgSizeInBits; }
+
+
+  bool supportsUnalignedAtomics() const { return SupportsUnalignedAtomics; }
+
+
+
+
+  virtual bool shouldInsertFencesForAtomic(const Instruction *I) const {
+    return false;
+  }
+
+
+
+
+
+  virtual Value *emitLoadLinked(IRBuilder<> &Builder, Value *Addr,
+                                AtomicOrdering Ord) const {
+    ::llvm::llvm_unreachable_internal("Load linked unimplemented on this target", "/home/trippels/llvm/llvm/include/llvm/CodeGen/TargetLowering.h", 1473);
+  }
+
+
+
+  virtual Value *emitStoreConditional(IRBuilder<> &Builder, Value *Val,
+                                      Value *Addr, AtomicOrdering Ord) const {
+    ::llvm::llvm_unreachable_internal("Store conditional unimplemented on this target", "/home/trippels/llvm/llvm/include/llvm/CodeGen/TargetLowering.h", 1480);
+  }
+  virtual Instruction *emitLeadingFence(IRBuilder<> &Builder, Instruction *Inst,
+                                        AtomicOrdering Ord) const {
+    if (isReleaseOrStronger(Ord) && Inst->hasAtomicStore())
+      return Builder.CreateFence(Ord);
+    else
+      return nullptr;
+  }
+
+  virtual Instruction *emitTrailingFence(IRBuilder<> &Builder,
+                                         Instruction *Inst,
+                                         AtomicOrdering Ord) const {
+    if (isAcquireOrStronger(Ord))
+      return Builder.CreateFence(Ord);
+    else
+      return nullptr;
+  }
+  virtual void emitAtomicCmpXchgNoStoreLLBalance(IRBuilder<> &Builder) const {}
+
+
+
+  virtual bool shouldExpandAtomicStoreInIR(StoreInst *SI) const {
+    return false;
+  }
+
+
+  virtual bool shouldSignExtendTypeInLibCall(EVT Type, bool IsSigned) const {
+    return IsSigned;
+  }
+
+
+
+  virtual AtomicExpansionKind shouldExpandAtomicLoadInIR(LoadInst *LI) const {
+    return AtomicExpansionKind::None;
+  }
+
+
+
+
+  virtual bool shouldExpandAtomicCmpXchgInIR(AtomicCmpXchgInst *AI) const {
+    return false;
+  }
+
+
+
+  virtual AtomicExpansionKind shouldExpandAtomicRMWInIR(AtomicRMWInst *) const {
+    return AtomicExpansionKind::None;
+  }
+  virtual LoadInst *
+  lowerIdempotentRMWIntoFencedLoad(AtomicRMWInst *RMWI) const {
+    return nullptr;
+  }
+
+
+
+  virtual ISD::NodeType getExtendForAtomicOps() const {
+    return ISD::ZERO_EXTEND;
+  }
+  virtual bool shouldNormalizeToSelectSequence(LLVMContext &Context,
+                                               EVT VT) const {
+
+
+    if (hasMultipleConditionRegisters())
+      return false;
+
+
+    LegalizeTypeAction Action = getTypeAction(Context, VT);
+    return Action != TypeExpandInteger && Action != TypeExpandFloat &&
+      Action != TypeSplitVector;
+  }
+
+
+
+
+  virtual bool convertSelectOfConstantsToMath(EVT VT) const {
+    return false;
+  }
+
+
+
+
+
+protected:
+
+
+  void setBooleanContents(BooleanContent Ty) {
+    BooleanContents = Ty;
+    BooleanFloatContents = Ty;
+  }
+
+
+
+  void setBooleanContents(BooleanContent IntTy, BooleanContent FloatTy) {
+    BooleanContents = IntTy;
+    BooleanFloatContents = FloatTy;
+  }
+
+
+
+  void setBooleanVectorContents(BooleanContent Ty) {
+    BooleanVectorContents = Ty;
+  }
+
+
+  void setSchedulingPreference(Sched::Preference Pref) {
+    SchedPreferenceInfo = Pref;
+  }
+
+
+
+  void setUseUnderscoreSetJmp(bool Val) {
+    UseUnderscoreSetJmp = Val;
+  }
+
+
+
+  void setUseUnderscoreLongJmp(bool Val) {
+    UseUnderscoreLongJmp = Val;
+  }
+
+
+  void setMinimumJumpTableEntries(unsigned Val);
+
+
+
+  void setMaximumJumpTableSize(unsigned);
+
+
+
+  void setStackPointerRegisterToSaveRestore(unsigned R) {
+    StackPointerRegisterToSaveRestore = R;
+  }
+
+
+
+
+
+
+  void setHasMultipleConditionRegisters(bool hasManyRegs = true) {
+    HasMultipleConditionRegisters = hasManyRegs;
+  }
+
+
+
+
+
+  void setHasExtractBitsInsn(bool hasExtractInsn = true) {
+    HasExtractBitsInsn = hasExtractInsn;
+  }
+
+
+
+
+  void setJumpIsExpensive(bool isExpensive = true);
+
+
+
+  void setHasFloatingPointExceptions(bool FPExceptions = true) {
+    HasFloatingPointExceptions = FPExceptions;
+  }
+
+
+  void addBypassSlowDiv(unsigned int SlowBitWidth, unsigned int FastBitWidth) {
+    BypassSlowDivWidths[SlowBitWidth] = FastBitWidth;
+  }
+
+
+
+
+  void addRegisterClass(MVT VT, const TargetRegisterClass *RC) {
+    
+   ((
+   (unsigned)VT.SimpleTy < array_lengthof(RegClassForVT)
+   ) ? static_cast<void> (0) : __assert_fail (
+   "(unsigned)VT.SimpleTy < array_lengthof(RegClassForVT)"
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/TargetLowering.h", 1713, __PRETTY_FUNCTION__))
+                                                                ;
+    RegClassForVT[VT.SimpleTy] = RC;
+  }
+
+
+
+  virtual std::pair<const TargetRegisterClass *, uint8_t>
+  findRepresentativeClass(const TargetRegisterInfo *TRI, MVT VT) const;
+
+
+
+  void computeRegisterProperties(const TargetRegisterInfo *TRI);
+
+
+
+
+  void setOperationAction(unsigned Op, MVT VT,
+                          LegalizeAction Action) {
+    
+   ((
+   Op < array_lengthof(OpActions[0]) && "Table isn't big enough!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Op < array_lengthof(OpActions[0]) && \"Table isn't big enough!\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/TargetLowering.h", 1731, __PRETTY_FUNCTION__))
+                                                                         ;
+    OpActions[(unsigned)VT.SimpleTy][Op] = Action;
+  }
+
+
+
+  void setLoadExtAction(unsigned ExtType, MVT ValVT, MVT MemVT,
+                        LegalizeAction Action) {
+    
+   ((
+   ExtType < ISD::LAST_LOADEXT_TYPE && ValVT.isValid() && MemVT.isValid() && "Table isn't big enough!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "ExtType < ISD::LAST_LOADEXT_TYPE && ValVT.isValid() && MemVT.isValid() && \"Table isn't big enough!\""
+   ,
+                                                       "/home/trippels/llvm/llvm/include/llvm/CodeGen/TargetLowering.h"
+    ,
+                                                       1740
+    , __PRETTY_FUNCTION__))
+                                                        
+                                                       ;
+    
+   ((
+   (unsigned)Action < 0x10 && "too many bits for bitfield array"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "(unsigned)Action < 0x10 && \"too many bits for bitfield array\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/TargetLowering.h", 1741, __PRETTY_FUNCTION__))
+                                                                        ;
+    unsigned Shift = 4 * ExtType;
+    LoadExtActions[ValVT.SimpleTy][MemVT.SimpleTy] &= ~((uint16_t)0xF << Shift);
+    LoadExtActions[ValVT.SimpleTy][MemVT.SimpleTy] |= (uint16_t)Action << Shift;
+  }
+
+
+
+  void setTruncStoreAction(MVT ValVT, MVT MemVT,
+                           LegalizeAction Action) {
+    
+   ((
+   ValVT.isValid() && MemVT.isValid() && "Table isn't big enough!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "ValVT.isValid() && MemVT.isValid() && \"Table isn't big enough!\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/TargetLowering.h", 1751, __PRETTY_FUNCTION__))
+                                                                          ;
+    TruncStoreActions[(unsigned)ValVT.SimpleTy][MemVT.SimpleTy] = Action;
+  }
+
+
+
+
+
+
+  void setIndexedLoadAction(unsigned IdxMode, MVT VT,
+                            LegalizeAction Action) {
+    
+   ((
+   VT.isValid() && IdxMode < ISD::LAST_INDEXED_MODE && (unsigned)Action < 0xf && "Table isn't big enough!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "VT.isValid() && IdxMode < ISD::LAST_INDEXED_MODE && (unsigned)Action < 0xf && \"Table isn't big enough!\""
+   ,
+                                                              "/home/trippels/llvm/llvm/include/llvm/CodeGen/TargetLowering.h"
+    ,
+                                                              1763
+    , __PRETTY_FUNCTION__))
+                                                               
+                                                              ;
+
+    IndexedModeActions[(unsigned)VT.SimpleTy][IdxMode] &= ~0xf0;
+    IndexedModeActions[(unsigned)VT.SimpleTy][IdxMode] |= ((uint8_t)Action) <<4;
+  }
+
+
+
+
+
+
+  void setIndexedStoreAction(unsigned IdxMode, MVT VT,
+                             LegalizeAction Action) {
+    
+   ((
+   VT.isValid() && IdxMode < ISD::LAST_INDEXED_MODE && (unsigned)Action < 0xf && "Table isn't big enough!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "VT.isValid() && IdxMode < ISD::LAST_INDEXED_MODE && (unsigned)Action < 0xf && \"Table isn't big enough!\""
+   ,
+                                                              "/home/trippels/llvm/llvm/include/llvm/CodeGen/TargetLowering.h"
+    ,
+                                                              1777
+    , __PRETTY_FUNCTION__))
+                                                               
+                                                              ;
+
+    IndexedModeActions[(unsigned)VT.SimpleTy][IdxMode] &= ~0x0f;
+    IndexedModeActions[(unsigned)VT.SimpleTy][IdxMode] |= ((uint8_t)Action);
+  }
+
+
+
+  void setCondCodeAction(ISD::CondCode CC, MVT VT,
+                         LegalizeAction Action) {
+    
+   ((
+   VT.isValid() && (unsigned)CC < array_lengthof(CondCodeActions) && "Table isn't big enough!"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "VT.isValid() && (unsigned)CC < array_lengthof(CondCodeActions) && \"Table isn't big enough!\""
+   ,
+                                    "/home/trippels/llvm/llvm/include/llvm/CodeGen/TargetLowering.h"
+    ,
+                                    1788
+    , __PRETTY_FUNCTION__))
+                                     
+                                    ;
+    
+   ((
+   (unsigned)Action < 0x10 && "too many bits for bitfield array"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "(unsigned)Action < 0x10 && \"too many bits for bitfield array\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/TargetLowering.h", 1789, __PRETTY_FUNCTION__))
+                                                                        ;
+
+
+
+    uint32_t Shift = 4 * (VT.SimpleTy & 0x7);
+    CondCodeActions[CC][VT.SimpleTy >> 3] &= ~((uint32_t)0xF << Shift);
+    CondCodeActions[CC][VT.SimpleTy >> 3] |= (uint32_t)Action << Shift;
+  }
+
+
+
+
+
+  void AddPromotedToType(unsigned Opc, MVT OrigVT, MVT DestVT) {
+    PromoteToType[std::make_pair(Opc, OrigVT.SimpleTy)] = DestVT.SimpleTy;
+  }
+
+
+
+  void setOperationPromotedToType(unsigned Opc, MVT OrigVT, MVT DestVT) {
+    setOperationAction(Opc, OrigVT, Promote);
+    AddPromotedToType(Opc, OrigVT, DestVT);
+  }
+
+
+
+
+  void setTargetDAGCombine(ISD::NodeType NT) {
+    
+   ((
+   unsigned(NT >> 3) < array_lengthof(TargetDAGCombineArray)
+   ) ? static_cast<void> (0) : __assert_fail (
+   "unsigned(NT >> 3) < array_lengthof(TargetDAGCombineArray)"
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/TargetLowering.h", 1817, __PRETTY_FUNCTION__))
+                                                                    ;
+    TargetDAGCombineArray[NT >> 3] |= 1 << (NT&7);
+  }
+
+
+  void setJumpBufSize(unsigned Size) {
+    JumpBufSize = Size;
+  }
+
+
+
+  void setJumpBufAlignment(unsigned Align) {
+    JumpBufAlignment = Align;
+  }
+
+
+  void setMinFunctionAlignment(unsigned Align) {
+    MinFunctionAlignment = Align;
+  }
+
+
+
+
+  void setPrefFunctionAlignment(unsigned Align) {
+    PrefFunctionAlignment = Align;
+  }
+
+
+
+
+
+  void setPrefLoopAlignment(unsigned Align) {
+    PrefLoopAlignment = Align;
+  }
+
+
+  void setMinStackArgumentAlignment(unsigned Align) {
+    MinStackArgumentAlignment = Align;
+  }
+
+
+
+
+
+  void setMaxAtomicSizeInBitsSupported(unsigned SizeInBits) {
+    MaxAtomicSizeInBitsSupported = SizeInBits;
+  }
+
+
+  void setMinCmpXchgSizeInBits(unsigned SizeInBits) {
+    MinCmpXchgSizeInBits = SizeInBits;
+  }
+
+
+  void setSupportsUnalignedAtomics(bool UnalignedSupported) {
+    SupportsUnalignedAtomics = UnalignedSupported;
+  }
+
+public:
+  virtual bool getAddrModeArguments(IntrinsicInst * ,
+                                    SmallVectorImpl<Value*> & ,
+                                    Type *& ) const {
+    return false;
+  }
+  struct AddrMode {
+    GlobalValue *BaseGV = nullptr;
+    int64_t BaseOffs = 0;
+    bool HasBaseReg = false;
+    int64_t Scale = 0;
+    AddrMode() = default;
+  };
+  virtual bool isLegalAddressingMode(const DataLayout &DL, const AddrMode &AM,
+                                     Type *Ty, unsigned AddrSpace,
+                                     Instruction *I = nullptr) const;
+  virtual int getScalingFactorCost(const DataLayout &DL, const AddrMode &AM,
+                                   Type *Ty, unsigned AS = 0) const {
+
+    if (isLegalAddressingMode(DL, AM, Ty, AS))
+      return 0;
+    return -1;
+  }
+
+
+
+
+  virtual bool isLegalICmpImmediate(int64_t) const {
+    return true;
+  }
+
+
+
+
+  virtual bool isLegalAddImmediate(int64_t) const {
+    return true;
+  }
+
+
+
+
+
+  virtual bool isVectorShiftByScalarCheap(Type *Ty) const {
+    return false;
+  }
+
+
+  virtual bool isCommutativeBinOp(unsigned Opcode) const {
+
+    switch (Opcode) {
+    case ISD::ADD:
+    case ISD::SMIN:
+    case ISD::SMAX:
+    case ISD::UMIN:
+    case ISD::UMAX:
+    case ISD::MUL:
+    case ISD::MULHU:
+    case ISD::MULHS:
+    case ISD::SMUL_LOHI:
+    case ISD::UMUL_LOHI:
+    case ISD::FADD:
+    case ISD::FMUL:
+    case ISD::AND:
+    case ISD::OR:
+    case ISD::XOR:
+    case ISD::SADDO:
+    case ISD::UADDO:
+    case ISD::ADDC:
+    case ISD::ADDE:
+    case ISD::FMINNUM:
+    case ISD::FMAXNUM:
+    case ISD::FMINNAN:
+    case ISD::FMAXNAN:
+      return true;
+    default: return false;
+    }
+  }
+
+
+
+
+
+  virtual bool isTruncateFree(Type *FromTy, Type *ToTy) const {
+    return false;
+  }
+
+
+
+
+
+
+  virtual bool allowTruncateForTailCall(Type *FromTy, Type *ToTy) const {
+    return false;
+  }
+
+  virtual bool isTruncateFree(EVT FromVT, EVT ToVT) const {
+    return false;
+  }
+
+  virtual bool isProfitableToHoist(Instruction *I) const { return true; }
+  bool isExtFree(const Instruction *I) const {
+    switch (I->getOpcode()) {
+    case Instruction::FPExt:
+      if (isFPExtFree(EVT::getEVT(I->getType()),
+                      EVT::getEVT(I->getOperand(0)->getType())))
+        return true;
+      break;
+    case Instruction::ZExt:
+      if (isZExtFree(I->getOperand(0)->getType(), I->getType()))
+        return true;
+      break;
+    case Instruction::SExt:
+      break;
+    default:
+      ::llvm::llvm_unreachable_internal("Instruction is not an extension", "/home/trippels/llvm/llvm/include/llvm/CodeGen/TargetLowering.h", 2035);
+    }
+    return isExtFreeImpl(I);
+  }
+
+
+
+
+
+
+
+  bool isExtLoad(const LoadInst *Load, const Instruction *Ext,
+                 const DataLayout &DL) const {
+    EVT VT = getValueType(DL, Ext->getType());
+    EVT LoadVT = getValueType(DL, Load->getType());
+
+
+
+    if (!Load->hasOneUse() && (isTypeLegal(LoadVT) || !isTypeLegal(VT)) &&
+        !isTruncateFree(Ext->getType(), Load->getType()))
+      return false;
+
+
+    unsigned LType;
+    if (isa<ZExtInst>(Ext))
+      LType = ISD::ZEXTLOAD;
+    else {
+      
+     ((
+     isa<SExtInst>(Ext) && "Unexpected ext type!"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "isa<SExtInst>(Ext) && \"Unexpected ext type!\""
+     , "/home/trippels/llvm/llvm/include/llvm/CodeGen/TargetLowering.h", 2062, __PRETTY_FUNCTION__))
+                                                         ;
+      LType = ISD::SEXTLOAD;
+    }
+
+    return isLoadExtLegal(LType, VT, LoadVT);
+  }
+  virtual bool isZExtFree(Type *FromTy, Type *ToTy) const {
+    return false;
+  }
+
+  virtual bool isZExtFree(EVT FromTy, EVT ToTy) const {
+    return false;
+  }
+  virtual bool hasPairedLoad(EVT ,
+                             unsigned & ) const {
+    return false;
+  }
+
+
+
+  virtual unsigned getMaxSupportedInterleaveFactor() const { return 2; }
+  virtual bool lowerInterleavedLoad(LoadInst *LI,
+                                    ArrayRef<ShuffleVectorInst *> Shuffles,
+                                    ArrayRef<unsigned> Indices,
+                                    unsigned Factor) const {
+    return false;
+  }
+
+
+
+
+
+
+
+  virtual bool lowerInterleavedStore(StoreInst *SI, ShuffleVectorInst *SVI,
+                                     unsigned Factor) const {
+    return false;
+  }
+
+
+
+
+  virtual bool isZExtFree(SDValue Val, EVT VT2) const {
+    return isZExtFree(Val.getValueType(), VT2);
+  }
+
+
+
+
+  virtual bool isFPExtFree(EVT DestVT, EVT SrcVT) const {
+    
+   ((
+   SrcVT.isFloatingPoint() && DestVT.isFloatingPoint() && "invalid fpext types"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "SrcVT.isFloatingPoint() && DestVT.isFloatingPoint() && \"invalid fpext types\""
+   ,
+                                "/home/trippels/llvm/llvm/include/llvm/CodeGen/TargetLowering.h"
+    ,
+                                2154
+    , __PRETTY_FUNCTION__))
+                                 
+                                ;
+    return false;
+  }
+
+
+
+
+  virtual bool isFPExtFoldable(unsigned Opcode, EVT DestVT, EVT SrcVT) const {
+    
+   ((
+   DestVT.isFloatingPoint() && SrcVT.isFloatingPoint() && "invalid fpext types"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "DestVT.isFloatingPoint() && SrcVT.isFloatingPoint() && \"invalid fpext types\""
+   ,
+                                "/home/trippels/llvm/llvm/include/llvm/CodeGen/TargetLowering.h"
+    ,
+                                2163
+    , __PRETTY_FUNCTION__))
+                                 
+                                ;
+    return isFPExtFree(DestVT, SrcVT);
+  }
+
+
+
+  virtual bool isVectorLoadExtDesirable(SDValue ExtVal) const { return false; }
+
+
+
+  virtual bool isFNegFree(EVT VT) const {
+    
+   ((
+   VT.isFloatingPoint()
+   ) ? static_cast<void> (0) : __assert_fail (
+   "VT.isFloatingPoint()"
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/TargetLowering.h", 2174, __PRETTY_FUNCTION__))
+                               ;
+    return false;
+  }
+
+
+
+  virtual bool isFAbsFree(EVT VT) const {
+    
+   ((
+   VT.isFloatingPoint()
+   ) ? static_cast<void> (0) : __assert_fail (
+   "VT.isFloatingPoint()"
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/TargetLowering.h", 2181, __PRETTY_FUNCTION__))
+                               ;
+    return false;
+  }
+  virtual bool isFMAFasterThanFMulAndFAdd(EVT) const {
+    return false;
+  }
+
+
+
+
+  virtual bool isNarrowingProfitable(EVT , EVT ) const {
+    return false;
+  }
+
+
+
+
+
+
+  virtual bool shouldConvertConstantLoadToIntImm(const APInt &Imm,
+                                                 Type *Ty) const {
+    return false;
+  }
+
+
+
+
+
+  virtual bool isExtractSubvectorCheap(EVT ResVT, EVT SrcVT,
+                                       unsigned Index) const {
+    return false;
+  }
+
+
+
+  virtual bool aggressivelyPreferBuildVectorSources(EVT VecVT) const {
+    return false;
+  }
+
+
+
+
+
+
+  void setLibcallName(RTLIB::Libcall Call, const char *Name) {
+    LibcallRoutineNames[Call] = Name;
+  }
+
+
+  const char *getLibcallName(RTLIB::Libcall Call) const {
+    return LibcallRoutineNames[Call];
+  }
+
+
+
+  void setCmpLibcallCC(RTLIB::Libcall Call, ISD::CondCode CC) {
+    CmpLibcallCCs[Call] = CC;
+  }
+
+
+
+  ISD::CondCode getCmpLibcallCC(RTLIB::Libcall Call) const {
+    return CmpLibcallCCs[Call];
+  }
+
+
+  void setLibcallCallingConv(RTLIB::Libcall Call, CallingConv::ID CC) {
+    LibcallCallingConvs[Call] = CC;
+  }
+
+
+  CallingConv::ID getLibcallCallingConv(RTLIB::Libcall Call) const {
+    return LibcallCallingConvs[Call];
+  }
+
+
+
+
+
+  virtual void finalizeLowering(MachineFunction &MF) const;
+
+private:
+  const TargetMachine &TM;
+
+
+
+
+
+
+  bool HasMultipleConditionRegisters;
+
+
+
+
+
+  bool HasExtractBitsInsn;
+
+
+
+
+
+  DenseMap <unsigned int, unsigned int> BypassSlowDivWidths;
+
+
+
+
+  bool JumpIsExpensive;
+
+
+
+  bool HasFloatingPointExceptions;
+
+
+
+
+  bool UseUnderscoreSetJmp;
+
+
+
+
+  bool UseUnderscoreLongJmp;
+
+
+
+  BooleanContent BooleanContents;
+
+
+
+  BooleanContent BooleanFloatContents;
+
+
+
+  BooleanContent BooleanVectorContents;
+
+
+
+  Sched::Preference SchedPreferenceInfo;
+
+
+  unsigned JumpBufSize;
+
+
+  unsigned JumpBufAlignment;
+
+
+  unsigned MinStackArgumentAlignment;
+
+
+
+  unsigned MinFunctionAlignment;
+
+
+
+  unsigned PrefFunctionAlignment;
+
+
+  unsigned PrefLoopAlignment;
+
+
+
+  unsigned MaxAtomicSizeInBitsSupported;
+
+
+
+  unsigned MinCmpXchgSizeInBits;
+
+
+  bool SupportsUnalignedAtomics;
+
+
+
+  unsigned StackPointerRegisterToSaveRestore;
+
+
+
+  const TargetRegisterClass *RegClassForVT[MVT::LAST_VALUETYPE];
+  unsigned char NumRegistersForVT[MVT::LAST_VALUETYPE];
+  MVT RegisterTypeForVT[MVT::LAST_VALUETYPE];
+
+
+
+
+
+
+
+  const TargetRegisterClass *RepRegClassForVT[MVT::LAST_VALUETYPE];
+
+
+
+
+  uint8_t RepRegClassCostForVT[MVT::LAST_VALUETYPE];
+
+
+
+
+
+
+  MVT TransformToType[MVT::LAST_VALUETYPE];
+
+
+
+
+
+
+  LegalizeAction OpActions[MVT::LAST_VALUETYPE][ISD::BUILTIN_OP_END];
+
+
+
+
+
+  uint16_t LoadExtActions[MVT::LAST_VALUETYPE][MVT::LAST_VALUETYPE];
+
+
+
+  LegalizeAction TruncStoreActions[MVT::LAST_VALUETYPE][MVT::LAST_VALUETYPE];
+
+
+
+
+
+
+
+  uint8_t IndexedModeActions[MVT::LAST_VALUETYPE][ISD::LAST_INDEXED_MODE];
+
+
+
+
+
+
+
+  uint32_t CondCodeActions[ISD::SETCC_INVALID][(MVT::LAST_VALUETYPE + 7) / 8];
+
+protected:
+  ValueTypeActionImpl ValueTypeActions;
+
+private:
+  LegalizeKind getTypeConversion(LLVMContext &Context, EVT VT) const;
+
+
+
+
+  unsigned char
+  TargetDAGCombineArray[(ISD::BUILTIN_OP_END+8 -1)/8];
+
+
+
+
+
+
+
+  std::map<std::pair<unsigned, MVT::SimpleValueType>, MVT::SimpleValueType>
+    PromoteToType;
+
+
+  const char *LibcallRoutineNames[RTLIB::UNKNOWN_LIBCALL + 1];
+
+
+
+  ISD::CondCode CmpLibcallCCs[RTLIB::UNKNOWN_LIBCALL];
+
+
+  CallingConv::ID LibcallCallingConvs[RTLIB::UNKNOWN_LIBCALL];
+
+
+  void InitLibcalls(const Triple &TT);
+
+protected:
+
+
+
+  virtual bool isExtFreeImpl(const Instruction *I) const { return false; }
+
+
+
+
+
+  unsigned GatherAllAliasesMaxDepth;
+  unsigned MaxStoresPerMemset;
+
+
+
+  unsigned MaxStoresPerMemsetOptSize;
+  unsigned MaxStoresPerMemcpy;
+
+
+
+  unsigned MaxStoresPerMemcpyOptSize;
+  unsigned MaxLoadsPerMemcmp;
+  unsigned MaxLoadsPerMemcmpOptSize;
+  unsigned MaxStoresPerMemmove;
+
+
+
+  unsigned MaxStoresPerMemmoveOptSize;
+
+
+
+  bool PredictableSelectIsExpensive;
+
+
+  bool EnableExtLdPromotion;
+
+
+
+  bool isLegalRC(const TargetRegisterInfo &TRI,
+                 const TargetRegisterClass &RC) const;
+
+
+
+  MachineBasicBlock *emitPatchPoint(MachineInstr &MI,
+                                    MachineBasicBlock *MBB) const;
+};
+
+
+
+
+
+
+class TargetLowering : public TargetLoweringBase {
+public:
+  struct DAGCombinerInfo;
+
+  TargetLowering(const TargetLowering &) = delete;
+  TargetLowering &operator=(const TargetLowering &) = delete;
+
+
+  explicit TargetLowering(const TargetMachine &TM);
+
+  bool isPositionIndependent() const;
+
+
+
+
+  virtual bool getPreIndexedAddressParts(SDNode * , SDValue & ,
+                                         SDValue & ,
+                                         ISD::MemIndexedMode & ,
+                                         SelectionDAG & ) const {
+    return false;
+  }
+
+
+
+
+  virtual bool getPostIndexedAddressParts(SDNode * , SDNode * ,
+                                          SDValue & ,
+                                          SDValue & ,
+                                          ISD::MemIndexedMode & ,
+                                          SelectionDAG & ) const {
+    return false;
+  }
+
+
+
+  virtual unsigned getJumpTableEncoding() const;
+
+  virtual const MCExpr *
+  LowerCustomJumpTableEntry(const MachineJumpTableInfo * ,
+                            const MachineBasicBlock * , unsigned ,
+                            MCContext & ) const {
+    ::llvm::llvm_unreachable_internal("Need to implement this hook if target has custom JTIs", "/home/trippels/llvm/llvm/include/llvm/CodeGen/TargetLowering.h", 2583);
+  }
+
+
+  virtual SDValue getPICJumpTableRelocBase(SDValue Table,
+                                           SelectionDAG &DAG) const;
+
+
+
+  virtual const MCExpr *
+  getPICJumpTableRelocBaseExpr(const MachineFunction *MF,
+                               unsigned JTI, MCContext &Ctx) const;
+
+
+
+  virtual bool isOffsetFoldingLegal(const GlobalAddressSDNode *GA) const;
+
+  bool isInTailCallPosition(SelectionDAG &DAG, SDNode *Node,
+                            SDValue &Chain) const;
+
+  void softenSetCCOperands(SelectionDAG &DAG, EVT VT, SDValue &NewLHS,
+                           SDValue &NewRHS, ISD::CondCode &CCCode,
+                           const SDLoc &DL) const;
+
+
+
+  std::pair<SDValue, SDValue> makeLibCall(SelectionDAG &DAG, RTLIB::Libcall LC,
+                                          EVT RetVT, ArrayRef<SDValue> Ops,
+                                          bool isSigned, const SDLoc &dl,
+                                          bool doesNotReturn = false,
+                                          bool isReturnValueUsed = true) const;
+
+
+
+
+  bool parametersInCSRMatch(const MachineRegisterInfo &MRI,
+      const uint32_t *CallerPreservedMask,
+      const SmallVectorImpl<CCValAssign> &ArgLocs,
+      const SmallVectorImpl<SDValue> &OutVals) const;
+  struct TargetLoweringOpt {
+    SelectionDAG &DAG;
+    bool LegalTys;
+    bool LegalOps;
+    SDValue Old;
+    SDValue New;
+
+    explicit TargetLoweringOpt(SelectionDAG &InDAG,
+                               bool LT, bool LO) :
+      DAG(InDAG), LegalTys(LT), LegalOps(LO) {}
+
+    bool LegalTypes() const { return LegalTys; }
+    bool LegalOperations() const { return LegalOps; }
+
+    bool CombineTo(SDValue O, SDValue N) {
+      Old = O;
+      New = N;
+      return true;
+    }
+  };
+
+
+
+
+
+  bool ShrinkDemandedConstant(SDValue Op, const APInt &Demanded,
+                              TargetLoweringOpt &TLO) const;
+
+
+
+
+  virtual bool targetShrinkDemandedConstant(SDValue Op, const APInt &Demanded,
+                                            TargetLoweringOpt &TLO) const {
+    return false;
+  }
+
+
+
+
+  bool ShrinkDemandedOp(SDValue Op, unsigned BitWidth, const APInt &Demanded,
+                        TargetLoweringOpt &TLO) const;
+  bool SimplifyDemandedBits(SDNode *User, unsigned OpIdx, const APInt &Demanded,
+                            DAGCombinerInfo &DCI, TargetLoweringOpt &TLO) const;
+  bool SimplifyDemandedBits(SDValue Op, const APInt &DemandedMask,
+                            KnownBits &Known,
+                            TargetLoweringOpt &TLO,
+                            unsigned Depth = 0,
+                            bool AssumeSingleUse = false) const;
+
+
+  bool SimplifyDemandedBits(SDValue Op, const APInt &DemandedMask,
+                            DAGCombinerInfo &DCI) const;
+
+
+
+
+
+  virtual void computeKnownBitsForTargetNode(const SDValue Op,
+                                             KnownBits &Known,
+                                             const APInt &DemandedElts,
+                                             const SelectionDAG &DAG,
+                                             unsigned Depth = 0) const;
+
+
+
+
+  virtual void computeKnownBitsForFrameIndex(const SDValue FIOp,
+                                             KnownBits &Known,
+                                             const APInt &DemandedElts,
+                                             const SelectionDAG &DAG,
+                                             unsigned Depth = 0) const;
+
+
+
+
+
+  virtual unsigned ComputeNumSignBitsForTargetNode(SDValue Op,
+                                                   const APInt &DemandedElts,
+                                                   const SelectionDAG &DAG,
+                                                   unsigned Depth = 0) const;
+
+  struct DAGCombinerInfo {
+    void *DC;
+    CombineLevel Level;
+    bool CalledByLegalizer;
+
+  public:
+    SelectionDAG &DAG;
+
+    DAGCombinerInfo(SelectionDAG &dag, CombineLevel level, bool cl, void *dc)
+      : DC(dc), Level(level), CalledByLegalizer(cl), DAG(dag) {}
+
+    bool isBeforeLegalize() const { return Level == BeforeLegalizeTypes; }
+    bool isBeforeLegalizeOps() const { return Level < AfterLegalizeVectorOps; }
+    bool isAfterLegalizeVectorOps() const {
+      return Level == AfterLegalizeDAG;
+    }
+    CombineLevel getDAGCombineLevel() { return Level; }
+    bool isCalledByLegalizer() const { return CalledByLegalizer; }
+
+    void AddToWorklist(SDNode *N);
+    SDValue CombineTo(SDNode *N, ArrayRef<SDValue> To, bool AddTo = true);
+    SDValue CombineTo(SDNode *N, SDValue Res, bool AddTo = true);
+    SDValue CombineTo(SDNode *N, SDValue Res0, SDValue Res1, bool AddTo = true);
+
+    void CommitTargetLoweringOpt(const TargetLoweringOpt &TLO);
+  };
+
+
+
+  bool isConstTrueVal(const SDNode *N) const;
+
+
+
+  bool isConstFalseVal(const SDNode *N) const;
+
+
+
+  SDValue getConstTrueVal(SelectionDAG &DAG, EVT VT, const SDLoc &DL) const;
+
+
+  bool isExtendedTrueVal(const ConstantSDNode *N, EVT VT, bool Signed) const;
+
+
+
+  SDValue SimplifySetCC(EVT VT, SDValue N0, SDValue N1, ISD::CondCode Cond,
+                        bool foldBooleans, DAGCombinerInfo &DCI,
+                        const SDLoc &dl) const;
+
+
+  virtual SDValue unwrapAddress(SDValue N) const { return N; }
+
+
+
+  virtual bool
+  isGAPlusOffset(SDNode *N, const GlobalValue* &GA, int64_t &Offset) const;
+  virtual SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const;
+
+
+
+
+
+
+  virtual bool isDesirableToCommuteWithShift(const SDNode *N) const {
+    return true;
+  }
+  virtual bool isDesirableToCombineBuildVectorToShuffleTruncate(
+      ArrayRef<int> ShuffleMask, EVT SrcVT, EVT TruncVT) const {
+    return false;
+  }
+
+
+
+
+
+  virtual bool isTypeDesirableForOp(unsigned , EVT VT) const {
+
+    return isTypeLegal(VT);
+  }
+
+
+
+
+  virtual bool isDesirableToTransformToIntegerOp(unsigned ,
+                                                 EVT ) const {
+    return false;
+  }
+
+
+
+
+  virtual bool IsDesirableToPromoteOp(SDValue , EVT & ) const {
+    return false;
+  }
+
+
+
+  virtual bool supportSwiftError() const {
+    return false;
+  }
+
+
+
+  virtual bool supportSplitCSR(MachineFunction *MF) const {
+    return false;
+  }
+
+
+
+
+  virtual void initializeSplitCSR(MachineBasicBlock *Entry) const {
+    ::llvm::llvm_unreachable_internal("Not Implemented", "/home/trippels/llvm/llvm/include/llvm/CodeGen/TargetLowering.h", 2867);
+  }
+
+
+
+
+
+  virtual void insertCopiesSplitCSR(
+      MachineBasicBlock *Entry,
+      const SmallVectorImpl<MachineBasicBlock *> &Exits) const {
+    ::llvm::llvm_unreachable_internal("Not Implemented", "/home/trippels/llvm/llvm/include/llvm/CodeGen/TargetLowering.h", 2877);
+  }
+  virtual SDValue LowerFormalArguments(
+      SDValue , CallingConv::ID , bool ,
+      const SmallVectorImpl<ISD::InputArg> & , const SDLoc & ,
+      SelectionDAG & , SmallVectorImpl<SDValue> & ) const {
+    ::llvm::llvm_unreachable_internal("Not Implemented", "/home/trippels/llvm/llvm/include/llvm/CodeGen/TargetLowering.h", 2893);
+  }
+
+
+
+
+
+  struct CallLoweringInfo {
+    SDValue Chain;
+    Type *RetTy = nullptr;
+    bool RetSExt : 1;
+    bool RetZExt : 1;
+    bool IsVarArg : 1;
+    bool IsInReg : 1;
+    bool DoesNotReturn : 1;
+    bool IsReturnValueUsed : 1;
+    bool IsConvergent : 1;
+    bool IsPatchPoint : 1;
+
+
+
+    bool IsTailCall = false;
+
+
+    bool IsPostTypeLegalization = false;
+
+    unsigned NumFixedArgs = -1;
+    CallingConv::ID CallConv = CallingConv::C;
+    SDValue Callee;
+    ArgListTy Args;
+    SelectionDAG &DAG;
+    SDLoc DL;
+    ImmutableCallSite CS;
+    SmallVector<ISD::OutputArg, 32> Outs;
+    SmallVector<SDValue, 32> OutVals;
+    SmallVector<ISD::InputArg, 32> Ins;
+    SmallVector<SDValue, 4> InVals;
+
+    CallLoweringInfo(SelectionDAG &DAG)
+        : RetSExt(false), RetZExt(false), IsVarArg(false), IsInReg(false),
+          DoesNotReturn(false), IsReturnValueUsed(true), IsConvergent(false),
+          IsPatchPoint(false), DAG(DAG) {}
+
+    CallLoweringInfo &setDebugLoc(const SDLoc &dl) {
+      DL = dl;
+      return *this;
+    }
+
+    CallLoweringInfo &setChain(SDValue InChain) {
+      Chain = InChain;
+      return *this;
+    }
+
+
+    CallLoweringInfo &setLibCallee(CallingConv::ID CC, Type *ResultType,
+                                   SDValue Target, ArgListTy &&ArgsList) {
+      RetTy = ResultType;
+      Callee = Target;
+      CallConv = CC;
+      NumFixedArgs = ArgsList.size();
+      Args = std::move(ArgsList);
+
+      DAG.getTargetLoweringInfo().markLibCallAttributes(
+          &(DAG.getMachineFunction()), CC, Args);
+      return *this;
+    }
+
+    CallLoweringInfo &setCallee(CallingConv::ID CC, Type *ResultType,
+                                SDValue Target, ArgListTy &&ArgsList) {
+      RetTy = ResultType;
+      Callee = Target;
+      CallConv = CC;
+      NumFixedArgs = ArgsList.size();
+      Args = std::move(ArgsList);
+      return *this;
+    }
+
+    CallLoweringInfo &setCallee(Type *ResultType, FunctionType *FTy,
+                                SDValue Target, ArgListTy &&ArgsList,
+                                ImmutableCallSite Call) {
+      RetTy = ResultType;
+
+      IsInReg = Call.hasRetAttr(Attribute::InReg);
+      DoesNotReturn =
+          Call.doesNotReturn() ||
+          (!Call.isInvoke() &&
+           isa<UnreachableInst>(Call.getInstruction()->getNextNode()));
+      IsVarArg = FTy->isVarArg();
+      IsReturnValueUsed = !Call.getInstruction()->use_empty();
+      RetSExt = Call.hasRetAttr(Attribute::SExt);
+      RetZExt = Call.hasRetAttr(Attribute::ZExt);
+
+      Callee = Target;
+
+      CallConv = Call.getCallingConv();
+      NumFixedArgs = FTy->getNumParams();
+      Args = std::move(ArgsList);
+
+      CS = Call;
+
+      return *this;
+    }
+
+    CallLoweringInfo &setInRegister(bool Value = true) {
+      IsInReg = Value;
+      return *this;
+    }
+
+    CallLoweringInfo &setNoReturn(bool Value = true) {
+      DoesNotReturn = Value;
+      return *this;
+    }
+
+    CallLoweringInfo &setVarArg(bool Value = true) {
+      IsVarArg = Value;
+      return *this;
+    }
+
+    CallLoweringInfo &setTailCall(bool Value = true) {
+      IsTailCall = Value;
+      return *this;
+    }
+
+    CallLoweringInfo &setDiscardResult(bool Value = true) {
+      IsReturnValueUsed = !Value;
+      return *this;
+    }
+
+    CallLoweringInfo &setConvergent(bool Value = true) {
+      IsConvergent = Value;
+      return *this;
+    }
+
+    CallLoweringInfo &setSExtResult(bool Value = true) {
+      RetSExt = Value;
+      return *this;
+    }
+
+    CallLoweringInfo &setZExtResult(bool Value = true) {
+      RetZExt = Value;
+      return *this;
+    }
+
+    CallLoweringInfo &setIsPatchPoint(bool Value = true) {
+      IsPatchPoint = Value;
+      return *this;
+    }
+
+    CallLoweringInfo &setIsPostTypeLegalization(bool Value=true) {
+      IsPostTypeLegalization = Value;
+      return *this;
+    }
+
+    ArgListTy &getArgs() {
+      return Args;
+    }
+  };
+
+
+
+
+
+  std::pair<SDValue, SDValue> LowerCallTo(CallLoweringInfo &CLI) const;
+
+
+
+
+
+
+  virtual SDValue
+    LowerCall(CallLoweringInfo & ,
+              SmallVectorImpl<SDValue> & ) const {
+    ::llvm::llvm_unreachable_internal("Not Implemented", "/home/trippels/llvm/llvm/include/llvm/CodeGen/TargetLowering.h", 3065);
+  }
+
+
+  virtual void HandleByVal(CCState *, unsigned &, unsigned) const {}
+
+
+
+
+  virtual bool CanLowerReturn(CallingConv::ID ,
+                              MachineFunction & , bool ,
+               const SmallVectorImpl<ISD::OutputArg> & ,
+               LLVMContext & ) const
+  {
+
+    return true;
+  }
+
+
+
+
+  virtual SDValue LowerReturn(SDValue , CallingConv::ID ,
+                              bool ,
+                              const SmallVectorImpl<ISD::OutputArg> & ,
+                              const SmallVectorImpl<SDValue> & ,
+                              const SDLoc & ,
+                              SelectionDAG & ) const {
+    ::llvm::llvm_unreachable_internal("Not Implemented", "/home/trippels/llvm/llvm/include/llvm/CodeGen/TargetLowering.h", 3092);
+  }
+
+
+
+
+
+
+  virtual bool isUsedByReturnOnly(SDNode *, SDValue & ) const {
+    return false;
+  }
+
+
+
+
+  virtual bool mayBeEmittedAsTailCall(const CallInst *) const {
+    return false;
+  }
+
+
+
+  virtual const char * getClearCacheBuiltinName() const {
+    return "__clear_cache";
+  }
+
+
+
+
+  virtual unsigned getRegisterByName(const char* RegName, EVT VT,
+                                     SelectionDAG &DAG) const {
+    report_fatal_error("Named registers not implemented for this target");
+  }
+
+
+
+
+
+
+
+  virtual EVT getTypeForExtReturn(LLVMContext &Context, EVT VT,
+                                       ISD::NodeType ) const {
+    EVT MinVT = getRegisterType(Context, MVT::i32);
+    return VT.bitsLT(MinVT) ? MinVT : VT;
+  }
+
+
+
+
+  virtual bool
+  functionArgumentNeedsConsecutiveRegisters(Type *Ty, CallingConv::ID CallConv,
+                                            bool isVarArg) const {
+    return false;
+  }
+
+
+
+  virtual const MCPhysReg *getScratchRegisters(CallingConv::ID CC) const {
+    return nullptr;
+  }
+  virtual SDValue prepareVolatileOrAtomicLoad(SDValue Chain, const SDLoc &DL,
+                                              SelectionDAG &DAG) const {
+    return Chain;
+  }
+
+
+
+
+  virtual MachineMemOperand::Flags getMMOFlags(const Instruction &I) const {
+    return MachineMemOperand::MONone;
+  }
+  virtual void LowerOperationWrapper(SDNode *N,
+                                     SmallVectorImpl<SDValue> &Results,
+                                     SelectionDAG &DAG) const;
+
+
+
+
+
+
+  virtual SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const;
+  virtual void ReplaceNodeResults(SDNode * ,
+                                  SmallVectorImpl<SDValue> & ,
+                                  SelectionDAG & ) const {
+    ::llvm::llvm_unreachable_internal("ReplaceNodeResults not implemented for this target!", "/home/trippels/llvm/llvm/include/llvm/CodeGen/TargetLowering.h", 3207);
+  }
+
+
+  virtual const char *getTargetNodeName(unsigned Opcode) const;
+
+
+
+  virtual FastISel *createFastISel(FunctionLoweringInfo &,
+                                   const TargetLibraryInfo *) const {
+    return nullptr;
+  }
+
+  bool verifyReturnAddressArgumentIsConstant(SDValue Op,
+                                             SelectionDAG &DAG) const;
+  virtual bool ExpandInlineAsm(CallInst *) const {
+    return false;
+  }
+
+  enum ConstraintType {
+    C_Register,
+    C_RegisterClass,
+    C_Memory,
+    C_Other,
+    C_Unknown
+  };
+
+  enum ConstraintWeight {
+
+    CW_Invalid = -1,
+    CW_Okay = 0,
+    CW_Good = 1,
+    CW_Better = 2,
+    CW_Best = 3,
+
+
+    CW_SpecificReg = CW_Okay,
+    CW_Register = CW_Good,
+    CW_Memory = CW_Better,
+    CW_Constant = CW_Best,
+    CW_Default = CW_Okay
+  };
+
+
+  struct AsmOperandInfo : public InlineAsm::ConstraintInfo {
+
+
+
+    std::string ConstraintCode;
+
+
+
+    TargetLowering::ConstraintType ConstraintType = TargetLowering::C_Unknown;
+
+
+
+
+    Value *CallOperandVal = nullptr;
+
+
+    MVT ConstraintVT = MVT::Other;
+
+
+    AsmOperandInfo(InlineAsm::ConstraintInfo Info)
+        : InlineAsm::ConstraintInfo(std::move(Info)) {}
+
+
+
+    bool isMatchingInputConstraint() const;
+
+
+
+    unsigned getMatchedOperand() const;
+  };
+
+  using AsmOperandInfoVector = std::vector<AsmOperandInfo>;
+
+
+
+
+
+  virtual AsmOperandInfoVector ParseConstraints(const DataLayout &DL,
+                                                const TargetRegisterInfo *TRI,
+                                                ImmutableCallSite CS) const;
+
+
+
+  virtual ConstraintWeight getMultipleConstraintMatchWeight(
+      AsmOperandInfo &info, int maIndex) const;
+
+
+
+  virtual ConstraintWeight getSingleConstraintMatchWeight(
+      AsmOperandInfo &info, const char *constraint) const;
+
+
+
+
+
+  virtual void ComputeConstraintToUse(AsmOperandInfo &OpInfo,
+                                      SDValue Op,
+                                      SelectionDAG *DAG = nullptr) const;
+
+
+  virtual ConstraintType getConstraintType(StringRef Constraint) const;
+  virtual std::pair<unsigned, const TargetRegisterClass *>
+  getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI,
+                               StringRef Constraint, MVT VT) const;
+
+  virtual unsigned getInlineAsmMemConstraint(StringRef ConstraintCode) const {
+    if (ConstraintCode == "i")
+      return InlineAsm::Constraint_i;
+    else if (ConstraintCode == "m")
+      return InlineAsm::Constraint_m;
+    return InlineAsm::Constraint_Unknown;
+  }
+
+
+
+
+  virtual const char *LowerXConstraint(EVT ConstraintVT) const;
+
+
+
+  virtual void LowerAsmOperandForConstraint(SDValue Op, std::string &Constraint,
+                                            std::vector<SDValue> &Ops,
+                                            SelectionDAG &DAG) const;
+
+
+
+
+  SDValue BuildSDIV(SDNode *N, const APInt &Divisor, SelectionDAG &DAG,
+                    bool IsAfterLegalization,
+                    std::vector<SDNode *> *Created) const;
+  SDValue BuildUDIV(SDNode *N, const APInt &Divisor, SelectionDAG &DAG,
+                    bool IsAfterLegalization,
+                    std::vector<SDNode *> *Created) const;
+
+
+
+
+
+  virtual SDValue BuildSDIVPow2(SDNode *N, const APInt &Divisor,
+                                SelectionDAG &DAG,
+                                std::vector<SDNode *> *Created) const;
+
+
+
+
+
+  virtual unsigned combineRepeatedFPDivisors() const {
+    return 0;
+  }
+  virtual SDValue getSqrtEstimate(SDValue Operand, SelectionDAG &DAG,
+                                  int Enabled, int &RefinementSteps,
+                                  bool &UseOneConstNR, bool Reciprocal) const {
+    return SDValue();
+  }
+  virtual SDValue getRecipEstimate(SDValue Operand, SelectionDAG &DAG,
+                                   int Enabled, int &RefinementSteps) const {
+    return SDValue();
+  }
+  bool expandMUL_LOHI(unsigned Opcode, EVT VT, SDLoc dl, SDValue LHS,
+                      SDValue RHS, SmallVectorImpl<SDValue> &Result, EVT HiLoVT,
+                      SelectionDAG &DAG, MulExpansionKind Kind,
+                      SDValue LL = SDValue(), SDValue LH = SDValue(),
+                      SDValue RL = SDValue(), SDValue RH = SDValue()) const;
+  bool expandMUL(SDNode *N, SDValue &Lo, SDValue &Hi, EVT HiLoVT,
+                 SelectionDAG &DAG, MulExpansionKind Kind,
+                 SDValue LL = SDValue(), SDValue LH = SDValue(),
+                 SDValue RL = SDValue(), SDValue RH = SDValue()) const;
+
+
+
+
+
+  bool expandFP_TO_SINT(SDNode *N, SDValue &Result, SelectionDAG &DAG) const;
+
+
+
+
+  SDValue scalarizeVectorLoad(LoadSDNode *LD, SelectionDAG &DAG) const;
+
+
+
+
+  SDValue scalarizeVectorStore(StoreSDNode *ST, SelectionDAG &DAG) const;
+
+
+
+  std::pair<SDValue, SDValue> expandUnalignedLoad(LoadSDNode *LD,
+                                                  SelectionDAG &DAG) const;
+
+
+
+  SDValue expandUnalignedStore(StoreSDNode *ST, SelectionDAG &DAG) const;
+  SDValue IncrementMemoryAddress(SDValue Addr, SDValue Mask, const SDLoc &DL,
+                                 EVT DataVT, SelectionDAG &DAG,
+                                 bool IsCompressedMemory) const;
+
+
+
+
+
+  SDValue getVectorElementPointer(SelectionDAG &DAG, SDValue VecPtr, EVT VecVT,
+                                  SDValue Idx) const;
+  virtual MachineBasicBlock *
+  EmitInstrWithCustomInserter(MachineInstr &MI, MachineBasicBlock *MBB) const;
+
+
+
+
+
+  virtual void AdjustInstrPostInstrSelection(MachineInstr &MI,
+                                             SDNode *Node) const;
+
+
+
+  virtual bool useLoadStackGuardNode() const {
+    return false;
+  }
+
+  virtual SDValue emitStackGuardXorFP(SelectionDAG &DAG, SDValue Val,
+                                      const SDLoc &DL) const {
+    ::llvm::llvm_unreachable_internal("not implemented for this target", "/home/trippels/llvm/llvm/include/llvm/CodeGen/TargetLowering.h", 3526);
+  }
+
+
+  virtual SDValue LowerToTLSEmulatedModel(const GlobalAddressSDNode *GA,
+                                          SelectionDAG &DAG) const;
+
+
+
+
+
+  SDValue lowerCmpEqZeroToCtlzSrl(SDValue Op, SelectionDAG &DAG) const;
+
+private:
+  SDValue simplifySetCCWithAnd(EVT VT, SDValue N0, SDValue N1,
+                               ISD::CondCode Cond, DAGCombinerInfo &DCI,
+                               const SDLoc &DL) const;
+};
+
+
+
+
+void GetReturnInfo(Type *ReturnType, AttributeList attr,
+                   SmallVectorImpl<ISD::OutputArg> &Outs,
+                   const TargetLowering &TLI, const DataLayout &DL);
+
+}
+namespace llvm {
+
+namespace PBQP {
+namespace RegAlloc {
+
+
+class PBQPRAGraph;
+
+}
+}
+
+using PBQPRAGraph = PBQP::RegAlloc::PBQPRAGraph;
+
+
+
+class PBQPRAConstraint {
+public:
+  virtual ~PBQPRAConstraint() = 0;
+  virtual void apply(PBQPRAGraph &G) = 0;
+
+private:
+  virtual void anchor();
+};
+
+
+
+
+
+class PBQPRAConstraintList : public PBQPRAConstraint {
+public:
+  void apply(PBQPRAGraph &G) override {
+    for (auto &C : Constraints)
+      C->apply(G);
+  }
+
+  void addConstraint(std::unique_ptr<PBQPRAConstraint> C) {
+    if (C)
+      Constraints.push_back(std::move(C));
+  }
+
+private:
+  std::vector<std::unique_ptr<PBQPRAConstraint>> Constraints;
+
+  void anchor() override;
+};
+
+}
+namespace llvm {
+
+class ScheduleDAGInstrs;
+
+
+class ScheduleDAGMutation {
+  virtual void anchor();
+
+public:
+  virtual ~ScheduleDAGMutation() = default;
+
+  virtual void apply(ScheduleDAGInstrs *DAG) = 0;
+};
+
+}
+namespace llvm {
+
+class FunctionPass;
+class MachineFunction;
+class MachineFunctionPass;
+class ModulePass;
+class Pass;
+class TargetMachine;
+class TargetRegisterClass;
+class raw_ostream;
+
+}
+
+
+namespace llvm {
+  FunctionPass *createAtomicExpandPass();
+
+
+
+
+
+
+
+  FunctionPass *createUnreachableBlockEliminationPass();
+
+
+
+  MachineFunctionPass *
+  createMachineFunctionPrinterPass(raw_ostream &OS,
+                                   const std::string &Banner ="");
+
+
+
+  MachineFunctionPass *createPrintMIRPass(raw_ostream &OS);
+
+
+
+
+
+
+  MachineFunctionPass *createResetMachineFunctionPass(bool EmitFallbackDiag,
+                                                      bool AbortOnFailedISel);
+
+
+
+  FunctionPass *createCodeGenPreparePass();
+
+
+
+  FunctionPass *createScalarizeMaskedMemIntrinPass();
+
+
+
+  extern char &AtomicExpandID;
+
+
+  extern char &MachineLoopInfoID;
+
+
+  extern char &MachineDominatorsID;
+
+
+  extern char &MachineDominanceFrontierID;
+
+
+  extern char &MachineRegionInfoPassID;
+
+
+  extern char &EdgeBundlesID;
+
+
+
+  extern char &LiveVariablesID;
+
+
+
+
+
+  extern char &PHIEliminationID;
+
+
+
+  extern char &LiveIntervalsID;
+
+
+  extern char &LiveStacksID;
+
+
+
+
+  extern char &TwoAddressInstructionPassID;
+
+
+  extern char &ProcessImplicitDefsID;
+
+
+  extern char &RegisterCoalescerID;
+
+
+  extern char &MachineSchedulerID;
+
+
+  extern char &PostMachineSchedulerID;
+
+
+
+  extern char &SpillPlacementID;
+
+
+
+  extern char &ShrinkWrapID;
+
+
+
+  extern char &LiveRangeShrinkID;
+
+
+  extern char &RAGreedyID;
+
+
+  extern char &RABasicID;
+
+
+
+  extern char &VirtRegRewriterID;
+
+
+
+  extern char &UnreachableMachineBlockElimID;
+
+
+  extern char &DeadMachineInstructionElimID;
+
+
+  extern char &DetectDeadLanesID;
+
+
+
+
+  FunctionPass *createFastRegisterAllocator();
+
+
+
+
+  FunctionPass *createBasicRegisterAllocator();
+
+
+
+
+  FunctionPass *createGreedyRegisterAllocator();
+
+
+
+
+  FunctionPass *createDefaultPBQPRegisterAllocator();
+
+
+
+  extern char &PrologEpilogCodeInserterID;
+  MachineFunctionPass *createPrologEpilogInserterPass();
+
+
+
+  extern char &ExpandPostRAPseudosID;
+
+
+
+  extern char &PostRAHazardRecognizerID;
+
+
+
+  extern char &PostRASchedulerID;
+
+
+
+
+
+  extern char &BranchFolderPassID;
+
+
+
+  extern char &BranchRelaxationPassID;
+
+
+  extern char &MachineFunctionPrinterPassID;
+
+
+
+  extern char &MIRPrintingPassID;
+
+
+
+  extern char &TailDuplicateID;
+
+
+
+  extern char &MachineTraceMetricsID;
+
+
+
+  extern char &EarlyIfConverterID;
+
+
+
+  extern char &MachineCombinerID;
+
+
+
+  extern char &StackColoringID;
+
+
+  extern char &IfConverterID;
+
+  FunctionPass *createIfConverter(
+      std::function<bool(const MachineFunction &)> Ftor);
+
+
+
+  extern char &MachineBlockPlacementID;
+
+
+
+
+  extern char &MachineBlockPlacementStatsID;
+
+
+
+  FunctionPass *createGCLoweringPass();
+
+
+
+
+  FunctionPass *createShadowStackGCLoweringPass();
+
+
+
+
+
+  extern char &GCMachineCodeAnalysisID;
+
+
+
+  FunctionPass *createGCInfoPrinter(raw_ostream &OS);
+
+
+  extern char &MachineCSEID;
+
+
+
+  extern char &ImplicitNullChecksID;
+
+
+  extern char &MachineLICMID;
+
+
+  extern char &MachineSinkingID;
+
+
+
+  extern char &MachineCopyPropagationID;
+
+
+
+  extern char &PeepholeOptimizerID;
+
+
+
+  extern char &OptimizePHIsID;
+
+
+  extern char &StackSlotColoringID;
+
+
+  extern char &FuncletLayoutID;
+
+
+
+  extern char &XRayInstrumentationID;
+
+
+  extern char &FEntryInserterID;
+
+
+  extern char &PatchableFunctionID;
+
+
+
+  FunctionPass *createStackProtectorPass();
+
+
+
+
+  FunctionPass *createMachineVerifierPass(const std::string& Banner);
+
+
+
+  FunctionPass *createDwarfEHPass();
+
+
+
+  FunctionPass *createWinEHPass();
+
+
+
+
+  FunctionPass *createSjLjEHPreparePass();
+
+
+
+
+
+  extern char &LocalStackSlotAllocationID;
+
+
+  extern char &ExpandISelPseudosID;
+
+
+  extern char &UnpackMachineBundlesID;
+
+  FunctionPass *
+  createUnpackMachineBundles(std::function<bool(const MachineFunction &)> Ftor);
+
+
+
+  extern char &FinalizeMachineBundlesID;
+
+
+
+
+  extern char &StackMapLivenessID;
+
+
+  extern char &LiveDebugValuesID;
+
+
+  ModulePass *createJumpInstrTablesPass();
+
+
+
+  ModulePass *createForwardControlFlowIntegrityPass();
+
+
+
+
+  FunctionPass *createInterleavedAccessPass();
+
+
+
+
+  ModulePass *createLowerEmuTLSPass();
+
+
+
+
+  ModulePass *createPreISelIntrinsicLoweringPass();
+
+
+
+
+
+  Pass *createGlobalMergePass(const TargetMachine *TM, unsigned MaximalOffset,
+                              bool OnlyOptimizeForSize = false,
+                              bool MergeExternalByDefault = false);
+
+
+
+  FunctionPass *createSafeStackPass();
+
+
+
+
+  extern char &RenameIndependentSubregsID;
+
+
+
+  FunctionPass *createRegUsageInfoCollector();
+
+
+
+
+  FunctionPass *createRegUsageInfoPropPass();
+
+
+  extern char &MachinePipelinerID;
+
+
+  FunctionPass *createFreeMachineFunctionPass();
+
+
+
+  ModulePass *createMachineOutlinerPass(bool OutlineFromLinkOnceODRs = false);
+
+
+
+  FunctionPass *createExpandReductionsPass();
+
+
+  FunctionPass *createExpandMemCmpPass();
+
+}
+
+
+namespace llvm {
+
+using MachinePassCtor = void *(*)();
+
+
+
+
+
+
+
+class MachinePassRegistryListener {
+  virtual void anchor();
+
+public:
+  MachinePassRegistryListener() = default;
+  virtual ~MachinePassRegistryListener() = default;
+
+  virtual void NotifyAdd(StringRef N, MachinePassCtor C, StringRef D) = 0;
+  virtual void NotifyRemove(StringRef N) = 0;
+};
+
+
+
+
+
+
+class MachinePassRegistryNode {
+private:
+  MachinePassRegistryNode *Next = nullptr;
+  StringRef Name;
+  StringRef Description;
+  MachinePassCtor Ctor;
+
+public:
+  MachinePassRegistryNode(const char *N, const char *D, MachinePassCtor C)
+      : Name(N), Description(D), Ctor(C) {}
+
+
+  MachinePassRegistryNode *getNext() const { return Next; }
+  MachinePassRegistryNode **getNextAddress() { return &Next; }
+  StringRef getName() const { return Name; }
+  StringRef getDescription() const { return Description; }
+  MachinePassCtor getCtor() const { return Ctor; }
+  void setNext(MachinePassRegistryNode *N) { Next = N; }
+};
+
+
+
+
+
+
+class MachinePassRegistry {
+private:
+  MachinePassRegistryNode *List;
+  MachinePassCtor Default;
+  MachinePassRegistryListener *Listener;
+
+public:
+
+
+
+
+
+  MachinePassRegistryNode *getList() { return List; }
+  MachinePassCtor getDefault() { return Default; }
+  void setDefault(MachinePassCtor C) { Default = C; }
+  void setDefault(StringRef Name);
+  void setListener(MachinePassRegistryListener *L) { Listener = L; }
+
+
+
+  void Add(MachinePassRegistryNode *Node);
+
+
+
+  void Remove(MachinePassRegistryNode *Node);
+};
+
+
+
+
+
+
+template<class RegistryClass>
+class RegisterPassParser : public MachinePassRegistryListener,
+                   public cl::parser<typename RegistryClass::FunctionPassCtor> {
+public:
+  RegisterPassParser(cl::Option &O)
+      : cl::parser<typename RegistryClass::FunctionPassCtor>(O) {}
+  ~RegisterPassParser() override { RegistryClass::setListener(nullptr); }
+
+  void initialize() {
+    cl::parser<typename RegistryClass::FunctionPassCtor>::initialize();
+
+
+    for (RegistryClass *Node = RegistryClass::getList();
+         Node; Node = Node->getNext()) {
+      this->addLiteralOption(Node->getName(),
+                      (typename RegistryClass::FunctionPassCtor)Node->getCtor(),
+                             Node->getDescription());
+    }
+
+
+    RegistryClass::setListener(this);
+  }
+
+
+  void NotifyAdd(StringRef N, MachinePassCtor C, StringRef D) override {
+    this->addLiteralOption(N, (typename RegistryClass::FunctionPassCtor)C, D);
+  }
+  void NotifyRemove(StringRef N) override {
+    this->removeLiteralOption(N);
+  }
+};
+
+}
+
+
+namespace llvm {
+
+
+
+
+
+
+
+class ScheduleDAGSDNodes;
+class SelectionDAGISel;
+
+class RegisterScheduler : public MachinePassRegistryNode {
+public:
+  using FunctionPassCtor = ScheduleDAGSDNodes *(*)(SelectionDAGISel*,
+                                                   CodeGenOpt::Level);
+
+  static MachinePassRegistry Registry;
+
+  RegisterScheduler(const char *N, const char *D, FunctionPassCtor C)
+  : MachinePassRegistryNode(N, D, (MachinePassCtor)C)
+  { Registry.Add(this); }
+  ~RegisterScheduler() { Registry.Remove(this); }
+
+
+
+  RegisterScheduler *getNext() const {
+    return (RegisterScheduler *)MachinePassRegistryNode::getNext();
+  }
+
+  static RegisterScheduler *getList() {
+    return (RegisterScheduler *)Registry.getList();
+  }
+
+  static void setListener(MachinePassRegistryListener *L) {
+    Registry.setListener(L);
+  }
+};
+
+
+
+ScheduleDAGSDNodes *createBURRListDAGScheduler(SelectionDAGISel *IS,
+                                               CodeGenOpt::Level OptLevel);
+
+
+
+ScheduleDAGSDNodes *createSourceListDAGScheduler(SelectionDAGISel *IS,
+                                                 CodeGenOpt::Level OptLevel);
+
+
+
+
+
+ScheduleDAGSDNodes *createHybridListDAGScheduler(SelectionDAGISel *IS,
+                                                 CodeGenOpt::Level);
+
+
+
+
+
+ScheduleDAGSDNodes *createILPListDAGScheduler(SelectionDAGISel *IS,
+                                              CodeGenOpt::Level);
+
+
+
+ScheduleDAGSDNodes *createFastDAGScheduler(SelectionDAGISel *IS,
+                                           CodeGenOpt::Level OptLevel);
+
+
+
+
+ScheduleDAGSDNodes *createVLIWDAGScheduler(SelectionDAGISel *IS,
+                                           CodeGenOpt::Level OptLevel);
+
+
+ScheduleDAGSDNodes *createDefaultScheduler(SelectionDAGISel *IS,
+                                           CodeGenOpt::Level OptLevel);
+
+
+
+ScheduleDAGSDNodes *createDAGLinearizer(SelectionDAGISel *IS,
+                                        CodeGenOpt::Level OptLevel);
+
+}
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+namespace llvm {
+
+struct InstrItinerary;
+
+
+struct MCProcResourceDesc {
+
+  const char *Name;
+
+  unsigned NumUnits;
+  unsigned SuperIdx;
+  int BufferSize;
+
+  bool operator==(const MCProcResourceDesc &Other) const {
+    return NumUnits == Other.NumUnits && SuperIdx == Other.SuperIdx
+      && BufferSize == Other.BufferSize;
+  }
+};
+
+
+
+struct MCWriteProcResEntry {
+  unsigned ProcResourceIdx;
+  unsigned Cycles;
+
+  bool operator==(const MCWriteProcResEntry &Other) const {
+    return ProcResourceIdx == Other.ProcResourceIdx && Cycles == Other.Cycles;
+  }
+};
+
+
+
+
+
+
+struct MCWriteLatencyEntry {
+  int Cycles;
+  unsigned WriteResourceID;
+
+  bool operator==(const MCWriteLatencyEntry &Other) const {
+    return Cycles == Other.Cycles && WriteResourceID == Other.WriteResourceID;
+  }
+};
+struct MCReadAdvanceEntry {
+  unsigned UseIdx;
+  unsigned WriteResourceID;
+  int Cycles;
+
+  bool operator==(const MCReadAdvanceEntry &Other) const {
+    return UseIdx == Other.UseIdx && WriteResourceID == Other.WriteResourceID
+      && Cycles == Other.Cycles;
+  }
+};
+
+
+
+
+
+struct MCSchedClassDesc {
+  static const unsigned short InvalidNumMicroOps = 
+                                                  (65535)
+                                                            ;
+  static const unsigned short VariantNumMicroOps = 
+                                                  (65535) 
+                                                             - 1;
+
+
+  const char* Name;
+
+  unsigned short NumMicroOps;
+  bool BeginGroup;
+  bool EndGroup;
+  unsigned WriteProcResIdx;
+  unsigned NumWriteProcResEntries;
+  unsigned WriteLatencyIdx;
+  unsigned NumWriteLatencyEntries;
+  unsigned ReadAdvanceIdx;
+  unsigned NumReadAdvanceEntries;
+
+  bool isValid() const {
+    return NumMicroOps != InvalidNumMicroOps;
+  }
+  bool isVariant() const {
+    return NumMicroOps == VariantNumMicroOps;
+  }
+};
+struct MCSchedModel {
+
+
+  unsigned IssueWidth;
+  static const unsigned DefaultIssueWidth = 1;
+  unsigned MicroOpBufferSize;
+  static const unsigned DefaultMicroOpBufferSize = 0;
+
+
+
+
+
+
+  unsigned LoopMicroOpBufferSize;
+  static const unsigned DefaultLoopMicroOpBufferSize = 0;
+
+
+  unsigned LoadLatency;
+  static const unsigned DefaultLoadLatency = 4;
+
+
+
+
+
+  unsigned HighLatency;
+  static const unsigned DefaultHighLatency = 10;
+
+
+
+  unsigned MispredictPenalty;
+  static const unsigned DefaultMispredictPenalty = 10;
+
+  bool PostRAScheduler;
+
+  bool CompleteModel;
+
+  unsigned ProcID;
+  const MCProcResourceDesc *ProcResourceTable;
+  const MCSchedClassDesc *SchedClassTable;
+  unsigned NumProcResourceKinds;
+  unsigned NumSchedClasses;
+
+  friend class InstrItineraryData;
+  const InstrItinerary *InstrItineraries;
+
+  unsigned getProcessorID() const { return ProcID; }
+
+
+  bool hasInstrSchedModel() const { return SchedClassTable; }
+
+
+
+  bool isComplete() const { return CompleteModel; }
+
+
+  bool isOutOfOrder() const { return MicroOpBufferSize > 1; }
+
+  unsigned getNumProcResourceKinds() const {
+    return NumProcResourceKinds;
+  }
+
+  const MCProcResourceDesc *getProcResource(unsigned ProcResourceIdx) const {
+    
+   ((
+   hasInstrSchedModel() && "No scheduling machine model"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "hasInstrSchedModel() && \"No scheduling machine model\""
+   , "/home/trippels/llvm/llvm/include/llvm/MC/MCSchedule.h", 213, __PRETTY_FUNCTION__))
+                                                                ;
+
+    
+   ((
+   ProcResourceIdx < NumProcResourceKinds && "bad proc resource idx"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "ProcResourceIdx < NumProcResourceKinds && \"bad proc resource idx\""
+   , "/home/trippels/llvm/llvm/include/llvm/MC/MCSchedule.h", 215, __PRETTY_FUNCTION__))
+                                                                            ;
+    return &ProcResourceTable[ProcResourceIdx];
+  }
+
+  const MCSchedClassDesc *getSchedClassDesc(unsigned SchedClassIdx) const {
+    
+   ((
+   hasInstrSchedModel() && "No scheduling machine model"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "hasInstrSchedModel() && \"No scheduling machine model\""
+   , "/home/trippels/llvm/llvm/include/llvm/MC/MCSchedule.h", 220, __PRETTY_FUNCTION__))
+                                                                ;
+
+    
+   ((
+   SchedClassIdx < NumSchedClasses && "bad scheduling class idx"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "SchedClassIdx < NumSchedClasses && \"bad scheduling class idx\""
+   , "/home/trippels/llvm/llvm/include/llvm/MC/MCSchedule.h", 222, __PRETTY_FUNCTION__))
+                                                                        ;
+    return &SchedClassTable[SchedClassIdx];
+  }
+
+
+  static const MCSchedModel &GetDefaultSchedModel() { return Default; }
+  static const MCSchedModel Default;
+};
+
+}
+
+
+namespace llvm {
+struct InstrStage {
+  enum ReservationKinds {
+    Required = 0,
+    Reserved = 1
+  };
+
+  unsigned Cycles_;
+  unsigned Units_;
+  int NextCycles_;
+  ReservationKinds Kind_;
+
+
+  unsigned getCycles() const {
+    return Cycles_;
+  }
+
+
+  unsigned getUnits() const {
+    return Units_;
+  }
+
+  ReservationKinds getReservationKind() const {
+    return Kind_;
+  }
+
+
+
+  unsigned getNextCycles() const {
+    return (NextCycles_ >= 0) ? (unsigned)NextCycles_ : Cycles_;
+  }
+};
+
+
+
+
+
+
+struct InstrItinerary {
+  int NumMicroOps;
+  unsigned FirstStage;
+  unsigned LastStage;
+  unsigned FirstOperandCycle;
+  unsigned LastOperandCycle;
+};
+
+
+
+
+class InstrItineraryData {
+public:
+  MCSchedModel SchedModel =
+      MCSchedModel::GetDefaultSchedModel();
+  const InstrStage *Stages = nullptr;
+  const unsigned *OperandCycles = nullptr;
+  const unsigned *Forwardings = nullptr;
+  const InstrItinerary *Itineraries =
+      nullptr;
+
+  InstrItineraryData() = default;
+  InstrItineraryData(const MCSchedModel &SM, const InstrStage *S,
+                     const unsigned *OS, const unsigned *F)
+    : SchedModel(SM), Stages(S), OperandCycles(OS), Forwardings(F),
+      Itineraries(SchedModel.InstrItineraries) {}
+
+
+  bool isEmpty() const { return Itineraries == nullptr; }
+
+
+  bool isEndMarker(unsigned ItinClassIndx) const {
+    return ((Itineraries[ItinClassIndx].FirstStage == ~0U) &&
+            (Itineraries[ItinClassIndx].LastStage == ~0U));
+  }
+
+
+  const InstrStage *beginStage(unsigned ItinClassIndx) const {
+    unsigned StageIdx = Itineraries[ItinClassIndx].FirstStage;
+    return Stages + StageIdx;
+  }
+
+
+  const InstrStage *endStage(unsigned ItinClassIndx) const {
+    unsigned StageIdx = Itineraries[ItinClassIndx].LastStage;
+    return Stages + StageIdx;
+  }
+
+
+
+
+  unsigned getStageLatency(unsigned ItinClassIndx) const {
+
+
+    if (isEmpty())
+      return 1;
+
+
+    unsigned Latency = 0, StartCycle = 0;
+    for (const InstrStage *IS = beginStage(ItinClassIndx),
+           *E = endStage(ItinClassIndx); IS != E; ++IS) {
+      Latency = std::max(Latency, StartCycle + IS->getCycles());
+      StartCycle += IS->getNextCycles();
+    }
+    return Latency;
+  }
+
+
+
+  int getOperandCycle(unsigned ItinClassIndx, unsigned OperandIdx) const {
+    if (isEmpty())
+      return -1;
+
+    unsigned FirstIdx = Itineraries[ItinClassIndx].FirstOperandCycle;
+    unsigned LastIdx = Itineraries[ItinClassIndx].LastOperandCycle;
+    if ((FirstIdx + OperandIdx) >= LastIdx)
+      return -1;
+
+    return (int)OperandCycles[FirstIdx + OperandIdx];
+  }
+
+
+
+
+
+
+  bool hasPipelineForwarding(unsigned DefClass, unsigned DefIdx,
+                             unsigned UseClass, unsigned UseIdx) const {
+    unsigned FirstDefIdx = Itineraries[DefClass].FirstOperandCycle;
+    unsigned LastDefIdx = Itineraries[DefClass].LastOperandCycle;
+    if ((FirstDefIdx + DefIdx) >= LastDefIdx)
+      return false;
+    if (Forwardings[FirstDefIdx + DefIdx] == 0)
+      return false;
+
+    unsigned FirstUseIdx = Itineraries[UseClass].FirstOperandCycle;
+    unsigned LastUseIdx = Itineraries[UseClass].LastOperandCycle;
+    if ((FirstUseIdx + UseIdx) >= LastUseIdx)
+      return false;
+
+    return Forwardings[FirstDefIdx + DefIdx] ==
+      Forwardings[FirstUseIdx + UseIdx];
+  }
+
+
+
+
+  int getOperandLatency(unsigned DefClass, unsigned DefIdx,
+                        unsigned UseClass, unsigned UseIdx) const {
+    if (isEmpty())
+      return -1;
+
+    int DefCycle = getOperandCycle(DefClass, DefIdx);
+    if (DefCycle == -1)
+      return -1;
+
+    int UseCycle = getOperandCycle(UseClass, UseIdx);
+    if (UseCycle == -1)
+      return -1;
+
+    UseCycle = DefCycle - UseCycle + 1;
+    if (UseCycle > 0 &&
+        hasPipelineForwarding(DefClass, DefIdx, UseClass, UseIdx))
+
+      --UseCycle;
+    return UseCycle;
+  }
+
+
+
+  int getNumMicroOps(unsigned ItinClassIndx) const {
+    if (isEmpty())
+      return 1;
+    return Itineraries[ItinClassIndx].NumMicroOps;
+  }
+};
+
+}
+
+namespace llvm {
+
+template <typename T> class ArrayRef;
+class raw_ostream;
+class Triple;
+
+const unsigned MAX_SUBTARGET_FEATURES = 192;
+
+
+
+class FeatureBitset : public std::bitset<MAX_SUBTARGET_FEATURES> {
+public:
+
+  FeatureBitset() = default;
+
+  FeatureBitset(const bitset<MAX_SUBTARGET_FEATURES>& B) : bitset(B) {}
+
+  FeatureBitset(std::initializer_list<unsigned> Init) {
+    for (auto I : Init)
+      set(I);
+  }
+};
+
+
+
+
+struct SubtargetFeatureKV {
+  const char *Key;
+  const char *Desc;
+  FeatureBitset Value;
+  FeatureBitset Implies;
+
+
+  bool operator<(StringRef S) const {
+    return StringRef(Key) < S;
+  }
+
+
+  bool operator<(const SubtargetFeatureKV &Other) const {
+    return StringRef(Key) < StringRef(Other.Key);
+  }
+};
+
+
+
+
+struct SubtargetInfoKV {
+  const char *Key;
+  const void *Value;
+
+
+  bool operator<(StringRef S) const {
+    return StringRef(Key) < S;
+  }
+};
+class SubtargetFeatures {
+  std::vector<std::string> Features;
+
+public:
+  explicit SubtargetFeatures(StringRef Initial = "");
+
+
+  std::string getString() const;
+
+
+  void AddFeature(StringRef String, bool Enable = true);
+
+
+  static void ToggleFeature(FeatureBitset &Bits, StringRef String,
+                            ArrayRef<SubtargetFeatureKV> FeatureTable);
+
+
+  static void ApplyFeatureFlag(FeatureBitset &Bits, StringRef Feature,
+                               ArrayRef<SubtargetFeatureKV> FeatureTable);
+
+
+  FeatureBitset getFeatureBits(StringRef CPU,
+                               ArrayRef<SubtargetFeatureKV> CPUTable,
+                               ArrayRef<SubtargetFeatureKV> FeatureTable);
+
+
+  const std::vector<std::string> &getFeatures() const { return Features; }
+
+
+  void print(raw_ostream &OS) const;
+
+
+  void dump() const;
+
+
+  void getDefaultSubtargetFeatures(const Triple& Triple);
+};
+
+}
+
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+namespace llvm {
+
+class MachineInstr;
+class MCInst;
+
+
+
+
+
+class MCSubtargetInfo {
+  Triple TargetTriple;
+  std::string CPU;
+  ArrayRef<SubtargetFeatureKV> ProcFeatures;
+  ArrayRef<SubtargetFeatureKV> ProcDesc;
+
+
+  const SubtargetInfoKV *ProcSchedModels;
+  const MCWriteProcResEntry *WriteProcResTable;
+  const MCWriteLatencyEntry *WriteLatencyTable;
+  const MCReadAdvanceEntry *ReadAdvanceTable;
+  const MCSchedModel *CPUSchedModel;
+
+  const InstrStage *Stages;
+  const unsigned *OperandCycles;
+  const unsigned *ForwardingPaths;
+  FeatureBitset FeatureBits;
+
+public:
+  MCSubtargetInfo(const MCSubtargetInfo &) = default;
+  MCSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS,
+                  ArrayRef<SubtargetFeatureKV> PF,
+                  ArrayRef<SubtargetFeatureKV> PD,
+                  const SubtargetInfoKV *ProcSched,
+                  const MCWriteProcResEntry *WPR, const MCWriteLatencyEntry *WL,
+                  const MCReadAdvanceEntry *RA, const InstrStage *IS,
+                  const unsigned *OC, const unsigned *FP);
+  MCSubtargetInfo() = delete;
+  MCSubtargetInfo &operator=(const MCSubtargetInfo &) = delete;
+  MCSubtargetInfo &operator=(MCSubtargetInfo &&) = delete;
+  virtual ~MCSubtargetInfo() = default;
+
+
+  const Triple &getTargetTriple() const { return TargetTriple; }
+
+
+  StringRef getCPU() const {
+    return CPU;
+  }
+
+
+
+  const FeatureBitset& getFeatureBits() const {
+    return FeatureBits;
+  }
+
+
+
+  void setFeatureBits(const FeatureBitset &FeatureBits_) {
+    FeatureBits = FeatureBits_;
+  }
+
+  bool hasFeature(unsigned Feature) const {
+    return FeatureBits[Feature];
+  }
+
+protected:
+
+
+
+
+  void InitMCProcessorInfo(StringRef CPU, StringRef FS);
+
+public:
+
+
+  void setDefaultFeatures(StringRef CPU, StringRef FS);
+
+
+
+  FeatureBitset ToggleFeature(uint64_t FB);
+
+
+
+  FeatureBitset ToggleFeature(const FeatureBitset& FB);
+
+
+
+  FeatureBitset ToggleFeature(StringRef FS);
+
+
+
+  FeatureBitset ApplyFeatureFlag(StringRef FS);
+
+
+
+  bool checkFeatures(StringRef FS) const;
+
+
+
+  const MCSchedModel &getSchedModelForCPU(StringRef CPU) const;
+
+
+  const MCSchedModel &getSchedModel() const { return *CPUSchedModel; }
+
+
+
+  const MCWriteProcResEntry *getWriteProcResBegin(
+    const MCSchedClassDesc *SC) const {
+    return &WriteProcResTable[SC->WriteProcResIdx];
+  }
+  const MCWriteProcResEntry *getWriteProcResEnd(
+    const MCSchedClassDesc *SC) const {
+    return getWriteProcResBegin(SC) + SC->NumWriteProcResEntries;
+  }
+
+  const MCWriteLatencyEntry *getWriteLatencyEntry(const MCSchedClassDesc *SC,
+                                                  unsigned DefIdx) const {
+    
+   ((
+   DefIdx < SC->NumWriteLatencyEntries && "MachineModel does not specify a WriteResource for DefIdx"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "DefIdx < SC->NumWriteLatencyEntries && \"MachineModel does not specify a WriteResource for DefIdx\""
+   ,
+                                                                     "/home/trippels/llvm/llvm/include/llvm/MC/MCSubtargetInfo.h"
+    ,
+                                                                     146
+    , __PRETTY_FUNCTION__))
+                                                                      
+                                                                     ;
+
+    return &WriteLatencyTable[SC->WriteLatencyIdx + DefIdx];
+  }
+
+  int getReadAdvanceCycles(const MCSchedClassDesc *SC, unsigned UseIdx,
+                           unsigned WriteResID) const {
+
+
+
+    for (const MCReadAdvanceEntry *I = &ReadAdvanceTable[SC->ReadAdvanceIdx],
+           *E = I + SC->NumReadAdvanceEntries; I != E; ++I) {
+      if (I->UseIdx < UseIdx)
+        continue;
+      if (I->UseIdx > UseIdx)
+        break;
+
+      if (!I->WriteResourceID || I->WriteResourceID == WriteResID) {
+        return I->Cycles;
+      }
+    }
+    return 0;
+  }
+
+
+
+  InstrItineraryData getInstrItineraryForCPU(StringRef CPU) const;
+
+
+  void initInstrItins(InstrItineraryData &InstrItins) const;
+
+
+  bool isCPUStringValid(StringRef CPU) const {
+    auto Found = std::lower_bound(ProcDesc.begin(), ProcDesc.end(), CPU);
+    return Found != ProcDesc.end() && StringRef(Found->Key) == CPU;
+  }
+
+
+  virtual std::string getSchedInfoStr(const MachineInstr &MI) const {
+    return {};
+  }
+
+  virtual std::string getSchedInfoStr(MCInst const &MCI) const {
+    return {};
+  }
+};
+
+}
+
+
+
+
+
+namespace llvm {
+
+class CallLowering;
+class InstrItineraryData;
+struct InstrStage;
+class InstructionSelector;
+class LegalizerInfo;
+class MachineInstr;
+struct MachineSchedPolicy;
+struct MCReadAdvanceEntry;
+struct MCWriteLatencyEntry;
+struct MCWriteProcResEntry;
+class RegisterBankInfo;
+class SDep;
+class SelectionDAGTargetInfo;
+struct SubtargetFeatureKV;
+struct SubtargetInfoKV;
+class SUnit;
+class TargetFrameLowering;
+class TargetInstrInfo;
+class TargetLowering;
+class TargetRegisterClass;
+class TargetRegisterInfo;
+class TargetSchedModel;
+class Triple;
+
+
+
+
+
+
+
+class TargetSubtargetInfo : public MCSubtargetInfo {
+protected:
+  TargetSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS,
+                      ArrayRef<SubtargetFeatureKV> PF,
+                      ArrayRef<SubtargetFeatureKV> PD,
+                      const SubtargetInfoKV *ProcSched,
+                      const MCWriteProcResEntry *WPR,
+                      const MCWriteLatencyEntry *WL,
+                      const MCReadAdvanceEntry *RA, const InstrStage *IS,
+                      const unsigned *OC, const unsigned *FP);
+
+public:
+
+
+  using AntiDepBreakMode = enum { ANTIDEP_NONE, ANTIDEP_CRITICAL, ANTIDEP_ALL };
+  using RegClassVector = SmallVectorImpl<const TargetRegisterClass *>;
+
+  TargetSubtargetInfo() = delete;
+  TargetSubtargetInfo(const TargetSubtargetInfo &) = delete;
+  TargetSubtargetInfo &operator=(const TargetSubtargetInfo &) = delete;
+  ~TargetSubtargetInfo() override;
+
+  virtual bool isXRaySupported() const { return false; }
+  virtual const TargetInstrInfo *getInstrInfo() const { return nullptr; }
+  virtual const TargetFrameLowering *getFrameLowering() const {
+    return nullptr;
+  }
+  virtual const TargetLowering *getTargetLowering() const { return nullptr; }
+  virtual const SelectionDAGTargetInfo *getSelectionDAGInfo() const {
+    return nullptr;
+  }
+  virtual const CallLowering *getCallLowering() const { return nullptr; }
+
+
+
+
+
+  virtual const InstructionSelector *getInstructionSelector() const {
+    return nullptr;
+  }
+
+  virtual unsigned getHwMode() const { return 0; }
+
+
+  virtual RegisterScheduler::FunctionPassCtor
+      getDAGScheduler(CodeGenOpt::Level) const {
+    return nullptr;
+  }
+
+  virtual const LegalizerInfo *getLegalizerInfo() const { return nullptr; }
+
+
+
+  virtual const TargetRegisterInfo *getRegisterInfo() const { return nullptr; }
+
+
+
+  virtual const RegisterBankInfo *getRegBankInfo() const { return nullptr; }
+
+
+
+  virtual const InstrItineraryData *getInstrItineraryData() const {
+    return nullptr;
+  }
+
+
+
+
+
+  virtual unsigned resolveSchedClass(unsigned SchedClass,
+                                     const MachineInstr *MI,
+                                     const TargetSchedModel *SchedModel) const {
+    return 0;
+  }
+
+
+
+
+
+
+
+  virtual bool enableMachineScheduler() const;
+
+
+  virtual bool supportPrintSchedInfo() const { return false; }
+
+
+
+  virtual bool enableMachineSchedDefaultSched() const { return true; }
+
+
+
+
+
+  virtual bool enableJoinGlobalCopies() const;
+
+
+
+
+
+  virtual bool enablePostRAScheduler() const;
+
+
+  virtual bool enableAtomicExpand() const;
+
+
+
+
+
+
+  virtual void overrideSchedPolicy(MachineSchedPolicy &Policy,
+                                   unsigned NumRegionInstrs) const {}
+
+
+
+  virtual void adjustSchedDependency(SUnit *def, SUnit *use, SDep &dep) const {}
+
+
+
+  virtual AntiDepBreakMode getAntiDepBreakMode() const { return ANTIDEP_NONE; }
+
+
+
+
+  virtual void getCriticalPathRCs(RegClassVector &CriticalPathRCs) const {
+    return CriticalPathRCs.clear();
+  }
+
+
+
+  virtual void getPostRAMutations(
+      std::vector<std::unique_ptr<ScheduleDAGMutation>> &Mutations) const {
+  }
+
+
+
+  virtual void getSMSMutations(
+      std::vector<std::unique_ptr<ScheduleDAGMutation>> &Mutations) const {
+  }
+
+
+
+  virtual CodeGenOpt::Level getOptLevelToEnablePostRAScheduler() const {
+    return CodeGenOpt::Default;
+  }
+
+
+
+
+
+  virtual bool enableRALocalReassignment(CodeGenOpt::Level OptLevel) const;
+
+
+
+
+  virtual bool enableAdvancedRASplitCost() const;
+
+
+
+  virtual bool useAA() const;
+
+
+  virtual bool enableEarlyIfConversion() const { return false; }
+
+
+
+
+  virtual std::unique_ptr<PBQPRAConstraint> getCustomPBQPConstraints() const {
+    return nullptr;
+  }
+
+
+
+
+  virtual bool enableSubRegLiveness() const { return false; }
+
+
+  std::string getSchedInfoStr(const MachineInstr &MI) const override;
+  std::string getSchedInfoStr(MCInst const &MCI) const override;
+};
+
+}
+       
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+
+namespace llvm {
+
+class Function;
+class GlobalValue;
+class LLVMContext;
+class ScalarEvolution;
+class SCEV;
+class TargetMachine;
+
+extern cl::opt<unsigned> PartialUnrollingThreshold;
+template <typename T>
+class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
+private:
+  using BaseT = TargetTransformInfoImplCRTPBase<T>;
+  using TTI = TargetTransformInfo;
+
+
+
+  unsigned getPermuteShuffleOverhead(Type *Ty) {
+    
+   ((
+   Ty->isVectorTy() && "Can only shuffle vectors"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Ty->isVectorTy() && \"Can only shuffle vectors\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/BasicTTIImpl.h", 86, __PRETTY_FUNCTION__))
+                                                         ;
+    unsigned Cost = 0;
+
+
+
+
+
+
+
+    for (int i = 0, e = Ty->getVectorNumElements(); i < e; ++i) {
+      Cost += static_cast<T *>(this)
+                  ->getVectorInstrCost(Instruction::InsertElement, Ty, i);
+      Cost += static_cast<T *>(this)
+                  ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
+    }
+    return Cost;
+  }
+
+
+  const TargetSubtargetInfo *getST() const {
+    return static_cast<const T *>(this)->getST();
+  }
+
+
+  const TargetLoweringBase *getTLI() const {
+    return static_cast<const T *>(this)->getTLI();
+  }
+
+protected:
+  explicit BasicTTIImplBase(const TargetMachine *TM, const DataLayout &DL)
+      : BaseT(DL) {}
+
+  using TargetTransformInfoImplBase::DL;
+
+public:
+
+
+  bool allowsMisalignedMemoryAccesses(LLVMContext &Context,
+                                      unsigned BitWidth, unsigned AddressSpace,
+                                      unsigned Alignment, bool *Fast) const {
+    EVT E = EVT::getIntegerVT(Context, BitWidth);
+    return getTLI()->allowsMisalignedMemoryAccesses(E, AddressSpace, Alignment, Fast);
+  }
+
+  bool hasBranchDivergence() { return false; }
+
+  bool isSourceOfDivergence(const Value *V) { return false; }
+
+  bool isAlwaysUniform(const Value *V) { return false; }
+
+  unsigned getFlatAddressSpace() {
+
+    return -1;
+  }
+
+  bool isLegalAddImmediate(int64_t imm) {
+    return getTLI()->isLegalAddImmediate(imm);
+  }
+
+  bool isLegalICmpImmediate(int64_t imm) {
+    return getTLI()->isLegalICmpImmediate(imm);
+  }
+
+  bool isLegalAddressingMode(Type *Ty, GlobalValue *BaseGV, int64_t BaseOffset,
+                             bool HasBaseReg, int64_t Scale,
+                             unsigned AddrSpace, Instruction *I = nullptr) {
+    TargetLoweringBase::AddrMode AM;
+    AM.BaseGV = BaseGV;
+    AM.BaseOffs = BaseOffset;
+    AM.HasBaseReg = HasBaseReg;
+    AM.Scale = Scale;
+    return getTLI()->isLegalAddressingMode(DL, AM, Ty, AddrSpace, I);
+  }
+
+  bool isLSRCostLess(TTI::LSRCost C1, TTI::LSRCost C2) {
+    return TargetTransformInfoImplBase::isLSRCostLess(C1, C2);
+  }
+
+  int getScalingFactorCost(Type *Ty, GlobalValue *BaseGV, int64_t BaseOffset,
+                           bool HasBaseReg, int64_t Scale, unsigned AddrSpace) {
+    TargetLoweringBase::AddrMode AM;
+    AM.BaseGV = BaseGV;
+    AM.BaseOffs = BaseOffset;
+    AM.HasBaseReg = HasBaseReg;
+    AM.Scale = Scale;
+    return getTLI()->getScalingFactorCost(DL, AM, Ty, AddrSpace);
+  }
+
+  bool isTruncateFree(Type *Ty1, Type *Ty2) {
+    return getTLI()->isTruncateFree(Ty1, Ty2);
+  }
+
+  bool isProfitableToHoist(Instruction *I) {
+    return getTLI()->isProfitableToHoist(I);
+  }
+
+  bool isTypeLegal(Type *Ty) {
+    EVT VT = getTLI()->getValueType(DL, Ty);
+    return getTLI()->isTypeLegal(VT);
+  }
+
+  int getGEPCost(Type *PointeeType, const Value *Ptr,
+                 ArrayRef<const Value *> Operands) {
+    return BaseT::getGEPCost(PointeeType, Ptr, Operands);
+  }
+
+  int getExtCost(const Instruction *I, const Value *Src) {
+    if (getTLI()->isExtFree(I))
+      return TargetTransformInfo::TCC_Free;
+
+    if (isa<ZExtInst>(I) || isa<SExtInst>(I))
+      if (const LoadInst *LI = dyn_cast<LoadInst>(Src))
+        if (getTLI()->isExtLoad(LI, I, DL))
+          return TargetTransformInfo::TCC_Free;
+
+    return TargetTransformInfo::TCC_Basic;
+  }
+
+  unsigned getIntrinsicCost(Intrinsic::ID IID, Type *RetTy,
+                            ArrayRef<const Value *> Arguments) {
+    return BaseT::getIntrinsicCost(IID, RetTy, Arguments);
+  }
+
+  unsigned getIntrinsicCost(Intrinsic::ID IID, Type *RetTy,
+                            ArrayRef<Type *> ParamTys) {
+    if (IID == Intrinsic::cttz) {
+      if (getTLI()->isCheapToSpeculateCttz())
+        return TargetTransformInfo::TCC_Basic;
+      return TargetTransformInfo::TCC_Expensive;
+    }
+
+    if (IID == Intrinsic::ctlz) {
+      if (getTLI()->isCheapToSpeculateCtlz())
+        return TargetTransformInfo::TCC_Basic;
+      return TargetTransformInfo::TCC_Expensive;
+    }
+
+    return BaseT::getIntrinsicCost(IID, RetTy, ParamTys);
+  }
+
+  unsigned getEstimatedNumberOfCaseClusters(const SwitchInst &SI,
+                                            unsigned &JumpTableSize) {
+
+
+
+
+
+
+
+    unsigned N = SI.getNumCases();
+    const TargetLoweringBase *TLI = getTLI();
+    const DataLayout &DL = this->getDataLayout();
+
+    JumpTableSize = 0;
+    bool IsJTAllowed = TLI->areJTsAllowed(SI.getParent()->getParent());
+
+
+    if (N < 1 || (!IsJTAllowed && DL.getPointerSizeInBits() < N))
+      return N;
+
+    APInt MaxCaseVal = SI.case_begin()->getCaseValue()->getValue();
+    APInt MinCaseVal = MaxCaseVal;
+    for (auto CI : SI.cases()) {
+      const APInt &CaseVal = CI.getCaseValue()->getValue();
+      if (CaseVal.sgt(MaxCaseVal))
+        MaxCaseVal = CaseVal;
+      if (CaseVal.slt(MinCaseVal))
+        MinCaseVal = CaseVal;
+    }
+
+
+    if (N <= DL.getPointerSizeInBits()) {
+      SmallPtrSet<const BasicBlock *, 4> Dests;
+      for (auto I : SI.cases())
+        Dests.insert(I.getCaseSuccessor());
+
+      if (TLI->isSuitableForBitTests(Dests.size(), N, MinCaseVal, MaxCaseVal,
+                                     DL))
+        return 1;
+    }
+
+
+    if (IsJTAllowed) {
+      if (N < 2 || N < TLI->getMinimumJumpTableEntries())
+        return N;
+      uint64_t Range =
+          (MaxCaseVal - MinCaseVal)
+              .getLimitedValue(std::numeric_limits<uint64_t>::max() - 1) + 1;
+
+      if (TLI->isSuitableForJumpTable(&SI, N, Range)) {
+        JumpTableSize = Range;
+        return 1;
+      }
+    }
+    return N;
+  }
+
+  unsigned getJumpBufAlignment() { return getTLI()->getJumpBufAlignment(); }
+
+  unsigned getJumpBufSize() { return getTLI()->getJumpBufSize(); }
+
+  bool shouldBuildLookupTables() {
+    const TargetLoweringBase *TLI = getTLI();
+    return TLI->isOperationLegalOrCustom(ISD::BR_JT, MVT::Other) ||
+           TLI->isOperationLegalOrCustom(ISD::BRIND, MVT::Other);
+  }
+
+  bool haveFastSqrt(Type *Ty) {
+    const TargetLoweringBase *TLI = getTLI();
+    EVT VT = TLI->getValueType(DL, Ty);
+    return TLI->isTypeLegal(VT) &&
+           TLI->isOperationLegalOrCustom(ISD::FSQRT, VT);
+  }
+
+  bool isFCmpOrdCheaperThanFCmpZero(Type *Ty) {
+    return true;
+  }
+
+  unsigned getFPOpCost(Type *Ty) {
+
+
+    const TargetLoweringBase *TLI = getTLI();
+    EVT VT = TLI->getValueType(DL, Ty);
+    if (TLI->isOperationLegalOrCustomOrPromote(ISD::FADD, VT))
+      return TargetTransformInfo::TCC_Basic;
+    return TargetTransformInfo::TCC_Expensive;
+  }
+
+  unsigned getOperationCost(unsigned Opcode, Type *Ty, Type *OpTy) {
+    const TargetLoweringBase *TLI = getTLI();
+    switch (Opcode) {
+    default: break;
+    case Instruction::Trunc:
+      if (TLI->isTruncateFree(OpTy, Ty))
+        return TargetTransformInfo::TCC_Free;
+      return TargetTransformInfo::TCC_Basic;
+    case Instruction::ZExt:
+      if (TLI->isZExtFree(OpTy, Ty))
+        return TargetTransformInfo::TCC_Free;
+      return TargetTransformInfo::TCC_Basic;
+    }
+
+    return BaseT::getOperationCost(Opcode, Ty, OpTy);
+  }
+
+  unsigned getInliningThresholdMultiplier() { return 1; }
+
+  void getUnrollingPreferences(Loop *L, ScalarEvolution &SE,
+                               TTI::UnrollingPreferences &UP) {
+    unsigned MaxOps;
+    const TargetSubtargetInfo *ST = getST();
+    if (PartialUnrollingThreshold.getNumOccurrences() > 0)
+      MaxOps = PartialUnrollingThreshold;
+    else if (ST->getSchedModel().LoopMicroOpBufferSize > 0)
+      MaxOps = ST->getSchedModel().LoopMicroOpBufferSize;
+    else
+      return;
+
+
+    for (Loop::block_iterator I = L->block_begin(), E = L->block_end(); I != E;
+         ++I) {
+      BasicBlock *BB = *I;
+
+      for (BasicBlock::iterator J = BB->begin(), JE = BB->end(); J != JE; ++J)
+        if (isa<CallInst>(J) || isa<InvokeInst>(J)) {
+          ImmutableCallSite CS(&*J);
+          if (const Function *F = CS.getCalledFunction()) {
+            if (!static_cast<T *>(this)->isLoweredToCall(F))
+              continue;
+          }
+
+          return;
+        }
+    }
+
+
+
+    UP.Partial = UP.Runtime = UP.UpperBound = true;
+    UP.PartialThreshold = MaxOps;
+
+
+    UP.OptSizeThreshold = 0;
+    UP.PartialOptSizeThreshold = 0;
+
+
+
+    UP.BEInsns = 2;
+  }
+
+  int getInstructionLatency(const Instruction *I) {
+    if (isa<LoadInst>(I))
+      return getST()->getSchedModel().DefaultLoadLatency;
+
+    return BaseT::getInstructionLatency(I);
+  }
+
+
+
+
+
+
+  unsigned getNumberOfRegisters(bool Vector) { return Vector ? 0 : 1; }
+
+  unsigned getRegisterBitWidth(bool Vector) const { return 32; }
+
+
+
+  unsigned getScalarizationOverhead(Type *Ty, bool Insert, bool Extract) {
+    
+   ((
+   Ty->isVectorTy() && "Can only scalarize vectors"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Ty->isVectorTy() && \"Can only scalarize vectors\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/BasicTTIImpl.h", 417, __PRETTY_FUNCTION__))
+                                                           ;
+    unsigned Cost = 0;
+
+    for (int i = 0, e = Ty->getVectorNumElements(); i < e; ++i) {
+      if (Insert)
+        Cost += static_cast<T *>(this)
+                    ->getVectorInstrCost(Instruction::InsertElement, Ty, i);
+      if (Extract)
+        Cost += static_cast<T *>(this)
+                    ->getVectorInstrCost(Instruction::ExtractElement, Ty, i);
+    }
+
+    return Cost;
+  }
+
+
+
+
+  unsigned getOperandsScalarizationOverhead(ArrayRef<const Value *> Args,
+                                            unsigned VF) {
+    unsigned Cost = 0;
+    SmallPtrSet<const Value*, 4> UniqueOperands;
+    for (const Value *A : Args) {
+      if (!isa<Constant>(A) && UniqueOperands.insert(A).second) {
+        Type *VecTy = nullptr;
+        if (A->getType()->isVectorTy()) {
+          VecTy = A->getType();
+
+          
+         ((
+         (VF == 1 || VF == VecTy->getVectorNumElements()) && "Vector argument does not match VF"
+         ) ? static_cast<void> (0) : __assert_fail (
+         "(VF == 1 || VF == VecTy->getVectorNumElements()) && \"Vector argument does not match VF\""
+         ,
+                                                    "/home/trippels/llvm/llvm/include/llvm/CodeGen/BasicTTIImpl.h"
+          ,
+                                                    446
+          , __PRETTY_FUNCTION__))
+                                                     
+                                                    ;
+        }
+        else
+          VecTy = VectorType::get(A->getType(), VF);
+
+        Cost += getScalarizationOverhead(VecTy, false, true);
+      }
+    }
+
+    return Cost;
+  }
+
+  unsigned getScalarizationOverhead(Type *VecTy, ArrayRef<const Value *> Args) {
+    
+   ((
+   VecTy->isVectorTy()
+   ) ? static_cast<void> (0) : __assert_fail (
+   "VecTy->isVectorTy()"
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/BasicTTIImpl.h", 459, __PRETTY_FUNCTION__))
+                              ;
+
+    unsigned Cost = 0;
+
+    Cost += getScalarizationOverhead(VecTy, true, false);
+    if (!Args.empty())
+      Cost += getOperandsScalarizationOverhead(Args,
+                                               VecTy->getVectorNumElements());
+    else
+
+
+      Cost += getScalarizationOverhead(VecTy, false, true);
+
+    return Cost;
+  }
+
+  unsigned getMaxInterleaveFactor(unsigned VF) { return 1; }
+
+  unsigned getArithmeticInstrCost(
+      unsigned Opcode, Type *Ty,
+      TTI::OperandValueKind Opd1Info = TTI::OK_AnyValue,
+      TTI::OperandValueKind Opd2Info = TTI::OK_AnyValue,
+      TTI::OperandValueProperties Opd1PropInfo = TTI::OP_None,
+      TTI::OperandValueProperties Opd2PropInfo = TTI::OP_None,
+      ArrayRef<const Value *> Args = ArrayRef<const Value *>()) {
+
+    const TargetLoweringBase *TLI = getTLI();
+    int ISD = TLI->InstructionOpcodeToISD(Opcode);
+    
+   ((
+   ISD && "Invalid opcode"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "ISD && \"Invalid opcode\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/BasicTTIImpl.h", 487, __PRETTY_FUNCTION__))
+                                  ;
+
+    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, Ty);
+
+    bool IsFloat = Ty->isFPOrFPVectorTy();
+
+
+    unsigned OpCost = (IsFloat ? 2 : 1);
+
+    if (TLI->isOperationLegalOrPromote(ISD, LT.second)) {
+
+
+      return LT.first * OpCost;
+    }
+
+    if (!TLI->isOperationExpand(ISD, LT.second)) {
+
+
+      return LT.first * 2 * OpCost;
+    }
+
+
+
+
+    if (Ty->isVectorTy()) {
+      unsigned Num = Ty->getVectorNumElements();
+      unsigned Cost = static_cast<T *>(this)
+                          ->getArithmeticInstrCost(Opcode, Ty->getScalarType());
+
+
+      return getScalarizationOverhead(Ty, Args) + Num * Cost;
+    }
+
+
+    return OpCost;
+  }
+
+  unsigned getShuffleCost(TTI::ShuffleKind Kind, Type *Tp, int Index,
+                          Type *SubTp) {
+    if (Kind == TTI::SK_Alternate || Kind == TTI::SK_PermuteTwoSrc ||
+        Kind == TTI::SK_PermuteSingleSrc) {
+      return getPermuteShuffleOverhead(Tp);
+    }
+    return 1;
+  }
+
+  unsigned getCastInstrCost(unsigned Opcode, Type *Dst, Type *Src,
+                            const Instruction *I = nullptr) {
+    const TargetLoweringBase *TLI = getTLI();
+    int ISD = TLI->InstructionOpcodeToISD(Opcode);
+    
+   ((
+   ISD && "Invalid opcode"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "ISD && \"Invalid opcode\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/BasicTTIImpl.h", 537, __PRETTY_FUNCTION__))
+                                  ;
+    std::pair<unsigned, MVT> SrcLT = TLI->getTypeLegalizationCost(DL, Src);
+    std::pair<unsigned, MVT> DstLT = TLI->getTypeLegalizationCost(DL, Dst);
+
+
+    if (SrcLT.first == DstLT.first &&
+        SrcLT.second.getSizeInBits() == DstLT.second.getSizeInBits()) {
+
+
+      if (Opcode == Instruction::BitCast || Opcode == Instruction::Trunc)
+        return 0;
+    }
+
+    if (Opcode == Instruction::Trunc &&
+        TLI->isTruncateFree(SrcLT.second, DstLT.second))
+      return 0;
+
+    if (Opcode == Instruction::ZExt &&
+        TLI->isZExtFree(SrcLT.second, DstLT.second))
+      return 0;
+
+    if (Opcode == Instruction::AddrSpaceCast &&
+        TLI->isNoopAddrSpaceCast(Src->getPointerAddressSpace(),
+                                 Dst->getPointerAddressSpace()))
+      return 0;
+
+
+
+    if ((Opcode == Instruction::ZExt || Opcode == Instruction::SExt) &&
+        I && isa<LoadInst>(I->getOperand(0))) {
+        EVT ExtVT = EVT::getEVT(Dst);
+        EVT LoadVT = EVT::getEVT(Src);
+        unsigned LType =
+          ((Opcode == Instruction::ZExt) ? ISD::ZEXTLOAD : ISD::SEXTLOAD);
+        if (TLI->isLoadExtLegal(LType, ExtVT, LoadVT))
+          return 0;
+    }
+
+
+    if (SrcLT.first == DstLT.first &&
+        TLI->isOperationLegalOrPromote(ISD, DstLT.second))
+      return 1;
+
+
+    if (!Src->isVectorTy() && !Dst->isVectorTy()) {
+
+      if (Opcode == Instruction::BitCast)
+        return 0;
+
+
+
+      if (!TLI->isOperationExpand(ISD, DstLT.second))
+        return 1;
+
+
+      return 4;
+    }
+
+
+    if (Dst->isVectorTy() && Src->isVectorTy()) {
+
+      if (SrcLT.first == DstLT.first &&
+          SrcLT.second.getSizeInBits() == DstLT.second.getSizeInBits()) {
+
+
+        if (Opcode == Instruction::ZExt)
+          return 1;
+
+
+        if (Opcode == Instruction::SExt)
+          return 2;
+
+
+
+
+        if (!TLI->isOperationExpand(ISD, DstLT.second))
+          return SrcLT.first * 1;
+      }
+
+
+
+
+
+      if ((TLI->getTypeAction(Src->getContext(), TLI->getValueType(DL, Src)) ==
+           TargetLowering::TypeSplitVector) ||
+          (TLI->getTypeAction(Dst->getContext(), TLI->getValueType(DL, Dst)) ==
+           TargetLowering::TypeSplitVector)) {
+        Type *SplitDst = VectorType::get(Dst->getVectorElementType(),
+                                         Dst->getVectorNumElements() / 2);
+        Type *SplitSrc = VectorType::get(Src->getVectorElementType(),
+                                         Src->getVectorNumElements() / 2);
+        T *TTI = static_cast<T *>(this);
+        return TTI->getVectorSplitCost() +
+               (2 * TTI->getCastInstrCost(Opcode, SplitDst, SplitSrc, I));
+      }
+
+
+
+      unsigned Num = Dst->getVectorNumElements();
+      unsigned Cost = static_cast<T *>(this)->getCastInstrCost(
+          Opcode, Dst->getScalarType(), Src->getScalarType(), I);
+
+
+
+      return getScalarizationOverhead(Dst, true, true) + Num * Cost;
+    }
+
+
+
+
+
+    if (Opcode == Instruction::BitCast)
+
+      return (Src->isVectorTy() ? getScalarizationOverhead(Src, false, true)
+                                : 0) +
+             (Dst->isVectorTy() ? getScalarizationOverhead(Dst, true, false)
+                                : 0);
+
+    ::llvm::llvm_unreachable_internal("Unhandled cast", "/home/trippels/llvm/llvm/include/llvm/CodeGen/BasicTTIImpl.h", 655);
+  }
+
+  unsigned getExtractWithExtendCost(unsigned Opcode, Type *Dst,
+                                    VectorType *VecTy, unsigned Index) {
+    return static_cast<T *>(this)->getVectorInstrCost(
+               Instruction::ExtractElement, VecTy, Index) +
+           static_cast<T *>(this)->getCastInstrCost(Opcode, Dst,
+                                                    VecTy->getElementType());
+  }
+
+  unsigned getCFInstrCost(unsigned Opcode) {
+
+    return 0;
+  }
+
+  unsigned getCmpSelInstrCost(unsigned Opcode, Type *ValTy, Type *CondTy,
+                              const Instruction *I) {
+    const TargetLoweringBase *TLI = getTLI();
+    int ISD = TLI->InstructionOpcodeToISD(Opcode);
+    
+   ((
+   ISD && "Invalid opcode"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "ISD && \"Invalid opcode\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/BasicTTIImpl.h", 675, __PRETTY_FUNCTION__))
+                                  ;
+
+
+    if (ISD == ISD::SELECT) {
+      
+     ((
+     CondTy && "CondTy must exist"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "CondTy && \"CondTy must exist\""
+     , "/home/trippels/llvm/llvm/include/llvm/CodeGen/BasicTTIImpl.h", 679, __PRETTY_FUNCTION__))
+                                          ;
+      if (CondTy->isVectorTy())
+        ISD = ISD::VSELECT;
+    }
+    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, ValTy);
+
+    if (!(ValTy->isVectorTy() && !LT.second.isVector()) &&
+        !TLI->isOperationExpand(ISD, LT.second)) {
+
+
+      return LT.first * 1;
+    }
+
+
+
+
+    if (ValTy->isVectorTy()) {
+      unsigned Num = ValTy->getVectorNumElements();
+      if (CondTy)
+        CondTy = CondTy->getScalarType();
+      unsigned Cost = static_cast<T *>(this)->getCmpSelInstrCost(
+          Opcode, ValTy->getScalarType(), CondTy, I);
+
+
+
+      return getScalarizationOverhead(ValTy, true, false) + Num * Cost;
+    }
+
+
+    return 1;
+  }
+
+  unsigned getVectorInstrCost(unsigned Opcode, Type *Val, unsigned Index) {
+    std::pair<unsigned, MVT> LT =
+        getTLI()->getTypeLegalizationCost(DL, Val->getScalarType());
+
+    return LT.first;
+  }
+
+  unsigned getMemoryOpCost(unsigned Opcode, Type *Src, unsigned Alignment,
+                       unsigned AddressSpace, const Instruction *I = nullptr) {
+    
+   ((
+   !Src->isVoidTy() && "Invalid type"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "!Src->isVoidTy() && \"Invalid type\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/BasicTTIImpl.h", 720, __PRETTY_FUNCTION__))
+                                             ;
+    std::pair<unsigned, MVT> LT = getTLI()->getTypeLegalizationCost(DL, Src);
+
+
+    unsigned Cost = LT.first;
+
+    if (Src->isVectorTy() &&
+        Src->getPrimitiveSizeInBits() < LT.second.getSizeInBits()) {
+
+
+
+      TargetLowering::LegalizeAction LA = TargetLowering::Expand;
+      EVT MemVT = getTLI()->getValueType(DL, Src);
+      if (Opcode == Instruction::Store)
+        LA = getTLI()->getTruncStoreAction(LT.second, MemVT);
+      else
+        LA = getTLI()->getLoadExtAction(ISD::EXTLOAD, LT.second, MemVT);
+
+      if (LA != TargetLowering::Legal && LA != TargetLowering::Custom) {
+
+
+        Cost += getScalarizationOverhead(Src, Opcode != Instruction::Store,
+                                         Opcode == Instruction::Store);
+      }
+    }
+
+    return Cost;
+  }
+
+  unsigned getInterleavedMemoryOpCost(unsigned Opcode, Type *VecTy,
+                                      unsigned Factor,
+                                      ArrayRef<unsigned> Indices,
+                                      unsigned Alignment,
+                                      unsigned AddressSpace) {
+    VectorType *VT = dyn_cast<VectorType>(VecTy);
+    
+   ((
+   VT && "Expect a vector type for interleaved memory op"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "VT && \"Expect a vector type for interleaved memory op\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/BasicTTIImpl.h", 755, __PRETTY_FUNCTION__))
+                                                                 ;
+
+    unsigned NumElts = VT->getNumElements();
+    
+   ((
+   Factor > 1 && NumElts % Factor == 0 && "Invalid interleave factor"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Factor > 1 && NumElts % Factor == 0 && \"Invalid interleave factor\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/BasicTTIImpl.h", 758, __PRETTY_FUNCTION__))
+                                                                             ;
+
+    unsigned NumSubElts = NumElts / Factor;
+    VectorType *SubVT = VectorType::get(VT->getElementType(), NumSubElts);
+
+
+    unsigned Cost = static_cast<T *>(this)->getMemoryOpCost(
+        Opcode, VecTy, Alignment, AddressSpace);
+
+
+
+    MVT VecTyLT = getTLI()->getTypeLegalizationCost(DL, VecTy).second;
+    unsigned VecTySize =
+        static_cast<T *>(this)->getDataLayout().getTypeStoreSize(VecTy);
+    unsigned VecTyLTSize = VecTyLT.getStoreSize();
+
+
+    auto ceil = [](unsigned A, unsigned B) { return (A + B - 1) / B; };
+    if (Opcode == Instruction::Load && VecTySize > VecTyLTSize) {
+
+
+      unsigned NumLegalInsts = ceil(VecTySize, VecTyLTSize);
+
+
+
+      unsigned NumEltsPerLegalInst = ceil(NumElts, NumLegalInsts);
+
+
+      BitVector UsedInsts(NumLegalInsts, false);
+      for (unsigned Index : Indices)
+        for (unsigned Elt = 0; Elt < NumSubElts; ++Elt)
+          UsedInsts.set((Index + Elt * Factor) / NumEltsPerLegalInst);
+
+
+
+      Cost *= UsedInsts.count() / NumLegalInsts;
+    }
+
+
+    if (Opcode == Instruction::Load) {
+      
+     ((
+     Indices.size() <= Factor && "Interleaved memory op has too many members"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "Indices.size() <= Factor && \"Interleaved memory op has too many members\""
+     ,
+                                                         "/home/trippels/llvm/llvm/include/llvm/CodeGen/BasicTTIImpl.h"
+      ,
+                                                         823
+      , __PRETTY_FUNCTION__))
+                                                          
+                                                         ;
+
+      for (unsigned Index : Indices) {
+        
+       ((
+       Index < Factor && "Invalid index for interleaved memory op"
+       ) ? static_cast<void> (0) : __assert_fail (
+       "Index < Factor && \"Invalid index for interleaved memory op\""
+       , "/home/trippels/llvm/llvm/include/llvm/CodeGen/BasicTTIImpl.h", 826, __PRETTY_FUNCTION__))
+                                                                          ;
+
+
+        for (unsigned i = 0; i < NumSubElts; i++)
+          Cost += static_cast<T *>(this)->getVectorInstrCost(
+              Instruction::ExtractElement, VT, Index + i * Factor);
+      }
+
+      unsigned InsSubCost = 0;
+      for (unsigned i = 0; i < NumSubElts; i++)
+        InsSubCost += static_cast<T *>(this)->getVectorInstrCost(
+            Instruction::InsertElement, SubVT, i);
+
+      Cost += Indices.size() * InsSubCost;
+    } else {
+      unsigned ExtSubCost = 0;
+      for (unsigned i = 0; i < NumSubElts; i++)
+        ExtSubCost += static_cast<T *>(this)->getVectorInstrCost(
+            Instruction::ExtractElement, SubVT, i);
+      Cost += ExtSubCost * Factor;
+
+      for (unsigned i = 0; i < NumElts; i++)
+        Cost += static_cast<T *>(this)
+                    ->getVectorInstrCost(Instruction::InsertElement, VT, i);
+    }
+
+    return Cost;
+  }
+
+
+  unsigned getIntrinsicInstrCost(Intrinsic::ID IID, Type *RetTy,
+                                 ArrayRef<Value *> Args, FastMathFlags FMF,
+                                 unsigned VF = 1) {
+    unsigned RetVF = (RetTy->isVectorTy() ? RetTy->getVectorNumElements() : 1);
+    
+   ((
+   (RetVF == 1 || VF == 1) && "VF > 1 and RetVF is a vector type"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "(RetVF == 1 || VF == 1) && \"VF > 1 and RetVF is a vector type\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/BasicTTIImpl.h", 869, __PRETTY_FUNCTION__))
+                                                                         ;
+
+    switch (IID) {
+    default: {
+
+      SmallVector<Type *, 4> Types;
+      for (Value *Op : Args) {
+        Type *OpTy = Op->getType();
+        
+       ((
+       VF == 1 || !OpTy->isVectorTy()
+       ) ? static_cast<void> (0) : __assert_fail (
+       "VF == 1 || !OpTy->isVectorTy()"
+       , "/home/trippels/llvm/llvm/include/llvm/CodeGen/BasicTTIImpl.h", 877, __PRETTY_FUNCTION__))
+                                             ;
+        Types.push_back(VF == 1 ? OpTy : VectorType::get(OpTy, VF));
+      }
+
+      if (VF > 1 && !RetTy->isVoidTy())
+        RetTy = VectorType::get(RetTy, VF);
+
+
+
+
+      unsigned ScalarizationCost = std::numeric_limits<unsigned>::max();
+      if (RetVF > 1 || VF > 1) {
+        ScalarizationCost = 0;
+        if (!RetTy->isVoidTy())
+          ScalarizationCost += getScalarizationOverhead(RetTy, true, false);
+        ScalarizationCost += getOperandsScalarizationOverhead(Args, VF);
+      }
+
+      return static_cast<T *>(this)->
+        getIntrinsicInstrCost(IID, RetTy, Types, FMF, ScalarizationCost);
+    }
+    case Intrinsic::masked_scatter: {
+      
+     ((
+     VF == 1 && "Can't vectorize types here."
+     ) ? static_cast<void> (0) : __assert_fail (
+     "VF == 1 && \"Can't vectorize types here.\""
+     , "/home/trippels/llvm/llvm/include/llvm/CodeGen/BasicTTIImpl.h", 899, __PRETTY_FUNCTION__))
+                                                     ;
+      Value *Mask = Args[3];
+      bool VarMask = !isa<Constant>(Mask);
+      unsigned Alignment = cast<ConstantInt>(Args[2])->getZExtValue();
+      return
+        static_cast<T *>(this)->getGatherScatterOpCost(Instruction::Store,
+                                                       Args[0]->getType(),
+                                                       Args[1], VarMask,
+                                                       Alignment);
+    }
+    case Intrinsic::masked_gather: {
+      
+     ((
+     VF == 1 && "Can't vectorize types here."
+     ) ? static_cast<void> (0) : __assert_fail (
+     "VF == 1 && \"Can't vectorize types here.\""
+     , "/home/trippels/llvm/llvm/include/llvm/CodeGen/BasicTTIImpl.h", 910, __PRETTY_FUNCTION__))
+                                                     ;
+      Value *Mask = Args[2];
+      bool VarMask = !isa<Constant>(Mask);
+      unsigned Alignment = cast<ConstantInt>(Args[1])->getZExtValue();
+      return
+        static_cast<T *>(this)->getGatherScatterOpCost(Instruction::Load,
+                                                       RetTy, Args[0], VarMask,
+                                                       Alignment);
+    }
+    }
+  }
+
+
+
+
+
+  unsigned getIntrinsicInstrCost(
+      Intrinsic::ID IID, Type *RetTy, ArrayRef<Type *> Tys, FastMathFlags FMF,
+      unsigned ScalarizationCostPassed = std::numeric_limits<unsigned>::max()) {
+    SmallVector<unsigned, 2> ISDs;
+    unsigned SingleCallCost = 10;
+    switch (IID) {
+    default: {
+
+      unsigned ScalarizationCost = ScalarizationCostPassed;
+      unsigned ScalarCalls = 1;
+      Type *ScalarRetTy = RetTy;
+      if (RetTy->isVectorTy()) {
+        if (ScalarizationCostPassed == std::numeric_limits<unsigned>::max())
+          ScalarizationCost = getScalarizationOverhead(RetTy, true, false);
+        ScalarCalls = std::max(ScalarCalls, RetTy->getVectorNumElements());
+        ScalarRetTy = RetTy->getScalarType();
+      }
+      SmallVector<Type *, 4> ScalarTys;
+      for (unsigned i = 0, ie = Tys.size(); i != ie; ++i) {
+        Type *Ty = Tys[i];
+        if (Ty->isVectorTy()) {
+          if (ScalarizationCostPassed == std::numeric_limits<unsigned>::max())
+            ScalarizationCost += getScalarizationOverhead(Ty, false, true);
+          ScalarCalls = std::max(ScalarCalls, Ty->getVectorNumElements());
+          Ty = Ty->getScalarType();
+        }
+        ScalarTys.push_back(Ty);
+      }
+      if (ScalarCalls == 1)
+        return 1;
+
+      unsigned ScalarCost = static_cast<T *>(this)->getIntrinsicInstrCost(
+          IID, ScalarRetTy, ScalarTys, FMF);
+
+      return ScalarCalls * ScalarCost + ScalarizationCost;
+    }
+
+
+    case Intrinsic::sqrt:
+      ISDs.push_back(ISD::FSQRT);
+      break;
+    case Intrinsic::sin:
+      ISDs.push_back(ISD::FSIN);
+      break;
+    case Intrinsic::cos:
+      ISDs.push_back(ISD::FCOS);
+      break;
+    case Intrinsic::exp:
+      ISDs.push_back(ISD::FEXP);
+      break;
+    case Intrinsic::exp2:
+      ISDs.push_back(ISD::FEXP2);
+      break;
+    case Intrinsic::log:
+      ISDs.push_back(ISD::FLOG);
+      break;
+    case Intrinsic::log10:
+      ISDs.push_back(ISD::FLOG10);
+      break;
+    case Intrinsic::log2:
+      ISDs.push_back(ISD::FLOG2);
+      break;
+    case Intrinsic::fabs:
+      ISDs.push_back(ISD::FABS);
+      break;
+    case Intrinsic::minnum:
+      ISDs.push_back(ISD::FMINNUM);
+      if (FMF.noNaNs())
+        ISDs.push_back(ISD::FMINNAN);
+      break;
+    case Intrinsic::maxnum:
+      ISDs.push_back(ISD::FMAXNUM);
+      if (FMF.noNaNs())
+        ISDs.push_back(ISD::FMAXNAN);
+      break;
+    case Intrinsic::copysign:
+      ISDs.push_back(ISD::FCOPYSIGN);
+      break;
+    case Intrinsic::floor:
+      ISDs.push_back(ISD::FFLOOR);
+      break;
+    case Intrinsic::ceil:
+      ISDs.push_back(ISD::FCEIL);
+      break;
+    case Intrinsic::trunc:
+      ISDs.push_back(ISD::FTRUNC);
+      break;
+    case Intrinsic::nearbyint:
+      ISDs.push_back(ISD::FNEARBYINT);
+      break;
+    case Intrinsic::rint:
+      ISDs.push_back(ISD::FRINT);
+      break;
+    case Intrinsic::round:
+      ISDs.push_back(ISD::FROUND);
+      break;
+    case Intrinsic::pow:
+      ISDs.push_back(ISD::FPOW);
+      break;
+    case Intrinsic::fma:
+      ISDs.push_back(ISD::FMA);
+      break;
+    case Intrinsic::fmuladd:
+      ISDs.push_back(ISD::FMA);
+      break;
+
+    case Intrinsic::lifetime_start:
+    case Intrinsic::lifetime_end:
+    case Intrinsic::sideeffect:
+      return 0;
+    case Intrinsic::masked_store:
+      return static_cast<T *>(this)
+          ->getMaskedMemoryOpCost(Instruction::Store, Tys[0], 0, 0);
+    case Intrinsic::masked_load:
+      return static_cast<T *>(this)
+          ->getMaskedMemoryOpCost(Instruction::Load, RetTy, 0, 0);
+    case Intrinsic::ctpop:
+      ISDs.push_back(ISD::CTPOP);
+
+
+      SingleCallCost = TargetTransformInfo::TCC_Expensive;
+      break;
+
+    }
+
+    const TargetLoweringBase *TLI = getTLI();
+    std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(DL, RetTy);
+
+    SmallVector<unsigned, 2> LegalCost;
+    SmallVector<unsigned, 2> CustomCost;
+    for (unsigned ISD : ISDs) {
+      if (TLI->isOperationLegalOrPromote(ISD, LT.second)) {
+        if (IID == Intrinsic::fabs && TLI->isFAbsFree(LT.second)) {
+          return 0;
+        }
+
+
+
+
+
+        if (LT.first > 1)
+          LegalCost.push_back(LT.first * 2);
+        else
+          LegalCost.push_back(LT.first * 1);
+      } else if (!TLI->isOperationExpand(ISD, LT.second)) {
+
+
+        CustomCost.push_back(LT.first * 2);
+      }
+    }
+
+    auto MinLegalCostI = std::min_element(LegalCost.begin(), LegalCost.end());
+    if (MinLegalCostI != LegalCost.end())
+      return *MinLegalCostI;
+
+    auto MinCustomCostI = std::min_element(CustomCost.begin(), CustomCost.end());
+    if (MinCustomCostI != CustomCost.end())
+      return *MinCustomCostI;
+
+
+
+    if (IID == Intrinsic::fmuladd)
+      return static_cast<T *>(this)
+                 ->getArithmeticInstrCost(BinaryOperator::FMul, RetTy) +
+             static_cast<T *>(this)
+                 ->getArithmeticInstrCost(BinaryOperator::FAdd, RetTy);
+
+
+
+
+    if (RetTy->isVectorTy()) {
+      unsigned ScalarizationCost =
+          ((ScalarizationCostPassed != std::numeric_limits<unsigned>::max())
+               ? ScalarizationCostPassed
+               : getScalarizationOverhead(RetTy, true, false));
+      unsigned ScalarCalls = RetTy->getVectorNumElements();
+      SmallVector<Type *, 4> ScalarTys;
+      for (unsigned i = 0, ie = Tys.size(); i != ie; ++i) {
+        Type *Ty = Tys[i];
+        if (Ty->isVectorTy())
+          Ty = Ty->getScalarType();
+        ScalarTys.push_back(Ty);
+      }
+      unsigned ScalarCost = static_cast<T *>(this)->getIntrinsicInstrCost(
+          IID, RetTy->getScalarType(), ScalarTys, FMF);
+      for (unsigned i = 0, ie = Tys.size(); i != ie; ++i) {
+        if (Tys[i]->isVectorTy()) {
+          if (ScalarizationCostPassed == std::numeric_limits<unsigned>::max())
+            ScalarizationCost += getScalarizationOverhead(Tys[i], false, true);
+          ScalarCalls = std::max(ScalarCalls, Tys[i]->getVectorNumElements());
+        }
+      }
+
+      return ScalarCalls * ScalarCost + ScalarizationCost;
+    }
+
+
+    return SingleCallCost;
+  }
+  unsigned getCallInstrCost(Function *F, Type *RetTy, ArrayRef<Type *> Tys) {
+    return 10;
+  }
+
+  unsigned getNumberOfParts(Type *Tp) {
+    std::pair<unsigned, MVT> LT = getTLI()->getTypeLegalizationCost(DL, Tp);
+    return LT.first;
+  }
+
+  unsigned getAddressComputationCost(Type *Ty, ScalarEvolution *,
+                                     const SCEV *) {
+    return 0;
+  }
+  unsigned getArithmeticReductionCost(unsigned Opcode, Type *Ty,
+                                      bool IsPairwise) {
+    
+   ((
+   Ty->isVectorTy() && "Expect a vector type"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Ty->isVectorTy() && \"Expect a vector type\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/BasicTTIImpl.h", 1188, __PRETTY_FUNCTION__))
+                                                     ;
+    Type *ScalarTy = Ty->getVectorElementType();
+    unsigned NumVecElts = Ty->getVectorNumElements();
+    unsigned NumReduxLevels = Log2_32(NumVecElts);
+    unsigned ArithCost = 0;
+    unsigned ShuffleCost = 0;
+    auto *ConcreteTTI = static_cast<T *>(this);
+    std::pair<unsigned, MVT> LT =
+        ConcreteTTI->getTLI()->getTypeLegalizationCost(DL, Ty);
+    unsigned LongVectorCount = 0;
+    unsigned MVTLen =
+        LT.second.isVector() ? LT.second.getVectorNumElements() : 1;
+    while (NumVecElts > MVTLen) {
+      NumVecElts /= 2;
+
+      ShuffleCost += (IsPairwise + 1) *
+                     ConcreteTTI->getShuffleCost(TTI::SK_ExtractSubvector, Ty,
+                                                 NumVecElts, Ty);
+      ArithCost += ConcreteTTI->getArithmeticInstrCost(Opcode, Ty);
+      Ty = VectorType::get(ScalarTy, NumVecElts);
+      ++LongVectorCount;
+    }
+
+
+
+
+    ShuffleCost += (NumReduxLevels - LongVectorCount) * (IsPairwise + 1) *
+                   ConcreteTTI->getShuffleCost(TTI::SK_ExtractSubvector, Ty,
+                                               NumVecElts, Ty);
+    ArithCost += (NumReduxLevels - LongVectorCount) *
+                 ConcreteTTI->getArithmeticInstrCost(Opcode, Ty);
+    return ShuffleCost + ArithCost + getScalarizationOverhead(Ty, false, true);
+  }
+
+
+
+  unsigned getMinMaxReductionCost(Type *Ty, Type *CondTy, bool IsPairwise,
+                                  bool) {
+    
+   ((
+   Ty->isVectorTy() && "Expect a vector type"
+   ) ? static_cast<void> (0) : __assert_fail (
+   "Ty->isVectorTy() && \"Expect a vector type\""
+   , "/home/trippels/llvm/llvm/include/llvm/CodeGen/BasicTTIImpl.h", 1226, __PRETTY_FUNCTION__))
+                                                     ;
+    Type *ScalarTy = Ty->getVectorElementType();
+    Type *ScalarCondTy = CondTy->getVectorElementType();
+    unsigned NumVecElts = Ty->getVectorNumElements();
+    unsigned NumReduxLevels = Log2_32(NumVecElts);
+    unsigned CmpOpcode;
+    if (Ty->isFPOrFPVectorTy()) {
+      CmpOpcode = Instruction::FCmp;
+    } else {
+      
+     ((
+     Ty->isIntOrIntVectorTy() && "expecting floating point or integer type for min/max reduction"
+     ) ? static_cast<void> (0) : __assert_fail (
+     "Ty->isIntOrIntVectorTy() && \"expecting floating point or integer type for min/max reduction\""
+     ,
+                                                                             "/home/trippels/llvm/llvm/include/llvm/CodeGen/BasicTTIImpl.h"
+      ,
+                                                                             1236
+      , __PRETTY_FUNCTION__))
+                                                                              
+                                                                             ;
+      CmpOpcode = Instruction::ICmp;
+    }
+    unsigned MinMaxCost = 0;
+    unsigned ShuffleCost = 0;
+    auto *ConcreteTTI = static_cast<T *>(this);
+    std::pair<unsigned, MVT> LT =
+        ConcreteTTI->getTLI()->getTypeLegalizationCost(DL, Ty);
+    unsigned LongVectorCount = 0;
+    unsigned MVTLen =
+        LT.second.isVector() ? LT.second.getVectorNumElements() : 1;
+    while (NumVecElts > MVTLen) {
+      NumVecElts /= 2;
+
+      ShuffleCost += (IsPairwise + 1) *
+                     ConcreteTTI->getShuffleCost(TTI::SK_ExtractSubvector, Ty,
+                                                 NumVecElts, Ty);
+      MinMaxCost +=
+          ConcreteTTI->getCmpSelInstrCost(CmpOpcode, Ty, CondTy, nullptr) +
+          ConcreteTTI->getCmpSelInstrCost(Instruction::Select, Ty, CondTy,
+                                          nullptr);
+      Ty = VectorType::get(ScalarTy, NumVecElts);
+      CondTy = VectorType::get(ScalarCondTy, NumVecElts);
+      ++LongVectorCount;
+    }
+
+
+
+
+    ShuffleCost += (NumReduxLevels - LongVectorCount) * (IsPairwise + 1) *
+                   ConcreteTTI->getShuffleCost(TTI::SK_ExtractSubvector, Ty,
+                                               NumVecElts, Ty);
+    MinMaxCost +=
+        (NumReduxLevels - LongVectorCount) *
+        (ConcreteTTI->getCmpSelInstrCost(CmpOpcode, Ty, CondTy, nullptr) +
+         ConcreteTTI->getCmpSelInstrCost(Instruction::Select, Ty, CondTy,
+                                         nullptr));
+
+
+    return ShuffleCost + MinMaxCost +
+           3 * getScalarizationOverhead(Ty, false,
+                                                    true) +
+           ConcreteTTI->getCmpSelInstrCost(Instruction::Select, ScalarTy,
+                                           ScalarCondTy, nullptr);
+  }
+
+  unsigned getVectorSplitCost() { return 1; }
+
+
+};
+
+
+
+class BasicTTIImpl : public BasicTTIImplBase<BasicTTIImpl> {
+  using BaseT = BasicTTIImplBase<BasicTTIImpl>;
+
+  friend class BasicTTIImplBase<BasicTTIImpl>;
+
+  const TargetSubtargetInfo *ST;
+  const TargetLoweringBase *TLI;
+
+  const TargetSubtargetInfo *getST() const { return ST; }
+  const TargetLoweringBase *getTLI() const { return TLI; }
+
+public:
+  explicit BasicTTIImpl(const TargetMachine *ST, const Function &F);
+};
+
+}
+
+
+
+
+
+using namespace llvm;
+
+
+
+cl::opt<unsigned>
+llvm::PartialUnrollingThreshold("partial-unrolling-threshold", cl::init(0),
+                                cl::desc("Threshold for partial unrolling"),
+                                cl::Hidden);
+
+BasicTTIImpl::BasicTTIImpl(const TargetMachine *TM, const Function &F)
+    : BaseT(TM, F.getParent()->getDataLayout()), ST(TM->getSubtargetImpl(F)),
+      TLI(ST->getTargetLowering()) {}
diff --git a/gcc/testsuite/g++.dg/wrappers/NOT_FOR_UPSTREAM/cp-stdlib.C b/gcc/testsuite/g++.dg/wrappers/NOT_FOR_UPSTREAM/cp-stdlib.C
new file mode 100644
index 0000000..dc2162f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/wrappers/NOT_FOR_UPSTREAM/cp-stdlib.C
@@ -0,0 +1,154 @@
+// Test of including as much of the standard library as possible, to shake
+// out issues in the parser
+
+#include <algorithm>
+#include <any>
+#include <assert.h>
+#include <bitset>
+#include <cassert>
+#include <cassert>
+#include <cctype>
+#include <cerrno>
+#include <cfloat>
+#include <charconv>
+#include <climits>
+#include <clocale>
+#include <cmath>
+#include <complex>
+#include <csetjmp>
+#include <csignal>
+#include <cstdarg>
+#include <cstddef>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <ctime>
+#include <ctype.h>
+#include <cwchar>
+#include <cwctype>
+#include <deque>
+#include <errno.h>
+#include <exception>
+#include <experimental/algorithm>
+#include <experimental/any>
+#include <experimental/chrono>
+#include <experimental/deque>
+#include <experimental/filesystem>
+#include <experimental/forward_list>
+#include <experimental/functional>
+#include <experimental/list>
+#include <experimental/map>
+#include <experimental/memory>
+#include <experimental/numeric>
+#include <experimental/optional>
+#include <experimental/ratio>
+#include <experimental/regex>
+#include <experimental/set>
+#include <experimental/string>
+#include <experimental/string_view>
+#include <experimental/system_error>
+#include <experimental/tuple>
+#include <experimental/type_traits>
+#include <experimental/unordered_map>
+#include <experimental/unordered_set>
+#include <experimental/vector>
+#include <fenv.h>
+#include <filesystem>
+#include <float.h>
+#include <fstream>
+#include <functional>
+#include <inttypes.h>
+#include <iomanip>
+#include <ios>
+#include <iosfwd>
+#include <iostream>
+#include <iostream>
+#include <istream>
+#include <iterator>
+#include <limits.h>
+#include <limits>
+#include <list>
+#include <locale.h>
+#include <locale>
+#include <map>
+#include <math.h>
+#include <memory>
+#include <new>
+#include <numeric>
+#include <optional>
+#include <ostream>
+#include <queue>
+#include <set>
+#include <setjmp.h>
+#include <shared_mutex>
+#include <signal.h>
+#include <sstream>
+#include <stack>
+#include <stdarg.h>
+#include <stddef.h>
+#include <stdexcept>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <streambuf>
+#include <string.h>
+#include <string>
+#include <string_view>
+#include <time.h>
+#include <typeinfo>
+#include <uchar.h>
+#include <utility>
+#include <valarray>
+#include <variant>
+#include <vector>
+#include <vector>
+#include <wchar.h>
+#include <wctype.h>
+
+// C++11:
+#if __cplusplus >= 201103
+# include <array>
+# include <atomic>
+# include <cfenv>
+# include <chrono>
+# include <cinttypes>
+# include <codecvt>
+# include <condition_variable>
+# include <cstdint>
+# include <cuchar>
+# include <experimental/utility>
+# include <forward_list>
+# include <future>
+# include <initializer_list>
+# include <mutex>
+# include <random>
+# include <ratio>
+# include <regex>
+# include <scoped_allocator>
+# include <system_error>
+# include <thread>
+# include <tuple>
+# include <type_traits>
+# include <typeindex>
+# include <unordered_map>
+# include <unordered_set>
+#endif
+
+// C++14:
+#if __cplusplus >= 201402
+# include <experimental/memory_resource>
+#endif
+
+// Deprecated headers
+#ifndef __DEPRECATED
+# include <strstream>
+#endif
+
+// Smoketest
+
+std::vector<int> v;
+std::string s ("hello");
+#if __cplusplus >= 201103
+std::shared_ptr<int> p;
+#endif
diff --git a/gcc/testsuite/g++.dg/wrappers/NOT_FOR_UPSTREAM/cxx11-ios_failure.ii b/gcc/testsuite/g++.dg/wrappers/NOT_FOR_UPSTREAM/cxx11-ios_failure.ii
new file mode 100644
index 0000000..b960208
--- /dev/null
+++ b/gcc/testsuite/g++.dg/wrappers/NOT_FOR_UPSTREAM/cxx11-ios_failure.ii
@@ -0,0 +1,14 @@
+enum class errc {};
+enum class io_errc {
+  stream = 1
+};
+struct error_code;
+error_code make_error_code(errc);
+struct error_code {
+  template <typename _ErrorCodeEnum>
+  error_code(_ErrorCodeEnum __e) {
+    *this = make_error_code(__e);
+  }
+};
+error_code make_error_code(io_errc __e);
+error_code __ec = io_errc::stream;
diff --git a/gcc/testsuite/g++.dg/wrappers/NOT_FOR_UPSTREAM/cxx11-ios_failure.orig.ii b/gcc/testsuite/g++.dg/wrappers/NOT_FOR_UPSTREAM/cxx11-ios_failure.orig.ii
new file mode 100644
index 0000000..7dffc7f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/wrappers/NOT_FOR_UPSTREAM/cxx11-ios_failure.orig.ii
@@ -0,0 +1,24990 @@
+       
+
+       
+
+
+namespace std
+{
+  typedef long unsigned int size_t;
+  typedef long int ptrdiff_t;
+
+
+  typedef decltype(nullptr) nullptr_t;
+
+}
+namespace std
+{
+  inline namespace __cxx11 __attribute__((__abi_tag__ ("cxx11"))) { }
+}
+namespace __gnu_cxx
+{
+  inline namespace __cxx11 __attribute__((__abi_tag__ ("cxx11"))) { }
+}
+
+
+       
+
+
+       
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+  template<typename>
+    class allocator;
+
+  template<>
+    class allocator<void>;
+
+
+  template<typename, typename>
+    struct uses_allocator;
+
+
+
+
+}
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+
+
+
+
+
+  template<class _CharT>
+    struct char_traits;
+
+  template<> struct char_traits<char>;
+
+
+  template<> struct char_traits<wchar_t>;
+
+
+
+  template<> struct char_traits<char16_t>;
+  template<> struct char_traits<char32_t>;
+
+
+namespace __cxx11 {
+
+  template<typename _CharT, typename _Traits = char_traits<_CharT>,
+           typename _Alloc = allocator<_CharT> >
+    class basic_string;
+
+}
+
+
+  typedef basic_string<char> string;
+
+
+
+  typedef basic_string<wchar_t> wstring;
+
+
+
+
+  typedef basic_string<char16_t> u16string;
+
+
+  typedef basic_string<char32_t> u32string;
+
+
+
+
+
+}
+       
+
+       
+
+
+
+
+struct _IO_FILE;
+
+
+
+typedef struct _IO_FILE FILE;
+
+
+
+
+
+typedef struct _IO_FILE __FILE;
+
+
+typedef __builtin_va_list __gnuc_va_list;
+
+typedef long unsigned int size_t;
+typedef unsigned int wint_t;
+typedef struct
+{
+  int __count;
+  union
+  {
+
+    unsigned int __wch;
+
+
+
+    char __wchb[4];
+  } __value;
+} __mbstate_t;
+
+
+typedef __mbstate_t mbstate_t;
+
+
+
+
+
+
+extern "C" {
+
+
+
+
+struct tm;
+
+
+
+
+
+
+
+
+
+extern wchar_t *wcscpy (wchar_t *__restrict __dest,
+   const wchar_t *__restrict __src) throw ();
+
+extern wchar_t *wcsncpy (wchar_t *__restrict __dest,
+    const wchar_t *__restrict __src, size_t __n)
+     throw ();
+
+
+extern wchar_t *wcscat (wchar_t *__restrict __dest,
+   const wchar_t *__restrict __src) throw ();
+
+extern wchar_t *wcsncat (wchar_t *__restrict __dest,
+    const wchar_t *__restrict __src, size_t __n)
+     throw ();
+
+
+extern int wcscmp (const wchar_t *__s1, const wchar_t *__s2)
+     throw () __attribute__ ((__pure__));
+
+extern int wcsncmp (const wchar_t *__s1, const wchar_t *__s2, size_t __n)
+     throw () __attribute__ ((__pure__));
+
+
+
+
+extern int wcscasecmp (const wchar_t *__s1, const wchar_t *__s2) throw ();
+
+
+extern int wcsncasecmp (const wchar_t *__s1, const wchar_t *__s2,
+   size_t __n) throw ();
+
+
+
+typedef struct __locale_struct
+{
+
+  struct __locale_data *__locales[13];
+
+
+  const unsigned short int *__ctype_b;
+  const int *__ctype_tolower;
+  const int *__ctype_toupper;
+
+
+  const char *__names[13];
+} *__locale_t;
+
+
+typedef __locale_t locale_t;
+
+extern int wcscasecmp_l (const wchar_t *__s1, const wchar_t *__s2,
+    __locale_t __loc) throw ();
+
+extern int wcsncasecmp_l (const wchar_t *__s1, const wchar_t *__s2,
+     size_t __n, __locale_t __loc) throw ();
+
+
+
+
+
+extern int wcscoll (const wchar_t *__s1, const wchar_t *__s2) throw ();
+
+
+
+extern size_t wcsxfrm (wchar_t *__restrict __s1,
+         const wchar_t *__restrict __s2, size_t __n) throw ();
+
+
+
+
+
+
+
+
+extern int wcscoll_l (const wchar_t *__s1, const wchar_t *__s2,
+        __locale_t __loc) throw ();
+
+
+
+
+extern size_t wcsxfrm_l (wchar_t *__s1, const wchar_t *__s2,
+    size_t __n, __locale_t __loc) throw ();
+
+
+extern wchar_t *wcsdup (const wchar_t *__s) throw () __attribute__ ((__malloc__));
+
+
+
+
+
+extern "C++" wchar_t *wcschr (wchar_t *__wcs, wchar_t __wc)
+     throw () __asm ("wcschr") __attribute__ ((__pure__));
+extern "C++" const wchar_t *wcschr (const wchar_t *__wcs, wchar_t __wc)
+     throw () __asm ("wcschr") __attribute__ ((__pure__));
+
+
+
+
+
+
+extern "C++" wchar_t *wcsrchr (wchar_t *__wcs, wchar_t __wc)
+     throw () __asm ("wcsrchr") __attribute__ ((__pure__));
+extern "C++" const wchar_t *wcsrchr (const wchar_t *__wcs, wchar_t __wc)
+     throw () __asm ("wcsrchr") __attribute__ ((__pure__));
+
+
+
+
+
+
+
+
+
+extern wchar_t *wcschrnul (const wchar_t *__s, wchar_t __wc)
+     throw () __attribute__ ((__pure__));
+
+
+
+
+
+extern size_t wcscspn (const wchar_t *__wcs, const wchar_t *__reject)
+     throw () __attribute__ ((__pure__));
+
+
+extern size_t wcsspn (const wchar_t *__wcs, const wchar_t *__accept)
+     throw () __attribute__ ((__pure__));
+
+
+extern "C++" wchar_t *wcspbrk (wchar_t *__wcs, const wchar_t *__accept)
+     throw () __asm ("wcspbrk") __attribute__ ((__pure__));
+extern "C++" const wchar_t *wcspbrk (const wchar_t *__wcs,
+         const wchar_t *__accept)
+     throw () __asm ("wcspbrk") __attribute__ ((__pure__));
+
+
+
+
+
+
+extern "C++" wchar_t *wcsstr (wchar_t *__haystack, const wchar_t *__needle)
+     throw () __asm ("wcsstr") __attribute__ ((__pure__));
+extern "C++" const wchar_t *wcsstr (const wchar_t *__haystack,
+        const wchar_t *__needle)
+     throw () __asm ("wcsstr") __attribute__ ((__pure__));
+
+
+
+
+
+
+extern wchar_t *wcstok (wchar_t *__restrict __s,
+   const wchar_t *__restrict __delim,
+   wchar_t **__restrict __ptr) throw ();
+
+
+extern size_t wcslen (const wchar_t *__s) throw () __attribute__ ((__pure__));
+
+
+
+
+
+extern "C++" wchar_t *wcswcs (wchar_t *__haystack, const wchar_t *__needle)
+     throw () __asm ("wcswcs") __attribute__ ((__pure__));
+extern "C++" const wchar_t *wcswcs (const wchar_t *__haystack,
+        const wchar_t *__needle)
+     throw () __asm ("wcswcs") __attribute__ ((__pure__));
+extern size_t wcsnlen (const wchar_t *__s, size_t __maxlen)
+     throw () __attribute__ ((__pure__));
+
+
+
+
+
+
+extern "C++" wchar_t *wmemchr (wchar_t *__s, wchar_t __c, size_t __n)
+     throw () __asm ("wmemchr") __attribute__ ((__pure__));
+extern "C++" const wchar_t *wmemchr (const wchar_t *__s, wchar_t __c,
+         size_t __n)
+     throw () __asm ("wmemchr") __attribute__ ((__pure__));
+
+
+
+
+
+
+extern int wmemcmp (const wchar_t *__s1, const wchar_t *__s2, size_t __n)
+     throw () __attribute__ ((__pure__));
+
+
+extern wchar_t *wmemcpy (wchar_t *__restrict __s1,
+    const wchar_t *__restrict __s2, size_t __n) throw ();
+
+
+
+extern wchar_t *wmemmove (wchar_t *__s1, const wchar_t *__s2, size_t __n)
+     throw ();
+
+
+extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) throw ();
+
+
+
+
+
+extern wchar_t *wmempcpy (wchar_t *__restrict __s1,
+     const wchar_t *__restrict __s2, size_t __n)
+     throw ();
+
+
+
+
+
+
+extern wint_t btowc (int __c) throw ();
+
+
+
+extern int wctob (wint_t __c) throw ();
+
+
+
+extern int mbsinit (const mbstate_t *__ps) throw () __attribute__ ((__pure__));
+
+
+
+extern size_t mbrtowc (wchar_t *__restrict __pwc,
+         const char *__restrict __s, size_t __n,
+         mbstate_t *__restrict __p) throw ();
+
+
+extern size_t wcrtomb (char *__restrict __s, wchar_t __wc,
+         mbstate_t *__restrict __ps) throw ();
+
+
+extern size_t __mbrlen (const char *__restrict __s, size_t __n,
+   mbstate_t *__restrict __ps) throw ();
+extern size_t mbrlen (const char *__restrict __s, size_t __n,
+        mbstate_t *__restrict __ps) throw ();
+
+
+
+
+
+
+
+
+extern wint_t __btowc_alias (int __c) __asm ("btowc");
+extern __inline __attribute__ ((__gnu_inline__)) wint_t
+__attribute__ ((__leaf__)) btowc (int __c) throw ()
+{ return (__builtin_constant_p (__c) && __c >= '\0' && __c <= '\x7f'
+   ? (wint_t) __c : __btowc_alias (__c)); }
+
+extern int __wctob_alias (wint_t __c) __asm ("wctob");
+extern __inline __attribute__ ((__gnu_inline__)) int
+__attribute__ ((__leaf__)) wctob (wint_t __wc) throw ()
+{ return (__builtin_constant_p (__wc) && __wc >= L'\0' && __wc <= L'\x7f'
+   ? (int) __wc : __wctob_alias (__wc)); }
+
+extern __inline __attribute__ ((__gnu_inline__)) size_t
+__attribute__ ((__leaf__)) mbrlen (const char *__restrict __s, size_t __n, mbstate_t *__restrict __ps) throw ()
+
+{ return (__ps != __null
+   ? mbrtowc (__null, __s, __n, __ps) : __mbrlen (__s, __n, __null)); }
+
+
+
+
+
+extern size_t mbsrtowcs (wchar_t *__restrict __dst,
+    const char **__restrict __src, size_t __len,
+    mbstate_t *__restrict __ps) throw ();
+
+
+
+extern size_t wcsrtombs (char *__restrict __dst,
+    const wchar_t **__restrict __src, size_t __len,
+    mbstate_t *__restrict __ps) throw ();
+
+
+
+
+
+
+extern size_t mbsnrtowcs (wchar_t *__restrict __dst,
+     const char **__restrict __src, size_t __nmc,
+     size_t __len, mbstate_t *__restrict __ps) throw ();
+
+
+
+extern size_t wcsnrtombs (char *__restrict __dst,
+     const wchar_t **__restrict __src,
+     size_t __nwc, size_t __len,
+     mbstate_t *__restrict __ps) throw ();
+
+
+
+
+
+
+extern int wcwidth (wchar_t __c) throw ();
+
+
+
+extern int wcswidth (const wchar_t *__s, size_t __n) throw ();
+
+
+
+
+
+
+extern double wcstod (const wchar_t *__restrict __nptr,
+        wchar_t **__restrict __endptr) throw ();
+
+
+
+
+
+extern float wcstof (const wchar_t *__restrict __nptr,
+       wchar_t **__restrict __endptr) throw ();
+extern long double wcstold (const wchar_t *__restrict __nptr,
+       wchar_t **__restrict __endptr) throw ();
+
+
+
+
+
+
+
+extern long int wcstol (const wchar_t *__restrict __nptr,
+   wchar_t **__restrict __endptr, int __base) throw ();
+
+
+
+extern unsigned long int wcstoul (const wchar_t *__restrict __nptr,
+      wchar_t **__restrict __endptr, int __base)
+     throw ();
+
+
+
+
+
+
+__extension__
+extern long long int wcstoll (const wchar_t *__restrict __nptr,
+         wchar_t **__restrict __endptr, int __base)
+     throw ();
+
+
+
+__extension__
+extern unsigned long long int wcstoull (const wchar_t *__restrict __nptr,
+     wchar_t **__restrict __endptr,
+     int __base) throw ();
+
+
+
+
+
+
+__extension__
+extern long long int wcstoq (const wchar_t *__restrict __nptr,
+        wchar_t **__restrict __endptr, int __base)
+     throw ();
+
+
+
+__extension__
+extern unsigned long long int wcstouq (const wchar_t *__restrict __nptr,
+           wchar_t **__restrict __endptr,
+           int __base) throw ();
+extern long int wcstol_l (const wchar_t *__restrict __nptr,
+     wchar_t **__restrict __endptr, int __base,
+     __locale_t __loc) throw ();
+
+extern unsigned long int wcstoul_l (const wchar_t *__restrict __nptr,
+        wchar_t **__restrict __endptr,
+        int __base, __locale_t __loc) throw ();
+
+__extension__
+extern long long int wcstoll_l (const wchar_t *__restrict __nptr,
+    wchar_t **__restrict __endptr,
+    int __base, __locale_t __loc) throw ();
+
+__extension__
+extern unsigned long long int wcstoull_l (const wchar_t *__restrict __nptr,
+       wchar_t **__restrict __endptr,
+       int __base, __locale_t __loc)
+     throw ();
+
+extern double wcstod_l (const wchar_t *__restrict __nptr,
+   wchar_t **__restrict __endptr, __locale_t __loc)
+     throw ();
+
+extern float wcstof_l (const wchar_t *__restrict __nptr,
+         wchar_t **__restrict __endptr, __locale_t __loc)
+     throw ();
+
+extern long double wcstold_l (const wchar_t *__restrict __nptr,
+         wchar_t **__restrict __endptr,
+         __locale_t __loc) throw ();
+
+
+
+
+
+
+extern wchar_t *wcpcpy (wchar_t *__restrict __dest,
+   const wchar_t *__restrict __src) throw ();
+
+
+
+extern wchar_t *wcpncpy (wchar_t *__restrict __dest,
+    const wchar_t *__restrict __src, size_t __n)
+     throw ();
+
+
+
+
+
+
+extern __FILE *open_wmemstream (wchar_t **__bufloc, size_t *__sizeloc) throw ();
+
+
+
+
+
+
+extern int fwide (__FILE *__fp, int __mode) throw ();
+
+
+
+
+
+
+extern int fwprintf (__FILE *__restrict __stream,
+       const wchar_t *__restrict __format, ...)
+                                                           ;
+
+
+
+
+extern int wprintf (const wchar_t *__restrict __format, ...)
+                                                           ;
+
+extern int swprintf (wchar_t *__restrict __s, size_t __n,
+       const wchar_t *__restrict __format, ...)
+     throw () ;
+
+
+
+
+
+extern int vfwprintf (__FILE *__restrict __s,
+        const wchar_t *__restrict __format,
+        __gnuc_va_list __arg)
+                                                           ;
+
+
+
+
+extern int vwprintf (const wchar_t *__restrict __format,
+       __gnuc_va_list __arg)
+                                                           ;
+
+
+extern int vswprintf (wchar_t *__restrict __s, size_t __n,
+        const wchar_t *__restrict __format,
+        __gnuc_va_list __arg)
+     throw () ;
+
+
+
+
+
+
+extern int fwscanf (__FILE *__restrict __stream,
+      const wchar_t *__restrict __format, ...)
+                                                          ;
+
+
+
+
+extern int wscanf (const wchar_t *__restrict __format, ...)
+                                                          ;
+
+extern int swscanf (const wchar_t *__restrict __s,
+      const wchar_t *__restrict __format, ...)
+     throw () ;
+
+
+
+
+
+
+
+
+
+extern int vfwscanf (__FILE *__restrict __s,
+       const wchar_t *__restrict __format,
+       __gnuc_va_list __arg)
+                                                          ;
+
+
+
+
+extern int vwscanf (const wchar_t *__restrict __format,
+      __gnuc_va_list __arg)
+                                                          ;
+
+extern int vswscanf (const wchar_t *__restrict __s,
+       const wchar_t *__restrict __format,
+       __gnuc_va_list __arg)
+     throw () ;
+
+
+
+
+
+
+
+
+
+extern wint_t fgetwc (__FILE *__stream);
+extern wint_t getwc (__FILE *__stream);
+
+
+
+
+
+extern wint_t getwchar (void);
+
+
+
+
+
+
+extern wint_t fputwc (wchar_t __wc, __FILE *__stream);
+extern wint_t putwc (wchar_t __wc, __FILE *__stream);
+
+
+
+
+
+extern wint_t putwchar (wchar_t __wc);
+
+
+
+
+
+
+
+extern wchar_t *fgetws (wchar_t *__restrict __ws, int __n,
+   __FILE *__restrict __stream);
+
+
+
+
+
+extern int fputws (const wchar_t *__restrict __ws,
+     __FILE *__restrict __stream);
+
+
+
+
+
+
+extern wint_t ungetwc (wint_t __wc, __FILE *__stream);
+
+extern wint_t getwc_unlocked (__FILE *__stream);
+extern wint_t getwchar_unlocked (void);
+
+
+
+
+
+
+
+extern wint_t fgetwc_unlocked (__FILE *__stream);
+
+
+
+
+
+
+
+extern wint_t fputwc_unlocked (wchar_t __wc, __FILE *__stream);
+extern wint_t putwc_unlocked (wchar_t __wc, __FILE *__stream);
+extern wint_t putwchar_unlocked (wchar_t __wc);
+extern wchar_t *fgetws_unlocked (wchar_t *__restrict __ws, int __n,
+     __FILE *__restrict __stream);
+
+
+
+
+
+
+
+extern int fputws_unlocked (const wchar_t *__restrict __ws,
+       __FILE *__restrict __stream);
+
+
+
+
+
+
+
+extern size_t wcsftime (wchar_t *__restrict __s, size_t __maxsize,
+   const wchar_t *__restrict __format,
+   const struct tm *__restrict __tp) throw ();
+
+
+
+
+
+
+
+extern size_t wcsftime_l (wchar_t *__restrict __s, size_t __maxsize,
+     const wchar_t *__restrict __format,
+     const struct tm *__restrict __tp,
+     __locale_t __loc) throw ();
+}
+namespace std
+{
+  using ::mbstate_t;
+}
+extern "C++"
+{
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+  using ::wint_t;
+
+  using ::btowc;
+  using ::fgetwc;
+  using ::fgetws;
+  using ::fputwc;
+  using ::fputws;
+  using ::fwide;
+  using ::fwprintf;
+  using ::fwscanf;
+  using ::getwc;
+  using ::getwchar;
+  using ::mbrlen;
+  using ::mbrtowc;
+  using ::mbsinit;
+  using ::mbsrtowcs;
+  using ::putwc;
+  using ::putwchar;
+
+  using ::swprintf;
+
+  using ::swscanf;
+  using ::ungetwc;
+  using ::vfwprintf;
+
+  using ::vfwscanf;
+
+
+  using ::vswprintf;
+
+
+  using ::vswscanf;
+
+  using ::vwprintf;
+
+  using ::vwscanf;
+
+  using ::wcrtomb;
+  using ::wcscat;
+  using ::wcscmp;
+  using ::wcscoll;
+  using ::wcscpy;
+  using ::wcscspn;
+  using ::wcsftime;
+  using ::wcslen;
+  using ::wcsncat;
+  using ::wcsncmp;
+  using ::wcsncpy;
+  using ::wcsrtombs;
+  using ::wcsspn;
+  using ::wcstod;
+
+  using ::wcstof;
+
+  using ::wcstok;
+  using ::wcstol;
+  using ::wcstoul;
+  using ::wcsxfrm;
+  using ::wctob;
+  using ::wmemcmp;
+  using ::wmemcpy;
+  using ::wmemmove;
+  using ::wmemset;
+  using ::wprintf;
+  using ::wscanf;
+  using ::wcschr;
+  using ::wcspbrk;
+  using ::wcsrchr;
+  using ::wcsstr;
+  using ::wmemchr;
+
+}
+}
+
+
+
+
+
+
+
+namespace __gnu_cxx
+{
+
+
+
+
+
+  using ::wcstold;
+  using ::wcstoll;
+  using ::wcstoull;
+
+}
+
+namespace std
+{
+  using ::__gnu_cxx::wcstold;
+  using ::__gnu_cxx::wcstoll;
+  using ::__gnu_cxx::wcstoull;
+}
+namespace std
+{
+
+  using std::wcstof;
+
+
+  using std::vfwscanf;
+
+
+  using std::vswscanf;
+
+
+  using std::vwscanf;
+
+
+
+  using std::wcstold;
+  using std::wcstoll;
+  using std::wcstoull;
+
+}
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+  typedef long streamoff;
+  typedef ptrdiff_t streamsize;
+  template<typename _StateT>
+    class fpos
+    {
+    private:
+      streamoff _M_off;
+      _StateT _M_state;
+
+    public:
+
+
+
+
+      fpos()
+      : _M_off(0), _M_state() { }
+      fpos(streamoff __off)
+      : _M_off(__off), _M_state() { }
+
+
+      fpos(const fpos&) = default;
+      fpos& operator=(const fpos&) = default;
+      ~fpos() = default;
+
+
+
+      operator streamoff() const { return _M_off; }
+
+
+      void
+      state(_StateT __st)
+      { _M_state = __st; }
+
+
+      _StateT
+      state() const
+      { return _M_state; }
+
+
+
+
+
+      fpos&
+      operator+=(streamoff __off)
+      {
+ _M_off += __off;
+ return *this;
+      }
+
+
+
+
+
+      fpos&
+      operator-=(streamoff __off)
+      {
+ _M_off -= __off;
+ return *this;
+      }
+
+
+
+
+
+
+
+      fpos
+      operator+(streamoff __off) const
+      {
+ fpos __pos(*this);
+ __pos += __off;
+ return __pos;
+      }
+
+
+
+
+
+
+
+      fpos
+      operator-(streamoff __off) const
+      {
+ fpos __pos(*this);
+ __pos -= __off;
+ return __pos;
+      }
+
+
+
+
+
+
+      streamoff
+      operator-(const fpos& __other) const
+      { return _M_off - __other._M_off; }
+    };
+
+
+
+
+
+
+  template<typename _StateT>
+    inline bool
+    operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
+    { return streamoff(__lhs) == streamoff(__rhs); }
+
+  template<typename _StateT>
+    inline bool
+    operator!=(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
+    { return streamoff(__lhs) != streamoff(__rhs); }
+
+
+
+
+
+  typedef fpos<mbstate_t> streampos;
+
+  typedef fpos<mbstate_t> wstreampos;
+
+
+
+  typedef fpos<mbstate_t> u16streampos;
+
+  typedef fpos<mbstate_t> u32streampos;
+
+
+
+}
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+  class ios_base;
+
+  template<typename _CharT, typename _Traits = char_traits<_CharT> >
+    class basic_ios;
+
+  template<typename _CharT, typename _Traits = char_traits<_CharT> >
+    class basic_streambuf;
+
+  template<typename _CharT, typename _Traits = char_traits<_CharT> >
+    class basic_istream;
+
+  template<typename _CharT, typename _Traits = char_traits<_CharT> >
+    class basic_ostream;
+
+  template<typename _CharT, typename _Traits = char_traits<_CharT> >
+    class basic_iostream;
+
+
+namespace __cxx11 {
+
+  template<typename _CharT, typename _Traits = char_traits<_CharT>,
+     typename _Alloc = allocator<_CharT> >
+    class basic_stringbuf;
+
+  template<typename _CharT, typename _Traits = char_traits<_CharT>,
+    typename _Alloc = allocator<_CharT> >
+    class basic_istringstream;
+
+  template<typename _CharT, typename _Traits = char_traits<_CharT>,
+    typename _Alloc = allocator<_CharT> >
+    class basic_ostringstream;
+
+  template<typename _CharT, typename _Traits = char_traits<_CharT>,
+    typename _Alloc = allocator<_CharT> >
+    class basic_stringstream;
+
+}
+
+  template<typename _CharT, typename _Traits = char_traits<_CharT> >
+    class basic_filebuf;
+
+  template<typename _CharT, typename _Traits = char_traits<_CharT> >
+    class basic_ifstream;
+
+  template<typename _CharT, typename _Traits = char_traits<_CharT> >
+    class basic_ofstream;
+
+  template<typename _CharT, typename _Traits = char_traits<_CharT> >
+    class basic_fstream;
+
+  template<typename _CharT, typename _Traits = char_traits<_CharT> >
+    class istreambuf_iterator;
+
+  template<typename _CharT, typename _Traits = char_traits<_CharT> >
+    class ostreambuf_iterator;
+
+
+
+  typedef basic_ios<char> ios;
+
+
+  typedef basic_streambuf<char> streambuf;
+
+
+  typedef basic_istream<char> istream;
+
+
+  typedef basic_ostream<char> ostream;
+
+
+  typedef basic_iostream<char> iostream;
+
+
+  typedef basic_stringbuf<char> stringbuf;
+
+
+  typedef basic_istringstream<char> istringstream;
+
+
+  typedef basic_ostringstream<char> ostringstream;
+
+
+  typedef basic_stringstream<char> stringstream;
+
+
+  typedef basic_filebuf<char> filebuf;
+
+
+  typedef basic_ifstream<char> ifstream;
+
+
+  typedef basic_ofstream<char> ofstream;
+
+
+  typedef basic_fstream<char> fstream;
+
+
+
+  typedef basic_ios<wchar_t> wios;
+
+
+  typedef basic_streambuf<wchar_t> wstreambuf;
+
+
+  typedef basic_istream<wchar_t> wistream;
+
+
+  typedef basic_ostream<wchar_t> wostream;
+
+
+  typedef basic_iostream<wchar_t> wiostream;
+
+
+  typedef basic_stringbuf<wchar_t> wstringbuf;
+
+
+  typedef basic_istringstream<wchar_t> wistringstream;
+
+
+  typedef basic_ostringstream<wchar_t> wostringstream;
+
+
+  typedef basic_stringstream<wchar_t> wstringstream;
+
+
+  typedef basic_filebuf<wchar_t> wfilebuf;
+
+
+  typedef basic_ifstream<wchar_t> wifstream;
+
+
+  typedef basic_ofstream<wchar_t> wofstream;
+
+
+  typedef basic_fstream<wchar_t> wfstream;
+
+
+
+
+}
+       
+
+
+
+       
+
+
+
+
+extern "C++" {
+
+namespace std
+{
+  class exception
+  {
+  public:
+    exception() noexcept { }
+    virtual ~exception() noexcept;
+
+    exception(const exception&) = default;
+    exception& operator=(const exception&) = default;
+    exception(exception&&) = default;
+    exception& operator=(exception&&) = default;
+
+
+
+
+    virtual const char*
+    what() const noexcept;
+  };
+
+}
+
+}
+
+
+extern "C++" {
+
+namespace std
+{
+
+
+  class bad_exception : public exception
+  {
+  public:
+    bad_exception() noexcept { }
+
+
+
+    virtual ~bad_exception() noexcept;
+
+
+    virtual const char*
+    what() const noexcept;
+  };
+
+
+  typedef void (*terminate_handler) ();
+
+
+  typedef void (*unexpected_handler) ();
+
+
+  terminate_handler set_terminate(terminate_handler) noexcept;
+
+
+
+  terminate_handler get_terminate() noexcept;
+
+
+
+
+  void terminate() noexcept __attribute__ ((__noreturn__));
+
+
+  unexpected_handler set_unexpected(unexpected_handler) noexcept;
+
+
+
+  unexpected_handler get_unexpected() noexcept;
+
+
+
+
+  void unexpected() __attribute__ ((__noreturn__));
+ 
+  bool uncaught_exception() noexcept __attribute__ ((__pure__));
+
+
+
+
+  int uncaught_exceptions() noexcept __attribute__ ((__pure__));
+
+
+
+}
+
+namespace __gnu_cxx
+{
+
+  void __verbose_terminate_handler();
+
+
+}
+
+}
+
+
+
+
+
+       
+
+
+typedef long int ptrdiff_t;
+typedef struct {
+  long long __max_align_ll __attribute__((__aligned__(__alignof__(long long))));
+  long double __max_align_ld __attribute__((__aligned__(__alignof__(long double))));
+} max_align_t;
+
+
+
+
+
+
+  typedef decltype(nullptr) nullptr_t;
+namespace std
+{
+  class type_info;
+}
+
+namespace __cxxabiv1
+{
+  struct __cxa_refcounted_exception;
+
+  extern "C"
+    {
+
+      void*
+      __cxa_allocate_exception(size_t) noexcept;
+
+      void
+      __cxa_free_exception(void*) noexcept;
+
+
+      __cxa_refcounted_exception*
+      __cxa_init_primary_exception(void *object, std::type_info *tinfo,
+                void ( *dest) (void *)) noexcept;
+
+    }
+}
+
+
+
+       
+
+
+
+       
+
+
+
+namespace std
+{
+
+
+
+
+
+
+
+  size_t
+  _Hash_bytes(const void* __ptr, size_t __len, size_t __seed);
+
+
+
+
+
+  size_t
+  _Fnv_hash_bytes(const void* __ptr, size_t __len, size_t __seed);
+
+
+}
+
+
+
+extern "C++" {
+
+namespace __cxxabiv1
+{
+  class __class_type_info;
+}
+namespace std
+{
+
+
+
+
+
+
+  class type_info
+  {
+  public:
+
+
+
+
+    virtual ~type_info();
+
+
+
+    const char* name() const noexcept
+    { return __name[0] == '*' ? __name + 1 : __name; }
+    bool before(const type_info& __arg) const noexcept
+    { return (__name[0] == '*' && __arg.__name[0] == '*')
+ ? __name < __arg.__name
+ : __builtin_strcmp (__name, __arg.__name) < 0; }
+
+    bool operator==(const type_info& __arg) const noexcept
+    {
+      return ((__name == __arg.__name)
+       || (__name[0] != '*' &&
+    __builtin_strcmp (__name, __arg.__name) == 0));
+    }
+    bool operator!=(const type_info& __arg) const noexcept
+    { return !operator==(__arg); }
+
+
+    size_t hash_code() const noexcept
+    {
+
+      return _Hash_bytes(name(), __builtin_strlen(name()),
+    static_cast<size_t>(0xc70f6907UL));
+
+
+
+    }
+
+
+
+    virtual bool __is_pointer_p() const;
+
+
+    virtual bool __is_function_p() const;
+
+
+
+
+
+
+
+    virtual bool __do_catch(const type_info *__thr_type, void **__thr_obj,
+       unsigned __outer) const;
+
+
+    virtual bool __do_upcast(const __cxxabiv1::__class_type_info *__target,
+        void **__obj_ptr) const;
+
+  protected:
+    const char *__name;
+
+    explicit type_info(const char *__n): __name(__n) { }
+
+  private:
+
+    type_info& operator=(const type_info&);
+    type_info(const type_info&);
+  };
+
+
+
+
+
+
+
+  class bad_cast : public exception
+  {
+  public:
+    bad_cast() noexcept { }
+
+
+
+    virtual ~bad_cast() noexcept;
+
+
+    virtual const char* what() const noexcept;
+  };
+
+
+
+
+
+  class bad_typeid : public exception
+  {
+  public:
+    bad_typeid () noexcept { }
+
+
+
+    virtual ~bad_typeid() noexcept;
+
+
+    virtual const char* what() const noexcept;
+  };
+}
+
+}
+
+       
+
+
+
+
+extern "C++" {
+
+namespace std
+{
+
+
+
+
+
+
+  class bad_alloc : public exception
+  {
+  public:
+    bad_alloc() throw() { }
+
+
+    bad_alloc(const bad_alloc&) = default;
+    bad_alloc& operator=(const bad_alloc&) = default;
+
+
+
+
+    virtual ~bad_alloc() throw();
+
+
+    virtual const char* what() const throw();
+  };
+
+
+  class bad_array_new_length : public bad_alloc
+  {
+  public:
+    bad_array_new_length() throw() { }
+
+
+
+    virtual ~bad_array_new_length() throw();
+
+
+    virtual const char* what() const throw();
+  };
+
+
+
+
+
+
+  struct nothrow_t
+  {
+
+    explicit nothrow_t() = default;
+
+  };
+
+  extern const nothrow_t nothrow;
+
+
+
+  typedef void (*new_handler)();
+
+
+
+  new_handler set_new_handler(new_handler) throw();
+
+
+
+  new_handler get_new_handler() noexcept;
+
+}
+void* operator new(std::size_t)
+  __attribute__((__externally_visible__));
+void* operator new[](std::size_t)
+  __attribute__((__externally_visible__));
+void operator delete(void*) noexcept
+  __attribute__((__externally_visible__));
+void operator delete[](void*) noexcept
+  __attribute__((__externally_visible__));
+
+
+
+
+
+
+void* operator new(std::size_t, const std::nothrow_t&) noexcept
+  __attribute__((__externally_visible__, __malloc__));
+void* operator new[](std::size_t, const std::nothrow_t&) noexcept
+  __attribute__((__externally_visible__, __malloc__));
+void operator delete(void*, const std::nothrow_t&) noexcept
+  __attribute__((__externally_visible__));
+void operator delete[](void*, const std::nothrow_t&) noexcept
+  __attribute__((__externally_visible__));
+inline void* operator new(std::size_t, void* __p) noexcept
+{ return __p; }
+inline void* operator new[](std::size_t, void* __p) noexcept
+{ return __p; }
+
+
+inline void operator delete (void*, void*) noexcept { }
+inline void operator delete[](void*, void*) noexcept { }
+
+}
+
+extern "C++" {
+
+namespace std
+{
+  class type_info;
+
+
+
+
+
+  namespace __exception_ptr
+  {
+    class exception_ptr;
+  }
+
+  using __exception_ptr::exception_ptr;
+
+
+
+
+
+  exception_ptr current_exception() noexcept;
+
+  template<typename _Ex>
+  exception_ptr make_exception_ptr(_Ex) noexcept;
+
+
+  void rethrow_exception(exception_ptr) __attribute__ ((__noreturn__));
+
+  namespace __exception_ptr
+  {
+    using std::rethrow_exception;
+
+
+
+
+
+    class exception_ptr
+    {
+      void* _M_exception_object;
+
+      explicit exception_ptr(void* __e) noexcept;
+
+      void _M_addref() noexcept;
+      void _M_release() noexcept;
+
+      void *_M_get() const noexcept __attribute__ ((__pure__));
+
+      friend exception_ptr std::current_exception() noexcept;
+      friend void std::rethrow_exception(exception_ptr);
+      template<typename _Ex>
+      friend exception_ptr std::make_exception_ptr(_Ex) noexcept;
+
+    public:
+      exception_ptr() noexcept;
+
+      exception_ptr(const exception_ptr&) noexcept;
+
+
+      exception_ptr(nullptr_t) noexcept
+      : _M_exception_object(0)
+      { }
+
+      exception_ptr(exception_ptr&& __o) noexcept
+      : _M_exception_object(__o._M_exception_object)
+      { __o._M_exception_object = 0; }
+      exception_ptr&
+      operator=(const exception_ptr&) noexcept;
+
+
+      exception_ptr&
+      operator=(exception_ptr&& __o) noexcept
+      {
+        exception_ptr(static_cast<exception_ptr&&>(__o)).swap(*this);
+        return *this;
+      }
+
+
+      ~exception_ptr() noexcept;
+
+      void
+      swap(exception_ptr&) noexcept;
+      explicit operator bool() const
+      { return _M_exception_object; }
+
+
+      friend bool
+      operator==(const exception_ptr&, const exception_ptr&)
+ noexcept __attribute__ ((__pure__));
+
+      const class std::type_info*
+      __cxa_exception_type() const noexcept
+ __attribute__ ((__pure__));
+    };
+
+    bool
+    operator==(const exception_ptr&, const exception_ptr&)
+      noexcept __attribute__ ((__pure__));
+
+    bool
+    operator!=(const exception_ptr&, const exception_ptr&)
+      noexcept __attribute__ ((__pure__));
+
+    inline void
+    swap(exception_ptr& __lhs, exception_ptr& __rhs)
+    { __lhs.swap(__rhs); }
+
+    template<typename _Ex>
+      inline void
+      __dest_thunk(void* __x)
+      { static_cast<_Ex*>(__x)->~_Ex(); }
+
+  }
+
+
+  template<typename _Ex>
+    exception_ptr
+    make_exception_ptr(_Ex __ex) noexcept
+    {
+
+      void* __e = __cxxabiv1::__cxa_allocate_exception(sizeof(_Ex));
+      (void) __cxxabiv1::__cxa_init_primary_exception(
+   __e, const_cast<std::type_info*>(&typeid(__ex)),
+   __exception_ptr::__dest_thunk<_Ex>);
+      try
+ {
+          ::new (__e) _Ex(__ex);
+          return exception_ptr(__e);
+ }
+      catch(...)
+ {
+   __cxxabiv1::__cxa_free_exception(__e);
+   return current_exception();
+ }
+    }
+
+
+}
+
+}
+
+
+
+
+
+
+
+       
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+
+
+
+
+  template<typename _Tp>
+    inline constexpr _Tp*
+    __addressof(_Tp& __r) noexcept
+    { return __builtin_addressof(__r); }
+
+
+
+
+}
+
+       
+
+
+
+
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+  template<typename _Tp, _Tp __v>
+    struct integral_constant
+    {
+      static constexpr _Tp value = __v;
+      typedef _Tp value_type;
+      typedef integral_constant<_Tp, __v> type;
+      constexpr operator value_type() const noexcept { return value; }
+
+
+
+
+
+
+    };
+
+  template<typename _Tp, _Tp __v>
+    constexpr _Tp integral_constant<_Tp, __v>::value;
+
+
+  typedef integral_constant<bool, true> true_type;
+
+
+  typedef integral_constant<bool, false> false_type;
+
+  template<bool __v>
+    using __bool_constant = integral_constant<bool, __v>;
+  template<bool, typename, typename>
+    struct conditional;
+
+  template<typename...>
+    struct __or_;
+
+  template<>
+    struct __or_<>
+    : public false_type
+    { };
+
+  template<typename _B1>
+    struct __or_<_B1>
+    : public _B1
+    { };
+
+  template<typename _B1, typename _B2>
+    struct __or_<_B1, _B2>
+    : public conditional<_B1::value, _B1, _B2>::type
+    { };
+
+  template<typename _B1, typename _B2, typename _B3, typename... _Bn>
+    struct __or_<_B1, _B2, _B3, _Bn...>
+    : public conditional<_B1::value, _B1, __or_<_B2, _B3, _Bn...>>::type
+    { };
+
+  template<typename...>
+    struct __and_;
+
+  template<>
+    struct __and_<>
+    : public true_type
+    { };
+
+  template<typename _B1>
+    struct __and_<_B1>
+    : public _B1
+    { };
+
+  template<typename _B1, typename _B2>
+    struct __and_<_B1, _B2>
+    : public conditional<_B1::value, _B2, _B1>::type
+    { };
+
+  template<typename _B1, typename _B2, typename _B3, typename... _Bn>
+    struct __and_<_B1, _B2, _B3, _Bn...>
+    : public conditional<_B1::value, __and_<_B2, _B3, _Bn...>, _B1>::type
+    { };
+
+  template<typename _Pp>
+    struct __not_
+    : public __bool_constant<!bool(_Pp::value)>
+    { };
+  template<typename _Tp>
+    struct __success_type
+    { typedef _Tp type; };
+
+  struct __failure_type
+  { };
+
+
+
+  template<typename>
+    struct remove_cv;
+
+  template<typename>
+    struct __is_void_helper
+    : public false_type { };
+
+  template<>
+    struct __is_void_helper<void>
+    : public true_type { };
+
+
+  template<typename _Tp>
+    struct is_void
+    : public __is_void_helper<typename remove_cv<_Tp>::type>::type
+    { };
+
+  template<typename>
+    struct __is_integral_helper
+    : public false_type { };
+
+  template<>
+    struct __is_integral_helper<bool>
+    : public true_type { };
+
+  template<>
+    struct __is_integral_helper<char>
+    : public true_type { };
+
+  template<>
+    struct __is_integral_helper<signed char>
+    : public true_type { };
+
+  template<>
+    struct __is_integral_helper<unsigned char>
+    : public true_type { };
+
+
+  template<>
+    struct __is_integral_helper<wchar_t>
+    : public true_type { };
+
+
+  template<>
+    struct __is_integral_helper<char16_t>
+    : public true_type { };
+
+  template<>
+    struct __is_integral_helper<char32_t>
+    : public true_type { };
+
+  template<>
+    struct __is_integral_helper<short>
+    : public true_type { };
+
+  template<>
+    struct __is_integral_helper<unsigned short>
+    : public true_type { };
+
+  template<>
+    struct __is_integral_helper<int>
+    : public true_type { };
+
+  template<>
+    struct __is_integral_helper<unsigned int>
+    : public true_type { };
+
+  template<>
+    struct __is_integral_helper<long>
+    : public true_type { };
+
+  template<>
+    struct __is_integral_helper<unsigned long>
+    : public true_type { };
+
+  template<>
+    struct __is_integral_helper<long long>
+    : public true_type { };
+
+  template<>
+    struct __is_integral_helper<unsigned long long>
+    : public true_type { };
+
+
+
+
+  template<>
+    struct __is_integral_helper<__int128>
+    : public true_type { };
+
+  template<>
+    struct __is_integral_helper<unsigned __int128>
+    : public true_type { };
+  template<typename _Tp>
+    struct is_integral
+    : public __is_integral_helper<typename remove_cv<_Tp>::type>::type
+    { };
+
+  template<typename>
+    struct __is_floating_point_helper
+    : public false_type { };
+
+  template<>
+    struct __is_floating_point_helper<float>
+    : public true_type { };
+
+  template<>
+    struct __is_floating_point_helper<double>
+    : public true_type { };
+
+  template<>
+    struct __is_floating_point_helper<long double>
+    : public true_type { };
+
+
+  template<>
+    struct __is_floating_point_helper<__float128>
+    : public true_type { };
+
+
+
+  template<typename _Tp>
+    struct is_floating_point
+    : public __is_floating_point_helper<typename remove_cv<_Tp>::type>::type
+    { };
+
+
+  template<typename>
+    struct is_array
+    : public false_type { };
+
+  template<typename _Tp, std::size_t _Size>
+    struct is_array<_Tp[_Size]>
+    : public true_type { };
+
+  template<typename _Tp>
+    struct is_array<_Tp[]>
+    : public true_type { };
+
+  template<typename>
+    struct __is_pointer_helper
+    : public false_type { };
+
+  template<typename _Tp>
+    struct __is_pointer_helper<_Tp*>
+    : public true_type { };
+
+
+  template<typename _Tp>
+    struct is_pointer
+    : public __is_pointer_helper<typename remove_cv<_Tp>::type>::type
+    { };
+
+
+  template<typename>
+    struct is_lvalue_reference
+    : public false_type { };
+
+  template<typename _Tp>
+    struct is_lvalue_reference<_Tp&>
+    : public true_type { };
+
+
+  template<typename>
+    struct is_rvalue_reference
+    : public false_type { };
+
+  template<typename _Tp>
+    struct is_rvalue_reference<_Tp&&>
+    : public true_type { };
+
+  template<typename>
+    struct is_function;
+
+  template<typename>
+    struct __is_member_object_pointer_helper
+    : public false_type { };
+
+  template<typename _Tp, typename _Cp>
+    struct __is_member_object_pointer_helper<_Tp _Cp::*>
+    : public __not_<is_function<_Tp>>::type { };
+
+
+  template<typename _Tp>
+    struct is_member_object_pointer
+    : public __is_member_object_pointer_helper<
+    typename remove_cv<_Tp>::type>::type
+    { };
+
+  template<typename>
+    struct __is_member_function_pointer_helper
+    : public false_type { };
+
+  template<typename _Tp, typename _Cp>
+    struct __is_member_function_pointer_helper<_Tp _Cp::*>
+    : public is_function<_Tp>::type { };
+
+
+  template<typename _Tp>
+    struct is_member_function_pointer
+    : public __is_member_function_pointer_helper<
+    typename remove_cv<_Tp>::type>::type
+    { };
+
+
+  template<typename _Tp>
+    struct is_enum
+    : public integral_constant<bool, __is_enum(_Tp)>
+    { };
+
+
+  template<typename _Tp>
+    struct is_union
+    : public integral_constant<bool, __is_union(_Tp)>
+    { };
+
+
+  template<typename _Tp>
+    struct is_class
+    : public integral_constant<bool, __is_class(_Tp)>
+    { };
+
+
+  template<typename>
+    struct is_function
+    : public false_type { };
+
+  template<typename _Res, typename... _ArgTypes >
+    struct is_function<_Res(_ArgTypes...) >
+    : public true_type { };
+
+  template<typename _Res, typename... _ArgTypes >
+    struct is_function<_Res(_ArgTypes...) & >
+    : public true_type { };
+
+  template<typename _Res, typename... _ArgTypes >
+    struct is_function<_Res(_ArgTypes...) && >
+    : public true_type { };
+
+  template<typename _Res, typename... _ArgTypes >
+    struct is_function<_Res(_ArgTypes......) >
+    : public true_type { };
+
+  template<typename _Res, typename... _ArgTypes >
+    struct is_function<_Res(_ArgTypes......) & >
+    : public true_type { };
+
+  template<typename _Res, typename... _ArgTypes >
+    struct is_function<_Res(_ArgTypes......) && >
+    : public true_type { };
+
+  template<typename _Res, typename... _ArgTypes >
+    struct is_function<_Res(_ArgTypes...) const >
+    : public true_type { };
+
+  template<typename _Res, typename... _ArgTypes >
+    struct is_function<_Res(_ArgTypes...) const & >
+    : public true_type { };
+
+  template<typename _Res, typename... _ArgTypes >
+    struct is_function<_Res(_ArgTypes...) const && >
+    : public true_type { };
+
+  template<typename _Res, typename... _ArgTypes >
+    struct is_function<_Res(_ArgTypes......) const >
+    : public true_type { };
+
+  template<typename _Res, typename... _ArgTypes >
+    struct is_function<_Res(_ArgTypes......) const & >
+    : public true_type { };
+
+  template<typename _Res, typename... _ArgTypes >
+    struct is_function<_Res(_ArgTypes......) const && >
+    : public true_type { };
+
+  template<typename _Res, typename... _ArgTypes >
+    struct is_function<_Res(_ArgTypes...) volatile >
+    : public true_type { };
+
+  template<typename _Res, typename... _ArgTypes >
+    struct is_function<_Res(_ArgTypes...) volatile & >
+    : public true_type { };
+
+  template<typename _Res, typename... _ArgTypes >
+    struct is_function<_Res(_ArgTypes...) volatile && >
+    : public true_type { };
+
+  template<typename _Res, typename... _ArgTypes >
+    struct is_function<_Res(_ArgTypes......) volatile >
+    : public true_type { };
+
+  template<typename _Res, typename... _ArgTypes >
+    struct is_function<_Res(_ArgTypes......) volatile & >
+    : public true_type { };
+
+  template<typename _Res, typename... _ArgTypes >
+    struct is_function<_Res(_ArgTypes......) volatile && >
+    : public true_type { };
+
+  template<typename _Res, typename... _ArgTypes >
+    struct is_function<_Res(_ArgTypes...) const volatile >
+    : public true_type { };
+
+  template<typename _Res, typename... _ArgTypes >
+    struct is_function<_Res(_ArgTypes...) const volatile & >
+    : public true_type { };
+
+  template<typename _Res, typename... _ArgTypes >
+    struct is_function<_Res(_ArgTypes...) const volatile && >
+    : public true_type { };
+
+  template<typename _Res, typename... _ArgTypes >
+    struct is_function<_Res(_ArgTypes......) const volatile >
+    : public true_type { };
+
+  template<typename _Res, typename... _ArgTypes >
+    struct is_function<_Res(_ArgTypes......) const volatile & >
+    : public true_type { };
+
+  template<typename _Res, typename... _ArgTypes >
+    struct is_function<_Res(_ArgTypes......) const volatile && >
+    : public true_type { };
+
+
+
+  template<typename>
+    struct __is_null_pointer_helper
+    : public false_type { };
+
+  template<>
+    struct __is_null_pointer_helper<std::nullptr_t>
+    : public true_type { };
+
+
+  template<typename _Tp>
+    struct is_null_pointer
+    : public __is_null_pointer_helper<typename remove_cv<_Tp>::type>::type
+    { };
+
+
+  template<typename _Tp>
+    struct __is_nullptr_t
+    : public is_null_pointer<_Tp>
+    { };
+
+
+
+
+  template<typename _Tp>
+    struct is_reference
+    : public __or_<is_lvalue_reference<_Tp>,
+                   is_rvalue_reference<_Tp>>::type
+    { };
+
+
+  template<typename _Tp>
+    struct is_arithmetic
+    : public __or_<is_integral<_Tp>, is_floating_point<_Tp>>::type
+    { };
+
+
+  template<typename _Tp>
+    struct is_fundamental
+    : public __or_<is_arithmetic<_Tp>, is_void<_Tp>,
+     is_null_pointer<_Tp>>::type
+    { };
+
+
+  template<typename _Tp>
+    struct is_object
+    : public __not_<__or_<is_function<_Tp>, is_reference<_Tp>,
+                          is_void<_Tp>>>::type
+    { };
+
+  template<typename>
+    struct is_member_pointer;
+
+
+  template<typename _Tp>
+    struct is_scalar
+    : public __or_<is_arithmetic<_Tp>, is_enum<_Tp>, is_pointer<_Tp>,
+                   is_member_pointer<_Tp>, is_null_pointer<_Tp>>::type
+    { };
+
+
+  template<typename _Tp>
+    struct is_compound
+    : public __not_<is_fundamental<_Tp>>::type { };
+
+  template<typename _Tp>
+    struct __is_member_pointer_helper
+    : public false_type { };
+
+  template<typename _Tp, typename _Cp>
+    struct __is_member_pointer_helper<_Tp _Cp::*>
+    : public true_type { };
+
+
+  template<typename _Tp>
+    struct is_member_pointer
+    : public __is_member_pointer_helper<typename remove_cv<_Tp>::type>::type
+    { };
+
+
+
+  template<typename _Tp>
+    struct __is_referenceable
+    : public __or_<is_object<_Tp>, is_reference<_Tp>>::type
+    { };
+
+  template<typename _Res, typename... _Args >
+    struct __is_referenceable<_Res(_Args...) >
+    : public true_type
+    { };
+
+  template<typename _Res, typename... _Args >
+    struct __is_referenceable<_Res(_Args......) >
+    : public true_type
+    { };
+
+
+
+
+  template<typename>
+    struct is_const
+    : public false_type { };
+
+  template<typename _Tp>
+    struct is_const<_Tp const>
+    : public true_type { };
+
+
+  template<typename>
+    struct is_volatile
+    : public false_type { };
+
+  template<typename _Tp>
+    struct is_volatile<_Tp volatile>
+    : public true_type { };
+
+
+  template<typename _Tp>
+    struct is_trivial
+    : public integral_constant<bool, __is_trivial(_Tp)>
+    { };
+
+
+  template<typename _Tp>
+    struct is_trivially_copyable
+    : public integral_constant<bool, __is_trivially_copyable(_Tp)>
+    { };
+
+
+  template<typename _Tp>
+    struct is_standard_layout
+    : public integral_constant<bool, __is_standard_layout(_Tp)>
+    { };
+
+
+
+  template<typename _Tp>
+    struct is_pod
+    : public integral_constant<bool, __is_pod(_Tp)>
+    { };
+
+
+  template<typename _Tp>
+    struct is_literal_type
+    : public integral_constant<bool, __is_literal_type(_Tp)>
+    { };
+
+
+  template<typename _Tp>
+    struct is_empty
+    : public integral_constant<bool, __is_empty(_Tp)>
+    { };
+
+
+  template<typename _Tp>
+    struct is_polymorphic
+    : public integral_constant<bool, __is_polymorphic(_Tp)>
+    { };
+  template<typename _Tp>
+    struct is_abstract
+    : public integral_constant<bool, __is_abstract(_Tp)>
+    { };
+
+  template<typename _Tp,
+    bool = is_arithmetic<_Tp>::value>
+    struct __is_signed_helper
+    : public false_type { };
+
+  template<typename _Tp>
+    struct __is_signed_helper<_Tp, true>
+    : public integral_constant<bool, _Tp(-1) < _Tp(0)>
+    { };
+
+
+  template<typename _Tp>
+    struct is_signed
+    : public __is_signed_helper<_Tp>::type
+    { };
+
+
+  template<typename _Tp>
+    struct is_unsigned
+    : public __and_<is_arithmetic<_Tp>, __not_<is_signed<_Tp>>>
+    { };
+  template<typename _Tp, typename _Up = _Tp&&>
+    _Up
+    __declval(int);
+
+  template<typename _Tp>
+    _Tp
+    __declval(long);
+
+  template<typename _Tp>
+    auto declval() noexcept -> decltype(__declval<_Tp>(0));
+
+  template<typename, unsigned = 0>
+    struct extent;
+
+  template<typename>
+    struct remove_all_extents;
+
+  template<typename _Tp>
+    struct __is_array_known_bounds
+    : public integral_constant<bool, (extent<_Tp>::value > 0)>
+    { };
+
+  template<typename _Tp>
+    struct __is_array_unknown_bounds
+    : public __and_<is_array<_Tp>, __not_<extent<_Tp>>>
+    { };
+
+
+
+
+
+
+  struct __do_is_destructible_impl
+  {
+    template<typename _Tp, typename = decltype(declval<_Tp&>().~_Tp())>
+      static true_type __test(int);
+
+    template<typename>
+      static false_type __test(...);
+  };
+
+  template<typename _Tp>
+    struct __is_destructible_impl
+    : public __do_is_destructible_impl
+    {
+      typedef decltype(__test<_Tp>(0)) type;
+    };
+
+  template<typename _Tp,
+           bool = __or_<is_void<_Tp>,
+                        __is_array_unknown_bounds<_Tp>,
+                        is_function<_Tp>>::value,
+           bool = __or_<is_reference<_Tp>, is_scalar<_Tp>>::value>
+    struct __is_destructible_safe;
+
+  template<typename _Tp>
+    struct __is_destructible_safe<_Tp, false, false>
+    : public __is_destructible_impl<typename
+               remove_all_extents<_Tp>::type>::type
+    { };
+
+  template<typename _Tp>
+    struct __is_destructible_safe<_Tp, true, false>
+    : public false_type { };
+
+  template<typename _Tp>
+    struct __is_destructible_safe<_Tp, false, true>
+    : public true_type { };
+
+
+  template<typename _Tp>
+    struct is_destructible
+    : public __is_destructible_safe<_Tp>::type
+    { };
+
+
+
+
+
+  struct __do_is_nt_destructible_impl
+  {
+    template<typename _Tp>
+      static __bool_constant<noexcept(declval<_Tp&>().~_Tp())>
+      __test(int);
+
+    template<typename>
+      static false_type __test(...);
+  };
+
+  template<typename _Tp>
+    struct __is_nt_destructible_impl
+    : public __do_is_nt_destructible_impl
+    {
+      typedef decltype(__test<_Tp>(0)) type;
+    };
+
+  template<typename _Tp,
+           bool = __or_<is_void<_Tp>,
+                        __is_array_unknown_bounds<_Tp>,
+                        is_function<_Tp>>::value,
+           bool = __or_<is_reference<_Tp>, is_scalar<_Tp>>::value>
+    struct __is_nt_destructible_safe;
+
+  template<typename _Tp>
+    struct __is_nt_destructible_safe<_Tp, false, false>
+    : public __is_nt_destructible_impl<typename
+               remove_all_extents<_Tp>::type>::type
+    { };
+
+  template<typename _Tp>
+    struct __is_nt_destructible_safe<_Tp, true, false>
+    : public false_type { };
+
+  template<typename _Tp>
+    struct __is_nt_destructible_safe<_Tp, false, true>
+    : public true_type { };
+
+
+  template<typename _Tp>
+    struct is_nothrow_destructible
+    : public __is_nt_destructible_safe<_Tp>::type
+    { };
+
+  struct __do_is_default_constructible_impl
+  {
+    template<typename _Tp, typename = decltype(_Tp())>
+      static true_type __test(int);
+
+    template<typename>
+      static false_type __test(...);
+  };
+
+  template<typename _Tp>
+    struct __is_default_constructible_impl
+    : public __do_is_default_constructible_impl
+    {
+      typedef decltype(__test<_Tp>(0)) type;
+    };
+
+  template<typename _Tp>
+    struct __is_default_constructible_atom
+    : public __and_<__not_<is_void<_Tp>>,
+                    __is_default_constructible_impl<_Tp>>
+    { };
+
+  template<typename _Tp, bool = is_array<_Tp>::value>
+    struct __is_default_constructible_safe;
+
+
+
+
+
+
+  template<typename _Tp>
+    struct __is_default_constructible_safe<_Tp, true>
+    : public __and_<__is_array_known_bounds<_Tp>,
+      __is_default_constructible_atom<typename
+                      remove_all_extents<_Tp>::type>>
+    { };
+
+  template<typename _Tp>
+    struct __is_default_constructible_safe<_Tp, false>
+    : public __is_default_constructible_atom<_Tp>::type
+    { };
+
+
+  template<typename _Tp>
+    struct is_default_constructible
+    : public __is_default_constructible_safe<_Tp>::type
+    { };
+
+
+  template<typename _Tp, typename... _Args>
+    struct is_constructible
+      : public __bool_constant<__is_constructible(_Tp, _Args...)>
+    { };
+
+  template<typename _Tp, bool = __is_referenceable<_Tp>::value>
+    struct __is_copy_constructible_impl;
+
+  template<typename _Tp>
+    struct __is_copy_constructible_impl<_Tp, false>
+    : public false_type { };
+
+  template<typename _Tp>
+    struct __is_copy_constructible_impl<_Tp, true>
+    : public is_constructible<_Tp, const _Tp&>
+    { };
+
+
+  template<typename _Tp>
+    struct is_copy_constructible
+    : public __is_copy_constructible_impl<_Tp>
+    { };
+
+  template<typename _Tp, bool = __is_referenceable<_Tp>::value>
+    struct __is_move_constructible_impl;
+
+  template<typename _Tp>
+    struct __is_move_constructible_impl<_Tp, false>
+    : public false_type { };
+
+  template<typename _Tp>
+    struct __is_move_constructible_impl<_Tp, true>
+    : public is_constructible<_Tp, _Tp&&>
+    { };
+
+
+  template<typename _Tp>
+    struct is_move_constructible
+    : public __is_move_constructible_impl<_Tp>
+    { };
+
+  template<typename _Tp>
+    struct __is_nt_default_constructible_atom
+    : public integral_constant<bool, noexcept(_Tp())>
+    { };
+
+  template<typename _Tp, bool = is_array<_Tp>::value>
+    struct __is_nt_default_constructible_impl;
+
+  template<typename _Tp>
+    struct __is_nt_default_constructible_impl<_Tp, true>
+    : public __and_<__is_array_known_bounds<_Tp>,
+      __is_nt_default_constructible_atom<typename
+                      remove_all_extents<_Tp>::type>>
+    { };
+
+  template<typename _Tp>
+    struct __is_nt_default_constructible_impl<_Tp, false>
+    : public __is_nt_default_constructible_atom<_Tp>
+    { };
+
+
+  template<typename _Tp>
+    struct is_nothrow_default_constructible
+    : public __and_<is_default_constructible<_Tp>,
+                    __is_nt_default_constructible_impl<_Tp>>
+    { };
+
+  template<typename _Tp, typename... _Args>
+    struct __is_nt_constructible_impl
+    : public integral_constant<bool, noexcept(_Tp(declval<_Args>()...))>
+    { };
+
+  template<typename _Tp, typename _Arg>
+    struct __is_nt_constructible_impl<_Tp, _Arg>
+    : public integral_constant<bool,
+                               noexcept(static_cast<_Tp>(declval<_Arg>()))>
+    { };
+
+  template<typename _Tp>
+    struct __is_nt_constructible_impl<_Tp>
+    : public is_nothrow_default_constructible<_Tp>
+    { };
+
+
+  template<typename _Tp, typename... _Args>
+    struct is_nothrow_constructible
+    : public __and_<is_constructible<_Tp, _Args...>,
+      __is_nt_constructible_impl<_Tp, _Args...>>
+    { };
+
+  template<typename _Tp, bool = __is_referenceable<_Tp>::value>
+    struct __is_nothrow_copy_constructible_impl;
+
+  template<typename _Tp>
+    struct __is_nothrow_copy_constructible_impl<_Tp, false>
+    : public false_type { };
+
+  template<typename _Tp>
+    struct __is_nothrow_copy_constructible_impl<_Tp, true>
+    : public is_nothrow_constructible<_Tp, const _Tp&>
+    { };
+
+
+  template<typename _Tp>
+    struct is_nothrow_copy_constructible
+    : public __is_nothrow_copy_constructible_impl<_Tp>
+    { };
+
+  template<typename _Tp, bool = __is_referenceable<_Tp>::value>
+    struct __is_nothrow_move_constructible_impl;
+
+  template<typename _Tp>
+    struct __is_nothrow_move_constructible_impl<_Tp, false>
+    : public false_type { };
+
+  template<typename _Tp>
+    struct __is_nothrow_move_constructible_impl<_Tp, true>
+    : public is_nothrow_constructible<_Tp, _Tp&&>
+    { };
+
+
+  template<typename _Tp>
+    struct is_nothrow_move_constructible
+    : public __is_nothrow_move_constructible_impl<_Tp>
+    { };
+
+
+  template<typename _Tp, typename _Up>
+    struct is_assignable
+      : public __bool_constant<__is_assignable(_Tp, _Up)>
+    { };
+
+  template<typename _Tp, bool = __is_referenceable<_Tp>::value>
+    struct __is_copy_assignable_impl;
+
+  template<typename _Tp>
+    struct __is_copy_assignable_impl<_Tp, false>
+    : public false_type { };
+
+  template<typename _Tp>
+    struct __is_copy_assignable_impl<_Tp, true>
+    : public is_assignable<_Tp&, const _Tp&>
+    { };
+
+
+  template<typename _Tp>
+    struct is_copy_assignable
+    : public __is_copy_assignable_impl<_Tp>
+    { };
+
+  template<typename _Tp, bool = __is_referenceable<_Tp>::value>
+    struct __is_move_assignable_impl;
+
+  template<typename _Tp>
+    struct __is_move_assignable_impl<_Tp, false>
+    : public false_type { };
+
+  template<typename _Tp>
+    struct __is_move_assignable_impl<_Tp, true>
+    : public is_assignable<_Tp&, _Tp&&>
+    { };
+
+
+  template<typename _Tp>
+    struct is_move_assignable
+    : public __is_move_assignable_impl<_Tp>
+    { };
+
+  template<typename _Tp, typename _Up>
+    struct __is_nt_assignable_impl
+    : public integral_constant<bool, noexcept(declval<_Tp>() = declval<_Up>())>
+    { };
+
+
+  template<typename _Tp, typename _Up>
+    struct is_nothrow_assignable
+    : public __and_<is_assignable<_Tp, _Up>,
+      __is_nt_assignable_impl<_Tp, _Up>>
+    { };
+
+  template<typename _Tp, bool = __is_referenceable<_Tp>::value>
+    struct __is_nt_copy_assignable_impl;
+
+  template<typename _Tp>
+    struct __is_nt_copy_assignable_impl<_Tp, false>
+    : public false_type { };
+
+  template<typename _Tp>
+    struct __is_nt_copy_assignable_impl<_Tp, true>
+    : public is_nothrow_assignable<_Tp&, const _Tp&>
+    { };
+
+
+  template<typename _Tp>
+    struct is_nothrow_copy_assignable
+    : public __is_nt_copy_assignable_impl<_Tp>
+    { };
+
+  template<typename _Tp, bool = __is_referenceable<_Tp>::value>
+    struct __is_nt_move_assignable_impl;
+
+  template<typename _Tp>
+    struct __is_nt_move_assignable_impl<_Tp, false>
+    : public false_type { };
+
+  template<typename _Tp>
+    struct __is_nt_move_assignable_impl<_Tp, true>
+    : public is_nothrow_assignable<_Tp&, _Tp&&>
+    { };
+
+
+  template<typename _Tp>
+    struct is_nothrow_move_assignable
+    : public __is_nt_move_assignable_impl<_Tp>
+    { };
+
+
+  template<typename _Tp, typename... _Args>
+    struct is_trivially_constructible
+    : public __bool_constant<__is_trivially_constructible(_Tp, _Args...)>
+    { };
+
+
+  template<typename _Tp>
+    struct is_trivially_default_constructible
+    : public is_trivially_constructible<_Tp>::type
+    { };
+
+  struct __do_is_implicitly_default_constructible_impl
+  {
+    template <typename _Tp>
+    static void __helper(const _Tp&);
+
+    template <typename _Tp>
+    static true_type __test(const _Tp&,
+                            decltype(__helper<const _Tp&>({}))* = 0);
+
+    static false_type __test(...);
+  };
+
+  template<typename _Tp>
+    struct __is_implicitly_default_constructible_impl
+    : public __do_is_implicitly_default_constructible_impl
+    {
+      typedef decltype(__test(declval<_Tp>())) type;
+    };
+
+  template<typename _Tp>
+    struct __is_implicitly_default_constructible_safe
+    : public __is_implicitly_default_constructible_impl<_Tp>::type
+    { };
+
+  template <typename _Tp>
+    struct __is_implicitly_default_constructible
+    : public __and_<is_default_constructible<_Tp>,
+      __is_implicitly_default_constructible_safe<_Tp>>
+    { };
+
+
+
+  template<typename _Tp, bool = __is_referenceable<_Tp>::value>
+    struct __is_trivially_copy_constructible_impl;
+
+  template<typename _Tp>
+    struct __is_trivially_copy_constructible_impl<_Tp, false>
+    : public false_type { };
+
+  template<typename _Tp>
+    struct __is_trivially_copy_constructible_impl<_Tp, true>
+    : public __and_<is_copy_constructible<_Tp>,
+      integral_constant<bool,
+   __is_trivially_constructible(_Tp, const _Tp&)>>
+    { };
+
+  template<typename _Tp>
+    struct is_trivially_copy_constructible
+    : public __is_trivially_copy_constructible_impl<_Tp>
+    { };
+
+
+
+  template<typename _Tp, bool = __is_referenceable<_Tp>::value>
+    struct __is_trivially_move_constructible_impl;
+
+  template<typename _Tp>
+    struct __is_trivially_move_constructible_impl<_Tp, false>
+    : public false_type { };
+
+  template<typename _Tp>
+    struct __is_trivially_move_constructible_impl<_Tp, true>
+    : public __and_<is_move_constructible<_Tp>,
+      integral_constant<bool,
+   __is_trivially_constructible(_Tp, _Tp&&)>>
+    { };
+
+  template<typename _Tp>
+    struct is_trivially_move_constructible
+    : public __is_trivially_move_constructible_impl<_Tp>
+    { };
+
+
+  template<typename _Tp, typename _Up>
+    struct is_trivially_assignable
+    : public __bool_constant<__is_trivially_assignable(_Tp, _Up)>
+    { };
+
+
+
+  template<typename _Tp, bool = __is_referenceable<_Tp>::value>
+    struct __is_trivially_copy_assignable_impl;
+
+  template<typename _Tp>
+    struct __is_trivially_copy_assignable_impl<_Tp, false>
+    : public false_type { };
+
+  template<typename _Tp>
+    struct __is_trivially_copy_assignable_impl<_Tp, true>
+    : public __bool_constant<__is_trivially_assignable(_Tp&, const _Tp&)>
+    { };
+
+  template<typename _Tp>
+    struct is_trivially_copy_assignable
+    : public __is_trivially_copy_assignable_impl<_Tp>
+    { };
+
+
+
+  template<typename _Tp, bool = __is_referenceable<_Tp>::value>
+    struct __is_trivially_move_assignable_impl;
+
+  template<typename _Tp>
+    struct __is_trivially_move_assignable_impl<_Tp, false>
+    : public false_type { };
+
+  template<typename _Tp>
+    struct __is_trivially_move_assignable_impl<_Tp, true>
+    : public __bool_constant<__is_trivially_assignable(_Tp&, _Tp&&)>
+    { };
+
+  template<typename _Tp>
+    struct is_trivially_move_assignable
+    : public __is_trivially_move_assignable_impl<_Tp>
+    { };
+
+
+  template<typename _Tp>
+    struct is_trivially_destructible
+    : public __and_<is_destructible<_Tp>,
+      __bool_constant<__has_trivial_destructor(_Tp)>>
+    { };
+
+
+
+  template<typename _Tp>
+    struct has_virtual_destructor
+    : public integral_constant<bool, __has_virtual_destructor(_Tp)>
+    { };
+
+
+
+
+
+  template<typename _Tp>
+    struct alignment_of
+    : public integral_constant<std::size_t, __alignof__(_Tp)> { };
+
+
+  template<typename>
+    struct rank
+    : public integral_constant<std::size_t, 0> { };
+
+  template<typename _Tp, std::size_t _Size>
+    struct rank<_Tp[_Size]>
+    : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
+
+  template<typename _Tp>
+    struct rank<_Tp[]>
+    : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
+
+
+  template<typename, unsigned _Uint>
+    struct extent
+    : public integral_constant<std::size_t, 0> { };
+
+  template<typename _Tp, unsigned _Uint, std::size_t _Size>
+    struct extent<_Tp[_Size], _Uint>
+    : public integral_constant<std::size_t,
+          _Uint == 0 ? _Size : extent<_Tp,
+          _Uint - 1>::value>
+    { };
+
+  template<typename _Tp, unsigned _Uint>
+    struct extent<_Tp[], _Uint>
+    : public integral_constant<std::size_t,
+          _Uint == 0 ? 0 : extent<_Tp,
+             _Uint - 1>::value>
+    { };
+
+
+
+
+
+  template<typename, typename>
+    struct is_same
+    : public false_type { };
+
+  template<typename _Tp>
+    struct is_same<_Tp, _Tp>
+    : public true_type { };
+
+
+  template<typename _Base, typename _Derived>
+    struct is_base_of
+    : public integral_constant<bool, __is_base_of(_Base, _Derived)>
+    { };
+
+  template<typename _From, typename _To,
+           bool = __or_<is_void<_From>, is_function<_To>,
+                        is_array<_To>>::value>
+    struct __is_convertible_helper
+    {
+      typedef typename is_void<_To>::type type;
+
+
+
+    };
+
+  template<typename _From, typename _To>
+    class __is_convertible_helper<_From, _To, false>
+    {
+      template<typename _To1>
+ static void __test_aux(_To1) noexcept;
+
+      template<typename _From1, typename _To1,
+        typename = decltype(__test_aux<_To1>(std::declval<_From1>()))>
+ static true_type
+ __test(int);
+
+      template<typename, typename>
+ static false_type
+ __test(...);
+    public:
+      typedef decltype(__test<_From, _To>(0)) type;
+
+
+
+
+    };
+
+
+
+  template<typename _From, typename _To>
+    struct is_convertible
+    : public __is_convertible_helper<_From, _To>::type
+    { };
+  template<typename _Tp>
+    struct remove_const
+    { typedef _Tp type; };
+
+  template<typename _Tp>
+    struct remove_const<_Tp const>
+    { typedef _Tp type; };
+
+
+  template<typename _Tp>
+    struct remove_volatile
+    { typedef _Tp type; };
+
+  template<typename _Tp>
+    struct remove_volatile<_Tp volatile>
+    { typedef _Tp type; };
+
+
+  template<typename _Tp>
+    struct remove_cv
+    {
+      typedef typename
+      remove_const<typename remove_volatile<_Tp>::type>::type type;
+    };
+
+
+  template<typename _Tp>
+    struct add_const
+    { typedef _Tp const type; };
+
+
+  template<typename _Tp>
+    struct add_volatile
+    { typedef _Tp volatile type; };
+
+
+  template<typename _Tp>
+    struct add_cv
+    {
+      typedef typename
+      add_const<typename add_volatile<_Tp>::type>::type type;
+    };
+  template<typename _Tp>
+    struct remove_reference
+    { typedef _Tp type; };
+
+  template<typename _Tp>
+    struct remove_reference<_Tp&>
+    { typedef _Tp type; };
+
+  template<typename _Tp>
+    struct remove_reference<_Tp&&>
+    { typedef _Tp type; };
+
+  template<typename _Tp, bool = __is_referenceable<_Tp>::value>
+    struct __add_lvalue_reference_helper
+    { typedef _Tp type; };
+
+  template<typename _Tp>
+    struct __add_lvalue_reference_helper<_Tp, true>
+    { typedef _Tp& type; };
+
+
+  template<typename _Tp>
+    struct add_lvalue_reference
+    : public __add_lvalue_reference_helper<_Tp>
+    { };
+
+  template<typename _Tp, bool = __is_referenceable<_Tp>::value>
+    struct __add_rvalue_reference_helper
+    { typedef _Tp type; };
+
+  template<typename _Tp>
+    struct __add_rvalue_reference_helper<_Tp, true>
+    { typedef _Tp&& type; };
+
+
+  template<typename _Tp>
+    struct add_rvalue_reference
+    : public __add_rvalue_reference_helper<_Tp>
+    { };
+  template<typename _Unqualified, bool _IsConst, bool _IsVol>
+    struct __cv_selector;
+
+  template<typename _Unqualified>
+    struct __cv_selector<_Unqualified, false, false>
+    { typedef _Unqualified __type; };
+
+  template<typename _Unqualified>
+    struct __cv_selector<_Unqualified, false, true>
+    { typedef volatile _Unqualified __type; };
+
+  template<typename _Unqualified>
+    struct __cv_selector<_Unqualified, true, false>
+    { typedef const _Unqualified __type; };
+
+  template<typename _Unqualified>
+    struct __cv_selector<_Unqualified, true, true>
+    { typedef const volatile _Unqualified __type; };
+
+  template<typename _Qualified, typename _Unqualified,
+    bool _IsConst = is_const<_Qualified>::value,
+    bool _IsVol = is_volatile<_Qualified>::value>
+    class __match_cv_qualifiers
+    {
+      typedef __cv_selector<_Unqualified, _IsConst, _IsVol> __match;
+
+    public:
+      typedef typename __match::__type __type;
+    };
+
+
+  template<typename _Tp>
+    struct __make_unsigned
+    { typedef _Tp __type; };
+
+  template<>
+    struct __make_unsigned<char>
+    { typedef unsigned char __type; };
+
+  template<>
+    struct __make_unsigned<signed char>
+    { typedef unsigned char __type; };
+
+  template<>
+    struct __make_unsigned<short>
+    { typedef unsigned short __type; };
+
+  template<>
+    struct __make_unsigned<int>
+    { typedef unsigned int __type; };
+
+  template<>
+    struct __make_unsigned<long>
+    { typedef unsigned long __type; };
+
+  template<>
+    struct __make_unsigned<long long>
+    { typedef unsigned long long __type; };
+
+
+  template<>
+    struct __make_unsigned<__int128>
+    { typedef unsigned __int128 __type; };
+  template<typename _Tp,
+    bool _IsInt = is_integral<_Tp>::value,
+    bool _IsEnum = is_enum<_Tp>::value>
+    class __make_unsigned_selector;
+
+  template<typename _Tp>
+    class __make_unsigned_selector<_Tp, true, false>
+    {
+      using __unsigned_type
+ = typename __make_unsigned<typename remove_cv<_Tp>::type>::__type;
+
+    public:
+      using __type
+ = typename __match_cv_qualifiers<_Tp, __unsigned_type>::__type;
+    };
+
+  class __make_unsigned_selector_base
+  {
+  protected:
+    template<typename...> struct _List { };
+
+    template<typename _Tp, typename... _Up>
+      struct _List<_Tp, _Up...> : _List<_Up...>
+      { static constexpr size_t __size = sizeof(_Tp); };
+
+    template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)>
+      struct __select;
+
+    template<size_t _Sz, typename _Uint, typename... _UInts>
+      struct __select<_Sz, _List<_Uint, _UInts...>, true>
+      { using __type = _Uint; };
+
+    template<size_t _Sz, typename _Uint, typename... _UInts>
+      struct __select<_Sz, _List<_Uint, _UInts...>, false>
+      : __select<_Sz, _List<_UInts...>>
+      { };
+  };
+
+
+  template<typename _Tp>
+    class __make_unsigned_selector<_Tp, false, true>
+    : __make_unsigned_selector_base
+    {
+
+      using _UInts = _List<unsigned char, unsigned short, unsigned int,
+      unsigned long, unsigned long long>;
+
+      using __unsigned_type = typename __select<sizeof(_Tp), _UInts>::__type;
+
+    public:
+      using __type
+ = typename __match_cv_qualifiers<_Tp, __unsigned_type>::__type;
+    };
+
+
+
+
+
+
+  template<>
+    struct __make_unsigned<wchar_t>
+    {
+      using __type
+ = typename __make_unsigned_selector<wchar_t, false, true>::__type;
+    };
+
+
+  template<>
+    struct __make_unsigned<char16_t>
+    {
+      using __type
+ = typename __make_unsigned_selector<char16_t, false, true>::__type;
+    };
+
+  template<>
+    struct __make_unsigned<char32_t>
+    {
+      using __type
+ = typename __make_unsigned_selector<char32_t, false, true>::__type;
+    };
+
+
+
+
+
+  template<typename _Tp>
+    struct make_unsigned
+    { typedef typename __make_unsigned_selector<_Tp>::__type type; };
+
+
+  template<>
+    struct make_unsigned<bool>;
+
+
+
+  template<typename _Tp>
+    struct __make_signed
+    { typedef _Tp __type; };
+
+  template<>
+    struct __make_signed<char>
+    { typedef signed char __type; };
+
+  template<>
+    struct __make_signed<unsigned char>
+    { typedef signed char __type; };
+
+  template<>
+    struct __make_signed<unsigned short>
+    { typedef signed short __type; };
+
+  template<>
+    struct __make_signed<unsigned int>
+    { typedef signed int __type; };
+
+  template<>
+    struct __make_signed<unsigned long>
+    { typedef signed long __type; };
+
+  template<>
+    struct __make_signed<unsigned long long>
+    { typedef signed long long __type; };
+
+
+  template<>
+    struct __make_signed<unsigned __int128>
+    { typedef __int128 __type; };
+  template<typename _Tp,
+    bool _IsInt = is_integral<_Tp>::value,
+    bool _IsEnum = is_enum<_Tp>::value>
+    class __make_signed_selector;
+
+  template<typename _Tp>
+    class __make_signed_selector<_Tp, true, false>
+    {
+      using __signed_type
+ = typename __make_signed<typename remove_cv<_Tp>::type>::__type;
+
+    public:
+      using __type
+ = typename __match_cv_qualifiers<_Tp, __signed_type>::__type;
+    };
+
+
+  template<typename _Tp>
+    class __make_signed_selector<_Tp, false, true>
+    {
+      typedef typename __make_unsigned_selector<_Tp>::__type __unsigned_type;
+
+    public:
+      typedef typename __make_signed_selector<__unsigned_type>::__type __type;
+    };
+
+
+
+
+
+
+  template<>
+    struct __make_signed<wchar_t>
+    {
+      using __type
+ = typename __make_signed_selector<wchar_t, false, true>::__type;
+    };
+
+
+  template<>
+    struct __make_signed<char16_t>
+    {
+      using __type
+ = typename __make_signed_selector<char16_t, false, true>::__type;
+    };
+
+  template<>
+    struct __make_signed<char32_t>
+    {
+      using __type
+ = typename __make_signed_selector<char32_t, false, true>::__type;
+    };
+
+
+
+
+
+  template<typename _Tp>
+    struct make_signed
+    { typedef typename __make_signed_selector<_Tp>::__type type; };
+
+
+  template<>
+    struct make_signed<bool>;
+  template<typename _Tp>
+    struct remove_extent
+    { typedef _Tp type; };
+
+  template<typename _Tp, std::size_t _Size>
+    struct remove_extent<_Tp[_Size]>
+    { typedef _Tp type; };
+
+  template<typename _Tp>
+    struct remove_extent<_Tp[]>
+    { typedef _Tp type; };
+
+
+  template<typename _Tp>
+    struct remove_all_extents
+    { typedef _Tp type; };
+
+  template<typename _Tp, std::size_t _Size>
+    struct remove_all_extents<_Tp[_Size]>
+    { typedef typename remove_all_extents<_Tp>::type type; };
+
+  template<typename _Tp>
+    struct remove_all_extents<_Tp[]>
+    { typedef typename remove_all_extents<_Tp>::type type; };
+  template<typename _Tp, typename>
+    struct __remove_pointer_helper
+    { typedef _Tp type; };
+
+  template<typename _Tp, typename _Up>
+    struct __remove_pointer_helper<_Tp, _Up*>
+    { typedef _Up type; };
+
+
+  template<typename _Tp>
+    struct remove_pointer
+    : public __remove_pointer_helper<_Tp, typename remove_cv<_Tp>::type>
+    { };
+
+
+  template<typename _Tp, bool = __or_<__is_referenceable<_Tp>,
+          is_void<_Tp>>::value>
+    struct __add_pointer_helper
+    { typedef _Tp type; };
+
+  template<typename _Tp>
+    struct __add_pointer_helper<_Tp, true>
+    { typedef typename remove_reference<_Tp>::type* type; };
+
+  template<typename _Tp>
+    struct add_pointer
+    : public __add_pointer_helper<_Tp>
+    { };
+  template<std::size_t _Len>
+    struct __aligned_storage_msa
+    {
+      union __type
+      {
+ unsigned char __data[_Len];
+ struct __attribute__((__aligned__)) { } __align;
+      };
+    };
+  template<std::size_t _Len, std::size_t _Align =
+    __alignof__(typename __aligned_storage_msa<_Len>::__type)>
+    struct aligned_storage
+    {
+      union type
+      {
+ unsigned char __data[_Len];
+ struct __attribute__((__aligned__((_Align)))) { } __align;
+      };
+    };
+
+  template <typename... _Types>
+    struct __strictest_alignment
+    {
+      static const size_t _S_alignment = 0;
+      static const size_t _S_size = 0;
+    };
+
+  template <typename _Tp, typename... _Types>
+    struct __strictest_alignment<_Tp, _Types...>
+    {
+      static const size_t _S_alignment =
+        alignof(_Tp) > __strictest_alignment<_Types...>::_S_alignment
+ ? alignof(_Tp) : __strictest_alignment<_Types...>::_S_alignment;
+      static const size_t _S_size =
+        sizeof(_Tp) > __strictest_alignment<_Types...>::_S_size
+ ? sizeof(_Tp) : __strictest_alignment<_Types...>::_S_size;
+    };
+  template <size_t _Len, typename... _Types>
+    struct aligned_union
+    {
+    private:
+      static_assert(sizeof...(_Types) != 0, "At least one type is required");
+
+      using __strictest = __strictest_alignment<_Types...>;
+      static const size_t _S_len = _Len > __strictest::_S_size
+ ? _Len : __strictest::_S_size;
+    public:
+
+      static const size_t alignment_value = __strictest::_S_alignment;
+
+      typedef typename aligned_storage<_S_len, alignment_value>::type type;
+    };
+
+  template <size_t _Len, typename... _Types>
+    const size_t aligned_union<_Len, _Types...>::alignment_value;
+
+
+
+  template<typename _Up,
+    bool _IsArray = is_array<_Up>::value,
+    bool _IsFunction = is_function<_Up>::value>
+    struct __decay_selector;
+
+
+  template<typename _Up>
+    struct __decay_selector<_Up, false, false>
+    { typedef typename remove_cv<_Up>::type __type; };
+
+  template<typename _Up>
+    struct __decay_selector<_Up, true, false>
+    { typedef typename remove_extent<_Up>::type* __type; };
+
+  template<typename _Up>
+    struct __decay_selector<_Up, false, true>
+    { typedef typename add_pointer<_Up>::type __type; };
+
+
+  template<typename _Tp>
+    class decay
+    {
+      typedef typename remove_reference<_Tp>::type __remove_type;
+
+    public:
+      typedef typename __decay_selector<__remove_type>::__type type;
+    };
+
+  template<typename _Tp>
+    class reference_wrapper;
+
+
+  template<typename _Tp>
+    struct __strip_reference_wrapper
+    {
+      typedef _Tp __type;
+    };
+
+  template<typename _Tp>
+    struct __strip_reference_wrapper<reference_wrapper<_Tp> >
+    {
+      typedef _Tp& __type;
+    };
+
+  template<typename _Tp>
+    struct __decay_and_strip
+    {
+      typedef typename __strip_reference_wrapper<
+ typename decay<_Tp>::type>::__type __type;
+    };
+
+
+
+
+  template<bool, typename _Tp = void>
+    struct enable_if
+    { };
+
+
+  template<typename _Tp>
+    struct enable_if<true, _Tp>
+    { typedef _Tp type; };
+
+  template<typename... _Cond>
+    using _Require = typename enable_if<__and_<_Cond...>::value>::type;
+
+
+
+  template<bool _Cond, typename _Iftrue, typename _Iffalse>
+    struct conditional
+    { typedef _Iftrue type; };
+
+
+  template<typename _Iftrue, typename _Iffalse>
+    struct conditional<false, _Iftrue, _Iffalse>
+    { typedef _Iffalse type; };
+
+
+  template<typename... _Tp>
+    struct common_type;
+
+
+
+  struct __do_common_type_impl
+  {
+    template<typename _Tp, typename _Up>
+      static __success_type<typename decay<decltype
+       (true ? std::declval<_Tp>()
+        : std::declval<_Up>())>::type> _S_test(int);
+
+    template<typename, typename>
+      static __failure_type _S_test(...);
+  };
+
+  template<typename _Tp, typename _Up>
+    struct __common_type_impl
+    : private __do_common_type_impl
+    {
+      typedef decltype(_S_test<_Tp, _Up>(0)) type;
+    };
+
+  struct __do_member_type_wrapper
+  {
+    template<typename _Tp>
+      static __success_type<typename _Tp::type> _S_test(int);
+
+    template<typename>
+      static __failure_type _S_test(...);
+  };
+
+  template<typename _Tp>
+    struct __member_type_wrapper
+    : private __do_member_type_wrapper
+    {
+      typedef decltype(_S_test<_Tp>(0)) type;
+    };
+
+  template<typename _CTp, typename... _Args>
+    struct __expanded_common_type_wrapper
+    {
+      typedef common_type<typename _CTp::type, _Args...> type;
+    };
+
+  template<typename... _Args>
+    struct __expanded_common_type_wrapper<__failure_type, _Args...>
+    { typedef __failure_type type; };
+
+  template<typename _Tp>
+    struct common_type<_Tp>
+    { typedef typename decay<_Tp>::type type; };
+
+  template<typename _Tp, typename _Up>
+    struct common_type<_Tp, _Up>
+    : public __common_type_impl<_Tp, _Up>::type
+    { };
+
+  template<typename _Tp, typename _Up, typename... _Vp>
+    struct common_type<_Tp, _Up, _Vp...>
+    : public __expanded_common_type_wrapper<typename __member_type_wrapper<
+               common_type<_Tp, _Up>>::type, _Vp...>::type
+    { };
+
+
+  template<typename _Tp>
+    struct underlying_type
+    {
+      typedef __underlying_type(_Tp) type;
+    };
+
+  template<typename _Tp>
+    struct __declval_protector
+    {
+      static const bool __stop = false;
+    };
+
+  template<typename _Tp>
+    auto declval() noexcept -> decltype(__declval<_Tp>(0))
+    {
+      static_assert(__declval_protector<_Tp>::__stop,
+      "declval() must not be used!");
+      return __declval<_Tp>(0);
+    }
+
+
+  template<typename _Tp>
+    using __remove_cvref_t
+     = typename remove_cv<typename remove_reference<_Tp>::type>::type;
+
+
+  template<typename _Signature>
+    class result_of;
+
+
+
+
+
+  struct __invoke_memfun_ref { };
+  struct __invoke_memfun_deref { };
+  struct __invoke_memobj_ref { };
+  struct __invoke_memobj_deref { };
+  struct __invoke_other { };
+
+
+  template<typename _Tp, typename _Tag>
+    struct __result_of_success : __success_type<_Tp>
+    { using __invoke_type = _Tag; };
+
+
+  struct __result_of_memfun_ref_impl
+  {
+    template<typename _Fp, typename _Tp1, typename... _Args>
+      static __result_of_success<decltype(
+      (std::declval<_Tp1>().*std::declval<_Fp>())(std::declval<_Args>()...)
+      ), __invoke_memfun_ref> _S_test(int);
+
+    template<typename...>
+      static __failure_type _S_test(...);
+  };
+
+  template<typename _MemPtr, typename _Arg, typename... _Args>
+    struct __result_of_memfun_ref
+    : private __result_of_memfun_ref_impl
+    {
+      typedef decltype(_S_test<_MemPtr, _Arg, _Args...>(0)) type;
+    };
+
+
+  struct __result_of_memfun_deref_impl
+  {
+    template<typename _Fp, typename _Tp1, typename... _Args>
+      static __result_of_success<decltype(
+      ((*std::declval<_Tp1>()).*std::declval<_Fp>())(std::declval<_Args>()...)
+      ), __invoke_memfun_deref> _S_test(int);
+
+    template<typename...>
+      static __failure_type _S_test(...);
+  };
+
+  template<typename _MemPtr, typename _Arg, typename... _Args>
+    struct __result_of_memfun_deref
+    : private __result_of_memfun_deref_impl
+    {
+      typedef decltype(_S_test<_MemPtr, _Arg, _Args...>(0)) type;
+    };
+
+
+  struct __result_of_memobj_ref_impl
+  {
+    template<typename _Fp, typename _Tp1>
+      static __result_of_success<decltype(
+      std::declval<_Tp1>().*std::declval<_Fp>()
+      ), __invoke_memobj_ref> _S_test(int);
+
+    template<typename, typename>
+      static __failure_type _S_test(...);
+  };
+
+  template<typename _MemPtr, typename _Arg>
+    struct __result_of_memobj_ref
+    : private __result_of_memobj_ref_impl
+    {
+      typedef decltype(_S_test<_MemPtr, _Arg>(0)) type;
+    };
+
+
+  struct __result_of_memobj_deref_impl
+  {
+    template<typename _Fp, typename _Tp1>
+      static __result_of_success<decltype(
+      (*std::declval<_Tp1>()).*std::declval<_Fp>()
+      ), __invoke_memobj_deref> _S_test(int);
+
+    template<typename, typename>
+      static __failure_type _S_test(...);
+  };
+
+  template<typename _MemPtr, typename _Arg>
+    struct __result_of_memobj_deref
+    : private __result_of_memobj_deref_impl
+    {
+      typedef decltype(_S_test<_MemPtr, _Arg>(0)) type;
+    };
+
+  template<typename _MemPtr, typename _Arg>
+    struct __result_of_memobj;
+
+  template<typename _Res, typename _Class, typename _Arg>
+    struct __result_of_memobj<_Res _Class::*, _Arg>
+    {
+      typedef __remove_cvref_t<_Arg> _Argval;
+      typedef _Res _Class::* _MemPtr;
+      typedef typename conditional<__or_<is_same<_Argval, _Class>,
+        is_base_of<_Class, _Argval>>::value,
+        __result_of_memobj_ref<_MemPtr, _Arg>,
+        __result_of_memobj_deref<_MemPtr, _Arg>
+      >::type::type type;
+    };
+
+  template<typename _MemPtr, typename _Arg, typename... _Args>
+    struct __result_of_memfun;
+
+  template<typename _Res, typename _Class, typename _Arg, typename... _Args>
+    struct __result_of_memfun<_Res _Class::*, _Arg, _Args...>
+    {
+      typedef __remove_cvref_t<_Arg> _Argval;
+      typedef _Res _Class::* _MemPtr;
+      typedef typename conditional<__or_<is_same<_Argval, _Class>,
+        is_base_of<_Class, _Argval>>::value,
+        __result_of_memfun_ref<_MemPtr, _Arg, _Args...>,
+        __result_of_memfun_deref<_MemPtr, _Arg, _Args...>
+      >::type::type type;
+    };
+
+
+
+
+
+
+  template<typename _Tp, typename _Up = typename decay<_Tp>::type>
+    struct __inv_unwrap
+    {
+      using type = _Tp;
+    };
+
+  template<typename _Tp, typename _Up>
+    struct __inv_unwrap<_Tp, reference_wrapper<_Up>>
+    {
+      using type = _Up&;
+    };
+
+  template<bool, bool, typename _Functor, typename... _ArgTypes>
+    struct __result_of_impl
+    {
+      typedef __failure_type type;
+    };
+
+  template<typename _MemPtr, typename _Arg>
+    struct __result_of_impl<true, false, _MemPtr, _Arg>
+    : public __result_of_memobj<typename decay<_MemPtr>::type,
+    typename __inv_unwrap<_Arg>::type>
+    { };
+
+  template<typename _MemPtr, typename _Arg, typename... _Args>
+    struct __result_of_impl<false, true, _MemPtr, _Arg, _Args...>
+    : public __result_of_memfun<typename decay<_MemPtr>::type,
+    typename __inv_unwrap<_Arg>::type, _Args...>
+    { };
+
+
+  struct __result_of_other_impl
+  {
+    template<typename _Fn, typename... _Args>
+      static __result_of_success<decltype(
+      std::declval<_Fn>()(std::declval<_Args>()...)
+      ), __invoke_other> _S_test(int);
+
+    template<typename...>
+      static __failure_type _S_test(...);
+  };
+
+  template<typename _Functor, typename... _ArgTypes>
+    struct __result_of_impl<false, false, _Functor, _ArgTypes...>
+    : private __result_of_other_impl
+    {
+      typedef decltype(_S_test<_Functor, _ArgTypes...>(0)) type;
+    };
+
+
+  template<typename _Functor, typename... _ArgTypes>
+    struct __invoke_result
+    : public __result_of_impl<
+        is_member_object_pointer<
+          typename remove_reference<_Functor>::type
+        >::value,
+        is_member_function_pointer<
+          typename remove_reference<_Functor>::type
+        >::value,
+ _Functor, _ArgTypes...
+      >::type
+    { };
+
+  template<typename _Functor, typename... _ArgTypes>
+    struct result_of<_Functor(_ArgTypes...)>
+    : public __invoke_result<_Functor, _ArgTypes...>
+    { };
+  template<bool _Cond, typename _Tp = void>
+    using __enable_if_t = typename enable_if<_Cond, _Tp>::type;
+
+
+  template<typename...> using __void_t = void;
+
+
+
+
+  template<typename...> using void_t = void;
+
+
+
+  template<typename _Default, typename _AlwaysVoid,
+    template<typename...> class _Op, typename... _Args>
+    struct __detector
+    {
+      using value_t = false_type;
+      using type = _Default;
+    };
+
+
+  template<typename _Default, template<typename...> class _Op,
+     typename... _Args>
+    struct __detector<_Default, __void_t<_Op<_Args...>>, _Op, _Args...>
+    {
+      using value_t = true_type;
+      using type = _Op<_Args...>;
+    };
+
+
+  template<typename _Default, template<typename...> class _Op,
+    typename... _Args>
+    using __detected_or = __detector<_Default, void, _Op, _Args...>;
+
+
+  template<typename _Default, template<typename...> class _Op,
+    typename... _Args>
+    using __detected_or_t
+      = typename __detected_or<_Default, _Op, _Args...>::type;
+  template <typename _Tp>
+    struct __is_swappable;
+
+  template <typename _Tp>
+    struct __is_nothrow_swappable;
+
+  template<typename... _Elements>
+    class tuple;
+
+  template<typename>
+    struct __is_tuple_like_impl : false_type
+    { };
+
+  template<typename... _Tps>
+    struct __is_tuple_like_impl<tuple<_Tps...>> : true_type
+    { };
+
+
+  template<typename _Tp>
+    struct __is_tuple_like
+    : public __is_tuple_like_impl<__remove_cvref_t<_Tp>>::type
+    { };
+
+  template<typename _Tp>
+    inline
+    typename enable_if<__and_<__not_<__is_tuple_like<_Tp>>,
+         is_move_constructible<_Tp>,
+         is_move_assignable<_Tp>>::value>::type
+    swap(_Tp&, _Tp&)
+    noexcept(__and_<is_nothrow_move_constructible<_Tp>,
+             is_nothrow_move_assignable<_Tp>>::value);
+
+  template<typename _Tp, size_t _Nm>
+    inline
+    typename enable_if<__is_swappable<_Tp>::value>::type
+    swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
+    noexcept(__is_nothrow_swappable<_Tp>::value);
+
+  namespace __swappable_details {
+    using std::swap;
+
+    struct __do_is_swappable_impl
+    {
+      template<typename _Tp, typename
+               = decltype(swap(std::declval<_Tp&>(), std::declval<_Tp&>()))>
+        static true_type __test(int);
+
+      template<typename>
+        static false_type __test(...);
+    };
+
+    struct __do_is_nothrow_swappable_impl
+    {
+      template<typename _Tp>
+        static __bool_constant<
+          noexcept(swap(std::declval<_Tp&>(), std::declval<_Tp&>()))
+        > __test(int);
+
+      template<typename>
+        static false_type __test(...);
+    };
+
+  }
+
+  template<typename _Tp>
+    struct __is_swappable_impl
+    : public __swappable_details::__do_is_swappable_impl
+    {
+      typedef decltype(__test<_Tp>(0)) type;
+    };
+
+  template<typename _Tp>
+    struct __is_nothrow_swappable_impl
+    : public __swappable_details::__do_is_nothrow_swappable_impl
+    {
+      typedef decltype(__test<_Tp>(0)) type;
+    };
+
+  template<typename _Tp>
+    struct __is_swappable
+    : public __is_swappable_impl<_Tp>::type
+    { };
+
+  template<typename _Tp>
+    struct __is_nothrow_swappable
+    : public __is_nothrow_swappable_impl<_Tp>::type
+    { };
+
+
+
+
+
+
+  template<typename _Tp>
+    struct is_swappable
+    : public __is_swappable_impl<_Tp>::type
+    { };
+
+
+  template<typename _Tp>
+    struct is_nothrow_swappable
+    : public __is_nothrow_swappable_impl<_Tp>::type
+    { };
+  namespace __swappable_with_details {
+    using std::swap;
+
+    struct __do_is_swappable_with_impl
+    {
+      template<typename _Tp, typename _Up, typename
+               = decltype(swap(std::declval<_Tp>(), std::declval<_Up>())),
+               typename
+               = decltype(swap(std::declval<_Up>(), std::declval<_Tp>()))>
+        static true_type __test(int);
+
+      template<typename, typename>
+        static false_type __test(...);
+    };
+
+    struct __do_is_nothrow_swappable_with_impl
+    {
+      template<typename _Tp, typename _Up>
+        static __bool_constant<
+          noexcept(swap(std::declval<_Tp>(), std::declval<_Up>()))
+          &&
+          noexcept(swap(std::declval<_Up>(), std::declval<_Tp>()))
+        > __test(int);
+
+      template<typename, typename>
+        static false_type __test(...);
+    };
+
+  }
+
+  template<typename _Tp, typename _Up>
+    struct __is_swappable_with_impl
+    : public __swappable_with_details::__do_is_swappable_with_impl
+    {
+      typedef decltype(__test<_Tp, _Up>(0)) type;
+    };
+
+
+  template<typename _Tp>
+    struct __is_swappable_with_impl<_Tp&, _Tp&>
+    : public __swappable_details::__do_is_swappable_impl
+    {
+      typedef decltype(__test<_Tp&>(0)) type;
+    };
+
+  template<typename _Tp, typename _Up>
+    struct __is_nothrow_swappable_with_impl
+    : public __swappable_with_details::__do_is_nothrow_swappable_with_impl
+    {
+      typedef decltype(__test<_Tp, _Up>(0)) type;
+    };
+
+
+  template<typename _Tp>
+    struct __is_nothrow_swappable_with_impl<_Tp&, _Tp&>
+    : public __swappable_details::__do_is_nothrow_swappable_impl
+    {
+      typedef decltype(__test<_Tp&>(0)) type;
+    };
+
+
+  template<typename _Tp, typename _Up>
+    struct is_swappable_with
+    : public __is_swappable_with_impl<_Tp, _Up>::type
+    { };
+
+
+  template<typename _Tp, typename _Up>
+    struct is_nothrow_swappable_with
+    : public __is_nothrow_swappable_with_impl<_Tp, _Up>::type
+    { };
+  template<typename _Result, typename _Ret, typename = void>
+    struct __is_invocable_impl : false_type { };
+
+  template<typename _Result, typename _Ret>
+    struct __is_invocable_impl<_Result, _Ret, __void_t<typename _Result::type>>
+    : __or_<is_void<_Ret>, is_convertible<typename _Result::type, _Ret>>::type
+    { };
+
+  template<typename _Fn, typename... _ArgTypes>
+    struct __is_invocable
+    : __is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, void>::type
+    { };
+
+  template<typename _Fn, typename _Tp, typename... _Args>
+    constexpr bool __call_is_nt(__invoke_memfun_ref)
+    {
+      using _Up = typename __inv_unwrap<_Tp>::type;
+      return noexcept((std::declval<_Up>().*std::declval<_Fn>())(
+     std::declval<_Args>()...));
+    }
+
+  template<typename _Fn, typename _Tp, typename... _Args>
+    constexpr bool __call_is_nt(__invoke_memfun_deref)
+    {
+      return noexcept(((*std::declval<_Tp>()).*std::declval<_Fn>())(
+     std::declval<_Args>()...));
+    }
+
+  template<typename _Fn, typename _Tp>
+    constexpr bool __call_is_nt(__invoke_memobj_ref)
+    {
+      using _Up = typename __inv_unwrap<_Tp>::type;
+      return noexcept(std::declval<_Up>().*std::declval<_Fn>());
+    }
+
+  template<typename _Fn, typename _Tp>
+    constexpr bool __call_is_nt(__invoke_memobj_deref)
+    {
+      return noexcept((*std::declval<_Tp>()).*std::declval<_Fn>());
+    }
+
+  template<typename _Fn, typename... _Args>
+    constexpr bool __call_is_nt(__invoke_other)
+    {
+      return noexcept(std::declval<_Fn>()(std::declval<_Args>()...));
+    }
+
+  template<typename _Result, typename _Fn, typename... _Args>
+    struct __call_is_nothrow
+    : __bool_constant<
+ std::__call_is_nt<_Fn, _Args...>(typename _Result::__invoke_type{})
+      >
+    { };
+
+  template<typename _Fn, typename... _Args>
+    using __call_is_nothrow_
+      = __call_is_nothrow<__invoke_result<_Fn, _Args...>, _Fn, _Args...>;
+
+
+  template<typename _Fn, typename... _Args>
+    struct __is_nothrow_invocable
+    : __and_<__is_invocable<_Fn, _Args...>,
+             __call_is_nothrow_<_Fn, _Args...>>::type
+    { };
+
+  struct __nonesuch {
+    __nonesuch() = delete;
+    ~__nonesuch() = delete;
+    __nonesuch(__nonesuch const&) = delete;
+    void operator=(__nonesuch const&) = delete;
+  };
+
+}
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+  template<typename _Tp>
+    constexpr _Tp&&
+    forward(typename std::remove_reference<_Tp>::type& __t) noexcept
+    { return static_cast<_Tp&&>(__t); }
+
+
+
+
+
+
+
+  template<typename _Tp>
+    constexpr _Tp&&
+    forward(typename std::remove_reference<_Tp>::type&& __t) noexcept
+    {
+      static_assert(!std::is_lvalue_reference<_Tp>::value, "template argument"
+      " substituting _Tp is an lvalue reference type");
+      return static_cast<_Tp&&>(__t);
+    }
+
+
+
+
+
+
+  template<typename _Tp>
+    constexpr typename std::remove_reference<_Tp>::type&&
+    move(_Tp&& __t) noexcept
+    { return static_cast<typename std::remove_reference<_Tp>::type&&>(__t); }
+
+
+  template<typename _Tp>
+    struct __move_if_noexcept_cond
+    : public __and_<__not_<is_nothrow_move_constructible<_Tp>>,
+                    is_copy_constructible<_Tp>>::type { };
+  template<typename _Tp>
+    constexpr typename
+    conditional<__move_if_noexcept_cond<_Tp>::value, const _Tp&, _Tp&&>::type
+    move_if_noexcept(_Tp& __x) noexcept
+    { return std::move(__x); }
+  template<typename _Tp>
+    inline _Tp*
+    addressof(_Tp& __r) noexcept
+    { return std::__addressof(__r); }
+
+
+
+  template<typename _Tp>
+    const _Tp* addressof(const _Tp&&) = delete;
+
+
+  template <typename _Tp, typename _Up = _Tp>
+    inline _Tp
+    __exchange(_Tp& __obj, _Up&& __new_val)
+    {
+      _Tp __old_val = std::move(__obj);
+      __obj = std::forward<_Up>(__new_val);
+      return __old_val;
+    }
+  template<typename _Tp>
+    inline
+
+    typename enable_if<__and_<__not_<__is_tuple_like<_Tp>>,
+         is_move_constructible<_Tp>,
+         is_move_assignable<_Tp>>::value>::type
+    swap(_Tp& __a, _Tp& __b)
+    noexcept(__and_<is_nothrow_move_constructible<_Tp>,
+             is_nothrow_move_assignable<_Tp>>::value)
+
+
+
+
+    {
+
+     
+
+      _Tp __tmp = std::move(__a);
+      __a = std::move(__b);
+      __b = std::move(__tmp);
+    }
+
+
+
+
+  template<typename _Tp, size_t _Nm>
+    inline
+
+    typename enable_if<__is_swappable<_Tp>::value>::type
+    swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
+    noexcept(__is_nothrow_swappable<_Tp>::value)
+
+
+
+
+    {
+      for (size_t __n = 0; __n < _Nm; ++__n)
+ swap(__a[__n], __b[__n]);
+    }
+
+
+
+}
+
+extern "C++" {
+
+namespace std
+{
+
+
+
+
+
+
+  class nested_exception
+  {
+    exception_ptr _M_ptr;
+
+  public:
+    nested_exception() noexcept : _M_ptr(current_exception()) { }
+
+    nested_exception(const nested_exception&) noexcept = default;
+
+    nested_exception& operator=(const nested_exception&) noexcept = default;
+
+    virtual ~nested_exception() noexcept;
+
+    [[noreturn]]
+    void
+    rethrow_nested() const
+    {
+      if (_M_ptr)
+ rethrow_exception(_M_ptr);
+      std::terminate();
+    }
+
+    exception_ptr
+    nested_ptr() const noexcept
+    { return _M_ptr; }
+  };
+
+  template<typename _Except>
+    struct _Nested_exception : public _Except, public nested_exception
+    {
+      explicit _Nested_exception(const _Except& __ex)
+      : _Except(__ex)
+      { }
+
+      explicit _Nested_exception(_Except&& __ex)
+      : _Except(static_cast<_Except&&>(__ex))
+      { }
+    };
+
+
+
+
+  template<typename _Tp>
+    [[noreturn]]
+    inline void
+    __throw_with_nested_impl(_Tp&& __t, true_type)
+    {
+      using _Up = typename remove_reference<_Tp>::type;
+      throw _Nested_exception<_Up>{std::forward<_Tp>(__t)};
+    }
+
+  template<typename _Tp>
+    [[noreturn]]
+    inline void
+    __throw_with_nested_impl(_Tp&& __t, false_type)
+    { throw std::forward<_Tp>(__t); }
+
+
+
+  template<typename _Tp>
+    [[noreturn]]
+    inline void
+    throw_with_nested(_Tp&& __t)
+    {
+      using _Up = typename decay<_Tp>::type;
+      using _CopyConstructible
+ = __and_<is_copy_constructible<_Up>, is_move_constructible<_Up>>;
+      static_assert(_CopyConstructible::value,
+   "throw_with_nested argument must be CopyConstructible");
+      using __nest = __and_<is_class<_Up>, __bool_constant<!__is_final(_Up)>,
+       __not_<is_base_of<nested_exception, _Up>>>;
+      std::__throw_with_nested_impl(std::forward<_Tp>(__t), __nest{});
+    }
+
+
+  template<typename _Tp>
+    using __rethrow_if_nested_cond = typename enable_if<
+      __and_<is_polymorphic<_Tp>,
+      __or_<__not_<is_base_of<nested_exception, _Tp>>,
+     is_convertible<_Tp*, nested_exception*>>>::value
+    >::type;
+
+
+  template<typename _Ex>
+    inline __rethrow_if_nested_cond<_Ex>
+    __rethrow_if_nested_impl(const _Ex* __ptr)
+    {
+      if (auto __ne_ptr = dynamic_cast<const nested_exception*>(__ptr))
+ __ne_ptr->rethrow_nested();
+    }
+
+
+  inline void
+  __rethrow_if_nested_impl(const void*)
+  { }
+
+
+  template<typename _Ex>
+    inline void
+    rethrow_if_nested(const _Ex& __ex)
+    { std::__rethrow_if_nested_impl(std::__addressof(__ex)); }
+
+
+}
+
+}
+
+
+
+       
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+  void
+  __throw_bad_exception(void) __attribute__((__noreturn__));
+
+
+  void
+  __throw_bad_alloc(void) __attribute__((__noreturn__));
+
+
+  void
+  __throw_bad_cast(void) __attribute__((__noreturn__));
+
+  void
+  __throw_bad_typeid(void) __attribute__((__noreturn__));
+
+
+  void
+  __throw_logic_error(const char*) __attribute__((__noreturn__));
+
+  void
+  __throw_domain_error(const char*) __attribute__((__noreturn__));
+
+  void
+  __throw_invalid_argument(const char*) __attribute__((__noreturn__));
+
+  void
+  __throw_length_error(const char*) __attribute__((__noreturn__));
+
+  void
+  __throw_out_of_range(const char*) __attribute__((__noreturn__));
+
+  void
+  __throw_out_of_range_fmt(const char*, ...) __attribute__((__noreturn__))
+    __attribute__((__format__(__gnu_printf__, 1, 2)));
+
+  void
+  __throw_runtime_error(const char*) __attribute__((__noreturn__));
+
+  void
+  __throw_range_error(const char*) __attribute__((__noreturn__));
+
+  void
+  __throw_overflow_error(const char*) __attribute__((__noreturn__));
+
+  void
+  __throw_underflow_error(const char*) __attribute__((__noreturn__));
+
+
+  void
+  __throw_ios_failure(const char*) __attribute__((__noreturn__));
+
+  void
+  __throw_ios_failure(const char*, int) __attribute__((__noreturn__));
+
+
+  void
+  __throw_system_error(int) __attribute__((__noreturn__));
+
+
+  void
+  __throw_future_error(int) __attribute__((__noreturn__));
+
+
+  void
+  __throw_bad_function_call() __attribute__((__noreturn__));
+
+
+}
+       
+extern "C++" {
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+  struct __true_type { };
+  struct __false_type { };
+
+  template<bool>
+    struct __truth_type
+    { typedef __false_type __type; };
+
+  template<>
+    struct __truth_type<true>
+    { typedef __true_type __type; };
+
+
+
+  template<class _Sp, class _Tp>
+    struct __traitor
+    {
+      enum { __value = bool(_Sp::__value) || bool(_Tp::__value) };
+      typedef typename __truth_type<__value>::__type __type;
+    };
+
+
+  template<typename, typename>
+    struct __are_same
+    {
+      enum { __value = 0 };
+      typedef __false_type __type;
+    };
+
+  template<typename _Tp>
+    struct __are_same<_Tp, _Tp>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+
+  template<typename _Tp>
+    struct __is_void
+    {
+      enum { __value = 0 };
+      typedef __false_type __type;
+    };
+
+  template<>
+    struct __is_void<void>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+
+
+
+  template<typename _Tp>
+    struct __is_integer
+    {
+      enum { __value = 0 };
+      typedef __false_type __type;
+    };
+
+
+
+
+
+  template<>
+    struct __is_integer<bool>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_integer<char>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_integer<signed char>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_integer<unsigned char>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+
+  template<>
+    struct __is_integer<wchar_t>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+
+
+  template<>
+    struct __is_integer<char16_t>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_integer<char32_t>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+
+  template<>
+    struct __is_integer<short>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_integer<unsigned short>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_integer<int>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_integer<unsigned int>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_integer<long>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_integer<unsigned long>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_integer<long long>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_integer<unsigned long long>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+template<> struct __is_integer<__int128> { enum { __value = 1 }; typedef __true_type __type; }; template<> struct __is_integer<unsigned __int128> { enum { __value = 1 }; typedef __true_type __type; };
+  template<typename _Tp>
+    struct __is_floating
+    {
+      enum { __value = 0 };
+      typedef __false_type __type;
+    };
+
+
+  template<>
+    struct __is_floating<float>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_floating<double>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_floating<long double>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+
+
+
+  template<typename _Tp>
+    struct __is_pointer
+    {
+      enum { __value = 0 };
+      typedef __false_type __type;
+    };
+
+  template<typename _Tp>
+    struct __is_pointer<_Tp*>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+
+
+
+  template<typename _Tp>
+    struct __is_arithmetic
+    : public __traitor<__is_integer<_Tp>, __is_floating<_Tp> >
+    { };
+
+
+
+
+  template<typename _Tp>
+    struct __is_scalar
+    : public __traitor<__is_arithmetic<_Tp>, __is_pointer<_Tp> >
+    { };
+
+
+
+
+  template<typename _Tp>
+    struct __is_char
+    {
+      enum { __value = 0 };
+      typedef __false_type __type;
+    };
+
+  template<>
+    struct __is_char<char>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+
+  template<>
+    struct __is_char<wchar_t>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+
+  template<typename _Tp>
+    struct __is_byte
+    {
+      enum { __value = 0 };
+      typedef __false_type __type;
+    };
+
+  template<>
+    struct __is_byte<char>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_byte<signed char>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_byte<unsigned char>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+  template<typename _Tp>
+    struct __is_move_iterator
+    {
+      enum { __value = 0 };
+      typedef __false_type __type;
+    };
+
+
+
+  template<typename _Iterator>
+    inline _Iterator
+    __miter_base(_Iterator __it)
+    { return __it; }
+
+
+}
+}
+       
+
+
+
+
+extern "C++" {
+
+namespace __gnu_cxx __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+  template<bool, typename>
+    struct __enable_if
+    { };
+
+  template<typename _Tp>
+    struct __enable_if<true, _Tp>
+    { typedef _Tp __type; };
+
+
+
+  template<bool _Cond, typename _Iftrue, typename _Iffalse>
+    struct __conditional_type
+    { typedef _Iftrue __type; };
+
+  template<typename _Iftrue, typename _Iffalse>
+    struct __conditional_type<false, _Iftrue, _Iffalse>
+    { typedef _Iffalse __type; };
+
+
+
+  template<typename _Tp>
+    struct __add_unsigned
+    {
+    private:
+      typedef __enable_if<std::__is_integer<_Tp>::__value, _Tp> __if_type;
+
+    public:
+      typedef typename __if_type::__type __type;
+    };
+
+  template<>
+    struct __add_unsigned<char>
+    { typedef unsigned char __type; };
+
+  template<>
+    struct __add_unsigned<signed char>
+    { typedef unsigned char __type; };
+
+  template<>
+    struct __add_unsigned<short>
+    { typedef unsigned short __type; };
+
+  template<>
+    struct __add_unsigned<int>
+    { typedef unsigned int __type; };
+
+  template<>
+    struct __add_unsigned<long>
+    { typedef unsigned long __type; };
+
+  template<>
+    struct __add_unsigned<long long>
+    { typedef unsigned long long __type; };
+
+
+  template<>
+    struct __add_unsigned<bool>;
+
+  template<>
+    struct __add_unsigned<wchar_t>;
+
+
+
+  template<typename _Tp>
+    struct __remove_unsigned
+    {
+    private:
+      typedef __enable_if<std::__is_integer<_Tp>::__value, _Tp> __if_type;
+
+    public:
+      typedef typename __if_type::__type __type;
+    };
+
+  template<>
+    struct __remove_unsigned<char>
+    { typedef signed char __type; };
+
+  template<>
+    struct __remove_unsigned<unsigned char>
+    { typedef signed char __type; };
+
+  template<>
+    struct __remove_unsigned<unsigned short>
+    { typedef short __type; };
+
+  template<>
+    struct __remove_unsigned<unsigned int>
+    { typedef int __type; };
+
+  template<>
+    struct __remove_unsigned<unsigned long>
+    { typedef long __type; };
+
+  template<>
+    struct __remove_unsigned<unsigned long long>
+    { typedef long long __type; };
+
+
+  template<>
+    struct __remove_unsigned<bool>;
+
+  template<>
+    struct __remove_unsigned<wchar_t>;
+
+
+
+  template<typename _Type>
+    inline bool
+    __is_null_pointer(_Type* __ptr)
+    { return __ptr == 0; }
+
+  template<typename _Type>
+    inline bool
+    __is_null_pointer(_Type)
+    { return false; }
+
+
+  inline bool
+  __is_null_pointer(std::nullptr_t)
+  { return true; }
+
+
+
+  template<typename _Tp, bool = std::__is_integer<_Tp>::__value>
+    struct __promote
+    { typedef double __type; };
+
+
+
+
+  template<typename _Tp>
+    struct __promote<_Tp, false>
+    { };
+
+  template<>
+    struct __promote<long double>
+    { typedef long double __type; };
+
+  template<>
+    struct __promote<double>
+    { typedef double __type; };
+
+  template<>
+    struct __promote<float>
+    { typedef float __type; };
+
+  template<typename _Tp, typename _Up,
+           typename _Tp2 = typename __promote<_Tp>::__type,
+           typename _Up2 = typename __promote<_Up>::__type>
+    struct __promote_2
+    {
+      typedef __typeof__(_Tp2() + _Up2()) __type;
+    };
+
+  template<typename _Tp, typename _Up, typename _Vp,
+           typename _Tp2 = typename __promote<_Tp>::__type,
+           typename _Up2 = typename __promote<_Up>::__type,
+           typename _Vp2 = typename __promote<_Vp>::__type>
+    struct __promote_3
+    {
+      typedef __typeof__(_Tp2() + _Up2() + _Vp2()) __type;
+    };
+
+  template<typename _Tp, typename _Up, typename _Vp, typename _Wp,
+           typename _Tp2 = typename __promote<_Tp>::__type,
+           typename _Up2 = typename __promote<_Up>::__type,
+           typename _Vp2 = typename __promote<_Vp>::__type,
+           typename _Wp2 = typename __promote<_Wp>::__type>
+    struct __promote_4
+    {
+      typedef __typeof__(_Tp2() + _Up2() + _Vp2() + _Wp2()) __type;
+    };
+
+
+}
+}
+       
+
+
+
+
+namespace __gnu_cxx __attribute__ ((__visibility__ ("default")))
+{
+
+  template<typename _Value>
+    struct __numeric_traits_integer
+    {
+
+      static const _Value __min = (((_Value)(-1) < 0) ? (_Value)1 << (sizeof(_Value) * 8 - ((_Value)(-1) < 0)) : (_Value)0);
+      static const _Value __max = (((_Value)(-1) < 0) ? (((((_Value)1 << ((sizeof(_Value) * 8 - ((_Value)(-1) < 0)) - 1)) - 1) << 1) + 1) : ~(_Value)0);
+
+
+
+      static const bool __is_signed = ((_Value)(-1) < 0);
+      static const int __digits = (sizeof(_Value) * 8 - ((_Value)(-1) < 0));
+    };
+
+  template<typename _Value>
+    const _Value __numeric_traits_integer<_Value>::__min;
+
+  template<typename _Value>
+    const _Value __numeric_traits_integer<_Value>::__max;
+
+  template<typename _Value>
+    const bool __numeric_traits_integer<_Value>::__is_signed;
+
+  template<typename _Value>
+    const int __numeric_traits_integer<_Value>::__digits;
+  template<typename _Value>
+    struct __numeric_traits_floating
+    {
+
+      static const int __max_digits10 = (2 + (std::__are_same<_Value, float>::__value ? 24 : std::__are_same<_Value, double>::__value ? 53 : 64) * 643L / 2136);
+
+
+      static const bool __is_signed = true;
+      static const int __digits10 = (std::__are_same<_Value, float>::__value ? 6 : std::__are_same<_Value, double>::__value ? 15 : 18);
+      static const int __max_exponent10 = (std::__are_same<_Value, float>::__value ? 38 : std::__are_same<_Value, double>::__value ? 308 : 4932);
+    };
+
+  template<typename _Value>
+    const int __numeric_traits_floating<_Value>::__max_digits10;
+
+  template<typename _Value>
+    const bool __numeric_traits_floating<_Value>::__is_signed;
+
+  template<typename _Value>
+    const int __numeric_traits_floating<_Value>::__digits10;
+
+  template<typename _Value>
+    const int __numeric_traits_floating<_Value>::__max_exponent10;
+
+  template<typename _Value>
+    struct __numeric_traits
+    : public __conditional_type<std::__is_integer<_Value>::__value,
+    __numeric_traits_integer<_Value>,
+    __numeric_traits_floating<_Value> >::__type
+    { };
+
+
+}
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+  struct piecewise_construct_t { explicit piecewise_construct_t() = default; };
+
+
+  constexpr piecewise_construct_t piecewise_construct =
+    piecewise_construct_t();
+
+
+  template<typename...>
+    class tuple;
+
+  template<std::size_t...>
+    struct _Index_tuple;
+
+
+
+
+
+
+  template <bool, typename _T1, typename _T2>
+    struct _PCC
+    {
+      template <typename _U1, typename _U2>
+      static constexpr bool _ConstructiblePair()
+      {
+ return __and_<is_constructible<_T1, const _U1&>,
+        is_constructible<_T2, const _U2&>>::value;
+      }
+
+      template <typename _U1, typename _U2>
+      static constexpr bool _ImplicitlyConvertiblePair()
+      {
+ return __and_<is_convertible<const _U1&, _T1>,
+        is_convertible<const _U2&, _T2>>::value;
+      }
+
+      template <typename _U1, typename _U2>
+      static constexpr bool _MoveConstructiblePair()
+      {
+ return __and_<is_constructible<_T1, _U1&&>,
+        is_constructible<_T2, _U2&&>>::value;
+      }
+
+      template <typename _U1, typename _U2>
+      static constexpr bool _ImplicitlyMoveConvertiblePair()
+      {
+ return __and_<is_convertible<_U1&&, _T1>,
+        is_convertible<_U2&&, _T2>>::value;
+      }
+
+      template <bool __implicit, typename _U1, typename _U2>
+      static constexpr bool _CopyMovePair()
+      {
+ using __do_converts = __and_<is_convertible<const _U1&, _T1>,
+      is_convertible<_U2&&, _T2>>;
+ using __converts = typename conditional<__implicit,
+           __do_converts,
+           __not_<__do_converts>>::type;
+ return __and_<is_constructible<_T1, const _U1&>,
+        is_constructible<_T2, _U2&&>,
+        __converts
+        >::value;
+      }
+
+      template <bool __implicit, typename _U1, typename _U2>
+      static constexpr bool _MoveCopyPair()
+      {
+ using __do_converts = __and_<is_convertible<_U1&&, _T1>,
+      is_convertible<const _U2&, _T2>>;
+ using __converts = typename conditional<__implicit,
+           __do_converts,
+           __not_<__do_converts>>::type;
+ return __and_<is_constructible<_T1, _U1&&>,
+        is_constructible<_T2, const _U2&&>,
+        __converts
+        >::value;
+      }
+  };
+
+  template <typename _T1, typename _T2>
+    struct _PCC<false, _T1, _T2>
+    {
+      template <typename _U1, typename _U2>
+      static constexpr bool _ConstructiblePair()
+      {
+ return false;
+      }
+
+      template <typename _U1, typename _U2>
+      static constexpr bool _ImplicitlyConvertiblePair()
+      {
+ return false;
+      }
+
+      template <typename _U1, typename _U2>
+      static constexpr bool _MoveConstructiblePair()
+      {
+ return false;
+      }
+
+      template <typename _U1, typename _U2>
+      static constexpr bool _ImplicitlyMoveConvertiblePair()
+      {
+ return false;
+      }
+  };
+
+
+
+
+  struct __nonesuch_no_braces : std::__nonesuch {
+    explicit __nonesuch_no_braces(const __nonesuch&) = delete;
+  };
+
+
+  class __pair_base
+  {
+
+    template<typename _T1, typename _T2> friend struct pair;
+    __pair_base() = default;
+    ~__pair_base() = default;
+    __pair_base(const __pair_base&) = default;
+    __pair_base& operator=(const __pair_base&) = delete;
+
+  };
+
+
+
+
+
+
+
+  template<typename _T1, typename _T2>
+    struct pair
+    : private __pair_base
+    {
+      typedef _T1 first_type;
+      typedef _T2 second_type;
+
+      _T1 first;
+      _T2 second;
+
+
+
+
+
+
+      template <typename _U1 = _T1,
+                typename _U2 = _T2,
+                typename enable_if<__and_<
+                                     __is_implicitly_default_constructible<_U1>,
+                                     __is_implicitly_default_constructible<_U2>>
+                                   ::value, bool>::type = true>
+
+      constexpr pair()
+      : first(), second() { }
+
+
+      template <typename _U1 = _T1,
+                typename _U2 = _T2,
+                typename enable_if<__and_<
+                       is_default_constructible<_U1>,
+                       is_default_constructible<_U2>,
+                       __not_<
+                         __and_<__is_implicitly_default_constructible<_U1>,
+                                __is_implicitly_default_constructible<_U2>>>>
+                                   ::value, bool>::type = false>
+      explicit constexpr pair()
+      : first(), second() { }
+      using _PCCP = _PCC<true, _T1, _T2>;
+
+      template<typename _U1 = _T1, typename _U2=_T2, typename
+        enable_if<_PCCP::template
+      _ConstructiblePair<_U1, _U2>()
+                  && _PCCP::template
+      _ImplicitlyConvertiblePair<_U1, _U2>(),
+                         bool>::type=true>
+      constexpr pair(const _T1& __a, const _T2& __b)
+      : first(__a), second(__b) { }
+
+       template<typename _U1 = _T1, typename _U2=_T2, typename
+  enable_if<_PCCP::template
+       _ConstructiblePair<_U1, _U2>()
+                   && !_PCCP::template
+       _ImplicitlyConvertiblePair<_U1, _U2>(),
+                         bool>::type=false>
+      explicit constexpr pair(const _T1& __a, const _T2& __b)
+      : first(__a), second(__b) { }
+      template <typename _U1, typename _U2>
+        using _PCCFP = _PCC<!is_same<_T1, _U1>::value
+       || !is_same<_T2, _U2>::value,
+       _T1, _T2>;
+
+      template<typename _U1, typename _U2, typename
+        enable_if<_PCCFP<_U1, _U2>::template
+      _ConstructiblePair<_U1, _U2>()
+                  && _PCCFP<_U1, _U2>::template
+      _ImplicitlyConvertiblePair<_U1, _U2>(),
+     bool>::type=true>
+        constexpr pair(const pair<_U1, _U2>& __p)
+        : first(__p.first), second(__p.second) { }
+
+      template<typename _U1, typename _U2, typename
+        enable_if<_PCCFP<_U1, _U2>::template
+      _ConstructiblePair<_U1, _U2>()
+    && !_PCCFP<_U1, _U2>::template
+      _ImplicitlyConvertiblePair<_U1, _U2>(),
+                         bool>::type=false>
+ explicit constexpr pair(const pair<_U1, _U2>& __p)
+ : first(__p.first), second(__p.second) { }
+
+      constexpr pair(const pair&) = default;
+      constexpr pair(pair&&) = default;
+
+
+      template<typename _U1, typename
+        enable_if<_PCCP::template
+      _MoveCopyPair<true, _U1, _T2>(),
+                         bool>::type=true>
+       constexpr pair(_U1&& __x, const _T2& __y)
+       : first(std::forward<_U1>(__x)), second(__y) { }
+
+      template<typename _U1, typename
+        enable_if<_PCCP::template
+      _MoveCopyPair<false, _U1, _T2>(),
+                         bool>::type=false>
+       explicit constexpr pair(_U1&& __x, const _T2& __y)
+       : first(std::forward<_U1>(__x)), second(__y) { }
+
+      template<typename _U2, typename
+        enable_if<_PCCP::template
+      _CopyMovePair<true, _T1, _U2>(),
+                         bool>::type=true>
+       constexpr pair(const _T1& __x, _U2&& __y)
+       : first(__x), second(std::forward<_U2>(__y)) { }
+
+      template<typename _U2, typename
+        enable_if<_PCCP::template
+      _CopyMovePair<false, _T1, _U2>(),
+                         bool>::type=false>
+       explicit pair(const _T1& __x, _U2&& __y)
+       : first(__x), second(std::forward<_U2>(__y)) { }
+
+      template<typename _U1, typename _U2, typename
+        enable_if<_PCCP::template
+      _MoveConstructiblePair<_U1, _U2>()
+     && _PCCP::template
+      _ImplicitlyMoveConvertiblePair<_U1, _U2>(),
+                         bool>::type=true>
+ constexpr pair(_U1&& __x, _U2&& __y)
+ : first(std::forward<_U1>(__x)), second(std::forward<_U2>(__y)) { }
+
+      template<typename _U1, typename _U2, typename
+        enable_if<_PCCP::template
+      _MoveConstructiblePair<_U1, _U2>()
+     && !_PCCP::template
+      _ImplicitlyMoveConvertiblePair<_U1, _U2>(),
+                         bool>::type=false>
+ explicit constexpr pair(_U1&& __x, _U2&& __y)
+ : first(std::forward<_U1>(__x)), second(std::forward<_U2>(__y)) { }
+
+
+      template<typename _U1, typename _U2, typename
+        enable_if<_PCCFP<_U1, _U2>::template
+      _MoveConstructiblePair<_U1, _U2>()
+     && _PCCFP<_U1, _U2>::template
+      _ImplicitlyMoveConvertiblePair<_U1, _U2>(),
+                         bool>::type=true>
+ constexpr pair(pair<_U1, _U2>&& __p)
+ : first(std::forward<_U1>(__p.first)),
+   second(std::forward<_U2>(__p.second)) { }
+
+      template<typename _U1, typename _U2, typename
+        enable_if<_PCCFP<_U1, _U2>::template
+      _MoveConstructiblePair<_U1, _U2>()
+     && !_PCCFP<_U1, _U2>::template
+      _ImplicitlyMoveConvertiblePair<_U1, _U2>(),
+                         bool>::type=false>
+ explicit constexpr pair(pair<_U1, _U2>&& __p)
+ : first(std::forward<_U1>(__p.first)),
+   second(std::forward<_U2>(__p.second)) { }
+
+      template<typename... _Args1, typename... _Args2>
+        pair(piecewise_construct_t, tuple<_Args1...>, tuple<_Args2...>);
+
+      pair&
+      operator=(typename conditional<
+  __and_<is_copy_assignable<_T1>,
+         is_copy_assignable<_T2>>::value,
+  const pair&, const __nonesuch_no_braces&>::type __p)
+      {
+ first = __p.first;
+ second = __p.second;
+ return *this;
+      }
+
+      pair&
+      operator=(typename conditional<
+  __and_<is_move_assignable<_T1>,
+         is_move_assignable<_T2>>::value,
+  pair&&, __nonesuch_no_braces&&>::type __p)
+      noexcept(__and_<is_nothrow_move_assignable<_T1>,
+        is_nothrow_move_assignable<_T2>>::value)
+      {
+ first = std::forward<first_type>(__p.first);
+ second = std::forward<second_type>(__p.second);
+ return *this;
+      }
+
+      template<typename _U1, typename _U2>
+      typename enable_if<__and_<is_assignable<_T1&, const _U1&>,
+    is_assignable<_T2&, const _U2&>>::value,
+    pair&>::type
+ operator=(const pair<_U1, _U2>& __p)
+ {
+   first = __p.first;
+   second = __p.second;
+   return *this;
+ }
+
+      template<typename _U1, typename _U2>
+      typename enable_if<__and_<is_assignable<_T1&, _U1&&>,
+    is_assignable<_T2&, _U2&&>>::value,
+    pair&>::type
+ operator=(pair<_U1, _U2>&& __p)
+ {
+   first = std::forward<_U1>(__p.first);
+   second = std::forward<_U2>(__p.second);
+   return *this;
+ }
+
+      void
+      swap(pair& __p)
+      noexcept(__and_<__is_nothrow_swappable<_T1>,
+                      __is_nothrow_swappable<_T2>>::value)
+      {
+ using std::swap;
+ swap(first, __p.first);
+ swap(second, __p.second);
+      }
+
+    private:
+      template<typename... _Args1, std::size_t... _Indexes1,
+               typename... _Args2, std::size_t... _Indexes2>
+        pair(tuple<_Args1...>&, tuple<_Args2...>&,
+             _Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>);
+
+    };
+
+
+
+
+
+
+  template<typename _T1, typename _T2>
+    inline constexpr bool
+    operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
+    { return __x.first == __y.first && __x.second == __y.second; }
+
+
+  template<typename _T1, typename _T2>
+    inline constexpr bool
+    operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
+    { return __x.first < __y.first
+      || (!(__y.first < __x.first) && __x.second < __y.second); }
+
+
+  template<typename _T1, typename _T2>
+    inline constexpr bool
+    operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
+    { return !(__x == __y); }
+
+
+  template<typename _T1, typename _T2>
+    inline constexpr bool
+    operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
+    { return __y < __x; }
+
+
+  template<typename _T1, typename _T2>
+    inline constexpr bool
+    operator<=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
+    { return !(__y < __x); }
+
+
+  template<typename _T1, typename _T2>
+    inline constexpr bool
+    operator>=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
+    { return !(__x < __y); }
+
+
+
+
+
+  template<typename _T1, typename _T2>
+    inline
+
+
+    typename enable_if<__and_<__is_swappable<_T1>,
+                              __is_swappable<_T2>>::value>::type
+
+
+
+    swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y)
+    noexcept(noexcept(__x.swap(__y)))
+    { __x.swap(__y); }
+
+
+  template<typename _T1, typename _T2>
+    typename enable_if<!__and_<__is_swappable<_T1>,
+          __is_swappable<_T2>>::value>::type
+    swap(pair<_T1, _T2>&, pair<_T1, _T2>&) = delete;
+  template<typename _T1, typename _T2>
+    constexpr pair<typename __decay_and_strip<_T1>::__type,
+                   typename __decay_and_strip<_T2>::__type>
+    make_pair(_T1&& __x, _T2&& __y)
+    {
+      typedef typename __decay_and_strip<_T1>::__type __ds_type1;
+      typedef typename __decay_and_strip<_T2>::__type __ds_type2;
+      typedef pair<__ds_type1, __ds_type2> __pair_type;
+      return __pair_type(std::forward<_T1>(__x), std::forward<_T2>(__y));
+    }
+
+}
+       
+
+
+
+
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+  struct input_iterator_tag { };
+
+
+  struct output_iterator_tag { };
+
+
+  struct forward_iterator_tag : public input_iterator_tag { };
+
+
+
+  struct bidirectional_iterator_tag : public forward_iterator_tag { };
+
+
+
+  struct random_access_iterator_tag : public bidirectional_iterator_tag { };
+  template<typename _Category, typename _Tp, typename _Distance = ptrdiff_t,
+           typename _Pointer = _Tp*, typename _Reference = _Tp&>
+    struct iterator
+    {
+
+      typedef _Category iterator_category;
+
+      typedef _Tp value_type;
+
+      typedef _Distance difference_type;
+
+      typedef _Pointer pointer;
+
+      typedef _Reference reference;
+    };
+  template<typename _Iterator, typename = __void_t<>>
+    struct __iterator_traits { };
+
+  template<typename _Iterator>
+    struct __iterator_traits<_Iterator,
+        __void_t<typename _Iterator::iterator_category,
+          typename _Iterator::value_type,
+          typename _Iterator::difference_type,
+          typename _Iterator::pointer,
+          typename _Iterator::reference>>
+    {
+      typedef typename _Iterator::iterator_category iterator_category;
+      typedef typename _Iterator::value_type value_type;
+      typedef typename _Iterator::difference_type difference_type;
+      typedef typename _Iterator::pointer pointer;
+      typedef typename _Iterator::reference reference;
+    };
+
+  template<typename _Iterator>
+    struct iterator_traits
+    : public __iterator_traits<_Iterator> { };
+  template<typename _Tp>
+    struct iterator_traits<_Tp*>
+    {
+      typedef random_access_iterator_tag iterator_category;
+      typedef _Tp value_type;
+      typedef ptrdiff_t difference_type;
+      typedef _Tp* pointer;
+      typedef _Tp& reference;
+    };
+
+
+  template<typename _Tp>
+    struct iterator_traits<const _Tp*>
+    {
+      typedef random_access_iterator_tag iterator_category;
+      typedef _Tp value_type;
+      typedef ptrdiff_t difference_type;
+      typedef const _Tp* pointer;
+      typedef const _Tp& reference;
+    };
+
+
+
+
+
+  template<typename _Iter>
+    inline constexpr
+    typename iterator_traits<_Iter>::iterator_category
+    __iterator_category(const _Iter&)
+    { return typename iterator_traits<_Iter>::iterator_category(); }
+  template<typename _InIter>
+    using _RequireInputIter = typename
+      enable_if<is_convertible<typename
+  iterator_traits<_InIter>::iterator_category,
+          input_iterator_tag>::value>::type;
+
+
+
+}
+       
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+
+  template <typename> struct _List_iterator;
+  template <typename> struct _List_const_iterator;
+
+
+  template<typename _InputIterator>
+    inline
+    typename iterator_traits<_InputIterator>::difference_type
+    __distance(_InputIterator __first, _InputIterator __last,
+               input_iterator_tag)
+    {
+
+     
+
+      typename iterator_traits<_InputIterator>::difference_type __n = 0;
+      while (__first != __last)
+ {
+   ++__first;
+   ++__n;
+ }
+      return __n;
+    }
+
+  template<typename _RandomAccessIterator>
+    inline
+    typename iterator_traits<_RandomAccessIterator>::difference_type
+    __distance(_RandomAccessIterator __first, _RandomAccessIterator __last,
+               random_access_iterator_tag)
+    {
+
+     
+
+      return __last - __first;
+    }
+
+
+
+  template<typename _Tp>
+    ptrdiff_t
+    __distance(std::_List_iterator<_Tp>,
+        std::_List_iterator<_Tp>,
+        input_iterator_tag);
+
+  template<typename _Tp>
+    ptrdiff_t
+    __distance(std::_List_const_iterator<_Tp>,
+        std::_List_const_iterator<_Tp>,
+        input_iterator_tag);
+  template<typename _InputIterator>
+    inline
+    typename iterator_traits<_InputIterator>::difference_type
+    distance(_InputIterator __first, _InputIterator __last)
+    {
+
+      return std::__distance(__first, __last,
+        std::__iterator_category(__first));
+    }
+
+  template<typename _InputIterator, typename _Distance>
+    inline void
+    __advance(_InputIterator& __i, _Distance __n, input_iterator_tag)
+    {
+
+     
+      ;
+      while (__n--)
+ ++__i;
+    }
+
+  template<typename _BidirectionalIterator, typename _Distance>
+    inline void
+    __advance(_BidirectionalIterator& __i, _Distance __n,
+       bidirectional_iterator_tag)
+    {
+
+     
+
+      if (__n > 0)
+        while (__n--)
+   ++__i;
+      else
+        while (__n++)
+   --__i;
+    }
+
+  template<typename _RandomAccessIterator, typename _Distance>
+    inline void
+    __advance(_RandomAccessIterator& __i, _Distance __n,
+              random_access_iterator_tag)
+    {
+
+     
+
+      if (__builtin_constant_p(__n) && __n == 1)
+ ++__i;
+      else if (__builtin_constant_p(__n) && __n == -1)
+ --__i;
+      else
+ __i += __n;
+    }
+  template<typename _InputIterator, typename _Distance>
+    inline void
+    advance(_InputIterator& __i, _Distance __n)
+    {
+
+      typename iterator_traits<_InputIterator>::difference_type __d = __n;
+      std::__advance(__i, __d, std::__iterator_category(__i));
+    }
+
+
+
+  template<typename _InputIterator>
+    inline _InputIterator
+    next(_InputIterator __x, typename
+  iterator_traits<_InputIterator>::difference_type __n = 1)
+    {
+
+     
+      std::advance(__x, __n);
+      return __x;
+    }
+
+  template<typename _BidirectionalIterator>
+    inline _BidirectionalIterator
+    prev(_BidirectionalIterator __x, typename
+  iterator_traits<_BidirectionalIterator>::difference_type __n = 1)
+    {
+
+     
+
+      std::advance(__x, -__n);
+      return __x;
+    }
+
+
+
+
+}
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+  class __undefined;
+
+
+  template<typename _Tp>
+    struct __get_first_arg
+    { using type = __undefined; };
+
+  template<template<typename, typename...> class _Template, typename _Tp,
+           typename... _Types>
+    struct __get_first_arg<_Template<_Tp, _Types...>>
+    { using type = _Tp; };
+
+  template<typename _Tp>
+    using __get_first_arg_t = typename __get_first_arg<_Tp>::type;
+
+
+  template<typename _Tp, typename _Up>
+    struct __replace_first_arg
+    { };
+
+  template<template<typename, typename...> class _Template, typename _Up,
+           typename _Tp, typename... _Types>
+    struct __replace_first_arg<_Template<_Tp, _Types...>, _Up>
+    { using type = _Template<_Up, _Types...>; };
+
+  template<typename _Tp, typename _Up>
+    using __replace_first_arg_t = typename __replace_first_arg<_Tp, _Up>::type;
+
+  template<typename _Tp>
+    using __make_not_void
+      = typename conditional<is_void<_Tp>::value, __undefined, _Tp>::type;
+
+
+
+
+
+  template<typename _Ptr>
+    struct pointer_traits
+    {
+    private:
+      template<typename _Tp>
+ using __element_type = typename _Tp::element_type;
+
+      template<typename _Tp>
+ using __difference_type = typename _Tp::difference_type;
+
+      template<typename _Tp, typename _Up, typename = void>
+ struct __rebind : __replace_first_arg<_Tp, _Up> { };
+
+      template<typename _Tp, typename _Up>
+ struct __rebind<_Tp, _Up, __void_t<typename _Tp::template rebind<_Up>>>
+ { using type = typename _Tp::template rebind<_Up>; };
+
+    public:
+
+      using pointer = _Ptr;
+
+
+      using element_type
+ = __detected_or_t<__get_first_arg_t<_Ptr>, __element_type, _Ptr>;
+
+
+      using difference_type
+ = __detected_or_t<ptrdiff_t, __difference_type, _Ptr>;
+
+
+      template<typename _Up>
+        using rebind = typename __rebind<_Ptr, _Up>::type;
+
+      static _Ptr
+      pointer_to(__make_not_void<element_type>& __e)
+      { return _Ptr::pointer_to(__e); }
+
+      static_assert(!is_same<element_type, __undefined>::value,
+   "pointer type defines element_type or is like SomePointer<T, Args>");
+    };
+
+
+
+
+
+  template<typename _Tp>
+    struct pointer_traits<_Tp*>
+    {
+
+      typedef _Tp* pointer;
+
+      typedef _Tp element_type;
+
+      typedef ptrdiff_t difference_type;
+
+      template<typename _Up>
+        using rebind = _Up*;
+
+
+
+
+
+
+      static pointer
+      pointer_to(__make_not_void<element_type>& __r) noexcept
+      { return std::addressof(__r); }
+    };
+
+
+  template<typename _Ptr, typename _Tp>
+    using __ptr_rebind = typename pointer_traits<_Ptr>::template rebind<_Tp>;
+
+  template<typename _Tp>
+    constexpr _Tp*
+    __to_address(_Tp* __ptr) noexcept
+    {
+      static_assert(!std::is_function<_Tp>::value, "not a function pointer");
+      return __ptr;
+    }
+
+
+  template<typename _Ptr>
+    constexpr typename std::pointer_traits<_Ptr>::element_type*
+    __to_address(const _Ptr& __ptr)
+    { return std::__to_address(__ptr.operator->()); }
+
+}
+
+
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+  template<typename _Iterator>
+    class reverse_iterator
+    : public iterator<typename iterator_traits<_Iterator>::iterator_category,
+        typename iterator_traits<_Iterator>::value_type,
+        typename iterator_traits<_Iterator>::difference_type,
+        typename iterator_traits<_Iterator>::pointer,
+                      typename iterator_traits<_Iterator>::reference>
+    {
+    protected:
+      _Iterator current;
+
+      typedef iterator_traits<_Iterator> __traits_type;
+
+    public:
+      typedef _Iterator iterator_type;
+      typedef typename __traits_type::difference_type difference_type;
+      typedef typename __traits_type::pointer pointer;
+      typedef typename __traits_type::reference reference;
+     
+      reverse_iterator() : current() { }
+
+
+
+
+      explicit
+      reverse_iterator(iterator_type __x) : current(__x) { }
+
+
+
+
+     
+      reverse_iterator(const reverse_iterator& __x)
+      : current(__x.current) { }
+
+
+      reverse_iterator& operator=(const reverse_iterator&) = default;
+
+
+
+
+
+
+      template<typename _Iter>
+
+        reverse_iterator(const reverse_iterator<_Iter>& __x)
+ : current(__x.base()) { }
+
+
+
+
+      iterator_type
+      base() const
+      { return current; }
+      reference
+      operator*() const
+      {
+ _Iterator __tmp = current;
+ return *--__tmp;
+      }
+
+
+
+
+
+
+      pointer
+      operator->() const
+      {
+
+
+ _Iterator __tmp = current;
+ --__tmp;
+ return _S_to_pointer(__tmp);
+      }
+
+
+
+
+
+
+      reverse_iterator&
+      operator++()
+      {
+ --current;
+ return *this;
+      }
+
+
+
+
+
+
+      reverse_iterator
+      operator++(int)
+      {
+ reverse_iterator __tmp = *this;
+ --current;
+ return __tmp;
+      }
+
+
+
+
+
+
+      reverse_iterator&
+      operator--()
+      {
+ ++current;
+ return *this;
+      }
+
+
+
+
+
+
+      reverse_iterator
+      operator--(int)
+      {
+ reverse_iterator __tmp = *this;
+ ++current;
+ return __tmp;
+      }
+
+
+
+
+
+
+      reverse_iterator
+      operator+(difference_type __n) const
+      { return reverse_iterator(current - __n); }
+
+
+
+
+
+
+
+      reverse_iterator&
+      operator+=(difference_type __n)
+      {
+ current -= __n;
+ return *this;
+      }
+
+
+
+
+
+
+      reverse_iterator
+      operator-(difference_type __n) const
+      { return reverse_iterator(current + __n); }
+
+
+
+
+
+
+
+      reverse_iterator&
+      operator-=(difference_type __n)
+      {
+ current += __n;
+ return *this;
+      }
+
+
+
+
+
+
+      reference
+      operator[](difference_type __n) const
+      { return *(*this + __n); }
+
+    private:
+      template<typename _Tp>
+ static _Tp*
+ _S_to_pointer(_Tp* __p)
+        { return __p; }
+
+      template<typename _Tp>
+ static pointer
+ _S_to_pointer(_Tp __t)
+        { return __t.operator->(); }
+    };
+  template<typename _Iterator>
+    inline bool
+    operator==(const reverse_iterator<_Iterator>& __x,
+        const reverse_iterator<_Iterator>& __y)
+    { return __x.base() == __y.base(); }
+
+  template<typename _Iterator>
+    inline bool
+    operator<(const reverse_iterator<_Iterator>& __x,
+       const reverse_iterator<_Iterator>& __y)
+    { return __y.base() < __x.base(); }
+
+  template<typename _Iterator>
+    inline bool
+    operator!=(const reverse_iterator<_Iterator>& __x,
+        const reverse_iterator<_Iterator>& __y)
+    { return !(__x == __y); }
+
+  template<typename _Iterator>
+    inline bool
+    operator>(const reverse_iterator<_Iterator>& __x,
+       const reverse_iterator<_Iterator>& __y)
+    { return __y < __x; }
+
+  template<typename _Iterator>
+    inline bool
+    operator<=(const reverse_iterator<_Iterator>& __x,
+        const reverse_iterator<_Iterator>& __y)
+    { return !(__y < __x); }
+
+  template<typename _Iterator>
+    inline bool
+    operator>=(const reverse_iterator<_Iterator>& __x,
+        const reverse_iterator<_Iterator>& __y)
+    { return !(__x < __y); }
+
+
+
+  template<typename _IteratorL, typename _IteratorR>
+    inline bool
+    operator==(const reverse_iterator<_IteratorL>& __x,
+        const reverse_iterator<_IteratorR>& __y)
+    { return __x.base() == __y.base(); }
+
+  template<typename _IteratorL, typename _IteratorR>
+    inline bool
+    operator<(const reverse_iterator<_IteratorL>& __x,
+       const reverse_iterator<_IteratorR>& __y)
+    { return __y.base() < __x.base(); }
+
+  template<typename _IteratorL, typename _IteratorR>
+    inline bool
+    operator!=(const reverse_iterator<_IteratorL>& __x,
+        const reverse_iterator<_IteratorR>& __y)
+    { return !(__x == __y); }
+
+  template<typename _IteratorL, typename _IteratorR>
+    inline bool
+    operator>(const reverse_iterator<_IteratorL>& __x,
+       const reverse_iterator<_IteratorR>& __y)
+    { return __y < __x; }
+
+  template<typename _IteratorL, typename _IteratorR>
+    inline bool
+    operator<=(const reverse_iterator<_IteratorL>& __x,
+        const reverse_iterator<_IteratorR>& __y)
+    { return !(__y < __x); }
+
+  template<typename _IteratorL, typename _IteratorR>
+    inline bool
+    operator>=(const reverse_iterator<_IteratorL>& __x,
+        const reverse_iterator<_IteratorR>& __y)
+    { return !(__x < __y); }
+  template<typename _IteratorL, typename _IteratorR>
+    inline auto
+    operator-(const reverse_iterator<_IteratorL>& __x,
+       const reverse_iterator<_IteratorR>& __y)
+    -> decltype(__y.base() - __x.base())
+    { return __y.base() - __x.base(); }
+
+
+  template<typename _Iterator>
+    inline reverse_iterator<_Iterator>
+    operator+(typename reverse_iterator<_Iterator>::difference_type __n,
+       const reverse_iterator<_Iterator>& __x)
+    { return reverse_iterator<_Iterator>(__x.base() - __n); }
+
+
+
+  template<typename _Iterator>
+    inline reverse_iterator<_Iterator>
+    __make_reverse_iterator(_Iterator __i)
+    { return reverse_iterator<_Iterator>(__i); }
+  template<typename _Iterator>
+    auto
+    __niter_base(reverse_iterator<_Iterator> __it)
+    -> decltype(__make_reverse_iterator(__niter_base(__it.base())))
+    { return __make_reverse_iterator(__niter_base(__it.base())); }
+
+  template<typename _Iterator>
+    struct __is_move_iterator<reverse_iterator<_Iterator> >
+      : __is_move_iterator<_Iterator>
+    { };
+
+  template<typename _Iterator>
+    auto
+    __miter_base(reverse_iterator<_Iterator> __it)
+    -> decltype(__make_reverse_iterator(__miter_base(__it.base())))
+    { return __make_reverse_iterator(__miter_base(__it.base())); }
+  template<typename _Container>
+    class back_insert_iterator
+    : public iterator<output_iterator_tag, void, void, void, void>
+    {
+    protected:
+      _Container* container;
+
+    public:
+
+      typedef _Container container_type;
+
+
+      explicit
+      back_insert_iterator(_Container& __x)
+      : container(std::__addressof(__x)) { }
+      back_insert_iterator&
+      operator=(const typename _Container::value_type& __value)
+      {
+ container->push_back(__value);
+ return *this;
+      }
+
+      back_insert_iterator&
+      operator=(typename _Container::value_type&& __value)
+      {
+ container->push_back(std::move(__value));
+ return *this;
+      }
+
+
+
+      back_insert_iterator&
+      operator*()
+      { return *this; }
+
+
+      back_insert_iterator&
+      operator++()
+      { return *this; }
+
+
+      back_insert_iterator
+      operator++(int)
+      { return *this; }
+    };
+  template<typename _Container>
+    inline back_insert_iterator<_Container>
+    back_inserter(_Container& __x)
+    { return back_insert_iterator<_Container>(__x); }
+  template<typename _Container>
+    class front_insert_iterator
+    : public iterator<output_iterator_tag, void, void, void, void>
+    {
+    protected:
+      _Container* container;
+
+    public:
+
+      typedef _Container container_type;
+
+
+      explicit front_insert_iterator(_Container& __x)
+      : container(std::__addressof(__x)) { }
+      front_insert_iterator&
+      operator=(const typename _Container::value_type& __value)
+      {
+ container->push_front(__value);
+ return *this;
+      }
+
+      front_insert_iterator&
+      operator=(typename _Container::value_type&& __value)
+      {
+ container->push_front(std::move(__value));
+ return *this;
+      }
+
+
+
+      front_insert_iterator&
+      operator*()
+      { return *this; }
+
+
+      front_insert_iterator&
+      operator++()
+      { return *this; }
+
+
+      front_insert_iterator
+      operator++(int)
+      { return *this; }
+    };
+  template<typename _Container>
+    inline front_insert_iterator<_Container>
+    front_inserter(_Container& __x)
+    { return front_insert_iterator<_Container>(__x); }
+  template<typename _Container>
+    class insert_iterator
+    : public iterator<output_iterator_tag, void, void, void, void>
+    {
+    protected:
+      _Container* container;
+      typename _Container::iterator iter;
+
+    public:
+
+      typedef _Container container_type;
+
+
+
+
+
+      insert_iterator(_Container& __x, typename _Container::iterator __i)
+      : container(std::__addressof(__x)), iter(__i) {}
+      insert_iterator&
+      operator=(const typename _Container::value_type& __value)
+      {
+ iter = container->insert(iter, __value);
+ ++iter;
+ return *this;
+      }
+
+      insert_iterator&
+      operator=(typename _Container::value_type&& __value)
+      {
+ iter = container->insert(iter, std::move(__value));
+ ++iter;
+ return *this;
+      }
+
+
+
+      insert_iterator&
+      operator*()
+      { return *this; }
+
+
+      insert_iterator&
+      operator++()
+      { return *this; }
+
+
+      insert_iterator&
+      operator++(int)
+      { return *this; }
+    };
+  template<typename _Container, typename _Iterator>
+    inline insert_iterator<_Container>
+    inserter(_Container& __x, _Iterator __i)
+    {
+      return insert_iterator<_Container>(__x,
+      typename _Container::iterator(__i));
+    }
+
+
+
+
+}
+
+namespace __gnu_cxx __attribute__ ((__visibility__ ("default")))
+{
+
+  using std::iterator_traits;
+  using std::iterator;
+  template<typename _Iterator, typename _Container>
+    class __normal_iterator
+    {
+    protected:
+      _Iterator _M_current;
+
+      typedef iterator_traits<_Iterator> __traits_type;
+
+    public:
+      typedef _Iterator iterator_type;
+      typedef typename __traits_type::iterator_category iterator_category;
+      typedef typename __traits_type::value_type value_type;
+      typedef typename __traits_type::difference_type difference_type;
+      typedef typename __traits_type::reference reference;
+      typedef typename __traits_type::pointer pointer;
+
+      constexpr __normal_iterator() noexcept
+      : _M_current(_Iterator()) { }
+
+      explicit
+      __normal_iterator(const _Iterator& __i) noexcept
+      : _M_current(__i) { }
+
+
+      template<typename _Iter>
+        __normal_iterator(const __normal_iterator<_Iter,
+     typename __enable_if<
+              (std::__are_same<_Iter, typename _Container::pointer>::__value),
+        _Container>::__type>& __i) noexcept
+        : _M_current(__i.base()) { }
+
+
+      reference
+      operator*() const noexcept
+      { return *_M_current; }
+
+      pointer
+      operator->() const noexcept
+      { return _M_current; }
+
+      __normal_iterator&
+      operator++() noexcept
+      {
+ ++_M_current;
+ return *this;
+      }
+
+      __normal_iterator
+      operator++(int) noexcept
+      { return __normal_iterator(_M_current++); }
+
+
+      __normal_iterator&
+      operator--() noexcept
+      {
+ --_M_current;
+ return *this;
+      }
+
+      __normal_iterator
+      operator--(int) noexcept
+      { return __normal_iterator(_M_current--); }
+
+
+      reference
+      operator[](difference_type __n) const noexcept
+      { return _M_current[__n]; }
+
+      __normal_iterator&
+      operator+=(difference_type __n) noexcept
+      { _M_current += __n; return *this; }
+
+      __normal_iterator
+      operator+(difference_type __n) const noexcept
+      { return __normal_iterator(_M_current + __n); }
+
+      __normal_iterator&
+      operator-=(difference_type __n) noexcept
+      { _M_current -= __n; return *this; }
+
+      __normal_iterator
+      operator-(difference_type __n) const noexcept
+      { return __normal_iterator(_M_current - __n); }
+
+      const _Iterator&
+      base() const noexcept
+      { return _M_current; }
+    };
+  template<typename _IteratorL, typename _IteratorR, typename _Container>
+    inline bool
+    operator==(const __normal_iterator<_IteratorL, _Container>& __lhs,
+        const __normal_iterator<_IteratorR, _Container>& __rhs)
+    noexcept
+    { return __lhs.base() == __rhs.base(); }
+
+  template<typename _Iterator, typename _Container>
+    inline bool
+    operator==(const __normal_iterator<_Iterator, _Container>& __lhs,
+        const __normal_iterator<_Iterator, _Container>& __rhs)
+    noexcept
+    { return __lhs.base() == __rhs.base(); }
+
+  template<typename _IteratorL, typename _IteratorR, typename _Container>
+    inline bool
+    operator!=(const __normal_iterator<_IteratorL, _Container>& __lhs,
+        const __normal_iterator<_IteratorR, _Container>& __rhs)
+    noexcept
+    { return __lhs.base() != __rhs.base(); }
+
+  template<typename _Iterator, typename _Container>
+    inline bool
+    operator!=(const __normal_iterator<_Iterator, _Container>& __lhs,
+        const __normal_iterator<_Iterator, _Container>& __rhs)
+    noexcept
+    { return __lhs.base() != __rhs.base(); }
+
+
+  template<typename _IteratorL, typename _IteratorR, typename _Container>
+    inline bool
+    operator<(const __normal_iterator<_IteratorL, _Container>& __lhs,
+       const __normal_iterator<_IteratorR, _Container>& __rhs)
+    noexcept
+    { return __lhs.base() < __rhs.base(); }
+
+  template<typename _Iterator, typename _Container>
+    inline bool
+    operator<(const __normal_iterator<_Iterator, _Container>& __lhs,
+       const __normal_iterator<_Iterator, _Container>& __rhs)
+    noexcept
+    { return __lhs.base() < __rhs.base(); }
+
+  template<typename _IteratorL, typename _IteratorR, typename _Container>
+    inline bool
+    operator>(const __normal_iterator<_IteratorL, _Container>& __lhs,
+       const __normal_iterator<_IteratorR, _Container>& __rhs)
+    noexcept
+    { return __lhs.base() > __rhs.base(); }
+
+  template<typename _Iterator, typename _Container>
+    inline bool
+    operator>(const __normal_iterator<_Iterator, _Container>& __lhs,
+       const __normal_iterator<_Iterator, _Container>& __rhs)
+    noexcept
+    { return __lhs.base() > __rhs.base(); }
+
+  template<typename _IteratorL, typename _IteratorR, typename _Container>
+    inline bool
+    operator<=(const __normal_iterator<_IteratorL, _Container>& __lhs,
+        const __normal_iterator<_IteratorR, _Container>& __rhs)
+    noexcept
+    { return __lhs.base() <= __rhs.base(); }
+
+  template<typename _Iterator, typename _Container>
+    inline bool
+    operator<=(const __normal_iterator<_Iterator, _Container>& __lhs,
+        const __normal_iterator<_Iterator, _Container>& __rhs)
+    noexcept
+    { return __lhs.base() <= __rhs.base(); }
+
+  template<typename _IteratorL, typename _IteratorR, typename _Container>
+    inline bool
+    operator>=(const __normal_iterator<_IteratorL, _Container>& __lhs,
+        const __normal_iterator<_IteratorR, _Container>& __rhs)
+    noexcept
+    { return __lhs.base() >= __rhs.base(); }
+
+  template<typename _Iterator, typename _Container>
+    inline bool
+    operator>=(const __normal_iterator<_Iterator, _Container>& __lhs,
+        const __normal_iterator<_Iterator, _Container>& __rhs)
+    noexcept
+    { return __lhs.base() >= __rhs.base(); }
+
+
+
+
+
+  template<typename _IteratorL, typename _IteratorR, typename _Container>
+
+
+    inline auto
+    operator-(const __normal_iterator<_IteratorL, _Container>& __lhs,
+       const __normal_iterator<_IteratorR, _Container>& __rhs) noexcept
+    -> decltype(__lhs.base() - __rhs.base())
+
+
+
+
+
+    { return __lhs.base() - __rhs.base(); }
+
+  template<typename _Iterator, typename _Container>
+    inline typename __normal_iterator<_Iterator, _Container>::difference_type
+    operator-(const __normal_iterator<_Iterator, _Container>& __lhs,
+       const __normal_iterator<_Iterator, _Container>& __rhs)
+    noexcept
+    { return __lhs.base() - __rhs.base(); }
+
+  template<typename _Iterator, typename _Container>
+    inline __normal_iterator<_Iterator, _Container>
+    operator+(typename __normal_iterator<_Iterator, _Container>::difference_type
+       __n, const __normal_iterator<_Iterator, _Container>& __i)
+    noexcept
+    { return __normal_iterator<_Iterator, _Container>(__i.base() + __n); }
+
+
+}
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+  template<typename _Iterator, typename _Container>
+    _Iterator
+    __niter_base(__gnu_cxx::__normal_iterator<_Iterator, _Container> __it)
+    { return __it.base(); }
+  template<typename _Iterator>
+    class move_iterator
+    {
+    protected:
+      _Iterator _M_current;
+
+      typedef iterator_traits<_Iterator> __traits_type;
+      typedef typename __traits_type::reference __base_ref;
+
+    public:
+      typedef _Iterator iterator_type;
+      typedef typename __traits_type::iterator_category iterator_category;
+      typedef typename __traits_type::value_type value_type;
+      typedef typename __traits_type::difference_type difference_type;
+
+      typedef _Iterator pointer;
+
+
+      typedef typename conditional<is_reference<__base_ref>::value,
+    typename remove_reference<__base_ref>::type&&,
+    __base_ref>::type reference;
+
+     
+      move_iterator()
+      : _M_current() { }
+
+      explicit
+      move_iterator(iterator_type __i)
+      : _M_current(__i) { }
+
+      template<typename _Iter>
+
+ move_iterator(const move_iterator<_Iter>& __i)
+ : _M_current(__i.base()) { }
+
+      iterator_type
+      base() const
+      { return _M_current; }
+
+      reference
+      operator*() const
+      { return static_cast<reference>(*_M_current); }
+
+      pointer
+      operator->() const
+      { return _M_current; }
+
+      move_iterator&
+      operator++()
+      {
+ ++_M_current;
+ return *this;
+      }
+
+      move_iterator
+      operator++(int)
+      {
+ move_iterator __tmp = *this;
+ ++_M_current;
+ return __tmp;
+      }
+
+      move_iterator&
+      operator--()
+      {
+ --_M_current;
+ return *this;
+      }
+
+      move_iterator
+      operator--(int)
+      {
+ move_iterator __tmp = *this;
+ --_M_current;
+ return __tmp;
+      }
+
+      move_iterator
+      operator+(difference_type __n) const
+      { return move_iterator(_M_current + __n); }
+
+      move_iterator&
+      operator+=(difference_type __n)
+      {
+ _M_current += __n;
+ return *this;
+      }
+
+      move_iterator
+      operator-(difference_type __n) const
+      { return move_iterator(_M_current - __n); }
+
+      move_iterator&
+      operator-=(difference_type __n)
+      {
+ _M_current -= __n;
+ return *this;
+      }
+
+      reference
+      operator[](difference_type __n) const
+      { return std::move(_M_current[__n]); }
+    };
+
+
+
+
+  template<typename _IteratorL, typename _IteratorR>
+    inline bool
+    operator==(const move_iterator<_IteratorL>& __x,
+        const move_iterator<_IteratorR>& __y)
+    { return __x.base() == __y.base(); }
+
+  template<typename _Iterator>
+    inline bool
+    operator==(const move_iterator<_Iterator>& __x,
+        const move_iterator<_Iterator>& __y)
+    { return __x.base() == __y.base(); }
+
+  template<typename _IteratorL, typename _IteratorR>
+    inline bool
+    operator!=(const move_iterator<_IteratorL>& __x,
+        const move_iterator<_IteratorR>& __y)
+    { return !(__x == __y); }
+
+  template<typename _Iterator>
+    inline bool
+    operator!=(const move_iterator<_Iterator>& __x,
+        const move_iterator<_Iterator>& __y)
+    { return !(__x == __y); }
+
+  template<typename _IteratorL, typename _IteratorR>
+    inline bool
+    operator<(const move_iterator<_IteratorL>& __x,
+       const move_iterator<_IteratorR>& __y)
+    { return __x.base() < __y.base(); }
+
+  template<typename _Iterator>
+    inline bool
+    operator<(const move_iterator<_Iterator>& __x,
+       const move_iterator<_Iterator>& __y)
+    { return __x.base() < __y.base(); }
+
+  template<typename _IteratorL, typename _IteratorR>
+    inline bool
+    operator<=(const move_iterator<_IteratorL>& __x,
+        const move_iterator<_IteratorR>& __y)
+    { return !(__y < __x); }
+
+  template<typename _Iterator>
+    inline bool
+    operator<=(const move_iterator<_Iterator>& __x,
+        const move_iterator<_Iterator>& __y)
+    { return !(__y < __x); }
+
+  template<typename _IteratorL, typename _IteratorR>
+    inline bool
+    operator>(const move_iterator<_IteratorL>& __x,
+       const move_iterator<_IteratorR>& __y)
+    { return __y < __x; }
+
+  template<typename _Iterator>
+    inline bool
+    operator>(const move_iterator<_Iterator>& __x,
+       const move_iterator<_Iterator>& __y)
+    { return __y < __x; }
+
+  template<typename _IteratorL, typename _IteratorR>
+    inline bool
+    operator>=(const move_iterator<_IteratorL>& __x,
+        const move_iterator<_IteratorR>& __y)
+    { return !(__x < __y); }
+
+  template<typename _Iterator>
+    inline bool
+    operator>=(const move_iterator<_Iterator>& __x,
+        const move_iterator<_Iterator>& __y)
+    { return !(__x < __y); }
+
+
+  template<typename _IteratorL, typename _IteratorR>
+    inline auto
+    operator-(const move_iterator<_IteratorL>& __x,
+       const move_iterator<_IteratorR>& __y)
+    -> decltype(__x.base() - __y.base())
+    { return __x.base() - __y.base(); }
+
+  template<typename _Iterator>
+    inline move_iterator<_Iterator>
+    operator+(typename move_iterator<_Iterator>::difference_type __n,
+       const move_iterator<_Iterator>& __x)
+    { return __x + __n; }
+
+  template<typename _Iterator>
+    inline move_iterator<_Iterator>
+    make_move_iterator(_Iterator __i)
+    { return move_iterator<_Iterator>(__i); }
+
+  template<typename _Iterator, typename _ReturnType
+    = typename conditional<__move_if_noexcept_cond
+      <typename iterator_traits<_Iterator>::value_type>::value,
+                _Iterator, move_iterator<_Iterator>>::type>
+    inline _ReturnType
+    __make_move_if_noexcept_iterator(_Iterator __i)
+    { return _ReturnType(__i); }
+
+
+
+  template<typename _Tp, typename _ReturnType
+    = typename conditional<__move_if_noexcept_cond<_Tp>::value,
+      const _Tp*, move_iterator<_Tp*>>::type>
+    inline _ReturnType
+    __make_move_if_noexcept_iterator(_Tp* __i)
+    { return _ReturnType(__i); }
+
+
+
+  template<typename _Iterator>
+    auto
+    __niter_base(move_iterator<_Iterator> __it)
+    -> decltype(make_move_iterator(__niter_base(__it.base())))
+    { return make_move_iterator(__niter_base(__it.base())); }
+
+  template<typename _Iterator>
+    struct __is_move_iterator<move_iterator<_Iterator> >
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<typename _Iterator>
+    auto
+    __miter_base(move_iterator<_Iterator> __it)
+    -> decltype(__miter_base(__it.base()))
+    { return __miter_base(__it.base()); }
+
+}
+
+namespace std
+{
+  namespace __debug { }
+}
+
+
+
+
+namespace __gnu_debug
+{
+  using namespace std::__debug;
+}
+
+namespace __gnu_cxx
+{
+namespace __ops
+{
+  struct _Iter_less_iter
+  {
+    template<typename _Iterator1, typename _Iterator2>
+     
+      bool
+      operator()(_Iterator1 __it1, _Iterator2 __it2) const
+      { return *__it1 < *__it2; }
+  };
+
+ 
+  inline _Iter_less_iter
+  __iter_less_iter()
+  { return _Iter_less_iter(); }
+
+  struct _Iter_less_val
+  {
+
+    constexpr _Iter_less_val() = default;
+
+
+
+
+    explicit
+    _Iter_less_val(_Iter_less_iter) { }
+
+    template<typename _Iterator, typename _Value>
+      bool
+      operator()(_Iterator __it, _Value& __val) const
+      { return *__it < __val; }
+  };
+
+  inline _Iter_less_val
+  __iter_less_val()
+  { return _Iter_less_val(); }
+
+  inline _Iter_less_val
+  __iter_comp_val(_Iter_less_iter)
+  { return _Iter_less_val(); }
+
+  struct _Val_less_iter
+  {
+
+    constexpr _Val_less_iter() = default;
+
+
+
+
+    explicit
+    _Val_less_iter(_Iter_less_iter) { }
+
+    template<typename _Value, typename _Iterator>
+      bool
+      operator()(_Value& __val, _Iterator __it) const
+      { return __val < *__it; }
+  };
+
+  inline _Val_less_iter
+  __val_less_iter()
+  { return _Val_less_iter(); }
+
+  inline _Val_less_iter
+  __val_comp_iter(_Iter_less_iter)
+  { return _Val_less_iter(); }
+
+  struct _Iter_equal_to_iter
+  {
+    template<typename _Iterator1, typename _Iterator2>
+      bool
+      operator()(_Iterator1 __it1, _Iterator2 __it2) const
+      { return *__it1 == *__it2; }
+  };
+
+  inline _Iter_equal_to_iter
+  __iter_equal_to_iter()
+  { return _Iter_equal_to_iter(); }
+
+  struct _Iter_equal_to_val
+  {
+    template<typename _Iterator, typename _Value>
+      bool
+      operator()(_Iterator __it, _Value& __val) const
+      { return *__it == __val; }
+  };
+
+  inline _Iter_equal_to_val
+  __iter_equal_to_val()
+  { return _Iter_equal_to_val(); }
+
+  inline _Iter_equal_to_val
+  __iter_comp_val(_Iter_equal_to_iter)
+  { return _Iter_equal_to_val(); }
+
+  template<typename _Compare>
+    struct _Iter_comp_iter
+    {
+      _Compare _M_comp;
+
+      explicit
+      _Iter_comp_iter(_Compare __comp)
+ : _M_comp(std::move(__comp))
+      { }
+
+      template<typename _Iterator1, typename _Iterator2>
+       
+        bool
+        operator()(_Iterator1 __it1, _Iterator2 __it2)
+        { return bool(_M_comp(*__it1, *__it2)); }
+    };
+
+  template<typename _Compare>
+   
+    inline _Iter_comp_iter<_Compare>
+    __iter_comp_iter(_Compare __comp)
+    { return _Iter_comp_iter<_Compare>(std::move(__comp)); }
+
+  template<typename _Compare>
+    struct _Iter_comp_val
+    {
+      _Compare _M_comp;
+
+      explicit
+      _Iter_comp_val(_Compare __comp)
+ : _M_comp(std::move(__comp))
+      { }
+
+      explicit
+      _Iter_comp_val(const _Iter_comp_iter<_Compare>& __comp)
+ : _M_comp(__comp._M_comp)
+      { }
+
+
+      explicit
+      _Iter_comp_val(_Iter_comp_iter<_Compare>&& __comp)
+ : _M_comp(std::move(__comp._M_comp))
+      { }
+
+
+      template<typename _Iterator, typename _Value>
+ bool
+ operator()(_Iterator __it, _Value& __val)
+ { return bool(_M_comp(*__it, __val)); }
+    };
+
+  template<typename _Compare>
+   inline _Iter_comp_val<_Compare>
+    __iter_comp_val(_Compare __comp)
+    { return _Iter_comp_val<_Compare>(std::move(__comp)); }
+
+  template<typename _Compare>
+    inline _Iter_comp_val<_Compare>
+    __iter_comp_val(_Iter_comp_iter<_Compare> __comp)
+    { return _Iter_comp_val<_Compare>(std::move(__comp)); }
+
+  template<typename _Compare>
+    struct _Val_comp_iter
+    {
+      _Compare _M_comp;
+
+      explicit
+      _Val_comp_iter(_Compare __comp)
+ : _M_comp(std::move(__comp))
+      { }
+
+      explicit
+      _Val_comp_iter(const _Iter_comp_iter<_Compare>& __comp)
+ : _M_comp(__comp._M_comp)
+      { }
+
+
+      explicit
+      _Val_comp_iter(_Iter_comp_iter<_Compare>&& __comp)
+ : _M_comp(std::move(__comp._M_comp))
+      { }
+
+
+      template<typename _Value, typename _Iterator>
+ bool
+ operator()(_Value& __val, _Iterator __it)
+ { return bool(_M_comp(__val, *__it)); }
+    };
+
+  template<typename _Compare>
+    inline _Val_comp_iter<_Compare>
+    __val_comp_iter(_Compare __comp)
+    { return _Val_comp_iter<_Compare>(std::move(__comp)); }
+
+  template<typename _Compare>
+    inline _Val_comp_iter<_Compare>
+    __val_comp_iter(_Iter_comp_iter<_Compare> __comp)
+    { return _Val_comp_iter<_Compare>(std::move(__comp)); }
+
+  template<typename _Value>
+    struct _Iter_equals_val
+    {
+      _Value& _M_value;
+
+      explicit
+      _Iter_equals_val(_Value& __value)
+ : _M_value(__value)
+      { }
+
+      template<typename _Iterator>
+ bool
+ operator()(_Iterator __it)
+ { return *__it == _M_value; }
+    };
+
+  template<typename _Value>
+    inline _Iter_equals_val<_Value>
+    __iter_equals_val(_Value& __val)
+    { return _Iter_equals_val<_Value>(__val); }
+
+  template<typename _Iterator1>
+    struct _Iter_equals_iter
+    {
+      _Iterator1 _M_it1;
+
+      explicit
+      _Iter_equals_iter(_Iterator1 __it1)
+ : _M_it1(__it1)
+      { }
+
+      template<typename _Iterator2>
+ bool
+ operator()(_Iterator2 __it2)
+ { return *__it2 == *_M_it1; }
+    };
+
+  template<typename _Iterator>
+    inline _Iter_equals_iter<_Iterator>
+    __iter_comp_iter(_Iter_equal_to_iter, _Iterator __it)
+    { return _Iter_equals_iter<_Iterator>(__it); }
+
+  template<typename _Predicate>
+    struct _Iter_pred
+    {
+      _Predicate _M_pred;
+
+      explicit
+      _Iter_pred(_Predicate __pred)
+ : _M_pred(std::move(__pred))
+      { }
+
+      template<typename _Iterator>
+ bool
+ operator()(_Iterator __it)
+ { return bool(_M_pred(*__it)); }
+    };
+
+  template<typename _Predicate>
+    inline _Iter_pred<_Predicate>
+    __pred_iter(_Predicate __pred)
+    { return _Iter_pred<_Predicate>(std::move(__pred)); }
+
+  template<typename _Compare, typename _Value>
+    struct _Iter_comp_to_val
+    {
+      _Compare _M_comp;
+      _Value& _M_value;
+
+      _Iter_comp_to_val(_Compare __comp, _Value& __value)
+ : _M_comp(std::move(__comp)), _M_value(__value)
+      { }
+
+      template<typename _Iterator>
+ bool
+ operator()(_Iterator __it)
+ { return bool(_M_comp(*__it, _M_value)); }
+    };
+
+  template<typename _Compare, typename _Value>
+    _Iter_comp_to_val<_Compare, _Value>
+    __iter_comp_val(_Compare __comp, _Value &__val)
+    {
+      return _Iter_comp_to_val<_Compare, _Value>(std::move(__comp), __val);
+    }
+
+  template<typename _Compare, typename _Iterator1>
+    struct _Iter_comp_to_iter
+    {
+      _Compare _M_comp;
+      _Iterator1 _M_it1;
+
+      _Iter_comp_to_iter(_Compare __comp, _Iterator1 __it1)
+ : _M_comp(std::move(__comp)), _M_it1(__it1)
+      { }
+
+      template<typename _Iterator2>
+ bool
+ operator()(_Iterator2 __it2)
+ { return bool(_M_comp(*__it2, *_M_it1)); }
+    };
+
+  template<typename _Compare, typename _Iterator>
+    inline _Iter_comp_to_iter<_Compare, _Iterator>
+    __iter_comp_iter(_Iter_comp_iter<_Compare> __comp, _Iterator __it)
+    {
+      return _Iter_comp_to_iter<_Compare, _Iterator>(
+   std::move(__comp._M_comp), __it);
+    }
+
+  template<typename _Predicate>
+    struct _Iter_negate
+    {
+      _Predicate _M_pred;
+
+      explicit
+      _Iter_negate(_Predicate __pred)
+ : _M_pred(std::move(__pred))
+      { }
+
+      template<typename _Iterator>
+ bool
+ operator()(_Iterator __it)
+ { return !bool(_M_pred(*__it)); }
+    };
+
+  template<typename _Predicate>
+    inline _Iter_negate<_Predicate>
+    __negate(_Iter_pred<_Predicate> __pred)
+    { return _Iter_negate<_Predicate>(std::move(__pred._M_pred)); }
+
+}
+}
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+  template<typename _ForwardIterator1, typename _ForwardIterator2>
+    inline void
+    iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b)
+    {
+
+     
+
+     
+      swap(*__a, *__b);
+
+    }
+  template<typename _ForwardIterator1, typename _ForwardIterator2>
+    _ForwardIterator2
+    swap_ranges(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
+  _ForwardIterator2 __first2)
+    {
+
+     
+
+     
+
+      ;
+
+      for (; __first1 != __last1; ++__first1, (void)++__first2)
+ std::iter_swap(__first1, __first2);
+      return __first2;
+    }
+  template<typename _Tp>
+   
+    inline const _Tp&
+    min(const _Tp& __a, const _Tp& __b)
+    {
+
+     
+
+      if (__b < __a)
+ return __b;
+      return __a;
+    }
+  template<typename _Tp>
+   
+    inline const _Tp&
+    max(const _Tp& __a, const _Tp& __b)
+    {
+
+     
+
+      if (__a < __b)
+ return __b;
+      return __a;
+    }
+  template<typename _Tp, typename _Compare>
+   
+    inline const _Tp&
+    min(const _Tp& __a, const _Tp& __b, _Compare __comp)
+    {
+
+      if (__comp(__b, __a))
+ return __b;
+      return __a;
+    }
+  template<typename _Tp, typename _Compare>
+   
+    inline const _Tp&
+    max(const _Tp& __a, const _Tp& __b, _Compare __comp)
+    {
+
+      if (__comp(__a, __b))
+ return __b;
+      return __a;
+    }
+
+
+
+  template<typename _Iterator>
+    inline _Iterator
+    __niter_base(_Iterator __it)
+    { return __it; }
+
+
+
+
+  template<typename _From, typename _To>
+    inline _From
+    __niter_wrap(_From __from, _To __res)
+    { return __from + (__res - std::__niter_base(__from)); }
+
+
+  template<typename _Iterator>
+    inline _Iterator
+    __niter_wrap(const _Iterator&, _Iterator __res)
+    { return __res; }
+
+
+
+
+
+
+
+  template<bool, bool, typename>
+    struct __copy_move
+    {
+      template<typename _II, typename _OI>
+ static _OI
+ __copy_m(_II __first, _II __last, _OI __result)
+ {
+   for (; __first != __last; ++__result, (void)++__first)
+     *__result = *__first;
+   return __result;
+ }
+    };
+
+
+  template<typename _Category>
+    struct __copy_move<true, false, _Category>
+    {
+      template<typename _II, typename _OI>
+ static _OI
+ __copy_m(_II __first, _II __last, _OI __result)
+ {
+   for (; __first != __last; ++__result, (void)++__first)
+     *__result = std::move(*__first);
+   return __result;
+ }
+    };
+
+
+  template<>
+    struct __copy_move<false, false, random_access_iterator_tag>
+    {
+      template<typename _II, typename _OI>
+ static _OI
+ __copy_m(_II __first, _II __last, _OI __result)
+ {
+   typedef typename iterator_traits<_II>::difference_type _Distance;
+   for(_Distance __n = __last - __first; __n > 0; --__n)
+     {
+       *__result = *__first;
+       ++__first;
+       ++__result;
+     }
+   return __result;
+ }
+    };
+
+
+  template<>
+    struct __copy_move<true, false, random_access_iterator_tag>
+    {
+      template<typename _II, typename _OI>
+ static _OI
+ __copy_m(_II __first, _II __last, _OI __result)
+ {
+   typedef typename iterator_traits<_II>::difference_type _Distance;
+   for(_Distance __n = __last - __first; __n > 0; --__n)
+     {
+       *__result = std::move(*__first);
+       ++__first;
+       ++__result;
+     }
+   return __result;
+ }
+    };
+
+
+  template<bool _IsMove>
+    struct __copy_move<_IsMove, true, random_access_iterator_tag>
+    {
+      template<typename _Tp>
+ static _Tp*
+ __copy_m(const _Tp* __first, const _Tp* __last, _Tp* __result)
+ {
+
+   using __assignable = conditional<_IsMove,
+        is_move_assignable<_Tp>,
+        is_copy_assignable<_Tp>>;
+
+   static_assert( __assignable::type::value, "type is not assignable" );
+
+   const ptrdiff_t _Num = __last - __first;
+   if (_Num)
+     __builtin_memmove(__result, __first, sizeof(_Tp) * _Num);
+   return __result + _Num;
+ }
+    };
+
+  template<bool _IsMove, typename _II, typename _OI>
+    inline _OI
+    __copy_move_a(_II __first, _II __last, _OI __result)
+    {
+      typedef typename iterator_traits<_II>::value_type _ValueTypeI;
+      typedef typename iterator_traits<_OI>::value_type _ValueTypeO;
+      typedef typename iterator_traits<_II>::iterator_category _Category;
+      const bool __simple = (__is_trivially_copyable(_ValueTypeI)
+        && __is_pointer<_II>::__value
+        && __is_pointer<_OI>::__value
+        && __are_same<_ValueTypeI, _ValueTypeO>::__value);
+
+      return std::__copy_move<_IsMove, __simple,
+         _Category>::__copy_m(__first, __last, __result);
+    }
+
+
+
+  template<typename _CharT>
+    struct char_traits;
+
+  template<typename _CharT, typename _Traits>
+    class istreambuf_iterator;
+
+  template<typename _CharT, typename _Traits>
+    class ostreambuf_iterator;
+
+  template<bool _IsMove, typename _CharT>
+    typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
+      ostreambuf_iterator<_CharT, char_traits<_CharT> > >::__type
+    __copy_move_a2(_CharT*, _CharT*,
+     ostreambuf_iterator<_CharT, char_traits<_CharT> >);
+
+  template<bool _IsMove, typename _CharT>
+    typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
+      ostreambuf_iterator<_CharT, char_traits<_CharT> > >::__type
+    __copy_move_a2(const _CharT*, const _CharT*,
+     ostreambuf_iterator<_CharT, char_traits<_CharT> >);
+
+  template<bool _IsMove, typename _CharT>
+    typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
+        _CharT*>::__type
+    __copy_move_a2(istreambuf_iterator<_CharT, char_traits<_CharT> >,
+     istreambuf_iterator<_CharT, char_traits<_CharT> >, _CharT*);
+
+  template<bool _IsMove, typename _II, typename _OI>
+    inline _OI
+    __copy_move_a2(_II __first, _II __last, _OI __result)
+    {
+      return std::__niter_wrap(__result,
+  std::__copy_move_a<_IsMove>(std::__niter_base(__first),
+         std::__niter_base(__last),
+         std::__niter_base(__result)));
+    }
+  template<typename _II, typename _OI>
+    inline _OI
+    copy(_II __first, _II __last, _OI __result)
+    {
+
+     
+     
+
+      ;
+
+      return std::__copy_move_a2<__is_move_iterator<_II>::__value>
+      (std::__miter_base(__first), std::__miter_base(__last), __result);
+    }
+  template<typename _II, typename _OI>
+    inline _OI
+    move(_II __first, _II __last, _OI __result)
+    {
+
+     
+     
+
+      ;
+
+      return std::__copy_move_a2<true>(std::__miter_base(__first),
+           std::__miter_base(__last), __result);
+    }
+
+
+
+
+
+
+  template<bool, bool, typename>
+    struct __copy_move_backward
+    {
+      template<typename _BI1, typename _BI2>
+ static _BI2
+ __copy_move_b(_BI1 __first, _BI1 __last, _BI2 __result)
+ {
+   while (__first != __last)
+     *--__result = *--__last;
+   return __result;
+ }
+    };
+
+
+  template<typename _Category>
+    struct __copy_move_backward<true, false, _Category>
+    {
+      template<typename _BI1, typename _BI2>
+ static _BI2
+ __copy_move_b(_BI1 __first, _BI1 __last, _BI2 __result)
+ {
+   while (__first != __last)
+     *--__result = std::move(*--__last);
+   return __result;
+ }
+    };
+
+
+  template<>
+    struct __copy_move_backward<false, false, random_access_iterator_tag>
+    {
+      template<typename _BI1, typename _BI2>
+ static _BI2
+ __copy_move_b(_BI1 __first, _BI1 __last, _BI2 __result)
+ {
+   typename iterator_traits<_BI1>::difference_type __n;
+   for (__n = __last - __first; __n > 0; --__n)
+     *--__result = *--__last;
+   return __result;
+ }
+    };
+
+
+  template<>
+    struct __copy_move_backward<true, false, random_access_iterator_tag>
+    {
+      template<typename _BI1, typename _BI2>
+ static _BI2
+ __copy_move_b(_BI1 __first, _BI1 __last, _BI2 __result)
+ {
+   typename iterator_traits<_BI1>::difference_type __n;
+   for (__n = __last - __first; __n > 0; --__n)
+     *--__result = std::move(*--__last);
+   return __result;
+ }
+    };
+
+
+  template<bool _IsMove>
+    struct __copy_move_backward<_IsMove, true, random_access_iterator_tag>
+    {
+      template<typename _Tp>
+ static _Tp*
+ __copy_move_b(const _Tp* __first, const _Tp* __last, _Tp* __result)
+ {
+
+   using __assignable = conditional<_IsMove,
+        is_move_assignable<_Tp>,
+        is_copy_assignable<_Tp>>;
+
+   static_assert( __assignable::type::value, "type is not assignable" );
+
+   const ptrdiff_t _Num = __last - __first;
+   if (_Num)
+     __builtin_memmove(__result - _Num, __first, sizeof(_Tp) * _Num);
+   return __result - _Num;
+ }
+    };
+
+  template<bool _IsMove, typename _BI1, typename _BI2>
+    inline _BI2
+    __copy_move_backward_a(_BI1 __first, _BI1 __last, _BI2 __result)
+    {
+      typedef typename iterator_traits<_BI1>::value_type _ValueType1;
+      typedef typename iterator_traits<_BI2>::value_type _ValueType2;
+      typedef typename iterator_traits<_BI1>::iterator_category _Category;
+      const bool __simple = (__is_trivially_copyable(_ValueType1)
+        && __is_pointer<_BI1>::__value
+        && __is_pointer<_BI2>::__value
+        && __are_same<_ValueType1, _ValueType2>::__value);
+
+      return std::__copy_move_backward<_IsMove, __simple,
+           _Category>::__copy_move_b(__first,
+         __last,
+         __result);
+    }
+
+  template<bool _IsMove, typename _BI1, typename _BI2>
+    inline _BI2
+    __copy_move_backward_a2(_BI1 __first, _BI1 __last, _BI2 __result)
+    {
+      return std::__niter_wrap(__result,
+  std::__copy_move_backward_a<_IsMove>
+    (std::__niter_base(__first), std::__niter_base(__last),
+     std::__niter_base(__result)));
+    }
+  template<typename _BI1, typename _BI2>
+    inline _BI2
+    copy_backward(_BI1 __first, _BI1 __last, _BI2 __result)
+    {
+
+     
+     
+     
+
+
+      ;
+
+      return std::__copy_move_backward_a2<__is_move_iterator<_BI1>::__value>
+      (std::__miter_base(__first), std::__miter_base(__last), __result);
+    }
+  template<typename _BI1, typename _BI2>
+    inline _BI2
+    move_backward(_BI1 __first, _BI1 __last, _BI2 __result)
+    {
+
+     
+     
+     
+
+
+      ;
+
+      return std::__copy_move_backward_a2<true>(std::__miter_base(__first),
+      std::__miter_base(__last),
+      __result);
+    }
+
+
+
+
+
+
+  template<typename _ForwardIterator, typename _Tp>
+    inline typename
+    __gnu_cxx::__enable_if<!__is_scalar<_Tp>::__value, void>::__type
+    __fill_a(_ForwardIterator __first, _ForwardIterator __last,
+       const _Tp& __value)
+    {
+      for (; __first != __last; ++__first)
+ *__first = __value;
+    }
+
+  template<typename _ForwardIterator, typename _Tp>
+    inline typename
+    __gnu_cxx::__enable_if<__is_scalar<_Tp>::__value, void>::__type
+    __fill_a(_ForwardIterator __first, _ForwardIterator __last,
+      const _Tp& __value)
+    {
+      const _Tp __tmp = __value;
+      for (; __first != __last; ++__first)
+ *__first = __tmp;
+    }
+
+
+  template<typename _Tp>
+    inline typename
+    __gnu_cxx::__enable_if<__is_byte<_Tp>::__value, void>::__type
+    __fill_a(_Tp* __first, _Tp* __last, const _Tp& __c)
+    {
+      const _Tp __tmp = __c;
+      if (const size_t __len = __last - __first)
+ __builtin_memset(__first, static_cast<unsigned char>(__tmp), __len);
+    }
+  template<typename _ForwardIterator, typename _Tp>
+    inline void
+    fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value)
+    {
+
+     
+
+      ;
+
+      std::__fill_a(std::__niter_base(__first), std::__niter_base(__last),
+      __value);
+    }
+
+  template<typename _OutputIterator, typename _Size, typename _Tp>
+    inline typename
+    __gnu_cxx::__enable_if<!__is_scalar<_Tp>::__value, _OutputIterator>::__type
+    __fill_n_a(_OutputIterator __first, _Size __n, const _Tp& __value)
+    {
+      for (__decltype(__n + 0) __niter = __n;
+    __niter > 0; --__niter, (void) ++__first)
+ *__first = __value;
+      return __first;
+    }
+
+  template<typename _OutputIterator, typename _Size, typename _Tp>
+    inline typename
+    __gnu_cxx::__enable_if<__is_scalar<_Tp>::__value, _OutputIterator>::__type
+    __fill_n_a(_OutputIterator __first, _Size __n, const _Tp& __value)
+    {
+      const _Tp __tmp = __value;
+      for (__decltype(__n + 0) __niter = __n;
+    __niter > 0; --__niter, (void) ++__first)
+ *__first = __tmp;
+      return __first;
+    }
+
+  template<typename _Size, typename _Tp>
+    inline typename
+    __gnu_cxx::__enable_if<__is_byte<_Tp>::__value, _Tp*>::__type
+    __fill_n_a(_Tp* __first, _Size __n, const _Tp& __c)
+    {
+      std::__fill_a(__first, __first + __n, __c);
+      return __first + __n;
+    }
+  template<typename _OI, typename _Size, typename _Tp>
+    inline _OI
+    fill_n(_OI __first, _Size __n, const _Tp& __value)
+    {
+
+     
+      ;
+
+      return std::__niter_wrap(__first,
+  std::__fill_n_a(std::__niter_base(__first), __n, __value));
+    }
+
+  template<bool _BoolType>
+    struct __equal
+    {
+      template<typename _II1, typename _II2>
+ static bool
+ equal(_II1 __first1, _II1 __last1, _II2 __first2)
+ {
+   for (; __first1 != __last1; ++__first1, (void) ++__first2)
+     if (!(*__first1 == *__first2))
+       return false;
+   return true;
+ }
+    };
+
+  template<>
+    struct __equal<true>
+    {
+      template<typename _Tp>
+ static bool
+ equal(const _Tp* __first1, const _Tp* __last1, const _Tp* __first2)
+ {
+   if (const size_t __len = (__last1 - __first1))
+     return !__builtin_memcmp(__first1, __first2, sizeof(_Tp) * __len);
+   return true;
+ }
+    };
+
+  template<typename _II1, typename _II2>
+    inline bool
+    __equal_aux(_II1 __first1, _II1 __last1, _II2 __first2)
+    {
+      typedef typename iterator_traits<_II1>::value_type _ValueType1;
+      typedef typename iterator_traits<_II2>::value_type _ValueType2;
+      const bool __simple = ((__is_integer<_ValueType1>::__value
+         || __is_pointer<_ValueType1>::__value)
+        && __is_pointer<_II1>::__value
+        && __is_pointer<_II2>::__value
+        && __are_same<_ValueType1, _ValueType2>::__value);
+
+      return std::__equal<__simple>::equal(__first1, __last1, __first2);
+    }
+
+  template<typename, typename>
+    struct __lc_rai
+    {
+      template<typename _II1, typename _II2>
+ static _II1
+ __newlast1(_II1, _II1 __last1, _II2, _II2)
+ { return __last1; }
+
+      template<typename _II>
+ static bool
+ __cnd2(_II __first, _II __last)
+ { return __first != __last; }
+    };
+
+  template<>
+    struct __lc_rai<random_access_iterator_tag, random_access_iterator_tag>
+    {
+      template<typename _RAI1, typename _RAI2>
+ static _RAI1
+ __newlast1(_RAI1 __first1, _RAI1 __last1,
+     _RAI2 __first2, _RAI2 __last2)
+ {
+   const typename iterator_traits<_RAI1>::difference_type
+     __diff1 = __last1 - __first1;
+   const typename iterator_traits<_RAI2>::difference_type
+     __diff2 = __last2 - __first2;
+   return __diff2 < __diff1 ? __first1 + __diff2 : __last1;
+ }
+
+      template<typename _RAI>
+ static bool
+ __cnd2(_RAI, _RAI)
+ { return true; }
+    };
+
+  template<typename _II1, typename _II2, typename _Compare>
+    bool
+    __lexicographical_compare_impl(_II1 __first1, _II1 __last1,
+       _II2 __first2, _II2 __last2,
+       _Compare __comp)
+    {
+      typedef typename iterator_traits<_II1>::iterator_category _Category1;
+      typedef typename iterator_traits<_II2>::iterator_category _Category2;
+      typedef std::__lc_rai<_Category1, _Category2> __rai_type;
+
+      __last1 = __rai_type::__newlast1(__first1, __last1, __first2, __last2);
+      for (; __first1 != __last1 && __rai_type::__cnd2(__first2, __last2);
+    ++__first1, (void)++__first2)
+ {
+   if (__comp(__first1, __first2))
+     return true;
+   if (__comp(__first2, __first1))
+     return false;
+ }
+      return __first1 == __last1 && __first2 != __last2;
+    }
+
+  template<bool _BoolType>
+    struct __lexicographical_compare
+    {
+      template<typename _II1, typename _II2>
+ static bool __lc(_II1, _II1, _II2, _II2);
+    };
+
+  template<bool _BoolType>
+    template<typename _II1, typename _II2>
+      bool
+      __lexicographical_compare<_BoolType>::
+      __lc(_II1 __first1, _II1 __last1, _II2 __first2, _II2 __last2)
+      {
+ return std::__lexicographical_compare_impl(__first1, __last1,
+         __first2, __last2,
+     __gnu_cxx::__ops::__iter_less_iter());
+      }
+
+  template<>
+    struct __lexicographical_compare<true>
+    {
+      template<typename _Tp, typename _Up>
+ static bool
+ __lc(const _Tp* __first1, const _Tp* __last1,
+      const _Up* __first2, const _Up* __last2)
+ {
+   const size_t __len1 = __last1 - __first1;
+   const size_t __len2 = __last2 - __first2;
+   if (const size_t __len = std::min(__len1, __len2))
+     if (int __result = __builtin_memcmp(__first1, __first2, __len))
+       return __result < 0;
+   return __len1 < __len2;
+ }
+    };
+
+  template<typename _II1, typename _II2>
+    inline bool
+    __lexicographical_compare_aux(_II1 __first1, _II1 __last1,
+      _II2 __first2, _II2 __last2)
+    {
+      typedef typename iterator_traits<_II1>::value_type _ValueType1;
+      typedef typename iterator_traits<_II2>::value_type _ValueType2;
+      const bool __simple =
+ (__is_byte<_ValueType1>::__value && __is_byte<_ValueType2>::__value
+  && !__gnu_cxx::__numeric_traits<_ValueType1>::__is_signed
+  && !__gnu_cxx::__numeric_traits<_ValueType2>::__is_signed
+  && __is_pointer<_II1>::__value
+  && __is_pointer<_II2>::__value);
+
+      return std::__lexicographical_compare<__simple>::__lc(__first1, __last1,
+           __first2, __last2);
+    }
+
+  template<typename _ForwardIterator, typename _Tp, typename _Compare>
+    _ForwardIterator
+    __lower_bound(_ForwardIterator __first, _ForwardIterator __last,
+    const _Tp& __val, _Compare __comp)
+    {
+      typedef typename iterator_traits<_ForwardIterator>::difference_type
+ _DistanceType;
+
+      _DistanceType __len = std::distance(__first, __last);
+
+      while (__len > 0)
+ {
+   _DistanceType __half = __len >> 1;
+   _ForwardIterator __middle = __first;
+   std::advance(__middle, __half);
+   if (__comp(__middle, __val))
+     {
+       __first = __middle;
+       ++__first;
+       __len = __len - __half - 1;
+     }
+   else
+     __len = __half;
+ }
+      return __first;
+    }
+  template<typename _ForwardIterator, typename _Tp>
+    inline _ForwardIterator
+    lower_bound(_ForwardIterator __first, _ForwardIterator __last,
+  const _Tp& __val)
+    {
+
+     
+     
+
+      ;
+
+      return std::__lower_bound(__first, __last, __val,
+    __gnu_cxx::__ops::__iter_less_val());
+    }
+
+
+
+  inline constexpr int
+  __lg(int __n)
+  { return sizeof(int) * 8 - 1 - __builtin_clz(__n); }
+
+  inline constexpr unsigned
+  __lg(unsigned __n)
+  { return sizeof(int) * 8 - 1 - __builtin_clz(__n); }
+
+  inline constexpr long
+  __lg(long __n)
+  { return sizeof(long) * 8 - 1 - __builtin_clzl(__n); }
+
+  inline constexpr unsigned long
+  __lg(unsigned long __n)
+  { return sizeof(long) * 8 - 1 - __builtin_clzl(__n); }
+
+  inline constexpr long long
+  __lg(long long __n)
+  { return sizeof(long long) * 8 - 1 - __builtin_clzll(__n); }
+
+  inline constexpr unsigned long long
+  __lg(unsigned long long __n)
+  { return sizeof(long long) * 8 - 1 - __builtin_clzll(__n); }
+
+
+  template<typename _II1, typename _II2>
+    inline bool
+    equal(_II1 __first1, _II1 __last1, _II2 __first2)
+    {
+
+     
+     
+     
+
+
+      ;
+
+      return std::__equal_aux(std::__niter_base(__first1),
+         std::__niter_base(__last1),
+         std::__niter_base(__first2));
+    }
+  template<typename _IIter1, typename _IIter2, typename _BinaryPredicate>
+    inline bool
+    equal(_IIter1 __first1, _IIter1 __last1,
+   _IIter2 __first2, _BinaryPredicate __binary_pred)
+    {
+
+     
+     
+      ;
+
+      for (; __first1 != __last1; ++__first1, (void)++__first2)
+ if (!bool(__binary_pred(*__first1, *__first2)))
+   return false;
+      return true;
+    }
+
+
+
+  template<typename _II1, typename _II2>
+    inline bool
+    __equal4(_II1 __first1, _II1 __last1, _II2 __first2, _II2 __last2)
+    {
+      using _RATag = random_access_iterator_tag;
+      using _Cat1 = typename iterator_traits<_II1>::iterator_category;
+      using _Cat2 = typename iterator_traits<_II2>::iterator_category;
+      using _RAIters = __and_<is_same<_Cat1, _RATag>, is_same<_Cat2, _RATag>>;
+      if (_RAIters())
+ {
+   auto __d1 = std::distance(__first1, __last1);
+   auto __d2 = std::distance(__first2, __last2);
+   if (__d1 != __d2)
+     return false;
+   return std::equal(__first1, __last1, __first2);
+ }
+
+      for (; __first1 != __last1 && __first2 != __last2;
+   ++__first1, (void)++__first2)
+ if (!(*__first1 == *__first2))
+   return false;
+      return __first1 == __last1 && __first2 == __last2;
+    }
+
+
+  template<typename _II1, typename _II2, typename _BinaryPredicate>
+    inline bool
+    __equal4(_II1 __first1, _II1 __last1, _II2 __first2, _II2 __last2,
+      _BinaryPredicate __binary_pred)
+    {
+      using _RATag = random_access_iterator_tag;
+      using _Cat1 = typename iterator_traits<_II1>::iterator_category;
+      using _Cat2 = typename iterator_traits<_II2>::iterator_category;
+      using _RAIters = __and_<is_same<_Cat1, _RATag>, is_same<_Cat2, _RATag>>;
+      if (_RAIters())
+ {
+   auto __d1 = std::distance(__first1, __last1);
+   auto __d2 = std::distance(__first2, __last2);
+   if (__d1 != __d2)
+     return false;
+   return std::equal(__first1, __last1, __first2,
+           __binary_pred);
+ }
+
+      for (; __first1 != __last1 && __first2 != __last2;
+   ++__first1, (void)++__first2)
+ if (!bool(__binary_pred(*__first1, *__first2)))
+   return false;
+      return __first1 == __last1 && __first2 == __last2;
+    }
+  template<typename _II1, typename _II2>
+    inline bool
+    lexicographical_compare(_II1 __first1, _II1 __last1,
+       _II2 __first2, _II2 __last2)
+    {
+
+
+
+
+
+     
+     
+     
+     
+      ;
+      ;
+
+      return std::__lexicographical_compare_aux(std::__niter_base(__first1),
+      std::__niter_base(__last1),
+      std::__niter_base(__first2),
+      std::__niter_base(__last2));
+    }
+  template<typename _II1, typename _II2, typename _Compare>
+    inline bool
+    lexicographical_compare(_II1 __first1, _II1 __last1,
+       _II2 __first2, _II2 __last2, _Compare __comp)
+    {
+
+     
+     
+      ;
+      ;
+
+      return std::__lexicographical_compare_impl
+ (__first1, __last1, __first2, __last2,
+  __gnu_cxx::__ops::__iter_comp_iter(__comp));
+    }
+
+  template<typename _InputIterator1, typename _InputIterator2,
+    typename _BinaryPredicate>
+    pair<_InputIterator1, _InputIterator2>
+    __mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
+        _InputIterator2 __first2, _BinaryPredicate __binary_pred)
+    {
+      while (__first1 != __last1 && __binary_pred(__first1, __first2))
+ {
+   ++__first1;
+   ++__first2;
+ }
+      return pair<_InputIterator1, _InputIterator2>(__first1, __first2);
+    }
+  template<typename _InputIterator1, typename _InputIterator2>
+    inline pair<_InputIterator1, _InputIterator2>
+    mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
+      _InputIterator2 __first2)
+    {
+
+     
+     
+     
+
+
+      ;
+
+      return std::__mismatch(__first1, __last1, __first2,
+        __gnu_cxx::__ops::__iter_equal_to_iter());
+    }
+  template<typename _InputIterator1, typename _InputIterator2,
+    typename _BinaryPredicate>
+    inline pair<_InputIterator1, _InputIterator2>
+    mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
+      _InputIterator2 __first2, _BinaryPredicate __binary_pred)
+    {
+
+     
+     
+      ;
+
+      return std::__mismatch(__first1, __last1, __first2,
+ __gnu_cxx::__ops::__iter_comp_iter(__binary_pred));
+    }
+
+
+}
+
+       
+
+
+
+
+
+
+
+
+
+namespace __gnu_cxx __attribute__ ((__visibility__ ("default")))
+{
+
+  template<typename _CharT>
+    struct _Char_types
+    {
+      typedef unsigned long int_type;
+      typedef std::streampos pos_type;
+      typedef std::streamoff off_type;
+      typedef std::mbstate_t state_type;
+    };
+  template<typename _CharT>
+    struct char_traits
+    {
+      typedef _CharT char_type;
+      typedef typename _Char_types<_CharT>::int_type int_type;
+      typedef typename _Char_types<_CharT>::pos_type pos_type;
+      typedef typename _Char_types<_CharT>::off_type off_type;
+      typedef typename _Char_types<_CharT>::state_type state_type;
+
+      static void
+      assign(char_type& __c1, const char_type& __c2)
+      { __c1 = __c2; }
+
+      static constexpr bool
+      eq(const char_type& __c1, const char_type& __c2)
+      { return __c1 == __c2; }
+
+      static constexpr bool
+      lt(const char_type& __c1, const char_type& __c2)
+      { return __c1 < __c2; }
+
+      static int
+      compare(const char_type* __s1, const char_type* __s2, std::size_t __n);
+
+      static std::size_t
+      length(const char_type* __s);
+
+      static const char_type*
+      find(const char_type* __s, std::size_t __n, const char_type& __a);
+
+      static char_type*
+      move(char_type* __s1, const char_type* __s2, std::size_t __n);
+
+      static char_type*
+      copy(char_type* __s1, const char_type* __s2, std::size_t __n);
+
+      static char_type*
+      assign(char_type* __s, std::size_t __n, char_type __a);
+
+      static constexpr char_type
+      to_char_type(const int_type& __c)
+      { return static_cast<char_type>(__c); }
+
+      static constexpr int_type
+      to_int_type(const char_type& __c)
+      { return static_cast<int_type>(__c); }
+
+      static constexpr bool
+      eq_int_type(const int_type& __c1, const int_type& __c2)
+      { return __c1 == __c2; }
+
+      static constexpr int_type
+      eof()
+      { return static_cast<int_type>(-1); }
+
+      static constexpr int_type
+      not_eof(const int_type& __c)
+      { return !eq_int_type(__c, eof()) ? __c : to_int_type(char_type()); }
+    };
+
+  template<typename _CharT>
+    int
+    char_traits<_CharT>::
+    compare(const char_type* __s1, const char_type* __s2, std::size_t __n)
+    {
+      for (std::size_t __i = 0; __i < __n; ++__i)
+ if (lt(__s1[__i], __s2[__i]))
+   return -1;
+ else if (lt(__s2[__i], __s1[__i]))
+   return 1;
+      return 0;
+    }
+
+  template<typename _CharT>
+    std::size_t
+    char_traits<_CharT>::
+    length(const char_type* __p)
+    {
+      std::size_t __i = 0;
+      while (!eq(__p[__i], char_type()))
+        ++__i;
+      return __i;
+    }
+
+  template<typename _CharT>
+    const typename char_traits<_CharT>::char_type*
+    char_traits<_CharT>::
+    find(const char_type* __s, std::size_t __n, const char_type& __a)
+    {
+      for (std::size_t __i = 0; __i < __n; ++__i)
+        if (eq(__s[__i], __a))
+          return __s + __i;
+      return 0;
+    }
+
+  template<typename _CharT>
+    typename char_traits<_CharT>::char_type*
+    char_traits<_CharT>::
+    move(char_type* __s1, const char_type* __s2, std::size_t __n)
+    {
+      return static_cast<_CharT*>(__builtin_memmove(__s1, __s2,
+          __n * sizeof(char_type)));
+    }
+
+  template<typename _CharT>
+    typename char_traits<_CharT>::char_type*
+    char_traits<_CharT>::
+    copy(char_type* __s1, const char_type* __s2, std::size_t __n)
+    {
+
+      std::copy(__s2, __s2 + __n, __s1);
+      return __s1;
+    }
+
+  template<typename _CharT>
+    typename char_traits<_CharT>::char_type*
+    char_traits<_CharT>::
+    assign(char_type* __s, std::size_t __n, char_type __a)
+    {
+
+      std::fill_n(__s, __n, __a);
+      return __s;
+    }
+
+
+}
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+  template<class _CharT>
+    struct char_traits : public __gnu_cxx::char_traits<_CharT>
+    { };
+
+
+
+  template<>
+    struct char_traits<char>
+    {
+      typedef char char_type;
+      typedef int int_type;
+      typedef streampos pos_type;
+      typedef streamoff off_type;
+      typedef mbstate_t state_type;
+
+      static void
+      assign(char_type& __c1, const char_type& __c2) noexcept
+      { __c1 = __c2; }
+
+      static constexpr bool
+      eq(const char_type& __c1, const char_type& __c2) noexcept
+      { return __c1 == __c2; }
+
+      static constexpr bool
+      lt(const char_type& __c1, const char_type& __c2) noexcept
+      {
+
+ return (static_cast<unsigned char>(__c1)
+  < static_cast<unsigned char>(__c2));
+      }
+
+      static int
+      compare(const char_type* __s1, const char_type* __s2, size_t __n)
+      {
+
+
+
+
+
+
+ if (__n == 0)
+   return 0;
+ return __builtin_memcmp(__s1, __s2, __n);
+      }
+
+      static size_t
+      length(const char_type* __s)
+      {
+
+
+
+
+ return __builtin_strlen(__s);
+      }
+
+      static const char_type*
+      find(const char_type* __s, size_t __n, const char_type& __a)
+      {
+
+
+
+
+
+
+ if (__n == 0)
+   return 0;
+ return static_cast<const char_type*>(__builtin_memchr(__s, __a, __n));
+      }
+
+      static char_type*
+      move(char_type* __s1, const char_type* __s2, size_t __n)
+      {
+ if (__n == 0)
+   return __s1;
+ return static_cast<char_type*>(__builtin_memmove(__s1, __s2, __n));
+      }
+
+      static char_type*
+      copy(char_type* __s1, const char_type* __s2, size_t __n)
+      {
+ if (__n == 0)
+   return __s1;
+ return static_cast<char_type*>(__builtin_memcpy(__s1, __s2, __n));
+      }
+
+      static char_type*
+      assign(char_type* __s, size_t __n, char_type __a)
+      {
+ if (__n == 0)
+   return __s;
+ return static_cast<char_type*>(__builtin_memset(__s, __a, __n));
+      }
+
+      static constexpr char_type
+      to_char_type(const int_type& __c) noexcept
+      { return static_cast<char_type>(__c); }
+
+
+
+      static constexpr int_type
+      to_int_type(const char_type& __c) noexcept
+      { return static_cast<int_type>(static_cast<unsigned char>(__c)); }
+
+      static constexpr bool
+      eq_int_type(const int_type& __c1, const int_type& __c2) noexcept
+      { return __c1 == __c2; }
+
+      static constexpr int_type
+      eof() noexcept
+      { return static_cast<int_type>(-1); }
+
+      static constexpr int_type
+      not_eof(const int_type& __c) noexcept
+      { return (__c == eof()) ? 0 : __c; }
+  };
+
+
+
+
+  template<>
+    struct char_traits<wchar_t>
+    {
+      typedef wchar_t char_type;
+      typedef wint_t int_type;
+      typedef streamoff off_type;
+      typedef wstreampos pos_type;
+      typedef mbstate_t state_type;
+
+      static void
+      assign(char_type& __c1, const char_type& __c2) noexcept
+      { __c1 = __c2; }
+
+      static constexpr bool
+      eq(const char_type& __c1, const char_type& __c2) noexcept
+      { return __c1 == __c2; }
+
+      static constexpr bool
+      lt(const char_type& __c1, const char_type& __c2) noexcept
+      { return __c1 < __c2; }
+
+      static int
+      compare(const char_type* __s1, const char_type* __s2, size_t __n)
+      {
+
+
+
+
+
+
+ if (__n == 0)
+   return 0;
+ else
+   return wmemcmp(__s1, __s2, __n);
+      }
+
+      static size_t
+      length(const char_type* __s)
+      {
+
+
+
+
+
+   return wcslen(__s);
+      }
+
+      static const char_type*
+      find(const char_type* __s, size_t __n, const char_type& __a)
+      {
+
+
+
+
+
+
+ if (__n == 0)
+   return 0;
+ else
+   return wmemchr(__s, __a, __n);
+      }
+
+      static char_type*
+      move(char_type* __s1, const char_type* __s2, size_t __n)
+      {
+ if (__n == 0)
+   return __s1;
+ return wmemmove(__s1, __s2, __n);
+      }
+
+      static char_type*
+      copy(char_type* __s1, const char_type* __s2, size_t __n)
+      {
+ if (__n == 0)
+   return __s1;
+ return wmemcpy(__s1, __s2, __n);
+      }
+
+      static char_type*
+      assign(char_type* __s, size_t __n, char_type __a)
+      {
+ if (__n == 0)
+   return __s;
+ return wmemset(__s, __a, __n);
+      }
+
+      static constexpr char_type
+      to_char_type(const int_type& __c) noexcept
+      { return char_type(__c); }
+
+      static constexpr int_type
+      to_int_type(const char_type& __c) noexcept
+      { return int_type(__c); }
+
+      static constexpr bool
+      eq_int_type(const int_type& __c1, const int_type& __c2) noexcept
+      { return __c1 == __c2; }
+
+      static constexpr int_type
+      eof() noexcept
+      { return static_cast<int_type>((0xffffffffu)); }
+
+      static constexpr int_type
+      not_eof(const int_type& __c) noexcept
+      { return eq_int_type(__c, eof()) ? 0 : __c; }
+  };
+
+
+
+}
+
+
+
+       
+typedef signed char int8_t;
+typedef short int int16_t;
+typedef int int32_t;
+
+typedef long int int64_t;
+
+
+
+
+
+
+
+typedef unsigned char uint8_t;
+typedef unsigned short int uint16_t;
+
+typedef unsigned int uint32_t;
+
+
+
+typedef unsigned long int uint64_t;
+typedef signed char int_least8_t;
+typedef short int int_least16_t;
+typedef int int_least32_t;
+
+typedef long int int_least64_t;
+
+
+
+
+
+
+typedef unsigned char uint_least8_t;
+typedef unsigned short int uint_least16_t;
+typedef unsigned int uint_least32_t;
+
+typedef unsigned long int uint_least64_t;
+typedef signed char int_fast8_t;
+
+typedef long int int_fast16_t;
+typedef long int int_fast32_t;
+typedef long int int_fast64_t;
+typedef unsigned char uint_fast8_t;
+
+typedef unsigned long int uint_fast16_t;
+typedef unsigned long int uint_fast32_t;
+typedef unsigned long int uint_fast64_t;
+typedef long int intptr_t;
+
+
+typedef unsigned long int uintptr_t;
+typedef long int intmax_t;
+typedef unsigned long int uintmax_t;
+
+
+namespace std
+{
+
+  using ::int8_t;
+  using ::int16_t;
+  using ::int32_t;
+  using ::int64_t;
+
+  using ::int_fast8_t;
+  using ::int_fast16_t;
+  using ::int_fast32_t;
+  using ::int_fast64_t;
+
+  using ::int_least8_t;
+  using ::int_least16_t;
+  using ::int_least32_t;
+  using ::int_least64_t;
+
+  using ::intmax_t;
+  using ::intptr_t;
+
+  using ::uint8_t;
+  using ::uint16_t;
+  using ::uint32_t;
+  using ::uint64_t;
+
+  using ::uint_fast8_t;
+  using ::uint_fast16_t;
+  using ::uint_fast32_t;
+  using ::uint_fast64_t;
+
+  using ::uint_least8_t;
+  using ::uint_least16_t;
+  using ::uint_least32_t;
+  using ::uint_least64_t;
+
+  using ::uintmax_t;
+  using ::uintptr_t;
+
+
+
+
+
+}
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+  template<>
+    struct char_traits<char16_t>
+    {
+      typedef char16_t char_type;
+
+      typedef uint_least16_t int_type;
+
+
+
+
+
+      typedef streamoff off_type;
+      typedef u16streampos pos_type;
+      typedef mbstate_t state_type;
+
+      static void
+      assign(char_type& __c1, const char_type& __c2) noexcept
+      { __c1 = __c2; }
+
+      static constexpr bool
+      eq(const char_type& __c1, const char_type& __c2) noexcept
+      { return __c1 == __c2; }
+
+      static constexpr bool
+      lt(const char_type& __c1, const char_type& __c2) noexcept
+      { return __c1 < __c2; }
+
+      static int
+      compare(const char_type* __s1, const char_type* __s2, size_t __n)
+      {
+ for (size_t __i = 0; __i < __n; ++__i)
+   if (lt(__s1[__i], __s2[__i]))
+     return -1;
+   else if (lt(__s2[__i], __s1[__i]))
+     return 1;
+ return 0;
+      }
+
+      static size_t
+      length(const char_type* __s)
+      {
+ size_t __i = 0;
+ while (!eq(__s[__i], char_type()))
+   ++__i;
+ return __i;
+      }
+
+      static const char_type*
+      find(const char_type* __s, size_t __n, const char_type& __a)
+      {
+ for (size_t __i = 0; __i < __n; ++__i)
+   if (eq(__s[__i], __a))
+     return __s + __i;
+ return 0;
+      }
+
+      static char_type*
+      move(char_type* __s1, const char_type* __s2, size_t __n)
+      {
+ if (__n == 0)
+   return __s1;
+ return (static_cast<char_type*>
+  (__builtin_memmove(__s1, __s2, __n * sizeof(char_type))));
+      }
+
+      static char_type*
+      copy(char_type* __s1, const char_type* __s2, size_t __n)
+      {
+ if (__n == 0)
+   return __s1;
+ return (static_cast<char_type*>
+  (__builtin_memcpy(__s1, __s2, __n * sizeof(char_type))));
+      }
+
+      static char_type*
+      assign(char_type* __s, size_t __n, char_type __a)
+      {
+ for (size_t __i = 0; __i < __n; ++__i)
+   assign(__s[__i], __a);
+ return __s;
+      }
+
+      static constexpr char_type
+      to_char_type(const int_type& __c) noexcept
+      { return char_type(__c); }
+
+      static constexpr int_type
+      to_int_type(const char_type& __c) noexcept
+      { return __c == eof() ? int_type(0xfffd) : int_type(__c); }
+
+      static constexpr bool
+      eq_int_type(const int_type& __c1, const int_type& __c2) noexcept
+      { return __c1 == __c2; }
+
+      static constexpr int_type
+      eof() noexcept
+      { return static_cast<int_type>(-1); }
+
+      static constexpr int_type
+      not_eof(const int_type& __c) noexcept
+      { return eq_int_type(__c, eof()) ? 0 : __c; }
+    };
+
+  template<>
+    struct char_traits<char32_t>
+    {
+      typedef char32_t char_type;
+
+      typedef uint_least32_t int_type;
+
+
+
+
+
+      typedef streamoff off_type;
+      typedef u32streampos pos_type;
+      typedef mbstate_t state_type;
+
+      static void
+      assign(char_type& __c1, const char_type& __c2) noexcept
+      { __c1 = __c2; }
+
+      static constexpr bool
+      eq(const char_type& __c1, const char_type& __c2) noexcept
+      { return __c1 == __c2; }
+
+      static constexpr bool
+      lt(const char_type& __c1, const char_type& __c2) noexcept
+      { return __c1 < __c2; }
+
+      static int
+      compare(const char_type* __s1, const char_type* __s2, size_t __n)
+      {
+ for (size_t __i = 0; __i < __n; ++__i)
+   if (lt(__s1[__i], __s2[__i]))
+     return -1;
+   else if (lt(__s2[__i], __s1[__i]))
+     return 1;
+ return 0;
+      }
+
+      static size_t
+      length(const char_type* __s)
+      {
+ size_t __i = 0;
+ while (!eq(__s[__i], char_type()))
+   ++__i;
+ return __i;
+      }
+
+      static const char_type*
+      find(const char_type* __s, size_t __n, const char_type& __a)
+      {
+ for (size_t __i = 0; __i < __n; ++__i)
+   if (eq(__s[__i], __a))
+     return __s + __i;
+ return 0;
+      }
+
+      static char_type*
+      move(char_type* __s1, const char_type* __s2, size_t __n)
+      {
+ if (__n == 0)
+   return __s1;
+ return (static_cast<char_type*>
+  (__builtin_memmove(__s1, __s2, __n * sizeof(char_type))));
+      }
+
+      static char_type*
+      copy(char_type* __s1, const char_type* __s2, size_t __n)
+      {
+ if (__n == 0)
+   return __s1;
+ return (static_cast<char_type*>
+  (__builtin_memcpy(__s1, __s2, __n * sizeof(char_type))));
+      }
+
+      static char_type*
+      assign(char_type* __s, size_t __n, char_type __a)
+      {
+ for (size_t __i = 0; __i < __n; ++__i)
+   assign(__s[__i], __a);
+ return __s;
+      }
+
+      static constexpr char_type
+      to_char_type(const int_type& __c) noexcept
+      { return char_type(__c); }
+
+      static constexpr int_type
+      to_int_type(const char_type& __c) noexcept
+      { return int_type(__c); }
+
+      static constexpr bool
+      eq_int_type(const int_type& __c1, const int_type& __c2) noexcept
+      { return __c1 == __c2; }
+
+      static constexpr int_type
+      eof() noexcept
+      { return static_cast<int_type>(-1); }
+
+      static constexpr int_type
+      not_eof(const int_type& __c) noexcept
+      { return eq_int_type(__c, eof()) ? 0 : __c; }
+    };
+
+
+}
+       
+
+
+       
+
+       
+
+
+
+extern "C" {
+
+
+
+struct lconv
+{
+
+
+  char *decimal_point;
+  char *thousands_sep;
+
+
+
+
+
+  char *grouping;
+
+
+
+
+
+  char *int_curr_symbol;
+  char *currency_symbol;
+  char *mon_decimal_point;
+  char *mon_thousands_sep;
+  char *mon_grouping;
+  char *positive_sign;
+  char *negative_sign;
+  char int_frac_digits;
+  char frac_digits;
+
+  char p_cs_precedes;
+
+  char p_sep_by_space;
+
+  char n_cs_precedes;
+
+  char n_sep_by_space;
+
+
+
+
+
+
+  char p_sign_posn;
+  char n_sign_posn;
+
+
+  char int_p_cs_precedes;
+
+  char int_p_sep_by_space;
+
+  char int_n_cs_precedes;
+
+  char int_n_sep_by_space;
+
+
+
+
+
+
+  char int_p_sign_posn;
+  char int_n_sign_posn;
+};
+
+
+
+extern char *setlocale (int __category, const char *__locale) throw ();
+
+
+extern struct lconv *localeconv (void) throw ();
+
+
+extern __locale_t newlocale (int __category_mask, const char *__locale,
+        __locale_t __base) throw ();
+extern __locale_t duplocale (__locale_t __dataset) throw ();
+
+
+
+extern void freelocale (__locale_t __dataset) throw ();
+
+
+
+
+
+
+extern __locale_t uselocale (__locale_t __dataset) throw ();
+
+
+
+
+
+
+
+}
+namespace std
+{
+  using ::lconv;
+  using ::setlocale;
+  using ::localeconv;
+}
+
+
+
+
+
+
+namespace __gnu_cxx __attribute__ ((__visibility__ ("default")))
+{
+
+
+  extern "C" __typeof(uselocale) __uselocale;
+
+
+}
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+  typedef __locale_t __c_locale;
+
+
+
+
+
+  inline int
+  __convert_from_v(const __c_locale& __cloc __attribute__ ((__unused__)),
+     char* __out,
+     const int __size __attribute__ ((__unused__)),
+     const char* __fmt, ...)
+  {
+
+    __c_locale __old = __gnu_cxx::__uselocale(__cloc);
+    __builtin_va_list __args;
+    __builtin_va_start(__args, __fmt);
+
+
+    const int __ret = __builtin_vsnprintf(__out, __size, __fmt, __args);
+
+
+
+
+    __builtin_va_end(__args);
+
+
+    __gnu_cxx::__uselocale(__old);
+
+
+
+
+
+
+
+    return __ret;
+  }
+
+
+}
+
+       
+
+
+
+
+typedef unsigned char __u_char;
+typedef unsigned short int __u_short;
+typedef unsigned int __u_int;
+typedef unsigned long int __u_long;
+
+
+typedef signed char __int8_t;
+typedef unsigned char __uint8_t;
+typedef signed short int __int16_t;
+typedef unsigned short int __uint16_t;
+typedef signed int __int32_t;
+typedef unsigned int __uint32_t;
+
+typedef signed long int __int64_t;
+typedef unsigned long int __uint64_t;
+
+
+
+
+
+
+
+typedef long int __quad_t;
+typedef unsigned long int __u_quad_t;
+
+
+typedef unsigned long int __dev_t;
+typedef unsigned int __uid_t;
+typedef unsigned int __gid_t;
+typedef unsigned long int __ino_t;
+typedef unsigned long int __ino64_t;
+typedef unsigned int __mode_t;
+typedef unsigned long int __nlink_t;
+typedef long int __off_t;
+typedef long int __off64_t;
+typedef int __pid_t;
+typedef struct { int __val[2]; } __fsid_t;
+typedef long int __clock_t;
+typedef unsigned long int __rlim_t;
+typedef unsigned long int __rlim64_t;
+typedef unsigned int __id_t;
+typedef long int __time_t;
+typedef unsigned int __useconds_t;
+typedef long int __suseconds_t;
+
+typedef int __daddr_t;
+typedef int __key_t;
+
+
+typedef int __clockid_t;
+
+
+typedef void * __timer_t;
+
+
+typedef long int __blksize_t;
+
+
+
+
+typedef long int __blkcnt_t;
+typedef long int __blkcnt64_t;
+
+
+typedef unsigned long int __fsblkcnt_t;
+typedef unsigned long int __fsblkcnt64_t;
+
+
+typedef unsigned long int __fsfilcnt_t;
+typedef unsigned long int __fsfilcnt64_t;
+
+
+typedef long int __fsword_t;
+
+typedef long int __ssize_t;
+
+
+typedef long int __syscall_slong_t;
+
+typedef unsigned long int __syscall_ulong_t;
+
+
+
+typedef __off64_t __loff_t;
+typedef __quad_t *__qaddr_t;
+typedef char *__caddr_t;
+
+
+typedef long int __intptr_t;
+
+
+typedef unsigned int __socklen_t;
+
+extern "C" {
+
+
+
+
+
+
+static __inline unsigned int
+__bswap_32 (unsigned int __bsx)
+{
+  return __builtin_bswap32 (__bsx);
+}
+static __inline __uint64_t
+__bswap_64 (__uint64_t __bsx)
+{
+  return __builtin_bswap64 (__bsx);
+}
+
+
+
+
+
+
+enum
+{
+  _ISupper = ((0) < 8 ? ((1 << (0)) << 8) : ((1 << (0)) >> 8)),
+  _ISlower = ((1) < 8 ? ((1 << (1)) << 8) : ((1 << (1)) >> 8)),
+  _ISalpha = ((2) < 8 ? ((1 << (2)) << 8) : ((1 << (2)) >> 8)),
+  _ISdigit = ((3) < 8 ? ((1 << (3)) << 8) : ((1 << (3)) >> 8)),
+  _ISxdigit = ((4) < 8 ? ((1 << (4)) << 8) : ((1 << (4)) >> 8)),
+  _ISspace = ((5) < 8 ? ((1 << (5)) << 8) : ((1 << (5)) >> 8)),
+  _ISprint = ((6) < 8 ? ((1 << (6)) << 8) : ((1 << (6)) >> 8)),
+  _ISgraph = ((7) < 8 ? ((1 << (7)) << 8) : ((1 << (7)) >> 8)),
+  _ISblank = ((8) < 8 ? ((1 << (8)) << 8) : ((1 << (8)) >> 8)),
+  _IScntrl = ((9) < 8 ? ((1 << (9)) << 8) : ((1 << (9)) >> 8)),
+  _ISpunct = ((10) < 8 ? ((1 << (10)) << 8) : ((1 << (10)) >> 8)),
+  _ISalnum = ((11) < 8 ? ((1 << (11)) << 8) : ((1 << (11)) >> 8))
+};
+extern const unsigned short int **__ctype_b_loc (void)
+     throw () __attribute__ ((__const__));
+extern const __int32_t **__ctype_tolower_loc (void)
+     throw () __attribute__ ((__const__));
+extern const __int32_t **__ctype_toupper_loc (void)
+     throw () __attribute__ ((__const__));
+
+
+
+
+
+
+extern int isalnum (int) throw ();
+extern int isalpha (int) throw ();
+extern int iscntrl (int) throw ();
+extern int isdigit (int) throw ();
+extern int islower (int) throw ();
+extern int isgraph (int) throw ();
+extern int isprint (int) throw ();
+extern int ispunct (int) throw ();
+extern int isspace (int) throw ();
+extern int isupper (int) throw ();
+extern int isxdigit (int) throw ();
+
+
+
+extern int tolower (int __c) throw ();
+
+
+extern int toupper (int __c) throw ();
+
+
+
+
+
+
+
+
+extern int isblank (int) throw ();
+
+
+
+
+
+
+extern int isctype (int __c, int __mask) throw ();
+
+
+
+
+
+
+extern int isascii (int __c) throw ();
+
+
+
+extern int toascii (int __c) throw ();
+
+
+
+extern int _toupper (int) throw ();
+extern int _tolower (int) throw ();
+extern int isalnum_l (int, __locale_t) throw ();
+extern int isalpha_l (int, __locale_t) throw ();
+extern int iscntrl_l (int, __locale_t) throw ();
+extern int isdigit_l (int, __locale_t) throw ();
+extern int islower_l (int, __locale_t) throw ();
+extern int isgraph_l (int, __locale_t) throw ();
+extern int isprint_l (int, __locale_t) throw ();
+extern int ispunct_l (int, __locale_t) throw ();
+extern int isspace_l (int, __locale_t) throw ();
+extern int isupper_l (int, __locale_t) throw ();
+extern int isxdigit_l (int, __locale_t) throw ();
+
+extern int isblank_l (int, __locale_t) throw ();
+
+
+
+extern int __tolower_l (int __c, __locale_t __l) throw ();
+extern int tolower_l (int __c, __locale_t __l) throw ();
+
+
+extern int __toupper_l (int __c, __locale_t __l) throw ();
+extern int toupper_l (int __c, __locale_t __l) throw ();
+}
+namespace std
+{
+  using ::isalnum;
+  using ::isalpha;
+  using ::iscntrl;
+  using ::isdigit;
+  using ::isgraph;
+  using ::islower;
+  using ::isprint;
+  using ::ispunct;
+  using ::isspace;
+  using ::isupper;
+  using ::isxdigit;
+  using ::tolower;
+  using ::toupper;
+}
+
+
+
+
+
+
+
+namespace std
+{
+  using ::isblank;
+}
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+  class locale;
+
+  template<typename _Facet>
+    bool
+    has_facet(const locale&) throw();
+
+  template<typename _Facet>
+    const _Facet&
+    use_facet(const locale&);
+
+
+  template<typename _CharT>
+    bool
+    isspace(_CharT, const locale&);
+
+  template<typename _CharT>
+    bool
+    isprint(_CharT, const locale&);
+
+  template<typename _CharT>
+    bool
+    iscntrl(_CharT, const locale&);
+
+  template<typename _CharT>
+    bool
+    isupper(_CharT, const locale&);
+
+  template<typename _CharT>
+    bool
+    islower(_CharT, const locale&);
+
+  template<typename _CharT>
+    bool
+    isalpha(_CharT, const locale&);
+
+  template<typename _CharT>
+    bool
+    isdigit(_CharT, const locale&);
+
+  template<typename _CharT>
+    bool
+    ispunct(_CharT, const locale&);
+
+  template<typename _CharT>
+    bool
+    isxdigit(_CharT, const locale&);
+
+  template<typename _CharT>
+    bool
+    isalnum(_CharT, const locale&);
+
+  template<typename _CharT>
+    bool
+    isgraph(_CharT, const locale&);
+
+
+  template<typename _CharT>
+    bool
+    isblank(_CharT, const locale&);
+
+
+  template<typename _CharT>
+    _CharT
+    toupper(_CharT, const locale&);
+
+  template<typename _CharT>
+    _CharT
+    tolower(_CharT, const locale&);
+
+
+  class ctype_base;
+  template<typename _CharT>
+    class ctype;
+  template<> class ctype<char>;
+
+  template<> class ctype<wchar_t>;
+
+  template<typename _CharT>
+    class ctype_byname;
+
+
+  class codecvt_base;
+  template<typename _InternT, typename _ExternT, typename _StateT>
+    class codecvt;
+  template<> class codecvt<char, char, mbstate_t>;
+
+  template<> class codecvt<wchar_t, char, mbstate_t>;
+
+  template<typename _InternT, typename _ExternT, typename _StateT>
+    class codecvt_byname;
+
+
+
+  template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> >
+    class num_get;
+  template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
+    class num_put;
+
+namespace __cxx11 {
+  template<typename _CharT> class numpunct;
+  template<typename _CharT> class numpunct_byname;
+}
+
+namespace __cxx11 {
+
+  template<typename _CharT>
+    class collate;
+  template<typename _CharT>
+    class collate_byname;
+}
+
+
+  class time_base;
+namespace __cxx11 {
+  template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> >
+    class time_get;
+  template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> >
+    class time_get_byname;
+}
+  template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
+    class time_put;
+  template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
+    class time_put_byname;
+
+
+  class money_base;
+namespace __cxx11 {
+  template<typename _CharT, typename _InIter = istreambuf_iterator<_CharT> >
+    class money_get;
+  template<typename _CharT, typename _OutIter = ostreambuf_iterator<_CharT> >
+    class money_put;
+}
+namespace __cxx11 {
+  template<typename _CharT, bool _Intl = false>
+    class moneypunct;
+  template<typename _CharT, bool _Intl = false>
+    class moneypunct_byname;
+}
+
+
+  class messages_base;
+namespace __cxx11 {
+  template<typename _CharT>
+    class messages;
+  template<typename _CharT>
+    class messages_byname;
+}
+
+
+}
+       
+
+       
+
+
+
+
+
+
+
+typedef __time_t time_t;
+
+
+
+struct timespec
+  {
+    __time_t tv_sec;
+    __syscall_slong_t tv_nsec;
+  };
+
+
+typedef __pid_t pid_t;
+
+
+
+
+
+struct sched_param
+  {
+    int __sched_priority;
+  };
+
+extern "C" {
+
+
+
+extern int clone (int (*__fn) (void *__arg), void *__child_stack,
+    int __flags, void *__arg, ...) throw ();
+
+
+extern int unshare (int __flags) throw ();
+
+
+extern int sched_getcpu (void) throw ();
+
+
+extern int setns (int __fd, int __nstype) throw ();
+
+
+
+}
+
+
+
+
+
+
+
+struct __sched_param
+  {
+    int __sched_priority;
+  };
+typedef unsigned long int __cpu_mask;
+
+
+
+
+
+
+typedef struct
+{
+  __cpu_mask __bits[1024 / (8 * sizeof (__cpu_mask))];
+} cpu_set_t;
+extern "C" {
+
+extern int __sched_cpucount (size_t __setsize, const cpu_set_t *__setp)
+  throw ();
+extern cpu_set_t *__sched_cpualloc (size_t __count) throw () ;
+extern void __sched_cpufree (cpu_set_t *__set) throw ();
+
+}
+
+
+
+
+extern "C" {
+
+
+extern int sched_setparam (__pid_t __pid, const struct sched_param *__param)
+     throw ();
+
+
+extern int sched_getparam (__pid_t __pid, struct sched_param *__param) throw ();
+
+
+extern int sched_setscheduler (__pid_t __pid, int __policy,
+          const struct sched_param *__param) throw ();
+
+
+extern int sched_getscheduler (__pid_t __pid) throw ();
+
+
+extern int sched_yield (void) throw ();
+
+
+extern int sched_get_priority_max (int __algorithm) throw ();
+
+
+extern int sched_get_priority_min (int __algorithm) throw ();
+
+
+extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) throw ();
+extern int sched_setaffinity (__pid_t __pid, size_t __cpusetsize,
+         const cpu_set_t *__cpuset) throw ();
+
+
+extern int sched_getaffinity (__pid_t __pid, size_t __cpusetsize,
+         cpu_set_t *__cpuset) throw ();
+
+
+}
+extern "C" {
+
+
+
+
+
+
+
+
+
+
+struct timeval
+  {
+    __time_t tv_sec;
+    __suseconds_t tv_usec;
+  };
+struct timex
+{
+  unsigned int modes;
+  __syscall_slong_t offset;
+  __syscall_slong_t freq;
+  __syscall_slong_t maxerror;
+  __syscall_slong_t esterror;
+  int status;
+  __syscall_slong_t constant;
+  __syscall_slong_t precision;
+  __syscall_slong_t tolerance;
+  struct timeval time;
+  __syscall_slong_t tick;
+  __syscall_slong_t ppsfreq;
+  __syscall_slong_t jitter;
+  int shift;
+  __syscall_slong_t stabil;
+  __syscall_slong_t jitcnt;
+  __syscall_slong_t calcnt;
+  __syscall_slong_t errcnt;
+  __syscall_slong_t stbcnt;
+
+  int tai;
+
+
+  int :32; int :32; int :32; int :32;
+  int :32; int :32; int :32; int :32;
+  int :32; int :32; int :32;
+};
+
+extern "C" {
+
+
+extern int clock_adjtime (__clockid_t __clock_id, struct timex *__utx) throw ();
+
+}
+
+
+typedef __clock_t clock_t;
+
+
+
+typedef __clockid_t clockid_t;
+typedef __timer_t timer_t;
+
+
+struct tm
+{
+  int tm_sec;
+  int tm_min;
+  int tm_hour;
+  int tm_mday;
+  int tm_mon;
+  int tm_year;
+  int tm_wday;
+  int tm_yday;
+  int tm_isdst;
+
+
+  long int tm_gmtoff;
+  const char *tm_zone;
+
+
+
+
+};
+
+
+
+
+
+
+
+
+struct itimerspec
+  {
+    struct timespec it_interval;
+    struct timespec it_value;
+  };
+
+
+struct sigevent;
+
+
+
+extern clock_t clock (void) throw ();
+
+
+extern time_t time (time_t *__timer) throw ();
+
+
+extern double difftime (time_t __time1, time_t __time0)
+     throw () __attribute__ ((__const__));
+
+
+extern time_t mktime (struct tm *__tp) throw ();
+
+
+
+
+
+extern size_t strftime (char *__restrict __s, size_t __maxsize,
+   const char *__restrict __format,
+   const struct tm *__restrict __tp) throw ();
+
+
+
+
+
+extern char *strptime (const char *__restrict __s,
+         const char *__restrict __fmt, struct tm *__tp)
+     throw ();
+
+
+
+
+
+
+
+extern size_t strftime_l (char *__restrict __s, size_t __maxsize,
+     const char *__restrict __format,
+     const struct tm *__restrict __tp,
+     __locale_t __loc) throw ();
+
+
+
+extern char *strptime_l (const char *__restrict __s,
+    const char *__restrict __fmt, struct tm *__tp,
+    __locale_t __loc) throw ();
+
+
+
+
+
+
+extern struct tm *gmtime (const time_t *__timer) throw ();
+
+
+
+extern struct tm *localtime (const time_t *__timer) throw ();
+
+
+
+
+
+extern struct tm *gmtime_r (const time_t *__restrict __timer,
+       struct tm *__restrict __tp) throw ();
+
+
+
+extern struct tm *localtime_r (const time_t *__restrict __timer,
+          struct tm *__restrict __tp) throw ();
+
+
+
+
+
+extern char *asctime (const struct tm *__tp) throw ();
+
+
+extern char *ctime (const time_t *__timer) throw ();
+
+
+
+
+
+
+
+extern char *asctime_r (const struct tm *__restrict __tp,
+   char *__restrict __buf) throw ();
+
+
+extern char *ctime_r (const time_t *__restrict __timer,
+        char *__restrict __buf) throw ();
+
+
+
+
+extern char *__tzname[2];
+extern int __daylight;
+extern long int __timezone;
+
+
+
+
+extern char *tzname[2];
+
+
+
+extern void tzset (void) throw ();
+
+
+
+extern int daylight;
+extern long int timezone;
+
+
+
+
+
+extern int stime (const time_t *__when) throw ();
+extern time_t timegm (struct tm *__tp) throw ();
+
+
+extern time_t timelocal (struct tm *__tp) throw ();
+
+
+extern int dysize (int __year) throw () __attribute__ ((__const__));
+extern int nanosleep (const struct timespec *__requested_time,
+        struct timespec *__remaining);
+
+
+
+extern int clock_getres (clockid_t __clock_id, struct timespec *__res) throw ();
+
+
+extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) throw ();
+
+
+extern int clock_settime (clockid_t __clock_id, const struct timespec *__tp)
+     throw ();
+
+
+
+
+
+
+extern int clock_nanosleep (clockid_t __clock_id, int __flags,
+       const struct timespec *__req,
+       struct timespec *__rem);
+
+
+extern int clock_getcpuclockid (pid_t __pid, clockid_t *__clock_id) throw ();
+
+
+
+
+extern int timer_create (clockid_t __clock_id,
+    struct sigevent *__restrict __evp,
+    timer_t *__restrict __timerid) throw ();
+
+
+extern int timer_delete (timer_t __timerid) throw ();
+
+
+extern int timer_settime (timer_t __timerid, int __flags,
+     const struct itimerspec *__restrict __value,
+     struct itimerspec *__restrict __ovalue) throw ();
+
+
+extern int timer_gettime (timer_t __timerid, struct itimerspec *__value)
+     throw ();
+
+
+extern int timer_getoverrun (timer_t __timerid) throw ();
+
+
+
+
+
+extern int timespec_get (struct timespec *__ts, int __base)
+     throw () __attribute__ ((__nonnull__ (1)));
+extern int getdate_err;
+extern struct tm *getdate (const char *__string);
+extern int getdate_r (const char *__restrict __string,
+        struct tm *__restrict __resbufp);
+
+
+}
+
+typedef unsigned long int pthread_t;
+
+
+union pthread_attr_t
+{
+  char __size[56];
+  long int __align;
+};
+
+typedef union pthread_attr_t pthread_attr_t;
+
+
+
+
+
+typedef struct __pthread_internal_list
+{
+  struct __pthread_internal_list *__prev;
+  struct __pthread_internal_list *__next;
+} __pthread_list_t;
+typedef union
+{
+  struct __pthread_mutex_s
+  {
+    int __lock;
+    unsigned int __count;
+    int __owner;
+
+    unsigned int __nusers;
+
+
+
+    int __kind;
+
+    short __spins;
+    short __elision;
+    __pthread_list_t __list;
+  } __data;
+  char __size[40];
+  long int __align;
+} pthread_mutex_t;
+
+typedef union
+{
+  char __size[4];
+  int __align;
+} pthread_mutexattr_t;
+
+
+
+
+typedef union
+{
+  struct
+  {
+    int __lock;
+    unsigned int __futex;
+    __extension__ unsigned long long int __total_seq;
+    __extension__ unsigned long long int __wakeup_seq;
+    __extension__ unsigned long long int __woken_seq;
+    void *__mutex;
+    unsigned int __nwaiters;
+    unsigned int __broadcast_seq;
+  } __data;
+  char __size[48];
+  __extension__ long long int __align;
+} pthread_cond_t;
+
+typedef union
+{
+  char __size[4];
+  int __align;
+} pthread_condattr_t;
+
+
+
+typedef unsigned int pthread_key_t;
+
+
+
+typedef int pthread_once_t;
+
+
+
+
+
+typedef union
+{
+
+  struct
+  {
+    int __lock;
+    unsigned int __nr_readers;
+    unsigned int __readers_wakeup;
+    unsigned int __writer_wakeup;
+    unsigned int __nr_readers_queued;
+    unsigned int __nr_writers_queued;
+    int __writer;
+    int __shared;
+    unsigned long int __pad1;
+    unsigned long int __pad2;
+
+
+    unsigned int __flags;
+
+  } __data;
+  char __size[56];
+  long int __align;
+} pthread_rwlock_t;
+
+typedef union
+{
+  char __size[8];
+  long int __align;
+} pthread_rwlockattr_t;
+
+
+
+
+
+typedef volatile int pthread_spinlock_t;
+
+
+
+
+typedef union
+{
+  char __size[32];
+  long int __align;
+} pthread_barrier_t;
+
+typedef union
+{
+  char __size[4];
+  int __align;
+} pthread_barrierattr_t;
+
+
+
+
+typedef long int __jmp_buf[8];
+
+
+
+enum
+{
+  PTHREAD_CREATE_JOINABLE,
+
+  PTHREAD_CREATE_DETACHED
+
+};
+
+
+
+enum
+{
+  PTHREAD_MUTEX_TIMED_NP,
+  PTHREAD_MUTEX_RECURSIVE_NP,
+  PTHREAD_MUTEX_ERRORCHECK_NP,
+  PTHREAD_MUTEX_ADAPTIVE_NP
+
+  ,
+  PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_TIMED_NP,
+  PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP,
+  PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP,
+  PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL
+
+
+
+  , PTHREAD_MUTEX_FAST_NP = PTHREAD_MUTEX_TIMED_NP
+
+};
+
+
+
+
+enum
+{
+  PTHREAD_MUTEX_STALLED,
+  PTHREAD_MUTEX_STALLED_NP = PTHREAD_MUTEX_STALLED,
+  PTHREAD_MUTEX_ROBUST,
+  PTHREAD_MUTEX_ROBUST_NP = PTHREAD_MUTEX_ROBUST
+};
+
+
+
+
+
+enum
+{
+  PTHREAD_PRIO_NONE,
+  PTHREAD_PRIO_INHERIT,
+  PTHREAD_PRIO_PROTECT
+};
+enum
+{
+  PTHREAD_RWLOCK_PREFER_READER_NP,
+  PTHREAD_RWLOCK_PREFER_WRITER_NP,
+  PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP,
+  PTHREAD_RWLOCK_DEFAULT_NP = PTHREAD_RWLOCK_PREFER_READER_NP
+};
+enum
+{
+  PTHREAD_INHERIT_SCHED,
+
+  PTHREAD_EXPLICIT_SCHED
+
+};
+
+
+
+enum
+{
+  PTHREAD_SCOPE_SYSTEM,
+
+  PTHREAD_SCOPE_PROCESS
+
+};
+
+
+
+enum
+{
+  PTHREAD_PROCESS_PRIVATE,
+
+  PTHREAD_PROCESS_SHARED
+
+};
+struct _pthread_cleanup_buffer
+{
+  void (*__routine) (void *);
+  void *__arg;
+  int __canceltype;
+  struct _pthread_cleanup_buffer *__prev;
+};
+
+
+enum
+{
+  PTHREAD_CANCEL_ENABLE,
+
+  PTHREAD_CANCEL_DISABLE
+
+};
+enum
+{
+  PTHREAD_CANCEL_DEFERRED,
+
+  PTHREAD_CANCEL_ASYNCHRONOUS
+
+};
+extern "C" {
+
+
+
+
+extern int pthread_create (pthread_t *__restrict __newthread,
+      const pthread_attr_t *__restrict __attr,
+      void *(*__start_routine) (void *),
+      void *__restrict __arg) throw () __attribute__ ((__nonnull__ (1, 3)));
+
+
+
+
+
+extern void pthread_exit (void *__retval) __attribute__ ((__noreturn__));
+
+
+
+
+
+
+
+extern int pthread_join (pthread_t __th, void **__thread_return);
+
+
+
+
+extern int pthread_tryjoin_np (pthread_t __th, void **__thread_return) throw ();
+
+
+
+
+
+
+
+extern int pthread_timedjoin_np (pthread_t __th, void **__thread_return,
+     const struct timespec *__abstime);
+
+
+
+
+
+
+extern int pthread_detach (pthread_t __th) throw ();
+
+
+
+extern pthread_t pthread_self (void) throw () __attribute__ ((__const__));
+
+
+extern int pthread_equal (pthread_t __thread1, pthread_t __thread2)
+  throw () __attribute__ ((__const__));
+
+
+
+
+
+
+
+extern int pthread_attr_init (pthread_attr_t *__attr) throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_attr_destroy (pthread_attr_t *__attr)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_attr_getdetachstate (const pthread_attr_t *__attr,
+     int *__detachstate)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern int pthread_attr_setdetachstate (pthread_attr_t *__attr,
+     int __detachstate)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+extern int pthread_attr_getguardsize (const pthread_attr_t *__attr,
+          size_t *__guardsize)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern int pthread_attr_setguardsize (pthread_attr_t *__attr,
+          size_t __guardsize)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+extern int pthread_attr_getschedparam (const pthread_attr_t *__restrict __attr,
+           struct sched_param *__restrict __param)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern int pthread_attr_setschedparam (pthread_attr_t *__restrict __attr,
+           const struct sched_param *__restrict
+           __param) throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern int pthread_attr_getschedpolicy (const pthread_attr_t *__restrict
+     __attr, int *__restrict __policy)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern int pthread_attr_setschedpolicy (pthread_attr_t *__attr, int __policy)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_attr_getinheritsched (const pthread_attr_t *__restrict
+      __attr, int *__restrict __inherit)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern int pthread_attr_setinheritsched (pthread_attr_t *__attr,
+      int __inherit)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+extern int pthread_attr_getscope (const pthread_attr_t *__restrict __attr,
+      int *__restrict __scope)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern int pthread_attr_setscope (pthread_attr_t *__attr, int __scope)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_attr_getstackaddr (const pthread_attr_t *__restrict
+          __attr, void **__restrict __stackaddr)
+     throw () __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__deprecated__));
+
+
+
+
+
+extern int pthread_attr_setstackaddr (pthread_attr_t *__attr,
+          void *__stackaddr)
+     throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__));
+
+
+extern int pthread_attr_getstacksize (const pthread_attr_t *__restrict
+          __attr, size_t *__restrict __stacksize)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+
+
+extern int pthread_attr_setstacksize (pthread_attr_t *__attr,
+          size_t __stacksize)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+extern int pthread_attr_getstack (const pthread_attr_t *__restrict __attr,
+      void **__restrict __stackaddr,
+      size_t *__restrict __stacksize)
+     throw () __attribute__ ((__nonnull__ (1, 2, 3)));
+
+
+
+
+extern int pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr,
+      size_t __stacksize) throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+
+
+extern int pthread_attr_setaffinity_np (pthread_attr_t *__attr,
+     size_t __cpusetsize,
+     const cpu_set_t *__cpuset)
+     throw () __attribute__ ((__nonnull__ (1, 3)));
+
+
+
+extern int pthread_attr_getaffinity_np (const pthread_attr_t *__attr,
+     size_t __cpusetsize,
+     cpu_set_t *__cpuset)
+     throw () __attribute__ ((__nonnull__ (1, 3)));
+
+
+extern int pthread_getattr_default_np (pthread_attr_t *__attr)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+extern int pthread_setattr_default_np (const pthread_attr_t *__attr)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+
+extern int pthread_getattr_np (pthread_t __th, pthread_attr_t *__attr)
+     throw () __attribute__ ((__nonnull__ (2)));
+
+
+
+
+
+
+
+extern int pthread_setschedparam (pthread_t __target_thread, int __policy,
+      const struct sched_param *__param)
+     throw () __attribute__ ((__nonnull__ (3)));
+
+
+extern int pthread_getschedparam (pthread_t __target_thread,
+      int *__restrict __policy,
+      struct sched_param *__restrict __param)
+     throw () __attribute__ ((__nonnull__ (2, 3)));
+
+
+extern int pthread_setschedprio (pthread_t __target_thread, int __prio)
+     throw ();
+
+
+
+
+extern int pthread_getname_np (pthread_t __target_thread, char *__buf,
+          size_t __buflen)
+     throw () __attribute__ ((__nonnull__ (2)));
+
+
+extern int pthread_setname_np (pthread_t __target_thread, const char *__name)
+     throw () __attribute__ ((__nonnull__ (2)));
+
+
+
+
+
+extern int pthread_getconcurrency (void) throw ();
+
+
+extern int pthread_setconcurrency (int __level) throw ();
+
+
+
+
+
+
+
+extern int pthread_yield (void) throw ();
+
+
+
+
+extern int pthread_setaffinity_np (pthread_t __th, size_t __cpusetsize,
+       const cpu_set_t *__cpuset)
+     throw () __attribute__ ((__nonnull__ (3)));
+
+
+extern int pthread_getaffinity_np (pthread_t __th, size_t __cpusetsize,
+       cpu_set_t *__cpuset)
+     throw () __attribute__ ((__nonnull__ (3)));
+extern int pthread_once (pthread_once_t *__once_control,
+    void (*__init_routine) (void)) __attribute__ ((__nonnull__ (1, 2)));
+extern int pthread_setcancelstate (int __state, int *__oldstate);
+
+
+
+extern int pthread_setcanceltype (int __type, int *__oldtype);
+
+
+extern int pthread_cancel (pthread_t __th);
+
+
+
+
+extern void pthread_testcancel (void);
+
+
+
+
+typedef struct
+{
+  struct
+  {
+    __jmp_buf __cancel_jmp_buf;
+    int __mask_was_saved;
+  } __cancel_jmp_buf[1];
+  void *__pad[4];
+} __pthread_unwind_buf_t __attribute__ ((__aligned__));
+struct __pthread_cleanup_frame
+{
+  void (*__cancel_routine) (void *);
+  void *__cancel_arg;
+  int __do_it;
+  int __cancel_type;
+};
+
+
+
+
+class __pthread_cleanup_class
+{
+  void (*__cancel_routine) (void *);
+  void *__cancel_arg;
+  int __do_it;
+  int __cancel_type;
+
+ public:
+  __pthread_cleanup_class (void (*__fct) (void *), void *__arg)
+    : __cancel_routine (__fct), __cancel_arg (__arg), __do_it (1) { }
+  ~__pthread_cleanup_class () { if (__do_it) __cancel_routine (__cancel_arg); }
+  void __setdoit (int __newval) { __do_it = __newval; }
+  void __defer () { pthread_setcanceltype (PTHREAD_CANCEL_DEFERRED,
+        &__cancel_type); }
+  void __restore () const { pthread_setcanceltype (__cancel_type, 0); }
+};
+struct __jmp_buf_tag;
+extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) throw ();
+
+
+
+
+
+extern int pthread_mutex_init (pthread_mutex_t *__mutex,
+          const pthread_mutexattr_t *__mutexattr)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_mutex_destroy (pthread_mutex_t *__mutex)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_mutex_trylock (pthread_mutex_t *__mutex)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_mutex_lock (pthread_mutex_t *__mutex)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex,
+        const struct timespec *__restrict
+        __abstime) throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+
+extern int pthread_mutex_unlock (pthread_mutex_t *__mutex)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+extern int pthread_mutex_getprioceiling (const pthread_mutex_t *
+      __restrict __mutex,
+      int *__restrict __prioceiling)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+
+extern int pthread_mutex_setprioceiling (pthread_mutex_t *__restrict __mutex,
+      int __prioceiling,
+      int *__restrict __old_ceiling)
+     throw () __attribute__ ((__nonnull__ (1, 3)));
+
+
+
+
+extern int pthread_mutex_consistent (pthread_mutex_t *__mutex)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+extern int pthread_mutex_consistent_np (pthread_mutex_t *__mutex)
+     throw () __attribute__ ((__nonnull__ (1)));
+extern int pthread_mutexattr_init (pthread_mutexattr_t *__attr)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_mutexattr_destroy (pthread_mutexattr_t *__attr)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_mutexattr_getpshared (const pthread_mutexattr_t *
+      __restrict __attr,
+      int *__restrict __pshared)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern int pthread_mutexattr_setpshared (pthread_mutexattr_t *__attr,
+      int __pshared)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+extern int pthread_mutexattr_gettype (const pthread_mutexattr_t *__restrict
+          __attr, int *__restrict __kind)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+
+
+extern int pthread_mutexattr_settype (pthread_mutexattr_t *__attr, int __kind)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+extern int pthread_mutexattr_getprotocol (const pthread_mutexattr_t *
+       __restrict __attr,
+       int *__restrict __protocol)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+
+extern int pthread_mutexattr_setprotocol (pthread_mutexattr_t *__attr,
+       int __protocol)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_mutexattr_getprioceiling (const pthread_mutexattr_t *
+          __restrict __attr,
+          int *__restrict __prioceiling)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern int pthread_mutexattr_setprioceiling (pthread_mutexattr_t *__attr,
+          int __prioceiling)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+extern int pthread_mutexattr_getrobust (const pthread_mutexattr_t *__attr,
+     int *__robustness)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+extern int pthread_mutexattr_getrobust_np (const pthread_mutexattr_t *__attr,
+        int *__robustness)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+
+extern int pthread_mutexattr_setrobust (pthread_mutexattr_t *__attr,
+     int __robustness)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+extern int pthread_mutexattr_setrobust_np (pthread_mutexattr_t *__attr,
+        int __robustness)
+     throw () __attribute__ ((__nonnull__ (1)));
+extern int pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock,
+    const pthread_rwlockattr_t *__restrict
+    __attr) throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_rwlock_destroy (pthread_rwlock_t *__rwlock)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock)
+  throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock,
+           const struct timespec *__restrict
+           __abstime) throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+
+extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock,
+           const struct timespec *__restrict
+           __abstime) throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+
+extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+
+
+extern int pthread_rwlockattr_init (pthread_rwlockattr_t *__attr)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_rwlockattr_destroy (pthread_rwlockattr_t *__attr)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_rwlockattr_getpshared (const pthread_rwlockattr_t *
+       __restrict __attr,
+       int *__restrict __pshared)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *__attr,
+       int __pshared)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_rwlockattr_getkind_np (const pthread_rwlockattr_t *
+       __restrict __attr,
+       int *__restrict __pref)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern int pthread_rwlockattr_setkind_np (pthread_rwlockattr_t *__attr,
+       int __pref) throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+
+
+
+
+extern int pthread_cond_init (pthread_cond_t *__restrict __cond,
+         const pthread_condattr_t *__restrict __cond_attr)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_cond_destroy (pthread_cond_t *__cond)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_cond_signal (pthread_cond_t *__cond)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_cond_broadcast (pthread_cond_t *__cond)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+
+
+
+extern int pthread_cond_wait (pthread_cond_t *__restrict __cond,
+         pthread_mutex_t *__restrict __mutex)
+     __attribute__ ((__nonnull__ (1, 2)));
+extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond,
+       pthread_mutex_t *__restrict __mutex,
+       const struct timespec *__restrict __abstime)
+     __attribute__ ((__nonnull__ (1, 2, 3)));
+
+
+
+
+extern int pthread_condattr_init (pthread_condattr_t *__attr)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_condattr_destroy (pthread_condattr_t *__attr)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_condattr_getpshared (const pthread_condattr_t *
+     __restrict __attr,
+     int *__restrict __pshared)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern int pthread_condattr_setpshared (pthread_condattr_t *__attr,
+     int __pshared) throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+extern int pthread_condattr_getclock (const pthread_condattr_t *
+          __restrict __attr,
+          __clockid_t *__restrict __clock_id)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern int pthread_condattr_setclock (pthread_condattr_t *__attr,
+          __clockid_t __clock_id)
+     throw () __attribute__ ((__nonnull__ (1)));
+extern int pthread_spin_init (pthread_spinlock_t *__lock, int __pshared)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_spin_destroy (pthread_spinlock_t *__lock)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_spin_lock (pthread_spinlock_t *__lock)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_spin_trylock (pthread_spinlock_t *__lock)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_spin_unlock (pthread_spinlock_t *__lock)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+
+
+
+extern int pthread_barrier_init (pthread_barrier_t *__restrict __barrier,
+     const pthread_barrierattr_t *__restrict
+     __attr, unsigned int __count)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_barrier_destroy (pthread_barrier_t *__barrier)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_barrier_wait (pthread_barrier_t *__barrier)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+extern int pthread_barrierattr_init (pthread_barrierattr_t *__attr)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_barrierattr_destroy (pthread_barrierattr_t *__attr)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_barrierattr_getpshared (const pthread_barrierattr_t *
+        __restrict __attr,
+        int *__restrict __pshared)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern int pthread_barrierattr_setpshared (pthread_barrierattr_t *__attr,
+        int __pshared)
+     throw () __attribute__ ((__nonnull__ (1)));
+extern int pthread_key_create (pthread_key_t *__key,
+          void (*__destr_function) (void *))
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int pthread_key_delete (pthread_key_t __key) throw ();
+
+
+extern void *pthread_getspecific (pthread_key_t __key) throw ();
+
+
+extern int pthread_setspecific (pthread_key_t __key,
+    const void *__pointer) throw () ;
+
+
+
+
+extern int pthread_getcpuclockid (pthread_t __thread_id,
+      __clockid_t *__clock_id)
+     throw () __attribute__ ((__nonnull__ (2)));
+extern int pthread_atfork (void (*__prepare) (void),
+      void (*__parent) (void),
+      void (*__child) (void)) throw ();
+
+
+
+
+extern __inline __attribute__ ((__gnu_inline__)) int
+__attribute__ ((__leaf__)) pthread_equal (pthread_t __thread1, pthread_t __thread2) throw ()
+{
+  return __thread1 == __thread2;
+}
+
+
+}
+typedef pthread_t __gthread_t;
+typedef pthread_key_t __gthread_key_t;
+typedef pthread_once_t __gthread_once_t;
+typedef pthread_mutex_t __gthread_mutex_t;
+typedef pthread_mutex_t __gthread_recursive_mutex_t;
+typedef pthread_cond_t __gthread_cond_t;
+typedef struct timespec __gthread_time_t;
+static __typeof(pthread_once) __gthrw_pthread_once __attribute__ ((__weakref__("pthread_once")));
+static __typeof(pthread_getspecific) __gthrw_pthread_getspecific __attribute__ ((__weakref__("pthread_getspecific")));
+static __typeof(pthread_setspecific) __gthrw_pthread_setspecific __attribute__ ((__weakref__("pthread_setspecific")));
+
+static __typeof(pthread_create) __gthrw_pthread_create __attribute__ ((__weakref__("pthread_create")));
+static __typeof(pthread_join) __gthrw_pthread_join __attribute__ ((__weakref__("pthread_join")));
+static __typeof(pthread_equal) __gthrw_pthread_equal __attribute__ ((__weakref__("pthread_equal")));
+static __typeof(pthread_self) __gthrw_pthread_self __attribute__ ((__weakref__("pthread_self")));
+static __typeof(pthread_detach) __gthrw_pthread_detach __attribute__ ((__weakref__("pthread_detach")));
+
+static __typeof(pthread_cancel) __gthrw_pthread_cancel __attribute__ ((__weakref__("pthread_cancel")));
+
+static __typeof(sched_yield) __gthrw_sched_yield __attribute__ ((__weakref__("sched_yield")));
+
+static __typeof(pthread_mutex_lock) __gthrw_pthread_mutex_lock __attribute__ ((__weakref__("pthread_mutex_lock")));
+static __typeof(pthread_mutex_trylock) __gthrw_pthread_mutex_trylock __attribute__ ((__weakref__("pthread_mutex_trylock")));
+
+static __typeof(pthread_mutex_timedlock) __gthrw_pthread_mutex_timedlock __attribute__ ((__weakref__("pthread_mutex_timedlock")));
+
+static __typeof(pthread_mutex_unlock) __gthrw_pthread_mutex_unlock __attribute__ ((__weakref__("pthread_mutex_unlock")));
+static __typeof(pthread_mutex_init) __gthrw_pthread_mutex_init __attribute__ ((__weakref__("pthread_mutex_init")));
+static __typeof(pthread_mutex_destroy) __gthrw_pthread_mutex_destroy __attribute__ ((__weakref__("pthread_mutex_destroy")));
+
+static __typeof(pthread_cond_init) __gthrw_pthread_cond_init __attribute__ ((__weakref__("pthread_cond_init")));
+static __typeof(pthread_cond_broadcast) __gthrw_pthread_cond_broadcast __attribute__ ((__weakref__("pthread_cond_broadcast")));
+static __typeof(pthread_cond_signal) __gthrw_pthread_cond_signal __attribute__ ((__weakref__("pthread_cond_signal")));
+static __typeof(pthread_cond_wait) __gthrw_pthread_cond_wait __attribute__ ((__weakref__("pthread_cond_wait")));
+static __typeof(pthread_cond_timedwait) __gthrw_pthread_cond_timedwait __attribute__ ((__weakref__("pthread_cond_timedwait")));
+static __typeof(pthread_cond_destroy) __gthrw_pthread_cond_destroy __attribute__ ((__weakref__("pthread_cond_destroy")));
+
+static __typeof(pthread_key_create) __gthrw_pthread_key_create __attribute__ ((__weakref__("pthread_key_create")));
+static __typeof(pthread_key_delete) __gthrw_pthread_key_delete __attribute__ ((__weakref__("pthread_key_delete")));
+static __typeof(pthread_mutexattr_init) __gthrw_pthread_mutexattr_init __attribute__ ((__weakref__("pthread_mutexattr_init")));
+static __typeof(pthread_mutexattr_settype) __gthrw_pthread_mutexattr_settype __attribute__ ((__weakref__("pthread_mutexattr_settype")));
+static __typeof(pthread_mutexattr_destroy) __gthrw_pthread_mutexattr_destroy __attribute__ ((__weakref__("pthread_mutexattr_destroy")));
+static __typeof(pthread_key_create) __gthrw___pthread_key_create __attribute__ ((__weakref__("__pthread_key_create")));
+static inline int
+__gthread_active_p (void)
+{
+  static void *const __gthread_active_ptr
+    = __extension__ (void *) &__gthrw___pthread_key_create;
+  return __gthread_active_ptr != 0;
+}
+static inline int
+__gthread_create (__gthread_t *__threadid, void *(*__func) (void*),
+    void *__args)
+{
+  return __gthrw_pthread_create (__threadid, __null, __func, __args);
+}
+
+static inline int
+__gthread_join (__gthread_t __threadid, void **__value_ptr)
+{
+  return __gthrw_pthread_join (__threadid, __value_ptr);
+}
+
+static inline int
+__gthread_detach (__gthread_t __threadid)
+{
+  return __gthrw_pthread_detach (__threadid);
+}
+
+static inline int
+__gthread_equal (__gthread_t __t1, __gthread_t __t2)
+{
+  return __gthrw_pthread_equal (__t1, __t2);
+}
+
+static inline __gthread_t
+__gthread_self (void)
+{
+  return __gthrw_pthread_self ();
+}
+
+static inline int
+__gthread_yield (void)
+{
+  return __gthrw_sched_yield ();
+}
+
+static inline int
+__gthread_once (__gthread_once_t *__once, void (*__func) (void))
+{
+  if (__gthread_active_p ())
+    return __gthrw_pthread_once (__once, __func);
+  else
+    return -1;
+}
+
+static inline int
+__gthread_key_create (__gthread_key_t *__key, void (*__dtor) (void *))
+{
+  return __gthrw_pthread_key_create (__key, __dtor);
+}
+
+static inline int
+__gthread_key_delete (__gthread_key_t __key)
+{
+  return __gthrw_pthread_key_delete (__key);
+}
+
+static inline void *
+__gthread_getspecific (__gthread_key_t __key)
+{
+  return __gthrw_pthread_getspecific (__key);
+}
+
+static inline int
+__gthread_setspecific (__gthread_key_t __key, const void *__ptr)
+{
+  return __gthrw_pthread_setspecific (__key, __ptr);
+}
+
+static inline void
+__gthread_mutex_init_function (__gthread_mutex_t *__mutex)
+{
+  if (__gthread_active_p ())
+    __gthrw_pthread_mutex_init (__mutex, __null);
+}
+
+static inline int
+__gthread_mutex_destroy (__gthread_mutex_t *__mutex)
+{
+  if (__gthread_active_p ())
+    return __gthrw_pthread_mutex_destroy (__mutex);
+  else
+    return 0;
+}
+
+static inline int
+__gthread_mutex_lock (__gthread_mutex_t *__mutex)
+{
+  if (__gthread_active_p ())
+    return __gthrw_pthread_mutex_lock (__mutex);
+  else
+    return 0;
+}
+
+static inline int
+__gthread_mutex_trylock (__gthread_mutex_t *__mutex)
+{
+  if (__gthread_active_p ())
+    return __gthrw_pthread_mutex_trylock (__mutex);
+  else
+    return 0;
+}
+
+
+static inline int
+__gthread_mutex_timedlock (__gthread_mutex_t *__mutex,
+      const __gthread_time_t *__abs_timeout)
+{
+  if (__gthread_active_p ())
+    return __gthrw_pthread_mutex_timedlock (__mutex, __abs_timeout);
+  else
+    return 0;
+}
+
+
+static inline int
+__gthread_mutex_unlock (__gthread_mutex_t *__mutex)
+{
+  if (__gthread_active_p ())
+    return __gthrw_pthread_mutex_unlock (__mutex);
+  else
+    return 0;
+}
+static inline int
+__gthread_recursive_mutex_lock (__gthread_recursive_mutex_t *__mutex)
+{
+  return __gthread_mutex_lock (__mutex);
+}
+
+static inline int
+__gthread_recursive_mutex_trylock (__gthread_recursive_mutex_t *__mutex)
+{
+  return __gthread_mutex_trylock (__mutex);
+}
+
+
+static inline int
+__gthread_recursive_mutex_timedlock (__gthread_recursive_mutex_t *__mutex,
+         const __gthread_time_t *__abs_timeout)
+{
+  return __gthread_mutex_timedlock (__mutex, __abs_timeout);
+}
+
+
+static inline int
+__gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *__mutex)
+{
+  return __gthread_mutex_unlock (__mutex);
+}
+
+static inline int
+__gthread_recursive_mutex_destroy (__gthread_recursive_mutex_t *__mutex)
+{
+  return __gthread_mutex_destroy (__mutex);
+}
+static inline int
+__gthread_cond_broadcast (__gthread_cond_t *__cond)
+{
+  return __gthrw_pthread_cond_broadcast (__cond);
+}
+
+static inline int
+__gthread_cond_signal (__gthread_cond_t *__cond)
+{
+  return __gthrw_pthread_cond_signal (__cond);
+}
+
+static inline int
+__gthread_cond_wait (__gthread_cond_t *__cond, __gthread_mutex_t *__mutex)
+{
+  return __gthrw_pthread_cond_wait (__cond, __mutex);
+}
+
+static inline int
+__gthread_cond_timedwait (__gthread_cond_t *__cond, __gthread_mutex_t *__mutex,
+     const __gthread_time_t *__abs_timeout)
+{
+  return __gthrw_pthread_cond_timedwait (__cond, __mutex, __abs_timeout);
+}
+
+static inline int
+__gthread_cond_wait_recursive (__gthread_cond_t *__cond,
+          __gthread_recursive_mutex_t *__mutex)
+{
+  return __gthread_cond_wait (__cond, __mutex);
+}
+
+static inline int
+__gthread_cond_destroy (__gthread_cond_t* __cond)
+{
+  return __gthrw_pthread_cond_destroy (__cond);
+}
+
+
+typedef int _Atomic_word;
+
+namespace __gnu_cxx __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+
+
+
+
+  static inline _Atomic_word
+  __exchange_and_add(volatile _Atomic_word* __mem, int __val)
+  { return __atomic_fetch_add(__mem, __val, 4); }
+
+  static inline void
+  __atomic_add(volatile _Atomic_word* __mem, int __val)
+  { __atomic_fetch_add(__mem, __val, 4); }
+  static inline _Atomic_word
+  __exchange_and_add_single(_Atomic_word* __mem, int __val)
+  {
+    _Atomic_word __result = *__mem;
+    *__mem += __val;
+    return __result;
+  }
+
+  static inline void
+  __atomic_add_single(_Atomic_word* __mem, int __val)
+  { *__mem += __val; }
+
+  static inline _Atomic_word
+  __attribute__ ((__unused__))
+  __exchange_and_add_dispatch(_Atomic_word* __mem, int __val)
+  {
+
+    if (__gthread_active_p())
+      return __exchange_and_add(__mem, __val);
+    else
+      return __exchange_and_add_single(__mem, __val);
+
+
+
+  }
+
+  static inline void
+  __attribute__ ((__unused__))
+  __atomic_add_dispatch(_Atomic_word* __mem, int __val)
+  {
+
+    if (__gthread_active_p())
+      __atomic_add(__mem, __val);
+    else
+      __atomic_add_single(__mem, __val);
+
+
+
+  }
+
+
+}
+
+       
+
+
+       
+
+
+
+
+namespace __gnu_cxx __attribute__ ((__visibility__ ("default")))
+{
+
+
+  using std::size_t;
+  using std::ptrdiff_t;
+  template<typename _Tp>
+    class new_allocator
+    {
+    public:
+      typedef size_t size_type;
+      typedef ptrdiff_t difference_type;
+      typedef _Tp* pointer;
+      typedef const _Tp* const_pointer;
+      typedef _Tp& reference;
+      typedef const _Tp& const_reference;
+      typedef _Tp value_type;
+
+      template<typename _Tp1>
+ struct rebind
+ { typedef new_allocator<_Tp1> other; };
+
+
+
+
+      typedef std::true_type propagate_on_container_move_assignment;
+
+
+     
+      new_allocator() noexcept { }
+
+     
+      new_allocator(const new_allocator&) noexcept { }
+
+      template<typename _Tp1>
+
+ new_allocator(const new_allocator<_Tp1>&) noexcept { }
+
+      ~new_allocator() noexcept { }
+
+      pointer
+      address(reference __x) const noexcept
+      { return std::__addressof(__x); }
+
+      const_pointer
+      address(const_reference __x) const noexcept
+      { return std::__addressof(__x); }
+
+
+
+      pointer
+      allocate(size_type __n, const void* = static_cast<const void*>(0))
+      {
+ if (__n > this->max_size())
+   std::__throw_bad_alloc();
+ return static_cast<_Tp*>(::operator new(__n * sizeof(_Tp)));
+      }
+
+
+      void
+      deallocate(pointer __p, size_type)
+      {
+
+
+
+
+
+
+
+ ::operator delete(__p);
+      }
+
+      size_type
+      max_size() const noexcept
+      {
+
+ return size_t(0x7fffffffffffffffL) / sizeof(_Tp);
+
+
+
+      }
+
+
+      template<typename _Up, typename... _Args>
+ void
+ construct(_Up* __p, _Args&&... __args)
+ { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
+
+      template<typename _Up>
+ void
+ destroy(_Up* __p) { __p->~_Up(); }
+      template<typename _Up>
+ friend bool
+ operator==(const new_allocator&, const new_allocator<_Up>&)
+ noexcept
+ { return true; }
+
+      template<typename _Up>
+ friend bool
+ operator!=(const new_allocator&, const new_allocator<_Up>&)
+ noexcept
+ { return false; }
+    };
+
+
+}
+
+
+namespace std
+{
+  template<typename _Tp>
+    using __allocator_base = __gnu_cxx::new_allocator<_Tp>;
+}
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+
+
+
+
+
+  template<>
+    class allocator<void>
+    {
+    public:
+      typedef size_t size_type;
+      typedef ptrdiff_t difference_type;
+      typedef void* pointer;
+      typedef const void* const_pointer;
+      typedef void value_type;
+
+      template<typename _Tp1>
+ struct rebind
+ { typedef allocator<_Tp1> other; };
+
+
+
+
+      typedef true_type propagate_on_container_move_assignment;
+
+      typedef true_type is_always_equal;
+
+      template<typename _Up, typename... _Args>
+ void
+ construct(_Up* __p, _Args&&... __args)
+ { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
+
+      template<typename _Up>
+ void
+ destroy(_Up* __p) { __p->~_Up(); }
+
+    };
+  template<typename _Tp>
+    class allocator : public __allocator_base<_Tp>
+    {
+   public:
+      typedef size_t size_type;
+      typedef ptrdiff_t difference_type;
+      typedef _Tp* pointer;
+      typedef const _Tp* const_pointer;
+      typedef _Tp& reference;
+      typedef const _Tp& const_reference;
+      typedef _Tp value_type;
+
+      template<typename _Tp1>
+ struct rebind
+ { typedef allocator<_Tp1> other; };
+
+
+
+
+      typedef true_type propagate_on_container_move_assignment;
+
+      typedef true_type is_always_equal;
+
+
+
+
+     
+      allocator() noexcept { }
+
+     
+      allocator(const allocator& __a) noexcept
+      : __allocator_base<_Tp>(__a) { }
+
+
+
+      allocator& operator=(const allocator&) = default;
+
+
+      template<typename _Tp1>
+
+ allocator(const allocator<_Tp1>&) noexcept { }
+
+      ~allocator() noexcept { }
+
+      friend bool
+      operator==(const allocator&, const allocator&) noexcept
+      { return true; }
+
+      friend bool
+      operator!=(const allocator&, const allocator&) noexcept
+      { return false; }
+
+
+    };
+
+  template<typename _T1, typename _T2>
+    inline bool
+    operator==(const allocator<_T1>&, const allocator<_T2>&)
+    noexcept
+    { return true; }
+
+  template<typename _T1, typename _T2>
+    inline bool
+    operator!=(const allocator<_T1>&, const allocator<_T2>&)
+    noexcept
+    { return false; }
+
+
+
+  template<typename _Tp>
+    class allocator<const _Tp>
+    {
+    public:
+      typedef _Tp value_type;
+      template<typename _Up> allocator(const allocator<_Up>&) { }
+    };
+
+  template<typename _Tp>
+    class allocator<volatile _Tp>
+    {
+    public:
+      typedef _Tp value_type;
+      template<typename _Up> allocator(const allocator<_Up>&) { }
+    };
+
+  template<typename _Tp>
+    class allocator<const volatile _Tp>
+    {
+    public:
+      typedef _Tp value_type;
+      template<typename _Up> allocator(const allocator<_Up>&) { }
+    };
+
+
+
+
+
+
+  extern template class allocator<char>;
+  extern template class allocator<wchar_t>;
+
+
+
+
+
+
+  template<typename _Alloc, bool = __is_empty(_Alloc)>
+    struct __alloc_swap
+    { static void _S_do_it(_Alloc&, _Alloc&) noexcept { } };
+
+  template<typename _Alloc>
+    struct __alloc_swap<_Alloc, false>
+    {
+      static void
+      _S_do_it(_Alloc& __one, _Alloc& __two) noexcept
+      {
+
+ if (__one != __two)
+   swap(__one, __two);
+      }
+    };
+
+
+  template<typename _Alloc, bool = __is_empty(_Alloc)>
+    struct __alloc_neq
+    {
+      static bool
+      _S_do_it(const _Alloc&, const _Alloc&)
+      { return false; }
+    };
+
+  template<typename _Alloc>
+    struct __alloc_neq<_Alloc, false>
+    {
+      static bool
+      _S_do_it(const _Alloc& __one, const _Alloc& __two)
+      { return __one != __two; }
+    };
+
+
+  template<typename _Tp, bool
+    = __or_<is_copy_constructible<typename _Tp::value_type>,
+            is_nothrow_move_constructible<typename _Tp::value_type>>::value>
+    struct __shrink_to_fit_aux
+    { static bool _S_do_it(_Tp&) noexcept { return false; } };
+
+  template<typename _Tp>
+    struct __shrink_to_fit_aux<_Tp, true>
+    {
+      static bool
+      _S_do_it(_Tp& __c) noexcept
+      {
+
+ try
+   {
+     _Tp(__make_move_if_noexcept_iterator(__c.begin()),
+  __make_move_if_noexcept_iterator(__c.end()),
+  __c.get_allocator()).swap(__c);
+     return true;
+   }
+ catch(...)
+   { return false; }
+
+
+
+      }
+    };
+
+
+
+}
+
+
+       
+
+
+       
+
+
+
+namespace __cxxabiv1
+{
+
+
+
+
+
+
+
+  class __forced_unwind
+  {
+    virtual ~__forced_unwind() throw();
+
+
+    virtual void __pure_dummy() = 0;
+  };
+}
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+  template<typename _CharT, typename _Traits>
+    inline void
+    __ostream_write(basic_ostream<_CharT, _Traits>& __out,
+      const _CharT* __s, streamsize __n)
+    {
+      typedef basic_ostream<_CharT, _Traits> __ostream_type;
+      typedef typename __ostream_type::ios_base __ios_base;
+
+      const streamsize __put = __out.rdbuf()->sputn(__s, __n);
+      if (__put != __n)
+ __out.setstate(__ios_base::badbit);
+    }
+
+  template<typename _CharT, typename _Traits>
+    inline void
+    __ostream_fill(basic_ostream<_CharT, _Traits>& __out, streamsize __n)
+    {
+      typedef basic_ostream<_CharT, _Traits> __ostream_type;
+      typedef typename __ostream_type::ios_base __ios_base;
+
+      const _CharT __c = __out.fill();
+      for (; __n > 0; --__n)
+ {
+   const typename _Traits::int_type __put = __out.rdbuf()->sputc(__c);
+   if (_Traits::eq_int_type(__put, _Traits::eof()))
+     {
+       __out.setstate(__ios_base::badbit);
+       break;
+     }
+ }
+    }
+
+  template<typename _CharT, typename _Traits>
+    basic_ostream<_CharT, _Traits>&
+    __ostream_insert(basic_ostream<_CharT, _Traits>& __out,
+       const _CharT* __s, streamsize __n)
+    {
+      typedef basic_ostream<_CharT, _Traits> __ostream_type;
+      typedef typename __ostream_type::ios_base __ios_base;
+
+      typename __ostream_type::sentry __cerb(__out);
+      if (__cerb)
+ {
+   try
+     {
+       const streamsize __w = __out.width();
+       if (__w > __n)
+  {
+    const bool __left = ((__out.flags()
+     & __ios_base::adjustfield)
+           == __ios_base::left);
+    if (!__left)
+      __ostream_fill(__out, __w - __n);
+    if (__out.good())
+      __ostream_write(__out, __s, __n);
+    if (__left && __out.good())
+      __ostream_fill(__out, __w - __n);
+  }
+       else
+  __ostream_write(__out, __s, __n);
+       __out.width(0);
+     }
+   catch(__cxxabiv1::__forced_unwind&)
+     {
+       __out._M_setstate(__ios_base::badbit);
+       throw;
+     }
+   catch(...)
+     { __out._M_setstate(__ios_base::badbit); }
+ }
+      return __out;
+    }
+
+
+
+
+  extern template ostream& __ostream_insert(ostream&, const char*, streamsize);
+
+
+  extern template wostream& __ostream_insert(wostream&, const wchar_t*,
+          streamsize);
+
+
+
+
+}
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+  template<typename _Arg, typename _Result>
+    struct unary_function
+    {
+
+      typedef _Arg argument_type;
+
+
+      typedef _Result result_type;
+    };
+
+
+
+
+  template<typename _Arg1, typename _Arg2, typename _Result>
+    struct binary_function
+    {
+
+      typedef _Arg1 first_argument_type;
+
+
+      typedef _Arg2 second_argument_type;
+
+
+      typedef _Result result_type;
+    };
+  template<typename _Tp>
+    struct plus : public binary_function<_Tp, _Tp, _Tp>
+    {
+     
+      _Tp
+      operator()(const _Tp& __x, const _Tp& __y) const
+      { return __x + __y; }
+    };
+
+
+  template<typename _Tp>
+    struct minus : public binary_function<_Tp, _Tp, _Tp>
+    {
+     
+      _Tp
+      operator()(const _Tp& __x, const _Tp& __y) const
+      { return __x - __y; }
+    };
+
+
+  template<typename _Tp>
+    struct multiplies : public binary_function<_Tp, _Tp, _Tp>
+    {
+     
+      _Tp
+      operator()(const _Tp& __x, const _Tp& __y) const
+      { return __x * __y; }
+    };
+
+
+  template<typename _Tp>
+    struct divides : public binary_function<_Tp, _Tp, _Tp>
+    {
+     
+      _Tp
+      operator()(const _Tp& __x, const _Tp& __y) const
+      { return __x / __y; }
+    };
+
+
+  template<typename _Tp>
+    struct modulus : public binary_function<_Tp, _Tp, _Tp>
+    {
+     
+      _Tp
+      operator()(const _Tp& __x, const _Tp& __y) const
+      { return __x % __y; }
+    };
+
+
+  template<typename _Tp>
+    struct negate : public unary_function<_Tp, _Tp>
+    {
+     
+      _Tp
+      operator()(const _Tp& __x) const
+      { return -__x; }
+    };
+  template<typename _Tp>
+    struct equal_to : public binary_function<_Tp, _Tp, bool>
+    {
+     
+      bool
+      operator()(const _Tp& __x, const _Tp& __y) const
+      { return __x == __y; }
+    };
+
+
+  template<typename _Tp>
+    struct not_equal_to : public binary_function<_Tp, _Tp, bool>
+    {
+     
+      bool
+      operator()(const _Tp& __x, const _Tp& __y) const
+      { return __x != __y; }
+    };
+
+
+  template<typename _Tp>
+    struct greater : public binary_function<_Tp, _Tp, bool>
+    {
+     
+      bool
+      operator()(const _Tp& __x, const _Tp& __y) const
+      { return __x > __y; }
+    };
+
+
+  template<typename _Tp>
+    struct less : public binary_function<_Tp, _Tp, bool>
+    {
+     
+      bool
+      operator()(const _Tp& __x, const _Tp& __y) const
+      { return __x < __y; }
+    };
+
+
+  template<typename _Tp>
+    struct greater_equal : public binary_function<_Tp, _Tp, bool>
+    {
+     
+      bool
+      operator()(const _Tp& __x, const _Tp& __y) const
+      { return __x >= __y; }
+    };
+
+
+  template<typename _Tp>
+    struct less_equal : public binary_function<_Tp, _Tp, bool>
+    {
+     
+      bool
+      operator()(const _Tp& __x, const _Tp& __y) const
+      { return __x <= __y; }
+    };
+
+
+  template<typename _Tp>
+    struct greater<_Tp*> : public binary_function<_Tp*, _Tp*, bool>
+    {
+      bool
+      operator()(_Tp* __x, _Tp* __y) const noexcept
+      {
+ if (__builtin_constant_p (__x > __y))
+   return __x > __y;
+ return (long unsigned int)__x > (long unsigned int)__y;
+      }
+    };
+
+
+  template<typename _Tp>
+    struct less<_Tp*> : public binary_function<_Tp*, _Tp*, bool>
+    {
+      bool
+      operator()(_Tp* __x, _Tp* __y) const noexcept
+      {
+ if (__builtin_constant_p (__x < __y))
+   return __x < __y;
+ return (long unsigned int)__x < (long unsigned int)__y;
+      }
+    };
+
+
+  template<typename _Tp>
+    struct greater_equal<_Tp*> : public binary_function<_Tp*, _Tp*, bool>
+    {
+      bool
+      operator()(_Tp* __x, _Tp* __y) const noexcept
+      {
+ if (__builtin_constant_p (__x >= __y))
+   return __x >= __y;
+ return (long unsigned int)__x >= (long unsigned int)__y;
+      }
+    };
+
+
+  template<typename _Tp>
+    struct less_equal<_Tp*> : public binary_function<_Tp*, _Tp*, bool>
+    {
+      bool
+      operator()(_Tp* __x, _Tp* __y) const noexcept
+      {
+ if (__builtin_constant_p (__x <= __y))
+   return __x <= __y;
+ return (long unsigned int)__x <= (long unsigned int)__y;
+      }
+    };
+  template<typename _Tp>
+    struct logical_and : public binary_function<_Tp, _Tp, bool>
+    {
+     
+      bool
+      operator()(const _Tp& __x, const _Tp& __y) const
+      { return __x && __y; }
+    };
+
+
+  template<typename _Tp>
+    struct logical_or : public binary_function<_Tp, _Tp, bool>
+    {
+     
+      bool
+      operator()(const _Tp& __x, const _Tp& __y) const
+      { return __x || __y; }
+    };
+
+
+  template<typename _Tp>
+    struct logical_not : public unary_function<_Tp, bool>
+    {
+     
+      bool
+      operator()(const _Tp& __x) const
+      { return !__x; }
+    };
+  template<typename _Tp>
+    struct bit_and : public binary_function<_Tp, _Tp, _Tp>
+    {
+     
+      _Tp
+      operator()(const _Tp& __x, const _Tp& __y) const
+      { return __x & __y; }
+    };
+
+  template<typename _Tp>
+    struct bit_or : public binary_function<_Tp, _Tp, _Tp>
+    {
+     
+      _Tp
+      operator()(const _Tp& __x, const _Tp& __y) const
+      { return __x | __y; }
+    };
+
+  template<typename _Tp>
+    struct bit_xor : public binary_function<_Tp, _Tp, _Tp>
+    {
+     
+      _Tp
+      operator()(const _Tp& __x, const _Tp& __y) const
+      { return __x ^ __y; }
+    };
+
+  template<typename _Tp>
+    struct bit_not : public unary_function<_Tp, _Tp>
+    {
+   
+      _Tp
+      operator()(const _Tp& __x) const
+      { return ~__x; }
+    };
+  template<typename _Predicate>
+    class unary_negate
+    : public unary_function<typename _Predicate::argument_type, bool>
+    {
+    protected:
+      _Predicate _M_pred;
+
+    public:
+     
+      explicit
+      unary_negate(const _Predicate& __x) : _M_pred(__x) { }
+
+     
+      bool
+      operator()(const typename _Predicate::argument_type& __x) const
+      { return !_M_pred(__x); }
+    };
+
+
+  template<typename _Predicate>
+   
+    inline unary_negate<_Predicate>
+    not1(const _Predicate& __pred)
+    { return unary_negate<_Predicate>(__pred); }
+
+
+  template<typename _Predicate>
+    class binary_negate
+    : public binary_function<typename _Predicate::first_argument_type,
+        typename _Predicate::second_argument_type, bool>
+    {
+    protected:
+      _Predicate _M_pred;
+
+    public:
+     
+      explicit
+      binary_negate(const _Predicate& __x) : _M_pred(__x) { }
+
+     
+      bool
+      operator()(const typename _Predicate::first_argument_type& __x,
+   const typename _Predicate::second_argument_type& __y) const
+      { return !_M_pred(__x, __y); }
+    };
+
+
+  template<typename _Predicate>
+   
+    inline binary_negate<_Predicate>
+    not2(const _Predicate& __pred)
+    { return binary_negate<_Predicate>(__pred); }
+  template<typename _Arg, typename _Result>
+    class pointer_to_unary_function : public unary_function<_Arg, _Result>
+    {
+    protected:
+      _Result (*_M_ptr)(_Arg);
+
+    public:
+      pointer_to_unary_function() { }
+
+      explicit
+      pointer_to_unary_function(_Result (*__x)(_Arg))
+      : _M_ptr(__x) { }
+
+      _Result
+      operator()(_Arg __x) const
+      { return _M_ptr(__x); }
+    };
+
+
+  template<typename _Arg, typename _Result>
+    inline pointer_to_unary_function<_Arg, _Result>
+    ptr_fun(_Result (*__x)(_Arg))
+    { return pointer_to_unary_function<_Arg, _Result>(__x); }
+
+
+  template<typename _Arg1, typename _Arg2, typename _Result>
+    class pointer_to_binary_function
+    : public binary_function<_Arg1, _Arg2, _Result>
+    {
+    protected:
+      _Result (*_M_ptr)(_Arg1, _Arg2);
+
+    public:
+      pointer_to_binary_function() { }
+
+      explicit
+      pointer_to_binary_function(_Result (*__x)(_Arg1, _Arg2))
+      : _M_ptr(__x) { }
+
+      _Result
+      operator()(_Arg1 __x, _Arg2 __y) const
+      { return _M_ptr(__x, __y); }
+    };
+
+
+  template<typename _Arg1, typename _Arg2, typename _Result>
+    inline pointer_to_binary_function<_Arg1, _Arg2, _Result>
+    ptr_fun(_Result (*__x)(_Arg1, _Arg2))
+    { return pointer_to_binary_function<_Arg1, _Arg2, _Result>(__x); }
+
+
+  template<typename _Tp>
+    struct _Identity
+    : public unary_function<_Tp, _Tp>
+    {
+      _Tp&
+      operator()(_Tp& __x) const
+      { return __x; }
+
+      const _Tp&
+      operator()(const _Tp& __x) const
+      { return __x; }
+    };
+
+
+  template<typename _Tp> struct _Identity<const _Tp> : _Identity<_Tp> { };
+
+  template<typename _Pair>
+    struct _Select1st
+    : public unary_function<_Pair, typename _Pair::first_type>
+    {
+      typename _Pair::first_type&
+      operator()(_Pair& __x) const
+      { return __x.first; }
+
+      const typename _Pair::first_type&
+      operator()(const _Pair& __x) const
+      { return __x.first; }
+
+
+      template<typename _Pair2>
+        typename _Pair2::first_type&
+        operator()(_Pair2& __x) const
+        { return __x.first; }
+
+      template<typename _Pair2>
+        const typename _Pair2::first_type&
+        operator()(const _Pair2& __x) const
+        { return __x.first; }
+
+    };
+
+  template<typename _Pair>
+    struct _Select2nd
+    : public unary_function<_Pair, typename _Pair::second_type>
+    {
+      typename _Pair::second_type&
+      operator()(_Pair& __x) const
+      { return __x.second; }
+
+      const typename _Pair::second_type&
+      operator()(const _Pair& __x) const
+      { return __x.second; }
+    };
+  template<typename _Ret, typename _Tp>
+    class mem_fun_t : public unary_function<_Tp*, _Ret>
+    {
+    public:
+      explicit
+      mem_fun_t(_Ret (_Tp::*__pf)())
+      : _M_f(__pf) { }
+
+      _Ret
+      operator()(_Tp* __p) const
+      { return (__p->*_M_f)(); }
+
+    private:
+      _Ret (_Tp::*_M_f)();
+    };
+
+
+
+  template<typename _Ret, typename _Tp>
+    class const_mem_fun_t : public unary_function<const _Tp*, _Ret>
+    {
+    public:
+      explicit
+      const_mem_fun_t(_Ret (_Tp::*__pf)() const)
+      : _M_f(__pf) { }
+
+      _Ret
+      operator()(const _Tp* __p) const
+      { return (__p->*_M_f)(); }
+
+    private:
+      _Ret (_Tp::*_M_f)() const;
+    };
+
+
+
+  template<typename _Ret, typename _Tp>
+    class mem_fun_ref_t : public unary_function<_Tp, _Ret>
+    {
+    public:
+      explicit
+      mem_fun_ref_t(_Ret (_Tp::*__pf)())
+      : _M_f(__pf) { }
+
+      _Ret
+      operator()(_Tp& __r) const
+      { return (__r.*_M_f)(); }
+
+    private:
+      _Ret (_Tp::*_M_f)();
+  };
+
+
+
+  template<typename _Ret, typename _Tp>
+    class const_mem_fun_ref_t : public unary_function<_Tp, _Ret>
+    {
+    public:
+      explicit
+      const_mem_fun_ref_t(_Ret (_Tp::*__pf)() const)
+      : _M_f(__pf) { }
+
+      _Ret
+      operator()(const _Tp& __r) const
+      { return (__r.*_M_f)(); }
+
+    private:
+      _Ret (_Tp::*_M_f)() const;
+    };
+
+
+
+  template<typename _Ret, typename _Tp, typename _Arg>
+    class mem_fun1_t : public binary_function<_Tp*, _Arg, _Ret>
+    {
+    public:
+      explicit
+      mem_fun1_t(_Ret (_Tp::*__pf)(_Arg))
+      : _M_f(__pf) { }
+
+      _Ret
+      operator()(_Tp* __p, _Arg __x) const
+      { return (__p->*_M_f)(__x); }
+
+    private:
+      _Ret (_Tp::*_M_f)(_Arg);
+    };
+
+
+
+  template<typename _Ret, typename _Tp, typename _Arg>
+    class const_mem_fun1_t : public binary_function<const _Tp*, _Arg, _Ret>
+    {
+    public:
+      explicit
+      const_mem_fun1_t(_Ret (_Tp::*__pf)(_Arg) const)
+      : _M_f(__pf) { }
+
+      _Ret
+      operator()(const _Tp* __p, _Arg __x) const
+      { return (__p->*_M_f)(__x); }
+
+    private:
+      _Ret (_Tp::*_M_f)(_Arg) const;
+    };
+
+
+
+  template<typename _Ret, typename _Tp, typename _Arg>
+    class mem_fun1_ref_t : public binary_function<_Tp, _Arg, _Ret>
+    {
+    public:
+      explicit
+      mem_fun1_ref_t(_Ret (_Tp::*__pf)(_Arg))
+      : _M_f(__pf) { }
+
+      _Ret
+      operator()(_Tp& __r, _Arg __x) const
+      { return (__r.*_M_f)(__x); }
+
+    private:
+      _Ret (_Tp::*_M_f)(_Arg);
+    };
+
+
+
+  template<typename _Ret, typename _Tp, typename _Arg>
+    class const_mem_fun1_ref_t : public binary_function<_Tp, _Arg, _Ret>
+    {
+    public:
+      explicit
+      const_mem_fun1_ref_t(_Ret (_Tp::*__pf)(_Arg) const)
+      : _M_f(__pf) { }
+
+      _Ret
+      operator()(const _Tp& __r, _Arg __x) const
+      { return (__r.*_M_f)(__x); }
+
+    private:
+      _Ret (_Tp::*_M_f)(_Arg) const;
+    };
+
+
+
+  template<typename _Ret, typename _Tp>
+    inline mem_fun_t<_Ret, _Tp>
+    mem_fun(_Ret (_Tp::*__f)())
+    { return mem_fun_t<_Ret, _Tp>(__f); }
+
+  template<typename _Ret, typename _Tp>
+    inline const_mem_fun_t<_Ret, _Tp>
+    mem_fun(_Ret (_Tp::*__f)() const)
+    { return const_mem_fun_t<_Ret, _Tp>(__f); }
+
+  template<typename _Ret, typename _Tp>
+    inline mem_fun_ref_t<_Ret, _Tp>
+    mem_fun_ref(_Ret (_Tp::*__f)())
+    { return mem_fun_ref_t<_Ret, _Tp>(__f); }
+
+  template<typename _Ret, typename _Tp>
+    inline const_mem_fun_ref_t<_Ret, _Tp>
+    mem_fun_ref(_Ret (_Tp::*__f)() const)
+    { return const_mem_fun_ref_t<_Ret, _Tp>(__f); }
+
+  template<typename _Ret, typename _Tp, typename _Arg>
+    inline mem_fun1_t<_Ret, _Tp, _Arg>
+    mem_fun(_Ret (_Tp::*__f)(_Arg))
+    { return mem_fun1_t<_Ret, _Tp, _Arg>(__f); }
+
+  template<typename _Ret, typename _Tp, typename _Arg>
+    inline const_mem_fun1_t<_Ret, _Tp, _Arg>
+    mem_fun(_Ret (_Tp::*__f)(_Arg) const)
+    { return const_mem_fun1_t<_Ret, _Tp, _Arg>(__f); }
+
+  template<typename _Ret, typename _Tp, typename _Arg>
+    inline mem_fun1_ref_t<_Ret, _Tp, _Arg>
+    mem_fun_ref(_Ret (_Tp::*__f)(_Arg))
+    { return mem_fun1_ref_t<_Ret, _Tp, _Arg>(__f); }
+
+  template<typename _Ret, typename _Tp, typename _Arg>
+    inline const_mem_fun1_ref_t<_Ret, _Tp, _Arg>
+    mem_fun_ref(_Ret (_Tp::*__f)(_Arg) const)
+    { return const_mem_fun1_ref_t<_Ret, _Tp, _Arg>(__f); }
+
+
+
+
+}
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+  template<typename _Operation>
+    class binder1st
+    : public unary_function<typename _Operation::second_argument_type,
+       typename _Operation::result_type>
+    {
+    protected:
+      _Operation op;
+      typename _Operation::first_argument_type value;
+
+    public:
+      binder1st(const _Operation& __x,
+  const typename _Operation::first_argument_type& __y)
+      : op(__x), value(__y) { }
+
+      typename _Operation::result_type
+      operator()(const typename _Operation::second_argument_type& __x) const
+      { return op(value, __x); }
+
+
+
+      typename _Operation::result_type
+      operator()(typename _Operation::second_argument_type& __x) const
+      { return op(value, __x); }
+    } __attribute__ ((__deprecated__));
+
+
+  template<typename _Operation, typename _Tp>
+    inline binder1st<_Operation>
+    bind1st(const _Operation& __fn, const _Tp& __x)
+    {
+      typedef typename _Operation::first_argument_type _Arg1_type;
+      return binder1st<_Operation>(__fn, _Arg1_type(__x));
+    }
+
+
+  template<typename _Operation>
+    class binder2nd
+    : public unary_function<typename _Operation::first_argument_type,
+       typename _Operation::result_type>
+    {
+    protected:
+      _Operation op;
+      typename _Operation::second_argument_type value;
+
+    public:
+      binder2nd(const _Operation& __x,
+  const typename _Operation::second_argument_type& __y)
+      : op(__x), value(__y) { }
+
+      typename _Operation::result_type
+      operator()(const typename _Operation::first_argument_type& __x) const
+      { return op(__x, value); }
+
+
+
+      typename _Operation::result_type
+      operator()(typename _Operation::first_argument_type& __x) const
+      { return op(__x, value); }
+    } __attribute__ ((__deprecated__));
+
+
+  template<typename _Operation, typename _Tp>
+    inline binder2nd<_Operation>
+    bind2nd(const _Operation& __fn, const _Tp& __x)
+    {
+      typedef typename _Operation::second_argument_type _Arg2_type;
+      return binder2nd<_Operation>(__fn, _Arg2_type(__x));
+    }
+
+
+
+}
+
+
+
+       
+
+
+       
+
+
+
+
+
+
+
+
+namespace std
+{
+
+  template<class _E>
+    class initializer_list
+    {
+    public:
+      typedef _E value_type;
+      typedef const _E& reference;
+      typedef const _E& const_reference;
+      typedef size_t size_type;
+      typedef const _E* iterator;
+      typedef const _E* const_iterator;
+
+    private:
+      iterator _M_array;
+      size_type _M_len;
+
+
+      constexpr initializer_list(const_iterator __a, size_type __l)
+      : _M_array(__a), _M_len(__l) { }
+
+    public:
+      constexpr initializer_list() noexcept
+      : _M_array(0), _M_len(0) { }
+
+
+      constexpr size_type
+      size() const noexcept { return _M_len; }
+
+
+      constexpr const_iterator
+      begin() const noexcept { return _M_array; }
+
+
+      constexpr const_iterator
+      end() const noexcept { return begin() + size(); }
+    };
+
+
+
+
+
+
+  template<class _Tp>
+    constexpr const _Tp*
+    begin(initializer_list<_Tp> __ils) noexcept
+    { return __ils.begin(); }
+
+
+
+
+
+
+  template<class _Tp>
+    constexpr const _Tp*
+    end(initializer_list<_Tp> __ils) noexcept
+    { return __ils.end(); }
+}
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+
+
+
+
+  template<typename _Container>
+    inline auto
+    begin(_Container& __cont) -> decltype(__cont.begin())
+    { return __cont.begin(); }
+
+
+
+
+
+
+  template<typename _Container>
+    inline auto
+    begin(const _Container& __cont) -> decltype(__cont.begin())
+    { return __cont.begin(); }
+
+
+
+
+
+
+  template<typename _Container>
+    inline auto
+    end(_Container& __cont) -> decltype(__cont.end())
+    { return __cont.end(); }
+
+
+
+
+
+
+  template<typename _Container>
+    inline auto
+    end(const _Container& __cont) -> decltype(__cont.end())
+    { return __cont.end(); }
+
+
+
+
+
+  template<typename _Tp, size_t _Nm>
+    inline _Tp*
+    begin(_Tp (&__arr)[_Nm])
+    { return __arr; }
+
+
+
+
+
+
+  template<typename _Tp, size_t _Nm>
+    inline _Tp*
+    end(_Tp (&__arr)[_Nm])
+    { return __arr + _Nm; }
+
+}
+       
+
+
+       
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+  struct __allocator_traits_base
+  {
+    template<typename _Tp, typename _Up, typename = void>
+      struct __rebind : __replace_first_arg<_Tp, _Up> { };
+
+    template<typename _Tp, typename _Up>
+      struct __rebind<_Tp, _Up,
+        __void_t<typename _Tp::template rebind<_Up>::other>>
+      { using type = typename _Tp::template rebind<_Up>::other; };
+
+  protected:
+    template<typename _Tp>
+      using __pointer = typename _Tp::pointer;
+    template<typename _Tp>
+      using __c_pointer = typename _Tp::const_pointer;
+    template<typename _Tp>
+      using __v_pointer = typename _Tp::void_pointer;
+    template<typename _Tp>
+      using __cv_pointer = typename _Tp::const_void_pointer;
+    template<typename _Tp>
+      using __pocca = typename _Tp::propagate_on_container_copy_assignment;
+    template<typename _Tp>
+      using __pocma = typename _Tp::propagate_on_container_move_assignment;
+    template<typename _Tp>
+      using __pocs = typename _Tp::propagate_on_container_swap;
+    template<typename _Tp>
+      using __equal = typename _Tp::is_always_equal;
+  };
+
+  template<typename _Alloc, typename _Up>
+    using __alloc_rebind
+      = typename __allocator_traits_base::template __rebind<_Alloc, _Up>::type;
+
+
+
+
+
+  template<typename _Alloc>
+    struct allocator_traits : __allocator_traits_base
+    {
+
+      typedef _Alloc allocator_type;
+
+      typedef typename _Alloc::value_type value_type;
+
+
+
+
+
+
+      using pointer = __detected_or_t<value_type*, __pointer, _Alloc>;
+
+    private:
+
+      template<template<typename> class _Func, typename _Tp, typename = void>
+ struct _Ptr
+ {
+   using type = typename pointer_traits<pointer>::template rebind<_Tp>;
+ };
+
+      template<template<typename> class _Func, typename _Tp>
+ struct _Ptr<_Func, _Tp, __void_t<_Func<_Alloc>>>
+ {
+   using type = _Func<_Alloc>;
+ };
+
+
+      template<typename _A2, typename _PtrT, typename = void>
+ struct _Diff
+ { using type = typename pointer_traits<_PtrT>::difference_type; };
+
+      template<typename _A2, typename _PtrT>
+ struct _Diff<_A2, _PtrT, __void_t<typename _A2::difference_type>>
+ { using type = typename _A2::difference_type; };
+
+
+      template<typename _A2, typename _DiffT, typename = void>
+ struct _Size : make_unsigned<_DiffT> { };
+
+      template<typename _A2, typename _DiffT>
+ struct _Size<_A2, _DiffT, __void_t<typename _A2::size_type>>
+ { using type = typename _A2::size_type; };
+
+    public:
+
+
+
+
+
+
+      using const_pointer = typename _Ptr<__c_pointer, const value_type>::type;
+
+
+
+
+
+
+
+      using void_pointer = typename _Ptr<__v_pointer, void>::type;
+
+
+
+
+
+
+
+      using const_void_pointer = typename _Ptr<__cv_pointer, const void>::type;
+
+
+
+
+
+
+
+      using difference_type = typename _Diff<_Alloc, pointer>::type;
+
+
+
+
+
+
+
+      using size_type = typename _Size<_Alloc, difference_type>::type;
+
+
+
+
+
+
+
+      using propagate_on_container_copy_assignment
+ = __detected_or_t<false_type, __pocca, _Alloc>;
+
+
+
+
+
+
+
+      using propagate_on_container_move_assignment
+ = __detected_or_t<false_type, __pocma, _Alloc>;
+
+
+
+
+
+
+
+      using propagate_on_container_swap
+ = __detected_or_t<false_type, __pocs, _Alloc>;
+
+
+
+
+
+
+
+      using is_always_equal
+ = __detected_or_t<typename is_empty<_Alloc>::type, __equal, _Alloc>;
+
+      template<typename _Tp>
+ using rebind_alloc = __alloc_rebind<_Alloc, _Tp>;
+      template<typename _Tp>
+ using rebind_traits = allocator_traits<rebind_alloc<_Tp>>;
+
+    private:
+      template<typename _Alloc2>
+ static auto
+ _S_allocate(_Alloc2& __a, size_type __n, const_void_pointer __hint, int)
+ -> decltype(__a.allocate(__n, __hint))
+ { return __a.allocate(__n, __hint); }
+
+      template<typename _Alloc2>
+ static pointer
+ _S_allocate(_Alloc2& __a, size_type __n, const_void_pointer, ...)
+ { return __a.allocate(__n); }
+
+      template<typename _Tp, typename... _Args>
+ struct __construct_helper
+ {
+   template<typename _Alloc2,
+     typename = decltype(std::declval<_Alloc2*>()->construct(
+    std::declval<_Tp*>(), std::declval<_Args>()...))>
+     static true_type __test(int);
+
+   template<typename>
+     static false_type __test(...);
+
+   using type = decltype(__test<_Alloc>(0));
+ };
+
+      template<typename _Tp, typename... _Args>
+ using __has_construct
+   = typename __construct_helper<_Tp, _Args...>::type;
+
+      template<typename _Tp, typename... _Args>
+ static _Require<__has_construct<_Tp, _Args...>>
+ _S_construct(_Alloc& __a, _Tp* __p, _Args&&... __args)
+ { __a.construct(__p, std::forward<_Args>(__args)...); }
+
+      template<typename _Tp, typename... _Args>
+ static
+ _Require<__and_<__not_<__has_construct<_Tp, _Args...>>,
+          is_constructible<_Tp, _Args...>>>
+ _S_construct(_Alloc&, _Tp* __p, _Args&&... __args)
+ { ::new((void*)__p) _Tp(std::forward<_Args>(__args)...); }
+
+      template<typename _Alloc2, typename _Tp>
+ static auto
+ _S_destroy(_Alloc2& __a, _Tp* __p, int)
+ -> decltype(__a.destroy(__p))
+ { __a.destroy(__p); }
+
+      template<typename _Alloc2, typename _Tp>
+ static void
+ _S_destroy(_Alloc2&, _Tp* __p, ...)
+ { __p->~_Tp(); }
+
+      template<typename _Alloc2>
+ static auto
+ _S_max_size(_Alloc2& __a, int)
+ -> decltype(__a.max_size())
+ { return __a.max_size(); }
+
+      template<typename _Alloc2>
+ static size_type
+ _S_max_size(_Alloc2&, ...)
+ {
+
+
+   return __gnu_cxx::__numeric_traits<size_type>::__max
+     / sizeof(value_type);
+ }
+
+      template<typename _Alloc2>
+ static auto
+ _S_select(_Alloc2& __a, int)
+ -> decltype(__a.select_on_container_copy_construction())
+ { return __a.select_on_container_copy_construction(); }
+
+      template<typename _Alloc2>
+ static _Alloc2
+ _S_select(_Alloc2& __a, ...)
+ { return __a; }
+
+    public:
+      static pointer
+      allocate(_Alloc& __a, size_type __n)
+      { return __a.allocate(__n); }
+      static pointer
+      allocate(_Alloc& __a, size_type __n, const_void_pointer __hint)
+      { return _S_allocate(__a, __n, __hint, 0); }
+      static void
+      deallocate(_Alloc& __a, pointer __p, size_type __n)
+      { __a.deallocate(__p, __n); }
+      template<typename _Tp, typename... _Args>
+ static auto construct(_Alloc& __a, _Tp* __p, _Args&&... __args)
+ -> decltype(_S_construct(__a, __p, std::forward<_Args>(__args)...))
+ { _S_construct(__a, __p, std::forward<_Args>(__args)...); }
+      template<typename _Tp>
+ static void destroy(_Alloc& __a, _Tp* __p)
+ { _S_destroy(__a, __p, 0); }
+      static size_type max_size(const _Alloc& __a) noexcept
+      { return _S_max_size(__a, 0); }
+      static _Alloc
+      select_on_container_copy_construction(const _Alloc& __rhs)
+      { return _S_select(__rhs, 0); }
+    };
+
+
+  template<typename _Tp>
+    struct allocator_traits<allocator<_Tp>>
+    {
+
+      using allocator_type = allocator<_Tp>;
+
+      using value_type = _Tp;
+
+
+      using pointer = _Tp*;
+
+
+      using const_pointer = const _Tp*;
+
+
+      using void_pointer = void*;
+
+
+      using const_void_pointer = const void*;
+
+
+      using difference_type = std::ptrdiff_t;
+
+
+      using size_type = std::size_t;
+
+
+      using propagate_on_container_copy_assignment = false_type;
+
+
+      using propagate_on_container_move_assignment = true_type;
+
+
+      using propagate_on_container_swap = false_type;
+
+
+      using is_always_equal = true_type;
+
+      template<typename _Up>
+ using rebind_alloc = allocator<_Up>;
+
+      template<typename _Up>
+ using rebind_traits = allocator_traits<allocator<_Up>>;
+      static pointer
+      allocate(allocator_type& __a, size_type __n)
+      { return __a.allocate(__n); }
+      static pointer
+      allocate(allocator_type& __a, size_type __n, const_void_pointer __hint)
+      { return __a.allocate(__n, __hint); }
+      static void
+      deallocate(allocator_type& __a, pointer __p, size_type __n)
+      { __a.deallocate(__p, __n); }
+      template<typename _Up, typename... _Args>
+ static void
+ construct(allocator_type& __a, _Up* __p, _Args&&... __args)
+ { __a.construct(__p, std::forward<_Args>(__args)...); }
+      template<typename _Up>
+ static void
+ destroy(allocator_type& __a, _Up* __p)
+ { __a.destroy(__p); }
+
+
+
+
+
+
+      static size_type
+      max_size(const allocator_type& __a) noexcept
+      { return __a.max_size(); }
+
+
+
+
+
+
+      static allocator_type
+      select_on_container_copy_construction(const allocator_type& __rhs)
+      { return __rhs; }
+    };
+
+
+  template<typename _Alloc>
+    inline void
+    __do_alloc_on_copy(_Alloc& __one, const _Alloc& __two, true_type)
+    { __one = __two; }
+
+  template<typename _Alloc>
+    inline void
+    __do_alloc_on_copy(_Alloc&, const _Alloc&, false_type)
+    { }
+
+  template<typename _Alloc>
+    inline void __alloc_on_copy(_Alloc& __one, const _Alloc& __two)
+    {
+      typedef allocator_traits<_Alloc> __traits;
+      typedef typename __traits::propagate_on_container_copy_assignment __pocca;
+      __do_alloc_on_copy(__one, __two, __pocca());
+    }
+
+  template<typename _Alloc>
+    inline _Alloc __alloc_on_copy(const _Alloc& __a)
+    {
+      typedef allocator_traits<_Alloc> __traits;
+      return __traits::select_on_container_copy_construction(__a);
+    }
+
+  template<typename _Alloc>
+    inline void __do_alloc_on_move(_Alloc& __one, _Alloc& __two, true_type)
+    { __one = std::move(__two); }
+
+  template<typename _Alloc>
+    inline void __do_alloc_on_move(_Alloc&, _Alloc&, false_type)
+    { }
+
+  template<typename _Alloc>
+    inline void __alloc_on_move(_Alloc& __one, _Alloc& __two)
+    {
+      typedef allocator_traits<_Alloc> __traits;
+      typedef typename __traits::propagate_on_container_move_assignment __pocma;
+      __do_alloc_on_move(__one, __two, __pocma());
+    }
+
+  template<typename _Alloc>
+    inline void __do_alloc_on_swap(_Alloc& __one, _Alloc& __two, true_type)
+    {
+      using std::swap;
+      swap(__one, __two);
+    }
+
+  template<typename _Alloc>
+    inline void __do_alloc_on_swap(_Alloc&, _Alloc&, false_type)
+    { }
+
+  template<typename _Alloc>
+    inline void __alloc_on_swap(_Alloc& __one, _Alloc& __two)
+    {
+      typedef allocator_traits<_Alloc> __traits;
+      typedef typename __traits::propagate_on_container_swap __pocs;
+      __do_alloc_on_swap(__one, __two, __pocs());
+    }
+
+  template<typename _Alloc>
+    class __is_copy_insertable_impl
+    {
+      typedef allocator_traits<_Alloc> _Traits;
+
+      template<typename _Up, typename
+        = decltype(_Traits::construct(std::declval<_Alloc&>(),
+          std::declval<_Up*>(),
+          std::declval<const _Up&>()))>
+ static true_type
+ _M_select(int);
+
+      template<typename _Up>
+ static false_type
+ _M_select(...);
+
+    public:
+      typedef decltype(_M_select<typename _Alloc::value_type>(0)) type;
+    };
+
+
+  template<typename _Alloc>
+    struct __is_copy_insertable
+    : __is_copy_insertable_impl<_Alloc>::type
+    { };
+
+
+  template<typename _Tp>
+    struct __is_copy_insertable<allocator<_Tp>>
+    : is_copy_constructible<_Tp>
+    { };
+
+
+  template<typename _Alloc, typename = void>
+    struct __is_allocator : false_type { };
+
+  template<typename _Alloc>
+    struct __is_allocator<_Alloc,
+      __void_t<typename _Alloc::value_type,
+        decltype(std::declval<_Alloc&>().allocate(size_t{}))>>
+    : true_type { };
+
+  template<typename _Alloc>
+    using _RequireAllocator
+      = typename enable_if<__is_allocator<_Alloc>::value, _Alloc>::type;
+
+
+}
+
+
+
+
+namespace __gnu_cxx __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+
+
+
+template<typename _Alloc, typename = typename _Alloc::value_type>
+  struct __alloc_traits
+
+  : std::allocator_traits<_Alloc>
+
+  {
+    typedef _Alloc allocator_type;
+
+    typedef std::allocator_traits<_Alloc> _Base_type;
+    typedef typename _Base_type::value_type value_type;
+    typedef typename _Base_type::pointer pointer;
+    typedef typename _Base_type::const_pointer const_pointer;
+    typedef typename _Base_type::size_type size_type;
+    typedef typename _Base_type::difference_type difference_type;
+
+    typedef value_type& reference;
+    typedef const value_type& const_reference;
+    using _Base_type::allocate;
+    using _Base_type::deallocate;
+    using _Base_type::construct;
+    using _Base_type::destroy;
+    using _Base_type::max_size;
+
+  private:
+    template<typename _Ptr>
+      using __is_custom_pointer
+ = std::__and_<std::is_same<pointer, _Ptr>,
+        std::__not_<std::is_pointer<_Ptr>>>;
+
+  public:
+
+    template<typename _Ptr, typename... _Args>
+      static typename std::enable_if<__is_custom_pointer<_Ptr>::value>::type
+      construct(_Alloc& __a, _Ptr __p, _Args&&... __args)
+      {
+ _Base_type::construct(__a, std::__to_address(__p),
+         std::forward<_Args>(__args)...);
+      }
+
+
+    template<typename _Ptr>
+      static typename std::enable_if<__is_custom_pointer<_Ptr>::value>::type
+      destroy(_Alloc& __a, _Ptr __p)
+      { _Base_type::destroy(__a, std::__to_address(__p)); }
+
+    static _Alloc _S_select_on_copy(const _Alloc& __a)
+    { return _Base_type::select_on_container_copy_construction(__a); }
+
+    static void _S_on_swap(_Alloc& __a, _Alloc& __b)
+    { std::__alloc_on_swap(__a, __b); }
+
+    static constexpr bool _S_propagate_on_copy_assign()
+    { return _Base_type::propagate_on_container_copy_assignment::value; }
+
+    static constexpr bool _S_propagate_on_move_assign()
+    { return _Base_type::propagate_on_container_move_assignment::value; }
+
+    static constexpr bool _S_propagate_on_swap()
+    { return _Base_type::propagate_on_container_swap::value; }
+
+    static constexpr bool _S_always_equal()
+    { return _Base_type::is_always_equal::value; }
+
+    static constexpr bool _S_nothrow_move()
+    { return _S_propagate_on_move_assign() || _S_always_equal(); }
+
+    template<typename _Tp>
+      struct rebind
+      { typedef typename _Base_type::template rebind_alloc<_Tp> other; };
+  };
+
+
+}
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+namespace __cxx11 {
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    class basic_string
+    {
+      typedef typename __gnu_cxx::__alloc_traits<_Alloc>::template
+ rebind<_CharT>::other _Char_alloc_type;
+      typedef __gnu_cxx::__alloc_traits<_Char_alloc_type> _Alloc_traits;
+
+
+    public:
+      typedef _Traits traits_type;
+      typedef typename _Traits::char_type value_type;
+      typedef _Char_alloc_type allocator_type;
+      typedef typename _Alloc_traits::size_type size_type;
+      typedef typename _Alloc_traits::difference_type difference_type;
+      typedef typename _Alloc_traits::reference reference;
+      typedef typename _Alloc_traits::const_reference const_reference;
+      typedef typename _Alloc_traits::pointer pointer;
+      typedef typename _Alloc_traits::const_pointer const_pointer;
+      typedef __gnu_cxx::__normal_iterator<pointer, basic_string> iterator;
+      typedef __gnu_cxx::__normal_iterator<const_pointer, basic_string>
+       const_iterator;
+      typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+      typedef std::reverse_iterator<iterator> reverse_iterator;
+
+
+      static const size_type npos = static_cast<size_type>(-1);
+
+    protected:
+
+
+
+
+      typedef const_iterator __const_iterator;
+
+
+    private:
+      struct _Alloc_hider : allocator_type
+      {
+
+
+
+
+ _Alloc_hider(pointer __dat, const _Alloc& __a)
+ : allocator_type(__a), _M_p(__dat) { }
+
+ _Alloc_hider(pointer __dat, _Alloc&& __a = _Alloc())
+ : allocator_type(std::move(__a)), _M_p(__dat) { }
+
+
+ pointer _M_p;
+      };
+
+      _Alloc_hider _M_dataplus;
+      size_type _M_string_length;
+
+      enum { _S_local_capacity = 15 / sizeof(_CharT) };
+
+      union
+      {
+ _CharT _M_local_buf[_S_local_capacity + 1];
+ size_type _M_allocated_capacity;
+      };
+
+      void
+      _M_data(pointer __p)
+      { _M_dataplus._M_p = __p; }
+
+      void
+      _M_length(size_type __length)
+      { _M_string_length = __length; }
+
+      pointer
+      _M_data() const
+      { return _M_dataplus._M_p; }
+
+      pointer
+      _M_local_data()
+      {
+
+ return std::pointer_traits<pointer>::pointer_to(*_M_local_buf);
+
+
+
+      }
+
+      const_pointer
+      _M_local_data() const
+      {
+
+ return std::pointer_traits<const_pointer>::pointer_to(*_M_local_buf);
+
+
+
+      }
+
+      void
+      _M_capacity(size_type __capacity)
+      { _M_allocated_capacity = __capacity; }
+
+      void
+      _M_set_length(size_type __n)
+      {
+ _M_length(__n);
+ traits_type::assign(_M_data()[__n], _CharT());
+      }
+
+      bool
+      _M_is_local() const
+      { return _M_data() == _M_local_data(); }
+
+
+      pointer
+      _M_create(size_type&, size_type);
+
+      void
+      _M_dispose()
+      {
+ if (!_M_is_local())
+   _M_destroy(_M_allocated_capacity);
+      }
+
+      void
+      _M_destroy(size_type __size) throw()
+      { _Alloc_traits::deallocate(_M_get_allocator(), _M_data(), __size + 1); }
+
+
+
+      template<typename _InIterator>
+        void
+        _M_construct_aux(_InIterator __beg, _InIterator __end,
+    std::__false_type)
+ {
+          typedef typename iterator_traits<_InIterator>::iterator_category _Tag;
+          _M_construct(__beg, __end, _Tag());
+ }
+
+
+
+      template<typename _Integer>
+        void
+        _M_construct_aux(_Integer __beg, _Integer __end, std::__true_type)
+ { _M_construct_aux_2(static_cast<size_type>(__beg), __end); }
+
+      void
+      _M_construct_aux_2(size_type __req, _CharT __c)
+      { _M_construct(__req, __c); }
+
+      template<typename _InIterator>
+        void
+        _M_construct(_InIterator __beg, _InIterator __end)
+ {
+   typedef typename std::__is_integer<_InIterator>::__type _Integral;
+   _M_construct_aux(__beg, __end, _Integral());
+        }
+
+
+      template<typename _InIterator>
+        void
+        _M_construct(_InIterator __beg, _InIterator __end,
+       std::input_iterator_tag);
+
+
+
+      template<typename _FwdIterator>
+        void
+        _M_construct(_FwdIterator __beg, _FwdIterator __end,
+       std::forward_iterator_tag);
+
+      void
+      _M_construct(size_type __req, _CharT __c);
+
+      allocator_type&
+      _M_get_allocator()
+      { return _M_dataplus; }
+
+      const allocator_type&
+      _M_get_allocator() const
+      { return _M_dataplus; }
+
+    private:
+      size_type
+      _M_check(size_type __pos, const char* __s) const
+      {
+ if (__pos > this->size())
+   __throw_out_of_range_fmt(("%s: __pos (which is %zu) > " "this->size() (which is %zu)")
+                                         ,
+       __s, __pos, this->size());
+ return __pos;
+      }
+
+      void
+      _M_check_length(size_type __n1, size_type __n2, const char* __s) const
+      {
+ if (this->max_size() - (this->size() - __n1) < __n2)
+   __throw_length_error((__s));
+      }
+
+
+
+      size_type
+      _M_limit(size_type __pos, size_type __off) const noexcept
+      {
+ const bool __testoff = __off < this->size() - __pos;
+ return __testoff ? __off : this->size() - __pos;
+      }
+
+
+      bool
+      _M_disjunct(const _CharT* __s) const noexcept
+      {
+ return (less<const _CharT*>()(__s, _M_data())
+  || less<const _CharT*>()(_M_data() + this->size(), __s));
+      }
+
+
+
+      static void
+      _S_copy(_CharT* __d, const _CharT* __s, size_type __n)
+      {
+ if (__n == 1)
+   traits_type::assign(*__d, *__s);
+ else
+   traits_type::copy(__d, __s, __n);
+      }
+
+      static void
+      _S_move(_CharT* __d, const _CharT* __s, size_type __n)
+      {
+ if (__n == 1)
+   traits_type::assign(*__d, *__s);
+ else
+   traits_type::move(__d, __s, __n);
+      }
+
+      static void
+      _S_assign(_CharT* __d, size_type __n, _CharT __c)
+      {
+ if (__n == 1)
+   traits_type::assign(*__d, __c);
+ else
+   traits_type::assign(__d, __n, __c);
+      }
+
+
+
+      template<class _Iterator>
+        static void
+        _S_copy_chars(_CharT* __p, _Iterator __k1, _Iterator __k2)
+        {
+   for (; __k1 != __k2; ++__k1, (void)++__p)
+     traits_type::assign(*__p, *__k1);
+ }
+
+      static void
+      _S_copy_chars(_CharT* __p, iterator __k1, iterator __k2) noexcept
+      { _S_copy_chars(__p, __k1.base(), __k2.base()); }
+
+      static void
+      _S_copy_chars(_CharT* __p, const_iterator __k1, const_iterator __k2)
+      noexcept
+      { _S_copy_chars(__p, __k1.base(), __k2.base()); }
+
+      static void
+      _S_copy_chars(_CharT* __p, _CharT* __k1, _CharT* __k2) noexcept
+      { _S_copy(__p, __k1, __k2 - __k1); }
+
+      static void
+      _S_copy_chars(_CharT* __p, const _CharT* __k1, const _CharT* __k2)
+      noexcept
+      { _S_copy(__p, __k1, __k2 - __k1); }
+
+      static int
+      _S_compare(size_type __n1, size_type __n2) noexcept
+      {
+ const difference_type __d = difference_type(__n1 - __n2);
+
+ if (__d > __gnu_cxx::__numeric_traits<int>::__max)
+   return __gnu_cxx::__numeric_traits<int>::__max;
+ else if (__d < __gnu_cxx::__numeric_traits<int>::__min)
+   return __gnu_cxx::__numeric_traits<int>::__min;
+ else
+   return int(__d);
+      }
+
+      void
+      _M_assign(const basic_string&);
+
+      void
+      _M_mutate(size_type __pos, size_type __len1, const _CharT* __s,
+  size_type __len2);
+
+      void
+      _M_erase(size_type __pos, size_type __n);
+
+    public:
+
+
+
+
+
+
+
+      basic_string()
+      noexcept(is_nothrow_default_constructible<_Alloc>::value)
+      : _M_dataplus(_M_local_data())
+      { _M_set_length(0); }
+
+
+
+
+      explicit
+      basic_string(const _Alloc& __a) noexcept
+      : _M_dataplus(_M_local_data(), __a)
+      { _M_set_length(0); }
+
+
+
+
+
+      basic_string(const basic_string& __str)
+      : _M_dataplus(_M_local_data(),
+      _Alloc_traits::_S_select_on_copy(__str._M_get_allocator()))
+      { _M_construct(__str._M_data(), __str._M_data() + __str.length()); }
+      basic_string(const basic_string& __str, size_type __pos,
+     const _Alloc& __a = _Alloc())
+      : _M_dataplus(_M_local_data(), __a)
+      {
+ const _CharT* __start = __str._M_data()
+   + __str._M_check(__pos, "basic_string::basic_string");
+ _M_construct(__start, __start + __str._M_limit(__pos, npos));
+      }
+
+
+
+
+
+
+
+      basic_string(const basic_string& __str, size_type __pos,
+     size_type __n)
+      : _M_dataplus(_M_local_data())
+      {
+ const _CharT* __start = __str._M_data()
+   + __str._M_check(__pos, "basic_string::basic_string");
+ _M_construct(__start, __start + __str._M_limit(__pos, __n));
+      }
+      basic_string(const basic_string& __str, size_type __pos,
+     size_type __n, const _Alloc& __a)
+      : _M_dataplus(_M_local_data(), __a)
+      {
+ const _CharT* __start
+   = __str._M_data() + __str._M_check(__pos, "string::string");
+ _M_construct(__start, __start + __str._M_limit(__pos, __n));
+      }
+      basic_string(const _CharT* __s, size_type __n,
+     const _Alloc& __a = _Alloc())
+      : _M_dataplus(_M_local_data(), __a)
+      { _M_construct(__s, __s + __n); }
+      basic_string(const _CharT* __s, const _Alloc& __a = _Alloc())
+      : _M_dataplus(_M_local_data(), __a)
+      { _M_construct(__s, __s ? __s + traits_type::length(__s) : __s+npos); }
+      basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc())
+      : _M_dataplus(_M_local_data(), __a)
+      { _M_construct(__n, __c); }
+      basic_string(basic_string&& __str) noexcept
+      : _M_dataplus(_M_local_data(), std::move(__str._M_get_allocator()))
+      {
+ if (__str._M_is_local())
+   {
+     traits_type::copy(_M_local_buf, __str._M_local_buf,
+         _S_local_capacity + 1);
+   }
+ else
+   {
+     _M_data(__str._M_data());
+     _M_capacity(__str._M_allocated_capacity);
+   }
+
+
+
+
+ _M_length(__str.length());
+ __str._M_data(__str._M_local_data());
+ __str._M_set_length(0);
+      }
+
+
+
+
+
+
+      basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc())
+      : _M_dataplus(_M_local_data(), __a)
+      { _M_construct(__l.begin(), __l.end()); }
+
+      basic_string(const basic_string& __str, const _Alloc& __a)
+      : _M_dataplus(_M_local_data(), __a)
+      { _M_construct(__str.begin(), __str.end()); }
+
+      basic_string(basic_string&& __str, const _Alloc& __a)
+      noexcept(_Alloc_traits::_S_always_equal())
+      : _M_dataplus(_M_local_data(), __a)
+      {
+ if (__str._M_is_local())
+   {
+     traits_type::copy(_M_local_buf, __str._M_local_buf,
+         _S_local_capacity + 1);
+     _M_length(__str.length());
+     __str._M_set_length(0);
+   }
+ else if (_Alloc_traits::_S_always_equal()
+     || __str.get_allocator() == __a)
+   {
+     _M_data(__str._M_data());
+     _M_length(__str.length());
+     _M_capacity(__str._M_allocated_capacity);
+     __str._M_data(__str._M_local_buf);
+     __str._M_set_length(0);
+   }
+ else
+   _M_construct(__str.begin(), __str.end());
+      }
+      template<typename _InputIterator,
+        typename = std::_RequireInputIter<_InputIterator>>
+
+
+
+        basic_string(_InputIterator __beg, _InputIterator __end,
+       const _Alloc& __a = _Alloc())
+ : _M_dataplus(_M_local_data(), __a)
+ { _M_construct(__beg, __end); }
+      ~basic_string()
+      { _M_dispose(); }
+
+
+
+
+
+      basic_string&
+      operator=(const basic_string& __str)
+      {
+
+ if (_Alloc_traits::_S_propagate_on_copy_assign())
+   {
+     if (!_Alloc_traits::_S_always_equal() && !_M_is_local()
+  && _M_get_allocator() != __str._M_get_allocator())
+       {
+
+
+  if (__str.size() <= _S_local_capacity)
+    {
+      _M_destroy(_M_allocated_capacity);
+      _M_data(_M_local_data());
+      _M_set_length(0);
+    }
+  else
+    {
+      const auto __len = __str.size();
+      auto __alloc = __str._M_get_allocator();
+
+      auto __ptr = _Alloc_traits::allocate(__alloc, __len + 1);
+      _M_destroy(_M_allocated_capacity);
+      _M_data(__ptr);
+      _M_capacity(__len);
+      _M_set_length(__len);
+    }
+       }
+     std::__alloc_on_copy(_M_get_allocator(), __str._M_get_allocator());
+   }
+
+ return this->assign(__str);
+      }
+
+
+
+
+
+      basic_string&
+      operator=(const _CharT* __s)
+      { return this->assign(__s); }
+      basic_string&
+      operator=(_CharT __c)
+      {
+ this->assign(1, __c);
+ return *this;
+      }
+      basic_string&
+      operator=(basic_string&& __str)
+      noexcept(_Alloc_traits::_S_nothrow_move())
+      {
+ if (!_M_is_local() && _Alloc_traits::_S_propagate_on_move_assign()
+     && !_Alloc_traits::_S_always_equal()
+     && _M_get_allocator() != __str._M_get_allocator())
+   {
+
+     _M_destroy(_M_allocated_capacity);
+     _M_data(_M_local_data());
+     _M_set_length(0);
+   }
+
+ std::__alloc_on_move(_M_get_allocator(), __str._M_get_allocator());
+
+ if (!__str._M_is_local()
+     && (_Alloc_traits::_S_propagate_on_move_assign()
+       || _Alloc_traits::_S_always_equal()))
+   {
+     pointer __data = nullptr;
+     size_type __capacity;
+     if (!_M_is_local())
+       {
+  if (_Alloc_traits::_S_always_equal())
+    {
+      __data = _M_data();
+      __capacity = _M_allocated_capacity;
+    }
+  else
+    _M_destroy(_M_allocated_capacity);
+       }
+
+     _M_data(__str._M_data());
+     _M_length(__str.length());
+     _M_capacity(__str._M_allocated_capacity);
+     if (__data)
+       {
+  __str._M_data(__data);
+  __str._M_capacity(__capacity);
+       }
+     else
+       __str._M_data(__str._M_local_buf);
+   }
+ else
+     assign(__str);
+ __str.clear();
+ return *this;
+      }
+
+
+
+
+
+      basic_string&
+      operator=(initializer_list<_CharT> __l)
+      {
+ this->assign(__l.begin(), __l.size());
+ return *this;
+      }
+      iterator
+      begin() noexcept
+      { return iterator(_M_data()); }
+
+
+
+
+
+      const_iterator
+      begin() const noexcept
+      { return const_iterator(_M_data()); }
+
+
+
+
+
+      iterator
+      end() noexcept
+      { return iterator(_M_data() + this->size()); }
+
+
+
+
+
+      const_iterator
+      end() const noexcept
+      { return const_iterator(_M_data() + this->size()); }
+
+
+
+
+
+
+      reverse_iterator
+      rbegin() noexcept
+      { return reverse_iterator(this->end()); }
+
+
+
+
+
+
+      const_reverse_iterator
+      rbegin() const noexcept
+      { return const_reverse_iterator(this->end()); }
+
+
+
+
+
+
+      reverse_iterator
+      rend() noexcept
+      { return reverse_iterator(this->begin()); }
+
+
+
+
+
+
+      const_reverse_iterator
+      rend() const noexcept
+      { return const_reverse_iterator(this->begin()); }
+
+
+
+
+
+
+      const_iterator
+      cbegin() const noexcept
+      { return const_iterator(this->_M_data()); }
+
+
+
+
+
+      const_iterator
+      cend() const noexcept
+      { return const_iterator(this->_M_data() + this->size()); }
+
+
+
+
+
+
+      const_reverse_iterator
+      crbegin() const noexcept
+      { return const_reverse_iterator(this->end()); }
+
+
+
+
+
+
+      const_reverse_iterator
+      crend() const noexcept
+      { return const_reverse_iterator(this->begin()); }
+
+
+    public:
+
+
+
+      size_type
+      size() const noexcept
+      { return _M_string_length; }
+
+
+
+      size_type
+      length() const noexcept
+      { return _M_string_length; }
+
+
+      size_type
+      max_size() const noexcept
+      { return (_Alloc_traits::max_size(_M_get_allocator()) - 1) / 2; }
+      void
+      resize(size_type __n, _CharT __c);
+      void
+      resize(size_type __n)
+      { this->resize(__n, _CharT()); }
+
+
+
+      void
+      shrink_to_fit() noexcept
+      {
+
+ if (capacity() > size())
+   {
+     try
+       { reserve(0); }
+     catch(...)
+       { }
+   }
+
+      }
+
+
+
+
+
+
+      size_type
+      capacity() const noexcept
+      {
+ return _M_is_local() ? size_type(_S_local_capacity)
+                      : _M_allocated_capacity;
+      }
+      void
+      reserve(size_type __res_arg = 0);
+
+
+
+
+      void
+      clear() noexcept
+      { _M_set_length(0); }
+
+
+
+
+
+      bool
+      empty() const noexcept
+      { return this->size() == 0; }
+      const_reference
+      operator[] (size_type __pos) const noexcept
+      {
+ ;
+ return _M_data()[__pos];
+      }
+      reference
+      operator[](size_type __pos)
+      {
+
+
+ ;
+
+ ;
+ return _M_data()[__pos];
+      }
+      const_reference
+      at(size_type __n) const
+      {
+ if (__n >= this->size())
+   __throw_out_of_range_fmt(("basic_string::at: __n " "(which is %zu) >= this->size() " "(which is %zu)")
+
+                            ,
+       __n, this->size());
+ return _M_data()[__n];
+      }
+      reference
+      at(size_type __n)
+      {
+ if (__n >= size())
+   __throw_out_of_range_fmt(("basic_string::at: __n " "(which is %zu) >= this->size() " "(which is %zu)")
+
+                            ,
+       __n, this->size());
+ return _M_data()[__n];
+      }
+
+
+
+
+
+
+      reference
+      front() noexcept
+      {
+ ;
+ return operator[](0);
+      }
+
+
+
+
+
+      const_reference
+      front() const noexcept
+      {
+ ;
+ return operator[](0);
+      }
+
+
+
+
+
+      reference
+      back() noexcept
+      {
+ ;
+ return operator[](this->size() - 1);
+      }
+
+
+
+
+
+      const_reference
+      back() const noexcept
+      {
+ ;
+ return operator[](this->size() - 1);
+      }
+      basic_string&
+      operator+=(const basic_string& __str)
+      { return this->append(__str); }
+
+
+
+
+
+
+      basic_string&
+      operator+=(const _CharT* __s)
+      { return this->append(__s); }
+
+
+
+
+
+
+      basic_string&
+      operator+=(_CharT __c)
+      {
+ this->push_back(__c);
+ return *this;
+      }
+
+
+
+
+
+
+
+      basic_string&
+      operator+=(initializer_list<_CharT> __l)
+      { return this->append(__l.begin(), __l.size()); }
+      basic_string&
+      append(const basic_string& __str)
+      { return _M_append(__str._M_data(), __str.size()); }
+      basic_string&
+      append(const basic_string& __str, size_type __pos, size_type __n = npos)
+      { return _M_append(__str._M_data()
+    + __str._M_check(__pos, "basic_string::append"),
+    __str._M_limit(__pos, __n)); }
+
+
+
+
+
+
+
+      basic_string&
+      append(const _CharT* __s, size_type __n)
+      {
+ ;
+ _M_check_length(size_type(0), __n, "basic_string::append");
+ return _M_append(__s, __n);
+      }
+
+
+
+
+
+
+      basic_string&
+      append(const _CharT* __s)
+      {
+ ;
+ const size_type __n = traits_type::length(__s);
+ _M_check_length(size_type(0), __n, "basic_string::append");
+ return _M_append(__s, __n);
+      }
+      basic_string&
+      append(size_type __n, _CharT __c)
+      { return _M_replace_aux(this->size(), size_type(0), __n, __c); }
+
+
+
+
+
+
+
+      basic_string&
+      append(initializer_list<_CharT> __l)
+      { return this->append(__l.begin(), __l.size()); }
+      template<class _InputIterator,
+        typename = std::_RequireInputIter<_InputIterator>>
+
+
+
+        basic_string&
+        append(_InputIterator __first, _InputIterator __last)
+        { return this->replace(end(), end(), __first, __last); }
+      void
+      push_back(_CharT __c)
+      {
+ const size_type __size = this->size();
+ if (__size + 1 > this->capacity())
+   this->_M_mutate(__size, size_type(0), 0, size_type(1));
+ traits_type::assign(this->_M_data()[__size], __c);
+ this->_M_set_length(__size + 1);
+      }
+
+
+
+
+
+
+      basic_string&
+      assign(const basic_string& __str)
+      {
+ this->_M_assign(__str);
+ return *this;
+      }
+      basic_string&
+      assign(basic_string&& __str)
+      noexcept(_Alloc_traits::_S_nothrow_move())
+      {
+
+
+ return *this = std::move(__str);
+      }
+      basic_string&
+      assign(const basic_string& __str, size_type __pos, size_type __n = npos)
+      { return _M_replace(size_type(0), this->size(), __str._M_data()
+     + __str._M_check(__pos, "basic_string::assign"),
+     __str._M_limit(__pos, __n)); }
+      basic_string&
+      assign(const _CharT* __s, size_type __n)
+      {
+ ;
+ return _M_replace(size_type(0), this->size(), __s, __n);
+      }
+      basic_string&
+      assign(const _CharT* __s)
+      {
+ ;
+ return _M_replace(size_type(0), this->size(), __s,
+     traits_type::length(__s));
+      }
+      basic_string&
+      assign(size_type __n, _CharT __c)
+      { return _M_replace_aux(size_type(0), this->size(), __n, __c); }
+      template<class _InputIterator,
+        typename = std::_RequireInputIter<_InputIterator>>
+
+
+
+        basic_string&
+        assign(_InputIterator __first, _InputIterator __last)
+        { return this->replace(begin(), end(), __first, __last); }
+
+
+
+
+
+
+
+      basic_string&
+      assign(initializer_list<_CharT> __l)
+      { return this->assign(__l.begin(), __l.size()); }
+      iterator
+      insert(const_iterator __p, size_type __n, _CharT __c)
+      {
+ ;
+ const size_type __pos = __p - begin();
+ this->replace(__p, __p, __n, __c);
+ return iterator(this->_M_data() + __pos);
+      }
+      template<class _InputIterator,
+        typename = std::_RequireInputIter<_InputIterator>>
+ iterator
+        insert(const_iterator __p, _InputIterator __beg, _InputIterator __end)
+        {
+   ;
+   const size_type __pos = __p - begin();
+   this->replace(__p, __p, __beg, __end);
+   return iterator(this->_M_data() + __pos);
+ }
+      iterator
+      insert(const_iterator __p, initializer_list<_CharT> __l)
+      { return this->insert(__p, __l.begin(), __l.end()); }
+      basic_string&
+      insert(size_type __pos1, const basic_string& __str)
+      { return this->replace(__pos1, size_type(0),
+        __str._M_data(), __str.size()); }
+      basic_string&
+      insert(size_type __pos1, const basic_string& __str,
+      size_type __pos2, size_type __n = npos)
+      { return this->replace(__pos1, size_type(0), __str._M_data()
+        + __str._M_check(__pos2, "basic_string::insert"),
+        __str._M_limit(__pos2, __n)); }
+      basic_string&
+      insert(size_type __pos, const _CharT* __s, size_type __n)
+      { return this->replace(__pos, size_type(0), __s, __n); }
+      basic_string&
+      insert(size_type __pos, const _CharT* __s)
+      {
+ ;
+ return this->replace(__pos, size_type(0), __s,
+        traits_type::length(__s));
+      }
+      basic_string&
+      insert(size_type __pos, size_type __n, _CharT __c)
+      { return _M_replace_aux(_M_check(__pos, "basic_string::insert"),
+         size_type(0), __n, __c); }
+      iterator
+      insert(__const_iterator __p, _CharT __c)
+      {
+ ;
+ const size_type __pos = __p - begin();
+ _M_replace_aux(__pos, size_type(0), size_type(1), __c);
+ return iterator(_M_data() + __pos);
+      }
+      basic_string&
+      erase(size_type __pos = 0, size_type __n = npos)
+      {
+ _M_check(__pos, "basic_string::erase");
+ if (__n == npos)
+   this->_M_set_length(__pos);
+ else if (__n != 0)
+   this->_M_erase(__pos, _M_limit(__pos, __n));
+ return *this;
+      }
+      iterator
+      erase(__const_iterator __position)
+      {
+
+                           ;
+ const size_type __pos = __position - begin();
+ this->_M_erase(__pos, size_type(1));
+ return iterator(_M_data() + __pos);
+      }
+      iterator
+      erase(__const_iterator __first, __const_iterator __last)
+      {
+
+                        ;
+        const size_type __pos = __first - begin();
+ if (__last == end())
+   this->_M_set_length(__pos);
+ else
+   this->_M_erase(__pos, __last - __first);
+ return iterator(this->_M_data() + __pos);
+      }
+
+
+
+
+
+
+
+      void
+      pop_back() noexcept
+      {
+ ;
+ _M_erase(size() - 1, 1);
+      }
+      basic_string&
+      replace(size_type __pos, size_type __n, const basic_string& __str)
+      { return this->replace(__pos, __n, __str._M_data(), __str.size()); }
+      basic_string&
+      replace(size_type __pos1, size_type __n1, const basic_string& __str,
+       size_type __pos2, size_type __n2 = npos)
+      { return this->replace(__pos1, __n1, __str._M_data()
+        + __str._M_check(__pos2, "basic_string::replace"),
+        __str._M_limit(__pos2, __n2)); }
+      basic_string&
+      replace(size_type __pos, size_type __n1, const _CharT* __s,
+       size_type __n2)
+      {
+ ;
+ return _M_replace(_M_check(__pos, "basic_string::replace"),
+     _M_limit(__pos, __n1), __s, __n2);
+      }
+      basic_string&
+      replace(size_type __pos, size_type __n1, const _CharT* __s)
+      {
+ ;
+ return this->replace(__pos, __n1, __s, traits_type::length(__s));
+      }
+      basic_string&
+      replace(size_type __pos, size_type __n1, size_type __n2, _CharT __c)
+      { return _M_replace_aux(_M_check(__pos, "basic_string::replace"),
+         _M_limit(__pos, __n1), __n2, __c); }
+      basic_string&
+      replace(__const_iterator __i1, __const_iterator __i2,
+       const basic_string& __str)
+      { return this->replace(__i1, __i2, __str._M_data(), __str.size()); }
+      basic_string&
+      replace(__const_iterator __i1, __const_iterator __i2,
+       const _CharT* __s, size_type __n)
+      {
+
+                      ;
+ return this->replace(__i1 - begin(), __i2 - __i1, __s, __n);
+      }
+      basic_string&
+      replace(__const_iterator __i1, __const_iterator __i2, const _CharT* __s)
+      {
+ ;
+ return this->replace(__i1, __i2, __s, traits_type::length(__s));
+      }
+      basic_string&
+      replace(__const_iterator __i1, __const_iterator __i2, size_type __n,
+       _CharT __c)
+      {
+
+                      ;
+ return _M_replace_aux(__i1 - begin(), __i2 - __i1, __n, __c);
+      }
+      template<class _InputIterator,
+        typename = std::_RequireInputIter<_InputIterator>>
+        basic_string&
+        replace(const_iterator __i1, const_iterator __i2,
+  _InputIterator __k1, _InputIterator __k2)
+        {
+  
+                        ;
+   ;
+   return this->_M_replace_dispatch(__i1, __i2, __k1, __k2,
+        std::__false_type());
+ }
+      basic_string&
+      replace(__const_iterator __i1, __const_iterator __i2,
+       _CharT* __k1, _CharT* __k2)
+      {
+
+                      ;
+ ;
+ return this->replace(__i1 - begin(), __i2 - __i1,
+        __k1, __k2 - __k1);
+      }
+
+      basic_string&
+      replace(__const_iterator __i1, __const_iterator __i2,
+       const _CharT* __k1, const _CharT* __k2)
+      {
+
+                      ;
+ ;
+ return this->replace(__i1 - begin(), __i2 - __i1,
+        __k1, __k2 - __k1);
+      }
+
+      basic_string&
+      replace(__const_iterator __i1, __const_iterator __i2,
+       iterator __k1, iterator __k2)
+      {
+
+                      ;
+ ;
+ return this->replace(__i1 - begin(), __i2 - __i1,
+        __k1.base(), __k2 - __k1);
+      }
+
+      basic_string&
+      replace(__const_iterator __i1, __const_iterator __i2,
+       const_iterator __k1, const_iterator __k2)
+      {
+
+                      ;
+ ;
+ return this->replace(__i1 - begin(), __i2 - __i1,
+        __k1.base(), __k2 - __k1);
+      }
+      basic_string& replace(const_iterator __i1, const_iterator __i2,
+       initializer_list<_CharT> __l)
+      { return this->replace(__i1, __i2, __l.begin(), __l.size()); }
+    private:
+      template<class _Integer>
+ basic_string&
+ _M_replace_dispatch(const_iterator __i1, const_iterator __i2,
+       _Integer __n, _Integer __val, __true_type)
+        { return _M_replace_aux(__i1 - begin(), __i2 - __i1, __n, __val); }
+
+      template<class _InputIterator>
+ basic_string&
+ _M_replace_dispatch(const_iterator __i1, const_iterator __i2,
+       _InputIterator __k1, _InputIterator __k2,
+       __false_type);
+
+      basic_string&
+      _M_replace_aux(size_type __pos1, size_type __n1, size_type __n2,
+       _CharT __c);
+
+      basic_string&
+      _M_replace(size_type __pos, size_type __len1, const _CharT* __s,
+   const size_type __len2);
+
+      basic_string&
+      _M_append(const _CharT* __s, size_type __n);
+
+    public:
+      size_type
+      copy(_CharT* __s, size_type __n, size_type __pos = 0) const;
+      void
+      swap(basic_string& __s) noexcept;
+      const _CharT*
+      c_str() const noexcept
+      { return _M_data(); }
+      const _CharT*
+      data() const noexcept
+      { return _M_data(); }
+      allocator_type
+      get_allocator() const noexcept
+      { return _M_get_allocator(); }
+      size_type
+      find(const _CharT* __s, size_type __pos, size_type __n) const
+      noexcept;
+      size_type
+      find(const basic_string& __str, size_type __pos = 0) const
+      noexcept
+      { return this->find(__str.data(), __pos, __str.size()); }
+      size_type
+      find(const _CharT* __s, size_type __pos = 0) const noexcept
+      {
+ ;
+ return this->find(__s, __pos, traits_type::length(__s));
+      }
+      size_type
+      find(_CharT __c, size_type __pos = 0) const noexcept;
+      size_type
+      rfind(const basic_string& __str, size_type __pos = npos) const
+      noexcept
+      { return this->rfind(__str.data(), __pos, __str.size()); }
+      size_type
+      rfind(const _CharT* __s, size_type __pos, size_type __n) const
+      noexcept;
+      size_type
+      rfind(const _CharT* __s, size_type __pos = npos) const
+      {
+ ;
+ return this->rfind(__s, __pos, traits_type::length(__s));
+      }
+      size_type
+      rfind(_CharT __c, size_type __pos = npos) const noexcept;
+      size_type
+      find_first_of(const basic_string& __str, size_type __pos = 0) const
+      noexcept
+      { return this->find_first_of(__str.data(), __pos, __str.size()); }
+      size_type
+      find_first_of(const _CharT* __s, size_type __pos, size_type __n) const
+      noexcept;
+      size_type
+      find_first_of(const _CharT* __s, size_type __pos = 0) const
+      noexcept
+      {
+ ;
+ return this->find_first_of(__s, __pos, traits_type::length(__s));
+      }
+      size_type
+      find_first_of(_CharT __c, size_type __pos = 0) const noexcept
+      { return this->find(__c, __pos); }
+      size_type
+      find_last_of(const basic_string& __str, size_type __pos = npos) const
+      noexcept
+      { return this->find_last_of(__str.data(), __pos, __str.size()); }
+      size_type
+      find_last_of(const _CharT* __s, size_type __pos, size_type __n) const
+      noexcept;
+      size_type
+      find_last_of(const _CharT* __s, size_type __pos = npos) const
+      noexcept
+      {
+ ;
+ return this->find_last_of(__s, __pos, traits_type::length(__s));
+      }
+      size_type
+      find_last_of(_CharT __c, size_type __pos = npos) const noexcept
+      { return this->rfind(__c, __pos); }
+      size_type
+      find_first_not_of(const basic_string& __str, size_type __pos = 0) const
+      noexcept
+      { return this->find_first_not_of(__str.data(), __pos, __str.size()); }
+      size_type
+      find_first_not_of(const _CharT* __s, size_type __pos,
+   size_type __n) const noexcept;
+      size_type
+      find_first_not_of(const _CharT* __s, size_type __pos = 0) const
+      noexcept
+      {
+ ;
+ return this->find_first_not_of(__s, __pos, traits_type::length(__s));
+      }
+      size_type
+      find_first_not_of(_CharT __c, size_type __pos = 0) const
+      noexcept;
+      size_type
+      find_last_not_of(const basic_string& __str, size_type __pos = npos) const
+      noexcept
+      { return this->find_last_not_of(__str.data(), __pos, __str.size()); }
+      size_type
+      find_last_not_of(const _CharT* __s, size_type __pos,
+         size_type __n) const noexcept;
+      size_type
+      find_last_not_of(const _CharT* __s, size_type __pos = npos) const
+      noexcept
+      {
+ ;
+ return this->find_last_not_of(__s, __pos, traits_type::length(__s));
+      }
+      size_type
+      find_last_not_of(_CharT __c, size_type __pos = npos) const
+      noexcept;
+      basic_string
+      substr(size_type __pos = 0, size_type __n = npos) const
+      { return basic_string(*this,
+       _M_check(__pos, "basic_string::substr"), __n); }
+      int
+      compare(const basic_string& __str) const
+      {
+ const size_type __size = this->size();
+ const size_type __osize = __str.size();
+ const size_type __len = std::min(__size, __osize);
+
+ int __r = traits_type::compare(_M_data(), __str.data(), __len);
+ if (!__r)
+   __r = _S_compare(__size, __osize);
+ return __r;
+      }
+      int
+      compare(size_type __pos, size_type __n, const basic_string& __str) const;
+      int
+      compare(size_type __pos1, size_type __n1, const basic_string& __str,
+       size_type __pos2, size_type __n2 = npos) const;
+      int
+      compare(const _CharT* __s) const noexcept;
+      int
+      compare(size_type __pos, size_type __n1, const _CharT* __s) const;
+      int
+      compare(size_type __pos, size_type __n1, const _CharT* __s,
+       size_type __n2) const;
+
+
+      template<typename, typename, typename> friend class basic_stringbuf;
+    };
+}
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_string<_CharT, _Traits, _Alloc>
+    operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+       const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+    {
+      basic_string<_CharT, _Traits, _Alloc> __str(__lhs);
+      __str.append(__rhs);
+      return __str;
+    }
+
+
+
+
+
+
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_string<_CharT,_Traits,_Alloc>
+    operator+(const _CharT* __lhs,
+       const basic_string<_CharT,_Traits,_Alloc>& __rhs);
+
+
+
+
+
+
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_string<_CharT,_Traits,_Alloc>
+    operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs);
+
+
+
+
+
+
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline basic_string<_CharT, _Traits, _Alloc>
+    operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+       const _CharT* __rhs)
+    {
+      basic_string<_CharT, _Traits, _Alloc> __str(__lhs);
+      __str.append(__rhs);
+      return __str;
+    }
+
+
+
+
+
+
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline basic_string<_CharT, _Traits, _Alloc>
+    operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs)
+    {
+      typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
+      typedef typename __string_type::size_type __size_type;
+      __string_type __str(__lhs);
+      __str.append(__size_type(1), __rhs);
+      return __str;
+    }
+
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline basic_string<_CharT, _Traits, _Alloc>
+    operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
+       const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+    { return std::move(__lhs.append(__rhs)); }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline basic_string<_CharT, _Traits, _Alloc>
+    operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+       basic_string<_CharT, _Traits, _Alloc>&& __rhs)
+    { return std::move(__rhs.insert(0, __lhs)); }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline basic_string<_CharT, _Traits, _Alloc>
+    operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
+       basic_string<_CharT, _Traits, _Alloc>&& __rhs)
+    {
+      const auto __size = __lhs.size() + __rhs.size();
+      const bool __cond = (__size > __lhs.capacity()
+      && __size <= __rhs.capacity());
+      return __cond ? std::move(__rhs.insert(0, __lhs))
+             : std::move(__lhs.append(__rhs));
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline basic_string<_CharT, _Traits, _Alloc>
+    operator+(const _CharT* __lhs,
+       basic_string<_CharT, _Traits, _Alloc>&& __rhs)
+    { return std::move(__rhs.insert(0, __lhs)); }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline basic_string<_CharT, _Traits, _Alloc>
+    operator+(_CharT __lhs,
+       basic_string<_CharT, _Traits, _Alloc>&& __rhs)
+    { return std::move(__rhs.insert(0, 1, __lhs)); }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline basic_string<_CharT, _Traits, _Alloc>
+    operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
+       const _CharT* __rhs)
+    { return std::move(__lhs.append(__rhs)); }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline basic_string<_CharT, _Traits, _Alloc>
+    operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
+       _CharT __rhs)
+    { return std::move(__lhs.append(1, __rhs)); }
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+        const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+    noexcept
+    { return __lhs.compare(__rhs) == 0; }
+
+  template<typename _CharT>
+    inline
+    typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value, bool>::__type
+    operator==(const basic_string<_CharT>& __lhs,
+        const basic_string<_CharT>& __rhs) noexcept
+    { return (__lhs.size() == __rhs.size()
+       && !std::char_traits<_CharT>::compare(__lhs.data(), __rhs.data(),
+          __lhs.size())); }
+
+
+
+
+
+
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator==(const _CharT* __lhs,
+        const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+    { return __rhs.compare(__lhs) == 0; }
+
+
+
+
+
+
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+        const _CharT* __rhs)
+    { return __lhs.compare(__rhs) == 0; }
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+        const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+    noexcept
+    { return !(__lhs == __rhs); }
+
+
+
+
+
+
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator!=(const _CharT* __lhs,
+        const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+    { return !(__lhs == __rhs); }
+
+
+
+
+
+
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+        const _CharT* __rhs)
+    { return !(__lhs == __rhs); }
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+       const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+    noexcept
+    { return __lhs.compare(__rhs) < 0; }
+
+
+
+
+
+
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+       const _CharT* __rhs)
+    { return __lhs.compare(__rhs) < 0; }
+
+
+
+
+
+
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator<(const _CharT* __lhs,
+       const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+    { return __rhs.compare(__lhs) > 0; }
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+       const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+    noexcept
+    { return __lhs.compare(__rhs) > 0; }
+
+
+
+
+
+
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+       const _CharT* __rhs)
+    { return __lhs.compare(__rhs) > 0; }
+
+
+
+
+
+
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator>(const _CharT* __lhs,
+       const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+    { return __rhs.compare(__lhs) < 0; }
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator<=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+        const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+    noexcept
+    { return __lhs.compare(__rhs) <= 0; }
+
+
+
+
+
+
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator<=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+        const _CharT* __rhs)
+    { return __lhs.compare(__rhs) <= 0; }
+
+
+
+
+
+
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator<=(const _CharT* __lhs,
+        const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+    { return __rhs.compare(__lhs) >= 0; }
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator>=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+        const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+    noexcept
+    { return __lhs.compare(__rhs) >= 0; }
+
+
+
+
+
+
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator>=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
+        const _CharT* __rhs)
+    { return __lhs.compare(__rhs) >= 0; }
+
+
+
+
+
+
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline bool
+    operator>=(const _CharT* __lhs,
+      const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+    { return __rhs.compare(__lhs) <= 0; }
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline void
+    swap(basic_string<_CharT, _Traits, _Alloc>& __lhs,
+  basic_string<_CharT, _Traits, _Alloc>& __rhs)
+    noexcept(noexcept(__lhs.swap(__rhs)))
+    { __lhs.swap(__rhs); }
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_istream<_CharT, _Traits>&
+    operator>>(basic_istream<_CharT, _Traits>& __is,
+        basic_string<_CharT, _Traits, _Alloc>& __str);
+
+  template<>
+    basic_istream<char>&
+    operator>>(basic_istream<char>& __is, basic_string<char>& __str);
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline basic_ostream<_CharT, _Traits>&
+    operator<<(basic_ostream<_CharT, _Traits>& __os,
+        const basic_string<_CharT, _Traits, _Alloc>& __str)
+    {
+
+
+      return __ostream_insert(__os, __str.data(), __str.size());
+    }
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_istream<_CharT, _Traits>&
+    getline(basic_istream<_CharT, _Traits>& __is,
+     basic_string<_CharT, _Traits, _Alloc>& __str, _CharT __delim);
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline basic_istream<_CharT, _Traits>&
+    getline(basic_istream<_CharT, _Traits>& __is,
+     basic_string<_CharT, _Traits, _Alloc>& __str)
+    { return std::getline(__is, __str, __is.widen('\n')); }
+
+
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline basic_istream<_CharT, _Traits>&
+    getline(basic_istream<_CharT, _Traits>&& __is,
+     basic_string<_CharT, _Traits, _Alloc>& __str, _CharT __delim)
+    { return std::getline(__is, __str, __delim); }
+
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    inline basic_istream<_CharT, _Traits>&
+    getline(basic_istream<_CharT, _Traits>&& __is,
+     basic_string<_CharT, _Traits, _Alloc>& __str)
+    { return std::getline(__is, __str); }
+
+
+  template<>
+    basic_istream<char>&
+    getline(basic_istream<char>& __in, basic_string<char>& __str,
+     char __delim);
+
+
+  template<>
+    basic_istream<wchar_t>&
+    getline(basic_istream<wchar_t>& __in, basic_string<wchar_t>& __str,
+     wchar_t __delim);
+
+
+
+}
+
+
+
+       
+       
+
+extern "C" {
+
+
+
+
+
+
+union wait
+  {
+    int w_status;
+    struct
+      {
+
+ unsigned int __w_termsig:7;
+ unsigned int __w_coredump:1;
+ unsigned int __w_retcode:8;
+ unsigned int:16;
+
+
+
+
+
+
+
+      } __wait_terminated;
+    struct
+      {
+
+ unsigned int __w_stopval:8;
+ unsigned int __w_stopsig:8;
+ unsigned int:16;
+
+
+
+
+
+
+      } __wait_stopped;
+  };
+
+
+typedef struct
+  {
+    int quot;
+    int rem;
+  } div_t;
+
+
+
+typedef struct
+  {
+    long int quot;
+    long int rem;
+  } ldiv_t;
+
+
+
+
+
+
+
+__extension__ typedef struct
+  {
+    long long int quot;
+    long long int rem;
+  } lldiv_t;
+
+
+extern size_t __ctype_get_mb_cur_max (void) throw () ;
+
+
+
+
+extern double atof (const char *__nptr)
+     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
+
+extern int atoi (const char *__nptr)
+     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
+
+extern long int atol (const char *__nptr)
+     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
+
+
+
+
+
+__extension__ extern long long int atoll (const char *__nptr)
+     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
+
+
+
+
+
+extern double strtod (const char *__restrict __nptr,
+        char **__restrict __endptr)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+
+
+extern float strtof (const char *__restrict __nptr,
+       char **__restrict __endptr) throw () __attribute__ ((__nonnull__ (1)));
+
+extern long double strtold (const char *__restrict __nptr,
+       char **__restrict __endptr)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+
+
+extern long int strtol (const char *__restrict __nptr,
+   char **__restrict __endptr, int __base)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+extern unsigned long int strtoul (const char *__restrict __nptr,
+      char **__restrict __endptr, int __base)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+
+__extension__
+extern long long int strtoq (const char *__restrict __nptr,
+        char **__restrict __endptr, int __base)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+__extension__
+extern unsigned long long int strtouq (const char *__restrict __nptr,
+           char **__restrict __endptr, int __base)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+
+
+__extension__
+extern long long int strtoll (const char *__restrict __nptr,
+         char **__restrict __endptr, int __base)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+__extension__
+extern unsigned long long int strtoull (const char *__restrict __nptr,
+     char **__restrict __endptr, int __base)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+extern long int strtol_l (const char *__restrict __nptr,
+     char **__restrict __endptr, int __base,
+     __locale_t __loc) throw () __attribute__ ((__nonnull__ (1, 4)));
+
+extern unsigned long int strtoul_l (const char *__restrict __nptr,
+        char **__restrict __endptr,
+        int __base, __locale_t __loc)
+     throw () __attribute__ ((__nonnull__ (1, 4)));
+
+__extension__
+extern long long int strtoll_l (const char *__restrict __nptr,
+    char **__restrict __endptr, int __base,
+    __locale_t __loc)
+     throw () __attribute__ ((__nonnull__ (1, 4)));
+
+__extension__
+extern unsigned long long int strtoull_l (const char *__restrict __nptr,
+       char **__restrict __endptr,
+       int __base, __locale_t __loc)
+     throw () __attribute__ ((__nonnull__ (1, 4)));
+
+extern double strtod_l (const char *__restrict __nptr,
+   char **__restrict __endptr, __locale_t __loc)
+     throw () __attribute__ ((__nonnull__ (1, 3)));
+
+extern float strtof_l (const char *__restrict __nptr,
+         char **__restrict __endptr, __locale_t __loc)
+     throw () __attribute__ ((__nonnull__ (1, 3)));
+
+extern long double strtold_l (const char *__restrict __nptr,
+         char **__restrict __endptr,
+         __locale_t __loc)
+     throw () __attribute__ ((__nonnull__ (1, 3)));
+
+
+
+
+
+extern __inline __attribute__ ((__gnu_inline__)) int
+__attribute__ ((__leaf__)) atoi (const char *__nptr) throw ()
+{
+  return (int) strtol (__nptr, (char **) __null, 10);
+}
+extern __inline __attribute__ ((__gnu_inline__)) long int
+__attribute__ ((__leaf__)) atol (const char *__nptr) throw ()
+{
+  return strtol (__nptr, (char **) __null, 10);
+}
+
+
+
+
+__extension__ extern __inline __attribute__ ((__gnu_inline__)) long long int
+__attribute__ ((__leaf__)) atoll (const char *__nptr) throw ()
+{
+  return strtoll (__nptr, (char **) __null, 10);
+}
+
+extern char *l64a (long int __n) throw () ;
+
+
+extern long int a64l (const char *__s)
+     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
+
+
+
+
+extern "C" {
+
+
+
+
+
+typedef __u_char u_char;
+typedef __u_short u_short;
+typedef __u_int u_int;
+typedef __u_long u_long;
+typedef __quad_t quad_t;
+typedef __u_quad_t u_quad_t;
+typedef __fsid_t fsid_t;
+
+
+
+
+typedef __loff_t loff_t;
+
+
+
+typedef __ino_t ino_t;
+
+
+
+
+
+
+typedef __ino64_t ino64_t;
+
+
+
+
+typedef __dev_t dev_t;
+
+
+
+
+typedef __gid_t gid_t;
+
+
+
+
+typedef __mode_t mode_t;
+
+
+
+
+typedef __nlink_t nlink_t;
+
+
+
+
+typedef __uid_t uid_t;
+
+
+
+
+
+typedef __off_t off_t;
+
+
+
+
+
+
+typedef __off64_t off64_t;
+typedef __id_t id_t;
+
+
+
+
+typedef __ssize_t ssize_t;
+
+
+
+
+
+typedef __daddr_t daddr_t;
+typedef __caddr_t caddr_t;
+
+
+
+
+
+typedef __key_t key_t;
+typedef __useconds_t useconds_t;
+
+
+
+typedef __suseconds_t suseconds_t;
+
+
+
+
+
+
+
+
+typedef unsigned long int ulong;
+typedef unsigned short int ushort;
+typedef unsigned int uint;
+typedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__)));
+typedef unsigned int u_int16_t __attribute__ ((__mode__ (__HI__)));
+typedef unsigned int u_int32_t __attribute__ ((__mode__ (__SI__)));
+typedef unsigned int u_int64_t __attribute__ ((__mode__ (__DI__)));
+
+typedef int register_t __attribute__ ((__mode__ (__word__)));
+
+
+typedef int __sig_atomic_t;
+
+
+
+
+typedef struct
+  {
+    unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
+  } __sigset_t;
+
+
+
+typedef __sigset_t sigset_t;
+
+
+
+
+
+
+
+typedef long int __fd_mask;
+typedef struct
+  {
+
+
+
+    __fd_mask fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];
+
+
+
+
+
+  } fd_set;
+
+
+
+
+
+
+typedef __fd_mask fd_mask;
+extern "C" {
+extern int select (int __nfds, fd_set *__restrict __readfds,
+     fd_set *__restrict __writefds,
+     fd_set *__restrict __exceptfds,
+     struct timeval *__restrict __timeout);
+extern int pselect (int __nfds, fd_set *__restrict __readfds,
+      fd_set *__restrict __writefds,
+      fd_set *__restrict __exceptfds,
+      const struct timespec *__restrict __timeout,
+      const __sigset_t *__restrict __sigmask);
+}
+
+
+extern "C" {
+
+__extension__
+extern unsigned int gnu_dev_major (unsigned long long int __dev)
+     throw () __attribute__ ((__const__));
+__extension__
+extern unsigned int gnu_dev_minor (unsigned long long int __dev)
+     throw () __attribute__ ((__const__));
+__extension__
+extern unsigned long long int gnu_dev_makedev (unsigned int __major,
+            unsigned int __minor)
+     throw () __attribute__ ((__const__));
+
+
+__extension__ extern __inline __attribute__ ((__gnu_inline__)) __attribute__ ((__const__)) unsigned int
+__attribute__ ((__leaf__)) gnu_dev_major (unsigned long long int __dev) throw ()
+{
+  return ((__dev >> 8) & 0xfff) | ((unsigned int) (__dev >> 32) & ~0xfff);
+}
+
+__extension__ extern __inline __attribute__ ((__gnu_inline__)) __attribute__ ((__const__)) unsigned int
+__attribute__ ((__leaf__)) gnu_dev_minor (unsigned long long int __dev) throw ()
+{
+  return (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff);
+}
+
+__extension__ extern __inline __attribute__ ((__gnu_inline__)) __attribute__ ((__const__)) unsigned long long int
+__attribute__ ((__leaf__)) gnu_dev_makedev (unsigned int __major, unsigned int __minor) throw ()
+{
+  return ((__minor & 0xff) | ((__major & 0xfff) << 8)
+   | (((unsigned long long int) (__minor & ~0xff)) << 12)
+   | (((unsigned long long int) (__major & ~0xfff)) << 32));
+}
+
+}
+
+
+
+
+
+typedef __blksize_t blksize_t;
+
+
+
+
+
+
+typedef __blkcnt_t blkcnt_t;
+
+
+
+typedef __fsblkcnt_t fsblkcnt_t;
+
+
+
+typedef __fsfilcnt_t fsfilcnt_t;
+typedef __blkcnt64_t blkcnt64_t;
+typedef __fsblkcnt64_t fsblkcnt64_t;
+typedef __fsfilcnt64_t fsfilcnt64_t;
+}
+
+
+
+
+
+
+extern long int random (void) throw ();
+
+
+extern void srandom (unsigned int __seed) throw ();
+
+
+
+
+
+extern char *initstate (unsigned int __seed, char *__statebuf,
+   size_t __statelen) throw () __attribute__ ((__nonnull__ (2)));
+
+
+
+extern char *setstate (char *__statebuf) throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+
+
+
+
+struct random_data
+  {
+    int32_t *fptr;
+    int32_t *rptr;
+    int32_t *state;
+    int rand_type;
+    int rand_deg;
+    int rand_sep;
+    int32_t *end_ptr;
+  };
+
+extern int random_r (struct random_data *__restrict __buf,
+       int32_t *__restrict __result) throw () __attribute__ ((__nonnull__ (1, 2)));
+
+extern int srandom_r (unsigned int __seed, struct random_data *__buf)
+     throw () __attribute__ ((__nonnull__ (2)));
+
+extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
+   size_t __statelen,
+   struct random_data *__restrict __buf)
+     throw () __attribute__ ((__nonnull__ (2, 4)));
+
+extern int setstate_r (char *__restrict __statebuf,
+         struct random_data *__restrict __buf)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+
+
+
+
+extern int rand (void) throw ();
+
+extern void srand (unsigned int __seed) throw ();
+
+
+
+
+extern int rand_r (unsigned int *__seed) throw ();
+
+
+
+
+
+
+
+extern double drand48 (void) throw ();
+extern double erand48 (unsigned short int __xsubi[3]) throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern long int lrand48 (void) throw ();
+extern long int nrand48 (unsigned short int __xsubi[3])
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern long int mrand48 (void) throw ();
+extern long int jrand48 (unsigned short int __xsubi[3])
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern void srand48 (long int __seedval) throw ();
+extern unsigned short int *seed48 (unsigned short int __seed16v[3])
+     throw () __attribute__ ((__nonnull__ (1)));
+extern void lcong48 (unsigned short int __param[7]) throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+
+
+struct drand48_data
+  {
+    unsigned short int __x[3];
+    unsigned short int __old_x[3];
+    unsigned short int __c;
+    unsigned short int __init;
+    __extension__ unsigned long long int __a;
+
+  };
+
+
+extern int drand48_r (struct drand48_data *__restrict __buffer,
+        double *__restrict __result) throw () __attribute__ ((__nonnull__ (1, 2)));
+extern int erand48_r (unsigned short int __xsubi[3],
+        struct drand48_data *__restrict __buffer,
+        double *__restrict __result) throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern int lrand48_r (struct drand48_data *__restrict __buffer,
+        long int *__restrict __result)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+extern int nrand48_r (unsigned short int __xsubi[3],
+        struct drand48_data *__restrict __buffer,
+        long int *__restrict __result)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern int mrand48_r (struct drand48_data *__restrict __buffer,
+        long int *__restrict __result)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+extern int jrand48_r (unsigned short int __xsubi[3],
+        struct drand48_data *__restrict __buffer,
+        long int *__restrict __result)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
+     throw () __attribute__ ((__nonnull__ (2)));
+
+extern int seed48_r (unsigned short int __seed16v[3],
+       struct drand48_data *__buffer) throw () __attribute__ ((__nonnull__ (1, 2)));
+
+extern int lcong48_r (unsigned short int __param[7],
+        struct drand48_data *__buffer)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+
+
+
+
+
+
+
+extern void *malloc (size_t __size) throw () __attribute__ ((__malloc__)) ;
+
+extern void *calloc (size_t __nmemb, size_t __size)
+     throw () __attribute__ ((__malloc__)) ;
+
+
+
+
+
+
+
+
+
+
+extern void *realloc (void *__ptr, size_t __size)
+     throw () __attribute__ ((__warn_unused_result__));
+
+extern void free (void *__ptr) throw ();
+
+
+
+
+extern void cfree (void *__ptr) throw ();
+
+
+
+
+extern "C" {
+
+
+
+
+
+extern void *alloca (size_t __size) throw ();
+
+
+
+
+
+}
+
+
+
+
+
+extern void *valloc (size_t __size) throw () __attribute__ ((__malloc__)) ;
+
+
+
+
+extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
+     throw () __attribute__ ((__nonnull__ (1))) ;
+
+
+
+
+extern void *aligned_alloc (size_t __alignment, size_t __size)
+     throw () __attribute__ ((__malloc__)) __attribute__ ((__alloc_size__ (2))) ;
+
+
+
+
+extern void abort (void) throw () __attribute__ ((__noreturn__));
+
+
+
+extern int atexit (void (*__func) (void)) throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+
+extern "C++" int at_quick_exit (void (*__func) (void))
+     throw () __asm ("at_quick_exit") __attribute__ ((__nonnull__ (1)));
+
+
+
+
+
+
+
+
+
+extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+
+
+
+extern void exit (int __status) throw () __attribute__ ((__noreturn__));
+
+
+
+
+
+extern void quick_exit (int __status) throw () __attribute__ ((__noreturn__));
+
+
+
+
+
+
+
+extern void _Exit (int __status) throw () __attribute__ ((__noreturn__));
+
+
+
+
+
+
+extern char *getenv (const char *__name) throw () __attribute__ ((__nonnull__ (1))) ;
+
+
+
+
+
+extern char *secure_getenv (const char *__name)
+     throw () __attribute__ ((__nonnull__ (1))) ;
+
+
+
+
+
+
+extern int putenv (char *__string) throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+
+
+extern int setenv (const char *__name, const char *__value, int __replace)
+     throw () __attribute__ ((__nonnull__ (2)));
+
+
+extern int unsetenv (const char *__name) throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+
+
+
+extern int clearenv (void) throw ();
+extern char *mktemp (char *__template) throw () __attribute__ ((__nonnull__ (1)));
+extern int mkstemp (char *__template) __attribute__ ((__nonnull__ (1))) ;
+extern int mkstemp64 (char *__template) __attribute__ ((__nonnull__ (1))) ;
+extern int mkstemps (char *__template, int __suffixlen) __attribute__ ((__nonnull__ (1))) ;
+extern int mkstemps64 (char *__template, int __suffixlen)
+     __attribute__ ((__nonnull__ (1))) ;
+extern char *mkdtemp (char *__template) throw () __attribute__ ((__nonnull__ (1))) ;
+extern int mkostemp (char *__template, int __flags) __attribute__ ((__nonnull__ (1))) ;
+extern int mkostemp64 (char *__template, int __flags) __attribute__ ((__nonnull__ (1))) ;
+extern int mkostemps (char *__template, int __suffixlen, int __flags)
+     __attribute__ ((__nonnull__ (1))) ;
+extern int mkostemps64 (char *__template, int __suffixlen, int __flags)
+     __attribute__ ((__nonnull__ (1))) ;
+
+
+
+
+
+
+
+
+
+extern int system (const char *__command) ;
+
+
+
+
+
+
+extern char *canonicalize_file_name (const char *__name)
+     throw () __attribute__ ((__nonnull__ (1))) ;
+extern char *realpath (const char *__restrict __name,
+         char *__restrict __resolved) throw () ;
+
+
+
+
+
+
+typedef int (*__compar_fn_t) (const void *, const void *);
+
+
+typedef __compar_fn_t comparison_fn_t;
+
+
+
+typedef int (*__compar_d_fn_t) (const void *, const void *, void *);
+
+
+
+
+
+extern void *bsearch (const void *__key, const void *__base,
+        size_t __nmemb, size_t __size, __compar_fn_t __compar)
+     __attribute__ ((__nonnull__ (1, 2, 5))) ;
+
+
+extern __inline __attribute__ ((__gnu_inline__)) void *
+bsearch (const void *__key, const void *__base, size_t __nmemb, size_t __size,
+  __compar_fn_t __compar)
+{
+  size_t __l, __u, __idx;
+  const void *__p;
+  int __comparison;
+
+  __l = 0;
+  __u = __nmemb;
+  while (__l < __u)
+    {
+      __idx = (__l + __u) / 2;
+      __p = (void *) (((const char *) __base) + (__idx * __size));
+      __comparison = (*__compar) (__key, __p);
+      if (__comparison < 0)
+ __u = __idx;
+      else if (__comparison > 0)
+ __l = __idx + 1;
+      else
+ return (void *) __p;
+    }
+
+  return __null;
+}
+
+
+
+
+extern void qsort (void *__base, size_t __nmemb, size_t __size,
+     __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));
+
+extern void qsort_r (void *__base, size_t __nmemb, size_t __size,
+       __compar_d_fn_t __compar, void *__arg)
+  __attribute__ ((__nonnull__ (1, 4)));
+
+
+
+
+extern int abs (int __x) throw () __attribute__ ((__const__)) ;
+extern long int labs (long int __x) throw () __attribute__ ((__const__)) ;
+
+
+
+__extension__ extern long long int llabs (long long int __x)
+     throw () __attribute__ ((__const__)) ;
+
+
+
+
+
+
+
+extern div_t div (int __numer, int __denom)
+     throw () __attribute__ ((__const__)) ;
+extern ldiv_t ldiv (long int __numer, long int __denom)
+     throw () __attribute__ ((__const__)) ;
+
+
+
+
+__extension__ extern lldiv_t lldiv (long long int __numer,
+        long long int __denom)
+     throw () __attribute__ ((__const__)) ;
+
+extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
+     int *__restrict __sign) throw () __attribute__ ((__nonnull__ (3, 4))) ;
+
+
+
+
+extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
+     int *__restrict __sign) throw () __attribute__ ((__nonnull__ (3, 4))) ;
+
+
+
+
+extern char *gcvt (double __value, int __ndigit, char *__buf)
+     throw () __attribute__ ((__nonnull__ (3))) ;
+
+
+
+
+extern char *qecvt (long double __value, int __ndigit,
+      int *__restrict __decpt, int *__restrict __sign)
+     throw () __attribute__ ((__nonnull__ (3, 4))) ;
+extern char *qfcvt (long double __value, int __ndigit,
+      int *__restrict __decpt, int *__restrict __sign)
+     throw () __attribute__ ((__nonnull__ (3, 4))) ;
+extern char *qgcvt (long double __value, int __ndigit, char *__buf)
+     throw () __attribute__ ((__nonnull__ (3))) ;
+
+
+
+
+extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
+     int *__restrict __sign, char *__restrict __buf,
+     size_t __len) throw () __attribute__ ((__nonnull__ (3, 4, 5)));
+extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
+     int *__restrict __sign, char *__restrict __buf,
+     size_t __len) throw () __attribute__ ((__nonnull__ (3, 4, 5)));
+
+extern int qecvt_r (long double __value, int __ndigit,
+      int *__restrict __decpt, int *__restrict __sign,
+      char *__restrict __buf, size_t __len)
+     throw () __attribute__ ((__nonnull__ (3, 4, 5)));
+extern int qfcvt_r (long double __value, int __ndigit,
+      int *__restrict __decpt, int *__restrict __sign,
+      char *__restrict __buf, size_t __len)
+     throw () __attribute__ ((__nonnull__ (3, 4, 5)));
+
+
+
+
+
+
+extern int mblen (const char *__s, size_t __n) throw ();
+
+
+extern int mbtowc (wchar_t *__restrict __pwc,
+     const char *__restrict __s, size_t __n) throw ();
+
+
+extern int wctomb (char *__s, wchar_t __wchar) throw ();
+
+
+
+extern size_t mbstowcs (wchar_t *__restrict __pwcs,
+   const char *__restrict __s, size_t __n) throw ();
+
+extern size_t wcstombs (char *__restrict __s,
+   const wchar_t *__restrict __pwcs, size_t __n)
+     throw ();
+
+
+
+
+
+
+
+
+extern int rpmatch (const char *__response) throw () __attribute__ ((__nonnull__ (1))) ;
+extern int getsubopt (char **__restrict __optionp,
+        char *const *__restrict __tokens,
+        char **__restrict __valuep)
+     throw () __attribute__ ((__nonnull__ (1, 2, 3))) ;
+
+
+
+
+
+extern void setkey (const char *__key) throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+
+
+
+
+extern int posix_openpt (int __oflag) ;
+
+
+
+
+
+
+
+extern int grantpt (int __fd) throw ();
+
+
+
+extern int unlockpt (int __fd) throw ();
+
+
+
+
+extern char *ptsname (int __fd) throw () ;
+
+
+
+
+
+
+extern int ptsname_r (int __fd, char *__buf, size_t __buflen)
+     throw () __attribute__ ((__nonnull__ (2)));
+
+
+extern int getpt (void);
+
+
+
+
+
+
+extern int getloadavg (double __loadavg[], int __nelem)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+extern __inline __attribute__ ((__gnu_inline__)) double
+__attribute__ ((__leaf__)) atof (const char *__nptr) throw ()
+{
+  return strtod (__nptr, (char **) __null);
+}
+
+}
+
+       
+extern "C++"
+{
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+  using ::abs;
+
+
+  inline long
+  abs(long __i) { return __builtin_labs(__i); }
+
+
+
+  inline long long
+  abs(long long __x) { return __builtin_llabs (__x); }
+
+
+
+
+
+
+
+  inline constexpr double
+  abs(double __x)
+  { return __builtin_fabs(__x); }
+
+  inline constexpr float
+  abs(float __x)
+  { return __builtin_fabsf(__x); }
+
+  inline constexpr long double
+  abs(long double __x)
+  { return __builtin_fabsl(__x); }
+
+
+
+  inline constexpr __int128
+  abs(__int128 __x) { return __x >= 0 ? __x : -__x; }
+  inline constexpr
+  __float128
+  abs(__float128 __x)
+  { return __x < 0 ? -__x : __x; }
+
+
+
+}
+}
+extern "C++"
+{
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+  using ::div_t;
+  using ::ldiv_t;
+
+  using ::abort;
+
+
+
+  using ::atexit;
+
+
+  using ::at_quick_exit;
+
+
+  using ::atof;
+  using ::atoi;
+  using ::atol;
+  using ::bsearch;
+  using ::calloc;
+  using ::div;
+  using ::exit;
+  using ::free;
+  using ::getenv;
+  using ::labs;
+  using ::ldiv;
+  using ::malloc;
+
+  using ::mblen;
+  using ::mbstowcs;
+  using ::mbtowc;
+
+  using ::qsort;
+
+
+  using ::quick_exit;
+
+
+  using ::rand;
+  using ::realloc;
+  using ::srand;
+  using ::strtod;
+  using ::strtol;
+  using ::strtoul;
+  using ::system;
+
+  using ::wcstombs;
+  using ::wctomb;
+
+
+
+  inline ldiv_t
+  div(long __i, long __j) { return ldiv(__i, __j); }
+
+
+
+
+}
+namespace __gnu_cxx __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+  using ::lldiv_t;
+
+
+
+
+
+  using ::_Exit;
+
+
+
+  using ::llabs;
+
+  inline lldiv_t
+  div(long long __n, long long __d)
+  { lldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; }
+
+  using ::lldiv;
+  using ::atoll;
+  using ::strtoll;
+  using ::strtoull;
+
+  using ::strtof;
+  using ::strtold;
+
+
+}
+
+namespace std
+{
+
+  using ::__gnu_cxx::lldiv_t;
+
+  using ::__gnu_cxx::_Exit;
+
+  using ::__gnu_cxx::llabs;
+  using ::__gnu_cxx::div;
+  using ::__gnu_cxx::lldiv;
+
+  using ::__gnu_cxx::atoll;
+  using ::__gnu_cxx::strtof;
+  using ::__gnu_cxx::strtoll;
+  using ::__gnu_cxx::strtoull;
+  using ::__gnu_cxx::strtold;
+}
+
+
+
+}
+       
+
+
+
+
+       
+
+
+extern "C" {
+
+
+
+
+
+
+
+typedef struct
+{
+  __off_t __pos;
+  __mbstate_t __state;
+} _G_fpos_t;
+typedef struct
+{
+  __off64_t __pos;
+  __mbstate_t __state;
+} _G_fpos64_t;
+struct _IO_jump_t; struct _IO_FILE;
+typedef void _IO_lock_t;
+
+
+
+
+
+struct _IO_marker {
+  struct _IO_marker *_next;
+  struct _IO_FILE *_sbuf;
+
+
+
+  int _pos;
+};
+
+
+enum __codecvt_result
+{
+  __codecvt_ok,
+  __codecvt_partial,
+  __codecvt_error,
+  __codecvt_noconv
+};
+struct _IO_FILE {
+  int _flags;
+
+
+
+
+  char* _IO_read_ptr;
+  char* _IO_read_end;
+  char* _IO_read_base;
+  char* _IO_write_base;
+  char* _IO_write_ptr;
+  char* _IO_write_end;
+  char* _IO_buf_base;
+  char* _IO_buf_end;
+
+  char *_IO_save_base;
+  char *_IO_backup_base;
+  char *_IO_save_end;
+
+  struct _IO_marker *_markers;
+
+  struct _IO_FILE *_chain;
+
+  int _fileno;
+
+
+
+  int _flags2;
+
+  __off_t _old_offset;
+
+
+
+  unsigned short _cur_column;
+  signed char _vtable_offset;
+  char _shortbuf[1];
+
+
+
+  _IO_lock_t *_lock;
+  __off64_t _offset;
+  void *__pad1;
+  void *__pad2;
+  void *__pad3;
+  void *__pad4;
+  size_t __pad5;
+
+  int _mode;
+
+  char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
+
+};
+
+
+
+
+
+struct _IO_FILE_plus;
+
+extern struct _IO_FILE_plus _IO_2_1_stdin_;
+extern struct _IO_FILE_plus _IO_2_1_stdout_;
+extern struct _IO_FILE_plus _IO_2_1_stderr_;
+typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes);
+
+
+
+
+
+
+
+typedef __ssize_t __io_write_fn (void *__cookie, const char *__buf,
+     size_t __n);
+
+
+
+
+
+
+
+typedef int __io_seek_fn (void *__cookie, __off64_t *__pos, int __w);
+
+
+typedef int __io_close_fn (void *__cookie);
+
+
+
+
+typedef __io_read_fn cookie_read_function_t;
+typedef __io_write_fn cookie_write_function_t;
+typedef __io_seek_fn cookie_seek_function_t;
+typedef __io_close_fn cookie_close_function_t;
+
+
+typedef struct
+{
+  __io_read_fn *read;
+  __io_write_fn *write;
+  __io_seek_fn *seek;
+  __io_close_fn *close;
+} _IO_cookie_io_functions_t;
+typedef _IO_cookie_io_functions_t cookie_io_functions_t;
+
+struct _IO_cookie_file;
+
+
+extern void _IO_cookie_init (struct _IO_cookie_file *__cfile, int __read_write,
+        void *__cookie, _IO_cookie_io_functions_t __fns);
+
+
+
+
+extern "C" {
+
+
+extern int __underflow (_IO_FILE *);
+extern int __uflow (_IO_FILE *);
+extern int __overflow (_IO_FILE *, int);
+extern int _IO_getc (_IO_FILE *__fp);
+extern int _IO_putc (int __c, _IO_FILE *__fp);
+extern int _IO_feof (_IO_FILE *__fp) throw ();
+extern int _IO_ferror (_IO_FILE *__fp) throw ();
+
+extern int _IO_peekc_locked (_IO_FILE *__fp);
+
+
+
+
+
+extern void _IO_flockfile (_IO_FILE *) throw ();
+extern void _IO_funlockfile (_IO_FILE *) throw ();
+extern int _IO_ftrylockfile (_IO_FILE *) throw ();
+extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict,
+   __gnuc_va_list, int *__restrict);
+extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict,
+    __gnuc_va_list);
+extern __ssize_t _IO_padn (_IO_FILE *, int, __ssize_t);
+extern size_t _IO_sgetn (_IO_FILE *, void *, size_t);
+
+extern __off64_t _IO_seekoff (_IO_FILE *, __off64_t, int, int);
+extern __off64_t _IO_seekpos (_IO_FILE *, __off64_t, int);
+
+extern void _IO_free_backup_area (_IO_FILE *) throw ();
+}
+
+
+
+
+typedef __gnuc_va_list va_list;
+
+
+typedef _G_fpos_t fpos_t;
+
+
+
+
+
+typedef _G_fpos64_t fpos64_t;
+
+
+
+extern struct _IO_FILE *stdin;
+extern struct _IO_FILE *stdout;
+extern struct _IO_FILE *stderr;
+
+
+
+
+
+
+
+extern int remove (const char *__filename) throw ();
+
+extern int rename (const char *__old, const char *__new) throw ();
+
+
+
+
+extern int renameat (int __oldfd, const char *__old, int __newfd,
+       const char *__new) throw ();
+
+
+
+
+
+
+
+
+extern FILE *tmpfile (void) ;
+extern FILE *tmpfile64 (void) ;
+
+
+
+extern char *tmpnam (char *__s) throw () ;
+
+
+
+
+
+extern char *tmpnam_r (char *__s) throw () ;
+extern char *tempnam (const char *__dir, const char *__pfx)
+     throw () __attribute__ ((__malloc__)) ;
+
+
+
+
+
+
+
+
+extern int fclose (FILE *__stream);
+
+
+
+
+extern int fflush (FILE *__stream);
+
+extern int fflush_unlocked (FILE *__stream);
+extern int fcloseall (void);
+
+
+
+
+
+
+
+
+
+extern FILE *fopen (const char *__restrict __filename,
+      const char *__restrict __modes) ;
+
+
+
+
+extern FILE *freopen (const char *__restrict __filename,
+        const char *__restrict __modes,
+        FILE *__restrict __stream) ;
+
+
+extern FILE *fopen64 (const char *__restrict __filename,
+        const char *__restrict __modes) ;
+extern FILE *freopen64 (const char *__restrict __filename,
+   const char *__restrict __modes,
+   FILE *__restrict __stream) ;
+
+
+
+
+extern FILE *fdopen (int __fd, const char *__modes) throw () ;
+
+
+
+
+
+extern FILE *fopencookie (void *__restrict __magic_cookie,
+     const char *__restrict __modes,
+     _IO_cookie_io_functions_t __io_funcs) throw () ;
+
+
+
+
+extern FILE *fmemopen (void *__s, size_t __len, const char *__modes)
+  throw () ;
+
+
+
+
+extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) throw () ;
+
+
+
+
+
+
+extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) throw ();
+
+
+
+extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
+      int __modes, size_t __n) throw ();
+
+
+
+
+
+extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
+         size_t __size) throw ();
+
+
+extern void setlinebuf (FILE *__stream) throw ();
+
+
+
+
+
+
+
+
+extern int fprintf (FILE *__restrict __stream,
+      const char *__restrict __format, ...);
+
+
+
+
+extern int printf (const char *__restrict __format, ...);
+
+extern int sprintf (char *__restrict __s,
+      const char *__restrict __format, ...) throw ();
+
+
+
+
+
+extern int vfprintf (FILE *__restrict __s, const char *__restrict __format,
+       __gnuc_va_list __arg);
+
+
+
+
+extern int vprintf (const char *__restrict __format, __gnuc_va_list __arg);
+
+extern int vsprintf (char *__restrict __s, const char *__restrict __format,
+       __gnuc_va_list __arg) throw ();
+
+
+
+
+
+extern int snprintf (char *__restrict __s, size_t __maxlen,
+       const char *__restrict __format, ...)
+     throw () __attribute__ ((__format__ (__printf__, 3, 4)));
+
+extern int vsnprintf (char *__restrict __s, size_t __maxlen,
+        const char *__restrict __format, __gnuc_va_list __arg)
+     throw () __attribute__ ((__format__ (__printf__, 3, 0)));
+
+
+
+
+
+
+extern int vasprintf (char **__restrict __ptr, const char *__restrict __f,
+        __gnuc_va_list __arg)
+     throw () __attribute__ ((__format__ (__printf__, 2, 0))) ;
+extern int __asprintf (char **__restrict __ptr,
+         const char *__restrict __fmt, ...)
+     throw () __attribute__ ((__format__ (__printf__, 2, 3))) ;
+extern int asprintf (char **__restrict __ptr,
+       const char *__restrict __fmt, ...)
+     throw () __attribute__ ((__format__ (__printf__, 2, 3))) ;
+
+
+
+
+extern int vdprintf (int __fd, const char *__restrict __fmt,
+       __gnuc_va_list __arg)
+     __attribute__ ((__format__ (__printf__, 2, 0)));
+extern int dprintf (int __fd, const char *__restrict __fmt, ...)
+     __attribute__ ((__format__ (__printf__, 2, 3)));
+
+
+
+
+
+
+
+
+extern int fscanf (FILE *__restrict __stream,
+     const char *__restrict __format, ...) ;
+
+
+
+
+extern int scanf (const char *__restrict __format, ...) ;
+
+extern int sscanf (const char *__restrict __s,
+     const char *__restrict __format, ...) throw ();
+
+
+
+
+
+
+
+
+extern int vfscanf (FILE *__restrict __s, const char *__restrict __format,
+      __gnuc_va_list __arg)
+     __attribute__ ((__format__ (__scanf__, 2, 0))) ;
+
+
+
+
+
+extern int vscanf (const char *__restrict __format, __gnuc_va_list __arg)
+     __attribute__ ((__format__ (__scanf__, 1, 0))) ;
+
+
+extern int vsscanf (const char *__restrict __s,
+      const char *__restrict __format, __gnuc_va_list __arg)
+     throw () __attribute__ ((__format__ (__scanf__, 2, 0)));
+
+
+
+
+
+
+
+
+
+extern int fgetc (FILE *__stream);
+extern int getc (FILE *__stream);
+
+
+
+
+
+extern int getchar (void);
+
+extern int getc_unlocked (FILE *__stream);
+extern int getchar_unlocked (void);
+extern int fgetc_unlocked (FILE *__stream);
+
+
+
+
+
+
+
+
+
+
+
+extern int fputc (int __c, FILE *__stream);
+extern int putc (int __c, FILE *__stream);
+
+
+
+
+
+extern int putchar (int __c);
+
+extern int fputc_unlocked (int __c, FILE *__stream);
+
+
+
+
+
+
+
+extern int putc_unlocked (int __c, FILE *__stream);
+extern int putchar_unlocked (int __c);
+
+
+
+
+
+
+extern int getw (FILE *__stream);
+
+
+extern int putw (int __w, FILE *__stream);
+
+
+
+
+
+
+
+
+extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
+     ;
+extern char *gets (char *__s) __attribute__ ((__deprecated__));
+
+
+extern char *fgets_unlocked (char *__restrict __s, int __n,
+        FILE *__restrict __stream) ;
+extern __ssize_t __getdelim (char **__restrict __lineptr,
+          size_t *__restrict __n, int __delimiter,
+          FILE *__restrict __stream) ;
+extern __ssize_t getdelim (char **__restrict __lineptr,
+        size_t *__restrict __n, int __delimiter,
+        FILE *__restrict __stream) ;
+
+
+
+
+
+
+
+extern __ssize_t getline (char **__restrict __lineptr,
+       size_t *__restrict __n,
+       FILE *__restrict __stream) ;
+
+
+
+
+
+
+
+
+extern int fputs (const char *__restrict __s, FILE *__restrict __stream);
+
+
+
+
+
+extern int puts (const char *__s);
+
+
+
+
+
+
+extern int ungetc (int __c, FILE *__stream);
+
+
+
+
+
+
+extern size_t fread (void *__restrict __ptr, size_t __size,
+       size_t __n, FILE *__restrict __stream) ;
+
+
+
+
+extern size_t fwrite (const void *__restrict __ptr, size_t __size,
+        size_t __n, FILE *__restrict __s);
+
+extern int fputs_unlocked (const char *__restrict __s,
+      FILE *__restrict __stream);
+extern size_t fread_unlocked (void *__restrict __ptr, size_t __size,
+         size_t __n, FILE *__restrict __stream) ;
+extern size_t fwrite_unlocked (const void *__restrict __ptr, size_t __size,
+          size_t __n, FILE *__restrict __stream);
+
+
+
+
+
+
+
+
+extern int fseek (FILE *__stream, long int __off, int __whence);
+
+
+
+
+extern long int ftell (FILE *__stream) ;
+
+
+
+
+extern void rewind (FILE *__stream);
+
+extern int fseeko (FILE *__stream, __off_t __off, int __whence);
+
+
+
+
+extern __off_t ftello (FILE *__stream) ;
+
+
+
+
+
+
+extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos);
+
+
+
+
+extern int fsetpos (FILE *__stream, const fpos_t *__pos);
+
+
+
+extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
+extern __off64_t ftello64 (FILE *__stream) ;
+extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos);
+extern int fsetpos64 (FILE *__stream, const fpos64_t *__pos);
+
+
+
+
+extern void clearerr (FILE *__stream) throw ();
+
+extern int feof (FILE *__stream) throw () ;
+
+extern int ferror (FILE *__stream) throw () ;
+
+
+
+
+extern void clearerr_unlocked (FILE *__stream) throw ();
+extern int feof_unlocked (FILE *__stream) throw () ;
+extern int ferror_unlocked (FILE *__stream) throw () ;
+
+
+
+
+
+
+
+
+extern void perror (const char *__s);
+
+
+
+
+
+
+extern int sys_nerr;
+extern const char *const sys_errlist[];
+
+
+extern int _sys_nerr;
+extern const char *const _sys_errlist[];
+
+
+
+
+extern int fileno (FILE *__stream) throw () ;
+
+
+
+
+extern int fileno_unlocked (FILE *__stream) throw () ;
+extern FILE *popen (const char *__command, const char *__modes) ;
+
+
+
+
+
+extern int pclose (FILE *__stream);
+
+
+
+
+
+extern char *ctermid (char *__s) throw ();
+
+
+
+
+
+extern char *cuserid (char *__s);
+
+
+
+
+struct obstack;
+
+
+extern int obstack_printf (struct obstack *__restrict __obstack,
+      const char *__restrict __format, ...)
+     throw () __attribute__ ((__format__ (__printf__, 2, 3)));
+extern int obstack_vprintf (struct obstack *__restrict __obstack,
+       const char *__restrict __format,
+       __gnuc_va_list __args)
+     throw () __attribute__ ((__format__ (__printf__, 2, 0)));
+
+
+
+
+
+
+
+extern void flockfile (FILE *__stream) throw ();
+
+
+
+extern int ftrylockfile (FILE *__stream) throw () ;
+
+
+extern void funlockfile (FILE *__stream) throw ();
+extern __inline __attribute__ ((__gnu_inline__)) int
+vprintf (const char *__restrict __fmt, __gnuc_va_list __arg)
+{
+  return vfprintf (stdout, __fmt, __arg);
+}
+
+
+
+extern __inline __attribute__ ((__gnu_inline__)) int
+getchar (void)
+{
+  return _IO_getc (stdin);
+}
+
+
+
+
+extern __inline __attribute__ ((__gnu_inline__)) int
+fgetc_unlocked (FILE *__fp)
+{
+  return (__builtin_expect (((__fp)->_IO_read_ptr >= (__fp)->_IO_read_end), 0) ? __uflow (__fp) : *(unsigned char *) (__fp)->_IO_read_ptr++);
+}
+
+
+
+
+
+extern __inline __attribute__ ((__gnu_inline__)) int
+getc_unlocked (FILE *__fp)
+{
+  return (__builtin_expect (((__fp)->_IO_read_ptr >= (__fp)->_IO_read_end), 0) ? __uflow (__fp) : *(unsigned char *) (__fp)->_IO_read_ptr++);
+}
+
+
+extern __inline __attribute__ ((__gnu_inline__)) int
+getchar_unlocked (void)
+{
+  return (__builtin_expect (((stdin)->_IO_read_ptr >= (stdin)->_IO_read_end), 0) ? __uflow (stdin) : *(unsigned char *) (stdin)->_IO_read_ptr++);
+}
+
+
+
+
+extern __inline __attribute__ ((__gnu_inline__)) int
+putchar (int __c)
+{
+  return _IO_putc (__c, stdout);
+}
+
+
+
+
+extern __inline __attribute__ ((__gnu_inline__)) int
+fputc_unlocked (int __c, FILE *__stream)
+{
+  return (__builtin_expect (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c)));
+}
+
+
+
+
+
+extern __inline __attribute__ ((__gnu_inline__)) int
+putc_unlocked (int __c, FILE *__stream)
+{
+  return (__builtin_expect (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c)));
+}
+
+
+extern __inline __attribute__ ((__gnu_inline__)) int
+putchar_unlocked (int __c)
+{
+  return (__builtin_expect (((stdout)->_IO_write_ptr >= (stdout)->_IO_write_end), 0) ? __overflow (stdout, (unsigned char) (__c)) : (unsigned char) (*(stdout)->_IO_write_ptr++ = (__c)));
+}
+
+
+
+
+
+extern __inline __attribute__ ((__gnu_inline__)) __ssize_t
+getline (char **__lineptr, size_t *__n, FILE *__stream)
+{
+  return __getdelim (__lineptr, __n, '\n', __stream);
+}
+
+
+
+
+
+extern __inline __attribute__ ((__gnu_inline__)) int
+__attribute__ ((__leaf__)) feof_unlocked (FILE *__stream) throw ()
+{
+  return (((__stream)->_flags & 0x10) != 0);
+}
+
+
+extern __inline __attribute__ ((__gnu_inline__)) int
+__attribute__ ((__leaf__)) ferror_unlocked (FILE *__stream) throw ()
+{
+  return (((__stream)->_flags & 0x20) != 0);
+}
+}
+namespace std
+{
+  using ::FILE;
+  using ::fpos_t;
+
+  using ::clearerr;
+  using ::fclose;
+  using ::feof;
+  using ::ferror;
+  using ::fflush;
+  using ::fgetc;
+  using ::fgetpos;
+  using ::fgets;
+  using ::fopen;
+  using ::fprintf;
+  using ::fputc;
+  using ::fputs;
+  using ::fread;
+  using ::freopen;
+  using ::fscanf;
+  using ::fseek;
+  using ::fsetpos;
+  using ::ftell;
+  using ::fwrite;
+  using ::getc;
+  using ::getchar;
+
+
+  using ::gets;
+
+  using ::perror;
+  using ::printf;
+  using ::putc;
+  using ::putchar;
+  using ::puts;
+  using ::remove;
+  using ::rename;
+  using ::rewind;
+  using ::scanf;
+  using ::setbuf;
+  using ::setvbuf;
+  using ::sprintf;
+  using ::sscanf;
+  using ::tmpfile;
+
+  using ::tmpnam;
+
+  using ::ungetc;
+  using ::vfprintf;
+  using ::vprintf;
+  using ::vsprintf;
+}
+namespace __gnu_cxx
+{
+  using ::snprintf;
+  using ::vfscanf;
+  using ::vscanf;
+  using ::vsnprintf;
+  using ::vsscanf;
+
+}
+
+namespace std
+{
+  using ::__gnu_cxx::snprintf;
+  using ::__gnu_cxx::vfscanf;
+  using ::__gnu_cxx::vscanf;
+  using ::__gnu_cxx::vsnprintf;
+  using ::__gnu_cxx::vsscanf;
+}
+       
+
+
+extern "C" {
+
+
+
+
+
+
+extern int *__errno_location (void) throw () __attribute__ ((__const__));
+extern char *program_invocation_name, *program_invocation_short_name;
+
+
+
+}
+typedef int error_t;
+
+namespace __gnu_cxx __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+  template<typename _TRet, typename _Ret = _TRet, typename _CharT,
+    typename... _Base>
+    _Ret
+    __stoa(_TRet (*__convf) (const _CharT*, _CharT**, _Base...),
+    const char* __name, const _CharT* __str, std::size_t* __idx,
+    _Base... __base)
+    {
+      _Ret __ret;
+
+      _CharT* __endptr;
+
+      struct _Save_errno {
+ _Save_errno() : _M_errno((*__errno_location ())) { (*__errno_location ()) = 0; }
+ ~_Save_errno() { if ((*__errno_location ()) == 0) (*__errno_location ()) = _M_errno; }
+ int _M_errno;
+      } const __save_errno;
+
+      struct _Range_chk {
+   static bool
+   _S_chk(_TRet, std::false_type) { return false; }
+
+   static bool
+   _S_chk(_TRet __val, std::true_type)
+   {
+     return __val < _TRet(__numeric_traits<int>::__min)
+       || __val > _TRet(__numeric_traits<int>::__max);
+   }
+      };
+
+      const _TRet __tmp = __convf(__str, &__endptr, __base...);
+
+      if (__endptr == __str)
+ std::__throw_invalid_argument(__name);
+      else if ((*__errno_location ()) == 34
+   || _Range_chk::_S_chk(__tmp, std::is_same<_Ret, int>{}))
+ std::__throw_out_of_range(__name);
+      else
+ __ret = __tmp;
+
+      if (__idx)
+ *__idx = __endptr - __str;
+
+      return __ret;
+    }
+
+
+  template<typename _String, typename _CharT = typename _String::value_type>
+    _String
+    __to_xstring(int (*__convf) (_CharT*, std::size_t, const _CharT*,
+     __builtin_va_list), std::size_t __n,
+   const _CharT* __fmt, ...)
+    {
+
+
+      _CharT* __s = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+         * __n));
+
+      __builtin_va_list __args;
+      __builtin_va_start(__args, __fmt);
+
+      const int __len = __convf(__s, __n, __fmt, __args);
+
+      __builtin_va_end(__args);
+
+      return _String(__s, __s + __len);
+    }
+
+
+}
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+namespace __cxx11 {
+
+
+
+  inline int
+  stoi(const string& __str, size_t* __idx = 0, int __base = 10)
+  { return __gnu_cxx::__stoa<long, int>(&std::strtol, "stoi", __str.c_str(),
+     __idx, __base); }
+
+  inline long
+  stol(const string& __str, size_t* __idx = 0, int __base = 10)
+  { return __gnu_cxx::__stoa(&std::strtol, "stol", __str.c_str(),
+        __idx, __base); }
+
+  inline unsigned long
+  stoul(const string& __str, size_t* __idx = 0, int __base = 10)
+  { return __gnu_cxx::__stoa(&std::strtoul, "stoul", __str.c_str(),
+        __idx, __base); }
+
+  inline long long
+  stoll(const string& __str, size_t* __idx = 0, int __base = 10)
+  { return __gnu_cxx::__stoa(&std::strtoll, "stoll", __str.c_str(),
+        __idx, __base); }
+
+  inline unsigned long long
+  stoull(const string& __str, size_t* __idx = 0, int __base = 10)
+  { return __gnu_cxx::__stoa(&std::strtoull, "stoull", __str.c_str(),
+        __idx, __base); }
+
+
+  inline float
+  stof(const string& __str, size_t* __idx = 0)
+  { return __gnu_cxx::__stoa(&std::strtof, "stof", __str.c_str(), __idx); }
+
+  inline double
+  stod(const string& __str, size_t* __idx = 0)
+  { return __gnu_cxx::__stoa(&std::strtod, "stod", __str.c_str(), __idx); }
+
+  inline long double
+  stold(const string& __str, size_t* __idx = 0)
+  { return __gnu_cxx::__stoa(&std::strtold, "stold", __str.c_str(), __idx); }
+
+
+
+
+
+
+  inline string
+  to_string(int __val)
+  { return __gnu_cxx::__to_xstring<string>(&std::vsnprintf, 4 * sizeof(int),
+        "%d", __val); }
+
+  inline string
+  to_string(unsigned __val)
+  { return __gnu_cxx::__to_xstring<string>(&std::vsnprintf,
+        4 * sizeof(unsigned),
+        "%u", __val); }
+
+  inline string
+  to_string(long __val)
+  { return __gnu_cxx::__to_xstring<string>(&std::vsnprintf, 4 * sizeof(long),
+        "%ld", __val); }
+
+  inline string
+  to_string(unsigned long __val)
+  { return __gnu_cxx::__to_xstring<string>(&std::vsnprintf,
+        4 * sizeof(unsigned long),
+        "%lu", __val); }
+
+  inline string
+  to_string(long long __val)
+  { return __gnu_cxx::__to_xstring<string>(&std::vsnprintf,
+        4 * sizeof(long long),
+        "%lld", __val); }
+
+  inline string
+  to_string(unsigned long long __val)
+  { return __gnu_cxx::__to_xstring<string>(&std::vsnprintf,
+        4 * sizeof(unsigned long long),
+        "%llu", __val); }
+
+  inline string
+  to_string(float __val)
+  {
+    const int __n =
+      __gnu_cxx::__numeric_traits<float>::__max_exponent10 + 20;
+    return __gnu_cxx::__to_xstring<string>(&std::vsnprintf, __n,
+        "%f", __val);
+  }
+
+  inline string
+  to_string(double __val)
+  {
+    const int __n =
+      __gnu_cxx::__numeric_traits<double>::__max_exponent10 + 20;
+    return __gnu_cxx::__to_xstring<string>(&std::vsnprintf, __n,
+        "%f", __val);
+  }
+
+  inline string
+  to_string(long double __val)
+  {
+    const int __n =
+      __gnu_cxx::__numeric_traits<long double>::__max_exponent10 + 20;
+    return __gnu_cxx::__to_xstring<string>(&std::vsnprintf, __n,
+        "%Lf", __val);
+  }
+
+
+
+  inline int
+  stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
+  { return __gnu_cxx::__stoa<long, int>(&std::wcstol, "stoi", __str.c_str(),
+     __idx, __base); }
+
+  inline long
+  stol(const wstring& __str, size_t* __idx = 0, int __base = 10)
+  { return __gnu_cxx::__stoa(&std::wcstol, "stol", __str.c_str(),
+        __idx, __base); }
+
+  inline unsigned long
+  stoul(const wstring& __str, size_t* __idx = 0, int __base = 10)
+  { return __gnu_cxx::__stoa(&std::wcstoul, "stoul", __str.c_str(),
+        __idx, __base); }
+
+  inline long long
+  stoll(const wstring& __str, size_t* __idx = 0, int __base = 10)
+  { return __gnu_cxx::__stoa(&std::wcstoll, "stoll", __str.c_str(),
+        __idx, __base); }
+
+  inline unsigned long long
+  stoull(const wstring& __str, size_t* __idx = 0, int __base = 10)
+  { return __gnu_cxx::__stoa(&std::wcstoull, "stoull", __str.c_str(),
+        __idx, __base); }
+
+
+  inline float
+  stof(const wstring& __str, size_t* __idx = 0)
+  { return __gnu_cxx::__stoa(&std::wcstof, "stof", __str.c_str(), __idx); }
+
+  inline double
+  stod(const wstring& __str, size_t* __idx = 0)
+  { return __gnu_cxx::__stoa(&std::wcstod, "stod", __str.c_str(), __idx); }
+
+  inline long double
+  stold(const wstring& __str, size_t* __idx = 0)
+  { return __gnu_cxx::__stoa(&std::wcstold, "stold", __str.c_str(), __idx); }
+
+
+
+  inline wstring
+  to_wstring(int __val)
+  { return __gnu_cxx::__to_xstring<wstring>(&std::vswprintf, 4 * sizeof(int),
+         L"%d", __val); }
+
+  inline wstring
+  to_wstring(unsigned __val)
+  { return __gnu_cxx::__to_xstring<wstring>(&std::vswprintf,
+         4 * sizeof(unsigned),
+         L"%u", __val); }
+
+  inline wstring
+  to_wstring(long __val)
+  { return __gnu_cxx::__to_xstring<wstring>(&std::vswprintf, 4 * sizeof(long),
+         L"%ld", __val); }
+
+  inline wstring
+  to_wstring(unsigned long __val)
+  { return __gnu_cxx::__to_xstring<wstring>(&std::vswprintf,
+         4 * sizeof(unsigned long),
+         L"%lu", __val); }
+
+  inline wstring
+  to_wstring(long long __val)
+  { return __gnu_cxx::__to_xstring<wstring>(&std::vswprintf,
+         4 * sizeof(long long),
+         L"%lld", __val); }
+
+  inline wstring
+  to_wstring(unsigned long long __val)
+  { return __gnu_cxx::__to_xstring<wstring>(&std::vswprintf,
+         4 * sizeof(unsigned long long),
+         L"%llu", __val); }
+
+  inline wstring
+  to_wstring(float __val)
+  {
+    const int __n =
+      __gnu_cxx::__numeric_traits<float>::__max_exponent10 + 20;
+    return __gnu_cxx::__to_xstring<wstring>(&std::vswprintf, __n,
+         L"%f", __val);
+  }
+
+  inline wstring
+  to_wstring(double __val)
+  {
+    const int __n =
+      __gnu_cxx::__numeric_traits<double>::__max_exponent10 + 20;
+    return __gnu_cxx::__to_xstring<wstring>(&std::vswprintf, __n,
+         L"%f", __val);
+  }
+
+  inline wstring
+  to_wstring(long double __val)
+  {
+    const int __n =
+      __gnu_cxx::__numeric_traits<long double>::__max_exponent10 + 20;
+    return __gnu_cxx::__to_xstring<wstring>(&std::vswprintf, __n,
+         L"%Lf", __val);
+  }
+
+
+
+}
+
+}
+
+
+
+
+
+       
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+  template<typename _Result, typename _Arg>
+    struct __hash_base
+    {
+      typedef _Result result_type ;
+      typedef _Arg argument_type ;
+    };
+
+
+  template<typename _Tp>
+    struct hash;
+
+  template<typename _Tp, typename = void>
+    struct __poison_hash
+    {
+      static constexpr bool __enable_hash_call = false;
+    private:
+
+      __poison_hash(__poison_hash&&);
+      ~__poison_hash();
+    };
+
+  template<typename _Tp>
+    struct __poison_hash<_Tp, __void_t<decltype(hash<_Tp>()(declval<_Tp>()))>>
+    {
+      static constexpr bool __enable_hash_call = true;
+    };
+
+
+  template<typename _Tp, bool = is_enum<_Tp>::value>
+    struct __hash_enum
+    {
+    private:
+
+      __hash_enum(__hash_enum&&);
+      ~__hash_enum();
+    };
+
+
+  template<typename _Tp>
+    struct __hash_enum<_Tp, true> : public __hash_base<size_t, _Tp>
+    {
+      size_t
+      operator()(_Tp __val) const noexcept
+      {
+       using __type = typename underlying_type<_Tp>::type;
+       return hash<__type>{}(static_cast<__type>(__val));
+      }
+    };
+
+
+
+  template<typename _Tp>
+    struct hash : __hash_enum<_Tp>
+    { };
+
+
+  template<typename _Tp>
+    struct hash<_Tp*> : public __hash_base<size_t, _Tp*>
+    {
+      size_t
+      operator()(_Tp* __p) const noexcept
+      { return reinterpret_cast<size_t>(__p); }
+    };
+  template<> struct hash<bool> : public __hash_base<size_t, bool> { size_t operator()(bool __val) const noexcept { return static_cast<size_t>(__val); } };
+
+
+  template<> struct hash<char> : public __hash_base<size_t, char> { size_t operator()(char __val) const noexcept { return static_cast<size_t>(__val); } };
+
+
+  template<> struct hash<signed char> : public __hash_base<size_t, signed char> { size_t operator()(signed char __val) const noexcept { return static_cast<size_t>(__val); } };
+
+
+  template<> struct hash<unsigned char> : public __hash_base<size_t, unsigned char> { size_t operator()(unsigned char __val) const noexcept { return static_cast<size_t>(__val); } };
+
+
+  template<> struct hash<wchar_t> : public __hash_base<size_t, wchar_t> { size_t operator()(wchar_t __val) const noexcept { return static_cast<size_t>(__val); } };
+
+
+  template<> struct hash<char16_t> : public __hash_base<size_t, char16_t> { size_t operator()(char16_t __val) const noexcept { return static_cast<size_t>(__val); } };
+
+
+  template<> struct hash<char32_t> : public __hash_base<size_t, char32_t> { size_t operator()(char32_t __val) const noexcept { return static_cast<size_t>(__val); } };
+
+
+  template<> struct hash<short> : public __hash_base<size_t, short> { size_t operator()(short __val) const noexcept { return static_cast<size_t>(__val); } };
+
+
+  template<> struct hash<int> : public __hash_base<size_t, int> { size_t operator()(int __val) const noexcept { return static_cast<size_t>(__val); } };
+
+
+  template<> struct hash<long> : public __hash_base<size_t, long> { size_t operator()(long __val) const noexcept { return static_cast<size_t>(__val); } };
+
+
+  template<> struct hash<long long> : public __hash_base<size_t, long long> { size_t operator()(long long __val) const noexcept { return static_cast<size_t>(__val); } };
+
+
+  template<> struct hash<unsigned short> : public __hash_base<size_t, unsigned short> { size_t operator()(unsigned short __val) const noexcept { return static_cast<size_t>(__val); } };
+
+
+  template<> struct hash<unsigned int> : public __hash_base<size_t, unsigned int> { size_t operator()(unsigned int __val) const noexcept { return static_cast<size_t>(__val); } };
+
+
+  template<> struct hash<unsigned long> : public __hash_base<size_t, unsigned long> { size_t operator()(unsigned long __val) const noexcept { return static_cast<size_t>(__val); } };
+
+
+  template<> struct hash<unsigned long long> : public __hash_base<size_t, unsigned long long> { size_t operator()(unsigned long long __val) const noexcept { return static_cast<size_t>(__val); } };
+
+
+  template<> struct hash<__int128> : public __hash_base<size_t, __int128> { size_t operator()(__int128 __val) const noexcept { return static_cast<size_t>(__val); } };
+  template<> struct hash<__int128 unsigned> : public __hash_base<size_t, __int128 unsigned> { size_t operator()(__int128 unsigned __val) const noexcept { return static_cast<size_t>(__val); } };
+  struct _Hash_impl
+  {
+    static size_t
+    hash(const void* __ptr, size_t __clength,
+  size_t __seed = static_cast<size_t>(0xc70f6907UL))
+    { return _Hash_bytes(__ptr, __clength, __seed); }
+
+    template<typename _Tp>
+      static size_t
+      hash(const _Tp& __val)
+      { return hash(&__val, sizeof(__val)); }
+
+    template<typename _Tp>
+      static size_t
+      __hash_combine(const _Tp& __val, size_t __hash)
+      { return hash(&__val, sizeof(__val), __hash); }
+  };
+
+
+  struct _Fnv_hash_impl
+  {
+    static size_t
+    hash(const void* __ptr, size_t __clength,
+  size_t __seed = static_cast<size_t>(2166136261UL))
+    { return _Fnv_hash_bytes(__ptr, __clength, __seed); }
+
+    template<typename _Tp>
+      static size_t
+      hash(const _Tp& __val)
+      { return hash(&__val, sizeof(__val)); }
+
+    template<typename _Tp>
+      static size_t
+      __hash_combine(const _Tp& __val, size_t __hash)
+      { return hash(&__val, sizeof(__val), __hash); }
+  };
+
+
+  template<>
+    struct hash<float> : public __hash_base<size_t, float>
+    {
+      size_t
+      operator()(float __val) const noexcept
+      {
+
+ return __val != 0.0f ? std::_Hash_impl::hash(__val) : 0;
+      }
+    };
+
+
+  template<>
+    struct hash<double> : public __hash_base<size_t, double>
+    {
+      size_t
+      operator()(double __val) const noexcept
+      {
+
+ return __val != 0.0 ? std::_Hash_impl::hash(__val) : 0;
+      }
+    };
+
+
+  template<>
+    struct hash<long double>
+    : public __hash_base<size_t, long double>
+    {
+      __attribute__ ((__pure__)) size_t
+      operator()(long double __val) const noexcept;
+    };
+
+
+
+
+
+
+
+  template<typename _Hash>
+    struct __is_fast_hash : public std::true_type
+    { };
+
+  template<>
+    struct __is_fast_hash<hash<long double>> : public std::false_type
+    { };
+
+
+}
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+
+
+
+  template<>
+    struct hash<string>
+    : public __hash_base<size_t, string>
+    {
+      size_t
+      operator()(const string& __s) const noexcept
+      { return std::_Hash_impl::hash(__s.data(), __s.length()); }
+    };
+
+  template<>
+    struct __is_fast_hash<hash<string>> : std::false_type
+    { };
+
+
+
+  template<>
+    struct hash<wstring>
+    : public __hash_base<size_t, wstring>
+    {
+      size_t
+      operator()(const wstring& __s) const noexcept
+      { return std::_Hash_impl::hash(__s.data(),
+                                     __s.length() * sizeof(wchar_t)); }
+    };
+
+  template<>
+    struct __is_fast_hash<hash<wstring>> : std::false_type
+    { };
+
+
+
+
+  template<>
+    struct hash<u16string>
+    : public __hash_base<size_t, u16string>
+    {
+      size_t
+      operator()(const u16string& __s) const noexcept
+      { return std::_Hash_impl::hash(__s.data(),
+                                     __s.length() * sizeof(char16_t)); }
+    };
+
+  template<>
+    struct __is_fast_hash<hash<u16string>> : std::false_type
+    { };
+
+
+  template<>
+    struct hash<u32string>
+    : public __hash_base<size_t, u32string>
+    {
+      size_t
+      operator()(const u32string& __s) const noexcept
+      { return std::_Hash_impl::hash(__s.data(),
+                                     __s.length() * sizeof(char32_t)); }
+    };
+
+  template<>
+    struct __is_fast_hash<hash<u32string>> : std::false_type
+    { };
+
+}
+       
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    const typename basic_string<_CharT, _Traits, _Alloc>::size_type
+    basic_string<_CharT, _Traits, _Alloc>::npos;
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    void
+    basic_string<_CharT, _Traits, _Alloc>::
+    swap(basic_string& __s) noexcept
+    {
+      if (this == &__s)
+ return;
+
+      _Alloc_traits::_S_on_swap(_M_get_allocator(), __s._M_get_allocator());
+
+      if (_M_is_local())
+ if (__s._M_is_local())
+   {
+     if (length() && __s.length())
+       {
+  _CharT __tmp_data[_S_local_capacity + 1];
+  traits_type::copy(__tmp_data, __s._M_local_buf,
+      _S_local_capacity + 1);
+  traits_type::copy(__s._M_local_buf, _M_local_buf,
+      _S_local_capacity + 1);
+  traits_type::copy(_M_local_buf, __tmp_data,
+      _S_local_capacity + 1);
+       }
+     else if (__s.length())
+       {
+  traits_type::copy(_M_local_buf, __s._M_local_buf,
+      _S_local_capacity + 1);
+  _M_length(__s.length());
+  __s._M_set_length(0);
+  return;
+       }
+     else if (length())
+       {
+  traits_type::copy(__s._M_local_buf, _M_local_buf,
+      _S_local_capacity + 1);
+  __s._M_length(length());
+  _M_set_length(0);
+  return;
+       }
+   }
+ else
+   {
+     const size_type __tmp_capacity = __s._M_allocated_capacity;
+     traits_type::copy(__s._M_local_buf, _M_local_buf,
+         _S_local_capacity + 1);
+     _M_data(__s._M_data());
+     __s._M_data(__s._M_local_buf);
+     _M_capacity(__tmp_capacity);
+   }
+      else
+ {
+   const size_type __tmp_capacity = _M_allocated_capacity;
+   if (__s._M_is_local())
+     {
+       traits_type::copy(_M_local_buf, __s._M_local_buf,
+    _S_local_capacity + 1);
+       __s._M_data(_M_data());
+       _M_data(_M_local_buf);
+     }
+   else
+     {
+       pointer __tmp_ptr = _M_data();
+       _M_data(__s._M_data());
+       __s._M_data(__tmp_ptr);
+       _M_capacity(__s._M_allocated_capacity);
+     }
+   __s._M_capacity(__tmp_capacity);
+ }
+
+      const size_type __tmp_length = length();
+      _M_length(__s.length());
+      __s._M_length(__tmp_length);
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    typename basic_string<_CharT, _Traits, _Alloc>::pointer
+    basic_string<_CharT, _Traits, _Alloc>::
+    _M_create(size_type& __capacity, size_type __old_capacity)
+    {
+
+
+      if (__capacity > max_size())
+ std::__throw_length_error(("basic_string::_M_create"));
+
+
+
+
+      if (__capacity > __old_capacity && __capacity < 2 * __old_capacity)
+ {
+   __capacity = 2 * __old_capacity;
+
+   if (__capacity > max_size())
+     __capacity = max_size();
+ }
+
+
+
+      return _Alloc_traits::allocate(_M_get_allocator(), __capacity + 1);
+    }
+
+
+
+
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    template<typename _InIterator>
+      void
+      basic_string<_CharT, _Traits, _Alloc>::
+      _M_construct(_InIterator __beg, _InIterator __end,
+     std::input_iterator_tag)
+      {
+ size_type __len = 0;
+ size_type __capacity = size_type(_S_local_capacity);
+
+ while (__beg != __end && __len < __capacity)
+   {
+     _M_data()[__len++] = *__beg;
+     ++__beg;
+   }
+
+ try
+   {
+     while (__beg != __end)
+       {
+  if (__len == __capacity)
+    {
+
+      __capacity = __len + 1;
+      pointer __another = _M_create(__capacity, __len);
+      this->_S_copy(__another, _M_data(), __len);
+      _M_dispose();
+      _M_data(__another);
+      _M_capacity(__capacity);
+    }
+  _M_data()[__len++] = *__beg;
+  ++__beg;
+       }
+   }
+ catch(...)
+   {
+     _M_dispose();
+     throw;
+   }
+
+ _M_set_length(__len);
+      }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    template<typename _InIterator>
+      void
+      basic_string<_CharT, _Traits, _Alloc>::
+      _M_construct(_InIterator __beg, _InIterator __end,
+     std::forward_iterator_tag)
+      {
+
+ if (__gnu_cxx::__is_null_pointer(__beg) && __beg != __end)
+   std::__throw_logic_error(("basic_string::" "_M_construct null not valid")
+                                         );
+
+ size_type __dnew = static_cast<size_type>(std::distance(__beg, __end));
+
+ if (__dnew > size_type(_S_local_capacity))
+   {
+     _M_data(_M_create(__dnew, size_type(0)));
+     _M_capacity(__dnew);
+   }
+
+
+ try
+   { this->_S_copy_chars(_M_data(), __beg, __end); }
+ catch(...)
+   {
+     _M_dispose();
+     throw;
+   }
+
+ _M_set_length(__dnew);
+      }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    void
+    basic_string<_CharT, _Traits, _Alloc>::
+    _M_construct(size_type __n, _CharT __c)
+    {
+      if (__n > size_type(_S_local_capacity))
+ {
+   _M_data(_M_create(__n, size_type(0)));
+   _M_capacity(__n);
+ }
+
+      if (__n)
+ this->_S_assign(_M_data(), __n, __c);
+
+      _M_set_length(__n);
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    void
+    basic_string<_CharT, _Traits, _Alloc>::
+    _M_assign(const basic_string& __str)
+    {
+      if (this != &__str)
+ {
+   const size_type __rsize = __str.length();
+   const size_type __capacity = capacity();
+
+   if (__rsize > __capacity)
+     {
+       size_type __new_capacity = __rsize;
+       pointer __tmp = _M_create(__new_capacity, __capacity);
+       _M_dispose();
+       _M_data(__tmp);
+       _M_capacity(__new_capacity);
+     }
+
+   if (__rsize)
+     this->_S_copy(_M_data(), __str._M_data(), __rsize);
+
+   _M_set_length(__rsize);
+ }
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    void
+    basic_string<_CharT, _Traits, _Alloc>::
+    reserve(size_type __res)
+    {
+
+      if (__res < length())
+ __res = length();
+
+      const size_type __capacity = capacity();
+      if (__res != __capacity)
+ {
+   if (__res > __capacity
+       || __res > size_type(_S_local_capacity))
+     {
+       pointer __tmp = _M_create(__res, __capacity);
+       this->_S_copy(__tmp, _M_data(), length() + 1);
+       _M_dispose();
+       _M_data(__tmp);
+       _M_capacity(__res);
+     }
+   else if (!_M_is_local())
+     {
+       this->_S_copy(_M_local_data(), _M_data(), length() + 1);
+       _M_destroy(__capacity);
+       _M_data(_M_local_data());
+     }
+ }
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    void
+    basic_string<_CharT, _Traits, _Alloc>::
+    _M_mutate(size_type __pos, size_type __len1, const _CharT* __s,
+       size_type __len2)
+    {
+      const size_type __how_much = length() - __pos - __len1;
+
+      size_type __new_capacity = length() + __len2 - __len1;
+      pointer __r = _M_create(__new_capacity, capacity());
+
+      if (__pos)
+ this->_S_copy(__r, _M_data(), __pos);
+      if (__s && __len2)
+ this->_S_copy(__r + __pos, __s, __len2);
+      if (__how_much)
+ this->_S_copy(__r + __pos + __len2,
+        _M_data() + __pos + __len1, __how_much);
+
+      _M_dispose();
+      _M_data(__r);
+      _M_capacity(__new_capacity);
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    void
+    basic_string<_CharT, _Traits, _Alloc>::
+    _M_erase(size_type __pos, size_type __n)
+    {
+      const size_type __how_much = length() - __pos - __n;
+
+      if (__how_much && __n)
+ this->_S_move(_M_data() + __pos, _M_data() + __pos + __n, __how_much);
+
+      _M_set_length(length() - __n);
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    void
+    basic_string<_CharT, _Traits, _Alloc>::
+    resize(size_type __n, _CharT __c)
+    {
+      const size_type __size = this->size();
+      if (__size < __n)
+ this->append(__n - __size, __c);
+      else if (__n < __size)
+ this->_M_set_length(__n);
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_string<_CharT, _Traits, _Alloc>&
+    basic_string<_CharT, _Traits, _Alloc>::
+    _M_append(const _CharT* __s, size_type __n)
+    {
+      const size_type __len = __n + this->size();
+
+      if (__len <= this->capacity())
+ {
+   if (__n)
+     this->_S_copy(this->_M_data() + this->size(), __s, __n);
+ }
+      else
+ this->_M_mutate(this->size(), size_type(0), __s, __n);
+
+      this->_M_set_length(__len);
+      return *this;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    template<typename _InputIterator>
+      basic_string<_CharT, _Traits, _Alloc>&
+      basic_string<_CharT, _Traits, _Alloc>::
+      _M_replace_dispatch(const_iterator __i1, const_iterator __i2,
+     _InputIterator __k1, _InputIterator __k2,
+     std::__false_type)
+      {
+ const basic_string __s(__k1, __k2);
+ const size_type __n1 = __i2 - __i1;
+ return _M_replace(__i1 - begin(), __n1, __s._M_data(),
+     __s.size());
+      }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_string<_CharT, _Traits, _Alloc>&
+    basic_string<_CharT, _Traits, _Alloc>::
+    _M_replace_aux(size_type __pos1, size_type __n1, size_type __n2,
+     _CharT __c)
+    {
+      _M_check_length(__n1, __n2, "basic_string::_M_replace_aux");
+
+      const size_type __old_size = this->size();
+      const size_type __new_size = __old_size + __n2 - __n1;
+
+      if (__new_size <= this->capacity())
+ {
+   pointer __p = this->_M_data() + __pos1;
+
+   const size_type __how_much = __old_size - __pos1 - __n1;
+   if (__how_much && __n1 != __n2)
+     this->_S_move(__p + __n2, __p + __n1, __how_much);
+ }
+      else
+ this->_M_mutate(__pos1, __n1, 0, __n2);
+
+      if (__n2)
+ this->_S_assign(this->_M_data() + __pos1, __n2, __c);
+
+      this->_M_set_length(__new_size);
+      return *this;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_string<_CharT, _Traits, _Alloc>&
+    basic_string<_CharT, _Traits, _Alloc>::
+    _M_replace(size_type __pos, size_type __len1, const _CharT* __s,
+        const size_type __len2)
+    {
+      _M_check_length(__len1, __len2, "basic_string::_M_replace");
+
+      const size_type __old_size = this->size();
+      const size_type __new_size = __old_size + __len2 - __len1;
+
+      if (__new_size <= this->capacity())
+ {
+   pointer __p = this->_M_data() + __pos;
+
+   const size_type __how_much = __old_size - __pos - __len1;
+   if (_M_disjunct(__s))
+     {
+       if (__how_much && __len1 != __len2)
+  this->_S_move(__p + __len2, __p + __len1, __how_much);
+       if (__len2)
+  this->_S_copy(__p, __s, __len2);
+     }
+   else
+     {
+
+       if (__len2 && __len2 <= __len1)
+  this->_S_move(__p, __s, __len2);
+       if (__how_much && __len1 != __len2)
+  this->_S_move(__p + __len2, __p + __len1, __how_much);
+       if (__len2 > __len1)
+  {
+    if (__s + __len2 <= __p + __len1)
+      this->_S_move(__p, __s, __len2);
+    else if (__s >= __p + __len1)
+      this->_S_copy(__p, __s + __len2 - __len1, __len2);
+    else
+      {
+        const size_type __nleft = (__p + __len1) - __s;
+        this->_S_move(__p, __s, __nleft);
+        this->_S_copy(__p + __nleft, __p + __len2,
+        __len2 - __nleft);
+      }
+  }
+     }
+ }
+      else
+ this->_M_mutate(__pos, __len1, __s, __len2);
+
+      this->_M_set_length(__new_size);
+      return *this;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    typename basic_string<_CharT, _Traits, _Alloc>::size_type
+    basic_string<_CharT, _Traits, _Alloc>::
+    copy(_CharT* __s, size_type __n, size_type __pos) const
+    {
+      _M_check(__pos, "basic_string::copy");
+      __n = _M_limit(__pos, __n);
+      ;
+      if (__n)
+ _S_copy(__s, _M_data() + __pos, __n);
+
+      return __n;
+    }
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_string<_CharT, _Traits, _Alloc>
+    operator+(const _CharT* __lhs,
+       const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+    {
+      ;
+      typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
+      typedef typename __string_type::size_type __size_type;
+      const __size_type __len = _Traits::length(__lhs);
+      __string_type __str;
+      __str.reserve(__len + __rhs.size());
+      __str.append(__lhs, __len);
+      __str.append(__rhs);
+      return __str;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_string<_CharT, _Traits, _Alloc>
+    operator+(_CharT __lhs, const basic_string<_CharT, _Traits, _Alloc>& __rhs)
+    {
+      typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
+      typedef typename __string_type::size_type __size_type;
+      __string_type __str;
+      const __size_type __len = __rhs.size();
+      __str.reserve(__len + 1);
+      __str.append(__size_type(1), __lhs);
+      __str.append(__rhs);
+      return __str;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    typename basic_string<_CharT, _Traits, _Alloc>::size_type
+    basic_string<_CharT, _Traits, _Alloc>::
+    find(const _CharT* __s, size_type __pos, size_type __n) const
+    noexcept
+    {
+      ;
+      const size_type __size = this->size();
+
+      if (__n == 0)
+ return __pos <= __size ? __pos : npos;
+      if (__pos >= __size)
+ return npos;
+
+      const _CharT __elem0 = __s[0];
+      const _CharT* const __data = data();
+      const _CharT* __first = __data + __pos;
+      const _CharT* const __last = __data + __size;
+      size_type __len = __size - __pos;
+
+      while (__len >= __n)
+ {
+
+   __first = traits_type::find(__first, __len - __n + 1, __elem0);
+   if (!__first)
+     return npos;
+
+
+
+   if (traits_type::compare(__first, __s, __n) == 0)
+     return __first - __data;
+   __len = __last - ++__first;
+ }
+      return npos;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    typename basic_string<_CharT, _Traits, _Alloc>::size_type
+    basic_string<_CharT, _Traits, _Alloc>::
+    find(_CharT __c, size_type __pos) const noexcept
+    {
+      size_type __ret = npos;
+      const size_type __size = this->size();
+      if (__pos < __size)
+ {
+   const _CharT* __data = _M_data();
+   const size_type __n = __size - __pos;
+   const _CharT* __p = traits_type::find(__data + __pos, __n, __c);
+   if (__p)
+     __ret = __p - __data;
+ }
+      return __ret;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    typename basic_string<_CharT, _Traits, _Alloc>::size_type
+    basic_string<_CharT, _Traits, _Alloc>::
+    rfind(const _CharT* __s, size_type __pos, size_type __n) const
+    noexcept
+    {
+      ;
+      const size_type __size = this->size();
+      if (__n <= __size)
+ {
+   __pos = std::min(size_type(__size - __n), __pos);
+   const _CharT* __data = _M_data();
+   do
+     {
+       if (traits_type::compare(__data + __pos, __s, __n) == 0)
+  return __pos;
+     }
+   while (__pos-- > 0);
+ }
+      return npos;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    typename basic_string<_CharT, _Traits, _Alloc>::size_type
+    basic_string<_CharT, _Traits, _Alloc>::
+    rfind(_CharT __c, size_type __pos) const noexcept
+    {
+      size_type __size = this->size();
+      if (__size)
+ {
+   if (--__size > __pos)
+     __size = __pos;
+   for (++__size; __size-- > 0; )
+     if (traits_type::eq(_M_data()[__size], __c))
+       return __size;
+ }
+      return npos;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    typename basic_string<_CharT, _Traits, _Alloc>::size_type
+    basic_string<_CharT, _Traits, _Alloc>::
+    find_first_of(const _CharT* __s, size_type __pos, size_type __n) const
+    noexcept
+    {
+      ;
+      for (; __n && __pos < this->size(); ++__pos)
+ {
+   const _CharT* __p = traits_type::find(__s, __n, _M_data()[__pos]);
+   if (__p)
+     return __pos;
+ }
+      return npos;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    typename basic_string<_CharT, _Traits, _Alloc>::size_type
+    basic_string<_CharT, _Traits, _Alloc>::
+    find_last_of(const _CharT* __s, size_type __pos, size_type __n) const
+    noexcept
+    {
+      ;
+      size_type __size = this->size();
+      if (__size && __n)
+ {
+   if (--__size > __pos)
+     __size = __pos;
+   do
+     {
+       if (traits_type::find(__s, __n, _M_data()[__size]))
+  return __size;
+     }
+   while (__size-- != 0);
+ }
+      return npos;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    typename basic_string<_CharT, _Traits, _Alloc>::size_type
+    basic_string<_CharT, _Traits, _Alloc>::
+    find_first_not_of(const _CharT* __s, size_type __pos, size_type __n) const
+    noexcept
+    {
+      ;
+      for (; __pos < this->size(); ++__pos)
+ if (!traits_type::find(__s, __n, _M_data()[__pos]))
+   return __pos;
+      return npos;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    typename basic_string<_CharT, _Traits, _Alloc>::size_type
+    basic_string<_CharT, _Traits, _Alloc>::
+    find_first_not_of(_CharT __c, size_type __pos) const noexcept
+    {
+      for (; __pos < this->size(); ++__pos)
+ if (!traits_type::eq(_M_data()[__pos], __c))
+   return __pos;
+      return npos;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    typename basic_string<_CharT, _Traits, _Alloc>::size_type
+    basic_string<_CharT, _Traits, _Alloc>::
+    find_last_not_of(const _CharT* __s, size_type __pos, size_type __n) const
+    noexcept
+    {
+      ;
+      size_type __size = this->size();
+      if (__size)
+ {
+   if (--__size > __pos)
+     __size = __pos;
+   do
+     {
+       if (!traits_type::find(__s, __n, _M_data()[__size]))
+  return __size;
+     }
+   while (__size--);
+ }
+      return npos;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    typename basic_string<_CharT, _Traits, _Alloc>::size_type
+    basic_string<_CharT, _Traits, _Alloc>::
+    find_last_not_of(_CharT __c, size_type __pos) const noexcept
+    {
+      size_type __size = this->size();
+      if (__size)
+ {
+   if (--__size > __pos)
+     __size = __pos;
+   do
+     {
+       if (!traits_type::eq(_M_data()[__size], __c))
+  return __size;
+     }
+   while (__size--);
+ }
+      return npos;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    int
+    basic_string<_CharT, _Traits, _Alloc>::
+    compare(size_type __pos, size_type __n, const basic_string& __str) const
+    {
+      _M_check(__pos, "basic_string::compare");
+      __n = _M_limit(__pos, __n);
+      const size_type __osize = __str.size();
+      const size_type __len = std::min(__n, __osize);
+      int __r = traits_type::compare(_M_data() + __pos, __str.data(), __len);
+      if (!__r)
+ __r = _S_compare(__n, __osize);
+      return __r;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    int
+    basic_string<_CharT, _Traits, _Alloc>::
+    compare(size_type __pos1, size_type __n1, const basic_string& __str,
+     size_type __pos2, size_type __n2) const
+    {
+      _M_check(__pos1, "basic_string::compare");
+      __str._M_check(__pos2, "basic_string::compare");
+      __n1 = _M_limit(__pos1, __n1);
+      __n2 = __str._M_limit(__pos2, __n2);
+      const size_type __len = std::min(__n1, __n2);
+      int __r = traits_type::compare(_M_data() + __pos1,
+         __str.data() + __pos2, __len);
+      if (!__r)
+ __r = _S_compare(__n1, __n2);
+      return __r;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    int
+    basic_string<_CharT, _Traits, _Alloc>::
+    compare(const _CharT* __s) const noexcept
+    {
+      ;
+      const size_type __size = this->size();
+      const size_type __osize = traits_type::length(__s);
+      const size_type __len = std::min(__size, __osize);
+      int __r = traits_type::compare(_M_data(), __s, __len);
+      if (!__r)
+ __r = _S_compare(__size, __osize);
+      return __r;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    int
+    basic_string <_CharT, _Traits, _Alloc>::
+    compare(size_type __pos, size_type __n1, const _CharT* __s) const
+    {
+      ;
+      _M_check(__pos, "basic_string::compare");
+      __n1 = _M_limit(__pos, __n1);
+      const size_type __osize = traits_type::length(__s);
+      const size_type __len = std::min(__n1, __osize);
+      int __r = traits_type::compare(_M_data() + __pos, __s, __len);
+      if (!__r)
+ __r = _S_compare(__n1, __osize);
+      return __r;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    int
+    basic_string <_CharT, _Traits, _Alloc>::
+    compare(size_type __pos, size_type __n1, const _CharT* __s,
+     size_type __n2) const
+    {
+      ;
+      _M_check(__pos, "basic_string::compare");
+      __n1 = _M_limit(__pos, __n1);
+      const size_type __len = std::min(__n1, __n2);
+      int __r = traits_type::compare(_M_data() + __pos, __s, __len);
+      if (!__r)
+ __r = _S_compare(__n1, __n2);
+      return __r;
+    }
+
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_istream<_CharT, _Traits>&
+    operator>>(basic_istream<_CharT, _Traits>& __in,
+        basic_string<_CharT, _Traits, _Alloc>& __str)
+    {
+      typedef basic_istream<_CharT, _Traits> __istream_type;
+      typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
+      typedef typename __istream_type::ios_base __ios_base;
+      typedef typename __istream_type::int_type __int_type;
+      typedef typename __string_type::size_type __size_type;
+      typedef ctype<_CharT> __ctype_type;
+      typedef typename __ctype_type::ctype_base __ctype_base;
+
+      __size_type __extracted = 0;
+      typename __ios_base::iostate __err = __ios_base::goodbit;
+      typename __istream_type::sentry __cerb(__in, false);
+      if (__cerb)
+ {
+   try
+     {
+
+       __str.erase();
+       _CharT __buf[128];
+       __size_type __len = 0;
+       const streamsize __w = __in.width();
+       const __size_type __n = __w > 0 ? static_cast<__size_type>(__w)
+                                : __str.max_size();
+       const __ctype_type& __ct = use_facet<__ctype_type>(__in.getloc());
+       const __int_type __eof = _Traits::eof();
+       __int_type __c = __in.rdbuf()->sgetc();
+
+       while (__extracted < __n
+       && !_Traits::eq_int_type(__c, __eof)
+       && !__ct.is(__ctype_base::space,
+     _Traits::to_char_type(__c)))
+  {
+    if (__len == sizeof(__buf) / sizeof(_CharT))
+      {
+        __str.append(__buf, sizeof(__buf) / sizeof(_CharT));
+        __len = 0;
+      }
+    __buf[__len++] = _Traits::to_char_type(__c);
+    ++__extracted;
+    __c = __in.rdbuf()->snextc();
+  }
+       __str.append(__buf, __len);
+
+       if (_Traits::eq_int_type(__c, __eof))
+  __err |= __ios_base::eofbit;
+       __in.width(0);
+     }
+   catch(__cxxabiv1::__forced_unwind&)
+     {
+       __in._M_setstate(__ios_base::badbit);
+       throw;
+     }
+   catch(...)
+     {
+
+
+
+       __in._M_setstate(__ios_base::badbit);
+     }
+ }
+
+      if (!__extracted)
+ __err |= __ios_base::failbit;
+      if (__err)
+ __in.setstate(__err);
+      return __in;
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_istream<_CharT, _Traits>&
+    getline(basic_istream<_CharT, _Traits>& __in,
+     basic_string<_CharT, _Traits, _Alloc>& __str, _CharT __delim)
+    {
+      typedef basic_istream<_CharT, _Traits> __istream_type;
+      typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
+      typedef typename __istream_type::ios_base __ios_base;
+      typedef typename __istream_type::int_type __int_type;
+      typedef typename __string_type::size_type __size_type;
+
+      __size_type __extracted = 0;
+      const __size_type __n = __str.max_size();
+      typename __ios_base::iostate __err = __ios_base::goodbit;
+      typename __istream_type::sentry __cerb(__in, true);
+      if (__cerb)
+ {
+   try
+     {
+       __str.erase();
+       const __int_type __idelim = _Traits::to_int_type(__delim);
+       const __int_type __eof = _Traits::eof();
+       __int_type __c = __in.rdbuf()->sgetc();
+
+       while (__extracted < __n
+       && !_Traits::eq_int_type(__c, __eof)
+       && !_Traits::eq_int_type(__c, __idelim))
+  {
+    __str += _Traits::to_char_type(__c);
+    ++__extracted;
+    __c = __in.rdbuf()->snextc();
+  }
+
+       if (_Traits::eq_int_type(__c, __eof))
+  __err |= __ios_base::eofbit;
+       else if (_Traits::eq_int_type(__c, __idelim))
+  {
+    ++__extracted;
+    __in.rdbuf()->sbumpc();
+  }
+       else
+  __err |= __ios_base::failbit;
+     }
+   catch(__cxxabiv1::__forced_unwind&)
+     {
+       __in._M_setstate(__ios_base::badbit);
+       throw;
+     }
+   catch(...)
+     {
+
+
+
+       __in._M_setstate(__ios_base::badbit);
+     }
+ }
+      if (!__extracted)
+ __err |= __ios_base::failbit;
+      if (__err)
+ __in.setstate(__err);
+      return __in;
+    }
+  extern template class basic_string<char>;
+
+
+
+
+
+
+
+  extern template
+    basic_istream<char>&
+    operator>>(basic_istream<char>&, string&);
+  extern template
+    basic_ostream<char>&
+    operator<<(basic_ostream<char>&, const string&);
+  extern template
+    basic_istream<char>&
+    getline(basic_istream<char>&, string&, char);
+  extern template
+    basic_istream<char>&
+    getline(basic_istream<char>&, string&);
+
+
+
+  extern template class basic_string<wchar_t>;
+
+
+
+
+
+  extern template
+    basic_istream<wchar_t>&
+    operator>>(basic_istream<wchar_t>&, wstring&);
+  extern template
+    basic_ostream<wchar_t>&
+    operator<<(basic_ostream<wchar_t>&, const wstring&);
+  extern template
+    basic_istream<wchar_t>&
+    getline(basic_istream<wchar_t>&, wstring&, wchar_t);
+  extern template
+    basic_istream<wchar_t>&
+    getline(basic_istream<wchar_t>&, wstring&);
+
+
+
+
+}
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+  class locale
+  {
+  public:
+
+
+    typedef int category;
+
+
+    class facet;
+    class id;
+    class _Impl;
+
+    friend class facet;
+    friend class _Impl;
+
+    template<typename _Facet>
+      friend bool
+      has_facet(const locale&) throw();
+
+    template<typename _Facet>
+      friend const _Facet&
+      use_facet(const locale&);
+
+    template<typename _Cache>
+      friend struct __use_cache;
+    static const category none = 0;
+    static const category ctype = 1L << 0;
+    static const category numeric = 1L << 1;
+    static const category collate = 1L << 2;
+    static const category time = 1L << 3;
+    static const category monetary = 1L << 4;
+    static const category messages = 1L << 5;
+    static const category all = (ctype | numeric | collate |
+        time | monetary | messages);
+    locale() throw();
+    locale(const locale& __other) throw();
+    explicit
+    locale(const char* __s);
+    locale(const locale& __base, const char* __s, category __cat);
+    explicit
+    locale(const std::string& __s) : locale(__s.c_str()) { }
+    locale(const locale& __base, const std::string& __s, category __cat)
+    : locale(__base, __s.c_str(), __cat) { }
+    locale(const locale& __base, const locale& __add, category __cat);
+    template<typename _Facet>
+      locale(const locale& __other, _Facet* __f);
+
+
+    ~locale() throw();
+    const locale&
+    operator=(const locale& __other) throw();
+    template<typename _Facet>
+      locale
+      combine(const locale& __other) const;
+
+
+
+
+
+
+    __attribute ((__abi_tag__ ("cxx11")))
+    string
+    name() const;
+    bool
+    operator==(const locale& __other) const throw();
+
+
+
+
+
+
+
+    bool
+    operator!=(const locale& __other) const throw()
+    { return !(this->operator==(__other)); }
+    template<typename _Char, typename _Traits, typename _Alloc>
+      bool
+      operator()(const basic_string<_Char, _Traits, _Alloc>& __s1,
+   const basic_string<_Char, _Traits, _Alloc>& __s2) const;
+    static locale
+    global(const locale& __loc);
+
+
+
+
+    static const locale&
+    classic();
+
+  private:
+
+    _Impl* _M_impl;
+
+
+    static _Impl* _S_classic;
+
+
+    static _Impl* _S_global;
+
+
+
+
+
+    static const char* const* const _S_categories;
+    enum { _S_categories_size = 6 + 6 };
+
+
+    static __gthread_once_t _S_once;
+
+
+    explicit
+    locale(_Impl*) throw();
+
+    static void
+    _S_initialize();
+
+    static void
+    _S_initialize_once() throw();
+
+    static category
+    _S_normalize_category(category);
+
+    void
+    _M_coalesce(const locale& __base, const locale& __add, category __cat);
+
+
+    static const id* const _S_twinned_facets[];
+
+  };
+  class locale::facet
+  {
+  private:
+    friend class locale;
+    friend class locale::_Impl;
+
+    mutable _Atomic_word _M_refcount;
+
+
+    static __c_locale _S_c_locale;
+
+
+    static const char _S_c_name[2];
+
+
+    static __gthread_once_t _S_once;
+
+
+    static void
+    _S_initialize_once();
+
+  protected:
+    explicit
+    facet(size_t __refs = 0) throw() : _M_refcount(__refs ? 1 : 0)
+    { }
+
+
+    virtual
+    ~facet();
+
+    static void
+    _S_create_c_locale(__c_locale& __cloc, const char* __s,
+         __c_locale __old = 0);
+
+    static __c_locale
+    _S_clone_c_locale(__c_locale& __cloc) throw();
+
+    static void
+    _S_destroy_c_locale(__c_locale& __cloc);
+
+    static __c_locale
+    _S_lc_ctype_c_locale(__c_locale __cloc, const char* __s);
+
+
+
+    static __c_locale
+    _S_get_c_locale();
+
+    __attribute__ ((__const__)) static const char*
+    _S_get_c_name() throw();
+    facet(const facet&) = delete;
+
+    facet&
+    operator=(const facet&) = delete;
+
+
+  private:
+    void
+    _M_add_reference() const throw()
+    { __gnu_cxx::__atomic_add_dispatch(&_M_refcount, 1); }
+
+    void
+    _M_remove_reference() const throw()
+    {
+
+      ;
+      if (__gnu_cxx::__exchange_and_add_dispatch(&_M_refcount, -1) == 1)
+ {
+          ;
+   try
+     { delete this; }
+   catch(...)
+     { }
+ }
+    }
+
+    const facet* _M_sso_shim(const id*) const;
+    const facet* _M_cow_shim(const id*) const;
+
+  protected:
+    class __shim;
+  };
+  class locale::id
+  {
+  private:
+    friend class locale;
+    friend class locale::_Impl;
+
+    template<typename _Facet>
+      friend const _Facet&
+      use_facet(const locale&);
+
+    template<typename _Facet>
+      friend bool
+      has_facet(const locale&) throw();
+
+
+
+
+    mutable size_t _M_index;
+
+
+    static _Atomic_word _S_refcount;
+
+    void
+    operator=(const id&);
+
+    id(const id&);
+
+  public:
+
+
+
+    id() { }
+
+    size_t
+    _M_id() const throw();
+  };
+
+
+
+  class locale::_Impl
+  {
+  public:
+
+    friend class locale;
+    friend class locale::facet;
+
+    template<typename _Facet>
+      friend bool
+      has_facet(const locale&) throw();
+
+    template<typename _Facet>
+      friend const _Facet&
+      use_facet(const locale&);
+
+    template<typename _Cache>
+      friend struct __use_cache;
+
+  private:
+
+    _Atomic_word _M_refcount;
+    const facet** _M_facets;
+    size_t _M_facets_size;
+    const facet** _M_caches;
+    char** _M_names;
+    static const locale::id* const _S_id_ctype[];
+    static const locale::id* const _S_id_numeric[];
+    static const locale::id* const _S_id_collate[];
+    static const locale::id* const _S_id_time[];
+    static const locale::id* const _S_id_monetary[];
+    static const locale::id* const _S_id_messages[];
+    static const locale::id* const* const _S_facet_categories[];
+
+    void
+    _M_add_reference() throw()
+    { __gnu_cxx::__atomic_add_dispatch(&_M_refcount, 1); }
+
+    void
+    _M_remove_reference() throw()
+    {
+
+      ;
+      if (__gnu_cxx::__exchange_and_add_dispatch(&_M_refcount, -1) == 1)
+ {
+          ;
+   try
+     { delete this; }
+   catch(...)
+     { }
+ }
+    }
+
+    _Impl(const _Impl&, size_t);
+    _Impl(const char*, size_t);
+    _Impl(size_t) throw();
+
+   ~_Impl() throw();
+
+    _Impl(const _Impl&);
+
+    void
+    operator=(const _Impl&);
+
+    bool
+    _M_check_same_name()
+    {
+      bool __ret = true;
+      if (_M_names[1])
+
+ for (size_t __i = 0; __ret && __i < _S_categories_size - 1; ++__i)
+   __ret = __builtin_strcmp(_M_names[__i], _M_names[__i + 1]) == 0;
+      return __ret;
+    }
+
+    void
+    _M_replace_categories(const _Impl*, category);
+
+    void
+    _M_replace_category(const _Impl*, const locale::id* const*);
+
+    void
+    _M_replace_facet(const _Impl*, const locale::id*);
+
+    void
+    _M_install_facet(const locale::id*, const facet*);
+
+    template<typename _Facet>
+      void
+      _M_init_facet(_Facet* __facet)
+      { _M_install_facet(&_Facet::id, __facet); }
+
+    template<typename _Facet>
+      void
+      _M_init_facet_unchecked(_Facet* __facet)
+      {
+ __facet->_M_add_reference();
+ _M_facets[_Facet::id._M_id()] = __facet;
+      }
+
+    void
+    _M_install_cache(const facet*, size_t);
+
+    void _M_init_extra(facet**);
+    void _M_init_extra(void*, void*, const char*, const char*);
+  };
+  template<typename _CharT>
+    class __cxx11:: collate : public locale::facet
+    {
+    public:
+
+
+
+      typedef _CharT char_type;
+      typedef basic_string<_CharT> string_type;
+
+
+    protected:
+
+
+      __c_locale _M_c_locale_collate;
+
+    public:
+
+      static locale::id id;
+      explicit
+      collate(size_t __refs = 0)
+      : facet(__refs), _M_c_locale_collate(_S_get_c_locale())
+      { }
+      explicit
+      collate(__c_locale __cloc, size_t __refs = 0)
+      : facet(__refs), _M_c_locale_collate(_S_clone_c_locale(__cloc))
+      { }
+      int
+      compare(const _CharT* __lo1, const _CharT* __hi1,
+       const _CharT* __lo2, const _CharT* __hi2) const
+      { return this->do_compare(__lo1, __hi1, __lo2, __hi2); }
+      string_type
+      transform(const _CharT* __lo, const _CharT* __hi) const
+      { return this->do_transform(__lo, __hi); }
+      long
+      hash(const _CharT* __lo, const _CharT* __hi) const
+      { return this->do_hash(__lo, __hi); }
+
+
+      int
+      _M_compare(const _CharT*, const _CharT*) const throw();
+
+      size_t
+      _M_transform(_CharT*, const _CharT*, size_t) const throw();
+
+  protected:
+
+      virtual
+      ~collate()
+      { _S_destroy_c_locale(_M_c_locale_collate); }
+      virtual int
+      do_compare(const _CharT* __lo1, const _CharT* __hi1,
+   const _CharT* __lo2, const _CharT* __hi2) const;
+      virtual string_type
+      do_transform(const _CharT* __lo, const _CharT* __hi) const;
+      virtual long
+      do_hash(const _CharT* __lo, const _CharT* __hi) const;
+    };
+
+  template<typename _CharT>
+    locale::id collate<_CharT>::id;
+
+
+  template<>
+    int
+    collate<char>::_M_compare(const char*, const char*) const throw();
+
+  template<>
+    size_t
+    collate<char>::_M_transform(char*, const char*, size_t) const throw();
+
+
+  template<>
+    int
+    collate<wchar_t>::_M_compare(const wchar_t*, const wchar_t*) const throw();
+
+  template<>
+    size_t
+    collate<wchar_t>::_M_transform(wchar_t*, const wchar_t*, size_t) const throw();
+
+
+
+  template<typename _CharT>
+    class __cxx11:: collate_byname : public collate<_CharT>
+    {
+    public:
+
+
+      typedef _CharT char_type;
+      typedef basic_string<_CharT> string_type;
+
+
+      explicit
+      collate_byname(const char* __s, size_t __refs = 0)
+      : collate<_CharT>(__refs)
+      {
+ if (__builtin_strcmp(__s, "C") != 0
+     && __builtin_strcmp(__s, "POSIX") != 0)
+   {
+     this->_S_destroy_c_locale(this->_M_c_locale_collate);
+     this->_S_create_c_locale(this->_M_c_locale_collate, __s);
+   }
+      }
+
+
+      explicit
+      collate_byname(const string& __s, size_t __refs = 0)
+      : collate_byname(__s.c_str(), __refs) { }
+
+
+    protected:
+      virtual
+      ~collate_byname() { }
+    };
+
+
+}
+
+       
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+  template<typename _Facet>
+    locale::
+    locale(const locale& __other, _Facet* __f)
+    {
+      _M_impl = new _Impl(*__other._M_impl, 1);
+
+      try
+ { _M_impl->_M_install_facet(&_Facet::id, __f); }
+      catch(...)
+ {
+   _M_impl->_M_remove_reference();
+   throw;
+ }
+      delete [] _M_impl->_M_names[0];
+      _M_impl->_M_names[0] = 0;
+    }
+
+  template<typename _Facet>
+    locale
+    locale::
+    combine(const locale& __other) const
+    {
+      _Impl* __tmp = new _Impl(*_M_impl, 1);
+      try
+ {
+   __tmp->_M_replace_facet(__other._M_impl, &_Facet::id);
+ }
+      catch(...)
+ {
+   __tmp->_M_remove_reference();
+   throw;
+ }
+      return locale(__tmp);
+    }
+
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    bool
+    locale::
+    operator()(const basic_string<_CharT, _Traits, _Alloc>& __s1,
+        const basic_string<_CharT, _Traits, _Alloc>& __s2) const
+    {
+      typedef std::collate<_CharT> __collate_type;
+      const __collate_type& __collate = use_facet<__collate_type>(*this);
+      return (__collate.compare(__s1.data(), __s1.data() + __s1.length(),
+    __s2.data(), __s2.data() + __s2.length()) < 0);
+    }
+  template<typename _Facet>
+    bool
+    has_facet(const locale& __loc) throw()
+    {
+      const size_t __i = _Facet::id._M_id();
+      const locale::facet** __facets = __loc._M_impl->_M_facets;
+      return (__i < __loc._M_impl->_M_facets_size
+
+       && dynamic_cast<const _Facet*>(__facets[__i]));
+
+
+
+    }
+  template<typename _Facet>
+    const _Facet&
+    use_facet(const locale& __loc)
+    {
+      const size_t __i = _Facet::id._M_id();
+      const locale::facet** __facets = __loc._M_impl->_M_facets;
+      if (__i >= __loc._M_impl->_M_facets_size || !__facets[__i])
+        __throw_bad_cast();
+
+      return dynamic_cast<const _Facet&>(*__facets[__i]);
+
+
+
+    }
+
+
+
+  template<typename _CharT>
+    int
+    collate<_CharT>::_M_compare(const _CharT*, const _CharT*) const throw ()
+    { return 0; }
+
+
+  template<typename _CharT>
+    size_t
+    collate<_CharT>::_M_transform(_CharT*, const _CharT*, size_t) const throw ()
+    { return 0; }
+
+  template<typename _CharT>
+    int
+    collate<_CharT>::
+    do_compare(const _CharT* __lo1, const _CharT* __hi1,
+        const _CharT* __lo2, const _CharT* __hi2) const
+    {
+
+
+      const string_type __one(__lo1, __hi1);
+      const string_type __two(__lo2, __hi2);
+
+      const _CharT* __p = __one.c_str();
+      const _CharT* __pend = __one.data() + __one.length();
+      const _CharT* __q = __two.c_str();
+      const _CharT* __qend = __two.data() + __two.length();
+
+
+
+
+      for (;;)
+ {
+   const int __res = _M_compare(__p, __q);
+   if (__res)
+     return __res;
+
+   __p += char_traits<_CharT>::length(__p);
+   __q += char_traits<_CharT>::length(__q);
+   if (__p == __pend && __q == __qend)
+     return 0;
+   else if (__p == __pend)
+     return -1;
+   else if (__q == __qend)
+     return 1;
+
+   __p++;
+   __q++;
+ }
+    }
+
+  template<typename _CharT>
+    typename collate<_CharT>::string_type
+    collate<_CharT>::
+    do_transform(const _CharT* __lo, const _CharT* __hi) const
+    {
+      string_type __ret;
+
+
+      const string_type __str(__lo, __hi);
+
+      const _CharT* __p = __str.c_str();
+      const _CharT* __pend = __str.data() + __str.length();
+
+      size_t __len = (__hi - __lo) * 2;
+
+      _CharT* __c = new _CharT[__len];
+
+      try
+ {
+
+
+
+   for (;;)
+     {
+
+       size_t __res = _M_transform(__c, __p, __len);
+
+
+       if (__res >= __len)
+  {
+    __len = __res + 1;
+    delete [] __c, __c = 0;
+    __c = new _CharT[__len];
+    __res = _M_transform(__c, __p, __len);
+  }
+
+       __ret.append(__c, __res);
+       __p += char_traits<_CharT>::length(__p);
+       if (__p == __pend)
+  break;
+
+       __p++;
+       __ret.push_back(_CharT());
+     }
+ }
+      catch(...)
+ {
+   delete [] __c;
+   throw;
+ }
+
+      delete [] __c;
+
+      return __ret;
+    }
+
+  template<typename _CharT>
+    long
+    collate<_CharT>::
+    do_hash(const _CharT* __lo, const _CharT* __hi) const
+    {
+      unsigned long __val = 0;
+      for (; __lo < __hi; ++__lo)
+ __val =
+   *__lo + ((__val << 7)
+     | (__val >> (__gnu_cxx::__numeric_traits<unsigned long>::
+    __digits - 7)));
+      return static_cast<long>(__val);
+    }
+
+
+
+
+  extern template class collate<char>;
+  extern template class collate_byname<char>;
+
+  extern template
+    const collate<char>&
+    use_facet<collate<char> >(const locale&);
+
+  extern template
+    bool
+    has_facet<collate<char> >(const locale&);
+
+
+  extern template class collate<wchar_t>;
+  extern template class collate_byname<wchar_t>;
+
+  extern template
+    const collate<wchar_t>&
+    use_facet<collate<wchar_t> >(const locale&);
+
+  extern template
+    bool
+    has_facet<collate<wchar_t> >(const locale&);
+
+
+
+
+}
+
+
+
+
+       
+
+
+
+
+
+
+       
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+  enum class errc
+    {
+      address_family_not_supported = 97,
+      address_in_use = 98,
+      address_not_available = 99,
+      already_connected = 106,
+      argument_list_too_long = 7,
+      argument_out_of_domain = 33,
+      bad_address = 14,
+      bad_file_descriptor = 9,
+
+
+      bad_message = 74,
+
+
+      broken_pipe = 32,
+      connection_aborted = 103,
+      connection_already_in_progress = 114,
+      connection_refused = 111,
+      connection_reset = 104,
+      cross_device_link = 18,
+      destination_address_required = 89,
+      device_or_resource_busy = 16,
+      directory_not_empty = 39,
+      executable_format_error = 8,
+      file_exists = 17,
+      file_too_large = 27,
+      filename_too_long = 36,
+      function_not_supported = 38,
+      host_unreachable = 113,
+
+
+      identifier_removed = 43,
+
+
+      illegal_byte_sequence = 84,
+      inappropriate_io_control_operation = 25,
+      interrupted = 4,
+      invalid_argument = 22,
+      invalid_seek = 29,
+      io_error = 5,
+      is_a_directory = 21,
+      message_size = 90,
+      network_down = 100,
+      network_reset = 102,
+      network_unreachable = 101,
+      no_buffer_space = 105,
+      no_child_process = 10,
+
+
+      no_link = 67,
+
+
+      no_lock_available = 37,
+
+
+      no_message_available = 61,
+
+
+      no_message = 42,
+      no_protocol_option = 92,
+      no_space_on_device = 28,
+
+
+      no_stream_resources = 63,
+
+
+      no_such_device_or_address = 6,
+      no_such_device = 19,
+      no_such_file_or_directory = 2,
+      no_such_process = 3,
+      not_a_directory = 20,
+      not_a_socket = 88,
+
+
+      not_a_stream = 60,
+
+
+      not_connected = 107,
+      not_enough_memory = 12,
+
+
+      not_supported = 95,
+
+
+
+      operation_canceled = 125,
+
+
+      operation_in_progress = 115,
+      operation_not_permitted = 1,
+      operation_not_supported = 95,
+      operation_would_block = 11,
+
+
+      owner_dead = 130,
+
+
+      permission_denied = 13,
+
+
+      protocol_error = 71,
+
+
+      protocol_not_supported = 93,
+      read_only_file_system = 30,
+      resource_deadlock_would_occur = 35,
+      resource_unavailable_try_again = 11,
+      result_out_of_range = 34,
+
+
+      state_not_recoverable = 131,
+
+
+
+      stream_timeout = 62,
+
+
+
+      text_file_busy = 26,
+
+
+      timed_out = 110,
+      too_many_files_open_in_system = 23,
+      too_many_files_open = 24,
+      too_many_links = 31,
+      too_many_symbolic_link_levels = 40,
+
+
+      value_too_large = 75,
+
+
+      wrong_protocol_type = 91
+    };
+
+
+}
+
+       
+
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+
+
+  struct __cow_string
+  {
+    union {
+      const char* _M_p;
+      char _M_bytes[sizeof(const char*)];
+    };
+
+    __cow_string();
+    __cow_string(const std::string&);
+    __cow_string(const char*, size_t);
+    __cow_string(const __cow_string&) noexcept;
+    __cow_string& operator=(const __cow_string&) noexcept;
+    ~__cow_string();
+
+    __cow_string(__cow_string&&) noexcept;
+    __cow_string& operator=(__cow_string&&) noexcept;
+
+  };
+
+  typedef basic_string<char> __sso_string;
+  class logic_error : public exception
+  {
+    __cow_string _M_msg;
+
+  public:
+
+    explicit
+    logic_error(const string& __arg) ;
+
+
+    explicit
+    logic_error(const char*) ;
+
+    logic_error(logic_error&&) noexcept;
+    logic_error& operator=(logic_error&&) noexcept;
+
+
+
+    logic_error(const logic_error&) noexcept;
+    logic_error& operator=(const logic_error&) noexcept;
+
+
+
+
+
+    virtual ~logic_error() noexcept;
+
+
+
+    virtual const char*
+    what() const noexcept;
+
+
+
+
+
+  };
+
+
+
+  class domain_error : public logic_error
+  {
+  public:
+    explicit domain_error(const string& __arg) ;
+
+    explicit domain_error(const char*) ;
+    domain_error(const domain_error&) = default;
+    domain_error& operator=(const domain_error&) = default;
+    domain_error(domain_error&&) = default;
+    domain_error& operator=(domain_error&&) = default;
+
+    virtual ~domain_error() noexcept;
+  };
+
+
+  class invalid_argument : public logic_error
+  {
+  public:
+    explicit invalid_argument(const string& __arg) ;
+
+    explicit invalid_argument(const char*) ;
+    invalid_argument(const invalid_argument&) = default;
+    invalid_argument& operator=(const invalid_argument&) = default;
+    invalid_argument(invalid_argument&&) = default;
+    invalid_argument& operator=(invalid_argument&&) = default;
+
+    virtual ~invalid_argument() noexcept;
+  };
+
+
+
+  class length_error : public logic_error
+  {
+  public:
+    explicit length_error(const string& __arg) ;
+
+    explicit length_error(const char*) ;
+    length_error(const length_error&) = default;
+    length_error& operator=(const length_error&) = default;
+    length_error(length_error&&) = default;
+    length_error& operator=(length_error&&) = default;
+
+    virtual ~length_error() noexcept;
+  };
+
+
+
+  class out_of_range : public logic_error
+  {
+  public:
+    explicit out_of_range(const string& __arg) ;
+
+    explicit out_of_range(const char*) ;
+    out_of_range(const out_of_range&) = default;
+    out_of_range& operator=(const out_of_range&) = default;
+    out_of_range(out_of_range&&) = default;
+    out_of_range& operator=(out_of_range&&) = default;
+
+    virtual ~out_of_range() noexcept;
+  };
+
+
+
+
+
+
+  class runtime_error : public exception
+  {
+    __cow_string _M_msg;
+
+  public:
+
+    explicit
+    runtime_error(const string& __arg) ;
+
+
+    explicit
+    runtime_error(const char*) ;
+
+    runtime_error(runtime_error&&) noexcept;
+    runtime_error& operator=(runtime_error&&) noexcept;
+
+
+
+    runtime_error(const runtime_error&) noexcept;
+    runtime_error& operator=(const runtime_error&) noexcept;
+
+
+
+
+
+    virtual ~runtime_error() noexcept;
+
+
+
+    virtual const char*
+    what() const noexcept;
+
+
+
+
+
+  };
+
+
+  class range_error : public runtime_error
+  {
+  public:
+    explicit range_error(const string& __arg) ;
+
+    explicit range_error(const char*) ;
+    range_error(const range_error&) = default;
+    range_error& operator=(const range_error&) = default;
+    range_error(range_error&&) = default;
+    range_error& operator=(range_error&&) = default;
+
+    virtual ~range_error() noexcept;
+  };
+
+
+  class overflow_error : public runtime_error
+  {
+  public:
+    explicit overflow_error(const string& __arg) ;
+
+    explicit overflow_error(const char*) ;
+    overflow_error(const overflow_error&) = default;
+    overflow_error& operator=(const overflow_error&) = default;
+    overflow_error(overflow_error&&) = default;
+    overflow_error& operator=(overflow_error&&) = default;
+
+    virtual ~overflow_error() noexcept;
+  };
+
+
+  class underflow_error : public runtime_error
+  {
+  public:
+    explicit underflow_error(const string& __arg) ;
+
+    explicit underflow_error(const char*) ;
+    underflow_error(const underflow_error&) = default;
+    underflow_error& operator=(const underflow_error&) = default;
+    underflow_error(underflow_error&&) = default;
+    underflow_error& operator=(underflow_error&&) = default;
+
+    virtual ~underflow_error() noexcept;
+  };
+
+
+
+
+}
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+  class error_code;
+  class error_condition;
+  class system_error;
+
+
+  template<typename _Tp>
+    struct is_error_code_enum : public false_type { };
+
+
+  template<typename _Tp>
+    struct is_error_condition_enum : public false_type { };
+
+  template<>
+    struct is_error_condition_enum<errc>
+    : public true_type { };
+  inline namespace _V2 {
+
+
+  class error_category
+  {
+  public:
+    constexpr error_category() noexcept = default;
+
+    virtual ~error_category();
+
+    error_category(const error_category&) = delete;
+    error_category& operator=(const error_category&) = delete;
+
+    virtual const char*
+    name() const noexcept = 0;
+
+
+
+
+
+
+  private:
+    __attribute ((__abi_tag__ ("cxx11")))
+    virtual __cow_string
+    _M_message(int) const;
+
+  public:
+    __attribute ((__abi_tag__ ("cxx11")))
+    virtual string
+    message(int) const = 0;
+  public:
+    virtual error_condition
+    default_error_condition(int __i) const noexcept;
+
+    virtual bool
+    equivalent(int __i, const error_condition& __cond) const noexcept;
+
+    virtual bool
+    equivalent(const error_code& __code, int __i) const noexcept;
+
+    bool
+    operator<(const error_category& __other) const noexcept
+    { return less<const error_category*>()(this, &__other); }
+
+    bool
+    operator==(const error_category& __other) const noexcept
+    { return this == &__other; }
+
+    bool
+    operator!=(const error_category& __other) const noexcept
+    { return this != &__other; }
+  };
+
+
+  __attribute__ ((__const__)) const error_category& system_category() noexcept;
+  __attribute__ ((__const__)) const error_category& generic_category() noexcept;
+
+  }
+
+  error_code make_error_code(errc) noexcept;
+
+  template<typename _Tp>
+    struct hash;
+
+
+
+  struct error_code
+  {
+    error_code() noexcept
+    : _M_value(0), _M_cat(&system_category()) { }
+
+    error_code(int __v, const error_category& __cat) noexcept
+    : _M_value(__v), _M_cat(&__cat) { }
+
+    template<typename _ErrorCodeEnum, typename = typename
+      enable_if<is_error_code_enum<_ErrorCodeEnum>::value>::type>
+      error_code(_ErrorCodeEnum __e) noexcept
+      { *this = make_error_code(__e); }
+
+    void
+    assign(int __v, const error_category& __cat) noexcept
+    {
+      _M_value = __v;
+      _M_cat = &__cat;
+    }
+
+    void
+    clear() noexcept
+    { assign(0, system_category()); }
+
+
+    template<typename _ErrorCodeEnum>
+      typename enable_if<is_error_code_enum<_ErrorCodeEnum>::value,
+    error_code&>::type
+      operator=(_ErrorCodeEnum __e) noexcept
+      { return *this = make_error_code(__e); }
+
+    int
+    value() const noexcept { return _M_value; }
+
+    const error_category&
+    category() const noexcept { return *_M_cat; }
+
+    error_condition
+    default_error_condition() const noexcept;
+
+    __attribute ((__abi_tag__ ("cxx11")))
+    string
+    message() const
+    { return category().message(value()); }
+
+    explicit operator bool() const noexcept
+    { return _M_value != 0; }
+
+
+  private:
+    friend class hash<error_code>;
+
+    int _M_value;
+    const error_category* _M_cat;
+  };
+
+
+  inline error_code
+  make_error_code(errc __e) noexcept
+  { return error_code(static_cast<int>(__e), generic_category()); }
+
+  inline bool
+  operator<(const error_code& __lhs, const error_code& __rhs) noexcept
+  {
+    return (__lhs.category() < __rhs.category()
+     || (__lhs.category() == __rhs.category()
+  && __lhs.value() < __rhs.value()));
+  }
+
+  template<typename _CharT, typename _Traits>
+    basic_ostream<_CharT, _Traits>&
+    operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e)
+    { return (__os << __e.category().name() << ':' << __e.value()); }
+
+  error_condition make_error_condition(errc) noexcept;
+
+
+
+  struct error_condition
+  {
+    error_condition() noexcept
+    : _M_value(0), _M_cat(&generic_category()) { }
+
+    error_condition(int __v, const error_category& __cat) noexcept
+    : _M_value(__v), _M_cat(&__cat) { }
+
+    template<typename _ErrorConditionEnum, typename = typename
+  enable_if<is_error_condition_enum<_ErrorConditionEnum>::value>::type>
+      error_condition(_ErrorConditionEnum __e) noexcept
+      { *this = make_error_condition(__e); }
+
+    void
+    assign(int __v, const error_category& __cat) noexcept
+    {
+      _M_value = __v;
+      _M_cat = &__cat;
+    }
+
+
+    template<typename _ErrorConditionEnum>
+      typename enable_if<is_error_condition_enum
+    <_ErrorConditionEnum>::value, error_condition&>::type
+      operator=(_ErrorConditionEnum __e) noexcept
+      { return *this = make_error_condition(__e); }
+
+    void
+    clear() noexcept
+    { assign(0, generic_category()); }
+
+
+    int
+    value() const noexcept { return _M_value; }
+
+    const error_category&
+    category() const noexcept { return *_M_cat; }
+
+    __attribute ((__abi_tag__ ("cxx11")))
+    string
+    message() const
+    { return category().message(value()); }
+
+    explicit operator bool() const noexcept
+    { return _M_value != 0; }
+
+
+  private:
+    int _M_value;
+    const error_category* _M_cat;
+  };
+
+
+  inline error_condition
+  make_error_condition(errc __e) noexcept
+  { return error_condition(static_cast<int>(__e), generic_category()); }
+
+  inline bool
+  operator<(const error_condition& __lhs,
+     const error_condition& __rhs) noexcept
+  {
+    return (__lhs.category() < __rhs.category()
+     || (__lhs.category() == __rhs.category()
+  && __lhs.value() < __rhs.value()));
+  }
+
+
+  inline bool
+  operator==(const error_code& __lhs, const error_code& __rhs) noexcept
+  { return (__lhs.category() == __rhs.category()
+     && __lhs.value() == __rhs.value()); }
+
+  inline bool
+  operator==(const error_code& __lhs, const error_condition& __rhs) noexcept
+  {
+    return (__lhs.category().equivalent(__lhs.value(), __rhs)
+     || __rhs.category().equivalent(__lhs, __rhs.value()));
+  }
+
+  inline bool
+  operator==(const error_condition& __lhs, const error_code& __rhs) noexcept
+  {
+    return (__rhs.category().equivalent(__rhs.value(), __lhs)
+     || __lhs.category().equivalent(__rhs, __lhs.value()));
+  }
+
+  inline bool
+  operator==(const error_condition& __lhs,
+      const error_condition& __rhs) noexcept
+  {
+    return (__lhs.category() == __rhs.category()
+     && __lhs.value() == __rhs.value());
+  }
+
+  inline bool
+  operator!=(const error_code& __lhs, const error_code& __rhs) noexcept
+  { return !(__lhs == __rhs); }
+
+  inline bool
+  operator!=(const error_code& __lhs, const error_condition& __rhs) noexcept
+  { return !(__lhs == __rhs); }
+
+  inline bool
+  operator!=(const error_condition& __lhs, const error_code& __rhs) noexcept
+  { return !(__lhs == __rhs); }
+
+  inline bool
+  operator!=(const error_condition& __lhs,
+      const error_condition& __rhs) noexcept
+  { return !(__lhs == __rhs); }
+
+
+
+
+
+
+
+  class system_error : public std::runtime_error
+  {
+  private:
+    error_code _M_code;
+
+  public:
+    system_error(error_code __ec = error_code())
+    : runtime_error(__ec.message()), _M_code(__ec) { }
+
+    system_error(error_code __ec, const string& __what)
+    : runtime_error(__what + ": " + __ec.message()), _M_code(__ec) { }
+
+    system_error(error_code __ec, const char* __what)
+    : runtime_error(__what + (": " + __ec.message())), _M_code(__ec) { }
+
+    system_error(int __v, const error_category& __ecat, const char* __what)
+    : system_error(error_code(__v, __ecat), __what) { }
+
+    system_error(int __v, const error_category& __ecat)
+    : runtime_error(error_code(__v, __ecat).message()),
+      _M_code(__v, __ecat) { }
+
+    system_error(int __v, const error_category& __ecat, const string& __what)
+    : runtime_error(__what + ": " + error_code(__v, __ecat).message()),
+      _M_code(__v, __ecat) { }
+
+
+    system_error (const system_error &) = default;
+    system_error &operator= (const system_error &) = default;
+
+
+    virtual ~system_error() noexcept;
+
+    const error_code&
+    code() const noexcept { return _M_code; }
+  };
+
+
+}
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+
+
+  template<>
+    struct hash<error_code>
+    : public __hash_base<size_t, error_code>
+    {
+      size_t
+      operator()(const error_code& __e) const noexcept
+      {
+ const size_t __tmp = std::_Hash_impl::hash(__e._M_value);
+ return std::_Hash_impl::__hash_combine(__e._M_cat, __tmp);
+      }
+    };
+
+}
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+
+
+
+  enum _Ios_Fmtflags
+    {
+      _S_boolalpha = 1L << 0,
+      _S_dec = 1L << 1,
+      _S_fixed = 1L << 2,
+      _S_hex = 1L << 3,
+      _S_internal = 1L << 4,
+      _S_left = 1L << 5,
+      _S_oct = 1L << 6,
+      _S_right = 1L << 7,
+      _S_scientific = 1L << 8,
+      _S_showbase = 1L << 9,
+      _S_showpoint = 1L << 10,
+      _S_showpos = 1L << 11,
+      _S_skipws = 1L << 12,
+      _S_unitbuf = 1L << 13,
+      _S_uppercase = 1L << 14,
+      _S_adjustfield = _S_left | _S_right | _S_internal,
+      _S_basefield = _S_dec | _S_oct | _S_hex,
+      _S_floatfield = _S_scientific | _S_fixed,
+      _S_ios_fmtflags_end = 1L << 16,
+      _S_ios_fmtflags_max = 0x7fffffff,
+      _S_ios_fmtflags_min = ~0x7fffffff
+    };
+
+  inline constexpr _Ios_Fmtflags
+  operator&(_Ios_Fmtflags __a, _Ios_Fmtflags __b)
+  { return _Ios_Fmtflags(static_cast<int>(__a) & static_cast<int>(__b)); }
+
+  inline constexpr _Ios_Fmtflags
+  operator|(_Ios_Fmtflags __a, _Ios_Fmtflags __b)
+  { return _Ios_Fmtflags(static_cast<int>(__a) | static_cast<int>(__b)); }
+
+  inline constexpr _Ios_Fmtflags
+  operator^(_Ios_Fmtflags __a, _Ios_Fmtflags __b)
+  { return _Ios_Fmtflags(static_cast<int>(__a) ^ static_cast<int>(__b)); }
+
+  inline constexpr _Ios_Fmtflags
+  operator~(_Ios_Fmtflags __a)
+  { return _Ios_Fmtflags(~static_cast<int>(__a)); }
+
+  inline const _Ios_Fmtflags&
+  operator|=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b)
+  { return __a = __a | __b; }
+
+  inline const _Ios_Fmtflags&
+  operator&=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b)
+  { return __a = __a & __b; }
+
+  inline const _Ios_Fmtflags&
+  operator^=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b)
+  { return __a = __a ^ __b; }
+
+
+  enum _Ios_Openmode
+    {
+      _S_app = 1L << 0,
+      _S_ate = 1L << 1,
+      _S_bin = 1L << 2,
+      _S_in = 1L << 3,
+      _S_out = 1L << 4,
+      _S_trunc = 1L << 5,
+      _S_ios_openmode_end = 1L << 16,
+      _S_ios_openmode_max = 0x7fffffff,
+      _S_ios_openmode_min = ~0x7fffffff
+    };
+
+  inline constexpr _Ios_Openmode
+  operator&(_Ios_Openmode __a, _Ios_Openmode __b)
+  { return _Ios_Openmode(static_cast<int>(__a) & static_cast<int>(__b)); }
+
+  inline constexpr _Ios_Openmode
+  operator|(_Ios_Openmode __a, _Ios_Openmode __b)
+  { return _Ios_Openmode(static_cast<int>(__a) | static_cast<int>(__b)); }
+
+  inline constexpr _Ios_Openmode
+  operator^(_Ios_Openmode __a, _Ios_Openmode __b)
+  { return _Ios_Openmode(static_cast<int>(__a) ^ static_cast<int>(__b)); }
+
+  inline constexpr _Ios_Openmode
+  operator~(_Ios_Openmode __a)
+  { return _Ios_Openmode(~static_cast<int>(__a)); }
+
+  inline const _Ios_Openmode&
+  operator|=(_Ios_Openmode& __a, _Ios_Openmode __b)
+  { return __a = __a | __b; }
+
+  inline const _Ios_Openmode&
+  operator&=(_Ios_Openmode& __a, _Ios_Openmode __b)
+  { return __a = __a & __b; }
+
+  inline const _Ios_Openmode&
+  operator^=(_Ios_Openmode& __a, _Ios_Openmode __b)
+  { return __a = __a ^ __b; }
+
+
+  enum _Ios_Iostate
+    {
+      _S_goodbit = 0,
+      _S_badbit = 1L << 0,
+      _S_eofbit = 1L << 1,
+      _S_failbit = 1L << 2,
+      _S_ios_iostate_end = 1L << 16,
+      _S_ios_iostate_max = 0x7fffffff,
+      _S_ios_iostate_min = ~0x7fffffff
+    };
+
+  inline constexpr _Ios_Iostate
+  operator&(_Ios_Iostate __a, _Ios_Iostate __b)
+  { return _Ios_Iostate(static_cast<int>(__a) & static_cast<int>(__b)); }
+
+  inline constexpr _Ios_Iostate
+  operator|(_Ios_Iostate __a, _Ios_Iostate __b)
+  { return _Ios_Iostate(static_cast<int>(__a) | static_cast<int>(__b)); }
+
+  inline constexpr _Ios_Iostate
+  operator^(_Ios_Iostate __a, _Ios_Iostate __b)
+  { return _Ios_Iostate(static_cast<int>(__a) ^ static_cast<int>(__b)); }
+
+  inline constexpr _Ios_Iostate
+  operator~(_Ios_Iostate __a)
+  { return _Ios_Iostate(~static_cast<int>(__a)); }
+
+  inline const _Ios_Iostate&
+  operator|=(_Ios_Iostate& __a, _Ios_Iostate __b)
+  { return __a = __a | __b; }
+
+  inline const _Ios_Iostate&
+  operator&=(_Ios_Iostate& __a, _Ios_Iostate __b)
+  { return __a = __a & __b; }
+
+  inline const _Ios_Iostate&
+  operator^=(_Ios_Iostate& __a, _Ios_Iostate __b)
+  { return __a = __a ^ __b; }
+
+
+  enum _Ios_Seekdir
+    {
+      _S_beg = 0,
+      _S_cur = 1,
+      _S_end = 2,
+      _S_ios_seekdir_end = 1L << 16
+    };
+
+
+
+  enum class io_errc { stream = 1 };
+
+  template <> struct is_error_code_enum<io_errc> : public true_type { };
+
+  const error_category& iostream_category() noexcept;
+
+  inline error_code
+  make_error_code(io_errc __e) noexcept
+  { return error_code(static_cast<int>(__e), iostream_category()); }
+
+  inline error_condition
+  make_error_condition(io_errc __e) noexcept
+  { return error_condition(static_cast<int>(__e), iostream_category()); }
+  class ios_base
+  {
+  public:
+    class __attribute ((__abi_tag__ ("cxx11"))) failure : public system_error
+    {
+    public:
+      explicit
+      failure(const string& __str);
+
+
+      explicit
+      failure(const string&, const error_code&);
+
+      explicit
+      failure(const char*, const error_code& = io_errc::stream);
+
+
+      virtual
+      ~failure() throw();
+
+      virtual const char*
+      what() const throw();
+    };
+    typedef _Ios_Fmtflags fmtflags;
+
+
+    static const fmtflags boolalpha = _S_boolalpha;
+
+
+    static const fmtflags dec = _S_dec;
+
+
+    static const fmtflags fixed = _S_fixed;
+
+
+    static const fmtflags hex = _S_hex;
+
+
+
+
+    static const fmtflags internal = _S_internal;
+
+
+
+    static const fmtflags left = _S_left;
+
+
+    static const fmtflags oct = _S_oct;
+
+
+
+    static const fmtflags right = _S_right;
+
+
+    static const fmtflags scientific = _S_scientific;
+
+
+
+    static const fmtflags showbase = _S_showbase;
+
+
+
+    static const fmtflags showpoint = _S_showpoint;
+
+
+    static const fmtflags showpos = _S_showpos;
+
+
+    static const fmtflags skipws = _S_skipws;
+
+
+    static const fmtflags unitbuf = _S_unitbuf;
+
+
+
+    static const fmtflags uppercase = _S_uppercase;
+
+
+    static const fmtflags adjustfield = _S_adjustfield;
+
+
+    static const fmtflags basefield = _S_basefield;
+
+
+    static const fmtflags floatfield = _S_floatfield;
+    typedef _Ios_Iostate iostate;
+
+
+
+    static const iostate badbit = _S_badbit;
+
+
+    static const iostate eofbit = _S_eofbit;
+
+
+
+
+    static const iostate failbit = _S_failbit;
+
+
+    static const iostate goodbit = _S_goodbit;
+    typedef _Ios_Openmode openmode;
+
+
+    static const openmode app = _S_app;
+
+
+    static const openmode ate = _S_ate;
+
+
+
+
+    static const openmode binary = _S_bin;
+
+
+    static const openmode in = _S_in;
+
+
+    static const openmode out = _S_out;
+
+
+    static const openmode trunc = _S_trunc;
+    typedef _Ios_Seekdir seekdir;
+
+
+    static const seekdir beg = _S_beg;
+
+
+    static const seekdir cur = _S_cur;
+
+
+    static const seekdir end = _S_end;
+
+
+
+    typedef int io_state;
+    typedef int open_mode;
+    typedef int seek_dir;
+
+    typedef std::streampos streampos;
+    typedef std::streamoff streamoff;
+    enum event
+    {
+      erase_event,
+      imbue_event,
+      copyfmt_event
+    };
+    typedef void (*event_callback) (event __e, ios_base& __b, int __i);
+    void
+    register_callback(event_callback __fn, int __index);
+
+  protected:
+    streamsize _M_precision;
+    streamsize _M_width;
+    fmtflags _M_flags;
+    iostate _M_exception;
+    iostate _M_streambuf_state;
+
+
+
+    struct _Callback_list
+    {
+
+      _Callback_list* _M_next;
+      ios_base::event_callback _M_fn;
+      int _M_index;
+      _Atomic_word _M_refcount;
+
+      _Callback_list(ios_base::event_callback __fn, int __index,
+       _Callback_list* __cb)
+      : _M_next(__cb), _M_fn(__fn), _M_index(__index), _M_refcount(0) { }
+
+      void
+      _M_add_reference() { __gnu_cxx::__atomic_add_dispatch(&_M_refcount, 1); }
+
+
+      int
+      _M_remove_reference()
+      {
+
+        ;
+        int __res = __gnu_cxx::__exchange_and_add_dispatch(&_M_refcount, -1);
+        if (__res == 0)
+          {
+            ;
+          }
+        return __res;
+      }
+    };
+
+     _Callback_list* _M_callbacks;
+
+    void
+    _M_call_callbacks(event __ev) throw();
+
+    void
+    _M_dispose_callbacks(void) throw();
+
+
+    struct _Words
+    {
+      void* _M_pword;
+      long _M_iword;
+      _Words() : _M_pword(0), _M_iword(0) { }
+    };
+
+
+    _Words _M_word_zero;
+
+
+
+    enum { _S_local_word_size = 8 };
+    _Words _M_local_word[_S_local_word_size];
+
+
+    int _M_word_size;
+    _Words* _M_word;
+
+    _Words&
+    _M_grow_words(int __index, bool __iword);
+
+
+    locale _M_ios_locale;
+
+    void
+    _M_init() throw();
+
+  public:
+
+
+
+
+
+    class Init
+    {
+      friend class ios_base;
+    public:
+      Init();
+      ~Init();
+
+
+      Init(const Init&) = default;
+      Init& operator=(const Init&) = default;
+
+
+    private:
+      static _Atomic_word _S_refcount;
+      static bool _S_synced_with_stdio;
+    };
+
+
+
+
+
+
+    fmtflags
+    flags() const
+    { return _M_flags; }
+    fmtflags
+    flags(fmtflags __fmtfl)
+    {
+      fmtflags __old = _M_flags;
+      _M_flags = __fmtfl;
+      return __old;
+    }
+    fmtflags
+    setf(fmtflags __fmtfl)
+    {
+      fmtflags __old = _M_flags;
+      _M_flags |= __fmtfl;
+      return __old;
+    }
+    fmtflags
+    setf(fmtflags __fmtfl, fmtflags __mask)
+    {
+      fmtflags __old = _M_flags;
+      _M_flags &= ~__mask;
+      _M_flags |= (__fmtfl & __mask);
+      return __old;
+    }
+
+
+
+
+
+
+
+    void
+    unsetf(fmtflags __mask)
+    { _M_flags &= ~__mask; }
+    streamsize
+    precision() const
+    { return _M_precision; }
+
+
+
+
+
+
+    streamsize
+    precision(streamsize __prec)
+    {
+      streamsize __old = _M_precision;
+      _M_precision = __prec;
+      return __old;
+    }
+
+
+
+
+
+
+
+    streamsize
+    width() const
+    { return _M_width; }
+
+
+
+
+
+
+    streamsize
+    width(streamsize __wide)
+    {
+      streamsize __old = _M_width;
+      _M_width = __wide;
+      return __old;
+    }
+    static bool
+    sync_with_stdio(bool __sync = true);
+    locale
+    imbue(const locale& __loc) throw();
+    locale
+    getloc() const
+    { return _M_ios_locale; }
+    const locale&
+    _M_getloc() const
+    { return _M_ios_locale; }
+    static int
+    xalloc() throw();
+    long&
+    iword(int __ix)
+    {
+      _Words& __word = ((unsigned)__ix < (unsigned)_M_word_size)
+   ? _M_word[__ix] : _M_grow_words(__ix, true);
+      return __word._M_iword;
+    }
+    void*&
+    pword(int __ix)
+    {
+      _Words& __word = ((unsigned)__ix < (unsigned)_M_word_size)
+   ? _M_word[__ix] : _M_grow_words(__ix, false);
+      return __word._M_pword;
+    }
+    virtual ~ios_base();
+
+  protected:
+    ios_base() throw ();
+  public:
+    ios_base(const ios_base&) = delete;
+
+    ios_base&
+    operator=(const ios_base&) = delete;
+
+  protected:
+    void
+    _M_move(ios_base&) noexcept;
+
+    void
+    _M_swap(ios_base& __rhs) noexcept;
+
+  };
+
+
+
+  inline ios_base&
+  boolalpha(ios_base& __base)
+  {
+    __base.setf(ios_base::boolalpha);
+    return __base;
+  }
+
+
+  inline ios_base&
+  noboolalpha(ios_base& __base)
+  {
+    __base.unsetf(ios_base::boolalpha);
+    return __base;
+  }
+
+
+  inline ios_base&
+  showbase(ios_base& __base)
+  {
+    __base.setf(ios_base::showbase);
+    return __base;
+  }
+
+
+  inline ios_base&
+  noshowbase(ios_base& __base)
+  {
+    __base.unsetf(ios_base::showbase);
+    return __base;
+  }
+
+
+  inline ios_base&
+  showpoint(ios_base& __base)
+  {
+    __base.setf(ios_base::showpoint);
+    return __base;
+  }
+
+
+  inline ios_base&
+  noshowpoint(ios_base& __base)
+  {
+    __base.unsetf(ios_base::showpoint);
+    return __base;
+  }
+
+
+  inline ios_base&
+  showpos(ios_base& __base)
+  {
+    __base.setf(ios_base::showpos);
+    return __base;
+  }
+
+
+  inline ios_base&
+  noshowpos(ios_base& __base)
+  {
+    __base.unsetf(ios_base::showpos);
+    return __base;
+  }
+
+
+  inline ios_base&
+  skipws(ios_base& __base)
+  {
+    __base.setf(ios_base::skipws);
+    return __base;
+  }
+
+
+  inline ios_base&
+  noskipws(ios_base& __base)
+  {
+    __base.unsetf(ios_base::skipws);
+    return __base;
+  }
+
+
+  inline ios_base&
+  uppercase(ios_base& __base)
+  {
+    __base.setf(ios_base::uppercase);
+    return __base;
+  }
+
+
+  inline ios_base&
+  nouppercase(ios_base& __base)
+  {
+    __base.unsetf(ios_base::uppercase);
+    return __base;
+  }
+
+
+  inline ios_base&
+  unitbuf(ios_base& __base)
+  {
+     __base.setf(ios_base::unitbuf);
+     return __base;
+  }
+
+
+  inline ios_base&
+  nounitbuf(ios_base& __base)
+  {
+     __base.unsetf(ios_base::unitbuf);
+     return __base;
+  }
+
+
+
+  inline ios_base&
+  internal(ios_base& __base)
+  {
+     __base.setf(ios_base::internal, ios_base::adjustfield);
+     return __base;
+  }
+
+
+  inline ios_base&
+  left(ios_base& __base)
+  {
+    __base.setf(ios_base::left, ios_base::adjustfield);
+    return __base;
+  }
+
+
+  inline ios_base&
+  right(ios_base& __base)
+  {
+    __base.setf(ios_base::right, ios_base::adjustfield);
+    return __base;
+  }
+
+
+
+  inline ios_base&
+  dec(ios_base& __base)
+  {
+    __base.setf(ios_base::dec, ios_base::basefield);
+    return __base;
+  }
+
+
+  inline ios_base&
+  hex(ios_base& __base)
+  {
+    __base.setf(ios_base::hex, ios_base::basefield);
+    return __base;
+  }
+
+
+  inline ios_base&
+  oct(ios_base& __base)
+  {
+    __base.setf(ios_base::oct, ios_base::basefield);
+    return __base;
+  }
+
+
+
+  inline ios_base&
+  fixed(ios_base& __base)
+  {
+    __base.setf(ios_base::fixed, ios_base::floatfield);
+    return __base;
+  }
+
+
+  inline ios_base&
+  scientific(ios_base& __base)
+  {
+    __base.setf(ios_base::scientific, ios_base::floatfield);
+    return __base;
+  }
+
+
+
+
+
+
+  inline ios_base&
+  hexfloat(ios_base& __base)
+  {
+    __base.setf(ios_base::fixed | ios_base::scientific, ios_base::floatfield);
+    return __base;
+  }
+
+
+  inline ios_base&
+  defaultfloat(ios_base& __base)
+  {
+    __base.unsetf(ios_base::floatfield);
+    return __base;
+  }
+
+
+
+}
+       
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+
+  template<typename _CharT, typename _Traits>
+    streamsize
+    __copy_streambufs_eof(basic_streambuf<_CharT, _Traits>*,
+     basic_streambuf<_CharT, _Traits>*, bool&);
+  template<typename _CharT, typename _Traits>
+    class basic_streambuf
+    {
+    public:
+
+
+
+
+
+
+      typedef _CharT char_type;
+      typedef _Traits traits_type;
+      typedef typename traits_type::int_type int_type;
+      typedef typename traits_type::pos_type pos_type;
+      typedef typename traits_type::off_type off_type;
+
+
+
+
+      typedef basic_streambuf<char_type, traits_type> __streambuf_type;
+
+
+      friend class basic_ios<char_type, traits_type>;
+      friend class basic_istream<char_type, traits_type>;
+      friend class basic_ostream<char_type, traits_type>;
+      friend class istreambuf_iterator<char_type, traits_type>;
+      friend class ostreambuf_iterator<char_type, traits_type>;
+
+      friend streamsize
+      __copy_streambufs_eof<>(basic_streambuf*, basic_streambuf*, bool&);
+
+      template<bool _IsMove, typename _CharT2>
+        friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value,
+            _CharT2*>::__type
+        __copy_move_a2(istreambuf_iterator<_CharT2>,
+         istreambuf_iterator<_CharT2>, _CharT2*);
+
+      template<typename _CharT2>
+        friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value,
+      istreambuf_iterator<_CharT2> >::__type
+        find(istreambuf_iterator<_CharT2>, istreambuf_iterator<_CharT2>,
+      const _CharT2&);
+
+      template<typename _CharT2, typename _Distance>
+        friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value,
+            void>::__type
+        advance(istreambuf_iterator<_CharT2>&, _Distance);
+
+      template<typename _CharT2, typename _Traits2>
+        friend basic_istream<_CharT2, _Traits2>&
+        operator>>(basic_istream<_CharT2, _Traits2>&, _CharT2*);
+
+      template<typename _CharT2, typename _Traits2, typename _Alloc>
+        friend basic_istream<_CharT2, _Traits2>&
+        operator>>(basic_istream<_CharT2, _Traits2>&,
+     basic_string<_CharT2, _Traits2, _Alloc>&);
+
+      template<typename _CharT2, typename _Traits2, typename _Alloc>
+        friend basic_istream<_CharT2, _Traits2>&
+        getline(basic_istream<_CharT2, _Traits2>&,
+  basic_string<_CharT2, _Traits2, _Alloc>&, _CharT2);
+
+    protected:
+
+
+
+
+
+
+
+      char_type* _M_in_beg;
+      char_type* _M_in_cur;
+      char_type* _M_in_end;
+      char_type* _M_out_beg;
+      char_type* _M_out_cur;
+      char_type* _M_out_end;
+
+
+      locale _M_buf_locale;
+
+  public:
+
+      virtual
+      ~basic_streambuf()
+      { }
+      locale
+      pubimbue(const locale& __loc)
+      {
+ locale __tmp(this->getloc());
+ this->imbue(__loc);
+ _M_buf_locale = __loc;
+ return __tmp;
+      }
+      locale
+      getloc() const
+      { return _M_buf_locale; }
+      basic_streambuf*
+      pubsetbuf(char_type* __s, streamsize __n)
+      { return this->setbuf(__s, __n); }
+      pos_type
+      pubseekoff(off_type __off, ios_base::seekdir __way,
+   ios_base::openmode __mode = ios_base::in | ios_base::out)
+      { return this->seekoff(__off, __way, __mode); }
+      pos_type
+      pubseekpos(pos_type __sp,
+   ios_base::openmode __mode = ios_base::in | ios_base::out)
+      { return this->seekpos(__sp, __mode); }
+
+
+
+
+      int
+      pubsync() { return this->sync(); }
+      streamsize
+      in_avail()
+      {
+ const streamsize __ret = this->egptr() - this->gptr();
+ return __ret ? __ret : this->showmanyc();
+      }
+      int_type
+      snextc()
+      {
+ int_type __ret = traits_type::eof();
+ if (__builtin_expect(!traits_type::eq_int_type(this->sbumpc(),
+             __ret), true))
+   __ret = this->sgetc();
+ return __ret;
+      }
+      int_type
+      sbumpc()
+      {
+ int_type __ret;
+ if (__builtin_expect(this->gptr() < this->egptr(), true))
+   {
+     __ret = traits_type::to_int_type(*this->gptr());
+     this->gbump(1);
+   }
+ else
+   __ret = this->uflow();
+ return __ret;
+      }
+      int_type
+      sgetc()
+      {
+ int_type __ret;
+ if (__builtin_expect(this->gptr() < this->egptr(), true))
+   __ret = traits_type::to_int_type(*this->gptr());
+ else
+   __ret = this->underflow();
+ return __ret;
+      }
+      streamsize
+      sgetn(char_type* __s, streamsize __n)
+      { return this->xsgetn(__s, __n); }
+      int_type
+      sputbackc(char_type __c)
+      {
+ int_type __ret;
+ const bool __testpos = this->eback() < this->gptr();
+ if (__builtin_expect(!__testpos ||
+        !traits_type::eq(__c, this->gptr()[-1]), false))
+   __ret = this->pbackfail(traits_type::to_int_type(__c));
+ else
+   {
+     this->gbump(-1);
+     __ret = traits_type::to_int_type(*this->gptr());
+   }
+ return __ret;
+      }
+      int_type
+      sungetc()
+      {
+ int_type __ret;
+ if (__builtin_expect(this->eback() < this->gptr(), true))
+   {
+     this->gbump(-1);
+     __ret = traits_type::to_int_type(*this->gptr());
+   }
+ else
+   __ret = this->pbackfail();
+ return __ret;
+      }
+      int_type
+      sputc(char_type __c)
+      {
+ int_type __ret;
+ if (__builtin_expect(this->pptr() < this->epptr(), true))
+   {
+     *this->pptr() = __c;
+     this->pbump(1);
+     __ret = traits_type::to_int_type(__c);
+   }
+ else
+   __ret = this->overflow(traits_type::to_int_type(__c));
+ return __ret;
+      }
+      streamsize
+      sputn(const char_type* __s, streamsize __n)
+      { return this->xsputn(__s, __n); }
+
+    protected:
+      basic_streambuf()
+      : _M_in_beg(0), _M_in_cur(0), _M_in_end(0),
+      _M_out_beg(0), _M_out_cur(0), _M_out_end(0),
+      _M_buf_locale(locale())
+      { }
+      char_type*
+      eback() const { return _M_in_beg; }
+
+      char_type*
+      gptr() const { return _M_in_cur; }
+
+      char_type*
+      egptr() const { return _M_in_end; }
+      void
+      gbump(int __n) { _M_in_cur += __n; }
+      void
+      setg(char_type* __gbeg, char_type* __gnext, char_type* __gend)
+      {
+ _M_in_beg = __gbeg;
+ _M_in_cur = __gnext;
+ _M_in_end = __gend;
+      }
+      char_type*
+      pbase() const { return _M_out_beg; }
+
+      char_type*
+      pptr() const { return _M_out_cur; }
+
+      char_type*
+      epptr() const { return _M_out_end; }
+      void
+      pbump(int __n) { _M_out_cur += __n; }
+      void
+      setp(char_type* __pbeg, char_type* __pend)
+      {
+ _M_out_beg = _M_out_cur = __pbeg;
+ _M_out_end = __pend;
+      }
+      virtual void
+      imbue(const locale& __loc __attribute__ ((__unused__)))
+      { }
+      virtual basic_streambuf<char_type,_Traits>*
+      setbuf(char_type*, streamsize)
+      { return this; }
+      virtual pos_type
+      seekoff(off_type, ios_base::seekdir,
+       ios_base::openmode = ios_base::in | ios_base::out)
+      { return pos_type(off_type(-1)); }
+      virtual pos_type
+      seekpos(pos_type,
+       ios_base::openmode = ios_base::in | ios_base::out)
+      { return pos_type(off_type(-1)); }
+      virtual int
+      sync() { return 0; }
+      virtual streamsize
+      showmanyc() { return 0; }
+      virtual streamsize
+      xsgetn(char_type* __s, streamsize __n);
+      virtual int_type
+      underflow()
+      { return traits_type::eof(); }
+      virtual int_type
+      uflow()
+      {
+ int_type __ret = traits_type::eof();
+ const bool __testeof = traits_type::eq_int_type(this->underflow(),
+       __ret);
+ if (!__testeof)
+   {
+     __ret = traits_type::to_int_type(*this->gptr());
+     this->gbump(1);
+   }
+ return __ret;
+      }
+      virtual int_type
+      pbackfail(int_type __c __attribute__ ((__unused__)) = traits_type::eof())
+      { return traits_type::eof(); }
+      virtual streamsize
+      xsputn(const char_type* __s, streamsize __n);
+      virtual int_type
+      overflow(int_type __c __attribute__ ((__unused__)) = traits_type::eof())
+      { return traits_type::eof(); }
+
+
+
+    public:
+      [[__deprecated__("stossc is deprecated, use sbumpc instead")]]
+
+      void
+      stossc()
+      {
+ if (this->gptr() < this->egptr())
+   this->gbump(1);
+ else
+   this->uflow();
+      }
+
+
+
+      void
+      __safe_gbump(streamsize __n) { _M_in_cur += __n; }
+
+      void
+      __safe_pbump(streamsize __n) { _M_out_cur += __n; }
+
+
+
+
+    protected:
+
+      basic_streambuf(const basic_streambuf&);
+
+      basic_streambuf&
+      operator=(const basic_streambuf&);
+
+
+      void
+      swap(basic_streambuf& __sb)
+      {
+ std::swap(_M_in_beg, __sb._M_in_beg);
+ std::swap(_M_in_cur, __sb._M_in_cur);
+ std::swap(_M_in_end, __sb._M_in_end);
+ std::swap(_M_out_beg, __sb._M_out_beg);
+ std::swap(_M_out_cur, __sb._M_out_cur);
+ std::swap(_M_out_end, __sb._M_out_end);
+ std::swap(_M_buf_locale, __sb._M_buf_locale);
+      }
+
+    };
+
+
+  template<typename _CharT, typename _Traits>
+    std::basic_streambuf<_CharT, _Traits>::
+    basic_streambuf(const basic_streambuf&) = default;
+
+  template<typename _CharT, typename _Traits>
+    std::basic_streambuf<_CharT, _Traits>&
+    std::basic_streambuf<_CharT, _Traits>::
+    operator=(const basic_streambuf&) = default;
+
+
+
+  template<>
+    streamsize
+    __copy_streambufs_eof(basic_streambuf<char>* __sbin,
+     basic_streambuf<char>* __sbout, bool& __ineof);
+
+  template<>
+    streamsize
+    __copy_streambufs_eof(basic_streambuf<wchar_t>* __sbin,
+     basic_streambuf<wchar_t>* __sbout, bool& __ineof);
+
+
+
+
+
+}
+
+       
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+  template<typename _CharT, typename _Traits>
+    streamsize
+    basic_streambuf<_CharT, _Traits>::
+    xsgetn(char_type* __s, streamsize __n)
+    {
+      streamsize __ret = 0;
+      while (__ret < __n)
+ {
+   const streamsize __buf_len = this->egptr() - this->gptr();
+   if (__buf_len)
+     {
+       const streamsize __remaining = __n - __ret;
+       const streamsize __len = std::min(__buf_len, __remaining);
+       traits_type::copy(__s, this->gptr(), __len);
+       __ret += __len;
+       __s += __len;
+       this->__safe_gbump(__len);
+     }
+
+   if (__ret < __n)
+     {
+       const int_type __c = this->uflow();
+       if (!traits_type::eq_int_type(__c, traits_type::eof()))
+  {
+    traits_type::assign(*__s++, traits_type::to_char_type(__c));
+    ++__ret;
+  }
+       else
+  break;
+     }
+ }
+      return __ret;
+    }
+
+  template<typename _CharT, typename _Traits>
+    streamsize
+    basic_streambuf<_CharT, _Traits>::
+    xsputn(const char_type* __s, streamsize __n)
+    {
+      streamsize __ret = 0;
+      while (__ret < __n)
+ {
+   const streamsize __buf_len = this->epptr() - this->pptr();
+   if (__buf_len)
+     {
+       const streamsize __remaining = __n - __ret;
+       const streamsize __len = std::min(__buf_len, __remaining);
+       traits_type::copy(this->pptr(), __s, __len);
+       __ret += __len;
+       __s += __len;
+       this->__safe_pbump(__len);
+     }
+
+   if (__ret < __n)
+     {
+       int_type __c = this->overflow(traits_type::to_int_type(*__s));
+       if (!traits_type::eq_int_type(__c, traits_type::eof()))
+  {
+    ++__ret;
+    ++__s;
+  }
+       else
+  break;
+     }
+ }
+      return __ret;
+    }
+
+
+
+
+  template<typename _CharT, typename _Traits>
+    streamsize
+    __copy_streambufs_eof(basic_streambuf<_CharT, _Traits>* __sbin,
+     basic_streambuf<_CharT, _Traits>* __sbout,
+     bool& __ineof)
+    {
+      streamsize __ret = 0;
+      __ineof = true;
+      typename _Traits::int_type __c = __sbin->sgetc();
+      while (!_Traits::eq_int_type(__c, _Traits::eof()))
+ {
+   __c = __sbout->sputc(_Traits::to_char_type(__c));
+   if (_Traits::eq_int_type(__c, _Traits::eof()))
+     {
+       __ineof = false;
+       break;
+     }
+   ++__ret;
+   __c = __sbin->snextc();
+ }
+      return __ret;
+    }
+
+  template<typename _CharT, typename _Traits>
+    inline streamsize
+    __copy_streambufs(basic_streambuf<_CharT, _Traits>* __sbin,
+        basic_streambuf<_CharT, _Traits>* __sbout)
+    {
+      bool __ineof;
+      return __copy_streambufs_eof(__sbin, __sbout, __ineof);
+    }
+
+
+
+
+  extern template class basic_streambuf<char>;
+  extern template
+    streamsize
+    __copy_streambufs(basic_streambuf<char>*,
+        basic_streambuf<char>*);
+  extern template
+    streamsize
+    __copy_streambufs_eof(basic_streambuf<char>*,
+     basic_streambuf<char>*, bool&);
+
+
+  extern template class basic_streambuf<wchar_t>;
+  extern template
+    streamsize
+    __copy_streambufs(basic_streambuf<wchar_t>*,
+        basic_streambuf<wchar_t>*);
+  extern template
+    streamsize
+    __copy_streambufs_eof(basic_streambuf<wchar_t>*,
+     basic_streambuf<wchar_t>*, bool&);
+
+
+
+
+}
+       
+
+
+
+       
+
+       
+
+
+
+typedef unsigned long int wctype_t;
+
+enum
+{
+  __ISwupper = 0,
+  __ISwlower = 1,
+  __ISwalpha = 2,
+  __ISwdigit = 3,
+  __ISwxdigit = 4,
+  __ISwspace = 5,
+  __ISwprint = 6,
+  __ISwgraph = 7,
+  __ISwblank = 8,
+  __ISwcntrl = 9,
+  __ISwpunct = 10,
+  __ISwalnum = 11,
+
+  _ISwupper = ((__ISwupper) < 8 ? (int) ((1UL << (__ISwupper)) << 24) : ((__ISwupper) < 16 ? (int) ((1UL << (__ISwupper)) << 8) : ((__ISwupper) < 24 ? (int) ((1UL << (__ISwupper)) >> 8) : (int) ((1UL << (__ISwupper)) >> 24)))),
+  _ISwlower = ((__ISwlower) < 8 ? (int) ((1UL << (__ISwlower)) << 24) : ((__ISwlower) < 16 ? (int) ((1UL << (__ISwlower)) << 8) : ((__ISwlower) < 24 ? (int) ((1UL << (__ISwlower)) >> 8) : (int) ((1UL << (__ISwlower)) >> 24)))),
+  _ISwalpha = ((__ISwalpha) < 8 ? (int) ((1UL << (__ISwalpha)) << 24) : ((__ISwalpha) < 16 ? (int) ((1UL << (__ISwalpha)) << 8) : ((__ISwalpha) < 24 ? (int) ((1UL << (__ISwalpha)) >> 8) : (int) ((1UL << (__ISwalpha)) >> 24)))),
+  _ISwdigit = ((__ISwdigit) < 8 ? (int) ((1UL << (__ISwdigit)) << 24) : ((__ISwdigit) < 16 ? (int) ((1UL << (__ISwdigit)) << 8) : ((__ISwdigit) < 24 ? (int) ((1UL << (__ISwdigit)) >> 8) : (int) ((1UL << (__ISwdigit)) >> 24)))),
+  _ISwxdigit = ((__ISwxdigit) < 8 ? (int) ((1UL << (__ISwxdigit)) << 24) : ((__ISwxdigit) < 16 ? (int) ((1UL << (__ISwxdigit)) << 8) : ((__ISwxdigit) < 24 ? (int) ((1UL << (__ISwxdigit)) >> 8) : (int) ((1UL << (__ISwxdigit)) >> 24)))),
+  _ISwspace = ((__ISwspace) < 8 ? (int) ((1UL << (__ISwspace)) << 24) : ((__ISwspace) < 16 ? (int) ((1UL << (__ISwspace)) << 8) : ((__ISwspace) < 24 ? (int) ((1UL << (__ISwspace)) >> 8) : (int) ((1UL << (__ISwspace)) >> 24)))),
+  _ISwprint = ((__ISwprint) < 8 ? (int) ((1UL << (__ISwprint)) << 24) : ((__ISwprint) < 16 ? (int) ((1UL << (__ISwprint)) << 8) : ((__ISwprint) < 24 ? (int) ((1UL << (__ISwprint)) >> 8) : (int) ((1UL << (__ISwprint)) >> 24)))),
+  _ISwgraph = ((__ISwgraph) < 8 ? (int) ((1UL << (__ISwgraph)) << 24) : ((__ISwgraph) < 16 ? (int) ((1UL << (__ISwgraph)) << 8) : ((__ISwgraph) < 24 ? (int) ((1UL << (__ISwgraph)) >> 8) : (int) ((1UL << (__ISwgraph)) >> 24)))),
+  _ISwblank = ((__ISwblank) < 8 ? (int) ((1UL << (__ISwblank)) << 24) : ((__ISwblank) < 16 ? (int) ((1UL << (__ISwblank)) << 8) : ((__ISwblank) < 24 ? (int) ((1UL << (__ISwblank)) >> 8) : (int) ((1UL << (__ISwblank)) >> 24)))),
+  _ISwcntrl = ((__ISwcntrl) < 8 ? (int) ((1UL << (__ISwcntrl)) << 24) : ((__ISwcntrl) < 16 ? (int) ((1UL << (__ISwcntrl)) << 8) : ((__ISwcntrl) < 24 ? (int) ((1UL << (__ISwcntrl)) >> 8) : (int) ((1UL << (__ISwcntrl)) >> 24)))),
+  _ISwpunct = ((__ISwpunct) < 8 ? (int) ((1UL << (__ISwpunct)) << 24) : ((__ISwpunct) < 16 ? (int) ((1UL << (__ISwpunct)) << 8) : ((__ISwpunct) < 24 ? (int) ((1UL << (__ISwpunct)) >> 8) : (int) ((1UL << (__ISwpunct)) >> 24)))),
+  _ISwalnum = ((__ISwalnum) < 8 ? (int) ((1UL << (__ISwalnum)) << 24) : ((__ISwalnum) < 16 ? (int) ((1UL << (__ISwalnum)) << 8) : ((__ISwalnum) < 24 ? (int) ((1UL << (__ISwalnum)) >> 8) : (int) ((1UL << (__ISwalnum)) >> 24))))
+};
+
+
+
+extern "C" {
+
+
+
+
+
+
+
+
+extern int iswalnum (wint_t __wc) throw ();
+
+
+
+
+
+extern int iswalpha (wint_t __wc) throw ();
+
+
+extern int iswcntrl (wint_t __wc) throw ();
+
+
+
+extern int iswdigit (wint_t __wc) throw ();
+
+
+
+extern int iswgraph (wint_t __wc) throw ();
+
+
+
+
+extern int iswlower (wint_t __wc) throw ();
+
+
+extern int iswprint (wint_t __wc) throw ();
+
+
+
+
+extern int iswpunct (wint_t __wc) throw ();
+
+
+
+
+extern int iswspace (wint_t __wc) throw ();
+
+
+
+
+extern int iswupper (wint_t __wc) throw ();
+
+
+
+
+extern int iswxdigit (wint_t __wc) throw ();
+
+
+
+
+
+extern int iswblank (wint_t __wc) throw ();
+extern wctype_t wctype (const char *__property) throw ();
+
+
+
+extern int iswctype (wint_t __wc, wctype_t __desc) throw ();
+
+
+
+
+
+
+
+
+
+
+typedef const __int32_t *wctrans_t;
+
+
+
+
+
+
+
+extern wint_t towlower (wint_t __wc) throw ();
+
+
+extern wint_t towupper (wint_t __wc) throw ();
+
+
+}
+extern "C" {
+
+
+
+
+extern wctrans_t wctrans (const char *__property) throw ();
+
+
+extern wint_t towctrans (wint_t __wc, wctrans_t __desc) throw ();
+
+
+
+
+
+
+
+
+extern int iswalnum_l (wint_t __wc, __locale_t __locale) throw ();
+
+
+
+
+
+extern int iswalpha_l (wint_t __wc, __locale_t __locale) throw ();
+
+
+extern int iswcntrl_l (wint_t __wc, __locale_t __locale) throw ();
+
+
+
+extern int iswdigit_l (wint_t __wc, __locale_t __locale) throw ();
+
+
+
+extern int iswgraph_l (wint_t __wc, __locale_t __locale) throw ();
+
+
+
+
+extern int iswlower_l (wint_t __wc, __locale_t __locale) throw ();
+
+
+extern int iswprint_l (wint_t __wc, __locale_t __locale) throw ();
+
+
+
+
+extern int iswpunct_l (wint_t __wc, __locale_t __locale) throw ();
+
+
+
+
+extern int iswspace_l (wint_t __wc, __locale_t __locale) throw ();
+
+
+
+
+extern int iswupper_l (wint_t __wc, __locale_t __locale) throw ();
+
+
+
+
+extern int iswxdigit_l (wint_t __wc, __locale_t __locale) throw ();
+
+
+
+
+extern int iswblank_l (wint_t __wc, __locale_t __locale) throw ();
+
+
+
+extern wctype_t wctype_l (const char *__property, __locale_t __locale)
+     throw ();
+
+
+
+extern int iswctype_l (wint_t __wc, wctype_t __desc, __locale_t __locale)
+     throw ();
+
+
+
+
+
+
+
+extern wint_t towlower_l (wint_t __wc, __locale_t __locale) throw ();
+
+
+extern wint_t towupper_l (wint_t __wc, __locale_t __locale) throw ();
+
+
+
+extern wctrans_t wctrans_l (const char *__property, __locale_t __locale)
+     throw ();
+
+
+extern wint_t towctrans_l (wint_t __wc, wctrans_t __desc,
+      __locale_t __locale) throw ();
+
+
+
+}
+namespace std
+{
+  using ::wctrans_t;
+  using ::wctype_t;
+  using ::wint_t;
+
+  using ::iswalnum;
+  using ::iswalpha;
+
+  using ::iswblank;
+
+  using ::iswcntrl;
+  using ::iswctype;
+  using ::iswdigit;
+  using ::iswgraph;
+  using ::iswlower;
+  using ::iswprint;
+  using ::iswpunct;
+  using ::iswspace;
+  using ::iswupper;
+  using ::iswxdigit;
+  using ::towctrans;
+  using ::towlower;
+  using ::towupper;
+  using ::wctrans;
+  using ::wctype;
+}
+       
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+  struct ctype_base
+  {
+
+    typedef const int* __to_type;
+
+
+
+    typedef unsigned short mask;
+    static const mask upper = _ISupper;
+    static const mask lower = _ISlower;
+    static const mask alpha = _ISalpha;
+    static const mask digit = _ISdigit;
+    static const mask xdigit = _ISxdigit;
+    static const mask space = _ISspace;
+    static const mask print = _ISprint;
+    static const mask graph = _ISalpha | _ISdigit | _ISpunct;
+    static const mask cntrl = _IScntrl;
+    static const mask punct = _ISpunct;
+    static const mask alnum = _ISalpha | _ISdigit;
+
+    static const mask blank = _ISblank;
+
+  };
+
+
+}
+
+
+
+
+
+
+       
+
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+  template<typename _CharT, typename _Traits>
+    class istreambuf_iterator
+    : public iterator<input_iterator_tag, _CharT, typename _Traits::off_type,
+        _CharT*,
+
+
+        _CharT>
+
+
+
+    {
+    public:
+
+
+
+      typedef _CharT char_type;
+      typedef _Traits traits_type;
+      typedef typename _Traits::int_type int_type;
+      typedef basic_streambuf<_CharT, _Traits> streambuf_type;
+      typedef basic_istream<_CharT, _Traits> istream_type;
+
+
+      template<typename _CharT2>
+ friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value,
+        ostreambuf_iterator<_CharT2> >::__type
+ copy(istreambuf_iterator<_CharT2>, istreambuf_iterator<_CharT2>,
+      ostreambuf_iterator<_CharT2>);
+
+      template<bool _IsMove, typename _CharT2>
+ friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value,
+            _CharT2*>::__type
+ __copy_move_a2(istreambuf_iterator<_CharT2>,
+         istreambuf_iterator<_CharT2>, _CharT2*);
+
+      template<typename _CharT2>
+ friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value,
+        istreambuf_iterator<_CharT2> >::__type
+ find(istreambuf_iterator<_CharT2>, istreambuf_iterator<_CharT2>,
+      const _CharT2&);
+
+      template<typename _CharT2, typename _Distance>
+ friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value,
+            void>::__type
+ advance(istreambuf_iterator<_CharT2>&, _Distance);
+
+    private:
+
+
+
+
+
+
+
+      mutable streambuf_type* _M_sbuf;
+      int_type _M_c;
+
+    public:
+
+      constexpr istreambuf_iterator() noexcept
+      : _M_sbuf(0), _M_c(traits_type::eof()) { }
+
+
+      istreambuf_iterator(const istreambuf_iterator&) noexcept = default;
+
+      ~istreambuf_iterator() = default;
+
+
+
+      istreambuf_iterator(istream_type& __s) noexcept
+      : _M_sbuf(__s.rdbuf()), _M_c(traits_type::eof()) { }
+
+
+      istreambuf_iterator(streambuf_type* __s) noexcept
+      : _M_sbuf(__s), _M_c(traits_type::eof()) { }
+
+
+      istreambuf_iterator&
+      operator=(const istreambuf_iterator&) noexcept = default;
+
+
+
+
+
+      char_type
+      operator*() const
+      {
+ int_type __c = _M_get();
+ return traits_type::to_char_type(__c);
+      }
+
+
+      istreambuf_iterator&
+      operator++()
+      {
+
+
+
+                        ;
+
+ _M_sbuf->sbumpc();
+ _M_c = traits_type::eof();
+ return *this;
+      }
+
+
+      istreambuf_iterator
+      operator++(int)
+      {
+
+
+
+                        ;
+
+ istreambuf_iterator __old = *this;
+ __old._M_c = _M_sbuf->sbumpc();
+ _M_c = traits_type::eof();
+ return __old;
+      }
+
+
+
+
+
+      bool
+      equal(const istreambuf_iterator& __b) const
+      { return _M_at_eof() == __b._M_at_eof(); }
+
+    private:
+      int_type
+      _M_get() const
+      {
+ int_type __ret = _M_c;
+ if (_M_sbuf && _S_is_eof(__ret) && _S_is_eof(__ret = _M_sbuf->sgetc()))
+   _M_sbuf = 0;
+ return __ret;
+      }
+
+      bool
+      _M_at_eof() const
+      { return _S_is_eof(_M_get()); }
+
+      static bool
+      _S_is_eof(int_type __c)
+      {
+ const int_type __eof = traits_type::eof();
+ return traits_type::eq_int_type(__c, __eof);
+      }
+    };
+
+  template<typename _CharT, typename _Traits>
+    inline bool
+    operator==(const istreambuf_iterator<_CharT, _Traits>& __a,
+        const istreambuf_iterator<_CharT, _Traits>& __b)
+    { return __a.equal(__b); }
+
+  template<typename _CharT, typename _Traits>
+    inline bool
+    operator!=(const istreambuf_iterator<_CharT, _Traits>& __a,
+        const istreambuf_iterator<_CharT, _Traits>& __b)
+    { return !__a.equal(__b); }
+
+
+  template<typename _CharT, typename _Traits>
+    class ostreambuf_iterator
+    : public iterator<output_iterator_tag, void, void, void, void>
+    {
+    public:
+
+
+
+      typedef _CharT char_type;
+      typedef _Traits traits_type;
+      typedef basic_streambuf<_CharT, _Traits> streambuf_type;
+      typedef basic_ostream<_CharT, _Traits> ostream_type;
+
+
+      template<typename _CharT2>
+ friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value,
+        ostreambuf_iterator<_CharT2> >::__type
+ copy(istreambuf_iterator<_CharT2>, istreambuf_iterator<_CharT2>,
+      ostreambuf_iterator<_CharT2>);
+
+    private:
+      streambuf_type* _M_sbuf;
+      bool _M_failed;
+
+    public:
+
+      ostreambuf_iterator(ostream_type& __s) noexcept
+      : _M_sbuf(__s.rdbuf()), _M_failed(!_M_sbuf) { }
+
+
+      ostreambuf_iterator(streambuf_type* __s) noexcept
+      : _M_sbuf(__s), _M_failed(!_M_sbuf) { }
+
+
+      ostreambuf_iterator&
+      operator=(_CharT __c)
+      {
+ if (!_M_failed &&
+     _Traits::eq_int_type(_M_sbuf->sputc(__c), _Traits::eof()))
+   _M_failed = true;
+ return *this;
+      }
+
+
+      ostreambuf_iterator&
+      operator*()
+      { return *this; }
+
+
+      ostreambuf_iterator&
+      operator++(int)
+      { return *this; }
+
+
+      ostreambuf_iterator&
+      operator++()
+      { return *this; }
+
+
+      bool
+      failed() const noexcept
+      { return _M_failed; }
+
+      ostreambuf_iterator&
+      _M_put(const _CharT* __ws, streamsize __len)
+      {
+ if (__builtin_expect(!_M_failed, true)
+     && __builtin_expect(this->_M_sbuf->sputn(__ws, __len) != __len,
+    false))
+   _M_failed = true;
+ return *this;
+      }
+    };
+
+
+  template<typename _CharT>
+    typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
+        ostreambuf_iterator<_CharT> >::__type
+    copy(istreambuf_iterator<_CharT> __first,
+  istreambuf_iterator<_CharT> __last,
+  ostreambuf_iterator<_CharT> __result)
+    {
+      if (__first._M_sbuf && !__last._M_sbuf && !__result._M_failed)
+ {
+   bool __ineof;
+   __copy_streambufs_eof(__first._M_sbuf, __result._M_sbuf, __ineof);
+   if (!__ineof)
+     __result._M_failed = true;
+ }
+      return __result;
+    }
+
+  template<bool _IsMove, typename _CharT>
+    typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
+        ostreambuf_iterator<_CharT> >::__type
+    __copy_move_a2(_CharT* __first, _CharT* __last,
+     ostreambuf_iterator<_CharT> __result)
+    {
+      const streamsize __num = __last - __first;
+      if (__num > 0)
+ __result._M_put(__first, __num);
+      return __result;
+    }
+
+  template<bool _IsMove, typename _CharT>
+    typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
+        ostreambuf_iterator<_CharT> >::__type
+    __copy_move_a2(const _CharT* __first, const _CharT* __last,
+     ostreambuf_iterator<_CharT> __result)
+    {
+      const streamsize __num = __last - __first;
+      if (__num > 0)
+ __result._M_put(__first, __num);
+      return __result;
+    }
+
+  template<bool _IsMove, typename _CharT>
+    typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
+        _CharT*>::__type
+    __copy_move_a2(istreambuf_iterator<_CharT> __first,
+     istreambuf_iterator<_CharT> __last, _CharT* __result)
+    {
+      typedef istreambuf_iterator<_CharT> __is_iterator_type;
+      typedef typename __is_iterator_type::traits_type traits_type;
+      typedef typename __is_iterator_type::streambuf_type streambuf_type;
+      typedef typename traits_type::int_type int_type;
+
+      if (__first._M_sbuf && !__last._M_sbuf)
+ {
+   streambuf_type* __sb = __first._M_sbuf;
+   int_type __c = __sb->sgetc();
+   while (!traits_type::eq_int_type(__c, traits_type::eof()))
+     {
+       const streamsize __n = __sb->egptr() - __sb->gptr();
+       if (__n > 1)
+  {
+    traits_type::copy(__result, __sb->gptr(), __n);
+    __sb->__safe_gbump(__n);
+    __result += __n;
+    __c = __sb->underflow();
+  }
+       else
+  {
+    *__result++ = traits_type::to_char_type(__c);
+    __c = __sb->snextc();
+  }
+     }
+ }
+      return __result;
+    }
+
+  template<typename _CharT>
+    typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
+          istreambuf_iterator<_CharT> >::__type
+    find(istreambuf_iterator<_CharT> __first,
+  istreambuf_iterator<_CharT> __last, const _CharT& __val)
+    {
+      typedef istreambuf_iterator<_CharT> __is_iterator_type;
+      typedef typename __is_iterator_type::traits_type traits_type;
+      typedef typename __is_iterator_type::streambuf_type streambuf_type;
+      typedef typename traits_type::int_type int_type;
+      const int_type __eof = traits_type::eof();
+
+      if (__first._M_sbuf && !__last._M_sbuf)
+ {
+   const int_type __ival = traits_type::to_int_type(__val);
+   streambuf_type* __sb = __first._M_sbuf;
+   int_type __c = __sb->sgetc();
+   while (!traits_type::eq_int_type(__c, __eof)
+   && !traits_type::eq_int_type(__c, __ival))
+     {
+       streamsize __n = __sb->egptr() - __sb->gptr();
+       if (__n > 1)
+  {
+    const _CharT* __p = traits_type::find(__sb->gptr(),
+       __n, __val);
+    if (__p)
+      __n = __p - __sb->gptr();
+    __sb->__safe_gbump(__n);
+    __c = __sb->sgetc();
+  }
+       else
+  __c = __sb->snextc();
+     }
+
+   __first._M_c = __eof;
+ }
+
+      return __first;
+    }
+
+  template<typename _CharT, typename _Distance>
+    typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
+        void>::__type
+    advance(istreambuf_iterator<_CharT>& __i, _Distance __n)
+    {
+      if (__n == 0)
+ return;
+
+      ;
+     
+
+                           ;
+
+      typedef istreambuf_iterator<_CharT> __is_iterator_type;
+      typedef typename __is_iterator_type::traits_type traits_type;
+      typedef typename __is_iterator_type::streambuf_type streambuf_type;
+      typedef typename traits_type::int_type int_type;
+      const int_type __eof = traits_type::eof();
+
+      streambuf_type* __sb = __i._M_sbuf;
+      while (__n > 0)
+ {
+   streamsize __size = __sb->egptr() - __sb->gptr();
+   if (__size > __n)
+     {
+       __sb->__safe_gbump(__n);
+       break;
+     }
+
+   __sb->__safe_gbump(__size);
+   __n -= __size;
+   if (traits_type::eq_int_type(__sb->underflow(), __eof))
+     {
+      
+
+                      ;
+       break;
+     }
+ }
+
+      __i._M_c = __eof;
+    }
+
+
+
+
+}
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+  template<typename _Tp>
+    void
+    __convert_to_v(const char*, _Tp&, ios_base::iostate&,
+     const __c_locale&) throw();
+
+
+  template<>
+    void
+    __convert_to_v(const char*, float&, ios_base::iostate&,
+     const __c_locale&) throw();
+
+  template<>
+    void
+    __convert_to_v(const char*, double&, ios_base::iostate&,
+     const __c_locale&) throw();
+
+  template<>
+    void
+    __convert_to_v(const char*, long double&, ios_base::iostate&,
+     const __c_locale&) throw();
+
+
+
+  template<typename _CharT, typename _Traits>
+    struct __pad
+    {
+      static void
+      _S_pad(ios_base& __io, _CharT __fill, _CharT* __news,
+      const _CharT* __olds, streamsize __newlen, streamsize __oldlen);
+    };
+
+
+
+
+
+
+  template<typename _CharT>
+    _CharT*
+    __add_grouping(_CharT* __s, _CharT __sep,
+     const char* __gbeg, size_t __gsize,
+     const _CharT* __first, const _CharT* __last);
+
+
+
+
+  template<typename _CharT>
+    inline
+    ostreambuf_iterator<_CharT>
+    __write(ostreambuf_iterator<_CharT> __s, const _CharT* __ws, int __len)
+    {
+      __s._M_put(__ws, __len);
+      return __s;
+    }
+
+
+  template<typename _CharT, typename _OutIter>
+    inline
+    _OutIter
+    __write(_OutIter __s, const _CharT* __ws, int __len)
+    {
+      for (int __j = 0; __j < __len; __j++, ++__s)
+ *__s = __ws[__j];
+      return __s;
+    }
+  template<typename _CharT>
+    class __ctype_abstract_base : public locale::facet, public ctype_base
+    {
+    public:
+
+
+      typedef _CharT char_type;
+      bool
+      is(mask __m, char_type __c) const
+      { return this->do_is(__m, __c); }
+      const char_type*
+      is(const char_type *__lo, const char_type *__hi, mask *__vec) const
+      { return this->do_is(__lo, __hi, __vec); }
+      const char_type*
+      scan_is(mask __m, const char_type* __lo, const char_type* __hi) const
+      { return this->do_scan_is(__m, __lo, __hi); }
+      const char_type*
+      scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
+      { return this->do_scan_not(__m, __lo, __hi); }
+      char_type
+      toupper(char_type __c) const
+      { return this->do_toupper(__c); }
+      const char_type*
+      toupper(char_type *__lo, const char_type* __hi) const
+      { return this->do_toupper(__lo, __hi); }
+      char_type
+      tolower(char_type __c) const
+      { return this->do_tolower(__c); }
+      const char_type*
+      tolower(char_type* __lo, const char_type* __hi) const
+      { return this->do_tolower(__lo, __hi); }
+      char_type
+      widen(char __c) const
+      { return this->do_widen(__c); }
+      const char*
+      widen(const char* __lo, const char* __hi, char_type* __to) const
+      { return this->do_widen(__lo, __hi, __to); }
+      char
+      narrow(char_type __c, char __dfault) const
+      { return this->do_narrow(__c, __dfault); }
+      const char_type*
+      narrow(const char_type* __lo, const char_type* __hi,
+       char __dfault, char* __to) const
+      { return this->do_narrow(__lo, __hi, __dfault, __to); }
+
+    protected:
+      explicit
+      __ctype_abstract_base(size_t __refs = 0): facet(__refs) { }
+
+      virtual
+      ~__ctype_abstract_base() { }
+      virtual bool
+      do_is(mask __m, char_type __c) const = 0;
+      virtual const char_type*
+      do_is(const char_type* __lo, const char_type* __hi,
+     mask* __vec) const = 0;
+      virtual const char_type*
+      do_scan_is(mask __m, const char_type* __lo,
+   const char_type* __hi) const = 0;
+      virtual const char_type*
+      do_scan_not(mask __m, const char_type* __lo,
+    const char_type* __hi) const = 0;
+      virtual char_type
+      do_toupper(char_type __c) const = 0;
+      virtual const char_type*
+      do_toupper(char_type* __lo, const char_type* __hi) const = 0;
+      virtual char_type
+      do_tolower(char_type __c) const = 0;
+      virtual const char_type*
+      do_tolower(char_type* __lo, const char_type* __hi) const = 0;
+      virtual char_type
+      do_widen(char __c) const = 0;
+      virtual const char*
+      do_widen(const char* __lo, const char* __hi, char_type* __to) const = 0;
+      virtual char
+      do_narrow(char_type __c, char __dfault) const = 0;
+      virtual const char_type*
+      do_narrow(const char_type* __lo, const char_type* __hi,
+  char __dfault, char* __to) const = 0;
+    };
+  template<typename _CharT>
+    class ctype : public __ctype_abstract_base<_CharT>
+    {
+    public:
+
+      typedef _CharT char_type;
+      typedef typename __ctype_abstract_base<_CharT>::mask mask;
+
+
+      static locale::id id;
+
+      explicit
+      ctype(size_t __refs = 0) : __ctype_abstract_base<_CharT>(__refs) { }
+
+   protected:
+      virtual
+      ~ctype();
+
+      virtual bool
+      do_is(mask __m, char_type __c) const;
+
+      virtual const char_type*
+      do_is(const char_type* __lo, const char_type* __hi, mask* __vec) const;
+
+      virtual const char_type*
+      do_scan_is(mask __m, const char_type* __lo, const char_type* __hi) const;
+
+      virtual const char_type*
+      do_scan_not(mask __m, const char_type* __lo,
+    const char_type* __hi) const;
+
+      virtual char_type
+      do_toupper(char_type __c) const;
+
+      virtual const char_type*
+      do_toupper(char_type* __lo, const char_type* __hi) const;
+
+      virtual char_type
+      do_tolower(char_type __c) const;
+
+      virtual const char_type*
+      do_tolower(char_type* __lo, const char_type* __hi) const;
+
+      virtual char_type
+      do_widen(char __c) const;
+
+      virtual const char*
+      do_widen(const char* __lo, const char* __hi, char_type* __dest) const;
+
+      virtual char
+      do_narrow(char_type, char __dfault) const;
+
+      virtual const char_type*
+      do_narrow(const char_type* __lo, const char_type* __hi,
+  char __dfault, char* __to) const;
+    };
+
+  template<typename _CharT>
+    locale::id ctype<_CharT>::id;
+  template<>
+    class ctype<char> : public locale::facet, public ctype_base
+    {
+    public:
+
+
+      typedef char char_type;
+
+    protected:
+
+      __c_locale _M_c_locale_ctype;
+      bool _M_del;
+      __to_type _M_toupper;
+      __to_type _M_tolower;
+      const mask* _M_table;
+      mutable char _M_widen_ok;
+      mutable char _M_widen[1 + static_cast<unsigned char>(-1)];
+      mutable char _M_narrow[1 + static_cast<unsigned char>(-1)];
+      mutable char _M_narrow_ok;
+
+
+    public:
+
+      static locale::id id;
+
+      static const size_t table_size = 1 + static_cast<unsigned char>(-1);
+      explicit
+      ctype(const mask* __table = 0, bool __del = false, size_t __refs = 0);
+      explicit
+      ctype(__c_locale __cloc, const mask* __table = 0, bool __del = false,
+     size_t __refs = 0);
+      inline bool
+      is(mask __m, char __c) const;
+      inline const char*
+      is(const char* __lo, const char* __hi, mask* __vec) const;
+      inline const char*
+      scan_is(mask __m, const char* __lo, const char* __hi) const;
+      inline const char*
+      scan_not(mask __m, const char* __lo, const char* __hi) const;
+      char_type
+      toupper(char_type __c) const
+      { return this->do_toupper(__c); }
+      const char_type*
+      toupper(char_type *__lo, const char_type* __hi) const
+      { return this->do_toupper(__lo, __hi); }
+      char_type
+      tolower(char_type __c) const
+      { return this->do_tolower(__c); }
+      const char_type*
+      tolower(char_type* __lo, const char_type* __hi) const
+      { return this->do_tolower(__lo, __hi); }
+      char_type
+      widen(char __c) const
+      {
+ if (_M_widen_ok)
+   return _M_widen[static_cast<unsigned char>(__c)];
+ this->_M_widen_init();
+ return this->do_widen(__c);
+      }
+      const char*
+      widen(const char* __lo, const char* __hi, char_type* __to) const
+      {
+ if (_M_widen_ok == 1)
+   {
+     __builtin_memcpy(__to, __lo, __hi - __lo);
+     return __hi;
+   }
+ if (!_M_widen_ok)
+   _M_widen_init();
+ return this->do_widen(__lo, __hi, __to);
+      }
+      char
+      narrow(char_type __c, char __dfault) const
+      {
+ if (_M_narrow[static_cast<unsigned char>(__c)])
+   return _M_narrow[static_cast<unsigned char>(__c)];
+ const char __t = do_narrow(__c, __dfault);
+ if (__t != __dfault)
+   _M_narrow[static_cast<unsigned char>(__c)] = __t;
+ return __t;
+      }
+      const char_type*
+      narrow(const char_type* __lo, const char_type* __hi,
+      char __dfault, char* __to) const
+      {
+ if (__builtin_expect(_M_narrow_ok == 1, true))
+   {
+     __builtin_memcpy(__to, __lo, __hi - __lo);
+     return __hi;
+   }
+ if (!_M_narrow_ok)
+   _M_narrow_init();
+ return this->do_narrow(__lo, __hi, __dfault, __to);
+      }
+
+
+
+
+
+      const mask*
+      table() const throw()
+      { return _M_table; }
+
+
+      static const mask*
+      classic_table() throw();
+    protected:
+
+
+
+
+
+
+
+      virtual
+      ~ctype();
+      virtual char_type
+      do_toupper(char_type __c) const;
+      virtual const char_type*
+      do_toupper(char_type* __lo, const char_type* __hi) const;
+      virtual char_type
+      do_tolower(char_type __c) const;
+      virtual const char_type*
+      do_tolower(char_type* __lo, const char_type* __hi) const;
+      virtual char_type
+      do_widen(char __c) const
+      { return __c; }
+      virtual const char*
+      do_widen(const char* __lo, const char* __hi, char_type* __to) const
+      {
+ __builtin_memcpy(__to, __lo, __hi - __lo);
+ return __hi;
+      }
+      virtual char
+      do_narrow(char_type __c, char __dfault __attribute__((__unused__))) const
+      { return __c; }
+      virtual const char_type*
+      do_narrow(const char_type* __lo, const char_type* __hi,
+  char __dfault __attribute__((__unused__)), char* __to) const
+      {
+ __builtin_memcpy(__to, __lo, __hi - __lo);
+ return __hi;
+      }
+
+    private:
+      void _M_narrow_init() const;
+      void _M_widen_init() const;
+    };
+  template<>
+    class ctype<wchar_t> : public __ctype_abstract_base<wchar_t>
+    {
+    public:
+
+
+      typedef wchar_t char_type;
+      typedef wctype_t __wmask_type;
+
+    protected:
+      __c_locale _M_c_locale_ctype;
+
+
+      bool _M_narrow_ok;
+      char _M_narrow[128];
+      wint_t _M_widen[1 + static_cast<unsigned char>(-1)];
+
+
+      mask _M_bit[16];
+      __wmask_type _M_wmask[16];
+
+    public:
+
+
+      static locale::id id;
+      explicit
+      ctype(size_t __refs = 0);
+      explicit
+      ctype(__c_locale __cloc, size_t __refs = 0);
+
+    protected:
+      __wmask_type
+      _M_convert_to_wmask(const mask __m) const throw();
+
+
+      virtual
+      ~ctype();
+      virtual bool
+      do_is(mask __m, char_type __c) const;
+      virtual const char_type*
+      do_is(const char_type* __lo, const char_type* __hi, mask* __vec) const;
+      virtual const char_type*
+      do_scan_is(mask __m, const char_type* __lo, const char_type* __hi) const;
+      virtual const char_type*
+      do_scan_not(mask __m, const char_type* __lo,
+    const char_type* __hi) const;
+      virtual char_type
+      do_toupper(char_type __c) const;
+      virtual const char_type*
+      do_toupper(char_type* __lo, const char_type* __hi) const;
+      virtual char_type
+      do_tolower(char_type __c) const;
+      virtual const char_type*
+      do_tolower(char_type* __lo, const char_type* __hi) const;
+      virtual char_type
+      do_widen(char __c) const;
+      virtual const char*
+      do_widen(const char* __lo, const char* __hi, char_type* __to) const;
+      virtual char
+      do_narrow(char_type __c, char __dfault) const;
+      virtual const char_type*
+      do_narrow(const char_type* __lo, const char_type* __hi,
+  char __dfault, char* __to) const;
+
+
+      void
+      _M_initialize_ctype() throw();
+    };
+
+
+
+  template<typename _CharT>
+    class ctype_byname : public ctype<_CharT>
+    {
+    public:
+      typedef typename ctype<_CharT>::mask mask;
+
+      explicit
+      ctype_byname(const char* __s, size_t __refs = 0);
+
+
+      explicit
+      ctype_byname(const string& __s, size_t __refs = 0)
+      : ctype_byname(__s.c_str(), __refs) { }
+
+
+    protected:
+      virtual
+      ~ctype_byname() { }
+    };
+
+
+  template<>
+    class ctype_byname<char> : public ctype<char>
+    {
+    public:
+      explicit
+      ctype_byname(const char* __s, size_t __refs = 0);
+
+
+      explicit
+      ctype_byname(const string& __s, size_t __refs = 0);
+
+
+    protected:
+      virtual
+      ~ctype_byname();
+    };
+
+
+  template<>
+    class ctype_byname<wchar_t> : public ctype<wchar_t>
+    {
+    public:
+      explicit
+      ctype_byname(const char* __s, size_t __refs = 0);
+
+
+      explicit
+      ctype_byname(const string& __s, size_t __refs = 0);
+
+
+    protected:
+      virtual
+      ~ctype_byname();
+    };
+
+
+
+}
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+  bool
+  ctype<char>::
+  is(mask __m, char __c) const
+  { return _M_table[static_cast<unsigned char>(__c)] & __m; }
+
+  const char*
+  ctype<char>::
+  is(const char* __low, const char* __high, mask* __vec) const
+  {
+    while (__low < __high)
+      *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
+    return __high;
+  }
+
+  const char*
+  ctype<char>::
+  scan_is(mask __m, const char* __low, const char* __high) const
+  {
+    while (__low < __high
+    && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
+      ++__low;
+    return __low;
+  }
+
+  const char*
+  ctype<char>::
+  scan_not(mask __m, const char* __low, const char* __high) const
+  {
+    while (__low < __high
+    && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
+      ++__low;
+    return __low;
+  }
+
+
+}
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+  class __num_base
+  {
+  public:
+
+
+    enum
+      {
+ _S_ominus,
+ _S_oplus,
+ _S_ox,
+ _S_oX,
+ _S_odigits,
+ _S_odigits_end = _S_odigits + 16,
+ _S_oudigits = _S_odigits_end,
+ _S_oudigits_end = _S_oudigits + 16,
+ _S_oe = _S_odigits + 14,
+ _S_oE = _S_oudigits + 14,
+ _S_oend = _S_oudigits_end
+      };
+
+
+
+
+
+
+    static const char* _S_atoms_out;
+
+
+
+    static const char* _S_atoms_in;
+
+    enum
+    {
+      _S_iminus,
+      _S_iplus,
+      _S_ix,
+      _S_iX,
+      _S_izero,
+      _S_ie = _S_izero + 14,
+      _S_iE = _S_izero + 20,
+      _S_iend = 26
+    };
+
+
+
+    static void
+    _S_format_float(const ios_base& __io, char* __fptr, char __mod) throw();
+  };
+
+  template<typename _CharT>
+    struct __numpunct_cache : public locale::facet
+    {
+      const char* _M_grouping;
+      size_t _M_grouping_size;
+      bool _M_use_grouping;
+      const _CharT* _M_truename;
+      size_t _M_truename_size;
+      const _CharT* _M_falsename;
+      size_t _M_falsename_size;
+      _CharT _M_decimal_point;
+      _CharT _M_thousands_sep;
+
+
+
+
+
+      _CharT _M_atoms_out[__num_base::_S_oend];
+
+
+
+
+
+      _CharT _M_atoms_in[__num_base::_S_iend];
+
+      bool _M_allocated;
+
+      __numpunct_cache(size_t __refs = 0)
+      : facet(__refs), _M_grouping(0), _M_grouping_size(0),
+ _M_use_grouping(false),
+ _M_truename(0), _M_truename_size(0), _M_falsename(0),
+ _M_falsename_size(0), _M_decimal_point(_CharT()),
+ _M_thousands_sep(_CharT()), _M_allocated(false)
+ { }
+
+      ~__numpunct_cache();
+
+      void
+      _M_cache(const locale& __loc);
+
+    private:
+      __numpunct_cache&
+      operator=(const __numpunct_cache&);
+
+      explicit
+      __numpunct_cache(const __numpunct_cache&);
+    };
+
+  template<typename _CharT>
+    __numpunct_cache<_CharT>::~__numpunct_cache()
+    {
+      if (_M_allocated)
+ {
+   delete [] _M_grouping;
+   delete [] _M_truename;
+   delete [] _M_falsename;
+ }
+    }
+
+namespace __cxx11 {
+  template<typename _CharT>
+    class numpunct : public locale::facet
+    {
+    public:
+
+
+
+      typedef _CharT char_type;
+      typedef basic_string<_CharT> string_type;
+
+      typedef __numpunct_cache<_CharT> __cache_type;
+
+    protected:
+      __cache_type* _M_data;
+
+    public:
+
+      static locale::id id;
+
+
+
+
+
+
+      explicit
+      numpunct(size_t __refs = 0)
+      : facet(__refs), _M_data(0)
+      { _M_initialize_numpunct(); }
+      explicit
+      numpunct(__cache_type* __cache, size_t __refs = 0)
+      : facet(__refs), _M_data(__cache)
+      { _M_initialize_numpunct(); }
+      explicit
+      numpunct(__c_locale __cloc, size_t __refs = 0)
+      : facet(__refs), _M_data(0)
+      { _M_initialize_numpunct(__cloc); }
+      char_type
+      decimal_point() const
+      { return this->do_decimal_point(); }
+      char_type
+      thousands_sep() const
+      { return this->do_thousands_sep(); }
+      string
+      grouping() const
+      { return this->do_grouping(); }
+      string_type
+      truename() const
+      { return this->do_truename(); }
+      string_type
+      falsename() const
+      { return this->do_falsename(); }
+
+    protected:
+
+      virtual
+      ~numpunct();
+      virtual char_type
+      do_decimal_point() const
+      { return _M_data->_M_decimal_point; }
+      virtual char_type
+      do_thousands_sep() const
+      { return _M_data->_M_thousands_sep; }
+      virtual string
+      do_grouping() const
+      { return _M_data->_M_grouping; }
+      virtual string_type
+      do_truename() const
+      { return _M_data->_M_truename; }
+      virtual string_type
+      do_falsename() const
+      { return _M_data->_M_falsename; }
+
+
+      void
+      _M_initialize_numpunct(__c_locale __cloc = 0);
+    };
+
+  template<typename _CharT>
+    locale::id numpunct<_CharT>::id;
+
+  template<>
+    numpunct<char>::~numpunct();
+
+  template<>
+    void
+    numpunct<char>::_M_initialize_numpunct(__c_locale __cloc);
+
+
+  template<>
+    numpunct<wchar_t>::~numpunct();
+
+  template<>
+    void
+    numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc);
+
+
+
+  template<typename _CharT>
+    class numpunct_byname : public numpunct<_CharT>
+    {
+    public:
+      typedef _CharT char_type;
+      typedef basic_string<_CharT> string_type;
+
+      explicit
+      numpunct_byname(const char* __s, size_t __refs = 0)
+      : numpunct<_CharT>(__refs)
+      {
+ if (__builtin_strcmp(__s, "C") != 0
+     && __builtin_strcmp(__s, "POSIX") != 0)
+   {
+     __c_locale __tmp;
+     this->_S_create_c_locale(__tmp, __s);
+     this->_M_initialize_numpunct(__tmp);
+     this->_S_destroy_c_locale(__tmp);
+   }
+      }
+
+
+      explicit
+      numpunct_byname(const string& __s, size_t __refs = 0)
+      : numpunct_byname(__s.c_str(), __refs) { }
+
+
+    protected:
+      virtual
+      ~numpunct_byname() { }
+    };
+
+}
+
+
+  template<typename _CharT, typename _InIter>
+    class num_get : public locale::facet
+    {
+    public:
+
+
+
+      typedef _CharT char_type;
+      typedef _InIter iter_type;
+
+
+
+      static locale::id id;
+      explicit
+      num_get(size_t __refs = 0) : facet(__refs) { }
+      iter_type
+      get(iter_type __in, iter_type __end, ios_base& __io,
+   ios_base::iostate& __err, bool& __v) const
+      { return this->do_get(__in, __end, __io, __err, __v); }
+      iter_type
+      get(iter_type __in, iter_type __end, ios_base& __io,
+   ios_base::iostate& __err, long& __v) const
+      { return this->do_get(__in, __end, __io, __err, __v); }
+
+      iter_type
+      get(iter_type __in, iter_type __end, ios_base& __io,
+   ios_base::iostate& __err, unsigned short& __v) const
+      { return this->do_get(__in, __end, __io, __err, __v); }
+
+      iter_type
+      get(iter_type __in, iter_type __end, ios_base& __io,
+   ios_base::iostate& __err, unsigned int& __v) const
+      { return this->do_get(__in, __end, __io, __err, __v); }
+
+      iter_type
+      get(iter_type __in, iter_type __end, ios_base& __io,
+   ios_base::iostate& __err, unsigned long& __v) const
+      { return this->do_get(__in, __end, __io, __err, __v); }
+
+
+      iter_type
+      get(iter_type __in, iter_type __end, ios_base& __io,
+   ios_base::iostate& __err, long long& __v) const
+      { return this->do_get(__in, __end, __io, __err, __v); }
+
+      iter_type
+      get(iter_type __in, iter_type __end, ios_base& __io,
+   ios_base::iostate& __err, unsigned long long& __v) const
+      { return this->do_get(__in, __end, __io, __err, __v); }
+      iter_type
+      get(iter_type __in, iter_type __end, ios_base& __io,
+   ios_base::iostate& __err, float& __v) const
+      { return this->do_get(__in, __end, __io, __err, __v); }
+
+      iter_type
+      get(iter_type __in, iter_type __end, ios_base& __io,
+   ios_base::iostate& __err, double& __v) const
+      { return this->do_get(__in, __end, __io, __err, __v); }
+
+      iter_type
+      get(iter_type __in, iter_type __end, ios_base& __io,
+   ios_base::iostate& __err, long double& __v) const
+      { return this->do_get(__in, __end, __io, __err, __v); }
+      iter_type
+      get(iter_type __in, iter_type __end, ios_base& __io,
+   ios_base::iostate& __err, void*& __v) const
+      { return this->do_get(__in, __end, __io, __err, __v); }
+
+    protected:
+
+      virtual ~num_get() { }
+
+      __attribute ((__abi_tag__ ("cxx11")))
+      iter_type
+      _M_extract_float(iter_type, iter_type, ios_base&, ios_base::iostate&,
+         string&) const;
+
+      template<typename _ValueT>
+ __attribute ((__abi_tag__ ("cxx11")))
+ iter_type
+ _M_extract_int(iter_type, iter_type, ios_base&, ios_base::iostate&,
+         _ValueT&) const;
+
+      template<typename _CharT2>
+      typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value, int>::__type
+ _M_find(const _CharT2*, size_t __len, _CharT2 __c) const
+ {
+   int __ret = -1;
+   if (__len <= 10)
+     {
+       if (__c >= _CharT2('0') && __c < _CharT2(_CharT2('0') + __len))
+  __ret = __c - _CharT2('0');
+     }
+   else
+     {
+       if (__c >= _CharT2('0') && __c <= _CharT2('9'))
+  __ret = __c - _CharT2('0');
+       else if (__c >= _CharT2('a') && __c <= _CharT2('f'))
+  __ret = 10 + (__c - _CharT2('a'));
+       else if (__c >= _CharT2('A') && __c <= _CharT2('F'))
+  __ret = 10 + (__c - _CharT2('A'));
+     }
+   return __ret;
+ }
+
+      template<typename _CharT2>
+      typename __gnu_cxx::__enable_if<!__is_char<_CharT2>::__value,
+          int>::__type
+ _M_find(const _CharT2* __zero, size_t __len, _CharT2 __c) const
+ {
+   int __ret = -1;
+   const char_type* __q = char_traits<_CharT2>::find(__zero, __len, __c);
+   if (__q)
+     {
+       __ret = __q - __zero;
+       if (__ret > 15)
+  __ret -= 6;
+     }
+   return __ret;
+ }
+      virtual iter_type
+      do_get(iter_type, iter_type, ios_base&, ios_base::iostate&, bool&) const;
+
+      virtual iter_type
+      do_get(iter_type __beg, iter_type __end, ios_base& __io,
+      ios_base::iostate& __err, long& __v) const
+      { return _M_extract_int(__beg, __end, __io, __err, __v); }
+
+      virtual iter_type
+      do_get(iter_type __beg, iter_type __end, ios_base& __io,
+      ios_base::iostate& __err, unsigned short& __v) const
+      { return _M_extract_int(__beg, __end, __io, __err, __v); }
+
+      virtual iter_type
+      do_get(iter_type __beg, iter_type __end, ios_base& __io,
+      ios_base::iostate& __err, unsigned int& __v) const
+      { return _M_extract_int(__beg, __end, __io, __err, __v); }
+
+      virtual iter_type
+      do_get(iter_type __beg, iter_type __end, ios_base& __io,
+      ios_base::iostate& __err, unsigned long& __v) const
+      { return _M_extract_int(__beg, __end, __io, __err, __v); }
+
+
+      virtual iter_type
+      do_get(iter_type __beg, iter_type __end, ios_base& __io,
+      ios_base::iostate& __err, long long& __v) const
+      { return _M_extract_int(__beg, __end, __io, __err, __v); }
+
+      virtual iter_type
+      do_get(iter_type __beg, iter_type __end, ios_base& __io,
+      ios_base::iostate& __err, unsigned long long& __v) const
+      { return _M_extract_int(__beg, __end, __io, __err, __v); }
+
+
+      virtual iter_type
+      do_get(iter_type, iter_type, ios_base&, ios_base::iostate&, float&) const;
+
+      virtual iter_type
+      do_get(iter_type, iter_type, ios_base&, ios_base::iostate&,
+      double&) const;
+
+
+
+
+
+
+
+      virtual iter_type
+      do_get(iter_type, iter_type, ios_base&, ios_base::iostate&,
+      long double&) const;
+
+
+      virtual iter_type
+      do_get(iter_type, iter_type, ios_base&, ios_base::iostate&, void*&) const;
+    };
+
+  template<typename _CharT, typename _InIter>
+    locale::id num_get<_CharT, _InIter>::id;
+  template<typename _CharT, typename _OutIter>
+    class num_put : public locale::facet
+    {
+    public:
+
+
+
+      typedef _CharT char_type;
+      typedef _OutIter iter_type;
+
+
+
+      static locale::id id;
+      explicit
+      num_put(size_t __refs = 0) : facet(__refs) { }
+      iter_type
+      put(iter_type __s, ios_base& __io, char_type __fill, bool __v) const
+      { return this->do_put(__s, __io, __fill, __v); }
+      iter_type
+      put(iter_type __s, ios_base& __io, char_type __fill, long __v) const
+      { return this->do_put(__s, __io, __fill, __v); }
+
+      iter_type
+      put(iter_type __s, ios_base& __io, char_type __fill,
+   unsigned long __v) const
+      { return this->do_put(__s, __io, __fill, __v); }
+
+
+      iter_type
+      put(iter_type __s, ios_base& __io, char_type __fill, long long __v) const
+      { return this->do_put(__s, __io, __fill, __v); }
+
+      iter_type
+      put(iter_type __s, ios_base& __io, char_type __fill,
+   unsigned long long __v) const
+      { return this->do_put(__s, __io, __fill, __v); }
+      iter_type
+      put(iter_type __s, ios_base& __io, char_type __fill, double __v) const
+      { return this->do_put(__s, __io, __fill, __v); }
+
+      iter_type
+      put(iter_type __s, ios_base& __io, char_type __fill,
+   long double __v) const
+      { return this->do_put(__s, __io, __fill, __v); }
+      iter_type
+      put(iter_type __s, ios_base& __io, char_type __fill,
+   const void* __v) const
+      { return this->do_put(__s, __io, __fill, __v); }
+
+    protected:
+      template<typename _ValueT>
+ iter_type
+ _M_insert_float(iter_type, ios_base& __io, char_type __fill,
+   char __mod, _ValueT __v) const;
+
+      void
+      _M_group_float(const char* __grouping, size_t __grouping_size,
+       char_type __sep, const char_type* __p, char_type* __new,
+       char_type* __cs, int& __len) const;
+
+      template<typename _ValueT>
+ iter_type
+ _M_insert_int(iter_type, ios_base& __io, char_type __fill,
+        _ValueT __v) const;
+
+      void
+      _M_group_int(const char* __grouping, size_t __grouping_size,
+     char_type __sep, ios_base& __io, char_type* __new,
+     char_type* __cs, int& __len) const;
+
+      void
+      _M_pad(char_type __fill, streamsize __w, ios_base& __io,
+      char_type* __new, const char_type* __cs, int& __len) const;
+
+
+      virtual
+      ~num_put() { }
+      virtual iter_type
+      do_put(iter_type __s, ios_base& __io, char_type __fill, bool __v) const;
+
+      virtual iter_type
+      do_put(iter_type __s, ios_base& __io, char_type __fill, long __v) const
+      { return _M_insert_int(__s, __io, __fill, __v); }
+
+      virtual iter_type
+      do_put(iter_type __s, ios_base& __io, char_type __fill,
+      unsigned long __v) const
+      { return _M_insert_int(__s, __io, __fill, __v); }
+
+
+      virtual iter_type
+      do_put(iter_type __s, ios_base& __io, char_type __fill,
+      long long __v) const
+      { return _M_insert_int(__s, __io, __fill, __v); }
+
+      virtual iter_type
+      do_put(iter_type __s, ios_base& __io, char_type __fill,
+      unsigned long long __v) const
+      { return _M_insert_int(__s, __io, __fill, __v); }
+
+
+      virtual iter_type
+      do_put(iter_type, ios_base&, char_type, double) const;
+
+
+
+
+
+
+      virtual iter_type
+      do_put(iter_type, ios_base&, char_type, long double) const;
+
+
+      virtual iter_type
+      do_put(iter_type, ios_base&, char_type, const void*) const;
+
+
+
+
+
+
+
+    };
+
+  template <typename _CharT, typename _OutIter>
+    locale::id num_put<_CharT, _OutIter>::id;
+
+
+
+
+
+
+
+
+
+  template<typename _CharT>
+    inline bool
+    isspace(_CharT __c, const locale& __loc)
+    { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::space, __c); }
+
+
+  template<typename _CharT>
+    inline bool
+    isprint(_CharT __c, const locale& __loc)
+    { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::print, __c); }
+
+
+  template<typename _CharT>
+    inline bool
+    iscntrl(_CharT __c, const locale& __loc)
+    { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::cntrl, __c); }
+
+
+  template<typename _CharT>
+    inline bool
+    isupper(_CharT __c, const locale& __loc)
+    { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::upper, __c); }
+
+
+  template<typename _CharT>
+    inline bool
+    islower(_CharT __c, const locale& __loc)
+    { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::lower, __c); }
+
+
+  template<typename _CharT>
+    inline bool
+    isalpha(_CharT __c, const locale& __loc)
+    { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::alpha, __c); }
+
+
+  template<typename _CharT>
+    inline bool
+    isdigit(_CharT __c, const locale& __loc)
+    { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::digit, __c); }
+
+
+  template<typename _CharT>
+    inline bool
+    ispunct(_CharT __c, const locale& __loc)
+    { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::punct, __c); }
+
+
+  template<typename _CharT>
+    inline bool
+    isxdigit(_CharT __c, const locale& __loc)
+    { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::xdigit, __c); }
+
+
+  template<typename _CharT>
+    inline bool
+    isalnum(_CharT __c, const locale& __loc)
+    { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::alnum, __c); }
+
+
+  template<typename _CharT>
+    inline bool
+    isgraph(_CharT __c, const locale& __loc)
+    { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::graph, __c); }
+
+
+
+  template<typename _CharT>
+    inline bool
+    isblank(_CharT __c, const locale& __loc)
+    { return use_facet<ctype<_CharT> >(__loc).is(ctype_base::blank, __c); }
+
+
+
+  template<typename _CharT>
+    inline _CharT
+    toupper(_CharT __c, const locale& __loc)
+    { return use_facet<ctype<_CharT> >(__loc).toupper(__c); }
+
+
+  template<typename _CharT>
+    inline _CharT
+    tolower(_CharT __c, const locale& __loc)
+    { return use_facet<ctype<_CharT> >(__loc).tolower(__c); }
+
+
+}
+
+       
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+
+  template<typename _Facet>
+    struct __use_cache
+    {
+      const _Facet*
+      operator() (const locale& __loc) const;
+    };
+
+
+  template<typename _CharT>
+    struct __use_cache<__numpunct_cache<_CharT> >
+    {
+      const __numpunct_cache<_CharT>*
+      operator() (const locale& __loc) const
+      {
+ const size_t __i = numpunct<_CharT>::id._M_id();
+ const locale::facet** __caches = __loc._M_impl->_M_caches;
+ if (!__caches[__i])
+   {
+     __numpunct_cache<_CharT>* __tmp = 0;
+     try
+       {
+  __tmp = new __numpunct_cache<_CharT>;
+  __tmp->_M_cache(__loc);
+       }
+     catch(...)
+       {
+  delete __tmp;
+  throw;
+       }
+     __loc._M_impl->_M_install_cache(__tmp, __i);
+   }
+ return static_cast<const __numpunct_cache<_CharT>*>(__caches[__i]);
+      }
+    };
+
+  template<typename _CharT>
+    void
+    __numpunct_cache<_CharT>::_M_cache(const locale& __loc)
+    {
+      const numpunct<_CharT>& __np = use_facet<numpunct<_CharT> >(__loc);
+
+      char* __grouping = 0;
+      _CharT* __truename = 0;
+      _CharT* __falsename = 0;
+      try
+ {
+   const string& __g = __np.grouping();
+   _M_grouping_size = __g.size();
+   __grouping = new char[_M_grouping_size];
+   __g.copy(__grouping, _M_grouping_size);
+   _M_use_grouping = (_M_grouping_size
+        && static_cast<signed char>(__grouping[0]) > 0
+        && (__grouping[0]
+     != __gnu_cxx::__numeric_traits<char>::__max));
+
+   const basic_string<_CharT>& __tn = __np.truename();
+   _M_truename_size = __tn.size();
+   __truename = new _CharT[_M_truename_size];
+   __tn.copy(__truename, _M_truename_size);
+
+   const basic_string<_CharT>& __fn = __np.falsename();
+   _M_falsename_size = __fn.size();
+   __falsename = new _CharT[_M_falsename_size];
+   __fn.copy(__falsename, _M_falsename_size);
+
+   _M_decimal_point = __np.decimal_point();
+   _M_thousands_sep = __np.thousands_sep();
+
+   const ctype<_CharT>& __ct = use_facet<ctype<_CharT> >(__loc);
+   __ct.widen(__num_base::_S_atoms_out,
+       __num_base::_S_atoms_out
+       + __num_base::_S_oend, _M_atoms_out);
+   __ct.widen(__num_base::_S_atoms_in,
+       __num_base::_S_atoms_in
+       + __num_base::_S_iend, _M_atoms_in);
+
+   _M_grouping = __grouping;
+   _M_truename = __truename;
+   _M_falsename = __falsename;
+   _M_allocated = true;
+ }
+      catch(...)
+ {
+   delete [] __grouping;
+   delete [] __truename;
+   delete [] __falsename;
+   throw;
+ }
+    }
+  __attribute__ ((__pure__)) bool
+  __verify_grouping(const char* __grouping, size_t __grouping_size,
+      const string& __grouping_tmp) throw ();
+
+
+
+  template<typename _CharT, typename _InIter>
+    __attribute ((__abi_tag__ ("cxx11")))
+    _InIter
+    num_get<_CharT, _InIter>::
+    _M_extract_float(_InIter __beg, _InIter __end, ios_base& __io,
+       ios_base::iostate& __err, string& __xtrc) const
+    {
+      typedef char_traits<_CharT> __traits_type;
+      typedef __numpunct_cache<_CharT> __cache_type;
+      __use_cache<__cache_type> __uc;
+      const locale& __loc = __io._M_getloc();
+      const __cache_type* __lc = __uc(__loc);
+      const _CharT* __lit = __lc->_M_atoms_in;
+      char_type __c = char_type();
+
+
+      bool __testeof = __beg == __end;
+
+
+      if (!__testeof)
+ {
+   __c = *__beg;
+   const bool __plus = __c == __lit[__num_base::_S_iplus];
+   if ((__plus || __c == __lit[__num_base::_S_iminus])
+       && !(__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
+       && !(__c == __lc->_M_decimal_point))
+     {
+       __xtrc += __plus ? '+' : '-';
+       if (++__beg != __end)
+  __c = *__beg;
+       else
+  __testeof = true;
+     }
+ }
+
+
+      bool __found_mantissa = false;
+      int __sep_pos = 0;
+      while (!__testeof)
+ {
+   if ((__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
+       || __c == __lc->_M_decimal_point)
+     break;
+   else if (__c == __lit[__num_base::_S_izero])
+     {
+       if (!__found_mantissa)
+  {
+    __xtrc += '0';
+    __found_mantissa = true;
+  }
+       ++__sep_pos;
+
+       if (++__beg != __end)
+  __c = *__beg;
+       else
+  __testeof = true;
+     }
+   else
+     break;
+ }
+
+
+      bool __found_dec = false;
+      bool __found_sci = false;
+      string __found_grouping;
+      if (__lc->_M_use_grouping)
+ __found_grouping.reserve(32);
+      const char_type* __lit_zero = __lit + __num_base::_S_izero;
+
+      if (!__lc->_M_allocated)
+
+ while (!__testeof)
+   {
+     const int __digit = _M_find(__lit_zero, 10, __c);
+     if (__digit != -1)
+       {
+  __xtrc += '0' + __digit;
+  __found_mantissa = true;
+       }
+     else if (__c == __lc->_M_decimal_point
+       && !__found_dec && !__found_sci)
+       {
+  __xtrc += '.';
+  __found_dec = true;
+       }
+     else if ((__c == __lit[__num_base::_S_ie]
+        || __c == __lit[__num_base::_S_iE])
+       && !__found_sci && __found_mantissa)
+       {
+
+  __xtrc += 'e';
+  __found_sci = true;
+
+
+  if (++__beg != __end)
+    {
+      __c = *__beg;
+      const bool __plus = __c == __lit[__num_base::_S_iplus];
+      if (__plus || __c == __lit[__num_base::_S_iminus])
+        __xtrc += __plus ? '+' : '-';
+      else
+        continue;
+    }
+  else
+    {
+      __testeof = true;
+      break;
+    }
+       }
+     else
+       break;
+
+     if (++__beg != __end)
+       __c = *__beg;
+     else
+       __testeof = true;
+   }
+      else
+ while (!__testeof)
+   {
+
+
+     if (__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
+       {
+  if (!__found_dec && !__found_sci)
+    {
+
+
+      if (__sep_pos)
+        {
+   __found_grouping += static_cast<char>(__sep_pos);
+   __sep_pos = 0;
+        }
+      else
+        {
+
+
+   __xtrc.clear();
+   break;
+        }
+    }
+  else
+    break;
+       }
+     else if (__c == __lc->_M_decimal_point)
+       {
+  if (!__found_dec && !__found_sci)
+    {
+
+
+
+      if (__found_grouping.size())
+        __found_grouping += static_cast<char>(__sep_pos);
+      __xtrc += '.';
+      __found_dec = true;
+    }
+  else
+    break;
+       }
+     else
+       {
+  const char_type* __q =
+    __traits_type::find(__lit_zero, 10, __c);
+  if (__q)
+    {
+      __xtrc += '0' + (__q - __lit_zero);
+      __found_mantissa = true;
+      ++__sep_pos;
+    }
+  else if ((__c == __lit[__num_base::_S_ie]
+     || __c == __lit[__num_base::_S_iE])
+    && !__found_sci && __found_mantissa)
+    {
+
+      if (__found_grouping.size() && !__found_dec)
+        __found_grouping += static_cast<char>(__sep_pos);
+      __xtrc += 'e';
+      __found_sci = true;
+
+
+      if (++__beg != __end)
+        {
+   __c = *__beg;
+   const bool __plus = __c == __lit[__num_base::_S_iplus];
+   if ((__plus || __c == __lit[__num_base::_S_iminus])
+       && !(__lc->_M_use_grouping
+     && __c == __lc->_M_thousands_sep)
+       && !(__c == __lc->_M_decimal_point))
+        __xtrc += __plus ? '+' : '-';
+   else
+     continue;
+        }
+      else
+        {
+   __testeof = true;
+   break;
+        }
+    }
+  else
+    break;
+       }
+
+     if (++__beg != __end)
+       __c = *__beg;
+     else
+       __testeof = true;
+   }
+
+
+
+      if (__found_grouping.size())
+        {
+
+   if (!__found_dec && !__found_sci)
+     __found_grouping += static_cast<char>(__sep_pos);
+
+          if (!std::__verify_grouping(__lc->_M_grouping,
+          __lc->_M_grouping_size,
+          __found_grouping))
+     __err = ios_base::failbit;
+        }
+
+      return __beg;
+    }
+
+  template<typename _CharT, typename _InIter>
+    template<typename _ValueT>
+      __attribute ((__abi_tag__ ("cxx11")))
+      _InIter
+      num_get<_CharT, _InIter>::
+      _M_extract_int(_InIter __beg, _InIter __end, ios_base& __io,
+       ios_base::iostate& __err, _ValueT& __v) const
+      {
+        typedef char_traits<_CharT> __traits_type;
+ using __gnu_cxx::__add_unsigned;
+ typedef typename __add_unsigned<_ValueT>::__type __unsigned_type;
+ typedef __numpunct_cache<_CharT> __cache_type;
+ __use_cache<__cache_type> __uc;
+ const locale& __loc = __io._M_getloc();
+ const __cache_type* __lc = __uc(__loc);
+ const _CharT* __lit = __lc->_M_atoms_in;
+ char_type __c = char_type();
+
+
+ const ios_base::fmtflags __basefield = __io.flags()
+                                        & ios_base::basefield;
+ const bool __oct = __basefield == ios_base::oct;
+ int __base = __oct ? 8 : (__basefield == ios_base::hex ? 16 : 10);
+
+
+ bool __testeof = __beg == __end;
+
+
+ bool __negative = false;
+ if (!__testeof)
+   {
+     __c = *__beg;
+     __negative = __c == __lit[__num_base::_S_iminus];
+     if ((__negative || __c == __lit[__num_base::_S_iplus])
+  && !(__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
+  && !(__c == __lc->_M_decimal_point))
+       {
+  if (++__beg != __end)
+    __c = *__beg;
+  else
+    __testeof = true;
+       }
+   }
+
+
+
+ bool __found_zero = false;
+ int __sep_pos = 0;
+ while (!__testeof)
+   {
+     if ((__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
+  || __c == __lc->_M_decimal_point)
+       break;
+     else if (__c == __lit[__num_base::_S_izero]
+       && (!__found_zero || __base == 10))
+       {
+  __found_zero = true;
+  ++__sep_pos;
+  if (__basefield == 0)
+    __base = 8;
+  if (__base == 8)
+    __sep_pos = 0;
+       }
+     else if (__found_zero
+       && (__c == __lit[__num_base::_S_ix]
+    || __c == __lit[__num_base::_S_iX]))
+       {
+  if (__basefield == 0)
+    __base = 16;
+  if (__base == 16)
+    {
+      __found_zero = false;
+      __sep_pos = 0;
+    }
+  else
+    break;
+       }
+     else
+       break;
+
+     if (++__beg != __end)
+       {
+  __c = *__beg;
+  if (!__found_zero)
+    break;
+       }
+     else
+       __testeof = true;
+   }
+
+
+
+ const size_t __len = (__base == 16 ? __num_base::_S_iend
+         - __num_base::_S_izero : __base);
+
+
+ typedef __gnu_cxx::__numeric_traits<_ValueT> __num_traits;
+ string __found_grouping;
+ if (__lc->_M_use_grouping)
+   __found_grouping.reserve(32);
+ bool __testfail = false;
+ bool __testoverflow = false;
+ const __unsigned_type __max =
+   (__negative && __num_traits::__is_signed)
+   ? -static_cast<__unsigned_type>(__num_traits::__min)
+   : __num_traits::__max;
+ const __unsigned_type __smax = __max / __base;
+ __unsigned_type __result = 0;
+ int __digit = 0;
+ const char_type* __lit_zero = __lit + __num_base::_S_izero;
+
+ if (!__lc->_M_allocated)
+
+   while (!__testeof)
+     {
+       __digit = _M_find(__lit_zero, __len, __c);
+       if (__digit == -1)
+  break;
+
+       if (__result > __smax)
+  __testoverflow = true;
+       else
+  {
+    __result *= __base;
+    __testoverflow |= __result > __max - __digit;
+    __result += __digit;
+    ++__sep_pos;
+  }
+
+       if (++__beg != __end)
+  __c = *__beg;
+       else
+  __testeof = true;
+     }
+ else
+   while (!__testeof)
+     {
+
+
+       if (__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
+  {
+
+
+    if (__sep_pos)
+      {
+        __found_grouping += static_cast<char>(__sep_pos);
+        __sep_pos = 0;
+      }
+    else
+      {
+        __testfail = true;
+        break;
+      }
+  }
+       else if (__c == __lc->_M_decimal_point)
+  break;
+       else
+  {
+    const char_type* __q =
+      __traits_type::find(__lit_zero, __len, __c);
+    if (!__q)
+      break;
+
+    __digit = __q - __lit_zero;
+    if (__digit > 15)
+      __digit -= 6;
+    if (__result > __smax)
+      __testoverflow = true;
+    else
+      {
+        __result *= __base;
+        __testoverflow |= __result > __max - __digit;
+        __result += __digit;
+        ++__sep_pos;
+      }
+  }
+
+       if (++__beg != __end)
+  __c = *__beg;
+       else
+  __testeof = true;
+     }
+
+
+
+ if (__found_grouping.size())
+   {
+
+     __found_grouping += static_cast<char>(__sep_pos);
+
+     if (!std::__verify_grouping(__lc->_M_grouping,
+     __lc->_M_grouping_size,
+     __found_grouping))
+       __err = ios_base::failbit;
+   }
+
+
+
+ if ((!__sep_pos && !__found_zero && !__found_grouping.size())
+     || __testfail)
+   {
+     __v = 0;
+     __err = ios_base::failbit;
+   }
+ else if (__testoverflow)
+   {
+     if (__negative && __num_traits::__is_signed)
+       __v = __num_traits::__min;
+     else
+       __v = __num_traits::__max;
+     __err = ios_base::failbit;
+   }
+ else
+   __v = __negative ? -__result : __result;
+
+ if (__testeof)
+   __err |= ios_base::eofbit;
+ return __beg;
+      }
+
+
+
+  template<typename _CharT, typename _InIter>
+    _InIter
+    num_get<_CharT, _InIter>::
+    do_get(iter_type __beg, iter_type __end, ios_base& __io,
+           ios_base::iostate& __err, bool& __v) const
+    {
+      if (!(__io.flags() & ios_base::boolalpha))
+        {
+
+
+
+   long __l = -1;
+          __beg = _M_extract_int(__beg, __end, __io, __err, __l);
+   if (__l == 0 || __l == 1)
+     __v = bool(__l);
+   else
+     {
+
+
+       __v = true;
+       __err = ios_base::failbit;
+       if (__beg == __end)
+  __err |= ios_base::eofbit;
+     }
+        }
+      else
+        {
+
+   typedef __numpunct_cache<_CharT> __cache_type;
+   __use_cache<__cache_type> __uc;
+   const locale& __loc = __io._M_getloc();
+   const __cache_type* __lc = __uc(__loc);
+
+   bool __testf = true;
+   bool __testt = true;
+   bool __donef = __lc->_M_falsename_size == 0;
+   bool __donet = __lc->_M_truename_size == 0;
+   bool __testeof = false;
+   size_t __n = 0;
+   while (!__donef || !__donet)
+     {
+       if (__beg == __end)
+  {
+    __testeof = true;
+    break;
+  }
+
+       const char_type __c = *__beg;
+
+       if (!__donef)
+  __testf = __c == __lc->_M_falsename[__n];
+
+       if (!__testf && __donet)
+  break;
+
+       if (!__donet)
+  __testt = __c == __lc->_M_truename[__n];
+
+       if (!__testt && __donef)
+  break;
+
+       if (!__testt && !__testf)
+  break;
+
+       ++__n;
+       ++__beg;
+
+       __donef = !__testf || __n >= __lc->_M_falsename_size;
+       __donet = !__testt || __n >= __lc->_M_truename_size;
+     }
+   if (__testf && __n == __lc->_M_falsename_size && __n)
+     {
+       __v = false;
+       if (__testt && __n == __lc->_M_truename_size)
+  __err = ios_base::failbit;
+       else
+  __err = __testeof ? ios_base::eofbit : ios_base::goodbit;
+     }
+   else if (__testt && __n == __lc->_M_truename_size && __n)
+     {
+       __v = true;
+       __err = __testeof ? ios_base::eofbit : ios_base::goodbit;
+     }
+   else
+     {
+
+
+       __v = false;
+       __err = ios_base::failbit;
+       if (__testeof)
+  __err |= ios_base::eofbit;
+     }
+ }
+      return __beg;
+    }
+
+  template<typename _CharT, typename _InIter>
+    _InIter
+    num_get<_CharT, _InIter>::
+    do_get(iter_type __beg, iter_type __end, ios_base& __io,
+    ios_base::iostate& __err, float& __v) const
+    {
+      string __xtrc;
+      __xtrc.reserve(32);
+      __beg = _M_extract_float(__beg, __end, __io, __err, __xtrc);
+      std::__convert_to_v(__xtrc.c_str(), __v, __err, _S_get_c_locale());
+      if (__beg == __end)
+ __err |= ios_base::eofbit;
+      return __beg;
+    }
+
+  template<typename _CharT, typename _InIter>
+    _InIter
+    num_get<_CharT, _InIter>::
+    do_get(iter_type __beg, iter_type __end, ios_base& __io,
+           ios_base::iostate& __err, double& __v) const
+    {
+      string __xtrc;
+      __xtrc.reserve(32);
+      __beg = _M_extract_float(__beg, __end, __io, __err, __xtrc);
+      std::__convert_to_v(__xtrc.c_str(), __v, __err, _S_get_c_locale());
+      if (__beg == __end)
+ __err |= ios_base::eofbit;
+      return __beg;
+    }
+  template<typename _CharT, typename _InIter>
+    _InIter
+    num_get<_CharT, _InIter>::
+    do_get(iter_type __beg, iter_type __end, ios_base& __io,
+           ios_base::iostate& __err, long double& __v) const
+    {
+      string __xtrc;
+      __xtrc.reserve(32);
+      __beg = _M_extract_float(__beg, __end, __io, __err, __xtrc);
+      std::__convert_to_v(__xtrc.c_str(), __v, __err, _S_get_c_locale());
+      if (__beg == __end)
+ __err |= ios_base::eofbit;
+      return __beg;
+    }
+
+  template<typename _CharT, typename _InIter>
+    _InIter
+    num_get<_CharT, _InIter>::
+    do_get(iter_type __beg, iter_type __end, ios_base& __io,
+           ios_base::iostate& __err, void*& __v) const
+    {
+
+      typedef ios_base::fmtflags fmtflags;
+      const fmtflags __fmt = __io.flags();
+      __io.flags((__fmt & ~ios_base::basefield) | ios_base::hex);
+
+      typedef __gnu_cxx::__conditional_type<(sizeof(void*)
+          <= sizeof(unsigned long)),
+ unsigned long, unsigned long long>::__type _UIntPtrType;
+
+      _UIntPtrType __ul;
+      __beg = _M_extract_int(__beg, __end, __io, __err, __ul);
+
+
+      __io.flags(__fmt);
+
+      __v = reinterpret_cast<void*>(__ul);
+      return __beg;
+    }
+
+
+
+  template<typename _CharT, typename _OutIter>
+    void
+    num_put<_CharT, _OutIter>::
+    _M_pad(_CharT __fill, streamsize __w, ios_base& __io,
+    _CharT* __new, const _CharT* __cs, int& __len) const
+    {
+
+
+      __pad<_CharT, char_traits<_CharT> >::_S_pad(__io, __fill, __new,
+        __cs, __w, __len);
+      __len = static_cast<int>(__w);
+    }
+
+
+
+  template<typename _CharT, typename _ValueT>
+    int
+    __int_to_char(_CharT* __bufend, _ValueT __v, const _CharT* __lit,
+    ios_base::fmtflags __flags, bool __dec)
+    {
+      _CharT* __buf = __bufend;
+      if (__builtin_expect(__dec, true))
+ {
+
+   do
+     {
+       *--__buf = __lit[(__v % 10) + __num_base::_S_odigits];
+       __v /= 10;
+     }
+   while (__v != 0);
+ }
+      else if ((__flags & ios_base::basefield) == ios_base::oct)
+ {
+
+   do
+     {
+       *--__buf = __lit[(__v & 0x7) + __num_base::_S_odigits];
+       __v >>= 3;
+     }
+   while (__v != 0);
+ }
+      else
+ {
+
+   const bool __uppercase = __flags & ios_base::uppercase;
+   const int __case_offset = __uppercase ? __num_base::_S_oudigits
+                                         : __num_base::_S_odigits;
+   do
+     {
+       *--__buf = __lit[(__v & 0xf) + __case_offset];
+       __v >>= 4;
+     }
+   while (__v != 0);
+ }
+      return __bufend - __buf;
+    }
+
+
+
+  template<typename _CharT, typename _OutIter>
+    void
+    num_put<_CharT, _OutIter>::
+    _M_group_int(const char* __grouping, size_t __grouping_size, _CharT __sep,
+   ios_base&, _CharT* __new, _CharT* __cs, int& __len) const
+    {
+      _CharT* __p = std::__add_grouping(__new, __sep, __grouping,
+     __grouping_size, __cs, __cs + __len);
+      __len = __p - __new;
+    }
+
+  template<typename _CharT, typename _OutIter>
+    template<typename _ValueT>
+      _OutIter
+      num_put<_CharT, _OutIter>::
+      _M_insert_int(_OutIter __s, ios_base& __io, _CharT __fill,
+      _ValueT __v) const
+      {
+ using __gnu_cxx::__add_unsigned;
+ typedef typename __add_unsigned<_ValueT>::__type __unsigned_type;
+ typedef __numpunct_cache<_CharT> __cache_type;
+ __use_cache<__cache_type> __uc;
+ const locale& __loc = __io._M_getloc();
+ const __cache_type* __lc = __uc(__loc);
+ const _CharT* __lit = __lc->_M_atoms_out;
+ const ios_base::fmtflags __flags = __io.flags();
+
+
+ const int __ilen = 5 * sizeof(_ValueT);
+ _CharT* __cs = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+            * __ilen));
+
+
+
+ const ios_base::fmtflags __basefield = __flags & ios_base::basefield;
+ const bool __dec = (__basefield != ios_base::oct
+       && __basefield != ios_base::hex);
+ const __unsigned_type __u = ((__v > 0 || !__dec)
+         ? __unsigned_type(__v)
+         : -__unsigned_type(__v));
+  int __len = __int_to_char(__cs + __ilen, __u, __lit, __flags, __dec);
+ __cs += __ilen - __len;
+
+
+ if (__lc->_M_use_grouping)
+   {
+
+
+     _CharT* __cs2 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+          * (__len + 1)
+          * 2));
+     _M_group_int(__lc->_M_grouping, __lc->_M_grouping_size,
+    __lc->_M_thousands_sep, __io, __cs2 + 2, __cs, __len);
+     __cs = __cs2 + 2;
+   }
+
+
+ if (__builtin_expect(__dec, true))
+   {
+
+     if (__v >= 0)
+       {
+  if (bool(__flags & ios_base::showpos)
+      && __gnu_cxx::__numeric_traits<_ValueT>::__is_signed)
+    *--__cs = __lit[__num_base::_S_oplus], ++__len;
+       }
+     else
+       *--__cs = __lit[__num_base::_S_ominus], ++__len;
+   }
+ else if (bool(__flags & ios_base::showbase) && __v)
+   {
+     if (__basefield == ios_base::oct)
+       *--__cs = __lit[__num_base::_S_odigits], ++__len;
+     else
+       {
+
+  const bool __uppercase = __flags & ios_base::uppercase;
+  *--__cs = __lit[__num_base::_S_ox + __uppercase];
+
+  *--__cs = __lit[__num_base::_S_odigits];
+  __len += 2;
+       }
+   }
+
+
+ const streamsize __w = __io.width();
+ if (__w > static_cast<streamsize>(__len))
+   {
+     _CharT* __cs3 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+          * __w));
+     _M_pad(__fill, __w, __io, __cs3, __cs, __len);
+     __cs = __cs3;
+   }
+ __io.width(0);
+
+
+
+ return std::__write(__s, __cs, __len);
+      }
+
+  template<typename _CharT, typename _OutIter>
+    void
+    num_put<_CharT, _OutIter>::
+    _M_group_float(const char* __grouping, size_t __grouping_size,
+     _CharT __sep, const _CharT* __p, _CharT* __new,
+     _CharT* __cs, int& __len) const
+    {
+
+
+
+      const int __declen = __p ? __p - __cs : __len;
+      _CharT* __p2 = std::__add_grouping(__new, __sep, __grouping,
+      __grouping_size,
+      __cs, __cs + __declen);
+
+
+      int __newlen = __p2 - __new;
+      if (__p)
+ {
+   char_traits<_CharT>::copy(__p2, __p, __len - __declen);
+   __newlen += __len - __declen;
+ }
+      __len = __newlen;
+    }
+  template<typename _CharT, typename _OutIter>
+    template<typename _ValueT>
+      _OutIter
+      num_put<_CharT, _OutIter>::
+      _M_insert_float(_OutIter __s, ios_base& __io, _CharT __fill, char __mod,
+         _ValueT __v) const
+      {
+ typedef __numpunct_cache<_CharT> __cache_type;
+ __use_cache<__cache_type> __uc;
+ const locale& __loc = __io._M_getloc();
+ const __cache_type* __lc = __uc(__loc);
+
+
+ const streamsize __prec = __io.precision() < 0 ? 6 : __io.precision();
+
+ const int __max_digits =
+   __gnu_cxx::__numeric_traits<_ValueT>::__digits10;
+
+
+ int __len;
+
+ char __fbuf[16];
+ __num_base::_S_format_float(__io, __fbuf, __mod);
+
+
+
+ const bool __use_prec =
+   (__io.flags() & ios_base::floatfield) != ios_base::floatfield;
+
+
+
+ int __cs_size = __max_digits * 3;
+ char* __cs = static_cast<char*>(__builtin_alloca(__cs_size));
+ if (__use_prec)
+   __len = std::__convert_from_v(_S_get_c_locale(), __cs, __cs_size,
+     __fbuf, __prec, __v);
+ else
+   __len = std::__convert_from_v(_S_get_c_locale(), __cs, __cs_size,
+     __fbuf, __v);
+
+
+ if (__len >= __cs_size)
+   {
+     __cs_size = __len + 1;
+     __cs = static_cast<char*>(__builtin_alloca(__cs_size));
+     if (__use_prec)
+       __len = std::__convert_from_v(_S_get_c_locale(), __cs, __cs_size,
+         __fbuf, __prec, __v);
+     else
+       __len = std::__convert_from_v(_S_get_c_locale(), __cs, __cs_size,
+         __fbuf, __v);
+   }
+ const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
+
+ _CharT* __ws = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+            * __len));
+ __ctype.widen(__cs, __cs + __len, __ws);
+
+
+ _CharT* __wp = 0;
+ const char* __p = char_traits<char>::find(__cs, __len, '.');
+ if (__p)
+   {
+     __wp = __ws + (__p - __cs);
+     *__wp = __lc->_M_decimal_point;
+   }
+
+
+
+
+ if (__lc->_M_use_grouping
+     && (__wp || __len < 3 || (__cs[1] <= '9' && __cs[2] <= '9'
+          && __cs[1] >= '0' && __cs[2] >= '0')))
+   {
+
+
+     _CharT* __ws2 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+          * __len * 2));
+
+     streamsize __off = 0;
+     if (__cs[0] == '-' || __cs[0] == '+')
+       {
+  __off = 1;
+  __ws2[0] = __ws[0];
+  __len -= 1;
+       }
+
+     _M_group_float(__lc->_M_grouping, __lc->_M_grouping_size,
+      __lc->_M_thousands_sep, __wp, __ws2 + __off,
+      __ws + __off, __len);
+     __len += __off;
+
+     __ws = __ws2;
+   }
+
+
+ const streamsize __w = __io.width();
+ if (__w > static_cast<streamsize>(__len))
+   {
+     _CharT* __ws3 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+          * __w));
+     _M_pad(__fill, __w, __io, __ws3, __ws, __len);
+     __ws = __ws3;
+   }
+ __io.width(0);
+
+
+
+ return std::__write(__s, __ws, __len);
+      }
+
+  template<typename _CharT, typename _OutIter>
+    _OutIter
+    num_put<_CharT, _OutIter>::
+    do_put(iter_type __s, ios_base& __io, char_type __fill, bool __v) const
+    {
+      const ios_base::fmtflags __flags = __io.flags();
+      if ((__flags & ios_base::boolalpha) == 0)
+        {
+          const long __l = __v;
+          __s = _M_insert_int(__s, __io, __fill, __l);
+        }
+      else
+        {
+   typedef __numpunct_cache<_CharT> __cache_type;
+   __use_cache<__cache_type> __uc;
+   const locale& __loc = __io._M_getloc();
+   const __cache_type* __lc = __uc(__loc);
+
+   const _CharT* __name = __v ? __lc->_M_truename
+                              : __lc->_M_falsename;
+   int __len = __v ? __lc->_M_truename_size
+                   : __lc->_M_falsename_size;
+
+   const streamsize __w = __io.width();
+   if (__w > static_cast<streamsize>(__len))
+     {
+       const streamsize __plen = __w - __len;
+       _CharT* __ps
+  = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+       * __plen));
+
+       char_traits<_CharT>::assign(__ps, __plen, __fill);
+       __io.width(0);
+
+       if ((__flags & ios_base::adjustfield) == ios_base::left)
+  {
+    __s = std::__write(__s, __name, __len);
+    __s = std::__write(__s, __ps, __plen);
+  }
+       else
+  {
+    __s = std::__write(__s, __ps, __plen);
+    __s = std::__write(__s, __name, __len);
+  }
+       return __s;
+     }
+   __io.width(0);
+   __s = std::__write(__s, __name, __len);
+ }
+      return __s;
+    }
+
+  template<typename _CharT, typename _OutIter>
+    _OutIter
+    num_put<_CharT, _OutIter>::
+    do_put(iter_type __s, ios_base& __io, char_type __fill, double __v) const
+    { return _M_insert_float(__s, __io, __fill, char(), __v); }
+  template<typename _CharT, typename _OutIter>
+    _OutIter
+    num_put<_CharT, _OutIter>::
+    do_put(iter_type __s, ios_base& __io, char_type __fill,
+    long double __v) const
+    { return _M_insert_float(__s, __io, __fill, 'L', __v); }
+
+  template<typename _CharT, typename _OutIter>
+    _OutIter
+    num_put<_CharT, _OutIter>::
+    do_put(iter_type __s, ios_base& __io, char_type __fill,
+           const void* __v) const
+    {
+      const ios_base::fmtflags __flags = __io.flags();
+      const ios_base::fmtflags __fmt = ~(ios_base::basefield
+      | ios_base::uppercase);
+      __io.flags((__flags & __fmt) | (ios_base::hex | ios_base::showbase));
+
+      typedef __gnu_cxx::__conditional_type<(sizeof(const void*)
+          <= sizeof(unsigned long)),
+ unsigned long, unsigned long long>::__type _UIntPtrType;
+
+      __s = _M_insert_int(__s, __io, __fill,
+     reinterpret_cast<_UIntPtrType>(__v));
+      __io.flags(__flags);
+      return __s;
+    }
+
+
+  template<typename _CharT, typename _Traits>
+    void
+    __pad<_CharT, _Traits>::_S_pad(ios_base& __io, _CharT __fill,
+       _CharT* __news, const _CharT* __olds,
+       streamsize __newlen, streamsize __oldlen)
+    {
+      const size_t __plen = static_cast<size_t>(__newlen - __oldlen);
+      const ios_base::fmtflags __adjust = __io.flags() & ios_base::adjustfield;
+
+
+      if (__adjust == ios_base::left)
+ {
+   _Traits::copy(__news, __olds, __oldlen);
+   _Traits::assign(__news + __oldlen, __plen, __fill);
+   return;
+ }
+
+      size_t __mod = 0;
+      if (__adjust == ios_base::internal)
+ {
+
+
+
+          const locale& __loc = __io._M_getloc();
+   const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
+
+   if (__ctype.widen('-') == __olds[0]
+       || __ctype.widen('+') == __olds[0])
+     {
+       __news[0] = __olds[0];
+       __mod = 1;
+       ++__news;
+     }
+   else if (__ctype.widen('0') == __olds[0]
+     && __oldlen > 1
+     && (__ctype.widen('x') == __olds[1]
+         || __ctype.widen('X') == __olds[1]))
+     {
+       __news[0] = __olds[0];
+       __news[1] = __olds[1];
+       __mod = 2;
+       __news += 2;
+     }
+
+ }
+      _Traits::assign(__news, __plen, __fill);
+      _Traits::copy(__news + __plen, __olds + __mod, __oldlen - __mod);
+    }
+
+  template<typename _CharT>
+    _CharT*
+    __add_grouping(_CharT* __s, _CharT __sep,
+     const char* __gbeg, size_t __gsize,
+     const _CharT* __first, const _CharT* __last)
+    {
+      size_t __idx = 0;
+      size_t __ctr = 0;
+
+      while (__last - __first > __gbeg[__idx]
+      && static_cast<signed char>(__gbeg[__idx]) > 0
+      && __gbeg[__idx] != __gnu_cxx::__numeric_traits<char>::__max)
+ {
+   __last -= __gbeg[__idx];
+   __idx < __gsize - 1 ? ++__idx : ++__ctr;
+ }
+
+      while (__first != __last)
+ *__s++ = *__first++;
+
+      while (__ctr--)
+ {
+   *__s++ = __sep;
+   for (char __i = __gbeg[__idx]; __i > 0; --__i)
+     *__s++ = *__first++;
+ }
+
+      while (__idx--)
+ {
+   *__s++ = __sep;
+   for (char __i = __gbeg[__idx]; __i > 0; --__i)
+     *__s++ = *__first++;
+ }
+
+      return __s;
+    }
+
+
+
+
+  extern template class __cxx11:: numpunct<char>;
+  extern template class __cxx11:: numpunct_byname<char>;
+  extern template class num_get<char>;
+  extern template class num_put<char>;
+  extern template class ctype_byname<char>;
+
+  extern template
+    const ctype<char>&
+    use_facet<ctype<char> >(const locale&);
+
+  extern template
+    const numpunct<char>&
+    use_facet<numpunct<char> >(const locale&);
+
+  extern template
+    const num_put<char>&
+    use_facet<num_put<char> >(const locale&);
+
+  extern template
+    const num_get<char>&
+    use_facet<num_get<char> >(const locale&);
+
+  extern template
+    bool
+    has_facet<ctype<char> >(const locale&);
+
+  extern template
+    bool
+    has_facet<numpunct<char> >(const locale&);
+
+  extern template
+    bool
+    has_facet<num_put<char> >(const locale&);
+
+  extern template
+    bool
+    has_facet<num_get<char> >(const locale&);
+
+
+  extern template class __cxx11:: numpunct<wchar_t>;
+  extern template class __cxx11:: numpunct_byname<wchar_t>;
+  extern template class num_get<wchar_t>;
+  extern template class num_put<wchar_t>;
+  extern template class ctype_byname<wchar_t>;
+
+  extern template
+    const ctype<wchar_t>&
+    use_facet<ctype<wchar_t> >(const locale&);
+
+  extern template
+    const numpunct<wchar_t>&
+    use_facet<numpunct<wchar_t> >(const locale&);
+
+  extern template
+    const num_put<wchar_t>&
+    use_facet<num_put<wchar_t> >(const locale&);
+
+  extern template
+    const num_get<wchar_t>&
+    use_facet<num_get<wchar_t> >(const locale&);
+
+ extern template
+    bool
+    has_facet<ctype<wchar_t> >(const locale&);
+
+  extern template
+    bool
+    has_facet<numpunct<wchar_t> >(const locale&);
+
+  extern template
+    bool
+    has_facet<num_put<wchar_t> >(const locale&);
+
+  extern template
+    bool
+    has_facet<num_get<wchar_t> >(const locale&);
+
+
+
+
+}
+
+
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+  template<typename _Facet>
+    inline const _Facet&
+    __check_facet(const _Facet* __f)
+    {
+      if (!__f)
+ __throw_bad_cast();
+      return *__f;
+    }
+  template<typename _CharT, typename _Traits>
+    class basic_ios : public ios_base
+    {
+    public:
+
+
+
+
+
+
+      typedef _CharT char_type;
+      typedef typename _Traits::int_type int_type;
+      typedef typename _Traits::pos_type pos_type;
+      typedef typename _Traits::off_type off_type;
+      typedef _Traits traits_type;
+
+
+
+
+
+
+      typedef ctype<_CharT> __ctype_type;
+      typedef num_put<_CharT, ostreambuf_iterator<_CharT, _Traits> >
+           __num_put_type;
+      typedef num_get<_CharT, istreambuf_iterator<_CharT, _Traits> >
+           __num_get_type;
+
+
+
+    protected:
+      basic_ostream<_CharT, _Traits>* _M_tie;
+      mutable char_type _M_fill;
+      mutable bool _M_fill_init;
+      basic_streambuf<_CharT, _Traits>* _M_streambuf;
+
+
+      const __ctype_type* _M_ctype;
+
+      const __num_put_type* _M_num_put;
+
+      const __num_get_type* _M_num_get;
+
+    public:
+      explicit operator bool() const
+      { return !this->fail(); }
+
+
+
+
+
+      bool
+      operator!() const
+      { return this->fail(); }
+      iostate
+      rdstate() const
+      { return _M_streambuf_state; }
+      void
+      clear(iostate __state = goodbit);
+
+
+
+
+
+
+
+      void
+      setstate(iostate __state)
+      { this->clear(this->rdstate() | __state); }
+
+
+
+
+      void
+      _M_setstate(iostate __state)
+      {
+
+
+ _M_streambuf_state |= __state;
+ if (this->exceptions() & __state)
+   throw;
+      }
+
+
+
+
+
+
+
+      bool
+      good() const
+      { return this->rdstate() == 0; }
+
+
+
+
+
+
+
+      bool
+      eof() const
+      { return (this->rdstate() & eofbit) != 0; }
+      bool
+      fail() const
+      { return (this->rdstate() & (badbit | failbit)) != 0; }
+
+
+
+
+
+
+
+      bool
+      bad() const
+      { return (this->rdstate() & badbit) != 0; }
+      iostate
+      exceptions() const
+      { return _M_exception; }
+      void
+      exceptions(iostate __except)
+      {
+        _M_exception = __except;
+        this->clear(_M_streambuf_state);
+      }
+
+
+
+
+
+
+
+      explicit
+      basic_ios(basic_streambuf<_CharT, _Traits>* __sb)
+      : ios_base(), _M_tie(0), _M_fill(), _M_fill_init(false), _M_streambuf(0),
+ _M_ctype(0), _M_num_put(0), _M_num_get(0)
+      { this->init(__sb); }
+
+
+
+
+
+
+
+      virtual
+      ~basic_ios() { }
+      basic_ostream<_CharT, _Traits>*
+      tie() const
+      { return _M_tie; }
+      basic_ostream<_CharT, _Traits>*
+      tie(basic_ostream<_CharT, _Traits>* __tiestr)
+      {
+        basic_ostream<_CharT, _Traits>* __old = _M_tie;
+        _M_tie = __tiestr;
+        return __old;
+      }
+
+
+
+
+
+
+
+      basic_streambuf<_CharT, _Traits>*
+      rdbuf() const
+      { return _M_streambuf; }
+      basic_streambuf<_CharT, _Traits>*
+      rdbuf(basic_streambuf<_CharT, _Traits>* __sb);
+      basic_ios&
+      copyfmt(const basic_ios& __rhs);
+
+
+
+
+
+
+
+      char_type
+      fill() const
+      {
+ if (!_M_fill_init)
+   {
+     _M_fill = this->widen(' ');
+     _M_fill_init = true;
+   }
+ return _M_fill;
+      }
+      char_type
+      fill(char_type __ch)
+      {
+ char_type __old = this->fill();
+ _M_fill = __ch;
+ return __old;
+      }
+      locale
+      imbue(const locale& __loc);
+      char
+      narrow(char_type __c, char __dfault) const
+      { return __check_facet(_M_ctype).narrow(__c, __dfault); }
+      char_type
+      widen(char __c) const
+      { return __check_facet(_M_ctype).widen(__c); }
+
+    protected:
+
+
+
+
+
+
+
+      basic_ios()
+      : ios_base(), _M_tie(0), _M_fill(char_type()), _M_fill_init(false),
+ _M_streambuf(0), _M_ctype(0), _M_num_put(0), _M_num_get(0)
+      { }
+
+
+
+
+
+
+
+      void
+      init(basic_streambuf<_CharT, _Traits>* __sb);
+
+
+      basic_ios(const basic_ios&) = delete;
+      basic_ios& operator=(const basic_ios&) = delete;
+
+      void
+      move(basic_ios& __rhs)
+      {
+ ios_base::_M_move(__rhs);
+ _M_cache_locale(_M_ios_locale);
+ this->tie(__rhs.tie(nullptr));
+ _M_fill = __rhs._M_fill;
+ _M_fill_init = __rhs._M_fill_init;
+ _M_streambuf = nullptr;
+      }
+
+      void
+      move(basic_ios&& __rhs)
+      { this->move(__rhs); }
+
+      void
+      swap(basic_ios& __rhs) noexcept
+      {
+ ios_base::_M_swap(__rhs);
+ _M_cache_locale(_M_ios_locale);
+ __rhs._M_cache_locale(__rhs._M_ios_locale);
+ std::swap(_M_tie, __rhs._M_tie);
+ std::swap(_M_fill, __rhs._M_fill);
+ std::swap(_M_fill_init, __rhs._M_fill_init);
+      }
+
+      void
+      set_rdbuf(basic_streambuf<_CharT, _Traits>* __sb)
+      { _M_streambuf = __sb; }
+
+
+      void
+      _M_cache_locale(const locale& __loc);
+    };
+
+
+}
+
+       
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+  template<typename _CharT, typename _Traits>
+    void
+    basic_ios<_CharT, _Traits>::clear(iostate __state)
+    {
+      if (this->rdbuf())
+ _M_streambuf_state = __state;
+      else
+   _M_streambuf_state = __state | badbit;
+      if (this->exceptions() & this->rdstate())
+ __throw_ios_failure(("basic_ios::clear"));
+    }
+
+  template<typename _CharT, typename _Traits>
+    basic_streambuf<_CharT, _Traits>*
+    basic_ios<_CharT, _Traits>::rdbuf(basic_streambuf<_CharT, _Traits>* __sb)
+    {
+      basic_streambuf<_CharT, _Traits>* __old = _M_streambuf;
+      _M_streambuf = __sb;
+      this->clear();
+      return __old;
+    }
+
+  template<typename _CharT, typename _Traits>
+    basic_ios<_CharT, _Traits>&
+    basic_ios<_CharT, _Traits>::copyfmt(const basic_ios& __rhs)
+    {
+
+
+      if (this != &__rhs)
+ {
+
+
+
+
+   _Words* __words = (__rhs._M_word_size <= _S_local_word_size) ?
+                      _M_local_word : new _Words[__rhs._M_word_size];
+
+
+   _Callback_list* __cb = __rhs._M_callbacks;
+   if (__cb)
+     __cb->_M_add_reference();
+   _M_call_callbacks(erase_event);
+   if (_M_word != _M_local_word)
+     {
+       delete [] _M_word;
+       _M_word = 0;
+     }
+   _M_dispose_callbacks();
+
+
+   _M_callbacks = __cb;
+   for (int __i = 0; __i < __rhs._M_word_size; ++__i)
+     __words[__i] = __rhs._M_word[__i];
+   _M_word = __words;
+   _M_word_size = __rhs._M_word_size;
+
+   this->flags(__rhs.flags());
+   this->width(__rhs.width());
+   this->precision(__rhs.precision());
+   this->tie(__rhs.tie());
+   this->fill(__rhs.fill());
+   _M_ios_locale = __rhs.getloc();
+   _M_cache_locale(_M_ios_locale);
+
+   _M_call_callbacks(copyfmt_event);
+
+
+   this->exceptions(__rhs.exceptions());
+ }
+      return *this;
+    }
+
+
+  template<typename _CharT, typename _Traits>
+    locale
+    basic_ios<_CharT, _Traits>::imbue(const locale& __loc)
+    {
+      locale __old(this->getloc());
+      ios_base::imbue(__loc);
+      _M_cache_locale(__loc);
+      if (this->rdbuf() != 0)
+ this->rdbuf()->pubimbue(__loc);
+      return __old;
+    }
+
+  template<typename _CharT, typename _Traits>
+    void
+    basic_ios<_CharT, _Traits>::init(basic_streambuf<_CharT, _Traits>* __sb)
+    {
+
+      ios_base::_M_init();
+
+
+      _M_cache_locale(_M_ios_locale);
+      _M_fill = _CharT();
+      _M_fill_init = false;
+
+      _M_tie = 0;
+      _M_exception = goodbit;
+      _M_streambuf = __sb;
+      _M_streambuf_state = __sb ? goodbit : badbit;
+    }
+
+  template<typename _CharT, typename _Traits>
+    void
+    basic_ios<_CharT, _Traits>::_M_cache_locale(const locale& __loc)
+    {
+      if (__builtin_expect(has_facet<__ctype_type>(__loc), true))
+ _M_ctype = std::__addressof(use_facet<__ctype_type>(__loc));
+      else
+ _M_ctype = 0;
+
+      if (__builtin_expect(has_facet<__num_put_type>(__loc), true))
+ _M_num_put = std::__addressof(use_facet<__num_put_type>(__loc));
+      else
+ _M_num_put = 0;
+
+      if (__builtin_expect(has_facet<__num_get_type>(__loc), true))
+ _M_num_get = std::__addressof(use_facet<__num_get_type>(__loc));
+      else
+ _M_num_get = 0;
+    }
+
+
+
+
+  extern template class basic_ios<char>;
+
+
+  extern template class basic_ios<wchar_t>;
+
+
+
+
+}
+
+       
+
+
+
+namespace __cxxabiv1
+{
+  extern "C"
+  {
+  __extension__ typedef int __guard __attribute__((mode (__DI__)));
+
+
+  typedef void __cxa_vec_ctor_return_type;
+
+
+  typedef void __cxa_cdtor_return_type;
+
+
+  }
+}
+
+
+
+
+namespace __cxxabiv1
+{
+  extern "C"
+  {
+
+
+  typedef __cxa_cdtor_return_type (*__cxa_cdtor_type)(void *);
+
+
+  void*
+  __cxa_vec_new(size_t __element_count, size_t __element_size,
+  size_t __padding_size, __cxa_cdtor_type __constructor,
+  __cxa_cdtor_type __destructor);
+
+  void*
+  __cxa_vec_new2(size_t __element_count, size_t __element_size,
+   size_t __padding_size, __cxa_cdtor_type __constructor,
+   __cxa_cdtor_type __destructor, void *(*__alloc) (size_t),
+   void (*__dealloc) (void*));
+
+  void*
+  __cxa_vec_new3(size_t __element_count, size_t __element_size,
+   size_t __padding_size, __cxa_cdtor_type __constructor,
+   __cxa_cdtor_type __destructor, void *(*__alloc) (size_t),
+   void (*__dealloc) (void*, size_t));
+
+
+  __cxa_vec_ctor_return_type
+  __cxa_vec_ctor(void* __array_address, size_t __element_count,
+   size_t __element_size, __cxa_cdtor_type __constructor,
+   __cxa_cdtor_type __destructor);
+
+  __cxa_vec_ctor_return_type
+  __cxa_vec_cctor(void* __dest_array, void* __src_array,
+    size_t __element_count, size_t __element_size,
+    __cxa_cdtor_return_type (*__constructor) (void*, void*),
+    __cxa_cdtor_type __destructor);
+
+
+  void
+  __cxa_vec_dtor(void* __array_address, size_t __element_count,
+   size_t __element_size, __cxa_cdtor_type __destructor);
+
+  void
+  __cxa_vec_cleanup(void* __array_address, size_t __element_count, size_t __s,
+      __cxa_cdtor_type __destructor) noexcept;
+
+
+  void
+  __cxa_vec_delete(void* __array_address, size_t __element_size,
+     size_t __padding_size, __cxa_cdtor_type __destructor);
+
+  void
+  __cxa_vec_delete2(void* __array_address, size_t __element_size,
+      size_t __padding_size, __cxa_cdtor_type __destructor,
+      void (*__dealloc) (void*));
+
+  void
+  __cxa_vec_delete3(void* __array_address, size_t __element_size,
+      size_t __padding_size, __cxa_cdtor_type __destructor,
+      void (*__dealloc) (void*, size_t));
+
+  int
+  __cxa_guard_acquire(__guard*);
+
+  void
+  __cxa_guard_release(__guard*) noexcept;
+
+  void
+  __cxa_guard_abort(__guard*) noexcept;
+
+
+  int
+  __cxa_atexit(void (*)(void*), void*, void*) noexcept;
+
+  int
+  __cxa_finalize(void*);
+
+
+  int
+  __cxa_thread_atexit(void (*)(void*), void*, void *) noexcept;
+
+
+  void
+  __cxa_pure_virtual(void) __attribute__ ((__noreturn__));
+
+  void
+  __cxa_deleted_virtual(void) __attribute__ ((__noreturn__));
+
+
+  void
+  __cxa_bad_cast() __attribute__((__noreturn__));
+
+  void
+  __cxa_bad_typeid() __attribute__((__noreturn__));
+
+  void
+  __cxa_throw_bad_array_new_length() __attribute__((__noreturn__));
+  char*
+  __cxa_demangle(const char* __mangled_name, char* __output_buffer,
+   size_t* __length, int* __status);
+
+
+  }
+}
+
+
+
+
+
+
+namespace __cxxabiv1
+{
+
+  class __fundamental_type_info : public std::type_info
+  {
+  public:
+    explicit
+    __fundamental_type_info(const char* __n) : std::type_info(__n) { }
+
+    virtual
+    ~__fundamental_type_info();
+  };
+
+
+  class __array_type_info : public std::type_info
+  {
+  public:
+    explicit
+    __array_type_info(const char* __n) : std::type_info(__n) { }
+
+    virtual
+    ~__array_type_info();
+  };
+
+
+  class __function_type_info : public std::type_info
+  {
+  public:
+    explicit
+    __function_type_info(const char* __n) : std::type_info(__n) { }
+
+    virtual
+    ~__function_type_info();
+
+  protected:
+
+    virtual bool
+    __is_function_p() const;
+  };
+
+
+  class __enum_type_info : public std::type_info
+  {
+  public:
+    explicit
+    __enum_type_info(const char* __n) : std::type_info(__n) { }
+
+    virtual
+    ~__enum_type_info();
+  };
+
+
+  class __pbase_type_info : public std::type_info
+  {
+  public:
+    unsigned int __flags;
+    const std::type_info* __pointee;
+
+    explicit
+    __pbase_type_info(const char* __n, int __quals,
+        const std::type_info* __type)
+    : std::type_info(__n), __flags(__quals), __pointee(__type)
+    { }
+
+    virtual
+    ~__pbase_type_info();
+
+
+    enum __masks
+      {
+ __const_mask = 0x1,
+ __volatile_mask = 0x2,
+ __restrict_mask = 0x4,
+ __incomplete_mask = 0x8,
+ __incomplete_class_mask = 0x10,
+ __transaction_safe_mask = 0x20,
+ __noexcept_mask = 0x40
+      };
+
+  protected:
+    __pbase_type_info(const __pbase_type_info&);
+
+    __pbase_type_info&
+    operator=(const __pbase_type_info&);
+
+
+    virtual bool
+    __do_catch(const std::type_info* __thr_type, void** __thr_obj,
+        unsigned int __outer) const;
+
+    inline virtual bool
+    __pointer_catch(const __pbase_type_info* __thr_type, void** __thr_obj,
+      unsigned __outer) const;
+  };
+
+  inline bool __pbase_type_info::
+  __pointer_catch (const __pbase_type_info *thrown_type,
+     void **thr_obj,
+     unsigned outer) const
+  {
+    return __pointee->__do_catch (thrown_type->__pointee, thr_obj, outer + 2);
+  }
+
+
+  class __pointer_type_info : public __pbase_type_info
+  {
+  public:
+    explicit
+    __pointer_type_info(const char* __n, int __quals,
+   const std::type_info* __type)
+    : __pbase_type_info (__n, __quals, __type) { }
+
+
+    virtual
+    ~__pointer_type_info();
+
+  protected:
+
+    virtual bool
+    __is_pointer_p() const;
+
+    virtual bool
+    __pointer_catch(const __pbase_type_info* __thr_type, void** __thr_obj,
+      unsigned __outer) const;
+  };
+
+  class __class_type_info;
+
+
+  class __pointer_to_member_type_info : public __pbase_type_info
+  {
+  public:
+    __class_type_info* __context;
+
+    explicit
+    __pointer_to_member_type_info(const char* __n, int __quals,
+      const std::type_info* __type,
+      __class_type_info* __klass)
+    : __pbase_type_info(__n, __quals, __type), __context(__klass) { }
+
+    virtual
+    ~__pointer_to_member_type_info();
+
+  protected:
+    __pointer_to_member_type_info(const __pointer_to_member_type_info&);
+
+    __pointer_to_member_type_info&
+    operator=(const __pointer_to_member_type_info&);
+
+
+    virtual bool
+    __pointer_catch(const __pbase_type_info* __thr_type, void** __thr_obj,
+      unsigned __outer) const;
+  };
+
+
+  class __base_class_type_info
+  {
+  public:
+    const __class_type_info* __base_type;
+
+
+
+    long __offset_flags;
+
+
+    enum __offset_flags_masks
+      {
+ __virtual_mask = 0x1,
+ __public_mask = 0x2,
+ __hwm_bit = 2,
+ __offset_shift = 8
+      };
+
+
+    bool
+    __is_virtual_p() const
+    { return __offset_flags & __virtual_mask; }
+
+    bool
+    __is_public_p() const
+    { return __offset_flags & __public_mask; }
+
+    ptrdiff_t
+    __offset() const
+    {
+
+
+
+      return static_cast<ptrdiff_t>(__offset_flags) >> __offset_shift;
+    }
+  };
+
+
+  class __class_type_info : public std::type_info
+  {
+  public:
+    explicit
+    __class_type_info (const char *__n) : type_info(__n) { }
+
+    virtual
+    ~__class_type_info ();
+
+
+
+
+
+
+    enum __sub_kind
+      {
+
+ __unknown = 0,
+
+
+
+ __not_contained,
+
+
+ __contained_ambig,
+
+
+ __contained_virtual_mask = __base_class_type_info::__virtual_mask,
+
+
+ __contained_public_mask = __base_class_type_info::__public_mask,
+
+
+ __contained_mask = 1 << __base_class_type_info::__hwm_bit,
+
+ __contained_private = __contained_mask,
+ __contained_public = __contained_mask | __contained_public_mask
+      };
+
+    struct __upcast_result;
+    struct __dyncast_result;
+
+  protected:
+
+    virtual bool
+    __do_upcast(const __class_type_info* __dst_type, void**__obj_ptr) const;
+
+    virtual bool
+    __do_catch(const type_info* __thr_type, void** __thr_obj,
+        unsigned __outer) const;
+
+  public:
+
+
+    virtual bool
+    __do_upcast(const __class_type_info* __dst, const void* __obj,
+  __upcast_result& __restrict __result) const;
+
+
+
+
+
+
+
+    inline __sub_kind
+    __find_public_src(ptrdiff_t __src2dst, const void* __obj_ptr,
+        const __class_type_info* __src_type,
+        const void* __src_ptr) const;
+    virtual bool
+    __do_dyncast(ptrdiff_t __src2dst, __sub_kind __access_path,
+   const __class_type_info* __dst_type, const void* __obj_ptr,
+   const __class_type_info* __src_type, const void* __src_ptr,
+   __dyncast_result& __result) const;
+
+
+
+
+
+    virtual __sub_kind
+    __do_find_public_src(ptrdiff_t __src2dst, const void* __obj_ptr,
+    const __class_type_info* __src_type,
+    const void* __src_ptr) const;
+  };
+
+
+  class __si_class_type_info : public __class_type_info
+  {
+  public:
+    const __class_type_info* __base_type;
+
+    explicit
+    __si_class_type_info(const char *__n, const __class_type_info *__base)
+    : __class_type_info(__n), __base_type(__base) { }
+
+    virtual
+    ~__si_class_type_info();
+
+  protected:
+    __si_class_type_info(const __si_class_type_info&);
+
+    __si_class_type_info&
+    operator=(const __si_class_type_info&);
+
+
+    virtual bool
+    __do_dyncast(ptrdiff_t __src2dst, __sub_kind __access_path,
+   const __class_type_info* __dst_type, const void* __obj_ptr,
+   const __class_type_info* __src_type, const void* __src_ptr,
+   __dyncast_result& __result) const;
+
+    virtual __sub_kind
+    __do_find_public_src(ptrdiff_t __src2dst, const void* __obj_ptr,
+    const __class_type_info* __src_type,
+    const void* __sub_ptr) const;
+
+    virtual bool
+    __do_upcast(const __class_type_info*__dst, const void*__obj,
+  __upcast_result& __restrict __result) const;
+  };
+
+
+  class __vmi_class_type_info : public __class_type_info
+  {
+  public:
+    unsigned int __flags;
+    unsigned int __base_count;
+
+
+
+
+    __base_class_type_info __base_info[1];
+
+    explicit
+    __vmi_class_type_info(const char* __n, int ___flags)
+    : __class_type_info(__n), __flags(___flags), __base_count(0) { }
+
+    virtual
+    ~__vmi_class_type_info();
+
+
+    enum __flags_masks
+      {
+ __non_diamond_repeat_mask = 0x1,
+ __diamond_shaped_mask = 0x2,
+ __flags_unknown_mask = 0x10
+      };
+
+  protected:
+
+    virtual bool
+    __do_dyncast(ptrdiff_t __src2dst, __sub_kind __access_path,
+   const __class_type_info* __dst_type, const void* __obj_ptr,
+   const __class_type_info* __src_type, const void* __src_ptr,
+   __dyncast_result& __result) const;
+
+    virtual __sub_kind
+    __do_find_public_src(ptrdiff_t __src2dst, const void* __obj_ptr,
+    const __class_type_info* __src_type,
+    const void* __src_ptr) const;
+
+    virtual bool
+    __do_upcast(const __class_type_info* __dst, const void* __obj,
+  __upcast_result& __restrict __result) const;
+  };
+
+
+  struct __cxa_exception;
+  struct __cxa_refcounted_exception;
+  struct __cxa_dependent_exception;
+  struct __cxa_eh_globals;
+
+  extern "C"
+  {
+  void*
+  __dynamic_cast(const void* __src_ptr,
+   const __class_type_info* __src_type,
+   const __class_type_info* __dst_type,
+   ptrdiff_t __src2dst);
+  __cxa_eh_globals*
+  __cxa_get_globals() noexcept __attribute__ ((__const__));
+
+  __cxa_eh_globals*
+  __cxa_get_globals_fast() noexcept __attribute__ ((__const__));
+
+
+  void
+  __cxa_free_exception(void*) noexcept;
+
+
+  void
+  __cxa_throw(void*, std::type_info*, void ( *) (void *))
+  __attribute__((__noreturn__));
+
+
+  void*
+  __cxa_get_exception_ptr(void*) noexcept __attribute__ ((__pure__));
+
+  void*
+  __cxa_begin_catch(void*) noexcept;
+
+  void
+  __cxa_end_catch();
+
+  void
+  __cxa_rethrow() __attribute__((__noreturn__));
+
+
+
+  std::type_info*
+  __cxa_current_exception_type() noexcept __attribute__ ((__pure__));
+
+
+
+
+  __cxa_dependent_exception*
+  __cxa_allocate_dependent_exception() noexcept;
+
+
+  void
+  __cxa_free_dependent_exception(__cxa_dependent_exception*) noexcept;
+
+  }
+
+
+
+  class __foreign_exception
+  {
+    virtual ~__foreign_exception() throw();
+    virtual void __pure_dummy() = 0;
+  };
+
+}
+namespace abi = __cxxabiv1;
+
+namespace __gnu_cxx
+{
+  class recursive_init_error: public std::exception
+  {
+  public:
+    recursive_init_error() throw() { }
+    virtual ~recursive_init_error() throw ();
+  };
+}
+
+
+
+
+extern "C" {
+
+
+
+
+extern char *gettext (const char *__msgid)
+     throw () __attribute__ ((__format_arg__ (1)));
+
+
+
+extern char *dgettext (const char *__domainname, const char *__msgid)
+     throw () __attribute__ ((__format_arg__ (2)));
+extern char *__dgettext (const char *__domainname, const char *__msgid)
+     throw () __attribute__ ((__format_arg__ (2)));
+
+
+
+extern char *dcgettext (const char *__domainname,
+   const char *__msgid, int __category)
+     throw () __attribute__ ((__format_arg__ (2)));
+extern char *__dcgettext (const char *__domainname,
+     const char *__msgid, int __category)
+     throw () __attribute__ ((__format_arg__ (2)));
+
+
+
+
+extern char *ngettext (const char *__msgid1, const char *__msgid2,
+         unsigned long int __n)
+     throw () __attribute__ ((__format_arg__ (1))) __attribute__ ((__format_arg__ (2)));
+
+
+
+extern char *dngettext (const char *__domainname, const char *__msgid1,
+   const char *__msgid2, unsigned long int __n)
+     throw () __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));
+
+
+
+extern char *dcngettext (const char *__domainname, const char *__msgid1,
+    const char *__msgid2, unsigned long int __n,
+    int __category)
+     throw () __attribute__ ((__format_arg__ (2))) __attribute__ ((__format_arg__ (3)));
+
+
+
+
+
+extern char *textdomain (const char *__domainname) throw ();
+
+
+
+extern char *bindtextdomain (const char *__domainname,
+        const char *__dirname) throw ();
+
+
+
+extern char *bind_textdomain_codeset (const char *__domainname,
+          const char *__codeset) throw ();
+}
+
+namespace
+{
+  struct io_error_category : std::error_category
+  {
+    virtual const char*
+    name() const noexcept
+    { return "iostream"; }
+
+    
+   __attribute ((__abi_tag__ ("cxx11")))
+    
+   virtual std::string message(int __ec) const
+    {
+      std::string __msg;
+      switch (std::io_errc(__ec))
+      {
+      case std::io_errc::stream:
+          __msg = "iostream error";
+          break;
+      default:
+          __msg = "Unknown error";
+          break;
+      }
+      return __msg;
+    }
+  };
+
+  const io_error_category&
+  __io_category_instance() noexcept
+  {
+    static const io_error_category __ec{};
+    return __ec;
+  }
+
+}
+
+namespace std 
+             __attribute__ ((__visibility__ (
+             "default"
+             )))
+
+{
+
+
+  const error_category&
+  iostream_category() noexcept
+  { return __io_category_instance(); }
+
+  ios_base::failure::failure(const string& __str)
+  : system_error(io_errc::stream, __str) { }
+
+  ios_base::failure::failure(const string& __str, const error_code& __ec)
+  : system_error(__ec, __str) { }
+
+  ios_base::failure::failure(const char* __str, const error_code& __ec)
+  : system_error(__ec, __str) { }
+
+  ios_base::failure::~failure()
+  { }
+
+  const char*
+  ios_base::failure::what() const throw()
+  { return runtime_error::what(); }
+
+
+
+  extern void __construct_ios_failure(void*, const char*);
+  extern void __destroy_ios_failure(void*);
+  extern bool __is_ios_failure_handler(const __cxxabiv1::__class_type_info*);
+
+
+
+
+  struct __ios_failure : std::ios::failure
+  {
+    __ios_failure(const char* s) : failure(s)
+    { __construct_ios_failure(buf, runtime_error::what()); }
+
+    __ios_failure(const char* s, int e) : failure(s, to_error_code(e))
+    { __construct_ios_failure(buf, runtime_error::what()); }
+
+    ~__ios_failure()
+    { __destroy_ios_failure(buf); }
+
+
+
+
+
+    alignas(runtime_error) unsigned char buf[sizeof(runtime_error)];
+
+    static error_code
+    to_error_code(int e)
+    { return e ? error_code(e, system_category()) : io_errc::stream; }
+  };
+
+
+  class __iosfail_type_info : __cxxabiv1::__si_class_type_info
+  {
+    ~__iosfail_type_info();
+
+    bool
+    __do_upcast (const __class_type_info *dst_type,
+   void **obj_ptr) const override;
+  };
+
+  __iosfail_type_info::~__iosfail_type_info() = default;
+
+
+
+  bool
+  __iosfail_type_info::__do_upcast(const __class_type_info *dst_type,
+       void **obj_ptr) const
+  {
+
+
+
+    if (__is_ios_failure_handler(dst_type))
+      {
+ *obj_ptr = static_cast<__ios_failure*>(*obj_ptr)->buf;
+ return true;
+      }
+
+    return __class_type_info::__do_upcast(dst_type, obj_ptr);
+  }
+
+
+
+
+  void
+  __throw_ios_failure(const char* __s __attribute__((unused)))
+  { 
+   (throw (
+   __ios_failure(gettext (__s))
+   ))
+                                                 ; }
+
+  void
+  __throw_ios_failure(const char* str __attribute__((unused)),
+        int err __attribute__((unused)))
+  { 
+   (throw (
+   __ios_failure(gettext (str), err)
+   ))
+                                                      ; }
+
+
+}
diff --git a/gcc/testsuite/g++.dg/wrappers/NOT_FOR_UPSTREAM/gimple-ssa-sprintf.ii b/gcc/testsuite/g++.dg/wrappers/NOT_FOR_UPSTREAM/gimple-ssa-sprintf.ii
new file mode 100644
index 0000000..dd30e48
--- /dev/null
+++ b/gcc/testsuite/g++.dg/wrappers/NOT_FOR_UPSTREAM/gimple-ssa-sprintf.ii
@@ -0,0 +1,12 @@
+/* False positive from -Wchar-subscripts.  */
+/* { dg-options "-Wall" } */
+
+static char target_to_host_charmap[256];
+
+bool
+init_target_to_host_charmap ()
+{
+  if (target_to_host_charmap['%'])
+    return true;
+  return false;
+}
diff --git a/gcc/testsuite/g++.dg/wrappers/NOT_FOR_UPSTREAM/kdecore.C b/gcc/testsuite/g++.dg/wrappers/NOT_FOR_UPSTREAM/kdecore.C
new file mode 100644
index 0000000..aaa9190
--- /dev/null
+++ b/gcc/testsuite/g++.dg/wrappers/NOT_FOR_UPSTREAM/kdecore.C
@@ -0,0 +1,129586 @@
+// { dg-options "-Wno-attributes -Wno-register -fsyntax-only" }
+
+extern "C"
+
+int mkstemps(char *, int);
+extern "C"
+
+unsigned long strlcat(char*, const char*, unsigned long);
+
+
+
+
+
+
+extern "C"
+
+unsigned long strlcpy(char*, const char*, unsigned long);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C"
+
+int mkstemps(char *, int);
+extern "C"
+
+unsigned long strlcat(char*, const char*, unsigned long);
+
+
+
+
+
+
+extern "C"
+
+unsigned long strlcpy(char*, const char*, unsigned long);
+
+
+
+
+
+
+
+
+
+typedef unsigned char uchar;
+typedef unsigned short ushort;
+typedef unsigned uint;
+typedef unsigned long ulong;
+typedef char *pchar;
+typedef uchar *puchar;
+typedef const char *pcchar;
+
+
+
+
+
+
+
+const bool FALSE = 0;
+const bool TRUE = !0;
+
+
+
+
+
+
+
+
+inline int qRound( double d )
+{
+    return d >= 0.0 ? int(d + 0.5) : int( d - ((int)d-1) + 0.5 ) + ((int)d-1);
+}
+typedef signed char Q_INT8;
+typedef unsigned char Q_UINT8;
+typedef short Q_INT16;
+typedef unsigned short Q_UINT16;
+typedef int Q_INT32;
+typedef unsigned int Q_UINT32;
+
+
+
+
+typedef long Q_LONG;
+typedef unsigned long Q_ULONG;
+
+
+
+
+
+
+
+typedef long long Q_INT64;
+typedef unsigned long long Q_UINT64;
+
+typedef Q_INT64 Q_LLONG;
+typedef Q_UINT64 Q_ULLONG;
+
+
+
+
+
+
+
+    typedef Q_ULONG QtOffset;
+
+
+
+
+
+
+
+class QDataStream;
+
+
+
+
+
+
+
+
+
+
+
+ const char *qVersion();
+ bool qSysInfo( int *wordSize, bool *bigEndian );
+ bool qSharedBuild();
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ void qDebug( const char *, ... )
+
+    __attribute__ ((format (printf, 1, 2)))
+
+;
+
+ void qWarning( const char *, ... )
+
+    __attribute__ ((format (printf, 1, 2)))
+
+;
+
+ void qFatal( const char *, ... )
+
+    __attribute__ ((format (printf, 1, 2)))
+
+;
+
+ void qSystemWarning( const char *, int code = -1 );
+ bool qt_check_pointer( bool c, const char *, int );
+
+
+enum QtMsgType { QtDebugMsg, QtWarningMsg, QtFatalMsg };
+
+typedef void (*QtMsgHandler)(QtMsgType, const char *);
+ QtMsgHandler qInstallMsgHandler( QtMsgHandler );
+
+
+
+
+
+ void qSuppressObsoleteWarnings( bool = TRUE );
+
+ void qObsolete( const char *obj, const char *oldfunc,
+                   const char *newfunc );
+ void qObsolete( const char *obj, const char *oldfunc );
+ void qObsolete( const char *message );
+
+
+
+
+
+
+ const char *qInstallPath();
+ const char *qInstallPathDocs();
+ const char *qInstallPathHeaders();
+ const char *qInstallPathLibs();
+ const char *qInstallPathBins();
+ const char *qInstallPathPlugins();
+ const char *qInstallPathData();
+ const char *qInstallPathTranslations();
+ const char *qInstallPathSysconf();
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef __SIZE_TYPE__ size_t;
+
+extern "C" {
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+union wait
+  {
+    int w_status;
+    struct
+      {
+
+        unsigned int __w_termsig:7;
+        unsigned int __w_coredump:1;
+        unsigned int __w_retcode:8;
+        unsigned int:16;
+
+
+
+
+
+
+
+      } __wait_terminated;
+    struct
+      {
+
+        unsigned int __w_stopval:8;
+        unsigned int __w_stopsig:8;
+        unsigned int:16;
+
+
+
+
+
+
+      } __wait_stopped;
+  };
+
+
+
+
+
+typedef struct
+  {
+    int quot;
+    int rem;
+  } div_t;
+
+
+
+typedef struct
+  {
+    long int quot;
+    long int rem;
+  } ldiv_t;
+
+
+
+
+
+
+__extension__ typedef struct
+  {
+    long long int quot;
+    long long int rem;
+  } lldiv_t;
+
+
+
+
+
+
+
+
+
+
+
+
+extern size_t __ctype_get_mb_cur_max (void) throw ();
+
+
+
+
+extern double atof (__const char *__nptr) throw () __attribute__ ((__pure__));
+
+extern int atoi (__const char *__nptr) throw () __attribute__ ((__pure__));
+
+extern long int atol (__const char *__nptr) throw () __attribute__ ((__pure__));
+
+
+
+
+
+__extension__ extern long long int atoll (__const char *__nptr)
+     throw () __attribute__ ((__pure__));
+
+
+
+
+
+extern double strtod (__const char *__restrict __nptr,
+                      char **__restrict __endptr) throw ();
+
+
+
+
+
+extern float strtof (__const char *__restrict __nptr,
+                     char **__restrict __endptr) throw ();
+
+extern long double strtold (__const char *__restrict __nptr,
+                            char **__restrict __endptr) throw ();
+
+
+
+
+
+extern long int strtol (__const char *__restrict __nptr,
+                        char **__restrict __endptr, int __base) throw ();
+
+extern unsigned long int strtoul (__const char *__restrict __nptr,
+                                  char **__restrict __endptr, int __base)
+     throw ();
+
+
+
+
+__extension__
+extern long long int strtoq (__const char *__restrict __nptr,
+                             char **__restrict __endptr, int __base) throw ();
+
+__extension__
+extern unsigned long long int strtouq (__const char *__restrict __nptr,
+                                       char **__restrict __endptr, int __base)
+     throw ();
+
+
+
+
+
+__extension__
+extern long long int strtoll (__const char *__restrict __nptr,
+                              char **__restrict __endptr, int __base) throw ();
+
+__extension__
+extern unsigned long long int strtoull (__const char *__restrict __nptr,
+                                        char **__restrict __endptr, int __base)
+     throw ();
+
+
+
+
+
+
+typedef struct __locale_struct
+{
+
+  struct locale_data *__locales[13];
+
+
+  const unsigned short int *__ctype_b;
+  const int *__ctype_tolower;
+  const int *__ctype_toupper;
+
+
+  const char *__names[13];
+} *__locale_t;
+
+
+
+extern long int strtol_l (__const char *__restrict __nptr,
+                          char **__restrict __endptr, int __base,
+                          __locale_t __loc) throw ();
+
+extern unsigned long int strtoul_l (__const char *__restrict __nptr,
+                                    char **__restrict __endptr,
+                                    int __base, __locale_t __loc) throw ();
+
+__extension__
+extern long long int strtoll_l (__const char *__restrict __nptr,
+                                char **__restrict __endptr, int __base,
+                                __locale_t __loc) throw ();
+
+__extension__
+extern unsigned long long int strtoull_l (__const char *__restrict __nptr,
+                                          char **__restrict __endptr,
+                                          int __base, __locale_t __loc)
+     throw ();
+
+extern double strtod_l (__const char *__restrict __nptr,
+                        char **__restrict __endptr, __locale_t __loc)
+     throw ();
+
+extern float strtof_l (__const char *__restrict __nptr,
+                       char **__restrict __endptr, __locale_t __loc) throw ();
+
+extern long double strtold_l (__const char *__restrict __nptr,
+                              char **__restrict __endptr,
+                              __locale_t __loc) throw ();
+
+
+
+
+
+
+extern double __strtod_internal (__const char *__restrict __nptr,
+                                 char **__restrict __endptr, int __group)
+     throw ();
+extern float __strtof_internal (__const char *__restrict __nptr,
+                                char **__restrict __endptr, int __group)
+     throw ();
+extern long double __strtold_internal (__const char *__restrict __nptr,
+                                       char **__restrict __endptr,
+                                       int __group) throw ();
+
+extern long int __strtol_internal (__const char *__restrict __nptr,
+                                   char **__restrict __endptr,
+                                   int __base, int __group) throw ();
+
+
+extern unsigned long int __strtoul_internal (__const char *__restrict __nptr,
+                                             char **__restrict __endptr,
+                                             int __base, int __group) throw ();
+
+
+
+__extension__
+extern long long int __strtoll_internal (__const char *__restrict __nptr,
+                                         char **__restrict __endptr,
+                                         int __base, int __group) throw ();
+
+
+__extension__
+extern unsigned long long int __strtoull_internal (__const char *
+                                                   __restrict __nptr,
+                                                   char **__restrict __endptr,
+                                                   int __base, int __group)
+     throw ();
+extern char *l64a (long int __n) throw ();
+
+
+extern long int a64l (__const char *__s) throw () __attribute__ ((__pure__));
+
+
+
+
+
+extern "C" {
+
+
+
+
+
+
+typedef unsigned char __u_char;
+typedef unsigned short int __u_short;
+typedef unsigned int __u_int;
+typedef unsigned long int __u_long;
+
+
+typedef signed char __int8_t;
+typedef unsigned char __uint8_t;
+typedef signed short int __int16_t;
+typedef unsigned short int __uint16_t;
+typedef signed int __int32_t;
+typedef unsigned int __uint32_t;
+
+
+
+
+__extension__ typedef signed long long int __int64_t;
+__extension__ typedef unsigned long long int __uint64_t;
+
+
+
+
+
+__extension__ typedef long long int __quad_t;
+__extension__ typedef unsigned long long int __u_quad_t;
+
+
+
+
+
+
+
+
+
+typedef unsigned long long int __dev_t;
+typedef unsigned int __uid_t;
+typedef unsigned int __gid_t;
+typedef unsigned long int __ino_t;
+typedef unsigned long long int __ino64_t;
+typedef unsigned int __mode_t;
+typedef unsigned int __nlink_t;
+typedef long int __off_t;
+typedef long long int __off64_t;
+typedef int __pid_t;
+typedef struct { int __val[2]; } __fsid_t;
+typedef long int __clock_t;
+typedef unsigned long int __rlim_t;
+typedef unsigned long long int __rlim64_t;
+typedef unsigned int __id_t;
+typedef long int __time_t;
+typedef unsigned int __useconds_t;
+typedef long int __suseconds_t;
+
+typedef int __daddr_t;
+typedef long int __swblk_t;
+typedef int __key_t;
+
+
+typedef int __clockid_t;
+
+
+typedef int __timer_t;
+
+
+typedef long int __blksize_t;
+
+
+
+
+typedef long int __blkcnt_t;
+typedef long long int __blkcnt64_t;
+
+
+typedef unsigned long int __fsblkcnt_t;
+typedef unsigned long long int __fsblkcnt64_t;
+
+
+typedef unsigned long int __fsfilcnt_t;
+typedef unsigned long long int __fsfilcnt64_t;
+
+
+
+
+typedef int __ssize_t;
+typedef __off64_t __loff_t;
+typedef __quad_t *__qaddr_t;
+typedef char *__caddr_t;
+
+
+typedef int __intptr_t;
+
+
+typedef unsigned int __socklen_t;
+
+
+
+typedef __u_char u_char;
+typedef __u_short u_short;
+typedef __u_int u_int;
+typedef __u_long u_long;
+typedef __quad_t quad_t;
+typedef __u_quad_t u_quad_t;
+typedef __fsid_t fsid_t;
+
+
+
+typedef __loff_t loff_t;
+
+
+
+typedef __ino_t ino_t;
+
+
+
+
+
+typedef __ino64_t ino64_t;
+
+
+
+typedef __dev_t dev_t;
+
+
+
+typedef __gid_t gid_t;
+
+
+
+typedef __mode_t mode_t;
+
+
+
+typedef __nlink_t nlink_t;
+
+
+
+typedef __uid_t uid_t;
+
+
+
+
+typedef __off_t off_t;
+
+
+
+
+
+typedef __off64_t off64_t;
+
+
+
+typedef __pid_t pid_t;
+
+
+
+typedef __id_t id_t;
+
+
+
+typedef __ssize_t ssize_t;
+
+
+
+
+typedef __daddr_t daddr_t;
+typedef __caddr_t caddr_t;
+
+
+
+
+typedef __key_t key_t;
+
+
+
+
+
+
+
+
+
+typedef __clock_t clock_t;
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef __time_t time_t;
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef __clockid_t clockid_t;
+
+
+
+
+
+
+
+
+
+
+typedef __timer_t timer_t;
+
+
+
+
+
+typedef __useconds_t useconds_t;
+
+
+typedef __suseconds_t suseconds_t;
+
+
+
+
+
+
+typedef unsigned long int ulong;
+typedef unsigned short int ushort;
+typedef unsigned int uint;
+
+
+
+
+typedef int int8_t __attribute__ ((__mode__ (__QI__)));
+typedef int int16_t __attribute__ ((__mode__ (__HI__)));
+typedef int int32_t __attribute__ ((__mode__ (__SI__)));
+typedef int int64_t __attribute__ ((__mode__ (__DI__)));
+
+
+typedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__)));
+typedef unsigned int u_int16_t __attribute__ ((__mode__ (__HI__)));
+typedef unsigned int u_int32_t __attribute__ ((__mode__ (__SI__)));
+typedef unsigned int u_int64_t __attribute__ ((__mode__ (__DI__)));
+
+typedef int register_t __attribute__ ((__mode__ (__word__)));
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef int __sig_atomic_t;
+
+
+
+typedef struct
+  {
+    unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
+  } __sigset_t;
+
+
+typedef __sigset_t sigset_t;
+
+
+
+
+
+
+struct timespec
+  {
+    __time_t tv_sec;
+    long int tv_nsec;
+  };
+
+
+
+
+
+
+
+struct timeval
+  {
+    __time_t tv_sec;
+    __suseconds_t tv_usec;
+  };
+typedef long int __fd_mask;
+
+
+
+
+
+
+
+
+typedef struct
+  {
+
+
+
+    __fd_mask fds_bits[1024 / (8 * sizeof (__fd_mask))];
+
+
+
+
+  } fd_set;
+
+#define FD_SET(fd,fds) \
+    (fds)->fds_bits[(fd) / (8 * sizeof(__fd_mask))] |= ((__fd_mask)1) << ((fd) % (8*sizeof(__fd_mask)))
+
+#define FD_ISSET(fd,fds) \
+    (((fds)->fds_bits[(fd) / (8 * sizeof(__fd_mask))] & (((__fd_mask)1) << ((fd) % (8*sizeof(__fd_mask))))) != 0)
+
+
+
+typedef __fd_mask fd_mask;
+
+
+
+
+
+
+
+
+extern "C" {
+
+
+
+
+
+
+extern int select (int __nfds, fd_set *__restrict __readfds,
+                   fd_set *__restrict __writefds,
+                   fd_set *__restrict __exceptfds,
+                   struct timeval *__restrict __timeout) throw ();
+
+
+
+
+
+extern int pselect (int __nfds, fd_set *__restrict __readfds,
+                    fd_set *__restrict __writefds,
+                    fd_set *__restrict __exceptfds,
+                    const struct timespec *__restrict __timeout,
+                    const __sigset_t *__restrict __sigmask) throw ();
+
+
+}
+
+
+
+
+
+
+
+
+
+
+
+
+typedef __blksize_t blksize_t;
+
+
+
+
+
+typedef __blkcnt_t blkcnt_t;
+
+
+typedef __fsblkcnt_t fsblkcnt_t;
+
+
+typedef __fsfilcnt_t fsfilcnt_t;
+typedef __blkcnt64_t blkcnt64_t;
+typedef __fsblkcnt64_t fsblkcnt64_t;
+typedef __fsfilcnt64_t fsfilcnt64_t;
+
+
+
+
+
+
+
+struct __sched_param
+  {
+    int __sched_priority;
+  };
+
+
+struct _pthread_fastlock
+{
+  long int __status;
+  int __spinlock;
+
+};
+
+
+
+typedef struct _pthread_descr_struct *_pthread_descr;
+
+
+
+
+typedef struct __pthread_attr_s
+{
+  int __detachstate;
+  int __schedpolicy;
+  struct __sched_param __schedparam;
+  int __inheritsched;
+  int __scope;
+  size_t __guardsize;
+  int __stackaddr_set;
+  void *__stackaddr;
+  size_t __stacksize;
+} pthread_attr_t;
+
+
+
+
+
+__extension__ typedef long long __pthread_cond_align_t;
+
+
+
+
+typedef struct
+{
+  struct _pthread_fastlock __c_lock;
+  _pthread_descr __c_waiting;
+  char __padding[48 - sizeof (struct _pthread_fastlock)
+                 - sizeof (_pthread_descr) - sizeof (__pthread_cond_align_t)];
+  __pthread_cond_align_t __align;
+} pthread_cond_t;
+
+
+
+typedef struct
+{
+  int __dummy;
+} pthread_condattr_t;
+
+
+typedef unsigned int pthread_key_t;
+
+
+
+
+
+typedef struct
+{
+  int __m_reserved;
+  int __m_count;
+  _pthread_descr __m_owner;
+  int __m_kind;
+  struct _pthread_fastlock __m_lock;
+} pthread_mutex_t;
+
+
+
+typedef struct
+{
+  int __mutexkind;
+} pthread_mutexattr_t;
+
+
+
+typedef int pthread_once_t;
+
+
+
+
+typedef struct _pthread_rwlock_t
+{
+  struct _pthread_fastlock __rw_lock;
+  int __rw_readers;
+  _pthread_descr __rw_writer;
+  _pthread_descr __rw_read_waiting;
+  _pthread_descr __rw_write_waiting;
+  int __rw_kind;
+  int __rw_pshared;
+} pthread_rwlock_t;
+
+
+
+typedef struct
+{
+  int __lockkind;
+  int __pshared;
+} pthread_rwlockattr_t;
+
+
+
+
+typedef volatile int pthread_spinlock_t;
+
+
+typedef struct {
+  struct _pthread_fastlock __ba_lock;
+  int __ba_required;
+  int __ba_present;
+  _pthread_descr __ba_waiting;
+} pthread_barrier_t;
+
+
+typedef struct {
+  int __pshared;
+} pthread_barrierattr_t;
+
+
+
+
+
+typedef unsigned long int pthread_t;
+
+
+}
+
+
+
+
+
+
+extern long int random (void) throw ();
+
+
+extern void srandom (unsigned int __seed) throw ();
+
+
+
+
+
+extern char *initstate (unsigned int __seed, char *__statebuf,
+                        size_t __statelen) throw ();
+
+
+
+extern char *setstate (char *__statebuf) throw ();
+
+
+
+
+
+
+
+struct random_data
+  {
+    int32_t *fptr;
+    int32_t *rptr;
+    int32_t *state;
+    int rand_type;
+    int rand_deg;
+    int rand_sep;
+    int32_t *end_ptr;
+  };
+
+extern int random_r (struct random_data *__restrict __buf,
+                     int32_t *__restrict __result) throw ();
+
+extern int srandom_r (unsigned int __seed, struct random_data *__buf) throw ();
+
+extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
+                        size_t __statelen,
+                        struct random_data *__restrict __buf) throw ();
+
+extern int setstate_r (char *__restrict __statebuf,
+                       struct random_data *__restrict __buf) throw ();
+
+
+
+
+
+
+extern int rand (void) throw ();
+
+extern void srand (unsigned int __seed) throw ();
+
+
+
+
+extern int rand_r (unsigned int *__seed) throw ();
+
+
+
+
+
+
+
+extern double drand48 (void) throw ();
+extern double erand48 (unsigned short int __xsubi[3]) throw ();
+
+
+extern long int lrand48 (void) throw ();
+extern long int nrand48 (unsigned short int __xsubi[3]) throw ();
+
+
+extern long int mrand48 (void) throw ();
+extern long int jrand48 (unsigned short int __xsubi[3]) throw ();
+
+
+extern void srand48 (long int __seedval) throw ();
+extern unsigned short int *seed48 (unsigned short int __seed16v[3]) throw ();
+extern void lcong48 (unsigned short int __param[7]) throw ();
+
+
+
+
+
+struct drand48_data
+  {
+    unsigned short int __x[3];
+    unsigned short int __old_x[3];
+    unsigned short int __c;
+    unsigned short int __init;
+    unsigned long long int __a;
+  };
+
+
+extern int drand48_r (struct drand48_data *__restrict __buffer,
+                      double *__restrict __result) throw ();
+extern int erand48_r (unsigned short int __xsubi[3],
+                      struct drand48_data *__restrict __buffer,
+                      double *__restrict __result) throw ();
+
+
+extern int lrand48_r (struct drand48_data *__restrict __buffer,
+                      long int *__restrict __result) throw ();
+extern int nrand48_r (unsigned short int __xsubi[3],
+                      struct drand48_data *__restrict __buffer,
+                      long int *__restrict __result) throw ();
+
+
+extern int mrand48_r (struct drand48_data *__restrict __buffer,
+                      long int *__restrict __result) throw ();
+extern int jrand48_r (unsigned short int __xsubi[3],
+                      struct drand48_data *__restrict __buffer,
+                      long int *__restrict __result) throw ();
+
+
+extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
+     throw ();
+
+extern int seed48_r (unsigned short int __seed16v[3],
+                     struct drand48_data *__buffer) throw ();
+
+extern int lcong48_r (unsigned short int __param[7],
+                      struct drand48_data *__buffer) throw ();
+
+
+
+
+
+
+
+
+extern void *malloc (size_t __size) throw () __attribute__ ((__malloc__));
+
+extern void *calloc (size_t __nmemb, size_t __size)
+     throw () __attribute__ ((__malloc__));
+
+
+
+
+
+
+
+extern void *realloc (void *__ptr, size_t __size) throw () __attribute__ ((__malloc__));
+
+extern void free (void *__ptr) throw ();
+
+
+
+
+extern void cfree (void *__ptr) throw ();
+
+
+
+
+
+
+
+extern "C" {
+
+
+
+
+
+extern void *alloca (size_t __size) throw ();
+
+
+
+
+}
+
+
+
+
+extern void *valloc (size_t __size) throw () __attribute__ ((__malloc__));
+
+
+
+
+extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
+     throw () __attribute__ ((__malloc__));
+
+
+
+
+extern void abort (void) throw () __attribute__ ((__noreturn__));
+
+
+
+extern int atexit (void (*__func) (void)) throw ();
+
+
+
+
+
+extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
+     throw ();
+
+
+
+
+
+
+extern void exit (int __status) throw () __attribute__ ((__noreturn__));
+
+
+
+
+
+
+extern void _Exit (int __status) throw () __attribute__ ((__noreturn__));
+
+
+
+
+
+
+extern char *getenv (__const char *__name) throw ();
+
+
+
+
+extern char *__secure_getenv (__const char *__name) throw ();
+
+
+
+
+
+extern int putenv (char *__string) throw ();
+
+
+
+
+
+extern int setenv (__const char *__name, __const char *__value, int __replace)
+     throw ();
+
+
+extern int unsetenv (__const char *__name) throw ();
+
+
+
+
+
+
+extern int clearenv (void) throw ();
+extern char *mktemp (char *__template) throw ();
+
+
+
+
+
+
+
+extern int mkstemp (char *__template) throw ();
+extern int mkstemp64 (char *__template) throw ();
+extern char *mkdtemp (char *__template) throw ();
+
+
+
+
+
+extern int system (__const char *__command) throw ();
+
+
+
+
+
+
+
+extern char *canonicalize_file_name (__const char *__name) throw ();
+extern char *realpath (__const char *__restrict __name,
+                       char *__restrict __resolved) throw ();
+
+
+
+
+
+typedef int (*__compar_fn_t) (__const void *, __const void *);
+
+
+typedef __compar_fn_t comparison_fn_t;
+
+
+
+
+
+
+extern void *bsearch (__const void *__key, __const void *__base,
+                      size_t __nmemb, size_t __size, __compar_fn_t __compar);
+
+
+
+extern void qsort (void *__base, size_t __nmemb, size_t __size,
+                   __compar_fn_t __compar);
+
+
+
+extern int abs (int __x) throw () __attribute__ ((__const__));
+extern long int labs (long int __x) throw () __attribute__ ((__const__));
+
+
+
+__extension__ extern long long int llabs (long long int __x)
+     throw () __attribute__ ((__const__));
+
+
+
+
+
+
+
+extern div_t div (int __numer, int __denom)
+     throw () __attribute__ ((__const__));
+extern ldiv_t ldiv (long int __numer, long int __denom)
+     throw () __attribute__ ((__const__));
+
+
+
+
+__extension__ extern lldiv_t lldiv (long long int __numer,
+                                    long long int __denom)
+     throw () __attribute__ ((__const__));
+
+extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
+                   int *__restrict __sign) throw ();
+
+
+
+
+extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
+                   int *__restrict __sign) throw ();
+
+
+
+
+extern char *gcvt (double __value, int __ndigit, char *__buf) throw ();
+
+
+
+
+extern char *qecvt (long double __value, int __ndigit,
+                    int *__restrict __decpt, int *__restrict __sign) throw ();
+extern char *qfcvt (long double __value, int __ndigit,
+                    int *__restrict __decpt, int *__restrict __sign) throw ();
+extern char *qgcvt (long double __value, int __ndigit, char *__buf) throw ();
+
+
+
+
+extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
+                   int *__restrict __sign, char *__restrict __buf,
+                   size_t __len) throw ();
+extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
+                   int *__restrict __sign, char *__restrict __buf,
+                   size_t __len) throw ();
+
+extern int qecvt_r (long double __value, int __ndigit,
+                    int *__restrict __decpt, int *__restrict __sign,
+                    char *__restrict __buf, size_t __len) throw ();
+extern int qfcvt_r (long double __value, int __ndigit,
+                    int *__restrict __decpt, int *__restrict __sign,
+                    char *__restrict __buf, size_t __len) throw ();
+
+
+
+
+
+
+
+extern int mblen (__const char *__s, size_t __n) throw ();
+
+
+extern int mbtowc (wchar_t *__restrict __pwc,
+                   __const char *__restrict __s, size_t __n) throw ();
+
+
+extern int wctomb (char *__s, wchar_t __wchar) throw ();
+
+
+
+extern size_t mbstowcs (wchar_t *__restrict __pwcs,
+                        __const char *__restrict __s, size_t __n) throw ();
+
+extern size_t wcstombs (char *__restrict __s,
+                        __const wchar_t *__restrict __pwcs, size_t __n)
+     throw ();
+
+
+
+
+
+
+
+
+extern int rpmatch (__const char *__response) throw ();
+extern int getsubopt (char **__restrict __optionp,
+                      char *__const *__restrict __tokens,
+                      char **__restrict __valuep) throw ();
+
+
+
+
+
+extern void setkey (__const char *__key) throw ();
+
+
+
+
+
+
+
+extern int posix_openpt (int __oflag) throw ();
+
+
+
+
+
+
+
+extern int grantpt (int __fd) throw ();
+
+
+
+extern int unlockpt (int __fd) throw ();
+
+
+
+
+extern char *ptsname (int __fd) throw ();
+
+
+
+
+
+
+extern int ptsname_r (int __fd, char *__buf, size_t __buflen) throw ();
+
+
+extern int getpt (void) throw ();
+
+
+
+
+
+
+extern int getloadavg (double __loadavg[], int __nelem) throw ();
+
+
+
+
+
+}
+
+
+
+
+
+extern "C" {
+
+
+
+
+
+
+
+extern void *memcpy (void *__restrict __dest,
+                     __const void *__restrict __src, size_t __n) throw ();
+
+
+extern void *memmove (void *__dest, __const void *__src, size_t __n)
+     throw ();
+
+
+
+
+
+
+extern void *memccpy (void *__restrict __dest, __const void *__restrict __src,
+                      int __c, size_t __n)
+     throw ();
+
+
+
+
+
+extern void *memset (void *__s, int __c, size_t __n) throw ();
+
+
+extern int memcmp (__const void *__s1, __const void *__s2, size_t __n)
+     throw () __attribute__ ((__pure__));
+
+
+extern void *memchr (__const void *__s, int __c, size_t __n)
+      throw () __attribute__ ((__pure__));
+
+
+
+
+
+extern void *rawmemchr (__const void *__s, int __c) throw () __attribute__ ((__pure__));
+
+
+extern void *memrchr (__const void *__s, int __c, size_t __n)
+      throw () __attribute__ ((__pure__));
+
+
+
+
+
+extern char *strcpy (char *__restrict __dest, __const char *__restrict __src)
+     throw ();
+
+extern char *strncpy (char *__restrict __dest,
+                      __const char *__restrict __src, size_t __n) throw ();
+
+
+extern char *strcat (char *__restrict __dest, __const char *__restrict __src)
+     throw ();
+
+extern char *strncat (char *__restrict __dest, __const char *__restrict __src,
+                      size_t __n) throw ();
+
+
+extern int strcmp (__const char *__s1, __const char *__s2)
+     throw () __attribute__ ((__pure__));
+
+extern int strncmp (__const char *__s1, __const char *__s2, size_t __n)
+     throw () __attribute__ ((__pure__));
+
+
+extern int strcoll (__const char *__s1, __const char *__s2)
+     throw () __attribute__ ((__pure__));
+
+extern size_t strxfrm (char *__restrict __dest,
+                       __const char *__restrict __src, size_t __n) throw ();
+
+extern int strcoll_l (__const char *__s1, __const char *__s2, __locale_t __l)
+     throw () __attribute__ ((__pure__));
+
+extern size_t strxfrm_l (char *__dest, __const char *__src, size_t __n,
+                         __locale_t __l) throw ();
+
+
+
+
+extern char *strdup (__const char *__s) throw () __attribute__ ((__malloc__));
+
+
+
+
+
+
+extern char *strndup (__const char *__string, size_t __n)
+     throw () __attribute__ ((__malloc__));
+
+
+
+
+
+
+extern char *strchr (__const char *__s, int __c) throw () __attribute__ ((__pure__));
+
+extern char *strrchr (__const char *__s, int __c) throw () __attribute__ ((__pure__));
+
+
+
+
+
+extern char *strchrnul (__const char *__s, int __c) throw () __attribute__ ((__pure__));
+
+
+
+
+
+extern size_t strcspn (__const char *__s, __const char *__reject)
+     throw () __attribute__ ((__pure__));
+
+
+extern size_t strspn (__const char *__s, __const char *__accept)
+     throw () __attribute__ ((__pure__));
+
+extern char *strpbrk (__const char *__s, __const char *__accept)
+     throw () __attribute__ ((__pure__));
+
+extern char *strstr (__const char *__haystack, __const char *__needle)
+     throw () __attribute__ ((__pure__));
+
+
+
+extern char *strtok (char *__restrict __s, __const char *__restrict __delim)
+     throw ();
+
+
+
+
+extern char *__strtok_r (char *__restrict __s,
+                         __const char *__restrict __delim,
+                         char **__restrict __save_ptr) throw ();
+
+extern char *strtok_r (char *__restrict __s, __const char *__restrict __delim,
+                       char **__restrict __save_ptr) throw ();
+
+
+
+
+extern char *strcasestr (__const char *__haystack, __const char *__needle)
+     throw () __attribute__ ((__pure__));
+
+
+
+
+
+
+extern void *memmem (__const void *__haystack, size_t __haystacklen,
+                     __const void *__needle, size_t __needlelen)
+     throw () __attribute__ ((__pure__));
+
+
+
+extern void *__mempcpy (void *__restrict __dest,
+                        __const void *__restrict __src, size_t __n) throw ();
+extern void *mempcpy (void *__restrict __dest,
+                      __const void *__restrict __src, size_t __n) throw ();
+
+
+
+
+
+extern size_t strlen (__const char *__s) throw () __attribute__ ((__pure__));
+
+
+
+
+
+extern size_t strnlen (__const char *__string, size_t __maxlen)
+     throw () __attribute__ ((__pure__));
+
+
+
+
+
+extern char *strerror (int __errnum) throw ();
+
+
+
+
+extern char *strerror_r (int __errnum, char *__buf, size_t __buflen) throw ();
+
+
+
+
+extern void __bzero (void *__s, size_t __n) throw ();
+
+
+
+extern void bcopy (__const void *__src, void *__dest, size_t __n) throw ();
+
+
+extern void bzero (void *__s, size_t __n) throw ();
+
+
+extern int bcmp (__const void *__s1, __const void *__s2, size_t __n)
+     throw () __attribute__ ((__pure__));
+
+
+extern char *index (__const char *__s, int __c) throw () __attribute__ ((__pure__));
+
+
+extern char *rindex (__const char *__s, int __c) throw () __attribute__ ((__pure__));
+
+
+
+extern int ffs (int __i) throw () __attribute__ ((__const__));
+
+
+
+
+extern int ffsl (long int __l) throw () __attribute__ ((__const__));
+
+__extension__ extern int ffsll (long long int __ll)
+     throw () __attribute__ ((__const__));
+
+
+
+
+extern int strcasecmp (__const char *__s1, __const char *__s2)
+     throw () __attribute__ ((__pure__));
+
+
+extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n)
+     throw () __attribute__ ((__pure__));
+
+
+
+
+
+extern int strcasecmp_l (__const char *__s1, __const char *__s2,
+                         __locale_t __loc) throw () __attribute__ ((__pure__));
+
+extern int strncasecmp_l (__const char *__s1, __const char *__s2,
+                          size_t __n, __locale_t __loc)
+     throw () __attribute__ ((__pure__));
+
+
+
+
+
+extern char *strsep (char **__restrict __stringp,
+                     __const char *__restrict __delim) throw ();
+
+
+
+
+extern int strverscmp (__const char *__s1, __const char *__s2)
+     throw () __attribute__ ((__pure__));
+
+
+extern char *strsignal (int __sig) throw ();
+
+
+extern char *__stpcpy (char *__restrict __dest, __const char *__restrict __src)
+     throw ();
+extern char *stpcpy (char *__restrict __dest, __const char *__restrict __src)
+     throw ();
+
+
+
+extern char *__stpncpy (char *__restrict __dest,
+                        __const char *__restrict __src, size_t __n) throw ();
+extern char *stpncpy (char *__restrict __dest,
+                      __const char *__restrict __src, size_t __n) throw ();
+
+
+extern char *strfry (char *__string) throw ();
+
+
+extern void *memfrob (void *__s, size_t __n) throw ();
+
+
+
+
+
+
+extern char *basename (__const char *__filename) throw ();
+}
+
+
+
+
+
+
+
+
+
+extern "C" {
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct flock
+  {
+    short int l_type;
+    short int l_whence;
+
+    __off_t l_start;
+    __off_t l_len;
+
+
+
+
+    __pid_t l_pid;
+  };
+
+
+struct flock64
+  {
+    short int l_type;
+    short int l_whence;
+    __off64_t l_start;
+    __off64_t l_len;
+    __pid_t l_pid;
+  };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C" {
+
+
+
+
+
+struct stat
+  {
+    __dev_t st_dev;
+    unsigned short int __pad1;
+
+    __ino_t st_ino;
+
+
+
+    __mode_t st_mode;
+    __nlink_t st_nlink;
+    __uid_t st_uid;
+    __gid_t st_gid;
+    __dev_t st_rdev;
+    unsigned short int __pad2;
+
+    __off_t st_size;
+
+
+
+    __blksize_t st_blksize;
+
+
+    __blkcnt_t st_blocks;
+    struct timespec st_atim;
+    struct timespec st_mtim;
+    struct timespec st_ctim;
+    unsigned long int __unused4;
+    unsigned long int __unused5;
+
+
+
+  };
+
+
+struct stat64
+  {
+    __dev_t st_dev;
+    unsigned int __pad1;
+
+    __ino_t __st_ino;
+    __mode_t st_mode;
+    __nlink_t st_nlink;
+    __uid_t st_uid;
+    __gid_t st_gid;
+    __dev_t st_rdev;
+    unsigned int __pad2;
+    __off64_t st_size;
+    __blksize_t st_blksize;
+
+    __blkcnt64_t st_blocks;
+
+
+
+
+
+
+
+    struct timespec st_atim;
+    struct timespec st_mtim;
+    struct timespec st_ctim;
+    __ino64_t st_ino;
+  };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern int stat (__const char *__restrict __file,
+                 struct stat *__restrict __buf) throw ();
+
+
+
+extern int fstat (int __fd, struct stat *__buf) throw ();
+extern int stat64 (__const char *__restrict __file,
+                   struct stat64 *__restrict __buf) throw ();
+extern int fstat64 (int __fd, struct stat64 *__buf) throw ();
+
+
+
+
+
+
+extern int lstat (__const char *__restrict __file,
+                  struct stat *__restrict __buf) throw ();
+extern int lstat64 (__const char *__restrict __file,
+                    struct stat64 *__restrict __buf) throw ();
+
+
+
+
+
+extern int chmod (__const char *__file, __mode_t __mode) throw ();
+
+
+
+
+
+extern int lchmod (__const char *__file, __mode_t __mode) throw ();
+
+
+
+
+extern int fchmod (int __fd, __mode_t __mode) throw ();
+
+
+
+
+
+extern __mode_t umask (__mode_t __mask) throw ();
+
+
+
+
+extern __mode_t getumask (void) throw ();
+
+
+
+extern int mkdir (__const char *__path, __mode_t __mode) throw ();
+
+
+
+
+
+extern int mknod (__const char *__path, __mode_t __mode, __dev_t __dev)
+     throw ();
+
+
+
+
+extern int mkfifo (__const char *__path, __mode_t __mode) throw ();
+extern int __fxstat (int __ver, int __fildes, struct stat *__stat_buf) throw ();
+extern int __xstat (int __ver, __const char *__filename,
+                    struct stat *__stat_buf) throw ();
+extern int __lxstat (int __ver, __const char *__filename,
+                     struct stat *__stat_buf) throw ();
+extern int __fxstat64 (int __ver, int __fildes, struct stat64 *__stat_buf)
+     throw ();
+extern int __xstat64 (int __ver, __const char *__filename,
+                      struct stat64 *__stat_buf) throw ();
+extern int __lxstat64 (int __ver, __const char *__filename,
+                       struct stat64 *__stat_buf) throw ();
+
+extern int __xmknod (int __ver, __const char *__path, __mode_t __mode,
+                     __dev_t *__dev) throw ();
+
+
+
+
+extern __inline__ int stat (__const char *__path,
+                            struct stat *__statbuf) throw ()
+{
+  return __xstat (3, __path, __statbuf);
+}
+
+
+extern __inline__ int lstat (__const char *__path,
+                             struct stat *__statbuf) throw ()
+{
+  return __lxstat (3, __path, __statbuf);
+}
+
+
+extern __inline__ int fstat (int __fd, struct stat *__statbuf) throw ()
+{
+  return __fxstat (3, __fd, __statbuf);
+}
+
+
+extern __inline__ int mknod (__const char *__path, __mode_t __mode,
+                             __dev_t __dev) throw ()
+{
+  return __xmknod (1, __path, __mode, &__dev);
+}
+
+
+
+
+
+extern __inline__ int stat64 (__const char *__path,
+                              struct stat64 *__statbuf) throw ()
+{
+  return __xstat64 (3, __path, __statbuf);
+}
+
+
+extern __inline__ int lstat64 (__const char *__path,
+                               struct stat64 *__statbuf) throw ()
+{
+  return __lxstat64 (3, __path, __statbuf);
+}
+
+
+extern __inline__ int fstat64 (int __fd, struct stat64 *__statbuf) throw ()
+{
+  return __fxstat64 (3, __fd, __statbuf);
+}
+
+
+
+
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern int fcntl (int __fd, int __cmd, ...) throw ();
+
+
+
+
+
+extern int open (__const char *__file, int __oflag, ...) throw ();
+extern int open64 (__const char *__file, int __oflag, ...) throw ();
+
+
+
+
+
+
+extern int creat (__const char *__file, __mode_t __mode) throw ();
+extern int creat64 (__const char *__file, __mode_t __mode) throw ();
+
+
+extern int lockf (int __fd, int __cmd, __off_t __len) throw ();
+extern int lockf64 (int __fd, int __cmd, __off64_t __len) throw ();
+
+
+
+
+
+
+
+extern int posix_fadvise (int __fd, __off_t __offset, size_t __len,
+                          int __advise) throw ();
+extern int posix_fadvise64 (int __fd, __off64_t __offset, size_t __len,
+                            int __advise) throw ();
+
+
+
+
+
+extern int posix_fallocate (int __fd, __off_t __offset, size_t __len) throw ();
+extern int posix_fallocate64 (int __fd, __off64_t __offset, size_t __len)
+     throw ();
+
+
+
+}
+
+
+
+
+
+
+extern "C" {
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef __intptr_t intptr_t;
+
+
+
+
+
+typedef __socklen_t socklen_t;
+
+
+
+
+
+
+
+extern int access (__const char *__name, int __type) throw ();
+
+
+
+
+extern int euidaccess (__const char *__name, int __type) throw ();
+
+
+
+
+
+
+
+
+
+extern __off_t lseek (int __fd, __off_t __offset, int __whence) throw ();
+extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence) throw ();
+
+
+
+extern int close (int __fd) throw ();
+
+
+
+extern ssize_t read (int __fd, void *__buf, size_t __nbytes) throw ();
+
+
+extern ssize_t write (int __fd, __const void *__buf, size_t __n) throw ();
+
+
+
+extern ssize_t pread (int __fd, void *__buf, size_t __nbytes, __off_t __offset)
+     throw ();
+extern ssize_t pwrite (int __fd, __const void *__buf, size_t __n,
+                       __off_t __offset) throw ();
+extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes,
+                        __off64_t __offset) throw ();
+
+
+extern ssize_t pwrite64 (int __fd, __const void *__buf, size_t __n,
+                         __off64_t __offset) throw ();
+
+
+
+
+
+
+
+extern int pipe (int __pipedes[2]) throw ();
+extern unsigned int alarm (unsigned int __seconds) throw ();
+extern unsigned int sleep (unsigned int __seconds) throw ();
+
+
+
+
+
+
+extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval)
+     throw ();
+
+
+
+extern int usleep (__useconds_t __useconds) throw ();
+
+
+
+
+
+extern int pause (void) throw ();
+
+
+
+extern int chown (__const char *__file, __uid_t __owner, __gid_t __group)
+     throw ();
+
+
+
+extern int fchown (int __fd, __uid_t __owner, __gid_t __group) throw ();
+
+
+
+
+extern int lchown (__const char *__file, __uid_t __owner, __gid_t __group)
+     throw ();
+
+
+
+
+extern int chdir (__const char *__path) throw ();
+
+
+
+extern int fchdir (int __fd) throw ();
+extern char *getcwd (char *__buf, size_t __size) throw ();
+
+
+
+
+
+extern char *get_current_dir_name (void) throw ();
+
+
+
+
+
+
+extern char *getwd (char *__buf) throw ();
+
+
+
+
+extern int dup (int __fd) throw ();
+
+
+extern int dup2 (int __fd, int __fd2) throw ();
+
+
+extern char **__environ;
+
+extern char **environ;
+
+
+
+
+
+extern int execve (__const char *__path, char *__const __argv[],
+                   char *__const __envp[]) throw ();
+
+
+
+
+extern int fexecve (int __fd, char *__const __argv[], char *__const __envp[])
+     throw ();
+
+
+
+
+extern int execv (__const char *__path, char *__const __argv[]) throw ();
+
+
+
+extern int execle (__const char *__path, __const char *__arg, ...) throw ();
+
+
+
+extern int execl (__const char *__path, __const char *__arg, ...) throw ();
+
+
+
+extern int execvp (__const char *__file, char *__const __argv[]) throw ();
+
+
+
+
+extern int execlp (__const char *__file, __const char *__arg, ...) throw ();
+
+
+
+
+extern int nice (int __inc) throw ();
+
+
+
+
+extern void _exit (int __status) __attribute__ ((__noreturn__));
+
+
+
+
+
+enum
+  {
+    _PC_LINK_MAX,
+    _PC_MAX_CANON,
+    _PC_MAX_INPUT,
+    _PC_NAME_MAX,
+    _PC_PATH_MAX,
+    _PC_PIPE_BUF,
+    _PC_CHOWN_RESTRICTED,
+    _PC_NO_TRUNC,
+    _PC_VDISABLE,
+    _PC_SYNC_IO,
+    _PC_ASYNC_IO,
+    _PC_PRIO_IO,
+    _PC_SOCK_MAXBUF,
+    _PC_FILESIZEBITS,
+    _PC_REC_INCR_XFER_SIZE,
+    _PC_REC_MAX_XFER_SIZE,
+    _PC_REC_MIN_XFER_SIZE,
+    _PC_REC_XFER_ALIGN,
+    _PC_ALLOC_SIZE_MIN,
+    _PC_SYMLINK_MAX
+  };
+
+
+enum
+  {
+    _SC_ARG_MAX,
+    _SC_CHILD_MAX,
+    _SC_CLK_TCK,
+    _SC_NGROUPS_MAX,
+    _SC_OPEN_MAX,
+    _SC_STREAM_MAX,
+    _SC_TZNAME_MAX,
+    _SC_JOB_CONTROL,
+    _SC_SAVED_IDS,
+    _SC_REALTIME_SIGNALS,
+    _SC_PRIORITY_SCHEDULING,
+    _SC_TIMERS,
+    _SC_ASYNCHRONOUS_IO,
+    _SC_PRIORITIZED_IO,
+    _SC_SYNCHRONIZED_IO,
+    _SC_FSYNC,
+    _SC_MAPPED_FILES,
+    _SC_MEMLOCK,
+    _SC_MEMLOCK_RANGE,
+    _SC_MEMORY_PROTECTION,
+    _SC_MESSAGE_PASSING,
+    _SC_SEMAPHORES,
+    _SC_SHARED_MEMORY_OBJECTS,
+    _SC_AIO_LISTIO_MAX,
+    _SC_AIO_MAX,
+    _SC_AIO_PRIO_DELTA_MAX,
+    _SC_DELAYTIMER_MAX,
+    _SC_MQ_OPEN_MAX,
+    _SC_MQ_PRIO_MAX,
+    _SC_VERSION,
+    _SC_PAGESIZE,
+    _SC_RTSIG_MAX,
+    _SC_SEM_NSEMS_MAX,
+    _SC_SEM_VALUE_MAX,
+    _SC_SIGQUEUE_MAX,
+    _SC_TIMER_MAX,
+
+
+
+    _SC_BC_BASE_MAX,
+    _SC_BC_DIM_MAX,
+    _SC_BC_SCALE_MAX,
+    _SC_BC_STRING_MAX,
+    _SC_COLL_WEIGHTS_MAX,
+    _SC_EQUIV_CLASS_MAX,
+    _SC_EXPR_NEST_MAX,
+    _SC_LINE_MAX,
+    _SC_RE_DUP_MAX,
+    _SC_CHARCLASS_NAME_MAX,
+
+    _SC_2_VERSION,
+    _SC_2_C_BIND,
+    _SC_2_C_DEV,
+    _SC_2_FORT_DEV,
+    _SC_2_FORT_RUN,
+    _SC_2_SW_DEV,
+    _SC_2_LOCALEDEF,
+
+    _SC_PII,
+    _SC_PII_XTI,
+    _SC_PII_SOCKET,
+    _SC_PII_INTERNET,
+    _SC_PII_OSI,
+    _SC_POLL,
+    _SC_SELECT,
+    _SC_UIO_MAXIOV,
+    _SC_IOV_MAX = _SC_UIO_MAXIOV,
+    _SC_PII_INTERNET_STREAM,
+    _SC_PII_INTERNET_DGRAM,
+    _SC_PII_OSI_COTS,
+    _SC_PII_OSI_CLTS,
+    _SC_PII_OSI_M,
+    _SC_T_IOV_MAX,
+
+
+    _SC_THREADS,
+    _SC_THREAD_SAFE_FUNCTIONS,
+    _SC_GETGR_R_SIZE_MAX,
+    _SC_GETPW_R_SIZE_MAX,
+    _SC_LOGIN_NAME_MAX,
+    _SC_TTY_NAME_MAX,
+    _SC_THREAD_DESTRUCTOR_ITERATIONS,
+    _SC_THREAD_KEYS_MAX,
+    _SC_THREAD_STACK_MIN,
+    _SC_THREAD_THREADS_MAX,
+    _SC_THREAD_ATTR_STACKADDR,
+    _SC_THREAD_ATTR_STACKSIZE,
+    _SC_THREAD_PRIORITY_SCHEDULING,
+    _SC_THREAD_PRIO_INHERIT,
+    _SC_THREAD_PRIO_PROTECT,
+    _SC_THREAD_PROCESS_SHARED,
+
+    _SC_NPROCESSORS_CONF,
+    _SC_NPROCESSORS_ONLN,
+    _SC_PHYS_PAGES,
+    _SC_AVPHYS_PAGES,
+    _SC_ATEXIT_MAX,
+    _SC_PASS_MAX,
+
+    _SC_XOPEN_VERSION,
+    _SC_XOPEN_XCU_VERSION,
+    _SC_XOPEN_UNIX,
+    _SC_XOPEN_CRYPT,
+    _SC_XOPEN_ENH_I18N,
+    _SC_XOPEN_SHM,
+
+    _SC_2_CHAR_TERM,
+    _SC_2_C_VERSION,
+    _SC_2_UPE,
+
+    _SC_XOPEN_XPG2,
+    _SC_XOPEN_XPG3,
+    _SC_XOPEN_XPG4,
+
+    _SC_CHAR_BIT,
+    _SC_CHAR_MAX,
+    _SC_CHAR_MIN,
+    _SC_INT_MAX,
+    _SC_INT_MIN,
+    _SC_LONG_BIT,
+    _SC_WORD_BIT,
+    _SC_MB_LEN_MAX,
+    _SC_NZERO,
+    _SC_SSIZE_MAX,
+    _SC_SCHAR_MAX,
+    _SC_SCHAR_MIN,
+    _SC_SHRT_MAX,
+    _SC_SHRT_MIN,
+    _SC_UCHAR_MAX,
+    _SC_UINT_MAX,
+    _SC_ULONG_MAX,
+    _SC_USHRT_MAX,
+
+    _SC_NL_ARGMAX,
+    _SC_NL_LANGMAX,
+    _SC_NL_MSGMAX,
+    _SC_NL_NMAX,
+    _SC_NL_SETMAX,
+    _SC_NL_TEXTMAX,
+
+    _SC_XBS5_ILP32_OFF32,
+    _SC_XBS5_ILP32_OFFBIG,
+    _SC_XBS5_LP64_OFF64,
+    _SC_XBS5_LPBIG_OFFBIG,
+
+    _SC_XOPEN_LEGACY,
+    _SC_XOPEN_REALTIME,
+    _SC_XOPEN_REALTIME_THREADS,
+
+    _SC_ADVISORY_INFO,
+    _SC_BARRIERS,
+    _SC_BASE,
+    _SC_C_LANG_SUPPORT,
+    _SC_C_LANG_SUPPORT_R,
+    _SC_CLOCK_SELECTION,
+    _SC_CPUTIME,
+    _SC_THREAD_CPUTIME,
+    _SC_DEVICE_IO,
+    _SC_DEVICE_SPECIFIC,
+    _SC_DEVICE_SPECIFIC_R,
+    _SC_FD_MGMT,
+    _SC_FIFO,
+    _SC_PIPE,
+    _SC_FILE_ATTRIBUTES,
+    _SC_FILE_LOCKING,
+    _SC_FILE_SYSTEM,
+    _SC_MONOTONIC_CLOCK,
+    _SC_MULTI_PROCESS,
+    _SC_SINGLE_PROCESS,
+    _SC_NETWORKING,
+    _SC_READER_WRITER_LOCKS,
+    _SC_SPIN_LOCKS,
+    _SC_REGEXP,
+    _SC_REGEX_VERSION,
+    _SC_SHELL,
+    _SC_SIGNALS,
+    _SC_SPAWN,
+    _SC_SPORADIC_SERVER,
+    _SC_THREAD_SPORADIC_SERVER,
+    _SC_SYSTEM_DATABASE,
+    _SC_SYSTEM_DATABASE_R,
+    _SC_TIMEOUTS,
+    _SC_TYPED_MEMORY_OBJECTS,
+    _SC_USER_GROUPS,
+    _SC_USER_GROUPS_R,
+    _SC_2_PBS,
+    _SC_2_PBS_ACCOUNTING,
+    _SC_2_PBS_LOCATE,
+    _SC_2_PBS_MESSAGE,
+    _SC_2_PBS_TRACK,
+    _SC_SYMLOOP_MAX,
+    _SC_STREAMS,
+    _SC_2_PBS_CHECKPOINT,
+
+    _SC_V6_ILP32_OFF32,
+    _SC_V6_ILP32_OFFBIG,
+    _SC_V6_LP64_OFF64,
+    _SC_V6_LPBIG_OFFBIG,
+
+    _SC_HOST_NAME_MAX,
+    _SC_TRACE,
+    _SC_TRACE_EVENT_FILTER,
+    _SC_TRACE_INHERIT,
+    _SC_TRACE_LOG
+  };
+
+
+enum
+  {
+    _CS_PATH,
+
+    _CS_V6_WIDTH_RESTRICTED_ENVS,
+
+    _CS_GNU_LIBC_VERSION,
+    _CS_GNU_LIBPTHREAD_VERSION,
+
+    _CS_LFS_CFLAGS = 1000,
+    _CS_LFS_LDFLAGS,
+    _CS_LFS_LIBS,
+    _CS_LFS_LINTFLAGS,
+    _CS_LFS64_CFLAGS,
+    _CS_LFS64_LDFLAGS,
+    _CS_LFS64_LIBS,
+    _CS_LFS64_LINTFLAGS,
+
+    _CS_XBS5_ILP32_OFF32_CFLAGS = 1100,
+    _CS_XBS5_ILP32_OFF32_LDFLAGS,
+    _CS_XBS5_ILP32_OFF32_LIBS,
+    _CS_XBS5_ILP32_OFF32_LINTFLAGS,
+    _CS_XBS5_ILP32_OFFBIG_CFLAGS,
+    _CS_XBS5_ILP32_OFFBIG_LDFLAGS,
+    _CS_XBS5_ILP32_OFFBIG_LIBS,
+    _CS_XBS5_ILP32_OFFBIG_LINTFLAGS,
+    _CS_XBS5_LP64_OFF64_CFLAGS,
+    _CS_XBS5_LP64_OFF64_LDFLAGS,
+    _CS_XBS5_LP64_OFF64_LIBS,
+    _CS_XBS5_LP64_OFF64_LINTFLAGS,
+    _CS_XBS5_LPBIG_OFFBIG_CFLAGS,
+    _CS_XBS5_LPBIG_OFFBIG_LDFLAGS,
+    _CS_XBS5_LPBIG_OFFBIG_LIBS,
+    _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,
+
+    _CS_POSIX_V6_ILP32_OFF32_CFLAGS,
+    _CS_POSIX_V6_ILP32_OFF32_LDFLAGS,
+    _CS_POSIX_V6_ILP32_OFF32_LIBS,
+    _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS,
+    _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS,
+    _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS,
+    _CS_POSIX_V6_ILP32_OFFBIG_LIBS,
+    _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS,
+    _CS_POSIX_V6_LP64_OFF64_CFLAGS,
+    _CS_POSIX_V6_LP64_OFF64_LDFLAGS,
+    _CS_POSIX_V6_LP64_OFF64_LIBS,
+    _CS_POSIX_V6_LP64_OFF64_LINTFLAGS,
+    _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS,
+    _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS,
+    _CS_POSIX_V6_LPBIG_OFFBIG_LIBS,
+    _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS
+  };
+
+
+extern long int pathconf (__const char *__path, int __name) throw ();
+
+
+extern long int fpathconf (int __fd, int __name) throw ();
+
+
+extern long int sysconf (int __name) throw () __attribute__ ((__const__));
+
+
+
+extern size_t confstr (int __name, char *__buf, size_t __len) throw ();
+
+
+
+
+extern __pid_t getpid (void) throw ();
+
+
+extern __pid_t getppid (void) throw ();
+
+
+
+
+extern __pid_t getpgrp (void) throw ();
+extern __pid_t __getpgid (__pid_t __pid) throw ();
+
+extern __pid_t getpgid (__pid_t __pid) throw ();
+
+
+
+
+
+
+extern int setpgid (__pid_t __pid, __pid_t __pgid) throw ();
+extern int setpgrp (void) throw ();
+extern __pid_t setsid (void) throw ();
+
+
+
+extern __pid_t getsid (__pid_t __pid) throw ();
+
+
+
+extern __uid_t getuid (void) throw ();
+
+
+extern __uid_t geteuid (void) throw ();
+
+
+extern __gid_t getgid (void) throw ();
+
+
+extern __gid_t getegid (void) throw ();
+
+
+
+
+extern int getgroups (int __size, __gid_t __list[]) throw ();
+
+
+
+extern int group_member (__gid_t __gid) throw ();
+
+
+
+
+
+
+extern int setuid (__uid_t __uid) throw ();
+
+
+
+
+extern int setreuid (__uid_t __ruid, __uid_t __euid) throw ();
+
+
+
+
+extern int seteuid (__uid_t __uid) throw ();
+
+
+
+
+
+
+extern int setgid (__gid_t __gid) throw ();
+
+
+
+
+extern int setregid (__gid_t __rgid, __gid_t __egid) throw ();
+
+
+
+
+extern int setegid (__gid_t __gid) throw ();
+
+
+
+
+
+extern int getresuid (__uid_t *__euid, __uid_t *__ruid, __uid_t *__suid);
+
+
+
+extern int getresgid (__gid_t *__egid, __gid_t *__rgid, __gid_t *__sgid);
+
+
+
+extern int setresuid (__uid_t __euid, __uid_t __ruid, __uid_t __suid);
+
+
+
+extern int setresgid (__gid_t __egid, __gid_t __rgid, __gid_t __sgid);
+
+
+
+
+
+
+extern __pid_t fork (void) throw ();
+
+
+
+
+
+
+extern __pid_t vfork (void) throw ();
+
+
+
+
+
+extern char *ttyname (int __fd) throw ();
+
+
+
+extern int ttyname_r (int __fd, char *__buf, size_t __buflen) throw ();
+
+
+
+extern int isatty (int __fd) throw ();
+
+
+
+
+
+extern int ttyslot (void) throw ();
+
+
+
+
+extern int link (__const char *__from, __const char *__to) throw ();
+
+
+
+extern int symlink (__const char *__from, __const char *__to) throw ();
+
+
+
+
+extern int readlink (__const char *__restrict __path, char *__restrict __buf,
+                     size_t __len) throw ();
+
+
+
+extern int unlink (__const char *__name) throw ();
+
+
+extern int rmdir (__const char *__path) throw ();
+
+
+
+extern __pid_t tcgetpgrp (int __fd) throw ();
+
+
+extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) throw ();
+
+
+
+extern char *getlogin (void) throw ();
+
+
+
+
+extern int getlogin_r (char *__name, size_t __name_len) throw ();
+
+
+
+
+extern int setlogin (__const char *__name) throw ();
+
+
+
+
+
+
+
+extern "C" {
+extern char *optarg;
+extern int optind;
+
+
+
+
+extern int opterr;
+
+
+
+extern int optopt;
+extern int getopt (int ___argc, char *const *___argv, const char *__shortopts);
+}
+
+
+
+
+
+
+
+
+
+
+extern int gethostname (char *__name, size_t __len) throw ();
+
+
+
+
+
+
+extern int sethostname (__const char *__name, size_t __len) throw ();
+
+
+
+extern int sethostid (long int __id) throw ();
+
+
+
+
+
+extern int getdomainname (char *__name, size_t __len) throw ();
+extern int setdomainname (__const char *__name, size_t __len) throw ();
+
+
+
+
+
+extern int vhangup (void) throw ();
+
+
+extern int revoke (__const char *__file) throw ();
+
+
+
+
+
+
+
+extern int profil (unsigned short int *__sample_buffer, size_t __size,
+                   size_t __offset, unsigned int __scale) throw ();
+
+
+
+
+
+extern int acct (__const char *__name) throw ();
+
+
+
+extern char *getusershell (void) throw ();
+extern void endusershell (void) throw ();
+extern void setusershell (void) throw ();
+
+
+
+
+
+extern int daemon (int __nochdir, int __noclose) throw ();
+
+
+
+
+
+
+extern int chroot (__const char *__path) throw ();
+
+
+
+extern char *getpass (__const char *__prompt) throw ();
+
+
+
+
+
+extern int fsync (int __fd) throw ();
+
+
+
+
+
+
+extern long int gethostid (void) throw ();
+
+
+extern void sync (void) throw ();
+
+
+
+
+extern int getpagesize (void) throw () __attribute__ ((__const__));
+
+
+
+
+extern int truncate (__const char *__file, __off_t __length) throw ();
+extern int truncate64 (__const char *__file, __off64_t __length) throw ();
+
+
+
+
+extern int ftruncate (int __fd, __off_t __length) throw ();
+extern int ftruncate64 (int __fd, __off64_t __length) throw ();
+
+
+
+
+
+extern int getdtablesize (void) throw ();
+extern int brk (void *__addr) throw ();
+
+
+
+
+
+extern void *sbrk (intptr_t __delta) throw ();
+extern long int syscall (long int __sysno, ...) throw ();
+extern int fdatasync (int __fildes) throw ();
+
+
+
+
+
+
+
+extern char *crypt (__const char *__key, __const char *__salt) throw ();
+
+
+
+extern void encrypt (char *__block, int __edflag) throw ();
+
+
+
+
+
+
+extern void swab (__const void *__restrict __from, void *__restrict __to,
+                  ssize_t __n) throw ();
+
+
+
+
+
+
+
+extern char *ctermid (char *__s) throw ();
+extern int pthread_atfork (void (*__prepare) (void),
+                           void (*__parent) (void),
+                           void (*__child) (void)) throw ();
+
+
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C" {
+extern void *mmap (void *__addr, size_t __len, int __prot,
+                   int __flags, int __fd, __off_t __offset) throw ();
+extern void *mmap64 (void *__addr, size_t __len, int __prot,
+                     int __flags, int __fd, __off64_t __offset) throw ();
+
+
+
+
+extern int munmap (void *__addr, size_t __len) throw ();
+
+
+
+
+extern int mprotect (void *__addr, size_t __len, int __prot) throw ();
+
+
+
+
+extern int msync (void *__addr, size_t __len, int __flags) throw ();
+
+
+
+
+extern int madvise (void *__addr, size_t __len, int __advice) throw ();
+
+
+
+extern int posix_madvise (void *__addr, size_t __len, int __advice) throw ();
+
+
+
+
+extern int mlock (__const void *__addr, size_t __len) throw ();
+
+
+extern int munlock (__const void *__addr, size_t __len) throw ();
+
+
+
+
+extern int mlockall (int __flags) throw ();
+
+
+
+extern int munlockall (void) throw ();
+
+
+
+
+
+extern void *mremap (void *__addr, size_t __old_len, size_t __new_len,
+                     int __may_move) throw ();
+
+
+
+
+
+
+extern int mincore (void *__start, size_t __len, unsigned char *__vec);
+
+
+
+
+extern int shm_open (__const char *__name, int __oflag, mode_t __mode);
+
+
+extern int shm_unlink (__const char *__name);
+
+}
+
+
+
+
+
+typedef Q_UINT32 nls_uint32;
+
+struct loaded_domain
+{
+  const char *data;
+
+  int use_mmap;
+  size_t mmap_size;
+
+  int must_swap;
+  nls_uint32 nstrings;
+  struct string_desc *orig_tab;
+  struct string_desc *trans_tab;
+  nls_uint32 hash_size;
+  nls_uint32 *hash_tab;
+};
+
+struct kde_loaded_l10nfile
+{
+  const char *filename;
+  int decided;
+
+  const void *data;
+
+  kde_loaded_l10nfile() : filename(0), decided(0), data(0) {}
+};
+
+void k_nl_load_domain(struct kde_loaded_l10nfile *__domain);
+
+static inline nls_uint32
+SWAP (nls_uint32 i)
+{
+  return (i << 24) | ((i & 0xff00) << 8) | ((i >> 8) & 0xff00) | (i >> 24);
+}
+
+
+
+
+
+
+
+
+
+
+
+static inline unsigned long hash_string (const char *__str_param);
+
+
+
+
+struct mo_file_header
+{
+
+  nls_uint32 magic;
+
+  nls_uint32 revision;
+
+  nls_uint32 nstrings;
+
+  nls_uint32 orig_tab_offset;
+
+  nls_uint32 trans_tab_offset;
+
+  nls_uint32 hash_tab_size;
+
+  nls_uint32 hash_tab_offset;
+};
+
+struct string_desc
+{
+
+  nls_uint32 length;
+
+  nls_uint32 offset;
+};
+
+
+char *k_nl_find_msg (struct kde_loaded_l10nfile *domain_file,
+                        const char *msgid);
+
+char *
+k_nl_find_msg (struct kde_loaded_l10nfile *domain_file, const char *msgid)
+{
+  size_t top, act, bottom;
+  struct loaded_domain *domain;
+
+  if (domain_file->decided == 0)
+    k_nl_load_domain (domain_file);
+
+  if (domain_file->data == __null)
+    return __null;
+
+  domain = (struct loaded_domain *) domain_file->data;
+
+
+  if (domain->hash_size > 2 && domain->hash_tab != __null)
+    {
+
+      nls_uint32 len = strlen (msgid);
+      nls_uint32 hash_val = hash_string (msgid);
+      nls_uint32 idx = hash_val % domain->hash_size;
+      nls_uint32 incr = 1 + (hash_val % (domain->hash_size - 2));
+      nls_uint32 nstr = ((domain->must_swap) ? SWAP (domain->hash_tab[idx]) : (domain->hash_tab[idx]));
+
+      if (nstr == 0)
+
+        return __null;
+
+      if (((domain->must_swap) ? SWAP (domain->orig_tab[nstr - 1].length) : (domain->orig_tab[nstr - 1].length)) == len
+          && strcmp (msgid,
+                     domain->data + ((domain->must_swap) ? SWAP (domain->orig_tab[nstr - 1].offset) : (domain->orig_tab[nstr - 1].offset))) == 0)
+
+        return (char *) domain->data + ((domain->must_swap) ? SWAP (domain->trans_tab[nstr - 1].offset) : (domain->trans_tab[nstr - 1].offset));
+
+
+      while (1)
+        {
+          if (idx >= domain->hash_size - incr)
+            idx -= domain->hash_size - incr;
+          else
+            idx += incr;
+
+          nstr = ((domain->must_swap) ? SWAP (domain->hash_tab[idx]) : (domain->hash_tab[idx]));
+          if (nstr == 0)
+
+            return __null;
+
+          if (((domain->must_swap) ? SWAP (domain->orig_tab[nstr - 1].length) : (domain->orig_tab[nstr - 1].length)) == len
+              && strcmp (msgid,
+                         domain->data + ((domain->must_swap) ? SWAP (domain->orig_tab[nstr - 1].offset) : (domain->orig_tab[nstr - 1].offset)))
+
+                 == 0)
+            return (char *) domain->data
+              + ((domain->must_swap) ? SWAP (domain->trans_tab[nstr - 1].offset) : (domain->trans_tab[nstr - 1].offset));
+        }
+
+    }
+
+
+
+  bottom = 0;
+  top = domain->nstrings;
+  act = top;
+  while (bottom < top)
+    {
+      int cmp_val;
+
+      act = (bottom + top) / 2;
+      cmp_val = strcmp (msgid, domain->data
+                               + ((domain->must_swap) ? SWAP (domain->orig_tab[act].offset) : (domain->orig_tab[act].offset)));
+
+      if (cmp_val < 0)
+        top = act;
+      else if (cmp_val > 0)
+        bottom = act + 1;
+      else
+        break;
+    }
+
+
+  return bottom >= top ? __null : (char *) domain->data
+                                + ((domain->must_swap) ? SWAP (domain->trans_tab[act].offset) : (domain->trans_tab[act].offset));
+
+}
+
+
+
+
+static inline unsigned long
+hash_string (const char *str_param)
+{
+  unsigned long int hval, g;
+  const char *str = str_param;
+
+
+  hval = 0;
+  while (*str != '\0')
+    {
+      hval <<= 4;
+      hval += (unsigned long) *str++;
+      g = hval & ((unsigned long) 0xf << (32 - 4));
+      if (g != 0)
+        {
+          hval ^= g >> (32 - 8);
+          hval ^= g;
+        }
+    }
+  return hval;
+}
+
+
+
+void
+k_nl_load_domain (struct kde_loaded_l10nfile *domain_file)
+{
+  int fd;
+  struct stat st;
+  struct mo_file_header *data = (struct mo_file_header *) -1;
+
+  int use_mmap = 0;
+
+  struct loaded_domain *domain;
+
+  domain_file->decided = 1;
+  domain_file->data = __null;
+
+
+
+
+
+  if (domain_file->filename == __null)
+    return;
+
+
+  fd = open (domain_file->filename, 00);
+  if (fd == -1)
+    return;
+
+
+  if (fstat (fd, &st) != 0
+      || st.st_size < (off_t) sizeof (struct mo_file_header))
+    {
+
+      close (fd);
+      return;
+    }
+
+
+
+
+  data = (struct mo_file_header *) mmap (__null, st.st_size, 0x1,
+                                         0x02, fd, 0);
+
+  if (data != (struct mo_file_header *) -1)
+    {
+
+      close (fd);
+      use_mmap = 1;
+    }
+
+
+
+
+  if (data == (struct mo_file_header *) -1)
+    {
+      off_t to_read;
+      char *read_ptr;
+
+      data = (struct mo_file_header *) malloc (st.st_size);
+      if (data == __null)
+        return;
+
+      to_read = st.st_size;
+      read_ptr = (char *) data;
+      do
+        {
+          long int nb = (long int) read (fd, read_ptr, to_read);
+          if (nb == -1)
+            {
+              close (fd);
+              return;
+            }
+
+          read_ptr += nb;
+          to_read -= nb;
+        }
+      while (to_read > 0);
+
+      close (fd);
+    }
+
+
+
+  if (data->magic != 0x950412de && data->magic != 0xde120495)
+    {
+
+
+      if (use_mmap)
+        munmap ((char *) data, st.st_size);
+      else
+
+        free (data);
+      return;
+    }
+
+  domain_file->data
+    = (struct loaded_domain *) malloc (sizeof (struct loaded_domain));
+  if (domain_file->data == __null)
+    return;
+
+  domain = (struct loaded_domain *) domain_file->data;
+  domain->data = (char *) data;
+
+  domain->use_mmap = use_mmap;
+  domain->mmap_size = st.st_size;
+
+  domain->must_swap = data->magic != 0x950412de;
+
+
+  switch (((domain->must_swap) ? SWAP (data->revision) : (data->revision)))
+    {
+    case 0:
+      domain->nstrings = ((domain->must_swap) ? SWAP (data->nstrings) : (data->nstrings));
+      domain->orig_tab = (struct string_desc *)
+        ((char *) data + ((domain->must_swap) ? SWAP (data->orig_tab_offset) : (data->orig_tab_offset)));
+      domain->trans_tab = (struct string_desc *)
+        ((char *) data + ((domain->must_swap) ? SWAP (data->trans_tab_offset) : (data->trans_tab_offset)));
+      domain->hash_size = ((domain->must_swap) ? SWAP (data->hash_tab_size) : (data->hash_tab_size));
+      domain->hash_tab = (nls_uint32 *)
+        ((char *) data + ((domain->must_swap) ? SWAP (data->hash_tab_offset) : (data->hash_tab_offset)));
+      break;
+    default:
+
+
+      if (use_mmap)
+        munmap ((char *) data, st.st_size);
+      else
+
+        free (data);
+      free (domain);
+      domain_file->data = __null;
+      return;
+    }
+}
+
+void
+k_nl_unload_domain (struct loaded_domain *domain)
+{
+
+  if (domain->use_mmap)
+    munmap ((caddr_t) domain->data, domain->mmap_size);
+  else
+
+    free ((void *) domain->data);
+
+  free (domain);
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C"
+
+int mkstemps(char *, int);
+extern "C"
+
+unsigned long strlcat(char*, const char*, unsigned long);
+
+
+
+
+
+
+extern "C"
+
+unsigned long strlcpy(char*, const char*, unsigned long);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct QUObject;
+
+
+
+
+
+class QObject;
+class QMetaObject;
+class QSignal;
+class QConnection;
+class QEvent;
+struct QMetaData;
+class QConnectionList;
+class QConnectionListIt;
+class QSignalVec;
+class QObjectList;
+class QObjectListIt;
+class QMemberDict;
+
+ void *qt_find_obj_child( QObject *, const char *, const char * );
+
+
+ void *qt_inheritedBy( QMetaObject *super, const QObject *cls );
+template <typename T>
+ T qt_cast(const QObject *object)
+{ return (T)qt_inheritedBy( ((T)0)->staticMetaObject(), object ); }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct QShared
+{
+    QShared() : count( 1 ) { }
+    void ref() { count++; }
+    bool deref() { return !--count; }
+    uint count;
+};
+
+
+
+class QGArray
+{
+friend class QBuffer;
+public:
+
+
+    struct array_data : public QShared {
+        array_data():data(0),len(0)
+
+
+
+            {}
+        char *data;
+        uint len;
+
+
+
+    };
+    QGArray();
+    enum Optimization { MemOptim, SpeedOptim };
+protected:
+    QGArray( int, int );
+    QGArray( int size );
+    QGArray( const QGArray &a );
+    virtual ~QGArray();
+
+    QGArray &operator=( const QGArray &a ) { return assign( a ); }
+
+    virtual void detach() { duplicate(*this); }
+
+
+    char *data() const { return shd->data; }
+    uint nrefs() const { return shd->count; }
+    uint size() const { return shd->len; }
+    bool isEqual( const QGArray &a ) const;
+
+    bool resize( uint newsize, Optimization optim );
+    bool resize( uint newsize );
+
+    bool fill( const char *d, int len, uint sz );
+
+    QGArray &assign( const QGArray &a );
+    QGArray &assign( const char *d, uint len );
+    QGArray &duplicate( const QGArray &a );
+    QGArray &duplicate( const char *d, uint len );
+    void store( const char *d, uint len );
+
+    array_data *sharedBlock() const { return shd; }
+    void setSharedBlock( array_data *p ) { shd=(array_data*)p; }
+
+    QGArray &setRawData( const char *d, uint len );
+    void resetRawData( const char *d, uint len );
+
+    int find( const char *d, uint index, uint sz ) const;
+    int contains( const char *d, uint sz ) const;
+
+    void sort( uint sz );
+    int bsearch( const char *d, uint sz ) const;
+
+    char *at( uint index ) const;
+
+    bool setExpand( uint index, const char *d, uint sz );
+
+protected:
+    virtual array_data *newData();
+    virtual void deleteData( array_data *p );
+
+private:
+    static void msg_index( uint );
+    array_data *shd;
+};
+
+
+inline char *QGArray::at( uint index ) const
+{
+
+    if ( index >= size() ) {
+        msg_index( index );
+        index = 0;
+    }
+
+    return &shd->data[index];
+}
+
+
+
+template<class type>
+class QMemArray : public QGArray
+{
+public:
+    typedef type* Iterator;
+    typedef const type* ConstIterator;
+    typedef type ValueType;
+
+protected:
+    QMemArray( int, int ) : QGArray( 0, 0 ) {}
+
+public:
+    QMemArray() {}
+    QMemArray( int size ) : QGArray(size*sizeof(type)) {}
+    QMemArray( const QMemArray<type> &a ) : QGArray(a) {}
+   ~QMemArray() {}
+    QMemArray<type> &operator=(const QMemArray<type> &a)
+                                { return (QMemArray<type>&)QGArray::assign(a); }
+    type *data() const { return (type *)QGArray::data(); }
+    uint nrefs() const { return QGArray::nrefs(); }
+    uint size() const { return QGArray::size()/sizeof(type); }
+    uint count() const { return size(); }
+    bool isEmpty() const { return QGArray::size() == 0; }
+    bool isNull() const { return QGArray::data() == 0; }
+    bool resize( uint size ) { return QGArray::resize(size*sizeof(type)); }
+    bool resize( uint size, Optimization optim ) { return QGArray::resize(size*sizeof(type), optim); }
+    bool truncate( uint pos ) { return QGArray::resize(pos*sizeof(type)); }
+    bool fill( const type &d, int size = -1 )
+        { return QGArray::fill((char*)&d,size,sizeof(type) ); }
+    void detach() { QGArray::detach(); }
+    QMemArray<type> copy() const
+        { QMemArray<type> tmp; return tmp.duplicate(*this); }
+    QMemArray<type>& assign( const QMemArray<type>& a )
+        { return (QMemArray<type>&)QGArray::assign(a); }
+    QMemArray<type>& assign( const type *a, uint n )
+        { return (QMemArray<type>&)QGArray::assign((char*)a,n*sizeof(type)); }
+    QMemArray<type>& duplicate( const QMemArray<type>& a )
+        { return (QMemArray<type>&)QGArray::duplicate(a); }
+    QMemArray<type>& duplicate( const type *a, uint n )
+        { return (QMemArray<type>&)QGArray::duplicate((char*)a,n*sizeof(type)); }
+    QMemArray<type>& setRawData( const type *a, uint n )
+        { return (QMemArray<type>&)QGArray::setRawData((char*)a,
+                                                     n*sizeof(type)); }
+    void resetRawData( const type *a, uint n )
+        { QGArray::resetRawData((char*)a,n*sizeof(type)); }
+    int find( const type &d, uint i=0 ) const
+        { return QGArray::find((char*)&d,i,sizeof(type)); }
+    int contains( const type &d ) const
+        { return QGArray::contains((char*)&d,sizeof(type)); }
+    void sort() { QGArray::sort(sizeof(type)); }
+    int bsearch( const type &d ) const
+        { return QGArray::bsearch((const char*)&d,sizeof(type)); }
+
+    type& operator[]( int i ) const
+        { return (type &)(*(type *)QGArray::at(i*sizeof(type))); }
+    type& at( uint i ) const
+        { return (type &)(*(type *)QGArray::at(i*sizeof(type))); }
+         operator const type*() const { return (const type *)QGArray::data(); }
+    bool operator==( const QMemArray<type> &a ) const { return isEqual(a); }
+    bool operator!=( const QMemArray<type> &a ) const { return !isEqual(a); }
+    Iterator begin() { return data(); }
+    Iterator end() { return data() + size(); }
+    ConstIterator begin() const { return data(); }
+    ConstIterator end() const { return data() + size(); }
+};
+
+
+
+
+
+ void *qmemmove( void *dst, const void *src, uint len );
+
+ char *qstrdup( const char * );
+
+ inline uint qstrlen( const char *str )
+{ return str ? (uint)strlen(str) : 0u; }
+
+ inline char *qstrcpy( char *dst, const char *src )
+{ return src ? strcpy(dst, src) : 0; }
+
+ char *qstrncpy( char *dst, const char *src, uint len );
+
+ inline int qstrcmp( const char *str1, const char *str2 )
+{
+    return ( str1 && str2 ) ? strcmp( str1, str2 )
+                            : ( str1 ? 1 : ( str2 ? -1 : 0 ) );
+}
+
+ inline int qstrncmp( const char *str1, const char *str2, uint len )
+{
+    return ( str1 && str2 ) ? strncmp( str1, str2, len )
+                            : ( str1 ? 1 : ( str2 ? -1 : 0 ) );
+}
+
+ int qstricmp( const char *, const char * );
+
+ int qstrnicmp( const char *, const char *, uint len );
+ Q_UINT16 qChecksum( const char *s, uint len );
+typedef QMemArray<char> QByteArray;
+
+
+
+ QByteArray qCompress( const uchar* data, int nbytes );
+ QByteArray qUncompress( const uchar* data, int nbytes );
+ inline QByteArray qCompress( const QByteArray& data)
+{ return qCompress( (const uchar*)data.data(), data.size() ); }
+ inline QByteArray qUncompress( const QByteArray& data )
+{ return qUncompress( (const uchar*)data.data(), data.size() ); }
+
+
+
+
+
+
+ QDataStream &operator<<( QDataStream &, const QByteArray & );
+ QDataStream &operator>>( QDataStream &, QByteArray & );
+
+
+
+
+
+
+class QRegExp;
+
+class QCString : public QByteArray
+{
+public:
+    QCString() {}
+    QCString( int size );
+    QCString( const QCString &s ) : QByteArray( s ) {}
+    QCString( const char *str );
+    QCString( const char *str, uint maxlen );
+    ~QCString();
+
+    QCString &operator=( const QCString &s );
+    QCString &operator=( const char *str );
+
+    bool isNull() const;
+    bool isEmpty() const;
+    uint length() const;
+    bool resize( uint newlen );
+    bool truncate( uint pos );
+    bool fill( char c, int len = -1 );
+
+    QCString copy() const;
+
+    QCString &sprintf( const char *format, ... );
+
+    int find( char c, int index=0, bool cs=TRUE ) const;
+    int find( const char *str, int index=0, bool cs=TRUE ) const;
+
+    int find( const QRegExp &, int index=0 ) const;
+
+    int findRev( char c, int index=-1, bool cs=TRUE) const;
+    int findRev( const char *str, int index=-1, bool cs=TRUE) const;
+
+    int findRev( const QRegExp &, int index=-1 ) const;
+
+    int contains( char c, bool cs=TRUE ) const;
+    int contains( const char *str, bool cs=TRUE ) const;
+
+    int contains( const QRegExp & ) const;
+
+    QCString left( uint len ) const;
+    QCString right( uint len ) const;
+    QCString mid( uint index, uint len=0xffffffff) const;
+
+    QCString leftJustify( uint width, char fill=' ', bool trunc=FALSE)const;
+    QCString rightJustify( uint width, char fill=' ',bool trunc=FALSE)const;
+
+    QCString lower() const;
+    QCString upper() const;
+
+    QCString stripWhiteSpace() const;
+    QCString simplifyWhiteSpace() const;
+
+    QCString &insert( uint index, const char * );
+    QCString &insert( uint index, char );
+    QCString &append( const char * );
+    QCString &prepend( const char * );
+    QCString &remove( uint index, uint len );
+    QCString &replace( uint index, uint len, const char * );
+
+    QCString &replace( const QRegExp &, const char * );
+
+    QCString &replace( char c, const char *after );
+    QCString &replace( const char *, const char * );
+    QCString &replace( char, char );
+
+    short toShort( bool *ok=0 ) const;
+    ushort toUShort( bool *ok=0 ) const;
+    int toInt( bool *ok=0 ) const;
+    uint toUInt( bool *ok=0 ) const;
+    long toLong( bool *ok=0 ) const;
+    ulong toULong( bool *ok=0 ) const;
+    float toFloat( bool *ok=0 ) const;
+    double toDouble( bool *ok=0 ) const;
+
+    QCString &setStr( const char *s );
+    QCString &setNum( short );
+    QCString &setNum( ushort );
+    QCString &setNum( int );
+    QCString &setNum( uint );
+    QCString &setNum( long );
+    QCString &setNum( ulong );
+    QCString &setNum( float, char f='g', int prec=6 );
+    QCString &setNum( double, char f='g', int prec=6 );
+
+    bool setExpand( uint index, char c );
+
+                operator const char *() const;
+    QCString &operator+=( const char *str );
+    QCString &operator+=( char c );
+private:
+    int find( const char *str, int index, bool cs, uint l ) const;
+};
+
+
+
+
+
+
+ QDataStream &operator<<( QDataStream &, const QCString & );
+ QDataStream &operator>>( QDataStream &, QCString & );
+
+
+
+
+
+
+inline QCString &QCString::operator=( const QCString &s )
+{ return (QCString&)assign( s ); }
+
+inline QCString &QCString::operator=( const char *str )
+{ return (QCString&)duplicate( str, qstrlen(str)+1 ); }
+
+inline bool QCString::isNull() const
+{ return data() == 0; }
+
+inline bool QCString::isEmpty() const
+{ return data() == 0 || *data() == '\0'; }
+
+inline uint QCString::length() const
+{ return qstrlen( data() ); }
+
+inline bool QCString::truncate( uint pos )
+{ return resize(pos+1); }
+
+inline QCString QCString::copy() const
+{ return QCString( data() ); }
+
+inline QCString &QCString::prepend( const char *s )
+{ return insert(0,s); }
+
+inline QCString &QCString::append( const char *s )
+{ return operator+=(s); }
+
+inline QCString &QCString::setNum( short n )
+{ return setNum((long)n); }
+
+inline QCString &QCString::setNum( ushort n )
+{ return setNum((ulong)n); }
+
+inline QCString &QCString::setNum( int n )
+{ return setNum((long)n); }
+
+inline QCString &QCString::setNum( uint n )
+{ return setNum((ulong)n); }
+
+inline QCString &QCString::setNum( float n, char f, int prec )
+{ return setNum((double)n,f,prec); }
+
+inline QCString::operator const char *() const
+{ return (const char *)data(); }
+
+
+
+
+
+
+ inline bool operator==( const QCString &s1, const QCString &s2 )
+{ return qstrcmp( s1.data(), s2.data() ) == 0; }
+
+ inline bool operator==( const QCString &s1, const char *s2 )
+{ return qstrcmp( s1.data(), s2 ) == 0; }
+
+ inline bool operator==( const char *s1, const QCString &s2 )
+{ return qstrcmp( s1, s2.data() ) == 0; }
+
+ inline bool operator!=( const QCString &s1, const QCString &s2 )
+{ return qstrcmp( s1.data(), s2.data() ) != 0; }
+
+ inline bool operator!=( const QCString &s1, const char *s2 )
+{ return qstrcmp( s1.data(), s2 ) != 0; }
+
+ inline bool operator!=( const char *s1, const QCString &s2 )
+{ return qstrcmp( s1, s2.data() ) != 0; }
+
+ inline bool operator<( const QCString &s1, const QCString& s2 )
+{ return qstrcmp( s1.data(), s2.data() ) < 0; }
+
+ inline bool operator<( const QCString &s1, const char *s2 )
+{ return qstrcmp( s1.data(), s2 ) < 0; }
+
+ inline bool operator<( const char *s1, const QCString &s2 )
+{ return qstrcmp( s1, s2.data() ) < 0; }
+
+ inline bool operator<=( const QCString &s1, const QCString &s2 )
+{ return qstrcmp( s1.data(), s2.data() ) <= 0; }
+
+ inline bool operator<=( const QCString &s1, const char *s2 )
+{ return qstrcmp( s1.data(), s2 ) <= 0; }
+
+ inline bool operator<=( const char *s1, const QCString &s2 )
+{ return qstrcmp( s1, s2.data() ) <= 0; }
+
+ inline bool operator>( const QCString &s1, const QCString &s2 )
+{ return qstrcmp( s1.data(), s2.data() ) > 0; }
+
+ inline bool operator>( const QCString &s1, const char *s2 )
+{ return qstrcmp( s1.data(), s2 ) > 0; }
+
+ inline bool operator>( const char *s1, const QCString &s2 )
+{ return qstrcmp( s1, s2.data() ) > 0; }
+
+ inline bool operator>=( const QCString &s1, const QCString& s2 )
+{ return qstrcmp( s1.data(), s2.data() ) >= 0; }
+
+ inline bool operator>=( const QCString &s1, const char *s2 )
+{ return qstrcmp( s1.data(), s2 ) >= 0; }
+
+ inline bool operator>=( const char *s1, const QCString &s2 )
+{ return qstrcmp( s1, s2.data() ) >= 0; }
+
+ inline const QCString operator+( const QCString &s1,
+                                          const QCString &s2 )
+{
+    QCString tmp( s1.data() );
+    tmp += s2;
+    return tmp;
+}
+
+ inline const QCString operator+( const QCString &s1, const char *s2 )
+{
+    QCString tmp( s1.data() );
+    tmp += s2;
+    return tmp;
+}
+
+ inline const QCString operator+( const char *s1, const QCString &s2 )
+{
+    QCString tmp( s1 );
+    tmp += s2;
+    return tmp;
+}
+
+ inline const QCString operator+( const QCString &s1, char c2 )
+{
+    QCString tmp( s1.data() );
+    tmp += c2;
+    return tmp;
+}
+
+ inline const QCString operator+( char c1, const QCString &s2 )
+{
+    QCString tmp;
+    tmp += c1;
+    tmp += s2;
+    return tmp;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+class QRegExp;
+class QString;
+class QCharRef;
+template <class T> class QDeepCopy;
+
+class QChar {
+public:
+    QChar();
+    QChar( char c );
+    QChar( uchar c );
+    QChar( uchar c, uchar r );
+    QChar( const QChar& c );
+    QChar( ushort rc );
+    QChar( short rc );
+    QChar( uint rc );
+    QChar( int rc );
+
+    static const QChar null;
+    static const QChar replacement;
+    static const QChar byteOrderMark;
+    static const QChar byteOrderSwapped;
+    static const QChar nbsp;
+
+
+
+    enum Category
+    {
+        NoCategory,
+
+        Mark_NonSpacing,
+        Mark_SpacingCombining,
+        Mark_Enclosing,
+
+        Number_DecimalDigit,
+        Number_Letter,
+        Number_Other,
+
+        Separator_Space,
+        Separator_Line,
+        Separator_Paragraph,
+
+        Other_Control,
+        Other_Format,
+        Other_Surrogate,
+        Other_PrivateUse,
+        Other_NotAssigned,
+
+        Letter_Uppercase,
+        Letter_Lowercase,
+        Letter_Titlecase,
+        Letter_Modifier,
+        Letter_Other,
+
+        Punctuation_Connector,
+        Punctuation_Dash,
+        Punctuation_Dask = Punctuation_Dash,
+        Punctuation_Open,
+        Punctuation_Close,
+        Punctuation_InitialQuote,
+        Punctuation_FinalQuote,
+        Punctuation_Other,
+
+        Symbol_Math,
+        Symbol_Currency,
+        Symbol_Modifier,
+        Symbol_Other
+    };
+
+    enum Direction
+    {
+        DirL, DirR, DirEN, DirES, DirET, DirAN, DirCS, DirB, DirS, DirWS, DirON,
+        DirLRE, DirLRO, DirAL, DirRLE, DirRLO, DirPDF, DirNSM, DirBN
+    };
+
+    enum Decomposition
+    {
+        Single, Canonical, Font, NoBreak, Initial, Medial,
+        Final, Isolated, Circle, Super, Sub, Vertical,
+        Wide, Narrow, Small, Square, Compat, Fraction
+    };
+
+    enum Joining
+    {
+        OtherJoining, Dual, Right, Center
+    };
+
+    enum CombiningClass
+    {
+        Combining_BelowLeftAttached = 200,
+        Combining_BelowAttached = 202,
+        Combining_BelowRightAttached = 204,
+        Combining_LeftAttached = 208,
+        Combining_RightAttached = 210,
+        Combining_AboveLeftAttached = 212,
+        Combining_AboveAttached = 214,
+        Combining_AboveRightAttached = 216,
+
+        Combining_BelowLeft = 218,
+        Combining_Below = 220,
+        Combining_BelowRight = 222,
+        Combining_Left = 224,
+        Combining_Right = 226,
+        Combining_AboveLeft = 228,
+        Combining_Above = 230,
+        Combining_AboveRight = 232,
+
+        Combining_DoubleBelow = 233,
+        Combining_DoubleAbove = 234,
+        Combining_IotaSubscript = 240
+    };
+
+
+
+    int digitValue() const;
+    QChar lower() const;
+    QChar upper() const;
+
+    Category category() const;
+    Direction direction() const;
+    Joining joining() const;
+    bool mirrored() const;
+    QChar mirroredChar() const;
+    const QString &decomposition() const;
+    Decomposition decompositionTag() const;
+    unsigned char combiningClass() const;
+
+    char latin1() const { return ucs > 0xff ? 0 : (char) ucs; }
+    ushort unicode() const { return ucs; }
+    ushort &unicode() { return ucs; }
+
+
+    operator char() const { return latin1(); }
+
+
+    bool isNull() const { return unicode()==0; }
+    bool isPrint() const;
+    bool isPunct() const;
+    bool isSpace() const;
+    bool isMark() const;
+    bool isLetter() const;
+    bool isNumber() const;
+    bool isLetterOrNumber() const;
+    bool isDigit() const;
+    bool isSymbol() const;
+
+    uchar cell() const { return ((uchar) ucs & 0xff); }
+    uchar row() const { return ((uchar) (ucs>>8)&0xff); }
+    void setCell( uchar cell ) { ucs = (ucs & 0xff00) + cell; }
+    void setRow( uchar row ) { ucs = (((ushort) row)<<8) + (ucs&0xff); }
+
+    static bool networkOrdered() {
+        int wordSize;
+        bool bigEndian = FALSE;
+        qSysInfo( &wordSize, &bigEndian );
+        return bigEndian;
+    }
+
+    friend inline bool operator==( char ch, QChar c );
+    friend inline bool operator==( QChar c, char ch );
+    friend inline bool operator==( QChar c1, QChar c2 );
+    friend inline bool operator!=( QChar c1, QChar c2 );
+    friend inline bool operator!=( char ch, QChar c );
+    friend inline bool operator!=( QChar c, char ch );
+    friend inline bool operator<=( QChar c, char ch );
+    friend inline bool operator<=( char ch, QChar c );
+    friend inline bool operator<=( QChar c1, QChar c2 );
+
+private:
+    ushort ucs;
+
+
+
+} ;
+
+inline QChar::QChar() : ucs( 0 )
+
+
+
+{
+}
+inline QChar::QChar( char c ) : ucs( (uchar)c )
+
+
+
+{
+}
+inline QChar::QChar( uchar c ) : ucs( c )
+
+
+
+{
+}
+inline QChar::QChar( uchar c, uchar r ) : ucs( (r << 8) | c )
+
+
+
+{
+}
+inline QChar::QChar( const QChar& c ) : ucs( c.ucs )
+
+
+
+{
+}
+
+inline QChar::QChar( ushort rc ) : ucs( rc )
+
+
+
+{
+}
+inline QChar::QChar( short rc ) : ucs( (ushort) rc )
+
+
+
+{
+}
+inline QChar::QChar( uint rc ) : ucs( (ushort ) (rc & 0xffff) )
+
+
+
+{
+}
+inline QChar::QChar( int rc ) : ucs( (ushort) (rc & 0xffff) )
+
+
+
+{
+}
+
+inline bool operator==( char ch, QChar c )
+{
+    return ((uchar) ch) == c.ucs;
+}
+
+inline bool operator==( QChar c, char ch )
+{
+    return ((uchar) ch) == c.ucs;
+}
+
+inline bool operator==( QChar c1, QChar c2 )
+{
+    return c1.ucs == c2.ucs;
+}
+
+inline bool operator!=( QChar c1, QChar c2 )
+{
+    return c1.ucs != c2.ucs;
+}
+
+inline bool operator!=( char ch, QChar c )
+{
+    return ((uchar)ch) != c.ucs;
+}
+
+inline bool operator!=( QChar c, char ch )
+{
+    return ((uchar) ch) != c.ucs;
+}
+
+inline bool operator<=( QChar c, char ch )
+{
+    return c.ucs <= ((uchar) ch);
+}
+
+inline bool operator<=( char ch, QChar c )
+{
+    return ((uchar) ch) <= c.ucs;
+}
+
+inline bool operator<=( QChar c1, QChar c2 )
+{
+    return c1.ucs <= c2.ucs;
+}
+
+inline bool operator>=( QChar c, char ch ) { return ch <= c; }
+inline bool operator>=( char ch, QChar c ) { return c <= ch; }
+inline bool operator>=( QChar c1, QChar c2 ) { return c2 <= c1; }
+inline bool operator<( QChar c, char ch ) { return !(ch<=c); }
+inline bool operator<( char ch, QChar c ) { return !(c<=ch); }
+inline bool operator<( QChar c1, QChar c2 ) { return !(c2<=c1); }
+inline bool operator>( QChar c, char ch ) { return !(ch>=c); }
+inline bool operator>( char ch, QChar c ) { return !(c>=ch); }
+inline bool operator>( QChar c1, QChar c2 ) { return !(c2>=c1); }
+
+
+struct QStringData : public QShared {
+    QStringData() :
+        QShared(), unicode(0), ascii(0), len(0), issimpletext(TRUE), maxl(0), islatin1(FALSE) { ref(); }
+    QStringData(QChar *u, uint l, uint m) :
+        QShared(), unicode(u), ascii(0), len(l), issimpletext(FALSE), maxl(m), islatin1(FALSE) { }
+    ~QStringData() { if ( unicode ) delete[] ((char*)unicode);
+                     if ( ascii ) delete[] ascii; }
+
+    void deleteSelf();
+    QChar *unicode;
+    char *ascii;
+    void setDirty() {
+        if ( ascii ) {
+            delete [] ascii;
+            ascii = 0;
+        }
+        issimpletext = FALSE;
+    }
+
+
+
+    uint len : 30;
+
+    uint issimpletext : 1;
+
+
+
+    uint maxl : 30;
+
+    uint islatin1 : 1;
+
+private:
+
+    QStringData( const QStringData& );
+    QStringData& operator=( const QStringData& );
+
+};
+
+
+class QString
+{
+public:
+    QString();
+    QString( QChar );
+    QString( const QString & );
+    QString( const QByteArray& );
+    QString( const QChar* unicode, uint length );
+
+    QString( const char *str );
+
+
+
+
+    ~QString();
+
+    QString &operator=( const QString & );
+    QString &operator=( const char * );
+
+
+
+    QString &operator=( const QCString& );
+    QString &operator=( QChar c );
+    QString &operator=( char c );
+
+    static const QString null;
+
+    bool isNull() const;
+    bool isEmpty() const;
+    uint length() const;
+    void truncate( uint pos );
+
+    QString & fill( QChar c, int len = -1 );
+
+    QString copy() const;
+
+    QString arg( long a, int fieldWidth = 0, int base = 10 ) const;
+    QString arg( ulong a, int fieldWidth = 0, int base = 10 ) const;
+    QString arg( Q_LLONG a, int fieldwidth=0, int base=10 ) const;
+    QString arg( Q_ULLONG a, int fieldwidth=0, int base=10 ) const;
+    QString arg( int a, int fieldWidth = 0, int base = 10 ) const;
+    QString arg( uint a, int fieldWidth = 0, int base = 10 ) const;
+    QString arg( short a, int fieldWidth = 0, int base = 10 ) const;
+    QString arg( ushort a, int fieldWidth = 0, int base = 10 ) const;
+    QString arg( double a, int fieldWidth = 0, char fmt = 'g',
+                 int prec = -1 ) const;
+    QString arg( char a, int fieldWidth = 0 ) const;
+    QString arg( QChar a, int fieldWidth = 0 ) const;
+    QString arg( const QString& a, int fieldWidth = 0 ) const;
+    QString arg( const QString& a1, const QString& a2 ) const;
+    QString arg( const QString& a1, const QString& a2,
+                 const QString& a3 ) const;
+    QString arg( const QString& a1, const QString& a2, const QString& a3,
+                 const QString& a4 ) const;
+
+
+    QString &sprintf( const char* format, ... )
+
+        __attribute__ ((format (printf, 2, 3)))
+
+        ;
+
+
+    int find( QChar c, int index=0, bool cs=TRUE ) const;
+    int find( char c, int index=0, bool cs=TRUE ) const;
+    int find( const QString &str, int index=0, bool cs=TRUE ) const;
+
+    int find( const QRegExp &, int index=0 ) const;
+
+
+    int find( const char* str, int index=0 ) const;
+
+    int findRev( QChar c, int index=-1, bool cs=TRUE) const;
+    int findRev( char c, int index=-1, bool cs=TRUE) const;
+    int findRev( const QString &str, int index=-1, bool cs=TRUE) const;
+
+    int findRev( const QRegExp &, int index=-1 ) const;
+
+
+    int findRev( const char* str, int index=-1 ) const;
+
+    int contains( QChar c, bool cs=TRUE ) const;
+    int contains( char c, bool cs=TRUE ) const
+                    { return contains(QChar(c), cs); }
+
+    int contains( const char* str, bool cs=TRUE ) const;
+
+    int contains( const QString &str, bool cs=TRUE ) const;
+
+    int contains( const QRegExp & ) const;
+
+
+    enum SectionFlags {
+        SectionDefault = 0x00,
+        SectionSkipEmpty = 0x01,
+        SectionIncludeLeadingSep = 0x02,
+        SectionIncludeTrailingSep = 0x04,
+        SectionCaseInsensitiveSeps = 0x08
+    };
+    QString section( QChar sep, int start, int end = 0xffffffff, int flags = SectionDefault ) const;
+    QString section( char sep, int start, int end = 0xffffffff, int flags = SectionDefault ) const;
+
+    QString section( const char *in_sep, int start, int end = 0xffffffff, int flags = SectionDefault ) const;
+
+    QString section( const QString &in_sep, int start, int end = 0xffffffff, int flags = SectionDefault ) const;
+
+    QString section( const QRegExp &reg, int start, int end = 0xffffffff, int flags = SectionDefault ) const;
+
+
+    QString left( uint len ) const;
+    QString right( uint len ) const;
+    QString mid( uint index, uint len=0xffffffff) const;
+
+    QString leftJustify( uint width, QChar fill=' ', bool trunc=FALSE)const;
+    QString rightJustify( uint width, QChar fill=' ',bool trunc=FALSE)const;
+
+    QString lower() const;
+    QString upper() const;
+
+    QString stripWhiteSpace() const;
+    QString simplifyWhiteSpace() const;
+
+    QString &insert( uint index, const QString & );
+
+    QString &insert( uint index, const QByteArray & );
+    QString &insert( uint index, const char * );
+
+    QString &insert( uint index, const QChar*, uint len );
+    QString &insert( uint index, QChar );
+    QString &insert( uint index, char c ) { return insert(index,QChar(c)); }
+    QString &append( char );
+    QString &append( QChar );
+    QString &append( const QString & );
+
+    QString &append( const QByteArray & );
+    QString &append( const char * );
+
+
+
+
+    QString &prepend( char );
+    QString &prepend( QChar );
+    QString &prepend( const QString & );
+
+    QString &prepend( const QByteArray & );
+    QString &prepend( const char * );
+
+
+
+
+    QString &remove( uint index, uint len );
+
+
+
+
+    QString &remove( const QString & );
+    QString &remove( const QString &, bool cs );
+
+    QString &remove( QChar c );
+    QString &remove( char c )
+    { return remove( QChar(c) ); }
+
+    QString &remove( const char * );
+
+
+    QString &remove( const QRegExp & );
+
+    QString &replace( uint index, uint len, const QString & );
+    QString &replace( uint index, uint len, const QChar*, uint clen );
+    QString &replace( uint index, uint len, QChar );
+    QString &replace( uint index, uint len, char c )
+    { return replace( index, len, QChar(c) ); }
+
+
+
+
+
+
+
+    QString &replace( QChar c, const QString & );
+    QString &replace( QChar c, const QString &, bool );
+
+
+    QString &replace( char c, const QString & after )
+    { return replace( QChar(c), after, TRUE ); }
+    QString &replace( char c, const QString & after, bool cs )
+    { return replace( QChar(c), after, cs ); }
+
+
+    QString &replace( const QString &, const QString & );
+    QString &replace( const QString &, const QString &, bool );
+
+
+    QString &replace( const QRegExp &, const QString & );
+
+    QString &replace( QChar, QChar );
+
+    short toShort( bool *ok=0, int base=10 ) const;
+    ushort toUShort( bool *ok=0, int base=10 ) const;
+    int toInt( bool *ok=0, int base=10 ) const;
+    uint toUInt( bool *ok=0, int base=10 ) const;
+    long toLong( bool *ok=0, int base=10 ) const;
+    ulong toULong( bool *ok=0, int base=10 ) const;
+    Q_LLONG toLongLong( bool *ok=0, int base=10 ) const;
+    Q_ULLONG toULongLong( bool *ok=0, int base=10 ) const;
+    float toFloat( bool *ok=0 ) const;
+    double toDouble( bool *ok=0 ) const;
+
+    QString &setNum( short, int base=10 );
+    QString &setNum( ushort, int base=10 );
+    QString &setNum( int, int base=10 );
+    QString &setNum( uint, int base=10 );
+    QString &setNum( long, int base=10 );
+    QString &setNum( ulong, int base=10 );
+    QString &setNum( Q_LLONG, int base=10 );
+    QString &setNum( Q_ULLONG, int base=10 );
+    QString &setNum( float, char f='g', int prec=6 );
+    QString &setNum( double, char f='g', int prec=6 );
+
+    static QString number( long, int base=10 );
+    static QString number( ulong, int base=10);
+    static QString number( Q_LLONG, int base=10 );
+    static QString number( Q_ULLONG, int base=10);
+    static QString number( int, int base=10 );
+    static QString number( uint, int base=10);
+    static QString number( double, char f='g', int prec=6 );
+
+    void setExpand( uint index, QChar c );
+
+    QString &operator+=( const QString &str );
+
+
+
+
+    QString &operator+=( const QByteArray &str );
+
+    QString &operator+=( const char *str );
+
+
+
+
+    QString &operator+=( QChar c );
+    QString &operator+=( char c );
+
+    QChar at( uint i ) const
+        { return i < d->len ? d->unicode[i] : QChar::null; }
+    QChar operator[]( int i ) const { return at((uint)i); }
+    QCharRef at( uint i );
+    QCharRef operator[]( int i );
+
+    QChar constref(uint i) const
+        { return at(i); }
+    QChar& ref(uint i)
+        {
+            if ( d->count != 1 || i >= d->len )
+                subat( i );
+            d->setDirty();
+            return d->unicode[i];
+        }
+
+    const QChar* unicode() const { return d->unicode; }
+    const char* ascii() const;
+    static QString fromAscii(const char*, int len=-1);
+    const char* latin1() const;
+    static QString fromLatin1(const char*, int len=-1);
+    QCString utf8() const;
+    static QString fromUtf8(const char*, int len=-1);
+    QCString local8Bit() const;
+    static QString fromLocal8Bit(const char*, int len=-1);
+    bool operator!() const;
+
+
+
+
+
+
+
+    static QString fromUcs2( const unsigned short *ucs2 );
+    const unsigned short *ucs2() const;
+
+    QString &setUnicode( const QChar* unicode, uint len );
+    QString &setUnicodeCodes( const ushort* unicode_as_ushorts, uint len );
+    QString &setAscii( const char*, int len=-1 );
+    QString &setLatin1( const char*, int len=-1 );
+
+    int compare( const QString& s ) const;
+    static int compare( const QString& s1, const QString& s2 )
+    { return s1.compare( s2 ); }
+
+    int localeAwareCompare( const QString& s ) const;
+    static int localeAwareCompare( const QString& s1, const QString& s2 )
+    { return s1.localeAwareCompare( s2 ); }
+
+
+    friend QDataStream &operator>>( QDataStream &, QString & );
+
+
+    void compose();
+    bool startsWith( const QString& str ) const;
+    bool startsWith( const QString& str, bool cs ) const;
+
+
+    bool endsWith( const QString& str ) const;
+    bool endsWith( const QString& str, bool cs ) const;
+
+
+    void setLength( uint newLength );
+
+    uint capacity() const;
+    void reserve( uint minCapacity );
+    void squeeze();
+
+    bool simpleText() const { if ( !d->issimpletext ) checkSimpleText(); return (bool)d->issimpletext; }
+    bool isRightToLeft() const;
+
+
+private:
+    QString( int size, bool );
+
+    void deref();
+    void real_detach();
+    void subat( uint );
+    QString multiArg( int numArgs, const QString& a1, const QString& a2,
+                      const QString& a3 = QString::null,
+                      const QString& a4 = QString::null ) const;
+
+    void checkSimpleText() const;
+    void grow( uint newLength );
+
+    QString &insertHelper( uint index, const char *s, uint len=(2147483647 * 2U + 1U) );
+    QString &operatorPlusEqHelper( const char *s, uint len2=(2147483647 * 2U + 1U) );
+
+
+    static QChar* latin1ToUnicode( const char*, uint * len, uint maxlen=(uint)-1 );
+    static QChar* latin1ToUnicode( const QByteArray&, uint * len );
+    static char* unicodeToLatin1( const QChar*, uint len );
+
+    QStringData *d;
+    static QStringData* shared_null;
+    static QStringData* makeSharedNull();
+
+    friend class QConstString;
+    friend class QTextStream;
+    QString( QStringData* dd, bool ) : d(dd) { }
+
+
+    void detach();
+    friend class QDeepCopy<QString>;
+};
+
+class QCharRef {
+    friend class QString;
+    QString& s;
+    uint p;
+    QCharRef(QString* str, uint pos) : s(*str), p(pos) { }
+
+public:
+
+
+
+
+    ushort unicode() const { return s.constref(p).unicode(); }
+    char latin1() const { return s.constref(p).latin1(); }
+
+
+    QCharRef operator=(char c ) { s.ref(p)=c; return *this; }
+    QCharRef operator=(uchar c ) { s.ref(p)=c; return *this; }
+    QCharRef operator=(QChar c ) { s.ref(p)=c; return *this; }
+    QCharRef operator=(const QCharRef& c ) { s.ref(p)=c.unicode(); return *this; }
+    QCharRef operator=(ushort rc ) { s.ref(p)=rc; return *this; }
+    QCharRef operator=(short rc ) { s.ref(p)=rc; return *this; }
+    QCharRef operator=(uint rc ) { s.ref(p)=rc; return *this; }
+    QCharRef operator=(int rc ) { s.ref(p)=rc; return *this; }
+
+    operator QChar () const { return s.constref(p); }
+
+
+    bool isNull() const { return unicode()==0; }
+    bool isPrint() const { return s.constref(p).isPrint(); }
+    bool isPunct() const { return s.constref(p).isPunct(); }
+    bool isSpace() const { return s.constref(p).isSpace(); }
+    bool isMark() const { return s.constref(p).isMark(); }
+    bool isLetter() const { return s.constref(p).isLetter(); }
+    bool isNumber() const { return s.constref(p).isNumber(); }
+    bool isLetterOrNumber() { return s.constref(p).isLetterOrNumber(); }
+    bool isDigit() const { return s.constref(p).isDigit(); }
+
+    int digitValue() const { return s.constref(p).digitValue(); }
+    QChar lower() const { return s.constref(p).lower(); }
+    QChar upper() const { return s.constref(p).upper(); }
+
+    QChar::Category category() const { return s.constref(p).category(); }
+    QChar::Direction direction() const { return s.constref(p).direction(); }
+    QChar::Joining joining() const { return s.constref(p).joining(); }
+    bool mirrored() const { return s.constref(p).mirrored(); }
+    QChar mirroredChar() const { return s.constref(p).mirroredChar(); }
+    const QString &decomposition() const { return s.constref(p).decomposition(); }
+    QChar::Decomposition decompositionTag() const { return s.constref(p).decompositionTag(); }
+    unsigned char combiningClass() const { return s.constref(p).combiningClass(); }
+
+
+    uchar cell() const { return s.constref(p).cell(); }
+    uchar row() const { return s.constref(p).row(); }
+
+};
+
+inline QCharRef QString::at( uint i ) { return QCharRef(this,i); }
+inline QCharRef QString::operator[]( int i ) { return at((uint)i); }
+
+
+class QConstString : private QString {
+public:
+    QConstString( const QChar* unicode, uint length );
+    ~QConstString();
+    const QString& string() const { return *this; }
+};
+
+
+
+
+
+
+ QDataStream &operator<<( QDataStream &, const QString & );
+ QDataStream &operator>>( QDataStream &, QString & );
+inline QString::QString() :
+    d(shared_null ? shared_null : makeSharedNull())
+{
+    d->ref();
+}
+
+inline QString::~QString()
+{
+    if ( d->deref() ) {
+        if ( d != shared_null )
+            d->deleteSelf();
+    }
+}
+
+
+inline void QString::detach()
+{ real_detach(); }
+
+inline QString QString::section( QChar sep, int start, int end, int flags ) const
+{ return section(QString(sep), start, end, flags); }
+
+inline QString QString::section( char sep, int start, int end, int flags ) const
+{ return section(QChar(sep), start, end, flags); }
+
+
+inline QString QString::section( const char *in_sep, int start, int end, int flags ) const
+{ return section(QString(in_sep), start, end, flags); }
+
+
+inline QString &QString::operator=( QChar c )
+{ *this = QString(c); return *this; }
+
+inline QString &QString::operator=( char c )
+{ *this = QString(QChar(c)); return *this; }
+
+inline bool QString::isNull() const
+{ return unicode() == 0; }
+
+inline bool QString::operator!() const
+{ return isNull(); }
+
+inline uint QString::length() const
+{ return d->len; }
+
+inline uint QString::capacity() const
+{ return d->maxl; }
+
+inline bool QString::isEmpty() const
+{ return length() == 0; }
+
+inline QString QString::copy() const
+{ return QString( *this ); }
+
+
+inline QString &QString::insert( uint index, const char *s )
+{ return insertHelper( index, s ); }
+
+inline QString &QString::insert( uint index, const QByteArray &s )
+{
+    int pos = s.find( 0 );
+    return insertHelper( index, s, pos==-1 ? s.size() : pos );
+}
+
+
+inline QString &QString::prepend( const QString & s )
+{ return insert(0,s); }
+
+inline QString &QString::prepend( QChar c )
+{ return insert(0,c); }
+
+inline QString &QString::prepend( char c )
+{ return insert(0,c); }
+
+
+inline QString &QString::prepend( const QByteArray & s )
+{ return insert(0,s); }
+
+
+inline QString &QString::append( const QString & s )
+{ return operator+=(s); }
+
+
+inline QString &QString::append( const QByteArray &s )
+{ return operator+=(s); }
+
+inline QString &QString::append( const char * s )
+{ return operator+=(s); }
+
+
+inline QString &QString::append( QChar c )
+{ return operator+=(c); }
+
+inline QString &QString::append( char c )
+{ return operator+=(c); }
+
+
+inline QString &QString::operator+=( const QByteArray &s )
+{
+    int pos = s.find( 0 );
+    return operatorPlusEqHelper( s, pos==-1 ? s.size() : pos );
+}
+inline QString &QString::setNum( short n, int base )
+{ return setNum((Q_LLONG)n, base); }
+
+inline QString &QString::setNum( ushort n, int base )
+{ return setNum((Q_ULLONG)n, base); }
+
+inline QString &QString::setNum( int n, int base )
+{ return setNum((Q_LLONG)n, base); }
+
+inline QString &QString::setNum( uint n, int base )
+{ return setNum((Q_ULLONG)n, base); }
+
+inline QString &QString::setNum( float n, char f, int prec )
+{ return setNum((double)n,f,prec); }
+
+inline QString QString::arg( int a, int fieldWidth, int base ) const
+{ return arg( (Q_LLONG)a, fieldWidth, base ); }
+
+inline QString QString::arg( uint a, int fieldWidth, int base ) const
+{ return arg( (Q_ULLONG)a, fieldWidth, base ); }
+
+inline QString QString::arg( short a, int fieldWidth, int base ) const
+{ return arg( (Q_LLONG)a, fieldWidth, base ); }
+
+inline QString QString::arg( ushort a, int fieldWidth, int base ) const
+{ return arg( (Q_ULLONG)a, fieldWidth, base ); }
+
+inline QString QString::arg( const QString& a1, const QString& a2 ) const {
+    return multiArg( 2, a1, a2 );
+}
+
+inline QString QString::arg( const QString& a1, const QString& a2,
+                             const QString& a3 ) const {
+    return multiArg( 3, a1, a2, a3 );
+}
+
+inline QString QString::arg( const QString& a1, const QString& a2,
+                             const QString& a3, const QString& a4 ) const {
+    return multiArg( 4, a1, a2, a3, a4 );
+}
+
+inline int QString::find( char c, int index, bool cs ) const
+{ return find(QChar(c), index, cs); }
+
+inline int QString::findRev( char c, int index, bool cs ) const
+{ return findRev( QChar(c), index, cs ); }
+
+
+inline int QString::find( const char* str, int index ) const
+{ return find(QString::fromAscii(str), index); }
+
+inline int QString::findRev( const char* str, int index ) const
+{ return findRev(QString::fromAscii(str), index); }
+
+
+
+
+
+
+
+ bool operator!=( const QString &s1, const QString &s2 );
+ bool operator<( const QString &s1, const QString &s2 );
+ bool operator<=( const QString &s1, const QString &s2 );
+ bool operator==( const QString &s1, const QString &s2 );
+ bool operator>( const QString &s1, const QString &s2 );
+ bool operator>=( const QString &s1, const QString &s2 );
+
+ bool operator!=( const QString &s1, const char *s2 );
+ bool operator<( const QString &s1, const char *s2 );
+ bool operator<=( const QString &s1, const char *s2 );
+ bool operator==( const QString &s1, const char *s2 );
+ bool operator>( const QString &s1, const char *s2 );
+ bool operator>=( const QString &s1, const char *s2 );
+ bool operator!=( const char *s1, const QString &s2 );
+ bool operator<( const char *s1, const QString &s2 );
+ bool operator<=( const char *s1, const QString &s2 );
+ bool operator==( const char *s1, const QString &s2 );
+
+ bool operator>=( const char *s1, const QString &s2 );
+
+
+ inline const QString operator+( const QString &s1, const QString &s2 )
+{
+    QString tmp( s1 );
+    tmp += s2;
+    return tmp;
+}
+
+
+ inline const QString operator+( const QString &s1, const char *s2 )
+{
+    QString tmp( s1 );
+    tmp += QString::fromAscii(s2);
+    return tmp;
+}
+
+ inline const QString operator+( const char *s1, const QString &s2 )
+{
+    QString tmp = QString::fromAscii( s1 );
+    tmp += s2;
+    return tmp;
+}
+
+
+ inline const QString operator+( const QString &s1, QChar c2 )
+{
+    QString tmp( s1 );
+    tmp += c2;
+    return tmp;
+}
+
+ inline const QString operator+( const QString &s1, char c2 )
+{
+    QString tmp( s1 );
+    tmp += c2;
+    return tmp;
+}
+
+ inline const QString operator+( QChar c1, const QString &s2 )
+{
+    QString tmp;
+    tmp += c1;
+    tmp += s2;
+    return tmp;
+}
+
+ inline const QString operator+( char c1, const QString &s2 )
+{
+    QString tmp;
+    tmp += c1;
+    tmp += s2;
+    return tmp;
+}
+
+
+
+
+
+class QColor;
+class QCursor;
+
+
+class Qt {
+public:
+    static const QColor & color0;
+    static const QColor & color1;
+    static const QColor & black;
+    static const QColor & white;
+    static const QColor & darkGray;
+    static const QColor & gray;
+    static const QColor & lightGray;
+    static const QColor & red;
+    static const QColor & green;
+    static const QColor & blue;
+    static const QColor & cyan;
+    static const QColor & magenta;
+    static const QColor & yellow;
+    static const QColor & darkRed;
+    static const QColor & darkGreen;
+    static const QColor & darkBlue;
+    static const QColor & darkCyan;
+    static const QColor & darkMagenta;
+    static const QColor & darkYellow;
+
+
+    enum ButtonState {
+        NoButton = 0x0000,
+        LeftButton = 0x0001,
+        RightButton = 0x0002,
+        MidButton = 0x0004,
+        MouseButtonMask = 0x0007,
+        ShiftButton = 0x0100,
+        ControlButton = 0x0200,
+        AltButton = 0x0400,
+        MetaButton = 0x0800,
+        KeyButtonMask = 0x0f00,
+        Keypad = 0x4000
+    };
+
+
+
+    enum Orientation {
+        Horizontal = 0,
+        Vertical
+    };
+
+
+    enum SortOrder {
+        Ascending,
+        Descending
+    };
+
+
+
+
+
+
+    enum AlignmentFlags {
+        AlignAuto = 0x0000,
+        AlignLeft = 0x0001,
+        AlignRight = 0x0002,
+        AlignHCenter = 0x0004,
+        AlignJustify = 0x0008,
+        AlignHorizontal_Mask = AlignLeft | AlignRight | AlignHCenter | AlignJustify,
+        AlignTop = 0x0010,
+        AlignBottom = 0x0020,
+        AlignVCenter = 0x0040,
+        AlignVertical_Mask = AlignTop | AlignBottom | AlignVCenter,
+        AlignCenter = AlignVCenter | AlignHCenter
+    };
+
+
+    enum TextFlags {
+        SingleLine = 0x0080,
+        DontClip = 0x0100,
+        ExpandTabs = 0x0200,
+        ShowPrefix = 0x0400,
+        WordBreak = 0x0800,
+        BreakAnywhere = 0x1000,
+
+        DontPrint = 0x2000,
+        Underline = 0x01000000,
+        Overline = 0x02000000,
+        StrikeOut = 0x04000000,
+        IncludeTrailingSpaces = 0x08000000,
+
+        NoAccel = 0x4000
+    };
+
+
+    typedef uint WState;
+
+
+    enum WidgetState {
+        WState_Created = 0x00000001,
+        WState_Disabled = 0x00000002,
+        WState_Visible = 0x00000004,
+        WState_ForceHide = 0x00000008,
+        WState_OwnCursor = 0x00000010,
+        WState_MouseTracking = 0x00000020,
+        WState_CompressKeys = 0x00000040,
+        WState_BlockUpdates = 0x00000080,
+        WState_InPaintEvent = 0x00000100,
+        WState_Reparented = 0x00000200,
+        WState_ConfigPending = 0x00000400,
+        WState_Resized = 0x00000800,
+        WState_AutoMask = 0x00001000,
+        WState_Polished = 0x00002000,
+        WState_DND = 0x00004000,
+        WState_Reserved0 = 0x00008000,
+        WState_Reserved1 = 0x00010000,
+        WState_OwnSizePolicy = 0x00020000,
+        WState_CreatedHidden = 0x00040000,
+        WState_Maximized = 0x00080000,
+        WState_Minimized = 0x00100000,
+        WState_ForceDisabled = 0x00200000,
+        WState_Exposed = 0x00400000,
+        WState_HasMouse = 0x00800000
+    };
+
+
+    typedef uint WFlags;
+
+
+    enum WidgetFlags {
+        WType_TopLevel = 0x00000001,
+        WType_Dialog = 0x00000002,
+        WType_Popup = 0x00000004,
+        WType_Desktop = 0x00000008,
+        WType_Mask = 0x0000000f,
+
+        WStyle_Customize = 0x00000010,
+        WStyle_NormalBorder = 0x00000020,
+        WStyle_DialogBorder = 0x00000040,
+        WStyle_NoBorder = 0x00002000,
+        WStyle_Title = 0x00000080,
+        WStyle_SysMenu = 0x00000100,
+        WStyle_Minimize = 0x00000200,
+        WStyle_Maximize = 0x00000400,
+        WStyle_MinMax = WStyle_Minimize | WStyle_Maximize,
+        WStyle_Tool = 0x00000800,
+        WStyle_StaysOnTop = 0x00001000,
+        WStyle_ContextHelp = 0x00004000,
+        WStyle_Reserved = 0x00008000,
+        WStyle_Mask = 0x0000fff0,
+
+        WDestructiveClose = 0x00010000,
+        WPaintDesktop = 0x00020000,
+        WPaintUnclipped = 0x00040000,
+        WPaintClever = 0x00080000,
+        WResizeNoErase = 0x00100000,
+        WMouseNoMask = 0x00200000,
+        WStaticContents = 0x00400000,
+        WRepaintNoErase = 0x00800000,
+
+        WX11BypassWM = 0x01000000,
+        WWinOwnDC = 0x00000000,
+        WMacNoSheet = 0x00000000,
+        WMacDrawer = 0x00000000,
+        WGroupLeader = 0x02000000,
+        WShowModal = 0x04000000,
+        WNoMousePropagation = 0x08000000,
+        WSubWindow = 0x10000000,
+
+        WStyle_Splash = 0x20000000,
+
+
+
+
+        WNoAutoErase = WRepaintNoErase | WResizeNoErase
+
+
+
+
+
+
+
+    };
+
+
+
+
+
+    enum ImageConversionFlags {
+        ColorMode_Mask = 0x00000003,
+        AutoColor = 0x00000000,
+        ColorOnly = 0x00000003,
+        MonoOnly = 0x00000002,
+
+
+        AlphaDither_Mask = 0x0000000c,
+        ThresholdAlphaDither = 0x00000000,
+        OrderedAlphaDither = 0x00000004,
+        DiffuseAlphaDither = 0x00000008,
+        NoAlpha = 0x0000000c,
+
+        Dither_Mask = 0x00000030,
+        DiffuseDither = 0x00000000,
+        OrderedDither = 0x00000010,
+        ThresholdDither = 0x00000020,
+
+
+        DitherMode_Mask = 0x000000c0,
+        AutoDither = 0x00000000,
+        PreferDither = 0x00000040,
+        AvoidDither = 0x00000080
+    };
+
+
+    enum BGMode {
+        TransparentMode,
+        OpaqueMode
+    };
+    enum GUIStyle {
+        WindowsStyle = 1,
+        MotifStyle = 4
+    };
+    enum SequenceMatch {
+        NoMatch,
+        PartialMatch,
+        Identical
+    };
+
+
+    enum Modifier {
+        META = 0x00100000,
+        SHIFT = 0x00200000,
+        CTRL = 0x00400000,
+        ALT = 0x00800000,
+        MODIFIER_MASK = 0x00f00000,
+        UNICODE_ACCEL = 0x10000000,
+
+        ASCII_ACCEL = UNICODE_ACCEL
+    };
+
+
+    enum Key {
+        Key_Escape = 0x1000,
+        Key_Tab = 0x1001,
+        Key_Backtab = 0x1002, Key_BackTab = Key_Backtab,
+        Key_Backspace = 0x1003, Key_BackSpace = Key_Backspace,
+        Key_Return = 0x1004,
+        Key_Enter = 0x1005,
+        Key_Insert = 0x1006,
+        Key_Delete = 0x1007,
+        Key_Pause = 0x1008,
+        Key_Print = 0x1009,
+        Key_SysReq = 0x100a,
+        Key_Clear = 0x100b,
+        Key_Home = 0x1010,
+        Key_End = 0x1011,
+        Key_Left = 0x1012,
+        Key_Up = 0x1013,
+        Key_Right = 0x1014,
+        Key_Down = 0x1015,
+        Key_Prior = 0x1016, Key_PageUp = Key_Prior,
+        Key_Next = 0x1017, Key_PageDown = Key_Next,
+        Key_Shift = 0x1020,
+        Key_Control = 0x1021,
+        Key_Meta = 0x1022,
+        Key_Alt = 0x1023,
+        Key_CapsLock = 0x1024,
+        Key_NumLock = 0x1025,
+        Key_ScrollLock = 0x1026,
+        Key_F1 = 0x1030,
+        Key_F2 = 0x1031,
+        Key_F3 = 0x1032,
+        Key_F4 = 0x1033,
+        Key_F5 = 0x1034,
+        Key_F6 = 0x1035,
+        Key_F7 = 0x1036,
+        Key_F8 = 0x1037,
+        Key_F9 = 0x1038,
+        Key_F10 = 0x1039,
+        Key_F11 = 0x103a,
+        Key_F12 = 0x103b,
+        Key_F13 = 0x103c,
+        Key_F14 = 0x103d,
+        Key_F15 = 0x103e,
+        Key_F16 = 0x103f,
+        Key_F17 = 0x1040,
+        Key_F18 = 0x1041,
+        Key_F19 = 0x1042,
+        Key_F20 = 0x1043,
+        Key_F21 = 0x1044,
+        Key_F22 = 0x1045,
+        Key_F23 = 0x1046,
+        Key_F24 = 0x1047,
+        Key_F25 = 0x1048,
+        Key_F26 = 0x1049,
+        Key_F27 = 0x104a,
+        Key_F28 = 0x104b,
+        Key_F29 = 0x104c,
+        Key_F30 = 0x104d,
+        Key_F31 = 0x104e,
+        Key_F32 = 0x104f,
+        Key_F33 = 0x1050,
+        Key_F34 = 0x1051,
+        Key_F35 = 0x1052,
+        Key_Super_L = 0x1053,
+        Key_Super_R = 0x1054,
+        Key_Menu = 0x1055,
+        Key_Hyper_L = 0x1056,
+        Key_Hyper_R = 0x1057,
+        Key_Help = 0x1058,
+        Key_Direction_L = 0x1059,
+        Key_Direction_R = 0x1060,
+        Key_Space = 0x20,
+        Key_Any = Key_Space,
+        Key_Exclam = 0x21,
+        Key_QuoteDbl = 0x22,
+        Key_NumberSign = 0x23,
+        Key_Dollar = 0x24,
+        Key_Percent = 0x25,
+        Key_Ampersand = 0x26,
+        Key_Apostrophe = 0x27,
+        Key_ParenLeft = 0x28,
+        Key_ParenRight = 0x29,
+        Key_Asterisk = 0x2a,
+        Key_Plus = 0x2b,
+        Key_Comma = 0x2c,
+        Key_Minus = 0x2d,
+        Key_Period = 0x2e,
+        Key_Slash = 0x2f,
+        Key_0 = 0x30,
+        Key_1 = 0x31,
+        Key_2 = 0x32,
+        Key_3 = 0x33,
+        Key_4 = 0x34,
+        Key_5 = 0x35,
+        Key_6 = 0x36,
+        Key_7 = 0x37,
+        Key_8 = 0x38,
+        Key_9 = 0x39,
+        Key_Colon = 0x3a,
+        Key_Semicolon = 0x3b,
+        Key_Less = 0x3c,
+        Key_Equal = 0x3d,
+        Key_Greater = 0x3e,
+        Key_Question = 0x3f,
+        Key_At = 0x40,
+        Key_A = 0x41,
+        Key_B = 0x42,
+        Key_C = 0x43,
+        Key_D = 0x44,
+        Key_E = 0x45,
+        Key_F = 0x46,
+        Key_G = 0x47,
+        Key_H = 0x48,
+        Key_I = 0x49,
+        Key_J = 0x4a,
+        Key_K = 0x4b,
+        Key_L = 0x4c,
+        Key_M = 0x4d,
+        Key_N = 0x4e,
+        Key_O = 0x4f,
+        Key_P = 0x50,
+        Key_Q = 0x51,
+        Key_R = 0x52,
+        Key_S = 0x53,
+        Key_T = 0x54,
+        Key_U = 0x55,
+        Key_V = 0x56,
+        Key_W = 0x57,
+        Key_X = 0x58,
+        Key_Y = 0x59,
+        Key_Z = 0x5a,
+        Key_BracketLeft = 0x5b,
+        Key_Backslash = 0x5c,
+        Key_BracketRight = 0x5d,
+        Key_AsciiCircum = 0x5e,
+        Key_Underscore = 0x5f,
+        Key_QuoteLeft = 0x60,
+        Key_BraceLeft = 0x7b,
+        Key_Bar = 0x7c,
+        Key_BraceRight = 0x7d,
+        Key_AsciiTilde = 0x7e,
+
+
+
+        Key_nobreakspace = 0x0a0,
+        Key_exclamdown = 0x0a1,
+        Key_cent = 0x0a2,
+        Key_sterling = 0x0a3,
+        Key_currency = 0x0a4,
+        Key_yen = 0x0a5,
+        Key_brokenbar = 0x0a6,
+        Key_section = 0x0a7,
+        Key_diaeresis = 0x0a8,
+        Key_copyright = 0x0a9,
+        Key_ordfeminine = 0x0aa,
+        Key_guillemotleft = 0x0ab,
+        Key_notsign = 0x0ac,
+        Key_hyphen = 0x0ad,
+        Key_registered = 0x0ae,
+        Key_macron = 0x0af,
+        Key_degree = 0x0b0,
+        Key_plusminus = 0x0b1,
+        Key_twosuperior = 0x0b2,
+        Key_threesuperior = 0x0b3,
+        Key_acute = 0x0b4,
+        Key_mu = 0x0b5,
+        Key_paragraph = 0x0b6,
+        Key_periodcentered = 0x0b7,
+        Key_cedilla = 0x0b8,
+        Key_onesuperior = 0x0b9,
+        Key_masculine = 0x0ba,
+        Key_guillemotright = 0x0bb,
+        Key_onequarter = 0x0bc,
+        Key_onehalf = 0x0bd,
+        Key_threequarters = 0x0be,
+        Key_questiondown = 0x0bf,
+        Key_Agrave = 0x0c0,
+        Key_Aacute = 0x0c1,
+        Key_Acircumflex = 0x0c2,
+        Key_Atilde = 0x0c3,
+        Key_Adiaeresis = 0x0c4,
+        Key_Aring = 0x0c5,
+        Key_AE = 0x0c6,
+        Key_Ccedilla = 0x0c7,
+        Key_Egrave = 0x0c8,
+        Key_Eacute = 0x0c9,
+        Key_Ecircumflex = 0x0ca,
+        Key_Ediaeresis = 0x0cb,
+        Key_Igrave = 0x0cc,
+        Key_Iacute = 0x0cd,
+        Key_Icircumflex = 0x0ce,
+        Key_Idiaeresis = 0x0cf,
+        Key_ETH = 0x0d0,
+        Key_Ntilde = 0x0d1,
+        Key_Ograve = 0x0d2,
+        Key_Oacute = 0x0d3,
+        Key_Ocircumflex = 0x0d4,
+        Key_Otilde = 0x0d5,
+        Key_Odiaeresis = 0x0d6,
+        Key_multiply = 0x0d7,
+        Key_Ooblique = 0x0d8,
+        Key_Ugrave = 0x0d9,
+        Key_Uacute = 0x0da,
+        Key_Ucircumflex = 0x0db,
+        Key_Udiaeresis = 0x0dc,
+        Key_Yacute = 0x0dd,
+        Key_THORN = 0x0de,
+        Key_ssharp = 0x0df,
+        Key_agrave = 0x0e0,
+        Key_aacute = 0x0e1,
+        Key_acircumflex = 0x0e2,
+        Key_atilde = 0x0e3,
+        Key_adiaeresis = 0x0e4,
+        Key_aring = 0x0e5,
+        Key_ae = 0x0e6,
+        Key_ccedilla = 0x0e7,
+        Key_egrave = 0x0e8,
+        Key_eacute = 0x0e9,
+        Key_ecircumflex = 0x0ea,
+        Key_ediaeresis = 0x0eb,
+        Key_igrave = 0x0ec,
+        Key_iacute = 0x0ed,
+        Key_icircumflex = 0x0ee,
+        Key_idiaeresis = 0x0ef,
+        Key_eth = 0x0f0,
+        Key_ntilde = 0x0f1,
+        Key_ograve = 0x0f2,
+        Key_oacute = 0x0f3,
+        Key_ocircumflex = 0x0f4,
+        Key_otilde = 0x0f5,
+        Key_odiaeresis = 0x0f6,
+        Key_division = 0x0f7,
+        Key_oslash = 0x0f8,
+        Key_ugrave = 0x0f9,
+        Key_uacute = 0x0fa,
+        Key_ucircumflex = 0x0fb,
+        Key_udiaeresis = 0x0fc,
+        Key_yacute = 0x0fd,
+        Key_thorn = 0x0fe,
+        Key_ydiaeresis = 0x0ff,
+
+
+
+        Key_Back = 0x1061,
+        Key_Forward = 0x1062,
+        Key_Stop = 0x1063,
+        Key_Refresh = 0x1064,
+
+        Key_VolumeDown = 0x1070,
+        Key_VolumeMute = 0x1071,
+        Key_VolumeUp = 0x1072,
+        Key_BassBoost = 0x1073,
+        Key_BassUp = 0x1074,
+        Key_BassDown = 0x1075,
+        Key_TrebleUp = 0x1076,
+        Key_TrebleDown = 0x1077,
+
+        Key_MediaPlay = 0x1080,
+        Key_MediaStop = 0x1081,
+        Key_MediaPrev = 0x1082,
+        Key_MediaNext = 0x1083,
+        Key_MediaRecord = 0x1084,
+
+        Key_HomePage = 0x1090,
+        Key_Favorites = 0x1091,
+        Key_Search = 0x1092,
+        Key_Standby = 0x1093,
+        Key_OpenUrl = 0x1094,
+
+        Key_LaunchMail = 0x10a0,
+        Key_LaunchMedia = 0x10a1,
+        Key_Launch0 = 0x10a2,
+        Key_Launch1 = 0x10a3,
+        Key_Launch2 = 0x10a4,
+        Key_Launch3 = 0x10a5,
+        Key_Launch4 = 0x10a6,
+        Key_Launch5 = 0x10a7,
+        Key_Launch6 = 0x10a8,
+        Key_Launch7 = 0x10a9,
+        Key_Launch8 = 0x10aa,
+        Key_Launch9 = 0x10ab,
+        Key_LaunchA = 0x10ac,
+        Key_LaunchB = 0x10ad,
+        Key_LaunchC = 0x10ae,
+        Key_LaunchD = 0x10af,
+        Key_LaunchE = 0x10b0,
+        Key_LaunchF = 0x10b1,
+
+        Key_MediaLast = 0x1fff,
+
+        Key_unknown = 0xffff
+    };
+
+
+    enum ArrowType {
+        UpArrow,
+        DownArrow,
+        LeftArrow,
+        RightArrow
+    };
+
+
+    enum RasterOp {
+        CopyROP,
+        OrROP,
+        XorROP,
+        NotAndROP, EraseROP=NotAndROP,
+        NotCopyROP,
+        NotOrROP,
+        NotXorROP,
+        AndROP, NotEraseROP=AndROP,
+        NotROP,
+        ClearROP,
+        SetROP,
+        NopROP,
+        AndNotROP,
+        OrNotROP,
+        NandROP,
+        NorROP, LastROP=NorROP
+    };
+
+
+    enum PenStyle {
+        NoPen,
+        SolidLine,
+        DashLine,
+        DotLine,
+        DashDotLine,
+        DashDotDotLine,
+        MPenStyle = 0x0f
+    };
+
+
+    enum PenCapStyle {
+        FlatCap = 0x00,
+        SquareCap = 0x10,
+        RoundCap = 0x20,
+        MPenCapStyle = 0x30
+    };
+
+
+    enum PenJoinStyle {
+        MiterJoin = 0x00,
+        BevelJoin = 0x40,
+        RoundJoin = 0x80,
+        MPenJoinStyle = 0xc0
+    };
+
+
+    enum BrushStyle {
+        NoBrush,
+        SolidPattern,
+        Dense1Pattern,
+        Dense2Pattern,
+        Dense3Pattern,
+        Dense4Pattern,
+        Dense5Pattern,
+        Dense6Pattern,
+        Dense7Pattern,
+        HorPattern,
+        VerPattern,
+        CrossPattern,
+        BDiagPattern,
+        FDiagPattern,
+        DiagCrossPattern,
+        CustomPattern=24
+    };
+
+
+    enum MacintoshVersion {
+
+        MV_Unknown = 0x0000,
+
+
+        MV_9 = 0x0001,
+        MV_10_DOT_0 = 0x0002,
+        MV_10_DOT_1 = 0x0003,
+        MV_10_DOT_2 = 0x0004,
+        MV_10_DOT_3 = 0x0005,
+
+
+        MV_CHEETAH = MV_10_DOT_0,
+        MV_PUMA = MV_10_DOT_1,
+        MV_JAGUAR = MV_10_DOT_2,
+        MV_PANTHER = MV_10_DOT_3
+    };
+
+
+    enum WindowsVersion {
+        WV_32s = 0x0001,
+        WV_95 = 0x0002,
+        WV_98 = 0x0003,
+        WV_Me = 0x0004,
+        WV_DOS_based = 0x000f,
+
+        WV_NT = 0x0010,
+        WV_2000 = 0x0020,
+        WV_XP = 0x0030,
+        WV_NT_based = 0x00f0
+    };
+
+
+    enum UIEffect {
+        UI_General,
+        UI_AnimateMenu,
+        UI_FadeMenu,
+        UI_AnimateCombo,
+        UI_AnimateTooltip,
+        UI_FadeTooltip,
+        UI_AnimateToolBox
+    };
+
+
+    enum CursorShape {
+        ArrowCursor,
+        UpArrowCursor,
+        CrossCursor,
+        WaitCursor,
+        IbeamCursor,
+        SizeVerCursor,
+        SizeHorCursor,
+        SizeBDiagCursor,
+        SizeFDiagCursor,
+        SizeAllCursor,
+        BlankCursor,
+        SplitVCursor,
+        SplitHCursor,
+        PointingHandCursor,
+        ForbiddenCursor,
+        WhatsThisCursor,
+        LastCursor = WhatsThisCursor,
+        BitmapCursor = 24
+    };
+
+
+
+    static const QCursor & arrowCursor;
+    static const QCursor & upArrowCursor;
+    static const QCursor & crossCursor;
+    static const QCursor & waitCursor;
+    static const QCursor & ibeamCursor;
+    static const QCursor & sizeVerCursor;
+    static const QCursor & sizeHorCursor;
+    static const QCursor & sizeBDiagCursor;
+    static const QCursor & sizeFDiagCursor;
+    static const QCursor & sizeAllCursor;
+    static const QCursor & blankCursor;
+    static const QCursor & splitVCursor;
+
+    static const QCursor & splitHCursor;
+
+    static const QCursor & pointingHandCursor;
+    static const QCursor & forbiddenCursor;
+    static const QCursor & whatsThisCursor;
+
+
+    enum TextFormat {
+        PlainText,
+        RichText,
+        AutoText,
+        LogText
+    };
+
+
+    enum AnchorAttribute {
+        AnchorName,
+        AnchorHref
+    };
+
+
+    enum Dock {
+        DockUnmanaged,
+        DockTornOff,
+        DockTop,
+        DockBottom,
+        DockRight,
+        DockLeft,
+        DockMinimized
+    };
+
+    typedef Dock ToolBarDock;
+
+
+    enum DateFormat {
+        TextDate,
+        ISODate,
+        LocalDate
+    };
+
+
+    enum TimeSpec {
+        LocalTime,
+        UTC
+    };
+
+
+    enum BackgroundMode {
+        FixedColor,
+        FixedPixmap,
+        NoBackground,
+        PaletteForeground,
+        PaletteButton,
+        PaletteLight,
+        PaletteMidlight,
+        PaletteDark,
+        PaletteMid,
+        PaletteText,
+        PaletteBrightText,
+        PaletteBase,
+        PaletteBackground,
+        PaletteShadow,
+        PaletteHighlight,
+        PaletteHighlightedText,
+        PaletteButtonText,
+        PaletteLink,
+        PaletteLinkVisited,
+        X11ParentRelative
+    };
+
+    typedef uint ComparisonFlags;
+
+
+    enum StringComparisonMode {
+        CaseSensitive = 0x00001,
+        BeginsWith = 0x00002,
+        EndsWith = 0x00004,
+        Contains = 0x00008,
+        ExactMatch = 0x00010
+    };
+
+
+    enum Corner {
+        TopLeft = 0x00000,
+        TopRight = 0x00001,
+        BottomLeft = 0x00002,
+        BottomRight = 0x00003
+    };
+    typedef unsigned long HANDLE;
+
+
+
+};
+
+
+class QInternal {
+public:
+    enum PaintDeviceFlags {
+        UndefinedDevice = 0x00,
+        Widget = 0x01,
+        Pixmap = 0x02,
+        Printer = 0x03,
+        Picture = 0x04,
+        System = 0x05,
+        DeviceTypeMask = 0x0f,
+        ExternalDevice = 0x10,
+
+        CompatibilityMode = 0x20
+    };
+};
+
+
+
+
+class QPaintDevice;
+class QPaintDeviceMetrics;
+class QWidget;
+class QWidgetMapper;
+class QDialog;
+class QColor;
+class QColorGroup;
+class QPalette;
+class QCursor;
+class QPoint;
+class QSize;
+class QRect;
+class QPointArray;
+class QPainter;
+class QRegion;
+class QFont;
+class QFontMetrics;
+class QFontInfo;
+class QPen;
+class QBrush;
+class QWMatrix;
+class QPixmap;
+class QBitmap;
+class QMovie;
+class QImage;
+class QImageIO;
+class QPicture;
+class QPrinter;
+class QAccel;
+class QTimer;
+class QTime;
+class QClipboard;
+
+
+
+
+class QWidgetList;
+class QWidgetListIt;
+typedef struct _XDisplay Display;
+typedef union _XEvent XEvent;
+typedef struct _XGC *GC;
+typedef struct _XRegion *Region;
+typedef unsigned long WId;
+
+ Display *qt_xdisplay();
+ int qt_xscreen();
+ WId qt_xrootwin();
+ WId qt_xrootwin( int scrn );
+ GC qt_xget_readonly_gc( int scrn, bool monochrome );
+ GC qt_xget_temp_gc( int scrn, bool monochrome );
+class QApplication;
+
+
+
+
+
+
+
+typedef Q_INT32 QCOORD;
+const QCOORD QCOORD_MAX = 2147483647;
+const QCOORD QCOORD_MIN = -QCOORD_MAX - 1;
+
+typedef unsigned int QRgb;
+
+ const char *qAppName();
+
+
+
+typedef void (*QtCleanUpFunction)();
+ void qAddPostRoutine( QtCleanUpFunction );
+ void qRemovePostRoutine( QtCleanUpFunction );
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+class QPoint
+{
+public:
+    QPoint();
+    QPoint( int xpos, int ypos );
+
+    bool isNull() const;
+
+    int x() const;
+    int y() const;
+    void setX( int x );
+    void setY( int y );
+
+    int manhattanLength() const;
+
+    QCOORD &rx();
+    QCOORD &ry();
+
+    QPoint &operator+=( const QPoint &p );
+    QPoint &operator-=( const QPoint &p );
+    QPoint &operator*=( int c );
+    QPoint &operator*=( double c );
+    QPoint &operator/=( int c );
+    QPoint &operator/=( double c );
+
+    friend inline bool operator==( const QPoint &, const QPoint & );
+    friend inline bool operator!=( const QPoint &, const QPoint & );
+    friend inline const QPoint operator+( const QPoint &, const QPoint & );
+    friend inline const QPoint operator-( const QPoint &, const QPoint & );
+    friend inline const QPoint operator*( const QPoint &, int );
+    friend inline const QPoint operator*( int, const QPoint & );
+    friend inline const QPoint operator*( const QPoint &, double );
+    friend inline const QPoint operator*( double, const QPoint & );
+    friend inline const QPoint operator-( const QPoint & );
+    friend inline const QPoint operator/( const QPoint &, int );
+    friend inline const QPoint operator/( const QPoint &, double );
+
+private:
+    static void warningDivByZero();
+
+
+
+
+
+    QCOORD xp;
+    QCOORD yp;
+
+};
+
+
+
+
+
+
+ QDataStream &operator<<( QDataStream &, const QPoint & );
+ QDataStream &operator>>( QDataStream &, QPoint & );
+
+
+
+
+
+
+inline QPoint::QPoint()
+{ xp=0; yp=0; }
+
+inline QPoint::QPoint( int xpos, int ypos )
+{ xp=(QCOORD)xpos; yp=(QCOORD)ypos; }
+
+inline bool QPoint::isNull() const
+{ return xp == 0 && yp == 0; }
+
+inline int QPoint::x() const
+{ return xp; }
+
+inline int QPoint::y() const
+{ return yp; }
+
+inline void QPoint::setX( int x )
+{ xp = (QCOORD)x; }
+
+inline void QPoint::setY( int y )
+{ yp = (QCOORD)y; }
+
+inline QCOORD &QPoint::rx()
+{ return xp; }
+
+inline QCOORD &QPoint::ry()
+{ return yp; }
+
+inline QPoint &QPoint::operator+=( const QPoint &p )
+{ xp+=p.xp; yp+=p.yp; return *this; }
+
+inline QPoint &QPoint::operator-=( const QPoint &p )
+{ xp-=p.xp; yp-=p.yp; return *this; }
+
+inline QPoint &QPoint::operator*=( int c )
+{ xp*=(QCOORD)c; yp*=(QCOORD)c; return *this; }
+
+inline QPoint &QPoint::operator*=( double c )
+{ xp=(QCOORD)(xp*c); yp=(QCOORD)(yp*c); return *this; }
+
+inline bool operator==( const QPoint &p1, const QPoint &p2 )
+{ return p1.xp == p2.xp && p1.yp == p2.yp; }
+
+inline bool operator!=( const QPoint &p1, const QPoint &p2 )
+{ return p1.xp != p2.xp || p1.yp != p2.yp; }
+
+inline const QPoint operator+( const QPoint &p1, const QPoint &p2 )
+{ return QPoint(p1.xp+p2.xp, p1.yp+p2.yp); }
+
+inline const QPoint operator-( const QPoint &p1, const QPoint &p2 )
+{ return QPoint(p1.xp-p2.xp, p1.yp-p2.yp); }
+
+inline const QPoint operator*( const QPoint &p, int c )
+{ return QPoint(p.xp*c, p.yp*c); }
+
+inline const QPoint operator*( int c, const QPoint &p )
+{ return QPoint(p.xp*c, p.yp*c); }
+
+inline const QPoint operator*( const QPoint &p, double c )
+{ return QPoint((QCOORD)(p.xp*c), (QCOORD)(p.yp*c)); }
+
+inline const QPoint operator*( double c, const QPoint &p )
+{ return QPoint((QCOORD)(p.xp*c), (QCOORD)(p.yp*c)); }
+
+inline const QPoint operator-( const QPoint &p )
+{ return QPoint(-p.xp, -p.yp); }
+
+inline QPoint &QPoint::operator/=( int c )
+{
+
+    if ( c == 0 )
+        warningDivByZero();
+
+    xp/=(QCOORD)c;
+    yp/=(QCOORD)c;
+    return *this;
+}
+
+inline QPoint &QPoint::operator/=( double c )
+{
+
+    if ( c == 0.0 )
+        warningDivByZero();
+
+    xp=(QCOORD)(xp/c);
+    yp=(QCOORD)(yp/c);
+    return *this;
+}
+
+inline const QPoint operator/( const QPoint &p, int c )
+{
+
+    if ( c == 0 )
+        QPoint::warningDivByZero();
+
+    return QPoint(p.xp/c, p.yp/c);
+}
+
+inline const QPoint operator/( const QPoint &p, double c )
+{
+
+    if ( c == 0.0 )
+        QPoint::warningDivByZero();
+
+    return QPoint((QCOORD)(p.xp/c), (QCOORD)(p.yp/c));
+}
+
+
+
+class QSize
+
+{
+public:
+
+    enum ScaleMode {
+        ScaleFree,
+        ScaleMin,
+        ScaleMax
+    };
+
+    QSize();
+    QSize( int w, int h );
+
+    bool isNull() const;
+    bool isEmpty() const;
+    bool isValid() const;
+
+    int width() const;
+    int height() const;
+    void setWidth( int w );
+    void setHeight( int h );
+    void transpose();
+
+    void scale( int w, int h, ScaleMode mode );
+    void scale( const QSize &s, ScaleMode mode );
+
+    QSize expandedTo( const QSize & ) const;
+    QSize boundedTo( const QSize & ) const;
+
+    QCOORD &rwidth();
+    QCOORD &rheight();
+
+    QSize &operator+=( const QSize & );
+    QSize &operator-=( const QSize & );
+    QSize &operator*=( int c );
+    QSize &operator*=( double c );
+    QSize &operator/=( int c );
+    QSize &operator/=( double c );
+
+    friend inline bool operator==( const QSize &, const QSize & );
+    friend inline bool operator!=( const QSize &, const QSize & );
+    friend inline const QSize operator+( const QSize &, const QSize & );
+    friend inline const QSize operator-( const QSize &, const QSize & );
+    friend inline const QSize operator*( const QSize &, int );
+    friend inline const QSize operator*( int, const QSize & );
+    friend inline const QSize operator*( const QSize &, double );
+    friend inline const QSize operator*( double, const QSize & );
+    friend inline const QSize operator/( const QSize &, int );
+    friend inline const QSize operator/( const QSize &, double );
+
+private:
+    static void warningDivByZero();
+
+    QCOORD wd;
+    QCOORD ht;
+};
+
+
+
+
+
+
+ QDataStream &operator<<( QDataStream &, const QSize & );
+ QDataStream &operator>>( QDataStream &, QSize & );
+
+
+
+
+
+
+inline QSize::QSize()
+{ wd = ht = -1; }
+
+inline QSize::QSize( int w, int h )
+{ wd=(QCOORD)w; ht=(QCOORD)h; }
+
+inline bool QSize::isNull() const
+{ return wd==0 && ht==0; }
+
+inline bool QSize::isEmpty() const
+{ return wd<1 || ht<1; }
+
+inline bool QSize::isValid() const
+{ return wd>=0 && ht>=0; }
+
+inline int QSize::width() const
+{ return wd; }
+
+inline int QSize::height() const
+{ return ht; }
+
+inline void QSize::setWidth( int w )
+{ wd=(QCOORD)w; }
+
+inline void QSize::setHeight( int h )
+{ ht=(QCOORD)h; }
+
+inline QCOORD &QSize::rwidth()
+{ return wd; }
+
+inline QCOORD &QSize::rheight()
+{ return ht; }
+
+inline QSize &QSize::operator+=( const QSize &s )
+{ wd+=s.wd; ht+=s.ht; return *this; }
+
+inline QSize &QSize::operator-=( const QSize &s )
+{ wd-=s.wd; ht-=s.ht; return *this; }
+
+inline QSize &QSize::operator*=( int c )
+{ wd*=(QCOORD)c; ht*=(QCOORD)c; return *this; }
+
+inline QSize &QSize::operator*=( double c )
+{ wd=(QCOORD)(wd*c); ht=(QCOORD)(ht*c); return *this; }
+
+inline bool operator==( const QSize &s1, const QSize &s2 )
+{ return s1.wd == s2.wd && s1.ht == s2.ht; }
+
+inline bool operator!=( const QSize &s1, const QSize &s2 )
+{ return s1.wd != s2.wd || s1.ht != s2.ht; }
+
+inline const QSize operator+( const QSize & s1, const QSize & s2 )
+{ return QSize(s1.wd+s2.wd, s1.ht+s2.ht); }
+
+inline const QSize operator-( const QSize &s1, const QSize &s2 )
+{ return QSize(s1.wd-s2.wd, s1.ht-s2.ht); }
+
+inline const QSize operator*( const QSize &s, int c )
+{ return QSize(s.wd*c, s.ht*c); }
+
+inline const QSize operator*( int c, const QSize &s )
+{ return QSize(s.wd*c, s.ht*c); }
+
+inline const QSize operator*( const QSize &s, double c )
+{ return QSize((QCOORD)(s.wd*c), (QCOORD)(s.ht*c)); }
+
+inline const QSize operator*( double c, const QSize &s )
+{ return QSize((QCOORD)(s.wd*c), (QCOORD)(s.ht*c)); }
+
+inline QSize &QSize::operator/=( int c )
+{
+
+    if ( c == 0 )
+        warningDivByZero();
+
+    wd/=(QCOORD)c; ht/=(QCOORD)c;
+    return *this;
+}
+
+inline QSize &QSize::operator/=( double c )
+{
+
+    if ( c == 0.0 )
+        warningDivByZero();
+
+    wd=(QCOORD)(wd/c); ht=(QCOORD)(ht/c);
+    return *this;
+}
+
+inline const QSize operator/( const QSize &s, int c )
+{
+
+    if ( c == 0 )
+        QSize::warningDivByZero();
+
+    return QSize(s.wd/c, s.ht/c);
+}
+
+inline const QSize operator/( const QSize &s, double c )
+{
+
+    if ( c == 0.0 )
+        QSize::warningDivByZero();
+
+    return QSize((QCOORD)(s.wd/c), (QCOORD)(s.ht/c));
+}
+
+inline QSize QSize::expandedTo( const QSize & otherSize ) const
+{
+    return QSize( ((otherSize.wd) < (wd) ? (wd) : (otherSize.wd)), ((otherSize.ht) < (ht) ? (ht) : (otherSize.ht)) );
+}
+
+inline QSize QSize::boundedTo( const QSize & otherSize ) const
+{
+    return QSize( ((wd) < (otherSize.wd) ? (wd) : (otherSize.wd)), ((ht) < (otherSize.ht) ? (ht) : (otherSize.ht)) );
+}
+
+
+
+
+
+
+
+class QRect
+{
+public:
+    QRect() { x1 = y1 = 0; x2 = y2 = -1; }
+    QRect( const QPoint &topleft, const QPoint &bottomright );
+    QRect( const QPoint &topleft, const QSize &size );
+    QRect( int left, int top, int width, int height );
+
+    bool isNull() const;
+    bool isEmpty() const;
+    bool isValid() const;
+    QRect normalize() const;
+
+    int left() const;
+    int top() const;
+    int right() const;
+    int bottom() const;
+
+    QCOORD &rLeft();
+    QCOORD &rTop();
+    QCOORD &rRight();
+    QCOORD &rBottom();
+
+    int x() const;
+    int y() const;
+    void setLeft( int pos );
+    void setTop( int pos );
+    void setRight( int pos );
+    void setBottom( int pos );
+    void setX( int x );
+    void setY( int y );
+
+    void setTopLeft( const QPoint &p );
+    void setBottomRight( const QPoint &p );
+    void setTopRight( const QPoint &p );
+    void setBottomLeft( const QPoint &p );
+
+    QPoint topLeft() const;
+    QPoint bottomRight() const;
+    QPoint topRight() const;
+    QPoint bottomLeft() const;
+    QPoint center() const;
+
+    void rect( int *x, int *y, int *w, int *h ) const;
+    void coords( int *x1, int *y1, int *x2, int *y2 ) const;
+
+    void moveLeft( int pos );
+    void moveTop( int pos );
+    void moveRight( int pos );
+    void moveBottom( int pos );
+    void moveTopLeft( const QPoint &p );
+    void moveBottomRight( const QPoint &p );
+    void moveTopRight( const QPoint &p );
+    void moveBottomLeft( const QPoint &p );
+    void moveCenter( const QPoint &p );
+    void moveBy( int dx, int dy );
+
+    void setRect( int x, int y, int w, int h );
+    void setCoords( int x1, int y1, int x2, int y2 );
+    void addCoords( int x1, int y1, int x2, int y2 );
+
+    QSize size() const;
+    int width() const;
+    int height() const;
+    void setWidth( int w );
+    void setHeight( int h );
+    void setSize( const QSize &s );
+
+    QRect operator|(const QRect &r) const;
+    QRect operator&(const QRect &r) const;
+    QRect& operator|=(const QRect &r);
+    QRect& operator&=(const QRect &r);
+
+    bool contains( const QPoint &p, bool proper=FALSE ) const;
+    bool contains( int x, int y ) const;
+    bool contains( int x, int y, bool proper ) const;
+    bool contains( const QRect &r, bool proper=FALSE ) const;
+    QRect unite( const QRect &r ) const;
+    QRect intersect( const QRect &r ) const;
+    bool intersects( const QRect &r ) const;
+
+    friend bool operator==( const QRect &, const QRect & );
+    friend bool operator!=( const QRect &, const QRect & );
+
+private:
+
+    friend void qt_setCoords( QRect *r, int xp1, int yp1, int xp2, int yp2 );
+
+
+
+
+
+
+
+    QCOORD x1;
+    QCOORD y1;
+    QCOORD x2;
+    QCOORD y2;
+
+};
+
+ bool operator==( const QRect &, const QRect & );
+ bool operator!=( const QRect &, const QRect & );
+
+
+
+
+
+
+ QDataStream &operator<<( QDataStream &, const QRect & );
+ QDataStream &operator>>( QDataStream &, QRect & );
+
+
+
+
+
+
+inline QRect::QRect( int left, int top, int width, int height )
+{
+    x1 = (QCOORD)left;
+    y1 = (QCOORD)top;
+    x2 = (QCOORD)(left+width-1);
+    y2 = (QCOORD)(top+height-1);
+}
+
+inline bool QRect::isNull() const
+{ return x2 == x1-1 && y2 == y1-1; }
+
+inline bool QRect::isEmpty() const
+{ return x1 > x2 || y1 > y2; }
+
+inline bool QRect::isValid() const
+{ return x1 <= x2 && y1 <= y2; }
+
+inline int QRect::left() const
+{ return x1; }
+
+inline int QRect::top() const
+{ return y1; }
+
+inline int QRect::right() const
+{ return x2; }
+
+inline int QRect::bottom() const
+{ return y2; }
+
+inline QCOORD &QRect::rLeft()
+{ return x1; }
+
+inline QCOORD & QRect::rTop()
+{ return y1; }
+
+inline QCOORD & QRect::rRight()
+{ return x2; }
+
+inline QCOORD & QRect::rBottom()
+{ return y2; }
+
+inline int QRect::x() const
+{ return x1; }
+
+inline int QRect::y() const
+{ return y1; }
+
+inline void QRect::setLeft( int pos )
+{ x1 = (QCOORD)pos; }
+
+inline void QRect::setTop( int pos )
+{ y1 = (QCOORD)pos; }
+
+inline void QRect::setRight( int pos )
+{ x2 = (QCOORD)pos; }
+
+inline void QRect::setBottom( int pos )
+{ y2 = (QCOORD)pos; }
+
+inline void QRect::setX( int x )
+{ x1 = (QCOORD)x; }
+
+inline void QRect::setY( int y )
+{ y1 = (QCOORD)y; }
+
+inline QPoint QRect::topLeft() const
+{ return QPoint(x1, y1); }
+
+inline QPoint QRect::bottomRight() const
+{ return QPoint(x2, y2); }
+
+inline QPoint QRect::topRight() const
+{ return QPoint(x2, y1); }
+
+inline QPoint QRect::bottomLeft() const
+{ return QPoint(x1, y2); }
+
+inline QPoint QRect::center() const
+{ return QPoint((x1+x2)/2, (y1+y2)/2); }
+
+inline int QRect::width() const
+{ return x2 - x1 + 1; }
+
+inline int QRect::height() const
+{ return y2 - y1 + 1; }
+
+inline QSize QRect::size() const
+{ return QSize(x2-x1+1, y2-y1+1); }
+
+inline bool QRect::contains( int x, int y, bool proper ) const
+{
+    if ( proper )
+        return x > x1 && x < x2 &&
+               y > y1 && y < y2;
+    else
+        return x >= x1 && x <= x2 &&
+               y >= y1 && y <= y2;
+}
+
+inline bool QRect::contains( int x, int y ) const
+{
+    return x >= x1 && x <= x2 &&
+           y >= y1 && y <= y2;
+}
+
+
+
+struct QRegionPrivate;
+
+
+class QRegion
+{
+public:
+    enum RegionType { Rectangle, Ellipse };
+
+    QRegion();
+    QRegion( int x, int y, int w, int h, RegionType = Rectangle );
+    QRegion( const QRect &, RegionType = Rectangle );
+    QRegion( const QPointArray &, bool winding=FALSE );
+    QRegion( const QRegion & );
+    QRegion( const QBitmap & );
+   ~QRegion();
+    QRegion &operator=( const QRegion & );
+
+    bool isNull() const;
+    bool isEmpty() const;
+
+    bool contains( const QPoint &p ) const;
+    bool contains( const QRect &r ) const;
+
+    void translate( int dx, int dy );
+
+    QRegion unite( const QRegion & ) const;
+    QRegion intersect( const QRegion &) const;
+    QRegion subtract( const QRegion & ) const;
+    QRegion eor( const QRegion & ) const;
+
+    QRect boundingRect() const;
+    QMemArray<QRect> rects() const;
+    void setRects( const QRect *, int );
+
+    const QRegion operator|( const QRegion & ) const;
+    const QRegion operator+( const QRegion & ) const;
+    const QRegion operator&( const QRegion & ) const;
+    const QRegion operator-( const QRegion & ) const;
+    const QRegion operator^( const QRegion & ) const;
+    QRegion& operator|=( const QRegion & );
+    QRegion& operator+=( const QRegion & );
+    QRegion& operator&=( const QRegion & );
+    QRegion& operator-=( const QRegion & );
+    QRegion& operator^=( const QRegion & );
+
+    bool operator==( const QRegion & ) const;
+    bool operator!=( const QRegion &r ) const
+                        { return !(operator==(r)); }
+
+
+
+
+    Region handle() const { if(!data->rgn) updateX11Region(); return data->rgn; }
+    friend QDataStream &operator<<( QDataStream &, const QRegion & );
+    friend QDataStream &operator>>( QDataStream &, QRegion & );
+
+private:
+    QRegion( bool );
+    QRegion copy() const;
+    void detach();
+
+
+
+
+    void updateX11Region() const;
+    void *clipRectangles( int &num ) const;
+    friend void *qt_getClipRects( const QRegion &, int & );
+
+    void exec( const QByteArray &, int ver = 0 );
+    struct QRegionData : public QShared {
+
+
+
+        Region rgn;
+        void *xrectangles;
+        QRegionPrivate *region;
+
+
+
+
+
+
+
+        bool is_null;
+    } *data;
+
+
+
+
+
+
+
+};
+
+
+
+
+
+
+
+
+
+ QDataStream &operator<<( QDataStream &, const QRegion & );
+ QDataStream &operator>>( QDataStream &, QRegion & );
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+class QIODevice
+{
+public:
+
+
+
+    typedef Q_ULONG Offset;
+
+
+    QIODevice();
+    virtual ~QIODevice();
+
+    int flags() const { return ioMode; }
+    int mode() const { return ioMode & 0x00ff; }
+    int state() const { return ioMode & 0xf000; }
+
+    bool isDirectAccess() const { return ((ioMode & 0x0100) == 0x0100); }
+    bool isSequentialAccess() const { return ((ioMode & 0x0200) == 0x0200); }
+    bool isCombinedAccess() const { return ((ioMode & 0x0300) == 0x0300); }
+    bool isBuffered() const { return ((ioMode & 0x0040) != 0x0040); }
+    bool isRaw() const { return ((ioMode & 0x0040) == 0x0040); }
+    bool isSynchronous() const { return ((ioMode & 0x0080) != 0x0080); }
+    bool isAsynchronous() const { return ((ioMode & 0x0080) == 0x0080); }
+    bool isTranslated() const { return ((ioMode & 0x0010) == 0x0010); }
+    bool isReadable() const { return ((ioMode & 0x0001) == 0x0001); }
+    bool isWritable() const { return ((ioMode & 0x0002) == 0x0002); }
+    bool isReadWrite() const { return ((ioMode & 0x0003) == 0x0003); }
+    bool isInactive() const { return state() == 0; }
+    bool isOpen() const { return state() == 0x1000; }
+
+    int status() const { return ioSt; }
+    void resetStatus() { ioSt = 0; }
+
+    virtual bool open( int mode ) = 0;
+    virtual void close() = 0;
+    virtual void flush() = 0;
+
+    virtual Offset size() const = 0;
+    virtual Offset at() const;
+    virtual bool at( Offset );
+    virtual bool atEnd() const;
+    bool reset() { return at(0); }
+
+    virtual Q_LONG readBlock( char *data, Q_ULONG maxlen ) = 0;
+    virtual Q_LONG writeBlock( const char *data, Q_ULONG len ) = 0;
+    virtual Q_LONG readLine( char *data, Q_ULONG maxlen );
+    Q_LONG writeBlock( const QByteArray& data );
+    virtual QByteArray readAll();
+
+    virtual int getch() = 0;
+    virtual int putch( int ) = 0;
+    virtual int ungetch( int ) = 0;
+
+protected:
+    void setFlags( int f ) { ioMode = f; }
+    void setType( int );
+    void setMode( int );
+    void setState( int );
+    void setStatus( int );
+    Offset ioIndex;
+
+private:
+    int ioMode;
+    int ioSt;
+
+private:
+
+    QIODevice( const QIODevice & );
+    QIODevice &operator=( const QIODevice & );
+
+};
+
+
+
+
+class QDataStream
+{
+public:
+    QDataStream();
+    QDataStream( QIODevice * );
+    QDataStream( QByteArray, int mode );
+    virtual ~QDataStream();
+
+    QIODevice *device() const;
+    void setDevice( QIODevice * );
+    void unsetDevice();
+
+    bool atEnd() const;
+    bool eof() const;
+
+    enum ByteOrder { BigEndian, LittleEndian };
+    int byteOrder() const;
+    void setByteOrder( int );
+
+    bool isPrintableData() const;
+    void setPrintableData( bool );
+
+    int version() const;
+    void setVersion( int );
+
+    QDataStream &operator>>( Q_INT8 &i );
+    QDataStream &operator>>( Q_UINT8 &i );
+    QDataStream &operator>>( Q_INT16 &i );
+    QDataStream &operator>>( Q_UINT16 &i );
+    QDataStream &operator>>( Q_INT32 &i );
+    QDataStream &operator>>( Q_UINT32 &i );
+    QDataStream &operator>>( Q_INT64 &i );
+    QDataStream &operator>>( Q_UINT64 &i );
+    QDataStream &operator>>( Q_LONG &i );
+    QDataStream &operator>>( Q_ULONG &i );
+
+    QDataStream &operator>>( float &f );
+    QDataStream &operator>>( double &f );
+    QDataStream &operator>>( char *&str );
+
+    QDataStream &operator<<( Q_INT8 i );
+    QDataStream &operator<<( Q_UINT8 i );
+    QDataStream &operator<<( Q_INT16 i );
+    QDataStream &operator<<( Q_UINT16 i );
+    QDataStream &operator<<( Q_INT32 i );
+    QDataStream &operator<<( Q_UINT32 i );
+    QDataStream &operator<<( Q_INT64 i );
+    QDataStream &operator<<( Q_UINT64 i );
+    QDataStream &operator<<( Q_LONG i );
+    QDataStream &operator<<( Q_ULONG i );
+    QDataStream &operator<<( float f );
+    QDataStream &operator<<( double f );
+    QDataStream &operator<<( const char *str );
+
+    QDataStream &readBytes( char *&, uint &len );
+    QDataStream &readRawBytes( char *, uint len );
+
+    QDataStream &writeBytes( const char *, uint len );
+    QDataStream &writeRawBytes( const char *, uint len );
+
+private:
+    QIODevice *dev;
+    bool owndev;
+    int byteorder;
+    bool printable;
+    bool noswap;
+    int ver;
+
+private:
+
+    QDataStream( const QDataStream & );
+    QDataStream &operator=( const QDataStream & );
+
+};
+
+
+
+
+
+
+inline QIODevice *QDataStream::device() const
+{ return dev; }
+
+inline bool QDataStream::atEnd() const
+{ return dev ? dev->atEnd() : TRUE; }
+
+inline bool QDataStream::eof() const
+{ return atEnd(); }
+
+inline int QDataStream::byteOrder() const
+{ return byteorder; }
+
+inline bool QDataStream::isPrintableData() const
+{ return printable; }
+
+inline void QDataStream::setPrintableData( bool p )
+{ printable = p; }
+
+inline int QDataStream::version() const
+{ return ver; }
+
+inline void QDataStream::setVersion( int v )
+{ ver = v; }
+
+inline QDataStream &QDataStream::operator>>( Q_UINT8 &i )
+{ return *this >> (Q_INT8&)i; }
+
+inline QDataStream &QDataStream::operator>>( Q_UINT16 &i )
+{ return *this >> (Q_INT16&)i; }
+
+inline QDataStream &QDataStream::operator>>( Q_UINT32 &i )
+{ return *this >> (Q_INT32&)i; }
+
+inline QDataStream &QDataStream::operator>>( Q_UINT64 &i )
+{ return *this >> (Q_INT64&)i; }
+
+inline QDataStream &QDataStream::operator>>( Q_ULONG &i )
+{ return *this >> (Q_LONG&)i; }
+
+inline QDataStream &QDataStream::operator<<( Q_UINT8 i )
+{ return *this << (Q_INT8)i; }
+
+inline QDataStream &QDataStream::operator<<( Q_UINT16 i )
+{ return *this << (Q_INT16)i; }
+
+inline QDataStream &QDataStream::operator<<( Q_UINT32 i )
+{ return *this << (Q_INT32)i; }
+
+inline QDataStream &QDataStream::operator<<( Q_UINT64 i )
+{ return *this << (Q_INT64)i; }
+
+inline QDataStream &QDataStream::operator<<( Q_ULONG i )
+{ return *this << (Q_LONG)i; }
+
+
+
+
+
+template <class T1, class T2>
+struct QPair
+{
+    typedef T1 first_type;
+    typedef T2 second_type;
+
+    QPair()
+        : first( T1() ), second( T2() )
+    {}
+    QPair( const T1& t1, const T2& t2 )
+        : first( t1 ), second( t2 )
+    {}
+
+    T1 first;
+    T2 second;
+};
+
+template <class T1, class T2>
+ bool operator==( const QPair<T1, T2>& x, const QPair<T1, T2>& y )
+{
+    return x.first == y.first && x.second == y.second;
+}
+
+template <class T1, class T2>
+ bool operator<( const QPair<T1, T2>& x, const QPair<T1, T2>& y )
+{
+    return x.first < y.first ||
+           ( !( y.first < x.first ) && x.second < y.second );
+}
+
+template <class T1, class T2>
+ QPair<T1, T2> qMakePair( const T1& x, const T2& y )
+{
+    return QPair<T1, T2>( x, y );
+}
+
+
+template <class T1, class T2>
+inline QDataStream& operator>>( QDataStream& s, QPair<T1, T2>& p )
+{
+    s >> p.first >> p.second;
+    return s;
+}
+
+template <class T1, class T2>
+inline QDataStream& operator<<( QDataStream& s, const QPair<T1, T2>& p )
+{
+    s << p.first << p.second;
+    return s;
+}
+
+
+
+
+
+
+
+
+
+
+extern "C" {
+
+
+
+
+
+
+
+
+
+
+
+typedef struct _IO_FILE FILE;
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef struct _IO_FILE __FILE;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef unsigned int wint_t;
+
+
+
+
+
+
+
+
+
+
+
+typedef struct
+{
+  int __count;
+  union
+  {
+    wint_t __wch;
+    char __wchb[4];
+  } __value;
+} __mbstate_t;
+
+typedef struct
+{
+  __off_t __pos;
+  __mbstate_t __state;
+} _G_fpos_t;
+typedef struct
+{
+  __off64_t __pos;
+  __mbstate_t __state;
+} _G_fpos64_t;
+
+
+
+
+
+
+
+enum
+{
+  __GCONV_OK = 0,
+  __GCONV_NOCONV,
+  __GCONV_NODB,
+  __GCONV_NOMEM,
+
+  __GCONV_EMPTY_INPUT,
+  __GCONV_FULL_OUTPUT,
+  __GCONV_ILLEGAL_INPUT,
+  __GCONV_INCOMPLETE_INPUT,
+
+  __GCONV_ILLEGAL_DESCRIPTOR,
+  __GCONV_INTERNAL_ERROR
+};
+
+
+
+enum
+{
+  __GCONV_IS_LAST = 0x0001,
+  __GCONV_IGNORE_ERRORS = 0x0002
+};
+
+
+
+struct __gconv_step;
+struct __gconv_step_data;
+struct __gconv_loaded_object;
+struct __gconv_trans_data;
+
+
+
+typedef int (*__gconv_fct) (struct __gconv_step *, struct __gconv_step_data *,
+                            __const unsigned char **, __const unsigned char *,
+                            unsigned char **, size_t *, int, int);
+
+
+typedef wint_t (*__gconv_btowc_fct) (struct __gconv_step *, unsigned char);
+
+
+typedef int (*__gconv_init_fct) (struct __gconv_step *);
+typedef void (*__gconv_end_fct) (struct __gconv_step *);
+
+
+
+typedef int (*__gconv_trans_fct) (struct __gconv_step *,
+                                  struct __gconv_step_data *, void *,
+                                  __const unsigned char *,
+                                  __const unsigned char **,
+                                  __const unsigned char *, unsigned char **,
+                                  size_t *);
+
+
+typedef int (*__gconv_trans_context_fct) (void *, __const unsigned char *,
+                                          __const unsigned char *,
+                                          unsigned char *, unsigned char *);
+
+
+typedef int (*__gconv_trans_query_fct) (__const char *, __const char ***,
+                                        size_t *);
+
+
+typedef int (*__gconv_trans_init_fct) (void **, const char *);
+typedef void (*__gconv_trans_end_fct) (void *);
+
+struct __gconv_trans_data
+{
+
+  __gconv_trans_fct __trans_fct;
+  __gconv_trans_context_fct __trans_context_fct;
+  __gconv_trans_end_fct __trans_end_fct;
+  void *__data;
+  struct __gconv_trans_data *__next;
+};
+
+
+
+struct __gconv_step
+{
+  struct __gconv_loaded_object *__shlib_handle;
+  __const char *__modname;
+
+  int __counter;
+
+  char *__from_name;
+  char *__to_name;
+
+  __gconv_fct __fct;
+  __gconv_btowc_fct __btowc_fct;
+  __gconv_init_fct __init_fct;
+  __gconv_end_fct __end_fct;
+
+
+
+  int __min_needed_from;
+  int __max_needed_from;
+  int __min_needed_to;
+  int __max_needed_to;
+
+
+  int __stateful;
+
+  void *__data;
+};
+
+
+
+struct __gconv_step_data
+{
+  unsigned char *__outbuf;
+  unsigned char *__outbufend;
+
+
+
+  int __flags;
+
+
+
+  int __invocation_counter;
+
+
+
+  int __internal_use;
+
+  __mbstate_t *__statep;
+  __mbstate_t __state;
+
+
+
+  struct __gconv_trans_data *__trans;
+};
+
+
+
+typedef struct __gconv_info
+{
+  size_t __nsteps;
+  struct __gconv_step *__steps;
+  __extension__ struct __gconv_step_data __data [];
+} *__gconv_t;
+typedef union
+{
+  struct __gconv_info __cd;
+  struct
+  {
+    struct __gconv_info __cd;
+    struct __gconv_step_data __data;
+  } __combined;
+} _G_iconv_t;
+
+typedef int _G_int16_t __attribute__ ((__mode__ (__HI__)));
+typedef int _G_int32_t __attribute__ ((__mode__ (__SI__)));
+typedef unsigned int _G_uint16_t __attribute__ ((__mode__ (__HI__)));
+typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__)));
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef __builtin_va_list __gnuc_va_list;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct _IO_jump_t; struct _IO_FILE;
+typedef void _IO_lock_t;
+
+
+
+
+
+struct _IO_marker {
+  struct _IO_marker *_next;
+  struct _IO_FILE *_sbuf;
+
+
+
+  int _pos;
+};
+
+
+enum __codecvt_result
+{
+  __codecvt_ok,
+  __codecvt_partial,
+  __codecvt_error,
+  __codecvt_noconv
+};
+struct _IO_FILE {
+  int _flags;
+
+
+
+  char* _IO_read_ptr;
+  char* _IO_read_end;
+  char* _IO_read_base;
+  char* _IO_write_base;
+  char* _IO_write_ptr;
+  char* _IO_write_end;
+  char* _IO_buf_base;
+  char* _IO_buf_end;
+
+  char *_IO_save_base;
+  char *_IO_backup_base;
+  char *_IO_save_end;
+
+  struct _IO_marker *_markers;
+
+  struct _IO_FILE *_chain;
+
+  int _fileno;
+
+
+
+  int _flags2;
+
+  __off_t _old_offset;
+
+
+  unsigned short _cur_column;
+  signed char _vtable_offset;
+  char _shortbuf[1];
+
+
+
+  _IO_lock_t *_lock;
+  __off64_t _offset;
+
+
+
+
+
+  void *__pad1;
+  void *__pad2;
+
+  int _mode;
+
+  char _unused2[15 * sizeof (int) - 2 * sizeof (void *)];
+
+};
+
+
+
+
+
+struct _IO_FILE_plus;
+
+extern struct _IO_FILE_plus _IO_2_1_stdin_;
+extern struct _IO_FILE_plus _IO_2_1_stdout_;
+extern struct _IO_FILE_plus _IO_2_1_stderr_;
+
+typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes);
+
+
+
+
+
+
+
+typedef __ssize_t __io_write_fn (void *__cookie, __const char *__buf,
+                                 size_t __n);
+
+
+
+
+
+
+
+typedef int __io_seek_fn (void *__cookie, __off64_t *__pos, int __w);
+
+
+typedef int __io_close_fn (void *__cookie);
+
+
+
+
+typedef __io_read_fn cookie_read_function_t;
+typedef __io_write_fn cookie_write_function_t;
+typedef __io_seek_fn cookie_seek_function_t;
+typedef __io_close_fn cookie_close_function_t;
+
+
+typedef struct
+{
+  __io_read_fn *read;
+  __io_write_fn *write;
+  __io_seek_fn *seek;
+  __io_close_fn *close;
+} _IO_cookie_io_functions_t;
+typedef _IO_cookie_io_functions_t cookie_io_functions_t;
+
+struct _IO_cookie_file;
+
+
+extern void _IO_cookie_init (struct _IO_cookie_file *__cfile, int __read_write,
+                             void *__cookie, _IO_cookie_io_functions_t __fns);
+
+
+
+
+extern "C" {
+
+
+extern int __underflow (_IO_FILE *) throw ();
+extern int __uflow (_IO_FILE *) throw ();
+extern int __overflow (_IO_FILE *, int) throw ();
+extern wint_t __wunderflow (_IO_FILE *) throw ();
+extern wint_t __wuflow (_IO_FILE *) throw ();
+extern wint_t __woverflow (_IO_FILE *, wint_t) throw ();
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern int _IO_getc (_IO_FILE *__fp) throw ();
+extern int _IO_putc (int __c, _IO_FILE *__fp) throw ();
+extern int _IO_feof (_IO_FILE *__fp) throw ();
+extern int _IO_ferror (_IO_FILE *__fp) throw ();
+
+extern int _IO_peekc_locked (_IO_FILE *__fp) throw ();
+
+
+
+
+extern void _IO_flockfile (_IO_FILE *) throw ();
+extern void _IO_funlockfile (_IO_FILE *) throw ();
+extern int _IO_ftrylockfile (_IO_FILE *) throw ();
+
+
+extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict,
+                        __gnuc_va_list, int *__restrict) throw ();
+extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict,
+                         __gnuc_va_list) throw ();
+extern __ssize_t _IO_padn (_IO_FILE *, int, __ssize_t) throw ();
+extern size_t _IO_sgetn (_IO_FILE *, void *, size_t) throw ();
+
+extern __off64_t _IO_seekoff (_IO_FILE *, __off64_t, int, int) throw ();
+extern __off64_t _IO_seekpos (_IO_FILE *, __off64_t, int) throw ();
+
+extern void _IO_free_backup_area (_IO_FILE *) throw ();
+}
+
+
+
+
+typedef __gnuc_va_list va_list;
+
+
+
+
+
+
+
+
+
+typedef _G_fpos_t fpos_t;
+
+
+
+
+
+typedef _G_fpos64_t fpos64_t;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern struct _IO_FILE *stdin;
+extern struct _IO_FILE *stdout;
+extern struct _IO_FILE *stderr;
+
+
+
+
+extern int remove (__const char *__filename) throw ();
+
+extern int rename (__const char *__old, __const char *__new) throw ();
+
+
+
+
+
+
+extern FILE *tmpfile (void) throw ();
+extern char *tmpnam (char *__s) throw ();
+
+
+
+extern FILE *tmpfile64 (void) throw ();
+
+
+
+
+
+extern char *tmpnam_r (char *__s) throw ();
+extern char *tempnam (__const char *__dir, __const char *__pfx)
+     throw () __attribute__ ((__malloc__));
+
+
+
+
+
+extern int fclose (FILE *__stream) throw ();
+
+extern int fflush (FILE *__stream) throw ();
+
+
+
+
+extern int fflush_unlocked (FILE *__stream) throw ();
+
+
+
+
+extern int fcloseall (void) throw ();
+
+
+
+
+
+
+extern FILE *fopen (__const char *__restrict __filename,
+                    __const char *__restrict __modes) throw ();
+
+extern FILE *freopen (__const char *__restrict __filename,
+                      __const char *__restrict __modes,
+                      FILE *__restrict __stream) throw ();
+
+
+extern FILE *fopen64 (__const char *__restrict __filename,
+                      __const char *__restrict __modes) throw ();
+extern FILE *freopen64 (__const char *__restrict __filename,
+                        __const char *__restrict __modes,
+                        FILE *__restrict __stream) throw ();
+
+
+
+
+extern FILE *fdopen (int __fd, __const char *__modes) throw ();
+
+
+
+
+
+extern FILE *fopencookie (void *__restrict __magic_cookie,
+                          __const char *__restrict __modes,
+                          _IO_cookie_io_functions_t __io_funcs) throw ();
+
+
+extern FILE *fmemopen (void *__s, size_t __len, __const char *__modes) throw ();
+
+
+
+
+extern FILE *open_memstream (char **__restrict __bufloc,
+                             size_t *__restrict __sizeloc) throw ();
+
+
+
+
+
+
+extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) throw ();
+
+
+
+extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
+                    int __modes, size_t __n) throw ();
+
+
+
+
+
+extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
+                       size_t __size) throw ();
+
+
+extern void setlinebuf (FILE *__stream) throw ();
+
+
+
+
+
+extern int fprintf (FILE *__restrict __stream,
+                    __const char *__restrict __format, ...) throw ();
+
+extern int printf (__const char *__restrict __format, ...) throw ();
+
+extern int sprintf (char *__restrict __s,
+                    __const char *__restrict __format, ...) throw ();
+
+
+extern int vfprintf (FILE *__restrict __s, __const char *__restrict __format,
+                     __gnuc_va_list __arg) throw ();
+
+extern int vprintf (__const char *__restrict __format, __gnuc_va_list __arg)
+     throw ();
+
+extern int vsprintf (char *__restrict __s, __const char *__restrict __format,
+                     __gnuc_va_list __arg) throw ();
+
+
+
+
+
+extern int snprintf (char *__restrict __s, size_t __maxlen,
+                     __const char *__restrict __format, ...)
+     throw () __attribute__ ((__format__ (__printf__, 3, 4)));
+
+extern int vsnprintf (char *__restrict __s, size_t __maxlen,
+                      __const char *__restrict __format, __gnuc_va_list __arg)
+     throw () __attribute__ ((__format__ (__printf__, 3, 0)));
+
+
+
+
+
+
+extern int vasprintf (char **__restrict __ptr, __const char *__restrict __f,
+                      __gnuc_va_list __arg)
+     throw () __attribute__ ((__format__ (__printf__, 2, 0)));
+extern int __asprintf (char **__restrict __ptr,
+                       __const char *__restrict __fmt, ...)
+     throw () __attribute__ ((__format__ (__printf__, 2, 3)));
+extern int asprintf (char **__restrict __ptr,
+                     __const char *__restrict __fmt, ...)
+     throw () __attribute__ ((__format__ (__printf__, 2, 3)));
+
+
+extern int vdprintf (int __fd, __const char *__restrict __fmt,
+                     __gnuc_va_list __arg)
+     throw () __attribute__ ((__format__ (__printf__, 2, 0)));
+extern int dprintf (int __fd, __const char *__restrict __fmt, ...)
+     throw () __attribute__ ((__format__ (__printf__, 2, 3)));
+
+
+
+
+
+extern int fscanf (FILE *__restrict __stream,
+                   __const char *__restrict __format, ...) throw ();
+
+extern int scanf (__const char *__restrict __format, ...) throw ();
+
+extern int sscanf (__const char *__restrict __s,
+                   __const char *__restrict __format, ...) throw ();
+
+
+
+
+
+extern int vfscanf (FILE *__restrict __s, __const char *__restrict __format,
+                    __gnuc_va_list __arg)
+     throw () __attribute__ ((__format__ (__scanf__, 2, 0)));
+
+
+extern int vscanf (__const char *__restrict __format, __gnuc_va_list __arg)
+     throw () __attribute__ ((__format__ (__scanf__, 1, 0)));
+
+
+extern int vsscanf (__const char *__restrict __s,
+                    __const char *__restrict __format, __gnuc_va_list __arg)
+     throw () __attribute__ ((__format__ (__scanf__, 2, 0)));
+
+
+
+
+
+
+extern int fgetc (FILE *__stream) throw ();
+extern int getc (FILE *__stream) throw ();
+
+
+extern int getchar (void) throw ();
+
+
+
+
+
+
+
+extern int getc_unlocked (FILE *__stream) throw ();
+extern int getchar_unlocked (void) throw ();
+
+
+
+
+extern int fgetc_unlocked (FILE *__stream) throw ();
+
+
+
+
+
+extern int fputc (int __c, FILE *__stream) throw ();
+extern int putc (int __c, FILE *__stream) throw ();
+
+
+extern int putchar (int __c) throw ();
+
+
+
+
+
+
+
+extern int fputc_unlocked (int __c, FILE *__stream) throw ();
+
+
+
+
+extern int putc_unlocked (int __c, FILE *__stream) throw ();
+extern int putchar_unlocked (int __c) throw ();
+
+
+
+
+
+extern int getw (FILE *__stream) throw ();
+
+
+extern int putw (int __w, FILE *__stream) throw ();
+
+
+
+
+
+extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
+     throw ();
+
+
+
+extern char *gets (char *__s) throw ();
+
+
+
+
+extern char *fgets_unlocked (char *__restrict __s, int __n,
+                             FILE *__restrict __stream) throw ();
+extern __ssize_t __getdelim (char **__restrict __lineptr,
+                               size_t *__restrict __n, int __delimiter,
+                               FILE *__restrict __stream) throw ();
+extern __ssize_t getdelim (char **__restrict __lineptr,
+                             size_t *__restrict __n, int __delimiter,
+                             FILE *__restrict __stream) throw ();
+
+
+extern __ssize_t getline (char **__restrict __lineptr,
+                            size_t *__restrict __n,
+                            FILE *__restrict __stream) throw ();
+
+
+
+
+
+extern int fputs (__const char *__restrict __s, FILE *__restrict __stream)
+     throw ();
+
+
+extern int puts (__const char *__s) throw ();
+
+
+
+extern int ungetc (int __c, FILE *__stream) throw ();
+
+
+
+extern size_t fread (void *__restrict __ptr, size_t __size,
+                     size_t __n, FILE *__restrict __stream) throw ();
+
+extern size_t fwrite (__const void *__restrict __ptr, size_t __size,
+                      size_t __n, FILE *__restrict __s) throw ();
+
+
+
+
+extern int fputs_unlocked (__const char *__restrict __s,
+                           FILE *__restrict __stream) throw ();
+
+
+
+
+extern size_t fread_unlocked (void *__restrict __ptr, size_t __size,
+                              size_t __n, FILE *__restrict __stream) throw ();
+extern size_t fwrite_unlocked (__const void *__restrict __ptr, size_t __size,
+                               size_t __n, FILE *__restrict __stream) throw ();
+
+
+
+
+
+extern int fseek (FILE *__stream, long int __off, int __whence) throw ();
+
+extern long int ftell (FILE *__stream) throw ();
+
+extern void rewind (FILE *__stream) throw ();
+
+extern int fseeko (FILE *__stream, __off_t __off, int __whence) throw ();
+
+extern __off_t ftello (FILE *__stream) throw ();
+
+
+
+extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos)
+     throw ();
+
+extern int fsetpos (FILE *__stream, __const fpos_t *__pos) throw ();
+
+
+
+extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence) throw ();
+extern __off64_t ftello64 (FILE *__stream) throw ();
+extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos)
+     throw ();
+extern int fsetpos64 (FILE *__stream, __const fpos64_t *__pos) throw ();
+
+
+
+
+extern void clearerr (FILE *__stream) throw ();
+
+extern int feof (FILE *__stream) throw ();
+
+extern int ferror (FILE *__stream) throw ();
+
+
+
+
+extern void clearerr_unlocked (FILE *__stream) throw ();
+extern int feof_unlocked (FILE *__stream) throw ();
+extern int ferror_unlocked (FILE *__stream) throw ();
+
+
+
+
+
+extern void perror (__const char *__s) throw ();
+
+
+
+
+
+
+extern int sys_nerr;
+extern __const char *__const sys_errlist[];
+
+
+extern int _sys_nerr;
+extern __const char *__const _sys_errlist[];
+
+
+
+
+extern int fileno (FILE *__stream) throw ();
+
+
+
+
+extern int fileno_unlocked (FILE *__stream) throw ();
+
+
+
+
+
+
+extern FILE *popen (__const char *__command, __const char *__modes) throw ();
+
+
+extern int pclose (FILE *__stream) throw ();
+
+
+
+
+
+extern char *ctermid (char *__s) throw ();
+
+
+
+
+
+extern char *cuserid (char *__s) throw ();
+
+
+
+
+struct obstack;
+
+
+extern int obstack_printf (struct obstack *__restrict __obstack,
+                           __const char *__restrict __format, ...)
+     throw () __attribute__ ((__format__ (__printf__, 2, 3)));
+extern int obstack_vprintf (struct obstack *__restrict __obstack,
+                            __const char *__restrict __format,
+                            __gnuc_va_list __args)
+     throw () __attribute__ ((__format__ (__printf__, 2, 0)));
+
+
+
+
+
+
+
+extern void flockfile (FILE *__stream) throw ();
+
+
+
+extern int ftrylockfile (FILE *__stream) throw ();
+
+
+extern void funlockfile (FILE *__stream) throw ();
+}
+
+
+
+class QTextCodec;
+class QTextDecoder;
+
+class QTextStreamPrivate;
+
+class QTextStream
+{
+public:
+    enum Encoding { Locale, Latin1, Unicode, UnicodeNetworkOrder,
+                    UnicodeReverse, RawUnicode, UnicodeUTF8 };
+
+    void setEncoding( Encoding );
+
+    void setCodec( QTextCodec* );
+    QTextCodec *codec();
+
+
+    QTextStream();
+    QTextStream( QIODevice * );
+    QTextStream( QString*, int mode );
+    QTextStream( QString&, int mode );
+    QTextStream( QByteArray, int mode );
+    QTextStream( FILE *, int mode );
+    virtual ~QTextStream();
+
+    QIODevice *device() const;
+    void setDevice( QIODevice * );
+    void unsetDevice();
+
+    bool atEnd() const;
+    bool eof() const;
+
+    QTextStream &operator>>( QChar & );
+    QTextStream &operator>>( char & );
+    QTextStream &operator>>( signed short & );
+    QTextStream &operator>>( unsigned short & );
+    QTextStream &operator>>( signed int & );
+    QTextStream &operator>>( unsigned int & );
+    QTextStream &operator>>( signed long & );
+    QTextStream &operator>>( unsigned long & );
+    QTextStream &operator>>( float & );
+    QTextStream &operator>>( double & );
+    QTextStream &operator>>( char * );
+    QTextStream &operator>>( QString & );
+    QTextStream &operator>>( QCString & );
+
+    QTextStream &operator<<( QChar );
+    QTextStream &operator<<( char );
+    QTextStream &operator<<( signed short );
+    QTextStream &operator<<( unsigned short );
+    QTextStream &operator<<( signed int );
+    QTextStream &operator<<( unsigned int );
+    QTextStream &operator<<( signed long );
+    QTextStream &operator<<( unsigned long );
+    QTextStream &operator<<( float );
+    QTextStream &operator<<( double );
+    QTextStream &operator<<( const char* );
+    QTextStream &operator<<( const QString & );
+    QTextStream &operator<<( const QCString & );
+    QTextStream &operator<<( void * );
+
+    QTextStream &readRawBytes( char *, uint len );
+    QTextStream &writeRawBytes( const char* , uint len );
+
+    QString readLine();
+    QString read();
+    void skipWhiteSpace();
+
+    enum {
+        skipws = 0x0001,
+        left = 0x0002,
+        right = 0x0004,
+        internal = 0x0008,
+        bin = 0x0010,
+        oct = 0x0020,
+        dec = 0x0040,
+        hex = 0x0080,
+        showbase = 0x0100,
+        showpoint = 0x0200,
+        uppercase = 0x0400,
+        showpos = 0x0800,
+        scientific= 0x1000,
+        fixed = 0x2000
+    };
+
+    static const int basefield;
+    static const int adjustfield;
+    static const int floatfield;
+
+    int flags() const;
+    int flags( int f );
+    int setf( int bits );
+    int setf( int bits, int mask );
+    int unsetf( int bits );
+
+    void reset();
+
+    int width() const;
+    int width( int );
+    int fill() const;
+    int fill( int );
+    int precision() const;
+    int precision( int );
+
+private:
+    long input_int();
+    void init();
+    QTextStream &output_int( int, ulong, bool );
+    QIODevice *dev;
+
+    int fflags;
+    int fwidth;
+    int fillchar;
+    int fprec;
+    bool doUnicodeHeader;
+    bool owndev;
+    QTextCodec *mapper;
+    QTextStreamPrivate * d;
+    QChar unused1;
+    bool latin1;
+    bool internalOrder;
+    bool networkOrder;
+    void *unused2;
+
+    QChar eat_ws();
+    uint ts_getline( QChar* );
+    void ts_ungetc( QChar );
+    QChar ts_getc();
+    uint ts_getbuf( QChar*, uint );
+    void ts_putc(int);
+    void ts_putc(QChar);
+    bool ts_isspace(QChar);
+    bool ts_isdigit(QChar);
+    ulong input_bin();
+    ulong input_oct();
+    ulong input_dec();
+    ulong input_hex();
+    double input_double();
+    QTextStream &writeBlock( const char* p, uint len );
+    QTextStream &writeBlock( const QChar* p, uint len );
+
+private:
+
+    QTextStream( const QTextStream & );
+    QTextStream &operator=( const QTextStream & );
+
+};
+
+typedef QTextStream QTS;
+
+class QTextIStream : public QTextStream {
+public:
+    QTextIStream( const QString* s ) :
+        QTextStream((QString*)s,0x0001) { }
+    QTextIStream( QByteArray ba ) :
+        QTextStream(ba,0x0001) { }
+    QTextIStream( FILE *f ) :
+        QTextStream(f,0x0001) { }
+
+private:
+
+    QTextIStream( const QTextIStream & );
+    QTextIStream &operator=( const QTextIStream & );
+
+};
+
+class QTextOStream : public QTextStream {
+public:
+    QTextOStream( QString* s ) :
+        QTextStream(s,0x0002) { }
+    QTextOStream( QByteArray ba ) :
+        QTextStream(ba,0x0002) { }
+    QTextOStream( FILE *f ) :
+        QTextStream(f,0x0002) { }
+
+private:
+
+    QTextOStream( const QTextOStream & );
+    QTextOStream &operator=( const QTextOStream & );
+
+};
+
+
+
+
+
+inline QIODevice *QTextStream::device() const
+{ return dev; }
+
+inline bool QTextStream::atEnd() const
+{ return dev ? dev->atEnd() : FALSE; }
+
+inline bool QTextStream::eof() const
+{ return atEnd(); }
+
+inline int QTextStream::flags() const
+{ return fflags; }
+
+inline int QTextStream::flags( int f )
+{ int oldf = fflags; fflags = f; return oldf; }
+
+inline int QTextStream::setf( int bits )
+{ int oldf = fflags; fflags |= bits; return oldf; }
+
+inline int QTextStream::setf( int bits, int mask )
+{ int oldf = fflags; fflags = (fflags & ~mask) | (bits & mask); return oldf; }
+
+inline int QTextStream::unsetf( int bits )
+{ int oldf = fflags; fflags &= ~bits; return oldf; }
+
+inline int QTextStream::width() const
+{ return fwidth; }
+
+inline int QTextStream::width( int w )
+{ int oldw = fwidth; fwidth = w; return oldw; }
+
+inline int QTextStream::fill() const
+{ return fillchar; }
+
+inline int QTextStream::fill( int f )
+{ int oldc = fillchar; fillchar = f; return oldc; }
+
+inline int QTextStream::precision() const
+{ return fprec; }
+
+inline int QTextStream::precision( int p )
+{ int oldp = fprec; fprec = p; return oldp; }
+
+
+
+
+inline QChar QTextStream::ts_getc()
+{ QChar r; return ( ts_getbuf( &r,1 ) == 1 ? r : QChar((ushort)0xffff) ); }
+
+
+
+
+
+typedef QTextStream & (*QTSFUNC)(QTextStream &);
+typedef int (QTextStream::*QTSMFI)(int);
+
+class QTSManip {
+public:
+    QTSManip( QTSMFI m, int a ) { mf=m; arg=a; }
+    void exec( QTextStream &s ) { (s.*mf)(arg); }
+private:
+    QTSMFI mf;
+    int arg;
+};
+
+ inline QTextStream &operator>>( QTextStream &s, QTSFUNC f )
+{ return (*f)( s ); }
+
+ inline QTextStream &operator<<( QTextStream &s, QTSFUNC f )
+{ return (*f)( s ); }
+
+ inline QTextStream &operator<<( QTextStream &s, QTSManip m )
+{ m.exec(s); return s; }
+
+ QTextStream &bin( QTextStream &s );
+ QTextStream &oct( QTextStream &s );
+ QTextStream &dec( QTextStream &s );
+ QTextStream &hex( QTextStream &s );
+ QTextStream &endl( QTextStream &s );
+ QTextStream &flush( QTextStream &s );
+ QTextStream &ws( QTextStream &s );
+ QTextStream &reset( QTextStream &s );
+
+ inline QTSManip qSetW( int w )
+{
+    QTSMFI func = &QTextStream::width;
+    return QTSManip(func,w);
+}
+
+ inline QTSManip qSetFill( int f )
+{
+    QTSMFI func = &QTextStream::fill;
+    return QTSManip(func,f);
+}
+
+ inline QTSManip qSetPrecision( int p )
+{
+    QTSMFI func = &QTextStream::precision;
+    return QTSManip(func,p);
+}
+
+
+
+
+template <class T>
+class QTextOStreamIterator
+{
+protected:
+    QTextOStream& stream;
+    QString separator;
+
+public:
+    QTextOStreamIterator( QTextOStream& s) : stream( s ) {}
+    QTextOStreamIterator( QTextOStream& s, const QString& sep )
+        : stream( s ), separator( sep ) {}
+    QTextOStreamIterator<T>& operator= ( const T& x ) {
+        stream << x;
+        if ( !separator.isEmpty() )
+            stream << separator;
+        return *this;
+    }
+    QTextOStreamIterator<T>& operator*() { return *this; }
+    QTextOStreamIterator<T>& operator++() { return *this; }
+    QTextOStreamIterator<T>& operator++(int) { return *this; }
+};
+
+
+template <class InputIterator, class OutputIterator>
+inline OutputIterator qCopy( InputIterator _begin, InputIterator _end,
+                             OutputIterator _dest )
+{
+    while( _begin != _end )
+        *_dest++ = *_begin++;
+    return _dest;
+}
+
+template <class BiIterator, class BiOutputIterator>
+inline BiOutputIterator qCopyBackward( BiIterator _begin, BiIterator _end,
+                                       BiOutputIterator _dest )
+{
+    while ( _begin != _end )
+        *--_dest = *--_end;
+    return _dest;
+}
+
+template <class InputIterator1, class InputIterator2>
+inline bool qEqual( InputIterator1 first1, InputIterator1 last1, InputIterator2 first2 )
+{
+
+    for ( ; first1 != last1; ++first1, ++first2 )
+        if ( *first1 != *first2 )
+            return FALSE;
+    return TRUE;
+}
+
+template <class ForwardIterator, class T>
+inline void qFill( ForwardIterator first, ForwardIterator last, const T& val )
+{
+    for ( ; first != last; ++first )
+        *first = val;
+}
+template <class InputIterator, class T>
+inline InputIterator qFind( InputIterator first, InputIterator last,
+                            const T& val )
+{
+    while ( first != last && *first != val )
+        ++first;
+    return first;
+}
+
+template <class InputIterator, class T, class Size>
+inline void qCount( InputIterator first, InputIterator last, const T& value,
+                    Size& n )
+{
+    for ( ; first != last; ++first )
+        if ( *first == value )
+            ++n;
+}
+
+template <class T>
+inline void qSwap( T& _value1, T& _value2 )
+{
+    T tmp = _value1;
+    _value1 = _value2;
+    _value2 = tmp;
+}
+
+
+template <class InputIterator>
+ void qBubbleSort( InputIterator b, InputIterator e )
+{
+
+    InputIterator last = e;
+    --last;
+
+    if ( last == b )
+        return;
+
+
+    while( b != last ) {
+        bool swapped = FALSE;
+        InputIterator swap_pos = b;
+        InputIterator x = e;
+        InputIterator y = x;
+        y--;
+        do {
+            --x;
+            --y;
+            if ( *x < *y ) {
+                swapped = TRUE;
+                qSwap( *x, *y );
+                swap_pos = y;
+            }
+        } while( y != b );
+        if ( !swapped )
+            return;
+        b = swap_pos;
+        b++;
+    }
+}
+
+
+template <class Container>
+inline void qBubbleSort( Container &c )
+{
+  qBubbleSort( c.begin(), c.end() );
+}
+
+
+template <class Value>
+ void qHeapSortPushDown( Value* heap, int first, int last )
+{
+    int r = first;
+    while ( r <= last / 2 ) {
+        if ( last == 2 * r ) {
+
+            if ( heap[2 * r] < heap[r] )
+                qSwap( heap[r], heap[2 * r] );
+            r = last;
+        } else {
+
+            if ( heap[2 * r] < heap[r] && !(heap[2 * r + 1] < heap[2 * r]) ) {
+
+                qSwap( heap[r], heap[2 * r] );
+                r *= 2;
+            } else if ( heap[2 * r + 1] < heap[r]
+                        && heap[2 * r + 1] < heap[2 * r] ) {
+
+                qSwap( heap[r], heap[2 * r + 1] );
+                r = 2 * r + 1;
+            } else {
+                r = last;
+            }
+        }
+    }
+}
+
+
+template <class InputIterator, class Value>
+ void qHeapSortHelper( InputIterator b, InputIterator e, Value, uint n )
+{
+
+    InputIterator insert = b;
+    Value* realheap = new Value[n];
+
+    Value* heap = realheap - 1;
+    int size = 0;
+    for( ; insert != e; ++insert ) {
+        heap[++size] = *insert;
+        int i = size;
+        while( i > 1 && heap[i] < heap[i / 2] ) {
+            qSwap( heap[i], heap[i / 2] );
+            i /= 2;
+        }
+    }
+
+
+    for( uint i = n; i > 0; i-- ) {
+        *b++ = heap[1];
+        if ( i > 1 ) {
+            heap[1] = heap[i];
+            qHeapSortPushDown( heap, 1, (int)i - 1 );
+        }
+    }
+
+    delete[] realheap;
+}
+
+
+template <class InputIterator>
+ void qHeapSort( InputIterator b, InputIterator e )
+{
+
+    if ( b == e )
+        return;
+
+
+    InputIterator it = b;
+    uint n = 0;
+    while ( it != e ) {
+        ++n;
+        ++it;
+    }
+
+
+
+    qHeapSortHelper( b, e, *b, n );
+}
+
+
+template <class Container>
+ void qHeapSort( Container &c )
+{
+    if ( c.begin() == c.end() )
+        return;
+
+
+
+    qHeapSortHelper( c.begin(), c.end(), *(c.begin()), (uint)c.count() );
+}
+
+template <class Container>
+class QBackInsertIterator
+{
+public:
+    explicit QBackInsertIterator( Container &c )
+        : container( &c )
+    {
+    }
+
+    QBackInsertIterator<Container>&
+    operator=( const typename Container::value_type &value )
+    {
+        container->push_back( value );
+        return *this;
+    }
+
+    QBackInsertIterator<Container>& operator*()
+    {
+        return *this;
+    }
+
+    QBackInsertIterator<Container>& operator++()
+    {
+        return *this;
+    }
+
+    QBackInsertIterator<Container>& operator++(int)
+    {
+        return *this;
+    }
+
+protected:
+    Container *container;
+};
+
+template <class Container>
+inline QBackInsertIterator<Container> qBackInserter( Container &c )
+{
+    return QBackInsertIterator<Container>( c );
+}
+template <class T>
+class QValueListNode
+{
+public:
+    QValueListNode( const T& t ) : data( t ) { }
+    QValueListNode() { }
+
+
+
+
+
+    QValueListNode<T>* next;
+    QValueListNode<T>* prev;
+    T data;
+};
+
+template<class T>
+class QValueListIterator
+{
+ public:
+
+
+
+    typedef QValueListNode<T>* NodePtr;
+
+
+
+    typedef T value_type;
+    typedef size_t size_type;
+
+
+
+    typedef int difference_type;
+
+    typedef T* pointer;
+    typedef T& reference;
+
+
+
+
+    NodePtr node;
+
+
+
+
+    QValueListIterator() : node( 0 ) {}
+    QValueListIterator( NodePtr p ) : node( p ) {}
+    QValueListIterator( const QValueListIterator<T>& it ) : node( it.node ) {}
+
+    bool operator==( const QValueListIterator<T>& it ) const { return node == it.node; }
+    bool operator!=( const QValueListIterator<T>& it ) const { return node != it.node; }
+    const T& operator*() const { return node->data; }
+    T& operator*() { return node->data; }
+
+
+
+    QValueListIterator<T>& operator++() {
+        node = node->next;
+        return *this;
+    }
+
+    QValueListIterator<T> operator++(int) {
+        QValueListIterator<T> tmp = *this;
+        node = node->next;
+        return tmp;
+    }
+
+    QValueListIterator<T>& operator--() {
+        node = node->prev;
+        return *this;
+    }
+
+    QValueListIterator<T> operator--(int) {
+        QValueListIterator<T> tmp = *this;
+        node = node->prev;
+        return tmp;
+    }
+
+    QValueListIterator<T>& operator+=( int j ) {
+        while ( j-- )
+            node = node->next;
+        return *this;
+    }
+
+    QValueListIterator<T>& operator-=( int j ) {
+        while ( j-- )
+            node = node->prev;
+        return *this;
+    }
+
+};
+
+template<class T>
+class QValueListConstIterator
+{
+ public:
+
+
+
+    typedef QValueListNode<T>* NodePtr;
+
+
+
+    typedef T value_type;
+    typedef size_t size_type;
+
+
+
+    typedef int difference_type;
+
+    typedef const T* pointer;
+    typedef const T& reference;
+
+
+
+
+    NodePtr node;
+
+
+
+
+    QValueListConstIterator() : node( 0 ) {}
+    QValueListConstIterator( NodePtr p ) : node( p ) {}
+    QValueListConstIterator( const QValueListConstIterator<T>& it ) : node( it.node ) {}
+    QValueListConstIterator( const QValueListIterator<T>& it ) : node( it.node ) {}
+
+    bool operator==( const QValueListConstIterator<T>& it ) const { return node == it.node; }
+    bool operator!=( const QValueListConstIterator<T>& it ) const { return node != it.node; }
+    const T& operator*() const { return node->data; }
+
+
+
+    QValueListConstIterator<T>& operator++() {
+        node = node->next;
+        return *this;
+    }
+
+    QValueListConstIterator<T> operator++(int) {
+        QValueListConstIterator<T> tmp = *this;
+        node = node->next;
+        return tmp;
+    }
+
+    QValueListConstIterator<T>& operator--() {
+        node = node->prev;
+        return *this;
+    }
+
+    QValueListConstIterator<T> operator--(int) {
+        QValueListConstIterator<T> tmp = *this;
+        node = node->prev;
+        return tmp;
+    }
+};
+
+template <class T>
+class QValueListPrivate : public QShared
+{
+public:
+
+
+
+    typedef QValueListIterator<T> Iterator;
+    typedef QValueListConstIterator<T> ConstIterator;
+    typedef QValueListNode<T> Node;
+    typedef QValueListNode<T>* NodePtr;
+    typedef size_t size_type;
+
+
+
+
+    QValueListPrivate();
+    QValueListPrivate( const QValueListPrivate<T>& _p );
+
+    void derefAndDelete()
+    {
+        if ( deref() )
+            delete this;
+    }
+
+
+
+
+
+    ~QValueListPrivate();
+
+    Iterator insert( Iterator it, const T& x );
+    Iterator remove( Iterator it );
+    NodePtr find( NodePtr start, const T& x ) const;
+    int findIndex( NodePtr start, const T& x ) const;
+    uint contains( const T& x ) const;
+    uint remove( const T& x );
+    NodePtr at( size_type i ) const;
+    void clear();
+
+    NodePtr node;
+    size_type nodes;
+};
+
+template <class T>
+ QValueListPrivate<T>::QValueListPrivate()
+{
+    node = new Node; node->next = node->prev = node; nodes = 0;
+}
+
+template <class T>
+ QValueListPrivate<T>::QValueListPrivate( const QValueListPrivate<T>& _p )
+    : QShared()
+{
+    node = new Node; node->next = node->prev = node; nodes = 0;
+    Iterator b( _p.node->next );
+    Iterator e( _p.node );
+    Iterator i( node );
+    while( b != e )
+        insert( i, *b++ );
+}
+
+template <class T>
+ QValueListPrivate<T>::~QValueListPrivate() {
+    NodePtr p = node->next;
+    while( p != node ) {
+        NodePtr x = p->next;
+        delete p;
+        p = x;
+    }
+    delete node;
+}
+
+template <class T>
+ typename QValueListPrivate<T>::Iterator QValueListPrivate<T>::insert( typename QValueListPrivate<T>::Iterator it, const T& x )
+{
+    NodePtr p = new Node( x );
+    p->next = it.node;
+    p->prev = it.node->prev;
+    it.node->prev->next = p;
+    it.node->prev = p;
+    nodes++;
+    return p;
+}
+
+template <class T>
+ typename QValueListPrivate<T>::Iterator QValueListPrivate<T>::remove( typename QValueListPrivate<T>::Iterator it )
+{
+    ((it.node != node) ? (void)0 : qWarning("ASSERT: \"%s\" in %s (%d)","it.node != node","/coolo/prod/qt-copy/include/qvaluelist.h",301));
+    NodePtr next = it.node->next;
+    NodePtr prev = it.node->prev;
+    prev->next = next;
+    next->prev = prev;
+    delete it.node;
+    nodes--;
+    return Iterator( next );
+}
+
+template <class T>
+ typename QValueListPrivate<T>::NodePtr QValueListPrivate<T>::find( typename QValueListPrivate<T>::NodePtr start, const T& x ) const
+{
+    ConstIterator first( start );
+    ConstIterator last( node );
+    while( first != last) {
+        if ( *first == x )
+            return first.node;
+        ++first;
+    }
+    return last.node;
+}
+
+template <class T>
+ int QValueListPrivate<T>::findIndex( typename QValueListPrivate<T>::NodePtr start, const T& x ) const
+{
+    ConstIterator first( start );
+    ConstIterator last( node );
+    int pos = 0;
+    while( first != last) {
+        if ( *first == x )
+            return pos;
+        ++first;
+        ++pos;
+    }
+    return -1;
+}
+
+template <class T>
+ uint QValueListPrivate<T>::contains( const T& x ) const
+{
+    uint result = 0;
+    Iterator first = Iterator( node->next );
+    Iterator last = Iterator( node );
+    while( first != last) {
+        if ( *first == x )
+            ++result;
+        ++first;
+    }
+    return result;
+}
+
+template <class T>
+ uint QValueListPrivate<T>::remove( const T& x )
+{
+    uint result = 0;
+    Iterator first = Iterator( node->next );
+    Iterator last = Iterator( node );
+    while( first != last) {
+        if ( *first == x ) {
+            first = remove( first );
+            ++result;
+        } else
+            ++first;
+    }
+    return result;
+}
+
+template <class T>
+ typename QValueListPrivate<T>::NodePtr QValueListPrivate<T>::at( size_type i ) const
+{
+    ((i <= nodes) ? (void)0 : qWarning("ASSERT: \"%s\" in %s (%d)","i <= nodes","/coolo/prod/qt-copy/include/qvaluelist.h",372));
+    NodePtr p = node->next;
+    for( size_type x = 0; x < i; ++x )
+        p = p->next;
+    return p;
+}
+
+template <class T>
+ void QValueListPrivate<T>::clear()
+{
+    nodes = 0;
+    NodePtr p = node->next;
+    while( p != node ) {
+        NodePtr next = p->next;
+        delete p;
+        p = next;
+    }
+    node->next = node->prev = node;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+template <class T> class QDeepCopy;
+
+template <class T>
+class QValueList
+{
+public:
+
+
+
+    typedef QValueListIterator<T> iterator;
+    typedef QValueListConstIterator<T> const_iterator;
+    typedef T value_type;
+    typedef value_type* pointer;
+    typedef const value_type* const_pointer;
+    typedef value_type& reference;
+    typedef const value_type& const_reference;
+    typedef size_t size_type;
+
+
+
+    typedef int difference_type;
+
+
+
+
+
+    QValueList() { sh = new QValueListPrivate<T>; }
+    QValueList( const QValueList<T>& l ) { sh = l.sh; sh->ref(); }
+
+
+
+
+
+
+
+    ~QValueList() { sh->derefAndDelete(); }
+
+    QValueList<T>& operator= ( const QValueList<T>& l )
+    {
+        l.sh->ref();
+        sh->derefAndDelete();
+        sh = l.sh;
+        return *this;
+    }
+    bool operator== ( const QValueList<T>& l ) const;
+    bool operator!= ( const QValueList<T>& l ) const { return !( *this == l ); }
+    iterator begin() { detach(); return iterator( sh->node->next ); }
+    const_iterator begin() const { return const_iterator( sh->node->next ); }
+    const_iterator constBegin() const { return const_iterator( sh->node->next ); }
+    iterator end() { detach(); return iterator( sh->node ); }
+    const_iterator end() const { return const_iterator( sh->node ); }
+    const_iterator constEnd() const { return const_iterator( sh->node ); }
+    iterator insert( iterator it, const T& x ) { detach(); return sh->insert( it, x ); }
+    uint remove( const T& x ) { detach(); return sh->remove( x ); }
+    void clear();
+
+
+    QValueList<T>& operator<< ( const T& x )
+    {
+        append( x );
+        return *this;
+    }
+
+    size_type size() const { return sh->nodes; }
+    bool empty() const { return sh->nodes == 0; }
+    void push_front( const T& x ) { detach(); sh->insert( begin(), x ); }
+    void push_back( const T& x ) { detach(); sh->insert( end(), x ); }
+    iterator erase( iterator pos ) { detach(); return sh->remove( pos ); }
+    iterator erase( iterator first, iterator last );
+    reference front() { ; return *begin(); }
+    const_reference front() const { ; return *begin(); }
+    reference back() { ; return *(--end()); }
+    const_reference back() const { ; return *(--end()); }
+    void pop_front() { ; erase( begin() ); }
+    void pop_back() {
+        ;
+        iterator tmp = end();
+        erase( --tmp );
+    }
+    void insert( iterator pos, size_type n, const T& x );
+    QValueList<T> operator+ ( const QValueList<T>& l ) const;
+    QValueList<T>& operator+= ( const QValueList<T>& l );
+
+    iterator fromLast() { detach(); return iterator( sh->node->prev ); }
+    const_iterator fromLast() const { return const_iterator( sh->node->prev ); }
+
+    bool isEmpty() const { return ( sh->nodes == 0 ); }
+
+    iterator append( const T& x ) { detach(); return sh->insert( end(), x ); }
+    iterator prepend( const T& x ) { detach(); return sh->insert( begin(), x ); }
+
+    iterator remove( iterator it ) { detach(); return sh->remove( it ); }
+
+    T& first() { ; detach(); return sh->node->next->data; }
+    const T& first() const { ; return sh->node->next->data; }
+    T& last() { ; detach(); return sh->node->prev->data; }
+    const T& last() const { ; return sh->node->prev->data; }
+
+    T& operator[] ( size_type i ) { ; detach(); return sh->at(i)->data; }
+    const T& operator[] ( size_type i ) const { ; return sh->at(i)->data; }
+    iterator at( size_type i ) { ; detach(); return iterator( sh->at(i) ); }
+    const_iterator at( size_type i ) const { ; return const_iterator( sh->at(i) ); }
+    iterator find ( const T& x ) { detach(); return iterator( sh->find( sh->node->next, x) ); }
+    const_iterator find ( const T& x ) const { return const_iterator( sh->find( sh->node->next, x) ); }
+    iterator find ( iterator it, const T& x ) { detach(); return iterator( sh->find( it.node, x ) ); }
+    const_iterator find ( const_iterator it, const T& x ) const { return const_iterator( sh->find( it.node, x ) ); }
+    int findIndex( const T& x ) const { return sh->findIndex( sh->node->next, x) ; }
+    size_type contains( const T& x ) const { return sh->contains( x ); }
+
+    size_type count() const { return sh->nodes; }
+
+    QValueList<T>& operator+= ( const T& x )
+    {
+        append( x );
+        return *this;
+    }
+    typedef QValueListIterator<T> Iterator;
+    typedef QValueListConstIterator<T> ConstIterator;
+    typedef T ValueType;
+
+protected:
+
+
+
+    void detach() { if ( sh->count > 1 ) detachInternal(); }
+
+
+
+
+    QValueListPrivate<T>* sh;
+
+private:
+    void detachInternal();
+
+    friend class QDeepCopy< QValueList<T> >;
+};
+
+template <class T>
+ bool QValueList<T>::operator== ( const QValueList<T>& l ) const
+{
+    if ( size() != l.size() )
+        return FALSE;
+    const_iterator it2 = begin();
+    const_iterator it = l.begin();
+    for( ; it != l.end(); ++it, ++it2 )
+        if ( !( *it == *it2 ) )
+            return FALSE;
+    return TRUE;
+}
+
+template <class T>
+ void QValueList<T>::clear()
+{
+    if ( sh->count == 1 ) sh->clear(); else { sh->deref(); sh = new QValueListPrivate<T>; }
+}
+
+template <class T>
+ typename QValueList<T>::iterator QValueList<T>::erase( typename QValueList<T>::iterator first, typename QValueList<T>::iterator last )
+{
+    while ( first != last )
+        erase( first++ );
+    return last;
+}
+
+
+template <class T>
+ void QValueList<T>::insert( typename QValueList<T>::iterator pos, size_type n, const T& x )
+{
+    for ( ; n > 0; --n )
+        insert( pos, x );
+}
+
+template <class T>
+ QValueList<T> QValueList<T>::operator+ ( const QValueList<T>& l ) const
+{
+    QValueList<T> l2( *this );
+    for( const_iterator it = l.begin(); it != l.end(); ++it )
+        l2.append( *it );
+    return l2;
+}
+
+template <class T>
+ QValueList<T>& QValueList<T>::operator+= ( const QValueList<T>& l )
+{
+    for( const_iterator it = l.begin(); it != l.end(); ++it )
+        append( *it );
+    return *this;
+}
+
+template <class T>
+ void QValueList<T>::detachInternal()
+{
+    sh->deref(); sh = new QValueListPrivate<T>( *sh );
+}
+
+
+template <class T>
+ QDataStream& operator>>( QDataStream& s, QValueList<T>& l )
+{
+    l.clear();
+    Q_UINT32 c;
+    s >> c;
+    for( Q_UINT32 i = 0; i < c; ++i )
+    {
+        T t;
+        s >> t;
+        l.append( t );
+        if ( s.atEnd() )
+            break;
+    }
+    return s;
+}
+
+template <class T>
+ QDataStream& operator<<( QDataStream& s, const QValueList<T>& l )
+{
+    s << (Q_UINT32)l.size();
+    QValueListConstIterator<T> it = l.begin();
+    for( ; it != l.end(); ++it )
+        s << *it;
+    return s;
+}
+
+
+struct QMapNodeBase
+{
+    enum Color { Red, Black };
+
+    QMapNodeBase* left;
+    QMapNodeBase* right;
+    QMapNodeBase* parent;
+
+    Color color;
+
+    QMapNodeBase* minimum() {
+        QMapNodeBase* x = this;
+        while ( x->left )
+            x = x->left;
+        return x;
+    }
+
+    QMapNodeBase* maximum() {
+        QMapNodeBase* x = this;
+        while ( x->right )
+            x = x->right;
+        return x;
+    }
+};
+
+
+template <class K, class T>
+struct QMapNode : public QMapNodeBase
+{
+    QMapNode( const K& _key, const T& _data ) { data = _data; key = _key; }
+    QMapNode( const K& _key ) { key = _key; }
+    QMapNode( const QMapNode<K,T>& _n ) { key = _n.key; data = _n.data; }
+    QMapNode() { }
+    T data;
+    K key;
+};
+
+
+template<class K, class T>
+class QMapIterator
+{
+ public:
+
+
+
+    typedef QMapNode< K, T >* NodePtr;
+
+
+
+    typedef T value_type;
+
+
+
+    typedef int difference_type;
+
+    typedef T* pointer;
+    typedef T& reference;
+
+
+
+
+    QMapNode<K,T>* node;
+
+
+
+
+    QMapIterator() : node( 0 ) {}
+    QMapIterator( QMapNode<K,T>* p ) : node( p ) {}
+    QMapIterator( const QMapIterator<K,T>& it ) : node( it.node ) {}
+
+    bool operator==( const QMapIterator<K,T>& it ) const { return node == it.node; }
+    bool operator!=( const QMapIterator<K,T>& it ) const { return node != it.node; }
+    T& operator*() { return node->data; }
+    const T& operator*() const { return node->data; }
+
+
+
+    const K& key() const { return node->key; }
+    T& data() { return node->data; }
+    const T& data() const { return node->data; }
+
+private:
+    int inc();
+    int dec();
+
+public:
+    QMapIterator<K,T>& operator++() {
+        inc();
+        return *this;
+    }
+
+    QMapIterator<K,T> operator++(int) {
+        QMapIterator<K,T> tmp = *this;
+        inc();
+        return tmp;
+    }
+
+    QMapIterator<K,T>& operator--() {
+        dec();
+        return *this;
+    }
+
+    QMapIterator<K,T> operator--(int) {
+        QMapIterator<K,T> tmp = *this;
+        dec();
+        return tmp;
+    }
+};
+
+template <class K, class T>
+ int QMapIterator<K,T>::inc()
+{
+    QMapNodeBase* tmp = node;
+    if ( tmp->right ) {
+        tmp = tmp->right;
+        while ( tmp->left )
+            tmp = tmp->left;
+    } else {
+        QMapNodeBase* y = tmp->parent;
+        while (tmp == y->right) {
+            tmp = y;
+            y = y->parent;
+        }
+        if (tmp->right != y)
+            tmp = y;
+    }
+    node = (NodePtr)tmp;
+    return 0;
+}
+
+template <class K, class T>
+ int QMapIterator<K,T>::dec()
+{
+    QMapNodeBase* tmp = node;
+    if (tmp->color == QMapNodeBase::Red &&
+        tmp->parent->parent == tmp ) {
+        tmp = tmp->right;
+    } else if (tmp->left != 0) {
+        QMapNodeBase* y = tmp->left;
+        while ( y->right )
+            y = y->right;
+        tmp = y;
+    } else {
+        QMapNodeBase* y = tmp->parent;
+        while (tmp == y->left) {
+            tmp = y;
+            y = y->parent;
+        }
+        tmp = y;
+    }
+    node = (NodePtr)tmp;
+    return 0;
+}
+
+template<class K, class T>
+class QMapConstIterator
+{
+ public:
+
+
+
+    typedef QMapNode< K, T >* NodePtr;
+
+
+
+    typedef T value_type;
+
+
+
+    typedef int difference_type;
+
+    typedef const T* pointer;
+    typedef const T& reference;
+
+
+
+
+
+    QMapNode<K,T>* node;
+
+
+
+
+    QMapConstIterator() : node( 0 ) {}
+    QMapConstIterator( QMapNode<K,T>* p ) : node( p ) {}
+    QMapConstIterator( const QMapConstIterator<K,T>& it ) : node( it.node ) {}
+    QMapConstIterator( const QMapIterator<K,T>& it ) : node( it.node ) {}
+
+    bool operator==( const QMapConstIterator<K,T>& it ) const { return node == it.node; }
+    bool operator!=( const QMapConstIterator<K,T>& it ) const { return node != it.node; }
+    const T& operator*() const { return node->data; }
+
+
+
+    const K& key() const { return node->key; }
+    const T& data() const { return node->data; }
+
+private:
+    int inc();
+    int dec();
+
+public:
+    QMapConstIterator<K,T>& operator++() {
+        inc();
+        return *this;
+    }
+
+    QMapConstIterator<K,T> operator++(int) {
+        QMapConstIterator<K,T> tmp = *this;
+        inc();
+        return tmp;
+    }
+
+    QMapConstIterator<K,T>& operator--() {
+        dec();
+        return *this;
+    }
+
+    QMapConstIterator<K,T> operator--(int) {
+        QMapConstIterator<K,T> tmp = *this;
+        dec();
+        return tmp;
+    }
+};
+
+template <class K, class T>
+ int QMapConstIterator<K,T>::inc()
+{
+    QMapNodeBase* tmp = node;
+    if ( tmp->right ) {
+        tmp = tmp->right;
+        while ( tmp->left )
+            tmp = tmp->left;
+    } else {
+        QMapNodeBase* y = tmp->parent;
+        while (tmp == y->right) {
+            tmp = y;
+            y = y->parent;
+        }
+        if (tmp->right != y)
+            tmp = y;
+    }
+    node = (NodePtr)tmp;
+    return 0;
+}
+
+template <class K, class T>
+ int QMapConstIterator<K,T>::dec()
+{
+    QMapNodeBase* tmp = node;
+    if (tmp->color == QMapNodeBase::Red &&
+        tmp->parent->parent == tmp ) {
+        tmp = tmp->right;
+    } else if (tmp->left != 0) {
+        QMapNodeBase* y = tmp->left;
+        while ( y->right )
+            y = y->right;
+        tmp = y;
+    } else {
+        QMapNodeBase* y = tmp->parent;
+        while (tmp == y->left) {
+            tmp = y;
+            y = y->parent;
+        }
+        tmp = y;
+    }
+    node = (NodePtr)tmp;
+    return 0;
+}
+
+
+class QMapPrivateBase : public QShared
+{
+public:
+    QMapPrivateBase() {
+        node_count = 0;
+    }
+    QMapPrivateBase( const QMapPrivateBase* _map) {
+        node_count = _map->node_count;
+    }
+
+
+
+
+    void rotateLeft( QMapNodeBase* x, QMapNodeBase*& root);
+    void rotateRight( QMapNodeBase* x, QMapNodeBase*& root );
+    void rebalance( QMapNodeBase* x, QMapNodeBase*& root );
+    QMapNodeBase* removeAndRebalance( QMapNodeBase* z, QMapNodeBase*& root,
+                                      QMapNodeBase*& leftmost,
+                                      QMapNodeBase*& rightmost );
+
+
+
+
+    int node_count;
+};
+
+
+template <class Key, class T>
+class QMapPrivate : public QMapPrivateBase
+{
+public:
+
+
+
+    typedef QMapIterator< Key, T > Iterator;
+    typedef QMapConstIterator< Key, T > ConstIterator;
+    typedef QMapNode< Key, T > Node;
+    typedef QMapNode< Key, T >* NodePtr;
+
+
+
+
+    QMapPrivate();
+    QMapPrivate( const QMapPrivate< Key, T >* _map );
+    ~QMapPrivate() { clear(); delete header; }
+
+    NodePtr copy( NodePtr p );
+    void clear();
+    void clear( NodePtr p );
+
+    Iterator begin() { return Iterator( (NodePtr)(header->left ) ); }
+    Iterator end() { return Iterator( header ); }
+    ConstIterator begin() const { return ConstIterator( (NodePtr)(header->left ) ); }
+    ConstIterator end() const { return ConstIterator( header ); }
+
+    ConstIterator find(const Key& k) const;
+
+    void remove( Iterator it ) {
+        NodePtr del = (NodePtr) removeAndRebalance( it.node, header->parent, header->left, header->right );
+        delete del;
+        --node_count;
+    }
+    Iterator insertSingle( const Key& k );
+    Iterator insert( QMapNodeBase* x, QMapNodeBase* y, const Key& k );
+
+protected:
+
+
+
+    const Key& key( QMapNodeBase* b ) const { return ((NodePtr)b)->key; }
+
+
+
+
+    NodePtr header;
+};
+
+
+template <class Key, class T>
+ QMapPrivate<Key,T>::QMapPrivate() {
+    header = new Node;
+    header->color = QMapNodeBase::Red;
+    header->parent = 0;
+    header->left = header->right = header;
+}
+template <class Key, class T>
+ QMapPrivate<Key,T>::QMapPrivate( const QMapPrivate< Key, T >* _map ) : QMapPrivateBase( _map ) {
+    header = new Node;
+    header->color = QMapNodeBase::Red;
+    if ( _map->header->parent == 0 ) {
+        header->parent = 0;
+        header->left = header->right = header;
+    } else {
+        header->parent = copy( (NodePtr)(_map->header->parent) );
+        header->parent->parent = header;
+        header->left = header->parent->minimum();
+        header->right = header->parent->maximum();
+    }
+}
+
+template <class Key, class T>
+ typename QMapPrivate<Key,T>::NodePtr QMapPrivate<Key,T>::copy( typename QMapPrivate<Key,T>::NodePtr p )
+{
+    if ( !p )
+        return 0;
+    NodePtr n = new Node( *p );
+    n->color = p->color;
+    if ( p->left ) {
+        n->left = copy( (NodePtr)(p->left) );
+        n->left->parent = n;
+    } else {
+        n->left = 0;
+    }
+    if ( p->right ) {
+        n->right = copy( (NodePtr)(p->right) );
+        n->right->parent = n;
+    } else {
+        n->right = 0;
+    }
+    return n;
+}
+
+template <class Key, class T>
+ void QMapPrivate<Key,T>::clear()
+{
+    clear( (NodePtr)(header->parent) );
+    header->color = QMapNodeBase::Red;
+    header->parent = 0;
+    header->left = header->right = header;
+    node_count = 0;
+}
+
+template <class Key, class T>
+ void QMapPrivate<Key,T>::clear( typename QMapPrivate<Key,T>::NodePtr p )
+{
+    while ( p != 0 ) {
+        clear( (NodePtr)p->right );
+        NodePtr y = (NodePtr)p->left;
+        delete p;
+        p = y;
+    }
+}
+
+template <class Key, class T>
+ typename QMapPrivate<Key,T>::ConstIterator QMapPrivate<Key,T>::find(const Key& k) const
+{
+    QMapNodeBase* y = header;
+    QMapNodeBase* x = header->parent;
+
+    while ( x != 0 ) {
+
+        if ( !( key(x) < k ) ) {
+            y = x;
+            x = x->left;
+        } else {
+            x = x->right;
+        }
+    }
+
+
+
+    if ( y == header || k < key(y) )
+        return ConstIterator( header );
+    return ConstIterator( (NodePtr)y );
+}
+
+template <class Key, class T>
+ typename QMapPrivate<Key,T>::Iterator QMapPrivate<Key,T>::insertSingle( const Key& k )
+{
+
+    QMapNodeBase* y = header;
+    QMapNodeBase* x = header->parent;
+    bool result = TRUE;
+    while ( x != 0 ) {
+        result = ( k < key(x) );
+        y = x;
+        x = result ? x->left : x->right;
+    }
+
+    Iterator j( (NodePtr)y );
+    if ( result ) {
+
+        if ( j == begin() ) {
+            return insert(x, y, k );
+        } else {
+
+            --j;
+        }
+    }
+
+    if ( (j.node->key) < k )
+        return insert(x, y, k );
+
+    return j;
+}
+
+
+template <class Key, class T>
+ typename QMapPrivate<Key,T>::Iterator QMapPrivate<Key,T>::insert( QMapNodeBase* x, QMapNodeBase* y, const Key& k )
+{
+    NodePtr z = new Node( k );
+    if (y == header || x != 0 || k < key(y) ) {
+        y->left = z;
+        if ( y == header ) {
+            header->parent = z;
+            header->right = z;
+        } else if ( y == header->left )
+            header->left = z;
+    } else {
+        y->right = z;
+        if ( y == header->right )
+            header->right = z;
+    }
+    z->parent = y;
+    z->left = 0;
+    z->right = 0;
+    rebalance( z, header->parent );
+    ++node_count;
+    return Iterator(z);
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+template <class T> class QDeepCopy;
+
+template<class Key, class T>
+class QMap
+{
+public:
+
+
+
+    typedef Key key_type;
+    typedef T mapped_type;
+    typedef QPair<const key_type, mapped_type> value_type;
+    typedef value_type* pointer;
+    typedef const value_type* const_pointer;
+    typedef value_type& reference;
+    typedef const value_type& const_reference;
+
+
+
+    typedef int difference_type;
+
+    typedef size_t size_type;
+    typedef QMapIterator<Key,T> iterator;
+    typedef QMapConstIterator<Key,T> const_iterator;
+    typedef QPair<iterator,bool> insert_pair;
+
+    typedef QMapIterator< Key, T > Iterator;
+    typedef QMapConstIterator< Key, T > ConstIterator;
+    typedef T ValueType;
+    typedef QMapPrivate< Key, T > Priv;
+
+
+
+
+    QMap()
+    {
+        sh = new QMapPrivate< Key, T >;
+    }
+    QMap( const QMap<Key,T>& m )
+    {
+        sh = m.sh; sh->ref();
+    }
+    ~QMap()
+    {
+        if ( sh->deref() )
+            delete sh;
+    }
+    QMap<Key,T>& operator= ( const QMap<Key,T>& m );
+    iterator begin() { detach(); return sh->begin(); }
+    iterator end() { detach(); return sh->end(); }
+    const_iterator begin() const { return ((const Priv*)sh)->begin(); }
+    const_iterator end() const { return ((const Priv*)sh)->end(); }
+    const_iterator constBegin() const { return begin(); }
+    const_iterator constEnd() const { return end(); }
+
+    iterator replace( const Key& k, const T& v )
+    {
+        remove( k );
+        return insert( k, v );
+    }
+
+    size_type size() const
+    {
+        return sh->node_count;
+    }
+    bool empty() const
+    {
+        return sh->node_count == 0;
+    }
+    QPair<iterator,bool> insert( const value_type& x );
+
+    void erase( iterator it )
+    {
+        detach();
+        sh->remove( it );
+    }
+    void erase( const key_type& k );
+    size_type count( const key_type& k ) const;
+    T& operator[] ( const Key& k );
+    void clear();
+
+    iterator find ( const Key& k )
+    {
+        detach();
+        return iterator( sh->find( k ).node );
+    }
+    const_iterator find ( const Key& k ) const { return sh->find( k ); }
+
+    const T& operator[] ( const Key& k ) const
+        { ; return sh->find( k ).data(); }
+    bool contains ( const Key& k ) const
+        { return find( k ) != end(); }
+
+
+    size_type count() const { return sh->node_count; }
+
+    QValueList<Key> keys() const {
+        QValueList<Key> r;
+        for (const_iterator i=begin(); i!=end(); ++i)
+            r.append(i.key());
+        return r;
+    }
+
+    QValueList<T> values() const {
+        QValueList<T> r;
+        for (const_iterator i=begin(); i!=end(); ++i)
+            r.append(*i);
+        return r;
+    }
+
+    bool isEmpty() const { return sh->node_count == 0; }
+
+    iterator insert( const Key& key, const T& value, bool overwrite = TRUE );
+    void remove( iterator it ) { detach(); sh->remove( it ); }
+    void remove( const Key& k );
+protected:
+
+
+
+    void detach() { if ( sh->count > 1 ) detachInternal(); }
+
+    Priv* sh;
+private:
+    void detachInternal();
+
+    friend class QDeepCopy< QMap<Key,T> >;
+};
+
+template<class Key, class T>
+ QMap<Key,T>& QMap<Key,T>::operator= ( const QMap<Key,T>& m )
+{
+    m.sh->ref();
+    if ( sh->deref() )
+        delete sh;
+    sh = m.sh;
+    return *this;
+}
+
+template<class Key, class T>
+ typename QMap<Key,T>::insert_pair QMap<Key,T>::insert( const typename QMap<Key,T>::value_type& x )
+{
+    detach();
+    size_type n = size();
+    iterator it = sh->insertSingle( x.first );
+    bool inserted = FALSE;
+    if ( n < size() ) {
+        inserted = TRUE;
+        it.data() = x.second;
+    }
+    return QPair<iterator,bool>( it, inserted );
+}
+
+template<class Key, class T>
+ void QMap<Key,T>::erase( const Key& k )
+{
+    detach();
+    iterator it( sh->find( k ).node );
+    if ( it != end() )
+        sh->remove( it );
+}
+
+template<class Key, class T>
+ typename QMap<Key,T>::size_type QMap<Key,T>::count( const Key& k ) const
+{
+    const_iterator it( sh->find( k ).node );
+    if ( it != end() ) {
+        size_type c = 0;
+        while ( it != end() ) {
+            ++it;
+            ++c;
+        }
+        return c;
+    }
+    return 0;
+}
+
+template<class Key, class T>
+ T& QMap<Key,T>::operator[] ( const Key& k )
+{
+    detach();
+    QMapNode<Key,T>* p = sh->find( k ).node;
+    if ( p != sh->end().node )
+        return p->data;
+    return insert( k, T() ).data();
+}
+
+template<class Key, class T>
+ void QMap<Key,T>::clear()
+{
+    if ( sh->count == 1 )
+        sh->clear();
+    else {
+        sh->deref();
+        sh = new QMapPrivate<Key,T>;
+    }
+}
+
+template<class Key, class T>
+ typename QMap<Key,T>::iterator QMap<Key,T>::insert( const Key& key, const T& value, bool overwrite )
+{
+    detach();
+    size_type n = size();
+    iterator it = sh->insertSingle( key );
+    if ( overwrite || n < size() )
+        it.data() = value;
+    return it;
+}
+
+template<class Key, class T>
+ void QMap<Key,T>::remove( const Key& k )
+{
+    detach();
+    iterator it( sh->find( k ).node );
+    if ( it != end() )
+        sh->remove( it );
+}
+
+template<class Key, class T>
+ void QMap<Key,T>::detachInternal()
+{
+    sh->deref(); sh = new QMapPrivate<Key,T>( sh );
+}
+
+
+
+template<class Key, class T>
+ QDataStream& operator>>( QDataStream& s, QMap<Key,T>& m ) {
+    m.clear();
+    Q_UINT32 c;
+    s >> c;
+    for( Q_UINT32 i = 0; i < c; ++i ) {
+        Key k; T t;
+        s >> k >> t;
+        m.insert( k, t );
+        if ( s.atEnd() )
+            break;
+    }
+    return s;
+}
+
+
+template<class Key, class T>
+ QDataStream& operator<<( QDataStream& s, const QMap<Key,T>& m ) {
+    s << (Q_UINT32)m.size();
+    QMapConstIterator<Key,T> it = m.begin();
+    for( ; it != m.end(); ++it )
+        s << it.key() << it.data();
+    return s;
+}
+
+
+
+
+
+
+class QImageDrag;
+class QTextDrag;
+
+class QMimeSource
+{
+    friend class QClipboardData;
+
+public:
+    QMimeSource();
+    virtual ~QMimeSource();
+    virtual const char* format( int n = 0 ) const = 0;
+    virtual bool provides( const char* ) const;
+    virtual QByteArray encodedData( const char* ) const = 0;
+    int serialNumber() const;
+
+private:
+    int ser_no;
+    enum { NoCache, Text, Graphics } cacheType;
+    union
+    {
+        struct
+        {
+            QString *str;
+            QCString *subtype;
+        } txt;
+        struct
+        {
+            QImage *img;
+            QPixmap *pix;
+        } gfx;
+    } cache;
+    void clearCache();
+
+
+    friend class QImageDrag;
+    friend class QTextDrag;
+
+};
+
+inline int QMimeSource::serialNumber() const
+{ return ser_no; }
+
+class QStringList;
+class QMimeSourceFactoryData;
+
+class QMimeSourceFactory {
+public:
+    QMimeSourceFactory();
+    virtual ~QMimeSourceFactory();
+
+    static QMimeSourceFactory* defaultFactory();
+    static void setDefaultFactory( QMimeSourceFactory* );
+    static QMimeSourceFactory* takeDefaultFactory();
+    static void addFactory( QMimeSourceFactory *f );
+    static void removeFactory( QMimeSourceFactory *f );
+
+    virtual const QMimeSource* data(const QString& abs_name) const;
+    virtual QString makeAbsolute(const QString& abs_or_rel_name, const QString& context) const;
+    const QMimeSource* data(const QString& abs_or_rel_name, const QString& context) const;
+
+    virtual void setText( const QString& abs_name, const QString& text );
+    virtual void setImage( const QString& abs_name, const QImage& im );
+    virtual void setPixmap( const QString& abs_name, const QPixmap& pm );
+    virtual void setData( const QString& abs_name, QMimeSource* data );
+    virtual void setFilePath( const QStringList& );
+    virtual QStringList filePath() const;
+    void addFilePath( const QString& );
+    virtual void setExtensionType( const QString& ext, const char* mimetype );
+
+private:
+    QMimeSource *dataInternal(const QString& abs_name, const QMap<QString, QString> &extensions ) const;
+    QMimeSourceFactoryData* d;
+};
+
+
+
+class QEvent: public Qt
+{
+public:
+    enum Type {
+        None = 0,
+
+
+        Timer = 1,
+        MouseButtonPress = 2,
+        MouseButtonRelease = 3,
+        MouseButtonDblClick = 4,
+        MouseMove = 5,
+        KeyPress = 6,
+        KeyRelease = 7,
+        FocusIn = 8,
+        FocusOut = 9,
+        Enter = 10,
+        Leave = 11,
+        Paint = 12,
+        Move = 13,
+        Resize = 14,
+        Create = 15,
+        Destroy = 16,
+        Show = 17,
+        Hide = 18,
+        Close = 19,
+        Quit = 20,
+        Reparent = 21,
+        ShowMinimized = 22,
+        ShowNormal = 23,
+        WindowActivate = 24,
+        WindowDeactivate = 25,
+        ShowToParent = 26,
+        HideToParent = 27,
+        ShowMaximized = 28,
+        ShowFullScreen = 29,
+        Accel = 30,
+        Wheel = 31,
+        AccelAvailable = 32,
+        CaptionChange = 33,
+        IconChange = 34,
+        ParentFontChange = 35,
+        ApplicationFontChange = 36,
+        ParentPaletteChange = 37,
+        ApplicationPaletteChange = 38,
+        PaletteChange = 39,
+        Clipboard = 40,
+        Speech = 42,
+        SockAct = 50,
+        AccelOverride = 51,
+        DeferredDelete = 52,
+        DragEnter = 60,
+        DragMove = 61,
+        DragLeave = 62,
+        Drop = 63,
+        DragResponse = 64,
+        ChildInserted = 70,
+        ChildRemoved = 71,
+        LayoutHint = 72,
+        ShowWindowRequest = 73,
+        ActivateControl = 80,
+        DeactivateControl = 81,
+        ContextMenu = 82,
+        IMStart = 83,
+        IMCompose = 84,
+        IMEnd = 85,
+        Accessibility = 86,
+        TabletMove = 87,
+        LocaleChange = 88,
+        LanguageChange = 89,
+        LayoutDirectionChange = 90,
+        Style = 91,
+        TabletPress = 92,
+        TabletRelease = 93,
+        User = 1000,
+        MaxUser = 65535
+    };
+
+
+    QEvent( Type type ) : t(type), posted(FALSE), spont(FALSE) {}
+    virtual ~QEvent();
+    Type type() const { return t; }
+    bool spontaneous() const { return spont; }
+protected:
+    Type t;
+private:
+    uint posted : 1;
+    uint spont : 1;
+
+
+    friend class QApplication;
+    friend class QAccelManager;
+    friend class QBaseApplication;
+    friend class QETWidget;
+};
+
+
+class QTimerEvent : public QEvent
+{
+public:
+    QTimerEvent( int timerId )
+        : QEvent(Timer), id(timerId) {}
+    int timerId() const { return id; }
+protected:
+    int id;
+};
+
+
+class QMouseEvent : public QEvent
+{
+public:
+    QMouseEvent( Type type, const QPoint &pos, int button, int state );
+
+    QMouseEvent( Type type, const QPoint &pos, const QPoint&globalPos,
+                 int button, int state )
+        : QEvent(type), p(pos), g(globalPos), b((ushort)button),s((ushort)state),accpt(TRUE) {};
+
+    const QPoint &pos() const { return p; }
+    const QPoint &globalPos() const { return g; }
+    int x() const { return p.x(); }
+    int y() const { return p.y(); }
+    int globalX() const { return g.x(); }
+    int globalY() const { return g.y(); }
+    ButtonState button() const { return (ButtonState) b; }
+    ButtonState state() const { return (ButtonState) s; }
+    ButtonState stateAfter() const;
+    bool isAccepted() const { return accpt; }
+    void accept() { accpt = TRUE; }
+    void ignore() { accpt = FALSE; }
+protected:
+    QPoint p;
+    QPoint g;
+    ushort b;
+    ushort s;
+    uint accpt:1;
+};
+
+
+
+class QWheelEvent : public QEvent
+{
+public:
+    QWheelEvent( const QPoint &pos, int delta, int state, Orientation orient = Vertical );
+    QWheelEvent( const QPoint &pos, const QPoint& globalPos, int delta, int state, Orientation orient = Vertical )
+        : QEvent(Wheel), p(pos), g(globalPos), d(delta), s((ushort)state),
+          accpt(TRUE), o(orient) {}
+    int delta() const { return d; }
+    const QPoint &pos() const { return p; }
+    const QPoint &globalPos() const { return g; }
+    int x() const { return p.x(); }
+    int y() const { return p.y(); }
+    int globalX() const { return g.x(); }
+    int globalY() const { return g.y(); }
+    ButtonState state() const { return ButtonState(s); }
+    Orientation orientation() const { return o; }
+    bool isAccepted() const { return accpt; }
+    void accept() { accpt = TRUE; }
+    void ignore() { accpt = FALSE; }
+protected:
+    QPoint p;
+    QPoint g;
+    int d;
+    ushort s;
+    bool accpt;
+    Orientation o;
+};
+
+
+class QTabletEvent : public QEvent
+{
+public:
+    enum TabletDevice { NoDevice = -1, Puck, Stylus, Eraser };
+    QTabletEvent( Type t, const QPoint &pos, const QPoint &globalPos, int device,
+                  int pressure, int xTilt, int yTilt, const QPair<int,int> &uId );
+    QTabletEvent( const QPoint &pos, const QPoint &globalPos, int device,
+                  int pressure, int xTilt, int yTilt, const QPair<int,int> &uId )
+        : QEvent( TabletMove ), mPos( pos ), mGPos( globalPos ), mDev( device ),
+          mPress( pressure ), mXT( xTilt ), mYT( yTilt ), mType( uId.first ),
+          mPhy( uId.second ), mbAcc(TRUE)
+    {}
+    int pressure() const { return mPress; }
+    int xTilt() const { return mXT; }
+    int yTilt() const { return mYT; }
+    const QPoint &pos() const { return mPos; }
+    const QPoint &globalPos() const { return mGPos; }
+    int x() const { return mPos.x(); }
+    int y() const { return mPos.y(); }
+    int globalX() const { return mGPos.x(); }
+    int globalY() const { return mGPos.y(); }
+    TabletDevice device() const { return TabletDevice(mDev); }
+    int isAccepted() const { return mbAcc; }
+    void accept() { mbAcc = TRUE; }
+    void ignore() { mbAcc = FALSE; }
+    QPair<int,int> uniqueId() { return QPair<int,int>( mType, mPhy); }
+protected:
+    QPoint mPos;
+    QPoint mGPos;
+    int mDev,
+        mPress,
+        mXT,
+        mYT,
+        mType,
+        mPhy;
+    bool mbAcc;
+
+};
+
+class QKeyEvent : public QEvent
+{
+public:
+    QKeyEvent( Type type, int key, int ascii, int state,
+                const QString& text=QString::null, bool autorep=FALSE, ushort count=1 )
+        : QEvent(type), txt(text), k((ushort)key), s((ushort)state),
+            a((uchar)ascii), accpt(TRUE), autor(autorep), c(count)
+    {
+        if ( key >= Key_Back && key <= Key_MediaLast )
+            accpt = FALSE;
+    }
+    int key() const { return k; }
+    int ascii() const { return a; }
+    ButtonState state() const { return ButtonState(s); }
+    ButtonState stateAfter() const;
+    bool isAccepted() const { return accpt; }
+    QString text() const { return txt; }
+    bool isAutoRepeat() const { return autor; }
+    int count() const { return int(c); }
+    void accept() { accpt = TRUE; }
+    void ignore() { accpt = FALSE; }
+
+protected:
+    QString txt;
+    ushort k, s;
+    uchar a;
+    uint accpt:1;
+    uint autor:1;
+    ushort c;
+};
+
+
+class QFocusEvent : public QEvent
+{
+public:
+
+    QFocusEvent( Type type )
+        : QEvent(type) {}
+
+    bool gotFocus() const { return type() == FocusIn; }
+    bool lostFocus() const { return type() == FocusOut; }
+
+    enum Reason { Mouse, Tab, Backtab, ActiveWindow, Popup, Shortcut, Other };
+    static Reason reason();
+    static void setReason( Reason reason );
+    static void resetReason();
+
+private:
+    static Reason m_reason;
+    static Reason prev_reason;
+};
+
+
+class QPaintEvent : public QEvent
+{
+public:
+    QPaintEvent( const QRegion& paintRegion, bool erased = TRUE)
+        : QEvent(Paint),
+          rec(paintRegion.boundingRect()),
+          reg(paintRegion),
+          erase(erased){}
+    QPaintEvent( const QRect &paintRect, bool erased = TRUE )
+        : QEvent(Paint),
+          rec(paintRect),
+          reg(paintRect),
+          erase(erased){}
+    const QRect &rect() const { return rec; }
+    const QRegion &region() const { return reg; }
+    bool erased() const { return erase; }
+protected:
+    friend class QApplication;
+    friend class QBaseApplication;
+    QRect rec;
+    QRegion reg;
+    bool erase;
+};
+
+
+class QMoveEvent : public QEvent
+{
+public:
+    QMoveEvent( const QPoint &pos, const QPoint &oldPos )
+        : QEvent(Move), p(pos), oldp(oldPos) {}
+    const QPoint &pos() const { return p; }
+    const QPoint &oldPos()const { return oldp;}
+protected:
+    QPoint p, oldp;
+    friend class QApplication;
+    friend class QBaseApplication;
+};
+
+
+class QResizeEvent : public QEvent
+{
+public:
+    QResizeEvent( const QSize &size, const QSize &oldSize )
+        : QEvent(Resize), s(size), olds(oldSize) {}
+    const QSize &size() const { return s; }
+    const QSize &oldSize()const { return olds;}
+protected:
+    QSize s, olds;
+    friend class QApplication;
+    friend class QBaseApplication;
+};
+
+
+class QCloseEvent : public QEvent
+{
+public:
+    QCloseEvent()
+        : QEvent(Close), accpt(FALSE) {}
+    bool isAccepted() const { return accpt; }
+    void accept() { accpt = TRUE; }
+    void ignore() { accpt = FALSE; }
+protected:
+    bool accpt;
+};
+
+
+class QShowEvent : public QEvent
+{
+public:
+    QShowEvent()
+        : QEvent(Show) {}
+};
+
+
+class QHideEvent : public QEvent
+{
+public:
+    QHideEvent()
+        : QEvent(Hide) {}
+};
+
+class QContextMenuEvent : public QEvent
+{
+public:
+    enum Reason { Mouse, Keyboard, Other };
+    QContextMenuEvent( Reason reason, const QPoint &pos, const QPoint &globalPos, int state )
+        : QEvent( ContextMenu ), p( pos ), gp( globalPos ), accpt( TRUE ), consum( TRUE ),
+        reas( reason ), s((ushort)state) {}
+    QContextMenuEvent( Reason reason, const QPoint &pos, int state );
+
+    int x() const { return p.x(); }
+    int y() const { return p.y(); }
+    int globalX() const { return gp.x(); }
+    int globalY() const { return gp.y(); }
+
+    const QPoint& pos() const { return p; }
+    const QPoint& globalPos() const { return gp; }
+
+    ButtonState state() const { return (ButtonState) s; }
+    bool isAccepted() const { return accpt; }
+    bool isConsumed() const { return consum; }
+    void consume() { accpt = FALSE; consum = TRUE; }
+    void accept() { accpt = TRUE; consum = TRUE; }
+    void ignore() { accpt = FALSE; consum = FALSE; }
+
+    Reason reason() const { return Reason( reas ); }
+
+protected:
+    QPoint p;
+    QPoint gp;
+    bool accpt;
+    bool consum;
+    uint reas:8;
+    ushort s;
+};
+
+
+class QIMEvent : public QEvent
+{
+public:
+    QIMEvent( Type type, const QString &text, int cursorPosition )
+        : QEvent(type), txt(text), cpos(cursorPosition), a(TRUE) {}
+    const QString &text() const { return txt; }
+    int cursorPos() const { return cpos; }
+    bool isAccepted() const { return a; }
+    void accept() { a = TRUE; }
+    void ignore() { a = FALSE; }
+    int selectionLength() const;
+
+private:
+    QString txt;
+    int cpos;
+    bool a;
+};
+
+class QIMComposeEvent : public QIMEvent
+{
+public:
+    QIMComposeEvent( Type type, const QString &text, int cursorPosition,
+                     int selLength )
+        : QIMEvent( type, text, cursorPosition ), selLen( selLength ) { }
+
+private:
+    int selLen;
+
+    friend class QIMEvent;
+};
+
+inline int QIMEvent::selectionLength() const
+{
+    if ( type() != IMCompose ) return 0;
+    QIMComposeEvent *that = (QIMComposeEvent *) this;
+    return that->selLen;
+}
+class QDropEvent : public QEvent, public QMimeSource
+{
+public:
+    QDropEvent( const QPoint& pos, Type typ=Drop )
+        : QEvent(typ), p(pos),
+          act(0), accpt(0), accptact(0), resv(0),
+          d(0)
+        {}
+    const QPoint &pos() const { return p; }
+    bool isAccepted() const { return accpt || accptact; }
+    void accept(bool y=TRUE) { accpt = y; }
+    void ignore() { accpt = FALSE; }
+
+    bool isActionAccepted() const { return accptact; }
+    void acceptAction(bool y=TRUE) { accptact = y; }
+    enum Action { Copy, Link, Move, Private, UserAction=100 };
+    void setAction( Action a ) { act = (uint)a; }
+    Action action() const { return Action(act); }
+
+    QWidget* source() const;
+    const char* format( int n = 0 ) const;
+    QByteArray encodedData( const char* ) const;
+    bool provides( const char* ) const;
+
+    QByteArray data(const char* f) const { return encodedData(f); }
+
+    void setPoint( const QPoint& np ) { p = np; }
+
+protected:
+    QPoint p;
+    uint act:8;
+    uint accpt:1;
+    uint accptact:1;
+    uint resv:5;
+    void * d;
+};
+
+
+
+class QDragMoveEvent : public QDropEvent
+{
+public:
+    QDragMoveEvent( const QPoint& pos, Type typ=DragMove )
+        : QDropEvent(pos,typ),
+          rect( pos, QSize( 1, 1 ) ) {}
+    QRect answerRect() const { return rect; }
+    void accept( bool y=TRUE ) { QDropEvent::accept(y); }
+    void accept( const QRect & r) { accpt = TRUE; rect = r; }
+    void ignore( const QRect & r) { accpt =FALSE; rect = r; }
+    void ignore() { QDropEvent::ignore(); }
+
+protected:
+    QRect rect;
+};
+
+
+class QDragEnterEvent : public QDragMoveEvent
+{
+public:
+    QDragEnterEvent( const QPoint& pos ) :
+        QDragMoveEvent(pos, DragEnter) { }
+};
+
+
+
+class QDragResponseEvent : public QEvent
+{
+public:
+    QDragResponseEvent( bool accepted )
+        : QEvent(DragResponse), a(accepted) {}
+    bool dragAccepted() const { return a; }
+protected:
+    bool a;
+};
+
+
+class QDragLeaveEvent : public QEvent
+{
+public:
+    QDragLeaveEvent()
+        : QEvent(DragLeave) {}
+};
+
+
+
+class QChildEvent : public QEvent
+{
+public:
+    QChildEvent( Type type, QObject *child )
+        : QEvent(type), c(child) {}
+    QObject *child() const { return c; }
+    bool inserted() const { return t == ChildInserted; }
+    bool removed() const { return t == ChildRemoved; }
+protected:
+    QObject *c;
+};
+
+
+class QCustomEvent : public QEvent
+{
+public:
+    QCustomEvent( int type );
+    QCustomEvent( Type type, void *data )
+        : QEvent(type), d(data) {};
+    void *data() const { return d; }
+    void setData( void* data ) { d = data; }
+private:
+    void *d;
+};
+
+
+
+
+class QMetaObject;
+class QVariant;
+class QMetaProperty;
+class QPostEventList;
+class QSenderObjectList;
+class QObjectPrivate;
+
+class QObjectUserData;
+
+struct QUObject;
+
+class QObject: public Qt
+{
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+   
+
+public:
+    QObject( QObject *parent=0, const char *name=0 );
+    virtual ~QObject();
+    virtual bool event( QEvent * );
+    virtual bool eventFilter( QObject *, QEvent * );
+
+    bool isA( const char * ) const;
+    bool inherits( const char * ) const;
+
+    const char *name() const;
+    const char *name( const char * defaultName ) const;
+
+    virtual void setName( const char *name );
+    bool isWidgetType() const { return isWidget; }
+    bool highPriority() const { return FALSE; }
+
+    bool signalsBlocked() const { return blockSig; }
+    void blockSignals( bool b );
+
+    int startTimer( int interval );
+    void killTimer( int id );
+    void killTimers();
+
+    QObject *child( const char *objName, const char *inheritsClass = 0, bool recursiveSearch = TRUE );
+    const QObjectList *children() const { return childObjects; }
+
+    static const QObjectList *objectTrees();
+
+    QObjectList *queryList( const char *inheritsClass = 0,
+                                  const char *objName = 0,
+                                  bool regexpMatch = TRUE,
+                                  bool recursiveSearch = TRUE ) const;
+
+    virtual void insertChild( QObject * );
+    virtual void removeChild( QObject * );
+
+    void installEventFilter( const QObject * );
+    void removeEventFilter( const QObject * );
+
+    static bool connect( const QObject *sender, const char *signal,
+                          const QObject *receiver, const char *member );
+    bool connect( const QObject *sender, const char *signal,
+                          const char *member ) const;
+    static bool disconnect( const QObject *sender, const char *signal,
+                             const QObject *receiver, const char *member );
+    bool disconnect( const char *signal=0,
+                             const QObject *receiver=0, const char *member=0 );
+    bool disconnect( const QObject *receiver, const char *member=0 );
+    static void connectInternal( const QObject *sender, int signal_index,
+                          const QObject *receiver, int membcode, int member_index );
+    static bool disconnectInternal( const QObject *sender, int signal_index,
+                             const QObject *receiver, int membcode, int member_index );
+
+    void dumpObjectTree();
+    void dumpObjectInfo();
+
+
+    virtual bool setProperty( const char *name, const QVariant& value );
+    virtual QVariant property( const char *name ) const;
+    static uint registerUserData();
+    void setUserData( uint id, QObjectUserData* data);
+    QObjectUserData* userData( uint id ) const;
+
+
+protected:
+    void destroyed();
+    void destroyed( QObject* obj );
+
+public:
+    QObject *parent() const { return parentObj; }
+
+public :
+    void deleteLater();
+
+private :
+    void cleanupEventFilter( QObject* );
+
+protected:
+    bool activate_filters( QEvent * );
+    QConnectionList *receivers( const char* signal ) const;
+    QConnectionList *receivers( int signal ) const;
+    void activate_signal( int signal );
+    void activate_signal( int signal, int );
+    void activate_signal( int signal, double );
+    void activate_signal( int signal, QString );
+    void activate_signal_bool( int signal, bool );
+    void activate_signal( QConnectionList *clist, QUObject *o );
+
+    const QObject *sender();
+
+    virtual void timerEvent( QTimerEvent * );
+    virtual void childEvent( QChildEvent * );
+    virtual void customEvent( QCustomEvent * );
+
+    virtual void connectNotify( const char *signal );
+    virtual void disconnectNotify( const char *signal );
+    virtual bool checkConnectArgs( const char *signal, const QObject *receiver,
+                                   const char *member );
+    static QCString normalizeSignalSlot( const char *signalSlot );
+
+private:
+    uint isSignal : 1;
+    uint isWidget : 1;
+    uint pendTimer : 1;
+    uint blockSig : 1;
+    uint wasDeleted : 1;
+    uint isTree : 1;
+
+    const char *objname;
+    QObject *parentObj;
+    QObjectList *childObjects;
+    QSignalVec *connections;
+    QSenderObjectList *senderObjects;
+    QObjectList *eventFilters;
+    QPostEventList *postedEvents;
+    QObjectPrivate* d;
+
+    static QMetaObject* staticQtMetaObject();
+
+    friend class QApplication;
+    friend class QBaseApplication;
+    friend class QWidget;
+    friend class QSignal;
+
+private:
+
+    QObject( const QObject & );
+    QObject &operator=( const QObject & );
+
+};
+
+
+
+class QObjectUserData {
+public:
+    virtual ~QObjectUserData();
+};
+
+
+
+inline bool QObject::connect( const QObject *sender, const char *signal,
+                              const char *member ) const
+{
+    return connect( sender, signal, this, member );
+}
+
+
+inline bool QObject::disconnect( const char *signal,
+                                 const QObject *receiver, const char *member )
+{
+    return disconnect( this, signal, receiver, member );
+}
+
+
+inline bool QObject::disconnect( const QObject *receiver, const char *member )
+{
+    return disconnect( this, 0, receiver, member );
+}
+
+
+
+
+
+class QTranslatorPrivate;
+
+class QTranslatorMessage
+{
+public:
+    QTranslatorMessage();
+    QTranslatorMessage( const char * context,
+                        const char * sourceText,
+                        const char * comment,
+                        const QString& translation = QString::null );
+    QTranslatorMessage( QDataStream & );
+    QTranslatorMessage( const QTranslatorMessage & m );
+
+    QTranslatorMessage & operator=( const QTranslatorMessage & m );
+
+    uint hash() const { return h; }
+    const char *context() const { return cx; }
+    const char *sourceText() const { return st; }
+    const char *comment() const { return cm; }
+
+    void setTranslation( const QString & translation ) { tn = translation; }
+    QString translation() const { return tn; }
+
+    enum Prefix { NoPrefix, Hash, HashContext, HashContextSourceText,
+                  HashContextSourceTextComment };
+    void write( QDataStream & s, bool strip = FALSE,
+                Prefix prefix = HashContextSourceTextComment ) const;
+    Prefix commonPrefix( const QTranslatorMessage& ) const;
+
+    bool operator==( const QTranslatorMessage& m ) const;
+    bool operator!=( const QTranslatorMessage& m ) const
+    { return !operator==( m ); }
+    bool operator<( const QTranslatorMessage& m ) const;
+    bool operator<=( const QTranslatorMessage& m ) const
+    { return !m.operator<( *this ); }
+    bool operator>( const QTranslatorMessage& m ) const
+    { return m.operator<( *this ); }
+    bool operator>=( const QTranslatorMessage& m ) const
+    { return !operator<( m ); }
+
+private:
+    uint h;
+    QCString cx;
+    QCString st;
+    QCString cm;
+    QString tn;
+
+    enum Tag { Tag_End = 1, Tag_SourceText16, Tag_Translation, Tag_Context16,
+               Tag_Hash, Tag_SourceText, Tag_Context, Tag_Comment,
+               Tag_Obsolete1 };
+};
+
+
+class QTranslator: public QObject
+{
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+public:
+    QTranslator( QObject * parent = 0, const char * name = 0 );
+    ~QTranslator();
+
+
+
+
+
+
+    virtual QTranslatorMessage findMessage( const char *, const char *,
+                                            const char * = 0 ) const;
+
+    bool load( const QString & filename,
+               const QString & directory = QString::null,
+               const QString & search_delimiters = QString::null,
+               const QString & suffix = QString::null );
+    bool load( const uchar *data, int len ) {
+        clear();
+        return do_load( data, len );
+    }
+
+    void clear();
+
+
+    enum SaveMode { Everything, Stripped };
+
+    bool save( const QString & filename, SaveMode mode = Everything );
+
+    void insert( const QTranslatorMessage& );
+    void insert( const char *context, const char *sourceText, const QString &translation ) {
+        insert( QTranslatorMessage(context, sourceText, "", translation) );
+    }
+    void remove( const QTranslatorMessage& );
+    void remove( const char *context, const char *sourceText ) {
+        remove( QTranslatorMessage(context, sourceText, "") );
+    }
+    bool contains( const char *, const char *, const char * comment = 0 ) const;
+
+    void squeeze( SaveMode = Everything );
+    void unsqueeze();
+
+    QValueList<QTranslatorMessage> messages() const;
+
+
+    bool isEmpty() const;
+
+private:
+
+    QTranslator( const QTranslator & );
+    QTranslator &operator=( const QTranslator & );
+
+
+    bool do_load( const uchar *data, int len );
+
+    QTranslatorPrivate * d;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+class QGVector;
+class QGList;
+class QGDict;
+
+
+class QPtrCollection
+{
+public:
+    bool autoDelete() const { return del_item; }
+    void setAutoDelete( bool enable ) { del_item = enable; }
+
+    virtual uint count() const = 0;
+    virtual void clear() = 0;
+
+    typedef void *Item;
+
+protected:
+    QPtrCollection() { del_item = FALSE; }
+    QPtrCollection(const QPtrCollection &) { del_item = FALSE; }
+    virtual ~QPtrCollection() {}
+
+    bool del_item;
+
+    virtual Item newItem( Item );
+    virtual void deleteItem( Item ) = 0;
+};
+
+
+class QLNode
+{
+friend class QGList;
+friend class QGListIterator;
+friend class QGListStdIterator;
+public:
+    QPtrCollection::Item getData() { return data; }
+private:
+    QPtrCollection::Item data;
+    QLNode *prev;
+    QLNode *next;
+    QLNode( QPtrCollection::Item d ) { data = d; }
+};
+
+class QGListIteratorList;
+
+class QGList : public QPtrCollection
+{
+friend class QGListIterator;
+friend class QGListIteratorList;
+friend class QGVector;
+public:
+    uint count() const;
+
+
+    QDataStream &read( QDataStream & );
+    QDataStream &write( QDataStream & ) const;
+
+protected:
+    QGList();
+    QGList( const QGList & );
+    virtual ~QGList();
+
+    QGList &operator=( const QGList & );
+    bool operator==( const QGList& ) const;
+
+    void inSort( QPtrCollection::Item );
+    void append( QPtrCollection::Item );
+    bool insertAt( uint index, QPtrCollection::Item );
+    void relinkNode( QLNode * );
+    bool removeNode( QLNode * );
+    bool remove( QPtrCollection::Item = 0 );
+    bool removeRef( QPtrCollection::Item = 0 );
+    bool removeFirst();
+    bool removeLast();
+    bool removeAt( uint );
+    bool replaceAt( uint, QPtrCollection::Item );
+    QPtrCollection::Item takeNode( QLNode * );
+    QPtrCollection::Item take();
+    QPtrCollection::Item takeAt( uint index );
+    QPtrCollection::Item takeFirst();
+    QPtrCollection::Item takeLast();
+
+    void sort();
+    void clear();
+
+    int findRef( QPtrCollection::Item, bool = TRUE );
+    int find( QPtrCollection::Item, bool = TRUE );
+
+    uint containsRef( QPtrCollection::Item ) const;
+    uint contains( QPtrCollection::Item ) const;
+
+    QPtrCollection::Item at( uint index );
+    int at() const;
+    QLNode *currentNode() const;
+
+    QPtrCollection::Item get() const;
+
+    QPtrCollection::Item cfirst() const;
+    QPtrCollection::Item clast() const;
+    QPtrCollection::Item first();
+    QPtrCollection::Item last();
+    QPtrCollection::Item next();
+    QPtrCollection::Item prev();
+
+    void toVector( QGVector * ) const;
+
+    virtual int compareItems( QPtrCollection::Item, QPtrCollection::Item );
+
+
+    virtual QDataStream &read( QDataStream &, QPtrCollection::Item & );
+    virtual QDataStream &write( QDataStream &, QPtrCollection::Item ) const;
+
+
+    QLNode* begin() const { return firstNode; }
+    QLNode* end() const { return 0; }
+    QLNode* erase( QLNode* it );
+
+private:
+    void prepend( QPtrCollection::Item );
+
+    void heapSortPushDown( QPtrCollection::Item* heap, int first, int last );
+
+    QLNode *firstNode;
+    QLNode *lastNode;
+    QLNode *curNode;
+    int curIndex;
+    uint numNodes;
+    QGListIteratorList *iterators;
+
+    QLNode *locate( uint );
+    QLNode *unlink();
+};
+
+
+inline uint QGList::count() const
+{
+    return numNodes;
+}
+
+inline bool QGList::removeFirst()
+{
+    first();
+    return remove();
+}
+
+inline bool QGList::removeLast()
+{
+    last();
+    return remove();
+}
+
+inline int QGList::at() const
+{
+    return curIndex;
+}
+
+inline QPtrCollection::Item QGList::at( uint index )
+{
+    QLNode *n = locate( index );
+    return n ? n->data : 0;
+}
+
+inline QLNode *QGList::currentNode() const
+{
+    return curNode;
+}
+
+inline QPtrCollection::Item QGList::get() const
+{
+    return curNode ? curNode->data : 0;
+}
+
+inline QPtrCollection::Item QGList::cfirst() const
+{
+    return firstNode ? firstNode->data : 0;
+}
+
+inline QPtrCollection::Item QGList::clast() const
+{
+    return lastNode ? lastNode->data : 0;
+}
+
+
+
+
+
+
+
+ QDataStream &operator>>( QDataStream &, QGList & );
+ QDataStream &operator<<( QDataStream &, const QGList & );
+
+
+
+
+
+
+class QGListIterator
+{
+friend class QGList;
+friend class QGListIteratorList;
+protected:
+    QGListIterator( const QGList & );
+    QGListIterator( const QGListIterator & );
+    QGListIterator &operator=( const QGListIterator & );
+   ~QGListIterator();
+
+    bool atFirst() const;
+    bool atLast() const;
+    QPtrCollection::Item toFirst();
+    QPtrCollection::Item toLast();
+
+    QPtrCollection::Item get() const;
+    QPtrCollection::Item operator()();
+    QPtrCollection::Item operator++();
+    QPtrCollection::Item operator+=(uint);
+    QPtrCollection::Item operator--();
+    QPtrCollection::Item operator-=(uint);
+
+protected:
+    QGList *list;
+
+private:
+    QLNode *curNode;
+};
+
+
+inline bool QGListIterator::atFirst() const
+{
+    return curNode == list->firstNode;
+}
+
+inline bool QGListIterator::atLast() const
+{
+    return curNode == list->lastNode;
+}
+
+inline QPtrCollection::Item QGListIterator::get() const
+{
+    return curNode ? curNode->data : 0;
+}
+
+class QGListStdIterator
+{
+public:
+    inline QGListStdIterator( QLNode* n ) : node( n ){}
+    inline operator QLNode* () { return node; }
+protected:
+    inline QLNode *next() { return node->next; }
+    QLNode *node;
+};
+
+
+template<class type>
+class QPtrListStdIterator : public QGListStdIterator
+{
+public:
+    inline QPtrListStdIterator( QLNode* n ): QGListStdIterator(n){}
+    type *operator*() { return node ? (type *)node->getData() : 0; }
+    inline QPtrListStdIterator<type> operator++()
+    { return node = next(); return *this; }
+    inline QPtrListStdIterator<type> operator++(int)
+    { QLNode* n = node; node = next(); return QPtrListStdIterator<type>( n ); }
+    inline bool operator==( const QPtrListStdIterator<type>& it ) const { return node == it.node; }
+    inline bool operator!=( const QPtrListStdIterator<type>& it ) const { return node != it.node; }
+};
+
+
+template<class type>
+class QPtrList
+
+
+
+        : public QGList
+
+{
+public:
+
+    QPtrList() {}
+    QPtrList( const QPtrList<type> &l ) : QGList(l) {}
+    ~QPtrList() { clear(); }
+    QPtrList<type> &operator=(const QPtrList<type> &l)
+                        { return (QPtrList<type>&)QGList::operator=(l); }
+    bool operator==( const QPtrList<type> &list ) const
+    { return QGList::operator==( list ); }
+    bool operator!=( const QPtrList<type> &list ) const
+    { return !QGList::operator==( list ); }
+    uint count() const { return QGList::count(); }
+    bool isEmpty() const { return QGList::count() == 0; }
+    bool insert( uint i, const type *d){ return QGList::insertAt(i,(QPtrCollection::Item)d); }
+    void inSort( const type *d ) { QGList::inSort((QPtrCollection::Item)d); }
+    void prepend( const type *d ) { QGList::insertAt(0,(QPtrCollection::Item)d); }
+    void append( const type *d ) { QGList::append((QPtrCollection::Item)d); }
+    bool remove( uint i ) { return QGList::removeAt(i); }
+    bool remove() { return QGList::remove((QPtrCollection::Item)0); }
+    bool remove( const type *d ) { return QGList::remove((QPtrCollection::Item)d); }
+    bool removeRef( const type *d ) { return QGList::removeRef((QPtrCollection::Item)d); }
+    void removeNode( QLNode *n ) { QGList::removeNode(n); }
+    bool removeFirst() { return QGList::removeFirst(); }
+    bool removeLast() { return QGList::removeLast(); }
+    type *take( uint i ) { return (type *)QGList::takeAt(i); }
+    type *take() { return (type *)QGList::take(); }
+    type *takeNode( QLNode *n ) { return (type *)QGList::takeNode(n); }
+    void clear() { QGList::clear(); }
+    void sort() { QGList::sort(); }
+    int find( const type *d ) { return QGList::find((QPtrCollection::Item)d); }
+    int findNext( const type *d ) { return QGList::find((QPtrCollection::Item)d,FALSE); }
+    int findRef( const type *d ) { return QGList::findRef((QPtrCollection::Item)d); }
+    int findNextRef( const type *d ){ return QGList::findRef((QPtrCollection::Item)d,FALSE);}
+    uint contains( const type *d ) const { return QGList::contains((QPtrCollection::Item)d); }
+    uint containsRef( const type *d ) const
+                                        { return QGList::containsRef((QPtrCollection::Item)d); }
+    bool replace( uint i, const type *d ) { return QGList::replaceAt( i, (QPtrCollection::Item)d ); }
+    type *at( uint i ) { return (type *)QGList::at(i); }
+    int at() const { return QGList::at(); }
+    type *current() const { return (type *)QGList::get(); }
+    QLNode *currentNode() const { return QGList::currentNode(); }
+    type *getFirst() const { return (type *)QGList::cfirst(); }
+    type *getLast() const { return (type *)QGList::clast(); }
+    type *first() { return (type *)QGList::first(); }
+    type *last() { return (type *)QGList::last(); }
+    type *next() { return (type *)QGList::next(); }
+    type *prev() { return (type *)QGList::prev(); }
+    void toVector( QGVector *vec )const{ QGList::toVector(vec); }
+
+
+
+    typedef QPtrListStdIterator<type> Iterator;
+    typedef QPtrListStdIterator<type> ConstIterator;
+    inline Iterator begin() { return QGList::begin(); }
+    inline ConstIterator begin() const { return QGList::begin(); }
+    inline ConstIterator constBegin() const { return QGList::begin(); }
+    inline Iterator end() { return QGList::end(); }
+    inline ConstIterator end() const { return QGList::end(); }
+    inline ConstIterator constEnd() const { return QGList::end(); }
+    inline Iterator erase( Iterator it ) { return QGList::erase( it ); }
+
+    typedef Iterator iterator;
+    typedef ConstIterator const_iterator;
+private:
+    void deleteItem( Item d );
+};
+
+
+template<> inline void QPtrList<void>::deleteItem( QPtrCollection::Item )
+{
+}
+
+
+template<class type> inline void QPtrList<type>::deleteItem( QPtrCollection::Item d )
+{
+    if ( del_item ) delete (type *)d;
+}
+
+template<class type>
+class QPtrListIterator : public QGListIterator
+{
+public:
+    QPtrListIterator(const QPtrList<type> &l) :QGListIterator((QGList &)l) {}
+   ~QPtrListIterator() {}
+    uint count() const { return list->count(); }
+    bool isEmpty() const { return list->count() == 0; }
+    bool atFirst() const { return QGListIterator::atFirst(); }
+    bool atLast() const { return QGListIterator::atLast(); }
+    type *toFirst() { return (type *)QGListIterator::toFirst(); }
+    type *toLast() { return (type *)QGListIterator::toLast(); }
+    operator type *() const { return (type *)QGListIterator::get(); }
+    type *operator*() { return (type *)QGListIterator::get(); }
+
+
+
+
+
+
+
+    type *current() const { return (type *)QGListIterator::get(); }
+    type *operator()() { return (type *)QGListIterator::operator()();}
+    type *operator++() { return (type *)QGListIterator::operator++(); }
+    type *operator+=(uint j) { return (type *)QGListIterator::operator+=(j);}
+    type *operator--() { return (type *)QGListIterator::operator--(); }
+    type *operator-=(uint j) { return (type *)QGListIterator::operator-=(j);}
+    QPtrListIterator<type>& operator=(const QPtrListIterator<type>&it)
+                              { QGListIterator::operator=(it); return *this; }
+};
+
+
+
+
+
+
+typedef QPtrListIterator<char> QStrListIterator;
+
+
+class QStrList : public QPtrList<char>
+{
+public:
+    QStrList( bool deepCopies=TRUE ) { dc = deepCopies; del_item = deepCopies; }
+    QStrList( const QStrList & );
+    ~QStrList() { clear(); }
+    QStrList& operator=( const QStrList & );
+
+private:
+    QPtrCollection::Item newItem( QPtrCollection::Item d ) { return dc ? qstrdup( (const char*)d ) : d; }
+    void deleteItem( QPtrCollection::Item d ) { if ( del_item ) delete[] (char*)d; }
+    int compareItems( QPtrCollection::Item s1, QPtrCollection::Item s2 ) { return qstrcmp((const char*)s1,
+                                                         (const char*)s2); }
+
+    QDataStream &read( QDataStream &s, QPtrCollection::Item &d )
+                                { s >> (char *&)d; return s; }
+    QDataStream &write( QDataStream &s, QPtrCollection::Item d ) const
+                                { return s << (const char *)d; }
+
+    bool dc;
+};
+
+
+class QStrIList : public QStrList
+{
+public:
+    QStrIList( bool deepCopies=TRUE ) : QStrList( deepCopies ) {}
+    ~QStrIList() { clear(); }
+private:
+    int compareItems( QPtrCollection::Item s1, QPtrCollection::Item s2 )
+                                { return qstricmp((const char*)s1,
+                                                    (const char*)s2); }
+};
+
+
+inline QStrList & QStrList::operator=( const QStrList &strList )
+{
+    clear();
+    dc = strList.dc;
+    del_item = dc;
+    QPtrList<char>::operator=( strList );
+    return *this;
+}
+
+inline QStrList::QStrList( const QStrList &strList )
+    : QPtrList<char>( strList )
+{
+    dc = FALSE;
+    operator=( strList );
+}
+
+
+
+
+
+
+
+
+
+class QDir;
+class QFilePrivate;
+
+class QFile : public QIODevice
+{
+public:
+    QFile();
+    QFile( const QString &name );
+   ~QFile();
+
+    QString name() const;
+    void setName( const QString &name );
+
+    typedef QCString (*EncoderFn)( const QString &fileName );
+    typedef QString (*DecoderFn)( const QCString &localfileName );
+    static QCString encodeName( const QString &fileName );
+    static QString decodeName( const QCString &localFileName );
+    static void setEncodingFunction( EncoderFn );
+    static void setDecodingFunction( DecoderFn );
+
+    bool exists() const;
+    static bool exists( const QString &fileName );
+
+    bool remove();
+    static bool remove( const QString &fileName );
+
+    bool open( int );
+    bool open( int, FILE * );
+    bool open( int, int );
+    void close();
+    void flush();
+
+    Offset size() const;
+    Offset at() const;
+    bool at( Offset );
+    bool atEnd() const;
+
+    Q_LONG readBlock( char *data, Q_ULONG len );
+    Q_LONG writeBlock( const char *data, Q_ULONG len );
+    Q_LONG writeBlock( const QByteArray& data )
+                      { return QIODevice::writeBlock(data); }
+    Q_LONG readLine( char *data, Q_ULONG maxlen );
+    Q_LONG readLine( QString &, Q_ULONG maxlen );
+
+    int getch();
+    int putch( int );
+    int ungetch( int );
+
+    int handle() const;
+
+    QString errorString() const;
+
+protected:
+    void setErrorString( const QString& );
+    QString fn;
+    FILE *fh;
+    int fd;
+    Offset length;
+    bool ext_f;
+    QFilePrivate *d;
+
+private:
+    void init();
+    void setErrorStringErrno( int );
+    QCString ungetchBuffer;
+
+private:
+
+    QFile( const QFile & );
+    QFile &operator=( const QFile & );
+
+};
+
+
+inline QString QFile::name() const
+{ return fn; }
+
+inline QIODevice::Offset QFile::at() const
+{ return ioIndex; }
+class QDate
+{
+public:
+    QDate() { jd = 0; }
+    QDate( int y, int m, int d );
+
+    bool isNull() const { return jd == 0; }
+    bool isValid() const;
+
+    int year() const;
+    int month() const;
+    int day() const;
+    int dayOfWeek() const;
+    int dayOfYear() const;
+    int daysInMonth() const;
+    int daysInYear() const;
+    int weekNumber( int *yearNum = 0 ) const;
+
+
+
+
+
+
+    static QString shortMonthName( int month );
+    static QString shortDayName( int weekday );
+    static QString longMonthName( int month );
+    static QString longDayName( int weekday );
+
+
+
+    QString toString( Qt::DateFormat f = Qt::TextDate ) const;
+
+    QString toString( const QString& format ) const;
+
+    bool setYMD( int y, int m, int d );
+
+    QDate addDays( int days ) const;
+    QDate addMonths( int months ) const;
+    QDate addYears( int years ) const;
+    int daysTo( const QDate & ) const;
+
+    bool operator==( const QDate &d ) const { return jd == d.jd; }
+    bool operator!=( const QDate &d ) const { return jd != d.jd; }
+    bool operator<( const QDate &d ) const { return jd < d.jd; }
+    bool operator<=( const QDate &d ) const { return jd <= d.jd; }
+    bool operator>( const QDate &d ) const { return jd > d.jd; }
+    bool operator>=( const QDate &d ) const { return jd >= d.jd; }
+
+    static QDate currentDate();
+    static QDate currentDate( Qt::TimeSpec );
+
+    static QDate fromString( const QString& s, Qt::DateFormat f = Qt::TextDate );
+
+    static bool isValid( int y, int m, int d );
+    static bool leapYear( int year );
+
+    static uint gregorianToJulian( int y, int m, int d );
+    static void julianToGregorian( uint jd, int &y, int &m, int &d );
+private:
+    uint jd;
+    friend class QDateTime;
+
+    friend QDataStream &operator<<( QDataStream &, const QDate & );
+    friend QDataStream &operator>>( QDataStream &, QDate & );
+
+};
+
+
+
+
+
+
+class QTime
+{
+public:
+    QTime() { ds=0; }
+    QTime( int h, int m, int s=0, int ms=0 );
+
+    bool isNull() const { return ds == 0; }
+    bool isValid() const;
+
+    int hour() const;
+    int minute() const;
+    int second() const;
+    int msec() const;
+
+
+    QString toString( Qt::DateFormat f = Qt::TextDate ) const;
+
+    QString toString( const QString& format ) const;
+
+    bool setHMS( int h, int m, int s, int ms=0 );
+
+    QTime addSecs( int secs ) const;
+    int secsTo( const QTime & ) const;
+    QTime addMSecs( int ms ) const;
+    int msecsTo( const QTime & ) const;
+
+    bool operator==( const QTime &d ) const { return ds == d.ds; }
+    bool operator!=( const QTime &d ) const { return ds != d.ds; }
+    bool operator<( const QTime &d ) const { return ds < d.ds; }
+    bool operator<=( const QTime &d ) const { return ds <= d.ds; }
+    bool operator>( const QTime &d ) const { return ds > d.ds; }
+    bool operator>=( const QTime &d ) const { return ds >= d.ds; }
+
+    static QTime currentTime();
+    static QTime currentTime( Qt::TimeSpec );
+
+    static QTime fromString( const QString& s, Qt::DateFormat f = Qt::TextDate );
+
+    static bool isValid( int h, int m, int s, int ms=0 );
+
+    void start();
+    int restart();
+    int elapsed() const;
+
+private:
+    static bool currentTime( QTime * );
+    static bool currentTime( QTime *, Qt::TimeSpec );
+
+    uint ds;
+    friend class QDateTime;
+
+    friend QDataStream &operator<<( QDataStream &, const QTime & );
+    friend QDataStream &operator>>( QDataStream &, QTime & );
+
+};
+
+
+
+
+
+
+class QDateTime
+{
+public:
+    QDateTime() {}
+    QDateTime( const QDate & );
+    QDateTime( const QDate &, const QTime & );
+
+    bool isNull() const { return d.isNull() && t.isNull(); }
+    bool isValid() const { return d.isValid() && t.isValid(); }
+
+    QDate date() const { return d; }
+    QTime time() const { return t; }
+    uint toTime_t() const;
+    void setDate( const QDate &date ) { d = date; }
+    void setTime( const QTime &time ) { t = time; }
+    void setTime_t( uint secsSince1Jan1970UTC );
+    void setTime_t( uint secsSince1Jan1970UTC, Qt::TimeSpec );
+
+
+    QString toString( Qt::DateFormat f = Qt::TextDate ) const;
+
+    QString toString( const QString& format ) const;
+
+    QDateTime addDays( int days ) const;
+    QDateTime addMonths( int months ) const;
+    QDateTime addYears( int years ) const;
+    QDateTime addSecs( int secs ) const;
+    int daysTo( const QDateTime & ) const;
+    int secsTo( const QDateTime & ) const;
+
+    bool operator==( const QDateTime &dt ) const;
+    bool operator!=( const QDateTime &dt ) const;
+    bool operator<( const QDateTime &dt ) const;
+    bool operator<=( const QDateTime &dt ) const;
+    bool operator>( const QDateTime &dt ) const;
+    bool operator>=( const QDateTime &dt ) const;
+
+    static QDateTime currentDateTime();
+    static QDateTime currentDateTime( Qt::TimeSpec );
+
+    static QDateTime fromString( const QString& s, Qt::DateFormat f = Qt::TextDate );
+
+private:
+    QDate d;
+    QTime t;
+
+    friend QDataStream &operator<<( QDataStream &, const QDateTime &);
+    friend QDataStream &operator>>( QDataStream &, QDateTime & );
+
+};
+
+
+
+
+
+
+
+ QDataStream &operator<<( QDataStream &, const QDate & );
+ QDataStream &operator>>( QDataStream &, QDate & );
+ QDataStream &operator<<( QDataStream &, const QTime & );
+ QDataStream &operator>>( QDataStream &, QTime & );
+ QDataStream &operator<<( QDataStream &, const QDateTime & );
+ QDataStream &operator>>( QDataStream &, QDateTime & );
+
+
+
+class QDir;
+struct QFileInfoCache;
+template <class T> class QDeepCopy;
+
+
+class QFileInfo
+{
+public:
+    enum PermissionSpec {
+        ReadOwner = 04000, WriteOwner = 02000, ExeOwner = 01000,
+        ReadUser = 00400, WriteUser = 00200, ExeUser = 00100,
+        ReadGroup = 00040, WriteGroup = 00020, ExeGroup = 00010,
+        ReadOther = 00004, WriteOther = 00002, ExeOther = 00001 };
+
+    QFileInfo();
+    QFileInfo( const QString &file );
+    QFileInfo( const QFile & );
+
+    QFileInfo( const QDir &, const QString &fileName );
+
+    QFileInfo( const QFileInfo & );
+   ~QFileInfo();
+
+    QFileInfo &operator=( const QFileInfo & );
+
+    void setFile( const QString &file );
+    void setFile( const QFile & );
+
+    void setFile( const QDir &, const QString &fileName );
+
+    bool exists() const;
+    void refresh() const;
+    bool caching() const;
+    void setCaching( bool );
+
+    QString filePath() const;
+    QString fileName() const;
+
+    QString absFilePath() const;
+
+    QString baseName( bool complete = FALSE ) const;
+    QString extension( bool complete = TRUE ) const;
+
+
+    QString dirPath( bool absPath = FALSE ) const;
+
+
+    QDir dir( bool absPath = FALSE ) const;
+
+    bool isReadable() const;
+    bool isWritable() const;
+    bool isExecutable() const;
+    bool isHidden() const;
+
+
+    bool isRelative() const;
+    bool convertToAbs();
+
+
+    bool isFile() const;
+    bool isDir() const;
+    bool isSymLink() const;
+
+    QString readLink() const;
+
+    QString owner() const;
+    uint ownerId() const;
+    QString group() const;
+    uint groupId() const;
+
+    bool permission( int permissionSpec ) const;
+
+
+
+
+
+
+    uint size() const;
+
+
+    QDateTime created() const;
+    QDateTime lastModified() const;
+    QDateTime lastRead() const;
+
+private:
+    void doStat() const;
+    static void slashify( QString & );
+    static void makeAbs( QString & );
+
+    QString fn;
+    QFileInfoCache *fic;
+    bool cache;
+
+    bool symLink;
+
+
+    void detach();
+    friend class QDeepCopy< QFileInfo >;
+};
+
+
+inline bool QFileInfo::caching() const
+{
+    return cache;
+}
+
+
+
+
+typedef QPtrList<QFileInfo> QFileInfoList;
+typedef QPtrListIterator<QFileInfo> QFileInfoListIterator;
+class QStringList;
+template <class T> class QDeepCopy;
+
+
+class QDir
+{
+public:
+    enum FilterSpec { Dirs = 0x001,
+                      Files = 0x002,
+                      Drives = 0x004,
+                      NoSymLinks = 0x008,
+                      All = 0x007,
+                      TypeMask = 0x00F,
+
+                      Readable = 0x010,
+                      Writable = 0x020,
+                      Executable = 0x040,
+                      RWEMask = 0x070,
+
+                      Modified = 0x080,
+                      Hidden = 0x100,
+                      System = 0x200,
+                      AccessMask = 0x3F0,
+
+                      DefaultFilter = -1 };
+
+    enum SortSpec { Name = 0x00,
+                      Time = 0x01,
+                      Size = 0x02,
+                      Unsorted = 0x03,
+                      SortByMask = 0x03,
+
+                      DirsFirst = 0x04,
+                      Reversed = 0x08,
+                      IgnoreCase = 0x10,
+                      DefaultSort = -1 };
+
+    QDir();
+    QDir( const QString &path, const QString &nameFilter = QString::null,
+          int sortSpec = Name | IgnoreCase, int filterSpec = All );
+    QDir( const QDir & );
+
+    virtual ~QDir();
+
+    QDir &operator=( const QDir & );
+    QDir &operator=( const QString &path );
+
+    virtual void setPath( const QString &path );
+    virtual QString path() const;
+    virtual QString absPath() const;
+    virtual QString canonicalPath() const;
+
+    virtual QString dirName() const;
+    virtual QString filePath( const QString &fileName,
+                              bool acceptAbsPath = TRUE ) const;
+    virtual QString absFilePath( const QString &fileName,
+                                 bool acceptAbsPath = TRUE ) const;
+
+    static QString convertSeparators( const QString &pathName );
+
+    virtual bool cd( const QString &dirName, bool acceptAbsPath = TRUE );
+    virtual bool cdUp();
+
+    QString nameFilter() const;
+    virtual void setNameFilter( const QString &nameFilter );
+    FilterSpec filter() const;
+    virtual void setFilter( int filterSpec );
+    SortSpec sorting() const;
+    virtual void setSorting( int sortSpec );
+
+    bool matchAllDirs() const;
+    virtual void setMatchAllDirs( bool );
+
+    uint count() const;
+    QString operator[]( int ) const;
+
+    virtual QStrList encodedEntryList( int filterSpec = DefaultFilter,
+                                       int sortSpec = DefaultSort ) const;
+    virtual QStrList encodedEntryList( const QString &nameFilter,
+                                       int filterSpec = DefaultFilter,
+                                       int sortSpec = DefaultSort ) const;
+    virtual QStringList entryList( int filterSpec = DefaultFilter,
+                                   int sortSpec = DefaultSort ) const;
+    virtual QStringList entryList( const QString &nameFilter,
+                                   int filterSpec = DefaultFilter,
+                                   int sortSpec = DefaultSort ) const;
+
+    virtual const QFileInfoList *entryInfoList( int filterSpec = DefaultFilter,
+                                                int sortSpec = DefaultSort ) const;
+    virtual const QFileInfoList *entryInfoList( const QString &nameFilter,
+                                                int filterSpec = DefaultFilter,
+                                                int sortSpec = DefaultSort ) const;
+
+    static const QFileInfoList *drives();
+
+    virtual bool mkdir( const QString &dirName,
+                        bool acceptAbsPath = TRUE ) const;
+    virtual bool rmdir( const QString &dirName,
+                        bool acceptAbsPath = TRUE ) const;
+
+    virtual bool isReadable() const;
+    virtual bool exists() const;
+    virtual bool isRoot() const;
+
+    virtual bool isRelative() const;
+    virtual void convertToAbs();
+
+    virtual bool operator==( const QDir & ) const;
+    virtual bool operator!=( const QDir & ) const;
+
+    virtual bool remove( const QString &fileName,
+                         bool acceptAbsPath = TRUE );
+    virtual bool rename( const QString &name, const QString &newName,
+                         bool acceptAbsPaths = TRUE );
+    virtual bool exists( const QString &name,
+                         bool acceptAbsPath = TRUE );
+
+    static char separator();
+
+    static bool setCurrent( const QString &path );
+    static QDir current();
+    static QDir home();
+    static QDir root();
+    static QString currentDirPath();
+    static QString homeDirPath();
+    static QString rootDirPath();
+
+    static bool match( const QStringList &filters, const QString &fileName );
+    static bool match( const QString &filter, const QString &fileName );
+    static QString cleanDirPath( const QString &dirPath );
+    static bool isRelativePath( const QString &path );
+    void refresh() const;
+
+private:
+
+
+
+
+    void init();
+    virtual bool readDirEntries( const QString &nameFilter,
+                                 int FilterSpec, int SortSpec );
+
+    static void slashify( QString & );
+
+    QString dPath;
+    QStringList *fList;
+    QFileInfoList *fiList;
+    QString nameFilt;
+    FilterSpec filtS;
+    SortSpec sortS;
+    uint dirty : 1;
+    uint allDirs : 1;
+
+    void detach();
+    friend class QDeepCopy< QDir >;
+};
+
+
+inline QString QDir::path() const
+{
+    return dPath;
+}
+
+inline QString QDir::nameFilter() const
+{
+    return nameFilt;
+}
+
+inline QDir::FilterSpec QDir::filter() const
+{
+    return filtS;
+}
+
+inline QDir::SortSpec QDir::sorting() const
+{
+    return sortS;
+}
+
+inline bool QDir::matchAllDirs() const
+{
+    return allDirs;
+}
+
+inline bool QDir::operator!=( const QDir &d ) const
+{
+    return !(*this == d);
+}
+
+
+struct QDirSortItem {
+    QString filename_cache;
+    QFileInfo* item;
+};
+
+
+
+
+
+
+
+class QIODevice;
+class QString;
+class QTextItem;
+
+
+
+struct QPaintDeviceX11Data;
+
+
+union QPDevCmdParam {
+    int ival;
+    int *ivec;
+    QString *str;
+    const QPoint *point;
+    const QRect *rect;
+    const QPointArray *ptarr;
+    const QPixmap *pixmap;
+    const QImage *image;
+    const QColor *color;
+    const QFont *font;
+    const QPen *pen;
+    const QBrush *brush;
+    const QRegion *rgn;
+    const QWMatrix *matrix;
+    const QTextItem *textItem;
+    QIODevice *device;
+};
+
+
+
+class QPaintDevice
+{
+public:
+    virtual ~QPaintDevice();
+
+    int devType() const;
+    bool isExtDev() const;
+    bool paintingActive() const;
+
+    virtual void setResolution( int );
+    virtual int resolution() const;
+
+
+
+
+
+
+    virtual Qt::HANDLE handle() const;
+    virtual Qt::HANDLE x11RenderHandle() const;
+
+
+
+
+
+
+
+    Display *x11Display() const;
+    int x11Screen() const;
+    int x11Depth() const;
+    int x11Cells() const;
+    Qt::HANDLE x11Colormap() const;
+    bool x11DefaultColormap() const;
+    void *x11Visual() const;
+    bool x11DefaultVisual() const;
+
+    static Display *x11AppDisplay();
+    static int x11AppScreen();
+
+    static int x11AppDpiX();
+    static int x11AppDpiY();
+    static void x11SetAppDpiX(int);
+    static void x11SetAppDpiY(int);
+    static int x11AppDepth();
+    static int x11AppCells();
+    static Qt::HANDLE x11AppRootWindow();
+    static Qt::HANDLE x11AppColormap();
+    static bool x11AppDefaultColormap();
+    static void *x11AppVisual();
+    static bool x11AppDefaultVisual();
+
+
+
+    static int x11AppDepth( int screen );
+    static int x11AppCells( int screen );
+    static Qt::HANDLE x11AppRootWindow( int screen );
+    static Qt::HANDLE x11AppColormap( int screen );
+    static void *x11AppVisual( int screen );
+    static bool x11AppDefaultColormap( int screen );
+    static bool x11AppDefaultVisual( int screen );
+    static int x11AppDpiX( int );
+    static int x11AppDpiY( int );
+    static void x11SetAppDpiX( int, int );
+    static void x11SetAppDpiY( int, int );
+    enum PDevCmd {
+        PdcNOP = 0,
+        PdcDrawPoint = 1,
+        PdcDrawFirst = PdcDrawPoint,
+        PdcMoveTo = 2,
+        PdcLineTo = 3,
+        PdcDrawLine = 4,
+        PdcDrawRect = 5,
+        PdcDrawRoundRect = 6,
+        PdcDrawEllipse = 7,
+        PdcDrawArc = 8,
+        PdcDrawPie = 9,
+        PdcDrawChord = 10,
+        PdcDrawLineSegments = 11,
+        PdcDrawPolyline = 12,
+        PdcDrawPolygon = 13,
+        PdcDrawCubicBezier = 14,
+        PdcDrawText = 15,
+        PdcDrawTextFormatted = 16,
+        PdcDrawPixmap = 17,
+        PdcDrawImage = 18,
+        PdcDrawText2 = 19,
+        PdcDrawText2Formatted = 20,
+        PdcDrawTextItem = 21,
+        PdcDrawLast = PdcDrawTextItem,
+
+
+
+        PdcBegin = 30,
+        PdcEnd = 31,
+        PdcSave = 32,
+        PdcRestore = 33,
+        PdcSetdev = 34,
+        PdcSetBkColor = 40,
+        PdcSetBkMode = 41,
+        PdcSetROP = 42,
+        PdcSetBrushOrigin = 43,
+        PdcSetFont = 45,
+        PdcSetPen = 46,
+        PdcSetBrush = 47,
+        PdcSetTabStops = 48,
+        PdcSetTabArray = 49,
+        PdcSetUnit = 50,
+        PdcSetVXform = 51,
+        PdcSetWindow = 52,
+        PdcSetViewport = 53,
+        PdcSetWXform = 54,
+        PdcSetWMatrix = 55,
+        PdcSaveWMatrix = 56,
+        PdcRestoreWMatrix = 57,
+        PdcSetClip = 60,
+        PdcSetClipRegion = 61,
+
+        PdcReservedStart = 0,
+        PdcReservedStop = 199
+    };
+
+protected:
+    QPaintDevice( uint devflags );
+
+
+
+
+    Qt::HANDLE hd;
+    Qt::HANDLE rendhd;
+
+    void copyX11Data( const QPaintDevice * );
+    void cloneX11Data( const QPaintDevice * );
+    virtual void setX11Data( const QPaintDeviceX11Data* );
+    QPaintDeviceX11Data* getX11Data( bool def=FALSE ) const;
+    virtual bool cmd( int, QPainter *, QPDevCmdParam * );
+    virtual int metric( int ) const;
+    virtual int fontMet( QFont *, int, const char * = 0, int = 0 ) const;
+    virtual int fontInf( QFont *, int ) const;
+
+    ushort devFlags;
+    ushort painters;
+
+    friend class QPainter;
+    friend class QPaintDeviceMetrics;
+
+
+
+
+
+
+
+    friend void bitBlt( QPaintDevice *, int, int,
+                                 const QPaintDevice *,
+                                 int, int, int, int, Qt::RasterOp, bool );
+
+
+    friend void qt_init_internal( int *, char **, Display *, Qt::HANDLE, Qt::HANDLE );
+    friend void qt_cleanup();
+
+
+private:
+
+    static Display *x_appdisplay;
+    static int x_appscreen;
+
+    static int x_appdepth;
+    static int x_appcells;
+    static Qt::HANDLE x_approotwindow;
+    static Qt::HANDLE x_appcolormap;
+    static bool x_appdefcolormap;
+    static void *x_appvisual;
+    static bool x_appdefvisual;
+
+
+    static int *x_appdepth_arr;
+    static int *x_appcells_arr;
+    static Qt::HANDLE *x_approotwindow_arr;
+    static Qt::HANDLE *x_appcolormap_arr;
+    static bool *x_appdefcolormap_arr;
+    static void **x_appvisual_arr;
+    static bool *x_appdefvisual_arr;
+
+    QPaintDeviceX11Data* x11Data;
+
+
+private:
+
+    QPaintDevice( const QPaintDevice & );
+    QPaintDevice &operator=( const QPaintDevice & );
+
+};
+
+
+
+void bitBlt( QPaintDevice *dst, int dx, int dy,
+             const QPaintDevice *src, int sx=0, int sy=0, int sw=-1, int sh=-1,
+             Qt::RasterOp = Qt::CopyROP, bool ignoreMask=FALSE );
+
+
+void bitBlt( QPaintDevice *dst, int dx, int dy,
+             const QImage *src, int sx=0, int sy=0, int sw=-1, int sh=-1,
+             int conversion_flags=0 );
+
+
+
+
+struct QPaintDeviceX11Data : public QShared {
+    Display* x_display;
+    int x_screen;
+    int x_depth;
+    int x_cells;
+    Qt::HANDLE x_colormap;
+    bool x_defcolormap;
+    void* x_visual;
+    bool x_defvisual;
+};
+
+
+
+
+
+
+
+inline int QPaintDevice::devType() const
+{ return devFlags & QInternal::DeviceTypeMask; }
+
+inline bool QPaintDevice::isExtDev() const
+{ return (devFlags & QInternal::ExternalDevice) != 0; }
+
+inline bool QPaintDevice::paintingActive() const
+{ return painters != 0; }
+
+
+inline Display *QPaintDevice::x11Display() const
+{ return x11Data ? x11Data->x_display : x_appdisplay; }
+
+inline int QPaintDevice::x11Screen() const
+{ return x11Data ? x11Data->x_screen : x_appscreen; }
+
+inline int QPaintDevice::x11Depth() const
+{ return x11Data ? x11Data->x_depth : x_appdepth; }
+
+inline int QPaintDevice::x11Cells() const
+{ return x11Data ? x11Data->x_cells : x_appcells; }
+
+inline Qt::HANDLE QPaintDevice::x11Colormap() const
+{ return x11Data ? x11Data->x_colormap : x_appcolormap; }
+
+inline bool QPaintDevice::x11DefaultColormap() const
+{ return x11Data ? x11Data->x_defcolormap : x_appdefcolormap; }
+
+inline void *QPaintDevice::x11Visual() const
+{ return x11Data ? x11Data->x_visual : x_appvisual; }
+
+inline bool QPaintDevice::x11DefaultVisual() const
+{ return x11Data ? x11Data->x_defvisual : x_appdefvisual; }
+
+inline Display *QPaintDevice::x11AppDisplay()
+{ return x_appdisplay; }
+
+inline int QPaintDevice::x11AppScreen()
+{ return x_appscreen; }
+
+inline int QPaintDevice::x11AppDepth( int screen )
+{ return x_appdepth_arr[ screen == -1 ? x_appscreen : screen ]; }
+
+inline int QPaintDevice::x11AppCells( int screen )
+{ return x_appcells_arr[ screen == -1 ? x_appscreen : screen ]; }
+
+inline Qt::HANDLE QPaintDevice::x11AppRootWindow( int screen )
+{ return x_approotwindow_arr[ screen == -1 ? x_appscreen : screen ]; }
+
+inline Qt::HANDLE QPaintDevice::x11AppColormap( int screen )
+{ return x_appcolormap_arr[ screen == -1 ? x_appscreen : screen ]; }
+
+inline bool QPaintDevice::x11AppDefaultColormap( int screen )
+{ return x_appdefcolormap_arr[ screen == -1 ? x_appscreen : screen ]; }
+
+inline void *QPaintDevice::x11AppVisual( int screen )
+{ return x_appvisual_arr[ screen == -1 ? x_appscreen : screen ]; }
+
+inline bool QPaintDevice::x11AppDefaultVisual( int screen )
+{ return x_appdefvisual_arr[ screen == -1 ? x_appscreen : screen ]; }
+
+inline int QPaintDevice::x11AppDepth()
+{ return x_appdepth; }
+
+inline int QPaintDevice::x11AppCells()
+{ return x_appcells; }
+
+inline Qt::HANDLE QPaintDevice::x11AppRootWindow()
+{ return x_approotwindow; }
+
+inline Qt::HANDLE QPaintDevice::x11AppColormap()
+{ return x_appcolormap; }
+
+inline bool QPaintDevice::x11AppDefaultColormap()
+{ return x_appdefcolormap; }
+
+inline void *QPaintDevice::x11AppVisual()
+{ return x_appvisual; }
+
+inline bool QPaintDevice::x11AppDefaultVisual()
+{ return x_appdefvisual; }
+
+
+
+
+
+inline void bitBlt( QPaintDevice *dst, const QPoint &dp,
+                    const QPaintDevice *src, const QRect &sr =QRect(0,0,-1,-1),
+                    Qt::RasterOp rop=Qt::CopyROP, bool ignoreMask=FALSE )
+{
+    bitBlt( dst, dp.x(), dp.y(), src, sr.x(), sr.y(), sr.width(), sr.height(),
+            rop, ignoreMask );
+}
+
+
+
+
+
+
+class QRegExp;
+template <class T> class QDeepCopy;
+
+
+
+
+
+
+
+class QStringList : public QValueList<QString>
+{
+public:
+    QStringList() { }
+    QStringList( const QStringList& l ) : QValueList<QString>(l) { }
+    QStringList( const QValueList<QString>& l ) : QValueList<QString>(l) { }
+    QStringList( const QString& i ) { append(i); }
+
+    QStringList( const char* i ) { append(i); }
+
+
+    static QStringList fromStrList(const QStrList&);
+
+    void sort();
+
+    static QStringList split( const QString &sep, const QString &str, bool allowEmptyEntries = FALSE );
+    static QStringList split( const QChar &sep, const QString &str, bool allowEmptyEntries = FALSE );
+
+    static QStringList split( const QRegExp &sep, const QString &str, bool allowEmptyEntries = FALSE );
+
+    QString join( const QString &sep ) const;
+
+    QStringList grep( const QString &str, bool cs = TRUE ) const;
+
+    QStringList grep( const QRegExp &expr ) const;
+
+
+    QStringList& gres( const QString &before, const QString &after,
+                       bool cs = TRUE );
+
+    QStringList& gres( const QRegExp &expr, const QString &after );
+
+
+protected:
+    void detach() { QValueList<QString>::detach(); }
+    friend class QDeepCopy< QStringList >;
+};
+
+
+class QDataStream;
+extern QDataStream &operator>>( QDataStream &, QStringList& );
+extern QDataStream &operator<<( QDataStream &, const QStringList& );
+
+
+const QRgb RGB_MASK = 0x00ffffff;
+
+ inline int qRed( QRgb rgb )
+{ return (int)((rgb >> 16) & 0xff); }
+
+ inline int qGreen( QRgb rgb )
+{ return (int)((rgb >> 8) & 0xff); }
+
+ inline int qBlue( QRgb rgb )
+{ return (int)(rgb & 0xff); }
+
+ inline int qAlpha( QRgb rgb )
+{ return (int)((rgb >> 24) & 0xff); }
+
+ inline QRgb qRgb( int r, int g, int b )
+{ return (0xff << 24) | ((r & 0xff) << 16) | ((g & 0xff) << 8) | (b & 0xff); }
+
+ inline QRgb qRgba( int r, int g, int b, int a )
+{ return ((a & 0xff) << 24) | ((r & 0xff) << 16) | ((g & 0xff) << 8) | (b & 0xff); }
+
+ inline int qGray( int r, int g, int b )
+{ return (r*11+g*16+b*5)/32; }
+
+ inline int qGray( QRgb rgb )
+{ return qGray( qRed(rgb), qGreen(rgb), qBlue(rgb) ); }
+
+
+class QColor
+{
+public:
+    enum Spec { Rgb, Hsv };
+
+    QColor();
+    QColor( int r, int g, int b );
+    QColor( int x, int y, int z, Spec );
+    QColor( QRgb rgb, uint pixel=0xffffffff);
+    QColor( const QString& name );
+    QColor( const char *name );
+    QColor( const QColor & );
+    QColor &operator=( const QColor & );
+
+    bool isValid() const;
+    bool isDirty() const;
+    QString name() const;
+    void setNamedColor( const QString& name );
+
+    QRgb rgb() const;
+    void setRgb( int r, int g, int b );
+    void setRgb( QRgb rgb );
+    void getRgb( int *r, int *g, int *b ) const { rgb( r, g, b ); }
+    void rgb( int *r, int *g, int *b ) const;
+
+    int red() const;
+    int green() const;
+    int blue() const;
+
+    void setHsv( int h, int s, int v );
+    void getHsv( int *h, int *s, int *v ) const { hsv( h, s, v ); }
+    void hsv( int *h, int *s, int *v ) const;
+    void getHsv( int &h, int &s, int &v ) const { hsv( &h, &s, &v ); }
+
+    QColor light( int f = 150 ) const;
+    QColor dark( int f = 200 ) const;
+
+    bool operator==( const QColor &c ) const;
+    bool operator!=( const QColor &c ) const;
+
+    uint alloc();
+    uint pixel() const;
+
+
+
+    uint alloc( int screen );
+    uint pixel( int screen ) const;
+
+
+    static int maxColors();
+    static int numBitPlanes();
+
+    static int enterAllocContext();
+    static void leaveAllocContext();
+    static int currentAllocContext();
+    static void destroyAllocContext( int );
+    static void initialize();
+    static void cleanup();
+
+    static QStringList colorNames();
+
+    enum { Dirt = 0x44495254, Invalid = 0x49000000 };
+
+private:
+    void setSystemNamedColor( const QString& name );
+    void setPixel( uint pixel );
+    static void initGlobalColors();
+    static uint argbToPix32(QRgb);
+    static QColor* globalColors();
+    static bool color_init;
+    static bool globals_init;
+
+
+
+    static enum ColorModel { d8, d32 } colormodel;
+    union {
+        QRgb argb;
+        struct D8 {
+            QRgb argb;
+            uchar pix;
+            uchar invalid;
+            uchar dirty;
+            uchar direct;
+        } d8;
+        struct D32 {
+            QRgb argb;
+            uint pix;
+            bool invalid() const { return argb == QColor::Invalid && pix == QColor::Dirt; }
+            bool probablyDirty() const { return pix == QColor::Dirt; }
+        } d32;
+    } d;
+};
+
+
+inline QColor::QColor()
+{ d.d32.argb = Invalid; d.d32.pix = Dirt; }
+
+inline QColor::QColor( int r, int g, int b )
+{ setRgb( r, g, b ); }
+
+inline QRgb QColor::rgb() const
+{ return d.argb; }
+
+inline int QColor::red() const
+{ return qRed(d.argb); }
+
+inline int QColor::green() const
+{ return qGreen(d.argb); }
+
+inline int QColor::blue() const
+{ return qBlue(d.argb); }
+
+inline bool QColor::isValid() const
+{
+    if ( colormodel == d8 )
+        return !d.d8.invalid;
+    else
+        return !d.d32.invalid();
+}
+
+inline bool QColor::operator==( const QColor &c ) const
+{
+    return d.argb == c.d.argb && isValid() == c.isValid();
+}
+
+inline bool QColor::operator!=( const QColor &c ) const
+{
+    return !operator==(c);
+}
+
+
+
+
+
+
+
+ QDataStream &operator<<( QDataStream &, const QColor & );
+ QDataStream &operator>>( QDataStream &, QColor & );
+
+
+
+
+
+
+
+
+class QBrush: public Qt
+{
+friend class QPainter;
+public:
+    QBrush();
+    QBrush( BrushStyle );
+    QBrush( const QColor &, BrushStyle=SolidPattern );
+    QBrush( const QColor &, const QPixmap & );
+    QBrush( const QBrush & );
+   ~QBrush();
+    QBrush &operator=( const QBrush & );
+
+    BrushStyle style() const { return data->style; }
+    void setStyle( BrushStyle );
+    const QColor &color()const { return data->color; }
+    void setColor( const QColor & );
+    QPixmap *pixmap() const { return data->pixmap; }
+    void setPixmap( const QPixmap & );
+
+    bool operator==( const QBrush &p ) const;
+    bool operator!=( const QBrush &b ) const
+                                        { return !(operator==(b)); }
+
+private:
+    QBrush copy() const;
+    void detach();
+    void init( const QColor &, BrushStyle );
+    struct QBrushData : public QShared {
+        BrushStyle style;
+        QColor color;
+        QPixmap *pixmap;
+    } *data;
+};
+
+
+
+
+
+
+
+ QDataStream &operator<<( QDataStream &, const QBrush & );
+ QDataStream &operator>>( QDataStream &, QBrush & );
+
+
+
+
+class QColorGroupPrivate;
+
+class QColorGroup
+{
+public:
+    QColorGroup();
+    QColorGroup( const QColor &foreground, const QColor &button,
+                 const QColor &light, const QColor &dark, const QColor &mid,
+                 const QColor &text, const QColor &base );
+    QColorGroup( const QBrush &foreground, const QBrush &button,
+                 const QBrush &light, const QBrush &dark, const QBrush &mid,
+                 const QBrush &text, const QBrush &bright_text,
+                 const QBrush &base, const QBrush &background);
+    QColorGroup( const QColorGroup & );
+
+   ~QColorGroup();
+
+    QColorGroup& operator =(const QColorGroup&);
+
+
+    enum ColorRole { Foreground, Button, Light, Midlight, Dark, Mid,
+                     Text, BrightText, ButtonText, Base, Background, Shadow,
+                     Highlight, HighlightedText, Link, LinkVisited,
+                     NColorRoles };
+
+    const QColor &color( ColorRole ) const;
+    const QBrush &brush( ColorRole ) const;
+    void setColor( ColorRole, const QColor & );
+    void setBrush( ColorRole, const QBrush & );
+
+    const QColor &foreground() const { return br[Foreground].color(); }
+    const QColor &button() const { return br[Button].color(); }
+    const QColor &light() const { return br[Light].color(); }
+    const QColor &dark() const { return br[Dark].color(); }
+    const QColor &mid() const { return br[Mid].color(); }
+    const QColor &text() const { return br[Text].color(); }
+    const QColor &base() const { return br[Base].color(); }
+    const QColor &background() const { return br[Background].color(); }
+
+    const QColor &midlight() const { return br[Midlight].color(); }
+    const QColor &brightText() const { return br[BrightText].color(); }
+    const QColor &buttonText() const { return br[ButtonText].color(); }
+    const QColor &shadow() const { return br[Shadow].color(); }
+    const QColor &highlight() const { return br[Highlight].color(); }
+    const QColor &highlightedText() const{return br[HighlightedText].color(); }
+    const QColor &link() const { return br[Link].color(); }
+    const QColor &linkVisited() const { return br[LinkVisited].color(); }
+
+    bool operator==( const QColorGroup &g ) const;
+    bool operator!=( const QColorGroup &g ) const
+        { return !(operator==(g)); }
+
+private:
+    QBrush *br;
+    QColorGroupPrivate * d;
+
+    friend class QPalette;
+};
+
+
+class QPalette
+{
+public:
+    QPalette();
+    QPalette( const QColor &button );
+    QPalette( const QColor &button, const QColor &background );
+    QPalette( const QColorGroup &active, const QColorGroup &disabled,
+              const QColorGroup &inactive );
+    QPalette( const QPalette & );
+    ~QPalette();
+    QPalette &operator=( const QPalette & );
+
+    enum ColorGroup { Disabled, Active, Inactive, NColorGroups, Normal=Active };
+
+    const QColor &color( ColorGroup, QColorGroup::ColorRole ) const;
+    const QBrush &brush( ColorGroup, QColorGroup::ColorRole ) const;
+    void setColor( ColorGroup, QColorGroup::ColorRole, const QColor & );
+    void setBrush( ColorGroup, QColorGroup::ColorRole, const QBrush & );
+
+    void setColor( QColorGroup::ColorRole, const QColor & );
+    void setBrush( QColorGroup::ColorRole, const QBrush & );
+
+    QPalette copy() const;
+
+    const QColorGroup &active() const { return data->active; }
+    const QColorGroup &disabled() const { return data->disabled; }
+    const QColorGroup &inactive() const { return data->inactive; }
+
+
+
+
+    void setActive( const QColorGroup & );
+    void setDisabled( const QColorGroup & );
+    void setInactive( const QColorGroup & );
+
+
+
+
+    bool operator==( const QPalette &p ) const;
+    bool operator!=( const QPalette &p ) const
+              { return !(operator==(p)); }
+    bool isCopyOf( const QPalette & );
+
+    int serialNumber() const { return data->ser_no; }
+
+
+    static QColorGroup::ColorRole foregroundRoleFromMode( Qt::BackgroundMode mode );
+    static QColorGroup::ColorRole backgroundRoleFromMode( Qt::BackgroundMode mode);
+
+private:
+    void detach();
+    const QBrush &directBrush( ColorGroup, QColorGroup::ColorRole ) const;
+    void directSetBrush( ColorGroup, QColorGroup::ColorRole, const QBrush& );
+
+    struct QPalData : public QShared {
+        QColorGroup disabled;
+        QColorGroup active;
+        int ser_no;
+        QColorGroup inactive;
+    } *data;
+};
+
+
+
+
+
+
+
+ QDataStream &operator<<( QDataStream &, const QColorGroup & );
+ QDataStream &operator>>( QDataStream &, QColorGroup & );
+
+ QDataStream &operator<<( QDataStream &, const QPalette & );
+ QDataStream &operator>>( QDataStream &, QPalette & );
+
+
+
+
+
+
+
+class QFontPrivate;
+class QStringList;
+class QTextFormatCollection;
+
+class QFont
+{
+public:
+    enum StyleHint {
+        Helvetica, SansSerif = Helvetica,
+        Times, Serif = Times,
+        Courier, TypeWriter = Courier,
+        OldEnglish, Decorative = OldEnglish,
+        System,
+        AnyStyle
+    };
+
+    enum StyleStrategy {
+        PreferDefault = 0x0001,
+        PreferBitmap = 0x0002,
+        PreferDevice = 0x0004,
+        PreferOutline = 0x0008,
+        ForceOutline = 0x0010,
+        PreferMatch = 0x0020,
+        PreferQuality = 0x0040,
+        PreferAntialias = 0x0080,
+        NoAntialias = 0x0100,
+        OpenGLCompatible = 0x0200
+    };
+
+    enum Weight {
+        Light = 25,
+        Normal = 50,
+        DemiBold = 63,
+        Bold = 75,
+        Black = 87
+    };
+
+    enum Stretch {
+        UltraCondensed = 50,
+        ExtraCondensed = 62,
+        Condensed = 75,
+        SemiCondensed = 87,
+        Unstretched = 100,
+        SemiExpanded = 112,
+        Expanded = 125,
+        ExtraExpanded = 150,
+        UltraExpanded = 200
+    };
+
+
+    QFont();
+
+
+
+
+
+    QFont( const QString &family, int pointSize = -1, int weight = -1,
+           bool italic = FALSE );
+
+
+    QFont( const QFont & );
+
+    ~QFont();
+
+    QString family() const;
+    void setFamily( const QString &);
+
+    int pointSize() const;
+    float pointSizeFloat() const;
+    void setPointSize( int );
+    void setPointSizeFloat( float );
+
+    int pixelSize() const;
+    void setPixelSize( int );
+    void setPixelSizeFloat( float );
+
+    int weight() const;
+    void setWeight( int );
+
+    bool bold() const;
+    void setBold( bool );
+
+    bool italic() const;
+    void setItalic( bool );
+
+    bool underline() const;
+    void setUnderline( bool );
+
+    bool overline() const;
+    void setOverline( bool );
+
+    bool strikeOut() const;
+    void setStrikeOut( bool );
+
+    bool fixedPitch() const;
+    void setFixedPitch( bool );
+
+    StyleHint styleHint() const;
+    StyleStrategy styleStrategy() const;
+    void setStyleHint( StyleHint, StyleStrategy = PreferDefault );
+    void setStyleStrategy( StyleStrategy s );
+
+    int stretch() const;
+    void setStretch( int );
+
+
+    bool rawMode() const;
+    void setRawMode( bool );
+
+
+    bool exactMatch() const;
+
+    QFont &operator=( const QFont & );
+    bool operator==( const QFont & ) const;
+    bool operator!=( const QFont & ) const;
+    bool isCopyOf( const QFont & ) const;
+
+
+
+
+
+    Qt::HANDLE handle() const;
+
+
+
+
+    void setRawName( const QString & );
+    QString rawName() const;
+
+    QString key() const;
+
+    QString toString() const;
+    bool fromString(const QString &);
+
+
+    static QString substitute(const QString &);
+    static QStringList substitutes(const QString &);
+    static QStringList substitutions();
+    static void insertSubstitution(const QString&, const QString &);
+    static void insertSubstitutions(const QString&, const QStringList &);
+    static void removeSubstitution(const QString &);
+
+    static void initialize();
+    static void cleanup();
+
+    static void cacheStatistics();
+    enum Script {
+
+        Latin,
+        Greek,
+        Cyrillic,
+        Armenian,
+        Georgian,
+        Runic,
+        Ogham,
+        SpacingModifiers,
+        CombiningMarks,
+
+
+        Hebrew,
+        Arabic,
+        Syriac,
+        Thaana,
+
+
+        Devanagari,
+        Bengali,
+        Gurmukhi,
+        Gujarati,
+        Oriya,
+        Tamil,
+        Telugu,
+        Kannada,
+        Malayalam,
+        Sinhala,
+        Thai,
+        Lao,
+        Tibetan,
+        Myanmar,
+        Khmer,
+
+
+        Han,
+        Hiragana,
+        Katakana,
+        Hangul,
+        Bopomofo,
+        Yi,
+
+
+        Ethiopic,
+        Cherokee,
+        CanadianAboriginal,
+        Mongolian,
+
+
+        CurrencySymbols,
+        LetterlikeSymbols,
+        NumberForms,
+        MathematicalOperators,
+        TechnicalSymbols,
+        GeometricSymbols,
+        MiscellaneousSymbols,
+        EnclosedAndSquare,
+        Braille,
+
+        Unicode,
+
+
+        Tagalog,
+        Hanunoo,
+        Buhid,
+        Tagbanwa,
+
+        KatakanaHalfWidth,
+
+
+        NScripts,
+        UnknownScript = NScripts,
+
+        NoScript,
+
+
+
+
+
+        Han_Japanese,
+        Han_SimplifiedChinese,
+        Han_TraditionalChinese,
+        Han_Korean,
+
+        LastPrivateScript
+
+    };
+
+    QString defaultFamily() const;
+    QString lastResortFamily() const;
+    QString lastResortFont() const;
+    QFont resolve( const QFont & ) const;
+
+protected:
+
+    bool dirty() const;
+    int deciPointSize() const;
+
+private:
+    QFont( QFontPrivate *, QPaintDevice *pd );
+
+    void detach();
+
+
+
+
+    void x11SetScreen( int screen = -1 );
+    int x11Screen() const;
+
+
+    friend class QFontMetrics;
+    friend class QFontInfo;
+    friend class QPainter;
+    friend class QPSPrinterFont;
+    friend class QApplication;
+    friend class QWidget;
+    friend class QTextFormatCollection;
+    friend class QTextLayout;
+    friend class QTextItem;
+
+
+    friend QDataStream &operator<<( QDataStream &, const QFont & );
+    friend QDataStream &operator>>( QDataStream &, QFont & );
+
+
+    QFontPrivate *d;
+};
+
+
+inline bool QFont::bold() const
+{ return weight() > Normal; }
+
+
+inline void QFont::setBold( bool enable )
+{ setWeight( enable ? Bold : Normal ); }
+ QDataStream &operator<<( QDataStream &, const QFont & );
+ QDataStream &operator>>( QDataStream &, QFont & );
+class QTextCodec;
+class QTextParag;
+
+class QFontMetrics
+{
+public:
+    QFontMetrics( const QFont & );
+    QFontMetrics( const QFont &, QFont::Script );
+    QFontMetrics( const QFontMetrics & );
+    ~QFontMetrics();
+
+    QFontMetrics &operator=( const QFontMetrics & );
+
+    int ascent() const;
+    int descent() const;
+    int height() const;
+    int leading() const;
+    int lineSpacing() const;
+    int minLeftBearing() const;
+    int minRightBearing() const;
+    int maxWidth() const;
+
+    bool inFont(QChar) const;
+
+    int leftBearing(QChar) const;
+    int rightBearing(QChar) const;
+    int width( const QString &, int len = -1 ) const;
+
+    int width( QChar ) const;
+
+
+
+
+    int charWidth( const QString &str, int pos ) const;
+    QRect boundingRect( const QString &, int len = -1 ) const;
+    QRect boundingRect( QChar ) const;
+    QRect boundingRect( int x, int y, int w, int h, int flags,
+                              const QString& str, int len=-1, int tabstops=0,
+                              int *tabarray=0, QTextParag **intern=0 ) const;
+    QSize size( int flags,
+                      const QString& str, int len=-1, int tabstops=0,
+                      int *tabarray=0, QTextParag **intern=0 ) const;
+
+    int underlinePos() const;
+    int overlinePos() const;
+    int strikeOutPos() const;
+    int lineWidth() const;
+
+private:
+    QFontMetrics( const QPainter * );
+
+    friend class QWidget;
+    friend class QPainter;
+    friend class QTextFormat;
+
+
+
+
+    QFontPrivate *d;
+    QPainter *painter;
+    int fscript;
+};
+
+
+
+
+
+
+class QFontInfo
+{
+public:
+    QFontInfo( const QFont & );
+    QFontInfo( const QFont &, QFont::Script );
+    QFontInfo( const QFontInfo & );
+    ~QFontInfo();
+
+    QFontInfo &operator=( const QFontInfo & );
+
+    QString family() const;
+    int pixelSize() const;
+    int pointSize() const;
+    bool italic() const;
+    int weight() const;
+    bool bold() const;
+    bool underline() const;
+    bool overline() const;
+    bool strikeOut() const;
+    bool fixedPitch() const;
+    QFont::StyleHint styleHint() const;
+    bool rawMode() const;
+
+    bool exactMatch() const;
+
+
+private:
+    QFontInfo( const QPainter * );
+
+    QFontPrivate *d;
+    QPainter *painter;
+    int fscript;
+
+    friend class QWidget;
+    friend class QPainter;
+};
+
+
+inline bool QFontInfo::bold() const
+{ return weight() > QFont::Normal; }
+
+
+
+
+
+
+class QSizePolicy
+{
+private:
+    enum { HSize = 6, HMask = 0x3f, VMask = HMask << HSize,
+           MayGrow = 1, ExpMask = 2, MayShrink = 4 };
+public:
+    enum SizeType { Fixed = 0,
+                    Minimum = MayGrow,
+                    Maximum = MayShrink,
+                    Preferred = MayGrow | MayShrink,
+                    MinimumExpanding = MayGrow | ExpMask,
+                    Expanding = MayGrow | MayShrink | ExpMask,
+                    Ignored = ExpMask };
+
+    enum ExpandData { NoDirection = 0,
+                      Horizontally = 1,
+                      Vertically = 2,
+
+
+
+
+                      BothDirections = Horizontally | Vertically };
+
+    QSizePolicy() : data( 0 ) { }
+
+    QSizePolicy( SizeType hor, SizeType ver, bool hfw = FALSE )
+        : data( hor | (ver<<HSize) | (hfw ? (Q_UINT32)(1<<2*HSize) : 0) ) { }
+    QSizePolicy( SizeType hor, SizeType ver, uchar hors, uchar vers, bool hfw = FALSE );
+
+    SizeType horData() const { return (SizeType)( data & HMask ); }
+    SizeType verData() const { return (SizeType)( (data & VMask) >> HSize ); }
+
+    bool mayShrinkHorizontally() const { return horData() & MayShrink || horData() == Ignored; }
+    bool mayShrinkVertically() const { return verData() & MayShrink || verData() == Ignored; }
+    bool mayGrowHorizontally() const { return horData() & MayGrow || horData() == Ignored; }
+    bool mayGrowVertically() const { return verData() & MayGrow || verData() == Ignored; }
+
+    ExpandData expanding() const
+    {
+        return (ExpandData)( (int)(verData() & ExpMask ? Vertically : 0) |
+                             (int)(horData() & ExpMask ? Horizontally : 0) );
+    }
+
+    void setHorData( SizeType d ) { data = (Q_UINT32)(data & ~HMask) | d; }
+    void setVerData( SizeType d ) { data = (Q_UINT32)(data & ~(HMask << HSize)) |
+                                           (d << HSize); }
+
+    void setHeightForWidth( bool b ) { data = b ? (Q_UINT32)( data | ( 1 << 2*HSize ) )
+                                              : (Q_UINT32)( data & ~( 1 << 2*HSize ) ); }
+    bool hasHeightForWidth() const { return data & ( 1 << 2*HSize ); }
+
+    bool operator==( const QSizePolicy& s ) const { return data == s.data; }
+    bool operator!=( const QSizePolicy& s ) const { return data != s.data; }
+
+
+    uint horStretch() const { return data >> 24; }
+    uint verStretch() const { return (data >> 16) & 0xff; }
+    void setHorStretch( uchar sf ) { data = (data&0x00ffffff) | (uint(sf)<<24); }
+    void setVerStretch( uchar sf ) { data = (data&0xff00ffff) | (uint(sf)<<16); }
+    inline void transpose();
+
+private:
+    QSizePolicy( int i ) : data( (Q_UINT32)i ) { }
+
+    Q_UINT32 data;
+};
+
+inline QSizePolicy::QSizePolicy( SizeType hor, SizeType ver, uchar hors, uchar vers, bool hfw )
+    : data( hor | (ver<<HSize) | (hfw ? (Q_UINT32)(1<<2*HSize) : 0) ) {
+    setHorStretch( hors );
+    setVerStretch( vers );
+}
+
+inline void QSizePolicy::transpose() {
+    *this = QSizePolicy( verData(), horData(), verStretch(), horStretch(),
+                         hasHeightForWidth() );
+}
+
+
+class QLayout;
+struct QWExtra;
+struct QTLWExtra;
+class QFocusData;
+class QCursor;
+class QWSRegionManager;
+class QStyle;
+
+class QWidget : public QObject, public QPaintDevice
+{
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+
+   
+   
+
+
+   
+   
+   
+
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+
+public:
+    explicit QWidget( QWidget* parent=0, const char* name=0, WFlags f=0 );
+    ~QWidget();
+
+    WId winId() const;
+    void setName( const char *name );
+
+
+
+    QStyle &style() const;
+    void setStyle( QStyle * );
+    QStyle* setStyle( const QString& );
+
+
+
+    bool isTopLevel() const;
+    bool isDialog() const;
+    bool isPopup() const;
+    bool isDesktop() const;
+    bool isModal() const;
+
+    bool isEnabled() const;
+    bool isEnabledTo(QWidget*) const;
+    bool isEnabledToTLW() const;
+
+public :
+    virtual void setEnabled( bool );
+    void setDisabled( bool );
+
+
+
+public:
+    QRect frameGeometry() const;
+    const QRect &geometry() const;
+    int x() const;
+    int y() const;
+    QPoint pos() const;
+    QSize frameSize() const;
+    QSize size() const;
+    int width() const;
+    int height() const;
+    QRect rect() const;
+    QRect childrenRect() const;
+    QRegion childrenRegion() const;
+
+    QSize minimumSize() const;
+    QSize maximumSize() const;
+    int minimumWidth() const;
+    int minimumHeight() const;
+    int maximumWidth() const;
+    int maximumHeight() const;
+    void setMinimumSize( const QSize & );
+    virtual void setMinimumSize( int minw, int minh );
+    void setMaximumSize( const QSize & );
+    virtual void setMaximumSize( int maxw, int maxh );
+    void setMinimumWidth( int minw );
+    void setMinimumHeight( int minh );
+    void setMaximumWidth( int maxw );
+    void setMaximumHeight( int maxh );
+
+    QSize sizeIncrement() const;
+    void setSizeIncrement( const QSize & );
+    virtual void setSizeIncrement( int w, int h );
+    QSize baseSize() const;
+    void setBaseSize( const QSize & );
+    void setBaseSize( int basew, int baseh );
+
+    void setFixedSize( const QSize & );
+    void setFixedSize( int w, int h );
+    void setFixedWidth( int w );
+    void setFixedHeight( int h );
+
+
+
+    QPoint mapToGlobal( const QPoint & ) const;
+    QPoint mapFromGlobal( const QPoint & ) const;
+    QPoint mapToParent( const QPoint & ) const;
+    QPoint mapFromParent( const QPoint & ) const;
+    QPoint mapTo( QWidget *, const QPoint & ) const;
+    QPoint mapFrom( QWidget *, const QPoint & ) const;
+
+    QWidget *topLevelWidget() const;
+
+
+
+    BackgroundMode backgroundMode() const;
+    virtual void setBackgroundMode( BackgroundMode );
+    void setBackgroundMode( BackgroundMode, BackgroundMode );
+
+    const QColor & foregroundColor() const;
+
+    const QColor & eraseColor() const;
+    virtual void setEraseColor( const QColor & );
+
+    const QPixmap * erasePixmap() const;
+    virtual void setErasePixmap( const QPixmap & );
+
+
+    const QColorGroup & colorGroup() const;
+    const QPalette & palette() const;
+    bool ownPalette() const;
+    virtual void setPalette( const QPalette & );
+    void unsetPalette();
+
+
+    const QColor & paletteForegroundColor() const;
+    void setPaletteForegroundColor( const QColor & );
+
+    const QColor & paletteBackgroundColor() const;
+    virtual void setPaletteBackgroundColor( const QColor & );
+
+    const QPixmap * paletteBackgroundPixmap() const;
+    virtual void setPaletteBackgroundPixmap( const QPixmap & );
+
+    const QBrush& backgroundBrush() const;
+
+    QFont font() const;
+    bool ownFont() const;
+    virtual void setFont( const QFont & );
+    void unsetFont();
+    QFontMetrics fontMetrics() const;
+    QFontInfo fontInfo() const;
+
+
+    const QCursor &cursor() const;
+    bool ownCursor() const;
+    virtual void setCursor( const QCursor & );
+    virtual void unsetCursor();
+
+
+    QString caption() const;
+    const QPixmap *icon() const;
+    QString iconText() const;
+
+    bool hasMouseTracking() const;
+    bool hasMouse() const;
+
+    virtual void setMask( const QBitmap & );
+    virtual void setMask( const QRegion & );
+    void clearMask();
+
+    const QColor & backgroundColor() const;
+    virtual void setBackgroundColor( const QColor & );
+    const QPixmap * backgroundPixmap() const;
+    virtual void setBackgroundPixmap( const QPixmap & );
+
+public :
+
+    virtual void setCaption( const QString &);
+    virtual void setIcon( const QPixmap & );
+    virtual void setIconText( const QString &);
+
+    virtual void setMouseTracking( bool enable );
+
+
+
+    virtual void setFocus();
+    void clearFocus();
+
+public:
+    enum FocusPolicy {
+        NoFocus = 0,
+        TabFocus = 0x1,
+        ClickFocus = 0x2,
+        StrongFocus = TabFocus | ClickFocus | 0x8,
+        WheelFocus = StrongFocus | 0x4
+    };
+
+    bool isActiveWindow() const;
+    virtual void setActiveWindow();
+    bool isFocusEnabled() const;
+
+    FocusPolicy focusPolicy() const;
+    virtual void setFocusPolicy( FocusPolicy );
+    bool hasFocus() const;
+    static void setTabOrder( QWidget *, QWidget * );
+    virtual void setFocusProxy( QWidget * );
+    QWidget * focusProxy() const;
+
+    void setInputMethodEnabled( bool b );
+    bool isInputMethodEnabled() const;
+
+
+    void grabMouse();
+
+    void grabMouse( const QCursor & );
+
+    void releaseMouse();
+    void grabKeyboard();
+    void releaseKeyboard();
+    static QWidget * mouseGrabber();
+    static QWidget * keyboardGrabber();
+
+
+
+    bool isUpdatesEnabled() const;
+
+
+
+
+public :
+    virtual void setUpdatesEnabled( bool enable );
+    void update();
+    void update( int x, int y, int w, int h );
+    void update( const QRect& );
+    void repaint();
+    void repaint( bool erase );
+    void repaint( int x, int y, int w, int h, bool erase=TRUE );
+    void repaint( const QRect &, bool erase = TRUE );
+    void repaint( const QRegion &, bool erase = TRUE );
+
+
+
+    virtual void show();
+    virtual void hide();
+    void setShown( bool show );
+    void setHidden( bool hide );
+
+
+
+    virtual void showMinimized();
+    virtual void showMaximized();
+    void showFullScreen();
+    virtual void showNormal();
+    virtual void polish();
+    void constPolish() const;
+    bool close();
+
+    void raise();
+    void lower();
+    void stackUnder( QWidget* );
+    virtual void move( int x, int y );
+    void move( const QPoint & );
+    virtual void resize( int w, int h );
+    void resize( const QSize & );
+    virtual void setGeometry( int x, int y, int w, int h );
+    virtual void setGeometry( const QRect & );
+
+public:
+    virtual bool close( bool alsoDelete );
+    bool isVisible() const;
+    bool isVisibleTo(QWidget*) const;
+    bool isVisibleToTLW() const;
+    QRect visibleRect() const;
+    bool isHidden() const;
+    bool isShown() const;
+    bool isMinimized() const;
+    bool isMaximized() const;
+    bool isFullScreen() const;
+
+    virtual QSize sizeHint() const;
+    virtual QSize minimumSizeHint() const;
+    virtual QSizePolicy sizePolicy() const;
+    virtual void setSizePolicy( QSizePolicy );
+    void setSizePolicy( QSizePolicy::SizeType hor, QSizePolicy::SizeType ver, bool hfw = FALSE );
+    virtual int heightForWidth(int) const;
+
+    QRegion clipRegion() const;
+
+
+public :
+    virtual void adjustSize();
+
+public:
+
+    QLayout * layout() const { return lay_out; }
+
+    void updateGeometry();
+    virtual void reparent( QWidget *parent, WFlags, const QPoint &,
+                                  bool showIt=FALSE );
+    void reparent( QWidget *parent, const QPoint &,
+                                  bool showIt=FALSE );
+
+
+
+
+
+    void erase();
+    void erase( int x, int y, int w, int h );
+    void erase( const QRect & );
+    void erase( const QRegion & );
+    void scroll( int dx, int dy );
+    void scroll( int dx, int dy, const QRect& );
+
+    void drawText( int x, int y, const QString &);
+    void drawText( const QPoint &, const QString &);
+
+
+
+    QWidget * focusWidget() const;
+    QRect microFocusHint() const;
+
+
+
+    bool acceptDrops() const;
+    virtual void setAcceptDrops( bool on );
+
+
+
+    virtual void setAutoMask(bool);
+    bool autoMask() const;
+
+    enum BackgroundOrigin { WidgetOrigin, ParentOrigin, WindowOrigin, AncestorOrigin };
+
+    virtual void setBackgroundOrigin( BackgroundOrigin );
+    BackgroundOrigin backgroundOrigin() const;
+    QPoint backgroundOffset() const;
+
+
+    virtual bool customWhatsThis() const;
+
+    QWidget * parentWidget( bool sameWindow = FALSE ) const;
+    WState testWState( WState s ) const;
+    WFlags testWFlags( WFlags f ) const;
+    static QWidget * find( WId );
+    static QWidgetMapper *wmapper();
+
+    QWidget *childAt( int x, int y, bool includeThis = FALSE ) const;
+    QWidget *childAt( const QPoint &, bool includeThis = FALSE ) const;
+protected:
+
+    bool event( QEvent * );
+    virtual void mousePressEvent( QMouseEvent * );
+    virtual void mouseReleaseEvent( QMouseEvent * );
+    virtual void mouseDoubleClickEvent( QMouseEvent * );
+    virtual void mouseMoveEvent( QMouseEvent * );
+
+    virtual void wheelEvent( QWheelEvent * );
+
+    virtual void keyPressEvent( QKeyEvent * );
+    virtual void keyReleaseEvent( QKeyEvent * );
+    virtual void focusInEvent( QFocusEvent * );
+    virtual void focusOutEvent( QFocusEvent * );
+    virtual void enterEvent( QEvent * );
+    virtual void leaveEvent( QEvent * );
+    virtual void paintEvent( QPaintEvent * );
+    virtual void moveEvent( QMoveEvent * );
+    virtual void resizeEvent( QResizeEvent * );
+    virtual void closeEvent( QCloseEvent * );
+    virtual void contextMenuEvent( QContextMenuEvent * );
+    virtual void imStartEvent( QIMEvent * );
+    virtual void imComposeEvent( QIMEvent * );
+    virtual void imEndEvent( QIMEvent * );
+    virtual void tabletEvent( QTabletEvent * );
+
+
+    virtual void dragEnterEvent( QDragEnterEvent * );
+    virtual void dragMoveEvent( QDragMoveEvent * );
+    virtual void dragLeaveEvent( QDragLeaveEvent * );
+    virtual void dropEvent( QDropEvent * );
+
+
+    virtual void showEvent( QShowEvent * );
+    virtual void hideEvent( QHideEvent * );
+    virtual bool x11Event( XEvent * );
+
+
+
+
+
+
+
+    virtual void updateMask();
+
+
+
+
+    virtual void styleChange( QStyle& );
+
+    virtual void enabledChange( bool oldEnabled );
+
+    virtual void paletteChange( const QPalette & );
+
+    virtual void fontChange( const QFont & );
+    virtual void windowActivationChange( bool oldActive );
+
+    int metric( int ) const;
+
+    void resetInputContext();
+
+    virtual void create( WId = 0, bool initializeWindow = TRUE,
+                         bool destroyOldWindow = TRUE );
+    virtual void destroy( bool destroyWindow = TRUE,
+                          bool destroySubWindows = TRUE );
+    uint getWState() const;
+    virtual void setWState( uint );
+    void clearWState( uint n );
+    WFlags getWFlags() const;
+    virtual void setWFlags( WFlags );
+    void clearWFlags( WFlags n );
+
+    virtual bool focusNextPrevChild( bool next );
+
+    QWExtra *extraData();
+    QTLWExtra *topData();
+    QFocusData *focusData();
+
+    virtual void setKeyCompression(bool);
+    virtual void setMicroFocusHint(int x, int y, int w, int h, bool text=TRUE, QFont *f = 0);
+private :
+    void focusProxyDestroyed();
+
+private:
+    void setFontSys( QFont *f = 0 );
+
+    void createInputContext();
+    void destroyInputContext();
+    void focusInputContext();
+    void checkChildrenDnd();
+    void setLayout( QLayout *l );
+
+    void setWinId( WId );
+    void showWindow();
+    void hideWindow();
+    void showChildren( bool spontaneous );
+    void hideChildren( bool spontaneous );
+    void reparentSys( QWidget *parent, WFlags, const QPoint &, bool showIt);
+    void createTLExtra();
+    void createExtra();
+    void deleteExtra();
+    void createSysExtra();
+    void deleteSysExtra();
+    void createTLSysExtra();
+    void deleteTLSysExtra();
+    void deactivateWidgetCleanup();
+    void internalSetGeometry( int, int, int, int, bool );
+    void reparentFocusWidgets( QWidget * );
+    QFocusData *focusData( bool create );
+    void setBackgroundFromMode();
+    void setBackgroundColorDirect( const QColor & );
+    void setBackgroundPixmapDirect( const QPixmap & );
+    void setBackgroundModeDirect( BackgroundMode );
+    void setBackgroundEmpty();
+    void updateFrameStrut() const;
+
+    void setBackgroundX11Relative();
+
+
+    WId winid;
+    uint widget_state;
+    uint widget_flags;
+    uint focus_policy : 4;
+    uint own_font :1;
+    uint own_palette :1;
+    uint sizehint_forced :1;
+    uint is_closing :1;
+    uint in_show : 1;
+    uint in_show_maximized : 1;
+    uint fstrut_dirty : 1;
+    uint im_enabled : 1;
+    QRect crect;
+    QColor bg_col;
+
+    QPalette pal;
+
+    QFont fnt;
+
+    QLayout *lay_out;
+
+    QWExtra *extra;
+    static int instanceCounter;
+    static int maxInstances;
+
+    static void createMapper();
+    static void destroyMapper();
+    static QWidgetList *wList();
+    static QWidgetList *tlwList();
+    static QWidgetMapper *mapper;
+    friend class QApplication;
+    friend class QBaseApplication;
+    friend class QPainter;
+    friend class QFontMetrics;
+    friend class QFontInfo;
+    friend class QETWidget;
+    friend class QLayout;
+
+private:
+
+    QWidget( const QWidget & );
+    QWidget &operator=( const QWidget & );
+
+
+public:
+
+    void setPalette( const QPalette &p, bool ) { setPalette( p ); }
+
+    void setFont( const QFont &f, bool ) { setFont( f ); }
+};
+
+
+inline Qt::WState QWidget::testWState( WState s ) const
+{ return (widget_state & s); }
+
+inline Qt::WFlags QWidget::testWFlags( WFlags f ) const
+{ return (widget_flags & f); }
+
+
+inline WId QWidget::winId() const
+{ return winid; }
+
+inline bool QWidget::isTopLevel() const
+{ return testWFlags(WType_TopLevel); }
+
+inline bool QWidget::isDialog() const
+{ return testWFlags(WType_Dialog); }
+
+inline bool QWidget::isPopup() const
+{ return testWFlags(WType_Popup); }
+
+inline bool QWidget::isDesktop() const
+{ return testWFlags(WType_Desktop); }
+
+inline bool QWidget::isEnabled() const
+{ return !testWState(WState_Disabled); }
+
+inline bool QWidget::isModal() const
+{ return testWFlags(WShowModal); }
+
+inline bool QWidget::isEnabledToTLW() const
+{ return isEnabled(); }
+
+inline const QRect &QWidget::geometry() const
+{ return crect; }
+
+inline QSize QWidget::size() const
+{ return crect.size(); }
+
+inline int QWidget::width() const
+{ return crect.width(); }
+
+inline int QWidget::height() const
+{ return crect.height(); }
+
+inline QRect QWidget::rect() const
+{ return QRect(0,0,crect.width(),crect.height()); }
+
+inline int QWidget::minimumWidth() const
+{ return minimumSize().width(); }
+
+inline int QWidget::minimumHeight() const
+{ return minimumSize().height(); }
+
+inline int QWidget::maximumWidth() const
+{ return maximumSize().width(); }
+
+inline int QWidget::maximumHeight() const
+{ return maximumSize().height(); }
+
+inline void QWidget::setMinimumSize( const QSize &s )
+{ setMinimumSize(s.width(),s.height()); }
+
+inline void QWidget::setMaximumSize( const QSize &s )
+{ setMaximumSize(s.width(),s.height()); }
+
+inline void QWidget::setSizeIncrement( const QSize &s )
+{ setSizeIncrement(s.width(),s.height()); }
+
+inline void QWidget::setBaseSize( const QSize &s )
+{ setBaseSize(s.width(),s.height()); }
+
+inline const QColor &QWidget::eraseColor() const
+{ return bg_col; }
+
+
+inline const QPalette &QWidget::palette() const
+{ return pal; }
+
+
+inline QFont QWidget::font() const
+{ return fnt; }
+
+inline QFontMetrics QWidget::fontMetrics() const
+{ return QFontMetrics(font()); }
+
+inline QFontInfo QWidget::fontInfo() const
+{ return QFontInfo(font()); }
+
+inline bool QWidget::hasMouseTracking() const
+{ return testWState(WState_MouseTracking); }
+
+inline bool QWidget::hasMouse() const
+{ return testWState(WState_HasMouse); }
+
+inline bool QWidget::isFocusEnabled() const
+{ return (FocusPolicy)focus_policy != NoFocus; }
+
+inline QWidget::FocusPolicy QWidget::focusPolicy() const
+{ return (FocusPolicy)focus_policy; }
+
+inline bool QWidget::isUpdatesEnabled() const
+{ return !testWState(WState_BlockUpdates); }
+
+inline void QWidget::update( const QRect &r )
+{ update( r.x(), r.y(), r.width(), r.height() ); }
+
+inline void QWidget::repaint()
+{ repaint( TRUE ); }
+
+inline void QWidget::repaint( const QRect &r, bool erase )
+{ repaint( r.x(), r.y(), r.width(), r.height(), erase ); }
+
+inline void QWidget::erase()
+{ erase( 0, 0, crect.width(), crect.height() ); }
+
+inline void QWidget::erase( const QRect &r )
+{ erase( r.x(), r.y(), r.width(), r.height() ); }
+
+inline bool QWidget::close()
+{ return close( FALSE ); }
+
+inline bool QWidget::isVisible() const
+{ return testWState(WState_Visible); }
+
+inline bool QWidget::isVisibleToTLW() const
+{ return isVisible(); }
+
+inline bool QWidget::isHidden() const
+{ return testWState(WState_ForceHide); }
+
+inline bool QWidget::isShown() const
+{ return !testWState(WState_ForceHide); }
+
+inline void QWidget::move( const QPoint &p )
+{ move( p.x(), p.y() ); }
+
+inline void QWidget::resize( const QSize &s )
+{ resize( s.width(), s.height()); }
+
+inline void QWidget::setGeometry( const QRect &r )
+{ setGeometry( r.left(), r.top(), r.width(), r.height() ); }
+
+inline void QWidget::drawText( const QPoint &p, const QString &s )
+{ drawText( p.x(), p.y(), s ); }
+
+inline QWidget *QWidget::parentWidget( bool sameWindow ) const
+{
+    if ( sameWindow )
+        return isTopLevel() ? 0 : (QWidget *)QObject::parent();
+    return (QWidget *)QObject::parent();
+}
+
+inline QWidgetMapper *QWidget::wmapper()
+{ return mapper; }
+
+inline uint QWidget::getWState() const
+{ return widget_state; }
+
+inline void QWidget::setWState( uint f )
+{ widget_state |= f; }
+
+inline void QWidget::clearWState( uint f )
+{ widget_state &= ~f; }
+
+inline Qt::WFlags QWidget::getWFlags() const
+{ return widget_flags; }
+
+inline void QWidget::setWFlags( WFlags f )
+{ widget_flags |= f; }
+
+inline void QWidget::clearWFlags( WFlags f )
+{ widget_flags &= ~f; }
+
+inline void QWidget::constPolish() const
+{
+    if ( !testWState(WState_Polished) ) {
+        QWidget* that = (QWidget*) this;
+        that->polish();
+        that->setWState(WState_Polished);
+    }
+}
+
+inline bool QWidget::ownCursor() const
+{
+    return testWState( WState_OwnCursor );
+}
+
+inline bool QWidget::ownFont() const
+{
+    return own_font;
+}
+
+inline bool QWidget::ownPalette() const
+{
+    return own_palette;
+}
+
+
+inline void QWidget::setSizePolicy( QSizePolicy::SizeType hor, QSizePolicy::SizeType ver, bool hfw )
+{
+    setSizePolicy( QSizePolicy( hor, ver, hfw) );
+}
+
+inline bool QWidget::isInputMethodEnabled() const
+{
+    return (bool)im_enabled;
+}
+
+
+
+
+
+class QFocusData;
+class QWSManager;
+
+
+
+
+
+
+
+struct QTLWExtra {
+
+    QString caption;
+    QString iconText;
+    QPixmap *icon;
+
+    QFocusData *focusData;
+    short incw, inch;
+
+    ulong fleft, fright, ftop, fbottom;
+    uint iconic: 1;
+    uint fullscreen : 1;
+    uint showMode: 2;
+    uint savedFlags;
+    short basew, baseh;
+
+    WId parentWinId;
+    uint embedded : 1;
+    uint spont_unmapped: 1;
+    uint reserved: 1;
+    uint dnd : 1;
+    uint uspos : 1;
+    uint ussize : 1;
+    void *xic;
+    QRect normalGeometry;
+};
+
+
+
+
+
+struct QWExtra {
+    Q_INT16 minw, minh;
+    Q_INT16 maxw, maxh;
+    QPixmap *bg_pix;
+    QWidget *focus_proxy;
+
+    QCursor *curs;
+
+    QTLWExtra *topextra;
+
+
+
+
+    WId xDndProxy;
+    uint bg_origin : 2;
+
+    uint children_use_dnd : 1;
+    uint compress_events : 1;
+
+
+
+
+    char bg_mode;
+    char bg_mode_visual;
+
+    QStyle* style;
+
+    QRect micro_focus_hint;
+    QSizePolicy size_policy;
+};
+
+
+
+
+class QWidgetList : public QPtrList<QWidget>
+{
+public:
+    QWidgetList() : QPtrList<QWidget>() {}
+    QWidgetList( const QWidgetList &list ) : QPtrList<QWidget>(list) {}
+   ~QWidgetList() { clear(); }
+    QWidgetList &operator=(const QWidgetList &list)
+        { return (QWidgetList&)QPtrList<QWidget>::operator=(list); }
+};
+
+class QWidgetListIt : public QPtrListIterator<QWidget>
+{
+public:
+    QWidgetListIt( const QWidgetList &l ) : QPtrListIterator<QWidget>(l) {}
+    QWidgetListIt &operator=(const QWidgetListIt &i)
+        { return (QWidgetListIt&)QPtrListIterator<QWidget>::operator=(i); }
+};
+
+
+
+
+class QPushButton;
+class QDialogPrivate;
+
+class QDialog : public QWidget
+{
+friend class QPushButton;
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+   
+   
+
+public:
+    explicit QDialog( QWidget* parent=0, const char* name=0, bool modal=FALSE,
+             WFlags f=0 );
+    ~QDialog();
+
+    enum DialogCode { Rejected, Accepted };
+
+    int result() const { return rescode; }
+
+    void show();
+    void hide();
+    void move( int x, int y );
+    void move( const QPoint &p );
+    void resize( int w, int h );
+    void resize( const QSize & );
+    void setGeometry( int x, int y, int w, int h );
+    void setGeometry( const QRect & );
+
+    void setOrientation( Orientation orientation );
+    Orientation orientation() const;
+
+    void setExtension( QWidget* extension );
+    QWidget* extension() const;
+
+    QSize sizeHint() const;
+    QSize minimumSizeHint() const;
+
+    void setSizeGripEnabled( bool );
+    bool isSizeGripEnabled() const;
+
+    void setModal( bool modal );
+    bool isModal() const;
+
+public :
+    int exec();
+
+protected :
+    virtual void done( int );
+    virtual void accept();
+    virtual void reject();
+
+    void showExtension( bool );
+
+protected:
+    void setResult( int r ) { rescode = r; }
+    void keyPressEvent( QKeyEvent * );
+    void closeEvent( QCloseEvent * );
+    void resizeEvent( QResizeEvent * );
+    void contextMenuEvent( QContextMenuEvent * );
+    bool eventFilter( QObject *, QEvent * );
+    void adjustPosition( QWidget*);
+
+private:
+    void setDefault( QPushButton * );
+    void hideDefault();
+    int rescode;
+    uint did_move : 1;
+    uint has_relpos : 1;
+    uint did_resize : 1;
+    uint in_loop: 1;
+    void adjustPositionInternal( QWidget*, bool useRelPos = FALSE );
+    QDialogPrivate* d;
+
+private:
+
+    QDialog( const QDialog & );
+    QDialog &operator=( const QDialog & );
+
+};
+
+
+
+
+class QLabel;
+class QPushButton;
+struct QMessageBoxData;
+
+class QMessageBox : public QDialog
+{
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+   
+   
+   
+   
+   
+
+public:
+    enum Icon { NoIcon = 0, Information = 1, Warning = 2, Critical = 3,
+                Question = 4 };
+
+    QMessageBox( QWidget* parent=0, const char* name=0 );
+    QMessageBox( const QString& caption, const QString &text, Icon icon,
+                 int button0, int button1, int button2,
+                 QWidget* parent=0, const char* name=0, bool modal=TRUE,
+                 WFlags f=WStyle_DialogBorder );
+    ~QMessageBox();
+
+    enum { NoButton = 0, Ok = 1, Cancel = 2, Yes = 3, No = 4, Abort = 5,
+           Retry = 6, Ignore = 7, YesAll = 8, NoAll = 9, ButtonMask = 0xff,
+           Default = 0x100, Escape = 0x200, FlagMask = 0x300 };
+
+    static int information( QWidget *parent, const QString &caption,
+                            const QString& text,
+                            int button0, int button1=0, int button2=0 );
+    static int information( QWidget *parent, const QString &caption,
+                            const QString& text,
+                            const QString& button0Text = QString::null,
+                            const QString& button1Text = QString::null,
+                            const QString& button2Text = QString::null,
+                            int defaultButtonNumber = 0,
+                            int escapeButtonNumber = -1 );
+
+    static int question( QWidget *parent, const QString &caption,
+                         const QString& text,
+                         int button0, int button1=0, int button2=0 );
+    static int question( QWidget *parent, const QString &caption,
+                         const QString& text,
+                         const QString& button0Text = QString::null,
+                         const QString& button1Text = QString::null,
+                         const QString& button2Text = QString::null,
+                         int defaultButtonNumber = 0,
+                         int escapeButtonNumber = -1 );
+
+    static int warning( QWidget *parent, const QString &caption,
+                        const QString& text,
+                        int button0, int button1, int button2=0 );
+    static int warning( QWidget *parent, const QString &caption,
+                        const QString& text,
+                        const QString& button0Text = QString::null,
+                        const QString& button1Text = QString::null,
+                        const QString& button2Text = QString::null,
+                        int defaultButtonNumber = 0,
+                        int escapeButtonNumber = -1 );
+
+    static int critical( QWidget *parent, const QString &caption,
+                         const QString& text,
+                         int button0, int button1, int button2=0 );
+    static int critical( QWidget *parent, const QString &caption,
+                         const QString& text,
+                         const QString& button0Text = QString::null,
+                         const QString& button1Text = QString::null,
+                         const QString& button2Text = QString::null,
+                         int defaultButtonNumber = 0,
+                         int escapeButtonNumber = -1 );
+
+    static void about( QWidget *parent, const QString &caption,
+                       const QString& text );
+
+    static void aboutQt( QWidget *parent,
+                         const QString& caption=QString::null );
+
+
+    static int message( const QString &caption,
+                        const QString& text,
+                        const QString& buttonText=QString::null,
+                        QWidget *parent=0, const char * =0 ) {
+        return QMessageBox::information( parent, caption, text,
+                                     buttonText.isEmpty()
+                                     ? tr("OK") : buttonText ) == 0;
+    }
+
+
+    static bool query( const QString &caption,
+                       const QString& text,
+                       const QString& yesButtonText=QString::null,
+                       const QString& noButtonText=QString::null,
+                       QWidget *parent=0, const char * = 0 ) {
+        return QMessageBox::information( parent, caption, text,
+                                     yesButtonText.isEmpty()
+                                     ? tr("OK") : yesButtonText,
+                                     noButtonText ) == 0;
+    }
+
+    QString text() const;
+    void setText( const QString &);
+
+    Icon icon() const;
+
+    void setIcon( Icon );
+    void setIcon( const QPixmap & );
+
+    const QPixmap *iconPixmap() const;
+    void setIconPixmap( const QPixmap & );
+
+    QString buttonText( int button ) const;
+    void setButtonText( int button, const QString &);
+
+    void adjustSize();
+
+
+    static QPixmap standardIcon( Icon icon, GUIStyle );
+
+    static QPixmap standardIcon( Icon icon );
+
+    TextFormat textFormat() const;
+    void setTextFormat( TextFormat );
+
+protected:
+    void resizeEvent( QResizeEvent * );
+    void showEvent( QShowEvent * );
+    void closeEvent( QCloseEvent * );
+    void keyPressEvent( QKeyEvent * );
+    void styleChanged( QStyle& );
+
+private :
+    void buttonClicked();
+
+private:
+    void init( int, int, int );
+    int indexOf( int ) const;
+    void resizeButtons();
+    QLabel *label;
+    QMessageBoxData *mbd;
+    void *reserved1;
+    void *reserved2;
+
+private:
+
+    QMessageBox( const QMessageBox & );
+    QMessageBox &operator=( const QMessageBox & );
+
+};
+
+
+
+
+
+
+
+class QRegExpEngine;
+struct QRegExpPrivate;
+
+class QRegExp
+{
+public:
+    enum CaretMode { CaretAtZero, CaretAtOffset, CaretWontMatch };
+
+    QRegExp();
+    QRegExp( const QString& pattern, bool caseSensitive = TRUE,
+             bool wildcard = FALSE );
+    QRegExp( const QRegExp& rx );
+    ~QRegExp();
+    QRegExp& operator=( const QRegExp& rx );
+
+    bool operator==( const QRegExp& rx ) const;
+    bool operator!=( const QRegExp& rx ) const { return !operator==( rx ); }
+
+    bool isEmpty() const;
+    bool isValid() const;
+    QString pattern() const;
+    void setPattern( const QString& pattern );
+    bool caseSensitive() const;
+    void setCaseSensitive( bool sensitive );
+
+    bool wildcard() const;
+    void setWildcard( bool wildcard );
+
+    bool minimal() const;
+    void setMinimal( bool minimal );
+
+    bool exactMatch( const QString& str ) const;
+    int search( const QString& str, int offset = 0 ) const;
+    int search( const QString& str, int offset, CaretMode caretMode ) const;
+    int searchRev( const QString& str, int offset = -1 ) const;
+    int searchRev( const QString& str, int offset, CaretMode caretMode ) const;
+
+    int matchedLength() const;
+
+    int numCaptures() const;
+    QStringList capturedTexts();
+    QString cap( int nth = 0 );
+    int pos( int nth = 0 );
+    QString errorString();
+
+
+    static QString escape( const QString& str );
+
+private:
+    void prepareEngine() const;
+    void prepareEngineForMatch( const QString& str ) const;
+    void invalidateEngine();
+
+    static int caretIndex( int offset, CaretMode caretMode );
+
+    QRegExpEngine *eng;
+    QRegExpPrivate *priv;
+};
+
+struct QLineEditPrivate;
+
+class QValidator;
+class QPopupMenu;
+
+
+
+
+
+
+
+
+
+class QFrame : public QWidget
+{
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+   
+   
+   
+   
+   
+   
+   
+   
+   
+
+public:
+    QFrame( QWidget* parent=0, const char* name=0, WFlags f=0 );
+
+    int frameStyle() const;
+    virtual void setFrameStyle( int );
+
+    int frameWidth() const;
+    QRect contentsRect() const;
+
+
+    bool lineShapesOk() const { return TRUE; }
+
+
+    QSize sizeHint() const;
+
+    enum Shape { NoFrame = 0,
+                 Box = 0x0001,
+                 Panel = 0x0002,
+                 WinPanel = 0x0003,
+                 HLine = 0x0004,
+                 VLine = 0x0005,
+                 StyledPanel = 0x0006,
+                 PopupPanel = 0x0007,
+                 MenuBarPanel = 0x0008,
+                 ToolBarPanel = 0x0009,
+                 LineEditPanel = 0x000a,
+                 TabWidgetPanel = 0x000b,
+                 GroupBoxPanel = 0x000c,
+                 MShape = 0x000f
+    };
+    enum Shadow { Plain = 0x0010,
+                  Raised = 0x0020,
+                  Sunken = 0x0030,
+                  MShadow = 0x00f0 };
+
+    Shape frameShape() const;
+    void setFrameShape( Shape );
+    Shadow frameShadow() const;
+    void setFrameShadow( Shadow );
+
+    int lineWidth() const;
+    virtual void setLineWidth( int );
+
+    int margin() const;
+    virtual void setMargin( int );
+
+    int midLineWidth() const;
+    virtual void setMidLineWidth( int );
+
+    QRect frameRect() const;
+    virtual void setFrameRect( const QRect & );
+
+protected:
+    void paintEvent( QPaintEvent * );
+    void resizeEvent( QResizeEvent * );
+    virtual void drawFrame( QPainter * );
+    virtual void drawContents( QPainter * );
+    virtual void frameChanged();
+    void styleChange( QStyle& );
+
+private:
+    void updateFrameWidth(bool=FALSE);
+    QRect frect;
+    int fstyle;
+    short lwidth;
+    short mwidth;
+    short mlwidth;
+    short fwidth;
+
+    void * d;
+private:
+
+    QFrame( const QFrame & );
+    QFrame &operator=( const QFrame & );
+
+};
+
+
+inline int QFrame::frameStyle() const
+{ return fstyle; }
+
+inline QFrame::Shape QFrame::frameShape() const
+{ return (Shape) ( fstyle & MShape ); }
+
+inline QFrame::Shadow QFrame::frameShadow() const
+{ return (Shadow) ( fstyle & MShadow ); }
+
+inline void QFrame::setFrameShape( QFrame::Shape s )
+{ setFrameStyle( ( fstyle & MShadow ) | s ); }
+
+inline void QFrame::setFrameShadow( QFrame::Shadow s )
+{ setFrameStyle( ( fstyle & MShape ) | s ); }
+
+inline int QFrame::lineWidth() const
+{ return lwidth; }
+
+inline int QFrame::midLineWidth() const
+{ return mlwidth; }
+
+inline int QFrame::margin() const
+{ return mwidth; }
+
+inline int QFrame::frameWidth() const
+{ return fwidth; }
+
+
+
+
+
+class QTextParagraph;
+class QTextCursor;
+
+class QLineEdit : public QFrame
+{
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+
+public:
+    QLineEdit( QWidget* parent, const char* name=0 );
+    QLineEdit( const QString &, QWidget* parent, const char* name=0 );
+    QLineEdit( const QString &, const QString &, QWidget* parent, const char* name=0 );
+    ~QLineEdit();
+
+    QString text() const;
+
+    QString displayText() const;
+
+    int maxLength() const;
+
+    bool frame() const;
+
+    enum EchoMode { Normal, NoEcho, Password };
+    EchoMode echoMode() const;
+
+    bool isReadOnly() const;
+
+    const QValidator * validator() const;
+
+    QSize sizeHint() const;
+    QSize minimumSizeHint() const;
+
+    int cursorPosition() const;
+    bool validateAndSet( const QString &, int, int, int );
+
+    int alignment() const;
+
+
+
+
+
+    void cursorForward( bool mark, int steps = 1 );
+    void cursorBackward( bool mark, int steps = 1 );
+    void cursorWordForward( bool mark );
+    void cursorWordBackward( bool mark );
+    void backspace();
+    void del();
+    void home( bool mark );
+    void end( bool mark );
+
+    bool isModified() const;
+    void clearModified();
+
+    bool edited() const;
+    void setEdited( bool );
+
+    bool hasSelectedText() const;
+    QString selectedText() const;
+    int selectionStart() const;
+
+    bool isUndoAvailable() const;
+    bool isRedoAvailable() const;
+
+
+
+
+
+
+    bool dragEnabled() const;
+
+    QString inputMask() const;
+    void setInputMask( const QString &inputMask );
+    bool hasAcceptableInput() const;
+
+public :
+    virtual void setText( const QString &);
+    virtual void selectAll();
+    virtual void deselect();
+    virtual void clearValidator();
+    virtual void insert( const QString &);
+    virtual void clear();
+    virtual void undo();
+    virtual void redo();
+    virtual void setMaxLength( int );
+    virtual void setFrame( bool );
+    virtual void setEchoMode( EchoMode );
+    virtual void setReadOnly( bool );
+    virtual void setValidator( const QValidator * );
+    virtual void setFont( const QFont & );
+    virtual void setPalette( const QPalette & );
+    virtual void setSelection( int, int );
+    virtual void setCursorPosition( int );
+    virtual void setAlignment( int flag );
+
+    virtual void cut();
+    virtual void copy() const;
+    virtual void paste();
+
+    virtual void setDragEnabled( bool b );
+
+protected:
+    void textChanged( const QString &);
+    void returnPressed();
+    void lostFocus();
+    void selectionChanged();
+
+protected:
+    bool event( QEvent * );
+    void mousePressEvent( QMouseEvent * );
+    void mouseMoveEvent( QMouseEvent * );
+    void mouseReleaseEvent( QMouseEvent * );
+    void mouseDoubleClickEvent( QMouseEvent * );
+    void keyPressEvent( QKeyEvent * );
+    void imStartEvent( QIMEvent * );
+    void imComposeEvent( QIMEvent * );
+    void imEndEvent( QIMEvent * );
+    void focusInEvent( QFocusEvent * );
+    void focusOutEvent( QFocusEvent * );
+    void resizeEvent( QResizeEvent * );
+    void drawContents( QPainter * );
+
+    void dragEnterEvent( QDragEnterEvent * );
+    void dragMoveEvent( QDragMoveEvent *e );
+    void dragLeaveEvent( QDragLeaveEvent *e );
+    void dropEvent( QDropEvent * );
+
+    void contextMenuEvent( QContextMenuEvent * );
+    virtual QPopupMenu *createPopupMenu();
+    void windowActivationChange( bool );
+
+
+
+
+private :
+    void clipboardChanged();
+
+public:
+    void setPasswordChar( QChar c );
+    QChar passwordChar() const;
+    int characterAt( int, QChar* ) const;
+    bool getSelection( int *, int * );
+
+private:
+    friend struct QLineEditPrivate;
+    QLineEditPrivate * d;
+
+private:
+
+    QLineEdit( const QLineEdit & );
+    QLineEdit &operator=( const QLineEdit & );
+
+};
+
+
+
+
+
+
+class QTimer;
+
+
+
+
+
+
+
+
+
+
+
+class QRangeControlPrivate;
+
+
+class QRangeControl
+{
+public:
+    QRangeControl();
+    QRangeControl( int minValue, int maxValue,
+                   int lineStep, int pageStep, int value );
+    virtual ~QRangeControl();
+    int value() const;
+    void setValue( int );
+    void addPage();
+    void subtractPage();
+    void addLine();
+    void subtractLine();
+
+    int minValue() const;
+    int maxValue() const;
+    void setRange( int minValue, int maxValue );
+    void setMinValue( int minVal );
+    void setMaxValue( int minVal );
+
+    int lineStep() const;
+    int pageStep() const;
+    void setSteps( int line, int page );
+
+    int bound( int ) const;
+
+protected:
+    int positionFromValue( int val, int space ) const;
+    int valueFromPosition( int pos, int space ) const;
+    void directSetValue( int val );
+    int prevValue() const;
+
+    virtual void valueChange();
+    virtual void rangeChange();
+    virtual void stepChange();
+
+private:
+    int minVal, maxVal;
+    int line, page;
+    int val, prevVal;
+
+    QRangeControlPrivate * d;
+
+private:
+
+    QRangeControl( const QRangeControl & );
+    QRangeControl &operator=( const QRangeControl & );
+
+};
+
+
+inline int QRangeControl::value() const
+{ return val; }
+
+inline int QRangeControl::prevValue() const
+{ return prevVal; }
+
+inline int QRangeControl::minValue() const
+{ return minVal; }
+
+inline int QRangeControl::maxValue() const
+{ return maxVal; }
+
+inline int QRangeControl::lineStep() const
+{ return line; }
+
+inline int QRangeControl::pageStep() const
+{ return page; }
+
+
+
+
+
+
+class QSpinWidgetPrivate;
+class QSpinWidget : public QWidget
+{
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+public:
+    QSpinWidget( QWidget* parent=0, const char* name=0 );
+    ~QSpinWidget();
+
+    void setEditWidget( QWidget * widget );
+    QWidget * editWidget();
+
+    QRect upRect() const;
+    QRect downRect() const;
+
+    void setUpEnabled( bool on );
+    void setDownEnabled( bool on );
+
+    bool isUpEnabled() const;
+    bool isDownEnabled() const;
+
+    enum ButtonSymbols { UpDownArrows, PlusMinus };
+    virtual void setButtonSymbols( ButtonSymbols bs );
+    ButtonSymbols buttonSymbols() const;
+
+    void arrange();
+
+protected:
+    void stepUpPressed();
+    void stepDownPressed();
+
+public :
+    void stepUp();
+    void stepDown();
+
+protected:
+    void mousePressEvent( QMouseEvent *e );
+    void resizeEvent( QResizeEvent* ev );
+    void mouseReleaseEvent( QMouseEvent *e );
+    void mouseMoveEvent( QMouseEvent *e );
+
+    void wheelEvent( QWheelEvent * );
+
+    void styleChange( QStyle& );
+    void paintEvent( QPaintEvent * );
+    void enableChanged( bool old );
+    void windowActivationChange( bool );
+
+private :
+    void timerDone();
+    void timerDoneEx();
+
+private:
+    QSpinWidgetPrivate * d;
+
+    void updateDisplay();
+
+private:
+
+    QSpinWidget( const QSpinWidget& );
+    QSpinWidget& operator=( const QSpinWidget& );
+
+};
+
+
+
+
+class QScrollBar : public QWidget, public QRangeControl
+{
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+   
+   
+   
+   
+   
+   
+   
+   
+
+public:
+    QScrollBar( QWidget *parent, const char* name = 0 );
+    QScrollBar( Orientation, QWidget *parent, const char* name = 0 );
+    QScrollBar( int minValue, int maxValue, int lineStep, int pageStep,
+                int value, Orientation, QWidget *parent, const char* name = 0 );
+    ~QScrollBar();
+
+    virtual void setOrientation( Orientation );
+    Orientation orientation() const;
+    virtual void setTracking( bool enable );
+    bool tracking() const;
+    bool draggingSlider() const;
+
+    virtual void setPalette( const QPalette & );
+    virtual QSize sizeHint() const;
+    virtual void setSizePolicy( QSizePolicy sp );
+    void setSizePolicy( QSizePolicy::SizeType hor, QSizePolicy::SizeType ver, bool hfw = FALSE );
+
+    int minValue() const;
+    int maxValue() const;
+    void setMinValue( int );
+    void setMaxValue( int );
+    int lineStep() const;
+    int pageStep() const;
+    void setLineStep( int );
+    void setPageStep( int );
+    int value() const;
+
+    int sliderStart() const;
+    QRect sliderRect() const;
+
+public :
+    void setValue( int );
+
+protected:
+    void valueChanged( int value );
+    void sliderPressed();
+    void sliderMoved( int value );
+    void sliderReleased();
+    void nextLine();
+    void prevLine();
+    void nextPage();
+    void prevPage();
+
+protected:
+
+    void wheelEvent( QWheelEvent * );
+
+    void keyPressEvent( QKeyEvent * );
+    void resizeEvent( QResizeEvent * );
+    void paintEvent( QPaintEvent * );
+
+    void mousePressEvent( QMouseEvent * );
+    void mouseReleaseEvent( QMouseEvent * );
+    void mouseMoveEvent( QMouseEvent * );
+    void contextMenuEvent( QContextMenuEvent * );
+    void hideEvent( QHideEvent* );
+
+    void valueChange();
+    void stepChange();
+    void rangeChange();
+
+    void styleChange( QStyle& );
+
+private :
+    void doAutoRepeat();
+
+private:
+    void init();
+    void positionSliderFromValue();
+    int calculateValueFromSlider() const;
+
+    void startAutoRepeat();
+    void stopAutoRepeat();
+
+    int rangeValueToSliderPos( int val ) const;
+    int sliderPosToRangeValue( int val ) const;
+
+    void action( int control );
+
+    void drawControls( uint controls, uint activeControl ) const;
+    void drawControls( uint controls, uint activeControl,
+                       QPainter *p ) const;
+
+    uint pressedControl;
+    bool track;
+    bool clickedAt;
+    Orientation orient;
+
+    int slidePrevVal;
+    QCOORD sliderPos;
+    QCOORD clickOffset;
+
+    QTimer * repeater;
+    void * d;
+
+private:
+
+    QScrollBar( const QScrollBar & );
+    QScrollBar &operator=( const QScrollBar & );
+
+};
+
+
+inline void QScrollBar::setTracking( bool t )
+{
+    track = t;
+}
+
+inline bool QScrollBar::tracking() const
+{
+    return track;
+}
+
+inline QScrollBar::Orientation QScrollBar::orientation() const
+{
+    return orient;
+}
+
+inline int QScrollBar::sliderStart() const
+{
+    return sliderPos;
+}
+
+inline void QScrollBar::setSizePolicy( QSizePolicy::SizeType hor, QSizePolicy::SizeType ver, bool hfw )
+{
+    QWidget::setSizePolicy( hor, ver, hfw );
+}
+
+
+
+
+class QScrollViewData;
+
+class QScrollView : public QFrame
+{
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+
+   
+
+
+public:
+    QScrollView(QWidget* parent=0, const char* name=0, WFlags f=0);
+    ~QScrollView();
+
+    enum ResizePolicy { Default, Manual, AutoOne, AutoOneFit };
+    virtual void setResizePolicy( ResizePolicy );
+    ResizePolicy resizePolicy() const;
+
+    void styleChange( QStyle & );
+    void removeChild(QWidget* child);
+    virtual void addChild( QWidget* child, int x=0, int y=0 );
+    virtual void moveChild( QWidget* child, int x, int y );
+    int childX(QWidget* child);
+    int childY(QWidget* child);
+    bool childIsVisible(QWidget* child) { return child->isVisible(); }
+    void showChild(QWidget* child, bool yes=TRUE) {
+        if ( yes )
+            child->show();
+        else
+            child->hide();
+    }
+
+    enum ScrollBarMode { Auto, AlwaysOff, AlwaysOn };
+
+    ScrollBarMode vScrollBarMode() const;
+    virtual void setVScrollBarMode( ScrollBarMode );
+
+    ScrollBarMode hScrollBarMode() const;
+    virtual void setHScrollBarMode( ScrollBarMode );
+
+    QWidget* cornerWidget() const;
+    virtual void setCornerWidget(QWidget*);
+
+
+
+    QScrollBar* horizontalScrollBar() const;
+    QScrollBar* verticalScrollBar() const;
+    QWidget* viewport() const;
+    QWidget* clipper() const;
+
+    int visibleWidth() const;
+    int visibleHeight() const;
+
+    int contentsWidth() const;
+    int contentsHeight() const;
+    int contentsX() const;
+    int contentsY() const;
+
+    void resize( int w, int h );
+    void resize( const QSize& );
+    void show();
+
+    void updateContents( int x, int y, int w, int h );
+    void updateContents( const QRect& r );
+    void updateContents();
+    void repaintContents( int x, int y, int w, int h, bool erase=TRUE );
+    void repaintContents( const QRect& r, bool erase=TRUE );
+    void repaintContents( bool erase=TRUE );
+    void contentsToViewport( int x, int y, int& vx, int& vy ) const;
+    void viewportToContents( int vx, int vy, int& x, int& y ) const;
+    QPoint contentsToViewport( const QPoint& ) const;
+    QPoint viewportToContents( const QPoint& ) const;
+    void enableClipper( bool y );
+
+    void setStaticBackground( bool y );
+    bool hasStaticBackground() const;
+
+    QSize viewportSize( int, int ) const;
+    QSize sizeHint() const;
+    QSize minimumSizeHint() const;
+
+    void removeChild(QObject* child);
+
+    bool isHorizontalSliderPressed();
+    bool isVerticalSliderPressed();
+
+
+    virtual void setDragAutoScroll( bool b );
+    bool dragAutoScroll() const;
+
+
+protected:
+    void contentsMoving(int x, int y);
+    void horizontalSliderPressed();
+    void horizontalSliderReleased();
+    void verticalSliderPressed();
+    void verticalSliderReleased();
+
+public :
+    virtual void resizeContents( int w, int h );
+    void scrollBy( int dx, int dy );
+    virtual void setContentsPos( int x, int y );
+    void ensureVisible(int x, int y);
+    void ensureVisible(int x, int y, int xmargin, int ymargin);
+    void center(int x, int y);
+    void center(int x, int y, float xmargin, float ymargin);
+
+    void updateScrollBars();
+    void setEnabled( bool enable );
+
+protected:
+    virtual void drawContents(QPainter*, int cx, int cy, int cw, int ch);
+    virtual void drawContentsOffset(QPainter*, int ox, int oy,
+                    int cx, int cy, int cw, int ch);
+
+
+    virtual void contentsMousePressEvent( QMouseEvent* );
+    virtual void contentsMouseReleaseEvent( QMouseEvent* );
+    virtual void contentsMouseDoubleClickEvent( QMouseEvent* );
+    virtual void contentsMouseMoveEvent( QMouseEvent* );
+
+    virtual void contentsDragEnterEvent( QDragEnterEvent * );
+    virtual void contentsDragMoveEvent( QDragMoveEvent * );
+    virtual void contentsDragLeaveEvent( QDragLeaveEvent * );
+    virtual void contentsDropEvent( QDropEvent * );
+
+
+    virtual void contentsWheelEvent( QWheelEvent * );
+
+    virtual void contentsContextMenuEvent( QContextMenuEvent * );
+
+
+    virtual void viewportPaintEvent( QPaintEvent* );
+    virtual void viewportResizeEvent( QResizeEvent* );
+    virtual void viewportMousePressEvent( QMouseEvent* );
+    virtual void viewportMouseReleaseEvent( QMouseEvent* );
+    virtual void viewportMouseDoubleClickEvent( QMouseEvent* );
+    virtual void viewportMouseMoveEvent( QMouseEvent* );
+
+    virtual void viewportDragEnterEvent( QDragEnterEvent * );
+    virtual void viewportDragMoveEvent( QDragMoveEvent * );
+    virtual void viewportDragLeaveEvent( QDragLeaveEvent * );
+    virtual void viewportDropEvent( QDropEvent * );
+
+
+    virtual void viewportWheelEvent( QWheelEvent * );
+
+    virtual void viewportContextMenuEvent( QContextMenuEvent * );
+
+    void frameChanged();
+
+    virtual void setMargins(int left, int top, int right, int bottom);
+    int leftMargin() const;
+    int topMargin() const;
+    int rightMargin() const;
+    int bottomMargin() const;
+
+    bool focusNextPrevChild( bool next );
+
+    virtual void setHBarGeometry(QScrollBar& hbar, int x, int y, int w, int h);
+    virtual void setVBarGeometry(QScrollBar& vbar, int x, int y, int w, int h);
+
+    void resizeEvent(QResizeEvent*);
+    void mousePressEvent( QMouseEvent * );
+    void mouseReleaseEvent( QMouseEvent * );
+    void mouseDoubleClickEvent( QMouseEvent * );
+    void mouseMoveEvent( QMouseEvent * );
+
+    void wheelEvent( QWheelEvent * );
+
+    void contextMenuEvent( QContextMenuEvent * );
+    bool eventFilter( QObject *, QEvent *e );
+
+    void setCachedSizeHint( const QSize &sh ) const;
+    QSize cachedSizeHint() const;
+    void fontChange( const QFont & );
+
+private:
+    void drawContents( QPainter* );
+    void moveContents(int x, int y);
+
+    QScrollViewData* d;
+
+private :
+    void hslide(int);
+    void vslide(int);
+    void hbarIsPressed();
+    void hbarIsReleased();
+    void vbarIsPressed();
+    void vbarIsReleased();
+
+    void doDragAutoScroll();
+    void startDragAutoScroll();
+    void stopDragAutoScroll();
+
+
+private:
+
+    QScrollView( const QScrollView & );
+    QScrollView &operator=( const QScrollView & );
+
+    void changeFrameRect(const QRect&);
+
+public:
+    void disableSizeHintCaching();
+
+};
+
+
+
+
+
+
+
+
+
+
+
+
+class QGVector : public QPtrCollection
+{
+friend class QGList;
+public:
+
+    QDataStream &read( QDataStream & );
+    QDataStream &write( QDataStream & ) const;
+
+    virtual int compareItems( Item, Item );
+
+protected:
+    QGVector();
+    QGVector( uint size );
+    QGVector( const QGVector &v );
+   ~QGVector();
+
+    QGVector &operator=( const QGVector &v );
+    bool operator==( const QGVector &v ) const;
+
+    Item *data() const { return vec; }
+    uint size() const { return len; }
+    uint count() const { return numItems; }
+
+    bool insert( uint index, Item );
+    bool remove( uint index );
+    Item take( uint index );
+
+    void clear();
+    bool resize( uint newsize );
+
+    bool fill( Item, int flen );
+
+    void sort();
+    int bsearch( Item ) const;
+
+    int findRef( Item, uint index ) const;
+    int find( Item, uint index ) const;
+    uint containsRef( Item ) const;
+    uint contains( Item ) const;
+
+    Item at( uint index ) const
+    {
+
+        if ( index >= len )
+            warningIndexRange( index );
+
+        return vec[index];
+    }
+
+    bool insertExpand( uint index, Item );
+
+    void toList( QGList * ) const;
+
+
+    virtual QDataStream &read( QDataStream &, Item & );
+    virtual QDataStream &write( QDataStream &, Item ) const;
+
+private:
+    Item *vec;
+    uint len;
+    uint numItems;
+
+    static void warningIndexRange( uint );
+};
+
+
+
+
+
+
+
+ QDataStream &operator>>( QDataStream &, QGVector & );
+ QDataStream &operator<<( QDataStream &, const QGVector & );
+
+
+template<class type>
+class QPtrVector
+
+
+
+        : public QGVector
+
+{
+public:
+    QPtrVector() { }
+    QPtrVector( uint size ) : QGVector(size) { }
+    QPtrVector( const QPtrVector<type> &v ) : QGVector( v ) { }
+    ~QPtrVector() { clear(); }
+    QPtrVector<type> &operator=(const QPtrVector<type> &v)
+                        { return (QPtrVector<type>&)QGVector::operator=(v); }
+    bool operator==( const QPtrVector<type> &v ) const { return QGVector::operator==(v); }
+    type **data() const { return (type **)QGVector::data(); }
+    uint size() const { return QGVector::size(); }
+    uint count() const { return QGVector::count(); }
+    bool isEmpty() const { return QGVector::count() == 0; }
+    bool isNull() const { return QGVector::size() == 0; }
+    bool resize( uint size ) { return QGVector::resize(size); }
+    bool insert( uint i, const type *d){ return QGVector::insert(i,(Item)d); }
+    bool remove( uint i ) { return QGVector::remove(i); }
+    type *take( uint i ) { return (type *)QGVector::take(i); }
+    void clear() { QGVector::clear(); }
+    bool fill( const type *d, int size=-1 )
+                                        { return QGVector::fill((Item)d,size);}
+    void sort() { QGVector::sort(); }
+    int bsearch( const type *d ) const{ return QGVector::bsearch((Item)d); }
+    int findRef( const type *d, uint i=0 ) const
+                                        { return QGVector::findRef((Item)d,i);}
+    int find( const type *d, uint i= 0 ) const
+                                        { return QGVector::find((Item)d,i); }
+    uint containsRef( const type *d ) const
+                                { return QGVector::containsRef((Item)d); }
+    uint contains( const type *d ) const
+                                        { return QGVector::contains((Item)d); }
+    type *operator[]( int i ) const { return (type *)QGVector::at(i); }
+    type *at( uint i ) const { return (type *)QGVector::at(i); }
+    void toList( QGList *list ) const { QGVector::toList(list); }
+private:
+    void deleteItem( Item d );
+};
+
+
+template<> inline void QPtrVector<void>::deleteItem( QPtrCollection::Item )
+{
+}
+
+
+template<class type> inline void QPtrVector<type>::deleteItem( QPtrCollection::Item d )
+{
+    if ( del_item ) delete (type *)d;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+class QGDictIterator;
+class QGDItList;
+
+
+class QBaseBucket
+{
+public:
+    QPtrCollection::Item getData() { return data; }
+    QPtrCollection::Item setData( QPtrCollection::Item d ) { return data = d; }
+    QBaseBucket *getNext() { return next; }
+    void setNext( QBaseBucket *n) { next = n; }
+protected:
+    QBaseBucket( QPtrCollection::Item d, QBaseBucket *n ) : data(d), next(n) {}
+    QPtrCollection::Item data;
+    QBaseBucket *next;
+};
+
+class QStringBucket : public QBaseBucket
+{
+public:
+    QStringBucket( const QString &k, QPtrCollection::Item d, QBaseBucket *n )
+        : QBaseBucket(d,n), key(k) {}
+    const QString &getKey() const { return key; }
+private:
+    QString key;
+};
+
+class QAsciiBucket : public QBaseBucket
+{
+public:
+    QAsciiBucket( const char *k, QPtrCollection::Item d, QBaseBucket *n )
+        : QBaseBucket(d,n), key(k) {}
+    const char *getKey() const { return key; }
+private:
+    const char *key;
+};
+
+class QIntBucket : public QBaseBucket
+{
+public:
+    QIntBucket( long k, QPtrCollection::Item d, QBaseBucket *n )
+        : QBaseBucket(d,n), key(k) {}
+    long getKey() const { return key; }
+private:
+    long key;
+};
+
+class QPtrBucket : public QBaseBucket
+{
+public:
+    QPtrBucket( void *k, QPtrCollection::Item d, QBaseBucket *n )
+        : QBaseBucket(d,n), key(k) {}
+    void *getKey() const { return key; }
+private:
+    void *key;
+};
+
+
+class QGDict : public QPtrCollection
+{
+public:
+    uint count() const { return numItems; }
+    uint size() const { return vlen; }
+    QPtrCollection::Item look_string( const QString& key, QPtrCollection::Item,
+                                   int );
+    QPtrCollection::Item look_ascii( const char *key, QPtrCollection::Item, int );
+    QPtrCollection::Item look_int( long key, QPtrCollection::Item, int );
+    QPtrCollection::Item look_ptr( void *key, QPtrCollection::Item, int );
+
+    QDataStream &read( QDataStream & );
+    QDataStream &write( QDataStream & ) const;
+
+protected:
+    enum KeyType { StringKey, AsciiKey, IntKey, PtrKey };
+
+    QGDict( uint len, KeyType kt, bool cs, bool ck );
+    QGDict( const QGDict & );
+   ~QGDict();
+
+    QGDict &operator=( const QGDict & );
+
+    bool remove_string( const QString &key, QPtrCollection::Item item=0 );
+    bool remove_ascii( const char *key, QPtrCollection::Item item=0 );
+    bool remove_int( long key, QPtrCollection::Item item=0 );
+    bool remove_ptr( void *key, QPtrCollection::Item item=0 );
+    QPtrCollection::Item take_string( const QString &key );
+    QPtrCollection::Item take_ascii( const char *key );
+    QPtrCollection::Item take_int( long key );
+    QPtrCollection::Item take_ptr( void *key );
+
+    void clear();
+    void resize( uint );
+
+    int hashKeyString( const QString & );
+    int hashKeyAscii( const char * );
+
+    void statistics() const;
+
+
+    virtual QDataStream &read( QDataStream &, QPtrCollection::Item & );
+    virtual QDataStream &write( QDataStream &, QPtrCollection::Item ) const;
+
+private:
+    QBaseBucket **vec;
+    uint vlen;
+    uint numItems;
+    uint keytype : 2;
+    uint cases : 1;
+    uint copyk : 1;
+    QGDItList *iterators;
+    void unlink_common( int, QBaseBucket *, QBaseBucket * );
+    QStringBucket *unlink_string( const QString &,
+                                  QPtrCollection::Item item = 0 );
+    QAsciiBucket *unlink_ascii( const char *, QPtrCollection::Item item = 0 );
+    QIntBucket *unlink_int( long, QPtrCollection::Item item = 0 );
+    QPtrBucket *unlink_ptr( void *, QPtrCollection::Item item = 0 );
+    void init( uint, KeyType, bool, bool );
+    friend class QGDictIterator;
+};
+
+
+class QGDictIterator
+{
+friend class QGDict;
+public:
+    QGDictIterator( const QGDict & );
+    QGDictIterator( const QGDictIterator & );
+    QGDictIterator &operator=( const QGDictIterator & );
+   ~QGDictIterator();
+
+    QPtrCollection::Item toFirst();
+
+    QPtrCollection::Item get() const;
+    QString getKeyString() const;
+    const char *getKeyAscii() const;
+    long getKeyInt() const;
+    void *getKeyPtr() const;
+
+    QPtrCollection::Item operator()();
+    QPtrCollection::Item operator++();
+    QPtrCollection::Item operator+=(uint);
+
+protected:
+    QGDict *dict;
+
+private:
+    QBaseBucket *curNode;
+    uint curIndex;
+};
+
+inline QPtrCollection::Item QGDictIterator::get() const
+{
+    return curNode ? curNode->getData() : 0;
+}
+
+inline QString QGDictIterator::getKeyString() const
+{
+    return curNode ? ((QStringBucket*)curNode)->getKey() : QString::null;
+}
+
+inline const char *QGDictIterator::getKeyAscii() const
+{
+    return curNode ? ((QAsciiBucket*)curNode)->getKey() : 0;
+}
+
+inline long QGDictIterator::getKeyInt() const
+{
+    return curNode ? ((QIntBucket*)curNode)->getKey() : 0;
+}
+
+inline void *QGDictIterator::getKeyPtr() const
+{
+    return curNode ? ((QPtrBucket*)curNode)->getKey() : 0;
+}
+
+
+template<class type>
+class QDict
+
+
+
+        : public QGDict
+
+{
+public:
+    QDict( int size = 17, bool caseSensitive = TRUE )
+        : QGDict( size, StringKey, caseSensitive, FALSE ) { }
+    QDict( const QDict<type> &d ) : QGDict( d ) { }
+    ~QDict() { clear(); }
+    QDict<type> &operator=(const QDict<type> &d)
+                        { return (QDict<type>&)QGDict::operator=(d); }
+    uint count() const { return QGDict::count(); }
+    uint size() const { return QGDict::size(); }
+    bool isEmpty() const { return QGDict::count() == 0; }
+
+    void insert( const QString &k, const type *d )
+                                        { QGDict::look_string(k,(Item)d,1); }
+    void replace( const QString &k, const type *d )
+                                        { QGDict::look_string(k,(Item)d,2); }
+    bool remove( const QString &k ) { return QGDict::remove_string(k); }
+    type *take( const QString &k ) { return (type *)QGDict::take_string(k); }
+    type *find( const QString &k ) const
+                { return (type *)((QGDict*)this)->QGDict::look_string(k,0,0); }
+    type *operator[]( const QString &k ) const
+                { return (type *)((QGDict*)this)->QGDict::look_string(k,0,0); }
+
+    void clear() { QGDict::clear(); }
+    void resize( uint n ) { QGDict::resize(n); }
+    void statistics() const { QGDict::statistics(); }
+
+
+
+
+
+
+
+private:
+        void deleteItem( Item d );
+};
+
+
+template<> inline void QDict<void>::deleteItem( Item )
+{
+}
+
+
+template<class type> inline void QDict<type>::deleteItem( QPtrCollection::Item d )
+{
+    if ( del_item ) delete (type *)d;
+}
+
+template<class type>
+class QDictIterator : public QGDictIterator
+{
+public:
+    QDictIterator(const QDict<type> &d) : QGDictIterator((QGDict &)d) { }
+    ~QDictIterator() {}
+    uint count() const { return dict->count(); }
+    bool isEmpty() const { return dict->count() == 0; }
+    type *toFirst() { return (type *)QGDictIterator::toFirst(); }
+    operator type *() const { return (type *)QGDictIterator::get(); }
+    type *operator*() { return (type *)QGDictIterator::get(); }
+    type *current() const { return (type *)QGDictIterator::get(); }
+    QString currentKey() const{ return QGDictIterator::getKeyString(); }
+    type *operator()() { return (type *)QGDictIterator::operator()(); }
+    type *operator++() { return (type *)QGDictIterator::operator++(); }
+    type *operator+=(uint j) { return (type *)QGDictIterator::operator+=(j); }
+};
+
+
+
+
+
+
+class QStyleSheet;
+class QTextDocument;
+template<class Key, class T> class QMap;
+class QStyleSheetItemData;
+
+class QStyleSheetItem : public Qt
+{
+public:
+    QStyleSheetItem( QStyleSheet* parent, const QString& name );
+    QStyleSheetItem( const QStyleSheetItem & );
+    ~QStyleSheetItem();
+
+    QStyleSheetItem& operator=( const QStyleSheetItem& other );
+
+    QString name() const;
+
+    QStyleSheet* styleSheet();
+    const QStyleSheet* styleSheet() const;
+
+    enum AdditionalStyleValues { Undefined = - 1};
+
+    enum DisplayMode {
+        DisplayBlock,
+        DisplayInline,
+        DisplayListItem,
+        DisplayNone
+    };
+
+    DisplayMode displayMode() const;
+    void setDisplayMode(DisplayMode m);
+
+    int alignment() const;
+    void setAlignment( int f);
+
+    enum VerticalAlignment {
+        VAlignBaseline,
+        VAlignSub,
+        VAlignSuper
+    };
+
+    VerticalAlignment verticalAlignment() const;
+    void setVerticalAlignment( VerticalAlignment valign );
+
+    int fontWeight() const;
+    void setFontWeight(int w);
+
+    int logicalFontSize() const;
+    void setLogicalFontSize(int s);
+
+    int logicalFontSizeStep() const;
+    void setLogicalFontSizeStep( int s );
+
+    int fontSize() const;
+    void setFontSize(int s);
+
+    QString fontFamily() const;
+    void setFontFamily( const QString& );
+
+    int numberOfColumns() const;
+    void setNumberOfColumns(int ncols);
+
+    QColor color() const;
+    void setColor( const QColor &);
+
+    bool fontItalic() const;
+    void setFontItalic( bool );
+    bool definesFontItalic() const;
+
+    bool fontUnderline() const;
+    void setFontUnderline( bool );
+    bool definesFontUnderline() const;
+
+    bool fontStrikeOut() const;
+    void setFontStrikeOut( bool );
+    bool definesFontStrikeOut() const;
+
+    bool isAnchor() const;
+    void setAnchor(bool anc);
+
+    enum WhiteSpaceMode { WhiteSpaceNormal, WhiteSpacePre, WhiteSpaceNoWrap };
+    WhiteSpaceMode whiteSpaceMode() const;
+    void setWhiteSpaceMode(WhiteSpaceMode m);
+
+    enum Margin {
+        MarginLeft,
+        MarginRight,
+        MarginTop,
+        MarginBottom,
+        MarginFirstLine,
+        MarginAll,
+        MarginVertical,
+        MarginHorizontal
+    };
+
+    int margin( Margin m) const;
+    void setMargin( Margin, int);
+
+    enum ListStyle {
+        ListDisc,
+        ListCircle,
+        ListSquare,
+        ListDecimal,
+        ListLowerAlpha,
+        ListUpperAlpha
+    };
+
+    ListStyle listStyle() const;
+    void setListStyle( ListStyle );
+
+    QString contexts() const;
+    void setContexts( const QString& );
+    bool allowedInContext( const QStyleSheetItem* ) const;
+
+    bool selfNesting() const;
+    void setSelfNesting( bool );
+
+    void setLineSpacing( int ls );
+    int lineSpacing() const;
+
+private:
+    void init();
+    QStyleSheetItemData* d;
+};
+class QTextCustomItem;
+
+
+class QStyleSheet : public QObject
+{
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+public:
+    QStyleSheet( QObject *parent=0, const char *name=0 );
+    virtual ~QStyleSheet();
+
+    static QStyleSheet* defaultSheet();
+    static void setDefaultSheet( QStyleSheet* );
+
+
+    QStyleSheetItem* item( const QString& name);
+    const QStyleSheetItem* item( const QString& name) const;
+
+    void insert( QStyleSheetItem* item);
+
+
+    virtual QTextCustomItem* tag( const QString& name,
+                                  const QMap<QString, QString> &attr,
+                                  const QString& context,
+                                  const QMimeSourceFactory& factory,
+                                  bool emptyTag, QTextDocument *doc ) const;
+
+    static QString escape( const QString& );
+    static QString convertFromPlainText( const QString&,
+                                         QStyleSheetItem::WhiteSpaceMode mode = QStyleSheetItem::WhiteSpacePre );
+    static bool mightBeRichText( const QString& );
+
+    virtual void scaleFont( QFont& font, int logicalSize ) const;
+
+    virtual void error( const QString& ) const;
+
+private:
+    void init();
+    QDict<QStyleSheetItem> styles;
+    QStyleSheetItem* nullstyle;
+private:
+
+    QStyleSheet( const QStyleSheet & );
+    QStyleSheet &operator=( const QStyleSheet & );
+
+};
+
+class QPainter;
+class QTextDocument;
+class QTextCursor;
+class QKeyEvent;
+class QResizeEvent;
+class QMouseEvent;
+class QTimer;
+class QTextString;
+class QTextCommand;
+class QTextParagraph;
+class QTextFormat;
+class QFont;
+class QColor;
+class QTextEdit;
+class QTextBrowser;
+class QTextString;
+struct QUndoRedoInfoPrivate;
+class QPopupMenu;
+class QTextEditPrivate;
+class QSyntaxHighlighter;
+
+
+class QTextEditOptimPrivate
+{
+public:
+
+
+    enum TagType { Color = 0, Format = 1 };
+    struct Tag {
+        TagType type:2;
+        bool bold:1;
+        bool italic:1;
+        bool underline:1;
+        int line;
+        int index;
+        Tag * leftTag;
+        Tag * parent;
+        Tag * prev;
+        Tag * next;
+        QString tag;
+    };
+    QTextEditOptimPrivate()
+    {
+        len = numLines = maxLineWidth = 0;
+        selStart.line = selStart.index = -1;
+        selEnd.line = selEnd.index = -1;
+        search.line = search.index = 0;
+        tags = lastTag = 0;
+    }
+    ~QTextEditOptimPrivate()
+    {
+        clearTags();
+    }
+    void clearTags()
+    {
+        Tag * itr = tags;
+        while ( tags ) {
+            itr = tags;
+            tags = tags->next;
+            delete itr;
+        }
+        tags = lastTag = 0;
+        tagIndex.clear();
+    }
+    int len;
+    int numLines;
+    int maxLineWidth;
+    struct Selection {
+        int line;
+        int index;
+    };
+    Selection selStart, selEnd, search;
+    Tag * tags, * lastTag;
+    QMap<int, QString> lines;
+    QMap<int, Tag *> tagIndex;
+};
+
+
+class QTextEdit : public QScrollView
+{
+    friend class QTextBrowser;
+    friend class QSyntaxHighlighter;
+
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+
+public:
+    enum WordWrap {
+        NoWrap,
+        WidgetWidth,
+        FixedPixelWidth,
+        FixedColumnWidth
+    };
+
+    enum WrapPolicy {
+        AtWordBoundary,
+        AtWhiteSpace = AtWordBoundary,
+        Anywhere,
+        AtWordOrDocumentBoundary
+    };
+
+    enum AutoFormatting {
+        AutoNone = 0,
+        AutoBulletList = 0x00000001,
+        AutoAll = 0xffffffff
+    };
+
+    enum KeyboardAction {
+        ActionBackspace,
+        ActionDelete,
+        ActionReturn,
+        ActionKill,
+        ActionWordBackspace,
+        ActionWordDelete
+    };
+
+    enum CursorAction {
+        MoveBackward,
+        MoveForward,
+        MoveWordBackward,
+        MoveWordForward,
+        MoveUp,
+        MoveDown,
+        MoveLineStart,
+        MoveLineEnd,
+        MoveHome,
+        MoveEnd,
+        MovePgUp,
+        MovePgDown
+    };
+
+    enum VerticalAlignment {
+        AlignNormal,
+        AlignSuperScript,
+        AlignSubScript
+    };
+
+    enum TextInsertionFlags {
+        RedoIndentation = 0x0001,
+        CheckNewLines = 0x0002,
+        RemoveSelected = 0x0004
+    };
+
+    QTextEdit( const QString& text, const QString& context = QString::null,
+               QWidget* parent=0, const char* name=0);
+    QTextEdit( QWidget* parent=0, const char* name=0 );
+    virtual ~QTextEdit();
+    void setPalette( const QPalette & );
+
+    QString text() const;
+    QString text( int para ) const;
+    TextFormat textFormat() const;
+    QString context() const;
+    QString documentTitle() const;
+
+    void getSelection( int *paraFrom, int *indexFrom,
+                    int *paraTo, int *indexTo, int selNum = 0 ) const;
+    virtual bool find( const QString &expr, bool cs, bool wo, bool forward = TRUE,
+                       int *para = 0, int *index = 0 );
+
+    int paragraphs() const;
+    int lines() const;
+    int linesOfParagraph( int para ) const;
+    int lineOfChar( int para, int chr );
+    int length() const;
+    QRect paragraphRect( int para ) const;
+    int paragraphAt( const QPoint &pos ) const;
+    int charAt( const QPoint &pos, int *para ) const;
+    int paragraphLength( int para ) const;
+
+    QStyleSheet* styleSheet() const;
+
+    QMimeSourceFactory* mimeSourceFactory() const;
+
+    QBrush paper() const;
+    bool linkUnderline() const;
+
+    int heightForWidth( int w ) const;
+
+    bool hasSelectedText() const;
+    QString selectedText() const;
+    bool isUndoAvailable() const;
+    bool isRedoAvailable() const;
+
+    WordWrap wordWrap() const;
+    int wrapColumnOrWidth() const;
+    WrapPolicy wrapPolicy() const;
+
+    int tabStopWidth() const;
+
+    QString anchorAt( const QPoint& pos );
+    QString anchorAt( const QPoint& pos, AnchorAttribute a );
+
+    QSize sizeHint() const;
+
+    bool isReadOnly() const { return readonly; }
+
+    void getCursorPosition( int *parag, int *index ) const;
+
+    bool isModified() const;
+    bool italic() const;
+    bool bold() const;
+    bool underline() const;
+    QString family() const;
+    int pointSize() const;
+    QColor color() const;
+    QFont font() const;
+    QFont currentFont() const;
+    int alignment() const;
+    int undoDepth() const;
+
+
+    virtual bool getFormat( int para, int index, QFont *font, QColor *color, VerticalAlignment *verticalAlignment );
+
+    virtual bool getParagraphFormat( int para, QFont *font, QColor *color,
+                                     VerticalAlignment *verticalAlignment, int *alignment,
+                                     QStyleSheetItem::DisplayMode *displayMode,
+                                     QStyleSheetItem::ListStyle *listStyle,
+                                     int *listDepth );
+
+
+    bool isOverwriteMode() const { return overWrite; }
+    QColor paragraphBackgroundColor( int para ) const;
+
+    bool isUndoRedoEnabled() const;
+    bool eventFilter( QObject *o, QEvent *e );
+    bool tabChangesFocus() const;
+
+    void setAutoFormatting( uint features );
+    uint autoFormatting() const;
+
+public :
+    void setEnabled( bool );
+
+    virtual void setMimeSourceFactory( QMimeSourceFactory* factory );
+
+    virtual void setStyleSheet( QStyleSheet* styleSheet );
+    virtual void scrollToAnchor( const QString& name );
+    virtual void setPaper( const QBrush& pap );
+    virtual void setLinkUnderline( bool );
+
+    virtual void setWordWrap( WordWrap mode );
+    virtual void setWrapColumnOrWidth( int );
+    virtual void setWrapPolicy( WrapPolicy policy );
+
+    virtual void copy();
+    virtual void append( const QString& text );
+
+    void setText( const QString &txt ) { setText( txt, QString::null ); }
+    virtual void setText( const QString &txt, const QString &context );
+    virtual void setTextFormat( TextFormat f );
+
+    virtual void selectAll( bool select = TRUE );
+    virtual void setTabStopWidth( int ts );
+    virtual void zoomIn( int range );
+    virtual void zoomIn() { zoomIn( 1 ); }
+    virtual void zoomOut( int range );
+    virtual void zoomOut() { zoomOut( 1 ); }
+    virtual void zoomTo( int size );
+
+    virtual void sync();
+    virtual void setReadOnly( bool b );
+
+    virtual void undo();
+    virtual void redo();
+    virtual void cut();
+    virtual void paste();
+
+    virtual void pasteSubType( const QCString &subtype );
+
+    virtual void clear();
+    virtual void del();
+    virtual void indent();
+    virtual void setItalic( bool b );
+    virtual void setBold( bool b );
+    virtual void setUnderline( bool b );
+    virtual void setFamily( const QString &f );
+    virtual void setPointSize( int s );
+    virtual void setColor( const QColor &c );
+    virtual void setFont( const QFont &f );
+    virtual void setVerticalAlignment( VerticalAlignment a );
+    virtual void setAlignment( int a );
+
+
+    virtual void setParagType( QStyleSheetItem::DisplayMode dm, QStyleSheetItem::ListStyle listStyle );
+
+    virtual void setCursorPosition( int parag, int index );
+    virtual void setSelection( int parag_from, int index_from, int parag_to, int index_to, int selNum = 0 );
+    virtual void setSelectionAttributes( int selNum, const QColor &back, bool invertText );
+    virtual void setModified( bool m );
+    virtual void resetFormat();
+    virtual void setUndoDepth( int d );
+    virtual void setFormat( QTextFormat *f, int flags );
+    virtual void ensureCursorVisible();
+    virtual void placeCursor( const QPoint &pos, QTextCursor *c = 0 );
+    virtual void moveCursor( CursorAction action, bool select );
+    virtual void doKeyboardAction( KeyboardAction action );
+    virtual void removeSelectedText( int selNum = 0 );
+    virtual void removeSelection( int selNum = 0 );
+    virtual void setCurrentFont( const QFont &f );
+    virtual void setOverwriteMode( bool b ) { overWrite = b; }
+
+    virtual void scrollToBottom();
+
+    void insert( const QString &text, uint insertionFlags = CheckNewLines | RemoveSelected );
+
+
+    virtual void insert( const QString &text, bool, bool = TRUE, bool = TRUE );
+
+    virtual void insertAt( const QString &text, int para, int index );
+    virtual void removeParagraph( int para );
+    virtual void insertParagraph( const QString &text, int para );
+
+    virtual void setParagraphBackgroundColor( int para, const QColor &bg );
+    virtual void clearParagraphBackground( int para );
+
+    virtual void setUndoRedoEnabled( bool b );
+    void setTabChangesFocus( bool b );
+
+
+    void polish();
+    void setMaxLogLines( int numLines );
+    int maxLogLines();
+
+
+protected:
+    void textChanged();
+    void selectionChanged();
+    void copyAvailable( bool );
+    void undoAvailable( bool yes );
+    void redoAvailable( bool yes );
+    void currentFontChanged( const QFont &f );
+    void currentColorChanged( const QColor &c );
+    void currentAlignmentChanged( int a );
+    void currentVerticalAlignmentChanged( VerticalAlignment a );
+    void cursorPositionChanged( QTextCursor *c );
+    void cursorPositionChanged( int para, int pos );
+    void returnPressed();
+    void modificationChanged( bool m );
+    void clicked( int parag, int index );
+    void doubleClicked( int parag, int index );
+
+protected:
+    void repaintChanged();
+    void updateStyles();
+    void drawContents( QPainter *p, int cx, int cy, int cw, int ch );
+    bool event( QEvent *e );
+    void keyPressEvent( QKeyEvent *e );
+    void resizeEvent( QResizeEvent *e );
+    void viewportResizeEvent( QResizeEvent* );
+    void contentsMousePressEvent( QMouseEvent *e );
+    void contentsMouseMoveEvent( QMouseEvent *e );
+    void contentsMouseReleaseEvent( QMouseEvent *e );
+    void contentsMouseDoubleClickEvent( QMouseEvent *e );
+
+    void contentsWheelEvent( QWheelEvent *e );
+
+    void imStartEvent( QIMEvent * );
+    void imComposeEvent( QIMEvent * );
+    void imEndEvent( QIMEvent * );
+
+    void contentsDragEnterEvent( QDragEnterEvent *e );
+    void contentsDragMoveEvent( QDragMoveEvent *e );
+    void contentsDragLeaveEvent( QDragLeaveEvent *e );
+    void contentsDropEvent( QDropEvent *e );
+
+    void contentsContextMenuEvent( QContextMenuEvent *e );
+    bool focusNextPrevChild( bool next );
+    QTextDocument *document() const;
+    QTextCursor *textCursor() const;
+    void setDocument( QTextDocument *doc );
+    virtual QPopupMenu *createPopupMenu( const QPoint& pos );
+    virtual QPopupMenu *createPopupMenu();
+    void drawCursor( bool visible );
+
+    void windowActivationChange( bool );
+
+protected :
+    virtual void doChangeInterval();
+    void sliderReleased();
+
+
+
+
+private :
+    void formatMore();
+    void doResize();
+    void autoScrollTimerDone();
+    void blinkCursor();
+    void setModified();
+    void startDrag();
+    void documentWidthChanged( int w );
+    void clipboardChanged();
+
+private:
+    struct UndoRedoInfo {
+        enum Type { Invalid, Insert, Delete, Backspace, Return, RemoveSelected, Format, Style };
+
+        UndoRedoInfo( QTextDocument *dc );
+        ~UndoRedoInfo();
+        void clear();
+        bool valid() const;
+
+        QUndoRedoInfoPrivate *d;
+        int id;
+        int index;
+        int eid;
+        int eindex;
+        QTextFormat *format;
+        int flags;
+        Type type;
+        QTextDocument *doc;
+        QByteArray styleInformation;
+    };
+
+private:
+    void updateCursor( const QPoint & pos );
+    void handleMouseMove( const QPoint& pos );
+    void drawContents( QPainter * );
+    virtual bool linksEnabled() const { return FALSE; }
+    void init();
+    void checkUndoRedoInfo( UndoRedoInfo::Type t );
+    void updateCurrentFormat();
+    bool handleReadOnlyKeyEvent( QKeyEvent *e );
+    void makeParagVisible( QTextParagraph *p );
+    void normalCopy();
+    void copyToClipboard();
+
+    QCString pickSpecial(QMimeSource* ms, bool always_ask, const QPoint&);
+    QTextDrag *dragObject( QWidget *parent = 0 ) const;
+
+
+    void pasteSpecial(const QPoint&);
+
+    void setFontInternal( const QFont &f );
+
+    virtual void emitHighlighted( const QString & ) {}
+    virtual void emitLinkClicked( const QString & ) {}
+
+    void readFormats( QTextCursor &c1, QTextCursor &c2, QTextString &text, bool fillStyles = FALSE );
+    void clearUndoRedo();
+    void paintDocument( bool drawAll, QPainter *p, int cx = -1, int cy = -1, int cw = -1, int ch = -1 );
+    void moveCursor( CursorAction action );
+    void ensureFormatted( QTextParagraph *p );
+    void placeCursor( const QPoint &pos, QTextCursor *c, bool link );
+    void updateMicroFocusHint();
+
+
+    bool checkOptimMode();
+    QString optimText() const;
+    void optimSetText( const QString &str );
+    void optimAppend( const QString &str );
+    void optimInsert( const QString &str, int line, int index );
+    void optimDrawContents( QPainter * p, int cx, int cy, int cw, int ch );
+    void optimMousePressEvent( QMouseEvent * e );
+    void optimMouseReleaseEvent( QMouseEvent * e );
+    void optimMouseMoveEvent( QMouseEvent * e );
+    int optimCharIndex( const QString &str, int mx ) const;
+    void optimSelectAll();
+    void optimRemoveSelection();
+    void optimSetSelection( int startLine, int startIdx, int endLine,
+                            int endIdx );
+    bool optimHasSelection() const;
+    QString optimSelectedText() const;
+    bool optimFind( const QString & str, bool, bool, bool, int *, int * );
+    void optimParseTags( QString * str, int lineNo = -1, int indexOffset = 0 );
+    QTextEditOptimPrivate::Tag * optimPreviousLeftTag( int line );
+    void optimSetTextFormat( QTextDocument *, QTextCursor *, QTextFormat * f,
+                             int, int, QTextEditOptimPrivate::Tag * t );
+    QTextEditOptimPrivate::Tag * optimAppendTag( int index, const QString & tag );
+    QTextEditOptimPrivate::Tag * optimInsertTag( int line, int index, const QString & tag );
+    void optimCheckLimit( const QString& str );
+
+private :
+    void optimDoAutoScroll();
+
+
+private:
+
+    void pasteSubType( const QCString &subtype, QMimeSource *m );
+
+
+private:
+    QTextDocument *doc;
+    QTextCursor *cursor;
+    QTimer *formatTimer, *scrollTimer, *changeIntervalTimer, *blinkTimer, *dragStartTimer;
+    QTextParagraph *lastFormatted;
+    int interval;
+    UndoRedoInfo undoRedoInfo;
+    QTextFormat *currentFormat;
+    int currentAlignment;
+    QPoint oldMousePos, mousePos;
+    QPoint dragStartPos;
+    QString onLink;
+    WordWrap wrapMode;
+    WrapPolicy wPolicy;
+    int wrapWidth;
+    QString pressedLink;
+    QTextEditPrivate *d;
+    bool inDoubleClick : 1;
+    bool mousePressed : 1;
+    bool cursorVisible : 1;
+    bool blinkCursorVisible : 1;
+    bool readOnly : 1;
+    bool modified : 1;
+    bool mightStartDrag : 1;
+    bool inDnD : 1;
+    bool readonly : 1;
+    bool undoEnabled : 1;
+    bool overWrite : 1;
+
+private:
+
+    QTextEdit( const QTextEdit & );
+    QTextEdit &operator=( const QTextEdit & );
+
+};
+
+inline QTextDocument *QTextEdit::document() const
+{
+    return doc;
+}
+
+inline QTextCursor *QTextEdit::textCursor() const
+{
+    return cursor;
+}
+
+inline void QTextEdit::setCurrentFont( const QFont &f )
+{
+    QTextEdit::setFontInternal( f );
+}
+class QSessionManagerData;
+
+class QSessionManager : public QObject
+{
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+    QSessionManager( QApplication *app, QString &id, QString &key );
+    ~QSessionManager();
+public:
+    QString sessionId() const;
+    QString sessionKey() const;
+
+    void* handle() const;
+
+
+    bool allowsInteraction();
+    bool allowsErrorInteraction();
+    void release();
+
+    void cancel();
+
+    enum RestartHint {
+        RestartIfRunning,
+        RestartAnyway,
+        RestartImmediately,
+        RestartNever
+    };
+    void setRestartHint( RestartHint );
+    RestartHint restartHint() const;
+
+    void setRestartCommand( const QStringList& );
+    QStringList restartCommand() const;
+    void setDiscardCommand( const QStringList& );
+    QStringList discardCommand() const;
+
+    void setManagerProperty( const QString& name, const QString& value );
+    void setManagerProperty( const QString& name, const QStringList& value );
+
+    bool isPhase2() const;
+    void requestPhase2();
+
+private:
+    friend class QApplication;
+    friend class QBaseApplication;
+    QSessionManagerData* d;
+};
+
+
+
+
+
+
+
+class QTimer : public QObject
+{
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+public:
+    QTimer( QObject *parent=0, const char *name=0 );
+   ~QTimer();
+
+    bool isActive() const;
+
+    int start( int msec, bool sshot = FALSE );
+    void changeInterval( int msec );
+    void stop();
+
+    static void singleShot( int msec, QObject *receiver, const char *member );
+
+    int timerId() const { return id; }
+
+protected:
+    void timeout();
+
+protected:
+    bool event( QEvent * );
+
+private:
+    int id;
+    uint single : 1;
+    uint nulltimer : 1;
+
+private:
+
+    QTimer( const QTimer & );
+    QTimer &operator=( const QTimer & );
+
+};
+
+
+inline bool QTimer::isActive() const
+{
+    return id >= 0;
+}
+
+
+
+class QGfx;
+class QPixmapPrivate;
+
+
+
+
+
+
+
+class QPixmap : public QPaintDevice, public Qt
+{
+public:
+    enum ColorMode { Auto, Color, Mono };
+    enum Optimization { DefaultOptim, NoOptim, MemoryOptim=NoOptim,
+                        NormalOptim, BestOptim };
+
+    QPixmap();
+    QPixmap( const QImage& image );
+    QPixmap( int w, int h, int depth = -1, Optimization = DefaultOptim );
+    QPixmap( const QSize &, int depth = -1, Optimization = DefaultOptim );
+
+    QPixmap( const QString& fileName, const char *format=0,
+             ColorMode mode=Auto );
+    QPixmap( const QString& fileName, const char *format,
+             int conversion_flags );
+    QPixmap( const char *xpm[] );
+    QPixmap( const QByteArray &data );
+
+    QPixmap( const QPixmap & );
+   ~QPixmap();
+
+    QPixmap &operator=( const QPixmap & );
+    QPixmap &operator=( const QImage & );
+
+    bool isNull() const;
+
+    int width() const { return data->w; }
+    int height() const { return data->h; }
+    QSize size() const { return QSize(data->w,data->h); }
+    QRect rect() const { return QRect(0,0,data->w,data->h); }
+    int depth() const { return data->d; }
+    static int defaultDepth();
+
+    void fill( const QColor &fillColor = Qt::white );
+    void fill( const QWidget *, int xofs, int yofs );
+    void fill( const QWidget *, const QPoint &ofs );
+    void resize( int width, int height );
+    void resize( const QSize & );
+
+    const QBitmap *mask() const;
+    void setMask( const QBitmap & );
+    bool selfMask() const;
+    bool hasAlpha() const;
+    bool hasAlphaChannel() const;
+
+    QBitmap createHeuristicMask( bool clipTight = TRUE ) const;
+
+
+    static QPixmap fromMimeSource( const QString& abs_name );
+
+    static QPixmap grabWindow( WId, int x=0, int y=0, int w=-1, int h=-1 );
+    static QPixmap grabWidget( QWidget * widget,
+                                int x=0, int y=0, int w=-1, int h=-1 );
+
+
+    QPixmap xForm( const QWMatrix & ) const;
+    static QWMatrix trueMatrix( const QWMatrix &, int w, int h );
+
+
+    QImage convertToImage() const;
+    bool convertFromImage( const QImage &, ColorMode mode=Auto );
+    bool convertFromImage( const QImage &, int conversion_flags );
+
+    static const char* imageFormat( const QString &fileName );
+    bool load( const QString& fileName, const char *format=0,
+                      ColorMode mode=Auto );
+    bool load( const QString& fileName, const char *format,
+                      int conversion_flags );
+    bool loadFromData( const uchar *buf, uint len,
+                              const char* format=0,
+                              ColorMode mode=Auto );
+    bool loadFromData( const uchar *buf, uint len,
+                              const char* format,
+                              int conversion_flags );
+    bool loadFromData( const QByteArray &data,
+                              const char* format=0,
+                              int conversion_flags=0 );
+    bool save( const QString& fileName, const char* format, int quality = -1 ) const;
+    bool save( QIODevice* device, const char* format, int quality = -1 ) const;
+
+
+
+
+
+
+    int serialNumber() const;
+
+    Optimization optimization() const;
+    void setOptimization( Optimization );
+    static Optimization defaultOptimization();
+    static void setDefaultOptimization( Optimization );
+
+    virtual void detach();
+
+    bool isQBitmap() const;
+    static int x11SetDefaultScreen( int screen );
+    void x11SetScreen( int screen );
+
+
+   
+
+protected:
+    QPixmap( int w, int h, const uchar *data, bool isXbitmap );
+    int metric( int ) const;
+    struct QPixmapData : public QShared {
+        QCOORD w, h;
+        short d;
+        uint uninit : 1;
+        uint bitmap : 1;
+        uint selfmask : 1;
+
+
+
+        int ser_no;
+        QBitmap *mask;
+        void *ximage;
+        void *maskgc;
+        QPixmap *alphapm;
+        Optimization optim;
+
+
+
+    } *data;
+private:
+
+    bool doImageIO( QImageIO* io, int quality ) const;
+
+    QPixmap( int w, int h, int depth, bool, Optimization );
+    void init( int, int, int, bool, Optimization );
+    void deref();
+    QPixmap copy( bool ignoreMask = FALSE ) const;
+
+
+
+
+
+
+
+    static Optimization defOptim;
+    friend void bitBlt( QPaintDevice *, int, int,
+                                 const QPaintDevice *,
+                                 int, int, int, int, RasterOp, bool );
+    friend void bitBlt( QPaintDevice *, int, int,
+                                 const QImage* src,
+                                 int, int, int, int, int conversion_flags );
+    friend void copyBlt( QPixmap *dst, int dx, int dy,
+                                  const QPixmap *src, int sx, int sy,
+                                  int sw, int sh );
+
+
+
+
+
+
+
+    friend class QBitmap;
+    friend class QPaintDevice;
+    friend class QPainter;
+};
+
+
+inline bool QPixmap::isNull() const
+{
+    return data->w == 0;
+}
+
+inline void QPixmap::fill( const QWidget *w, const QPoint &ofs )
+{
+    fill( w, ofs.x(), ofs.y() );
+}
+
+inline void QPixmap::resize( const QSize &s )
+{
+    resize( s.width(), s.height() );
+}
+
+inline const QBitmap *QPixmap::mask() const
+{
+    return data->mask;
+}
+
+inline bool QPixmap::selfMask() const
+{
+    return data->selfmask;
+}
+inline int QPixmap::serialNumber() const
+{
+    return data->ser_no;
+}
+
+inline QPixmap::Optimization QPixmap::optimization() const
+{
+    return data->optim;
+}
+
+inline bool QPixmap::isQBitmap() const
+{
+    return data->bitmap;
+}
+ QDataStream &operator<<( QDataStream &, const QPixmap & );
+ QDataStream &operator>>( QDataStream &, QPixmap & );
+
+
+
+
+
+
+
+
+
+
+bool qt_xForm_helper( const QWMatrix&, int, int, int, uchar*, int, int, int, uchar*, int, int, int );
+
+
+ void copyBlt( QPixmap *dst, int dx, int dy,
+                       const QPixmap *src, int sx = 0, int sy = 0,
+                       int sw = -1, int sh = -1 );
+
+
+
+class QPixmapCache
+{
+public:
+    static int cacheLimit();
+    static void setCacheLimit( int );
+    static QPixmap *find( const QString &key );
+    static bool find( const QString &key, QPixmap& );
+    static bool insert( const QString &key, QPixmap * );
+    static bool insert( const QString &key, const QPixmap& );
+    static void remove( const QString &key );
+    static void clear();
+};
+class QTipManager;
+class QIconViewToolTip;
+class QListViewToolTip;
+
+class QToolTipGroup: public QObject
+{
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+   
+   
+
+public:
+    QToolTipGroup( QObject *parent, const char *name = 0 );
+   ~QToolTipGroup();
+
+    bool delay() const;
+    bool enabled() const;
+
+public :
+    void setDelay( bool );
+    void setEnabled( bool );
+
+protected:
+    void showTip( const QString &);
+    void removeTip();
+
+private:
+    uint del:1;
+    uint ena:1;
+
+    friend class QTipManager;
+
+private:
+
+    QToolTipGroup( const QToolTipGroup & );
+    QToolTipGroup& operator=( const QToolTipGroup & );
+
+};
+
+
+class QToolTip: public Qt
+{
+public:
+    QToolTip( QWidget *, QToolTipGroup * = 0 );
+
+
+    static void add( QWidget *, const QString &);
+    static void add( QWidget *, const QString &,
+                     QToolTipGroup *, const QString& );
+    static void remove( QWidget * );
+
+    static void add( QWidget *, const QRect &, const QString &);
+    static void add( QWidget *, const QRect &, const QString &,
+                     QToolTipGroup *, const QString& );
+    static void remove( QWidget *, const QRect & );
+
+    static QString textFor( QWidget *, const QPoint & pos = QPoint() );
+
+    static void hide();
+
+    static QFont font();
+    static void setFont( const QFont & );
+    static QPalette palette();
+    static void setPalette( const QPalette & );
+
+
+
+
+
+    static void setGloballyEnabled( bool );
+    static bool isGloballyEnabled();
+    static void setWakeUpDelay(int);
+
+protected:
+    virtual void maybeTip( const QPoint & ) = 0;
+    void tip( const QRect &, const QString &);
+    void tip( const QRect &, const QString& , const QString &);
+    void tip( const QRect &, const QString &, const QRect & );
+    void tip( const QRect &, const QString&, const QString &, const QRect &);
+
+    void clear();
+
+public:
+    QWidget *parentWidget() const { return p; }
+    QToolTipGroup *group() const { return g; }
+
+private:
+    QWidget *p;
+    QToolTipGroup *g;
+    static QFont *ttFont;
+    static QPalette *ttPalette;
+
+    friend class QTipManager;
+};
+
+
+
+
+
+
+
+class QString;
+class QStyle;
+
+class QStyleFactory
+{
+public:
+
+    static QStringList keys();
+
+    static QStyle *create( const QString& );
+};
+
+
+
+
+
+
+
+class QConnection
+{
+public:
+    QConnection( const QObject *, int, const char *memberName, int memberType );
+   ~QConnection() {}
+
+    bool isConnected() const { return obj != 0; }
+
+    QObject *object() const { return obj; }
+    int member() const { return mbr; }
+    const char *memberName() const { return mbr_name; }
+    int memberType() const { return mbr_type; }
+    int numArgs() const { return nargs; }
+
+private:
+    QObject *obj;
+    int mbr;
+    const char *mbr_name;
+    int mbr_type;
+    int nargs;
+
+private:
+
+    QConnection( const QConnection & );
+    QConnection &operator=( const QConnection & );
+
+};
+
+
+
+
+
+
+
+class QObject;
+struct QUMethod;
+class QMetaObjectPrivate;
+
+struct QMetaData
+{
+    const char *name;
+    const QUMethod* method;
+    enum Access { Private, Protected, Public };
+    Access access;
+};
+
+
+struct QMetaEnum
+{
+    const char *name;
+    uint count;
+    struct Item
+    {
+        const char *key;
+        int value;
+    };
+    const Item *items;
+    bool set;
+};
+
+
+
+
+class QMetaProperty
+{
+public:
+    const char* type() const { return t; }
+    const char* name() const { return n; }
+
+    bool writable() const;
+    bool isValid() const;
+
+    bool isSetType() const;
+    bool isEnumType() const;
+    QStrList enumKeys() const;
+
+    int keyToValue( const char* key ) const;
+    const char* valueToKey( int value ) const;
+    int keysToValue( const QStrList& keys ) const;
+    QStrList valueToKeys( int value ) const;
+
+    bool designable( QObject* = 0 ) const;
+    bool scriptable( QObject* = 0 ) const;
+    bool stored( QObject* = 0 ) const;
+
+    bool reset( QObject* ) const;
+
+    const char* t;
+    const char* n;
+
+    enum Flags {
+        Invalid = 0x00000000,
+        Readable = 0x00000001,
+        Writable = 0x00000002,
+        EnumOrSet = 0x00000004,
+        UnresolvedEnum = 0x00000008,
+        StdSet = 0x00000100,
+        Override = 0x00000200
+    };
+
+    uint flags;
+    bool testFlags( uint f ) const;
+    bool stdSet() const;
+    int id() const;
+
+    QMetaObject** meta;
+
+    const QMetaEnum* enumData;
+    int _id;
+    void clear();
+};
+
+inline bool QMetaProperty::testFlags( uint f ) const
+{ return (flags & (uint)f) != (uint)0; }
+
+
+
+struct QClassInfo
+{
+    const char* name;
+    const char* value;
+};
+
+class QMetaObject
+{
+public:
+    QMetaObject( const char * const class_name, QMetaObject *superclass,
+                 const QMetaData * const slot_data, int n_slots,
+                 const QMetaData * const signal_data, int n_signals,
+
+                 const QMetaProperty *const prop_data, int n_props,
+                 const QMetaEnum *const enum_data, int n_enums,
+
+                 const QClassInfo *const class_info, int n_info );
+
+
+    QMetaObject( const char * const class_name, QMetaObject *superclass,
+                 const QMetaData * const slot_data, int n_slots,
+                 const QMetaData * const signal_data, int n_signals,
+                 const QMetaProperty *const prop_data, int n_props,
+                 const QMetaEnum *const enum_data, int n_enums,
+                 bool (*qt_static_property)(QObject*, int, int, QVariant*),
+                 const QClassInfo *const class_info, int n_info );
+
+
+
+    virtual ~QMetaObject();
+
+    const char *className() const { return classname; }
+    const char *superClassName() const { return superclassname; }
+
+    QMetaObject *superClass() const { return superclass; }
+
+    bool inherits( const char* clname ) const;
+
+    int numSlots( bool super = FALSE ) const;
+    int numSignals( bool super = FALSE ) const;
+
+    int findSlot( const char *, bool super = FALSE ) const;
+    int findSignal( const char *, bool super = FALSE ) const;
+
+    const QMetaData *slot( int index, bool super = FALSE ) const;
+    const QMetaData *signal( int index, bool super = FALSE ) const;
+
+    QStrList slotNames( bool super = FALSE ) const;
+    QStrList signalNames( bool super = FALSE ) const;
+
+    int slotOffset() const;
+    int signalOffset() const;
+    int propertyOffset() const;
+
+    int numClassInfo( bool super = FALSE ) const;
+    const QClassInfo *classInfo( int index, bool super = FALSE ) const;
+    const char *classInfo( const char* name, bool super = FALSE ) const;
+
+
+    const QMetaProperty *property( int index, bool super = FALSE ) const;
+    int findProperty( const char *name, bool super = FALSE ) const;
+    int indexOfProperty( const QMetaProperty*, bool super = FALSE ) const;
+    const QMetaProperty* resolveProperty( const QMetaProperty* ) const;
+    int resolveProperty( int ) const;
+    QStrList propertyNames( bool super = FALSE ) const;
+    int numProperties( bool super = FALSE ) const;
+
+
+
+
+
+    static QMetaObject *new_metaobject( const char *, QMetaObject *,
+                                        const QMetaData *const, int,
+                                        const QMetaData *const, int,
+
+                                        const QMetaProperty *const prop_data, int n_props,
+                                        const QMetaEnum *const enum_data, int n_enums,
+
+                                        const QClassInfo *const class_info, int n_info );
+
+    static QMetaObject *new_metaobject( const char *, QMetaObject *,
+                                        const QMetaData *const, int,
+                                        const QMetaData *const, int,
+                                        const QMetaProperty *const prop_data, int n_props,
+                                        const QMetaEnum *const enum_data, int n_enums,
+                                         bool (*qt_static_property)(QObject*, int, int, QVariant*),
+                                        const QClassInfo *const class_info, int n_info );
+    QStrList enumeratorNames( bool super = FALSE ) const;
+    int numEnumerators( bool super = FALSE ) const;
+    const QMetaEnum *enumerator( const char* name, bool super = FALSE ) const;
+
+
+    static QMetaObject *metaObject( const char *class_name );
+    static bool hasMetaObject( const char *class_name );
+
+private:
+    QMemberDict *init( const QMetaData *, int );
+
+    const char *classname;
+    const char *superclassname;
+    QMetaObject *superclass;
+    QMetaObjectPrivate *d;
+    void *reserved;
+    const QMetaData *slotData;
+    QMemberDict *slotDict;
+    const QMetaData *signalData;
+    QMemberDict *signalDict;
+    int signaloffset;
+    int slotoffset;
+
+    int propertyoffset;
+public:
+    bool qt_static_property( QObject* o, int id, int f, QVariant* v);
+private:
+    friend class QMetaProperty;
+
+
+private:
+
+    QMetaObject( const QMetaObject & );
+    QMetaObject &operator=( const QMetaObject & );
+
+};
+
+inline int QMetaObject::slotOffset() const
+{ return slotoffset; }
+
+inline int QMetaObject::signalOffset() const
+{ return signaloffset; }
+
+
+inline int QMetaObject::propertyOffset() const
+{ return propertyoffset; }
+
+
+typedef QMetaObject *(*QtStaticMetaObjectFunction)();
+
+class QMetaObjectCleanUp
+{
+public:
+    QMetaObjectCleanUp( const char *mo_name, QtStaticMetaObjectFunction );
+    QMetaObjectCleanUp();
+    ~QMetaObjectCleanUp();
+
+    void setMetaObject( QMetaObject *&mo );
+
+private:
+    QMetaObject **metaObject;
+};
+
+
+
+
+
+
+
+
+
+class QString;
+class QCString;
+class QFont;
+class QPixmap;
+class QBrush;
+class QRect;
+class QPoint;
+class QImage;
+class QSize;
+class QColor;
+class QPalette;
+class QColorGroup;
+class QIconSet;
+class QDataStream;
+class QPointArray;
+class QRegion;
+class QBitmap;
+class QCursor;
+class QStringList;
+class QSizePolicy;
+class QDate;
+class QTime;
+class QDateTime;
+class QBitArray;
+class QKeySequence;
+class QPen;
+
+class QVariant;
+
+template <class T> class QValueList;
+template <class T> class QValueListConstIterator;
+template <class T> class QValueListNode;
+template <class Key, class T> class QMap;
+template <class Key, class T> class QMapConstIterator;
+
+
+class QVariant
+{
+public:
+    enum Type {
+        Invalid,
+        Map,
+        List,
+        String,
+        StringList,
+        Font,
+        Pixmap,
+        Brush,
+        Rect,
+        Size,
+        Color,
+        Palette,
+        ColorGroup,
+        IconSet,
+        Point,
+        Image,
+        Int,
+        UInt,
+        Bool,
+        Double,
+        CString,
+        PointArray,
+        Region,
+        Bitmap,
+        Cursor,
+        SizePolicy,
+        Date,
+        Time,
+        DateTime,
+        ByteArray,
+        BitArray,
+        KeySequence,
+        Pen,
+        LongLong,
+        ULongLong
+    };
+
+    QVariant();
+    ~QVariant();
+    QVariant( const QVariant& );
+
+    QVariant( QDataStream& s );
+
+    QVariant( const QString& );
+    QVariant( const QCString& );
+    QVariant( const char* );
+
+    QVariant( const QStringList& );
+
+    QVariant( const QFont& );
+    QVariant( const QPixmap& );
+    QVariant( const QImage& );
+    QVariant( const QBrush& );
+    QVariant( const QPoint& );
+    QVariant( const QRect& );
+    QVariant( const QSize& );
+    QVariant( const QColor& );
+    QVariant( const QPalette& );
+    QVariant( const QColorGroup& );
+    QVariant( const QIconSet& );
+    QVariant( const QPointArray& );
+    QVariant( const QRegion& );
+    QVariant( const QBitmap& );
+    QVariant( const QCursor& );
+    QVariant( const QDate& );
+    QVariant( const QTime& );
+    QVariant( const QDateTime& );
+    QVariant( const QByteArray& );
+    QVariant( const QBitArray& );
+
+    QVariant( const QKeySequence& );
+
+    QVariant( const QPen& );
+
+    QVariant( const QValueList<QVariant>& );
+    QVariant( const QMap<QString,QVariant>& );
+
+    QVariant( int );
+    QVariant( uint );
+    QVariant( Q_LLONG );
+    QVariant( Q_ULLONG );
+
+    QVariant( bool, int );
+    QVariant( double );
+    QVariant( QSizePolicy );
+
+    QVariant& operator= ( const QVariant& );
+    bool operator==( const QVariant& ) const;
+    bool operator!=( const QVariant& ) const;
+
+    Type type() const;
+    const char* typeName() const;
+
+    bool canCast( Type ) const;
+    bool cast( Type );
+
+    bool isValid() const;
+    bool isNull() const;
+
+    void clear();
+
+    const QString toString() const;
+    const QCString toCString() const;
+
+    const QStringList toStringList() const;
+
+    const QFont toFont() const;
+    const QPixmap toPixmap() const;
+    const QImage toImage() const;
+    const QBrush toBrush() const;
+    const QPoint toPoint() const;
+    const QRect toRect() const;
+    const QSize toSize() const;
+    const QColor toColor() const;
+    const QPalette toPalette() const;
+    const QColorGroup toColorGroup() const;
+    const QIconSet toIconSet() const;
+    const QPointArray toPointArray() const;
+    const QBitmap toBitmap() const;
+    const QRegion toRegion() const;
+    const QCursor toCursor() const;
+    const QDate toDate() const;
+    const QTime toTime() const;
+    const QDateTime toDateTime() const;
+    const QByteArray toByteArray() const;
+    const QBitArray toBitArray() const;
+
+    const QKeySequence toKeySequence() const;
+
+    const QPen toPen() const;
+    int toInt( bool * ok=0 ) const;
+    uint toUInt( bool * ok=0 ) const;
+    Q_LLONG toLongLong( bool * ok=0 ) const;
+    Q_ULLONG toULongLong( bool * ok=0 ) const;
+    bool toBool() const;
+    double toDouble( bool * ok=0 ) const;
+
+    const QValueList<QVariant> toList() const;
+    const QMap<QString,QVariant> toMap() const;
+
+    QSizePolicy toSizePolicy() const;
+
+
+    QValueListConstIterator<QString> stringListBegin() const;
+    QValueListConstIterator<QString> stringListEnd() const;
+    QValueListConstIterator<QVariant> listBegin() const;
+    QValueListConstIterator<QVariant> listEnd() const;
+    QMapConstIterator<QString,QVariant> mapBegin() const;
+    QMapConstIterator<QString,QVariant> mapEnd() const;
+    QMapConstIterator<QString,QVariant> mapFind( const QString& ) const;
+
+    QString& asString();
+    QCString& asCString();
+
+    QStringList& asStringList();
+
+    QFont& asFont();
+    QPixmap& asPixmap();
+    QImage& asImage();
+    QBrush& asBrush();
+    QPoint& asPoint();
+    QRect& asRect();
+    QSize& asSize();
+    QColor& asColor();
+    QPalette& asPalette();
+    QColorGroup& asColorGroup();
+    QIconSet& asIconSet();
+    QPointArray& asPointArray();
+    QBitmap& asBitmap();
+    QRegion& asRegion();
+    QCursor& asCursor();
+    QDate& asDate();
+    QTime& asTime();
+    QDateTime& asDateTime();
+    QByteArray& asByteArray();
+    QBitArray& asBitArray();
+
+    QKeySequence& asKeySequence();
+
+    QPen& asPen();
+    int& asInt();
+    uint& asUInt();
+    Q_LLONG& asLongLong();
+    Q_ULLONG& asULongLong();
+    bool& asBool();
+    double& asDouble();
+
+    QValueList<QVariant>& asList();
+    QMap<QString,QVariant>& asMap();
+
+    QSizePolicy& asSizePolicy();
+
+
+    void load( QDataStream& );
+    void save( QDataStream& ) const;
+
+    static const char* typeToName( Type typ );
+    static Type nameToType( const char* name );
+
+private:
+    void detach();
+
+    class Private : public QShared
+    {
+    public:
+        Private();
+        Private( Private* );
+        ~Private();
+
+        void clear();
+
+        Type typ;
+        union
+        {
+            uint u;
+            int i;
+            Q_LLONG ll;
+            Q_ULLONG ull;
+            bool b;
+            double d;
+            void *ptr;
+        } value;
+        uint is_null : 1;
+    };
+
+    Private* d;
+
+public:
+    void* rawAccess( void* ptr = 0, Type typ = Invalid, bool deepCopy = FALSE );
+};
+inline QVariant::Type QVariant::type() const
+{
+    return d->typ;
+}
+
+inline bool QVariant::isValid() const
+{
+    return (d->typ != Invalid);
+}
+
+
+inline QValueListConstIterator<QString> QVariant::stringListBegin() const
+{
+    if ( d->typ != StringList )
+        return QValueListConstIterator<QString>();
+    return ((const QStringList*)d->value.ptr)->begin();
+}
+
+inline QValueListConstIterator<QString> QVariant::stringListEnd() const
+{
+    if ( d->typ != StringList )
+        return QValueListConstIterator<QString>();
+    return ((const QStringList*)d->value.ptr)->end();
+}
+
+inline QValueListConstIterator<QVariant> QVariant::listBegin() const
+{
+    if ( d->typ != List )
+        return QValueListConstIterator<QVariant>();
+    return ((const QValueList<QVariant>*)d->value.ptr)->begin();
+}
+
+inline QValueListConstIterator<QVariant> QVariant::listEnd() const
+{
+    if ( d->typ != List )
+        return QValueListConstIterator<QVariant>();
+    return ((const QValueList<QVariant>*)d->value.ptr)->end();
+}
+
+inline QMapConstIterator<QString,QVariant> QVariant::mapBegin() const
+{
+    if ( d->typ != Map )
+        return QMapConstIterator<QString,QVariant>();
+    return ((const QMap<QString,QVariant>*)d->value.ptr)->begin();
+}
+
+inline QMapConstIterator<QString,QVariant> QVariant::mapEnd() const
+{
+    if ( d->typ != Map )
+        return QMapConstIterator<QString,QVariant>();
+    return ((const QMap<QString,QVariant>*)d->value.ptr)->end();
+}
+
+inline QMapConstIterator<QString,QVariant> QVariant::mapFind( const QString& key ) const
+{
+    if ( d->typ != Map )
+        return QMapConstIterator<QString,QVariant>();
+    return ((const QMap<QString,QVariant>*)d->value.ptr)->find( key );
+}
+
+
+
+ QDataStream& operator>> ( QDataStream& s, QVariant& p );
+ QDataStream& operator<< ( QDataStream& s, const QVariant& p );
+ QDataStream& operator>> ( QDataStream& s, QVariant::Type& p );
+ QDataStream& operator<< ( QDataStream& s, const QVariant::Type p );
+
+
+
+
+
+class QWidget;
+class QSqlPropertyMapPrivate;
+
+class QSqlPropertyMap {
+public:
+    QSqlPropertyMap();
+    virtual ~QSqlPropertyMap();
+
+    QVariant property( QWidget * widget );
+    virtual void setProperty( QWidget * widget, const QVariant & value );
+
+    void insert( const QString & classname, const QString & property );
+    void remove( const QString & classname );
+
+    static QSqlPropertyMap * defaultMap();
+    static void installDefaultMap( QSqlPropertyMap * map );
+
+private:
+
+    QSqlPropertyMap( const QSqlPropertyMap & );
+    QSqlPropertyMap &operator=( const QSqlPropertyMap & );
+
+    QSqlPropertyMapPrivate* d;
+
+};
+
+
+
+
+
+
+
+
+
+
+
+
+namespace KDE
+{
+    unsigned int version();
+
+
+
+
+
+
+    unsigned int versionMajor();
+
+
+
+
+
+
+    unsigned int versionMinor();
+
+
+
+
+
+
+    unsigned int versionRelease();
+
+
+
+
+
+    const char *versionString();
+}
+
+
+
+class KConfig;
+class KCharsets;
+class DCOPClient;
+class DCOPObject;
+
+typedef unsigned long Atom;
+
+
+
+
+
+
+
+
+
+
+
+class QApplication;
+class QDesktopWidgetPrivate;
+
+class QDesktopWidget : public QWidget
+{
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+public:
+    QDesktopWidget();
+    ~QDesktopWidget();
+
+    bool isVirtualDesktop() const;
+
+    int numScreens() const;
+    int primaryScreen() const;
+
+    int screenNumber( QWidget *widget = 0 ) const;
+    int screenNumber( const QPoint & ) const;
+
+    QWidget *screen( int screen = -1 );
+
+    const QRect& screenGeometry( int screen = -1 ) const;
+    const QRect& screenGeometry( QWidget *widget ) const
+    { return screenGeometry( screenNumber( widget ) ); }
+    const QRect& screenGeometry( const QPoint &point ) const
+    { return screenGeometry( screenNumber( point ) ); }
+
+    const QRect& availableGeometry( int screen = -1 ) const;
+    const QRect& availableGeometry( QWidget *widget ) const
+    { return availableGeometry( screenNumber( widget ) ); }
+    const QRect& availableGeometry( const QPoint &point ) const
+    { return availableGeometry( screenNumber( point ) ); }
+
+    void insertChild( QObject * );
+
+protected:
+    void resized( int );
+
+protected:
+    void resizeEvent( QResizeEvent *e );
+
+private:
+    QDesktopWidgetPrivate *d;
+
+
+    QDesktopWidget( const QDesktopWidget & );
+    QDesktopWidget &operator=( const QDesktopWidget & );
+
+
+    friend class QApplication;
+};
+
+
+
+
+
+template<class type>
+class QAsciiDict
+
+
+
+        : public QGDict
+
+{
+public:
+    QAsciiDict(int size=17, bool caseSensitive=TRUE, bool copyKeys=TRUE )
+        : QGDict(size,AsciiKey,caseSensitive,copyKeys) {}
+    QAsciiDict( const QAsciiDict<type> &d ) : QGDict(d) {}
+   ~QAsciiDict() { clear(); }
+    QAsciiDict<type> &operator=(const QAsciiDict<type> &d)
+                        { return (QAsciiDict<type>&)QGDict::operator=(d); }
+    uint count() const { return QGDict::count(); }
+    uint size() const { return QGDict::size(); }
+    bool isEmpty() const { return QGDict::count() == 0; }
+
+    void insert( const char *k, const type *d )
+                                        { QGDict::look_ascii(k,(Item)d,1); }
+    void replace( const char *k, const type *d )
+                                        { QGDict::look_ascii(k,(Item)d,2); }
+    bool remove( const char *k ) { return QGDict::remove_ascii(k); }
+    type *take( const char *k ) { return (type *)QGDict::take_ascii(k); }
+    type *find( const char *k ) const
+                { return (type *)((QGDict*)this)->QGDict::look_ascii(k,0,0); }
+    type *operator[]( const char *k ) const
+                { return (type *)((QGDict*)this)->QGDict::look_ascii(k,0,0); }
+
+    void clear() { QGDict::clear(); }
+    void resize( uint n ) { QGDict::resize(n); }
+    void statistics() const { QGDict::statistics(); }
+
+
+
+
+
+
+
+private:
+    void deleteItem( Item d );
+};
+
+
+template<> inline void QAsciiDict<void>::deleteItem( QPtrCollection::Item )
+{
+}
+
+
+template<class type> inline void QAsciiDict<type>::deleteItem( QPtrCollection::Item d )
+{
+    if ( del_item ) delete (type *)d;
+}
+
+template<class type>
+class QAsciiDictIterator : public QGDictIterator
+{
+public:
+    QAsciiDictIterator(const QAsciiDict<type> &d)
+        : QGDictIterator((QGDict &)d) {}
+   ~QAsciiDictIterator() {}
+    uint count() const { return dict->count(); }
+    bool isEmpty() const { return dict->count() == 0; }
+    type *toFirst() { return (type *)QGDictIterator::toFirst(); }
+    operator type *() const { return (type *)QGDictIterator::get(); }
+    type *current() const { return (type *)QGDictIterator::get(); }
+    const char *currentKey() const { return QGDictIterator::getKeyAscii(); }
+    type *operator()() { return (type *)QGDictIterator::operator()(); }
+    type *operator++() { return (type *)QGDictIterator::operator++(); }
+    type *operator+=(uint j) { return (type *)QGDictIterator::operator+=(j);}
+};
+
+
+
+
+
+
+
+class QSessionManager;
+class QStyle;
+class QTranslator;
+class QEventLoop;
+
+
+
+
+
+class QMutex;
+
+
+
+class QApplication;
+extern QApplication *qApp;
+
+
+class QApplication : public QObject
+{
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+public:
+    QApplication( int &argc, char **argv );
+    QApplication( int &argc, char **argv, bool GUIenabled );
+    enum Type { Tty, GuiClient, GuiServer };
+    QApplication( int &argc, char **argv, Type );
+
+    QApplication( Display* dpy, HANDLE visual = 0, HANDLE cmap = 0 );
+    QApplication( Display *dpy, int argc, char **argv,
+                  HANDLE visual = 0, HANDLE cmap= 0 );
+
+    virtual ~QApplication();
+
+    int argc() const;
+    char **argv() const;
+
+    Type type() const;
+
+
+    static QStyle &style();
+    static void setStyle( QStyle* );
+    static QStyle* setStyle( const QString& );
+
+
+    enum ColorMode { NormalColors, CustomColors };
+    static ColorMode colorMode();
+    static void setColorMode( QApplication::ColorMode );
+
+
+    enum ColorSpec { NormalColor=0, CustomColor=1, ManyColor=2 };
+    static int colorSpec();
+    static void setColorSpec( int );
+
+    static QCursor *overrideCursor();
+    static void setOverrideCursor( const QCursor &, bool replace=FALSE );
+    static void restoreOverrideCursor();
+
+    static bool hasGlobalMouseTracking();
+    static void setGlobalMouseTracking( bool enable );
+
+    static QPalette palette( const QWidget* = 0 );
+    static void setPalette( const QPalette &, bool informWidgets=FALSE,
+                                 const char* className = 0 );
+
+    static QFont font( const QWidget* = 0 );
+    static void setFont( const QFont &, bool informWidgets=FALSE,
+                              const char* className = 0 );
+    static QFontMetrics fontMetrics();
+
+    QWidget *mainWidget() const;
+    virtual void setMainWidget( QWidget * );
+    virtual void polish( QWidget * );
+
+    static QWidgetList *allWidgets();
+    static QWidgetList *topLevelWidgets();
+
+    static QDesktopWidget *desktop();
+
+    static QWidget *activePopupWidget();
+    static QWidget *activeModalWidget();
+
+    static QClipboard *clipboard();
+
+    QWidget *focusWidget() const;
+    QWidget *activeWindow() const;
+
+    static QWidget *widgetAt( int x, int y, bool child=FALSE );
+    static QWidget *widgetAt( const QPoint &, bool child=FALSE );
+
+    static QEventLoop *eventLoop();
+
+    int exec();
+    void processEvents();
+    void processEvents( int maxtime );
+    void processOneEvent();
+    bool hasPendingEvents();
+    int enter_loop();
+    void exit_loop();
+    int loopLevel() const;
+    static void exit( int retcode=0 );
+
+    static bool sendEvent( QObject *receiver, QEvent *event );
+    static void postEvent( QObject *receiver, QEvent *event );
+    static void sendPostedEvents( QObject *receiver, int event_type );
+    static void sendPostedEvents();
+
+    static void removePostedEvents( QObject *receiver );
+
+    virtual bool notify( QObject *, QEvent * );
+
+    static bool startingUp();
+    static bool closingDown();
+
+    static void flushX();
+    static void flush();
+    static void syncX();
+
+    static void beep();
+
+
+
+    void setDefaultCodec( QTextCodec * );
+    QTextCodec* defaultCodec() const;
+
+    void installTranslator( QTranslator * );
+    void removeTranslator( QTranslator * );
+
+    enum Encoding { DefaultCodec, UnicodeUTF8 };
+    QString translate( const char * context,
+                                const char * key,
+                                const char * comment = 0,
+                                Encoding encoding = DefaultCodec ) const;
+
+    QString applicationDirPath();
+    QString applicationFilePath();
+
+
+
+    static void setWinStyleHighlightColor( const QColor &c ) {
+        QPalette p( palette() );
+        p.setColor( QColorGroup::Highlight, c );
+        setPalette( p, TRUE);
+    }
+    static const QColor &winStyleHighlightColor() {
+        return palette().active().highlight();
+    }
+
+    static void setDesktopSettingsAware( bool );
+    static bool desktopSettingsAware();
+
+    static void setCursorFlashTime( int );
+    static int cursorFlashTime();
+
+    static void setDoubleClickInterval( int );
+    static int doubleClickInterval();
+
+    static void setWheelScrollLines( int );
+    static int wheelScrollLines();
+
+    static void setGlobalStrut( const QSize & );
+    static QSize globalStrut();
+
+
+    static void setLibraryPaths( const QStringList & );
+    static QStringList libraryPaths();
+    static void addLibraryPath( const QString & );
+    static void removeLibraryPath( const QString & );
+
+    static void setStartDragTime( int ms );
+    static int startDragTime();
+    static void setStartDragDistance( int l );
+    static int startDragDistance();
+
+    static void setReverseLayout( bool b );
+    static bool reverseLayout();
+
+    static int horizontalAlignment( int align );
+
+    static bool isEffectEnabled( Qt::UIEffect );
+    static void setEffectEnabled( Qt::UIEffect, bool enable = TRUE );
+    virtual bool x11EventFilter( XEvent * );
+    virtual int x11ClientMessage( QWidget*, XEvent*, bool passive_only);
+    int x11ProcessEvent( XEvent* );
+    bool isSessionRestored() const;
+    QString sessionId() const;
+    QString sessionKey() const;
+    virtual void commitData( QSessionManager& sm );
+    virtual void saveState( QSessionManager& sm );
+
+
+    static void create_xim();
+    static void close_xim();
+    static bool x11_apply_settings();
+
+    void wakeUpGuiThread();
+
+    void lock();
+    void unlock(bool wakeUpGui = TRUE);
+    bool locked();
+    bool tryLock();
+
+
+protected:
+    void lastWindowClosed();
+    void aboutToQuit();
+    void guiThreadAwake();
+
+public :
+    void quit();
+    void closeAllWindows();
+    void aboutQt();
+
+
+
+
+
+
+protected:
+    bool event(QEvent *);
+
+private:
+    void construct( int &argc, char **argv, Type );
+    void initialize( int, char ** );
+    void init_precmdline();
+    void process_cmdline( int* argcptr, char ** argv );
+    bool internalNotify( QObject *, QEvent * );
+    static QMutex *qt_mutex;
+
+
+    int app_argc;
+    char **app_argv;
+    bool quit_now;
+    int quit_code;
+    static QStyle *app_style;
+    static int app_cspec;
+
+    static QPalette *app_pal;
+
+    static QFont *app_font;
+
+    static QCursor *app_cursor;
+
+    static QEventLoop* eventloop;
+    static int app_tracking;
+    static bool is_app_running;
+    static bool is_app_closing;
+    static bool app_exit_loop;
+    static int loop_level;
+    static QWidget *main_widget;
+    static QWidget *focus_widget;
+    static QWidget *active_window;
+    static bool obey_desktop_settings;
+    static int cursor_flash_time;
+    static int mouse_double_click_time;
+    static int wheel_scroll_lines;
+    static int composedUnicode;
+
+    static bool animate_ui;
+    static bool animate_menu;
+    static bool animate_tooltip;
+    static bool animate_combo;
+    static bool fade_menu;
+    static bool fade_tooltip;
+    static bool animate_toolbox;
+    static bool widgetCount;
+    static bool metaComposeUnicode;
+
+    QValueList<QTranslator*> *translators;
+
+    QSessionManager *session_manager;
+    QString session_id;
+    static QString* session_key;
+    bool is_session_restored;
+
+
+    static void x11_initialize_style();
+
+
+    static QSize app_strut;
+
+    static QStringList *app_libpaths;
+
+    static QAsciiDict<QPalette> *app_palettes;
+    static QAsciiDict<QFont> *app_fonts;
+
+    static QWidgetList *popupWidgets;
+    bool inPopupMode() const;
+    void closePopup( QWidget *popup );
+    void openPopup( QWidget *popup );
+    void setActiveWindow( QWidget* act );
+
+    static bool sendSpontaneousEvent( QObject *receiver, QEvent *event );
+    static void removePostedEvent( QEvent * );
+
+    friend class QWidget;
+    friend class QETWidget;
+    friend class QDialog;
+    friend class QAccelManager;
+    friend class QEvent;
+    friend class QTranslator;
+    friend class QEventLoop;
+    friend void qt_ucm_initialize( QApplication * );
+
+
+
+
+
+
+private:
+
+    QApplication( const QApplication & );
+    QApplication &operator=( const QApplication & );
+
+};
+
+inline int QApplication::argc() const
+{
+    return app_argc;
+}
+
+inline char **QApplication::argv() const
+{
+    return app_argv;
+}
+inline QCursor *QApplication::overrideCursor()
+{
+    return app_cursor;
+}
+
+inline bool QApplication::hasGlobalMouseTracking()
+{
+    return app_tracking > 0;
+}
+
+inline QWidget *QApplication::mainWidget() const
+{
+    return main_widget;
+}
+
+inline QWidget *QApplication::focusWidget() const
+{
+    return focus_widget;
+}
+
+inline QWidget *QApplication::activeWindow() const
+{
+    return active_window;
+}
+
+inline QWidget *QApplication::widgetAt( const QPoint &p, bool child )
+{
+    return widgetAt( p.x(), p.y(), child );
+}
+
+inline bool QApplication::inPopupMode() const
+{
+    return popupWidgets != 0;
+}
+
+inline bool QApplication::isSessionRestored() const
+{
+    return is_session_restored;
+}
+
+inline QString QApplication::sessionId() const
+{
+    return session_id;
+}
+
+inline QString QApplication::sessionKey() const
+{
+    return session_key ? *session_key : QString::null;
+}
+
+inline QSize QApplication::globalStrut()
+{
+    return app_strut;
+}
+
+inline bool QApplication::sendEvent( QObject *receiver, QEvent *event )
+{ if ( event ) event->spont = FALSE; return qApp ? qApp->notify( receiver, event ) : FALSE; }
+
+inline bool QApplication::sendSpontaneousEvent( QObject *receiver, QEvent *event )
+{ if ( event ) event->spont = TRUE; return qApp ? qApp->notify( receiver, event ) : FALSE; }
+inline int QApplication::horizontalAlignment( int align )
+{
+    align &= AlignHorizontal_Mask;
+    if ( align == AlignAuto ) {
+        if ( reverseLayout() )
+            align = AlignRight;
+        else
+            align = AlignLeft;
+    }
+    return align;
+}
+
+
+class KStandardDirs;
+class KAboutData;
+class KConfig;
+class KIconLoader;
+class KCharsets;
+class QFont;
+class KInstancePrivate;
+class KMimeSourceFactory;
+class KInstance
+{
+    friend class KStandardDirs;
+
+ public:
+
+
+
+
+    KInstance( const QCString& instanceName) ;
+    KInstance( const KAboutData * aboutData );
+
+
+
+
+
+
+
+    KInstance( KInstance* src );
+
+
+
+
+    virtual ~KInstance();
+
+
+
+
+
+    KStandardDirs *dirs() const;
+
+
+
+
+
+    KConfig *config() const;
+
+
+
+
+
+    KIconLoader *iconLoader() const;
+
+
+
+
+    void newIconLoader() const;
+
+    KCharsets *charsets() const;
+
+
+
+
+
+
+
+    const KAboutData *aboutData() const;
+
+
+
+
+
+
+    QCString instanceName() const;
+
+
+
+
+
+
+    KMimeSourceFactory* mimeSourceFactory () const;
+
+protected:
+
+
+
+    KInstance( const KInstance& );
+
+
+
+
+
+
+    void setConfigName(const QString &name);
+
+private:
+    mutable KStandardDirs *_dirs;
+
+    mutable KConfig *_config;
+    mutable KIconLoader *_iconLoader;
+
+    QCString _name;
+    const KAboutData *_aboutData;
+
+protected:
+    virtual void virtual_hook( int id, void* data );
+private:
+    KInstancePrivate *d;
+};
+
+struct _IceConn;
+class QPopupMenu;
+class QStrList;
+class KSessionManaged;
+class KStyle;
+class KURL;
+
+
+class KApplicationPrivate;
+class KApplication : public QApplication, public KInstance
+{
+
+  public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+public:
+  enum CaptionLayout { CaptionAppLast=1, CaptionAppFirst, CaptionNoApp };
+  KApplication( bool allowStyles=true, bool GUIenabled=true);
+  KApplication(Display *display, int& argc, char** argv, const QCString& rAppName,
+               bool allowStyles=true, bool GUIenabled=true);
+ KApplication(int& argc, char** argv,
+              const QCString& rAppName, bool allowStyles=true, bool GUIenabled=true) ;
+
+
+
+
+  static void addCmdLineOptions();
+
+  virtual ~KApplication();
+  static KApplication* kApplication() { return KApp; }
+  KConfig* sessionConfig();
+  bool isRestored() const { return QApplication::isSessionRestored(); }
+
+
+
+
+
+
+
+  void disableSessionManagement();
+
+
+
+
+
+
+
+  void enableSessionManagement();
+
+
+
+
+  enum ShutdownConfirm {
+
+
+
+    ShutdownConfirmDefault = -1,
+
+
+
+    ShutdownConfirmNo = 0,
+
+
+
+    ShutdownConfirmYes = 1
+  };
+
+
+
+
+  enum ShutdownType {
+
+
+
+    ShutdownTypeDefault = -1,
+
+
+
+    ShutdownTypeNone = 0,
+
+
+
+    ShutdownTypeReboot = 1,
+
+
+
+    ShutdownTypeHalt = 2
+  };
+
+
+
+
+  enum ShutdownMode {
+
+
+
+    ShutdownModeDefault = -1,
+
+
+
+
+    ShutdownModeSchedule = 0,
+
+
+
+    ShutdownModeTryNow = 1,
+
+
+
+    ShutdownModeForceNow = 2,
+
+
+
+    ShutdownModeInteractive = 3
+  };
+  bool requestShutDown( ShutdownConfirm confirm = ShutdownConfirmDefault,
+                        ShutdownType sdtype = ShutdownTypeDefault,
+                        ShutdownMode sdmode = ShutdownModeDefault );
+    void propagateSessionManager();
+
+
+
+
+
+
+  void commitData( QSessionManager& sm );
+
+
+
+
+
+
+  void saveState( QSessionManager& sm );
+  bool sessionSaving() const;
+
+
+
+
+
+
+
+  static DCOPClient *dcopClient();
+
+
+
+
+
+  static void disableAutoDcopRegistration();
+
+
+
+
+
+  QPixmap icon() const;
+
+
+
+
+
+  QString iconName() const;
+
+
+
+
+
+  QPixmap miniIcon() const;
+
+
+
+
+
+  QString miniIconName() const;
+  void setTopWidget( QWidget *topWidget );
+  void invokeHelp( const QString& anchor = QString::null,
+                   const QString& appname = QString::null ) const;
+  void invokeHTMLHelp( const QString& aFilename, const QString& aTopic = QString::null ) const __attribute__ ((deprecated));
+
+
+
+
+
+
+
+  void invokeMailer( const QString &address, const QString &subject );
+
+
+
+
+
+
+  void invokeMailer( const KURL &mailtoURL );
+  void invokeMailer(const QString &to, const QString &cc, const QString &bcc,
+                    const QString &subject, const QString &body,
+                    const QString &messageFile = QString::null, const QStringList &attachURLs = QStringList());
+
+public :
+  void invokeBrowser( const QString &url );
+  void cut();
+  void copy();
+  void paste();
+  void clear();
+  void selectAll();
+
+public:
+
+
+
+
+
+  static QCString launcher();
+  static int startServiceByName( const QString& _name, const QString &URL,
+                QString *error=0, QCString *dcopService=0, int *pid=0, const QCString &startup_id = "", bool noWait = false );
+  static int startServiceByName( const QString& _name, const QStringList &URLs=QStringList(),
+                QString *error=0, QCString *dcopService=0, int *pid=0, const QCString &startup_id = "", bool noWait = false );
+  static int startServiceByDesktopPath( const QString& _name, const QString &URL,
+                QString *error=0, QCString *dcopService=0, int *pid = 0, const QCString &startup_id = "", bool noWait = false );
+  static int startServiceByDesktopPath( const QString& _name, const QStringList &URLs=QStringList(),
+                QString *error=0, QCString *dcopService=0, int *pid = 0, const QCString &startup_id = "", bool noWait = false );
+  static int startServiceByDesktopName( const QString& _name, const QString &URL,
+                QString *error=0, QCString *dcopService=0, int *pid = 0, const QCString &startup_id = "", bool noWait = false );
+  static int startServiceByDesktopName( const QString& _name, const QStringList &URLs=QStringList(),
+                QString *error=0, QCString *dcopService=0, int *pid = 0, const QCString &startup_id = "", bool noWait = false );
+  static int kdeinitExec( const QString& name, const QStringList &args=QStringList(),
+                QString *error=0, int *pid = 0 );
+  static int kdeinitExecWait( const QString& name, const QStringList &args=QStringList(),
+                QString *error=0, int *pid = 0 );
+  QString caption() const;
+
+
+
+
+  __attribute__ ((deprecated)) KStyle* kstyle() const { return 0; }
+  QString makeStdCaption( const QString &userCaption,
+                          bool withAppName=true, bool modified=false ) const;
+  QString tempSaveName( const QString& pFilename ) const;
+  QString checkRecoverFile( const QString& pFilename, bool& bRecover ) const;
+
+
+
+
+
+
+  Display *getDisplay() { return display; }
+  void enableStyles();
+  void disableStyles();
+  void installX11EventFilter( QWidget* filter );
+
+
+
+
+
+  void removeX11EventFilter( const QWidget* filter );
+
+
+
+
+
+  static int random();
+
+
+
+
+
+
+  static QString randomString(int length);
+  void addKipcEventMask(int id);
+  void removeKipcEventMask(int id);
+
+
+
+
+
+
+  QCString startupId() const;
+
+
+
+
+
+
+  void setStartupId( const QCString& startup_id );
+
+
+
+
+
+
+  QString geometryArgument() const;
+
+
+
+
+
+  void installKDEPropertyMap();
+
+
+
+
+
+
+  bool authorize(const QString &genericAction);
+  bool authorizeKAction(const char *action);
+  bool authorizeURLAction(const QString &action, const KURL &baseURL, const KURL &destURL);
+
+
+
+  enum { ShiftModifier = 1<<0,
+         LockModifier = 1<<1,
+         ControlModifier = 1<<2,
+         Modifier1 = 1<<3,
+         Modifier2 = 1<<4,
+         Modifier3 = 1<<5,
+         Modifier4 = 1<<6,
+         Modifier5 = 1<<7 };
+  static uint keyboardModifiers();
+
+
+  enum { Button1Pressed = 1<<8,
+         Button2Pressed = 1<<9,
+         Button3Pressed = 1<<10,
+         Button4Pressed = 1<<11,
+         Button5Pressed = 1<<12 };
+  static uint mouseState();
+
+
+public :
+
+
+
+
+
+
+  void ref();
+
+
+
+
+
+  void deref();
+
+protected:
+
+
+
+  KApplication( bool allowStyles, bool GUIenabled, KInstance* _instance );
+
+
+
+
+
+  bool x11EventFilter( XEvent * );
+
+  Display *display;
+
+  Atom kipcCommAtom;
+  int kipcEventMask;
+
+
+  static KApplication *KApp;
+  int pArgc;
+  void invokeEditSlot( const char *slot );
+
+private :
+  void dcopFailure(const QString &);
+  void dcopBlockUserInput( bool );
+  void x11FilterDestroyed();
+
+private:
+  QString sessionConfigName() const;
+  KConfig* pSessionConfig;
+  static DCOPClient *s_DCOPClient;
+  static bool s_dcopClientNeedsPostInit;
+  QString aCaption;
+  bool bSessionManagement;
+  QPixmap aIconPixmap;
+  QPixmap aMiniIconPixmap;
+  QString aIconName;
+  QString aMiniIconName;
+  bool useStyles;
+  QWidget *smw;
+
+  void init( bool GUIenabled );
+
+  void parseCommandLine( );
+
+  void read_app_startup_id();
+
+  void dcopAutoRegistration();
+  void dcopClientPostInit();
+  void initUrlActionRestrictions();
+
+public:
+
+
+
+  bool notify(QObject *receiver, QEvent *event);
+
+
+
+
+  int xErrhandler( Display*, void* );
+
+
+
+
+  int xioErrhandler( Display* );
+
+
+
+
+  void iceIOErrorHandler( _IceConn *conn );
+
+
+
+
+  static bool loadedByKdeinit;
+
+
+
+
+  static void startKdeinit();
+
+
+
+
+  enum SettingsCategory { SETTINGS_MOUSE, SETTINGS_COMPLETION, SETTINGS_PATHS,
+         SETTINGS_POPUPMENU, SETTINGS_QT, SETTINGS_SHORTCUTS };
+  static QPalette createApplicationPalette();
+
+
+
+
+
+  static QPalette createApplicationPalette( KConfig *config, int contrast );
+  static void installSigpipeHandler();
+
+protected:
+
+
+
+
+
+
+  void kdisplayPaletteChanged();
+  void kdisplayStyleChanged();
+  void kdisplayFontChanged();
+
+
+
+
+
+
+  void appearanceChanged();
+
+
+
+
+  void toolbarAppearanceChanged(int);
+
+
+
+
+
+
+  void backgroundChanged(int desk);
+
+
+
+
+
+
+
+  void settingsChanged(int category);
+
+
+
+
+
+  void iconChanged(int group);
+  void kipcMessage(int id, int data);
+  void saveYourself();
+  void shutDown();
+
+private:
+  void propagateSettings(SettingsCategory category);
+  void kdisplaySetPalette();
+  void kdisplaySetStyle();
+  void kdisplaySetFont();
+  void applyGUIStyle();
+  static void sigpipeHandler(int);
+
+  int captionLayout;
+
+  KApplication(const KApplication&);
+  KApplication& operator=(const KApplication&);
+protected:
+  virtual void virtual_hook( int id, void* data );
+private:
+  KApplicationPrivate* d;
+};
+bool checkAccess(const QString& pathname, int mode);
+
+class KSessionManagedPrivate;
+class KSessionManaged
+{
+public:
+  KSessionManaged();
+  virtual ~KSessionManaged();
+  virtual bool saveState( QSessionManager& sm );
+  virtual bool commitData( QSessionManager& sm );
+
+protected:
+  virtual void virtual_hook( int id, void* data );
+private:
+  KSessionManagedPrivate *d;
+};
+
+
+
+
+class KCharsets;
+class KConfig;
+class KIconLoader;
+class KLocale;
+class KStandardDirs;
+class KStaticDeleterBase;
+class KStaticDeleterList;
+class KStringDict;
+class QString;
+class KGlobal
+{
+public:
+
+
+
+
+
+
+
+    static KInstance *instance();
+
+
+
+
+
+    static KStandardDirs *dirs();
+
+
+
+
+
+    static KConfig *config();
+
+
+
+
+
+    static KIconLoader *iconLoader();
+
+
+
+
+
+    static KLocale *locale();
+
+
+
+
+
+    static KCharsets *charsets();
+    static const QString &staticQString(const char *str);
+    static const QString &staticQString(const QString &str);
+
+
+
+
+
+
+
+    static void registerStaticDeleter(KStaticDeleterBase *d);
+
+
+
+
+
+
+
+    static void unregisterStaticDeleter(KStaticDeleterBase *d);
+
+
+
+
+
+
+
+    static void deleteStaticDeleters();
+
+
+    static KStringDict *_stringDict;
+    static KInstance *_instance;
+    static KLocale *_locale;
+    static KCharsets *_charsets;
+    static KStaticDeleterList *_staticDeleters;
+
+
+
+
+
+
+
+    static void setActiveInstance(KInstance *d);
+    static KInstance *activeInstance() { return _activeInstance; }
+
+    static KInstance *_activeInstance;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+template<class T>
+inline const T& kMin (const T& a, const T& b) { return a < b ? a : b; }
+
+template<class T>
+inline const T& kMax (const T& a, const T& b) { return b < a ? a : b; }
+
+template<class T>
+inline T kAbs (const T& a) { return a < 0 ? -a : a; }
+
+
+
+
+
+
+class KConfig;
+class KStandardDirsPrivate;
+class KStandardDirs
+{
+public:
+
+
+
+        KStandardDirs( );
+
+
+
+
+        virtual ~KStandardDirs();
+        void addPrefix( const QString& dir );
+        void addXdgConfigPrefix( const QString& dir );
+        void addXdgDataPrefix( const QString& dir );
+        bool addResourceType( const char *type,
+                              const QString& relativename );
+        bool addResourceDir( const char *type,
+                             const QString& absdir);
+        QString findResource( const char *type,
+                              const QString& filename ) const;
+        bool isRestrictedResource( const char *type,
+                              const QString& relPath=QString::null ) const;
+        Q_UINT32 calcResourceHash( const char *type,
+                              const QString& filename, bool deep) const;
+        QStringList findDirs( const char *type,
+                              const QString& reldir ) const;
+        QString findResourceDir( const char *type,
+                                 const QString& filename) const;
+        QStringList findAllResources( const char *type,
+                                       const QString& filter = QString::null,
+                                       bool recursive = false,
+                                       bool uniq = false) const;
+        QStringList findAllResources( const char *type,
+                                       const QString& filter,
+                                       bool recursive,
+                                       bool uniq,
+                                       QStringList &relPaths) const;
+        static QString findExe( const QString& appname,
+                                const QString& pathstr=QString::null,
+                                bool ignoreExecBit=false );
+        static int findAllExe( QStringList& list, const QString& appname,
+                               const QString& pathstr=QString::null,
+                               bool ignoreExecBit=false );
+        void addKDEDefaults();
+        bool addCustomized(KConfig *config);
+        QStringList resourceDirs(const char *type) const;
+
+
+
+
+
+
+
+        QStringList allTypes() const;
+         QString saveLocation(const char *type,
+                              const QString& suffix = QString::null,
+                              bool create = true) const;
+         QString relativeLocation(const char *type, const QString &absPath);
+        static bool makeDir(const QString& dir, int mode = 0755);
+        static QString kde_default(const char *type);
+
+
+
+
+        QString kfsstnd_prefixes();
+
+
+
+
+
+
+
+        QString localkdedir() const;
+
+
+
+
+
+        QString localxdgdatadir() const;
+
+
+
+
+
+        QString localxdgconfdir() const;
+
+
+
+
+
+
+
+        static bool exists(const QString &fullPath);
+        static QString realPath(const QString &dirname);
+ private:
+
+        QStringList prefixes;
+
+
+        QDict<QStringList> absolutes;
+        QDict<QStringList> relatives;
+
+        mutable QDict<QStringList> dircache;
+        mutable QDict<QString> savelocations;
+
+
+        KStandardDirs( const KStandardDirs& );
+        KStandardDirs& operator= ( const KStandardDirs& );
+
+        bool addedCustoms;
+
+        class KStandardDirsPrivate;
+        KStandardDirsPrivate *d;
+
+        void checkConfig() const;
+        void applyDataRestrictions(const QString &) const;
+        void createSpecialResource(const char*);
+};
+QString locate( const char *type, const QString& filename, const KInstance* instance = KGlobal::instance() );
+QString locateLocal( const char *type, const QString& filename, const KInstance* instance = KGlobal::instance() );
+QString locateLocal( const char *type, const QString& filename, bool createDir, const KInstance* instance = KGlobal::instance() );
+
+
+
+class QWidget;
+class QDateTime;
+class QDate;
+class QTime;
+class QPoint;
+class QSize;
+class QRect;
+class QRegion;
+class KURL;
+class QStringList;
+class QColor;
+class QPen;
+class QBrush;
+
+class kdbgstream;
+class kndbgstream;
+typedef kdbgstream & (*KDBGFUNC)(kdbgstream &);
+typedef kndbgstream & (*KNDBGFUNC)(kndbgstream &);
+
+
+
+
+
+
+
+class kdbgstreamprivate;
+class kdbgstream {
+ public:
+
+
+
+    kdbgstream(unsigned int _area, unsigned int _level, bool _print = true) :
+      area(_area), level(_level), print(_print) { }
+    kdbgstream(const char * initialString, unsigned int _area, unsigned int _level, bool _print = true) :
+      output(QString::fromLatin1(initialString)), area(_area), level(_level), print(_print) { }
+
+    kdbgstream(kdbgstream &str) :
+      output(str.output), area(str.area), level(str.level), print(str.print) { str.output.truncate(0); }
+    kdbgstream(const kdbgstream &str) :
+      output(str.output), area(str.area), level(str.level), print(str.print) {}
+    ~kdbgstream();
+
+
+
+
+
+    kdbgstream &operator<<(bool i) {
+        if (!print) return *this;
+        output += QString::fromLatin1(i ? "true" : "false");
+        return *this;
+    }
+
+
+
+
+
+    kdbgstream &operator<<(short i) {
+        if (!print) return *this;
+        QString tmp; tmp.setNum(i); output += tmp;
+        return *this;
+    }
+
+
+
+
+
+    kdbgstream &operator<<(unsigned short i) {
+        if (!print) return *this;
+        QString tmp; tmp.setNum(i); output += tmp;
+        return *this;
+    }
+
+
+
+
+
+    kdbgstream &operator<<(char i);
+
+
+
+
+
+    kdbgstream &operator<<(unsigned char i) {
+        return operator<<( static_cast<char>( i ) );
+    }
+
+
+
+
+
+    kdbgstream &operator<<(int i) {
+        if (!print) return *this;
+        QString tmp; tmp.setNum(i); output += tmp;
+        return *this;
+    }
+
+
+
+
+
+    kdbgstream &operator<<(unsigned int i) {
+        if (!print) return *this;
+        QString tmp; tmp.setNum(i); output += tmp;
+        return *this;
+    }
+
+
+
+
+
+    kdbgstream &operator<<(long i) {
+        if (!print) return *this;
+        QString tmp; tmp.setNum(i); output += tmp;
+        return *this;
+    }
+
+
+
+
+
+    kdbgstream &operator<<(unsigned long i) {
+        if (!print) return *this;
+        QString tmp; tmp.setNum(i); output += tmp;
+        return *this;
+    }
+
+
+
+    void flush();
+
+
+
+
+
+
+    kdbgstream &operator<<(const QString& string) {
+        if (!print) return *this;
+        output += string;
+        if (output.at(output.length() -1 ) == '\n')
+            flush();
+        return *this;
+    }
+
+
+
+
+
+    kdbgstream &operator<<(const char *string) {
+        if (!print) return *this;
+        output += QString::fromUtf8(string);
+        if (output.at(output.length() - 1) == '\n')
+            flush();
+        return *this;
+    }
+
+
+
+
+
+    kdbgstream &operator<<(const QCString& string) {
+        *this << string.data();
+        return *this;
+    }
+
+
+
+
+
+    kdbgstream& operator<<(const void * p) {
+        form("%p", p);
+        return *this;
+    }
+
+
+
+
+
+    kdbgstream& operator<<(KDBGFUNC f) {
+        if (!print) return *this;
+        return (*f)(*this);
+    }
+
+
+
+
+
+    kdbgstream& operator<<(double d) {
+      QString tmp; tmp.setNum(d); output += tmp;
+      return *this;
+    }
+
+
+
+
+
+
+    kdbgstream &form(const char *format, ...)
+
+      __attribute__ ( ( format ( printf, 2, 3 ) ) )
+
+     ;
+
+
+
+
+
+
+    kdbgstream& operator << (const QWidget* widget);
+    kdbgstream& operator << (QWidget* widget);
+
+
+
+
+
+
+    kdbgstream& operator << ( const QDateTime& dateTime );
+
+
+
+
+
+
+    kdbgstream& operator << ( const QDate& date );
+
+
+
+
+
+
+    kdbgstream& operator << ( const QTime& time );
+
+
+
+
+
+
+    kdbgstream& operator << ( const QPoint& point );
+
+
+
+
+
+
+    kdbgstream& operator << ( const QSize& size );
+
+
+
+
+
+
+    kdbgstream& operator << ( const QRect& rect);
+
+
+
+
+
+
+    kdbgstream& operator << ( const QRegion& region);
+
+
+
+
+
+
+    kdbgstream& operator << ( const KURL& url );
+
+
+
+
+
+
+    kdbgstream& operator << ( const QStringList& list);
+
+
+
+
+
+
+    kdbgstream& operator << ( const QColor& color);
+
+
+
+
+
+
+
+    kdbgstream& operator << ( const QPen& pen );
+
+
+
+
+
+
+    kdbgstream& operator << ( const QBrush& brush );
+
+
+ private:
+    QString output;
+    unsigned int area, level;
+    bool print;
+    kdbgstreamprivate* d;
+};
+
+
+
+
+
+
+
+inline kdbgstream &endl( kdbgstream &s) { s << "\n"; return s; }
+
+
+
+
+
+
+
+inline kdbgstream &flush( kdbgstream &s) { s.flush(); return s; }
+
+kdbgstream &perror( kdbgstream &s);
+
+
+
+
+
+
+
+class kndbgstream {
+ public:
+
+    kndbgstream() {}
+    ~kndbgstream() {}
+
+
+
+
+    kndbgstream &operator<<(short int ) { return *this; }
+
+
+
+
+    kndbgstream &operator<<(unsigned short int ) { return *this; }
+
+
+
+
+    kndbgstream &operator<<(char ) { return *this; }
+
+
+
+
+    kndbgstream &operator<<(unsigned char ) { return *this; }
+
+
+
+
+    kndbgstream &operator<<(int ) { return *this; }
+
+
+
+
+    kndbgstream &operator<<(unsigned int ) { return *this; }
+
+
+
+    void flush() {}
+
+
+
+
+    kndbgstream &operator<<(const QString& ) { return *this; }
+
+
+
+
+    kndbgstream &operator<<(const QCString& ) { return *this; }
+
+
+
+
+    kndbgstream &operator<<(const char *) { return *this; }
+
+
+
+
+    kndbgstream& operator<<(const void *) { return *this; }
+
+
+
+
+    kndbgstream& operator<<(void *) { return *this; }
+
+
+
+
+    kndbgstream& operator<<(double) { return *this; }
+
+
+
+
+    kndbgstream& operator<<(long) { return *this; }
+
+
+
+
+    kndbgstream& operator<<(unsigned long) { return *this; }
+
+
+
+
+    kndbgstream& operator<<(KNDBGFUNC) { return *this; }
+
+
+
+
+    kndbgstream& operator << (const QWidget*) { return *this; }
+    kndbgstream& operator << (QWidget*) { return *this; }
+
+
+
+
+    kndbgstream &form(const char *, ...) { return *this; }
+
+    kndbgstream& operator<<( const QDateTime& ) { return *this; }
+    kndbgstream& operator<<( const QDate& ) { return *this; }
+    kndbgstream& operator<<( const QTime& ) { return *this; }
+    kndbgstream& operator<<( const QPoint & ) { return *this; }
+    kndbgstream& operator<<( const QSize & ) { return *this; }
+    kndbgstream& operator<<( const QRect & ) { return *this; }
+    kndbgstream& operator<<( const QRegion & ) { return *this; }
+    kndbgstream& operator<<( const KURL & ) { return *this; }
+    kndbgstream& operator<<( const QStringList & ) { return *this; }
+    kndbgstream& operator<<( const QColor & ) { return *this; }
+    kndbgstream& operator<<( const QPen & ) { return *this; }
+    kndbgstream& operator<<( const QBrush & ) { return *this; }
+};
+
+
+
+
+
+
+inline kndbgstream &endl( kndbgstream & s) { return s; }
+
+
+
+
+
+inline kndbgstream &flush( kndbgstream & s) { return s; }
+inline kndbgstream &perror( kndbgstream & s) { return s; }
+kdbgstream kdDebug(int area = 0);
+kdbgstream kdDebug(bool cond, int area = 0);
+
+
+
+
+
+QString kdBacktrace();
+
+
+
+
+
+
+
+QString kdBacktrace(int levels);
+
+
+
+
+
+inline kndbgstream kndDebug(int area = 0) { (void)area;; return kndbgstream(); }
+inline kndbgstream kndDebug(bool , int = 0) { return kndbgstream(); }
+inline QString kndBacktrace() { return QString::null; }
+inline QString kndBacktrace(int) { return QString::null; }
+
+
+
+
+
+
+
+kdbgstream kdWarning(int area = 0);
+kdbgstream kdWarning(bool cond, int area = 0);
+
+
+
+
+
+
+kdbgstream kdError(int area = 0);
+kdbgstream kdError(bool cond, int area = 0);
+
+
+
+
+
+
+kdbgstream kdFatal(int area = 0);
+kdbgstream kdFatal(bool cond, int area = 0);
+
+
+
+
+
+
+void kdClearDebugConfig();
+
+
+
+
+class QStringList;
+class QTextCodec;
+class QDate;
+class QTime;
+class QDateTime;
+
+class KGlobal;
+class KConfig;
+class KConfigBase;
+class KLocalePrivate;
+class KCatalogue;
+class KCalendarSystem;
+
+
+
+
+
+
+
+QString i18n(const char *text);
+QString i18n(const char *index, const char *text);
+
+
+
+
+
+
+
+QString i18n(const char *singular, const char *plural, unsigned long n);
+
+
+
+
+
+
+
+inline QString tr2i18n(const char* message, const char* =0) {
+  return i18n(message);
+}
+class KLocale
+{
+  friend class KGlobal;
+public:
+  KLocale( const QString& catalogue, KConfig *config = 0 );
+
+
+
+
+  KLocale( const KLocale & rhs );
+
+
+
+
+  KLocale& operator= ( const KLocale & rhs );
+
+
+
+
+  ~KLocale();
+  QString translate( const char *index ) const;
+  QString translate( const char *index, const char *fallback) const;
+  QString translate( const char *singular, const char *plural,
+                     unsigned long n) const;
+  bool setEncoding(int mibEnum);
+  bool setLanguage(const QString & language);
+  bool setLanguage(const QStringList & languages);
+  bool setCountry(const QString & country);
+
+
+
+
+
+  enum SignPosition { ParensAround = 0, BeforeQuantityMoney = 1,
+                      AfterQuantityMoney = 2,
+                      BeforeMoney = 3, AfterMoney = 4 };
+
+
+
+
+
+
+
+  QString decimalSymbol() const;
+  QString thousandsSeparator() const;
+
+
+
+
+
+
+
+  QString currencySymbol() const;
+  QString monetaryDecimalSymbol() const;
+  QString monetaryThousandsSeparator() const;
+
+
+
+
+
+
+
+  QString positiveSign() const;
+
+
+
+
+
+
+
+  QString negativeSign() const;
+
+
+
+
+
+
+
+  int fracDigits() const;
+
+
+
+
+
+
+
+  bool positivePrefixCurrencySymbol() const;
+
+
+
+
+
+
+
+  bool negativePrefixCurrencySymbol() const;
+  SignPosition positiveMonetarySignPosition() const;
+  SignPosition negativeMonetarySignPosition() const;
+  QString formatMoney(double num,
+                      const QString & currency = QString::null,
+                      int digits = -1) const;
+  QString formatNumber(double num, int precision = -1) const;
+  QString formatLong(long num) const;
+   bool nounDeclension() const;
+  QString formatDate(const QDate &pDate, bool shortFormat = false) const;
+  bool dateMonthNamePossessive() const;
+  QString formatTime(const QTime &pTime, bool includeSecs = false) const;
+
+
+
+
+
+
+  bool use12Clock() const;
+  bool weekStartsMonday() const ;
+
+
+
+
+
+
+
+  int weekStartDay() const;
+  QString monthName(int i, bool shortName = false) const ;
+  QString monthNamePossessive(int i, bool shortName = false) const ;
+  QString weekDayName(int i, bool shortName = false) const ;
+
+
+
+
+
+
+
+  const KCalendarSystem * calendar() const;
+  QString calendarType() const;
+  void setCalendar(const QString & calendarType);
+  QString formatDateTime(const QDateTime &pDateTime,
+                         bool shortFormat = true,
+                         bool includeSecs = false) const;
+  double readMoney(const QString &numStr, bool * ok = 0) const;
+  double readNumber(const QString &numStr, bool * ok = 0) const;
+  QDate readDate(const QString &str, bool* ok = 0) const;
+
+
+
+
+
+  QDate readDate( const QString &intstr, const QString &fmt, bool* ok = 0) const;
+
+  enum ReadDateFlags {
+      NormalFormat = 1,
+      ShortFormat = 2
+  };
+  QDate readDate(const QString &str, ReadDateFlags flags, bool *ok = 0) const;
+  QTime readTime(const QString &str, bool* ok = 0) const;
+
+  enum ReadTimeFlags {
+      WithSeconds = 0,
+      WithoutSeconds = 1
+  };
+  QTime readTime(const QString &str, ReadTimeFlags flags, bool *ok = 0) const;
+  QString language() const;
+
+
+
+
+
+
+
+  QString country() const;
+  QStringList languagesTwoAlpha() const;
+  QStringList languageList() const;
+  const char * encoding() const;
+  int encodingMib() const;
+  QTextCodec * codecForEncoding() const;
+  int fileEncodingMib() const;
+  void setDateFormat(const QString & format);
+  void setDateFormatShort(const QString & format);
+
+
+
+
+
+
+  void setDateMonthNamePossessive(bool possessive);
+  void setTimeFormat(const QString & format);
+  void setWeekStartsMonday(bool start) ;
+
+
+
+
+
+
+
+  void setWeekStartDay(int day);
+
+
+
+
+
+
+  QString dateFormat() const;
+
+
+
+
+
+
+  QString dateFormatShort() const;
+
+
+
+
+
+
+  QString timeFormat() const;
+
+
+
+
+
+
+  void setDecimalSymbol(const QString & symbol);
+
+
+
+
+
+  void setThousandsSeparator(const QString & separator);
+
+
+
+
+
+
+  void setPositiveSign(const QString & sign);
+
+
+
+
+
+  void setNegativeSign(const QString & sign);
+
+
+
+
+
+  void setPositiveMonetarySignPosition(SignPosition signpos);
+
+
+
+
+
+  void setNegativeMonetarySignPosition(SignPosition signpos);
+
+
+
+
+
+
+
+  void setPositivePrefixCurrencySymbol(bool prefix);
+
+
+
+
+
+
+
+  void setNegativePrefixCurrencySymbol(bool prefix);
+
+
+
+
+
+  void setFracDigits(int digits);
+
+
+
+
+
+  void setMonetaryThousandsSeparator(const QString & separator);
+
+
+
+
+
+
+  void setMonetaryDecimalSymbol(const QString & symbol);
+
+
+
+
+
+  void setCurrencySymbol(const QString & symbol);
+
+
+
+
+
+
+  int pageSize() const;
+
+
+
+
+
+
+  void setPageSize(int paperFormat);
+
+
+
+
+
+  enum MeasureSystem { Metric, Imperial };
+
+
+
+
+
+
+  MeasureSystem measureSystem() const;
+
+
+
+
+
+
+  void setMeasureSystem(MeasureSystem value);
+  void insertCatalogue(const QString& catalogue);
+
+
+
+
+
+
+  void removeCatalogue(const QString &catalogue);
+
+
+
+
+
+  void setActiveCatalogue(const QString &catalogue);
+
+
+
+
+
+
+
+  QString translateQt(const char *context,
+                      const char *sourceText,
+                      const char *message) const;
+
+
+
+
+
+
+  QStringList allLanguagesTwoAlpha() const;
+
+
+
+
+
+
+
+  QString twoAlphaToLanguageName(const QString &code) const;
+
+
+
+
+
+
+  QStringList allCountriesTwoAlpha() const;
+
+
+
+
+
+
+
+  QString twoAlphaToCountryName(const QString &code) const;
+  static void splitLocale(const QString & str,
+                          QString & language,
+                          QString & country,
+                          QString & charset);
+  static void setMainCatalogue(const char *catalogue);
+
+
+
+
+
+
+
+  static QString langLookup(const QString &fname, const char *rtype = "html");
+
+
+
+
+
+
+  static QString defaultLanguage();
+
+
+
+
+
+
+  static QString defaultCountry();
+
+
+
+
+
+  static QString _initLanguage(KConfigBase *config);
+  QString formatMoney(const QString &numStr) const ;
+
+
+
+
+
+  QString formatNumber(const QString &numStr) const;
+
+
+
+
+
+
+
+  QString languages() const __attribute__ ((deprecated));
+
+
+
+
+
+  bool setCharset(const QString & charset) __attribute__ ((deprecated));
+
+
+
+
+
+  QString charset() const __attribute__ ((deprecated));
+
+protected:
+
+
+
+
+  static void initInstance();
+
+private:
+
+
+
+
+
+
+  void initFormat(KConfig *config);
+  void initLanguage(KConfig * config, bool useEnv);
+
+
+
+
+
+
+  void initEncoding(KConfig * config);
+
+
+
+
+
+
+  void initCatalogue(const QString & catalogue);
+
+
+
+
+
+  void initFileNameEncoding(KConfig *config);
+
+
+
+
+  static QCString encodeFileNameUTF8( const QString & fileName );
+
+
+
+
+  static QString decodeFileNameUTF8( const QCString & localFileName );
+
+
+
+
+
+  void initCatalogue( KCatalogue & catalogue );
+
+
+
+
+  void doBindInit();
+
+
+
+
+  void doFormatInit() const;
+
+
+
+
+  void initFormat();
+
+
+
+
+  QString translate_priv(const char *index,
+                         const char *text,
+                         const char ** original = 0) const;
+
+
+
+
+  bool useDefaultLanguage() const;
+
+
+
+
+  bool isLanguageInstalled(const QString & language) const;
+
+
+
+
+
+  static QString catalogueFileName(const QString & language,
+                                   const KCatalogue & catalogue);
+
+private:
+
+  QString m_decimalSymbol;
+  QString m_thousandsSeparator;
+  QString m_currencySymbol;
+  QString m_monetaryDecimalSymbol;
+  QString m_monetaryThousandsSeparator;
+  QString m_positiveSign;
+  QString m_negativeSign;
+  int m_fracDigits;
+  SignPosition m_positiveMonetarySignPosition;
+  SignPosition m_negativeMonetarySignPosition;
+
+
+  QString m_timeFormat;
+  QString m_dateFormat;
+  QString m_dateFormatShort;
+
+  QString m_language;
+  QString m_country;
+
+  bool m_weekStartsMonday;
+  bool m_positivePrefixCurrencySymbol;
+  bool m_negativePrefixCurrencySymbol;
+
+  KLocalePrivate *d;
+};
+
+
+
+
+
+
+
+
+class QPopupMenu;
+class QStylePrivate;
+class QMenuItem;
+class QTab;
+class QListViewItem;
+class QCheckListItem;
+
+class QStyleOption {
+public:
+    enum StyleOptionDefault { Default };
+
+    QStyleOption(StyleOptionDefault=Default) : def(TRUE) {}
+
+
+
+    QStyleOption(int in1) :
+        def(FALSE), i1(in1) {}
+    QStyleOption(int in1, int in2) :
+        def(FALSE), i1(in1), i2(in2) {}
+    QStyleOption(int in1, int in2, int in3, int in4) :
+        def(FALSE), i1(in1), i2(in2), i3(in3), i4(in4) {}
+    QStyleOption(QMenuItem* m) : def(FALSE), mi(m) {}
+    QStyleOption(QMenuItem* m, int in1) : def(FALSE), mi(m), i1(in1) {}
+    QStyleOption(QMenuItem* m, int in1, int in2) : def(FALSE), mi(m), i1(in1), i2(in2) {}
+    QStyleOption(const QColor& c) : def(FALSE), cl(&c) {}
+    QStyleOption(QTab* t) : def(FALSE), tb(t) {}
+    QStyleOption(QListViewItem* i) : def(FALSE), li(i) {}
+    QStyleOption(QCheckListItem* i) : def(FALSE), cli(i) {}
+    QStyleOption(Qt::ArrowType a) : def(FALSE), i1((int)a) {}
+    QStyleOption(const QRect& r) : def(FALSE), i1(r.x()), i2(r.y()), i3(r.width()),i4(r.height()){}
+    QStyleOption(QWidget *w) : def(FALSE), p1((void*)w) {}
+
+    bool isDefault() const { return def; }
+
+    int lineWidth() const { return i1; }
+    int midLineWidth() const { return i2; }
+    int frameShape() const { return i3; }
+    int frameShadow() const { return i4; }
+
+    int headerSection() const { return i1; }
+    QMenuItem* menuItem() const { return mi; }
+    int maxIconWidth() const { return i1; }
+    int tabWidth() const { return i2; }
+
+    const QColor& color() const { return *cl; }
+
+    QTab* tab() const { return tb; }
+
+    QCheckListItem* checkListItem() const { return cli; }
+    QListViewItem* listViewItem() const { return li; }
+
+    Qt::ArrowType arrowType() const { return (Qt::ArrowType)i1; }
+    QRect rect() const { return QRect( i1, i2, i3, i4 ); }
+    QWidget* widget() const { return (QWidget*)p1; }
+
+private:
+
+    bool def;
+    bool b1,b2,b3;
+    QMenuItem* mi;
+    QTab* tb;
+    QListViewItem* li;
+    const QColor* cl;
+    int i1, i2, i3, i4;
+    int i5, i6;
+    QCheckListItem* cli;
+    void *p1, *p2, *p3, *p4;
+
+};
+
+class QStyleHintReturn;
+
+class QStyle: public QObject
+{
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+
+public:
+    QStyle();
+    virtual ~QStyle();
+
+
+
+    virtual void polish( QWidget * );
+    virtual void unPolish( QWidget * );
+
+    virtual void polish( QApplication * );
+    virtual void unPolish( QApplication * );
+
+    virtual void polish( QPalette & );
+
+    virtual void polishPopupMenu( QPopupMenu* ) = 0;
+
+    virtual QRect itemRect( QPainter *p, const QRect &r,
+                            int flags, bool enabled,
+                            const QPixmap *pixmap,
+                            const QString &text, int len = -1 ) const;
+
+    virtual void drawItem( QPainter *p, const QRect &r,
+                           int flags, const QColorGroup &g, bool enabled,
+                           const QPixmap *pixmap, const QString &text,
+                           int len = -1, const QColor *penColor = 0 ) const;
+
+
+    enum PrimitiveElement {
+        PE_ButtonCommand,
+        PE_ButtonDefault,
+        PE_ButtonBevel,
+        PE_ButtonTool,
+        PE_ButtonDropDown,
+
+        PE_FocusRect,
+
+        PE_ArrowUp,
+        PE_ArrowDown,
+        PE_ArrowRight,
+        PE_ArrowLeft,
+
+        PE_SpinWidgetUp,
+        PE_SpinWidgetDown,
+        PE_SpinWidgetPlus,
+        PE_SpinWidgetMinus,
+
+        PE_Indicator,
+        PE_IndicatorMask,
+        PE_ExclusiveIndicator,
+        PE_ExclusiveIndicatorMask,
+
+        PE_DockWindowHandle,
+        PE_DockWindowSeparator,
+        PE_DockWindowResizeHandle,
+
+        PE_Splitter,
+
+        PE_Panel,
+        PE_PanelPopup,
+        PE_PanelMenuBar,
+        PE_PanelDockWindow,
+
+        PE_TabBarBase,
+
+        PE_HeaderSection,
+        PE_HeaderArrow,
+        PE_StatusBarSection,
+
+        PE_GroupBoxFrame,
+
+        PE_Separator,
+
+        PE_SizeGrip,
+
+        PE_CheckMark,
+
+        PE_ScrollBarAddLine,
+        PE_ScrollBarSubLine,
+        PE_ScrollBarAddPage,
+        PE_ScrollBarSubPage,
+        PE_ScrollBarSlider,
+        PE_ScrollBarFirst,
+        PE_ScrollBarLast,
+
+        PE_ProgressBarChunk,
+
+        PE_PanelLineEdit,
+        PE_PanelTabWidget,
+
+        PE_WindowFrame,
+
+        PE_CheckListController,
+        PE_CheckListIndicator,
+        PE_CheckListExclusiveIndicator,
+
+        PE_PanelGroupBox,
+
+
+        PE_CustomBase = 0xf000000
+    };
+
+    enum StyleFlags {
+        Style_Default = 0x00000000,
+        Style_Enabled = 0x00000001,
+        Style_Raised = 0x00000002,
+        Style_Sunken = 0x00000004,
+        Style_Off = 0x00000008,
+        Style_NoChange = 0x00000010,
+        Style_On = 0x00000020,
+        Style_Down = 0x00000040,
+        Style_Horizontal = 0x00000080,
+        Style_HasFocus = 0x00000100,
+        Style_Top = 0x00000200,
+        Style_Bottom = 0x00000400,
+        Style_FocusAtBorder = 0x00000800,
+        Style_AutoRaise = 0x00001000,
+        Style_MouseOver = 0x00002000,
+        Style_Up = 0x00004000,
+        Style_Selected = 0x00008000,
+        Style_Active = 0x00010000,
+        Style_ButtonDefault = 0x00020000
+    };
+    typedef uint SFlags;
+
+    virtual void drawPrimitive( PrimitiveElement pe,
+                                QPainter *p,
+                                const QRect &r,
+                                const QColorGroup &cg,
+                                SFlags flags = Style_Default,
+                                const QStyleOption& = QStyleOption::Default ) const = 0;
+
+
+    enum ControlElement {
+        CE_PushButton,
+        CE_PushButtonLabel,
+
+        CE_CheckBox,
+        CE_CheckBoxLabel,
+
+        CE_RadioButton,
+        CE_RadioButtonLabel,
+
+        CE_TabBarTab,
+        CE_TabBarLabel,
+
+        CE_ProgressBarGroove,
+        CE_ProgressBarContents,
+        CE_ProgressBarLabel,
+
+        CE_PopupMenuItem,
+        CE_MenuBarItem,
+
+        CE_ToolButtonLabel,
+        CE_MenuBarEmptyArea,
+        CE_PopupMenuScroller,
+        CE_DockWindowEmptyArea,
+        CE_PopupMenuVerticalExtra,
+        CE_PopupMenuHorizontalExtra,
+
+        CE_ToolBoxTab,
+        CE_HeaderLabel,
+
+
+        CE_CustomBase = 0xf0000000
+    };
+
+    virtual void drawControl( ControlElement element,
+                              QPainter *p,
+                              const QWidget *widget,
+                              const QRect &r,
+                              const QColorGroup &cg,
+                              SFlags how = Style_Default,
+                              const QStyleOption& = QStyleOption::Default ) const = 0;
+    virtual void drawControlMask( ControlElement element,
+                                  QPainter *p,
+                                  const QWidget *widget,
+                                  const QRect &r,
+                                  const QStyleOption& = QStyleOption::Default ) const = 0;
+
+    enum SubRect {
+        SR_PushButtonContents,
+        SR_PushButtonFocusRect,
+
+        SR_CheckBoxIndicator,
+        SR_CheckBoxContents,
+        SR_CheckBoxFocusRect,
+
+        SR_RadioButtonIndicator,
+        SR_RadioButtonContents,
+        SR_RadioButtonFocusRect,
+
+        SR_ComboBoxFocusRect,
+
+        SR_SliderFocusRect,
+
+        SR_DockWindowHandleRect,
+
+        SR_ProgressBarGroove,
+        SR_ProgressBarContents,
+        SR_ProgressBarLabel,
+
+        SR_ToolButtonContents,
+
+        SR_DialogButtonAccept,
+        SR_DialogButtonReject,
+        SR_DialogButtonApply,
+        SR_DialogButtonHelp,
+        SR_DialogButtonAll,
+        SR_DialogButtonAbort,
+        SR_DialogButtonIgnore,
+        SR_DialogButtonRetry,
+        SR_DialogButtonCustom,
+
+        SR_ToolBoxTabContents,
+
+
+        SR_CustomBase = 0xf0000000
+    };
+
+    virtual QRect subRect( SubRect r, const QWidget *widget ) const = 0;
+
+
+    enum ComplexControl{
+        CC_SpinWidget,
+        CC_ComboBox,
+        CC_ScrollBar,
+        CC_Slider,
+        CC_ToolButton,
+        CC_TitleBar,
+        CC_ListView,
+
+
+        CC_CustomBase = 0xf0000000
+    };
+
+    enum SubControl {
+        SC_None = 0x00000000,
+
+        SC_ScrollBarAddLine = 0x00000001,
+        SC_ScrollBarSubLine = 0x00000002,
+        SC_ScrollBarAddPage = 0x00000004,
+        SC_ScrollBarSubPage = 0x00000008,
+        SC_ScrollBarFirst = 0x00000010,
+        SC_ScrollBarLast = 0x00000020,
+        SC_ScrollBarSlider = 0x00000040,
+        SC_ScrollBarGroove = 0x00000080,
+
+        SC_SpinWidgetUp = 0x00000001,
+        SC_SpinWidgetDown = 0x00000002,
+        SC_SpinWidgetFrame = 0x00000004,
+        SC_SpinWidgetEditField = 0x00000008,
+        SC_SpinWidgetButtonField = 0x00000010,
+
+        SC_ComboBoxFrame = 0x00000001,
+        SC_ComboBoxEditField = 0x00000002,
+        SC_ComboBoxArrow = 0x00000004,
+        SC_ComboBoxListBoxPopup = 0x00000008,
+
+        SC_SliderGroove = 0x00000001,
+        SC_SliderHandle = 0x00000002,
+        SC_SliderTickmarks = 0x00000004,
+
+        SC_ToolButton = 0x00000001,
+        SC_ToolButtonMenu = 0x00000002,
+
+        SC_TitleBarLabel = 0x00000001,
+        SC_TitleBarSysMenu = 0x00000002,
+        SC_TitleBarMinButton = 0x00000004,
+        SC_TitleBarMaxButton = 0x00000008,
+        SC_TitleBarCloseButton = 0x00000010,
+        SC_TitleBarNormalButton = 0x00000020,
+        SC_TitleBarShadeButton = 0x00000040,
+        SC_TitleBarUnshadeButton = 0x00000080,
+
+        SC_ListView = 0x00000001,
+        SC_ListViewBranch = 0x00000002,
+        SC_ListViewExpand = 0x00000004,
+
+        SC_All = 0xffffffff
+    };
+    typedef uint SCFlags;
+
+
+    virtual void drawComplexControl( ComplexControl control,
+                                     QPainter *p,
+                                     const QWidget *widget,
+                                     const QRect &r,
+                                     const QColorGroup &cg,
+                                     SFlags how = Style_Default,
+                                     SCFlags sub = SC_All,
+                                     SCFlags subActive = SC_None,
+                                     const QStyleOption& = QStyleOption::Default ) const = 0;
+    virtual void drawComplexControlMask( ComplexControl control,
+                                         QPainter *p,
+                                         const QWidget *widget,
+                                         const QRect &r,
+                                         const QStyleOption& = QStyleOption::Default ) const = 0;
+
+    virtual QRect querySubControlMetrics( ComplexControl control,
+                                          const QWidget *widget,
+                                          SubControl sc,
+                                          const QStyleOption& = QStyleOption::Default ) const = 0;
+    virtual SubControl querySubControl( ComplexControl control,
+                                        const QWidget *widget,
+                                        const QPoint &pos,
+                                        const QStyleOption& = QStyleOption::Default ) const = 0;
+
+
+    enum PixelMetric {
+        PM_ButtonMargin,
+        PM_ButtonDefaultIndicator,
+        PM_MenuButtonIndicator,
+        PM_ButtonShiftHorizontal,
+        PM_ButtonShiftVertical,
+
+        PM_DefaultFrameWidth,
+        PM_SpinBoxFrameWidth,
+
+        PM_MaximumDragDistance,
+
+        PM_ScrollBarExtent,
+        PM_ScrollBarSliderMin,
+
+        PM_SliderThickness,
+        PM_SliderControlThickness,
+        PM_SliderLength,
+        PM_SliderTickmarkOffset,
+        PM_SliderSpaceAvailable,
+
+        PM_DockWindowSeparatorExtent,
+        PM_DockWindowHandleExtent,
+        PM_DockWindowFrameWidth,
+
+        PM_MenuBarFrameWidth,
+
+        PM_TabBarTabOverlap,
+        PM_TabBarTabHSpace,
+        PM_TabBarTabVSpace,
+        PM_TabBarBaseHeight,
+        PM_TabBarBaseOverlap,
+
+        PM_ProgressBarChunkWidth,
+
+        PM_SplitterWidth,
+        PM_TitleBarHeight,
+
+        PM_IndicatorWidth,
+        PM_IndicatorHeight,
+        PM_ExclusiveIndicatorWidth,
+        PM_ExclusiveIndicatorHeight,
+        PM_PopupMenuScrollerHeight,
+        PM_CheckListButtonSize,
+        PM_CheckListControllerSize,
+        PM_PopupMenuFrameHorizontalExtra,
+        PM_PopupMenuFrameVerticalExtra,
+
+        PM_DialogButtonsSeparator,
+        PM_DialogButtonsButtonWidth,
+        PM_DialogButtonsButtonHeight,
+
+        PM_MDIFrameWidth,
+        PM_MDIMinimizedWidth,
+        PM_HeaderMargin,
+        PM_HeaderMarkSize,
+        PM_HeaderGripMargin,
+        PM_TabBarTabShiftHorizontal,
+        PM_TabBarTabShiftVertical,
+
+
+
+        PM_CustomBase = 0xf0000000
+    };
+
+    virtual int pixelMetric( PixelMetric metric,
+                             const QWidget *widget = 0 ) const = 0;
+
+
+    enum ContentsType {
+        CT_PushButton,
+        CT_CheckBox,
+        CT_RadioButton,
+        CT_ToolButton,
+        CT_ComboBox,
+        CT_Splitter,
+        CT_DockWindow,
+        CT_ProgressBar,
+        CT_PopupMenuItem,
+        CT_TabBarTab,
+        CT_Slider,
+        CT_Header,
+        CT_LineEdit,
+        CT_MenuBar,
+        CT_SpinBox,
+        CT_SizeGrip,
+        CT_TabWidget,
+        CT_DialogButtons,
+
+
+        CT_CustomBase = 0xf0000000
+    };
+
+    virtual QSize sizeFromContents( ContentsType contents,
+                                    const QWidget *widget,
+                                    const QSize &contentsSize,
+                                    const QStyleOption& = QStyleOption::Default ) const = 0;
+
+    enum StyleHint {
+
+
+
+
+        SH_EtchDisabledText,
+
+
+        SH_GUIStyle,
+
+
+
+
+        SH_ScrollBar_BackgroundMode,
+        SH_ScrollBar_MiddleClickAbsolutePosition,
+        SH_ScrollBar_ScrollWhenPointerLeavesControl,
+
+
+        SH_TabBar_SelectMouseType,
+
+        SH_TabBar_Alignment,
+
+        SH_Header_ArrowAlignment,
+
+
+        SH_Slider_SnapToValue,
+
+
+
+        SH_Slider_SloppyKeyEvents,
+
+
+
+        SH_ProgressDialog_CenterCancelButton,
+
+
+
+        SH_ProgressDialog_TextLabelAlignment,
+
+
+        SH_PrintDialog_RightAlignButtons,
+
+
+
+        SH_MainWindow_SpaceBelowMenuBar,
+
+
+
+        SH_FontDialog_SelectAssociatedText,
+
+
+        SH_PopupMenu_AllowActiveAndDisabled,
+
+
+        SH_PopupMenu_SpaceActivatesItem,
+
+
+
+        SH_PopupMenu_SubMenuPopupDelay,
+
+
+
+        SH_ScrollView_FrameOnlyAroundContents,
+
+
+
+        SH_MenuBar_AltKeyNavigation,
+
+
+        SH_ComboBox_ListMouseTracking,
+
+
+        SH_PopupMenu_MouseTracking,
+
+
+        SH_MenuBar_MouseTracking,
+
+
+        SH_ItemView_ChangeHighlightOnFocus,
+
+
+        SH_Widget_ShareActivation,
+
+
+        SH_Workspace_FillSpaceOnMaximize,
+
+
+        SH_ComboBox_Popup,
+
+
+        SH_TitleBar_NoBorder,
+
+
+        SH_ScrollBar_StopMouseOverSlider,
+
+
+        SH_BlinkCursorWhenTextSelected,
+
+
+        SH_RichText_FullWidthSelection,
+
+
+        SH_PopupMenu_Scrollable,
+
+
+
+        SH_GroupBox_TextLabelVerticalAlignment,
+
+
+        SH_GroupBox_TextLabelColor,
+
+
+        SH_PopupMenu_SloppySubMenus,
+
+
+        SH_Table_GridLineColor,
+
+
+        SH_LineEdit_PasswordCharacter,
+
+
+        SH_DialogButtons_DefaultButton,
+
+
+        SH_ToolBox_SelectedPageTitleBold,
+
+
+        SH_TabBar_PreferNoArrows,
+
+
+        SH_ScrollBar_LeftClickAbsolutePosition,
+
+
+        SH_ListViewExpand_SelectMouseType,
+
+
+        SH_CustomBase = 0xf0000000
+    };
+
+    virtual int styleHint( StyleHint stylehint,
+                           const QWidget *widget = 0,
+                           const QStyleOption& = QStyleOption::Default,
+                           QStyleHintReturn* returnData = 0
+                           ) const = 0;
+
+
+    enum StylePixmap {
+        SP_TitleBarMinButton,
+        SP_TitleBarMaxButton,
+        SP_TitleBarCloseButton,
+        SP_TitleBarNormalButton,
+        SP_TitleBarShadeButton,
+        SP_TitleBarUnshadeButton,
+        SP_DockWindowCloseButton,
+        SP_MessageBoxInformation,
+        SP_MessageBoxWarning,
+        SP_MessageBoxCritical,
+        SP_MessageBoxQuestion,
+
+
+        SP_CustomBase = 0xf0000000
+    };
+
+    virtual QPixmap stylePixmap( StylePixmap stylepixmap,
+                                 const QWidget *widget = 0,
+                                 const QStyleOption& = QStyleOption::Default ) const = 0;
+
+
+    static QRect visualRect( const QRect &logical, const QWidget *w );
+
+    static QRect visualRect( const QRect &logical, const QRect &bounding );
+private:
+    QStylePrivate * d;
+
+
+    QStyle( const QStyle & );
+    QStyle& operator=( const QStyle & );
+
+};
+
+
+
+
+class QCommonStyle: public QStyle
+{
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+
+public:
+    QCommonStyle();
+    ~QCommonStyle();
+
+    void drawPrimitive( PrimitiveElement pe,
+                        QPainter *p,
+                        const QRect &r,
+                        const QColorGroup &cg,
+                        SFlags flags = Style_Default,
+                        const QStyleOption& = QStyleOption::Default ) const;
+
+    void drawControl( ControlElement element,
+                      QPainter *p,
+                      const QWidget *widget,
+                      const QRect &r,
+                      const QColorGroup &cg,
+                      SFlags how = Style_Default,
+                      const QStyleOption& = QStyleOption::Default ) const;
+
+    void drawControlMask( ControlElement element,
+                          QPainter *p,
+                          const QWidget *widget,
+                          const QRect &r,
+                          const QStyleOption& = QStyleOption::Default ) const;
+
+    QRect subRect( SubRect r, const QWidget *widget ) const;
+
+    void drawComplexControl( ComplexControl control,
+                             QPainter *p,
+                             const QWidget *widget,
+                             const QRect &r,
+                             const QColorGroup &cg,
+                             SFlags how = Style_Default,
+                             SCFlags sub = SC_All,
+                             SCFlags subActive = SC_None,
+                             const QStyleOption& = QStyleOption::Default ) const;
+
+    void drawComplexControlMask( ComplexControl control,
+                                 QPainter *p,
+                                 const QWidget *widget,
+                                 const QRect &r,
+                                 const QStyleOption& = QStyleOption::Default ) const;
+
+    QRect querySubControlMetrics( ComplexControl control,
+                                  const QWidget *widget,
+                                  SubControl sc,
+                                  const QStyleOption& = QStyleOption::Default ) const;
+
+    SubControl querySubControl( ComplexControl control,
+                                const QWidget *widget,
+                                const QPoint &pos,
+                                const QStyleOption& = QStyleOption::Default ) const;
+
+    int pixelMetric( PixelMetric m, const QWidget *widget = 0 ) const;
+
+    QSize sizeFromContents( ContentsType s,
+                            const QWidget *widget,
+                            const QSize &contentsSize,
+                            const QStyleOption& = QStyleOption::Default ) const;
+
+    int styleHint(StyleHint sh, const QWidget *, const QStyleOption &, QStyleHintReturn *) const;
+
+    QPixmap stylePixmap( StylePixmap sp,
+                         const QWidget *widget = 0,
+                         const QStyleOption& = QStyleOption::Default ) const;
+
+
+private:
+
+
+    QCommonStyle( const QCommonStyle & );
+    QCommonStyle &operator=( const QCommonStyle & );
+
+};
+
+class KPixmap;
+
+class KStylePrivate;
+class KStyle: public QCommonStyle
+{
+        public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+
+        public:
+                typedef uint KStyleFlags;
+                enum KStyleOption {
+                        Default = 0x00000000,
+                        AllowMenuTransparency = 0x00000001,
+                        FilledFrameWorkaround = 0x00000002
+                };
+                enum KStyleScrollBarType {
+                        WindowsStyleScrollBar = 0x00000000,
+                        PlatinumStyleScrollBar = 0x00000001,
+                        ThreeButtonScrollBar = 0x00000002,
+                        NextStyleScrollBar = 0x00000004
+                };
+                KStyle( KStyleFlags flags = KStyle::Default,
+                                KStyleScrollBarType sbtype = KStyle::WindowsStyleScrollBar );
+
+
+
+
+                ~KStyle();
+
+
+
+
+                static QString defaultStyle();
+                void setScrollBarType(KStyleScrollBarType sbtype);
+
+
+
+
+
+
+                KStyleFlags styleFlags() const;
+                virtual void renderMenuBlendPixmap( KPixmap& pix, const QColorGroup& cg,
+                                                                                        const QPopupMenu* popup ) const;
+                enum KStylePrimitive {
+                        KPE_DockWindowHandle,
+                        KPE_ToolBarHandle,
+                        KPE_GeneralHandle,
+
+                        KPE_SliderGroove,
+                        KPE_SliderHandle,
+
+                        KPE_ListViewExpander,
+                        KPE_ListViewBranch
+                };
+                virtual void drawKStylePrimitive( KStylePrimitive kpe,
+                                        QPainter* p,
+                                        const QWidget* widget,
+                                        const QRect &r,
+                                        const QColorGroup &cg,
+                                        SFlags flags = Style_Default,
+                                        const QStyleOption& = QStyleOption::Default ) const;
+
+
+                enum KStylePixelMetric {
+                        KPM_MenuItemSeparatorHeight = 0x00000001,
+                        KPM_MenuItemHMargin = 0x00000002,
+                        KPM_MenuItemVMargin = 0x00000004,
+                        KPM_MenuItemHFrame = 0x00000008,
+                        KPM_MenuItemVFrame = 0x00000010,
+                        KPM_MenuItemCheckMarkHMargin = 0x00000020,
+                        KPM_MenuItemArrowHMargin = 0x00000040,
+                        KPM_MenuItemTabSpacing = 0x00000080,
+
+                        KPM_ListViewBranchThickness = 0x00000100
+                };
+
+                int kPixelMetric( KStylePixelMetric kpm, const QWidget* widget = 0 ) const;
+
+
+
+                void polish( QWidget* widget );
+                void unPolish( QWidget* widget );
+                void polishPopupMenu( QPopupMenu* );
+
+                void drawPrimitive( PrimitiveElement pe,
+                                        QPainter* p,
+                                        const QRect &r,
+                                        const QColorGroup &cg,
+                                        SFlags flags = Style_Default,
+                                        const QStyleOption& = QStyleOption::Default ) const;
+
+                void drawControl( ControlElement element,
+                                        QPainter* p,
+                                        const QWidget* widget,
+                                        const QRect &r,
+                                        const QColorGroup &cg,
+                                        SFlags flags = Style_Default,
+                                        const QStyleOption& = QStyleOption::Default ) const;
+
+                void drawComplexControl( ComplexControl control,
+                                        QPainter *p,
+                                        const QWidget* widget,
+                                        const QRect &r,
+                                        const QColorGroup &cg,
+                                        SFlags flags = Style_Default,
+                                        SCFlags controls = SC_All,
+                                        SCFlags active = SC_None,
+                                        const QStyleOption& = QStyleOption::Default ) const;
+
+                SubControl querySubControl( ComplexControl control,
+                                        const QWidget* widget,
+                                        const QPoint &pos,
+                                        const QStyleOption& = QStyleOption::Default ) const;
+
+                QRect querySubControlMetrics( ComplexControl control,
+                                        const QWidget* widget,
+                                        SubControl sc,
+                                        const QStyleOption& = QStyleOption::Default ) const;
+
+                int pixelMetric( PixelMetric m,
+                                        const QWidget* widget = 0 ) const;
+
+                QRect subRect( SubRect r,
+                                        const QWidget* widget ) const;
+
+                QPixmap stylePixmap( StylePixmap stylepixmap,
+                                        const QWidget* widget = 0,
+                                        const QStyleOption& = QStyleOption::Default ) const;
+
+                int styleHint( StyleHint sh,
+                                        const QWidget* w = 0,
+                                        const QStyleOption &opt = QStyleOption::Default,
+                                        QStyleHintReturn* shr = 0 ) const;
+
+        protected:
+                bool eventFilter( QObject* object, QEvent* event );
+
+        private:
+
+                KStyle( const KStyle & );
+                KStyle& operator=( const KStyle & );
+
+        protected:
+                virtual void virtual_hook( int id, void* data );
+        private:
+                KStylePrivate *d;
+};
+
+
+
+class QIconFactory;
+class QIconSetPrivate;
+
+
+class QIconSet
+{
+public:
+
+    enum Size { Automatic, Small, Large };
+    enum Mode { Normal, Disabled, Active };
+    enum State { On, Off };
+
+    QIconSet();
+    QIconSet( const QPixmap& pixmap, Size size = Automatic );
+    QIconSet( const QPixmap& smallPix, const QPixmap& largePix );
+    QIconSet( const QIconSet& other );
+    virtual ~QIconSet();
+
+    void reset( const QPixmap& pixmap, Size size );
+
+    virtual void setPixmap( const QPixmap& pixmap, Size size,
+                            Mode mode = Normal, State state = Off );
+    virtual void setPixmap( const QString& fileName, Size size,
+                            Mode mode = Normal, State state = Off );
+    QPixmap pixmap( Size size, Mode mode, State state = Off ) const;
+    QPixmap pixmap( Size size, bool enabled, State state = Off ) const;
+    QPixmap pixmap() const;
+    bool isGenerated( Size size, Mode mode, State state = Off ) const;
+    void clearGenerated();
+    void installIconFactory( QIconFactory *factory );
+
+    bool isNull() const;
+
+    void detach();
+
+    QIconSet& operator=( const QIconSet& other );
+
+
+    static void setIconSize( Size which, const QSize& size );
+    static const QSize& iconSize( Size which );
+
+   
+
+private:
+    void normalize( Size& which, const QSize& pixSize );
+    QPixmap *createScaled( Size size, const QPixmap *suppliedPix ) const;
+    QPixmap *createDisabled( Size size, State state ) const;
+
+    QIconSetPrivate *d;
+};
+
+class QIconFactory : private QShared
+{
+public:
+    QIconFactory();
+    virtual ~QIconFactory();
+
+    virtual QPixmap *createPixmap( const QIconSet& iconSet, QIconSet::Size size,
+                                   QIconSet::Mode mode, QIconSet::State state );
+    void setAutoDelete( bool autoDelete ) { autoDel = autoDelete; }
+    bool autoDelete() const { return autoDel; }
+
+    static QIconFactory *defaultFactory();
+    static void installDefaultFactory( QIconFactory *factory );
+
+private:
+
+    QIconFactory( const QIconFactory & );
+    QIconFactory &operator=( const QIconFactory & );
+
+
+    friend class QIconSet;
+    friend class QIconSetPrivate;
+
+    uint autoDel : 1;
+    uint unused : 31;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+class QDataSource;
+class QObject;
+class QMoviePrivate;
+
+class QMovie {
+public:
+    QMovie();
+    QMovie(int bufsize);
+    QMovie(QDataSource*, int bufsize=1024);
+    QMovie(const QString &fileName, int bufsize=1024);
+    QMovie(QByteArray data, int bufsize=1024);
+    QMovie(const QMovie&);
+    ~QMovie();
+
+    QMovie& operator=(const QMovie&);
+
+    int pushSpace() const;
+    void pushData(const uchar* data, int length);
+
+    const QColor& backgroundColor() const;
+    void setBackgroundColor(const QColor&);
+
+    const QRect& getValidRect() const;
+    const QPixmap& framePixmap() const;
+    const QImage& frameImage() const;
+
+    bool isNull() const;
+
+    int frameNumber() const;
+    int steps() const;
+    bool paused() const;
+    bool finished() const;
+    bool running() const;
+
+    void unpause();
+    void pause();
+    void step();
+    void step(int);
+    void restart();
+
+    int speed() const;
+    void setSpeed(int);
+
+    void connectResize(QObject* receiver, const char *member);
+    void disconnectResize(QObject* receiver, const char *member=0);
+
+    void connectUpdate(QObject* receiver, const char *member);
+    void disconnectUpdate(QObject* receiver, const char *member=0);
+
+
+
+
+
+
+    enum Status { SourceEmpty=-2,
+                  UnrecognizedFormat=-1,
+                  Paused=1,
+                  EndOfFrame=2,
+                  EndOfLoop=3,
+                  EndOfMovie=4,
+                  SpeedChanged=5 };
+    void connectStatus(QObject* receiver, const char *member);
+    void disconnectStatus(QObject* receiver, const char *member=0);
+
+private:
+    QMoviePrivate *d;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+class KConfig;
+class KIconThemeDir;
+
+class KIconThemePrivate;
+
+class KIconPrivate;
+class KIcon
+{
+public:
+    KIcon() { size = 0; }
+
+
+
+
+    bool isValid() const { return size != 0; }
+
+
+
+
+    enum Context {
+      Any,
+      Action,
+      Application,
+      Device,
+      FileSystem,
+      MimeType
+    };
+
+
+
+
+    enum Type {
+      Fixed,
+      Scalable,
+      Threshold
+    };
+
+
+
+
+    enum MatchType {
+      MatchExact,
+      MatchBest
+
+    };
+
+
+
+
+
+
+    enum Group { NoGroup=-1, Desktop=0, FirstGroup=Desktop, Toolbar,
+        MainToolbar, Small, Panel, LastGroup, User };
+
+
+
+
+    enum StdSizes {
+
+        SizeSmall=16,
+
+        SizeMedium=32,
+
+        SizeLarge=48 };
+
+
+
+
+    enum States { DefaultState,
+                  ActiveState,
+                  DisabledState,
+                  LastState
+    };
+
+
+
+
+
+
+    enum Overlays {
+      LockOverlay=0x100,
+      ZipOverlay=0x200,
+      LinkOverlay=0x400,
+      HiddenOverlay=0x800,
+      ShareOverlay=0x1000,
+      OverlayMask = ~0xff
+    };
+
+
+
+
+    int size;
+
+
+
+
+    Context context;
+
+
+
+
+    Type type;
+
+
+
+
+    int threshold;
+
+
+
+
+    QString path;
+
+private:
+    KIconPrivate *d;
+};
+
+inline KIcon::Group& operator++(KIcon::Group& group) { group = static_cast<KIcon::Group>(group+1); return group; }
+inline KIcon::Group operator++(KIcon::Group& group,int) { KIcon::Group ret = group; ++group; return ret; }
+
+
+
+
+
+
+class KIconTheme
+{
+public:
+
+
+
+
+
+
+    KIconTheme(const QString& name, const QString& appName=QString::null);
+    ~KIconTheme();
+
+
+
+
+
+    QString name() const { return mName; }
+
+
+
+
+
+
+    QString description() const { return mDesc; }
+
+
+
+
+
+
+    QString example() const;
+
+
+
+
+
+    QString screenshot() const;
+
+
+
+
+
+    QString linkOverlay() const;
+
+
+
+
+
+    QString zipOverlay() const;
+
+
+
+
+
+    QString lockOverlay() const;
+
+
+
+
+
+
+    QString shareOverlay () const;
+
+
+
+
+
+    QString dir() const { return mDir; }
+
+
+
+
+
+    QStringList inherits() const { return mInherits; }
+
+
+
+
+
+    bool isValid() const;
+
+
+
+
+
+
+    bool isHidden() const;
+
+
+
+
+
+
+    int depth() const { return mDepth; }
+
+
+
+
+
+
+    int defaultSize(KIcon::Group group) const;
+
+
+
+
+
+
+    QValueList<int> querySizes(KIcon::Group group) const;
+
+
+
+
+
+
+
+    QStringList queryIcons(int size, KIcon::Context context = KIcon::Any) const;
+
+
+
+
+
+
+
+    QStringList queryIconsByContext(int size, KIcon::Context context = KIcon::Any) const;
+    KIcon iconPath(const QString& name, int size, KIcon::MatchType match) const;
+
+
+
+
+
+    static QStringList list();
+
+
+
+
+
+    static QString current();
+
+
+
+
+    static void reconfigure();
+
+
+
+
+
+
+    static QString defaultThemeName();
+
+private:
+    int mDefSize[8];
+    QValueList<int> mSizes[8];
+
+    int mDepth;
+    QString mDir, mName, mDesc;
+    QStringList mInherits;
+    QPtrList<KIconThemeDir> mDirs;
+    KIconThemePrivate *d;
+
+    static QString *_theme;
+    static QStringList *_theme_list;
+};
+
+class KIconGroup;
+class KIconThemeNode;
+class KConfig;
+class KIconLoaderPrivate;
+class KStandardDirs;
+class KIconEffect;
+class KIconLoader
+{
+public:
+    KIconLoader(const QString& appname=QString::null, KStandardDirs *dirs = 0);
+
+
+
+
+    ~KIconLoader();
+
+
+
+
+
+    void addAppDir(const QString& appname);
+    QPixmap loadIcon(const QString& name, KIcon::Group group, int size=0,
+                     int state=KIcon::DefaultState, QString *path_store=0L,
+                     bool canReturnNull=false) const;
+    QIconSet loadIconSet(const QString& name, KIcon::Group group, int size,
+                         bool canReturnNull);
+    QIconSet loadIconSet(const QString& name, KIcon::Group group, int size=0);
+    QString iconPath(const QString& name, int group_or_size,
+                     bool canReturnNull=false) const;
+    QMovie loadMovie(const QString& name, KIcon::Group group, int size=0) const;
+    QString moviePath(const QString& name, KIcon::Group group, int size=0) const;
+    QStringList loadAnimated(const QString& name, KIcon::Group group, int size=0) const;
+    QStringList queryIcons(int group_or_size, KIcon::Context context=KIcon::Any) const;
+    QStringList queryIconsByContext(int group_or_size,
+                                    KIcon::Context context=KIcon::Any) const;
+    QStringList queryIconsByDir( const QString& iconsDir ) const;
+
+
+
+
+
+
+    int currentSize(KIcon::Group group) const;
+
+
+
+
+
+
+    KIconTheme *theme() const;
+
+
+
+
+
+    KIconEffect *iconEffect() const;
+
+
+
+
+
+
+
+    void reconfigure( const QString& _appname, KStandardDirs *_dirs );
+
+
+
+
+
+
+    static QPixmap unknown();
+    bool alphaBlending( KIcon::Group group ) const;
+
+
+
+
+
+
+    void addExtraDesktopThemes();
+
+
+
+
+
+
+    bool extraDesktopThemesAdded() const;
+    void enableDelayedIconSetLoading( bool enable );
+    bool isDelayedIconSetLoadingEnabled() const;
+
+
+ private:
+
+
+
+    void init( const QString& _appname, KStandardDirs *_dirs );
+
+
+
+
+
+
+    KIcon findMatchingIcon(const QString& name, int size) const;
+
+
+
+
+
+     QImage *loadOverlay(const QString& name, int size) const;
+
+
+
+
+
+    void addAppThemes(const QString& appname);
+
+
+
+
+
+
+    void addBaseThemes(KIconThemeNode *node, const QString &appname);
+
+
+
+
+
+
+    QString unknownIconPath( int size ) const;
+
+
+
+
+
+
+    QString removeIconExtension(const QString &name) const;
+
+
+
+
+    QIconSet loadIconSetNonDelayed( const QString& name, KIcon::Group group,
+                                    int size, bool canReturnNull );
+
+
+    KIconLoaderPrivate *d;
+};
+
+
+
+
+
+QPixmap DesktopIcon(const QString& name, int size=0,
+                    int state=KIcon::DefaultState,
+                    KInstance *instance=KGlobal::instance());
+
+
+
+
+
+QPixmap DesktopIcon(const QString& name, KInstance *instance);
+
+
+
+
+
+QIconSet DesktopIconSet(const QString& name, int size=0,
+                    KInstance *instance=KGlobal::instance());
+
+
+
+
+
+QPixmap BarIcon(const QString& name, int size=0, int state=KIcon::DefaultState,
+        KInstance *instance=KGlobal::instance());
+
+
+
+
+
+QPixmap BarIcon(const QString& name, KInstance *instance);
+
+
+
+
+
+QIconSet BarIconSet(const QString& name, int size=0,
+                    KInstance *instance=KGlobal::instance());
+
+
+
+
+
+QPixmap SmallIcon(const QString& name, int size=0,
+                  int state=KIcon::DefaultState,
+                  KInstance *instance=KGlobal::instance());
+
+
+
+
+
+QPixmap SmallIcon(const QString& name, KInstance *instance);
+
+
+
+
+
+QIconSet SmallIconSet(const QString& name, int size=0,
+                    KInstance *instance=KGlobal::instance());
+
+
+
+
+
+QPixmap MainBarIcon(const QString& name, int size=0,
+                    int state=KIcon::DefaultState,
+                    KInstance *instance=KGlobal::instance());
+
+
+
+
+
+QPixmap MainBarIcon(const QString& name, KInstance *instance);
+
+
+
+
+
+QIconSet MainBarIconSet(const QString& name, int size=0,
+                    KInstance *instance=KGlobal::instance());
+
+
+
+
+
+QPixmap UserIcon(const QString& name, int state=KIcon::DefaultState,
+        KInstance *instance=KGlobal::instance());
+
+
+
+
+
+QPixmap UserIcon(const QString& name, KInstance *instance);
+
+
+
+
+
+QIconSet UserIconSet(const QString& name,
+        KInstance *instance=KGlobal::instance());
+
+
+
+
+
+int IconSize(KIcon::Group group, KInstance *instance=KGlobal::instance());
+
+class QMimeSource;
+
+class QClipboard : public QObject
+{
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+private:
+    QClipboard( QObject *parent=0, const char *name=0 );
+    ~QClipboard();
+
+public:
+    enum Mode { Clipboard, Selection };
+
+    void clear( Mode mode );
+    void clear();
+
+    bool supportsSelection() const;
+    bool ownsSelection() const;
+    bool ownsClipboard() const;
+
+    void setSelectionMode(bool enable);
+    bool selectionModeEnabled() const;
+
+
+    QString text( Mode mode ) const;
+    QString text( QCString& subtype, Mode mode ) const;
+    void setText( const QString &, Mode mode );
+
+
+    QMimeSource *data( Mode mode ) const;
+    void setData( QMimeSource*, Mode mode );
+
+    QImage image( Mode mode ) const;
+    QPixmap pixmap( Mode mode ) const;
+    void setImage( const QImage &, Mode mode );
+    void setPixmap( const QPixmap &, Mode mode );
+
+
+
+    QString text() const;
+    QString text(QCString& subtype) const;
+    void setText( const QString &);
+
+
+    QMimeSource *data() const;
+    void setData( QMimeSource* );
+
+    QImage image() const;
+    QPixmap pixmap() const;
+    void setImage( const QImage & );
+    void setPixmap( const QPixmap & );
+
+
+protected:
+    void selectionChanged();
+    void dataChanged();
+
+private :
+    void ownerDestroyed();
+
+protected:
+    void connectNotify( const char * );
+    bool event( QEvent * );
+
+    friend class QApplication;
+    friend class QBaseApplication;
+    friend class QDragManager;
+    friend class QMimeSource;
+
+private:
+
+
+
+
+
+
+
+    QClipboard( const QClipboard & );
+    QClipboard &operator=( const QClipboard & );
+
+};
+class KClipboardSynchronizer : public QObject
+{
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+
+public:
+    friend class KlipperWidget;
+    friend class KApplication;
+
+
+
+
+
+    static KClipboardSynchronizer *self();
+    static void setSynchronizing( bool sync );
+
+
+
+
+
+
+
+    static bool isSynchronizing()
+    {
+        return s_sync;
+    }
+    static void setReverseSynchronizing( bool enable );
+    static bool isReverseSynchronizing()
+    {
+        return s_reverse_sync;
+    }
+
+
+protected:
+    ~KClipboardSynchronizer();
+
+private :
+    void slotSelectionChanged();
+    void slotClipboardChanged();
+
+private:
+    KClipboardSynchronizer( QObject *parent = 0, const char *name = 0L );
+    void setupSignals();
+
+    static void setClipboard( QMimeSource* data, QClipboard::Mode mode );
+
+    static KClipboardSynchronizer *s_self;
+    static bool s_sync;
+    static bool s_reverse_sync;
+    static bool s_blocked;
+
+    class MimeSource;
+
+private:
+
+    enum Configuration { Synchronize = 1 };
+
+    static void newConfiguration( int config );
+
+};
+
+class QTimer;
+
+
+
+
+
+
+
+
+struct KEntry
+{
+  KEntry()
+    : mValue(0), bDirty(false), bNLS(false),
+      bGlobal(false), bImmutable(false), bDeleted(false), bExpand(false) {}
+  QCString mValue;
+
+
+
+  bool bDirty :1;
+
+
+
+  bool bNLS :1;
+
+
+
+  bool bGlobal:1;
+
+
+
+  bool bImmutable:1;
+
+
+
+  bool bDeleted:1;
+
+
+
+  bool bExpand:1;
+};
+
+
+
+
+
+
+struct KEntryKey
+{
+  KEntryKey(const QCString& _group = 0,
+            const QCString& _key = 0)
+      : mGroup(_group), mKey(_key), bLocal(false), bDefault(false),
+        c_key(_key.data()) {}
+
+
+
+  QCString mGroup;
+
+
+
+  QCString mKey;
+
+
+
+  bool bLocal :1;
+
+
+
+  bool bDefault:1;
+
+  const char *c_key;
+};
+
+
+
+
+
+inline bool operator <(const KEntryKey &k1, const KEntryKey &k2)
+{
+
+   int result=qstrcmp(k1.mGroup.data(),k2.mGroup.data());
+   if (result!=0)
+      return (result<0);
+
+  if (!k1.c_key && k2.c_key)
+    return true;
+
+  result = 0;
+  if (k1.c_key && k2.c_key)
+     result = strcmp(k1.c_key, k2.c_key);
+  if (result != 0)
+     return result < 0;
+  if (!k1.bLocal && k2.bLocal)
+    return true;
+  if (k1.bLocal && !k2.bLocal)
+    return false;
+  return (!k1.bDefault && k2.bDefault);
+}
+typedef QMap<KEntryKey, KEntry> KEntryMap;
+
+
+
+
+
+
+typedef QMap<KEntryKey, KEntry>::Iterator KEntryMapIterator;
+typedef QMap<KEntryKey, KEntry>::ConstIterator KEntryMapConstIterator;
+
+class KConfigBackEnd;
+class KConfigBasePrivate;
+class KConfigGroup;
+class KConfigBase : public QObject
+{
+  public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+
+  friend class KConfigBackEnd;
+  friend class KConfigINIBackEnd;
+  friend class KConfigGroup;
+
+public:
+
+
+
+  KConfigBase();
+
+
+
+
+  virtual ~KConfigBase();
+  void setGroup( const QString& group );
+
+
+
+
+
+  void setDesktopGroup();
+
+
+
+
+
+
+
+  QString group() const;
+
+
+
+
+
+
+
+  bool hasGroup(const QString &group) const;
+
+
+
+
+
+
+  virtual QStringList groupList() const = 0;
+
+
+
+
+
+
+  QString locale() const;
+   QString readEntry(const QString& pKey,
+                     const QString& aDefault = QString::null ) const;
+   QString readEntry(const char *pKey,
+                     const QString& aDefault = QString::null ) const;
+  QVariant readPropertyEntry( const QString& pKey, QVariant::Type ) const;
+  QVariant readPropertyEntry( const char *pKey, QVariant::Type ) const;
+  QVariant readPropertyEntry( const QString& pKey,
+                              const QVariant &aDefault) const;
+  QVariant readPropertyEntry( const char *pKey,
+                              const QVariant &aDefault) const;
+  int readListEntry( const QString& pKey, QStrList &list, char sep = ',' ) const;
+  int readListEntry( const char *pKey, QStrList &list, char sep = ',' ) const;
+  QStringList readListEntry( const QString& pKey, char sep = ',' ) const;
+  QStringList readListEntry( const char *pKey, char sep = ',' ) const;
+
+
+
+
+
+
+
+  QValueList<int> readIntListEntry( const QString& pKey ) const;
+
+
+
+
+
+
+
+  QValueList<int> readIntListEntry( const char *pKey ) const;
+  QString readPathEntry( const QString& pKey, const QString & aDefault = QString::null ) const;
+  QString readPathEntry( const char *pKey, const QString & aDefault = QString::null ) const;
+  QStringList readPathListEntry( const QString& pKey, char sep = ',' ) const;
+  QStringList readPathListEntry( const char *pKey, char sep = ',' ) const;
+  int readNumEntry( const QString& pKey, int nDefault = 0 ) const;
+  int readNumEntry( const char *pKey, int nDefault = 0 ) const;
+  unsigned int readUnsignedNumEntry( const QString& pKey, unsigned int nDefault = 0 ) const;
+  unsigned int readUnsignedNumEntry( const char *pKey, unsigned int nDefault = 0 ) const;
+  long readLongNumEntry( const QString& pKey, long nDefault = 0 ) const;
+  long readLongNumEntry( const char *pKey, long nDefault = 0 ) const;
+  unsigned long readUnsignedLongNumEntry( const QString& pKey, unsigned long nDefault = 0 ) const;
+  unsigned long readUnsignedLongNumEntry( const char *pKey, unsigned long nDefault = 0 ) const;
+  double readDoubleNumEntry( const QString& pKey, double nDefault = 0.0 ) const;
+  double readDoubleNumEntry( const char *pKey, double nDefault = 0.0 ) const;
+  QFont readFontEntry( const QString& pKey, const QFont* pDefault = 0L ) const;
+  QFont readFontEntry( const char *pKey, const QFont* pDefault = 0L ) const;
+  bool readBoolEntry( const QString& pKey, const bool bDefault = false ) const;
+  bool readBoolEntry( const char *pKey, const bool bDefault = false ) const;
+  QRect readRectEntry( const QString& pKey, const QRect* pDefault = 0L ) const;
+  QRect readRectEntry( const char *pKey, const QRect* pDefault = 0L ) const;
+  QPoint readPointEntry( const QString& pKey, const QPoint* pDefault = 0L ) const;
+  QPoint readPointEntry( const char *pKey, const QPoint* pDefault = 0L ) const;
+  QSize readSizeEntry( const QString& pKey, const QSize* pDefault = 0L ) const;
+  QSize readSizeEntry( const char *pKey, const QSize* pDefault = 0L ) const;
+  QColor readColorEntry( const QString& pKey, const QColor* pDefault = 0L ) const;
+  QColor readColorEntry( const char *pKey, const QColor* pDefault = 0L ) const;
+  QDateTime readDateTimeEntry( const QString& pKey, const QDateTime* pDefault = 0L ) const;
+  QDateTime readDateTimeEntry( const char *pKey, const QDateTime* pDefault = 0L ) const;
+   QString readEntryUntranslated( const QString& pKey,
+                     const QString& aDefault = QString::null ) const;
+   QString readEntryUntranslated( const char *pKey,
+                     const QString& aDefault = QString::null ) const;
+  void writeEntry( const QString& pKey, const QString& pValue,
+                      bool bPersistent = true, bool bGlobal = false,
+                      bool bNLS = false );
+  void writeEntry( const char *pKey, const QString& pValue,
+                      bool bPersistent = true, bool bGlobal = false,
+                      bool bNLS = false );
+  void writeEntry( const QString& pKey, const QVariant& rValue,
+                    bool bPersistent = true, bool bGlobal = false,
+                    bool bNLS = false );
+  void writeEntry( const char *pKey, const QVariant& rValue,
+                    bool bPersistent = true, bool bGlobal = false,
+                    bool bNLS = false );
+  void writeEntry( const QString& pKey, const QStrList &rValue,
+                   char sep = ',', bool bPersistent = true, bool bGlobal = false, bool bNLS = false );
+  void writeEntry( const char *pKey, const QStrList &rValue,
+                   char sep = ',', bool bPersistent = true, bool bGlobal = false, bool bNLS = false );
+  void writeEntry( const QString& pKey, const QStringList &rValue,
+                   char sep = ',', bool bPersistent = true, bool bGlobal = false, bool bNLS = false );
+  void writeEntry( const char *pKey, const QStringList &rValue,
+                   char sep = ',', bool bPersistent = true, bool bGlobal = false, bool bNLS = false );
+  void writeEntry( const QString& pKey, const QValueList<int>& rValue,
+                   bool bPersistent = true, bool bGlobal = false, bool bNLS = false );
+  void writeEntry( const char *pKey, const QValueList<int>& rValue,
+                   bool bPersistent = true, bool bGlobal = false, bool bNLS = false );
+  void writeEntry( const QString& pKey, const char *pValue,
+                      bool bPersistent = true, bool bGlobal = false,
+                      bool bNLS = false )
+    { writeEntry(pKey, QString::fromLatin1(pValue), bPersistent, bGlobal, bNLS); }
+  void writeEntry( const char *pKey, const char *pValue,
+                      bool bPersistent = true, bool bGlobal = false,
+                      bool bNLS = false )
+    { writeEntry(pKey, QString::fromLatin1(pValue), bPersistent, bGlobal, bNLS); }
+  void writeEntry( const QString& pKey, int nValue,
+                      bool bPersistent = true, bool bGlobal = false,
+                      bool bNLS = false );
+  void writeEntry( const char *pKey, int nValue,
+                      bool bPersistent = true, bool bGlobal = false,
+                      bool bNLS = false );
+  void writeEntry( const QString& pKey, unsigned int nValue,
+                      bool bPersistent = true, bool bGlobal = false,
+                      bool bNLS = false );
+  void writeEntry( const char *pKey, unsigned int nValue,
+                      bool bPersistent = true, bool bGlobal = false,
+                      bool bNLS = false );
+  void writeEntry( const QString& pKey, long nValue,
+                      bool bPersistent = true, bool bGlobal = false,
+                      bool bNLS = false );
+  void writeEntry( const char *pKey, long nValue,
+                      bool bPersistent = true, bool bGlobal = false,
+                      bool bNLS = false );
+  void writeEntry( const QString& pKey, unsigned long nValue,
+                      bool bPersistent = true, bool bGlobal = false,
+                      bool bNLS = false );
+  void writeEntry( const char *pKey, unsigned long nValue,
+                      bool bPersistent = true, bool bGlobal = false,
+                      bool bNLS = false );
+  void writeEntry( const QString& pKey, double nValue,
+                      bool bPersistent = true, bool bGlobal = false,
+                      char format = 'g', int precision = 6,
+                      bool bNLS = false );
+  void writeEntry( const char *pKey, double nValue,
+                      bool bPersistent = true, bool bGlobal = false,
+                      char format = 'g', int precision = 6,
+                      bool bNLS = false );
+  void writeEntry( const QString& pKey, bool bValue,
+                      bool bPersistent = true, bool bGlobal = false,
+                      bool bNLS = false );
+  void writeEntry( const char *pKey, bool bValue,
+                      bool bPersistent = true, bool bGlobal = false,
+                      bool bNLS = false );
+  void writeEntry( const QString& pKey, const QFont& rFont,
+                      bool bPersistent = true, bool bGlobal = false,
+                      bool bNLS = false );
+  void writeEntry( const char *pKey, const QFont& rFont,
+                      bool bPersistent = true, bool bGlobal = false,
+                      bool bNLS = false );
+  void writeEntry( const QString& pKey, const QColor& rColor,
+                   bool bPersistent = true, bool bGlobal = false,
+                   bool bNLS = false );
+  void writeEntry( const char *pKey, const QColor& rColor,
+                   bool bPersistent = true, bool bGlobal = false,
+                   bool bNLS = false );
+  void writeEntry( const QString& pKey, const QDateTime& rDateTime,
+                   bool bPersistent = true, bool bGlobal = false,
+                   bool bNLS = false );
+  void writeEntry( const char *pKey, const QDateTime& rDateTime,
+                   bool bPersistent = true, bool bGlobal = false,
+                   bool bNLS = false );
+  void writeEntry( const QString& pKey, const QRect& rValue,
+                   bool bPersistent = true, bool bGlobal = false,
+                   bool bNLS = false );
+  void writeEntry( const char *pKey, const QRect& rValue,
+                   bool bPersistent = true, bool bGlobal = false,
+                   bool bNLS = false );
+  void writeEntry( const QString& pKey, const QPoint& rValue,
+                   bool bPersistent = true, bool bGlobal = false,
+                   bool bNLS = false );
+  void writeEntry( const char *pKey, const QPoint& rValue,
+                   bool bPersistent = true, bool bGlobal = false,
+                   bool bNLS = false );
+  void writeEntry( const QString& pKey, const QSize& rValue,
+                   bool bPersistent = true, bool bGlobal = false,
+                   bool bNLS = false );
+  void writeEntry( const char *pKey, const QSize& rValue,
+                   bool bPersistent = true, bool bGlobal = false,
+                   bool bNLS = false );
+  void writePathEntry( const QString& pKey, const QString & path,
+                       bool bPersistent = true, bool bGlobal = false,
+                       bool bNLS = false );
+  void writePathEntry( const char *pKey, const QString & path,
+                       bool bPersistent = true, bool bGlobal = false,
+                       bool bNLS = false );
+  void writePathEntry( const QString& pKey, const QStringList &rValue,
+                   char sep = ',', bool bPersistent = true, bool bGlobal = false, bool bNLS = false );
+  void writePathEntry( const char *pKey, const QStringList &rValue,
+                   char sep = ',', bool bPersistent = true, bool bGlobal = false, bool bNLS = false );
+   void deleteEntry( const QString& pKey,
+                   bool bNLS = false, bool bGlobal = false);
+   void deleteEntry( const char *pKey,
+                   bool bNLS = false, bool bGlobal = false);
+  bool deleteGroup( const QString& group, bool bDeep = true, bool bGlobal = false );
+  void setDollarExpansion( bool _bExpand = true ) { bExpand = _bExpand; }
+
+
+
+
+
+
+  bool isDollarExpansion() const { return bExpand; }
+  virtual void rollback( bool bDeep = true );
+  virtual void sync();
+
+
+
+
+
+  bool isDirty() const { return bDirty; }
+  virtual void setReadOnly(bool _ro) { bReadOnly = _ro; }
+
+
+
+
+
+
+  bool isReadOnly() const { return bReadOnly; }
+  bool hasKey( const QString& key ) const;
+  virtual QMap<QString, QString> entryMap(const QString &group) const = 0;
+  virtual void reparseConfiguration() = 0;
+
+
+
+
+
+  bool isImmutable() const;
+
+
+
+
+
+
+
+  bool groupIsImmutable(const QString &group) const;
+
+
+
+
+
+
+
+  bool entryIsImmutable(const QString &key) const;
+
+
+
+
+
+
+  enum ConfigState { NoAccess, ReadOnly, ReadWrite };
+  ConfigState getConfigState() const;
+
+
+
+
+
+
+  bool checkConfigFilesWritable(bool warnUser);
+
+
+
+
+
+
+
+  void setReadDefaults(bool b);
+
+
+
+
+
+
+  bool readDefaults() const;
+  void revertToDefault(const QString &key);
+  bool hasDefault(const QString &key) const;
+
+protected:
+
+
+
+
+
+  void setLocale();
+
+
+
+
+
+
+  virtual void setDirty(bool _bDirty = true) { bDirty = _bDirty; }
+
+
+
+
+
+
+  virtual void parseConfigFiles();
+  virtual KEntryMap internalEntryMap( const QString& pGroup ) const = 0;
+  virtual KEntryMap internalEntryMap() const = 0;
+  virtual void putData(const KEntryKey &_key, const KEntry &_data, bool _checkGroup = true) = 0;
+  virtual KEntry lookupData(const KEntryKey &_key) const = 0;
+
+  virtual bool internalHasGroup(const QCString &group) const = 0;
+
+
+
+
+  KConfigBackEnd *backEnd;
+public:
+
+
+
+  void setGroup( const QCString &pGroup );
+  void setGroup( const char *pGroup );
+  bool hasGroup(const QCString &_pGroup) const;
+  bool hasGroup(const char *_pGroup) const;
+  bool hasKey( const char *pKey ) const;
+
+protected:
+  QCString readEntryUtf8( const char *pKey) const;
+
+
+
+  QCString mGroup;
+
+
+
+  QCString aLocaleString;
+
+
+
+
+  bool bDirty;
+
+  bool bLocaleInitialized;
+  bool bReadOnly;
+  mutable bool bExpand;
+
+protected:
+  virtual void virtual_hook( int id, void* data );
+private:
+  class KConfigBasePrivate;
+  KConfigBasePrivate *d;
+};
+
+class KConfigGroupSaverPrivate;
+class KConfigGroupSaver
+{
+public:
+  KConfigGroupSaver( KConfigBase* config, QString group )
+
+      : _config(config), _oldgroup(config->group())
+        { _config->setGroup( group ); }
+
+  KConfigGroupSaver( KConfigBase* config, const char *group )
+      : _config(config), _oldgroup(config->group())
+        { _config->setGroup( group ); }
+
+  KConfigGroupSaver( KConfigBase* config, const QCString &group )
+      : _config(config), _oldgroup(config->group())
+        { _config->setGroup( group ); }
+
+  ~KConfigGroupSaver() { _config->setGroup( _oldgroup ); }
+
+    KConfigBase* config() { return _config; };
+
+private:
+  KConfigBase* _config;
+  QString _oldgroup;
+
+  KConfigGroupSaver(const KConfigGroupSaver&);
+  KConfigGroupSaver& operator=(const KConfigGroupSaver&);
+
+  KConfigGroupSaverPrivate *d;
+};
+
+class KConfigGroupPrivate;
+
+
+
+
+class KConfigGroup: public KConfigBase
+{
+public:
+
+
+
+
+   KConfigGroup(KConfigBase *master, const QCString &group);
+
+
+
+
+
+
+   KConfigGroup(KConfigBase *master, const QString &group);
+
+
+
+
+
+
+
+   KConfigGroup(KConfigBase *master, const char * group);
+
+
+
+
+
+
+
+   void deleteGroup(bool bGlobal = false);
+
+
+   virtual void setDirty(bool b);
+   virtual void putData(const KEntryKey &_key, const KEntry &_data, bool _checkGroup = true);
+   virtual KEntry lookupData(const KEntryKey &_key) const;
+   virtual void sync();
+
+private:
+
+   void setGroup() { }
+   void setDesktopGroup() { }
+   void group() { }
+   void hasGroup() { }
+   void setReadOnly(bool) { }
+   void isDirty() { }
+
+
+   virtual QStringList groupList() const { return QStringList(); }
+   virtual void rollback(bool) { }
+   virtual void reparseConfiguration() { }
+   virtual QMap<QString, QString> entryMap(const QString &) const
+    { return QMap<QString,QString>(); }
+   virtual KEntryMap internalEntryMap( const QString&) const
+    { return KEntryMap(); }
+   virtual KEntryMap internalEntryMap() const
+    { return KEntryMap(); }
+   virtual bool internalHasGroup(const QCString &) const
+    { return false; }
+
+   void getConfigState() { }
+
+   KConfigBase *mMaster;
+protected:
+   virtual void virtual_hook( int id, void* data );
+private:
+   KConfigGroupPrivate* d;
+};
+
+class KConfigPrivate;
+class KConfig : public KConfigBase
+{
+  public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+
+public:
+  KConfig( const QString& fileName = QString::null,
+          bool bReadOnly = false, bool bUseKDEGlobals = true, const char *resType="config");
+
+  KConfig(KConfigBackEnd *backEnd, bool bReadOnly = false);
+
+
+
+
+
+
+
+  virtual ~KConfig();
+  virtual void rollback(bool bDeep = true);
+
+
+
+
+
+
+  virtual QStringList groupList() const;
+  virtual QMap<QString, QString> entryMap(const QString &pGroup) const;
+
+
+
+
+
+  virtual void reparseConfiguration();
+
+
+
+
+
+
+
+  void setFileWriteMode(int mode);
+
+
+
+
+
+
+
+  void setForceGlobal( bool force ) { bForceGlobal = force; }
+
+
+
+
+
+
+  bool forceGlobal() const { return bForceGlobal; }
+  void checkUpdate(const QString &id, const QString &updateFile);
+  KConfig* copyTo(const QString &file);
+
+protected:
+
+
+
+
+
+
+
+  virtual bool internalHasGroup(const QCString &group) const;
+  virtual KEntryMap internalEntryMap(const QString &pGroup) const;
+   virtual KEntryMap internalEntryMap() const { return aEntryMap; }
+  virtual void putData(const KEntryKey &_key, const KEntry &_data, bool _checkGroup=true);
+  virtual KEntry lookupData(const KEntryKey &_key) const;
+  KEntryMap aEntryMap;
+
+private:
+
+
+
+
+  KConfig( const KConfig& );
+
+
+
+
+  KConfig& operator= ( const KConfig& rConfig );
+
+private:
+  bool bGroupImmutable : 1;
+  bool bFileImmutable : 1;
+  bool bForceGlobal : 1;
+protected:
+  virtual void virtual_hook( int id, void* data );
+private:
+  KConfigPrivate *d;
+};
+
+
+
+class KSimpleConfigPrivate;
+class KSimpleConfig : public KConfig
+{
+  public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+
+public:
+  KSimpleConfig( const QString &fileName, bool bReadOnly = false);
+
+  KSimpleConfig(KConfigBackEnd *backEnd, bool bReadOnly = false);
+
+
+
+
+
+
+  virtual ~KSimpleConfig();
+
+  virtual void sync();
+
+private:
+
+
+  KSimpleConfig( const KSimpleConfig& );
+  KSimpleConfig& operator= ( const KSimpleConfig& rConfig );
+
+protected:
+  virtual void virtual_hook( int id, void* data );
+private:
+  KSimpleConfigPrivate *d;
+};
+
+
+
+
+
+
+
+class QUrl;
+class QStringList;
+template <typename K, typename V> class QMap;
+
+class KURLPrivate;
+class KURL
+{
+public:
+  enum AdjustementFlags
+  {
+    NoAdjustements = 0,
+    StripFileProtocol = 1
+  };
+
+
+
+
+
+
+
+  class List : public QValueList<KURL>
+  {
+  public:
+
+
+
+      List() { }
+
+
+
+
+
+      List(const KURL &url);
+
+
+
+
+
+      List(const QStringList &list);
+
+
+
+
+      QStringList toStringList() const;
+  };
+
+
+
+  KURL();
+
+
+
+
+  ~KURL();
+  KURL( const QString& url, int encoding_hint = 0 );
+  KURL( const char * url, int encoding_hint = 0 );
+  KURL( const QCString& url, int encoding_hint = 0 );
+
+
+
+
+  KURL( const KURL& u );
+
+
+
+
+  KURL( const QUrl &u );
+  KURL( const KURL& _baseurl, const QString& _rel_url, int encoding_hint=0 );
+
+
+
+
+
+
+  QString protocol() const { return m_bIsMalformed ? QString::null : m_strProtocol; }
+
+
+
+
+  void setProtocol( const QString& _txt );
+
+
+
+
+
+  QString user() const { return m_strUser; }
+
+
+
+
+
+
+  void setUser( const QString& _txt );
+
+
+
+
+  bool hasUser() const { return !m_strUser.isEmpty(); }
+
+
+
+
+
+  QString pass() const { return m_strPass; }
+  void setPass( const QString& _txt );
+
+
+
+
+  bool hasPass() const { return !m_strPass.isEmpty(); }
+
+
+
+
+
+  QString host() const { return m_strHost; }
+
+
+
+
+
+
+
+  void setHost( const QString& _txt );
+
+
+
+
+  bool hasHost() const { return !m_strHost.isEmpty(); }
+
+
+
+
+
+
+  unsigned short int port() const { return m_iPort; }
+
+
+
+
+  void setPort( unsigned short int _p );
+
+
+
+
+
+
+  QString path() const { return m_strPath; }
+  QString path( int _trailing ) const;
+  void setPath( const QString& path );
+
+
+
+
+
+  bool hasPath() const { return !m_strPath.isEmpty(); }
+  void cleanPath(bool cleanDirSeparator = true);
+  void adjustPath(int _trailing);
+  void setEncodedPathAndQuery( const QString& _txt, int encoding_hint = 0 );
+
+
+
+
+
+
+
+  void setEncodedPath(const QString& _txt, int encoding_hint = 0 );
+  QString encodedPathAndQuery( int _trailing = 0, bool _no_empty_path = false, int encoding_hint = 0) const;
+  void setQuery( const QString& _txt, int encoding_hint = 0);
+  QString query() const;
+
+
+
+
+
+  QString ref() const { return m_strRef_encoded; }
+
+
+
+
+
+  void setRef( const QString& _txt ) { m_strRef_encoded = _txt; }
+
+
+
+
+
+
+
+  bool hasRef() const { return !m_strRef_encoded.isNull(); }
+  QString htmlRef() const;
+
+
+
+
+
+
+  QString encodedHtmlRef() const;
+  void setHTMLRef( const QString& _ref );
+
+
+
+
+
+
+  bool hasHTMLRef() const;
+
+
+
+
+
+
+  bool isValid() const { return !m_bIsMalformed; }
+
+
+
+  __attribute__ ((deprecated)) bool isMalformed() const { return !isValid(); }
+
+
+
+
+
+
+  bool isLocalFile() const;
+
+
+
+
+
+
+
+  void setFileEncoding(const QString &encoding);
+
+
+
+
+
+
+
+  QString fileEncoding() const;
+
+
+
+
+
+
+
+  bool hasSubURL() const;
+  void addPath( const QString& txt );
+
+
+
+
+
+  QString queryItem( const QString& item ) const;
+  QString queryItem( const QString& item, int encoding_hint ) const;
+  enum QueryItemsOptions { CaseInsensitiveKeys = 1 };
+
+
+
+
+  QMap< QString, QString > queryItems( int options=0 ) const;
+  QMap< QString, QString > queryItems( int options, int encoding_hint ) const;
+  void addQueryItem( const QString& _item, const QString& _value, int encoding_hint = 0 );
+
+
+
+
+
+
+  void removeQueryItem( const QString& _item );
+  void setFileName( const QString&_txt );
+  QString fileName( bool _ignore_trailing_slash_in_path = true ) const;
+  QString directory( bool _strip_trailing_slash_from_result = true,
+                     bool _ignore_trailing_slash_in_path = true ) const;
+
+
+
+
+  void setDirectory(const QString &dir);
+  bool cd( const QString& _dir );
+  QString url( int _trailing = 0, int encoding_hint = 0) const;
+  QString prettyURL( int _trailing = 0) const;
+  QString prettyURL( int _trailing, AdjustementFlags _flags) const;
+  QString htmlURL() const;
+
+
+
+
+
+
+  bool isEmpty() const;
+  KURL upURL( ) const;
+
+  bool operator<(const KURL& _u) const;
+
+  KURL& operator=( const KURL& _u );
+  KURL& operator=( const QString& _url );
+  KURL& operator=( const char * _url );
+  KURL& operator=( const QUrl & u );
+
+  bool operator==( const KURL& _u ) const;
+  bool operator==( const QString& _u ) const;
+  bool operator!=( const KURL& _u ) const { return !( *this == _u ); }
+  bool operator!=( const QString& _u ) const { return !( *this == _u ); }
+  bool cmp( const KURL &u, bool ignore_trailing = false ) const __attribute__ ((deprecated));
+  bool equals( const KURL &u, bool ignore_trailing = false ) const;
+
+
+
+
+
+
+  bool isParentOf( const KURL& u ) const;
+  static List split( const QString& _url );
+  static List split( const KURL& _url );
+  static KURL join( const List& _list );
+  static KURL fromPathOrURL( const QString& text );
+  static QString encode_string(const QString &str, int encoding_hint = 0);
+  static QString encode_string_no_slash(const QString &str, int encoding_hint = 0);
+  static QString decode_string(const QString &str, int encoding_hint = 0);
+  static bool isRelativeURL(const QString &_url);
+  static QString relativeURL(const KURL &base_url, const KURL &url, int encoding_hint = 0);
+  static QString relativePath(const QString &base_dir, const QString &path, bool *isParent=0);
+
+
+
+
+  QString filename( bool _ignore_trailing_slash_in_path = true ) const
+  {
+    return fileName(_ignore_trailing_slash_in_path);
+  }
+
+protected:
+  void reset();
+  void parse( const QString& _url, int encoding_hint = 0);
+
+private:
+  QString m_strProtocol;
+  QString m_strUser;
+  QString m_strPass;
+  QString m_strHost;
+  QString m_strPath;
+  QString m_strRef_encoded;
+  QString m_strQuery_encoded;
+  bool m_bIsMalformed : 1;
+  uint freeForUse : 7;
+  unsigned short int m_iPort;
+  QString m_strPath_encoded;
+
+  friend QDataStream & operator<< (QDataStream & s, const KURL & a);
+  friend QDataStream & operator>> (QDataStream & s, KURL & a);
+private:
+  KURLPrivate* d;
+};
+bool urlcmp( const QString& _url1, const QString& _url2 );
+bool urlcmp( const QString& _url1, const QString& _url2, bool _ignore_trailing, bool _ignore_ref );
+
+QDataStream & operator<< (QDataStream & s, const KURL & a);
+QDataStream & operator>> (QDataStream & s, KURL & a);
+
+
+
+
+
+typedef QValueList<QCString> QCStringList;
+
+
+
+
+
+
+
+struct KCmdLineOptions
+{
+   const char *name;
+
+
+
+
+   const char *description;
+
+
+
+   const char *def;
+};
+
+
+class KCmdLineArgsList;
+class KApplication;
+class KUniqueApplication;
+class KCmdLineParsedOptions;
+class KCmdLineParsedArgs;
+class KAboutData;
+class KCmdLineArgsPrivate;
+class KCmdLineArgs
+{
+  friend class KApplication;
+  friend class KUniqueApplication;
+  friend class QPtrList<KCmdLineArgs>;
+public:
+   static void init(int _argc, char **_argv, const char *_appname,
+                    const char* programName, const char *_description,
+                    const char *_version, bool noKApp = false);
+
+
+
+  static void init(int _argc, char **_argv,
+                   const char *_appname, const char *_description,
+                   const char *_version, bool noKApp = false) __attribute__ ((deprecated));
+  static void init(int _argc, char **_argv,
+                   const KAboutData *about, bool noKApp = false);
+  static void init(const KAboutData *about);
+  static void addCmdLineOptions( const KCmdLineOptions *options,
+                                 const char *name=0, const char *id = 0,
+                                 const char *afterId=0);
+  static KCmdLineArgs *parsedArgs(const char *id=0);
+  static QString cwd();
+
+
+
+
+
+  static const char *appName();
+  static void usage(const char *id = 0);
+
+
+
+
+
+  static void usage(const QString &error);
+
+
+
+
+
+
+
+  static void enable_i18n();
+  QCString getOption(const char *option) const;
+  QCStringList getOptionList(const char *option) const;
+  bool isSet(const char *option) const;
+
+
+
+
+
+
+
+  int count() const;
+  const char *arg(int n) const;
+  KURL url(int n) const;
+
+
+
+
+
+
+
+  static KURL makeURL( const char * urlArg );
+
+
+
+
+
+
+
+  static void setCwd( char * cwd ) { mCwd = cwd; }
+
+
+
+
+  void clear();
+
+
+protected:
+
+
+
+
+  KCmdLineArgs( const KCmdLineOptions *_options, const char *_id,
+                const char *_name);
+  ~KCmdLineArgs();
+
+private:
+
+
+
+
+
+  static void findOption(const char *_opt, QCString opt, int &i, bool enabled, bool &moreOptions);
+
+
+
+
+
+
+
+  static void parseAllArgs();
+
+
+
+
+
+
+  static int *qt_argc();
+
+
+
+
+
+
+
+  static char ***qt_argv();
+  static void removeArgs(const char *id);
+
+
+
+
+
+
+
+  static void saveAppArgs( QDataStream &);
+
+
+
+
+
+
+  static void loadAppArgs( QDataStream &);
+
+
+
+
+
+
+  void setOption(const QCString &option, bool enabled);
+
+
+
+
+
+
+  void setOption(const QCString &option, const char *value);
+
+
+
+
+
+
+  void addArgument(const char *argument);
+
+
+
+
+
+
+  void save( QDataStream &) const;
+
+
+
+
+
+
+  void load( QDataStream &);
+  static void initIgnore(int _argc, char **_argv, const char *_appname);
+
+  static void printQ(const QString &msg);
+
+  const KCmdLineOptions *options;
+  const char *name;
+  const char *id;
+  KCmdLineParsedOptions *parsedOptionList;
+  KCmdLineParsedArgs *parsedArgList;
+  bool isQt;
+
+  static KCmdLineArgsList *argsList;
+  static const KAboutData *about;
+
+  static int argc;
+  static char **argv;
+  static bool parsed;
+  static bool ignoreUnknown;
+  static char *mCwd;
+  static bool parseArgs;
+
+  KCmdLineArgsPrivate *d;
+};
+
+class KAboutPersonPrivate;
+class KAboutDataPrivate;
+class KAboutPerson
+{
+public:
+    KAboutPerson( const char *name, const char *task,
+                  const char *emailAddress, const char *webAddress )
+    {
+      mName = name;
+      mTask = task;
+      mEmailAddress = emailAddress;
+      mWebAddress = webAddress;
+    }
+
+
+
+    KAboutPerson() {}
+
+
+
+
+
+
+    QString name() const;
+
+
+
+
+
+
+    QString task() const;
+
+
+
+
+
+
+    QString emailAddress() const;
+
+
+
+
+
+
+    QString webAddress() const;
+
+private:
+    const char *mName;
+    const char *mTask;
+    const char *mEmailAddress;
+    const char *mWebAddress;
+
+    KAboutPersonPrivate *d;
+};
+
+class KAboutTranslatorPrivate;
+class KAboutTranslator
+{
+public:
+
+
+
+
+
+
+
+    KAboutTranslator(const QString & name=QString::null,
+                     const QString & emailAddress=QString::null);
+
+
+
+
+
+
+    QString name() const;
+
+
+
+
+
+
+    QString emailAddress() const;
+
+private:
+    QString mName;
+    QString mEmail;
+    KAboutTranslatorPrivate* d;
+};
+class KAboutData
+{
+  public:
+
+
+
+    enum LicenseKey
+    {
+      License_Custom = -2,
+      License_File = -1,
+      License_Unknown = 0,
+      License_GPL = 1,
+      License_GPL_V2 = 1,
+      License_LGPL = 2,
+      License_LGPL_V2 = 2,
+      License_BSD = 3,
+      License_Artistic = 4,
+      License_QPL = 5,
+      License_QPL_V1_0 = 5
+    };
+
+  public:
+    KAboutData( const char *appName,
+                const char *programName,
+                const char *version,
+                const char *shortDescription = 0,
+                int licenseType = License_Unknown,
+                const char *copyrightStatement = 0,
+                const char *text = 0,
+                const char *homePageAddress = 0,
+                const char *bugsEmailAddress = "submit@bugs.kde.org"
+                );
+
+     ~KAboutData();
+    void addAuthor( const char *name,
+                    const char *task=0,
+                    const char *emailAddress=0,
+                    const char *webAddress=0 );
+    void addCredit( const char *name,
+                    const char *task=0,
+                    const char *emailAddress=0,
+                    const char *webAddress=0 );
+    void setTranslator(const char* name, const char* emailAddress);
+    void setLicenseText( const char *license );
+
+
+
+
+
+
+    void setLicenseTextFile( const QString &file );
+
+
+
+
+
+    const char *appName() const;
+
+
+
+
+
+    QString programName() const;
+
+
+
+
+
+    QString version() const;
+
+
+
+
+
+
+    QString shortDescription() const;
+
+
+
+
+
+
+    QString homepage() const;
+
+
+
+
+
+    QString bugAddress() const;
+
+
+
+
+
+    const QValueList<KAboutPerson> authors() const;
+
+
+
+
+
+    const QValueList<KAboutPerson> credits() const;
+
+
+
+
+
+    const QValueList<KAboutTranslator> translators() const;
+
+
+
+
+
+    static QString aboutTranslationTeam();
+
+
+
+
+
+    QString otherText() const;
+    QString license() const;
+
+
+
+
+
+    QString copyrightStatement() const;
+
+  private:
+    const char *mAppName;
+    const char *mProgramName;
+    const char *mVersion;
+    const char *mShortDescription;
+    int mLicenseKey;
+    const char *mCopyrightStatement;
+    const char *mOtherText;
+    const char *mHomepageAddress;
+    const char *mBugEmailAddress;
+    QValueList<KAboutPerson> mAuthorList;
+    QValueList<KAboutPerson> mCreditList;
+    const char *mLicenseText;
+
+    KAboutDataPrivate *d;
+};
+
+
+
+
+
+
+class KURL;
+
+
+
+
+
+
+
+class KGlobalSettings
+{
+  public:
+    static int dndEventDelay();
+
+
+
+
+
+
+
+    static bool singleClick();
+
+
+
+
+
+
+
+    enum TearOffHandle {
+      Disable = 0,
+      ApplicationLevel,
+      Enable
+    };
+
+
+
+
+
+
+    static TearOffHandle insertTearOffHandle();
+
+
+
+
+
+    static bool changeCursorOverIcon();
+
+
+
+
+
+
+    static bool visualActivate();
+
+
+
+
+
+
+    static unsigned int visualActivateSpeed();
+
+
+
+
+
+
+    static int autoSelectDelay();
+
+
+
+
+
+
+
+    static int contextMenuKey ();
+
+
+
+
+
+
+
+    static bool showContextMenusOnPress ();
+
+
+
+
+
+
+   enum Completion {
+
+
+
+       CompletionNone=1,
+
+
+
+       CompletionAuto,
+
+
+
+       CompletionMan,
+
+
+
+       CompletionShell,
+
+
+
+       CompletionPopup,
+
+
+
+
+       CompletionPopupAuto
+   };
+
+
+
+
+
+
+    static Completion completionMode();
+
+
+
+
+    struct KMouseSettings
+    {
+        enum { RightHanded = 0, LeftHanded = 1 };
+        int handed;
+    };
+
+
+
+
+
+    static KMouseSettings & mouseSettings();
+
+
+
+
+
+    static QString desktopPath() { initStatic(); return *s_desktopPath; }
+
+
+
+
+
+    static QString autostartPath() { initStatic(); return *s_autostartPath; }
+
+
+
+
+
+    static QString trashPath() { initStatic(); return *s_trashPath; }
+
+
+
+
+
+    static QString documentPath() { initStatic(); return *s_documentPath; }
+
+
+
+
+
+
+    static QColor toolBarHighlightColor();
+
+
+
+
+
+    static QColor inactiveTitleColor();
+
+
+
+
+
+    static QColor inactiveTextColor();
+
+
+
+
+
+    static QColor activeTitleColor();
+
+
+
+
+
+    static QColor activeTextColor();
+
+
+
+
+
+
+    static int contrast();
+
+
+
+
+
+
+    static QColor baseColor();
+
+
+
+
+
+
+    static QColor textColor();
+
+
+
+
+
+    static QColor linkColor();
+
+
+
+
+
+    static QColor visitedLinkColor();
+
+
+
+
+
+
+    static QColor highlightedTextColor();
+
+
+
+
+
+
+    static QColor highlightColor();
+    static QColor alternateBackgroundColor();
+    static QColor calculateAlternateBackgroundColor(const QColor& base);
+
+
+
+
+
+
+    static QFont generalFont();
+
+
+
+
+
+    static QFont fixedFont();
+
+
+
+
+
+    static QFont toolBarFont();
+
+
+
+
+
+    static QFont menuFont();
+
+
+
+
+
+    static QFont windowTitleFont();
+
+
+
+
+
+    static QFont taskbarFont();
+
+
+
+
+
+
+
+    static QFont largeFont(const QString &text = QString::null);
+
+
+
+
+
+
+
+    static bool isMultiHead();
+    static bool wheelMouseZooms();
+    static QRect splashScreenDesktopGeometry();
+    static QRect desktopGeometry(const QPoint& point);
+    static QRect desktopGeometry(QWidget* w);
+    static bool showIconsOnPushButtons();
+    static bool showFilePreview(const KURL &);
+
+private:
+
+
+
+    static void initStatic();
+
+
+
+    static void initColors();
+
+
+
+    static void rereadFontSettings();
+
+
+
+    static void rereadPathSettings();
+
+
+
+    static void rereadMouseSettings();
+
+
+    static QString* s_desktopPath;
+    static QString* s_autostartPath;
+    static QString* s_trashPath;
+    static QString* s_documentPath;
+    static QFont *_generalFont;
+    static QFont *_fixedFont;
+    static QFont *_toolBarFont;
+    static QFont *_menuFont;
+    static QFont *_windowTitleFont;
+    static QFont *_taskbarFont;
+    static QFont *_largeFont;
+    static QColor * kde2Gray;
+    static QColor * kde2Blue;
+    static QColor * kde2AlternateColor;
+    static KMouseSettings *s_mouseSettings;
+
+    friend class KApplication;
+};
+class KCrash
+{
+ private:
+  static const char *appName;
+  static const char *appPath;
+
+ public:
+
+
+
+
+  static void defaultCrashHandler (int signal);
+
+
+
+
+
+  typedef void (*HandlerType)(int);
+  static void setCrashHandler (HandlerType handler = defaultCrashHandler);
+
+
+
+
+
+  static HandlerType crashHandler() { return _crashHandler; }
+  static void setEmergencySaveFunction (HandlerType saveFunction = (HandlerType)0);
+
+
+
+
+  static HandlerType emergencySaveFunction() { return _emergencySaveFunction; }
+
+
+
+
+
+
+  static void setApplicationPath (QString path) { appPath = qstrdup(path.local8Bit().data()); }
+
+
+
+
+
+
+
+  static void setApplicationName (QString name) { appName = qstrdup(name.local8Bit().data()); }
+
+
+ protected:
+
+
+
+  static HandlerType _crashHandler;
+
+
+
+  static HandlerType _emergencySaveFunction;
+};
+
+
+
+
+inline QDataStream & operator << (QDataStream & str, bool b)
+{
+  str << Q_INT8(b);
+  return str;
+}
+
+inline QDataStream & operator >> (QDataStream & str, bool & b)
+{
+  Q_INT8 l;
+  str >> l;
+  b = bool(l);
+  return str;
+}
+class KInstance;
+class QTimer;
+class KLibrary;
+class KLibFactory;
+class KLibFactoryPrivate;
+class KLibLoaderPrivate;
+class KLibraryPrivate;
+
+class KLibrary : public QObject
+{
+    friend class KLibLoader;
+    friend class QAsciiDict<KLibrary>;
+
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+public:
+
+
+
+
+    KLibrary( const QString& libname, const QString& filename, void * handle );
+
+
+
+
+
+    QString name() const;
+
+
+
+
+
+    QString fileName() const;
+
+
+
+
+
+    KLibFactory* factory();
+    void* symbol( const char* name ) const;
+    bool hasSymbol( const char* name ) const;
+
+
+
+
+
+
+    void unload() const;
+
+private :
+    void slotObjectCreated( QObject *obj );
+    void slotObjectDestroyed();
+    void slotTimeout();
+
+private:
+
+
+
+
+    ~KLibrary();
+
+    QString m_libname;
+    QString m_filename;
+    KLibFactory* m_factory;
+    void * m_handle;
+    QPtrList<QObject> m_objs;
+    QTimer *m_timer;
+    KLibraryPrivate *d;
+};
+
+class KLibWrapPrivate;
+class KLibLoader : public QObject
+{
+    friend class KLibrary;
+
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+public:
+
+
+
+
+
+    ~KLibLoader();
+    KLibFactory* factory( const char* libname );
+    virtual KLibrary* library( const char* libname );
+    KLibrary* globalLibrary( const char *name );
+    QString lastErrorMessage() const;
+    virtual void unloadLibrary( const char *libname );
+
+
+
+
+
+
+
+    static KLibLoader* self();
+    static void cleanUp();
+    static QString findLibrary( const char * name, const KInstance * instance = KGlobal::instance() );
+
+protected:
+    KLibLoader( QObject* parent = 0, const char* name = 0 );
+
+private :
+    void slotLibraryDestroyed();
+private:
+    void close_pending( KLibWrapPrivate * );
+    QAsciiDict<KLibWrapPrivate> m_libs;
+
+    static KLibLoader* s_self;
+
+protected:
+    virtual void virtual_hook( int id, void* data );
+private:
+    KLibLoaderPrivate *d;
+};
+class KLibFactory : public QObject
+{
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+public:
+
+
+
+
+
+    KLibFactory( QObject* parent = 0, const char* name = 0 );
+    virtual ~KLibFactory();
+     QObject* create( QObject* parent = 0, const char* name = 0, const char* classname = "QObject", const QStringList &args = QStringList() );
+
+protected:
+
+
+
+
+    void objectCreated( QObject *obj );
+
+
+protected:
+    virtual QObject* createObject( QObject* parent = 0, const char* name = 0,
+                                   const char* classname = "QObject",
+                                   const QStringList &args = QStringList() ) = 0;
+
+
+protected:
+    virtual void virtual_hook( int id, void* data );
+private:
+    KLibFactoryPrivate *d;
+};
+
+
+
+
+class KMimeSourceFactoryPrivate;
+class KMimeSourceFactory : public QMimeSourceFactory
+{
+public:
+
+
+
+
+
+
+  KMimeSourceFactory (KIconLoader* loader = KGlobal::iconLoader());
+
+
+
+
+  virtual ~KMimeSourceFactory();
+  virtual QString makeAbsolute (const QString& abs_or_rel_name, const QString& context) const;
+
+protected:
+  virtual void virtual_hook( int id, void* data );
+private:
+  KMimeSourceFactoryPrivate* d;
+};
+
+
+
+class QKeySequence;
+ QDataStream &operator<<( QDataStream &, const QKeySequence & );
+ QDataStream &operator>>( QDataStream &, QKeySequence & );
+
+
+class QKeySequencePrivate;
+
+class QKeySequence : public Qt
+{
+public:
+    QKeySequence();
+    QKeySequence( const QString& key );
+    QKeySequence( int key );
+    QKeySequence( int k1, int k2, int k3 = 0, int k4 = 0 );
+    QKeySequence( const QKeySequence & );
+    ~QKeySequence();
+
+    uint count() const;
+    bool isEmpty() const;
+    Qt::SequenceMatch matches( const QKeySequence & ) const;
+
+    operator QString() const;
+    operator int () const;
+    int operator[]( uint ) const;
+    QKeySequence &operator=( const QKeySequence & );
+    bool operator==( const QKeySequence& ) const;
+    bool operator!= ( const QKeySequence& ) const;
+
+private:
+    static int decodeString( const QString & );
+    static QString encodeString( int );
+    int assign( QString );
+    void setKey( int key, int index );
+
+    QKeySequencePrivate* d;
+
+    friend QDataStream &operator<<( QDataStream &, const QKeySequence & );
+    friend QDataStream &operator>>( QDataStream &, QKeySequence & );
+    friend class QAccelManager;
+};
+
+
+class QKeyEvent;
+class KKeyNative;
+class KKey
+{
+ public:
+
+
+
+
+        enum { MOD_FLAG_COUNT = 4 };
+        enum { QtWIN = (Qt::ALT << 1) };
+
+
+
+
+        enum ModFlag {
+                SHIFT = 0x01,
+                CTRL = 0x02,
+                ALT = 0x04,
+                WIN = 0x08
+        };
+
+
+
+
+
+
+
+        KKey();
+
+
+
+
+
+
+        KKey( int keyQt );
+
+
+
+
+
+        KKey( const QKeySequence& keySeq );
+
+
+
+
+
+        KKey( const QKeyEvent* keyEvent );
+
+
+
+
+        KKey( const KKey& key );
+        KKey( const QString& key );
+
+
+
+        KKey( uint key, uint mod );
+        ~KKey();
+
+
+
+
+
+
+        void clear();
+
+
+
+
+
+
+
+        bool init( int keyQt );
+
+
+
+
+
+
+        bool init( const QKeySequence& keySeq );
+
+
+
+
+
+
+        bool init( const QKeyEvent* keyEvent );
+
+
+
+
+
+
+        bool init( const KKey& key );
+        bool init( const QString& key);
+
+
+
+
+        bool init( uint key, uint mod );
+
+
+
+
+        KKey& operator =( const KKey& key )
+                { init( key ); return *this; }
+        bool isNull() const;
+
+
+
+
+        bool isValidQt() const;
+
+
+
+
+        bool isValidNative() const;
+
+
+
+
+        uint sym() const;
+
+
+
+        uint modFlags() const;
+        int compare( const KKey& key ) const;
+
+
+
+
+
+        bool operator == ( const KKey& key ) const
+                { return compare( key ) == 0; }
+
+
+
+
+        bool operator != ( const KKey& key ) const
+                { return compare( key ) != 0; }
+
+
+
+
+        bool operator < ( const KKey& key ) const
+                { return compare( key ) < 0; }
+
+
+
+
+
+
+
+        int keyCodeQt() const;
+
+
+
+
+
+
+        QString toString() const;
+
+
+
+
+        QString toStringInternal() const;
+
+
+
+
+
+        void simplify();
+
+
+
+
+
+
+
+        static KKey& null();
+
+
+
+
+
+
+        static QString modFlagLabel( ModFlag f );
+
+ private:
+        uint m_sym;
+
+
+
+        uint m_mod;
+
+ private:
+        friend class KKeyNative;
+};
+class KKeySequence
+{
+ public:
+
+        enum { MAX_KEYS = 4 };
+
+
+
+
+
+
+
+        KKeySequence();
+
+
+
+
+
+        KKeySequence( const QKeySequence& keySeq );
+
+
+
+
+
+        KKeySequence( const KKey& key );
+
+
+
+
+
+        KKeySequence( const KKeyNative& key );
+
+
+
+
+
+        KKeySequence( const KKeySequence& keySeq );
+        KKeySequence( const QString& keySeq );
+
+        ~KKeySequence();
+
+
+
+
+
+
+        void clear();
+
+
+
+
+
+
+        bool init( const QKeySequence& keySeq );
+
+
+
+
+
+
+        bool init( const KKey& key );
+
+
+
+
+
+
+        bool init( const KKeyNative& key );
+
+
+
+
+
+
+        bool init( const KKeySequence& keySeq );
+        bool init( const QString& key );
+
+
+
+
+        KKeySequence& operator =( const KKeySequence& seq )
+                { init( seq ); return *this; }
+
+
+
+
+
+
+        uint count() const;
+        const KKey& key( uint i ) const;
+
+
+
+
+        bool isTriggerOnRelease() const;
+        bool setKey( uint i, const KKey& key );
+
+
+
+
+        void setTriggerOnRelease( bool );
+        bool isNull() const;
+
+
+
+
+
+
+        bool startsWith( const KKeySequence& keySeq ) const;
+        int compare( const KKeySequence& keySeq ) const;
+
+
+
+
+
+        bool operator == ( const KKeySequence& seq ) const
+                { return compare( seq ) == 0; }
+
+
+
+
+
+        bool operator != ( const KKeySequence& seq ) const
+                { return compare( seq ) != 0; }
+
+
+
+
+
+        bool operator < ( const KKeySequence& seq ) const
+                { return compare( seq ) < 0; }
+
+
+
+
+
+
+        QKeySequence qt() const;
+
+
+
+
+
+
+
+        int keyCodeQt() const;
+
+
+
+
+
+
+
+        QString toString() const;
+
+
+
+
+        QString toStringInternal() const;
+
+
+
+
+
+
+
+        static KKeySequence& null();
+
+ protected:
+        uchar m_nKeys;
+        uchar m_bTriggerOnRelease;
+
+        KKey m_rgvar[MAX_KEYS];
+
+ private:
+        class KKeySequencePrivate* d;
+        friend class KKeyNative;
+};
+class KShortcut
+{
+ public:
+
+
+
+
+        enum { MAX_SEQUENCES = 2 };
+
+
+
+
+
+
+
+        KShortcut();
+
+
+
+
+
+
+
+        KShortcut( int keyQt );
+
+
+
+
+
+
+        KShortcut( const QKeySequence& keySeq );
+
+
+
+
+
+
+        KShortcut( const KKey& key );
+
+
+
+
+
+
+        KShortcut( const KKeySequence& keySeq );
+
+
+
+
+
+        KShortcut( const KShortcut& shortcut );
+        KShortcut( const char* shortcut );
+        KShortcut( const QString& shortcut );
+        ~KShortcut();
+
+
+
+
+
+
+        void clear();
+
+
+
+
+
+
+
+        bool init( int keyQt );
+
+
+
+
+
+        bool init( const QKeySequence& keySeq );
+
+
+
+
+
+        bool init( const KKey& key );
+
+
+
+
+
+        bool init( const KKeySequence& keySeq );
+
+
+
+
+
+        bool init( const KShortcut& shortcut );
+        bool init( const QString& shortcut );
+
+
+
+
+        KShortcut& operator =( const KShortcut& cut )
+                { init( cut ); return *this; }
+
+
+
+
+
+
+
+        uint count() const;
+        const KKeySequence& seq( uint i ) const;
+        int keyCodeQt() const;
+        bool isNull() const;
+        int compare( const KShortcut& shortcut ) const;
+
+
+
+
+
+        bool operator == ( const KShortcut& cut ) const
+                { return compare( cut ) == 0; }
+
+
+
+
+
+        bool operator != ( const KShortcut& cut ) const
+                { return compare( cut ) != 0; }
+
+
+
+
+
+        bool operator < ( const KShortcut& cut ) const
+                { return compare( cut ) < 0; }
+
+
+
+
+
+
+
+        bool contains( const KKey& key ) const;
+
+
+
+
+
+
+
+        bool contains( const KKeyNative& key ) const;
+
+
+
+
+
+
+        bool contains( const KKeySequence& keySeq ) const;
+        bool setSeq( uint i, const KKeySequence& keySeq );
+        bool append( const KKeySequence& keySeq );
+        bool append( const KKey& spec );
+        bool append( const KShortcut& cut );
+
+
+
+
+
+        operator QKeySequence () const;
+        QString toString() const;
+
+
+
+
+        QString toStringInternal( const KShortcut* pcutDefault = 0 ) const;
+
+
+
+
+
+
+
+        static KShortcut& null();
+
+ protected:
+        uint m_nSeqs;
+        KKeySequence m_rgseq[MAX_SEQUENCES];
+
+ private:
+        class KShortcutPrivate* d;
+        friend class KKeyNative;
+
+
+ public:
+        operator int () const { return keyCodeQt(); }
+
+};
+
+
+class QKeyEvent;
+class KAccelActions;
+namespace KStdAccel
+{
+
+
+
+
+  enum StdAccel {
+    AccelNone,
+
+    Open, New, Close, Save,
+
+    Print,
+    Quit,
+
+    Undo, Redo, Cut, Copy, Paste, SelectAll, Deselect, DeleteWordBack,
+    DeleteWordForward, Find, FindNext, FindPrev, Replace,
+
+    Home, End, Prior, Next, GotoLine, AddBookmark, ZoomIn, ZoomOut,
+    Up, Back, Forward, Reload, PopupMenuContext, ShowMenubar,
+
+    Help, WhatsThis,
+
+    TextCompletion, PrevCompletion, NextCompletion, SubstringCompletion,
+    RotateUp, RotateDown,
+
+
+    TabNext, TabPrev,
+
+    FullScreen
+
+
+    , WhatThis = WhatsThis
+
+  };
+
+
+
+
+
+  const KShortcut& shortcut(StdAccel id);
+
+
+
+
+
+
+  QString name(StdAccel id);
+
+
+
+
+
+
+  QString label(StdAccel id);
+
+
+
+
+
+
+  QString whatsThis(StdAccel id);
+  StdAccel findStdAccel( const KKeySequence &keySeq );
+
+
+
+
+
+
+
+  KShortcut shortcutDefault(StdAccel id);
+
+
+
+
+
+
+  KShortcut shortcutDefault3(StdAccel id);
+
+
+
+
+
+
+  KShortcut shortcutDefault4(StdAccel id);
+
+
+
+
+
+  const KShortcut& open();
+
+
+
+
+
+  const KShortcut& openNew();
+
+
+
+
+
+  const KShortcut& close();
+
+
+
+
+
+  const KShortcut& save();
+
+
+
+
+
+  const KShortcut& print();
+
+
+
+
+
+  const KShortcut& quit();
+
+
+
+
+
+  const KShortcut& undo();
+
+
+
+
+
+  const KShortcut& redo();
+
+
+
+
+
+  const KShortcut& cut();
+
+
+
+
+
+  const KShortcut& copy();
+
+
+
+
+
+  const KShortcut& paste();
+
+
+
+
+
+  const KShortcut& selectAll();
+
+
+
+
+
+  const KShortcut& deleteWordBack();
+
+
+
+
+
+  const KShortcut& deleteWordForward();
+
+
+
+
+
+  const KShortcut& find();
+
+
+
+
+
+  const KShortcut& findNext();
+
+
+
+
+
+  const KShortcut& findPrev();
+
+
+
+
+
+  const KShortcut& replace();
+
+
+
+
+
+  const KShortcut& zoomIn();
+
+
+
+
+
+  const KShortcut& zoomOut();
+
+
+
+
+
+  const KShortcut& insert();
+
+
+
+
+
+  const KShortcut& home();
+
+
+
+
+
+  const KShortcut& end();
+
+
+
+
+
+  const KShortcut& prior();
+
+
+
+
+
+  const KShortcut& next();
+
+
+
+
+
+  const KShortcut& gotoLine();
+
+
+
+
+
+  const KShortcut& addBookmark();
+
+
+
+
+
+
+  const KShortcut& tabNext();
+
+
+
+
+
+
+  const KShortcut& tabPrev();
+
+
+
+
+
+
+  const KShortcut& fullScreen();
+
+
+
+
+
+  const KShortcut& help();
+
+
+
+
+
+  const KShortcut& completion();
+
+
+
+
+
+
+  const KShortcut& prevCompletion();
+
+
+
+
+
+
+  const KShortcut& nextCompletion();
+
+
+
+
+
+
+  const KShortcut& substringCompletion();
+
+
+
+
+
+  const KShortcut& rotateUp();
+
+
+
+
+
+  const KShortcut& rotateDown();
+
+
+
+
+
+  const KShortcut& popupMenuContext();
+
+
+
+
+
+  const KShortcut& whatsThis();
+
+
+
+
+
+  const KShortcut& reload();
+
+
+
+
+
+  const KShortcut& up();
+
+
+
+
+
+  const KShortcut& back();
+
+
+
+
+
+  const KShortcut& forward();
+
+
+
+
+
+  const KShortcut& showMenubar();
+
+
+
+
+
+
+  QString action(StdAccel id) ;
+
+
+
+
+  QString description(StdAccel id) ;
+
+
+
+
+  int key(StdAccel) ;
+
+
+
+
+  int defaultKey(StdAccel accel) ;
+  bool isEqual(const QKeyEvent* pEvent, int keyQt) ;
+
+
+}
+
+class QAccelPrivate;
+
+class QAccel : public QObject
+{
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+public:
+    QAccel( QWidget *parent, const char *name=0 );
+    QAccel( QWidget* watch, QObject *parent, const char *name=0 );
+    ~QAccel();
+
+    bool isEnabled() const;
+    void setEnabled( bool );
+
+    uint count() const;
+
+    int insertItem( const QKeySequence& key, int id=-1);
+    void removeItem( int id );
+    void clear();
+
+    QKeySequence key( int id );
+    int findKey( const QKeySequence& key ) const;
+
+    bool isItemEnabled( int id ) const;
+    void setItemEnabled( int id, bool enable );
+
+    bool connectItem( int id, const QObject *receiver, const char* member );
+    bool disconnectItem( int id, const QObject *receiver, const char* member );
+
+    void repairEventFilter();
+
+    void setWhatsThis( int id, const QString& );
+    QString whatsThis( int id ) const;
+    void setIgnoreWhatsThis( bool );
+    bool ignoreWhatsThis() const;
+
+    static QKeySequence shortcutKey( const QString & );
+    static QString keyToString(QKeySequence k );
+    static QKeySequence stringToKey( const QString & );
+
+protected:
+    void activated( int id );
+    void activatedAmbiguously( int id );
+
+protected:
+    bool eventFilter( QObject *, QEvent * );
+
+private:
+    QAccelPrivate * d;
+
+private:
+
+    QAccel( const QAccel & );
+    QAccel &operator=( const QAccel & );
+
+    friend class QAccelPrivate;
+    friend class QAccelManager;
+};
+
+
+
+
+class QPopupMenu;
+class QWidget;
+class KAccelAction;
+class KAccelActions;
+class KConfigBase;
+
+class KAccelPrivate;
+class KAccel : public QAccel
+{
+        public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+ public:
+
+
+
+
+
+
+
+        KAccel( QWidget* pParent, const char* psName = 0 );
+        KAccel( QWidget* watch, QObject* parent, const char* psName = 0 );
+        virtual ~KAccel();
+
+
+
+
+
+
+        KAccelActions& actions();
+
+
+
+
+
+
+        const KAccelActions& actions() const;
+
+
+
+
+
+        bool isEnabled();
+
+
+
+
+
+        void setEnabled( bool bEnabled );
+
+
+
+
+
+
+        bool getAutoUpdate();
+        bool setAutoUpdate( bool bAuto );
+        KAccelAction* insert( const QString& sAction, const QString& sLabel, const QString& sWhatsThis,
+                         const KShortcut& cutDef,
+                         const QObject* pObjSlot, const char* psMethodSlot,
+                         bool bConfigurable = true, bool bEnabled = true );
+
+
+
+
+        KAccelAction* insert( const QString& sAction, const QString& sLabel, const QString& sWhatsThis,
+                         const KShortcut& cutDef3, const KShortcut& cutDef4,
+                         const QObject* pObjSlot, const char* psMethodSlot,
+                         bool bConfigurable = true, bool bEnabled = true );
+        KAccelAction* insert( const char* psAction, const KShortcut& cutDef,
+                         const QObject* pObjSlot, const char* psMethodSlot,
+                         bool bConfigurable = true, bool bEnabled = true );
+
+
+
+
+
+
+        KAccelAction* insert( KStdAccel::StdAccel id,
+                         const QObject* pObjSlot, const char* psMethodSlot,
+                         bool bConfigurable = true, bool bEnabled = true );
+
+
+
+
+
+
+
+        KAccelAction* insert( const QString& sName, const QString& sLabel );
+
+
+
+
+
+
+
+        bool remove( const QString& sAction );
+        bool updateConnections();
+
+
+
+
+
+
+        const KShortcut& shortcut( const QString& sAction ) const;
+
+
+
+
+
+
+
+        bool setShortcut( const QString& sAction, const KShortcut &shortcut );
+        bool setSlot( const QString& sAction, const QObject* pObjSlot, const char* psMethodSlot );
+
+
+
+
+
+
+        bool setEnabled( const QString& sAction, bool bEnabled );
+
+
+
+
+
+
+        const QString& configGroup() const;
+
+
+
+
+
+
+        void setConfigGroup( const QString &name );
+        bool readSettings( KConfigBase* pConfig = 0 );
+        bool writeSettings( KConfigBase* pConfig = 0 ) const;
+
+
+
+
+        void emitKeycodeChanged();
+
+ protected:
+
+
+
+        void keycodeChanged();
+
+
+ public:
+
+
+
+
+        bool insertItem( const QString& sLabel, const QString& sAction,
+                         const char* psKey,
+                         int nIDMenu = 0, QPopupMenu* pMenu = 0, bool bConfigurable = true ) __attribute__ ((deprecated));
+
+
+
+        bool insertItem( const QString& sLabel, const QString& sAction,
+                         int key,
+                         int nIDMenu = 0, QPopupMenu* pMenu = 0, bool bConfigurable = true ) __attribute__ ((deprecated));
+
+
+
+        bool insertStdItem( KStdAccel::StdAccel id, const QString& descr = QString::null ) __attribute__ ((deprecated));
+
+
+
+        bool connectItem( const QString& sAction, const QObject* pObjSlot, const char* psMethodSlot, bool bActivate = true ) __attribute__ ((deprecated));
+
+
+
+
+        __attribute__ ((deprecated)) bool connectItem( KStdAccel::StdAccel accel, const QObject* pObjSlot, const char* psMethodSlot )
+                { return insert( accel, pObjSlot, psMethodSlot ); }
+
+
+
+        bool removeItem( const QString& sAction ) __attribute__ ((deprecated));
+
+
+
+        bool setItemEnabled( const QString& sAction, bool bEnable ) __attribute__ ((deprecated));
+
+
+
+        void changeMenuAccel( QPopupMenu *menu, int id, const QString& action ) ;
+
+
+
+        void changeMenuAccel( QPopupMenu *menu, int id, KStdAccel::StdAccel accel ) ;
+
+
+
+        static int stringToKey( const QString& ) __attribute__ ((deprecated));
+        int currentKey( const QString& action ) const __attribute__ ((deprecated));
+
+
+
+
+
+
+
+        QString findKey( int key ) const __attribute__ ((deprecated));
+
+
+ protected:
+
+        virtual void virtual_hook( int id, void* data );
+ private:
+        class KAccelPrivate* d;
+        friend class KAccelPrivate;
+};
+
+
+
+
+
+
+
+class QGuardedPtrPrivate : public QObject, public QShared
+{
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+public:
+    QGuardedPtrPrivate( QObject* );
+    ~QGuardedPtrPrivate();
+
+    QObject* object() const;
+    void reconnect( QObject* );
+
+private :
+    void objectDestroyed();
+
+private:
+    QObject* obj;
+
+    QGuardedPtrPrivate( const QGuardedPtrPrivate & );
+    QGuardedPtrPrivate &operator=( const QGuardedPtrPrivate & );
+
+};
+
+template <class T>
+class QGuardedPtr
+{
+public:
+    QGuardedPtr() : priv( new QGuardedPtrPrivate( 0 ) ) {}
+
+    QGuardedPtr( T* o) {
+        priv = new QGuardedPtrPrivate( (QObject*)o );
+    }
+
+    QGuardedPtr(const QGuardedPtr<T> &p) {
+        priv = p.priv;
+        ref();
+    }
+
+    ~QGuardedPtr() { deref(); }
+
+    QGuardedPtr<T> &operator=(const QGuardedPtr<T> &p) {
+        if ( priv != p.priv ) {
+            deref();
+            priv = p.priv;
+            ref();
+        }
+        return *this;
+    }
+
+    QGuardedPtr<T> &operator=(T* o) {
+        if ( priv->count == 1 ) {
+            priv->reconnect( (QObject*)o );
+        } else {
+            deref();
+            priv = new QGuardedPtrPrivate( (QObject*)o );
+        }
+        return *this;
+    }
+
+    bool operator==( const QGuardedPtr<T> &p ) const {
+        return priv->object() == p.priv->object();
+    }
+
+    bool operator!= ( const QGuardedPtr<T>& p ) const {
+        return !( *this == p );
+    }
+
+    bool isNull() const { return !priv->object(); }
+
+    T* operator->() const { return (T*) priv->object(); }
+
+    T& operator*() const { return *( (T*)priv->object() ); }
+
+    operator T*() const { return (T*) priv->object(); }
+
+private:
+
+    void ref() { priv->ref(); }
+
+    void deref() {
+        if ( priv->deref() )
+            delete priv;
+    }
+
+    QGuardedPtrPrivate* priv;
+};
+
+
+
+
+inline QObject* QGuardedPtrPrivate::object() const
+{
+    return obj;
+}
+
+
+
+
+
+
+
+class QMenuData;
+class QTextView;
+class KCheckAccelerators : public QObject
+{
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+public:
+
+
+
+
+    KCheckAccelerators( QObject* parent );
+
+
+
+    bool eventFilter( QObject * , QEvent * e);
+
+private:
+    void checkAccelerators( bool automatic );
+    int key;
+    bool alwaysShow;
+    bool autoCheck;
+    bool block;
+    QTimer autoCheckTimer;
+    void createDialog(QWidget *parent, bool automatic);
+    QGuardedPtr<QDialog> drklash;
+    QTextView *drklash_view;
+
+private :
+    void autoCheckSlot();
+    void slotDisableCheck(bool);
+};
+
+
+
+
+
+template<class type>
+class QPtrDict
+
+
+
+        : public QGDict
+
+{
+public:
+    QPtrDict(int size=17) : QGDict(size,PtrKey,0,0) {}
+    QPtrDict( const QPtrDict<type> &d ) : QGDict(d) {}
+   ~QPtrDict() { clear(); }
+    QPtrDict<type> &operator=(const QPtrDict<type> &d)
+                        { return (QPtrDict<type>&)QGDict::operator=(d); }
+    uint count() const { return QGDict::count(); }
+    uint size() const { return QGDict::size(); }
+    bool isEmpty() const { return QGDict::count() == 0; }
+    void insert( void *k, const type *d )
+                                        { QGDict::look_ptr(k,(Item)d,1); }
+    void replace( void *k, const type *d )
+                                        { QGDict::look_ptr(k,(Item)d,2); }
+    bool remove( void *k ) { return QGDict::remove_ptr(k); }
+    type *take( void *k ) { return (type*)QGDict::take_ptr(k); }
+    type *find( void *k ) const
+                { return (type *)((QGDict*)this)->QGDict::look_ptr(k,0,0); }
+    type *operator[]( void *k ) const
+                { return (type *)((QGDict*)this)->QGDict::look_ptr(k,0,0); }
+    void clear() { QGDict::clear(); }
+    void resize( uint n ) { QGDict::resize(n); }
+    void statistics() const { QGDict::statistics(); }
+
+
+
+
+
+
+
+private:
+    void deleteItem( Item d );
+};
+
+
+template<> inline void QPtrDict<void>::deleteItem( QPtrCollection::Item )
+{
+}
+
+
+template<class type>
+inline void QPtrDict<type>::deleteItem( QPtrCollection::Item d )
+{
+    if ( del_item ) delete (type *)d;
+}
+
+template<class type>
+class QPtrDictIterator : public QGDictIterator
+{
+public:
+    QPtrDictIterator(const QPtrDict<type> &d) :QGDictIterator((QGDict &)d) {}
+   ~QPtrDictIterator() {}
+    uint count() const { return dict->count(); }
+    bool isEmpty() const { return dict->count() == 0; }
+    type *toFirst() { return (type *)QGDictIterator::toFirst(); }
+    operator type *() const { return (type *)QGDictIterator::get(); }
+    type *current() const { return (type *)QGDictIterator::get(); }
+    void *currentKey() const { return QGDictIterator::getKeyPtr(); }
+    type *operator()() { return (type *)QGDictIterator::operator()(); }
+    type *operator++() { return (type *)QGDictIterator::operator++(); }
+    type *operator+=(uint j) { return (type *)QGDictIterator::operator+=(j);}
+};
+class KMacroExpanderBase {
+
+public:
+
+
+
+
+    KMacroExpanderBase( QChar c = '%' );
+
+
+
+
+    virtual ~KMacroExpanderBase();
+
+
+
+
+
+
+    void expandMacros( QString &str );
+    bool expandMacrosShellQuote( QString &str, uint &pos );
+
+
+
+
+
+    bool expandMacrosShellQuote( QString &str );
+
+
+
+
+
+    void setEscapeChar( QChar c );
+
+
+
+
+
+    QChar escapeChar() const;
+
+protected:
+    virtual int expandPlainMacro( const QString &str, uint pos, QStringList &ret );
+    virtual int expandEscapedMacro( const QString &str, uint pos, QStringList &ret );
+
+private:
+    QChar escapechar;
+};
+
+
+
+
+
+
+namespace KMacroExpander {
+    QString expandMacros( const QString &str, const QMap<QChar,QString> &map, QChar c = '%' );
+    QString expandMacrosShellQuote( const QString &str, const QMap<QChar,QString> &map, QChar c = '%' );
+    QString expandMacros( const QString &str, const QMap<QString,QString> &map, QChar c = '%' );
+    QString expandMacrosShellQuote( const QString &str, const QMap<QString,QString> &map, QChar c = '%' );
+
+
+
+
+
+    QString expandMacros( const QString &str, const QMap<QChar,QStringList> &map, QChar c = '%' );
+    QString expandMacros( const QString &str, const QMap<QString,QStringList> &map, QChar c = '%' );
+
+
+
+
+
+
+
+    QString expandMacrosShellQuote( const QString &str, const QMap<QChar,QStringList> &map, QChar c = '%' );
+    QString expandMacrosShellQuote( const QString &str, const QMap<QString,QStringList> &map, QChar c = '%' );
+}
+namespace KShell {
+
+
+
+
+    enum Options {
+        NoOptions = 0,
+
+
+
+
+        TildeExpand = 1,
+        AbortOnMeta = 2
+    };
+
+
+
+
+    enum Errors {
+
+
+
+        NoError = 0,
+
+
+
+
+        BadQuoting,
+
+
+
+
+
+        FoundMeta
+    };
+    QStringList splitArgs( const QString &cmd, int flags = 0, int *err = 0 );
+
+
+
+
+
+
+
+    QString joinArgs( const QStringList &args );
+    QString joinArgsDQ( const QStringList &args );
+    QString joinArgs( const char * const *argv, int argc = -1 );
+    QString tildeExpand( const QString &path );
+    QString homeDir( const QString &user );
+
+}
+
+
+
+
+
+enum KSycocaType { KST_KSycocaEntry = 0, KST_KService = 1, KST_KServiceType = 2, KST_KMimeType = 3,
+                 KST_KFolderType = 4, KST_KDEDesktopMimeType = 5, KST_KExecMimeType = 6,
+                 KST_KServiceGroup = 7, KST_KImageIOFormat = 8, KST_KProtocolInfo = 9,
+                 KST_KCustom = 1000 };
+
+enum KSycocaFactoryId { KST_KServiceFactory = 1,
+                        KST_KServiceTypeFactory = 2,
+                        KST_KServiceGroupFactory = 3,
+                        KST_KImageIO = 4,
+                        KST_KProtocolInfoFactory = 5,
+                        KST_CTimeInfo = 100 };
+
+
+
+class KShared {
+public:
+
+
+
+
+   KShared() : count(0) { }
+
+
+
+
+
+   KShared( const KShared & ) : count(0) { }
+
+
+
+
+   KShared &operator=(const KShared & ) { return *this; }
+
+
+
+
+   void _KShared_ref() const { count++; }
+
+
+
+
+
+   void _KShared_unref() const { if (!--count) delete this; }
+
+
+
+
+
+
+   int _KShared_count() const { return count; }
+
+protected:
+   virtual ~KShared() { }
+private:
+   mutable int count;
+};
+template< class T >
+struct KSharedPtr
+{
+public:
+
+
+
+  KSharedPtr()
+    : ptr(0) { }
+
+
+
+
+  KSharedPtr( T* t )
+    : ptr(t) { if ( ptr ) ptr->_KShared_ref(); }
+
+
+
+
+
+  KSharedPtr( const KSharedPtr& p )
+    : ptr(p.ptr) { if ( ptr ) ptr->_KShared_ref(); }
+
+
+
+
+
+  ~KSharedPtr() { if ( ptr ) ptr->_KShared_unref(); }
+
+  KSharedPtr<T>& operator= ( const KSharedPtr<T>& p ) {
+    if ( ptr == p.ptr ) return *this;
+    if ( ptr ) ptr->_KShared_unref();
+    ptr = p.ptr;
+    if ( ptr ) ptr->_KShared_ref();
+    return *this;
+  }
+  KSharedPtr<T>& operator= ( T* p ) {
+    if ( ptr == p ) return *this;
+    if ( ptr ) ptr->_KShared_unref();
+    ptr = p;
+    if ( ptr ) ptr->_KShared_ref();
+    return *this;
+  }
+  bool operator== ( const KSharedPtr<T>& p ) const { return ( ptr == p.ptr ); }
+  bool operator!= ( const KSharedPtr<T>& p ) const { return ( ptr != p.ptr ); }
+  bool operator== ( const T* p ) const { return ( ptr == p ); }
+  bool operator!= ( const T* p ) const { return ( ptr != p ); }
+  bool operator!() const { return ( ptr == 0 ); }
+  operator T*() const { return ptr; }
+
+
+
+
+
+  T* data() { return ptr; }
+
+
+
+
+
+  const T* data() const { return ptr; }
+
+  const T& operator*() const { return *ptr; }
+  T& operator*() { return *ptr; }
+  const T* operator->() const { return ptr; }
+  T* operator->() { return ptr; }
+
+
+
+
+
+  int count() const { return ptr->_KShared_count(); }
+private:
+  T* ptr;
+};
+class QDataStream;
+class KSycocaEntry : public KShared
+{
+
+public:
+   virtual bool isType(KSycocaType t) const { return (t == KST_KSycocaEntry); }
+   virtual KSycocaType sycocaType() const { return KST_KSycocaEntry; }
+
+public:
+  typedef KSharedPtr<KSycocaEntry> Ptr;
+  typedef QValueList<Ptr> List;
+public:
+
+
+
+   KSycocaEntry(const QString &path) : mOffset(0), m_bDeleted(false), mPath(path) { }
+
+
+
+
+   static void read( QDataStream &s, QString &str );
+   static void read( QDataStream &s, QStringList &list );
+
+
+
+
+
+   KSycocaEntry( QDataStream &_str, int offset ) :
+              mOffset( offset ), m_bDeleted(false)
+   {
+     read(_str, mPath);
+   }
+
+
+
+
+   virtual QString name() const = 0;
+
+
+
+
+
+
+   QString entryPath() const { return mPath; }
+
+
+
+
+   virtual bool isValid() const = 0;
+
+
+
+
+   virtual bool isDeleted() const { return m_bDeleted; }
+
+
+
+
+
+   int offset() { return mOffset; }
+
+
+
+
+
+
+   virtual void save(QDataStream &s)
+     {
+       mOffset = s.device()->at();
+       s << (Q_INT32) sycocaType() << mPath;
+     }
+
+
+
+
+
+   virtual void load(QDataStream &) = 0;
+
+private:
+   int mOffset;
+protected:
+   bool m_bDeleted;
+   QString mPath;
+protected:
+   virtual void virtual_hook( int id, void* data );
+};
+class KProtocolInfo : public KSycocaEntry
+{
+  friend class KProtocolInfoFactory;
+  public: virtual bool isType(KSycocaType t) const { if (t == KST_KProtocolInfo) return true; return KSycocaEntry::isType(t);} virtual KSycocaType sycocaType() const { return KST_KProtocolInfo; } private:
+
+public:
+  typedef KSharedPtr<KProtocolInfo> Ptr;
+
+public:
+
+
+
+
+  KProtocolInfo( const QString & path);
+
+
+
+
+
+  virtual bool isValid() const { return !m_name.isEmpty(); }
+  virtual QString name() const { return m_name; }
+  static QStringList protocols();
+  static bool isKnownProtocol( const KURL &url );
+  static QString exec( const QString& protocol );
+
+
+
+
+  enum Type { T_STREAM,
+              T_FILESYSTEM,
+              T_NONE,
+              T_ERROR
+  };
+  static Type inputType( const KURL &url );
+  static Type outputType( const KURL &url );
+  static QStringList listing( const KURL &url );
+
+
+
+
+
+  struct ExtraField {
+    ExtraField() {}
+    ExtraField(const QString& _name, const QString& _type )
+      : name(_name), type(_type) {
+    }
+    QString name;
+    QString type;
+  };
+  typedef QValueList<ExtraField > ExtraFieldList;
+
+
+
+
+
+
+
+  static ExtraFieldList extraFields( const KURL& url );
+  static bool isSourceProtocol( const KURL &url );
+  static bool isHelperProtocol( const KURL &url );
+  static bool isFilterProtocol( const KURL &url );
+  static bool supportsListing( const KURL &url );
+  static bool supportsReading( const KURL &url );
+  static bool supportsWriting( const KURL &url );
+  static bool supportsMakeDir( const KURL &url );
+  static bool supportsDeleting( const KURL &url );
+  static bool supportsLinking( const KURL &url );
+  static bool supportsMoving( const KURL &url );
+  static bool canCopyFromFile( const KURL &url );
+  static bool canCopyToFile( const KURL &url );
+  static QString defaultMimetype( const KURL& url );
+  static QString icon( const QString& protocol );
+  static QString config( const QString& protocol );
+  static int maxSlaves( const QString& protocol );
+  static bool determineMimetypeFromExtension( const QString &protocol );
+  static QString docPath( const QString& protocol );
+  static QString protocolClass( const QString& protocol );
+
+
+public:
+
+
+
+
+  KProtocolInfo( QDataStream& _str, int offset);
+
+  virtual ~KProtocolInfo();
+
+
+
+
+
+  virtual void load(QDataStream& );
+
+
+
+
+
+  virtual void save(QDataStream& );
+
+
+
+
+
+  static Type inputType( const QString& protocol ) __attribute__ ((deprecated));
+
+  static Type outputType( const QString& protocol ) __attribute__ ((deprecated));
+
+
+
+
+
+
+  static QStringList listing( const QString& protocol ) __attribute__ ((deprecated));
+
+  static bool isSourceProtocol( const QString& protocol ) __attribute__ ((deprecated));
+
+  static bool isHelperProtocol( const QString& protocol ) __attribute__ ((deprecated));
+
+  static bool isFilterProtocol( const QString& protocol ) __attribute__ ((deprecated));
+
+  static bool isKnownProtocol( const QString& protocol ) __attribute__ ((deprecated));
+
+  static bool supportsListing( const QString& protocol ) __attribute__ ((deprecated));
+
+  static bool supportsReading( const QString& protocol ) __attribute__ ((deprecated));
+
+  static bool supportsWriting( const QString& protocol ) __attribute__ ((deprecated));
+
+  static bool supportsMakeDir( const QString& protocol ) __attribute__ ((deprecated));
+
+  static bool supportsDeleting( const QString& protocol ) __attribute__ ((deprecated));
+
+  static bool supportsLinking( const QString& protocol ) __attribute__ ((deprecated));
+
+  static bool supportsMoving( const QString& protocol ) __attribute__ ((deprecated));
+
+  static bool canCopyFromFile( const QString& protocol ) __attribute__ ((deprecated));
+
+  static bool canCopyToFile( const QString& protocol ) __attribute__ ((deprecated));
+
+  static QString defaultMimetype( const QString& protocol) __attribute__ ((deprecated));
+
+
+protected:
+  QString m_name;
+  QString m_exec;
+  Type m_inputType;
+  Type m_outputType;
+  QStringList m_listing;
+  bool m_isSourceProtocol;
+  bool m_isHelperProtocol;
+  bool m_supportsListing;
+  bool m_supportsReading;
+  bool m_supportsWriting;
+  bool m_supportsMakeDir;
+  bool m_supportsDeleting;
+  bool m_supportsLinking;
+  bool m_supportsMoving;
+  QString m_defaultMimetype;
+  bool m_determineMimetypeFromExtension;
+  QString m_icon;
+  bool m_canCopyFromFile;
+  bool m_canCopyToFile;
+  QString m_config;
+  int m_maxSlaves;
+protected:
+  virtual void virtual_hook( int id, void* data );
+private:
+  class KProtocolInfoPrivate;
+  KProtocolInfoPrivate* d;
+};
+
+QDataStream& operator>>( QDataStream& s, KProtocolInfo::ExtraField& field );
+QDataStream& operator<<( QDataStream& s, const KProtocolInfo::ExtraField& field );
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C"
+
+int mkstemps(char *, int);
+extern "C"
+
+unsigned long strlcat(char*, const char*, unsigned long);
+
+
+
+
+
+
+extern "C"
+
+unsigned long strlcpy(char*, const char*, unsigned long);
+
+
+
+
+
+
+
+
+
+
+class KStartupInfoId;
+class KStartupInfoData;
+
+class KStartupInfoPrivate;
+class KStartupInfo
+    : public QObject
+    {
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+    public:
+        enum {
+            CleanOnCantDetect = 1 << 0,
+            DisableKWinModule = 1 << 1,
+            AnnounceSilenceChanges = 1 << 2
+            };
+        KStartupInfo( int flags, QObject* parent = __null, const char* name = __null );
+        KStartupInfo( bool clean_on_cantdetect, QObject* parent = 0, const char* name = 0 );
+        virtual ~KStartupInfo();
+        static bool sendStartup( const KStartupInfoId& id, const KStartupInfoData& data );
+        static bool sendStartupX( Display* dpy, const KStartupInfoId& id,
+            const KStartupInfoData& data );
+        static bool sendChange( const KStartupInfoId& id, const KStartupInfoData& data );
+        static bool sendChangeX( Display* dpy, const KStartupInfoId& id,
+            const KStartupInfoData& data );
+
+
+
+
+
+
+        static bool sendFinish( const KStartupInfoId& id );
+
+
+
+
+
+
+
+        static bool sendFinishX( Display* dpy, const KStartupInfoId& id );
+        static bool sendFinish( const KStartupInfoId& id, const KStartupInfoData& data );
+        static bool sendFinishX( Display* dpy, const KStartupInfoId& id,
+            const KStartupInfoData& data );
+
+
+
+
+
+
+
+        static KStartupInfoId currentStartupIdEnv();
+
+
+
+        static void resetStartupEnv();
+
+
+
+
+
+
+
+        static void appStarted();
+
+
+
+
+
+
+        enum startup_t { NoMatch, Match, CantDetect };
+
+
+
+
+
+
+
+        startup_t checkStartup( WId w );
+        startup_t checkStartup( WId w, KStartupInfoId& id );
+        startup_t checkStartup( WId w, KStartupInfoData& data );
+        startup_t checkStartup( WId w, KStartupInfoId& id, KStartupInfoData& data );
+
+
+
+
+        void setTimeout( unsigned int secs );
+
+
+
+
+
+        static void setWindowStartupId( WId window, const QCString& id );
+
+
+
+
+
+        static QCString windowStartupId( WId w );
+
+
+
+        class Data;
+    protected:
+
+
+
+
+
+
+        void gotNewStartup( const KStartupInfoId& id, const KStartupInfoData& data );
+
+
+
+
+
+        void gotStartupChange( const KStartupInfoId& id, const KStartupInfoData& data );
+
+
+
+
+
+
+        void gotRemoveStartup( const KStartupInfoId& id, const KStartupInfoData& data );
+    protected:
+        virtual void customEvent( QCustomEvent* e_P );
+    private :
+        void startups_cleanup();
+        void startups_cleanup_no_age();
+        void got_message( const QString& msg );
+        void window_added( WId w );
+        void slot_window_added( WId w );
+    private:
+        void init( int flags );
+        friend class KStartupInfoPrivate;
+        void got_startup_info( const QString& msg_P, bool update_only_P );
+        void got_remove_startup_info( const QString& msg_P );
+        void new_startup_info_internal( const KStartupInfoId& id_P,
+            Data& data_P, bool update_only_P );
+        void remove_startup_info_internal( const KStartupInfoId& id_P );
+        void remove_startup_pids( const KStartupInfoId& id, const KStartupInfoData& data );
+        void remove_startup_pids( const KStartupInfoData& data );
+        startup_t check_startup_internal( WId w, KStartupInfoId* id, KStartupInfoData* data,
+            bool remove );
+        bool find_id( const QCString& id_P, KStartupInfoId* id_O,
+            KStartupInfoData* data_O, bool remove );
+        bool find_pid( pid_t pid_P, const QCString& hostname, KStartupInfoId* id_O,
+            KStartupInfoData* data_O, bool remove );
+        bool find_wclass( QCString res_name_P, QCString res_class_P,
+            KStartupInfoId* id_O, KStartupInfoData* data_O, bool remove );
+        static QCString get_window_hostname( WId w_P );
+        void startups_cleanup_internal( bool age_P );
+        void clean_all_noncompliant();
+        bool clean_on_cantdetect_;
+        unsigned int timeout;
+        KStartupInfoPrivate* d;
+    };
+
+class KStartupInfoIdPrivate;
+class KStartupInfoId
+    {
+    public:
+
+
+
+
+        bool operator==( const KStartupInfoId& id ) const;
+
+
+
+
+        bool operator!=( const KStartupInfoId& id ) const;
+
+
+
+
+        bool none() const;
+
+
+
+
+
+
+
+        void initId( const QCString& id = "" );
+
+
+
+
+        const QCString& id() const;
+
+
+
+
+        bool setupStartupEnv() const;
+
+
+
+        KStartupInfoId();
+
+
+
+        KStartupInfoId( const KStartupInfoId& data );
+        ~KStartupInfoId();
+        KStartupInfoId& operator=( const KStartupInfoId& data );
+        bool operator<( const KStartupInfoId& id ) const;
+    private:
+        KStartupInfoId( const QString& txt );
+        QString to_text() const;
+        friend class KStartupInfo;
+        KStartupInfoIdPrivate* d;
+    };
+
+class KStartupInfoDataPrivate;
+class KStartupInfoData
+    {
+    public:
+
+
+
+
+        void setBin( const QString& bin );
+
+
+
+
+        const QString& bin() const;
+
+
+
+        void setName( const QString& name );
+
+
+
+
+
+
+        const QString& findName() const;
+
+
+
+
+
+        const QString& name() const;
+
+
+
+
+        void setIcon( const QString& icon );
+
+
+
+
+
+
+        const QString& findIcon() const;
+
+
+
+
+        const QString& icon() const;
+
+
+
+
+
+        void setDesktop( int desktop );
+
+
+
+
+        int desktop() const;
+
+
+
+
+
+
+        void setWMClass( const QCString& wmclass );
+
+
+
+
+
+
+        const QCString findWMClass() const;
+
+
+
+
+
+        const QCString& WMClass() const;
+
+
+
+
+
+
+
+        void addPid( pid_t pid );
+
+
+
+
+        const QValueList< pid_t >& pids() const;
+
+
+
+
+
+        bool is_pid( pid_t pid ) const;
+
+
+
+
+
+        void setHostname( const QCString& hostname = QCString());
+
+
+
+
+        const QCString& hostname() const;
+
+        enum TriState { Yes, No, Unknown };
+
+
+
+
+
+
+        void setSilent( TriState state );
+
+
+
+
+
+
+        TriState silent() const;
+        void setTimestamp( unsigned long time );
+
+
+
+
+
+        unsigned long timestamp() const;
+
+
+
+
+
+
+        void update( const KStartupInfoData& data );
+
+
+
+
+        KStartupInfoData();
+
+
+
+
+        KStartupInfoData( const KStartupInfoData& data );
+        ~KStartupInfoData();
+        KStartupInfoData& operator=( const KStartupInfoData& data );
+    private:
+        KStartupInfoData( const QString& txt );
+        QString to_text() const;
+        void remove_pid( pid_t pid );
+        friend class KStartupInfo;
+        friend class KStartupInfo::Data;
+        KStartupInfoDataPrivate* d;
+    };
+
+
+class DCOPObjectProxy;
+class DCOPClientPrivate;
+class DCOPClientTransaction;
+
+typedef QValueList<QCString> QCStringList;
+class DCOPClient : public QObject
+{
+  public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+
+ public:
+
+
+  DCOPClient();
+
+
+
+
+  virtual ~DCOPClient();
+  static void setServerAddress(const QCString &addr);
+  bool attach();
+
+
+
+
+
+
+
+  void bindToApp();
+
+
+
+
+
+  bool detach();
+
+
+
+
+
+  bool isAttached() const;
+
+
+
+
+
+
+  bool isAttachedToForeignServer() const;
+
+
+
+
+
+  bool acceptCalls() const;
+
+
+
+
+
+
+
+  void setAcceptCalls(bool b);
+
+
+
+
+
+
+
+  bool qtBridgeEnabled();
+  void setQtBridgeEnabled(bool b);
+  QCString registerAs( const QCString &appId, bool addPID = true );
+
+
+
+
+
+  bool isRegistered() const;
+
+
+
+
+
+
+  QCString appId() const;
+
+
+
+
+
+  int socket() const;
+  void suspend();
+
+
+
+
+
+
+  void resume();
+
+
+
+
+
+
+
+  bool isSuspended() const;
+  bool send(const QCString &remApp, const QCString &remObj,
+            const QCString &remFun, const QByteArray &data);
+  bool send(const QCString &remApp, const QCString &remObj,
+            const QCString &remFun, const QString &data);
+  bool call(const QCString &remApp, const QCString &remObj,
+            const QCString &remFun, const QByteArray &data,
+            QCString& replyType, QByteArray &replyData,
+            bool useEventLoop , int timeout );
+
+
+
+
+  bool call(const QCString &remApp, const QCString &remObj,
+            const QCString &remFun, const QByteArray &data,
+            QCString& replyType, QByteArray &replyData,
+            bool useEventLoop=false);
+  int callAsync(const QCString &remApp, const QCString &remObj,
+                const QCString &remFun, const QByteArray &data,
+                QObject *callBackObj, const char *callBackSlot);
+  bool findObject(const QCString &remApp, const QCString &remObj,
+            const QCString &remFun, const QByteArray &data,
+            QCString &foundApp, QCString &foundObj,
+            bool useEventLoop , int timeout );
+
+
+
+
+
+  bool findObject(const QCString &remApp, const QCString &remObj,
+            const QCString &remFun, const QByteArray &data,
+            QCString &foundApp, QCString &foundObj,
+            bool useEventLoop=false);
+
+
+
+
+
+
+  void emitDCOPSignal( const QCString &object, const QCString &signal,
+                       const QByteArray &data);
+
+
+  void emitDCOPSignal( const QCString &signal, const QByteArray &data);
+  bool connectDCOPSignal( const QCString &sender, const QCString &senderObj,
+                          const QCString &signal,
+                          const QCString &receiverObj, const QCString &slot,
+                          bool Volatile);
+
+
+
+
+
+  bool connectDCOPSignal( const QCString &sender, const QCString &signal,
+                          const QCString &receiverObj, const QCString &slot,
+                          bool Volatile) __attribute__ ((deprecated));
+  bool disconnectDCOPSignal( const QCString &sender, const QCString &senderObj,
+                          const QCString &signal,
+                          const QCString &receiverObj, const QCString &slot);
+
+
+
+
+
+  bool disconnectDCOPSignal( const QCString &sender, const QCString &signal,
+                          const QCString &receiverObj, const QCString &slot) __attribute__ ((deprecated));
+  virtual bool process(const QCString &fun, const QByteArray &data,
+                       QCString& replyType, QByteArray &replyData);
+  DCOPClientTransaction *beginTransaction( );
+  void endTransaction( DCOPClientTransaction *t, QCString& replyType, QByteArray &replyData);
+  Q_INT32 transactionId() const;
+
+
+
+
+
+
+  bool isApplicationRegistered( const QCString& remApp);
+
+
+
+
+
+
+  QCStringList registeredApplications();
+  QCStringList remoteObjects( const QCString& remApp, bool *ok = 0 );
+  QCStringList remoteInterfaces( const QCString& remApp, const QCString& remObj , bool *ok = 0 );
+  QCStringList remoteFunctions( const QCString& remApp, const QCString& remObj , bool *ok = 0 );
+  bool receive(const QCString &app, const QCString &obj,
+               const QCString &fun, const QByteArray& data,
+               QCString& replyType, QByteArray &replyData);
+  bool find(const QCString &app, const QCString &obj,
+            const QCString &fun, const QByteArray& data,
+            QCString& replyType, QByteArray &replyData);
+  static QCString normalizeFunctionSignature( const QCString& fun );
+
+
+
+
+
+
+
+  QCString senderId() const;
+  void setDefaultObject( const QCString& objId );
+  QCString defaultObject() const;
+  void setNotifications( bool enabled );
+  void setDaemonMode( bool daemonMode );
+  static DCOPClient* mainClient();
+  static void setMainClient( DCOPClient* mainClient);
+
+
+
+
+  static void emergencyClose();
+
+
+
+
+
+
+  static const char *postMortemSender();
+
+  static const char *postMortemObject();
+
+  static const char *postMortemFunction();
+  static QCString dcopServerFile(const QCString &hostname=0);
+
+
+
+
+
+  static QCString dcopServerFileOld(const QCString &hostname=0) __attribute__ ((deprecated));
+
+
+
+
+  static QCString iceauthPath();
+
+protected:
+  void applicationRegistered( const QCString& appId );
+  void applicationRemoved( const QCString& appId );
+  void attachFailed(const QString &msg);
+  void blockUserInput( bool block );
+  void callBack(int, const QCString&, const QByteArray &);
+
+public :
+
+protected :
+
+
+
+
+  void processSocketData(int socknum);
+
+private :
+  void processPostedMessagesInternal();
+  void asyncReplyReady();
+
+public:
+  class ReplyStruct;
+
+
+
+
+  void handleAsyncReply(ReplyStruct *replyStruct);
+
+private:
+
+  bool isLocalTransactionFinished(Q_INT32 id, QCString &replyType, QByteArray &replyData);
+
+  bool attachInternal( bool registerAsAnonymous = true );
+
+  bool callInternal(const QCString &remApp, const QCString &remObj,
+            const QCString &remFun, const QByteArray &data,
+            QCString& replyType, QByteArray &replyData,
+            bool useEventLoop, int timeout, int minor_opcode);
+
+
+  bool callInternal(const QCString &remApp, const QCString &remObjId,
+            const QCString &remFun, const QByteArray &data,
+            ReplyStruct *replyStruct,
+            bool useEventLoop, int timeout, int minor_opcode);
+
+protected:
+  virtual void virtual_hook( int id, void* data );
+private:
+  DCOPClientPrivate *d;
+};
+
+
+
+
+
+inline const char* dcopTypeName( bool ) { return "bool"; }
+inline const char* dcopTypeName( char ) { return "char"; }
+inline const char* dcopTypeName( uchar ) { return "uchar"; }
+inline const char* dcopTypeName( int ) { return "int"; }
+inline const char* dcopTypeName( uint ) { return "uint"; }
+inline const char* dcopTypeName( long ) { return "long"; }
+inline const char* dcopTypeName( ulong ) { return "ulong"; }
+inline const char* dcopTypeName( double ) { return "double"; }
+inline const char* dcopTypeName( float ) { return "float"; }
+inline const char* dcopTypeName( const char* ) { return "QCString"; }
+
+
+class DCOPRef; inline const char* dcopTypeName( const DCOPRef& ) { return "DCOPRef"; }
+
+
+class QString; inline const char* dcopTypeName( const QString& ) { return "QString"; }
+class QCString; inline const char* dcopTypeName( const QCString& ) { return "QCString"; }
+class QFont; inline const char* dcopTypeName( const QFont& ) { return "QFont"; }
+class QPixmap; inline const char* dcopTypeName( const QPixmap& ) { return "QPixmap"; }
+class QBrush; inline const char* dcopTypeName( const QBrush& ) { return "QBrush"; }
+class QRect; inline const char* dcopTypeName( const QRect& ) { return "QRect"; }
+class QPoint; inline const char* dcopTypeName( const QPoint& ) { return "QPoint"; }
+class QImage; inline const char* dcopTypeName( const QImage& ) { return "QImage"; }
+class QSize; inline const char* dcopTypeName( const QSize& ) { return "QSize"; }
+class QColor; inline const char* dcopTypeName( const QColor& ) { return "QColor"; }
+class QPalette; inline const char* dcopTypeName( const QPalette& ) { return "QPalette"; }
+class QColorGroup; inline const char* dcopTypeName( const QColorGroup& ) { return "QColorGroup"; }
+class QIconSet; inline const char* dcopTypeName( const QIconSet& ) { return "QIconSet"; }
+class QDataStream; inline const char* dcopTypeName( const QDataStream& ) { return "QDataStream"; }
+class QPointArray; inline const char* dcopTypeName( const QPointArray& ) { return "QPointArray"; }
+class QRegion; inline const char* dcopTypeName( const QRegion& ) { return "QRegion"; }
+class QBitmap; inline const char* dcopTypeName( const QBitmap& ) { return "QBitmap"; }
+class QCursor; inline const char* dcopTypeName( const QCursor& ) { return "QCursor"; }
+class QStringList; inline const char* dcopTypeName( const QStringList& ) { return "QStringList"; }
+class QSizePolicy; inline const char* dcopTypeName( const QSizePolicy& ) { return "QSizePolicy"; }
+class QDate; inline const char* dcopTypeName( const QDate& ) { return "QDate"; }
+class QTime; inline const char* dcopTypeName( const QTime& ) { return "QTime"; }
+class QDateTime; inline const char* dcopTypeName( const QDateTime& ) { return "QDateTime"; }
+class QBitArray; inline const char* dcopTypeName( const QBitArray& ) { return "QBitArray"; }
+class QKeySequence; inline const char* dcopTypeName( const QKeySequence& ) { return "QKeySequence"; }
+class QVariant; inline const char* dcopTypeName( const QVariant& ) { return "QVariant"; }
+
+
+class KURL; inline const char* dcopTypeName( const KURL& ) { return "KURL"; }
+
+
+template <class T> inline const char* dcopTypeName( const T& ) { return "<unknown>"; }
+
+
+inline void dcopTypeInit(bool& b){b=false;}
+inline void dcopTypeInit(char& c){c=0;}
+inline void dcopTypeInit(uchar& c){c=0;}
+inline void dcopTypeInit(int& i){i=0;}
+inline void dcopTypeInit(uint& i){i=0;}
+inline void dcopTypeInit(long& l){l=0;}
+inline void dcopTypeInit(ulong& l){l=0;}
+inline void dcopTypeInit(float& f){f=0;}
+inline void dcopTypeInit(double& d){d=0;}
+inline void dcopTypeInit(const char* s ){s=0;}
+
+
+template <class T> inline void dcopTypeInit(T&){}
+
+
+class QDataStream;
+class DCOPObject;
+class DCOPClient;
+class DCOPReply
+{
+public:
+
+
+
+
+
+
+    template<class T>
+    operator T() {
+        T t;
+        if ( typeCheck( dcopTypeName(t), true ) ) {
+            QDataStream reply( data, 0x0001 );
+            reply >> t;
+        } else {
+            dcopTypeInit(t);
+        }
+        return t;
+    }
+
+
+
+
+
+
+
+    template <class T> bool get( T& t, const char* tname ) {
+        if ( typeCheck( tname, false ) ) {
+            QDataStream reply( data, 0x0001 );
+            reply >> t;
+            return true;
+        }
+        return false;
+    }
+    template <class T> bool get( T& t ) {
+        if ( typeCheck( dcopTypeName(t), false ) ) {
+            QDataStream reply( data, 0x0001 );
+            reply >> t;
+            return true;
+        }
+        return false;
+    }
+
+
+
+
+
+    inline bool isValid() const { return !type.isNull(); }
+
+
+    QByteArray data;
+
+    QCString type;
+private:
+    bool typeCheck( const char* t );
+    bool typeCheck( const char* t, bool warn );
+};
+class DCOPArg {
+public:
+    template <class T> DCOPArg( const T& t, const char* tname_arg )
+        : tname(tname_arg)
+        {
+            QDataStream ds( data, 0x0002 );
+            ds << t;
+        }
+    template <class T> DCOPArg( const T& t )
+        : tname( dcopTypeName(t) )
+        {
+            QDataStream ds( data, 0x0002 );
+            ds << t;
+        }
+
+
+    QByteArray data;
+
+    const char* tname;
+};
+
+inline const char* dcopTypeName( const DCOPArg &arg ) { return arg.tname; }
+inline QDataStream & operator << (QDataStream & str, const DCOPArg& arg )
+   { str.writeRawBytes( arg.data.data(), arg.data.size() ); return str; }
+class DCOPRef
+{
+public:
+
+
+
+
+    DCOPRef();
+
+
+
+
+    DCOPRef( const DCOPRef& ref );
+
+
+
+
+
+
+
+    DCOPRef( const QCString& app, const QCString& obj = "" );
+
+
+
+
+
+
+    DCOPRef( DCOPObject *object );
+    DCOPRef( const QCString& app, const QCString& obj, const QCString& type );
+
+
+
+
+
+
+    bool isNull() const;
+
+
+
+
+
+    QCString app() const;
+
+
+
+
+
+
+    QCString obj() const;
+
+
+
+
+    QCString object() const;
+
+
+
+
+
+    QCString type() const;
+
+
+
+
+
+    DCOPRef& operator=( const DCOPRef& );
+
+
+
+
+
+
+
+    void setRef( const QCString& app, const QCString& obj = "" );
+
+
+
+
+
+
+
+    void setRef( const QCString& app, const QCString& obj, const QCString& type );
+
+
+
+
+
+
+    void clear();
+    DCOPClient* dcopClient() const;
+
+
+
+
+
+
+
+    void setDCOPClient( DCOPClient *client );
+    enum EventLoopFlag { NoEventLoop, UseEventLoop };
+    DCOPReply call( const QCString& fun ) {
+        QByteArray data;
+        return callInternal( fun, "()", data );
+    }
+    DCOPReply callExt( const QCString& fun, EventLoopFlag useEventLoop=NoEventLoop,
+                    int timeout=-1 ) {
+        QByteArray data;
+        return callInternal( fun, "()", data, useEventLoop, timeout );
+    }
+    template <class T1>
+    DCOPReply call( const QCString& fun, const T1& t1 ) {
+        QCString args;
+        args.sprintf( "(%s)",
+                     dcopTypeName(t1) );
+        QByteArray data;
+        QDataStream ds( data, 0x0002 );
+        ds << t1;
+        return callInternal( fun, args, data );
+    }
+    template <class T1>
+    DCOPReply callExt( const QCString& fun,
+                    EventLoopFlag useEventLoop, int timeout,
+                    const T1& t1) {
+        QCString args;
+        args.sprintf( "(%s)",
+                     dcopTypeName(t1) );
+        QByteArray data;
+        QDataStream ds( data, 0x0002 );
+        ds << t1;
+        return callInternal( fun, args, data, useEventLoop, timeout );
+    }
+    template <class T1, class T2>
+    DCOPReply call( const QCString& fun,
+                    const T1& t1,
+                    const T2& t2 ) {
+        QCString args;
+        args.sprintf( "(%s,%s)",
+                     dcopTypeName(t1),
+                     dcopTypeName(t2) );
+        QByteArray data;
+        QDataStream ds( data, 0x0002 );
+        ds << t1 << t2;
+        return callInternal( fun, args, data );
+    }
+    template <class T1, class T2>
+    DCOPReply callExt( const QCString& fun,
+                    EventLoopFlag useEventLoop, int timeout,
+                    const T1& t1,
+                    const T2& t2) {
+        QCString args;
+        args.sprintf( "(%s,%s)",
+                     dcopTypeName(t1),
+                     dcopTypeName(t2) );
+        QByteArray data;
+        QDataStream ds( data, 0x0002 );
+        ds << t1 << t2;
+        return callInternal( fun, args, data, useEventLoop, timeout );
+    }
+    template <class T1, class T2, class T3>
+    DCOPReply call( const QCString& fun,
+                    const T1& t1,
+                    const T2& t2,
+                    const T3& t3 ) {
+        QCString args;
+        args.sprintf( "(%s,%s,%s)",
+                     dcopTypeName(t1),
+                     dcopTypeName(t2),
+                     dcopTypeName(t3) );
+        QByteArray data;
+        QDataStream ds( data, 0x0002 );
+        ds << t1 << t2 << t3;
+        return callInternal( fun, args, data );
+    }
+    template <class T1, class T2, class T3>
+    DCOPReply callExt( const QCString& fun,
+                    EventLoopFlag useEventLoop, int timeout,
+                    const T1& t1,
+                    const T2& t2,
+                    const T3& t3) {
+        QCString args;
+        args.sprintf( "(%s,%s,%s)",
+                     dcopTypeName(t1),
+                     dcopTypeName(t2),
+                     dcopTypeName(t3) );
+        QByteArray data;
+        QDataStream ds( data, 0x0002 );
+        ds << t1 << t2 << t3;
+        return callInternal( fun, args, data, useEventLoop, timeout );
+    }
+    template <class T1,class T2,class T3,class T4>
+    DCOPReply call( const QCString& fun,
+                    const T1& t1,
+                    const T2& t2,
+                    const T3& t3,
+                    const T4& t4 ) {
+        QCString args;
+        args.sprintf( "(%s,%s,%s,%s)",
+                     dcopTypeName(t1),
+                     dcopTypeName(t2),
+                     dcopTypeName(t3),
+                     dcopTypeName(t4) );
+        QByteArray data;
+        QDataStream ds( data, 0x0002 );
+        ds << t1 << t2 << t3 << t4;
+        return callInternal( fun, args, data );
+    }
+    template <class T1,class T2,class T3,class T4>
+    DCOPReply callExt( const QCString& fun,
+                    EventLoopFlag useEventLoop, int timeout,
+                    const T1& t1,
+                    const T2& t2,
+                    const T3& t3,
+                    const T4& t4) {
+        QCString args;
+        args.sprintf( "(%s,%s,%s,%s)",
+                     dcopTypeName(t1),
+                     dcopTypeName(t2),
+                     dcopTypeName(t3),
+                     dcopTypeName(t4) );
+        QByteArray data;
+        QDataStream ds( data, 0x0002 );
+        ds << t1 << t2 << t3 << t4;
+        return callInternal( fun, args, data, useEventLoop, timeout );
+    }
+    template <class T1,class T2,class T3,class T4,class T5>
+    DCOPReply call( const QCString& fun,
+                    const T1& t1,
+                    const T2& t2,
+                    const T3& t3,
+                    const T4& t4,
+                    const T5& t5 ) {
+        QCString args;
+        args.sprintf( "(%s,%s,%s,%s,%s)",
+                     dcopTypeName(t1),
+                     dcopTypeName(t2),
+                     dcopTypeName(t3),
+                     dcopTypeName(t4),
+                     dcopTypeName(t5) );
+        QByteArray data;
+        QDataStream ds( data, 0x0002 );
+        ds << t1 << t2 << t3 << t4 << t5;
+        return callInternal( fun, args, data );
+    }
+    template <class T1,class T2,class T3,class T4,class T5>
+    DCOPReply callExt( const QCString& fun,
+                    EventLoopFlag useEventLoop, int timeout,
+                    const T1& t1,
+                    const T2& t2,
+                    const T3& t3,
+                    const T4& t4,
+                    const T5& t5 ) {
+        QCString args;
+        args.sprintf( "(%s,%s,%s,%s,%s)",
+                     dcopTypeName(t1),
+                     dcopTypeName(t2),
+                     dcopTypeName(t3),
+                     dcopTypeName(t4),
+                     dcopTypeName(t5) );
+        QByteArray data;
+        QDataStream ds( data, 0x0002 );
+        ds << t1 << t2 << t3 << t4 << t5;
+        return callInternal( fun, args, data, useEventLoop, timeout );
+    }
+    template <class T1,class T2,class T3,class T4,class T5,class T6>
+    DCOPReply call( const QCString& fun,
+                    const T1& t1,
+                    const T2& t2,
+                    const T3& t3,
+                    const T4& t4,
+                    const T5& t5,
+                    const T6& t6 ) {
+        QCString args;
+        args.sprintf( "(%s,%s,%s,%s,%s,%s)",
+                     dcopTypeName(t1),
+                     dcopTypeName(t2),
+                     dcopTypeName(t3),
+                     dcopTypeName(t4),
+                     dcopTypeName(t5),
+                     dcopTypeName(t6) );
+        QByteArray data;
+        QDataStream ds( data, 0x0002 );
+        ds << t1 << t2 << t3 << t4 << t5 << t6;
+        return callInternal( fun, args, data );
+    }
+    template <class T1,class T2,class T3,class T4,class T5,class T6>
+    DCOPReply callExt( const QCString& fun,
+                    EventLoopFlag useEventLoop, int timeout,
+                    const T1& t1,
+                    const T2& t2,
+                    const T3& t3,
+                    const T4& t4,
+                    const T5& t5,
+                    const T6& t6) {
+        QCString args;
+        args.sprintf( "(%s,%s,%s,%s,%s,%s)",
+                     dcopTypeName(t1),
+                     dcopTypeName(t2),
+                     dcopTypeName(t3),
+                     dcopTypeName(t4),
+                     dcopTypeName(t5),
+                     dcopTypeName(t6) );
+        QByteArray data;
+        QDataStream ds( data, 0x0002 );
+        ds << t1 << t2 << t3 << t4 << t5 << t6;
+        return callInternal( fun, args, data, useEventLoop, timeout );
+    }
+    template <class T1,class T2,class T3,class T4,class T5,class T6,class T7>
+    DCOPReply call( const QCString& fun,
+                    const T1& t1,
+                    const T2& t2,
+                    const T3& t3,
+                    const T4& t4,
+                    const T5& t5,
+                    const T6& t6,
+                    const T7& t7 ) {
+        QCString args;
+        args.sprintf( "(%s,%s,%s,%s,%s,%s,%s)",
+                     dcopTypeName(t1),
+                     dcopTypeName(t2),
+                     dcopTypeName(t3),
+                     dcopTypeName(t4),
+                     dcopTypeName(t5),
+                     dcopTypeName(t6),
+                     dcopTypeName(t7) );
+        QByteArray data;
+        QDataStream ds( data, 0x0002 );
+        ds << t1 << t2 << t3 << t4 << t5 << t6 << t7;
+        return callInternal( fun, args, data );
+    }
+    template <class T1,class T2,class T3,class T4,class T5,class T6,class T7>
+    DCOPReply callExt( const QCString& fun,
+                    EventLoopFlag useEventLoop, int timeout,
+                    const T1& t1,
+                    const T2& t2,
+                    const T3& t3,
+                    const T4& t4,
+                    const T5& t5,
+                    const T6& t6,
+                    const T7& t7) {
+        QCString args;
+        args.sprintf( "(%s,%s,%s,%s,%s,%s,%s)",
+                     dcopTypeName(t1),
+                     dcopTypeName(t2),
+                     dcopTypeName(t3),
+                     dcopTypeName(t4),
+                     dcopTypeName(t5),
+                     dcopTypeName(t6),
+                     dcopTypeName(t7) );
+        QByteArray data;
+        QDataStream ds( data, 0x0002 );
+        ds << t1 << t2 << t3 << t4 << t5 << t6 << t7;
+        return callInternal( fun, args, data, useEventLoop, timeout );
+    }
+    template <class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8>
+    DCOPReply call( const QCString& fun,
+                    const T1& t1,
+                    const T2& t2,
+                    const T3& t3,
+                    const T4& t4,
+                    const T5& t5,
+                    const T6& t6,
+                    const T7& t7,
+                    const T8& t8 ) {
+        QCString args;
+        args.sprintf( "(%s,%s,%s,%s,%s,%s,%s,%s)",
+                     dcopTypeName(t1),
+                     dcopTypeName(t2),
+                     dcopTypeName(t3),
+                     dcopTypeName(t4),
+                     dcopTypeName(t5),
+                     dcopTypeName(t6),
+                     dcopTypeName(t7),
+                     dcopTypeName(t8) );
+        QByteArray data;
+        QDataStream ds( data, 0x0002 );
+        ds << t1 << t2 << t3 << t4 << t5 << t6 << t7 << t8;
+        return callInternal( fun, args, data );
+    }
+    template <class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8>
+    DCOPReply callExt( const QCString& fun,
+                    EventLoopFlag useEventLoop, int timeout,
+                    const T1& t1,
+                    const T2& t2,
+                    const T3& t3,
+                    const T4& t4,
+                    const T5& t5,
+                    const T6& t6,
+                    const T7& t7,
+                    const T8& t8) {
+        QCString args;
+        args.sprintf( "(%s,%s,%s,%s,%s,%s,%s,%s)",
+                     dcopTypeName(t1),
+                     dcopTypeName(t2),
+                     dcopTypeName(t3),
+                     dcopTypeName(t4),
+                     dcopTypeName(t5),
+                     dcopTypeName(t6),
+                     dcopTypeName(t7),
+                     dcopTypeName(t8) );
+        QByteArray data;
+        QDataStream ds( data, 0x0002 );
+        ds << t1 << t2 << t3 << t4 << t5 << t6 << t7 << t8;
+        return callInternal( fun, args, data, useEventLoop, timeout );
+    }
+    bool send( const QCString& fun ) {
+        QByteArray data;
+        return sendInternal( fun, "()", data );
+    }
+    template <class T1>
+    bool send( const QCString& fun, const T1& t1 ) {
+        QCString args;
+        args.sprintf( "(%s)",
+                     dcopTypeName(t1) );
+        QByteArray data;
+        QDataStream ds( data, 0x0002 );
+        ds << t1;
+        return sendInternal( fun, args, data );
+    }
+    template <class T1, class T2>
+    bool send( const QCString& fun,
+                    const T1& t1,
+                    const T2& t2 ) {
+        QCString args;
+        args.sprintf( "(%s,%s)",
+                     dcopTypeName(t1),
+                     dcopTypeName(t2) );
+        QByteArray data;
+        QDataStream ds( data, 0x0002 );
+        ds << t1 << t2;
+        return sendInternal( fun, args, data );
+    }
+    template <class T1, class T2, class T3>
+    bool send( const QCString& fun,
+                    const T1& t1,
+                    const T2& t2,
+                    const T3& t3 ) {
+        QCString args;
+        args.sprintf( "(%s,%s,%s)",
+                     dcopTypeName(t1),
+                     dcopTypeName(t2),
+                     dcopTypeName(t3) );
+        QByteArray data;
+        QDataStream ds( data, 0x0002 );
+        ds << t1 << t2 << t3;
+        return sendInternal( fun, args, data );
+    }
+    template <class T1,class T2,class T3,class T4>
+    bool send( const QCString& fun,
+                    const T1& t1,
+                    const T2& t2,
+                    const T3& t3,
+                    const T4& t4 ) {
+        QCString args;
+        args.sprintf( "(%s,%s,%s,%s)",
+                     dcopTypeName(t1),
+                     dcopTypeName(t2),
+                     dcopTypeName(t3),
+                     dcopTypeName(t4) );
+        QByteArray data;
+        QDataStream ds( data, 0x0002 );
+        ds << t1 << t2 << t3 << t4;
+        return sendInternal( fun, args, data );
+    }
+    template <class T1,class T2,class T3,class T4,class T5>
+    bool send( const QCString& fun,
+                    const T1& t1,
+                    const T2& t2,
+                    const T3& t3,
+                    const T4& t4,
+                    const T5& t5 ) {
+        QCString args;
+        args.sprintf( "(%s,%s,%s,%s,%s)",
+                     dcopTypeName(t1),
+                     dcopTypeName(t2),
+                     dcopTypeName(t3),
+                     dcopTypeName(t4),
+                     dcopTypeName(t5) );
+        QByteArray data;
+        QDataStream ds( data, 0x0002 );
+        ds << t1 << t2 << t3 << t4 << t5;
+        return sendInternal( fun, args, data );
+    }
+    template <class T1,class T2,class T3,class T4,class T5,class T6>
+    bool send( const QCString& fun,
+                    const T1& t1,
+                    const T2& t2,
+                    const T3& t3,
+                    const T4& t4,
+                    const T5& t5,
+                    const T6& t6 ) {
+        QCString args;
+        args.sprintf( "(%s,%s,%s,%s,%s,%s)",
+                     dcopTypeName(t1),
+                     dcopTypeName(t2),
+                     dcopTypeName(t3),
+                     dcopTypeName(t4),
+                     dcopTypeName(t5),
+                     dcopTypeName(t6) );
+        QByteArray data;
+        QDataStream ds( data, 0x0002 );
+        ds << t1 << t2 << t3 << t4 << t5 << t6;
+        return sendInternal( fun, args, data );
+    }
+    template <class T1,class T2,class T3,class T4,class T5,class T6,class T7>
+    bool send( const QCString& fun,
+                    const T1& t1,
+                    const T2& t2,
+                    const T3& t3,
+                    const T4& t4,
+                    const T5& t5,
+                    const T6& t6,
+                    const T7& t7 ) {
+        QCString args;
+        args.sprintf( "(%s,%s,%s,%s,%s,%s,%s)",
+                     dcopTypeName(t1),
+                     dcopTypeName(t2),
+                     dcopTypeName(t3),
+                     dcopTypeName(t4),
+                     dcopTypeName(t5),
+                     dcopTypeName(t6),
+                     dcopTypeName(t7) );
+        QByteArray data;
+        QDataStream ds( data, 0x0002 );
+        ds << t1 << t2 << t3 << t4 << t5 << t6 << t7;
+        return sendInternal( fun, args, data );
+    }
+    template <class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8>
+    bool send( const QCString& fun,
+                    const T1& t1,
+                    const T2& t2,
+                    const T3& t3,
+                    const T4& t4,
+                    const T5& t5,
+                    const T6& t6,
+                    const T7& t7,
+                    const T8& t8 ) {
+        QCString args;
+        args.sprintf( "(%s,%s,%s,%s,%s,%s,%s,%s)",
+                     dcopTypeName(t1),
+                     dcopTypeName(t2),
+                     dcopTypeName(t3),
+                     dcopTypeName(t4),
+                     dcopTypeName(t5),
+                     dcopTypeName(t6),
+                     dcopTypeName(t7),
+                     dcopTypeName(t8) );
+        QByteArray data;
+        QDataStream ds( data, 0x0002 );
+        ds << t1 << t2 << t3 << t4 << t5 << t6 << t7 << t8;
+        return sendInternal( fun, args, data );
+    }
+
+
+
+private:
+    DCOPReply callInternal( const QCString& fun, const QCString& args, const QByteArray& data,
+                            EventLoopFlag useEventLoop, int timeout );
+    DCOPReply callInternal( const QCString& fun, const QCString& args, const QByteArray& data );
+    bool sendInternal( const QCString& fun, const QCString& args, const QByteArray& data );
+
+    QCString m_app;
+    QCString m_obj;
+    QCString m_type;
+
+    class DCOPRefPrivate;
+    DCOPRefPrivate *d;
+};
+
+
+
+
+QDataStream& operator<<( QDataStream&, const DCOPRef& ref );
+
+
+
+QDataStream& operator>>( QDataStream&, DCOPRef& ref );
+
+
+
+
+
+
+
+
+extern "C" {
+
+
+
+
+
+extern "C" {
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern int __sigismember (__const __sigset_t *, int);
+extern int __sigaddset (__sigset_t *, int);
+extern int __sigdelset (__sigset_t *, int);
+
+
+
+
+
+
+typedef __sig_atomic_t sig_atomic_t;
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef void (*__sighandler_t) (int);
+
+
+
+
+extern __sighandler_t __sysv_signal (int __sig, __sighandler_t __handler)
+     throw ();
+
+extern __sighandler_t sysv_signal (int __sig, __sighandler_t __handler)
+     throw ();
+
+
+
+
+
+
+
+extern __sighandler_t signal (int __sig, __sighandler_t __handler) throw ();
+
+
+
+
+
+extern __sighandler_t bsd_signal (int __sig, __sighandler_t __handler) throw ();
+
+
+
+
+
+
+extern int kill (__pid_t __pid, int __sig) throw ();
+
+
+
+
+
+
+extern int killpg (__pid_t __pgrp, int __sig) throw ();
+
+
+
+
+extern int raise (int __sig) throw ();
+
+
+
+
+extern __sighandler_t ssignal (int __sig, __sighandler_t __handler) throw ();
+extern int gsignal (int __sig) throw ();
+
+
+
+
+extern void psignal (int __sig, __const char *__s) throw ();
+extern int __sigpause (int __sig_or_mask, int __is_sig) throw ();
+
+
+
+
+extern int sigpause (int __mask) throw ();
+
+
+extern int sigblock (int __mask) throw ();
+
+
+extern int sigsetmask (int __mask) throw ();
+
+
+extern int siggetmask (void) throw ();
+
+
+
+
+
+
+
+typedef __sighandler_t sighandler_t;
+
+
+
+
+typedef __sighandler_t sig_t;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef union sigval
+  {
+    int sival_int;
+    void *sival_ptr;
+  } sigval_t;
+
+
+
+
+
+
+
+
+
+
+typedef struct siginfo
+  {
+    int si_signo;
+    int si_errno;
+
+    int si_code;
+
+    union
+      {
+        int _pad[((128 / sizeof (int)) - 3)];
+
+
+        struct
+          {
+            __pid_t si_pid;
+            __uid_t si_uid;
+          } _kill;
+
+
+        struct
+          {
+            unsigned int _timer1;
+            unsigned int _timer2;
+          } _timer;
+
+
+        struct
+          {
+            __pid_t si_pid;
+            __uid_t si_uid;
+            sigval_t si_sigval;
+          } _rt;
+
+
+        struct
+          {
+            __pid_t si_pid;
+            __uid_t si_uid;
+            int si_status;
+            __clock_t si_utime;
+            __clock_t si_stime;
+          } _sigchld;
+
+
+        struct
+          {
+            void *si_addr;
+          } _sigfault;
+
+
+        struct
+          {
+            long int si_band;
+            int si_fd;
+          } _sigpoll;
+      } _sifields;
+  } siginfo_t;
+
+
+
+
+
+
+
+enum
+{
+  SI_ASYNCNL = -6,
+  SI_SIGIO,
+  SI_ASYNCIO,
+  SI_MESGQ,
+  SI_TIMER,
+  SI_QUEUE,
+  SI_USER,
+  SI_KERNEL = 0x80
+};
+
+
+
+enum
+{
+  ILL_ILLOPC = 1,
+  ILL_ILLOPN,
+  ILL_ILLADR,
+  ILL_ILLTRP,
+  ILL_PRVOPC,
+  ILL_PRVREG,
+  ILL_COPROC,
+  ILL_BADSTK
+};
+
+
+enum
+{
+  FPE_INTDIV = 1,
+  FPE_INTOVF,
+  FPE_FLTDIV,
+  FPE_FLTOVF,
+  FPE_FLTUND,
+  FPE_FLTRES,
+  FPE_FLTINV,
+  FPE_FLTSUB
+};
+
+
+enum
+{
+  SEGV_MAPERR = 1,
+  SEGV_ACCERR
+};
+
+
+enum
+{
+  BUS_ADRALN = 1,
+  BUS_ADRERR,
+  BUS_OBJERR
+};
+
+
+enum
+{
+  TRAP_BRKPT = 1,
+  TRAP_TRACE
+};
+
+
+enum
+{
+  CLD_EXITED = 1,
+  CLD_KILLED,
+  CLD_DUMPED,
+  CLD_TRAPPED,
+  CLD_STOPPED,
+  CLD_CONTINUED
+};
+
+
+enum
+{
+  POLL_IN = 1,
+  POLL_OUT,
+  POLL_MSG,
+  POLL_ERR,
+  POLL_PRI,
+  POLL_HUP
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct __pthread_attr_s;
+
+typedef struct sigevent
+  {
+    sigval_t sigev_value;
+    int sigev_signo;
+    int sigev_notify;
+
+    union
+      {
+        int _pad[((64 / sizeof (int)) - 3)];
+
+        struct
+          {
+            void (*_function) (sigval_t);
+            void *_attribute;
+          } _sigev_thread;
+      } _sigev_un;
+  } sigevent_t;
+
+
+
+
+enum
+{
+  SIGEV_SIGNAL = 0,
+  SIGEV_NONE,
+  SIGEV_THREAD
+};
+
+
+
+extern int sigemptyset (sigset_t *__set) throw ();
+
+
+extern int sigfillset (sigset_t *__set) throw ();
+
+
+extern int sigaddset (sigset_t *__set, int __signo) throw ();
+
+
+extern int sigdelset (sigset_t *__set, int __signo) throw ();
+
+
+extern int sigismember (__const sigset_t *__set, int __signo) throw ();
+
+
+
+extern int sigisemptyset (__const sigset_t *__set) throw ();
+
+
+extern int sigandset (sigset_t *__set, __const sigset_t *__left,
+                      __const sigset_t *__right) throw ();
+
+
+extern int sigorset (sigset_t *__set, __const sigset_t *__left,
+                     __const sigset_t *__right) throw ();
+
+
+
+
+struct sigaction
+  {
+
+
+    union
+      {
+
+        __sighandler_t sa_handler;
+
+        void (*sa_sigaction) (int, siginfo_t *, void *);
+      }
+    __sigaction_handler;
+
+
+
+
+
+    __sigset_t sa_mask;
+
+
+    int sa_flags;
+
+
+    void (*sa_restorer) (void);
+  };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern int sigprocmask (int __how, __const sigset_t *__restrict __set,
+                        sigset_t *__restrict __oset) throw ();
+
+
+
+extern int sigsuspend (__const sigset_t *__set) throw ();
+
+
+extern int sigaction (int __sig, __const struct sigaction *__restrict __act,
+                      struct sigaction *__restrict __oact) throw ();
+
+
+extern int sigpending (sigset_t *__set) throw ();
+
+
+
+extern int sigwait (__const sigset_t *__restrict __set, int *__restrict __sig)
+     throw ();
+
+
+
+extern int sigwaitinfo (__const sigset_t *__restrict __set,
+                        siginfo_t *__restrict __info) throw ();
+
+
+
+extern int sigtimedwait (__const sigset_t *__restrict __set,
+                         siginfo_t *__restrict __info,
+                         __const struct timespec *__restrict __timeout)
+     throw ();
+
+
+
+extern int sigqueue (__pid_t __pid, int __sig, __const union sigval __val)
+     throw ();
+extern __const char *__const _sys_siglist[64];
+extern __const char *__const sys_siglist[64];
+
+
+struct sigvec
+  {
+    __sighandler_t sv_handler;
+    int sv_mask;
+
+    int sv_flags;
+  };
+
+
+
+
+
+
+
+
+
+extern int sigvec (int __sig, __const struct sigvec *__vec,
+                   struct sigvec *__ovec) throw ();
+
+
+
+
+
+struct _fpreg {
+        unsigned short significand[4];
+        unsigned short exponent;
+};
+
+struct _fpxreg {
+        unsigned short significand[4];
+        unsigned short exponent;
+        unsigned short padding[3];
+};
+
+struct _xmmreg {
+        unsigned long element[4];
+};
+
+struct _fpstate {
+
+        unsigned long cw;
+        unsigned long sw;
+        unsigned long tag;
+        unsigned long ipoff;
+        unsigned long cssel;
+        unsigned long dataoff;
+        unsigned long datasel;
+        struct _fpreg _st[8];
+        unsigned short status;
+        unsigned short magic;
+
+
+        unsigned long _fxsr_env[6];
+        unsigned long mxcsr;
+        unsigned long reserved;
+        struct _fpxreg _fxsr_st[8];
+        struct _xmmreg _xmm[8];
+        unsigned long padding[56];
+};
+
+
+struct sigcontext {
+        unsigned short gs, __gsh;
+        unsigned short fs, __fsh;
+        unsigned short es, __esh;
+        unsigned short ds, __dsh;
+        unsigned long edi;
+        unsigned long esi;
+        unsigned long ebp;
+        unsigned long esp;
+        unsigned long ebx;
+        unsigned long edx;
+        unsigned long ecx;
+        unsigned long eax;
+        unsigned long trapno;
+        unsigned long err;
+        unsigned long eip;
+        unsigned short cs, __csh;
+        unsigned long eflags;
+        unsigned long esp_at_signal;
+        unsigned short ss, __ssh;
+        struct _fpstate * fpstate;
+        unsigned long oldmask;
+        unsigned long cr2;
+};
+
+
+extern int sigreturn (struct sigcontext *__scp) throw ();
+extern int siginterrupt (int __sig, int __interrupt) throw ();
+
+struct sigstack
+  {
+    void *ss_sp;
+    int ss_onstack;
+  };
+
+
+
+enum
+{
+  SS_ONSTACK = 1,
+  SS_DISABLE
+};
+
+
+
+
+
+
+
+typedef struct sigaltstack
+  {
+    void *ss_sp;
+    int ss_flags;
+    size_t ss_size;
+  } stack_t;
+
+
+
+
+
+
+
+
+
+
+typedef int greg_t;
+
+
+
+
+typedef greg_t gregset_t[19];
+
+
+
+enum
+{
+  REG_GS = 0,
+  REG_FS,
+  REG_ES,
+  REG_DS,
+  REG_EDI,
+  REG_ESI,
+  REG_EBP,
+  REG_ESP,
+  REG_EBX,
+  REG_EDX,
+  REG_ECX,
+  REG_EAX,
+  REG_TRAPNO,
+  REG_ERR,
+  REG_EIP,
+  REG_CS,
+  REG_EFL,
+  REG_UESP,
+  REG_SS
+};
+
+
+
+struct _libc_fpreg
+{
+  unsigned short int significand[4];
+  unsigned short int exponent;
+};
+
+struct _libc_fpstate
+{
+  unsigned long int cw;
+  unsigned long int sw;
+  unsigned long int tag;
+  unsigned long int ipoff;
+  unsigned long int cssel;
+  unsigned long int dataoff;
+  unsigned long int datasel;
+  struct _libc_fpreg _st[8];
+  unsigned long int status;
+};
+
+
+typedef struct _libc_fpstate *fpregset_t;
+
+
+typedef struct
+  {
+    gregset_t gregs;
+
+
+    fpregset_t fpregs;
+    unsigned long int oldmask;
+    unsigned long int cr2;
+  } mcontext_t;
+
+
+typedef struct ucontext
+  {
+    unsigned long int uc_flags;
+    struct ucontext *uc_link;
+    stack_t uc_stack;
+    mcontext_t uc_mcontext;
+    __sigset_t uc_sigmask;
+    struct _libc_fpstate __fpregs_mem;
+  } ucontext_t;
+
+
+
+
+
+extern int sigstack (struct sigstack *__ss, struct sigstack *__oss) throw ();
+
+
+
+extern int sigaltstack (__const struct sigaltstack *__restrict __ss,
+                        struct sigaltstack *__restrict __oss) throw ();
+
+
+
+
+
+
+
+extern int sighold (int __sig) throw ();
+
+
+extern int sigrelse (int __sig) throw ();
+
+
+extern int sigignore (int __sig) throw ();
+
+
+extern __sighandler_t sigset (int __sig, __sighandler_t __disp) throw ();
+
+
+
+
+
+extern int pthread_sigmask (int __how,
+                            __const __sigset_t *__restrict __newmask,
+                            __sigset_t *__restrict __oldmask)throw ();
+
+
+extern int pthread_kill (pthread_t __threadid, int __signo) throw ();
+
+
+
+
+
+
+extern int __libc_current_sigrtmin (void) throw ();
+
+extern int __libc_current_sigrtmax (void) throw ();
+
+
+
+}
+
+
+
+
+enum __rlimit_resource
+{
+
+  RLIMIT_CPU = 0,
+
+
+  RLIMIT_FSIZE = 1,
+
+
+  RLIMIT_DATA = 2,
+
+
+  RLIMIT_STACK = 3,
+
+
+  RLIMIT_CORE = 4,
+
+
+
+
+
+  RLIMIT_RSS = 5,
+
+
+  RLIMIT_NOFILE = 7,
+  RLIMIT_OFILE = RLIMIT_NOFILE,
+
+
+  RLIMIT_AS = 9,
+
+
+  RLIMIT_NPROC = 6,
+
+
+  RLIMIT_MEMLOCK = 8,
+
+
+  RLIMIT_LOCKS = 10,
+
+  RLIMIT_NLIMITS = 11,
+  RLIM_NLIMITS = RLIMIT_NLIMITS
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef __rlim_t rlim_t;
+
+
+
+
+typedef __rlim64_t rlim64_t;
+
+
+struct rlimit
+  {
+
+    rlim_t rlim_cur;
+
+    rlim_t rlim_max;
+  };
+
+
+struct rlimit64
+  {
+
+    rlim64_t rlim_cur;
+
+    rlim64_t rlim_max;
+ };
+
+
+
+enum __rusage_who
+{
+
+  RUSAGE_SELF = 0,
+
+
+  RUSAGE_CHILDREN = -1,
+
+
+  RUSAGE_BOTH = -2
+};
+
+
+
+struct rusage
+  {
+
+    struct timeval ru_utime;
+
+    struct timeval ru_stime;
+
+    long int ru_maxrss;
+
+
+    long int ru_ixrss;
+
+    long int ru_idrss;
+
+    long int ru_isrss;
+
+
+    long int ru_minflt;
+
+    long int ru_majflt;
+
+    long int ru_nswap;
+
+
+    long int ru_inblock;
+
+    long int ru_oublock;
+
+    long int ru_msgsnd;
+
+    long int ru_msgrcv;
+
+    long int ru_nsignals;
+
+
+
+    long int ru_nvcsw;
+
+
+    long int ru_nivcsw;
+  };
+
+
+
+
+
+enum __priority_which
+{
+  PRIO_PROCESS = 0,
+  PRIO_PGRP = 1,
+  PRIO_USER = 2
+};
+
+
+
+
+
+
+extern "C" {
+typedef int __rlimit_resource_t;
+typedef int __rusage_who_t;
+typedef int __priority_which_t;
+
+
+
+
+
+extern int getrlimit (__rlimit_resource_t __resource,
+                      struct rlimit *__rlimits) throw ();
+extern int getrlimit64 (__rlimit_resource_t __resource,
+                        struct rlimit64 *__rlimits) throw ();
+
+
+
+
+
+
+extern int setrlimit (__rlimit_resource_t __resource,
+                      __const struct rlimit *__rlimits) throw ();
+extern int setrlimit64 (__rlimit_resource_t __resource,
+                        __const struct rlimit64 *__rlimits) throw ();
+
+
+
+
+extern int getrusage (__rusage_who_t __who, struct rusage *__usage) throw ();
+
+
+
+
+
+extern int getpriority (__priority_which_t __which, id_t __who) throw ();
+
+
+
+extern int setpriority (__priority_which_t __which, id_t __who, int __prio)
+     throw ();
+
+}
+
+
+
+
+typedef enum
+{
+  P_ALL,
+  P_PID,
+  P_PGID
+} idtype_t;
+
+
+
+
+
+extern __pid_t wait (void * __stat_loc) throw ();
+
+
+
+extern __pid_t waitpid (__pid_t __pid, int *__stat_loc, int __options) throw ();
+
+
+extern int waitid (idtype_t __idtype, __id_t __id, siginfo_t *__infop,
+                   int __options) throw ();
+
+
+
+
+
+struct rusage;
+
+
+
+
+
+
+extern __pid_t wait3 (void * __stat_loc, int __options,
+                      struct rusage * __usage) throw ();
+
+
+
+
+
+struct rusage;
+
+
+extern __pid_t wait4 (__pid_t __pid, void * __stat_loc, int __options,
+                      struct rusage *__usage) throw ();
+
+
+
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C"
+
+int mkstemps(char *, int);
+extern "C"
+
+unsigned long strlcat(char*, const char*, unsigned long);
+
+
+
+
+
+
+extern "C"
+
+unsigned long strlcpy(char*, const char*, unsigned long);
+
+
+
+
+struct NETPoint {
+
+
+
+    NETPoint() : x(0), y(0) { }
+
+
+
+
+    int x,
+      y;
+};
+struct NETSize {
+
+
+
+    NETSize() : width(0), height(0) { }
+
+
+
+
+    int width,
+      height;
+};
+struct NETRect {
+
+
+
+
+
+    NETPoint pos;
+
+
+
+
+
+
+    NETSize size;
+};
+struct NETIcon {
+
+
+
+    NETIcon() : data(0) { }
+
+
+
+
+
+
+    NETSize size;
+
+
+
+
+
+
+    unsigned char *data;
+};
+struct NETStrut {
+
+
+
+    NETStrut() : left(0), right(0), top(0), bottom(0) { }
+
+
+
+
+    int left;
+
+
+
+
+    int right;
+
+
+
+
+    int top;
+
+
+
+
+    int bottom;
+};
+class NET {
+public:
+    enum Role {
+        Client,
+        WindowManager
+    };
+    enum WindowType {
+        Unknown = -1,
+        Normal = 0,
+        Desktop = 1,
+        Dock = 2,
+        Toolbar = 3,
+        Menu = 4,
+        Dialog = 5,
+        Override = 6,
+        TopMenu = 7,
+        Tool = Toolbar,
+        Utility = 8,
+        Splash = 9
+    };
+
+
+
+
+
+
+    enum WindowTypeMask {
+        NormalMask = 1<<0,
+        DesktopMask = 1<<1,
+        DockMask = 1<<2,
+        ToolbarMask = 1<<3,
+        MenuMask = 1<<4,
+        DialogMask = 1<<5,
+        OverrideMask = 1<<6,
+        TopMenuMask = 1<<7,
+        UtilityMask = 1<<8,
+        SplashMask = 1<<9
+    };
+    enum State {
+        Modal = 1<<0,
+        Sticky = 1<<1,
+        MaxVert = 1<<2,
+        MaxHoriz = 1<<3,
+        Max = MaxVert | MaxHoriz,
+        Shaded = 1<<4,
+        SkipTaskbar = 1<<5,
+        KeepAbove = 1<<6,
+        StaysOnTop = KeepAbove,
+        SkipPager = 1<<7,
+        Hidden = 1<<8,
+        FullScreen = 1<<9,
+        KeepBelow = 1<<10,
+        DemandsAttention = 1<<11
+    };
+    enum Direction {
+        TopLeft = 0,
+        Top = 1,
+        TopRight = 2,
+        Right = 3,
+        BottomRight = 4,
+        Bottom = 5,
+        BottomLeft = 6,
+        Left = 7,
+        Move = 8,
+
+
+
+        KeyboardSize = 9,
+
+
+
+        KeyboardMove = 10
+    };
+    enum MappingState {
+        Visible,
+        Withdrawn,
+        Iconic
+    };
+
+
+
+
+    enum Action {
+        ActionMove = 1<<0,
+        ActionResize = 1<<1,
+        ActionMinimize = 1<<2,
+        ActionShade = 1<<3,
+        ActionStick = 1<<4,
+        ActionMaxVert = 1<<5,
+        ActionMaxHoriz = 1<<6,
+        ActionMax = ActionMaxVert | ActionMaxHoriz,
+        ActionFullScreen = 1<<7,
+        ActionChangeDesktop = 1<<8,
+        ActionClose = 1<<9
+    };
+    enum Property {
+
+        Supported = 1<<0,
+        ClientList = 1<<1,
+        ClientListStacking = 1<<2,
+        NumberOfDesktops = 1<<3,
+        DesktopGeometry = 1<<4,
+        DesktopViewport = 1<<5,
+        CurrentDesktop = 1<<6,
+        DesktopNames = 1<<7,
+        ActiveWindow = 1<<8,
+        WorkArea = 1<<9,
+        SupportingWMCheck = 1<<10,
+        VirtualRoots = 1<<11,
+        KDESystemTrayWindows = 1<<12,
+        CloseWindow = 1<<13,
+        WMMoveResize = 1<<14,
+
+
+        WMName = 1<<15,
+        WMVisibleName = 1<<16,
+        WMDesktop = 1<<17,
+        WMWindowType = 1<<18,
+        WMState = 1<<19,
+        WMStrut = 1<<20,
+        WMIconGeometry = 1<<21,
+        WMIcon = 1<<22,
+        WMPid = 1<<23,
+        WMHandledIcons = 1<<24,
+        WMPing = 1<<25,
+        WMKDESystemTrayWinFor = 1<<26,
+        XAWMState = 1<<27,
+        WMKDEFrameStrut = 1<<28,
+
+
+        WMIconName = 1<<29,
+        WMVisibleIconName = 1<<30,
+        WMGeometry = 1<<31
+    };
+    enum Property2 {
+        WM2UserTime = 1<<0,
+        WM2StartupId = 1<<1,
+        WM2TransientFor = 1<<2,
+        WM2GroupLeader = 1<<3,
+        WM2AllowedActions = 1<<4
+    };
+
+
+
+
+
+
+    enum { OnAllDesktops = -1 };
+
+
+
+
+
+
+
+    enum RequestSource {
+        FromUnknown,
+        FromApplication,
+        FromTool
+    };
+};
+class NETWinInfo;
+class KWin
+{
+public:
+    static void activateWindow( WId win, long time = 0 );
+    static void setActiveWindow( WId win, long time );
+
+
+
+
+    static void setActiveWindow( WId win );
+    static void demandAttention( WId win, bool set = true );
+    static void setUserTime( WId win, long time );
+
+
+
+
+    static void invokeContextHelp();
+    static void setSystemTrayWindowFor( WId trayWin, WId forWin );
+
+    class WindowInfo;
+    class WindowInfoPrivate;
+    static WindowInfo windowInfo( WId win, unsigned long properties = 0, unsigned long properties2 = 0 );
+    static WId transientFor( WId window );
+
+
+
+
+
+    static WId groupLeader( WId window );
+    static QPixmap icon( WId win, int width = -1, int height = -1, bool scale = false );
+    enum IconSource { NETWM = 1, WMHints = 2, ClassHint = 4, XApp = 8 };
+    static QPixmap icon( WId win, int width, int height, bool scale, int flags );
+
+
+
+
+
+
+
+    static void setIcons( WId win, const QPixmap& icon, const QPixmap& miniIcon );
+    static void setType( WId win, NET::WindowType windowType );
+    static void setState( WId win, unsigned long state );
+    static void clearState( WId win, unsigned long state );
+    static void setOnAllDesktops( WId win, bool b );
+
+
+
+
+
+
+
+    static void setOnDesktop( WId win, int desktop);
+    static void setStrut( WId win, int left, int right, int top, int bottom );
+
+
+
+
+
+    static int currentDesktop();
+
+
+
+
+
+
+    static int numberOfDesktops();
+
+
+
+
+
+
+    static void setCurrentDesktop( int desktop );
+    static void iconifyWindow( WId win, bool animation = true );
+    static void deIconifyWindow( WId win, bool animation = true );
+
+
+
+
+
+
+    static bool icccmCompliantMappingState();
+
+
+
+
+    static bool allowedActionsSupported();
+
+
+
+
+
+    static QString readNameProperty( WId window, unsigned long atom );
+
+
+
+
+    struct Info
+    {
+
+        WId win;
+
+        long unsigned int state;
+
+        bool isMinimized() const;
+        bool isIconified() const;
+        NET::MappingState mappingState;
+
+        NETStrut strut;
+
+        NET::WindowType windowType;
+
+        QString visibleName;
+
+        QString name;
+
+        int desktop;
+
+        bool onAllDesktops;
+
+        pid_t pid;
+
+        QRect geometry;
+
+        QRect frameGeometry;
+
+        QString visibleNameWithState() const;
+    };
+
+
+
+
+
+    static Info info( WId win ) ;
+    static void appStarted() ;
+};
+
+
+
+
+
+class KWin::WindowInfo
+{
+public:
+
+
+
+    WindowInfo( WId window, unsigned long properties, unsigned long properties2 );
+    WindowInfo();
+    ~WindowInfo();
+
+
+
+
+
+
+    bool valid( bool withdrawn_is_valid = false ) const;
+
+
+
+    WId win() const;
+
+
+
+
+    unsigned long state() const;
+
+
+
+
+
+
+
+    bool isMinimized() const;
+
+
+
+
+
+
+    NET::MappingState mappingState() const;
+
+
+
+
+    NETStrut strut() const;
+
+
+
+
+
+    NET::WindowType windowType( int supported_types ) const;
+    QString visibleNameMatchingState() const;
+
+
+
+
+
+    QString visibleName() const;
+    QString visibleNameWithState() const;
+
+
+
+
+
+    QString name() const;
+
+
+
+
+
+
+    QString visibleIconName() const;
+
+
+
+
+
+
+    QString iconName() const;
+
+
+
+
+    bool isOnCurrentDesktop() const;
+
+
+
+
+    bool isOnDesktop( int desktop ) const;
+
+
+
+
+
+    bool onAllDesktops() const;
+
+
+
+
+
+    int desktop() const;
+
+
+
+
+    QRect geometry() const;
+
+
+
+
+    QRect frameGeometry() const;
+
+
+
+
+
+    WId transientFor() const;
+
+
+
+
+    WId groupLeader() const;
+
+
+
+
+
+
+    bool actionSupported( NET::Action action ) const;
+
+    WindowInfo( const WindowInfo& );
+    WindowInfo& operator=( const WindowInfo& );
+private:
+    WindowInfoPrivate* d;
+};
+
+
+
+
+
+
+
+extern "C" {
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct tm
+{
+  int tm_sec;
+  int tm_min;
+  int tm_hour;
+  int tm_mday;
+  int tm_mon;
+  int tm_year;
+  int tm_wday;
+  int tm_yday;
+  int tm_isdst;
+
+
+  long int tm_gmtoff;
+  __const char *tm_zone;
+
+
+
+
+};
+
+
+
+
+
+
+
+
+struct itimerspec
+  {
+    struct timespec it_interval;
+    struct timespec it_value;
+  };
+
+
+struct sigevent;
+
+
+
+extern clock_t clock (void) throw ();
+
+
+extern time_t time (time_t *__timer) throw ();
+
+
+extern double difftime (time_t __time1, time_t __time0)
+     throw () __attribute__ ((__const__));
+
+
+extern time_t mktime (struct tm *__tp) throw ();
+
+
+
+
+
+extern size_t strftime (char *__restrict __s, size_t __maxsize,
+                        __const char *__restrict __format,
+                        __const struct tm *__restrict __tp) throw ();
+
+
+
+
+
+extern char *strptime (__const char *__restrict __s,
+                       __const char *__restrict __fmt, struct tm *__tp)
+     throw ();
+
+
+
+
+
+
+
+extern size_t strftime_l (char *__restrict __s, size_t __maxsize,
+                          __const char *__restrict __format,
+                          __const struct tm *__restrict __tp,
+                          __locale_t __loc) throw ();
+
+extern char *strptime_l (__const char *__restrict __s,
+                         __const char *__restrict __fmt, struct tm *__tp,
+                         __locale_t __loc) throw ();
+
+
+
+
+
+
+extern struct tm *gmtime (__const time_t *__timer) throw ();
+
+
+
+extern struct tm *localtime (__const time_t *__timer) throw ();
+
+
+
+
+
+extern struct tm *gmtime_r (__const time_t *__restrict __timer,
+                            struct tm *__restrict __tp) throw ();
+
+
+
+extern struct tm *localtime_r (__const time_t *__restrict __timer,
+                               struct tm *__restrict __tp) throw ();
+
+
+
+
+
+extern char *asctime (__const struct tm *__tp) throw ();
+
+
+extern char *ctime (__const time_t *__timer) throw ();
+
+
+
+
+
+
+
+extern char *asctime_r (__const struct tm *__restrict __tp,
+                        char *__restrict __buf) throw ();
+
+
+extern char *ctime_r (__const time_t *__restrict __timer,
+                      char *__restrict __buf) throw ();
+
+
+
+
+extern char *__tzname[2];
+extern int __daylight;
+extern long int __timezone;
+
+
+
+
+extern char *tzname[2];
+
+
+
+extern void tzset (void) throw ();
+
+
+
+extern int daylight;
+extern long int timezone;
+
+
+
+
+
+extern int stime (__const time_t *__when) throw ();
+
+
+
+
+
+extern time_t timegm (struct tm *__tp) throw ();
+
+
+extern time_t timelocal (struct tm *__tp) throw ();
+
+
+extern int dysize (int __year) throw () __attribute__ ((__const__));
+
+
+
+
+
+extern int nanosleep (__const struct timespec *__requested_time,
+                      struct timespec *__remaining) throw ();
+
+
+
+extern int clock_getres (clockid_t __clock_id, struct timespec *__res) throw ();
+
+
+extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) throw ();
+
+
+extern int clock_settime (clockid_t __clock_id, __const struct timespec *__tp)
+     throw ();
+
+
+
+extern int clock_nanosleep (clockid_t __clock_id, int __flags,
+                            __const struct timespec *__req,
+                            struct timespec *__rem) throw ();
+
+
+extern int clock_getcpuclockid (pid_t __pid, clockid_t *__clock_id) throw ();
+
+
+
+
+extern int timer_create (clockid_t __clock_id,
+                         struct sigevent *__restrict __evp,
+                         timer_t *__restrict __timerid) throw ();
+
+
+extern int timer_delete (timer_t __timerid) throw ();
+
+
+extern int timer_settime (timer_t __timerid, int __flags,
+                          __const struct itimerspec *__restrict __value,
+                          struct itimerspec *__restrict __ovalue) throw ();
+
+
+extern int timer_gettime (timer_t __timerid, struct itimerspec *__value)
+     throw ();
+
+
+extern int timer_getoverrun (timer_t __timerid) throw ();
+extern int getdate_err;
+
+
+
+
+
+extern struct tm *getdate (__const char *__string) throw ();
+extern int getdate_r (__const char *__restrict __string,
+                      struct tm *__restrict __resbufp) throw ();
+
+
+}
+
+
+
+
+
+extern "C" {
+
+
+
+
+
+
+struct timezone
+  {
+    int tz_minuteswest;
+    int tz_dsttime;
+  };
+
+typedef struct timezone *__restrict __timezone_ptr_t;
+extern int gettimeofday (struct timeval *__restrict __tv,
+                         __timezone_ptr_t __tz) throw ();
+
+
+
+
+extern int settimeofday (__const struct timeval *__tv,
+                         __const struct timezone *__tz) throw ();
+
+
+
+
+
+extern int adjtime (__const struct timeval *__delta,
+                    struct timeval *__olddelta) throw ();
+
+
+
+
+enum __itimer_which
+  {
+
+    ITIMER_REAL = 0,
+
+    ITIMER_VIRTUAL = 1,
+
+
+    ITIMER_PROF = 2
+  };
+
+
+
+struct itimerval
+  {
+
+    struct timeval it_interval;
+
+    struct timeval it_value;
+  };
+
+
+
+
+
+
+typedef int __itimer_which_t;
+
+
+
+
+extern int getitimer (__itimer_which_t __which,
+                      struct itimerval *__value) throw ();
+
+
+
+
+extern int setitimer (__itimer_which_t __which,
+                      __const struct itimerval *__restrict __new,
+                      struct itimerval *__restrict __old) throw ();
+
+
+
+
+extern int utimes (__const char *__file, __const struct timeval __tvp[2])
+     throw ();
+
+
+
+extern int lutimes (__const char *__file, __const struct timeval __tvp[2])
+     throw ();
+
+
+extern int futimes (int fd, __const struct timeval __tvp[2]) throw ();
+
+
+
+
+
+
+
+
+
+}
+
+
+
+extern "C" {
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern int *__errno_location (void) throw () __attribute__ ((__const__));
+
+
+
+extern char *program_invocation_name, *program_invocation_short_name;
+
+
+
+}
+typedef int error_t;
+
+
+
+
+
+
+
+
+
+typedef unsigned char uint8_t;
+typedef unsigned short int uint16_t;
+
+typedef unsigned int uint32_t;
+
+
+
+
+__extension__
+typedef unsigned long long int uint64_t;
+
+
+
+
+
+
+typedef signed char int_least8_t;
+typedef short int int_least16_t;
+typedef int int_least32_t;
+
+
+
+__extension__
+typedef long long int int_least64_t;
+
+
+
+typedef unsigned char uint_least8_t;
+typedef unsigned short int uint_least16_t;
+typedef unsigned int uint_least32_t;
+
+
+
+__extension__
+typedef unsigned long long int uint_least64_t;
+
+
+
+
+
+
+typedef signed char int_fast8_t;
+
+
+
+
+
+typedef int int_fast16_t;
+typedef int int_fast32_t;
+__extension__
+typedef long long int int_fast64_t;
+
+
+
+typedef unsigned char uint_fast8_t;
+
+
+
+
+
+typedef unsigned int uint_fast16_t;
+typedef unsigned int uint_fast32_t;
+__extension__
+typedef unsigned long long int uint_fast64_t;
+typedef unsigned int uintptr_t;
+__extension__
+typedef long long int intmax_t;
+__extension__
+typedef unsigned long long int uintmax_t;
+
+
+
+extern "C" {
+
+
+enum
+  {
+    IPPROTO_IP = 0,
+    IPPROTO_HOPOPTS = 0,
+    IPPROTO_ICMP = 1,
+    IPPROTO_IGMP = 2,
+    IPPROTO_IPIP = 4,
+    IPPROTO_TCP = 6,
+    IPPROTO_EGP = 8,
+    IPPROTO_PUP = 12,
+    IPPROTO_UDP = 17,
+    IPPROTO_IDP = 22,
+    IPPROTO_TP = 29,
+    IPPROTO_IPV6 = 41,
+    IPPROTO_ROUTING = 43,
+    IPPROTO_FRAGMENT = 44,
+    IPPROTO_RSVP = 46,
+    IPPROTO_GRE = 47,
+    IPPROTO_ESP = 50,
+    IPPROTO_AH = 51,
+    IPPROTO_ICMPV6 = 58,
+    IPPROTO_NONE = 59,
+    IPPROTO_DSTOPTS = 60,
+    IPPROTO_MTP = 92,
+    IPPROTO_ENCAP = 98,
+    IPPROTO_PIM = 103,
+    IPPROTO_COMP = 108,
+    IPPROTO_RAW = 255,
+    IPPROTO_MAX
+  };
+
+
+
+typedef uint16_t in_port_t;
+
+
+enum
+  {
+    IPPORT_ECHO = 7,
+    IPPORT_DISCARD = 9,
+    IPPORT_SYSTAT = 11,
+    IPPORT_DAYTIME = 13,
+    IPPORT_NETSTAT = 15,
+    IPPORT_FTP = 21,
+    IPPORT_TELNET = 23,
+    IPPORT_SMTP = 25,
+    IPPORT_TIMESERVER = 37,
+    IPPORT_NAMESERVER = 42,
+    IPPORT_WHOIS = 43,
+    IPPORT_MTP = 57,
+
+    IPPORT_TFTP = 69,
+    IPPORT_RJE = 77,
+    IPPORT_FINGER = 79,
+    IPPORT_TTYLINK = 87,
+    IPPORT_SUPDUP = 95,
+
+
+    IPPORT_EXECSERVER = 512,
+    IPPORT_LOGINSERVER = 513,
+    IPPORT_CMDSERVER = 514,
+    IPPORT_EFSSERVER = 520,
+
+
+    IPPORT_BIFFUDP = 512,
+    IPPORT_WHOSERVER = 513,
+    IPPORT_ROUTESERVER = 520,
+
+
+    IPPORT_RESERVED = 1024,
+
+
+    IPPORT_USERRESERVED = 5000
+  };
+
+
+
+typedef uint32_t in_addr_t;
+struct in_addr
+  {
+    in_addr_t s_addr;
+  };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct in6_addr
+  {
+    union
+      {
+        uint8_t u6_addr8[16];
+        uint16_t u6_addr16[8];
+        uint32_t u6_addr32[4];
+      } in6_u;
+  };
+
+extern const struct in6_addr in6addr_any;
+extern const struct in6_addr in6addr_loopback;
+
+
+
+
+
+
+
+
+
+
+enum __socket_type
+{
+  SOCK_STREAM = 1,
+
+  SOCK_DGRAM = 2,
+
+  SOCK_RAW = 3,
+  SOCK_RDM = 4,
+  SOCK_SEQPACKET = 5,
+
+  SOCK_PACKET = 10
+
+
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef unsigned short int sa_family_t;
+
+
+
+
+
+
+
+
+
+struct sockaddr
+  {
+    sa_family_t sa_family;
+    char sa_data[14];
+  };
+
+
+
+
+
+
+
+
+
+struct sockaddr_storage
+  {
+    sa_family_t ss_family;
+    __uint32_t __ss_align;
+    char __ss_padding[(128 - (2 * sizeof (__uint32_t)))];
+  };
+
+
+
+enum
+  {
+    MSG_OOB = 0x01,
+    MSG_PEEK = 0x02,
+    MSG_DONTROUTE = 0x04,
+
+
+    MSG_TRYHARD = MSG_DONTROUTE,
+
+    MSG_CTRUNC = 0x08,
+    MSG_PROXY = 0x10,
+    MSG_TRUNC = 0x20,
+    MSG_DONTWAIT = 0x40,
+    MSG_EOR = 0x80,
+    MSG_WAITALL = 0x100,
+    MSG_FIN = 0x200,
+    MSG_SYN = 0x400,
+    MSG_CONFIRM = 0x800,
+    MSG_RST = 0x1000,
+    MSG_ERRQUEUE = 0x2000,
+    MSG_NOSIGNAL = 0x4000,
+    MSG_MORE = 0x8000
+  };
+
+
+
+
+struct msghdr
+  {
+    void *msg_name;
+    socklen_t msg_namelen;
+
+    struct iovec *msg_iov;
+    size_t msg_iovlen;
+
+    void *msg_control;
+    size_t msg_controllen;
+
+    int msg_flags;
+  };
+
+
+struct cmsghdr
+  {
+    size_t cmsg_len;
+
+    int cmsg_level;
+    int cmsg_type;
+
+
+
+  };
+
+
+
+
+
+
+
+
+
+
+
+extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
+                                      struct cmsghdr *__cmsg) throw ();
+enum
+  {
+    SCM_RIGHTS = 0x01,
+
+    SCM_CREDENTIALS = 0x02,
+
+    __SCM_CONNECT = 0x03
+  };
+
+
+
+struct ucred
+{
+  pid_t pid;
+  uid_t uid;
+  gid_t gid;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct linger
+  {
+    int l_onoff;
+    int l_linger;
+  };
+
+
+
+struct sockaddr_in
+  {
+    sa_family_t sin_family;
+    in_port_t sin_port;
+    struct in_addr sin_addr;
+
+
+    unsigned char sin_zero[sizeof (struct sockaddr) -
+                           (sizeof (unsigned short int)) -
+                           sizeof (in_port_t) -
+                           sizeof (struct in_addr)];
+  };
+
+
+struct sockaddr_in6
+  {
+    sa_family_t sin6_family;
+    in_port_t sin6_port;
+    uint32_t sin6_flowinfo;
+    struct in6_addr sin6_addr;
+    uint32_t sin6_scope_id;
+  };
+
+
+struct ipv6_mreq
+  {
+
+    struct in6_addr ipv6mr_multiaddr;
+
+
+    unsigned int ipv6mr_interface;
+  };
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct ip_opts
+  {
+    struct in_addr ip_dst;
+    char ip_opts[40];
+  };
+
+
+struct ip_mreq
+  {
+    struct in_addr imr_multiaddr;
+    struct in_addr imr_interface;
+  };
+
+
+struct ip_mreqn
+  {
+    struct in_addr imr_multiaddr;
+    struct in_addr imr_address;
+    int imr_ifindex;
+  };
+
+
+struct in_pktinfo
+  {
+    int ipi_ifindex;
+    struct in_addr ipi_spec_dst;
+    struct in_addr ipi_addr;
+  };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern uint32_t ntohl (uint32_t __netlong) throw () __attribute__ ((__const__));
+extern uint16_t ntohs (uint16_t __netshort)
+     throw () __attribute__ ((__const__));
+extern uint32_t htonl (uint32_t __hostlong)
+     throw () __attribute__ ((__const__));
+extern uint16_t htons (uint16_t __hostshort)
+     throw () __attribute__ ((__const__));
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern int bindresvport (int __sockfd, struct sockaddr_in *__sock_in) throw ();
+
+
+extern int bindresvport6 (int __sockfd, struct sockaddr_in6 *__sock_in)
+     throw ();
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct in6_pktinfo
+  {
+    struct in6_addr ipi6_addr;
+    unsigned int ipi6_ifindex;
+  };
+
+}
+
+
+
+
+
+
+
+
+extern "C" {
+
+struct rpcent
+{
+  char *r_name;
+  char **r_aliases;
+  int r_number;
+};
+
+extern void setrpcent (int __stayopen) throw ();
+extern void endrpcent (void) throw ();
+extern struct rpcent *getrpcbyname (__const char *__name) throw ();
+extern struct rpcent *getrpcbynumber (int __number) throw ();
+extern struct rpcent *getrpcent (void) throw ();
+
+
+extern int getrpcbyname_r (__const char *__name, struct rpcent *__result_buf,
+                           char *__buffer, size_t __buflen,
+                           struct rpcent **__result) throw ();
+
+extern int getrpcbynumber_r (int __number, struct rpcent *__result_buf,
+                             char *__buffer, size_t __buflen,
+                             struct rpcent **__result) throw ();
+
+extern int getrpcent_r (struct rpcent *__result_buf, char *__buffer,
+                        size_t __buflen, struct rpcent **__result) throw ();
+
+
+}
+
+
+
+
+
+
+struct netent
+{
+  char *n_name;
+  char **n_aliases;
+  int n_addrtype;
+  uint32_t n_net;
+};
+
+
+
+
+extern "C" {
+
+
+
+
+
+extern int *__h_errno_location (void) throw () __attribute__ ((__const__));
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern void herror (__const char *__str) throw ();
+
+
+extern __const char *hstrerror (int __err_num) throw ();
+
+
+
+
+struct hostent
+{
+  char *h_name;
+  char **h_aliases;
+  int h_addrtype;
+  int h_length;
+  char **h_addr_list;
+};
+
+
+
+extern void sethostent (int __stay_open) throw ();
+
+
+extern void endhostent (void) throw ();
+
+
+
+extern struct hostent *gethostent (void) throw ();
+
+
+
+extern struct hostent *gethostbyaddr (__const void *__addr, __socklen_t __len,
+                                      int __type) throw ();
+
+
+extern struct hostent *gethostbyname (__const char *__name) throw ();
+
+
+
+
+
+extern struct hostent *gethostbyname2 (__const char *__name, int __af) throw ();
+
+
+
+
+
+
+extern int gethostent_r (struct hostent *__restrict __result_buf,
+                         char *__restrict __buf, size_t __buflen,
+                         struct hostent **__restrict __result,
+                         int *__restrict __h_errnop) throw ();
+
+extern int gethostbyaddr_r (__const void *__restrict __addr, __socklen_t __len,
+                            int __type,
+                            struct hostent *__restrict __result_buf,
+                            char *__restrict __buf, size_t __buflen,
+                            struct hostent **__restrict __result,
+                            int *__restrict __h_errnop) throw ();
+
+extern int gethostbyname_r (__const char *__restrict __name,
+                            struct hostent *__restrict __result_buf,
+                            char *__restrict __buf, size_t __buflen,
+                            struct hostent **__restrict __result,
+                            int *__restrict __h_errnop) throw ();
+
+extern int gethostbyname2_r (__const char *__restrict __name, int __af,
+                             struct hostent *__restrict __result_buf,
+                             char *__restrict __buf, size_t __buflen,
+                             struct hostent **__restrict __result,
+                             int *__restrict __h_errnop) throw ();
+
+
+
+
+
+extern void setnetent (int __stay_open) throw ();
+
+
+extern void endnetent (void) throw ();
+
+
+
+extern struct netent *getnetent (void) throw ();
+
+
+
+extern struct netent *getnetbyaddr (uint32_t __net, int __type)
+     throw ();
+
+
+extern struct netent *getnetbyname (__const char *__name) throw ();
+
+
+
+
+
+
+
+extern int getnetent_r (struct netent *__restrict __result_buf,
+                        char *__restrict __buf, size_t __buflen,
+                        struct netent **__restrict __result,
+                        int *__restrict __h_errnop) throw ();
+
+extern int getnetbyaddr_r (uint32_t __net, int __type,
+                           struct netent *__restrict __result_buf,
+                           char *__restrict __buf, size_t __buflen,
+                           struct netent **__restrict __result,
+                           int *__restrict __h_errnop) throw ();
+
+extern int getnetbyname_r (__const char *__restrict __name,
+                           struct netent *__restrict __result_buf,
+                           char *__restrict __buf, size_t __buflen,
+                           struct netent **__restrict __result,
+                           int *__restrict __h_errnop) throw ();
+
+
+
+
+struct servent
+{
+  char *s_name;
+  char **s_aliases;
+  int s_port;
+  char *s_proto;
+};
+
+
+
+extern void setservent (int __stay_open) throw ();
+
+
+extern void endservent (void) throw ();
+
+
+
+extern struct servent *getservent (void) throw ();
+
+
+
+extern struct servent *getservbyname (__const char *__name,
+                                      __const char *__proto) throw ();
+
+
+
+extern struct servent *getservbyport (int __port, __const char *__proto)
+     throw ();
+
+
+
+
+
+extern int getservent_r (struct servent *__restrict __result_buf,
+                         char *__restrict __buf, size_t __buflen,
+                         struct servent **__restrict __result) throw ();
+
+extern int getservbyname_r (__const char *__restrict __name,
+                            __const char *__restrict __proto,
+                            struct servent *__restrict __result_buf,
+                            char *__restrict __buf, size_t __buflen,
+                            struct servent **__restrict __result) throw ();
+
+extern int getservbyport_r (int __port, __const char *__restrict __proto,
+                            struct servent *__restrict __result_buf,
+                            char *__restrict __buf, size_t __buflen,
+                            struct servent **__restrict __result) throw ();
+
+
+
+
+struct protoent
+{
+  char *p_name;
+  char **p_aliases;
+  int p_proto;
+};
+
+
+
+extern void setprotoent (int __stay_open) throw ();
+
+
+extern void endprotoent (void) throw ();
+
+
+
+extern struct protoent *getprotoent (void) throw ();
+
+
+extern struct protoent *getprotobyname (__const char *__name) throw ();
+
+
+extern struct protoent *getprotobynumber (int __proto) throw ();
+
+
+
+
+
+extern int getprotoent_r (struct protoent *__restrict __result_buf,
+                          char *__restrict __buf, size_t __buflen,
+                          struct protoent **__restrict __result) throw ();
+
+extern int getprotobyname_r (__const char *__restrict __name,
+                             struct protoent *__restrict __result_buf,
+                             char *__restrict __buf, size_t __buflen,
+                             struct protoent **__restrict __result) throw ();
+
+extern int getprotobynumber_r (int __proto,
+                               struct protoent *__restrict __result_buf,
+                               char *__restrict __buf, size_t __buflen,
+                               struct protoent **__restrict __result) throw ();
+
+
+
+
+extern int setnetgrent (__const char *__netgroup) throw ();
+
+
+extern void endnetgrent (void) throw ();
+
+
+
+extern int getnetgrent (char **__restrict __hostp,
+                        char **__restrict __userp,
+                        char **__restrict __domainp) throw ();
+
+
+
+extern int innetgr (__const char *__netgroup, __const char *__host,
+                    __const char *__user, __const char *domain) throw ();
+
+
+extern int getnetgrent_r (char **__restrict __hostp,
+                          char **__restrict __userp,
+                          char **__restrict __domainp,
+                          char *__restrict __buffer, size_t __buflen) throw ();
+extern int rcmd (char **__restrict __ahost, unsigned short int __rport,
+                 __const char *__restrict __locuser,
+                 __const char *__restrict __remuser,
+                 __const char *__restrict __cmd, int *__restrict __fd2p)
+     throw ();
+
+
+
+extern int rcmd_af (char **__restrict __ahost, unsigned short int __rport,
+                    __const char *__restrict __locuser,
+                    __const char *__restrict __remuser,
+                    __const char *__restrict __cmd, int *__restrict __fd2p,
+                    sa_family_t __af) throw ();
+
+
+
+
+
+
+extern int rexec (char **__restrict __ahost, int __rport,
+                  __const char *__restrict __name,
+                  __const char *__restrict __pass,
+                  __const char *__restrict __cmd, int *__restrict __fd2p)
+     throw ();
+
+
+
+extern int rexec_af (char **__restrict __ahost, int __rport,
+                     __const char *__restrict __name,
+                     __const char *__restrict __pass,
+                     __const char *__restrict __cmd, int *__restrict __fd2p,
+                     sa_family_t __af) throw ();
+
+
+
+
+extern int ruserok (__const char *__rhost, int __suser,
+                    __const char *__remuser, __const char *__locuser) throw ();
+
+
+
+extern int ruserok_af (__const char *__rhost, int __suser,
+                       __const char *__remuser, __const char *__locuser,
+                       sa_family_t __af) throw ();
+
+
+
+
+extern int rresvport (int *__alport) throw ();
+
+
+
+extern int rresvport_af (int *__alport, sa_family_t __af) throw ();
+
+
+
+
+
+
+struct addrinfo
+{
+  int ai_flags;
+  int ai_family;
+  int ai_socktype;
+  int ai_protocol;
+  socklen_t ai_addrlen;
+  struct sockaddr *ai_addr;
+  char *ai_canonname;
+  struct addrinfo *ai_next;
+};
+
+
+
+struct gaicb
+{
+  const char *ar_name;
+  const char *ar_service;
+  const struct addrinfo *ar_request;
+  struct addrinfo *ar_result;
+
+  int __return;
+  int __unused[5];
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern int getaddrinfo (__const char *__restrict __name,
+                        __const char *__restrict __service,
+                        __const struct addrinfo *__restrict __req,
+                        struct addrinfo **__restrict __pai) throw ();
+
+
+extern void freeaddrinfo (struct addrinfo *__ai) throw ();
+
+
+extern __const char *gai_strerror (int __ecode) throw ();
+
+
+extern int getnameinfo (__const struct sockaddr *__restrict __sa,
+                        socklen_t __salen, char *__restrict __host,
+                        socklen_t __hostlen, char *__restrict __serv,
+                        socklen_t __servlen, unsigned int __flags) throw ();
+
+
+
+
+
+extern int getaddrinfo_a (int __mode, struct gaicb *__list[],
+                          int __ent, struct sigevent *__restrict __sig)
+     throw ();
+
+
+
+
+extern int gai_suspend (__const struct gaicb *__const __list[], int __ent,
+                        __const struct timespec *__timeout) throw ();
+
+
+extern int gai_error (struct gaicb *__req) throw ();
+
+
+extern int gai_cancel (struct gaicb *__gaicbp) throw ();
+
+
+
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef unsigned long XID;
+
+
+typedef unsigned long Mask;
+
+
+typedef unsigned long Atom;
+
+typedef unsigned long VisualID;
+typedef unsigned long Time;
+typedef XID Window;
+typedef XID Drawable;
+
+typedef XID Font;
+
+typedef XID Pixmap;
+typedef XID Cursor;
+typedef XID Colormap;
+typedef XID GContext;
+typedef XID KeySym;
+
+typedef unsigned char KeyCode;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef int ptrdiff_t;
+
+
+typedef char *XPointer;
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef struct _XExtData {
+        int number;
+        struct _XExtData *next;
+        int (*free_private)(
+
+        struct _XExtData *extension
+
+        );
+        XPointer private_data;
+} XExtData;
+
+
+
+
+typedef struct {
+        int extension;
+        int major_opcode;
+        int first_event;
+        int first_error;
+} XExtCodes;
+
+
+
+
+
+typedef struct {
+    int depth;
+    int bits_per_pixel;
+    int scanline_pad;
+} XPixmapFormatValues;
+
+
+
+
+
+typedef struct {
+        int function;
+        unsigned long plane_mask;
+        unsigned long foreground;
+        unsigned long background;
+        int line_width;
+        int line_style;
+        int cap_style;
+
+        int join_style;
+        int fill_style;
+
+        int fill_rule;
+        int arc_mode;
+        Pixmap tile;
+        Pixmap stipple;
+        int ts_x_origin;
+        int ts_y_origin;
+        Font font;
+        int subwindow_mode;
+        int graphics_exposures;
+        int clip_x_origin;
+        int clip_y_origin;
+        Pixmap clip_mask;
+        int dash_offset;
+        char dashes;
+} XGCValues;
+
+
+
+
+
+
+typedef struct _XGC
+
+
+
+
+
+
+
+*GC;
+
+
+
+
+typedef struct {
+        XExtData *ext_data;
+        VisualID visualid;
+
+        int c_class;
+
+
+
+        unsigned long red_mask, green_mask, blue_mask;
+        int bits_per_rgb;
+        int map_entries;
+} Visual;
+
+
+
+
+typedef struct {
+        int depth;
+        int nvisuals;
+        Visual *visuals;
+} Depth;
+
+
+
+
+
+
+
+struct _XDisplay;
+
+typedef struct {
+        XExtData *ext_data;
+        struct _XDisplay *display;
+        Window root;
+        int width, height;
+        int mwidth, mheight;
+        int ndepths;
+        Depth *depths;
+        int root_depth;
+        Visual *root_visual;
+        GC default_gc;
+        Colormap cmap;
+        unsigned long white_pixel;
+        unsigned long black_pixel;
+        int max_maps, min_maps;
+        int backing_store;
+        int save_unders;
+        long root_input_mask;
+} Screen;
+
+
+
+
+typedef struct {
+        XExtData *ext_data;
+        int depth;
+        int bits_per_pixel;
+        int scanline_pad;
+} ScreenFormat;
+
+
+
+
+typedef struct {
+    Pixmap background_pixmap;
+    unsigned long background_pixel;
+    Pixmap border_pixmap;
+    unsigned long border_pixel;
+    int bit_gravity;
+    int win_gravity;
+    int backing_store;
+    unsigned long backing_planes;
+    unsigned long backing_pixel;
+    int save_under;
+    long event_mask;
+    long do_not_propagate_mask;
+    int override_redirect;
+    Colormap colormap;
+    Cursor cursor;
+} XSetWindowAttributes;
+
+typedef struct {
+    int x, y;
+    int width, height;
+    int border_width;
+    int depth;
+    Visual *visual;
+    Window root;
+
+    int c_class;
+
+
+
+    int bit_gravity;
+    int win_gravity;
+    int backing_store;
+    unsigned long backing_planes;
+    unsigned long backing_pixel;
+    int save_under;
+    Colormap colormap;
+    int map_installed;
+    int map_state;
+    long all_event_masks;
+    long your_event_mask;
+    long do_not_propagate_mask;
+    int override_redirect;
+    Screen *screen;
+} XWindowAttributes;
+
+
+
+
+
+
+typedef struct {
+        int family;
+        int length;
+        char *address;
+} XHostAddress;
+
+
+
+
+typedef struct _XImage {
+    int width, height;
+    int xoffset;
+    int format;
+    char *data;
+    int byte_order;
+    int bitmap_unit;
+    int bitmap_bit_order;
+    int bitmap_pad;
+    int depth;
+    int bytes_per_line;
+    int bits_per_pixel;
+    unsigned long red_mask;
+    unsigned long green_mask;
+    unsigned long blue_mask;
+    XPointer obdata;
+    struct funcs {
+
+        struct _XImage *(*create_image)(
+                struct _XDisplay* ,
+                Visual* ,
+                unsigned int ,
+                int ,
+                int ,
+                char* ,
+                unsigned int ,
+                unsigned int ,
+                int ,
+                int );
+        int (*destroy_image) (struct _XImage *);
+        unsigned long (*get_pixel) (struct _XImage *, int, int);
+        int (*put_pixel) (struct _XImage *, int, int, unsigned long);
+        struct _XImage *(*sub_image)(struct _XImage *, int, int, unsigned int, unsigned int);
+        int (*add_pixel) (struct _XImage *, long);
+        } f;
+} XImage;
+
+
+
+
+typedef struct {
+    int x, y;
+    int width, height;
+    int border_width;
+    Window sibling;
+    int stack_mode;
+} XWindowChanges;
+
+
+
+
+typedef struct {
+        unsigned long pixel;
+        unsigned short red, green, blue;
+        char flags;
+        char pad;
+} XColor;
+
+
+
+
+
+
+typedef struct {
+    short x1, y1, x2, y2;
+} XSegment;
+
+typedef struct {
+    short x, y;
+} XPoint;
+
+typedef struct {
+    short x, y;
+    unsigned short width, height;
+} XRectangle;
+
+typedef struct {
+    short x, y;
+    unsigned short width, height;
+    short angle1, angle2;
+} XArc;
+
+
+
+
+typedef struct {
+        int key_click_percent;
+        int bell_percent;
+        int bell_pitch;
+        int bell_duration;
+        int led;
+        int led_mode;
+        int key;
+        int auto_repeat_mode;
+} XKeyboardControl;
+
+
+
+typedef struct {
+        int key_click_percent;
+        int bell_percent;
+        unsigned int bell_pitch, bell_duration;
+        unsigned long led_mask;
+        int global_auto_repeat;
+        char auto_repeats[32];
+} XKeyboardState;
+
+
+
+typedef struct {
+        Time time;
+        short x, y;
+} XTimeCoord;
+
+
+
+typedef struct {
+        int max_keypermod;
+        KeyCode *modifiermap;
+} XModifierKeymap;
+typedef struct _XDisplay Display;
+
+
+struct _XPrivate;
+struct _XrmHashBucketRec;
+
+typedef struct
+
+
+
+{
+        XExtData *ext_data;
+        struct _XPrivate *private1;
+        int fd;
+        int private2;
+        int proto_major_version;
+        int proto_minor_version;
+        char *vendor;
+        XID private3;
+        XID private4;
+        XID private5;
+        int private6;
+        XID (*resource_alloc)(
+
+                struct _XDisplay*
+
+        );
+        int byte_order;
+        int bitmap_unit;
+        int bitmap_pad;
+        int bitmap_bit_order;
+        int nformats;
+        ScreenFormat *pixmap_format;
+        int private8;
+        int release;
+        struct _XPrivate *private9, *private10;
+        int qlen;
+        unsigned long last_request_read;
+        unsigned long request;
+        XPointer private11;
+        XPointer private12;
+        XPointer private13;
+        XPointer private14;
+        unsigned max_request_size;
+        struct _XrmHashBucketRec *db;
+        int (*private15)(
+
+                struct _XDisplay*
+
+                );
+        char *display_name;
+        int default_screen;
+        int nscreens;
+        Screen *screens;
+        unsigned long motion_buffer;
+        unsigned long private16;
+        int min_keycode;
+        int max_keycode;
+        XPointer private17;
+        XPointer private18;
+        int private19;
+        char *xdefaults;
+
+}
+
+
+
+*_XPrivDisplay;
+typedef struct {
+        int type;
+        unsigned long serial;
+        int send_event;
+        Display *display;
+        Window window;
+        Window root;
+        Window subwindow;
+        Time time;
+        int x, y;
+        int x_root, y_root;
+        unsigned int state;
+        unsigned int keycode;
+        int same_screen;
+} XKeyEvent;
+typedef XKeyEvent XKeyPressedEvent;
+typedef XKeyEvent XKeyReleasedEvent;
+
+typedef struct {
+        int type;
+        unsigned long serial;
+        int send_event;
+        Display *display;
+        Window window;
+        Window root;
+        Window subwindow;
+        Time time;
+        int x, y;
+        int x_root, y_root;
+        unsigned int state;
+        unsigned int button;
+        int same_screen;
+} XButtonEvent;
+typedef XButtonEvent XButtonPressedEvent;
+typedef XButtonEvent XButtonReleasedEvent;
+
+typedef struct {
+        int type;
+        unsigned long serial;
+        int send_event;
+        Display *display;
+        Window window;
+        Window root;
+        Window subwindow;
+        Time time;
+        int x, y;
+        int x_root, y_root;
+        unsigned int state;
+        char is_hint;
+        int same_screen;
+} XMotionEvent;
+typedef XMotionEvent XPointerMovedEvent;
+
+typedef struct {
+        int type;
+        unsigned long serial;
+        int send_event;
+        Display *display;
+        Window window;
+        Window root;
+        Window subwindow;
+        Time time;
+        int x, y;
+        int x_root, y_root;
+        int mode;
+        int detail;
+
+
+
+
+        int same_screen;
+        int focus;
+        unsigned int state;
+} XCrossingEvent;
+typedef XCrossingEvent XEnterWindowEvent;
+typedef XCrossingEvent XLeaveWindowEvent;
+
+typedef struct {
+        int type;
+        unsigned long serial;
+        int send_event;
+        Display *display;
+        Window window;
+        int mode;
+        int detail;
+
+
+
+
+
+} XFocusChangeEvent;
+typedef XFocusChangeEvent XFocusInEvent;
+typedef XFocusChangeEvent XFocusOutEvent;
+
+
+typedef struct {
+        int type;
+        unsigned long serial;
+        int send_event;
+        Display *display;
+        Window window;
+        char key_vector[32];
+} XKeymapEvent;
+
+typedef struct {
+        int type;
+        unsigned long serial;
+        int send_event;
+        Display *display;
+        Window window;
+        int x, y;
+        int width, height;
+        int count;
+} XExposeEvent;
+
+typedef struct {
+        int type;
+        unsigned long serial;
+        int send_event;
+        Display *display;
+        Drawable drawable;
+        int x, y;
+        int width, height;
+        int count;
+        int major_code;
+        int minor_code;
+} XGraphicsExposeEvent;
+
+typedef struct {
+        int type;
+        unsigned long serial;
+        int send_event;
+        Display *display;
+        Drawable drawable;
+        int major_code;
+        int minor_code;
+} XNoExposeEvent;
+
+typedef struct {
+        int type;
+        unsigned long serial;
+        int send_event;
+        Display *display;
+        Window window;
+        int state;
+} XVisibilityEvent;
+
+typedef struct {
+        int type;
+        unsigned long serial;
+        int send_event;
+        Display *display;
+        Window parent;
+        Window window;
+        int x, y;
+        int width, height;
+        int border_width;
+        int override_redirect;
+} XCreateWindowEvent;
+
+typedef struct {
+        int type;
+        unsigned long serial;
+        int send_event;
+        Display *display;
+        Window event;
+        Window window;
+} XDestroyWindowEvent;
+
+typedef struct {
+        int type;
+        unsigned long serial;
+        int send_event;
+        Display *display;
+        Window event;
+        Window window;
+        int from_configure;
+} XUnmapEvent;
+
+typedef struct {
+        int type;
+        unsigned long serial;
+        int send_event;
+        Display *display;
+        Window event;
+        Window window;
+        int override_redirect;
+} XMapEvent;
+
+typedef struct {
+        int type;
+        unsigned long serial;
+        int send_event;
+        Display *display;
+        Window parent;
+        Window window;
+} XMapRequestEvent;
+
+typedef struct {
+        int type;
+        unsigned long serial;
+        int send_event;
+        Display *display;
+        Window event;
+        Window window;
+        Window parent;
+        int x, y;
+        int override_redirect;
+} XReparentEvent;
+
+typedef struct {
+        int type;
+        unsigned long serial;
+        int send_event;
+        Display *display;
+        Window event;
+        Window window;
+        int x, y;
+        int width, height;
+        int border_width;
+        Window above;
+        int override_redirect;
+} XConfigureEvent;
+
+typedef struct {
+        int type;
+        unsigned long serial;
+        int send_event;
+        Display *display;
+        Window event;
+        Window window;
+        int x, y;
+} XGravityEvent;
+
+typedef struct {
+        int type;
+        unsigned long serial;
+        int send_event;
+        Display *display;
+        Window window;
+        int width, height;
+} XResizeRequestEvent;
+
+typedef struct {
+        int type;
+        unsigned long serial;
+        int send_event;
+        Display *display;
+        Window parent;
+        Window window;
+        int x, y;
+        int width, height;
+        int border_width;
+        Window above;
+        int detail;
+        unsigned long value_mask;
+} XConfigureRequestEvent;
+
+typedef struct {
+        int type;
+        unsigned long serial;
+        int send_event;
+        Display *display;
+        Window event;
+        Window window;
+        int place;
+} XCirculateEvent;
+
+typedef struct {
+        int type;
+        unsigned long serial;
+        int send_event;
+        Display *display;
+        Window parent;
+        Window window;
+        int place;
+} XCirculateRequestEvent;
+
+typedef struct {
+        int type;
+        unsigned long serial;
+        int send_event;
+        Display *display;
+        Window window;
+        Atom atom;
+        Time time;
+        int state;
+} XPropertyEvent;
+
+typedef struct {
+        int type;
+        unsigned long serial;
+        int send_event;
+        Display *display;
+        Window window;
+        Atom selection;
+        Time time;
+} XSelectionClearEvent;
+
+typedef struct {
+        int type;
+        unsigned long serial;
+        int send_event;
+        Display *display;
+        Window owner;
+        Window requestor;
+        Atom selection;
+        Atom target;
+        Atom property;
+        Time time;
+} XSelectionRequestEvent;
+
+typedef struct {
+        int type;
+        unsigned long serial;
+        int send_event;
+        Display *display;
+        Window requestor;
+        Atom selection;
+        Atom target;
+        Atom property;
+        Time time;
+} XSelectionEvent;
+
+typedef struct {
+        int type;
+        unsigned long serial;
+        int send_event;
+        Display *display;
+        Window window;
+        Colormap colormap;
+
+        int c_new;
+
+
+
+        int state;
+} XColormapEvent;
+
+typedef struct {
+        int type;
+        unsigned long serial;
+        int send_event;
+        Display *display;
+        Window window;
+        Atom message_type;
+        int format;
+        union {
+                char b[20];
+                short s[10];
+                long l[5];
+                } data;
+} XClientMessageEvent;
+
+typedef struct {
+        int type;
+        unsigned long serial;
+        int send_event;
+        Display *display;
+        Window window;
+        int request;
+
+        int first_keycode;
+        int count;
+} XMappingEvent;
+
+typedef struct {
+        int type;
+        Display *display;
+        XID resourceid;
+        unsigned long serial;
+        unsigned char error_code;
+        unsigned char request_code;
+        unsigned char minor_code;
+} XErrorEvent;
+
+typedef struct {
+        int type;
+        unsigned long serial;
+        int send_event;
+        Display *display;
+        Window window;
+} XAnyEvent;
+
+
+
+
+
+typedef union _XEvent {
+        int type;
+        XAnyEvent xany;
+        XKeyEvent xkey;
+        XButtonEvent xbutton;
+        XMotionEvent xmotion;
+        XCrossingEvent xcrossing;
+        XFocusChangeEvent xfocus;
+        XExposeEvent xexpose;
+        XGraphicsExposeEvent xgraphicsexpose;
+        XNoExposeEvent xnoexpose;
+        XVisibilityEvent xvisibility;
+        XCreateWindowEvent xcreatewindow;
+        XDestroyWindowEvent xdestroywindow;
+        XUnmapEvent xunmap;
+        XMapEvent xmap;
+        XMapRequestEvent xmaprequest;
+        XReparentEvent xreparent;
+        XConfigureEvent xconfigure;
+        XGravityEvent xgravity;
+        XResizeRequestEvent xresizerequest;
+        XConfigureRequestEvent xconfigurerequest;
+        XCirculateEvent xcirculate;
+        XCirculateRequestEvent xcirculaterequest;
+        XPropertyEvent xproperty;
+        XSelectionClearEvent xselectionclear;
+        XSelectionRequestEvent xselectionrequest;
+        XSelectionEvent xselection;
+        XColormapEvent xcolormap;
+        XClientMessageEvent xclient;
+        XMappingEvent xmapping;
+        XErrorEvent xerror;
+        XKeymapEvent xkeymap;
+        long pad[24];
+} XEvent;
+
+
+
+
+
+
+typedef struct {
+    short lbearing;
+    short rbearing;
+    short width;
+    short ascent;
+    short descent;
+    unsigned short attributes;
+} XCharStruct;
+
+
+
+
+
+typedef struct {
+    Atom name;
+    unsigned long card32;
+} XFontProp;
+
+typedef struct {
+    XExtData *ext_data;
+    Font fid;
+    unsigned direction;
+    unsigned min_char_or_byte2;
+    unsigned max_char_or_byte2;
+    unsigned min_byte1;
+    unsigned max_byte1;
+    int all_chars_exist;
+    unsigned default_char;
+    int n_properties;
+    XFontProp *properties;
+    XCharStruct min_bounds;
+    XCharStruct max_bounds;
+    XCharStruct *per_char;
+    int ascent;
+    int descent;
+} XFontStruct;
+
+
+
+
+typedef struct {
+    char *chars;
+    int nchars;
+    int delta;
+    Font font;
+} XTextItem;
+
+typedef struct {
+    unsigned char byte1;
+    unsigned char byte2;
+} XChar2b;
+
+typedef struct {
+    XChar2b *chars;
+    int nchars;
+    int delta;
+    Font font;
+} XTextItem16;
+
+
+typedef union { Display *display;
+                GC gc;
+                Visual *visual;
+                Screen *screen;
+                ScreenFormat *pixmap_format;
+                XFontStruct *font; } XEDataObject;
+
+typedef struct {
+    XRectangle max_ink_extent;
+    XRectangle max_logical_extent;
+} XFontSetExtents;
+
+
+
+
+
+typedef struct _XOM *XOM;
+typedef struct _XOC *XOC, *XFontSet;
+
+typedef struct {
+    char *chars;
+    int nchars;
+    int delta;
+    XFontSet font_set;
+} XmbTextItem;
+
+typedef struct {
+    wchar_t *chars;
+    int nchars;
+    int delta;
+    XFontSet font_set;
+} XwcTextItem;
+
+
+typedef struct {
+    int charset_count;
+    char **charset_list;
+} XOMCharSetList;
+
+typedef enum {
+    XOMOrientation_LTR_TTB,
+    XOMOrientation_RTL_TTB,
+    XOMOrientation_TTB_LTR,
+    XOMOrientation_TTB_RTL,
+    XOMOrientation_Context
+} XOrientation;
+
+typedef struct {
+    int num_orientation;
+    XOrientation *orientation;
+} XOMOrientation;
+
+typedef struct {
+    int num_font;
+    XFontStruct **font_struct_list;
+    char **font_name_list;
+} XOMFontInfo;
+
+typedef struct _XIM *XIM;
+typedef struct _XIC *XIC;
+
+typedef void (*XIMProc)(
+
+    XIM,
+    XPointer,
+    XPointer
+
+);
+
+typedef int (*XICProc)(
+
+    XIC,
+    XPointer,
+    XPointer
+
+);
+
+typedef void (*XIDProc)(
+
+    Display*,
+    XPointer,
+    XPointer
+
+);
+
+typedef unsigned long XIMStyle;
+
+typedef struct {
+    unsigned short count_styles;
+    XIMStyle *supported_styles;
+} XIMStyles;
+
+
+
+
+
+
+typedef void *XVaNestedList;
+
+
+
+
+typedef struct {
+    XPointer client_data;
+    XIMProc callback;
+} XIMCallback;
+
+typedef struct {
+    XPointer client_data;
+    XICProc callback;
+} XICCallback;
+
+typedef unsigned long XIMFeedback;
+
+
+typedef struct _XIMText {
+    unsigned short length;
+    XIMFeedback *feedback;
+    int encoding_is_wchar;
+    union {
+        char *multi_byte;
+        wchar_t *wide_char;
+    } string;
+} XIMText;
+
+typedef unsigned long XIMPreeditState;
+
+
+typedef struct _XIMPreeditStateNotifyCallbackStruct {
+    XIMPreeditState state;
+} XIMPreeditStateNotifyCallbackStruct;
+
+typedef unsigned long XIMResetState;
+
+
+typedef unsigned long XIMStringConversionFeedback;
+
+
+typedef struct _XIMStringConversionText {
+    unsigned short length;
+    XIMStringConversionFeedback *feedback;
+    int encoding_is_wchar;
+    union {
+        char *mbs;
+        wchar_t *wcs;
+    } string;
+} XIMStringConversionText;
+
+typedef unsigned short XIMStringConversionPosition;
+
+typedef unsigned short XIMStringConversionType;
+
+
+typedef unsigned short XIMStringConversionOperation;
+
+
+typedef enum {
+    XIMForwardChar, XIMBackwardChar,
+    XIMForwardWord, XIMBackwardWord,
+    XIMCaretUp, XIMCaretDown,
+    XIMNextLine, XIMPreviousLine,
+    XIMLineStart, XIMLineEnd,
+    XIMAbsolutePosition,
+    XIMDontChange
+} XIMCaretDirection;
+
+typedef struct _XIMStringConversionCallbackStruct {
+    XIMStringConversionPosition position;
+    XIMCaretDirection direction;
+    XIMStringConversionOperation operation;
+    unsigned short factor;
+    XIMStringConversionText *text;
+} XIMStringConversionCallbackStruct;
+
+typedef struct _XIMPreeditDrawCallbackStruct {
+    int caret;
+    int chg_first;
+    int chg_length;
+    XIMText *text;
+} XIMPreeditDrawCallbackStruct;
+
+typedef enum {
+    XIMIsInvisible,
+    XIMIsPrimary,
+    XIMIsSecondary
+} XIMCaretStyle;
+
+typedef struct _XIMPreeditCaretCallbackStruct {
+    int position;
+    XIMCaretDirection direction;
+    XIMCaretStyle style;
+} XIMPreeditCaretCallbackStruct;
+
+typedef enum {
+    XIMTextType,
+    XIMBitmapType
+} XIMStatusDataType;
+
+typedef struct _XIMStatusDrawCallbackStruct {
+    XIMStatusDataType type;
+    union {
+        XIMText *text;
+        Pixmap bitmap;
+    } data;
+} XIMStatusDrawCallbackStruct;
+
+typedef struct _XIMHotKeyTrigger {
+    KeySym keysym;
+    int modifier;
+    int modifier_mask;
+} XIMHotKeyTrigger;
+
+typedef struct _XIMHotKeyTriggers {
+    int num_hot_key;
+    XIMHotKeyTrigger *key;
+} XIMHotKeyTriggers;
+
+typedef unsigned long XIMHotKeyState;
+
+
+typedef struct {
+    unsigned short count_values;
+    char **supported_values;
+} XIMValuesList;
+
+extern "C" {
+
+
+
+
+
+extern int _Xdebug;
+
+extern XFontStruct *XLoadQueryFont(
+
+    Display* ,
+    const char*
+
+);
+
+extern XFontStruct *XQueryFont(
+
+    Display* ,
+    XID
+
+);
+
+
+extern XTimeCoord *XGetMotionEvents(
+
+    Display* ,
+    Window ,
+    Time ,
+    Time ,
+    int*
+
+);
+
+extern XModifierKeymap *XDeleteModifiermapEntry(
+
+    XModifierKeymap* ,
+
+    unsigned int ,
+
+
+
+    int
+
+);
+
+extern XModifierKeymap *XGetModifierMapping(
+
+    Display*
+
+);
+
+extern XModifierKeymap *XInsertModifiermapEntry(
+
+    XModifierKeymap* ,
+
+    unsigned int ,
+
+
+
+    int
+
+);
+
+extern XModifierKeymap *XNewModifiermap(
+
+    int
+
+);
+
+extern XImage *XCreateImage(
+
+    Display* ,
+    Visual* ,
+    unsigned int ,
+    int ,
+    int ,
+    char* ,
+    unsigned int ,
+    unsigned int ,
+    int ,
+    int
+
+);
+extern int XInitImage(
+
+    XImage*
+
+);
+extern XImage *XGetImage(
+
+    Display* ,
+    Drawable ,
+    int ,
+    int ,
+    unsigned int ,
+    unsigned int ,
+    unsigned long ,
+    int
+
+);
+extern XImage *XGetSubImage(
+
+    Display* ,
+    Drawable ,
+    int ,
+    int ,
+    unsigned int ,
+    unsigned int ,
+    unsigned long ,
+    int ,
+    XImage* ,
+    int ,
+    int
+
+);
+
+
+
+
+extern Display *XOpenDisplay(
+
+    const char*
+
+);
+
+extern void XrmInitialize(
+
+    void
+
+);
+
+extern char *XFetchBytes(
+
+    Display* ,
+    int*
+
+);
+extern char *XFetchBuffer(
+
+    Display* ,
+    int* ,
+    int
+
+);
+extern char *XGetAtomName(
+
+    Display* ,
+    Atom
+
+);
+extern int XGetAtomNames(
+
+    Display* ,
+    Atom* ,
+    int ,
+    char**
+
+);
+extern char *XGetDefault(
+
+    Display* ,
+    const char* ,
+    const char*
+
+);
+extern char *XDisplayName(
+
+    const char*
+
+);
+extern char *XKeysymToString(
+
+    KeySym
+
+);
+
+extern int (*XSynchronize(
+
+    Display* ,
+    int
+
+))(
+
+    Display*
+
+);
+extern int (*XSetAfterFunction(
+
+    Display* ,
+    int (*) (
+
+             Display*
+
+            )
+
+))(
+
+    Display*
+
+);
+extern Atom XInternAtom(
+
+    Display* ,
+    const char* ,
+    int
+
+);
+extern int XInternAtoms(
+
+    Display* ,
+    char** ,
+    int ,
+    int ,
+    Atom*
+
+);
+extern Colormap XCopyColormapAndFree(
+
+    Display* ,
+    Colormap
+
+);
+extern Colormap XCreateColormap(
+
+    Display* ,
+    Window ,
+    Visual* ,
+    int
+
+);
+extern Cursor XCreatePixmapCursor(
+
+    Display* ,
+    Pixmap ,
+    Pixmap ,
+    XColor* ,
+    XColor* ,
+    unsigned int ,
+    unsigned int
+
+);
+extern Cursor XCreateGlyphCursor(
+
+    Display* ,
+    Font ,
+    Font ,
+    unsigned int ,
+    unsigned int ,
+    XColor const * ,
+    XColor const *
+
+);
+extern Cursor XCreateFontCursor(
+
+    Display* ,
+    unsigned int
+
+);
+extern Font XLoadFont(
+
+    Display* ,
+    const char*
+
+);
+extern GC XCreateGC(
+
+    Display* ,
+    Drawable ,
+    unsigned long ,
+    XGCValues*
+
+);
+extern GContext XGContextFromGC(
+
+    GC
+
+);
+extern void XFlushGC(
+
+    Display* ,
+    GC
+
+);
+extern Pixmap XCreatePixmap(
+
+    Display* ,
+    Drawable ,
+    unsigned int ,
+    unsigned int ,
+    unsigned int
+
+);
+extern Pixmap XCreateBitmapFromData(
+
+    Display* ,
+    Drawable ,
+    const char* ,
+    unsigned int ,
+    unsigned int
+
+);
+extern Pixmap XCreatePixmapFromBitmapData(
+
+    Display* ,
+    Drawable ,
+    char* ,
+    unsigned int ,
+    unsigned int ,
+    unsigned long ,
+    unsigned long ,
+    unsigned int
+
+);
+extern Window XCreateSimpleWindow(
+
+    Display* ,
+    Window ,
+    int ,
+    int ,
+    unsigned int ,
+    unsigned int ,
+    unsigned int ,
+    unsigned long ,
+    unsigned long
+
+);
+extern Window XGetSelectionOwner(
+
+    Display* ,
+    Atom
+
+);
+extern Window XCreateWindow(
+
+    Display* ,
+    Window ,
+    int ,
+    int ,
+    unsigned int ,
+    unsigned int ,
+    unsigned int ,
+    int ,
+    unsigned int ,
+    Visual* ,
+    unsigned long ,
+    XSetWindowAttributes*
+
+);
+extern Colormap *XListInstalledColormaps(
+
+    Display* ,
+    Window ,
+    int*
+
+);
+extern char **XListFonts(
+
+    Display* ,
+    const char* ,
+    int ,
+    int*
+
+);
+extern char **XListFontsWithInfo(
+
+    Display* ,
+    const char* ,
+    int ,
+    int* ,
+    XFontStruct**
+
+);
+extern char **XGetFontPath(
+
+    Display* ,
+    int*
+
+);
+extern char **XListExtensions(
+
+    Display* ,
+    int*
+
+);
+extern Atom *XListProperties(
+
+    Display* ,
+    Window ,
+    int*
+
+);
+extern XHostAddress *XListHosts(
+
+    Display* ,
+    int* ,
+    int*
+
+);
+extern KeySym XKeycodeToKeysym(
+
+    Display* ,
+
+    unsigned int ,
+
+
+
+    int
+
+);
+extern KeySym XLookupKeysym(
+
+    XKeyEvent* ,
+    int
+
+);
+extern KeySym *XGetKeyboardMapping(
+
+    Display* ,
+
+    unsigned int ,
+
+
+
+    int ,
+    int*
+
+);
+extern KeySym XStringToKeysym(
+
+    const char*
+
+);
+extern long XMaxRequestSize(
+
+    Display*
+
+);
+extern long XExtendedMaxRequestSize(
+
+    Display*
+
+);
+extern char *XResourceManagerString(
+
+    Display*
+
+);
+extern char *XScreenResourceString(
+
+        Screen*
+
+);
+extern unsigned long XDisplayMotionBufferSize(
+
+    Display*
+
+);
+extern VisualID XVisualIDFromVisual(
+
+    Visual*
+
+);
+
+
+
+extern int XInitThreads(
+
+    void
+
+);
+
+extern void XLockDisplay(
+
+    Display*
+
+);
+
+extern void XUnlockDisplay(
+
+    Display*
+
+);
+
+
+
+extern XExtCodes *XInitExtension(
+
+    Display* ,
+    const char*
+
+);
+
+extern XExtCodes *XAddExtension(
+
+    Display*
+
+);
+extern XExtData *XFindOnExtensionList(
+
+    XExtData** ,
+    int
+
+);
+extern XExtData **XEHeadOfExtensionList(
+
+    XEDataObject
+
+);
+
+
+extern Window XRootWindow(
+
+    Display* ,
+    int
+
+);
+extern Window XDefaultRootWindow(
+
+    Display*
+
+);
+extern Window XRootWindowOfScreen(
+
+    Screen*
+
+);
+extern Visual *XDefaultVisual(
+
+    Display* ,
+    int
+
+);
+extern Visual *XDefaultVisualOfScreen(
+
+    Screen*
+
+);
+extern GC XDefaultGC(
+
+    Display* ,
+    int
+
+);
+extern GC XDefaultGCOfScreen(
+
+    Screen*
+
+);
+extern unsigned long XBlackPixel(
+
+    Display* ,
+    int
+
+);
+extern unsigned long XWhitePixel(
+
+    Display* ,
+    int
+
+);
+extern unsigned long XAllPlanes(
+
+    void
+
+);
+extern unsigned long XBlackPixelOfScreen(
+
+    Screen*
+
+);
+extern unsigned long XWhitePixelOfScreen(
+
+    Screen*
+
+);
+extern unsigned long XNextRequest(
+
+    Display*
+
+);
+extern unsigned long XLastKnownRequestProcessed(
+
+    Display*
+
+);
+extern char *XServerVendor(
+
+    Display*
+
+);
+extern char *XDisplayString(
+
+    Display*
+
+);
+extern Colormap XDefaultColormap(
+
+    Display* ,
+    int
+
+);
+extern Colormap XDefaultColormapOfScreen(
+
+    Screen*
+
+);
+extern Display *XDisplayOfScreen(
+
+    Screen*
+
+);
+extern Screen *XScreenOfDisplay(
+
+    Display* ,
+    int
+
+);
+extern Screen *XDefaultScreenOfDisplay(
+
+    Display*
+
+);
+extern long XEventMaskOfScreen(
+
+    Screen*
+
+);
+
+extern int XScreenNumberOfScreen(
+
+    Screen*
+
+);
+
+typedef int (*XErrorHandler) (
+
+    Display* ,
+    XErrorEvent*
+
+);
+
+extern XErrorHandler XSetErrorHandler (
+
+    XErrorHandler
+
+);
+
+
+typedef int (*XIOErrorHandler) (
+
+    Display*
+
+);
+
+extern XIOErrorHandler XSetIOErrorHandler (
+
+    XIOErrorHandler
+
+);
+
+
+extern XPixmapFormatValues *XListPixmapFormats(
+
+    Display* ,
+    int*
+
+);
+extern int *XListDepths(
+
+    Display* ,
+    int ,
+    int*
+
+);
+
+
+
+extern int XReconfigureWMWindow(
+
+    Display* ,
+    Window ,
+    int ,
+    unsigned int ,
+    XWindowChanges*
+
+);
+
+extern int XGetWMProtocols(
+
+    Display* ,
+    Window ,
+    Atom** ,
+    int*
+
+);
+extern int XSetWMProtocols(
+
+    Display* ,
+    Window ,
+    Atom* ,
+    int
+
+);
+extern int XIconifyWindow(
+
+    Display* ,
+    Window ,
+    int
+
+);
+extern int XWithdrawWindow(
+
+    Display* ,
+    Window ,
+    int
+
+);
+extern int XGetCommand(
+
+    Display* ,
+    Window ,
+    char*** ,
+    int*
+
+);
+extern int XGetWMColormapWindows(
+
+    Display* ,
+    Window ,
+    Window** ,
+    int*
+
+);
+extern int XSetWMColormapWindows(
+
+    Display* ,
+    Window ,
+    Window* ,
+    int
+
+);
+extern void XFreeStringList(
+
+    char**
+
+);
+extern int XSetTransientForHint(
+
+    Display* ,
+    Window ,
+    Window
+
+);
+
+
+
+extern int XActivateScreenSaver(
+
+    Display*
+
+);
+
+extern int XAddHost(
+
+    Display* ,
+    XHostAddress*
+
+);
+
+extern int XAddHosts(
+
+    Display* ,
+    XHostAddress* ,
+    int
+
+);
+
+extern int XAddToExtensionList(
+
+    struct _XExtData** ,
+    XExtData*
+
+);
+
+extern int XAddToSaveSet(
+
+    Display* ,
+    Window
+
+);
+
+extern int XAllocColor(
+
+    Display* ,
+    Colormap ,
+    XColor*
+
+);
+
+extern int XAllocColorCells(
+
+    Display* ,
+    Colormap ,
+    int ,
+    unsigned long* ,
+    unsigned int ,
+    unsigned long* ,
+    unsigned int
+
+);
+
+extern int XAllocColorPlanes(
+
+    Display* ,
+    Colormap ,
+    int ,
+    unsigned long* ,
+    int ,
+    int ,
+    int ,
+    int ,
+    unsigned long* ,
+    unsigned long* ,
+    unsigned long*
+
+);
+
+extern int XAllocNamedColor(
+
+    Display* ,
+    Colormap ,
+    const char* ,
+    XColor* ,
+    XColor*
+
+);
+
+extern int XAllowEvents(
+
+    Display* ,
+    int ,
+    Time
+
+);
+
+extern int XAutoRepeatOff(
+
+    Display*
+
+);
+
+extern int XAutoRepeatOn(
+
+    Display*
+
+);
+
+extern int XBell(
+
+    Display* ,
+    int
+
+);
+
+extern int XBitmapBitOrder(
+
+    Display*
+
+);
+
+extern int XBitmapPad(
+
+    Display*
+
+);
+
+extern int XBitmapUnit(
+
+    Display*
+
+);
+
+extern int XCellsOfScreen(
+
+    Screen*
+
+);
+
+extern int XChangeActivePointerGrab(
+
+    Display* ,
+    unsigned int ,
+    Cursor ,
+    Time
+
+);
+
+extern int XChangeGC(
+
+    Display* ,
+    GC ,
+    unsigned long ,
+    XGCValues*
+
+);
+
+extern int XChangeKeyboardControl(
+
+    Display* ,
+    unsigned long ,
+    XKeyboardControl*
+
+);
+
+extern int XChangeKeyboardMapping(
+
+    Display* ,
+    int ,
+    int ,
+    KeySym* ,
+    int
+
+);
+
+extern int XChangePointerControl(
+
+    Display* ,
+    int ,
+    int ,
+    int ,
+    int ,
+    int
+
+);
+
+extern int XChangeProperty(
+
+    Display* ,
+    Window ,
+    Atom ,
+    Atom ,
+    int ,
+    int ,
+    const unsigned char* ,
+    int
+
+);
+
+extern int XChangeSaveSet(
+
+    Display* ,
+    Window ,
+    int
+
+);
+
+extern int XChangeWindowAttributes(
+
+    Display* ,
+    Window ,
+    unsigned long ,
+    XSetWindowAttributes*
+
+);
+
+extern int XCheckIfEvent(
+
+    Display* ,
+    XEvent* ,
+    int (*) (
+
+               Display* ,
+               XEvent* ,
+               XPointer
+
+             ) ,
+    XPointer
+
+);
+
+extern int XCheckMaskEvent(
+
+    Display* ,
+    long ,
+    XEvent*
+
+);
+
+extern int XCheckTypedEvent(
+
+    Display* ,
+    int ,
+    XEvent*
+
+);
+
+extern int XCheckTypedWindowEvent(
+
+    Display* ,
+    Window ,
+    int ,
+    XEvent*
+
+);
+
+extern int XCheckWindowEvent(
+
+    Display* ,
+    Window ,
+    long ,
+    XEvent*
+
+);
+
+extern int XCirculateSubwindows(
+
+    Display* ,
+    Window ,
+    int
+
+);
+
+extern int XCirculateSubwindowsDown(
+
+    Display* ,
+    Window
+
+);
+
+extern int XCirculateSubwindowsUp(
+
+    Display* ,
+    Window
+
+);
+
+extern int XClearArea(
+
+    Display* ,
+    Window ,
+    int ,
+    int ,
+    unsigned int ,
+    unsigned int ,
+    int
+
+);
+
+extern int XClearWindow(
+
+    Display* ,
+    Window
+
+);
+
+extern int XCloseDisplay(
+
+    Display*
+
+);
+
+extern int XConfigureWindow(
+
+    Display* ,
+    Window ,
+    unsigned int ,
+    XWindowChanges*
+
+);
+
+extern int XConnectionNumber(
+
+    Display*
+
+);
+
+extern int XConvertSelection(
+
+    Display* ,
+    Atom ,
+    Atom ,
+    Atom ,
+    Window ,
+    Time
+
+);
+
+extern int XCopyArea(
+
+    Display* ,
+    Drawable ,
+    Drawable ,
+    GC ,
+    int ,
+    int ,
+    unsigned int ,
+    unsigned int ,
+    int ,
+    int
+
+);
+
+extern int XCopyGC(
+
+    Display* ,
+    GC ,
+    unsigned long ,
+    GC
+
+);
+
+extern int XCopyPlane(
+
+    Display* ,
+    Drawable ,
+    Drawable ,
+    GC ,
+    int ,
+    int ,
+    unsigned int ,
+    unsigned int ,
+    int ,
+    int ,
+    unsigned long
+
+);
+
+extern int XDefaultDepth(
+
+    Display* ,
+    int
+
+);
+
+extern int XDefaultDepthOfScreen(
+
+    Screen*
+
+);
+
+extern int XDefaultScreen(
+
+    Display*
+
+);
+
+extern int XDefineCursor(
+
+    Display* ,
+    Window ,
+    Cursor
+
+);
+
+extern int XDeleteProperty(
+
+    Display* ,
+    Window ,
+    Atom
+
+);
+
+extern int XDestroyWindow(
+
+    Display* ,
+    Window
+
+);
+
+extern int XDestroySubwindows(
+
+    Display* ,
+    Window
+
+);
+
+extern int XDoesBackingStore(
+
+    Screen*
+
+);
+
+extern int XDoesSaveUnders(
+
+    Screen*
+
+);
+
+extern int XDisableAccessControl(
+
+    Display*
+
+);
+
+
+extern int XDisplayCells(
+
+    Display* ,
+    int
+
+);
+
+extern int XDisplayHeight(
+
+    Display* ,
+    int
+
+);
+
+extern int XDisplayHeightMM(
+
+    Display* ,
+    int
+
+);
+
+extern int XDisplayKeycodes(
+
+    Display* ,
+    int* ,
+    int*
+
+);
+
+extern int XDisplayPlanes(
+
+    Display* ,
+    int
+
+);
+
+extern int XDisplayWidth(
+
+    Display* ,
+    int
+
+);
+
+extern int XDisplayWidthMM(
+
+    Display* ,
+    int
+
+);
+
+extern int XDrawArc(
+
+    Display* ,
+    Drawable ,
+    GC ,
+    int ,
+    int ,
+    unsigned int ,
+    unsigned int ,
+    int ,
+    int
+
+);
+
+extern int XDrawArcs(
+
+    Display* ,
+    Drawable ,
+    GC ,
+    XArc* ,
+    int
+
+);
+
+extern int XDrawImageString(
+
+    Display* ,
+    Drawable ,
+    GC ,
+    int ,
+    int ,
+    const char* ,
+    int
+
+);
+
+extern int XDrawImageString16(
+
+    Display* ,
+    Drawable ,
+    GC ,
+    int ,
+    int ,
+    const XChar2b* ,
+    int
+
+);
+
+extern int XDrawLine(
+
+    Display* ,
+    Drawable ,
+    GC ,
+    int ,
+    int ,
+    int ,
+    int
+
+);
+
+extern int XDrawLines(
+
+    Display* ,
+    Drawable ,
+    GC ,
+    XPoint* ,
+    int ,
+    int
+
+);
+
+extern int XDrawPoint(
+
+    Display* ,
+    Drawable ,
+    GC ,
+    int ,
+    int
+
+);
+
+extern int XDrawPoints(
+
+    Display* ,
+    Drawable ,
+    GC ,
+    XPoint* ,
+    int ,
+    int
+
+);
+
+extern int XDrawRectangle(
+
+    Display* ,
+    Drawable ,
+    GC ,
+    int ,
+    int ,
+    unsigned int ,
+    unsigned int
+
+);
+
+extern int XDrawRectangles(
+
+    Display* ,
+    Drawable ,
+    GC ,
+    XRectangle* ,
+    int
+
+);
+
+extern int XDrawSegments(
+
+    Display* ,
+    Drawable ,
+    GC ,
+    XSegment* ,
+    int
+
+);
+
+extern int XDrawString(
+
+    Display* ,
+    Drawable ,
+    GC ,
+    int ,
+    int ,
+    const char* ,
+    int
+
+);
+
+extern int XDrawString16(
+
+    Display* ,
+    Drawable ,
+    GC ,
+    int ,
+    int ,
+    const XChar2b* ,
+    int
+
+);
+
+extern int XDrawText(
+
+    Display* ,
+    Drawable ,
+    GC ,
+    int ,
+    int ,
+    XTextItem* ,
+    int
+
+);
+
+extern int XDrawText16(
+
+    Display* ,
+    Drawable ,
+    GC ,
+    int ,
+    int ,
+    XTextItem16* ,
+    int
+
+);
+
+extern int XEnableAccessControl(
+
+    Display*
+
+);
+
+extern int XEventsQueued(
+
+    Display* ,
+    int
+
+);
+
+extern int XFetchName(
+
+    Display* ,
+    Window ,
+    char**
+
+);
+
+extern int XFillArc(
+
+    Display* ,
+    Drawable ,
+    GC ,
+    int ,
+    int ,
+    unsigned int ,
+    unsigned int ,
+    int ,
+    int
+
+);
+
+extern int XFillArcs(
+
+    Display* ,
+    Drawable ,
+    GC ,
+    XArc* ,
+    int
+
+);
+
+extern int XFillPolygon(
+
+    Display* ,
+    Drawable ,
+    GC ,
+    XPoint* ,
+    int ,
+    int ,
+    int
+
+);
+
+extern int XFillRectangle(
+
+    Display* ,
+    Drawable ,
+    GC ,
+    int ,
+    int ,
+    unsigned int ,
+    unsigned int
+
+);
+
+extern int XFillRectangles(
+
+    Display* ,
+    Drawable ,
+    GC ,
+    XRectangle* ,
+    int
+
+);
+
+extern int XFlush(
+
+    Display*
+
+);
+
+extern int XForceScreenSaver(
+
+    Display* ,
+    int
+
+);
+
+extern int XFree(
+
+    void*
+
+);
+
+extern int XFreeColormap(
+
+    Display* ,
+    Colormap
+
+);
+
+extern int XFreeColors(
+
+    Display* ,
+    Colormap ,
+    unsigned long* ,
+    int ,
+    unsigned long
+
+);
+
+extern int XFreeCursor(
+
+    Display* ,
+    Cursor
+
+);
+
+extern int XFreeExtensionList(
+
+    char**
+
+);
+
+extern int XFreeFont(
+
+    Display* ,
+    XFontStruct*
+
+);
+
+extern int XFreeFontInfo(
+
+    char** ,
+    XFontStruct* ,
+    int
+
+);
+
+extern int XFreeFontNames(
+
+    char**
+
+);
+
+extern int XFreeFontPath(
+
+    char**
+
+);
+
+extern int XFreeGC(
+
+    Display* ,
+    GC
+
+);
+
+extern int XFreeModifiermap(
+
+    XModifierKeymap*
+
+);
+
+extern int XFreePixmap(
+
+    Display* ,
+    Pixmap
+
+);
+
+extern int XGeometry(
+
+    Display* ,
+    int ,
+    const char* ,
+    const char* ,
+    unsigned int ,
+    unsigned int ,
+    unsigned int ,
+    int ,
+    int ,
+    int* ,
+    int* ,
+    int* ,
+    int*
+
+);
+
+extern int XGetErrorDatabaseText(
+
+    Display* ,
+    const char* ,
+    const char* ,
+    const char* ,
+    char* ,
+    int
+
+);
+
+extern int XGetErrorText(
+
+    Display* ,
+    int ,
+    char* ,
+    int
+
+);
+
+extern int XGetFontProperty(
+
+    XFontStruct* ,
+    Atom ,
+    unsigned long*
+
+);
+
+extern int XGetGCValues(
+
+    Display* ,
+    GC ,
+    unsigned long ,
+    XGCValues*
+
+);
+
+extern int XGetGeometry(
+
+    Display* ,
+    Drawable ,
+    Window* ,
+    int* ,
+    int* ,
+    unsigned int* ,
+    unsigned int* ,
+    unsigned int* ,
+    unsigned int*
+
+);
+
+extern int XGetIconName(
+
+    Display* ,
+    Window ,
+    char**
+
+);
+
+extern int XGetInputFocus(
+
+    Display* ,
+    Window* ,
+    int*
+
+);
+
+extern int XGetKeyboardControl(
+
+    Display* ,
+    XKeyboardState*
+
+);
+
+extern int XGetPointerControl(
+
+    Display* ,
+    int* ,
+    int* ,
+    int*
+
+);
+
+extern int XGetPointerMapping(
+
+    Display* ,
+    unsigned char* ,
+    int
+
+);
+
+extern int XGetScreenSaver(
+
+    Display* ,
+    int* ,
+    int* ,
+    int* ,
+    int*
+
+);
+
+extern int XGetTransientForHint(
+
+    Display* ,
+    Window ,
+    Window*
+
+);
+
+extern int XGetWindowProperty(
+
+    Display* ,
+    Window ,
+    Atom ,
+    long ,
+    long ,
+    int ,
+    Atom ,
+    Atom* ,
+    int* ,
+    unsigned long* ,
+    unsigned long* ,
+    unsigned char**
+
+);
+
+extern int XGetWindowAttributes(
+
+    Display* ,
+    Window ,
+    XWindowAttributes*
+
+);
+
+extern int XGrabButton(
+
+    Display* ,
+    unsigned int ,
+    unsigned int ,
+    Window ,
+    int ,
+    unsigned int ,
+    int ,
+    int ,
+    Window ,
+    Cursor
+
+);
+
+extern int XGrabKey(
+
+    Display* ,
+    int ,
+    unsigned int ,
+    Window ,
+    int ,
+    int ,
+    int
+
+);
+
+extern int XGrabKeyboard(
+
+    Display* ,
+    Window ,
+    int ,
+    int ,
+    int ,
+    Time
+
+);
+
+extern int XGrabPointer(
+
+    Display* ,
+    Window ,
+    int ,
+    unsigned int ,
+    int ,
+    int ,
+    Window ,
+    Cursor ,
+    Time
+
+);
+
+extern int XGrabServer(
+
+    Display*
+
+);
+
+extern int XHeightMMOfScreen(
+
+    Screen*
+
+);
+
+extern int XHeightOfScreen(
+
+    Screen*
+
+);
+
+extern int XIfEvent(
+
+    Display* ,
+    XEvent* ,
+    int (*) (
+
+               Display* ,
+               XEvent* ,
+               XPointer
+
+             ) ,
+    XPointer
+
+);
+
+extern int XImageByteOrder(
+
+    Display*
+
+);
+
+extern int XInstallColormap(
+
+    Display* ,
+    Colormap
+
+);
+
+extern KeyCode XKeysymToKeycode(
+
+    Display* ,
+    KeySym
+
+);
+
+extern int XKillClient(
+
+    Display* ,
+    XID
+
+);
+
+extern int XLookupColor(
+
+    Display* ,
+    Colormap ,
+    const char* ,
+    XColor* ,
+    XColor*
+
+);
+
+extern int XLowerWindow(
+
+    Display* ,
+    Window
+
+);
+
+extern int XMapRaised(
+
+    Display* ,
+    Window
+
+);
+
+extern int XMapSubwindows(
+
+    Display* ,
+    Window
+
+);
+
+extern int XMapWindow(
+
+    Display* ,
+    Window
+
+);
+
+extern int XMaskEvent(
+
+    Display* ,
+    long ,
+    XEvent*
+
+);
+
+extern int XMaxCmapsOfScreen(
+
+    Screen*
+
+);
+
+extern int XMinCmapsOfScreen(
+
+    Screen*
+
+);
+
+extern int XMoveResizeWindow(
+
+    Display* ,
+    Window ,
+    int ,
+    int ,
+    unsigned int ,
+    unsigned int
+
+);
+
+extern int XMoveWindow(
+
+    Display* ,
+    Window ,
+    int ,
+    int
+
+);
+
+extern int XNextEvent(
+
+    Display* ,
+    XEvent*
+
+);
+
+extern int XNoOp(
+
+    Display*
+
+);
+
+extern int XParseColor(
+
+    Display* ,
+    Colormap ,
+    const char* ,
+    XColor*
+
+);
+
+extern int XParseGeometry(
+
+    const char* ,
+    int* ,
+    int* ,
+    unsigned int* ,
+    unsigned int*
+
+);
+
+extern int XPeekEvent(
+
+    Display* ,
+    XEvent*
+
+);
+
+extern int XPeekIfEvent(
+
+    Display* ,
+    XEvent* ,
+    int (*) (
+
+               Display* ,
+               XEvent* ,
+               XPointer
+
+             ) ,
+    XPointer
+
+);
+
+extern int XPending(
+
+    Display*
+
+);
+
+extern int XPlanesOfScreen(
+
+    Screen*
+
+
+);
+
+extern int XProtocolRevision(
+
+    Display*
+
+);
+
+extern int XProtocolVersion(
+
+    Display*
+
+);
+
+
+extern int XPutBackEvent(
+
+    Display* ,
+    XEvent*
+
+);
+
+extern int XPutImage(
+
+    Display* ,
+    Drawable ,
+    GC ,
+    XImage* ,
+    int ,
+    int ,
+    int ,
+    int ,
+    unsigned int ,
+    unsigned int
+
+);
+
+extern int XQLength(
+
+    Display*
+
+);
+
+extern int XQueryBestCursor(
+
+    Display* ,
+    Drawable ,
+    unsigned int ,
+    unsigned int ,
+    unsigned int* ,
+    unsigned int*
+
+);
+
+extern int XQueryBestSize(
+
+    Display* ,
+    int ,
+    Drawable ,
+    unsigned int ,
+    unsigned int ,
+    unsigned int* ,
+    unsigned int*
+
+);
+
+extern int XQueryBestStipple(
+
+    Display* ,
+    Drawable ,
+    unsigned int ,
+    unsigned int ,
+    unsigned int* ,
+    unsigned int*
+
+);
+
+extern int XQueryBestTile(
+
+    Display* ,
+    Drawable ,
+    unsigned int ,
+    unsigned int ,
+    unsigned int* ,
+    unsigned int*
+
+);
+
+extern int XQueryColor(
+
+    Display* ,
+    Colormap ,
+    XColor*
+
+);
+
+extern int XQueryColors(
+
+    Display* ,
+    Colormap ,
+    XColor* ,
+    int
+
+);
+
+extern int XQueryExtension(
+
+    Display* ,
+    const char* ,
+    int* ,
+    int* ,
+    int*
+
+);
+
+extern int XQueryKeymap(
+
+    Display* ,
+    char [32]
+
+);
+
+extern int XQueryPointer(
+
+    Display* ,
+    Window ,
+    Window* ,
+    Window* ,
+    int* ,
+    int* ,
+    int* ,
+    int* ,
+    unsigned int*
+
+);
+
+extern int XQueryTextExtents(
+
+    Display* ,
+    XID ,
+    const char* ,
+    int ,
+    int* ,
+    int* ,
+    int* ,
+    XCharStruct*
+
+);
+
+extern int XQueryTextExtents16(
+
+    Display* ,
+    XID ,
+    const XChar2b* ,
+    int ,
+    int* ,
+    int* ,
+    int* ,
+    XCharStruct*
+
+);
+
+extern int XQueryTree(
+
+    Display* ,
+    Window ,
+    Window* ,
+    Window* ,
+    Window** ,
+    unsigned int*
+
+);
+
+extern int XRaiseWindow(
+
+    Display* ,
+    Window
+
+);
+
+extern int XReadBitmapFile(
+
+    Display* ,
+    Drawable ,
+    const char* ,
+    unsigned int* ,
+    unsigned int* ,
+    Pixmap* ,
+    int* ,
+    int*
+
+);
+
+extern int XReadBitmapFileData(
+
+    const char* ,
+    unsigned int* ,
+    unsigned int* ,
+    unsigned char** ,
+    int* ,
+    int*
+
+);
+
+extern int XRebindKeysym(
+
+    Display* ,
+    KeySym ,
+    KeySym* ,
+    int ,
+    const unsigned char* ,
+    int
+
+);
+
+extern int XRecolorCursor(
+
+    Display* ,
+    Cursor ,
+    XColor* ,
+    XColor*
+
+);
+
+extern int XRefreshKeyboardMapping(
+
+    XMappingEvent*
+
+);
+
+extern int XRemoveFromSaveSet(
+
+    Display* ,
+    Window
+
+);
+
+extern int XRemoveHost(
+
+    Display* ,
+    XHostAddress*
+
+);
+
+extern int XRemoveHosts(
+
+    Display* ,
+    XHostAddress* ,
+    int
+
+);
+
+extern int XReparentWindow(
+
+    Display* ,
+    Window ,
+    Window ,
+    int ,
+    int
+
+);
+
+extern int XResetScreenSaver(
+
+    Display*
+
+);
+
+extern int XResizeWindow(
+
+    Display* ,
+    Window ,
+    unsigned int ,
+    unsigned int
+
+);
+
+extern int XRestackWindows(
+
+    Display* ,
+    Window* ,
+    int
+
+);
+
+extern int XRotateBuffers(
+
+    Display* ,
+    int
+
+);
+
+extern int XRotateWindowProperties(
+
+    Display* ,
+    Window ,
+    Atom* ,
+    int ,
+    int
+
+);
+
+extern int XScreenCount(
+
+    Display*
+
+);
+
+extern int XSelectInput(
+
+    Display* ,
+    Window ,
+    long
+
+);
+
+extern int XSendEvent(
+
+    Display* ,
+    Window ,
+    int ,
+    long ,
+    XEvent*
+
+);
+
+extern int XSetAccessControl(
+
+    Display* ,
+    int
+
+);
+
+extern int XSetArcMode(
+
+    Display* ,
+    GC ,
+    int
+
+);
+
+extern int XSetBackground(
+
+    Display* ,
+    GC ,
+    unsigned long
+
+);
+
+extern int XSetClipMask(
+
+    Display* ,
+    GC ,
+    Pixmap
+
+);
+
+extern int XSetClipOrigin(
+
+    Display* ,
+    GC ,
+    int ,
+    int
+
+);
+
+extern int XSetClipRectangles(
+
+    Display* ,
+    GC ,
+    int ,
+    int ,
+    XRectangle* ,
+    int ,
+    int
+
+);
+
+extern int XSetCloseDownMode(
+
+    Display* ,
+    int
+
+);
+
+extern int XSetCommand(
+
+    Display* ,
+    Window ,
+    char** ,
+    int
+
+);
+
+extern int XSetDashes(
+
+    Display* ,
+    GC ,
+    int ,
+    const char* ,
+    int
+
+);
+
+extern int XSetFillRule(
+
+    Display* ,
+    GC ,
+    int
+
+);
+
+extern int XSetFillStyle(
+
+    Display* ,
+    GC ,
+    int
+
+);
+
+extern int XSetFont(
+
+    Display* ,
+    GC ,
+    Font
+
+);
+
+extern int XSetFontPath(
+
+    Display* ,
+    char** ,
+    int
+
+);
+
+extern int XSetForeground(
+
+    Display* ,
+    GC ,
+    unsigned long
+
+);
+
+extern int XSetFunction(
+
+    Display* ,
+    GC ,
+    int
+
+);
+
+extern int XSetGraphicsExposures(
+
+    Display* ,
+    GC ,
+    int
+
+);
+
+extern int XSetIconName(
+
+    Display* ,
+    Window ,
+    const char*
+
+);
+
+extern int XSetInputFocus(
+
+    Display* ,
+    Window ,
+    int ,
+    Time
+
+);
+
+extern int XSetLineAttributes(
+
+    Display* ,
+    GC ,
+    unsigned int ,
+    int ,
+    int ,
+    int
+
+);
+
+extern int XSetModifierMapping(
+
+    Display* ,
+    XModifierKeymap*
+
+);
+
+extern int XSetPlaneMask(
+
+    Display* ,
+    GC ,
+    unsigned long
+
+);
+
+extern int XSetPointerMapping(
+
+    Display* ,
+    const unsigned char* ,
+    int
+
+);
+
+extern int XSetScreenSaver(
+
+    Display* ,
+    int ,
+    int ,
+    int ,
+    int
+
+);
+
+extern int XSetSelectionOwner(
+
+    Display* ,
+    Atom ,
+    Window ,
+    Time
+
+);
+
+extern int XSetState(
+
+    Display* ,
+    GC ,
+    unsigned long ,
+    unsigned long ,
+    int ,
+    unsigned long
+
+);
+
+extern int XSetStipple(
+
+    Display* ,
+    GC ,
+    Pixmap
+
+);
+
+extern int XSetSubwindowMode(
+
+    Display* ,
+    GC ,
+    int
+
+);
+
+extern int XSetTSOrigin(
+
+    Display* ,
+    GC ,
+    int ,
+    int
+
+);
+
+extern int XSetTile(
+
+    Display* ,
+    GC ,
+    Pixmap
+
+);
+
+extern int XSetWindowBackground(
+
+    Display* ,
+    Window ,
+    unsigned long
+
+);
+
+extern int XSetWindowBackgroundPixmap(
+
+    Display* ,
+    Window ,
+    Pixmap
+
+);
+
+extern int XSetWindowBorder(
+
+    Display* ,
+    Window ,
+    unsigned long
+
+);
+
+extern int XSetWindowBorderPixmap(
+
+    Display* ,
+    Window ,
+    Pixmap
+
+);
+
+extern int XSetWindowBorderWidth(
+
+    Display* ,
+    Window ,
+    unsigned int
+
+);
+
+extern int XSetWindowColormap(
+
+    Display* ,
+    Window ,
+    Colormap
+
+);
+
+extern int XStoreBuffer(
+
+    Display* ,
+    const char* ,
+    int ,
+    int
+
+);
+
+extern int XStoreBytes(
+
+    Display* ,
+    const char* ,
+    int
+
+);
+
+extern int XStoreColor(
+
+    Display* ,
+    Colormap ,
+    XColor*
+
+);
+
+extern int XStoreColors(
+
+    Display* ,
+    Colormap ,
+    XColor* ,
+    int
+
+);
+
+extern int XStoreName(
+
+    Display* ,
+    Window ,
+    const char*
+
+);
+
+extern int XStoreNamedColor(
+
+    Display* ,
+    Colormap ,
+    const char* ,
+    unsigned long ,
+    int
+
+);
+
+extern int XSync(
+
+    Display* ,
+    int
+
+);
+
+extern int XTextExtents(
+
+    XFontStruct* ,
+    const char* ,
+    int ,
+    int* ,
+    int* ,
+    int* ,
+    XCharStruct*
+
+);
+
+extern int XTextExtents16(
+
+    XFontStruct* ,
+    const XChar2b* ,
+    int ,
+    int* ,
+    int* ,
+    int* ,
+    XCharStruct*
+
+);
+
+extern int XTextWidth(
+
+    XFontStruct* ,
+    const char* ,
+    int
+
+);
+
+extern int XTextWidth16(
+
+    XFontStruct* ,
+    const XChar2b* ,
+    int
+
+);
+
+extern int XTranslateCoordinates(
+
+    Display* ,
+    Window ,
+    Window ,
+    int ,
+    int ,
+    int* ,
+    int* ,
+    Window*
+
+);
+
+extern int XUndefineCursor(
+
+    Display* ,
+    Window
+
+);
+
+extern int XUngrabButton(
+
+    Display* ,
+    unsigned int ,
+    unsigned int ,
+    Window
+
+);
+
+extern int XUngrabKey(
+
+    Display* ,
+    int ,
+    unsigned int ,
+    Window
+
+);
+
+extern int XUngrabKeyboard(
+
+    Display* ,
+    Time
+
+);
+
+extern int XUngrabPointer(
+
+    Display* ,
+    Time
+
+);
+
+extern int XUngrabServer(
+
+    Display*
+
+);
+
+extern int XUninstallColormap(
+
+    Display* ,
+    Colormap
+
+);
+
+extern int XUnloadFont(
+
+    Display* ,
+    Font
+
+);
+
+extern int XUnmapSubwindows(
+
+    Display* ,
+    Window
+
+);
+
+extern int XUnmapWindow(
+
+    Display* ,
+    Window
+
+);
+
+extern int XVendorRelease(
+
+    Display*
+
+);
+
+extern int XWarpPointer(
+
+    Display* ,
+    Window ,
+    Window ,
+    int ,
+    int ,
+    unsigned int ,
+    unsigned int ,
+    int ,
+    int
+
+);
+
+extern int XWidthMMOfScreen(
+
+    Screen*
+
+);
+
+extern int XWidthOfScreen(
+
+    Screen*
+
+);
+
+extern int XWindowEvent(
+
+    Display* ,
+    Window ,
+    long ,
+    XEvent*
+
+);
+
+extern int XWriteBitmapFile(
+
+    Display* ,
+    const char* ,
+    Pixmap ,
+    unsigned int ,
+    unsigned int ,
+    int ,
+    int
+
+);
+
+extern int XSupportsLocale (void);
+
+extern char *XSetLocaleModifiers(
+    const char*
+);
+
+extern XOM XOpenOM(
+
+    Display* ,
+    struct _XrmHashBucketRec* ,
+    const char* ,
+    const char*
+
+);
+
+extern int XCloseOM(
+
+    XOM
+
+);
+
+extern char *XSetOMValues(
+
+    XOM ,
+    ...
+
+);
+
+extern char *XGetOMValues(
+
+    XOM ,
+    ...
+
+);
+
+extern Display *XDisplayOfOM(
+
+    XOM
+
+);
+
+extern char *XLocaleOfOM(
+
+    XOM
+
+);
+
+extern XOC XCreateOC(
+
+    XOM ,
+    ...
+
+);
+
+extern void XDestroyOC(
+
+    XOC
+
+);
+
+extern XOM XOMOfOC(
+
+    XOC
+
+);
+
+extern char *XSetOCValues(
+
+    XOC ,
+    ...
+
+);
+
+extern char *XGetOCValues(
+
+    XOC ,
+    ...
+
+);
+
+extern XFontSet XCreateFontSet(
+
+    Display* ,
+    const char* ,
+    char*** ,
+    int* ,
+    char**
+
+);
+
+extern void XFreeFontSet(
+
+    Display* ,
+    XFontSet
+
+);
+
+extern int XFontsOfFontSet(
+
+    XFontSet ,
+    XFontStruct*** ,
+    char***
+
+);
+
+extern char *XBaseFontNameListOfFontSet(
+
+    XFontSet
+
+);
+
+extern char *XLocaleOfFontSet(
+
+    XFontSet
+
+);
+
+extern int XContextDependentDrawing(
+
+    XFontSet
+
+);
+
+extern int XDirectionalDependentDrawing(
+
+    XFontSet
+
+);
+
+extern int XContextualDrawing(
+
+    XFontSet
+
+);
+
+extern XFontSetExtents *XExtentsOfFontSet(
+
+    XFontSet
+
+);
+
+extern int XmbTextEscapement(
+
+    XFontSet ,
+    const char* ,
+    int
+
+);
+
+extern int XwcTextEscapement(
+
+    XFontSet ,
+    const wchar_t* ,
+    int
+
+);
+
+extern int Xutf8TextEscapement(
+
+    XFontSet ,
+    const char* ,
+    int
+
+);
+
+extern int XmbTextExtents(
+
+    XFontSet ,
+    const char* ,
+    int ,
+    XRectangle* ,
+    XRectangle*
+
+);
+
+extern int XwcTextExtents(
+
+    XFontSet ,
+    const wchar_t* ,
+    int ,
+    XRectangle* ,
+    XRectangle*
+
+);
+
+extern int Xutf8TextExtents(
+
+    XFontSet ,
+    const char* ,
+    int ,
+    XRectangle* ,
+    XRectangle*
+
+);
+
+extern int XmbTextPerCharExtents(
+
+    XFontSet ,
+    const char* ,
+    int ,
+    XRectangle* ,
+    XRectangle* ,
+    int ,
+    int* ,
+    XRectangle* ,
+    XRectangle*
+
+);
+
+extern int XwcTextPerCharExtents(
+
+    XFontSet ,
+    const wchar_t* ,
+    int ,
+    XRectangle* ,
+    XRectangle* ,
+    int ,
+    int* ,
+    XRectangle* ,
+    XRectangle*
+
+);
+
+extern int Xutf8TextPerCharExtents(
+
+    XFontSet ,
+    const char* ,
+    int ,
+    XRectangle* ,
+    XRectangle* ,
+    int ,
+    int* ,
+    XRectangle* ,
+    XRectangle*
+
+);
+
+extern void XmbDrawText(
+
+    Display* ,
+    Drawable ,
+    GC ,
+    int ,
+    int ,
+    XmbTextItem* ,
+    int
+
+);
+
+extern void XwcDrawText(
+
+    Display* ,
+    Drawable ,
+    GC ,
+    int ,
+    int ,
+    XwcTextItem* ,
+    int
+
+);
+
+extern void Xutf8DrawText(
+
+    Display* ,
+    Drawable ,
+    GC ,
+    int ,
+    int ,
+    XmbTextItem* ,
+    int
+
+);
+
+extern void XmbDrawString(
+
+    Display* ,
+    Drawable ,
+    XFontSet ,
+    GC ,
+    int ,
+    int ,
+    const char* ,
+    int
+
+);
+
+extern void XwcDrawString(
+
+    Display* ,
+    Drawable ,
+    XFontSet ,
+    GC ,
+    int ,
+    int ,
+    const wchar_t* ,
+    int
+
+);
+
+extern void Xutf8DrawString(
+
+    Display* ,
+    Drawable ,
+    XFontSet ,
+    GC ,
+    int ,
+    int ,
+    const char* ,
+    int
+
+);
+
+extern void XmbDrawImageString(
+
+    Display* ,
+    Drawable ,
+    XFontSet ,
+    GC ,
+    int ,
+    int ,
+    const char* ,
+    int
+
+);
+
+extern void XwcDrawImageString(
+
+    Display* ,
+    Drawable ,
+    XFontSet ,
+    GC ,
+    int ,
+    int ,
+    const wchar_t* ,
+    int
+
+);
+
+extern void Xutf8DrawImageString(
+
+    Display* ,
+    Drawable ,
+    XFontSet ,
+    GC ,
+    int ,
+    int ,
+    const char* ,
+    int
+
+);
+
+extern XIM XOpenIM(
+
+    Display* ,
+    struct _XrmHashBucketRec* ,
+    char* ,
+    char*
+
+);
+
+extern int XCloseIM(
+
+    XIM
+
+);
+
+extern char *XGetIMValues(
+
+    XIM , ...
+
+);
+
+extern char *XSetIMValues(
+
+    XIM , ...
+
+);
+
+extern Display *XDisplayOfIM(
+
+    XIM
+
+);
+
+extern char *XLocaleOfIM(
+
+    XIM
+
+);
+
+extern XIC XCreateIC(
+
+    XIM , ...
+
+);
+
+extern void XDestroyIC(
+
+    XIC
+
+);
+
+extern void XSetICFocus(
+
+    XIC
+
+);
+
+extern void XUnsetICFocus(
+
+    XIC
+
+);
+
+extern wchar_t *XwcResetIC(
+
+    XIC
+
+);
+
+extern char *XmbResetIC(
+
+    XIC
+
+);
+
+extern char *Xutf8ResetIC(
+
+    XIC
+
+);
+
+extern char *XSetICValues(
+
+    XIC , ...
+
+);
+
+extern char *XGetICValues(
+
+    XIC , ...
+
+);
+
+extern XIM XIMOfIC(
+
+    XIC
+
+);
+
+extern int XFilterEvent(
+
+    XEvent* ,
+    Window
+
+);
+
+extern int XmbLookupString(
+
+    XIC ,
+    XKeyPressedEvent* ,
+    char* ,
+    int ,
+    KeySym* ,
+    int*
+
+);
+
+extern int XwcLookupString(
+
+    XIC ,
+    XKeyPressedEvent* ,
+    wchar_t* ,
+    int ,
+    KeySym* ,
+    int*
+
+);
+
+extern int Xutf8LookupString(
+
+    XIC ,
+    XKeyPressedEvent* ,
+    char* ,
+    int ,
+    KeySym* ,
+    int*
+
+);
+
+extern XVaNestedList XVaCreateNestedList(
+
+    int , ...
+
+);
+
+
+
+extern int XRegisterIMInstantiateCallback(
+
+    Display* ,
+    struct _XrmHashBucketRec* ,
+    char* ,
+    char* ,
+    XIDProc ,
+    XPointer
+
+);
+
+extern int XUnregisterIMInstantiateCallback(
+
+    Display* ,
+    struct _XrmHashBucketRec* ,
+    char* ,
+    char* ,
+    XIDProc ,
+    XPointer
+
+);
+
+typedef void (*XConnectionWatchProc)(
+
+    Display* ,
+    XPointer ,
+    int ,
+    int ,
+    XPointer*
+
+);
+
+
+extern int XInternalConnectionNumbers(
+
+    Display* ,
+    int** ,
+    int*
+
+);
+
+extern void XProcessInternalConnection(
+
+    Display* ,
+    int
+
+);
+
+extern int XAddConnectionWatch(
+
+    Display* ,
+    XConnectionWatchProc ,
+    XPointer
+
+);
+
+extern void XRemoveConnectionWatch(
+
+    Display* ,
+    XConnectionWatchProc ,
+    XPointer
+
+);
+
+extern void XSetAuthorization(
+
+    char * ,
+    int ,
+    char * ,
+    int
+
+);
+
+extern int _Xmbtowc(
+
+    wchar_t * ,
+
+
+
+
+    char * ,
+    int
+
+
+);
+
+extern int _Xwctomb(
+
+    char * ,
+    wchar_t
+
+);
+
+}
+
+
+
+
+
+typedef struct {
+        long flags;
+        int x, y;
+        int width, height;
+        int min_width, min_height;
+        int max_width, max_height;
+        int width_inc, height_inc;
+        struct {
+                int x;
+                int y;
+        } min_aspect, max_aspect;
+        int base_width, base_height;
+        int win_gravity;
+} XSizeHints;
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef struct {
+        long flags;
+        int input;
+
+        int initial_state;
+        Pixmap icon_pixmap;
+        Window icon_window;
+        int icon_x, icon_y;
+        Pixmap icon_mask;
+        XID window_group;
+
+} XWMHints;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef struct {
+    unsigned char *value;
+    Atom encoding;
+    int format;
+    unsigned long nitems;
+} XTextProperty;
+
+
+typedef enum {
+    XStringStyle,
+    XCompoundTextStyle,
+    XTextStyle,
+    XStdICCTextStyle,
+
+    XUTF8StringStyle
+} XICCEncodingStyle;
+
+typedef struct {
+        int min_width, min_height;
+        int max_width, max_height;
+        int width_inc, height_inc;
+} XIconSize;
+
+typedef struct {
+        char *res_name;
+        char *res_class;
+} XClassHint;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef struct _XComposeStatus {
+    XPointer compose_ptr;
+    int chars_matched;
+} XComposeStatus;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef struct _XRegion *Region;
+
+
+
+
+
+
+
+
+
+
+typedef struct {
+  Visual *visual;
+  VisualID visualid;
+  int screen;
+  int depth;
+
+  int c_class;
+
+
+
+  unsigned long red_mask;
+  unsigned long green_mask;
+  unsigned long blue_mask;
+  int colormap_size;
+  int bits_per_rgb;
+} XVisualInfo;
+
+
+
+
+
+
+typedef struct {
+        Colormap colormap;
+        unsigned long red_max;
+        unsigned long red_mult;
+        unsigned long green_max;
+        unsigned long green_mult;
+        unsigned long blue_max;
+        unsigned long blue_mult;
+        unsigned long base_pixel;
+        VisualID visualid;
+        XID killid;
+} XStandardColormap;
+
+
+
+
+
+
+
+typedef int XContext;
+
+
+extern "C" {
+
+
+
+extern XClassHint *XAllocClassHint (
+
+    void
+
+);
+
+extern XIconSize *XAllocIconSize (
+
+    void
+
+);
+
+extern XSizeHints *XAllocSizeHints (
+
+    void
+
+);
+
+extern XStandardColormap *XAllocStandardColormap (
+
+    void
+
+);
+
+extern XWMHints *XAllocWMHints (
+
+    void
+
+);
+
+extern int XClipBox(
+
+    Region ,
+    XRectangle*
+
+);
+
+extern Region XCreateRegion(
+
+    void
+
+);
+
+extern const char *XDefaultString (void);
+
+extern int XDeleteContext(
+
+    Display* ,
+    XID ,
+    XContext
+
+);
+
+extern int XDestroyRegion(
+
+    Region
+
+);
+
+extern int XEmptyRegion(
+
+    Region
+
+);
+
+extern int XEqualRegion(
+
+    Region ,
+    Region
+
+);
+
+extern int XFindContext(
+
+    Display* ,
+    XID ,
+    XContext ,
+    XPointer*
+
+);
+
+extern int XGetClassHint(
+
+    Display* ,
+    Window ,
+    XClassHint*
+
+);
+
+extern int XGetIconSizes(
+
+    Display* ,
+    Window ,
+    XIconSize** ,
+    int*
+
+);
+
+extern int XGetNormalHints(
+
+    Display* ,
+    Window ,
+    XSizeHints*
+
+);
+
+extern int XGetRGBColormaps(
+
+    Display* ,
+    Window ,
+    XStandardColormap** ,
+    int* ,
+    Atom
+
+);
+
+extern int XGetSizeHints(
+
+    Display* ,
+    Window ,
+    XSizeHints* ,
+    Atom
+
+);
+
+extern int XGetStandardColormap(
+
+    Display* ,
+    Window ,
+    XStandardColormap* ,
+    Atom
+
+);
+
+extern int XGetTextProperty(
+
+    Display* ,
+    Window ,
+    XTextProperty* ,
+    Atom
+
+);
+
+extern XVisualInfo *XGetVisualInfo(
+
+    Display* ,
+    long ,
+    XVisualInfo* ,
+    int*
+
+);
+
+extern int XGetWMClientMachine(
+
+    Display* ,
+    Window ,
+    XTextProperty*
+
+);
+
+extern XWMHints *XGetWMHints(
+
+    Display* ,
+    Window
+
+);
+
+extern int XGetWMIconName(
+
+    Display* ,
+    Window ,
+    XTextProperty*
+
+);
+
+extern int XGetWMName(
+
+    Display* ,
+    Window ,
+    XTextProperty*
+
+);
+
+extern int XGetWMNormalHints(
+
+    Display* ,
+    Window ,
+    XSizeHints* ,
+    long*
+
+);
+
+extern int XGetWMSizeHints(
+
+    Display* ,
+    Window ,
+    XSizeHints* ,
+    long* ,
+    Atom
+
+);
+
+extern int XGetZoomHints(
+
+    Display* ,
+    Window ,
+    XSizeHints*
+
+);
+
+extern int XIntersectRegion(
+
+    Region ,
+    Region ,
+    Region
+
+);
+
+extern void XConvertCase(
+
+    KeySym ,
+    KeySym* ,
+    KeySym*
+
+);
+
+extern int XLookupString(
+
+    XKeyEvent* ,
+    char* ,
+    int ,
+    KeySym* ,
+    XComposeStatus*
+
+);
+
+extern int XMatchVisualInfo(
+
+    Display* ,
+    int ,
+    int ,
+    int ,
+    XVisualInfo*
+
+);
+
+extern int XOffsetRegion(
+
+    Region ,
+    int ,
+    int
+
+);
+
+extern int XPointInRegion(
+
+    Region ,
+    int ,
+    int
+
+);
+
+extern Region XPolygonRegion(
+
+    XPoint* ,
+    int ,
+    int
+
+);
+
+extern int XRectInRegion(
+
+    Region ,
+    int ,
+    int ,
+    unsigned int ,
+    unsigned int
+
+);
+
+extern int XSaveContext(
+
+    Display* ,
+    XID ,
+    XContext ,
+    const char*
+
+);
+
+extern int XSetClassHint(
+
+    Display* ,
+    Window ,
+    XClassHint*
+
+);
+
+extern int XSetIconSizes(
+
+    Display* ,
+    Window ,
+    XIconSize* ,
+    int
+
+);
+
+extern int XSetNormalHints(
+
+    Display* ,
+    Window ,
+    XSizeHints*
+
+);
+
+extern void XSetRGBColormaps(
+
+    Display* ,
+    Window ,
+    XStandardColormap* ,
+    int ,
+    Atom
+
+);
+
+extern int XSetSizeHints(
+
+    Display* ,
+    Window ,
+    XSizeHints* ,
+    Atom
+
+);
+
+extern int XSetStandardProperties(
+
+    Display* ,
+    Window ,
+    const char* ,
+    const char* ,
+    Pixmap ,
+    char** ,
+    int ,
+    XSizeHints*
+
+);
+
+extern void XSetTextProperty(
+
+    Display* ,
+    Window ,
+    XTextProperty* ,
+    Atom
+
+);
+
+extern void XSetWMClientMachine(
+
+    Display* ,
+    Window ,
+    XTextProperty*
+
+);
+
+extern int XSetWMHints(
+
+    Display* ,
+    Window ,
+    XWMHints*
+
+);
+
+extern void XSetWMIconName(
+
+    Display* ,
+    Window ,
+    XTextProperty*
+
+);
+
+extern void XSetWMName(
+
+    Display* ,
+    Window ,
+    XTextProperty*
+
+);
+
+extern void XSetWMNormalHints(
+
+    Display* ,
+    Window ,
+    XSizeHints*
+
+);
+
+extern void XSetWMProperties(
+
+    Display* ,
+    Window ,
+    XTextProperty* ,
+    XTextProperty* ,
+    char** ,
+    int ,
+    XSizeHints* ,
+    XWMHints* ,
+    XClassHint*
+
+);
+
+extern void XmbSetWMProperties(
+
+    Display* ,
+    Window ,
+    const char* ,
+    const char* ,
+    char** ,
+    int ,
+    XSizeHints* ,
+    XWMHints* ,
+    XClassHint*
+
+);
+
+extern void Xutf8SetWMProperties(
+
+    Display* ,
+    Window ,
+    const char* ,
+    const char* ,
+    char** ,
+    int ,
+    XSizeHints* ,
+    XWMHints* ,
+    XClassHint*
+
+);
+
+extern void XSetWMSizeHints(
+
+    Display* ,
+    Window ,
+    XSizeHints* ,
+    Atom
+
+);
+
+extern int XSetRegion(
+
+    Display* ,
+    GC ,
+    Region
+
+);
+
+extern void XSetStandardColormap(
+
+    Display* ,
+    Window ,
+    XStandardColormap* ,
+    Atom
+
+);
+
+extern int XSetZoomHints(
+
+    Display* ,
+    Window ,
+    XSizeHints*
+
+);
+
+extern int XShrinkRegion(
+
+    Region ,
+    int ,
+    int
+
+);
+
+extern int XStringListToTextProperty(
+
+    char** ,
+    int ,
+    XTextProperty*
+
+);
+
+extern int XSubtractRegion(
+
+    Region ,
+    Region ,
+    Region
+
+);
+
+extern int XmbTextListToTextProperty(
+    Display* display,
+    char** list,
+    int count,
+    XICCEncodingStyle style,
+    XTextProperty* text_prop_return
+);
+
+extern int XwcTextListToTextProperty(
+    Display* display,
+    wchar_t** list,
+    int count,
+    XICCEncodingStyle style,
+    XTextProperty* text_prop_return
+);
+
+extern int Xutf8TextListToTextProperty(
+    Display* display,
+    char** list,
+    int count,
+    XICCEncodingStyle style,
+    XTextProperty* text_prop_return
+);
+
+extern void XwcFreeStringList(
+    wchar_t** list
+);
+
+extern int XTextPropertyToStringList(
+
+    XTextProperty* ,
+    char*** ,
+    int*
+
+);
+
+extern int XmbTextPropertyToTextList(
+    Display* display,
+    const XTextProperty* text_prop,
+    char*** list_return,
+    int* count_return
+);
+
+extern int XwcTextPropertyToTextList(
+    Display* display,
+    const XTextProperty* text_prop,
+    wchar_t*** list_return,
+    int* count_return
+);
+
+extern int Xutf8TextPropertyToTextList(
+    Display* display,
+    const XTextProperty* text_prop,
+    char*** list_return,
+    int* count_return
+);
+
+extern int XUnionRectWithRegion(
+
+    XRectangle* ,
+    Region ,
+    Region
+
+);
+
+extern int XUnionRegion(
+
+    Region ,
+    Region ,
+    Region
+
+);
+
+extern int XWMGeometry(
+
+    Display* ,
+    int ,
+    const char* ,
+    const char* ,
+    unsigned int ,
+    XSizeHints* ,
+    int* ,
+    int* ,
+    int* ,
+    int* ,
+    int*
+
+);
+
+extern int XXorRegion(
+
+    Region ,
+    Region ,
+    Region
+
+);
+
+}
+
+
+
+
+
+
+
+
+
+
+
+
+struct NETRootInfoPrivate;
+struct NETWinInfoPrivate;
+class NETRootInfo : public NET {
+public:
+
+
+
+
+    enum { PROTOCOLS, WINDOW_TYPES, STATES, PROTOCOLS2, ACTIONS,
+        PROPERTIES_SIZE };
+    NETRootInfo(Display *display, Window supportWindow, const char *wmName,
+                const unsigned long properties[], int properties_size,
+                int screen = -1, bool doActivate = true);
+
+
+
+
+
+
+
+    NETRootInfo(Display *display, Window supportWindow, const char *wmName,
+                unsigned long properties, int screen = -1, bool doActivate = true) ;
+    NETRootInfo(Display *display, const unsigned long properties[], int properties_size,
+                int screen = -1, bool doActivate = true);
+
+
+
+
+
+
+
+    NETRootInfo(Display *display, unsigned long properties, int screen = -1,
+                bool doActivate = true) ;
+
+
+
+
+
+
+    NETRootInfo(const NETRootInfo &rootinfo);
+
+
+
+
+    virtual ~NETRootInfo();
+
+
+
+
+
+
+    Display *x11Display() const;
+
+
+
+
+
+
+    Window rootWindow() const;
+
+
+
+
+
+
+    Window supportWindow() const;
+
+
+
+
+
+
+    const char *wmName() const;
+
+
+
+
+
+
+    int screenNumber() const;
+
+
+
+
+
+
+
+    bool isSupported( NET::Property property ) const;
+
+
+
+
+    bool isSupported( NET::Property2 property ) const;
+
+
+
+
+    bool isSupported( NET::WindowType type ) const;
+
+
+
+
+    bool isSupported( NET::State state ) const;
+
+
+
+
+
+    bool isSupported( NET::Action action ) const;
+    const unsigned long* supportedProperties() const;
+    const unsigned long* passedProperties() const;
+    unsigned long supported() const ;
+    const Window *clientList() const;
+    int clientListCount() const;
+    const Window *clientListStacking() const;
+    int clientListStackingCount() const;
+    const Window *kdeSystemTrayWindows() const;
+    int kdeSystemTrayWindowsCount() const;
+    NETSize desktopGeometry(int desktop) const;
+    NETPoint desktopViewport(int desktop) const;
+    NETRect workArea(int desktop) const;
+    const char *desktopName(int desktop) const;
+    const Window *virtualRoots( ) const;
+    int virtualRootsCount() const;
+
+
+
+
+
+
+    int numberOfDesktops() const;
+
+
+
+
+
+
+    int currentDesktop() const;
+
+
+
+
+
+
+    Window activeWindow() const;
+    void activate();
+    void setClientList(Window *windows, unsigned int count);
+    void setClientListStacking(Window *windows, unsigned int count);
+    void setKDESystemTrayWindows(Window *windows, unsigned int count);
+
+
+
+
+
+
+    void setCurrentDesktop(int desktop);
+    void setDesktopGeometry(int desktop, const NETSize &geometry);
+    void setDesktopViewport(int desktop, const NETPoint &viewport);
+
+
+
+
+
+
+    void setNumberOfDesktops(int numberOfDesktops);
+    void setDesktopName(int desktop, const char *desktopName);
+    void setActiveWindow(Window window, NET::RequestSource src,
+        Time timestamp );
+
+
+
+
+
+
+
+    void setActiveWindow(Window window);
+    void setWorkArea(int desktop, const NETRect &workArea);
+    void setVirtualRoots(Window *windows, unsigned int count);
+
+
+
+
+
+    const NETRootInfo &operator=(const NETRootInfo &rootinfo);
+    void closeWindowRequest(Window window);
+    void moveResizeRequest(Window window, int x_root, int y_root,
+                           Direction direction);
+    void event( XEvent* event, unsigned long* properties, int properties_size );
+    unsigned long event(XEvent *event) ;
+
+
+protected:
+
+
+
+
+
+
+
+    virtual void addClient(Window) { }
+    virtual void removeClient(Window) { }
+    virtual void addSystemTrayWin(Window) { }
+    virtual void removeSystemTrayWin(Window) { }
+    virtual void changeNumberOfDesktops(int) { }
+    virtual void changeDesktopGeometry(int, const NETSize &) { }
+    virtual void changeDesktopViewport(int, const NETPoint &) { }
+    virtual void changeCurrentDesktop(int) { }
+    virtual  void changeActiveWindow(Window) { }
+    virtual void closeWindow(Window) { }
+    virtual void moveResize(Window, int, int, unsigned long) { }
+
+
+private:
+    void update( const unsigned long[] );
+    void setSupported();
+    void setDefaultProperties();
+    void updateSupportedProperties( Atom atom );
+    Role role;
+
+protected:
+    virtual void virtual_hook( int id, void* data );
+private:
+    NETRootInfoPrivate *p;
+    friend class NETRootInfo2;
+};
+
+class NETRootInfo2
+    : public NETRootInfo
+{
+public:
+    NETRootInfo2(Display *display, Window supportWindow, const char *wmName,
+                unsigned long properties[], int properties_size,
+                int screen = -1, bool doActivate = true);
+    void sendPing( Window window, Time timestamp );
+protected:
+    friend class NETRootInfo;
+    virtual void gotPing( Window, Time ) {};
+    virtual void changeActiveWindow(Window,NET::RequestSource,Time) { }
+
+
+};
+class NETWinInfo : public NET {
+public:
+
+
+
+
+    enum { PROTOCOLS, PROTOCOLS2,
+        PROPERTIES_SIZE };
+    NETWinInfo(Display *display, Window window, Window rootWindow,
+               const unsigned long properties[], int properties_size,
+               Role role = Client);
+
+
+
+
+
+
+
+    NETWinInfo(Display *display, Window window,
+               Window rootWindow, unsigned long properties,
+               Role role = Client);
+
+
+
+
+
+
+    NETWinInfo(const NETWinInfo & wininfo);
+
+
+
+
+    virtual ~NETWinInfo();
+
+
+
+
+
+    const NETWinInfo &operator=(const NETWinInfo &wintinfo);
+    const unsigned long* passedProperties() const;
+    unsigned long properties() const ;
+
+
+
+
+
+
+    NETRect iconGeometry() const;
+
+
+
+
+
+
+
+    unsigned long state() const;
+
+
+
+
+
+
+    NETStrut strut() const;
+    WindowType windowType( unsigned long supported_types ) const;
+    WindowType windowType() const ;
+
+
+
+
+
+
+    const char *name() const;
+
+
+
+
+
+
+    const char *visibleName() const;
+    const char *iconName() const;
+    const char *visibleIconName() const;
+    int desktop() const;
+
+
+
+
+
+
+    int pid() const;
+
+
+
+
+
+
+    int handledIcons() const;
+
+
+
+
+
+
+
+    Window kdeSystemTrayWinFor() const;
+
+
+
+
+
+
+
+    MappingState mappingState() const;
+    void setIcon(NETIcon icon, int replace = 1);
+
+
+
+
+
+
+    void setIconGeometry(NETRect geometry);
+
+
+
+
+
+
+    void setStrut(NETStrut strut);
+    void setState(unsigned long state, unsigned long mask);
+
+
+
+
+
+
+
+    void setWindowType(WindowType type);
+
+
+
+
+
+
+    void setName(const char *name);
+
+
+
+
+
+
+
+    void setVisibleName(const char *visibleName);
+
+
+
+
+
+
+    void setIconName(const char *name);
+
+
+
+
+
+
+
+    void setVisibleIconName(const char *name);
+    void setDesktop(int desktop);
+
+
+
+
+
+
+    void setPid(int pid);
+
+
+
+
+
+
+    void setHandledIcons(int handled);
+
+
+
+
+
+
+    void setKDESystemTrayWinFor(Window window);
+
+
+
+
+
+
+
+    void setKDEFrameStrut(NETStrut strut);
+    NETIcon icon(int width = -1, int height = -1) const;
+    void setUserTime( Time time );
+
+
+
+
+    Time userTime() const;
+
+
+
+
+    void setStartupId( const char* startup_id );
+
+
+
+
+    const char* startupId() const;
+
+
+
+
+    void setAllowedActions( unsigned long actions );
+
+
+
+
+    unsigned long allowedActions() const;
+
+
+
+
+
+    Window transientFor() const;
+
+
+
+
+    Window groupLeader() const;
+    void kdeGeometry(NETRect &frame, NETRect &window);
+    void event( XEvent* event, unsigned long* properties, int properties_size );
+    unsigned long event(XEvent *event) ;
+
+
+
+
+
+
+
+    static const int OnAllDesktops;
+
+
+protected:
+    virtual void changeDesktop(int) { }
+    virtual void changeState(unsigned long , unsigned long ) { }
+
+private:
+    void update( const unsigned long[] );
+    void updateWMState();
+    Role role;
+
+protected:
+    virtual void virtual_hook( int id, void* data );
+private:
+    NETWinInfoPrivate *p;
+};
+
+
+
+
+
+class QSocketNotifier;
+class KProcessPrivate;
+class KPty;
+class KProcess : public QObject
+{
+  public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+
+public:
+  enum Communication {
+       NoCommunication = 0,
+       Stdin = 1, Stdout = 2, Stderr = 4,
+       AllOutput = 6, All = 7,
+       NoRead
+  };
+
+
+
+
+  enum RunMode {
+
+
+
+
+       DontCare,
+
+
+
+       NotifyOnExit,
+
+
+
+       Block,
+
+
+
+
+       OwnGroup
+  };
+
+
+
+
+
+  KProcess( QObject* parent, const char *name = 0 );
+
+
+
+
+  KProcess();
+  virtual ~KProcess();
+  bool setExecutable(const QString& proc) ;
+  KProcess &operator<<(const QString& arg);
+
+
+
+  KProcess &operator<<(const char * arg);
+
+
+
+
+
+  KProcess &operator<<(const QCString & arg);
+
+
+
+
+
+
+
+  KProcess &operator<<(const QStringList& args);
+
+
+
+
+
+  void clearArguments();
+  virtual bool start(RunMode runmode = NotifyOnExit,
+        Communication comm = NoCommunication);
+
+
+
+
+
+
+
+  virtual bool kill(int signo = 15);
+
+
+
+
+
+  bool isRunning() const;
+  pid_t pid() const;
+
+
+
+
+
+  __attribute__ ((deprecated)) pid_t getPid() const { return pid(); }
+
+
+
+
+  void suspend();
+
+
+
+
+  void resume();
+  bool wait(int timeout = -1);
+
+
+
+
+
+
+
+  bool normalExit() const;
+
+
+
+
+
+
+
+  int exitStatus() const;
+  bool writeStdin(const char *buffer, int buflen);
+
+
+
+
+
+
+
+  bool closeStdin();
+  bool closeStdout();
+  bool closeStderr();
+  bool closePty();
+
+
+
+
+  void closeAll();
+
+
+
+
+
+  const QValueList<QCString> &args() { return arguments; }
+  void setRunPrivileged(bool keepPrivileges);
+
+
+
+
+
+
+  bool runPrivileged() const;
+
+
+
+
+
+
+
+  void setEnvironment(const QString &name, const QString &value);
+
+
+
+
+
+
+
+  void setWorkingDirectory(const QString &dir);
+  void setUseShell(bool useShell, const char *shell = 0);
+  static QString quote(const QString &arg);
+  void detach();
+  void setUsePty(Communication comm, bool addUtmp);
+  KPty *pty() const;
+
+
+
+
+  enum { PrioLowest = 20, PrioLow = 10, PrioLower = 5, PrioNormal = 0,
+    PrioHigher = -5, PrioHigh = -10, PrioHighest = -19 };
+
+
+
+
+
+
+
+  bool setPriority(int prio);
+
+protected:
+
+
+
+
+
+
+  void processExited(KProcess *proc);
+  void receivedStdout(KProcess *proc, char *buffer, int buflen);
+  void receivedStdout(int fd, int &len);
+  void receivedStderr(KProcess *proc, char *buffer, int buflen);
+
+
+
+
+
+
+
+  void wroteStdin(KProcess *proc);
+
+
+protected :
+
+
+
+
+
+
+  void slotChildOutput(int fdno);
+
+
+
+
+
+
+  void slotChildError(int fdno);
+
+
+
+
+
+
+
+  void slotSendData(int dummy);
+
+protected:
+
+
+
+
+
+  void setupEnvironment();
+
+
+
+
+
+  QValueList<QCString> arguments;
+
+
+
+
+  RunMode run_mode;
+
+
+
+
+
+
+  bool runs;
+  pid_t pid_;
+  int status;
+
+
+
+
+
+
+
+  bool keepPrivs;
+  virtual int setupCommunication(Communication comm);
+  virtual int commSetupDoneP();
+
+
+
+
+
+
+  virtual int commSetupDoneC();
+  virtual void processHasExited(int state);
+  virtual void commClose();
+  void setBinaryExecutable(const char *filename);
+
+
+
+
+  int out[2];
+
+
+
+  int in[2];
+
+
+
+  int err[2];
+
+
+
+
+  QSocketNotifier *innot;
+
+
+
+  QSocketNotifier *outnot;
+
+
+
+  QSocketNotifier *errnot;
+
+
+
+
+
+  Communication communication;
+
+
+
+
+
+
+  int childOutput(int fdno);
+
+
+
+
+
+
+  int childError(int fdno);
+
+
+
+
+  const char *input_data;
+
+
+
+  int input_sent;
+
+
+
+  int input_total;
+
+
+
+
+
+  friend class KProcessController;
+
+protected:
+  virtual void virtual_hook( int id, void* data );
+private:
+  KProcessPrivate *d;
+};
+
+class KShellProcessPrivate;
+class KShellProcess: public KProcess
+{
+  public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+
+public:
+
+
+
+
+
+
+  KShellProcess(const char *shellname=0);
+
+
+
+
+  ~KShellProcess();
+
+  virtual bool start(RunMode runmode = NotifyOnExit,
+                  Communication comm = NoCommunication);
+
+  static QString quote(const QString &arg);
+
+private:
+  QCString shell;
+
+protected:
+  virtual void virtual_hook( int id, void* data );
+private:
+  KShellProcessPrivate *d;
+};
+
+class QSocketNotifier;
+class KProcessController : public QObject
+{
+  public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+
+public:
+
+
+
+
+  static void ref();
+
+
+
+
+
+  static void deref();
+
+
+
+
+
+  static KProcessController *theKProcessController;
+  static void theSigCHLDHandler(int signal);
+  bool waitForProcessExit(int timeout);
+
+
+
+
+
+
+  void unscheduleCheck();
+
+
+
+
+
+
+  void rescheduleCheck();
+  int notifierFd() const;
+
+
+
+
+  void addKProcess( KProcess* );
+
+
+
+  void removeKProcess( KProcess* );
+
+
+
+  void addProcess( int pid );
+
+private :
+  void slotDoHousekeeping();
+
+private:
+  friend class I_just_love_gcc;
+
+  int fd[2];
+  bool needcheck;
+  QSocketNotifier *notifier;
+  QValueList<KProcess*> kProcessList;
+  QValueList<int> unixProcessList;
+
+  static void setupHandlers();
+  static void resetHandlers();
+  static struct sigaction oldChildHandlerData;
+  static bool handlerSet;
+
+  static int refCount;
+
+
+  KProcessController();
+  ~KProcessController();
+
+
+  KProcessController( const KProcessController& );
+  KProcessController& operator= ( const KProcessController& );
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef void *IcePointer;
+
+
+
+
+typedef enum {
+    IcePoAuthHaveReply,
+    IcePoAuthRejected,
+    IcePoAuthFailed,
+    IcePoAuthDoneCleanup
+} IcePoAuthStatus;
+
+typedef enum {
+    IcePaAuthContinue,
+    IcePaAuthAccepted,
+    IcePaAuthRejected,
+    IcePaAuthFailed
+} IcePaAuthStatus;
+
+typedef enum {
+    IceConnectPending,
+    IceConnectAccepted,
+    IceConnectRejected,
+    IceConnectIOError
+} IceConnectStatus;
+
+typedef enum {
+    IceProtocolSetupSuccess,
+    IceProtocolSetupFailure,
+    IceProtocolSetupIOError,
+    IceProtocolAlreadyActive
+} IceProtocolSetupStatus;
+
+typedef enum {
+    IceAcceptSuccess,
+    IceAcceptFailure,
+    IceAcceptBadMalloc
+} IceAcceptStatus;
+
+typedef enum {
+    IceClosedNow,
+    IceClosedASAP,
+    IceConnectionInUse,
+    IceStartedShutdownNegotiation
+} IceCloseStatus;
+
+typedef enum {
+    IceProcessMessagesSuccess,
+    IceProcessMessagesIOError,
+    IceProcessMessagesConnectionClosed
+} IceProcessMessagesStatus;
+
+typedef struct {
+    unsigned long sequence_of_request;
+    int major_opcode_of_request;
+    int minor_opcode_of_request;
+    IcePointer reply;
+} IceReplyWaitInfo;
+
+typedef struct _IceConn *IceConn;
+typedef struct _IceListenObj *IceListenObj;
+
+typedef void (*IceWatchProc) (
+
+    IceConn ,
+    IcePointer ,
+    int ,
+    IcePointer *
+
+);
+
+typedef void (*IcePoProcessMsgProc) (
+
+    IceConn ,
+    IcePointer ,
+    int ,
+    unsigned long ,
+    int ,
+    IceReplyWaitInfo * ,
+    int *
+
+);
+
+typedef void (*IcePaProcessMsgProc) (
+
+    IceConn ,
+    IcePointer ,
+    int ,
+    unsigned long ,
+    int
+
+);
+
+typedef struct {
+    int major_version;
+    int minor_version;
+    IcePoProcessMsgProc process_msg_proc;
+} IcePoVersionRec;
+
+typedef struct {
+    int major_version;
+    int minor_version;
+    IcePaProcessMsgProc process_msg_proc;
+} IcePaVersionRec;
+
+typedef IcePoAuthStatus (*IcePoAuthProc) (
+
+    IceConn ,
+    IcePointer * ,
+    int ,
+    int ,
+    int ,
+    IcePointer ,
+    int * ,
+    IcePointer * ,
+    char **
+
+);
+
+typedef IcePaAuthStatus (*IcePaAuthProc) (
+
+    IceConn ,
+    IcePointer * ,
+    int ,
+    int ,
+    IcePointer ,
+    int * ,
+    IcePointer * ,
+    char **
+
+);
+
+typedef int (*IceHostBasedAuthProc) (
+
+    char *
+
+);
+
+typedef int (*IceProtocolSetupProc) (
+
+    IceConn ,
+    int ,
+    int ,
+    char * ,
+    char * ,
+    IcePointer * ,
+    char **
+
+);
+
+typedef void (*IceProtocolActivateProc) (
+
+    IceConn ,
+    IcePointer
+
+);
+
+typedef void (*IceIOErrorProc) (
+
+    IceConn
+
+);
+
+typedef void (*IcePingReplyProc) (
+
+    IceConn ,
+    IcePointer
+
+);
+
+typedef void (*IceErrorHandler) (
+
+    IceConn ,
+    int ,
+    int ,
+    unsigned long ,
+    int ,
+    int ,
+    IcePointer
+
+);
+
+typedef void (*IceIOErrorHandler) (
+
+    IceConn
+
+);
+
+
+
+
+
+
+extern "C" {
+
+extern int IceRegisterForProtocolSetup (
+
+    char * ,
+    char * ,
+    char * ,
+    int ,
+    IcePoVersionRec * ,
+    int ,
+    char ** ,
+    IcePoAuthProc * ,
+    IceIOErrorProc
+
+);
+
+extern int IceRegisterForProtocolReply (
+
+    char * ,
+    char * ,
+    char * ,
+    int ,
+    IcePaVersionRec * ,
+    int ,
+    char ** ,
+    IcePaAuthProc * ,
+    IceHostBasedAuthProc ,
+    IceProtocolSetupProc ,
+    IceProtocolActivateProc ,
+    IceIOErrorProc
+
+);
+
+extern IceConn IceOpenConnection (
+
+    char * ,
+    IcePointer ,
+    int ,
+    int ,
+    int ,
+    char *
+
+);
+
+extern IcePointer IceGetConnectionContext (
+
+    IceConn
+
+);
+
+extern int IceListenForConnections (
+
+    int * ,
+    IceListenObj ** ,
+    int ,
+    char *
+
+);
+
+extern int IceListenForWellKnownConnections (
+
+    char * ,
+    int * ,
+    IceListenObj ** ,
+    int ,
+    char *
+
+);
+
+extern int IceGetListenConnectionNumber (
+
+    IceListenObj
+
+);
+
+extern char *IceGetListenConnectionString (
+
+    IceListenObj
+
+);
+
+extern char *IceComposeNetworkIdList (
+
+    int ,
+    IceListenObj *
+
+);
+
+extern void IceFreeListenObjs (
+
+    int ,
+    IceListenObj *
+
+);
+
+extern void IceSetHostBasedAuthProc (
+
+    IceListenObj ,
+    IceHostBasedAuthProc
+
+);
+
+extern IceConn IceAcceptConnection (
+
+    IceListenObj ,
+    IceAcceptStatus *
+
+);
+
+extern void IceSetShutdownNegotiation (
+
+    IceConn ,
+    int
+
+);
+
+extern int IceCheckShutdownNegotiation (
+
+    IceConn
+
+);
+
+extern IceCloseStatus IceCloseConnection (
+
+    IceConn
+
+);
+
+extern int IceAddConnectionWatch (
+
+    IceWatchProc ,
+    IcePointer
+
+);
+
+extern void IceRemoveConnectionWatch (
+
+    IceWatchProc ,
+    IcePointer
+
+);
+
+extern IceProtocolSetupStatus IceProtocolSetup (
+
+    IceConn ,
+    int ,
+    IcePointer ,
+    int ,
+    int * ,
+    int * ,
+    char ** ,
+    char ** ,
+    int ,
+    char *
+
+);
+
+extern int IceProtocolShutdown (
+
+    IceConn ,
+    int
+
+);
+
+extern IceProcessMessagesStatus IceProcessMessages (
+
+    IceConn ,
+    IceReplyWaitInfo * ,
+    int *
+
+);
+
+extern int IcePing (
+
+   IceConn ,
+   IcePingReplyProc ,
+   IcePointer
+
+);
+
+extern char *IceAllocScratch (
+
+   IceConn ,
+   unsigned long
+
+);
+
+extern int IceFlush (
+
+   IceConn
+
+);
+
+extern int IceGetOutBufSize (
+
+   IceConn
+
+);
+
+extern int IceGetInBufSize (
+
+   IceConn
+
+);
+
+extern IceConnectStatus IceConnectionStatus (
+
+    IceConn
+
+);
+
+extern char *IceVendor (
+
+    IceConn
+
+);
+
+extern char *IceRelease (
+
+    IceConn
+
+);
+
+extern int IceProtocolVersion (
+
+    IceConn
+
+);
+
+extern int IceProtocolRevision (
+
+    IceConn
+
+);
+
+extern int IceConnectionNumber (
+
+    IceConn
+
+);
+
+extern char *IceConnectionString (
+
+    IceConn
+
+);
+
+extern unsigned long IceLastSentSequenceNumber (
+
+    IceConn
+
+);
+
+extern unsigned long IceLastReceivedSequenceNumber (
+
+    IceConn
+
+);
+
+extern int IceSwapping (
+
+    IceConn
+
+);
+
+extern IceErrorHandler IceSetErrorHandler (
+
+    IceErrorHandler
+
+);
+
+extern IceIOErrorHandler IceSetIOErrorHandler (
+
+    IceIOErrorHandler
+
+);
+
+
+
+
+
+
+extern int IceInitThreads (
+
+    void
+
+);
+
+extern void IceAppLockConn (
+
+    IceConn
+
+);
+
+extern void IceAppUnlockConn (
+
+    IceConn
+
+);
+
+}
+
+
+
+
+
+
+typedef IcePointer SmPointer;
+
+
+
+
+
+
+typedef struct _SmcConn *SmcConn;
+typedef struct _SmsConn *SmsConn;
+
+
+
+
+
+
+typedef struct {
+    int length;
+    SmPointer value;
+} SmPropValue;
+
+typedef struct {
+    char *name;
+    char *type;
+    int num_vals;
+    SmPropValue *vals;
+} SmProp;
+
+
+
+
+
+
+
+typedef enum {
+    SmcClosedNow,
+    SmcClosedASAP,
+    SmcConnectionInUse
+} SmcCloseStatus;
+
+
+
+
+
+
+
+typedef void (*SmcSaveYourselfProc) (
+
+    SmcConn ,
+    SmPointer ,
+    int ,
+    int ,
+    int ,
+    int
+
+);
+
+typedef void (*SmcSaveYourselfPhase2Proc) (
+
+    SmcConn ,
+    SmPointer
+
+);
+
+typedef void (*SmcInteractProc) (
+
+    SmcConn ,
+    SmPointer
+
+);
+
+typedef void (*SmcDieProc) (
+
+    SmcConn ,
+    SmPointer
+
+);
+
+typedef void (*SmcShutdownCancelledProc) (
+
+    SmcConn ,
+    SmPointer
+
+);
+
+typedef void (*SmcSaveCompleteProc) (
+
+    SmcConn ,
+    SmPointer
+
+);
+
+typedef void (*SmcPropReplyProc) (
+
+    SmcConn ,
+    SmPointer ,
+    int ,
+    SmProp **
+
+);
+
+
+
+
+
+
+typedef struct {
+
+    struct {
+        SmcSaveYourselfProc callback;
+        SmPointer client_data;
+    } save_yourself;
+
+    struct {
+        SmcDieProc callback;
+        SmPointer client_data;
+    } die;
+
+    struct {
+        SmcSaveCompleteProc callback;
+        SmPointer client_data;
+    } save_complete;
+
+    struct {
+        SmcShutdownCancelledProc callback;
+        SmPointer client_data;
+    } shutdown_cancelled;
+
+} SmcCallbacks;
+
+
+
+
+
+
+
+
+typedef int (*SmsRegisterClientProc) (
+
+    SmsConn ,
+    SmPointer ,
+    char *
+
+);
+
+typedef void (*SmsInteractRequestProc) (
+
+    SmsConn ,
+    SmPointer ,
+    int
+
+);
+
+typedef void (*SmsInteractDoneProc) (
+
+    SmsConn ,
+    SmPointer ,
+    int
+
+);
+
+typedef void (*SmsSaveYourselfRequestProc) (
+
+    SmsConn ,
+    SmPointer ,
+    int ,
+    int ,
+    int ,
+    int ,
+    int
+
+);
+
+typedef void (*SmsSaveYourselfPhase2RequestProc) (
+
+    SmsConn ,
+    SmPointer
+
+);
+
+typedef void (*SmsSaveYourselfDoneProc) (
+
+    SmsConn ,
+    SmPointer ,
+    int
+
+);
+
+typedef void (*SmsCloseConnectionProc) (
+
+    SmsConn ,
+    SmPointer ,
+    int ,
+    char **
+
+);
+
+typedef void (*SmsSetPropertiesProc) (
+
+    SmsConn ,
+    SmPointer ,
+    int ,
+    SmProp **
+
+);
+
+typedef void (*SmsDeletePropertiesProc) (
+
+    SmsConn ,
+    SmPointer ,
+    int ,
+    char **
+
+);
+
+typedef void (*SmsGetPropertiesProc) (
+
+    SmsConn ,
+    SmPointer
+
+);
+
+
+
+
+
+
+typedef struct {
+
+    struct {
+        SmsRegisterClientProc callback;
+        SmPointer manager_data;
+    } register_client;
+
+    struct {
+        SmsInteractRequestProc callback;
+        SmPointer manager_data;
+    } interact_request;
+
+    struct {
+        SmsInteractDoneProc callback;
+        SmPointer manager_data;
+    } interact_done;
+
+    struct {
+        SmsSaveYourselfRequestProc callback;
+        SmPointer manager_data;
+    } save_yourself_request;
+
+    struct {
+        SmsSaveYourselfPhase2RequestProc callback;
+        SmPointer manager_data;
+    } save_yourself_phase2_request;
+
+    struct {
+        SmsSaveYourselfDoneProc callback;
+        SmPointer manager_data;
+    } save_yourself_done;
+
+    struct {
+        SmsCloseConnectionProc callback;
+        SmPointer manager_data;
+    } close_connection;
+
+    struct {
+        SmsSetPropertiesProc callback;
+        SmPointer manager_data;
+    } set_properties;
+
+    struct {
+        SmsDeletePropertiesProc callback;
+        SmPointer manager_data;
+    } delete_properties;
+
+    struct {
+        SmsGetPropertiesProc callback;
+        SmPointer manager_data;
+    } get_properties;
+
+} SmsCallbacks;
+
+
+
+
+
+typedef int (*SmsNewClientProc) (
+
+    SmsConn ,
+    SmPointer ,
+    unsigned long * ,
+    SmsCallbacks * ,
+    char **
+
+);
+
+
+
+
+
+
+
+typedef void (*SmcErrorHandler) (
+
+    SmcConn ,
+    int ,
+    int ,
+    unsigned long ,
+    int ,
+    int ,
+    SmPointer
+
+);
+
+typedef void (*SmsErrorHandler) (
+
+    SmsConn ,
+    int ,
+    int ,
+    unsigned long ,
+    int ,
+    int ,
+    SmPointer
+
+);
+
+
+
+
+
+
+
+extern "C" {
+
+extern SmcConn SmcOpenConnection (
+
+    char * ,
+    SmPointer ,
+    int ,
+    int ,
+    unsigned long ,
+    SmcCallbacks * ,
+    char * ,
+    char ** ,
+    int ,
+    char *
+
+);
+
+extern SmcCloseStatus SmcCloseConnection (
+
+    SmcConn ,
+    int ,
+    char **
+
+);
+
+extern void SmcModifyCallbacks (
+
+    SmcConn ,
+    unsigned long ,
+    SmcCallbacks *
+
+);
+
+extern void SmcSetProperties (
+
+    SmcConn ,
+    int ,
+    SmProp **
+
+);
+
+extern void SmcDeleteProperties (
+
+    SmcConn ,
+    int ,
+    char **
+
+);
+
+extern int SmcGetProperties (
+
+    SmcConn ,
+    SmcPropReplyProc ,
+    SmPointer
+
+);
+
+extern int SmcInteractRequest (
+
+    SmcConn ,
+    int ,
+    SmcInteractProc ,
+    SmPointer
+
+);
+
+extern void SmcInteractDone (
+
+    SmcConn ,
+    int
+
+);
+
+extern void SmcRequestSaveYourself (
+
+    SmcConn ,
+    int ,
+    int ,
+    int ,
+    int ,
+    int
+
+);
+
+extern int SmcRequestSaveYourselfPhase2 (
+
+    SmcConn ,
+    SmcSaveYourselfPhase2Proc ,
+    SmPointer
+
+);
+
+extern void SmcSaveYourselfDone (
+
+    SmcConn ,
+    int
+
+);
+
+extern int SmcProtocolVersion (
+
+    SmcConn
+
+);
+
+extern int SmcProtocolRevision (
+
+    SmcConn
+
+);
+
+extern char *SmcVendor (
+
+    SmcConn
+
+);
+
+extern char *SmcRelease (
+
+    SmcConn
+
+);
+
+extern char *SmcClientID (
+
+    SmcConn
+
+);
+
+extern IceConn SmcGetIceConnection (
+
+    SmcConn
+
+);
+
+extern int SmsInitialize (
+
+    char * ,
+    char * ,
+    SmsNewClientProc ,
+    SmPointer ,
+    IceHostBasedAuthProc ,
+    int ,
+    char *
+
+);
+
+extern char *SmsClientHostName (
+
+    SmsConn
+
+);
+
+extern char *SmsGenerateClientID (
+
+    SmsConn
+
+);
+
+extern int SmsRegisterClientReply (
+
+    SmsConn ,
+    char *
+
+);
+
+extern void SmsSaveYourself (
+
+    SmsConn ,
+    int ,
+    int ,
+    int ,
+    int
+
+);
+
+extern void SmsSaveYourselfPhase2 (
+
+    SmsConn
+
+);
+
+extern void SmsInteract (
+
+    SmsConn
+
+);
+
+extern void SmsDie (
+
+    SmsConn
+
+);
+
+extern void SmsSaveComplete (
+
+    SmsConn
+
+);
+
+extern void SmsShutdownCancelled (
+
+    SmsConn
+
+);
+
+extern void SmsReturnProperties (
+
+    SmsConn ,
+    int ,
+    SmProp **
+
+);
+
+extern void SmsCleanUp (
+
+    SmsConn
+
+);
+
+extern int SmsProtocolVersion (
+
+    SmsConn
+
+);
+
+extern int SmsProtocolRevision (
+
+    SmsConn
+
+);
+
+extern char *SmsClientID (
+
+    SmsConn
+
+);
+
+extern IceConn SmsGetIceConnection (
+
+    SmsConn
+
+);
+
+extern SmcErrorHandler SmcSetErrorHandler (
+
+    SmcErrorHandler
+
+);
+
+extern SmsErrorHandler SmsSetErrorHandler (
+
+    SmsErrorHandler
+
+);
+
+extern void SmFreeProperty (
+
+    SmProp *
+
+);
+
+extern void SmFreeReasons (
+
+    int ,
+    char **
+
+);
+
+}
+namespace X
+{
+
+
+
+
+
+const int XUnsorted = 0;
+const int Unsorted = XUnsorted;
+const XID XNone = 0L;
+const XID None = XNone;
+typedef int XBool;
+typedef XBool Bool;
+const int XKeyPress = 2;
+const int KeyPress = XKeyPress;
+
+
+
+
+
+
+
+const int XKeyRelease = 3;
+const int KeyRelease = XKeyRelease;
+
+
+
+
+
+
+
+const int XAbove = 0;
+const int Above = XAbove;
+
+
+
+
+
+
+
+const int XBelow = 1;
+const int Below = XBelow;
+
+
+
+
+
+
+
+const int XFocusIn = 9;
+const int FocusIn = XFocusIn;
+
+
+
+
+
+
+
+const int XFocusOut = 10;
+const int FocusOut = XFocusOut;
+
+
+
+
+
+
+
+const int XAlways = 2;
+const int Always = XAlways;
+
+
+
+
+
+
+
+const int XSuccess = 0;
+const int Success = XSuccess;
+
+
+
+
+
+
+
+const int XGrayScale = 1;
+const int GrayScale = XGrayScale;
+
+
+
+
+
+
+
+typedef int XStatus;
+typedef XStatus Status;
+}
+
+using namespace X;
+
+
+
+
+
+
+
+
+class KIPC
+{
+public:
+
+
+
+
+    enum Message { PaletteChanged=0, FontChanged, StyleChanged,
+                   BackgroundChanged, SettingsChanged, IconChanged, ToolbarStyleChanged,
+                   ClipboardConfigChanged,
+                   UserMessage=32 };
+    static void sendMessage(Message msg, WId w, int data=0);
+
+
+
+
+
+
+
+    static void sendMessageAll(Message msg, int data=0);
+};
+
+
+
+class DCOPClient;
+typedef QValueList<QCString> QCStringList;
+
+
+
+
+
+
+
+
+
+class DCOPObject
+{
+public:
+
+
+
+
+  DCOPObject();
+
+
+
+
+
+  DCOPObject(QObject *obj);
+
+
+
+
+  DCOPObject(const QCString &objId);
+
+
+
+
+  virtual ~DCOPObject();
+
+
+
+
+
+  QCString objId() const;
+
+
+
+
+
+
+
+  bool setObjId(const QCString &objId);
+  virtual bool process(const QCString &fun, const QByteArray &data,
+                       QCString& replyType, QByteArray &replyData);
+  virtual bool processDynamic(const QCString &fun, const QByteArray &data,
+                              QCString& replyType, QByteArray &replyData);
+  virtual QCStringList functionsDynamic();
+  virtual QCStringList interfacesDynamic();
+  virtual QCStringList interfaces();
+  virtual QCStringList functions();
+
+
+
+
+
+
+
+  void emitDCOPSignal( const QCString &signal, const QByteArray &data);
+  bool connectDCOPSignal( const QCString &sender, const QCString &senderObj,
+                          const QCString &signal,
+                          const QCString &slot,
+                          bool Volatile);
+  bool disconnectDCOPSignal( const QCString &sender, const QCString &senderObj,
+                             const QCString &signal,
+                             const QCString &slot);
+  DCOPClient *callingDcopClient();
+
+
+
+
+
+  void setCallingDcopClient(DCOPClient *);
+  static bool hasObject(const QCString &objId);
+
+
+
+
+
+
+
+  static DCOPObject *find(const QCString &objId);
+  static QPtrList<DCOPObject> match(const QCString &partialId);
+
+
+
+
+
+
+
+  static QCString objectName( QObject* obj );
+
+private:
+
+
+
+  QCString ident;
+
+protected:
+  virtual void virtual_hook( int id, void* data );
+private:
+  class DCOPObjectPrivate;
+  DCOPObjectPrivate *d;
+};
+
+class DCOPObjectProxyPrivate;
+class DCOPObjectProxy
+{
+public:
+
+
+
+    DCOPObjectProxy();
+
+
+
+
+
+
+
+    DCOPObjectProxy( DCOPClient*);
+
+
+
+
+    virtual ~DCOPObjectProxy();
+    virtual bool process( const QCString& obj, const QCString& fun,
+                          const QByteArray& data,
+                          QCString& replyType, QByteArray &replyData );
+private:
+    void* unused;
+    void* unused_too;
+    friend class DCOPClient;
+    static QPtrList<DCOPObjectProxy>* proxies;
+protected:
+    virtual void virtual_hook( int id, void* data );
+private:
+    DCOPObjectProxyPrivate* d;
+};
+
+
+
+
+class KApplication;
+
+
+
+
+
+
+
+class KAppDCOPInterface : virtual public DCOPObject
+{
+public: virtual bool process(const QCString &fun, const QByteArray &data, QCString& replyType, QByteArray &replyData); QCStringList functions(); QCStringList interfaces(); private:
+
+public:
+
+
+
+
+
+        KAppDCOPInterface( KApplication * theKapp );
+
+
+
+
+        ~KAppDCOPInterface();
+public:
+
+
+
+        void disableSessionManagement();
+
+        QCString startupId();
+        QCString caption();
+
+        void quit();
+
+
+
+
+private:
+        KApplication *m_KApplication;
+};
+
+bool kde_have_kipc = true;
+
+KApplication* KApplication::KApp = 0L;
+bool KApplication::loadedByKdeinit = false;
+DCOPClient *KApplication::s_DCOPClient = 0L;
+bool KApplication::s_dcopClientNeedsPostInit = false;
+
+static Atom atom_DesktopWindow;
+static Atom atom_NetSupported;
+
+
+
+
+static Atom atom_KdeNetUserTime;
+static Atom kde_net_wm_user_time = 0;
+
+
+
+
+Time qt_x_last_input_time = 0L;
+extern Time qt_x_time;
+
+template class QPtrList<KSessionManaged>;
+
+
+extern "C" {
+static int kde_xio_errhandler( Display * dpy )
+{
+  return KApplication::kApplication()->xioErrhandler( dpy );
+}
+
+static int kde_x_errhandler( Display *dpy, XErrorEvent *err )
+{
+  return KApplication::kApplication()->xErrhandler( dpy, err );
+}
+
+}
+
+
+extern "C" {
+static void kde_ice_ioerrorhandler( IceConn conn )
+{
+    if(KApplication::kApplication())
+        KApplication::kApplication()->iceIOErrorHandler( conn );
+
+}
+}
+
+
+
+
+class KApplicationPrivate
+{
+public:
+  KApplicationPrivate()
+    : actionRestrictions( false ),
+        refCount( 1 ),
+        oldIceIOErrorHandler( 0 ),
+        checkAccelerators( 0 ),
+        overrideStyle( QString::null ),
+        startup_id( "0" ),
+        m_KAppDCOPInterface( 0L ),
+        session_save( false ),
+        oldXErrorHandler( __null ),
+        oldXIOErrorHandler( __null )
+  {
+  }
+
+  ~KApplicationPrivate()
+  {}
+
+
+  bool actionRestrictions : 1;
+
+
+
+
+
+
+  int refCount;
+  IceIOErrorHandler oldIceIOErrorHandler;
+  KCheckAccelerators* checkAccelerators;
+  QString overrideStyle;
+  QString geometry_arg;
+  QCString startup_id;
+  KAppDCOPInterface *m_KAppDCOPInterface;
+  bool session_save;
+  int (*oldXErrorHandler)(Display*,XErrorEvent*);
+  int (*oldXIOErrorHandler)(Display*);
+
+  class URLActionRule
+  {
+  public:
+
+
+
+
+
+
+
+
+
+
+     URLActionRule(const QString &act,
+                   const QString &bProt, const QString &bHost, const QString &bPath,
+                   const QString &dProt, const QString &dHost, const QString &dPath,
+                   bool perm)
+                   : action(act),
+                     baseProt(bProt), baseHost(bHost), basePath(bPath),
+                     destProt(dProt), destHost(dHost), destPath(dPath),
+                     permission(perm)
+                   {
+                      if (baseProt.isEmpty()) baseProtWildCard = true; else if (baseProt[baseProt.length()-1] == '!') { baseProtWildCard = false; baseProt.truncate(baseProt.length()-1); } else baseProtWildCard = true;;
+                      if (baseHost.isEmpty()) baseHostWildCard = true; else if (baseHost[0] == '*') { baseHostWildCard = true; baseHost = baseHost.mid(1); } else baseHostWildCard = false;;
+                      if (basePath.isEmpty()) basePathWildCard = true; else if (basePath[basePath.length()-1] == '!') { basePathWildCard = false; basePath.truncate(basePath.length()-1); } else basePathWildCard = true;;
+                      if (destProt.isEmpty()) destProtWildCard = true; else if (destProt[destProt.length()-1] == '!') { destProtWildCard = false; destProt.truncate(destProt.length()-1); } else destProtWildCard = true;;
+                      if (destHost.isEmpty()) destHostWildCard = true; else if (destHost[0] == '*') { destHostWildCard = true; destHost = destHost.mid(1); } else destHostWildCard = false;;
+                      if (destPath.isEmpty()) destPathWildCard = true; else if (destPath[destPath.length()-1] == '!') { destPathWildCard = false; destPath.truncate(destPath.length()-1); } else destPathWildCard = true;;
+                      destProtEqual = (destProt == "=");;
+                      destHostEqual = (destHost == "=");;
+                   }
+
+     bool baseMatch(const KURL &url, const QString &protClass)
+     {
+        if (baseProtWildCard)
+        {
+           if ( !baseProt.isEmpty() && !url.protocol().startsWith(baseProt) &&
+                (protClass.isEmpty() || (protClass != baseProt)) )
+              return false;
+        }
+        else
+        {
+           if ( (url.protocol() != baseProt) &&
+                (protClass.isEmpty() || (protClass != baseProt)) )
+              return false;
+        }
+        if (baseHostWildCard)
+        {
+           if (!baseHost.isEmpty() && !url.host().endsWith(baseHost))
+              return false;
+        }
+        else
+        {
+           if (url.host() != baseHost)
+              return false;
+        }
+        if (basePathWildCard)
+        {
+           if (!basePath.isEmpty() && !url.path().startsWith(basePath))
+              return false;
+        }
+        else
+        {
+           if (url.path() != basePath)
+              return false;
+        }
+        return true;
+     }
+
+     bool destMatch(const KURL &url, const QString &protClass, const KURL &base, const QString &baseClass)
+     {
+        if (destProtEqual)
+        {
+           if ( (url.protocol() != base.protocol()) &&
+                (protClass.isEmpty() || baseClass.isEmpty() || protClass != baseClass) )
+              return false;
+        }
+        else if (destProtWildCard)
+        {
+           if ( !destProt.isEmpty() && !url.protocol().startsWith(destProt) &&
+                (protClass.isEmpty() || (protClass != destProt)) )
+              return false;
+        }
+        else
+        {
+           if ( (url.protocol() != destProt) &&
+                (protClass.isEmpty() || (protClass != destProt)) )
+              return false;
+        }
+        if (destHostWildCard)
+        {
+           if (!destHost.isEmpty() && !url.host().endsWith(destHost))
+              return false;
+        }
+        else if (destHostEqual)
+        {
+           if (url.host() != base.host())
+              return false;
+        }
+        else
+        {
+           if (url.host() != destHost)
+              return false;
+        }
+        if (destPathWildCard)
+        {
+           if (!destPath.isEmpty() && !url.path().startsWith(destPath))
+              return false;
+        }
+        else
+        {
+           if (url.path() != destPath)
+              return false;
+        }
+        return true;
+     }
+
+     QString action;
+     QString baseProt;
+     QString baseHost;
+     QString basePath;
+     QString destProt;
+     QString destHost;
+     QString destPath;
+     bool baseProtWildCard : 1;
+     bool baseHostWildCard : 1;
+     bool basePathWildCard : 1;
+     bool destProtWildCard : 1;
+     bool destHostWildCard : 1;
+     bool destPathWildCard : 1;
+     bool destProtEqual : 1;
+     bool destHostEqual : 1;
+     bool permission;
+  };
+  QPtrList<URLActionRule> urlActionRestrictions;
+
+    QString sessionKey;
+    QString pSessionConfigFile;
+};
+
+
+static QPtrList<QWidget>*x11Filter = 0;
+static bool autoDcopRegistration = true;
+
+void KApplication::installX11EventFilter( QWidget* filter )
+{
+    if ( !filter )
+        return;
+    if (!x11Filter)
+        x11Filter = new QPtrList<QWidget>;
+    connect ( filter, "2""destroyed()", this, "1""x11FilterDestroyed()" );
+    x11Filter->append( filter );
+}
+
+void KApplication::x11FilterDestroyed()
+{
+    removeX11EventFilter( static_cast< const QWidget* >( sender()));
+}
+
+void KApplication::removeX11EventFilter( const QWidget* filter )
+{
+    if ( !x11Filter || !filter )
+        return;
+    x11Filter->removeRef( filter );
+    if ( x11Filter->isEmpty() ) {
+        delete x11Filter;
+        x11Filter = 0;
+    }
+}
+
+
+
+
+
+extern bool kde_g_bKillAccelOverride;
+
+bool KApplication::notify(QObject *receiver, QEvent *event)
+{
+    QEvent::Type t = event->type();
+    if (kde_g_bKillAccelOverride)
+    {
+       kde_g_bKillAccelOverride = false;
+
+       if (t == QEvent::AccelOverride)
+       {
+          static_cast<QKeyEvent *>(event)->accept();
+          return true;
+       }
+       else
+          kdWarning(125) << "kde_g_bKillAccelOverride set, but received an event other than AccelOverride." << endl;
+    }
+
+    if ((t == QEvent::AccelOverride) || (t == QEvent::KeyPress))
+    {
+       static const KShortcut& _selectAll = KStdAccel::selectAll();
+       if (receiver && receiver->inherits("QLineEdit"))
+       {
+          QLineEdit *edit = static_cast<QLineEdit *>(receiver);
+
+          QKeyEvent *kevent = static_cast<QKeyEvent *>(event);
+          KKey key(kevent);
+          if (_selectAll.contains(key))
+          {
+             if (t == QEvent::KeyPress)
+             {
+                edit->selectAll();
+                return true;
+             }
+             else
+             {
+                kevent->accept();
+             }
+          }
+
+          if (key == KKey(Qt::CTRL + Qt::Key_U))
+          {
+             if (t == QEvent::KeyPress)
+             {
+                if (!edit->isReadOnly())
+                {
+                   QString t(edit->text());
+                   t = t.mid(edit->cursorPosition());
+                   edit->validateAndSet(t, 0, 0, 0);
+                }
+                return true;
+             }
+             else
+             {
+                kevent->accept();
+             }
+
+          }
+       }
+       if (receiver && receiver->inherits("QTextEdit"))
+       {
+          QTextEdit *medit = static_cast<QTextEdit *>(receiver);
+
+          QKeyEvent *kevent = static_cast<QKeyEvent *>(event);
+          if (_selectAll.contains(KKey(kevent)))
+          {
+             if (t == QEvent::KeyPress)
+             {
+                medit->selectAll();
+                return true;
+             }
+             else
+             {
+                kevent->accept();
+             }
+          }
+       }
+    }
+    if( event->type() == QEvent::Show && receiver->isWidgetType())
+    {
+        QWidget* w = static_cast< QWidget* >( receiver );
+        if( w->isTopLevel() && qt_x_last_input_time != 0L )
+            XChangeProperty( qt_xdisplay(), w->winId(), kde_net_wm_user_time, ((Atom) 6),
+                32, 0, (unsigned char*)&qt_x_last_input_time, 1 );
+    }
+    if( event->type() == QEvent::Hide && receiver->isWidgetType())
+    {
+        QWidget* w = static_cast< QWidget* >( receiver );
+        if( w->isTopLevel() && w->winId() != 0 )
+            XDeleteProperty( qt_xdisplay(), w->winId(), kde_net_wm_user_time );
+    }
+    return QApplication::notify(receiver, event);
+}
+
+
+
+static QPtrList<KSessionManaged>* sessionClients()
+{
+    static QPtrList<KSessionManaged>* session_clients = 0L;
+    if ( !session_clients )
+        session_clients = new QPtrList<KSessionManaged>;
+    return session_clients;
+}
+
+
+
+
+
+
+QString KApplication::sessionConfigName() const
+{
+
+
+
+    QString sessKey = sessionKey();
+    if ( sessKey.isEmpty() && !d->sessionKey.isEmpty() )
+        sessKey = d->sessionKey;
+    return QString("session/%1_%2_%3").arg(name()).arg(sessionId()).arg(sessKey);
+
+}
+
+
+static SmcConn mySmcConnection = 0;
+static SmcConn tmpSmcConnection = 0;
+
+
+
+
+static QTime* smModificationTime = 0;
+
+KApplication::KApplication( int& argc, char** argv, const QCString& rAppName,
+                            bool allowStyles, bool GUIenabled ) :
+  QApplication( argc, argv, GUIenabled ), KInstance(rAppName),
+
+  display(0L),
+
+  d (new KApplicationPrivate())
+{
+    read_app_startup_id();
+    if (!GUIenabled)
+       allowStyles = false;
+    useStyles = allowStyles;
+    ((!rAppName.isEmpty()) ? (void)0 : qWarning("ASSERT: \"%s\" in %s (%d)","!rAppName.isEmpty()","/coolo/prod/kdelibs/kdecore/kapplication.cpp",543));
+    setName(rAppName);
+
+    installSigpipeHandler();
+    KCmdLineArgs::initIgnore(argc, argv, rAppName.data());
+    parseCommandLine( );
+    init(GUIenabled);
+    d->m_KAppDCOPInterface = new KAppDCOPInterface(this);
+}
+
+KApplication::KApplication( bool allowStyles, bool GUIenabled ) :
+  QApplication( *KCmdLineArgs::qt_argc(), *KCmdLineArgs::qt_argv(),
+                GUIenabled ),
+  KInstance( KCmdLineArgs::about),
+
+  display(0L),
+
+  d (new KApplicationPrivate)
+{
+    read_app_startup_id();
+    if (!GUIenabled)
+       allowStyles = false;
+    useStyles = allowStyles;
+    setName( instanceName() );
+
+    installSigpipeHandler();
+    parseCommandLine( );
+    init(GUIenabled);
+    d->m_KAppDCOPInterface = new KAppDCOPInterface(this);
+}
+
+KApplication::KApplication( bool allowStyles, bool GUIenabled, KInstance* _instance ) :
+  QApplication( *KCmdLineArgs::qt_argc(), *KCmdLineArgs::qt_argv(),
+                GUIenabled ),
+  KInstance( _instance ),
+
+  display(0L),
+
+  d (new KApplicationPrivate)
+{
+    read_app_startup_id();
+    if (!GUIenabled)
+       allowStyles = false;
+    useStyles = allowStyles;
+    setName( instanceName() );
+
+    installSigpipeHandler();
+    parseCommandLine( );
+    init(GUIenabled);
+}
+
+
+KApplication::KApplication(Display *display, int& argc, char** argv, const QCString& rAppName,
+                           bool allowStyles, bool GUIenabled ) :
+  QApplication( display ), KInstance(rAppName),
+  display(0L),
+  d (new KApplicationPrivate())
+{
+    read_app_startup_id();
+    if (!GUIenabled)
+       allowStyles = false;
+    useStyles = allowStyles;
+
+    ((!rAppName.isEmpty()) ? (void)0 : qWarning("ASSERT: \"%s\" in %s (%d)","!rAppName.isEmpty()","/coolo/prod/kdelibs/kdecore/kapplication.cpp",606));
+    setName(rAppName);
+
+    installSigpipeHandler();
+    KCmdLineArgs::initIgnore(argc, argv, rAppName.data());
+    parseCommandLine( );
+    init(GUIenabled);
+    d->m_KAppDCOPInterface = new KAppDCOPInterface(this);
+}
+
+
+int KApplication::xioErrhandler( Display* dpy )
+{
+    if(KApplication::kApplication())
+    {
+        shutDown();
+        d->oldXIOErrorHandler( dpy );
+    }
+    exit( 1 );
+    return 0;
+}
+
+int KApplication::xErrhandler( Display* dpy, void* err_ )
+{
+    XErrorEvent* err = static_cast< XErrorEvent* >( err_ );
+    if(KApplication::kApplication())
+    {
+
+        d->oldXErrorHandler( dpy, err );
+    }
+    return 0;
+}
+
+void KApplication::iceIOErrorHandler( _IceConn *conn )
+{
+    shutDown();
+
+    if ( d->oldIceIOErrorHandler != __null )
+      (*d->oldIceIOErrorHandler)( conn );
+
+    exit( 1 );
+}
+
+class KDETranslator : public QTranslator
+{
+public:
+  KDETranslator(QObject *parent) : QTranslator(parent, "kdetranslator") {}
+  virtual QTranslatorMessage findMessage(const char* context,
+                                         const char *sourceText,
+                                         const char* message) const
+  {
+    QTranslatorMessage res;
+    res.setTranslation(KGlobal::locale()->translateQt(context, sourceText, message));
+    return res;
+  }
+};
+
+void KApplication::init(bool GUIenabled)
+{
+  if ((getuid() != geteuid()) ||
+      (getgid() != getegid()))
+  {
+     fprintf(stderr, "The KDE libraries are not designed to run with suid privileges.\n");
+     ::exit(127);
+  }
+
+  KProcessController::ref();
+
+  (void) KClipboardSynchronizer::self();
+
+  QApplication::setDesktopSettingsAware( false );
+
+  KApp = this;
+
+
+
+
+  if ( GUIenabled ) {
+      const int max = 20;
+      Atom* atoms[max];
+      char* names[max];
+      Atom atoms_return[max];
+      int n = 0;
+
+      atoms[n] = &kipcCommAtom;
+      names[n++] = (char *) "KIPC_COMM_ATOM";
+
+      atoms[n] = &atom_DesktopWindow;
+      names[n++] = (char *) "KDE_DESKTOP_WINDOW";
+
+      atoms[n] = &atom_NetSupported;
+      names[n++] = (char *) "_NET_SUPPORTED";
+
+      atoms[n] = &atom_KdeNetUserTime;
+      names[n++] = (char *) "_KDE_NET_USER_TIME";
+
+      atoms[n] = &kde_net_wm_user_time;
+      names[n++] = (char *) "_NET_WM_USER_TIME";
+
+      XInternAtoms( qt_xdisplay(), names, n, FALSE, atoms_return );
+      for (int i = 0; i < n; i++ )
+          *atoms[i] = atoms_return[i];
+  }
+
+
+  dcopAutoRegistration();
+  dcopClientPostInit();
+
+  smw = 0;
+
+
+
+  kipcEventMask = (1 << KIPC::StyleChanged) | (1 << KIPC::PaletteChanged) |
+                  (1 << KIPC::FontChanged) | (1 << KIPC::BackgroundChanged) |
+                  (1 << KIPC::ToolbarStyleChanged) | (1 << KIPC::SettingsChanged) |
+                  (1 << KIPC::ClipboardConfigChanged);
+
+
+
+  (void) KGlobal::locale();
+
+  KConfig* config = KGlobal::config();
+  d->actionRestrictions = config->hasGroup("KDE Action Restrictions" );
+
+
+
+
+  QCString readOnly = getenv("KDE_HOME_READONLY");
+  if (readOnly.isEmpty() && (qstrcmp(name(), "kdialog") != 0))
+  {
+    KConfigGroupSaver saver(config, "KDE Action Restrictions");
+    if (config->readBoolEntry("warn_unwritable_config",TRUE))
+       config->checkConfigFilesWritable(TRUE);
+  }
+
+  if (GUIenabled)
+  {
+
+
+    fcntl((((_XPrivDisplay)qt_xdisplay())->fd), 2, 1);
+
+    d->oldXErrorHandler = XSetErrorHandler( kde_x_errhandler );
+    d->oldXIOErrorHandler = XSetIOErrorHandler( kde_xio_errhandler );
+
+
+    connect( this, "2""aboutToQuit()", this, "2""shutDown()" );
+
+
+    display = desktop()->x11Display();
+
+
+    {
+        QStringList plugins = KGlobal::dirs()->resourceDirs( "qtplugins" );
+        QStringList::Iterator it = plugins.begin();
+        while (it != plugins.end()) {
+            addLibraryPath( *it );
+            ++it;
+        }
+
+    }
+    kdisplaySetStyle();
+    kdisplaySetFont();
+
+    propagateSettings(SETTINGS_QT);
+
+
+    QMimeSourceFactory::defaultFactory()->addFactory( mimeSourceFactory() );
+
+    KConfigGroupSaver saver( config, "Development" );
+    if( config->hasKey( "CheckAccelerators" ) || config->hasKey( "AutoCheckAccelerators" ))
+        d->checkAccelerators = new KCheckAccelerators( this );
+  }
+
+
+
+  bool rtl = reverseLayout();
+  installTranslator(new KDETranslator(this));
+  setReverseLayout( rtl );
+  if (i18n( "_: Dear Translator! Translate this string to the string 'LTR' in "
+         "left-to-right languages (as english) or to 'RTL' in right-to-left "
+         "languages (such as Hebrew and Arabic) to get proper widget layout." ) == "RTL")
+
+        setReverseLayout( !rtl );
+
+
+  KGlobal::dirs()->addResourceType("appdata", KStandardDirs::kde_default("data")
+                                   + QString::fromLatin1(name()) + '/');
+  pSessionConfig = 0L;
+  bSessionManagement = true;
+
+
+
+  if (GUIenabled && kde_have_kipc )
+  {
+    smw = new QWidget(0,0);
+    long data = 1;
+    XChangeProperty(qt_xdisplay(), smw->winId(),
+                    atom_DesktopWindow, atom_DesktopWindow,
+                    32, 0, (unsigned char *)&data, 1);
+  }
+
+
+
+
+  d->oldIceIOErrorHandler = IceSetIOErrorHandler( kde_ice_ioerrorhandler );
+}
+
+static int my_system (const char *command) {
+   int pid, status;
+
+   QApplication::flushX();
+   pid = fork();
+   if (pid == -1)
+      return -1;
+   if (pid == 0) {
+      const char* shell = "/bin/sh";
+      execl(shell, shell, "-c", command, (void *)0);
+      ::exit(127);
+   }
+   do {
+      if (waitpid(pid, &status, 0) == -1) {
+         if ((*__errno_location ()) != 4)
+            return -1;
+       } else
+            return status;
+   } while(1);
+}
+
+
+DCOPClient *KApplication::dcopClient()
+{
+  if (s_DCOPClient)
+    return s_DCOPClient;
+
+  s_DCOPClient = new DCOPClient();
+  KCmdLineArgs *args = KCmdLineArgs::parsedArgs("kde");
+  if (args->isSet("dcopserver"))
+  {
+    s_DCOPClient->setServerAddress( args->getOption("dcopserver"));
+  }
+  if( KApplication::kApplication() ) {
+    connect(s_DCOPClient, "2""attachFailed(const QString &)",
+            KApplication::kApplication(), "1""dcopFailure(const QString &)");
+    connect(s_DCOPClient, "2""blockUserInput(bool)",
+            KApplication::kApplication(), "1""dcopBlockUserInput(bool)" );
+  }
+  else
+    s_dcopClientNeedsPostInit = true;
+
+  DCOPClient::setMainClient( s_DCOPClient );
+  return s_DCOPClient;
+}
+
+void KApplication::dcopClientPostInit()
+{
+  if( s_dcopClientNeedsPostInit )
+    {
+    s_dcopClientNeedsPostInit = false;
+    connect(s_DCOPClient, "2""blockUserInput(bool)",
+            "1""dcopBlockUserInput(bool)" );
+    s_DCOPClient->bindToApp();
+    }
+}
+
+void KApplication::dcopAutoRegistration()
+{
+  if (autoDcopRegistration)
+     {
+     ( void ) dcopClient();
+     if( dcopClient()->appId().isEmpty())
+         dcopClient()->registerAs(name());
+     }
+}
+
+void KApplication::disableAutoDcopRegistration()
+{
+  autoDcopRegistration = false;
+}
+
+KConfig* KApplication::sessionConfig()
+{
+    if (pSessionConfig)
+        return pSessionConfig;
+
+
+    pSessionConfig = new KConfig( sessionConfigName(), false, false);
+    return pSessionConfig;
+}
+
+void KApplication::ref()
+{
+    d->refCount++;
+
+}
+
+void KApplication::deref()
+{
+    d->refCount--;
+
+    if ( d->refCount <= 0 )
+        quit();
+}
+
+KSessionManaged::KSessionManaged()
+{
+    sessionClients()->remove( this );
+    sessionClients()->append( this );
+}
+
+KSessionManaged::~KSessionManaged()
+{
+    sessionClients()->remove( this );
+}
+
+bool KSessionManaged::saveState(QSessionManager&)
+{
+    return true;
+}
+
+bool KSessionManaged::commitData(QSessionManager&)
+{
+    return true;
+}
+
+
+void KApplication::disableSessionManagement() {
+  bSessionManagement = false;
+}
+
+void KApplication::enableSessionManagement() {
+  bSessionManagement = true;
+  if( mySmcConnection ) {
+        SmcRequestSaveYourself( mySmcConnection, 1, 0,
+                                2,
+                                0, 0 );
+
+
+        IceFlush(SmcGetIceConnection(mySmcConnection));
+  }
+}
+
+
+bool KApplication::requestShutDown(
+    ShutdownConfirm confirm, ShutdownType sdtype, ShutdownMode sdmode )
+{
+
+    QApplication::syncX();
+
+    if ( confirm == ShutdownConfirmYes ||
+         sdtype != ShutdownTypeDefault ||
+         sdmode != ShutdownModeDefault )
+    {
+        QByteArray data;
+        QDataStream arg(data, 0x0002);
+        arg << (int)confirm << (int)sdtype << (int)sdmode;
+        return dcopClient()->send( "ksmserver", "ksmserver",
+                                   "logout(int,int,int)", data );
+    }
+
+    if ( mySmcConnection ) {
+
+        SmcRequestSaveYourself( mySmcConnection, 2, 1,
+                                2,
+                                confirm == ShutdownConfirmNo, 1 );
+
+
+        IceFlush(SmcGetIceConnection(mySmcConnection));
+        return TRUE;
+    }
+
+
+
+    propagateSessionManager();
+    QCString smEnv = ::getenv("SESSION_MANAGER");
+    if (smEnv.isEmpty())
+        return FALSE;
+
+    if (! tmpSmcConnection) {
+        char cerror[256];
+        char* myId = 0;
+        char* prevId = 0;
+        SmcCallbacks cb;
+        tmpSmcConnection = SmcOpenConnection( 0, 0, 1, 0,
+                                              0, &cb,
+                                              prevId,
+                                              &myId,
+                                              255,
+                                              cerror );
+        ::free( myId );
+        if (!tmpSmcConnection )
+            return FALSE;
+    }
+
+    SmcRequestSaveYourself( tmpSmcConnection, 2, 1,
+                            2, 0, 1 );
+
+
+    IceFlush(SmcGetIceConnection(tmpSmcConnection));
+    return TRUE;
+
+
+
+
+}
+
+void KApplication::propagateSessionManager()
+{
+    QCString fName = QFile::encodeName(locateLocal("socket", "KSMserver"));
+    QCString display = ::getenv("DISPLAY");
+
+    display.replace(QRegExp("\\.[0-9]+$"), "");
+    int i;
+    while( (i = display.find(':')) >= 0)
+       display[i] = '_';
+
+    fName += "_"+display;
+    QCString smEnv = ::getenv("SESSION_MANAGER");
+    bool check = smEnv.isEmpty();
+    if ( !check && smModificationTime ) {
+         QFileInfo info( fName );
+         QTime current = info.lastModified().time();
+         check = current > *smModificationTime;
+    }
+    if ( check ) {
+        delete smModificationTime;
+        QFile f( fName );
+        if ( !f.open( 0x0001 ) )
+            return;
+        QFileInfo info ( f );
+        smModificationTime = new QTime( info.lastModified().time() );
+        QTextStream t(&f);
+        t.setEncoding( QTextStream::Latin1 );
+        QString s = t.readLine();
+        f.close();
+        ::setenv( "SESSION_MANAGER", s.latin1(), TRUE );
+    }
+}
+
+void KApplication::commitData( QSessionManager& sm )
+{
+    d->session_save = true;
+    bool canceled = false;
+    for (KSessionManaged* it = sessionClients()->first();
+         it && !canceled;
+         it = sessionClients()->next() ) {
+        canceled = !it->commitData( sm );
+    }
+    if ( canceled )
+        sm.cancel();
+
+    if ( sm.allowsInteraction() ) {
+        QWidgetList done;
+        QWidgetList *list = QApplication::topLevelWidgets();
+        bool canceled = FALSE;
+        QWidget* w = list->first();
+        while ( !canceled && w ) {
+            if ( !w->testWState( WState_ForceHide ) && !w->inherits("KMainWindow") ) {
+                QCloseEvent e;
+                sendEvent( w, &e );
+                canceled = !e.isAccepted();
+                if ( !canceled )
+                    done.append( w );
+                delete list;
+                list = QApplication::topLevelWidgets();
+                w = list->first();
+            } else {
+                w = list->next();
+            }
+            while ( w && done.containsRef( w ) )
+                w = list->next();
+        }
+        delete list;
+    }
+
+
+    if ( !bSessionManagement )
+        sm.setRestartHint( QSessionManager::RestartNever );
+    else
+        sm.setRestartHint( QSessionManager::RestartIfRunning );
+    d->session_save = false;
+}
+
+void KApplication::saveState( QSessionManager& sm )
+{
+    d->session_save = true;
+
+    static bool firstTime = true;
+    mySmcConnection = (SmcConn) sm.handle();
+
+    if ( !bSessionManagement ) {
+        sm.setRestartHint( QSessionManager::RestartNever );
+        d->session_save = false;
+        return;
+    }
+    else
+        sm.setRestartHint( QSessionManager::RestartIfRunning );
+    if ( firstTime ) {
+        firstTime = false;
+        d->session_save = false;
+        return;
+    }
+
+
+
+
+
+
+
+    if ( pSessionConfig ) {
+        delete pSessionConfig;
+        pSessionConfig = 0;
+    }
+
+
+    QStringList restartCommand = sm.restartCommand();
+
+
+
+
+
+
+
+    QCString multiHead = getenv("KDE_MULTIHEAD");
+    if (multiHead.lower() == "true") {
+
+
+
+
+
+
+        QCString displayname = getenv("DISPLAY");
+        if (! displayname.isNull()) {
+
+
+            restartCommand.append("-display");
+            restartCommand.append(displayname);
+        }
+        sm.setRestartCommand( restartCommand );
+    }
+
+
+
+    saveYourself();
+    bool canceled = false;
+    for (KSessionManaged* it = sessionClients()->first();
+         it && !canceled;
+         it = sessionClients()->next() ) {
+        canceled = !it->saveState( sm );
+    }
+
+
+    if ( pSessionConfig ) {
+        pSessionConfig->sync();
+        QStringList discard;
+        discard << "rm" << locateLocal("config", sessionConfigName());
+        sm.setDiscardCommand( discard );
+    } else {
+        sm.setDiscardCommand( "" );
+    }
+
+    if ( canceled )
+        sm.cancel();
+
+
+
+    d->session_save = false;
+}
+
+bool KApplication::sessionSaving() const
+{
+    return d->session_save;
+}
+
+void KApplication::startKdeinit()
+{
+
+  QString srv = KStandardDirs::findExe(QString::fromLatin1("kdeinit"));
+  if (srv.isEmpty())
+     srv = KStandardDirs::findExe(QString::fromLatin1("kdeinit"), "/coolo/KDE"+QString::fromLatin1("/bin"));
+  if (srv.isEmpty())
+     return;
+  if (KApplication::kApplication() && (Tty != KApplication::kApplication()->type()))
+    setOverrideCursor( Qt::waitCursor );
+  my_system(QFile::encodeName(srv)+" --suicide");
+  if (KApplication::kApplication() && (Tty != KApplication::kApplication()->type()))
+    restoreOverrideCursor();
+}
+
+void KApplication::dcopFailure(const QString &msg)
+{
+  static int failureCount = 0;
+  failureCount++;
+  if (failureCount == 1)
+  {
+     startKdeinit();
+     return;
+  }
+  if (failureCount == 2)
+  {
+     QString msgStr(i18n("There was an error setting up inter-process\n"
+                      "communications for KDE. The message returned\n"
+                      "by the system was:\n\n"));
+     msgStr += msg;
+     msgStr += i18n("\n\nPlease check that the \"dcopserver\" program is running!");
+
+     if (Tty != KApplication::kApplication()->type())
+     {
+       QMessageBox::critical
+         (
+           KApplication::kApplication()->mainWidget(),
+           i18n("DCOP communications error (%1)").arg(KApplication::kApplication()->caption()),
+           msgStr,
+           i18n("OK")
+         );
+     }
+     else
+     {
+       fprintf(stderr, "%s\n", msgStr.local8Bit().data());
+     }
+
+     return;
+  }
+}
+
+static const KCmdLineOptions qt_options[] =
+{
+
+
+   { "display <displayname>", ("Use the X-server display 'displayname'."), 0},
+
+
+
+   { "session <sessionId>", ("Restore the application for the given 'sessionId'."), 0},
+   { "cmap", ("Causes the application to install a private color\nmap on an 8-bit display."), 0},
+   { "ncols <count>", ("Limits the number of colors allocated in the color\ncube on an 8-bit display, if the application is\nusing the QApplication::ManyColor color\nspecification."), 0},
+   { "nograb", ("tells Qt to never grab the mouse or the keyboard."), 0},
+   { "dograb", ("running under a debugger can cause an implicit\n-nograb, use -dograb to override."), 0},
+   { "sync", ("switches to synchronous mode for debugging."), 0},
+   { "fn", 0, 0},
+   { "font <fontname>", ("defines the application font."), 0},
+   { "bg", 0, 0},
+   { "background <color>", ("sets the default background color and an\napplication palette (light and dark shades are\ncalculated)."), 0},
+   { "fg", 0, 0},
+   { "foreground <color>", ("sets the default foreground color."), 0},
+   { "btn", 0, 0},
+   { "button <color>", ("sets the default button color."), 0},
+   { "name <name>", ("sets the application name."), 0},
+   { "title <title>", ("sets the application title (caption)."), 0},
+
+   { "visual TrueColor", ("forces the application to use a TrueColor visual on\nan 8-bit display."), 0},
+   { "inputstyle <inputstyle>", ("sets XIM (X Input Method) input style. Possible\nvalues are onthespot, overthespot, offthespot and\nroot."), 0 },
+   { "im <XIM server>", ("set XIM server."),0},
+   { "noxim", ("disable XIM."), 0 },
+
+
+
+
+   { "reverse", ("mirrors the whole layout of widgets."), 0},
+   { 0, 0, 0 }
+};
+
+static const KCmdLineOptions kde_options[] =
+{
+   { "caption <caption>", ("Use 'caption' as name in the titlebar."), 0},
+   { "icon <icon>", ("Use 'icon' as the application icon."), 0},
+   { "miniicon <icon>", ("Use 'icon' as the icon in the titlebar."), 0},
+   { "config <filename>", ("Use alternative configuration file."), 0},
+   { "dcopserver <server>", ("Use the DCOP Server specified by 'server'."), 0},
+   { "nocrashhandler", ("Disable crash handler, to get core dumps."), 0},
+   { "waitforwm", ("Waits for a WM_NET compatible windowmanager."), 0},
+   { "style <style>", ("sets the application GUI style."), 0},
+   { "geometry <geometry>", ("sets the client geometry of the main widget."), 0},
+
+
+
+   { "smkey <sessionKey>", 0, 0},
+
+
+
+   { 0, 0, 0 }
+};
+
+void
+KApplication::addCmdLineOptions()
+{
+   KCmdLineArgs::addCmdLineOptions(qt_options, "Qt", "qt");
+   KCmdLineArgs::addCmdLineOptions(kde_options, "KDE", "kde");
+}
+
+void KApplication::parseCommandLine( )
+{
+    KCmdLineArgs *args = KCmdLineArgs::parsedArgs("kde");
+
+    if (args->isSet("config"))
+    {
+        QString config = QString::fromLocal8Bit(args->getOption("config"));
+        setConfigName(config);
+    }
+
+    if (args->isSet("style"))
+    {
+
+       QStringList styles = QStyleFactory::keys();
+       QString reqStyle(args->getOption("style").lower());
+
+           for (QStringList::ConstIterator it = styles.begin(); it != styles.end(); ++it)
+                   if ((*it).lower() == reqStyle)
+                   {
+                           d->overrideStyle = *it;
+                           break;
+                   }
+
+       if (d->overrideStyle.isEmpty())
+          fprintf(stderr, "%s", i18n("The style %1 was not found\n").arg(reqStyle).local8Bit().data());
+    }
+
+    if (args->isSet("caption"))
+    {
+       aCaption = QString::fromLocal8Bit(args->getOption("caption"));
+    }
+
+    if (args->isSet("miniicon"))
+    {
+       const char *tmp = args->getOption("miniicon");
+       aMiniIconPixmap = SmallIcon(tmp);
+       aMiniIconName = tmp;
+    }
+
+    if (args->isSet("icon"))
+    {
+       const char *tmp = args->getOption("icon");
+       aIconPixmap = DesktopIcon( tmp );
+       aIconName = tmp;
+       if (aMiniIconPixmap.isNull())
+       {
+          aMiniIconPixmap = SmallIcon( tmp );
+          aMiniIconName = tmp;
+       }
+    }
+
+    bool nocrashhandler = (getenv("KDE_DEBUG") != __null);
+    if (!nocrashhandler && args->isSet("crashhandler"))
+    {
+
+        KCrash::setCrashHandler(KCrash::defaultCrashHandler);
+        KCrash::setEmergencySaveFunction(__null);
+
+        KCrash::setApplicationName(QString(args->appName()));
+    }
+
+
+    if ( args->isSet( "waitforwm" ) ) {
+        Atom type;
+        (void) desktop();
+        int format;
+        unsigned long length, after;
+        unsigned char *data;
+        while ( XGetWindowProperty( qt_xdisplay(), qt_xrootwin(), atom_NetSupported,
+                                    0, 1, FALSE, 0L, &type, &format,
+                                    &length, &after, &data ) != Success || !length ) {
+            if ( data )
+                XFree( data );
+            XEvent event;
+            XWindowEvent( qt_xdisplay(), qt_xrootwin(), (1L<<22), &event );
+        }
+        if ( data )
+            XFree( data );
+    }
+
+
+
+
+    if (args->isSet("geometry"))
+    {
+        d->geometry_arg = args->getOption("geometry");
+    }
+
+    if (args->isSet("smkey"))
+    {
+        d->sessionKey = args->getOption("smkey");
+    }
+
+}
+
+QString KApplication::geometryArgument() const
+{
+    return d->geometry_arg;
+}
+
+QPixmap KApplication::icon() const
+{
+  if( aIconPixmap.isNull()) {
+      KApplication *that = const_cast<KApplication *>(this);
+      that->aIconPixmap = DesktopIcon( instanceName() );
+  }
+  return aIconPixmap;
+}
+
+QString KApplication::iconName() const
+{
+  return aIconName.isNull() ? (QString)instanceName() : aIconName;
+}
+
+QPixmap KApplication::miniIcon() const
+{
+  if (aMiniIconPixmap.isNull()) {
+      KApplication *that = const_cast<KApplication *>(this);
+      that->aMiniIconPixmap = SmallIcon( instanceName() );
+  }
+  return aMiniIconPixmap;
+}
+
+QString KApplication::miniIconName() const
+{
+  return aMiniIconName.isNull() ? (QString)instanceName() : aMiniIconName;
+}
+
+extern void kDebugCleanup();
+
+KApplication::~KApplication()
+{
+  delete d->m_KAppDCOPInterface;
+
+
+
+
+  KGlobal::deleteStaticDeleters();
+  KLibLoader::cleanUp();
+
+  delete smw;
+
+
+  delete s_DCOPClient;
+  s_DCOPClient = 0L;
+
+  KProcessController::deref();
+
+  if ( d->oldXErrorHandler != __null )
+      XSetErrorHandler( d->oldXErrorHandler );
+  if ( d->oldXIOErrorHandler != __null )
+      XSetIOErrorHandler( d->oldXIOErrorHandler );
+  if ( d->oldIceIOErrorHandler != __null )
+      IceSetIOErrorHandler( d->oldIceIOErrorHandler );
+
+  delete d;
+  KApp = 0;
+
+
+  mySmcConnection = 0;
+  delete smModificationTime;
+  smModificationTime = 0;
+
+
+  if (tmpSmcConnection) {
+      SmcCloseConnection( tmpSmcConnection, 0, 0 );
+      tmpSmcConnection = 0;
+  }
+
+
+
+}
+
+
+
+class KAppX11HackWidget: public QWidget
+{
+public:
+    bool publicx11Event( XEvent * e) { return x11Event( e ); }
+};
+
+
+
+
+static bool kapp_block_user_input = false;
+
+void KApplication::dcopBlockUserInput( bool b )
+{
+    kapp_block_user_input = b;
+}
+
+
+bool KApplication::x11EventFilter( XEvent *_event )
+{
+    switch ( _event->type ) {
+        case 4:
+        case XKeyPress:
+        {
+            if( _event->type == 4 )
+                qt_x_last_input_time = _event->xbutton.time;
+            else
+                qt_x_last_input_time = _event->xkey.time;
+            QWidget* w = activeWindow();
+            if( w ) {
+                XChangeProperty( qt_xdisplay(), w->winId(), kde_net_wm_user_time, ((Atom) 6),
+                    32, 0, (unsigned char*)&qt_x_time, 1 );
+                timeval tv;
+                gettimeofday( &tv, __null );
+                unsigned long now = tv.tv_sec * 10 + tv.tv_usec / 100000;
+                XChangeProperty(qt_xdisplay(), w->winId(),
+                            atom_KdeNetUserTime, ((Atom) 6),
+                            32, 0, (unsigned char *)&now, 1);
+            }
+        }
+        break;
+        default: break;
+    }
+
+    if ( kapp_block_user_input ) {
+        switch ( _event->type ) {
+        case 4:
+        case 5:
+        case XKeyPress:
+        case XKeyRelease:
+        case 6:
+            return TRUE;
+        default:
+            break;
+        }
+    }
+
+    if (x11Filter) {
+        for (QWidget *w=x11Filter->first(); w; w=x11Filter->next()) {
+            if (((KAppX11HackWidget*) w)->publicx11Event(_event))
+                return true;
+        }
+    }
+
+
+    if ((_event->type == 33) &&
+            (_event->xclient.message_type == kipcCommAtom))
+    {
+        XClientMessageEvent *cme = (XClientMessageEvent *) _event;
+
+        int id = cme->data.l[0];
+        int arg = cme->data.l[1];
+        if ((id < 32) && (kipcEventMask & (1 << id)))
+        {
+            switch (id)
+            {
+            case KIPC::StyleChanged:
+                KGlobal::config()->reparseConfiguration();
+                kdisplaySetStyle();
+                break;
+
+            case KIPC::ToolbarStyleChanged:
+                KGlobal::config()->reparseConfiguration();
+                if (useStyles)
+                    toolbarAppearanceChanged(arg);
+                break;
+
+            case KIPC::PaletteChanged:
+                KGlobal::config()->reparseConfiguration();
+                kdisplaySetPalette();
+                break;
+
+            case KIPC::FontChanged:
+                KGlobal::config()->reparseConfiguration();
+                KGlobalSettings::rereadFontSettings();
+                kdisplaySetFont();
+                break;
+
+            case KIPC::BackgroundChanged:
+                backgroundChanged(arg);
+                break;
+
+            case KIPC::SettingsChanged:
+                KGlobal::config()->reparseConfiguration();
+                if (arg == SETTINGS_PATHS)
+                    KGlobalSettings::rereadPathSettings();
+                else if (arg == SETTINGS_MOUSE)
+                    KGlobalSettings::rereadMouseSettings();
+                propagateSettings((SettingsCategory)arg);
+                break;
+
+            case KIPC::IconChanged:
+                QPixmapCache::clear();
+                KGlobal::config()->reparseConfiguration();
+                KGlobal::instance()->newIconLoader();
+                iconChanged(arg);
+                break;
+
+            case KIPC::ClipboardConfigChanged:
+                KClipboardSynchronizer::newConfiguration(arg);
+                break;
+            }
+        }
+        else if (id >= 32)
+        {
+            kipcMessage(id, arg);
+        }
+        return true;
+    }
+
+    return false;
+}
+
+
+void KApplication::invokeEditSlot( const char *slot )
+{
+  QObject *object = focusWidget();
+  if( !object )
+    return;
+
+  QMetaObject *meta = object->metaObject();
+
+  int idx = meta->findSlot( slot + 1, true );
+  if( idx < 0 )
+    return;
+
+  object->qt_invoke( idx, 0 );
+}
+
+void KApplication::addKipcEventMask(int id)
+{
+    if (id >= 32)
+    {
+        kdDebug(101) << "Cannot use KIPC event mask for message IDs >= 32\n";
+        return;
+    }
+    kipcEventMask |= (1 << id);
+}
+
+void KApplication::removeKipcEventMask(int id)
+{
+    if (id >= 32)
+    {
+        kdDebug(101) << "Cannot use KIPC event mask for message IDs >= 32\n";
+        return;
+    }
+    kipcEventMask &= ~(1 << id);
+}
+
+void KApplication::enableStyles()
+{
+    if (!useStyles)
+    {
+        useStyles = true;
+        applyGUIStyle();
+    }
+}
+
+void KApplication::disableStyles()
+{
+    useStyles = false;
+}
+
+void KApplication::applyGUIStyle()
+{
+    if ( !useStyles ) return;
+
+    KConfigGroup pConfig (KGlobal::config(), "General");
+    QString defaultStyle = KStyle::defaultStyle();
+    QString styleStr = pConfig.readEntry("widgetStyle", defaultStyle);
+
+    if (d->overrideStyle.isEmpty()) {
+
+
+
+      QStyle* sp = QStyleFactory::create( styleStr );
+
+
+      if ( !sp && styleStr != defaultStyle)
+          sp = QStyleFactory::create( defaultStyle );
+      if ( !sp )
+          sp = QStyleFactory::create( *(QStyleFactory::keys().begin()) );
+      setStyle(sp);
+    }
+    else
+        setStyle(d->overrideStyle);
+
+    kdisplaySetPalette();
+}
+
+QString KApplication::caption() const
+{
+
+  if( !aCaption.isNull() )
+        return aCaption;
+  else
+
+      if ( KGlobal::instance()->aboutData() )
+        return KGlobal::instance()->aboutData()->programName();
+      else
+
+        return name();
+}
+
+
+
+
+
+
+QString KApplication::makeStdCaption( const QString &userCaption,
+                                      bool withAppName, bool modified ) const
+{
+  QString s = userCaption.isEmpty() ? caption() : userCaption;
+
+
+  if (modified)
+      s += QString::fromUtf8(" [") + i18n("modified") + QString::fromUtf8("]");
+
+  if ( !userCaption.isEmpty() ) {
+
+
+      if ( withAppName && !caption().isNull() && !userCaption.endsWith(caption()) )
+          s += QString::fromUtf8(" - ") + caption();
+  }
+
+  return s;
+}
+
+QPalette KApplication::createApplicationPalette()
+{
+    KConfig *config = KGlobal::config();
+    KConfigGroupSaver saver( config, "General" );
+    return createApplicationPalette( config, KGlobalSettings::contrast() );
+}
+
+QPalette KApplication::createApplicationPalette( KConfig *config, int contrast_ )
+{
+    QColor kde31Background( 238, 238, 230 );
+    QColor kde31Beige( 255,221,118 );
+
+    QColor kde31Button;
+    if ( QPixmap::defaultDepth() > 8 )
+      kde31Button.setRgb( 238, 234, 222 );
+    else
+      kde31Button.setRgb( 220, 220, 220 );
+
+    QColor kde31Link( 0, 0, 192 );
+    QColor kde31VisitedLink( 128, 0,128 );
+
+    QColor background = config->readColorEntry( "background", &kde31Background );
+    QColor foreground = config->readColorEntry( "foreground", &black );
+    QColor button = config->readColorEntry( "buttonBackground", &kde31Button );
+    QColor buttonText = config->readColorEntry( "buttonForeground", &foreground );
+    QColor highlight = config->readColorEntry( "selectBackground", &kde31Beige );
+    QColor highlightedText = config->readColorEntry( "selectForeground", &black );
+    QColor base = config->readColorEntry( "windowBackground", &white );
+    QColor baseText = config->readColorEntry( "windowForeground", &black );
+    QColor link = config->readColorEntry( "linkColor", &kde31Link );
+    QColor visitedLink = config->readColorEntry( "visitedLinkColor", &kde31VisitedLink );
+
+    int highlightVal, lowlightVal;
+    highlightVal = 100 + (2*contrast_+4)*16/10;
+    lowlightVal = 100 + (2*contrast_+4)*10;
+
+    QColor disfg = foreground;
+
+    int h, s, v;
+    disfg.hsv( &h, &s, &v );
+    if (v > 128)
+
+        disfg = disfg.dark(lowlightVal);
+    else if (disfg != black)
+
+        disfg = disfg.light(highlightVal);
+    else
+
+        disfg = Qt::darkGray;
+
+
+    QColorGroup disabledgrp(disfg, background,
+                            background.light(highlightVal),
+                            background.dark(lowlightVal),
+                            background.dark(120),
+                            background.dark(120), base);
+
+    QColorGroup colgrp(foreground, background, background.light(highlightVal),
+                       background.dark(lowlightVal),
+                       background.dark(120),
+                       baseText, base);
+
+    int inlowlightVal = lowlightVal-25;
+    if(inlowlightVal < 120)
+        inlowlightVal = 120;
+
+    colgrp.setColor(QColorGroup::Highlight, highlight);
+    colgrp.setColor(QColorGroup::HighlightedText, highlightedText);
+    colgrp.setColor(QColorGroup::Button, button);
+    colgrp.setColor(QColorGroup::ButtonText, buttonText);
+    colgrp.setColor(QColorGroup::Midlight, background.light(110));
+    colgrp.setColor(QColorGroup::Link, link);
+    colgrp.setColor(QColorGroup::LinkVisited, visitedLink);
+
+    disabledgrp.setColor(QColorGroup::Button, button);
+
+    QColor disbtntext = buttonText;
+    disbtntext.hsv( &h, &s, &v );
+    if (v > 128)
+
+        disbtntext = disbtntext.dark(lowlightVal);
+    else if (disbtntext != black)
+
+        disbtntext = disbtntext.light(highlightVal);
+    else
+
+        disbtntext = Qt::darkGray;
+
+    disabledgrp.setColor(QColorGroup::ButtonText, disbtntext);
+    disabledgrp.setColor(QColorGroup::Midlight, background.light(110));
+    disabledgrp.setColor(QColorGroup::Highlight, highlight.dark(120));
+    disabledgrp.setColor(QColorGroup::Link, link);
+    disabledgrp.setColor(QColorGroup::LinkVisited, visitedLink);
+
+    return QPalette(colgrp, disabledgrp, colgrp);
+}
+
+
+void KApplication::kdisplaySetPalette()
+{
+    QApplication::setPalette( createApplicationPalette(), true);
+    kdisplayPaletteChanged();
+    appearanceChanged();
+}
+
+
+void KApplication::kdisplaySetFont()
+{
+    QApplication::setFont(KGlobalSettings::generalFont(), true);
+    QApplication::setFont(KGlobalSettings::menuFont(), true, "QMenuBar");
+    QApplication::setFont(KGlobalSettings::menuFont(), true, "QPopupMenu");
+    QApplication::setFont(KGlobalSettings::menuFont(), true, "KPopupTitle");
+
+
+    QStyleSheet* sheet = QStyleSheet::defaultSheet();
+    sheet->item ("pre")->setFontFamily (KGlobalSettings::fixedFont().family());
+    sheet->item ("code")->setFontFamily (KGlobalSettings::fixedFont().family());
+    sheet->item ("tt")->setFontFamily (KGlobalSettings::fixedFont().family());
+
+    kdisplayFontChanged();
+    appearanceChanged();
+}
+
+
+void KApplication::kdisplaySetStyle()
+{
+    if (useStyles)
+    {
+        applyGUIStyle();
+        kdisplayStyleChanged();
+        appearanceChanged();
+    }
+}
+
+
+void KApplication::propagateSettings(SettingsCategory arg)
+{
+    KConfigBase* config = KGlobal::config();
+    KConfigGroupSaver saver( config, "KDE" );
+
+    int num = config->readNumEntry("CursorBlinkRate", QApplication::cursorFlashTime());
+    if (num < 200)
+        num = 200;
+    if (num > 2000)
+        num = 2000;
+    QApplication::setCursorFlashTime(num);
+    num = config->readNumEntry("DoubleClickInterval", QApplication::doubleClickInterval());
+    QApplication::setDoubleClickInterval(num);
+    num = config->readNumEntry("StartDragTime", QApplication::startDragTime());
+    QApplication::setStartDragTime(num);
+    num = config->readNumEntry("StartDragDist", QApplication::startDragDistance());
+    QApplication::setStartDragDistance(num);
+    num = config->readNumEntry("WheelScrollLines", QApplication::wheelScrollLines());
+    QApplication::setWheelScrollLines(num);
+
+    bool b = config->readBoolEntry("EffectAnimateMenu", false);
+    QApplication::setEffectEnabled( Qt::UI_AnimateMenu, b);
+    b = config->readBoolEntry("EffectFadeMenu", false);
+    QApplication::setEffectEnabled( Qt::UI_FadeMenu, b);
+    b = config->readBoolEntry("EffectAnimateCombo", false);
+    QApplication::setEffectEnabled( Qt::UI_AnimateCombo, b);
+    b = config->readBoolEntry("EffectAnimateTooltip", false);
+    QApplication::setEffectEnabled( Qt::UI_AnimateTooltip, b);
+    b = config->readBoolEntry("EffectFadeTooltip", false);
+    QApplication::setEffectEnabled( Qt::UI_FadeTooltip, b);
+    b = !config->readBoolEntry("EffectNoTooltip", false);
+    QToolTip::setGloballyEnabled( b );
+
+    settingsChanged(arg);
+}
+
+void KApplication::installKDEPropertyMap()
+{
+
+
+
+
+
+
+
+    QSqlPropertyMap *kdeMap = new QSqlPropertyMap;
+    kdeMap->insert( "KColorButton", "color" );
+    kdeMap->insert( "KComboBox", "currentItem" );
+    kdeMap->insert( "KDatePicker", "date" );
+    kdeMap->insert( "KEditListBox", "currentItem" );
+    kdeMap->insert( "KFontCombo", "family" );
+    kdeMap->insert( "KFontRequester", "font" );
+    kdeMap->insert( "KFontChooser", "font" );
+    kdeMap->insert( "KHistoryCombo", "currentItem" );
+    kdeMap->insert( "KListBox", "currentItem" );
+    kdeMap->insert( "KLineEdit", "text" );
+    kdeMap->insert( "KRestrictedLine", "text" );
+    kdeMap->insert( "KSqueezedTextLabel", "text" );
+    kdeMap->insert( "KTextBrowser", "source" );
+    kdeMap->insert( "KTextEdit", "text" );
+    kdeMap->insert( "KURLRequester", "url" );
+    kdeMap->insert( "KPasswordEdit", "password" );
+    kdeMap->insert( "KIntNumInput", "value" );
+    kdeMap->insert( "KIntSpinBox", "value" );
+    kdeMap->insert( "KDoubleNumInput", "value" );
+
+
+
+
+
+      kdeMap->insert( "QTabWidget", "currentPage" );
+
+    QSqlPropertyMap::installDefaultMap( kdeMap );
+
+}
+
+void KApplication::invokeHelp( const QString& anchor,
+                               const QString& _appname) const
+{
+   QString url;
+   QString appname;
+   if (_appname.isEmpty())
+     appname = name();
+   else
+     appname = _appname;
+
+   if (!anchor.isEmpty())
+     url = QString("help:/%1?anchor=%2").arg(appname).arg(anchor);
+   else
+     url = QString("help:/%1/index.html").arg(appname);
+
+   QString error;
+   if ( !dcopClient()->isApplicationRegistered("khelpcenter") )
+   {
+       if (startServiceByDesktopName("khelpcenter", url, &error, 0, 0, "", true))
+       {
+           kdWarning() << "Could not launch help:\n" << error << endl;
+           return;
+       }
+   }
+   else
+       DCOPRef( "khelpcenter", "KHelpCenterIface" ).send( "openURL", url );
+}
+
+void KApplication::invokeHTMLHelp( const QString& _filename, const QString& topic ) const
+{
+   kdWarning() << "invoking HTML help is deprecated! use docbook and invokeHelp!\n";
+
+   QString filename;
+
+   if( _filename.isEmpty() )
+     filename = QString(name()) + "/index.html";
+   else
+     filename = _filename;
+
+   QString url;
+   if (!topic.isEmpty())
+     url = QString("help:/%1#%2").arg(filename).arg(topic);
+   else
+     url = QString("help:/%1").arg(filename);
+
+   QString error;
+   if ( !dcopClient()->isApplicationRegistered("khelpcenter") )
+   {
+       if (startServiceByDesktopName("khelpcenter", url, &error, 0, 0, "", true))
+       {
+           kdWarning() << "Could not launch help:\n" << error << endl;
+           return;
+       }
+   }
+   else
+       DCOPRef( "khelpcenter", "KHelpCenterIface" ).send( "openURL", url );
+}
+
+
+void KApplication::invokeMailer(const QString &address, const QString &subject)
+{
+   invokeMailer(address, QString::null, QString::null, subject, QString::null, QString::null, QStringList());
+}
+
+void KApplication::invokeMailer(const KURL &mailtoURL)
+{
+   QString address = KURL::decode_string(mailtoURL.path()), subject, cc, bcc, body, attach;
+   QStringList queries = QStringList::split('&', mailtoURL.query().mid(1));
+   for (QStringList::Iterator it = queries.begin(); it != queries.end(); ++it)
+   {
+     QString q = (*it).lower();
+     if (q.startsWith("subject="))
+       subject = KURL::decode_string((*it).mid(8));
+     else
+     if (q.startsWith("cc="))
+       cc = KURL::decode_string((*it).mid(3));
+     else
+     if (q.startsWith("bcc="))
+       bcc = KURL::decode_string((*it).mid(4));
+     else
+     if (q.startsWith("body="))
+       body = KURL::decode_string((*it).mid(5));
+
+
+
+   }
+
+   invokeMailer( address, cc, bcc, subject, body, QString::null, QStringList() );
+}
+
+void KApplication::invokeMailer(const QString &to, const QString &cc, const QString &bcc,
+                                const QString &subject, const QString &body,
+                                const QString & , const QStringList &attachURLs)
+{
+   KConfig config("emaildefaults");
+   config.setGroup( QString::fromLatin1("PROFILE_Default") );
+   QString command = config.readPathEntry("EmailClient");
+
+   if (command.isEmpty() || command == QString::fromLatin1("kmail")
+       || command.endsWith("/kmail"))
+     command = QString::fromLatin1("kmail --composer -s %s -c %c -b %b --body %B --attach %A %t");
+
+
+
+
+
+
+   if (config.readBoolEntry("TerminalClient", false))
+      command = "konsole -e " + command;
+
+   QStringList cmdTokens = KShell::splitArgs(command);
+   QString cmd = cmdTokens[0];
+   cmdTokens.remove(cmdTokens.begin());
+
+   QMap<QChar, QString> keyMap;
+   keyMap.insert('t', to);
+   keyMap.insert('s', subject);
+   keyMap.insert('c', cc);
+   keyMap.insert('b', bcc);
+   keyMap.insert('B', body);
+
+   for (QStringList::Iterator it = cmdTokens.begin(); it != cmdTokens.end(); )
+   {
+     if (*it == "%A")
+     {
+         if (it == cmdTokens.begin())
+             continue;
+         QStringList::ConstIterator urlit = attachURLs.begin();
+         QStringList::ConstIterator urlend = attachURLs.end();
+         if ( urlit != urlend )
+         {
+             QStringList::Iterator previt = it;
+             --previt;
+             *it = *urlit;
+             ++it;
+             while ( ++urlit != urlend )
+             {
+                 cmdTokens.insert( it, *previt );
+                 cmdTokens.insert( it, *urlit );
+             }
+         } else {
+             --it;
+             it = cmdTokens.remove( cmdTokens.remove( it ) );
+         }
+     } else {
+         *it = KMacroExpander::expandMacros(*it, keyMap);
+         ++it;
+     }
+   }
+
+   QString error;
+   if (kdeinitExec(cmd, cmdTokens, &error))
+      kdWarning() << "Could not launch mail client:\n" << error << endl;
+}
+
+
+void KApplication::invokeBrowser( const QString &url )
+{
+   QString error;
+
+   if (startServiceByDesktopName("kfmclient", url, &error, 0, 0, "", true))
+   {
+      kdWarning() << "Could not launch browser:\n" << error << endl;
+      return;
+   }
+}
+
+void KApplication::cut()
+{
+  invokeEditSlot( "1""cut()" );
+}
+
+void KApplication::copy()
+{
+  invokeEditSlot( "1""copy()" );
+}
+
+void KApplication::paste()
+{
+  invokeEditSlot( "1""paste()" );
+}
+
+void KApplication::clear()
+{
+  invokeEditSlot( "1""clear()" );
+}
+
+void KApplication::selectAll()
+{
+  invokeEditSlot( "1""selectAll()" );
+}
+
+QCString
+KApplication::launcher()
+{
+   return "klauncher";
+}
+
+static int
+startServiceInternal( const QCString &function,
+              const QString& _name, const QStringList &URLs,
+              QString *error, QCString *dcopService, int *pid, const QCString& startup_id, bool noWait )
+{
+   struct serviceResult
+   {
+      int result;
+      QCString dcopName;
+      QString error;
+      pid_t pid;
+   };
+
+
+   DCOPClient *dcopClient;
+   if (KApplication::kApplication())
+      dcopClient = KApplication::kApplication()->dcopClient();
+   else
+      dcopClient = new DCOPClient;
+
+   if (!dcopClient->isAttached())
+   {
+      if (!dcopClient->attach())
+      {
+         if (error)
+            *error = i18n("Could not register with DCOP.\n");
+         return -1;
+      }
+   }
+   QByteArray params;
+   QDataStream stream(params, 0x0002);
+   stream << _name << URLs;
+   QCString replyType;
+   QByteArray replyData;
+   QCString _launcher = KApplication::launcher();
+   QValueList<QCString> envs;
+
+   if (qt_xdisplay()) {
+       QCString dpystring(XDisplayString(qt_xdisplay()));
+       envs.append( QCString("DISPLAY=") + dpystring );
+   } else if( getenv( "DISPLAY" )) {
+       QCString dpystring( getenv( "DISPLAY" ));
+       envs.append( QCString("DISPLAY=") + dpystring );
+   }
+
+   stream << envs;
+   if( !startup_id.isNull())
+       stream << startup_id << noWait;
+
+   if (!dcopClient->call(_launcher, _launcher,
+        function, params, replyType, replyData))
+   {
+        if (error)
+           *error = i18n("KLauncher could not be reached via DCOP.\n");
+        if (!KApplication::kApplication())
+           delete dcopClient;
+        return -1;
+   }
+   if (!KApplication::kApplication())
+      delete dcopClient;
+
+   if (noWait)
+      return 0;
+
+   QDataStream stream2(replyData, 0x0001);
+   serviceResult result;
+   stream2 >> result.result >> result.dcopName >> result.error >> result.pid;
+   if (dcopService)
+      *dcopService = result.dcopName;
+   if (error)
+      *error = result.error;
+   if (pid)
+      *pid = result.pid;
+   return result.result;
+}
+
+int
+KApplication::startServiceByName( const QString& _name, const QString &URL,
+                  QString *error, QCString *dcopService, int *pid, const QCString& startup_id, bool noWait )
+{
+   QStringList URLs;
+   if (!URL.isEmpty())
+      URLs.append(URL);
+   return startServiceInternal(
+                      "start_service_by_name(QString,QStringList,QValueList<QCString>,QCString,bool)",
+                      _name, URLs, error, dcopService, pid, startup_id, noWait);
+}
+
+int
+KApplication::startServiceByName( const QString& _name, const QStringList &URLs,
+                  QString *error, QCString *dcopService, int *pid, const QCString& startup_id, bool noWait )
+{
+   return startServiceInternal(
+                      "start_service_by_name(QString,QStringList,QValueList<QCString>,QCString,bool)",
+                      _name, URLs, error, dcopService, pid, startup_id, noWait);
+}
+
+int
+KApplication::startServiceByDesktopPath( const QString& _name, const QString &URL,
+                  QString *error, QCString *dcopService, int *pid, const QCString& startup_id, bool noWait )
+{
+   QStringList URLs;
+   if (!URL.isEmpty())
+      URLs.append(URL);
+   return startServiceInternal(
+                      "start_service_by_desktop_path(QString,QStringList,QValueList<QCString>,QCString,bool)",
+                      _name, URLs, error, dcopService, pid, startup_id, noWait);
+}
+
+int
+KApplication::startServiceByDesktopPath( const QString& _name, const QStringList &URLs,
+                  QString *error, QCString *dcopService, int *pid, const QCString& startup_id, bool noWait )
+{
+   return startServiceInternal(
+                      "start_service_by_desktop_path(QString,QStringList,QValueList<QCString>,QCString,bool)",
+                      _name, URLs, error, dcopService, pid, startup_id, noWait);
+}
+
+int
+KApplication::startServiceByDesktopName( const QString& _name, const QString &URL,
+                  QString *error, QCString *dcopService, int *pid, const QCString& startup_id, bool noWait )
+{
+   QStringList URLs;
+   if (!URL.isEmpty())
+      URLs.append(URL);
+   return startServiceInternal(
+                      "start_service_by_desktop_name(QString,QStringList,QValueList<QCString>,QCString,bool)",
+                      _name, URLs, error, dcopService, pid, startup_id, noWait);
+}
+
+int
+KApplication::startServiceByDesktopName( const QString& _name, const QStringList &URLs,
+                  QString *error, QCString *dcopService, int *pid, const QCString& startup_id, bool noWait )
+{
+   return startServiceInternal(
+                      "start_service_by_desktop_name(QString,QStringList,QValueList<QCString>,QCString,bool)",
+                      _name, URLs, error, dcopService, pid, startup_id, noWait);
+}
+
+int
+KApplication::kdeinitExec( const QString& name, const QStringList &args,
+                           QString *error, int *pid )
+{
+   return startServiceInternal("kdeinit_exec(QString,QStringList,QValueList<QCString>)",
+        name, args, error, 0, pid, QCString(), false);
+}
+
+int
+KApplication::kdeinitExecWait( const QString& name, const QStringList &args,
+                           QString *error, int *pid )
+{
+   return startServiceInternal("kdeinit_exec_wait(QString,QStringList,QValueList<QCString>)",
+        name, args, error, 0, pid, QCString(), false);
+}
+
+QString KApplication::tempSaveName( const QString& pFilename ) const
+{
+  QString aFilename;
+
+  if( pFilename[0] != '/' )
+    {
+      kdWarning(101) << "Relative filename passed to KApplication::tempSaveName" << endl;
+      aFilename = QFileInfo( QDir( "." ), pFilename ).absFilePath();
+    }
+  else
+    aFilename = pFilename;
+
+  QDir aAutosaveDir( QDir::homeDirPath() + "/autosave/" );
+  if( !aAutosaveDir.exists() )
+    {
+      if( !aAutosaveDir.mkdir( aAutosaveDir.absPath() ) )
+        {
+
+          aAutosaveDir.setPath( KGlobal::dirs()->saveLocation("tmp") );
+        }
+    }
+
+  aFilename.replace( "/", "\\!" ).prepend( "#" ).append( "#" ).prepend( "/" ).prepend( aAutosaveDir.absPath() );
+
+  return aFilename;
+}
+
+
+QString KApplication::checkRecoverFile( const QString& pFilename,
+        bool& bRecover ) const
+{
+  QString aFilename;
+
+  if( pFilename[0] != '/' )
+    {
+      kdWarning(101) << "Relative filename passed to KApplication::tempSaveName" << endl;
+      aFilename = QFileInfo( QDir( "." ), pFilename ).absFilePath();
+    }
+  else
+    aFilename = pFilename;
+
+  QDir aAutosaveDir( QDir::homeDirPath() + "/autosave/" );
+  if( !aAutosaveDir.exists() )
+    {
+      if( !aAutosaveDir.mkdir( aAutosaveDir.absPath() ) )
+        {
+
+          aAutosaveDir.setPath( KGlobal::dirs()->saveLocation("tmp") );
+        }
+    }
+
+  aFilename.replace( "/", "\\!" ).prepend( "#" ).append( "#" ).prepend( "/" ).prepend( aAutosaveDir.absPath() );
+
+  if( QFile( aFilename ).exists() )
+    {
+      bRecover = true;
+      return aFilename;
+    }
+  else
+    {
+      bRecover = false;
+      return pFilename;
+    }
+}
+
+
+bool checkAccess(const QString& pathname, int mode)
+{
+  int accessOK = access( QFile::encodeName(pathname), mode );
+  if ( accessOK == 0 )
+    return true;
+
+
+
+
+  if ( (mode & 2) == 0 )
+    return false;
+
+
+  if (!access( QFile::encodeName(pathname), 0))
+      return false;
+
+
+  QString dirName(pathname);
+  int pos = dirName.findRev('/');
+  if ( pos == -1 )
+    return false;
+  else if ( pos == 0 )
+      pos = 1;
+
+  dirName.truncate(pos);
+
+  accessOK = access( QFile::encodeName(dirName), 2 );
+
+  if ( accessOK == 0 )
+    return true;
+  else
+    return false;
+}
+
+void KApplication::setTopWidget( QWidget *topWidget )
+{
+  if( topWidget != 0 )
+  {
+
+    Window leader = topWidget->winId();
+    char* argv = const_cast< char* >( KCmdLineArgs::appName());
+    XSetCommand(display, leader, &argv, 1);
+
+    XWMHints *hints = XGetWMHints(display, topWidget->winId());
+    if (hints)
+    {
+        if (!(hints->flags & (1L << 6)))
+        {
+            hints->window_group = leader;
+            hints->flags |= (1L << 6);
+        }
+        if (!(hints->flags & (1L << 0)))
+        {
+            hints->input = 1;
+            hints->flags |= (1L << 0);
+        }
+        XSetWMHints(display, topWidget->winId(), hints);
+        XFree(reinterpret_cast<char *>(hints));
+    }
+
+
+
+    if ( !topWidget->inherits("KMainWindow") ) {
+        topWidget->setCaption( caption() );
+
+
+        NETWinInfo info(qt_xdisplay(), topWidget->winId(), qt_xrootwin(), NET::WMName );
+        info.setName( caption().utf8().data() );
+
+    }
+
+
+    topWidget->setIcon( icon() );
+
+
+    KWin::setIcons(topWidget->winId(), icon(), miniIcon() );
+
+
+    KStartupInfo::setWindowStartupId( topWidget->winId(), startupId());
+
+  }
+}
+
+QCString KApplication::startupId() const
+{
+    return d->startup_id;
+}
+
+void KApplication::setStartupId( const QCString& startup_id )
+{
+    if( startup_id.isEmpty())
+        d->startup_id = "0";
+    else
+        d->startup_id = startup_id;
+}
+
+
+
+void KApplication::read_app_startup_id()
+{
+
+    KStartupInfoId id = KStartupInfo::currentStartupIdEnv();
+    KStartupInfo::resetStartupEnv();
+    d->startup_id = id.id();
+
+}
+
+int KApplication::random()
+{
+   static int init = false;
+   if (!init)
+   {
+      unsigned int seed;
+      init = true;
+      int fd = open("/dev/urandom", 00);
+      if (fd <= 0 || ::read(fd, &seed, sizeof(seed)) != sizeof(seed))
+      {
+
+            srand(getpid());
+            seed = rand()+time(0);
+      }
+      if (fd >= 0) close(fd);
+      srand(seed);
+   }
+   return rand();
+}
+
+QString KApplication::randomString(int length)
+{
+   if (length <=0 ) return QString::null;
+
+   QString str;
+   while (length--)
+   {
+      int r=random() % 62;
+      r+=48;
+      if (r>57) r+=7;
+      if (r>90) r+=6;
+      str += char(r);
+
+   }
+   return str;
+}
+
+bool KApplication::authorize(const QString &genericAction)
+{
+   if (!d->actionRestrictions)
+      return true;
+
+   KConfig *config = KGlobal::config();
+   KConfigGroupSaver saver( config, "KDE Action Restrictions" );
+   return config->readBoolEntry(genericAction, true);
+}
+
+bool KApplication::authorizeKAction(const char *action)
+{
+   if (!d->actionRestrictions || !action)
+      return true;
+
+   static const QString &action_prefix = KGlobal::staticQString( "action/" );
+
+   return authorize(action_prefix + action);
+}
+
+void KApplication::initUrlActionRestrictions()
+{
+  d->urlActionRestrictions.setAutoDelete(true);
+  d->urlActionRestrictions.clear();
+  d->urlActionRestrictions.append( new KApplicationPrivate::URLActionRule
+  ("open", QString::null, QString::null, QString::null, QString::null, QString::null, QString::null, true));
+  d->urlActionRestrictions.append( new KApplicationPrivate::URLActionRule
+  ("list", QString::null, QString::null, QString::null, QString::null, QString::null, QString::null, true));
+
+
+
+
+
+  d->urlActionRestrictions.append( new KApplicationPrivate::URLActionRule
+  ("link", QString::null, QString::null, QString::null, ":internet", QString::null, QString::null, true));
+  d->urlActionRestrictions.append( new KApplicationPrivate::URLActionRule
+  ("redirect", QString::null, QString::null, QString::null, ":internet", QString::null, QString::null, true));
+
+
+
+  d->urlActionRestrictions.append( new KApplicationPrivate::URLActionRule
+  ("redirect", QString::null, QString::null, QString::null, "file", QString::null, QString::null, true));
+  d->urlActionRestrictions.append( new KApplicationPrivate::URLActionRule
+  ("redirect", ":internet", QString::null, QString::null, "file", QString::null, QString::null, false));
+
+
+  d->urlActionRestrictions.append( new KApplicationPrivate::URLActionRule
+  ("redirect", ":local", QString::null, QString::null, QString::null, QString::null, QString::null, true));
+
+
+  d->urlActionRestrictions.append( new KApplicationPrivate::URLActionRule
+  ("redirect", QString::null, QString::null, QString::null, "about", QString::null, QString::null, true));
+
+
+  d->urlActionRestrictions.append( new KApplicationPrivate::URLActionRule
+  ("redirect", QString::null, QString::null, QString::null, "=", QString::null, QString::null, true));
+
+  KConfig *config = KGlobal::config();
+  KConfigGroupSaver saver( config, "KDE URL Restrictions" );
+  int count = config->readNumEntry("rule_count");
+  QString keyFormat = QString("rule_%1");
+  for(int i = 1; i <= count; i++)
+  {
+    QString key = keyFormat.arg(i);
+    QStringList rule = config->readListEntry(key);
+    if (rule.count() != 8)
+      continue;
+    QString action = rule[0];
+    QString refProt = rule[1];
+    QString refHost = rule[2];
+    QString refPath = rule[3];
+    QString urlProt = rule[4];
+    QString urlHost = rule[5];
+    QString urlPath = rule[6];
+    QString strEnabled = rule[7].lower();
+
+    bool bEnabled = (strEnabled == "true");
+
+    if (refPath.startsWith("$HOME"))
+       refPath.replace(0, 5, QDir::homeDirPath());
+    else if (refPath.startsWith("~"))
+       refPath.replace(0, 1, QDir::homeDirPath());
+    if (urlPath.startsWith("$HOME"))
+       urlPath.replace(0, 5, QDir::homeDirPath());
+    else if (urlPath.startsWith("~"))
+       urlPath.replace(0, 1, QDir::homeDirPath());
+
+    if (refPath.startsWith("$TMP"))
+       refPath.replace(0, 4, KGlobal::dirs()->saveLocation("tmp"));
+    if (urlPath.startsWith("$TMP"))
+       urlPath.replace(0, 4, KGlobal::dirs()->saveLocation("tmp"));
+
+    d->urlActionRestrictions.append(new KApplicationPrivate::URLActionRule
+        ( action, refProt, refHost, refPath, urlProt, urlHost, urlPath, bEnabled));
+  }
+}
+
+bool KApplication::authorizeURLAction(const QString &action, const KURL &_baseURL, const KURL &_destURL)
+{
+  bool result = false;
+  if (d->urlActionRestrictions.isEmpty())
+     initUrlActionRestrictions();
+
+  KURL baseURL(_baseURL);
+  baseURL.setPath(QDir::cleanDirPath(baseURL.path()));
+  QString baseClass = KProtocolInfo::protocolClass(baseURL.protocol());
+  KURL destURL(_destURL);
+  destURL.setPath(QDir::cleanDirPath(destURL.path()));
+  QString destClass = KProtocolInfo::protocolClass(destURL.protocol());
+
+  for(KApplicationPrivate::URLActionRule *rule = d->urlActionRestrictions.first();
+      rule; rule = d->urlActionRestrictions.next())
+  {
+     if ((result != rule->permission) &&
+         (action == rule->action) &&
+         rule->baseMatch(baseURL, baseClass) &&
+         rule->destMatch(destURL, destClass, baseURL, baseClass))
+     {
+        result = rule->permission;
+     }
+  }
+  return result;
+}
+
+
+uint KApplication::keyboardModifiers()
+{
+    Window root;
+    Window child;
+    int root_x, root_y, win_x, win_y;
+    uint keybstate;
+    XQueryPointer( qt_xdisplay(), qt_xrootwin(), &root, &child,
+                   &root_x, &root_y, &win_x, &win_y, &keybstate );
+    return keybstate & 0x00ff;
+}
+
+uint KApplication::mouseState()
+{
+    Window root;
+    Window child;
+    int root_x, root_y, win_x, win_y;
+    uint keybstate;
+    XQueryPointer( qt_xdisplay(), qt_xrootwin(), &root, &child,
+                   &root_x, &root_y, &win_x, &win_y, &keybstate );
+    return keybstate & 0xff00;
+}
+
+void KApplication::installSigpipeHandler()
+{
+    struct sigaction act;
+    act.__sigaction_handler.sa_handler = sigpipeHandler;
+    sigemptyset( &act.sa_mask );
+    act.sa_flags = 0;
+    sigaction( 13, &act, 0 );
+}
+
+void KApplication::sigpipeHandler(int)
+{
+    int saved_errno = (*__errno_location ());
+
+
+    char msg[1000];
+    sprintf(msg, "*** SIGPIPE *** (ignored, pid = %ld)\n", (long) getpid());
+    write(2, msg, strlen(msg));
+
+
+
+    (*__errno_location ()) = saved_errno;
+}
+
+void KApplication::virtual_hook( int id, void* data )
+{ KInstance::virtual_hook( id, data ); }
+
+void KSessionManaged::virtual_hook( int, void* )
+{ }
+
+
+
+
+struct QUuid
+{
+    QUuid()
+    {
+        memset( this, 0, sizeof(QUuid) );
+    }
+    QUuid( uint l, ushort w1, ushort w2, uchar b1, uchar b2, uchar b3, uchar b4, uchar b5, uchar b6, uchar b7, uchar b8 )
+    {
+        data1 = l;
+        data2 = w1;
+        data3 = w2;
+        data4[0] = b1;
+        data4[1] = b2;
+        data4[2] = b3;
+        data4[3] = b4;
+        data4[4] = b5;
+        data4[5] = b6;
+        data4[6] = b7;
+        data4[7] = b8;
+    }
+    QUuid( const QUuid &uuid )
+    {
+        memcpy( this, &uuid, sizeof(QUuid) );
+    }
+
+    QUuid( const QString & );
+    QUuid( const char * );
+    QString toString() const;
+    operator QString() const { return toString(); }
+
+    bool isNull() const;
+
+    QUuid &operator=(const QUuid &orig )
+    {
+        memcpy( this, &orig, sizeof(QUuid) );
+        return *this;
+    }
+
+    bool operator==(const QUuid &orig ) const
+    {
+        uint i;
+        if ( data1 != orig.data1 || data2 != orig.data2 ||
+             data3 != orig.data3 )
+            return FALSE;
+
+        for( i = 0; i < 8; i++ )
+            if ( data4[i] != orig.data4[i] )
+                return FALSE;
+
+        return TRUE;
+    }
+
+    bool operator!=(const QUuid &orig ) const
+    {
+        return !( *this == orig );
+    }
+    uint data1;
+    ushort data2;
+    ushort data3;
+    uchar data4[ 8 ];
+};
+
+
+ QDataStream &operator<<( QDataStream &, const QUuid & );
+ QDataStream &operator>>( QDataStream &, QUuid & );
+
+
+
+
+
+
+struct QUObject;
+struct QUInterfaceDescription;
+struct QUnknownInterface;
+struct QDispatchInterface;
+
+
+struct QUBuffer
+{
+    virtual long read( char *data, ulong maxlen ) = 0;
+    virtual long write( const char *data, ulong len ) = 0;
+};
+
+
+
+struct QUType
+{
+    virtual const QUuid *uuid() const = 0;
+    virtual const char *desc() const = 0;
+
+
+    virtual bool canConvertFrom( QUObject *, QUType * ) = 0;
+
+    virtual bool canConvertTo( QUObject *, QUType * ) = 0;
+
+
+    virtual bool convertFrom( QUObject *, QUType * ) = 0;
+
+    virtual bool convertTo( QUObject *, QUType * ) = 0;
+
+    virtual void clear( QUObject * ) = 0;
+
+    virtual int serializeTo( QUObject *, QUBuffer * ) = 0;
+    virtual int serializeFrom( QUObject *, QUBuffer * ) = 0;
+
+    static bool isEqual( const QUType *t1, const QUType *t2 );
+    static bool check( QUObject* o, QUType* t );
+};
+
+
+
+extern const QUuid TID_QUType_Null;
+struct QUType_Null : public QUType
+{
+    const QUuid *uuid() const;
+    const char *desc() const;
+
+    bool canConvertFrom( QUObject *, QUType * );
+    bool canConvertTo( QUObject *, QUType * );
+    bool convertFrom( QUObject *, QUType * );
+    bool convertTo( QUObject *, QUType * );
+    void clear( QUObject * );
+    int serializeTo( QUObject *, QUBuffer * );
+    int serializeFrom( QUObject *, QUBuffer * );
+};
+extern QUType_Null static_QUType_Null;
+
+
+
+struct QUObject
+{
+public:
+    QUObject() : type( &static_QUType_Null ) {}
+    ~QUObject() { type->clear( this ); }
+
+    QUType *type;
+
+
+    union
+    {
+        bool b;
+
+        char c;
+        short s;
+        int i;
+        long l;
+
+        unsigned char uc;
+        unsigned short us;
+        unsigned int ui;
+        unsigned long ul;
+
+        float f;
+        double d;
+
+        char byte[16];
+
+        struct {
+           char* data;
+           unsigned long size;
+        } bytearray;
+
+        void* ptr;
+
+        struct {
+            void *ptr;
+            bool owner;
+        } voidstar;
+
+        struct {
+            char *ptr;
+            bool owner;
+        } charstar;
+
+        struct {
+            char *ptr;
+            bool owner;
+        } utf8;
+
+        struct {
+            char *ptr;
+            bool owner;
+        } local8bit;
+
+        QUnknownInterface* iface;
+        QDispatchInterface* idisp;
+
+    } payload;
+
+};
+
+
+
+
+
+struct QUParameter
+{
+    const char* name;
+    QUType *type;
+    const void* typeExtra;
+    enum { In = 1, Out = 2, InOut = In | Out };
+    int inOut;
+};
+
+
+
+struct QUMethod
+{
+    const char* name;
+    int count;
+    const QUParameter* parameters;
+};
+
+
+struct QUProperty
+{
+    const char* name;
+    QUType* type;
+    const void* typeExtra;
+
+    int set;
+    int get;
+
+    int designable;
+    int stored;
+};
+
+
+
+struct QUInterfaceDescription
+{
+    int methodCount;
+    const QUMethod* methods;
+    int propertyCount;
+    const QUProperty* properties;
+};
+
+
+
+
+
+struct QUComponentDescription
+{
+    const char* name;
+    const char* vendor;
+    const char* release;
+    const char* info;
+    QUuid cid;
+    int count;
+    const QUuid* interfaces;
+};
+
+
+
+
+
+struct QUComponentServerDescription
+{
+    const char* name;
+    const char* vendor;
+    const char* release;
+    const char* info;
+    int count;
+    const QUComponentDescription* components;
+};
+
+
+
+struct QUEnumItem
+{
+    const char *key;
+    int value;
+};
+
+struct QUEnum
+{
+    const char *name;
+    unsigned int count;
+    const QUEnumItem *items;
+    bool set;
+};
+
+inline bool QUType::isEqual( const QUType *t1, const QUType *t2 ) {
+    return t1 == t2 || t1->uuid() == t2->uuid() ||
+        *(t1->uuid()) == *(t2->uuid());
+}
+
+inline bool QUType::check( QUObject* o, QUType* t ) {
+    return isEqual( o->type, t ) || t->convertFrom( o, o->type );
+}
+
+
+
+
+extern const QUuid TID_QUType_enum;
+struct QUType_enum : public QUType
+{
+    const QUuid *uuid() const;
+    const char *desc() const;
+
+    void set( QUObject *, int );
+    int &get( QUObject * o ) { return o->payload.i; }
+    bool canConvertFrom( QUObject *, QUType * );
+    bool canConvertTo( QUObject *, QUType * );
+    bool convertFrom( QUObject *, QUType * );
+    bool convertTo( QUObject *, QUType * );
+    void clear( QUObject * ) {}
+    int serializeTo( QUObject *, QUBuffer * );
+    int serializeFrom( QUObject *, QUBuffer * );
+};
+extern QUType_enum static_QUType_enum;
+
+
+
+extern const QUuid TID_QUType_ptr;
+struct QUType_ptr : public QUType
+{
+    const QUuid *uuid() const;
+    const char *desc() const;
+
+    void set( QUObject *, const void* );
+    void* &get( QUObject * o ) { return o->payload.ptr; }
+    bool canConvertFrom( QUObject *, QUType * );
+    bool canConvertTo( QUObject *, QUType * );
+    bool convertFrom( QUObject *, QUType * );
+    bool convertTo( QUObject *, QUType * );
+    void clear( QUObject * ) {}
+    int serializeTo( QUObject *, QUBuffer * );
+    int serializeFrom( QUObject *, QUBuffer * );
+};
+extern QUType_ptr static_QUType_ptr;
+
+
+extern const QUuid TID_QUType_iface;
+struct QUType_iface : public QUType
+{
+    const QUuid *uuid() const;
+    const char *desc() const;
+
+    void set( QUObject *, QUnknownInterface* );
+    QUnknownInterface* &get( QUObject *o ){ return o->payload.iface; }
+    bool canConvertFrom( QUObject *, QUType * );
+    bool canConvertTo( QUObject *, QUType * );
+    bool convertFrom( QUObject *, QUType * );
+    bool convertTo( QUObject *, QUType * );
+    void clear( QUObject * ) {}
+    int serializeTo( QUObject *, QUBuffer * );
+    int serializeFrom( QUObject *, QUBuffer * );
+};
+extern QUType_iface static_QUType_iface;
+
+
+extern const QUuid TID_QUType_idisp;
+struct QUType_idisp : public QUType
+{
+    const QUuid *uuid() const;
+    const char *desc() const;
+
+    void set( QUObject *, QDispatchInterface* );
+    QDispatchInterface* &get( QUObject *o ){ return o->payload.idisp; }
+    bool canConvertFrom( QUObject *, QUType * );
+    bool canConvertTo( QUObject *, QUType * );
+    bool convertFrom( QUObject *, QUType * );
+    bool convertTo( QUObject *, QUType * );
+    void clear( QUObject * ) {}
+    int serializeTo( QUObject *, QUBuffer * );
+    int serializeFrom( QUObject *, QUBuffer * );
+};
+extern QUType_idisp static_QUType_idisp;
+
+
+extern const QUuid TID_QUType_bool;
+struct QUType_bool : public QUType
+{
+    const QUuid *uuid() const;
+    const char *desc() const;
+
+    void set( QUObject *, bool );
+    bool &get( QUObject *o ) { return o->payload.b; }
+    bool canConvertFrom( QUObject *, QUType * );
+    bool canConvertTo( QUObject *, QUType * );
+    bool convertFrom( QUObject *, QUType * );
+    bool convertTo( QUObject *, QUType * );
+    void clear( QUObject * ) {}
+    int serializeTo( QUObject *, QUBuffer * );
+    int serializeFrom( QUObject *, QUBuffer * );
+};
+extern QUType_bool static_QUType_bool;
+
+
+extern const QUuid TID_QUType_int;
+struct QUType_int : public QUType
+{
+    const QUuid *uuid() const;
+    const char *desc() const;
+
+    void set( QUObject *, int );
+    int &get( QUObject *o ) { return o->payload.i; }
+    bool canConvertFrom( QUObject *, QUType * );
+    bool canConvertTo( QUObject *, QUType * );
+    bool convertFrom( QUObject *, QUType * );
+    bool convertTo( QUObject *, QUType * );
+    void clear( QUObject * ) {}
+    int serializeTo( QUObject *, QUBuffer * );
+    int serializeFrom( QUObject *, QUBuffer * );
+};
+extern QUType_int static_QUType_int;
+
+
+
+extern const QUuid TID_QUType_double;
+struct QUType_double : public QUType
+{
+    const QUuid *uuid() const;
+    const char *desc() const;
+
+    void set( QUObject *, double );
+    double &get( QUObject *o ) { return o->payload.d; }
+    bool canConvertFrom( QUObject *, QUType * );
+    bool canConvertTo( QUObject *, QUType * );
+    bool convertFrom( QUObject *, QUType * );
+    bool convertTo( QUObject *, QUType * );
+    void clear( QUObject * ) {}
+    int serializeTo( QUObject *, QUBuffer * );
+    int serializeFrom( QUObject *, QUBuffer * );
+};
+extern QUType_double static_QUType_double;
+
+
+
+extern const QUuid TID_QUType_charstar;
+struct QUType_charstar : public QUType
+{
+    const QUuid *uuid() const;
+    const char *desc() const;
+
+    void set( QUObject *, const char*, bool take = FALSE );
+    char* get( QUObject *o ){ return o->payload.charstar.ptr; }
+    bool canConvertFrom( QUObject *, QUType * );
+    bool canConvertTo( QUObject *, QUType * );
+    bool convertFrom( QUObject *, QUType * );
+    bool convertTo( QUObject *, QUType * );
+    void clear( QUObject * );
+    int serializeTo( QUObject *, QUBuffer * );
+    int serializeFrom( QUObject *, QUBuffer * );
+
+};
+extern QUType_charstar static_QUType_charstar;
+
+
+extern const QUuid TID_QUType_QString;
+
+struct QUType_QString : public QUType
+{
+    const QUuid *uuid() const;
+    const char *desc() const;
+
+    void set( QUObject *, const QString & );
+    QString &get( QUObject * o ) { return *(QString*)o->payload.ptr; }
+
+    bool canConvertFrom( QUObject *, QUType * );
+    bool canConvertTo( QUObject *, QUType * );
+    bool convertFrom( QUObject *, QUType * );
+    bool convertTo( QUObject *, QUType * );
+    void clear( QUObject * );
+    int serializeTo( QUObject *, QUBuffer * );
+    int serializeFrom( QUObject *, QUBuffer * );
+
+};
+extern QUType_QString static_QUType_QString;
+
+
+
+class QVariant;
+
+
+
+extern const QUuid TID_QUType_QVariant;
+
+struct QUType_QVariant : public QUType
+{
+    const QUuid *uuid() const;
+    const char *desc() const;
+
+    void set( QUObject *, const QVariant & );
+    QVariant &get( QUObject * o );
+
+    bool canConvertFrom( QUObject *, QUType * );
+    bool canConvertTo( QUObject *, QUType * );
+    bool convertFrom( QUObject *, QUType * );
+    bool convertTo( QUObject *, QUType * );
+    void clear( QUObject * );
+    int serializeTo( QUObject *, QUBuffer * );
+    int serializeFrom( QUObject *, QUBuffer * );
+};
+extern QUType_QVariant static_QUType_QVariant;
+
+
+
+
+extern const QUuid TID_QUType_varptr;
+struct QUType_varptr : public QUType
+{
+    const QUuid *uuid() const;
+    const char *desc() const;
+
+    void set( QUObject *, const void* );
+    void* &get( QUObject * o ) { return o->payload.ptr; }
+    bool canConvertFrom( QUObject *, QUType * );
+    bool canConvertTo( QUObject *, QUType * );
+    bool convertFrom( QUObject *, QUType * );
+    bool convertTo( QUObject *, QUType * );
+    void clear( QUObject * ) {}
+    int serializeTo( QUObject *, QUBuffer * );
+    int serializeFrom( QUObject *, QUBuffer * );
+};
+extern QUType_varptr static_QUType_varptr;
+
+
+
+
+
+
+const char *KApplication::className() const
+{
+    return "KApplication";
+}
+
+QMetaObject *KApplication::metaObj = 0;
+static QMetaObjectCleanUp cleanUp_KApplication( "KApplication", &KApplication::staticMetaObject );
+QMetaObject* KApplication::staticMetaObject()
+{
+    if ( metaObj )
+        return metaObj;
+    QMetaObject* parentObject = QApplication::staticMetaObject();
+    static const QUParameter param_slot_0[] = {
+        { "url", &static_QUType_QString, 0, QUParameter::In }
+    };
+    static const QUMethod slot_0 = {"invokeBrowser", 1, param_slot_0 };
+    static const QUMethod slot_1 = {"cut", 0, 0 };
+    static const QUMethod slot_2 = {"copy", 0, 0 };
+    static const QUMethod slot_3 = {"paste", 0, 0 };
+    static const QUMethod slot_4 = {"clear", 0, 0 };
+    static const QUMethod slot_5 = {"selectAll", 0, 0 };
+    static const QUMethod slot_6 = {"ref", 0, 0 };
+    static const QUMethod slot_7 = {"deref", 0, 0 };
+    static const QUParameter param_slot_8[] = {
+        { 0, &static_QUType_QString, 0, QUParameter::In }
+    };
+    static const QUMethod slot_8 = {"dcopFailure", 1, param_slot_8 };
+    static const QUParameter param_slot_9[] = {
+        { 0, &static_QUType_bool, 0, QUParameter::In }
+    };
+    static const QUMethod slot_9 = {"dcopBlockUserInput", 1, param_slot_9 };
+    static const QUMethod slot_10 = {"x11FilterDestroyed", 0, 0 };
+    static const QMetaData slot_tbl[] = {
+        { "invokeBrowser(const QString&)", &slot_0, QMetaData::Public },
+        { "cut()", &slot_1, QMetaData::Public },
+        { "copy()", &slot_2, QMetaData::Public },
+        { "paste()", &slot_3, QMetaData::Public },
+        { "clear()", &slot_4, QMetaData::Public },
+        { "selectAll()", &slot_5, QMetaData::Public },
+        { "ref()", &slot_6, QMetaData::Public },
+        { "deref()", &slot_7, QMetaData::Public },
+        { "dcopFailure(const QString&)", &slot_8, QMetaData::Private },
+        { "dcopBlockUserInput(bool)", &slot_9, QMetaData::Private },
+        { "x11FilterDestroyed()", &slot_10, QMetaData::Private }
+    };
+    static const QUMethod signal_0 = {"kdisplayPaletteChanged", 0, 0 };
+    static const QUMethod signal_1 = {"kdisplayStyleChanged", 0, 0 };
+    static const QUMethod signal_2 = {"kdisplayFontChanged", 0, 0 };
+    static const QUMethod signal_3 = {"appearanceChanged", 0, 0 };
+    static const QUParameter param_signal_4[] = {
+        { 0, &static_QUType_int, 0, QUParameter::In }
+    };
+    static const QUMethod signal_4 = {"toolbarAppearanceChanged", 1, param_signal_4 };
+    static const QUParameter param_signal_5[] = {
+        { "desk", &static_QUType_int, 0, QUParameter::In }
+    };
+    static const QUMethod signal_5 = {"backgroundChanged", 1, param_signal_5 };
+    static const QUParameter param_signal_6[] = {
+        { "category", &static_QUType_int, 0, QUParameter::In }
+    };
+    static const QUMethod signal_6 = {"settingsChanged", 1, param_signal_6 };
+    static const QUParameter param_signal_7[] = {
+        { "group", &static_QUType_int, 0, QUParameter::In }
+    };
+    static const QUMethod signal_7 = {"iconChanged", 1, param_signal_7 };
+    static const QUParameter param_signal_8[] = {
+        { "id", &static_QUType_int, 0, QUParameter::In },
+        { "data", &static_QUType_int, 0, QUParameter::In }
+    };
+    static const QUMethod signal_8 = {"kipcMessage", 2, param_signal_8 };
+    static const QUMethod signal_9 = {"saveYourself", 0, 0 };
+    static const QUMethod signal_10 = {"shutDown", 0, 0 };
+    static const QMetaData signal_tbl[] = {
+        { "kdisplayPaletteChanged()", &signal_0, QMetaData::Public },
+        { "kdisplayStyleChanged()", &signal_1, QMetaData::Public },
+        { "kdisplayFontChanged()", &signal_2, QMetaData::Public },
+        { "appearanceChanged()", &signal_3, QMetaData::Public },
+        { "toolbarAppearanceChanged(int)", &signal_4, QMetaData::Public },
+        { "backgroundChanged(int)", &signal_5, QMetaData::Public },
+        { "settingsChanged(int)", &signal_6, QMetaData::Public },
+        { "iconChanged(int)", &signal_7, QMetaData::Public },
+        { "kipcMessage(int,int)", &signal_8, QMetaData::Public },
+        { "saveYourself()", &signal_9, QMetaData::Public },
+        { "shutDown()", &signal_10, QMetaData::Public }
+    };
+    metaObj = QMetaObject::new_metaobject(
+        "KApplication", parentObject,
+        slot_tbl, 11,
+        signal_tbl, 11,
+
+        0, 0,
+        0, 0,
+
+        0, 0 );
+    cleanUp_KApplication.setMetaObject( metaObj );
+    return metaObj;
+}
+
+void* KApplication::qt_cast( const char* clname )
+{
+    if ( !qstrcmp( clname, "KApplication" ) )
+        return this;
+    if ( !qstrcmp( clname, "KInstance" ) )
+        return (KInstance*)this;
+    return QApplication::qt_cast( clname );
+}
+
+
+void KApplication::kdisplayPaletteChanged()
+{
+    activate_signal( staticMetaObject()->signalOffset() + 0 );
+}
+
+
+void KApplication::kdisplayStyleChanged()
+{
+    activate_signal( staticMetaObject()->signalOffset() + 1 );
+}
+
+
+void KApplication::kdisplayFontChanged()
+{
+    activate_signal( staticMetaObject()->signalOffset() + 2 );
+}
+
+
+void KApplication::appearanceChanged()
+{
+    activate_signal( staticMetaObject()->signalOffset() + 3 );
+}
+
+
+void KApplication::toolbarAppearanceChanged( int t0 )
+{
+    activate_signal( staticMetaObject()->signalOffset() + 4, t0 );
+}
+
+
+void KApplication::backgroundChanged( int t0 )
+{
+    activate_signal( staticMetaObject()->signalOffset() + 5, t0 );
+}
+
+
+void KApplication::settingsChanged( int t0 )
+{
+    activate_signal( staticMetaObject()->signalOffset() + 6, t0 );
+}
+
+
+void KApplication::iconChanged( int t0 )
+{
+    activate_signal( staticMetaObject()->signalOffset() + 7, t0 );
+}
+
+
+
+
+
+
+
+
+
+class QConnectionList : public QPtrList<QConnection>
+{
+public:
+    QConnectionList() : QPtrList<QConnection>() {}
+    QConnectionList( const QConnectionList &list ) : QPtrList<QConnection>(list) {}
+   ~QConnectionList() { clear(); }
+    QConnectionList &operator=(const QConnectionList &list)
+        { return (QConnectionList&)QPtrList<QConnection>::operator=(list); }
+};
+
+class QConnectionListIt : public QPtrListIterator<QConnection>
+{
+public:
+    QConnectionListIt( const QConnectionList &l ) : QPtrListIterator<QConnection>(l) {}
+    QConnectionListIt &operator=(const QConnectionListIt &i)
+        { return (QConnectionListIt&)QPtrListIterator<QConnection>::operator=(i); }
+};
+
+class QSignalVec : public QPtrVector<QConnectionList>
+{
+public:
+    QSignalVec(int size=17 )
+        : QPtrVector<QConnectionList>(size) {}
+    QSignalVec( const QSignalVec &dict )
+        : QPtrVector<QConnectionList>(dict) {}
+   ~QSignalVec() { clear(); }
+    QSignalVec &operator=(const QSignalVec &dict)
+        { return (QSignalVec&)QPtrVector<QConnectionList>::operator=(dict); }
+    QConnectionList* at( uint index ) const {
+        return index >= size()? 0 : QPtrVector<QConnectionList>::at(index);
+    }
+    bool insert( uint index, const QConnectionList* d ) {
+        if (index >= size() )
+            resize( 2*index + 1);
+        return QPtrVector<QConnectionList>::insert(index, d);
+    }
+};
+
+
+
+void KApplication::kipcMessage( int t0, int t1 )
+{
+    if ( signalsBlocked() )
+        return;
+    QConnectionList *clist = receivers( staticMetaObject()->signalOffset() + 8 );
+    if ( !clist )
+        return;
+    QUObject o[3];
+    static_QUType_int.set(o+1,t0);
+    static_QUType_int.set(o+2,t1);
+    activate_signal( clist, o );
+}
+
+
+void KApplication::saveYourself()
+{
+    activate_signal( staticMetaObject()->signalOffset() + 9 );
+}
+
+
+void KApplication::shutDown()
+{
+    activate_signal( staticMetaObject()->signalOffset() + 10 );
+}
+
+bool KApplication::qt_invoke( int _id, QUObject* _o )
+{
+    switch ( _id - staticMetaObject()->slotOffset() ) {
+    case 0: invokeBrowser((const QString&)static_QUType_QString.get(_o+1)); break;
+    case 1: cut(); break;
+    case 2: copy(); break;
+    case 3: paste(); break;
+    case 4: clear(); break;
+    case 5: selectAll(); break;
+    case 6: ref(); break;
+    case 7: deref(); break;
+    case 8: dcopFailure((const QString&)static_QUType_QString.get(_o+1)); break;
+    case 9: dcopBlockUserInput((bool)static_QUType_bool.get(_o+1)); break;
+    case 10: x11FilterDestroyed(); break;
+    default:
+        return QApplication::qt_invoke( _id, _o );
+    }
+    return TRUE;
+}
+
+bool KApplication::qt_emit( int _id, QUObject* _o )
+{
+    switch ( _id - staticMetaObject()->signalOffset() ) {
+    case 0: kdisplayPaletteChanged(); break;
+    case 1: kdisplayStyleChanged(); break;
+    case 2: kdisplayFontChanged(); break;
+    case 3: appearanceChanged(); break;
+    case 4: toolbarAppearanceChanged((int)static_QUType_int.get(_o+1)); break;
+    case 5: backgroundChanged((int)static_QUType_int.get(_o+1)); break;
+    case 6: settingsChanged((int)static_QUType_int.get(_o+1)); break;
+    case 7: iconChanged((int)static_QUType_int.get(_o+1)); break;
+    case 8: kipcMessage((int)static_QUType_int.get(_o+1),(int)static_QUType_int.get(_o+2)); break;
+    case 9: saveYourself(); break;
+    case 10: shutDown(); break;
+    default:
+        return QApplication::qt_emit(_id,_o);
+    }
+    return TRUE;
+}
+
+
+bool KApplication::qt_property( int id, int f, QVariant* v)
+{
+    return QApplication::qt_property( id, f, v);
+}
+
+bool KApplication::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; }
+
+
+
+
+class KConfig;
+class QWidget;
+class KAutoConfig : public QObject {
+
+public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+
+protected:
+
+
+
+
+
+  void settingsChanged();
+
+
+
+
+
+
+
+  void settingsChanged( QWidget *widget );
+  void widgetModified();
+
+
+public:
+
+
+
+
+
+
+
+  KAutoConfig( KConfig *kconfig, QObject *parent=0, const char *name=0 );
+  KAutoConfig( QObject *parent=0, const char *name=0 );
+
+
+
+
+  ~KAutoConfig();
+  void addWidget( QWidget *widget, const QString &group );
+
+
+
+
+
+
+
+  void ignoreSubWidget( QWidget *widget );
+
+
+
+
+
+
+
+  bool hasChanged() const;
+
+
+
+
+
+
+
+  bool isDefault() const;
+  inline void addWidgetChangedSignal( const QString &widgetName,
+                  const QCString &signal){
+    changedMap.insert( widgetName, signal );
+  }
+
+
+public :
+  bool retrieveSettings( bool trackChanges=false );
+
+
+
+
+
+
+
+  bool saveSettings();
+
+
+
+
+
+
+
+  void resetSettings();
+
+
+protected:
+
+
+
+  KConfig *config;
+
+
+
+  QMap<QString, QCString> changedMap;
+  bool parseChildren( const QWidget *widget,
+                  QPtrList<QWidget>&currentGroup, bool trackChanges );
+
+
+private:
+  class KAutoConfigPrivate;
+
+
+
+  KAutoConfigPrivate *d;
+
+};
+
+
+
+class QObjectList : public QPtrList<QObject>
+{
+public:
+    QObjectList() : QPtrList<QObject>() {}
+    QObjectList( const QObjectList &list ) : QPtrList<QObject>(list) {}
+   ~QObjectList() { clear(); }
+    QObjectList &operator=(const QObjectList &list)
+        { return (QObjectList&)QPtrList<QObject>::operator=(list); }
+};
+
+class QObjectListIterator : public QPtrListIterator<QObject>
+{
+public:
+    QObjectListIterator( const QObjectList &l )
+        : QPtrListIterator<QObject>( l ) { }
+    QObjectListIterator &operator=( const QObjectListIterator &i )
+        { return (QObjectListIterator&)
+                 QPtrListIterator<QObject>::operator=( i ); }
+};
+class QObjectListIt : public QPtrListIterator<QObject>
+{
+public:
+    QObjectListIt( const QObjectList &l ) : QPtrListIterator<QObject>(l) {}
+    QObjectListIt &operator=(const QObjectListIt &i)
+        { return (QObjectListIt&)QPtrListIterator<QObject>::operator=(i); }
+};
+
+
+
+
+
+
+class KAutoConfig::KAutoConfigPrivate {
+
+public:
+  KAutoConfigPrivate() : changed(false)
+
+    , retrievedSettings(false)
+
+  { init(); }
+
+
+  QPtrList<QWidget> widgets;
+
+  QMap<QWidget*, QString> groups;
+
+
+  QPtrList<QWidget> ignore;
+
+
+  bool changed;
+
+
+
+  bool retrievedSettings;
+
+
+
+  QMap<QWidget*, QPtrList<QWidget> > autoWidgets;
+
+  QMap<QWidget*, QVariant> defaultValues;
+
+  QAsciiDict<int> ignoreTheseWidgets;
+
+  void init(){
+    ignoreTheseWidgets.insert("QLabel", new int(1));
+    ignoreTheseWidgets.insert("QFrame", new int(2));
+    ignoreTheseWidgets.insert("QGroupBox", new int(3));
+    ignoreTheseWidgets.insert("QButtonGroup", new int(4));
+    ignoreTheseWidgets.insert("QWidget", new int(5));
+    ignoreTheseWidgets.setAutoDelete(true);
+
+    static bool defaultKDEPropertyMapInstalled = false;
+    if ( !defaultKDEPropertyMapInstalled && KApplication::kApplication() ) {
+      KApplication::kApplication()->installKDEPropertyMap();
+      defaultKDEPropertyMapInstalled = true;
+    }
+  }
+};
+
+KAutoConfig::KAutoConfig(KConfig *kconfig, QObject *parent,
+    const char *name) : QObject(parent, name), config(kconfig) {
+  d = new KAutoConfigPrivate();
+}
+
+KAutoConfig::KAutoConfig(QObject *parent, const char *name) :
+    QObject(parent, name), config(KGlobal::config()) {
+  d = new KAutoConfigPrivate();
+}
+
+KAutoConfig::~KAutoConfig(){
+  delete d;
+}
+
+void KAutoConfig::addWidget(QWidget *widget, const QString &group){
+  d->groups.insert(widget, group);
+  d->widgets.append(widget);
+  QPtrList<QWidget> newAutoConfigWidget;
+  d->autoWidgets.insert(widget, newAutoConfigWidget );
+}
+
+void KAutoConfig::ignoreSubWidget(QWidget *widget){
+  d->ignore.append(widget);
+}
+
+bool KAutoConfig::retrieveSettings(bool trackChanges){
+
+  if(d->retrievedSettings){
+      kdDebug(180) << "This should not happen.  Function "
+       "KAutoConfig::retrieveSettings() called more then once, returning "
+       "first.  It is not recommended unless you know the implementation "
+       "details of KAutoConfig and what this breaks.  Please fix." << endl;
+    return false;
+  }
+  d->retrievedSettings = true;
+
+
+  if(trackChanges){
+
+    changedMap.insert("QButton", "2""stateChanged(int)");
+    changedMap.insert("QCheckBox", "2""stateChanged(int)");
+    changedMap.insert("QPushButton", "2""stateChanged(int)");
+    changedMap.insert("QRadioButton", "2""stateChanged(int)");
+    changedMap.insert("QComboBox", "2""activated (int)");
+
+
+    changedMap.insert("QDateEdit", "2""valueChanged(const QDate &)");
+    changedMap.insert("QDateTimeEdit", "2""valueChanged(const QDateTime &)");
+    changedMap.insert("QDial", "2""valueChanged (int)");
+    changedMap.insert("QLineEdit", "2""textChanged(const QString &)");
+    changedMap.insert("QSlider", "2""valueChanged(int)");
+    changedMap.insert("QSpinBox", "2""valueChanged(int)");
+    changedMap.insert("QTimeEdit", "2""valueChanged(const QTime &)");
+    changedMap.insert("QTextEdit", "2""textChanged()");
+    changedMap.insert("QTextBrowser", "2""sourceChanged(const QString &)");
+    changedMap.insert("QMultiLineEdit", "2""textChanged()");
+    changedMap.insert("QListBox", "2""selectionChanged()");
+    changedMap.insert("QTabWidget", "2""currentChanged(QWidget *)");
+
+
+    changedMap.insert( "KComboBox", "2""activated (int)");
+    changedMap.insert( "KFontCombo", "2""activated (int)");
+    changedMap.insert( "KFontRequester", "2""fontSelected(const QFont &)");
+    changedMap.insert( "KFontChooser", "2""fontSelected(const QFont &)");
+    changedMap.insert( "KHistoryCombo", "2""activated (int)");
+
+    changedMap.insert( "KColorButton", "2""changed(const QColor &)");
+    changedMap.insert( "KDatePicker", "2""dateSelected (QDate)");
+    changedMap.insert( "KEditListBox", "2""changed()");
+    changedMap.insert( "KListBox", "2""selectionChanged()");
+    changedMap.insert( "KLineEdit", "2""textChanged(const QString &)");
+    changedMap.insert( "KPasswordEdit", "2""textChanged(const QString &)");
+    changedMap.insert( "KRestrictedLine", "2""textChanged(const QString &)");
+    changedMap.insert( "KTextBrowser", "2""sourceChanged(const QString &)");
+    changedMap.insert( "KTextEdit", "2""textChanged()");
+    changedMap.insert( "KURLRequester", "2""textChanged (const QString& )");
+    changedMap.insert( "KIntNumInput", "2""valueChanged (int)");
+    changedMap.insert( "KIntSpinBox", "2""valueChanged (int)");
+    changedMap.insert( "KDoubleNumInput", "2""valueChanged (double)");
+  }
+
+
+  QPtrListIterator<QWidget> it( d->widgets );
+  QWidget *widget = 0;
+  bool usingDefaultValues = false;
+  while ( (widget = it.current()) != 0 ) {
+    ++it;
+    config->setGroup(d->groups[widget]);
+    usingDefaultValues |= parseChildren(widget, d->autoWidgets[widget], trackChanges);
+  }
+  return usingDefaultValues;
+}
+
+bool KAutoConfig::saveSettings() {
+
+  if(!d->retrievedSettings){
+      kdDebug(180) << "KAutoConfig::saveSettings() called before "
+      "KAutoConfig::retrieveSettings().  This should NEVER happen.  "
+      "Please Fix." << endl;
+    return false;
+  }
+
+
+  QSqlPropertyMap *propertyMap = QSqlPropertyMap::defaultMap();
+
+  QPtrListIterator<QWidget> it( d->widgets );
+  QWidget *widget = 0;
+  while ( (widget = it.current()) != 0 ) {
+    ++it;
+    config->setGroup(d->groups[widget]);
+
+
+    QPtrListIterator<QWidget> it( d->autoWidgets[widget] );
+    QWidget *groupWidget;
+    bool widgetChanged = false;
+    while ( (groupWidget = it.current()) != 0 ){
+      ++it;
+      QVariant defaultValue = d->defaultValues[groupWidget];
+      QVariant currentValue = propertyMap->property(groupWidget);
+
+      if(!config->hasDefault(groupWidget->name()) && currentValue == defaultValue){
+        config->revertToDefault(groupWidget->name());
+        widgetChanged = true;
+      }
+      else{
+        QVariant savedValue = config->readPropertyEntry(groupWidget->name(),
+                                                             defaultValue);
+        if(savedValue != currentValue){
+          config->writeEntry(groupWidget->name(), currentValue);
+          widgetChanged = true;
+        }
+      }
+    }
+    d->changed |= widgetChanged;
+    if(widgetChanged)
+      ( settingsChanged(widget) );
+  }
+
+  if(d->changed){
+    ( settingsChanged() );
+    d->changed = false;
+    config->sync();
+    return true;
+  }
+  return false;
+}
+
+bool KAutoConfig::hasChanged() const {
+
+  if(!d->retrievedSettings){
+    kdDebug(180) << "KAutoConfig::hasChanged() called before "
+      "KAutoConfig::retrieveSettings().  This should NEVER happen.  "
+      "Please Fix." << endl;
+    return false;
+  }
+
+
+  QSqlPropertyMap *propertyMap = QSqlPropertyMap::defaultMap();
+
+  QPtrListIterator<QWidget> it( d->widgets );
+  QWidget *widget = 0;
+  while ( (widget = it.current()) != 0 ) {
+    ++it;
+    config->setGroup(d->groups[widget]);
+
+    QPtrListIterator<QWidget> it( d->autoWidgets[widget] );
+    QWidget *groupWidget;
+    while ( (groupWidget = it.current()) != 0 ){
+      ++it;
+      QVariant defaultValue = d->defaultValues[groupWidget];
+      QVariant currentValue = propertyMap->property(groupWidget);
+      QVariant savedValue = config->readPropertyEntry(groupWidget->name(),
+      defaultValue);
+
+      if((currentValue == defaultValue && savedValue != currentValue) ||
+         (savedValue != currentValue))
+        return true;
+    }
+  }
+  return false;
+}
+
+bool KAutoConfig::isDefault() const {
+
+  if(!d->retrievedSettings){
+    kdDebug(180) << "KAutoConfig::isDefault() called before "
+      "KAutoConfig::retrieveSettings().  This should NEVER happen.  "
+      "Please Fix." << endl;
+    return false;
+  }
+
+
+  QSqlPropertyMap *propertyMap = QSqlPropertyMap::defaultMap();
+
+  QPtrListIterator<QWidget> it( d->widgets );
+  QWidget *widget = 0;
+  while ( (widget = it.current()) != 0 ) {
+    ++it;
+    config->setGroup(d->groups[widget]);
+
+    QPtrListIterator<QWidget> it( d->autoWidgets[widget] );
+    QWidget *groupWidget;
+    while ( (groupWidget = it.current()) != 0 ){
+      ++it;
+      QVariant defaultValue = d->defaultValues[groupWidget];
+      QVariant currentValue = propertyMap->property(groupWidget);
+      if(currentValue != defaultValue){
+
+        return false;
+      }
+    }
+  }
+  return true;
+}
+
+void KAutoConfig::resetSettings(){
+
+  if(!d->retrievedSettings){
+    kdDebug(180) << "KAutoConfig::resetSettings() called before "
+      "KAutoConfig::retrieveSettings().  This should NEVER happen.  "
+      "Please Fix." << endl;
+    return;
+  }
+
+
+  QSqlPropertyMap *propertyMap = QSqlPropertyMap::defaultMap();
+
+  QPtrListIterator<QWidget> it( d->widgets );
+  QWidget *widget = 0;
+  while ( (widget = it.current()) != 0 ) {
+    ++it;
+    config->setGroup(d->groups[widget]);
+
+
+    QPtrListIterator<QWidget> it( d->autoWidgets[widget] );
+    QWidget *groupWidget;
+    while ( (groupWidget = it.current()) != 0 ){
+      ++it;
+      QVariant defaultValue = d->defaultValues[groupWidget];
+      if(defaultValue != propertyMap->property(groupWidget)){
+        propertyMap->setProperty(groupWidget, defaultValue);
+        d->changed = true;
+      }
+    }
+  }
+}
+
+bool KAutoConfig::parseChildren(const QWidget *widget,
+    QPtrList<QWidget>& currentGroup, bool trackChanges){
+  bool valueChanged = false;
+  const QPtrList<QObject> *listOfChildren = widget->children();
+  if(!listOfChildren)
+    return valueChanged;
+
+  QSqlPropertyMap *propertyMap = QSqlPropertyMap::defaultMap();
+  QPtrListIterator<QObject> it( *listOfChildren );
+  QObject *object;
+  while ( (object = it.current()) != 0 )
+  {
+    ++it;
+    if(!object->isWidgetType()){
+      continue;
+    }
+    QWidget *childWidget = (QWidget *)object;
+    if(d->ignore.containsRef(childWidget)){
+      continue;
+    }
+
+    bool parseTheChildren = true;
+    if( d->ignoreTheseWidgets[childWidget->className()] == 0 &&
+      childWidget->name(0) != __null )
+    {
+      QVariant defaultSetting = propertyMap->property(childWidget);
+      if(defaultSetting.isValid())
+      {
+        parseTheChildren = false;
+
+        if(config->entryIsImmutable( childWidget->name()))
+          childWidget->setEnabled(false);
+        else
+        {
+
+
+
+          currentGroup.append(childWidget);
+          d->defaultValues.insert(childWidget, defaultSetting);
+        }
+
+        QVariant setting =
+         config->readPropertyEntry(childWidget->name(), defaultSetting);
+        if(setting != defaultSetting)
+        {
+          propertyMap->setProperty(childWidget, setting);
+          valueChanged = true;
+        }
+        if(trackChanges && changedMap.find(childWidget->className()) !=
+            changedMap.end())
+        {
+          connect(childWidget, changedMap[childWidget->className()],
+                  this, "2""widgetModified()");
+        }
+
+        else if(trackChanges &&
+          changedMap.find(childWidget->className()) == changedMap.end())
+        {
+          kdDebug(180) << "KAutoConfig::retrieveSettings, Unknown changed "
+           "signal for widget:" << childWidget->className() << endl;
+        }
+
+
+      }
+
+      else
+      {
+          kdDebug(180) << "KAutoConfig::retrieveSettings, Unknown widget:"
+           << childWidget->className() << endl;
+      }
+
+    }
+    if(parseTheChildren)
+    {
+
+
+      valueChanged |= parseChildren(childWidget, currentGroup, trackChanges);
+    }
+  }
+  return valueChanged;
+}
+
+const char *KAutoConfig::className() const
+{
+    return "KAutoConfig";
+}
+
+QMetaObject *KAutoConfig::metaObj = 0;
+static QMetaObjectCleanUp cleanUp_KAutoConfig( "KAutoConfig", &KAutoConfig::staticMetaObject );
+QMetaObject* KAutoConfig::staticMetaObject()
+{
+    if ( metaObj )
+        return metaObj;
+    QMetaObject* parentObject = QObject::staticMetaObject();
+    static const QUParameter param_slot_0[] = {
+        { 0, &static_QUType_bool, 0, QUParameter::Out }
+    };
+    static const QUMethod slot_0 = {"retrieveSettings", 1, param_slot_0 };
+    static const QUParameter param_slot_1[] = {
+        { 0, &static_QUType_bool, 0, QUParameter::Out },
+        { "trackChanges", &static_QUType_bool, 0, QUParameter::In }
+    };
+    static const QUMethod slot_1 = {"retrieveSettings", 2, param_slot_1 };
+    static const QUParameter param_slot_2[] = {
+        { 0, &static_QUType_bool, 0, QUParameter::Out }
+    };
+    static const QUMethod slot_2 = {"saveSettings", 1, param_slot_2 };
+    static const QUMethod slot_3 = {"resetSettings", 0, 0 };
+    static const QMetaData slot_tbl[] = {
+        { "retrieveSettings()", &slot_0, QMetaData::Public },
+        { "retrieveSettings(bool)", &slot_1, QMetaData::Public },
+        { "saveSettings()", &slot_2, QMetaData::Public },
+        { "resetSettings()", &slot_3, QMetaData::Public }
+    };
+    static const QUMethod signal_0 = {"settingsChanged", 0, 0 };
+    static const QUParameter param_signal_1[] = {
+        { "widget", &static_QUType_ptr, "QWidget", QUParameter::In }
+    };
+    static const QUMethod signal_1 = {"settingsChanged", 1, param_signal_1 };
+    static const QUMethod signal_2 = {"widgetModified", 0, 0 };
+    static const QMetaData signal_tbl[] = {
+        { "settingsChanged()", &signal_0, QMetaData::Private },
+        { "settingsChanged(QWidget*)", &signal_1, QMetaData::Private },
+        { "widgetModified()", &signal_2, QMetaData::Private }
+    };
+    metaObj = QMetaObject::new_metaobject(
+        "KAutoConfig", parentObject,
+        slot_tbl, 4,
+        signal_tbl, 3,
+
+        0, 0,
+        0, 0,
+
+        0, 0 );
+    cleanUp_KAutoConfig.setMetaObject( metaObj );
+    return metaObj;
+}
+
+void* KAutoConfig::qt_cast( const char* clname )
+{
+    if ( !qstrcmp( clname, "KAutoConfig" ) )
+        return this;
+    return QObject::qt_cast( clname );
+}
+
+
+void KAutoConfig::settingsChanged()
+{
+    activate_signal( staticMetaObject()->signalOffset() + 0 );
+}
+
+
+
+
+
+void KAutoConfig::settingsChanged( QWidget* t0 )
+{
+    if ( signalsBlocked() )
+        return;
+    QConnectionList *clist = receivers( staticMetaObject()->signalOffset() + 1 );
+    if ( !clist )
+        return;
+    QUObject o[2];
+    static_QUType_ptr.set(o+1,t0);
+    activate_signal( clist, o );
+}
+
+
+void KAutoConfig::widgetModified()
+{
+    activate_signal( staticMetaObject()->signalOffset() + 2 );
+}
+
+bool KAutoConfig::qt_invoke( int _id, QUObject* _o )
+{
+    switch ( _id - staticMetaObject()->slotOffset() ) {
+    case 0: static_QUType_bool.set(_o,retrieveSettings()); break;
+    case 1: static_QUType_bool.set(_o,retrieveSettings((bool)static_QUType_bool.get(_o+1))); break;
+    case 2: static_QUType_bool.set(_o,saveSettings()); break;
+    case 3: resetSettings(); break;
+    default:
+        return QObject::qt_invoke( _id, _o );
+    }
+    return TRUE;
+}
+
+bool KAutoConfig::qt_emit( int _id, QUObject* _o )
+{
+    switch ( _id - staticMetaObject()->signalOffset() ) {
+    case 0: settingsChanged(); break;
+    case 1: settingsChanged((QWidget*)static_QUType_ptr.get(_o+1)); break;
+    case 2: widgetModified(); break;
+    default:
+        return QObject::qt_emit(_id,_o);
+    }
+    return TRUE;
+}
+
+
+bool KAutoConfig::qt_property( int id, int f, QVariant* v)
+{
+    return QObject::qt_property( id, f, v);
+}
+
+bool KAutoConfig::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; }
+
+
+
+
+
+
+
+class KDebugDCOPIface : virtual public DCOPObject
+{
+        public: virtual bool process(const QCString &fun, const QByteArray &data, QCString& replyType, QByteArray &replyData); QCStringList functions(); QCStringList interfaces(); private:
+public:
+        KDebugDCOPIface();
+        ~KDebugDCOPIface();
+
+public:
+
+
+
+
+        void notifyKDebugConfigChanged();
+};
+
+
+
+
+
+template<class type>
+class QIntDict
+
+
+
+        : public QGDict
+
+{
+public:
+    QIntDict(int size=17) : QGDict(size,IntKey,0,0) {}
+    QIntDict( const QIntDict<type> &d ) : QGDict(d) {}
+   ~QIntDict() { clear(); }
+    QIntDict<type> &operator=(const QIntDict<type> &d)
+                        { return (QIntDict<type>&)QGDict::operator=(d); }
+    uint count() const { return QGDict::count(); }
+    uint size() const { return QGDict::size(); }
+    bool isEmpty() const { return QGDict::count() == 0; }
+    void insert( long k, const type *d )
+                                        { QGDict::look_int(k,(Item)d,1); }
+    void replace( long k, const type *d )
+                                        { QGDict::look_int(k,(Item)d,2); }
+    bool remove( long k ) { return QGDict::remove_int(k); }
+    type *take( long k ) { return (type*)QGDict::take_int(k); }
+    type *find( long k ) const
+                { return (type *)((QGDict*)this)->QGDict::look_int(k,0,0); }
+    type *operator[]( long k ) const
+                { return (type *)((QGDict*)this)->QGDict::look_int(k,0,0); }
+    void clear() { QGDict::clear(); }
+    void resize( uint n ) { QGDict::resize(n); }
+    void statistics() const { QGDict::statistics(); }
+
+
+
+
+
+
+
+private:
+    void deleteItem( Item d );
+};
+
+
+template<> inline void QIntDict<void>::deleteItem( QPtrCollection::Item )
+{
+}
+
+
+template<class type> inline void QIntDict<type>::deleteItem( QPtrCollection::Item d )
+{
+    if ( del_item ) delete (type*)d;
+}
+
+template<class type>
+class QIntDictIterator : public QGDictIterator
+{
+public:
+    QIntDictIterator(const QIntDict<type> &d) :QGDictIterator((QGDict &)d) {}
+   ~QIntDictIterator() {}
+    uint count() const { return dict->count(); }
+    bool isEmpty() const { return dict->count() == 0; }
+    type *toFirst() { return (type *)QGDictIterator::toFirst(); }
+    operator type *() const { return (type *)QGDictIterator::get(); }
+    type *current() const { return (type *)QGDictIterator::get(); }
+    long currentKey() const { return QGDictIterator::getKeyInt(); }
+    type *operator()() { return (type *)QGDictIterator::operator()(); }
+    type *operator++() { return (type *)QGDictIterator::operator++(); }
+    type *operator+=(uint j) { return (type *)QGDictIterator::operator+=(j);}
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+class QPen: public Qt
+{
+public:
+    QPen();
+    QPen( PenStyle );
+    QPen( const QColor &color, uint width=0, PenStyle style=SolidLine );
+    QPen( const QColor &cl, uint w, PenStyle s, PenCapStyle c, PenJoinStyle j);
+    QPen( const QPen & );
+   ~QPen();
+    QPen &operator=( const QPen & );
+
+    PenStyle style() const { return data->style; }
+    void setStyle( PenStyle );
+    uint width() const { return data->width; }
+    void setWidth( uint );
+    const QColor &color() const { return data->color; }
+    void setColor( const QColor & );
+    PenCapStyle capStyle() const;
+    void setCapStyle( PenCapStyle );
+    PenJoinStyle joinStyle() const;
+    void setJoinStyle( PenJoinStyle );
+
+    bool operator==( const QPen &p ) const;
+    bool operator!=( const QPen &p ) const
+                                        { return !(operator==(p)); }
+
+private:
+    friend class QPainter;
+
+
+
+
+    QPen copy() const;
+    void detach();
+    void init( const QColor &, uint, uint );
+    struct QPenData : public QShared {
+        PenStyle style;
+        uint width;
+        QColor color;
+        Q_UINT16 linest;
+    } *data;
+};
+
+
+
+
+
+
+ QDataStream &operator<<( QDataStream &, const QPen & );
+ QDataStream &operator>>( QDataStream &, QPen & );
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C" {
+
+
+enum
+{
+  _ISupper = ((0) < 8 ? ((1 << (0)) << 8) : ((1 << (0)) >> 8)),
+  _ISlower = ((1) < 8 ? ((1 << (1)) << 8) : ((1 << (1)) >> 8)),
+  _ISalpha = ((2) < 8 ? ((1 << (2)) << 8) : ((1 << (2)) >> 8)),
+  _ISdigit = ((3) < 8 ? ((1 << (3)) << 8) : ((1 << (3)) >> 8)),
+  _ISxdigit = ((4) < 8 ? ((1 << (4)) << 8) : ((1 << (4)) >> 8)),
+  _ISspace = ((5) < 8 ? ((1 << (5)) << 8) : ((1 << (5)) >> 8)),
+  _ISprint = ((6) < 8 ? ((1 << (6)) << 8) : ((1 << (6)) >> 8)),
+  _ISgraph = ((7) < 8 ? ((1 << (7)) << 8) : ((1 << (7)) >> 8)),
+  _ISblank = ((8) < 8 ? ((1 << (8)) << 8) : ((1 << (8)) >> 8)),
+  _IScntrl = ((9) < 8 ? ((1 << (9)) << 8) : ((1 << (9)) >> 8)),
+  _ISpunct = ((10) < 8 ? ((1 << (10)) << 8) : ((1 << (10)) >> 8)),
+  _ISalnum = ((11) < 8 ? ((1 << (11)) << 8) : ((1 << (11)) >> 8))
+};
+extern __const unsigned short int **__ctype_b_loc (void)
+     __attribute__ ((__const));
+extern __const __int32_t **__ctype_tolower_loc (void)
+     __attribute__ ((__const));
+extern __const __int32_t **__ctype_toupper_loc (void)
+     __attribute__ ((__const));
+
+
+
+
+
+
+
+
+
+
+
+extern int isalnum (int) throw ();
+extern int isalpha (int) throw ();
+extern int iscntrl (int) throw ();
+extern int isdigit (int) throw ();
+extern int islower (int) throw ();
+extern int isgraph (int) throw ();
+extern int isprint (int) throw ();
+extern int ispunct (int) throw ();
+extern int isspace (int) throw ();
+extern int isupper (int) throw ();
+extern int isxdigit (int) throw ();
+
+
+
+extern int tolower (int __c) throw ();
+
+
+extern int toupper (int __c) throw ();
+
+
+
+
+
+
+
+
+extern int isblank (int) throw ();
+
+
+
+
+
+
+extern int isctype (int __c, int __mask) throw ();
+
+
+
+
+
+
+extern int isascii (int __c) throw ();
+
+
+
+extern int toascii (int __c) throw ();
+
+
+
+extern int _toupper (int) throw ();
+extern int _tolower (int) throw ();
+
+
+
+
+
+
+
+
+
+
+
+extern int isalnum_l (int, __locale_t) throw ();
+extern int isalpha_l (int, __locale_t) throw ();
+extern int iscntrl_l (int, __locale_t) throw ();
+extern int isdigit_l (int, __locale_t) throw ();
+extern int islower_l (int, __locale_t) throw ();
+extern int isgraph_l (int, __locale_t) throw ();
+extern int isprint_l (int, __locale_t) throw ();
+extern int ispunct_l (int, __locale_t) throw ();
+extern int isspace_l (int, __locale_t) throw ();
+extern int isupper_l (int, __locale_t) throw ();
+extern int isxdigit_l (int, __locale_t) throw ();
+
+extern int isblank_l (int, __locale_t) throw ();
+
+
+
+extern int __tolower_l (int __c, __locale_t __l) throw ();
+extern int tolower_l (int __c, __locale_t __l) throw ();
+
+
+extern int __toupper_l (int __c, __locale_t __l) throw ();
+extern int toupper_l (int __c, __locale_t __l) throw ();
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C" {
+
+
+extern void closelog (void) throw ();
+
+
+extern void openlog (__const char *__ident, int __option, int __facility)
+     throw ();
+
+
+extern int setlogmask (int __mask) throw ();
+
+
+extern void syslog (int __pri, __const char *__fmt, ...) throw ()
+     __attribute__ ((__format__(__printf__, 2, 3)));
+
+
+
+extern void vsyslog (int __pri, __const char *__fmt, __gnuc_va_list __ap)
+     throw () __attribute__ ((__format__(__printf__, 2, 0)));
+
+
+}
+
+
+class KStaticDeleterBase {
+public:
+    virtual ~KStaticDeleterBase() { }
+
+
+
+
+
+    virtual void destructObject();
+};
+template<class type> class KStaticDeleter : public KStaticDeleterBase {
+public:
+    KStaticDeleter() { deleteit = 0; globalReference = 0; array = false; }
+
+
+
+
+
+
+
+    __attribute__ ((deprecated)) type *setObject( type *obj, bool isArray = false) {
+        deleteit = obj;
+        globalReference = 0;
+        array = isArray;
+        if (obj)
+            KGlobal::registerStaticDeleter(this);
+        else
+            KGlobal::unregisterStaticDeleter(this);
+        return obj;
+    }
+    type *setObject( type* & globalRef, type *obj, bool isArray = false) {
+        globalReference = &globalRef;
+        deleteit = obj;
+        array = isArray;
+        if (obj)
+            KGlobal::registerStaticDeleter(this);
+        else
+            KGlobal::unregisterStaticDeleter(this);
+        globalRef = obj;
+        return obj;
+    }
+
+
+
+
+
+    virtual void destructObject() {
+        if (globalReference)
+           *globalReference = 0;
+        if (array)
+           delete [] deleteit;
+        else
+           delete deleteit;
+        deleteit = 0;
+    }
+    virtual ~KStaticDeleter() {
+        KGlobal::unregisterStaticDeleter(this);
+        destructObject();
+    }
+private:
+    type *deleteit;
+    type **globalReference;
+    bool array;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C"
+
+int mkstemps(char *, int);
+extern "C"
+
+unsigned long strlcat(char*, const char*, unsigned long);
+
+
+
+
+
+
+extern "C"
+
+unsigned long strlcpy(char*, const char*, unsigned long);
+
+
+
+
+
+
+
+
+
+extern "C" {
+
+
+
+extern int backtrace (void **__array, int __size) throw ();
+
+
+
+
+extern char **backtrace_symbols (void *__const *__array, int __size) throw ();
+
+
+
+
+
+extern void backtrace_symbols_fd (void *__const *__array, int __size,
+                                  int __fd) throw ();
+
+}
+
+
+class KDebugEntry;
+
+class KDebugEntry
+{
+public:
+    KDebugEntry (int n, QString d) {number=n; descr=d;}
+    unsigned int number;
+    QString descr;
+};
+
+static QIntDict<KDebugEntry> *KDebugCache;
+
+static KStaticDeleter< QIntDict<KDebugEntry> > kdd;
+
+static QString getDescrFromNum(unsigned int _num)
+{
+  if (!KDebugCache) {
+    kdd.setObject(KDebugCache, new QIntDict<KDebugEntry>);
+
+    KGlobal::unregisterStaticDeleter(&kdd);
+    KDebugCache->setAutoDelete(true);
+  }
+
+  KDebugEntry *ent = KDebugCache->find( _num );
+  if ( ent )
+    return ent->descr;
+
+  if ( !KDebugCache->isEmpty() )
+    return QString::null;
+
+  QString filename(locate("config","kdebug.areas"));
+  if (filename.isEmpty())
+      return QString::null;
+
+  QFile file(filename);
+  if (!file.open(0x0001)) {
+    qWarning("Couldn't open %s", filename.local8Bit().data());
+    file.close();
+    return QString::null;
+  }
+
+  unsigned long number = 0;
+  bool longOK;
+
+  QTextStream *ts = new QTextStream(&file);
+  ts->setEncoding( QTextStream::Latin1 );
+  while (!ts->eof()) {
+    const QString data(ts->readLine());
+    int i = 0;
+    int len = data.length();
+
+    QChar ch = data[0];
+    if (ch == '#' || ch.isNull()) {
+      continue;
+    }
+    while (ch.isSpace()) {
+      if (!(i < len))
+        continue;
+      ++i;
+      ch = data[i];
+    }
+    if (ch.isNumber()) {
+        int numStart = i ;
+        while (ch.isNumber()) {
+          if (!(i < len))
+            continue;
+          ++i;
+          ch = data[i];
+        }
+        number = data.mid(numStart,i).toULong(&longOK);
+    }
+    while (ch.isSpace()) {
+      if (!(i < len))
+        continue;
+      ++i;
+      ch = data[i];
+    }
+    const QString description(data.mid(i, len));
+
+
+    KDebugCache->insert(number, new KDebugEntry(number,description));
+  }
+
+  delete ts;
+  file.close();
+
+  ent = KDebugCache->find( _num );
+  if ( ent )
+      return ent->descr;
+
+  return QString::null;
+}
+
+enum DebugLevels {
+    KDEBUG_INFO= 0,
+    KDEBUG_WARN= 1,
+    KDEBUG_ERROR= 2,
+    KDEBUG_FATAL= 3
+};
+
+
+struct kDebugPrivate {
+  kDebugPrivate() :
+        oldarea(0), config(0) { }
+
+  ~kDebugPrivate() { delete config; }
+
+  QString aAreaName;
+  unsigned int oldarea;
+  KConfig *config;
+};
+
+static kDebugPrivate *kDebug_data = 0;
+static KStaticDeleter<kDebugPrivate> pcd;
+static KStaticDeleter<KDebugDCOPIface> dcopsd;
+static KDebugDCOPIface* kDebugDCOPIface = 0;
+
+static void kDebugBackend( unsigned short nLevel, unsigned int nArea, const char *data)
+{
+  if ( !kDebug_data )
+  {
+      pcd.setObject(kDebug_data, new kDebugPrivate());
+
+      KGlobal::unregisterStaticDeleter(&pcd);
+
+
+      if (!kDebugDCOPIface)
+      {
+          kDebugDCOPIface = dcopsd.setObject(kDebugDCOPIface, new KDebugDCOPIface);
+      }
+  }
+
+  if (!kDebug_data->config && KGlobal::_instance )
+  {
+      kDebug_data->config = new KConfig("kdebugrc", false, false);
+      kDebug_data->config->setGroup("0");
+
+
+
+      if ( KGlobal::_instance )
+        kDebug_data->aAreaName = KGlobal::instance()->instanceName();
+  }
+
+  if (kDebug_data->config && kDebug_data->oldarea != nArea) {
+    kDebug_data->config->setGroup( QString::number(static_cast<int>(nArea)) );
+    kDebug_data->oldarea = nArea;
+    if ( nArea > 0 && KGlobal::_instance )
+      kDebug_data->aAreaName = getDescrFromNum(nArea);
+    if ((nArea == 0) || kDebug_data->aAreaName.isEmpty())
+      if ( KGlobal::_instance )
+        kDebug_data->aAreaName = KGlobal::instance()->instanceName();
+  }
+
+  int nPriority = 0;
+  QString aCaption;
+
+
+
+    QString key;
+    switch( nLevel )
+      {
+      case KDEBUG_INFO:
+        key = "InfoOutput";
+        aCaption = "Info";
+        nPriority = 6;
+        break;
+      case KDEBUG_WARN:
+        key = "WarnOutput";
+        aCaption = "Warning";
+        nPriority = 4;
+        break;
+      case KDEBUG_FATAL:
+        key = "FatalOutput";
+        aCaption = "Fatal Error";
+        nPriority = 2;
+        break;
+      case KDEBUG_ERROR:
+      default:
+
+        key = "ErrorOutput";
+        aCaption = "Error";
+        nPriority = 3;
+        break;
+      }
+
+  short nOutput = kDebug_data->config ? kDebug_data->config->readNumEntry(key, 2) : 2;
+
+
+
+  if (!KApplication::kApplication() && (nOutput == 1))
+    nOutput = 2;
+
+
+  switch( nOutput )
+        {
+        case 0:
+          {
+                QString aKey;
+                switch( nLevel )
+                {
+                    case KDEBUG_INFO:
+                        aKey = "InfoFilename";
+                        break;
+                    case KDEBUG_WARN:
+                        aKey = "WarnFilename";
+                        break;
+                    case KDEBUG_FATAL:
+                        aKey = "FatalFilename";
+                        break;
+                    case KDEBUG_ERROR:
+                    default:
+                        aKey = "ErrorFilename";
+                        break;
+                }
+                QString aOutputFileName = kDebug_data->config->readPathEntry(aKey, "kdebug.dbg");
+
+                const int BUFSIZE = 4096;
+                char buf[BUFSIZE];
+                int nSize;
+                if ( !kDebug_data->aAreaName.isEmpty() )
+                    nSize = snprintf( buf, BUFSIZE, "%s: %s", kDebug_data->aAreaName.ascii(), data);
+                else
+                    nSize = snprintf( buf, BUFSIZE, "%s", data);
+
+                QFile aOutputFile( aOutputFileName );
+                aOutputFile.open( 0x0002 | 0x0004 );
+                if ( ( nSize == -1 ) || ( nSize >= BUFSIZE ) )
+                    aOutputFile.writeBlock( buf, BUFSIZE-1 );
+                else
+                    aOutputFile.writeBlock( buf, nSize );
+                aOutputFile.close();
+                break;
+          }
+        case 1:
+          {
+
+
+              if ( !kDebug_data->aAreaName.isEmpty() ) aCaption += QString("(")+kDebug_data->aAreaName+")";
+              QMessageBox::warning( 0L, aCaption, data, i18n("&OK") );
+              break;
+          }
+        case 2:
+          {
+              FILE *output;
+
+
+
+
+                  output = stderr;
+
+
+              if ( !kDebug_data->aAreaName.isEmpty() ) fprintf( output, "%s: ", kDebug_data->aAreaName.ascii() );
+              fputs( data, output);
+              break;
+          }
+        case 3:
+          {
+              syslog( nPriority, "%s", data);
+              break;
+          }
+        case 4:
+          {
+              break;
+          }
+        }
+
+
+  if( ( nLevel == KDEBUG_FATAL )
+      && ( !kDebug_data->config || kDebug_data->config->readNumEntry( "AbortFatal", 1 ) ) )
+        abort();
+}
+
+kdbgstream &perror( kdbgstream &s) { return s << QString::fromLocal8Bit(strerror((*__errno_location ()))); }
+kdbgstream kdDebug(int area) { return kdbgstream(area, KDEBUG_INFO); }
+kdbgstream kdDebug(bool cond, int area) { if (cond) return kdbgstream(area, KDEBUG_INFO); else return kdbgstream(0, 0, false); }
+
+kdbgstream kdError(int area) { return kdbgstream("ERROR: ", area, KDEBUG_ERROR); }
+kdbgstream kdError(bool cond, int area) { if (cond) return kdbgstream("ERROR: ", area, KDEBUG_ERROR); else return kdbgstream(0,0,false); }
+kdbgstream kdWarning(int area) { return kdbgstream("WARNING: ", area, KDEBUG_WARN); }
+kdbgstream kdWarning(bool cond, int area) { if (cond) return kdbgstream("WARNING: ", area, KDEBUG_WARN); else return kdbgstream(0,0,false); }
+kdbgstream kdFatal(int area) { return kdbgstream("FATAL: ", area, KDEBUG_FATAL); }
+kdbgstream kdFatal(bool cond, int area) { if (cond) return kdbgstream("FATAL: ", area, KDEBUG_FATAL); else return kdbgstream(0,0,false); }
+
+void kdbgstream::flush() {
+    if (output.isEmpty() || !print)
+        return;
+    kDebugBackend( level, area, output.local8Bit().data() );
+    output = QString::null;
+}
+
+kdbgstream &kdbgstream::form(const char *format, ...)
+{
+    char buf[4096];
+    va_list arguments;
+    __builtin_va_start(arguments,format);
+    vsnprintf( buf, sizeof(buf), format, arguments );
+    __builtin_va_end(arguments);
+    *this << buf;
+    return *this;
+}
+
+kdbgstream::~kdbgstream() {
+    if (!output.isEmpty()) {
+        fprintf(stderr, "ASSERT: debug output not ended with \\n\n");
+        fprintf(stderr, "%s", kdBacktrace().latin1());
+        *this << "\n";
+    }
+}
+
+kdbgstream& kdbgstream::operator << (char ch)
+{
+  if (!print) return *this;
+  if (!isprint(ch))
+    output += "\\x" + QString::number( static_cast<uint>( ch ) + 0x100, 16 ).right(2);
+  else {
+    output += ch;
+    if (ch == '\n') flush();
+  }
+  return *this;
+}
+
+kdbgstream& kdbgstream::operator << (QWidget* widget)
+{
+    return *this << const_cast< const QWidget* >( widget );
+}
+
+kdbgstream& kdbgstream::operator << (const QWidget* widget)
+{
+  QString string, temp;
+
+  if(widget==0)
+    {
+      string=(QString)"[Null pointer]";
+    } else {
+      temp.setNum((ulong)widget, 16);
+      string=(QString)"["+widget->className()+" pointer "
+        + "(0x" + temp + ")";
+      if(widget->name(0)==0)
+        {
+          string += " to unnamed widget, ";
+        } else {
+          string += (QString)" to widget " + widget->name() + ", ";
+        }
+      string += "geometry="
+        + QString().setNum(widget->width())
+        + "x"+QString().setNum(widget->height())
+        + "+"+QString().setNum(widget->x())
+        + "+"+QString().setNum(widget->y())
+        + "]";
+    }
+  if (!print)
+    {
+      return *this;
+    }
+  output += string;
+  if (output.at(output.length() -1 ) == '\n')
+    {
+      flush();
+    }
+  return *this;
+}
+
+
+
+
+
+kdbgstream& kdbgstream::operator<<( const QDateTime& time) {
+    *this << time.toString();
+    return *this;
+}
+kdbgstream& kdbgstream::operator<<( const QDate& date) {
+    *this << date.toString();
+
+    return *this;
+}
+kdbgstream& kdbgstream::operator<<( const QTime& time ) {
+    *this << time.toString();
+    return *this;
+}
+kdbgstream& kdbgstream::operator<<( const QPoint& p ) {
+    *this << "(" << p.x() << ", " << p.y() << ")";
+    return *this;
+}
+kdbgstream& kdbgstream::operator<<( const QSize& s ) {
+    *this << "[" << s.width() << "x" << s.height() << "]";
+    return *this;
+}
+kdbgstream& kdbgstream::operator<<( const QRect& r ) {
+    *this << "[" << r.left() << ", " << r.top() << " - " << r.right() << ", " << r.bottom() << "]";
+    return *this;
+}
+kdbgstream& kdbgstream::operator<<( const QRegion& reg ) {
+    *this<< "[ ";
+
+    QMemArray<QRect>rs=reg.rects();
+    for (uint i=0;i<rs.size();++i)
+        *this << QString("[%1, %2 - %3, %4] ").arg(rs[i].left()).arg(rs[i].top()).arg(rs[i].right()).arg(rs[i].bottom() ) ;
+
+    *this <<"]";
+    return *this;
+}
+kdbgstream& kdbgstream::operator<<( const KURL& u ) {
+    *this << u.prettyURL();
+    return *this;
+}
+kdbgstream& kdbgstream::operator<<( const QStringList& l ) {
+    *this << "(";
+    *this << l.join(",");
+    *this << ")";
+
+    return *this;
+}
+kdbgstream& kdbgstream::operator<<( const QColor& c ) {
+    if ( c.isValid() )
+        *this <<c.name();
+    else
+        *this << "(invalid/default)";
+    return *this;
+}
+kdbgstream& kdbgstream::operator<<( const QPen& p ) {
+    static const char* const s_penStyles[] = {
+        "NoPen", "SolidLine", "DashLine", "DotLine", "DashDotLine",
+        "DashDotDotLine" };
+    static const char* const s_capStyles[] = {
+        "FlatCap", "SquareCap", "RoundCap" };
+    *this << "[ style:";
+    *this << s_penStyles[ p.style() ];
+    *this << " width:";
+    *this << p.width();
+    *this << " color:";
+    if ( p.color().isValid() )
+        *this << p.color().name();
+    else
+        *this <<"(invalid/default)";
+    if ( p.width() > 0 )
+    {
+        *this << " capstyle:";
+        *this << s_capStyles[ p.capStyle() >> 4 ];
+
+    }
+    *this <<" ]";
+    return *this;
+}
+kdbgstream& kdbgstream::operator<<( const QBrush& b) {
+    static const char* const s_brushStyles[] = {
+        "NoBrush", "SolidPattern", "Dense1Pattern", "Dense2Pattern", "Dense3Pattern",
+        "Dense4Pattern", "Dense5Pattern", "Dense6Pattern", "Dense7Pattern",
+        "HorPattern", "VerPattern", "CrossPattern", "BDiagPattern", "FDiagPattern",
+        "DiagCrossPattern" };
+
+    *this <<"[ style: ";
+    *this <<s_brushStyles[ b.style() ];
+    *this <<" color: ";
+
+    if ( b.color().isValid() )
+        *this <<b.color().name() ;
+    else
+        *this <<"(invalid/default)";
+    if ( b.pixmap() )
+        *this <<" has a pixmap";
+    *this <<" ]";
+    return *this;
+}
+
+QString kdBacktrace(int levels)
+{
+    QString s;
+
+    void* trace[256];
+    int n = backtrace(trace, 256);
+    char** strings = backtrace_symbols (trace, n);
+
+    if ( levels != -1 )
+        n = ((n) < (levels) ? (n) : (levels));
+    s = "[\n";
+
+    for (int i = 0; i < n; ++i)
+        s += QString::number(i) +
+             QString::fromLatin1(": ") +
+             QString::fromLatin1(strings[i]) + QString::fromLatin1("\n");
+    s += "]\n";
+    free (strings);
+
+    return s;
+}
+
+QString kdBacktrace()
+{
+    return kdBacktrace(-1 );
+}
+
+void kdClearDebugConfig()
+{
+    delete kDebug_data->config;
+    kDebug_data->config = 0;
+}
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (__const char *__assertion, __const char *__file,
+                           unsigned int __line, __const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, __const char *__file,
+                                  unsigned int __line,
+                                  __const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+
+
+
+
+
+
+
+
+typedef long INT32;
+
+typedef short INT16;
+
+
+
+typedef signed char INT8;
+typedef unsigned long CARD32;
+
+typedef unsigned short CARD16;
+typedef unsigned char CARD8;
+
+typedef CARD32 BITS32;
+typedef CARD16 BITS16;
+
+
+typedef CARD8 BYTE;
+typedef CARD8 BOOL;
+
+template <class Z> class NETRArray {
+public:
+
+
+
+
+    NETRArray();
+
+
+
+
+
+    ~NETRArray();
+
+
+
+
+
+
+    Z &operator[](int);
+
+
+
+
+
+    int size() const { return sz; }
+
+
+
+
+    void reset();
+
+private:
+    int sz;
+    int capacity;
+    Z *d;
+};
+
+
+
+
+
+
+
+struct NETRootInfoPrivate {
+
+    Display *display;
+    NETSize rootSize;
+    Window root;
+    Window supportwindow;
+    const char *name;
+    int screen;
+
+
+
+    NETRArray<NETPoint> viewport;
+    NETRArray<NETRect> workarea;
+    NETSize geometry;
+    Window active;
+    Window *clients, *stacking, *virtual_roots, *kde_system_tray_windows;
+    NETRArray<const char *> desktop_names;
+    int number_of_desktops;
+    int current_desktop;
+
+    unsigned long clients_count, stacking_count, virtual_roots_count,
+        kde_system_tray_windows_count;
+
+    unsigned long properties[ 5 ];
+    unsigned long client_properties[ 5 ];
+
+    int ref;
+};
+
+
+
+
+
+
+
+struct NETWinInfoPrivate {
+    Display *display;
+    Window window, root;
+    NET::MappingState mapping_state;
+    Bool mapping_state_dirty;
+
+    NETRArray<NETIcon> icons;
+    int icon_count;
+
+    NETRect icon_geom, win_geom;
+    unsigned long state;
+    NETStrut strut, frame_strut;
+    NETRArray<NET::WindowType> types;
+    char *name, *visible_name, *icon_name, *visible_icon_name;
+    int desktop;
+    int pid;
+    int handled_icons;
+    Window kde_system_tray_win_for;
+    Time user_time;
+    char* startup_id;
+    Window transient_for, window_group;
+    unsigned long allowed_actions;
+
+    unsigned long properties[ 2 ];
+
+    int ref;
+};
+
+
+static Atom UTF8_STRING = 0;
+
+
+static Atom net_supported = 0;
+static Atom net_client_list = 0;
+static Atom net_client_list_stacking = 0;
+static Atom net_desktop_geometry = 0;
+static Atom net_desktop_viewport = 0;
+static Atom net_current_desktop = 0;
+static Atom net_desktop_names = 0;
+static Atom net_number_of_desktops = 0;
+static Atom net_active_window = 0;
+static Atom net_workarea = 0;
+static Atom net_supporting_wm_check = 0;
+static Atom net_virtual_roots = 0;
+
+
+static Atom net_close_window = 0;
+static Atom net_wm_moveresize = 0;
+
+
+static Atom net_wm_name = 0;
+static Atom net_wm_visible_name = 0;
+static Atom net_wm_icon_name = 0;
+static Atom net_wm_visible_icon_name = 0;
+static Atom net_wm_desktop = 0;
+static Atom net_wm_window_type = 0;
+static Atom net_wm_state = 0;
+static Atom net_wm_strut = 0;
+static Atom net_wm_icon_geometry = 0;
+static Atom net_wm_icon = 0;
+static Atom net_wm_pid = 0;
+static Atom net_wm_user_time = 0;
+static Atom net_wm_handled_icons = 0;
+static Atom net_startup_id = 0;
+static Atom net_wm_allowed_actions = 0;
+
+
+static Atom kde_net_system_tray_windows = 0;
+static Atom kde_net_wm_system_tray_window_for = 0;
+static Atom kde_net_wm_frame_strut = 0;
+static Atom kde_net_wm_window_type_override = 0;
+static Atom kde_net_wm_window_type_topmenu = 0;
+
+
+static Atom wm_protocols = 0;
+static Atom net_wm_ping = 0;
+
+
+static Atom net_wm_window_type_normal = 0;
+static Atom net_wm_window_type_desktop = 0;
+static Atom net_wm_window_type_dock = 0;
+static Atom net_wm_window_type_toolbar = 0;
+static Atom net_wm_window_type_menu = 0;
+static Atom net_wm_window_type_dialog = 0;
+static Atom net_wm_window_type_utility = 0;
+static Atom net_wm_window_type_splash = 0;
+
+
+static Atom net_wm_state_modal = 0;
+static Atom net_wm_state_sticky = 0;
+static Atom net_wm_state_max_vert = 0;
+static Atom net_wm_state_max_horiz = 0;
+static Atom net_wm_state_shaded = 0;
+static Atom net_wm_state_skip_taskbar = 0;
+static Atom net_wm_state_skip_pager = 0;
+static Atom net_wm_state_hidden = 0;
+static Atom net_wm_state_fullscreen = 0;
+static Atom net_wm_state_above = 0;
+static Atom net_wm_state_below = 0;
+static Atom net_wm_state_demands_attention = 0;
+
+
+static Atom net_wm_action_move = 0;
+static Atom net_wm_action_resize = 0;
+static Atom net_wm_action_minimize = 0;
+static Atom net_wm_action_shade = 0;
+static Atom net_wm_action_stick = 0;
+static Atom net_wm_action_max_vert = 0;
+static Atom net_wm_action_max_horiz = 0;
+static Atom net_wm_action_fullscreen = 0;
+static Atom net_wm_action_change_desk = 0;
+static Atom net_wm_action_close = 0;
+
+
+static Atom net_wm_state_stays_on_top = 0;
+
+
+static Atom xa_wm_state = 0;
+
+static Bool netwm_atoms_created = 0;
+const unsigned long netwm_sendevent_mask = ((1L<<20)|
+                                             (1L<<19));
+
+
+const long MAX_PROP_SIZE = 100000;
+
+static char *nstrdup(const char *s1) {
+    if (! s1) return (char *) 0;
+
+    int l = strlen(s1) + 1;
+    char *s2 = new char[l];
+    strncpy(s2, s1, l);
+    return s2;
+}
+
+
+static char *nstrndup(const char *s1, int l) {
+    if (! s1 || l == 0) return (char *) 0;
+
+    char *s2 = new char[l+1];
+    strncpy(s2, s1, l);
+    s2[l] = '\0';
+    return s2;
+}
+
+
+static Window *nwindup(Window *w1, int n) {
+    if (! w1 || n == 0) return (Window *) 0;
+
+    Window *w2 = new Window[n];
+    while (n--) w2[n] = w1[n];
+    return w2;
+}
+
+
+static void refdec_nri(NETRootInfoPrivate *p) {
+
+
+
+
+
+    if (! --p->ref) {
+
+
+
+
+
+        if (p->name) delete [] p->name;
+        if (p->stacking) delete [] p->stacking;
+        if (p->clients) delete [] p->clients;
+        if (p->virtual_roots) delete [] p->virtual_roots;
+        if (p->kde_system_tray_windows) delete [] p->kde_system_tray_windows;
+
+        int i;
+        for (i = 0; i < p->desktop_names.size(); i++)
+            if (p->desktop_names[i]) delete [] p->desktop_names[i];
+    }
+}
+
+
+static void refdec_nwi(NETWinInfoPrivate *p) {
+
+
+
+
+
+    if (! --p->ref) {
+
+
+
+
+
+        if (p->name) delete [] p->name;
+        if (p->visible_name) delete [] p->visible_name;
+        if (p->icon_name) delete [] p->icon_name;
+        if (p->visible_icon_name) delete [] p->visible_icon_name;
+        if (p->startup_id) delete[] p->startup_id;
+
+        int i;
+        for (i = 0; i < p->icons.size(); i++)
+            if (p->icons[i].data) delete [] p->icons[i].data;
+    }
+}
+
+
+static int wcmp(const void *a, const void *b) {
+    return *((Window *) a) - *((Window *) b);
+}
+
+
+static const int netAtomCount = 69;
+static void create_atoms(Display *d) {
+    static const char * const names[netAtomCount] =
+    {
+        "UTF8_STRING",
+            "_NET_SUPPORTED",
+            "_NET_SUPPORTING_WM_CHECK",
+            "_NET_CLIENT_LIST",
+            "_NET_CLIENT_LIST_STACKING",
+            "_NET_NUMBER_OF_DESKTOPS",
+            "_NET_DESKTOP_GEOMETRY",
+            "_NET_DESKTOP_VIEWPORT",
+            "_NET_CURRENT_DESKTOP",
+            "_NET_DESKTOP_NAMES",
+            "_NET_ACTIVE_WINDOW",
+            "_NET_WORKAREA",
+            "_NET_VIRTUAL_ROOTS",
+            "_NET_CLOSE_WINDOW",
+
+            "_NET_WM_MOVERESIZE",
+            "_NET_WM_NAME",
+            "_NET_WM_VISIBLE_NAME",
+            "_NET_WM_ICON_NAME",
+            "_NET_WM_VISIBLE_ICON_NAME",
+            "_NET_WM_DESKTOP",
+            "_NET_WM_WINDOW_TYPE",
+            "_NET_WM_STATE",
+            "_NET_WM_STRUT",
+            "_NET_WM_ICON_GEOMETRY",
+            "_NET_WM_ICON",
+            "_NET_WM_PID",
+            "_NET_WM_USER_TIME",
+            "_NET_WM_HANDLED_ICONS",
+            "_KDE_STARTUP_ID",
+
+
+            "_NET_AM_ALLOWED_ACTIONS",
+            "_NET_WM_PING",
+
+            "_NET_WM_WINDOW_TYPE_NORMAL",
+            "_NET_WM_WINDOW_TYPE_DESKTOP",
+            "_NET_WM_WINDOW_TYPE_DOCK",
+            "_NET_WM_WINDOW_TYPE_TOOLBAR",
+            "_NET_WM_WINDOW_TYPE_MENU",
+            "_NET_WM_WINDOW_TYPE_DIALOG",
+            "_NET_WM_WINDOW_TYPE_UTILITY",
+            "_NET_WM_WINDOW_TYPE_SPLASH",
+
+            "_NET_WM_STATE_MODAL",
+            "_NET_WM_STATE_STICKY",
+            "_NET_WM_STATE_MAXIMIZED_VERT",
+            "_NET_WM_STATE_MAXIMIZED_HORZ",
+            "_NET_WM_STATE_SHADED",
+            "_NET_WM_STATE_SKIP_TASKBAR",
+            "_NET_WM_STATE_SKIP_PAGER",
+            "_NET_WM_STATE_HIDDEN",
+            "_NET_WM_STATE_FULLSCREEN",
+            "_NET_WM_STATE_ABOVE",
+            "_NET_WM_STATE_BELOW",
+            "_NET_WM_STATE_DEMANDS_ATTENTION",
+
+            "_NET_WM_ACTION_MOVE",
+            "_NET_WM_ACTION_RESIZE",
+            "_NET_WM_ACTION_MINIMIZE",
+            "_NET_WM_ACTION_SHADE",
+            "_NET_WM_ACTION_STICK",
+            "_NET_WM_ACTION_MAXIMIZE_VERT",
+            "_NET_WM_ACTION_MAXIMIZE_HORZ",
+            "_NET_WM_ACTION_FULLSCREEN",
+            "_NET_WM_ACTION_CHANGE_DESKTOP",
+            "_NET_WM_ACTION_CLOSE",
+
+            "_NET_WM_STATE_STAYS_ON_TOP",
+
+            "_KDE_NET_SYSTEM_TRAY_WINDOWS",
+            "_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR",
+            "_KDE_NET_WM_FRAME_STRUT",
+            "_KDE_NET_WM_WINDOW_TYPE_OVERRIDE",
+            "_KDE_NET_WM_WINDOW_TYPE_TOPMENU",
+
+            "WM_STATE",
+            "WM_PROTOCOLS"
+            };
+
+    Atom atoms[netAtomCount], *atomsp[netAtomCount] =
+    {
+        &UTF8_STRING,
+            &net_supported,
+            &net_supporting_wm_check,
+            &net_client_list,
+            &net_client_list_stacking,
+            &net_number_of_desktops,
+            &net_desktop_geometry,
+            &net_desktop_viewport,
+            &net_current_desktop,
+            &net_desktop_names,
+            &net_active_window,
+            &net_workarea,
+            &net_virtual_roots,
+            &net_close_window,
+
+            &net_wm_moveresize,
+            &net_wm_name,
+            &net_wm_visible_name,
+            &net_wm_icon_name,
+            &net_wm_visible_icon_name,
+            &net_wm_desktop,
+            &net_wm_window_type,
+            &net_wm_state,
+            &net_wm_strut,
+            &net_wm_icon_geometry,
+            &net_wm_icon,
+            &net_wm_pid,
+            &net_wm_user_time,
+            &net_wm_handled_icons,
+            &net_startup_id,
+            &net_wm_allowed_actions,
+            &net_wm_ping,
+
+            &net_wm_window_type_normal,
+            &net_wm_window_type_desktop,
+            &net_wm_window_type_dock,
+            &net_wm_window_type_toolbar,
+            &net_wm_window_type_menu,
+            &net_wm_window_type_dialog,
+            &net_wm_window_type_utility,
+            &net_wm_window_type_splash,
+
+            &net_wm_state_modal,
+            &net_wm_state_sticky,
+            &net_wm_state_max_vert,
+            &net_wm_state_max_horiz,
+            &net_wm_state_shaded,
+            &net_wm_state_skip_taskbar,
+            &net_wm_state_skip_pager,
+            &net_wm_state_hidden,
+            &net_wm_state_fullscreen,
+            &net_wm_state_above,
+            &net_wm_state_below,
+            &net_wm_state_demands_attention,
+
+            &net_wm_action_move,
+            &net_wm_action_resize,
+            &net_wm_action_minimize,
+            &net_wm_action_shade,
+            &net_wm_action_stick,
+            &net_wm_action_max_vert,
+            &net_wm_action_max_horiz,
+            &net_wm_action_fullscreen,
+            &net_wm_action_change_desk,
+            &net_wm_action_close,
+
+            &net_wm_state_stays_on_top,
+
+            &kde_net_system_tray_windows,
+            &kde_net_wm_system_tray_window_for,
+            &kde_net_wm_frame_strut,
+            &kde_net_wm_window_type_override,
+            &kde_net_wm_window_type_topmenu,
+
+            &xa_wm_state,
+            &wm_protocols
+            };
+
+    int i = netAtomCount;
+    while (i--)
+        atoms[i] = 0;
+
+    XInternAtoms(d, (char **) names, netAtomCount, 0, atoms);
+
+    i = netAtomCount;
+    while (i--)
+        *atomsp[i] = atoms[i];
+
+    netwm_atoms_created = 1;
+}
+
+
+static void readIcon(NETWinInfoPrivate *p) {
+
+
+
+
+
+    Atom type_ret;
+    int format_ret;
+    unsigned long nitems_ret = 0, after_ret = 0;
+    unsigned char *data_ret = 0;
+
+
+    for (int i = 0; i < p->icons.size(); i++)
+        delete [] p->icons[i].data;
+    p->icons.reset();
+    p->icon_count = 0;
+
+
+    unsigned char *buffer = 0;
+    unsigned long offset = 0;
+    unsigned long buffer_offset = 0;
+    unsigned long bufsize = 0;
+
+
+    do {
+        if (XGetWindowProperty(p->display, p->window, net_wm_icon, offset,
+                               MAX_PROP_SIZE, 0, ((Atom) 6), &type_ret,
+                               &format_ret, &nitems_ret, &after_ret, &data_ret)
+            == Success) {
+            if (!bufsize)
+            {
+               if (nitems_ret < 3 || type_ret != ((Atom) 6) ||
+                  format_ret != 32) {
+
+
+
+
+                  if ( data_ret )
+                     XFree(data_ret);
+                  return;
+               }
+
+               bufsize = nitems_ret * sizeof(long) + after_ret;
+               buffer = (unsigned char *) malloc(bufsize);
+            }
+            else if (buffer_offset + nitems_ret*sizeof(long) > bufsize)
+            {
+fprintf(stderr, "NETWM: Warning readIcon() needs buffer adjustment!\n");
+               bufsize = buffer_offset + nitems_ret * sizeof(long) + after_ret;
+               buffer = (unsigned char *) realloc(buffer, bufsize);
+            }
+            memcpy((buffer + buffer_offset), data_ret, nitems_ret * sizeof(long));
+            buffer_offset += nitems_ret * sizeof(long);
+            offset += nitems_ret;
+
+            if ( data_ret )
+                XFree(data_ret);
+        } else {
+            if (buffer)
+               free(buffer);
+            return;
+        }
+    }
+    while (after_ret > 0);
+
+    CARD32 *data32;
+    unsigned long i, j, k, sz, s;
+    unsigned long *d = (unsigned long *) buffer;
+    for (i = 0, j = 0; i < bufsize; i++) {
+        p->icons[j].size.width = *d++;
+        i += sizeof(long);
+        p->icons[j].size.height = *d++;
+        i += sizeof(long);
+
+        sz = p->icons[j].size.width * p->icons[j].size.height;
+        s = sz * sizeof(long);
+
+        if ( i + s - 1 > bufsize ) {
+            break;
+        }
+
+        if (p->icons[j].data) delete [] p->icons[j].data;
+        data32 = new CARD32[sz];
+        p->icons[j].data = (unsigned char *) data32;
+        for (k = 0; k < sz; k++, i += sizeof(long)) {
+            *data32++ = (CARD32) *d++;
+        }
+        j++;
+        p->icon_count++;
+    }
+
+
+
+
+
+    free(buffer);
+}
+
+
+template <class Z>
+NETRArray<Z>::NETRArray()
+  : sz(0), capacity(2)
+{
+    d = (Z*) calloc(capacity, sizeof(Z));
+}
+
+
+template <class Z>
+NETRArray<Z>::~NETRArray() {
+    free(d);
+}
+
+
+template <class Z>
+void NETRArray<Z>::reset() {
+    sz = 0;
+    capacity = 2;
+    d = (Z*) realloc(d, sizeof(Z)*capacity);
+    memset( (void*) d, 0, sizeof(Z)*capacity );
+}
+
+template <class Z>
+Z &NETRArray<Z>::operator[](int index) {
+    if (index >= capacity) {
+
+
+
+        int newcapacity = 2*capacity > index+1 ? 2*capacity : index+1;
+
+        d = (Z*) realloc(d, sizeof(Z)*newcapacity);
+        memset( (void*) &d[capacity], 0, sizeof(Z)*(newcapacity-capacity) );
+        capacity = newcapacity;
+    }
+    if (index >= sz)
+        sz = index + 1;
+
+    return d[index];
+}
+
+
+
+
+NETRootInfo::NETRootInfo(Display *display, Window supportWindow, const char *wmName,
+                         const unsigned long properties[], int properties_size,
+                         int screen, bool doActivate)
+{
+
+
+
+
+
+    p = new NETRootInfoPrivate;
+    p->ref = 1;
+
+    p->display = display;
+    p->name = nstrdup(wmName);
+
+    if (screen != -1) {
+        p->screen = screen;
+    } else {
+        p->screen = (((_XPrivDisplay)p->display)->default_screen);
+    }
+
+    p->root = ((&((_XPrivDisplay)p->display)->screens[p->screen])->root);
+    p->supportwindow = supportWindow;
+    p->number_of_desktops = p->current_desktop = 0;
+    p->active = None;
+    p->clients = p->stacking = p->virtual_roots = (Window *) 0;
+    p->clients_count = p->stacking_count = p->virtual_roots_count = 0;
+    p->kde_system_tray_windows = 0;
+    p->kde_system_tray_windows_count = 0;
+    setDefaultProperties();
+    if( properties_size > PROPERTIES_SIZE ) {
+        fprintf( stderr, "NETRootInfo::NETRootInfo(): properties array too large\n");
+        properties_size = PROPERTIES_SIZE;
+    }
+    for( int i = 0; i < properties_size; ++i )
+        p->properties[ i ] = properties[ i ];
+
+    p->properties[ PROTOCOLS ] |= ( Supported | SupportingWMCheck );
+    p->client_properties[ PROTOCOLS ] = DesktopNames
+                                        | WMPing;
+    p->client_properties[ PROTOCOLS2 ] = 0;
+
+    role = WindowManager;
+
+    if (! netwm_atoms_created) create_atoms(p->display);
+
+    if (doActivate) activate();
+}
+
+NETRootInfo::NETRootInfo(Display *display, Window supportWindow, const char *wmName,
+                         unsigned long properties, int screen, bool doActivate)
+{
+
+
+
+
+
+    p = new NETRootInfoPrivate;
+    p->ref = 1;
+
+    p->display = display;
+    p->name = nstrdup(wmName);
+
+    if (screen != -1) {
+        p->screen = screen;
+    } else {
+        p->screen = (((_XPrivDisplay)p->display)->default_screen);
+    }
+
+    p->root = ((&((_XPrivDisplay)p->display)->screens[p->screen])->root);
+    p->supportwindow = supportWindow;
+    p->number_of_desktops = p->current_desktop = 0;
+    p->active = None;
+    p->clients = p->stacking = p->virtual_roots = (Window *) 0;
+    p->clients_count = p->stacking_count = p->virtual_roots_count = 0;
+    p->kde_system_tray_windows = 0;
+    p->kde_system_tray_windows_count = 0;
+    setDefaultProperties();
+    p->properties[ PROTOCOLS ] = properties;
+
+    p->properties[ PROTOCOLS ] |= ( Supported | SupportingWMCheck );
+    p->client_properties[ PROTOCOLS ] = DesktopNames
+                                        | WMPing;
+    p->client_properties[ PROTOCOLS2 ] = 0;
+
+    role = WindowManager;
+
+    if (! netwm_atoms_created) create_atoms(p->display);
+
+    if (doActivate) activate();
+}
+
+
+NETRootInfo::NETRootInfo(Display *display, const unsigned long properties[], int properties_size,
+                         int screen, bool doActivate)
+{
+
+
+
+
+
+    p = new NETRootInfoPrivate;
+    p->ref = 1;
+
+    p->name = 0;
+
+    p->display = display;
+
+    if (screen != -1) {
+        p->screen = screen;
+    } else {
+        p->screen = (((_XPrivDisplay)p->display)->default_screen);
+    }
+
+    p->root = ((&((_XPrivDisplay)p->display)->screens[p->screen])->root);
+    p->rootSize.width = (((&((_XPrivDisplay)p->display)->screens[p->screen]))->width);
+    p->rootSize.height = (((&((_XPrivDisplay)p->display)->screens[p->screen]))->height);
+
+    p->supportwindow = None;
+    p->number_of_desktops = p->current_desktop = 0;
+    p->active = None;
+    p->clients = p->stacking = p->virtual_roots = (Window *) 0;
+    p->clients_count = p->stacking_count = p->virtual_roots_count = 0;
+    p->kde_system_tray_windows = 0;
+    p->kde_system_tray_windows_count = 0;
+    setDefaultProperties();
+    if( properties_size > PROPERTIES_SIZE ) {
+        fprintf( stderr, "NETWinInfo::NETWinInfo(): properties array too large\n");
+        properties_size = PROPERTIES_SIZE;
+    }
+    for( int i = 0; i < properties_size; ++i )
+        p->client_properties[ i ] = properties[ i ];
+    for( int i = 0; i < PROPERTIES_SIZE; ++i )
+        p->properties[ i ] = 0;
+
+    role = Client;
+
+    if (! netwm_atoms_created) create_atoms(p->display);
+
+    if (doActivate) activate();
+}
+
+NETRootInfo::NETRootInfo(Display *display, unsigned long properties, int screen,
+                         bool doActivate)
+{
+
+
+
+
+
+    p = new NETRootInfoPrivate;
+    p->ref = 1;
+
+    p->name = 0;
+
+    p->display = display;
+
+    if (screen != -1) {
+        p->screen = screen;
+    } else {
+        p->screen = (((_XPrivDisplay)p->display)->default_screen);
+    }
+
+    p->root = ((&((_XPrivDisplay)p->display)->screens[p->screen])->root);
+    p->rootSize.width = (((&((_XPrivDisplay)p->display)->screens[p->screen]))->width);
+    p->rootSize.height = (((&((_XPrivDisplay)p->display)->screens[p->screen]))->height);
+
+    p->supportwindow = None;
+    p->number_of_desktops = p->current_desktop = 0;
+    p->active = None;
+    p->clients = p->stacking = p->virtual_roots = (Window *) 0;
+    p->clients_count = p->stacking_count = p->virtual_roots_count = 0;
+    p->kde_system_tray_windows = 0;
+    p->kde_system_tray_windows_count = 0;
+    setDefaultProperties();
+    p->client_properties[ PROTOCOLS ] = properties;
+    for( int i = 0; i < PROPERTIES_SIZE; ++i )
+        p->properties[ i ] = 0;
+
+    role = Client;
+
+    if (! netwm_atoms_created) create_atoms(p->display);
+
+    if (doActivate) activate();
+}
+
+
+NETRootInfo2::NETRootInfo2(Display *display, Window supportWindow, const char *wmName,
+                         unsigned long properties[], int properties_size,
+                         int screen, bool doActivate)
+    : NETRootInfo( display, supportWindow, wmName, properties, properties_size,
+        screen, doActivate )
+{
+}
+
+
+
+NETRootInfo::NETRootInfo(const NETRootInfo &rootinfo) {
+
+
+
+
+
+    p = rootinfo.p;
+    role = rootinfo.role;
+
+    p->ref++;
+}
+
+
+
+
+NETRootInfo::~NETRootInfo() {
+    refdec_nri(p);
+
+    if (! p->ref) delete p;
+}
+
+
+void NETRootInfo::setDefaultProperties()
+{
+    p->properties[ PROTOCOLS ] = Supported | SupportingWMCheck;
+    p->properties[ WINDOW_TYPES ] = NormalMask | DesktopMask | DockMask
+        | ToolbarMask | MenuMask | DialogMask;
+    p->properties[ STATES ] = Modal | Sticky | MaxVert | MaxHoriz | Shaded
+        | SkipTaskbar | StaysOnTop;
+    p->properties[ PROTOCOLS2 ] = 0;
+    p->properties[ ACTIONS ] = 0;
+    p->client_properties[ PROTOCOLS ] = 0;
+    p->client_properties[ WINDOW_TYPES ] = 0;
+    p->client_properties[ STATES ] = 0;
+    p->client_properties[ PROTOCOLS2 ] = 0;
+    p->client_properties[ ACTIONS ] = 0;
+}
+
+void NETRootInfo::activate() {
+    if (role == WindowManager) {
+
+
+
+
+
+
+        setSupported();
+    } else {
+
+
+
+
+
+        update(p->client_properties);
+    }
+}
+
+
+void NETRootInfo::setClientList(Window *windows, unsigned int count) {
+    if (role != WindowManager) return;
+
+    p->clients_count = count;
+
+    if (p->clients) delete [] p->clients;
+    p->clients = nwindup(windows, count);
+
+
+
+
+
+
+    XChangeProperty(p->display, p->root, net_client_list, ((Atom) 33), 32,
+                    0, (unsigned char *)p->clients,
+                    p->clients_count);
+}
+
+
+void NETRootInfo::setClientListStacking(Window *windows, unsigned int count) {
+    if (role != WindowManager) return;
+
+    p->stacking_count = count;
+    if (p->stacking) delete [] p->stacking;
+    p->stacking = nwindup(windows, count);
+
+
+
+
+
+
+
+    XChangeProperty(p->display, p->root, net_client_list_stacking, ((Atom) 33), 32,
+                    0, (unsigned char *) p->stacking,
+                    p->stacking_count);
+}
+
+
+void NETRootInfo::setKDESystemTrayWindows(Window *windows, unsigned int count) {
+    if (role != WindowManager) return;
+
+    p->kde_system_tray_windows_count = count;
+    if (p->kde_system_tray_windows) delete [] p->kde_system_tray_windows;
+    p->kde_system_tray_windows = nwindup(windows, count);
+
+
+
+
+
+
+
+    XChangeProperty(p->display, p->root, kde_net_system_tray_windows, ((Atom) 33), 32,
+                    0,
+                    (unsigned char *) p->kde_system_tray_windows,
+                    p->kde_system_tray_windows_count);
+}
+
+
+void NETRootInfo::setNumberOfDesktops(int numberOfDesktops) {
+
+
+
+
+
+
+
+    if (role == WindowManager) {
+        p->number_of_desktops = numberOfDesktops;
+        long d = numberOfDesktops;
+        XChangeProperty(p->display, p->root, net_number_of_desktops, ((Atom) 6), 32,
+                        0, (unsigned char *) &d, 1);
+    } else {
+        XEvent e;
+
+        e.xclient.type = 33;
+        e.xclient.message_type = net_number_of_desktops;
+        e.xclient.display = p->display;
+        e.xclient.window = p->root;
+        e.xclient.format = 32;
+        e.xclient.data.l[0] = numberOfDesktops;
+        e.xclient.data.l[1] = 0l;
+        e.xclient.data.l[2] = 0l;
+        e.xclient.data.l[3] = 0l;
+        e.xclient.data.l[4] = 0l;
+
+        XSendEvent(p->display, p->root, 0, netwm_sendevent_mask, &e);
+    }
+}
+
+
+void NETRootInfo::setCurrentDesktop(int desktop) {
+
+
+
+
+
+
+
+    if (role == WindowManager) {
+        p->current_desktop = desktop;
+        long d = p->current_desktop - 1;
+        XChangeProperty(p->display, p->root, net_current_desktop, ((Atom) 6), 32,
+                        0, (unsigned char *) &d, 1);
+    } else {
+        XEvent e;
+
+        e.xclient.type = 33;
+        e.xclient.message_type = net_current_desktop;
+        e.xclient.display = p->display;
+        e.xclient.window = p->root;
+        e.xclient.format = 32;
+        e.xclient.data.l[0] = desktop - 1;
+        e.xclient.data.l[1] = 0l;
+        e.xclient.data.l[2] = 0l;
+        e.xclient.data.l[3] = 0l;
+        e.xclient.data.l[4] = 0l;
+
+        XSendEvent(p->display, p->root, 0, netwm_sendevent_mask, &e);
+    }
+}
+
+
+void NETRootInfo::setDesktopName(int desktop, const char *desktopName) {
+
+    if (desktop < 1) return;
+
+    if (p->desktop_names[desktop - 1]) delete [] p->desktop_names[desktop - 1];
+    p->desktop_names[desktop - 1] = nstrdup(desktopName);
+
+    unsigned int i, proplen,
+        num = ((p->number_of_desktops > p->desktop_names.size()) ?
+               p->number_of_desktops : p->desktop_names.size());
+    for (i = 0, proplen = 0; i < num; i++)
+        proplen += (p->desktop_names[i] != 0 ? strlen(p->desktop_names[i])+1 : 1 );
+
+    char *prop = new char[proplen], *propp = prop;
+
+    for (i = 0; i < num; i++)
+        if (p->desktop_names[i]) {
+            strcpy(propp, p->desktop_names[i]);
+            propp += strlen(p->desktop_names[i]) + 1;
+        } else
+            *propp++ = '\0';
+    XChangeProperty(p->display, p->root, net_desktop_names, UTF8_STRING, 8,
+                    0, (unsigned char *) prop, proplen);
+
+    delete [] prop;
+}
+
+
+void NETRootInfo::setDesktopGeometry(int , const NETSize &geometry) {
+
+
+
+
+
+
+    if (role == WindowManager) {
+        p->geometry = geometry;
+
+        long data[2];
+        data[0] = p->geometry.width;
+        data[1] = p->geometry.height;
+
+        XChangeProperty(p->display, p->root, net_desktop_geometry, ((Atom) 6), 32,
+                        0, (unsigned char *) data, 2);
+    } else {
+        XEvent e;
+
+        e.xclient.type = 33;
+        e.xclient.message_type = net_desktop_geometry;
+        e.xclient.display = p->display;
+        e.xclient.window = p->root;
+        e.xclient.format = 32;
+        e.xclient.data.l[0] = geometry.width;
+        e.xclient.data.l[1] = geometry.height;
+        e.xclient.data.l[2] = 0l;
+        e.xclient.data.l[3] = 0l;
+        e.xclient.data.l[4] = 0l;
+
+        XSendEvent(p->display, p->root, 0, netwm_sendevent_mask, &e);
+    }
+}
+
+
+void NETRootInfo::setDesktopViewport(int desktop, const NETPoint &viewport) {
+
+
+
+
+
+
+    if (desktop < 1) return;
+
+    if (role == WindowManager) {
+        p->viewport[desktop - 1] = viewport;
+
+        int d, i, l;
+        l = p->number_of_desktops * 2;
+        long *data = new long[l];
+        for (d = 0, i = 0; d < p->number_of_desktops; d++) {
+            data[i++] = p->viewport[d].x;
+            data[i++] = p->viewport[d].y;
+        }
+
+        XChangeProperty(p->display, p->root, net_desktop_viewport, ((Atom) 6), 32,
+                        0, (unsigned char *) data, l);
+
+        delete [] data;
+    } else {
+        XEvent e;
+
+        e.xclient.type = 33;
+        e.xclient.message_type = net_desktop_viewport;
+        e.xclient.display = p->display;
+        e.xclient.window = p->root;
+        e.xclient.format = 32;
+        e.xclient.data.l[0] = viewport.x;
+        e.xclient.data.l[1] = viewport.y;
+        e.xclient.data.l[2] = 0l;
+        e.xclient.data.l[3] = 0l;
+        e.xclient.data.l[4] = 0l;
+
+        XSendEvent(p->display, p->root, 0, netwm_sendevent_mask, &e);
+    }
+}
+
+
+void NETRootInfo::setSupported() {
+    if (role != WindowManager) {
+
+
+
+
+        return;
+    }
+
+    Atom atoms[netAtomCount];
+    int pnum = 2;
+
+
+    atoms[0] = net_supported;
+    atoms[1] = net_supporting_wm_check;
+
+    if (p->properties[ PROTOCOLS ] & ClientList)
+        atoms[pnum++] = net_client_list;
+
+    if (p->properties[ PROTOCOLS ] & ClientListStacking)
+        atoms[pnum++] = net_client_list_stacking;
+
+    if (p->properties[ PROTOCOLS ] & NumberOfDesktops)
+        atoms[pnum++] = net_number_of_desktops;
+
+    if (p->properties[ PROTOCOLS ] & DesktopGeometry)
+        atoms[pnum++] = net_desktop_geometry;
+
+    if (p->properties[ PROTOCOLS ] & DesktopViewport)
+        atoms[pnum++] = net_desktop_viewport;
+
+    if (p->properties[ PROTOCOLS ] & CurrentDesktop)
+        atoms[pnum++] = net_current_desktop;
+
+    if (p->properties[ PROTOCOLS ] & DesktopNames)
+        atoms[pnum++] = net_desktop_names;
+
+    if (p->properties[ PROTOCOLS ] & ActiveWindow)
+        atoms[pnum++] = net_active_window;
+
+    if (p->properties[ PROTOCOLS ] & WorkArea)
+        atoms[pnum++] = net_workarea;
+
+    if (p->properties[ PROTOCOLS ] & VirtualRoots)
+        atoms[pnum++] = net_virtual_roots;
+
+    if (p->properties[ PROTOCOLS ] & CloseWindow)
+        atoms[pnum++] = net_close_window;
+
+
+
+    if (p->properties[ PROTOCOLS ] & WMMoveResize)
+        atoms[pnum++] = net_wm_moveresize;
+
+    if (p->properties[ PROTOCOLS ] & WMName)
+        atoms[pnum++] = net_wm_name;
+
+    if (p->properties[ PROTOCOLS ] & WMVisibleName)
+        atoms[pnum++] = net_wm_visible_name;
+
+    if (p->properties[ PROTOCOLS ] & WMIconName)
+        atoms[pnum++] = net_wm_icon_name;
+
+    if (p->properties[ PROTOCOLS ] & WMVisibleIconName)
+        atoms[pnum++] = net_wm_visible_icon_name;
+
+    if (p->properties[ PROTOCOLS ] & WMDesktop)
+        atoms[pnum++] = net_wm_desktop;
+
+    if (p->properties[ PROTOCOLS ] & WMWindowType) {
+        atoms[pnum++] = net_wm_window_type;
+
+
+        if (p->properties[ WINDOW_TYPES ] & NormalMask)
+            atoms[pnum++] = net_wm_window_type_normal;
+        if (p->properties[ WINDOW_TYPES ] & DesktopMask)
+            atoms[pnum++] = net_wm_window_type_desktop;
+        if (p->properties[ WINDOW_TYPES ] & DockMask)
+            atoms[pnum++] = net_wm_window_type_dock;
+        if (p->properties[ WINDOW_TYPES ] & ToolbarMask)
+            atoms[pnum++] = net_wm_window_type_toolbar;
+        if (p->properties[ WINDOW_TYPES ] & MenuMask)
+            atoms[pnum++] = net_wm_window_type_menu;
+        if (p->properties[ WINDOW_TYPES ] & DialogMask)
+            atoms[pnum++] = net_wm_window_type_dialog;
+        if (p->properties[ WINDOW_TYPES ] & UtilityMask)
+            atoms[pnum++] = net_wm_window_type_utility;
+        if (p->properties[ WINDOW_TYPES ] & SplashMask)
+            atoms[pnum++] = net_wm_window_type_splash;
+
+        if (p->properties[ WINDOW_TYPES ] & OverrideMask)
+            atoms[pnum++] = kde_net_wm_window_type_override;
+        if (p->properties[ WINDOW_TYPES ] & TopMenuMask)
+            atoms[pnum++] = kde_net_wm_window_type_topmenu;
+    }
+
+    if (p->properties[ PROTOCOLS ] & WMState) {
+        atoms[pnum++] = net_wm_state;
+
+
+        if (p->properties[ STATES ] & Modal)
+            atoms[pnum++] = net_wm_state_modal;
+        if (p->properties[ STATES ] & Sticky)
+            atoms[pnum++] = net_wm_state_sticky;
+        if (p->properties[ STATES ] & MaxVert)
+            atoms[pnum++] = net_wm_state_max_vert;
+        if (p->properties[ STATES ] & MaxHoriz)
+            atoms[pnum++] = net_wm_state_max_horiz;
+        if (p->properties[ STATES ] & Shaded)
+            atoms[pnum++] = net_wm_state_shaded;
+        if (p->properties[ STATES ] & SkipTaskbar)
+            atoms[pnum++] = net_wm_state_skip_taskbar;
+        if (p->properties[ STATES ] & SkipPager)
+            atoms[pnum++] = net_wm_state_skip_pager;
+        if (p->properties[ STATES ] & Hidden)
+            atoms[pnum++] = net_wm_state_hidden;
+        if (p->properties[ STATES ] & FullScreen)
+            atoms[pnum++] = net_wm_state_fullscreen;
+        if (p->properties[ STATES ] & KeepAbove)
+            atoms[pnum++] = net_wm_state_above;
+        if (p->properties[ STATES ] & KeepBelow)
+            atoms[pnum++] = net_wm_state_below;
+        if (p->properties[ STATES ] & DemandsAttention)
+            atoms[pnum++] = net_wm_state_demands_attention;
+
+        if (p->properties[ STATES ] & StaysOnTop)
+            atoms[pnum++] = net_wm_state_stays_on_top;
+    }
+
+    if (p->properties[ PROTOCOLS ] & WMStrut)
+        atoms[pnum++] = net_wm_strut;
+
+    if (p->properties[ PROTOCOLS ] & WMIconGeometry)
+        atoms[pnum++] = net_wm_icon_geometry;
+
+    if (p->properties[ PROTOCOLS ] & WMIcon)
+        atoms[pnum++] = net_wm_icon;
+
+    if (p->properties[ PROTOCOLS ] & WMPid)
+        atoms[pnum++] = net_wm_pid;
+
+    if (p->properties[ PROTOCOLS ] & WMHandledIcons)
+        atoms[pnum++] = net_wm_handled_icons;
+
+    if (p->properties[ PROTOCOLS ] & WMPing)
+        atoms[pnum++] = net_wm_ping;
+
+    if (p->properties[ PROTOCOLS2 ] & WM2UserTime)
+        atoms[pnum++] = net_wm_user_time;
+
+    if (p->properties[ PROTOCOLS2 ] & WM2StartupId)
+        atoms[pnum++] = net_startup_id;
+
+    if (p->properties[ PROTOCOLS2 ] & WM2AllowedActions) {
+        atoms[pnum++] = net_wm_allowed_actions;
+
+
+        if (p->properties[ ACTIONS ] & ActionMove)
+            atoms[pnum++] = net_wm_action_move;
+        if (p->properties[ ACTIONS ] & ActionResize)
+            atoms[pnum++] = net_wm_action_resize;
+        if (p->properties[ ACTIONS ] & ActionMinimize)
+            atoms[pnum++] = net_wm_action_minimize;
+        if (p->properties[ ACTIONS ] & ActionShade)
+            atoms[pnum++] = net_wm_action_shade;
+        if (p->properties[ ACTIONS ] & ActionStick)
+            atoms[pnum++] = net_wm_action_stick;
+        if (p->properties[ ACTIONS ] & ActionMaxVert)
+            atoms[pnum++] = net_wm_action_max_vert;
+        if (p->properties[ ACTIONS ] & ActionMaxHoriz)
+            atoms[pnum++] = net_wm_action_max_horiz;
+        if (p->properties[ ACTIONS ] & ActionFullScreen)
+            atoms[pnum++] = net_wm_action_fullscreen;
+        if (p->properties[ ACTIONS ] & ActionChangeDesktop)
+            atoms[pnum++] = net_wm_action_change_desk;
+        if (p->properties[ ACTIONS ] & ActionClose)
+            atoms[pnum++] = net_wm_action_close;
+    }
+
+
+    if (p->properties[ PROTOCOLS ] & KDESystemTrayWindows)
+        atoms[pnum++] = kde_net_system_tray_windows;
+
+    if (p->properties[ PROTOCOLS ] & WMKDESystemTrayWinFor)
+        atoms[pnum++] = kde_net_wm_system_tray_window_for;
+
+    if (p->properties[ PROTOCOLS ] & WMKDEFrameStrut)
+        atoms[pnum++] = kde_net_wm_frame_strut;
+
+    XChangeProperty(p->display, p->root, net_supported, ((Atom) 4), 32,
+                    0, (unsigned char *) atoms, pnum);
+    XChangeProperty(p->display, p->root, net_supporting_wm_check, ((Atom) 33), 32,
+                    0, (unsigned char *) &(p->supportwindow), 1);
+    XChangeProperty(p->display, p->supportwindow, net_supporting_wm_check,
+                    ((Atom) 33), 32, 0,
+                    (unsigned char *) &(p->supportwindow), 1);
+    XChangeProperty(p->display, p->supportwindow, net_wm_name, UTF8_STRING, 8,
+                    0, (unsigned char *) p->name,
+                    strlen(p->name));
+}
+
+void NETRootInfo::updateSupportedProperties( Atom atom )
+{
+    if( atom == net_supported )
+        p->properties[ PROTOCOLS ] |= Supported;
+
+    else if( atom == net_supporting_wm_check )
+        p->properties[ PROTOCOLS ] |= SupportingWMCheck;
+
+    else if( atom == net_client_list )
+        p->properties[ PROTOCOLS ] |= ClientList;
+
+    else if( atom == net_client_list_stacking )
+        p->properties[ PROTOCOLS ] |= ClientListStacking;
+
+    else if( atom == net_number_of_desktops )
+        p->properties[ PROTOCOLS ] |= NumberOfDesktops;
+
+    else if( atom == net_desktop_geometry )
+        p->properties[ PROTOCOLS ] |= DesktopGeometry;
+
+    else if( atom == net_desktop_viewport )
+        p->properties[ PROTOCOLS ] |= DesktopViewport;
+
+    else if( atom == net_current_desktop )
+        p->properties[ PROTOCOLS ] |= CurrentDesktop;
+
+    else if( atom == net_desktop_names )
+        p->properties[ PROTOCOLS ] |= DesktopNames;
+
+    else if( atom == net_active_window )
+        p->properties[ PROTOCOLS ] |= ActiveWindow;
+
+    else if( atom == net_workarea )
+        p->properties[ PROTOCOLS ] |= WorkArea;
+
+    else if( atom == net_virtual_roots )
+        p->properties[ PROTOCOLS ] |= VirtualRoots;
+
+    else if( atom == net_close_window )
+        p->properties[ PROTOCOLS ] |= CloseWindow;
+
+
+
+    else if( atom == net_wm_moveresize )
+        p->properties[ PROTOCOLS ] |= WMMoveResize;
+
+    else if( atom == net_wm_name )
+        p->properties[ PROTOCOLS ] |= WMName;
+
+    else if( atom == net_wm_visible_name )
+        p->properties[ PROTOCOLS ] |= WMVisibleName;
+
+    else if( atom == net_wm_icon_name )
+        p->properties[ PROTOCOLS ] |= WMIconName;
+
+    else if( atom == net_wm_visible_icon_name )
+        p->properties[ PROTOCOLS ] |= WMVisibleIconName;
+
+    else if( atom == net_wm_desktop )
+        p->properties[ PROTOCOLS ] |= WMDesktop;
+
+    else if( atom == net_wm_window_type )
+        p->properties[ PROTOCOLS ] |= WMWindowType;
+
+
+    else if( atom == net_wm_window_type_normal )
+        p->properties[ WINDOW_TYPES ] |= NormalMask;
+    else if( atom == net_wm_window_type_desktop )
+        p->properties[ WINDOW_TYPES ] |= DesktopMask;
+    else if( atom == net_wm_window_type_dock )
+        p->properties[ WINDOW_TYPES ] |= DockMask;
+    else if( atom == net_wm_window_type_toolbar )
+        p->properties[ WINDOW_TYPES ] |= ToolbarMask;
+    else if( atom == net_wm_window_type_menu )
+        p->properties[ WINDOW_TYPES ] |= MenuMask;
+    else if( atom == net_wm_window_type_dialog )
+        p->properties[ WINDOW_TYPES ] |= DialogMask;
+    else if( atom == net_wm_window_type_utility )
+        p->properties[ WINDOW_TYPES ] |= UtilityMask;
+    else if( atom == net_wm_window_type_splash )
+        p->properties[ WINDOW_TYPES ] |= SplashMask;
+
+    else if( atom == kde_net_wm_window_type_override )
+        p->properties[ WINDOW_TYPES ] |= OverrideMask;
+    else if( atom == kde_net_wm_window_type_topmenu )
+        p->properties[ WINDOW_TYPES ] |= TopMenuMask;
+
+    else if( atom == net_wm_state )
+        p->properties[ PROTOCOLS ] |= WMState;
+
+
+    else if( atom == net_wm_state_modal )
+        p->properties[ STATES ] |= Modal;
+    else if( atom == net_wm_state_sticky )
+        p->properties[ STATES ] |= Sticky;
+    else if( atom == net_wm_state_max_vert )
+        p->properties[ STATES ] |= MaxVert;
+    else if( atom == net_wm_state_max_horiz )
+        p->properties[ STATES ] |= MaxHoriz;
+    else if( atom == net_wm_state_shaded )
+        p->properties[ STATES ] |= Shaded;
+    else if( atom == net_wm_state_skip_taskbar )
+        p->properties[ STATES ] |= SkipTaskbar;
+    else if( atom == net_wm_state_skip_pager )
+        p->properties[ STATES ] |= SkipPager;
+    else if( atom == net_wm_state_hidden )
+        p->properties[ STATES ] |= Hidden;
+    else if( atom == net_wm_state_fullscreen )
+        p->properties[ STATES ] |= FullScreen;
+    else if( atom == net_wm_state_above )
+        p->properties[ STATES ] |= KeepAbove;
+    else if( atom == net_wm_state_below )
+        p->properties[ STATES ] |= KeepBelow;
+    else if( atom == net_wm_state_demands_attention )
+        p->properties[ STATES ] |= DemandsAttention;
+
+    else if( atom == net_wm_state_stays_on_top )
+        p->properties[ STATES ] |= StaysOnTop;
+
+    else if( atom == net_wm_strut )
+        p->properties[ PROTOCOLS ] |= WMStrut;
+
+    else if( atom == net_wm_icon_geometry )
+        p->properties[ PROTOCOLS ] |= WMIconGeometry;
+
+    else if( atom == net_wm_icon )
+        p->properties[ PROTOCOLS ] |= WMIcon;
+
+    else if( atom == net_wm_pid )
+        p->properties[ PROTOCOLS ] |= WMPid;
+
+    else if( atom == net_wm_handled_icons )
+        p->properties[ PROTOCOLS ] |= WMHandledIcons;
+
+    else if( atom == net_wm_ping )
+        p->properties[ PROTOCOLS ] |= WMPing;
+
+    else if( atom == net_wm_user_time )
+        p->properties[ PROTOCOLS2 ] |= WM2UserTime;
+
+    else if( atom == net_startup_id )
+        p->properties[ PROTOCOLS2 ] |= WM2StartupId;
+
+    else if( atom == net_wm_allowed_actions )
+        p->properties[ PROTOCOLS2 ] |= WM2AllowedActions;
+
+
+    else if( atom == net_wm_action_move )
+        p->properties[ ACTIONS ] |= ActionMove;
+    else if( atom == net_wm_action_resize )
+        p->properties[ ACTIONS ] |= ActionResize;
+    else if( atom == net_wm_action_minimize )
+        p->properties[ ACTIONS ] |= ActionMinimize;
+    else if( atom == net_wm_action_shade )
+        p->properties[ ACTIONS ] |= ActionShade;
+    else if( atom == net_wm_action_stick )
+        p->properties[ ACTIONS ] |= ActionStick;
+    else if( atom == net_wm_action_max_vert )
+        p->properties[ ACTIONS ] |= ActionMaxVert;
+    else if( atom == net_wm_action_max_horiz )
+        p->properties[ ACTIONS ] |= ActionMaxHoriz;
+    else if( atom == net_wm_action_fullscreen )
+        p->properties[ ACTIONS ] |= ActionFullScreen;
+    else if( atom == net_wm_action_change_desk )
+        p->properties[ ACTIONS ] |= ActionChangeDesktop;
+    else if( atom == net_wm_action_close )
+        p->properties[ ACTIONS ] |= ActionClose;
+
+
+    else if( atom == kde_net_system_tray_windows )
+        p->properties[ PROTOCOLS ] |= KDESystemTrayWindows;
+
+    else if( atom == kde_net_wm_system_tray_window_for )
+        p->properties[ PROTOCOLS ] |= WMKDESystemTrayWinFor;
+
+    else if( atom == kde_net_wm_frame_strut )
+        p->properties[ PROTOCOLS ] |= WMKDEFrameStrut;
+}
+
+extern Time qt_x_last_input_time;
+void NETRootInfo::setActiveWindow(Window window) {
+    setActiveWindow( window, FromUnknown, qt_x_last_input_time );
+}
+
+void NETRootInfo::setActiveWindow(Window window, NET::RequestSource src,
+    Time timestamp ) {
+
+
+
+
+
+
+    if (role == WindowManager) {
+        p->active = window;
+        XChangeProperty(p->display, p->root, net_active_window, ((Atom) 33), 32,
+                        0, (unsigned char *) &(p->active), 1);
+    } else {
+        XEvent e;
+
+        e.xclient.type = 33;
+        e.xclient.message_type = net_active_window;
+        e.xclient.display = p->display;
+        e.xclient.window = window;
+        e.xclient.format = 32;
+        e.xclient.data.l[0] = src;
+        e.xclient.data.l[1] = timestamp;
+        e.xclient.data.l[2] = 0l;
+        e.xclient.data.l[3] = 0l;
+        e.xclient.data.l[4] = 0l;
+
+        XSendEvent(p->display, p->root, 0, netwm_sendevent_mask, &e);
+    }
+}
+
+
+void NETRootInfo::setWorkArea(int desktop, const NETRect &workarea) {
+
+
+
+
+
+
+
+    if (role != WindowManager || desktop < 1) return;
+
+    p->workarea[desktop - 1] = workarea;
+
+    long *wa = new long[p->number_of_desktops * 4];
+    int i, o;
+    for (i = 0, o = 0; i < p->number_of_desktops; i++) {
+        wa[o++] = p->workarea[i].pos.x;
+        wa[o++] = p->workarea[i].pos.y;
+        wa[o++] = p->workarea[i].size.width;
+        wa[o++] = p->workarea[i].size.height;
+    }
+
+    XChangeProperty(p->display, p->root, net_workarea, ((Atom) 6), 32,
+                    0, (unsigned char *) wa,
+                    p->number_of_desktops * 4);
+
+    delete [] wa;
+}
+
+
+void NETRootInfo::setVirtualRoots(Window *windows, unsigned int count) {
+    if (role != WindowManager) return;
+
+    p->virtual_roots_count = count;
+    p->virtual_roots = windows;
+
+
+
+
+
+
+    XChangeProperty(p->display, p->root, net_virtual_roots, ((Atom) 33), 32,
+                    0, (unsigned char *) p->virtual_roots,
+                    p->virtual_roots_count);
+}
+
+
+void NETRootInfo::closeWindowRequest(Window window) {
+
+
+
+
+
+
+    XEvent e;
+
+    e.xclient.type = 33;
+    e.xclient.message_type = net_close_window;
+    e.xclient.display = p->display;
+    e.xclient.window = window;
+    e.xclient.format = 32;
+    e.xclient.data.l[0] = 0l;
+    e.xclient.data.l[1] = 0l;
+    e.xclient.data.l[2] = 0l;
+    e.xclient.data.l[3] = 0l;
+    e.xclient.data.l[4] = 0l;
+
+    XSendEvent(p->display, p->root, 0, netwm_sendevent_mask, &e);
+}
+
+
+void NETRootInfo::moveResizeRequest(Window window, int x_root, int y_root,
+                                    Direction direction)
+{
+
+
+
+
+
+
+
+    XEvent e;
+
+    e.xclient.type = 33;
+    e.xclient.message_type = net_wm_moveresize;
+    e.xclient.display = p->display;
+    e.xclient.window = window,
+    e.xclient.format = 32;
+    e.xclient.data.l[0] = x_root;
+    e.xclient.data.l[1] = y_root;
+    e.xclient.data.l[2] = direction;
+    e.xclient.data.l[3] = 0l;
+    e.xclient.data.l[4] = 0l;
+
+    XSendEvent(p->display, p->root, 0, netwm_sendevent_mask, &e);
+}
+
+void NETRootInfo2::sendPing( Window window, Time timestamp )
+{
+    if (role != WindowManager) return;
+
+
+
+
+    XEvent e;
+    e.xclient.type = 33;
+    e.xclient.message_type = wm_protocols;
+    e.xclient.display = p->display;
+    e.xclient.window = window,
+    e.xclient.format = 32;
+    e.xclient.data.l[0] = net_wm_ping;
+    e.xclient.data.l[1] = timestamp;
+    e.xclient.data.l[2] = window;
+    e.xclient.data.l[3] = 0;
+    e.xclient.data.l[4] = 0;
+
+    XSendEvent(p->display, window, 0, 0, &e);
+}
+
+
+
+
+
+const NETRootInfo &NETRootInfo::operator=(const NETRootInfo &rootinfo) {
+
+
+
+
+
+    if (p != rootinfo.p) {
+        refdec_nri(p);
+
+        if (! p->ref) delete p;
+    }
+
+    p = rootinfo.p;
+    role = rootinfo.role;
+    p->ref++;
+
+    return *this;
+}
+
+unsigned long NETRootInfo::event(XEvent *ev )
+{
+    unsigned long props[ 1 ];
+    event( ev, props, 1 );
+    return props[ 0 ];
+}
+
+void NETRootInfo::event(XEvent *event, unsigned long* properties, int properties_size )
+{
+    unsigned long props[ PROPERTIES_SIZE ] = { 0, 0, 0, 0, 0 };
+    (static_cast<void> ((PROPERTIES_SIZE == 5) ? 0 : (__assert_fail ("PROPERTIES_SIZE == 5", "/coolo/prod/kdelibs/kdecore/netwm.cpp", 1610, __PRETTY_FUNCTION__), 0)));
+    unsigned long& dirty = props[ PROTOCOLS ];
+    unsigned long& dirty2 = props[ PROTOCOLS2 ];
+    bool do_update = false;
+
+    (void)dirty2;;
+
+
+
+    if (role == WindowManager && event->type == 33 &&
+        event->xclient.format == 32) {
+
+
+
+
+        if (event->xclient.message_type == net_number_of_desktops) {
+            dirty = NumberOfDesktops;
+
+
+
+
+
+
+            changeNumberOfDesktops(event->xclient.data.l[0]);
+        } else if (event->xclient.message_type == net_desktop_geometry) {
+            dirty = DesktopGeometry;
+
+            NETSize sz;
+            sz.width = event->xclient.data.l[0];
+            sz.height = event->xclient.data.l[1];
+
+
+
+
+
+
+            changeDesktopGeometry(~0, sz);
+        } else if (event->xclient.message_type == net_desktop_viewport) {
+            dirty = DesktopViewport;
+
+            NETPoint pt;
+            pt.x = event->xclient.data.l[0];
+            pt.y = event->xclient.data.l[1];
+
+
+
+
+
+
+            changeDesktopViewport(p->current_desktop, pt);
+        } else if (event->xclient.message_type == net_current_desktop) {
+            dirty = CurrentDesktop;
+
+
+
+
+
+
+            changeCurrentDesktop(event->xclient.data.l[0] + 1);
+        } else if (event->xclient.message_type == net_active_window) {
+            dirty = ActiveWindow;
+
+
+
+
+
+
+            changeActiveWindow(event->xclient.window);
+            if( NETRootInfo2* this2 = dynamic_cast< NETRootInfo2* >( this ))
+            {
+                RequestSource src = FromUnknown;
+
+                if( event->xclient.data.l[0] >= FromUnknown
+                    && event->xclient.data.l[0] <= FromTool )
+                    src = static_cast< RequestSource >( event->xclient.data.l[0] );
+                this2->changeActiveWindow( event->xclient.window, src,
+                    event->xclient.data.l[1]);
+            }
+        } else if (event->xclient.message_type == net_wm_moveresize) {
+            moveResize(event->xclient.window,
+                       event->xclient.data.l[0],
+                       event->xclient.data.l[1],
+                       event->xclient.data.l[2]);
+        } else if (event->xclient.message_type == net_close_window) {
+
+
+
+
+
+
+            closeWindow(event->xclient.window);
+        } else if (event->xclient.message_type == wm_protocols
+            && (Atom)event->xclient.data.l[ 0 ] == net_wm_ping) {
+            dirty = WMPing;
+
+
+
+
+
+            if( NETRootInfo2* this2 = dynamic_cast< NETRootInfo2* >( this ))
+                this2->gotPing( event->xclient.data.l[2], event->xclient.data.l[1]);
+        }
+    }
+
+    if (event->type == 28) {
+
+
+
+
+
+        XEvent pe = *event;
+
+        Bool done = 0;
+        Bool compaction = 0;
+        while (! done) {
+
+
+
+
+
+            if (pe.xproperty.atom == net_client_list)
+                dirty |= ClientList;
+            else if (pe.xproperty.atom == net_client_list_stacking)
+                dirty |= ClientListStacking;
+            else if (pe.xproperty.atom == kde_net_system_tray_windows)
+                dirty |= KDESystemTrayWindows;
+            else if (pe.xproperty.atom == net_desktop_names)
+                dirty |= DesktopNames;
+            else if (pe.xproperty.atom == net_workarea)
+                dirty |= WorkArea;
+            else if (pe.xproperty.atom == net_number_of_desktops)
+                dirty |= NumberOfDesktops;
+            else if (pe.xproperty.atom == net_desktop_geometry)
+                dirty |= DesktopGeometry;
+            else if (pe.xproperty.atom == net_desktop_viewport)
+                dirty |= DesktopViewport;
+            else if (pe.xproperty.atom == net_current_desktop)
+                dirty |= CurrentDesktop;
+            else if (pe.xproperty.atom == net_active_window)
+                dirty |= ActiveWindow;
+            else {
+
+
+
+
+
+                if ( compaction )
+                    XPutBackEvent(p->display, &pe);
+                break;
+            }
+
+            if (XCheckTypedWindowEvent(p->display, p->root, 28, &pe) )
+                compaction = 1;
+            else
+                break;
+        }
+
+        do_update = true;
+    }
+
+    if( do_update )
+        update( props );
+
+
+
+
+
+
+    if( properties_size > PROPERTIES_SIZE )
+        properties_size = PROPERTIES_SIZE;
+    for( int i = 0;
+         i < properties_size;
+         ++i )
+        properties[ i ] = props[ i ];
+}
+
+
+
+
+void NETRootInfo::update( const unsigned long dirty_props[] )
+{
+    Atom type_ret;
+    int format_ret;
+    unsigned char *data_ret;
+    unsigned long nitems_ret, unused;
+    unsigned long props[ PROPERTIES_SIZE ];
+    for( int i = 0;
+         i < PROPERTIES_SIZE;
+         ++i )
+        props[ i ] = dirty_props[ i ] & p->client_properties[ i ];
+    const unsigned long& dirty = props[ PROTOCOLS ];
+    const unsigned long& dirty2 = props[ PROTOCOLS2 ];
+
+    (void)dirty2;;
+
+    if (dirty & Supported ) {
+
+        for( int i = 0; i < PROPERTIES_SIZE; ++i )
+            p->properties[ i ] = 0;
+        if( XGetWindowProperty(p->display, p->root, net_supported,
+                               0l, MAX_PROP_SIZE, 0, ((Atom) 4), &type_ret,
+                               &format_ret, &nitems_ret, &unused, &data_ret)
+            == Success ) {
+            if( type_ret == ((Atom) 4) && format_ret == 32 ) {
+                Atom* atoms = (Atom*) data_ret;
+                for( unsigned int i = 0;
+                     i < nitems_ret;
+                     ++i )
+                    updateSupportedProperties( atoms[ i ] );
+            }
+            if ( data_ret )
+                XFree(data_ret);
+        }
+    }
+
+    if (dirty & ClientList) {
+        bool read_ok = false;
+        if (XGetWindowProperty(p->display, p->root, net_client_list,
+                               0l, MAX_PROP_SIZE, 0, ((Atom) 33), &type_ret,
+                               &format_ret, &nitems_ret, &unused, &data_ret)
+            == Success) {
+            if (type_ret == ((Atom) 33) && format_ret == 32) {
+                Window *wins = (Window *) data_ret;
+
+                qsort(wins, nitems_ret, sizeof(Window), wcmp);
+
+                if (p->clients) {
+                    if (role == Client) {
+                        unsigned long new_index = 0, old_index = 0;
+                        unsigned long new_count = nitems_ret,
+                                      old_count = p->clients_count;
+
+                        while (old_index < old_count || new_index < new_count) {
+                            if (old_index == old_count) {
+                                addClient(wins[new_index++]);
+                            } else if (new_index == new_count) {
+                                removeClient(p->clients[old_index++]);
+                            } else {
+                                if (p->clients[old_index] <
+                                    wins[new_index]) {
+                                    removeClient(p->clients[old_index++]);
+                                } else if (wins[new_index] <
+                                           p->clients[old_index]) {
+                                    addClient(wins[new_index++]);
+                                } else {
+                                    new_index++;
+                                    old_index++;
+                                }
+                            }
+                        }
+                    }
+
+                    delete [] p->clients;
+                } else {
+
+
+
+
+                    unsigned long n;
+                    for (n = 0; n < nitems_ret; n++) {
+                        addClient(wins[n]);
+                    }
+                }
+
+                p->clients_count = nitems_ret;
+                p->clients = nwindup(wins, p->clients_count);
+                read_ok = true;
+            }
+
+            if ( data_ret )
+                XFree(data_ret);
+        }
+        if( !read_ok ) {
+            for( unsigned int i = 0; i < p->clients_count; ++ i )
+                removeClient(p->clients[i]);
+            p->clients_count = 0;
+            delete[] p->clients;
+            p->clients = __null;
+        }
+
+
+
+
+
+    }
+
+    if (dirty & KDESystemTrayWindows) {
+        bool read_ok = false;
+        if (XGetWindowProperty(p->display, p->root, kde_net_system_tray_windows,
+                               0l, MAX_PROP_SIZE, 0, ((Atom) 33), &type_ret,
+                               &format_ret, &nitems_ret, &unused, &data_ret)
+            == Success) {
+            if (type_ret == ((Atom) 33) && format_ret == 32) {
+                Window *wins = (Window *) data_ret;
+
+                qsort(wins, nitems_ret, sizeof(Window), wcmp);
+
+                if (p->kde_system_tray_windows) {
+                    if (role == Client) {
+                        unsigned long new_index = 0, new_count = nitems_ret;
+                        unsigned long old_index = 0,
+                                      old_count = p->kde_system_tray_windows_count;
+
+                        while(old_index < old_count || new_index < new_count) {
+                            if (old_index == old_count) {
+                                addSystemTrayWin(wins[new_index++]);
+                            } else if (new_index == new_count) {
+                                removeSystemTrayWin(p->kde_system_tray_windows[old_index++]);
+                            } else {
+                                if (p->kde_system_tray_windows[old_index] <
+                                    wins[new_index]) {
+                                    removeSystemTrayWin(p->kde_system_tray_windows[old_index++]);
+                                } else if (wins[new_index] <
+                                           p->kde_system_tray_windows[old_index]) {
+                                    addSystemTrayWin(wins[new_index++]);
+                                } else {
+                                    new_index++;
+                                    old_index++;
+                                }
+                            }
+                        }
+                    }
+
+                } else {
+                    unsigned long n;
+                    for (n = 0; n < nitems_ret; n++) {
+                        addSystemTrayWin(wins[n]);
+                    }
+                }
+
+                p->kde_system_tray_windows_count = nitems_ret;
+                if (p->kde_system_tray_windows)
+                    delete [] p->kde_system_tray_windows;
+                p->kde_system_tray_windows =
+                    nwindup(wins, p->kde_system_tray_windows_count);
+                read_ok = true;
+            }
+
+            if ( data_ret )
+                XFree(data_ret);
+        }
+        if( !read_ok ) {
+            for( unsigned int i = 0; i < p->kde_system_tray_windows_count; ++i )
+                removeSystemTrayWin(p->kde_system_tray_windows[i]);
+            p->kde_system_tray_windows_count = 0;
+            delete [] p->kde_system_tray_windows;
+            p->kde_system_tray_windows = __null;
+        }
+    }
+
+    if (dirty & ClientListStacking) {
+        p->stacking_count = 0;
+        delete[] p->stacking;
+        p->stacking = __null;
+        if (XGetWindowProperty(p->display, p->root, net_client_list_stacking,
+                               0, MAX_PROP_SIZE, 0, ((Atom) 33), &type_ret,
+                               &format_ret, &nitems_ret, &unused, &data_ret)
+            == Success) {
+            if (type_ret == ((Atom) 33) && format_ret == 32) {
+                Window *wins = (Window *) data_ret;
+
+                p->stacking_count = nitems_ret;
+                p->stacking = nwindup(wins, p->stacking_count);
+            }
+
+
+
+
+
+
+            if ( data_ret )
+                XFree(data_ret);
+        }
+    }
+
+    if (dirty & NumberOfDesktops) {
+        p->number_of_desktops = 0;
+
+        if (XGetWindowProperty(p->display, p->root, net_number_of_desktops,
+                               0l, 1l, 0, ((Atom) 6), &type_ret, &format_ret,
+                               &nitems_ret, &unused, &data_ret)
+            == Success) {
+            if (type_ret == ((Atom) 6) && format_ret == 32 && nitems_ret == 1) {
+                p->number_of_desktops = *((long *) data_ret);
+            }
+
+
+
+
+
+            if ( data_ret )
+                XFree(data_ret);
+        }
+    }
+
+    if (dirty & DesktopGeometry) {
+        p->geometry = p->rootSize;
+        if (XGetWindowProperty(p->display, p->root, net_desktop_geometry,
+                               0l, 2l, 0, ((Atom) 6), &type_ret, &format_ret,
+                               &nitems_ret, &unused, &data_ret)
+            == Success) {
+            if (type_ret == ((Atom) 6) && format_ret == 32 &&
+                nitems_ret == 2) {
+                long *data = (long *) data_ret;
+
+                p->geometry.width = data[0];
+                p->geometry.height = data[1];
+
+
+
+
+            }
+            if ( data_ret )
+                XFree(data_ret);
+        }
+    }
+
+    if (dirty & DesktopViewport) {
+        for (int i = 0; i < p->viewport.size(); i++)
+            p->viewport[i].x = p->viewport[i].y = 0;
+        if (XGetWindowProperty(p->display, p->root, net_desktop_viewport,
+                               0l, 2l, 0, ((Atom) 6), &type_ret, &format_ret,
+                               &nitems_ret, &unused, &data_ret)
+            == Success) {
+            if (type_ret == ((Atom) 6) && format_ret == 32 &&
+                nitems_ret == 2) {
+                long *data = (long *) data_ret;
+
+                int d, i, n;
+                n = nitems_ret / 2;
+                for (d = 0, i = 0; d < n; d++) {
+                    p->viewport[d].x = data[i++];
+                    p->viewport[d].y = data[i++];
+                }
+            }
+            if ( data_ret )
+                XFree(data_ret);
+        }
+    }
+
+    if (dirty & CurrentDesktop) {
+        p->current_desktop = 0;
+        if (XGetWindowProperty(p->display, p->root, net_current_desktop,
+                               0l, 1l, 0, ((Atom) 6), &type_ret, &format_ret,
+                               &nitems_ret, &unused, &data_ret)
+            == Success) {
+            if (type_ret == ((Atom) 6) && format_ret == 32 && nitems_ret == 1) {
+                p->current_desktop = *((long *) data_ret) + 1;
+            }
+
+
+
+
+
+            if ( data_ret )
+                XFree(data_ret);
+        }
+    }
+
+    if (dirty & DesktopNames) {
+        for( int i = 0; i < p->desktop_names.size(); ++i )
+            delete[] p->desktop_names[ i ];
+        p->desktop_names.reset();
+        if (XGetWindowProperty(p->display, p->root, net_desktop_names,
+                               0l, MAX_PROP_SIZE, 0, UTF8_STRING, &type_ret,
+                               &format_ret, &nitems_ret, &unused, &data_ret)
+            == Success) {
+            if (type_ret == UTF8_STRING && format_ret == 8) {
+                const char *d = (const char *) data_ret;
+                unsigned int s, n, index;
+
+                for (s = 0, n = 0, index = 0; n < nitems_ret; n++) {
+                    if (d[n] == '\0') {
+                        if (p->desktop_names[index])
+                            delete [] p->desktop_names[index];
+                        p->desktop_names[index++] = nstrndup((d + s), n - s + 1);
+                        s = n + 1;
+                    }
+                }
+            }
+
+
+
+
+
+            if ( data_ret )
+                XFree(data_ret);
+        }
+    }
+
+    if (dirty & ActiveWindow) {
+        p->active = None;
+        if (XGetWindowProperty(p->display, p->root, net_active_window, 0l, 1l,
+                               0, ((Atom) 33), &type_ret, &format_ret,
+                               &nitems_ret, &unused, &data_ret)
+            == Success) {
+            if (type_ret == ((Atom) 33) && format_ret == 32 && nitems_ret == 1) {
+                p->active = *((Window *) data_ret);
+            }
+
+
+
+
+
+            if ( data_ret )
+                XFree(data_ret);
+        }
+    }
+
+    if (dirty & WorkArea) {
+        p->workarea.reset();
+        if (XGetWindowProperty(p->display, p->root, net_workarea, 0l,
+                               (p->number_of_desktops * 4), 0, ((Atom) 6),
+                               &type_ret, &format_ret, &nitems_ret, &unused,
+                               &data_ret)
+            == Success) {
+            if (type_ret == ((Atom) 6) && format_ret == 32 &&
+                nitems_ret == (unsigned) (p->number_of_desktops * 4)) {
+                long *d = (long *) data_ret;
+                int i, j;
+                for (i = 0, j = 0; i < p->number_of_desktops; i++) {
+                    p->workarea[i].pos.x = d[j++];
+                    p->workarea[i].pos.y = d[j++];
+                    p->workarea[i].size.width = d[j++];
+                    p->workarea[i].size.height = d[j++];
+                }
+            }
+
+
+
+
+
+            if ( data_ret )
+                XFree(data_ret);
+        }
+    }
+
+
+    if (dirty & SupportingWMCheck) {
+        p->supportwindow = None;
+        delete[] p->name;
+        p->name = __null;
+        if (XGetWindowProperty(p->display, p->root, net_supporting_wm_check,
+                               0l, 1l, 0, ((Atom) 33), &type_ret, &format_ret,
+                               &nitems_ret, &unused, &data_ret)
+            == Success) {
+            if (type_ret == ((Atom) 33) && format_ret == 32 && nitems_ret == 1) {
+                p->supportwindow = *((Window *) data_ret);
+
+                unsigned char *name_ret;
+                if (XGetWindowProperty(p->display, p->supportwindow,
+                                       net_wm_name, 0l, MAX_PROP_SIZE, 0,
+                                       UTF8_STRING, &type_ret, &format_ret,
+                                       &nitems_ret, &unused, &name_ret)
+                    == Success) {
+                    if (type_ret == UTF8_STRING && format_ret == 8)
+                        p->name = nstrndup((const char *) name_ret, nitems_ret);
+
+                    if ( name_ret )
+                        XFree(name_ret);
+                }
+            }
+
+
+
+
+
+
+            if ( data_ret )
+                XFree(data_ret);
+        }
+    }
+
+    if (dirty & VirtualRoots) {
+        p->virtual_roots_count = 0;
+        delete[] p->virtual_roots;
+        p->virtual_roots = __null;
+        if (XGetWindowProperty(p->display, p->root, net_virtual_roots,
+                               0, MAX_PROP_SIZE, 0, ((Atom) 33), &type_ret,
+                               &format_ret, &nitems_ret, &unused, &data_ret)
+            == Success) {
+            if (type_ret == ((Atom) 33) && format_ret == 32) {
+                Window *wins = (Window *) data_ret;
+
+                p->virtual_roots_count = nitems_ret;
+                p->virtual_roots = nwindup(wins, p->virtual_roots_count);
+            }
+
+
+
+
+
+            if ( data_ret )
+                XFree(data_ret);
+        }
+    }
+}
+
+
+Display *NETRootInfo::x11Display() const {
+    return p->display;
+}
+
+
+Window NETRootInfo::rootWindow() const {
+    return p->root;
+}
+
+
+Window NETRootInfo::supportWindow() const {
+    return p->supportwindow;
+}
+
+
+const char *NETRootInfo::wmName() const {
+    return p->name; }
+
+
+int NETRootInfo::screenNumber() const {
+    return p->screen;
+}
+
+
+unsigned long NETRootInfo::supported() const {
+    return role == WindowManager
+        ? p->properties[ PROTOCOLS ]
+        : p->client_properties[ PROTOCOLS ];
+}
+
+const unsigned long* NETRootInfo::supportedProperties() const {
+    return p->properties;
+}
+
+const unsigned long* NETRootInfo::passedProperties() const {
+    return role == WindowManager
+        ? p->properties
+        : p->client_properties;
+}
+
+bool NETRootInfo::isSupported( NET::Property property ) const {
+    return p->properties[ PROTOCOLS ] & property;
+}
+
+bool NETRootInfo::isSupported( NET::Property2 property ) const {
+    return p->properties[ PROTOCOLS2 ] & property;
+}
+
+bool NETRootInfo::isSupported( NET::WindowType type ) const {
+    return p->properties[ WINDOW_TYPES ] & type;
+}
+
+bool NETRootInfo::isSupported( NET::State state ) const {
+    return p->properties[ STATES ] & state;
+}
+
+bool NETRootInfo::isSupported( NET::Action action ) const {
+    return p->properties[ ACTIONS ] & action;
+}
+
+const Window *NETRootInfo::clientList() const {
+    return p->clients;
+}
+
+
+int NETRootInfo::clientListCount() const {
+    return p->clients_count;
+}
+
+
+const Window *NETRootInfo::clientListStacking() const {
+    return p->stacking;
+}
+
+
+int NETRootInfo::clientListStackingCount() const {
+    return p->stacking_count;
+}
+
+
+const Window *NETRootInfo::kdeSystemTrayWindows() const {
+    return p->kde_system_tray_windows;
+}
+
+
+int NETRootInfo::kdeSystemTrayWindowsCount() const {
+    return p->kde_system_tray_windows_count;
+}
+
+
+NETSize NETRootInfo::desktopGeometry(int) const {
+    return p->geometry.width != 0 ? p->geometry : p->rootSize;
+}
+
+
+NETPoint NETRootInfo::desktopViewport(int desktop) const {
+    if (desktop < 1) {
+        NETPoint pt;
+        return pt;
+    }
+
+    return p->viewport[desktop - 1];
+}
+
+
+NETRect NETRootInfo::workArea(int desktop) const {
+    if (desktop < 1) {
+        NETRect rt;
+        return rt;
+    }
+
+    return p->workarea[desktop - 1];
+}
+
+
+const char *NETRootInfo::desktopName(int desktop) const {
+    if (desktop < 1) {
+        return 0;
+    }
+
+    return p->desktop_names[desktop - 1];
+}
+
+
+const Window *NETRootInfo::virtualRoots( ) const {
+    return p->virtual_roots;
+}
+
+
+int NETRootInfo::virtualRootsCount() const {
+    return p->virtual_roots_count;
+}
+
+
+int NETRootInfo::numberOfDesktops() const {
+    return p->number_of_desktops == 0 ? 1 : p->number_of_desktops;
+}
+
+
+int NETRootInfo::currentDesktop() const {
+    return p->current_desktop == 0 ? 1 : p->current_desktop;
+}
+
+
+Window NETRootInfo::activeWindow() const {
+    return p->active;
+}
+
+
+
+
+const int NETWinInfo::OnAllDesktops = NET::OnAllDesktops;
+
+NETWinInfo::NETWinInfo(Display *display, Window window, Window rootWindow,
+                       const unsigned long properties[], int properties_size,
+                       Role role)
+{
+
+
+
+
+
+
+    p = new NETWinInfoPrivate;
+    p->ref = 1;
+
+    p->display = display;
+    p->window = window;
+    p->root = rootWindow;
+    p->mapping_state = Withdrawn;
+    p->mapping_state_dirty = 1;
+    p->state = 0;
+    p->types[ 0 ] = Unknown;
+    p->name = (char *) 0;
+    p->visible_name = (char *) 0;
+    p->icon_name = (char *) 0;
+    p->visible_icon_name = (char *) 0;
+    p->desktop = p->pid = p->handled_icons = 0;
+    p->user_time = -1U;
+    p->startup_id = __null;
+    p->transient_for = None;
+    p->window_group = None;
+    p->allowed_actions = 0;
+
+
+
+
+
+    p->kde_system_tray_win_for = 0;
+
+    for( int i = 0;
+         i < PROPERTIES_SIZE;
+         ++i )
+        p->properties[ i ] = 0;
+    if( properties_size > PROPERTIES_SIZE )
+        properties_size = PROPERTIES_SIZE;
+    for( int i = 0;
+         i < properties_size;
+         ++i )
+        p->properties[ i ] = properties[ i ];
+
+    p->icon_count = 0;
+
+    this->role = role;
+
+    if (! netwm_atoms_created) create_atoms(p->display);
+
+    update(p->properties);
+}
+
+
+NETWinInfo::NETWinInfo(Display *display, Window window, Window rootWindow,
+                       unsigned long properties, Role role)
+{
+
+
+
+
+
+
+    p = new NETWinInfoPrivate;
+    p->ref = 1;
+
+    p->display = display;
+    p->window = window;
+    p->root = rootWindow;
+    p->mapping_state = Withdrawn;
+    p->mapping_state_dirty = 1;
+    p->state = 0;
+    p->types[ 0 ] = Unknown;
+    p->name = (char *) 0;
+    p->visible_name = (char *) 0;
+    p->icon_name = (char *) 0;
+    p->visible_icon_name = (char *) 0;
+    p->desktop = p->pid = p->handled_icons = 0;
+    p->user_time = -1U;
+    p->startup_id = __null;
+    p->transient_for = None;
+    p->window_group = None;
+    p->allowed_actions = 0;
+
+
+
+
+
+    p->kde_system_tray_win_for = 0;
+
+    for( int i = 0;
+         i < PROPERTIES_SIZE;
+         ++i )
+        p->properties[ i ] = 0;
+    p->properties[ PROTOCOLS ] = properties;
+
+    p->icon_count = 0;
+
+    this->role = role;
+
+    if (! netwm_atoms_created) create_atoms(p->display);
+
+    update(p->properties);
+}
+
+
+NETWinInfo::NETWinInfo(const NETWinInfo &wininfo) {
+    p = wininfo.p;
+    p->ref++;
+}
+
+
+NETWinInfo::~NETWinInfo() {
+    refdec_nwi(p);
+
+    if (! p->ref) delete p;
+}
+
+
+
+
+const NETWinInfo &NETWinInfo::operator=(const NETWinInfo &wininfo) {
+
+
+
+
+
+    if (p != wininfo.p) {
+        refdec_nwi(p);
+
+        if (! p->ref) delete p;
+    }
+
+    p = wininfo.p;
+    role = wininfo.role;
+    p->ref++;
+
+    return *this;
+}
+
+
+void NETWinInfo::setIcon(NETIcon icon, Bool replace) {
+    if (role != Client) return;
+
+    int proplen, i, sz, j;
+
+    if (replace) {
+
+        for (i = 0; i < p->icons.size(); i++) {
+            if (p->icons[i].data) delete [] p->icons[i].data;
+            p->icons[i].data = 0;
+            p->icons[i].size.width = 0;
+            p->icons[i].size.height = 0;
+        }
+
+        p->icon_count = 0;
+    }
+
+
+    p->icons[p->icon_count] = icon;
+    p->icon_count++;
+
+
+    NETIcon &ni = p->icons[p->icon_count - 1];
+    sz = ni.size.width * ni.size.height;
+    CARD32 *d = new CARD32[sz];
+    ni.data = (unsigned char *) d;
+    memcpy(d, icon.data, sz * sizeof(CARD32));
+
+
+    for (i = 0, proplen = 0; i < p->icon_count; i++) {
+        proplen += 2 + (p->icons[i].size.width *
+                        p->icons[i].size.height);
+    }
+
+    CARD32 *d32;
+    long *prop = new long[proplen], *pprop = prop;
+    for (i = 0; i < p->icon_count; i++) {
+
+        *pprop++ = p->icons[i].size.width;
+        *pprop++ = p->icons[i].size.height;
+
+
+        sz = (p->icons[i].size.width * p->icons[i].size.height);
+        d32 = (CARD32 *) p->icons[i].data;
+        for (j = 0; j < sz; j++) *pprop++ = *d32++;
+    }
+
+    XChangeProperty(p->display, p->window, net_wm_icon, ((Atom) 6), 32,
+                    0, (unsigned char *) prop, proplen);
+
+    delete [] prop;
+}
+
+
+void NETWinInfo::setIconGeometry(NETRect geometry) {
+    if (role != Client) return;
+
+    p->icon_geom = geometry;
+
+    long data[4];
+    data[0] = geometry.pos.x;
+    data[1] = geometry.pos.y;
+    data[2] = geometry.size.width;
+    data[3] = geometry.size.height;
+
+    XChangeProperty(p->display, p->window, net_wm_icon_geometry, ((Atom) 6),
+                    32, 0, (unsigned char *) data, 4);
+}
+
+
+void NETWinInfo::setStrut(NETStrut strut) {
+    if (role != Client) return;
+
+    p->strut = strut;
+
+    long data[4];
+    data[0] = strut.left;
+    data[1] = strut.right;
+    data[2] = strut.top;
+    data[3] = strut.bottom;
+
+    XChangeProperty(p->display, p->window, net_wm_strut, ((Atom) 6), 32,
+                    0, (unsigned char *) data, 4);
+}
+
+
+void NETWinInfo::setState(unsigned long state, unsigned long mask) {
+    if (p->mapping_state_dirty)
+        updateWMState();
+
+    if (role == Client && p->mapping_state != Withdrawn) {
+
+
+
+
+
+
+        XEvent e;
+        e.xclient.type = 33;
+        e.xclient.message_type = net_wm_state;
+        e.xclient.display = p->display;
+        e.xclient.window = p->window;
+        e.xclient.format = 32;
+        e.xclient.data.l[3] = 0l;
+        e.xclient.data.l[4] = 0l;
+
+        if ((mask & Modal) && ((p->state & Modal) != (state & Modal))) {
+            e.xclient.data.l[0] = (state & Modal) ? 1 : 0;
+            e.xclient.data.l[1] = net_wm_state_modal;
+            e.xclient.data.l[2] = 0l;
+
+            XSendEvent(p->display, p->root, 0, netwm_sendevent_mask, &e);
+        }
+
+        if ((mask & Sticky) && ((p->state & Sticky) != (state & Sticky))) {
+            e.xclient.data.l[0] = (state & Sticky) ? 1 : 0;
+            e.xclient.data.l[1] = net_wm_state_sticky;
+            e.xclient.data.l[2] = 0l;
+
+            XSendEvent(p->display, p->root, 0, netwm_sendevent_mask, &e);
+        }
+
+        if ((mask & Max) && (( (p->state&mask) & Max) != (state & Max))) {
+
+            unsigned long wishstate = (p->state & ~mask) | (state & mask);
+            if ( ( (wishstate & MaxHoriz) != (p->state & MaxHoriz) )
+                 && ( (wishstate & MaxVert) != (p->state & MaxVert) ) ) {
+                if ( (wishstate & Max) == Max ) {
+                    e.xclient.data.l[0] = 1;
+                    e.xclient.data.l[1] = net_wm_state_max_horiz;
+                    e.xclient.data.l[2] = net_wm_state_max_vert;
+                    XSendEvent(p->display, p->root, 0, netwm_sendevent_mask, &e);
+                } else if ( (wishstate & Max) == 0 ) {
+                    e.xclient.data.l[0] = 0;
+                    e.xclient.data.l[1] = net_wm_state_max_horiz;
+                    e.xclient.data.l[2] = net_wm_state_max_vert;
+                    XSendEvent(p->display, p->root, 0, netwm_sendevent_mask, &e);
+                } else {
+                    e.xclient.data.l[0] = ( wishstate & MaxHoriz ) ? 1 : 0;
+                    e.xclient.data.l[1] = net_wm_state_max_horiz;
+                    e.xclient.data.l[2] = 0;
+                    XSendEvent(p->display, p->root, 0, netwm_sendevent_mask, &e);
+                    e.xclient.data.l[0] = ( wishstate & MaxVert ) ? 1 : 0;
+                    e.xclient.data.l[1] = net_wm_state_max_vert;
+                    e.xclient.data.l[2] = 0;
+                    XSendEvent(p->display, p->root, 0, netwm_sendevent_mask, &e);
+                }
+            } else if ( (wishstate & MaxVert) != (p->state & MaxVert) ) {
+                e.xclient.data.l[0] = ( wishstate & MaxVert ) ? 1 : 0;
+                e.xclient.data.l[1] = net_wm_state_max_vert;
+                e.xclient.data.l[2] = 0;
+                XSendEvent(p->display, p->root, 0, netwm_sendevent_mask, &e);
+            } else if ( (wishstate & MaxHoriz) != (p->state & MaxHoriz) ) {
+                e.xclient.data.l[0] = ( wishstate & MaxHoriz ) ? 1 : 0;
+                e.xclient.data.l[1] = net_wm_state_max_horiz;
+                e.xclient.data.l[2] = 0;
+                XSendEvent(p->display, p->root, 0, netwm_sendevent_mask, &e);
+            }
+        }
+
+        if ((mask & Shaded) && ((p->state & Shaded) != (state & Shaded))) {
+            e.xclient.data.l[0] = (state & Shaded) ? 1 : 0;
+            e.xclient.data.l[1] = net_wm_state_shaded;
+            e.xclient.data.l[2] = 0l;
+
+            XSendEvent(p->display, p->root, 0, netwm_sendevent_mask, &e);
+        }
+
+        if ((mask & SkipTaskbar) &&
+            ((p->state & SkipTaskbar) != (state & SkipTaskbar))) {
+            e.xclient.data.l[0] = (state & SkipTaskbar) ? 1 : 0;
+            e.xclient.data.l[1] = net_wm_state_skip_taskbar;
+            e.xclient.data.l[2] = 0l;
+
+            XSendEvent(p->display, p->root, 0, netwm_sendevent_mask, &e);
+        }
+
+        if ((mask & SkipPager) &&
+            ((p->state & SkipPager) != (state & SkipPager))) {
+            e.xclient.data.l[0] = (state & SkipPager) ? 1 : 0;
+            e.xclient.data.l[1] = net_wm_state_skip_pager;
+            e.xclient.data.l[2] = 0l;
+
+            XSendEvent(p->display, p->root, 0, netwm_sendevent_mask, &e);
+        }
+
+        if ((mask & Hidden) &&
+            ((p->state & Hidden) != (state & Hidden))) {
+            e.xclient.data.l[0] = (state & Hidden) ? 1 : 0;
+            e.xclient.data.l[1] = net_wm_state_hidden;
+            e.xclient.data.l[2] = 0l;
+
+            XSendEvent(p->display, p->root, 0, netwm_sendevent_mask, &e);
+        }
+
+        if ((mask & FullScreen) &&
+            ((p->state & FullScreen) != (state & FullScreen))) {
+            e.xclient.data.l[0] = (state & FullScreen) ? 1 : 0;
+            e.xclient.data.l[1] = net_wm_state_fullscreen;
+            e.xclient.data.l[2] = 0l;
+
+            XSendEvent(p->display, p->root, 0, netwm_sendevent_mask, &e);
+        }
+
+        if ((mask & KeepAbove) &&
+            ((p->state & KeepAbove) != (state & KeepAbove))) {
+            e.xclient.data.l[0] = (state & KeepAbove) ? 1 : 0;
+            e.xclient.data.l[1] = net_wm_state_above;
+            e.xclient.data.l[2] = 0l;
+
+            XSendEvent(p->display, p->root, 0, netwm_sendevent_mask, &e);
+        }
+
+        if ((mask & KeepBelow) &&
+            ((p->state & KeepBelow) != (state & KeepBelow))) {
+            e.xclient.data.l[0] = (state & KeepBelow) ? 1 : 0;
+            e.xclient.data.l[1] = net_wm_state_below;
+            e.xclient.data.l[2] = 0l;
+
+            XSendEvent(p->display, p->root, 0, netwm_sendevent_mask, &e);
+        }
+
+        if ((mask & StaysOnTop) && ((p->state & StaysOnTop) != (state & StaysOnTop))) {
+            e.xclient.data.l[0] = (state & StaysOnTop) ? 1 : 0;
+            e.xclient.data.l[1] = net_wm_state_stays_on_top;
+            e.xclient.data.l[2] = 0l;
+
+            XSendEvent(p->display, p->root, 0, netwm_sendevent_mask, &e);
+        }
+
+        if ((mask & DemandsAttention) &&
+            ((p->state & DemandsAttention) != (state & DemandsAttention))) {
+            e.xclient.data.l[0] = (state & DemandsAttention) ? 1 : 0;
+            e.xclient.data.l[1] = net_wm_state_demands_attention;
+            e.xclient.data.l[2] = 0l;
+
+            XSendEvent(p->display, p->root, 0, netwm_sendevent_mask, &e);
+        }
+
+    } else {
+        p->state &= ~mask;
+        p->state |= state;
+
+        long data[50];
+        int count = 0;
+
+
+        if (p->state & Modal) data[count++] = net_wm_state_modal;
+        if (p->state & MaxVert) data[count++] = net_wm_state_max_vert;
+        if (p->state & MaxHoriz) data[count++] = net_wm_state_max_horiz;
+        if (p->state & Shaded) data[count++] = net_wm_state_shaded;
+        if (p->state & Hidden) data[count++] = net_wm_state_hidden;
+        if (p->state & FullScreen) data[count++] = net_wm_state_fullscreen;
+        if (p->state & DemandsAttention) data[count++] = net_wm_state_demands_attention;
+
+
+        if (p->state & KeepAbove) data[count++] = net_wm_state_above;
+        if (p->state & KeepBelow) data[count++] = net_wm_state_below;
+        if (p->state & StaysOnTop) data[count++] = net_wm_state_stays_on_top;
+        if (p->state & Sticky) data[count++] = net_wm_state_sticky;
+        if (p->state & SkipTaskbar) data[count++] = net_wm_state_skip_taskbar;
+        if (p->state & SkipPager) data[count++] = net_wm_state_skip_pager;
+        XChangeProperty(p->display, p->window, net_wm_state, ((Atom) 4), 32,
+                        0, (unsigned char *) data, count);
+    }
+}
+
+
+void NETWinInfo::setWindowType(WindowType type) {
+    if (role != Client) return;
+
+    int len;
+    long data[2];
+
+    switch (type) {
+    case Override:
+
+
+        data[0] = kde_net_wm_window_type_override;
+        data[1] = net_wm_window_type_normal;
+        len = 2;
+        break;
+
+    case Dialog:
+        data[0] = net_wm_window_type_dialog;
+        data[1] = None;
+        len = 1;
+        break;
+
+    case Menu:
+        data[0] = net_wm_window_type_menu;
+        data[1] = None;
+        len = 1;
+        break;
+
+    case TopMenu:
+
+
+        data[0] = kde_net_wm_window_type_topmenu;
+        data[1] = net_wm_window_type_dock;
+        len = 2;
+        break;
+
+    case Tool:
+        data[0] = net_wm_window_type_toolbar;
+        data[1] = None;
+        len = 1;
+        break;
+
+    case Dock:
+        data[0] = net_wm_window_type_dock;
+        data[1] = None;
+        len = 1;
+        break;
+
+    case Desktop:
+        data[0] = net_wm_window_type_desktop;
+        data[1] = None;
+        len = 1;
+        break;
+
+    case Utility:
+        data[0] = net_wm_window_type_utility;
+        data[1] = net_wm_window_type_dialog;
+        len = 2;
+        break;
+
+    case Splash:
+        data[0] = net_wm_window_type_splash;
+        data[1] = net_wm_window_type_dock;
+        len = 2;
+        break;
+
+    default:
+    case Normal:
+        data[0] = net_wm_window_type_normal;
+        data[1] = None;
+        len = 1;
+        break;
+    }
+
+    XChangeProperty(p->display, p->window, net_wm_window_type, ((Atom) 4), 32,
+                    0, (unsigned char *) &data, len);
+}
+
+
+void NETWinInfo::setName(const char *name) {
+    if (role != Client) return;
+
+    if (p->name) delete [] p->name;
+    p->name = nstrdup(name);
+    XChangeProperty(p->display, p->window, net_wm_name, UTF8_STRING, 8,
+                    0, (unsigned char *) p->name,
+                    strlen(p->name));
+}
+
+
+void NETWinInfo::setVisibleName(const char *visibleName) {
+    if (role != WindowManager) return;
+
+    if (p->visible_name) delete [] p->visible_name;
+    p->visible_name = nstrdup(visibleName);
+    XChangeProperty(p->display, p->window, net_wm_visible_name, UTF8_STRING, 8,
+                    0, (unsigned char *) p->visible_name,
+                    strlen(p->visible_name));
+}
+
+
+void NETWinInfo::setIconName(const char *iconName) {
+    if (role != Client) return;
+
+    if (p->icon_name) delete [] p->icon_name;
+    p->icon_name = nstrdup(iconName);
+    XChangeProperty(p->display, p->window, net_wm_icon_name, UTF8_STRING, 8,
+                    0, (unsigned char *) p->icon_name,
+                    strlen(p->icon_name));
+}
+
+
+void NETWinInfo::setVisibleIconName(const char *visibleIconName) {
+    if (role != WindowManager) return;
+
+    if (p->visible_icon_name) delete [] p->visible_icon_name;
+    p->visible_icon_name = nstrdup(visibleIconName);
+    XChangeProperty(p->display, p->window, net_wm_visible_icon_name, UTF8_STRING, 8,
+                    0, (unsigned char *) p->visible_icon_name,
+                    strlen(p->visible_icon_name));
+}
+
+
+void NETWinInfo::setDesktop(int desktop) {
+    if (p->mapping_state_dirty)
+        updateWMState();
+
+    if (role == Client && p->mapping_state != Withdrawn) {
+
+
+        if ( desktop == 0 )
+            return;
+
+        XEvent e;
+
+        e.xclient.type = 33;
+        e.xclient.message_type = net_wm_desktop;
+        e.xclient.display = p->display;
+        e.xclient.window = p->window;
+        e.xclient.format = 32;
+        e.xclient.data.l[0] = desktop == OnAllDesktops ? OnAllDesktops : desktop - 1;
+        e.xclient.data.l[1] = 0l;
+        e.xclient.data.l[2] = 0l;
+        e.xclient.data.l[3] = 0l;
+        e.xclient.data.l[4] = 0l;
+
+        XSendEvent(p->display, p->root, 0, netwm_sendevent_mask, &e);
+    } else {
+
+        p->desktop = desktop;
+        long d = desktop;
+
+        if ( d != OnAllDesktops ) {
+            if ( d == 0 ) {
+                XDeleteProperty( p->display, p->window, net_wm_desktop );
+                return;
+            }
+
+            d -= 1;
+        }
+
+        XChangeProperty(p->display, p->window, net_wm_desktop, ((Atom) 6), 32,
+                        0, (unsigned char *) &d, 1);
+    }
+}
+
+
+void NETWinInfo::setPid(int pid) {
+    if (role != Client) return;
+
+    p->pid = pid;
+    long d = pid;
+    XChangeProperty(p->display, p->window, net_wm_pid, ((Atom) 6), 32,
+                    0, (unsigned char *) &d, 1);
+}
+
+
+void NETWinInfo::setHandledIcons(Bool handled) {
+    if (role != Client) return;
+
+    p->handled_icons = handled;
+    long d = handled;
+    XChangeProperty(p->display, p->window, net_wm_handled_icons, ((Atom) 6), 32,
+                    0, (unsigned char *) &d, 1);
+}
+
+void NETWinInfo::setStartupId(const char* id) {
+    if (role != Client) return;
+
+    if(p->startup_id) delete[] p->startup_id;
+    p->startup_id = nstrdup(id);
+    XChangeProperty(p->display, p->window, net_startup_id, ((Atom) 31), 8,
+
+        0, reinterpret_cast< unsigned char* >( p->startup_id ),
+        strlen( p->startup_id ));
+}
+
+void NETWinInfo::setAllowedActions( unsigned long actions ) {
+    if( role != WindowManager )
+        return;
+    long data[50];
+    int count = 0;
+
+    p->allowed_actions = actions;
+    if (p->allowed_actions & ActionMove) data[count++] = net_wm_action_move;
+    if (p->allowed_actions & ActionResize) data[count++] = net_wm_action_resize;
+    if (p->allowed_actions & ActionMinimize) data[count++] = net_wm_action_minimize;
+    if (p->allowed_actions & ActionShade) data[count++] = net_wm_action_shade;
+    if (p->allowed_actions & ActionStick) data[count++] = net_wm_action_stick;
+    if (p->allowed_actions & ActionMaxVert) data[count++] = net_wm_action_max_vert;
+    if (p->allowed_actions & ActionMaxHoriz) data[count++] = net_wm_action_max_horiz;
+    if (p->allowed_actions & ActionFullScreen) data[count++] = net_wm_action_fullscreen;
+    if (p->allowed_actions & ActionChangeDesktop) data[count++] = net_wm_action_change_desk;
+    if (p->allowed_actions & ActionClose) data[count++] = net_wm_action_close;
+    XChangeProperty(p->display, p->window, net_wm_allowed_actions, ((Atom) 4), 32,
+                    0, (unsigned char *) data, count);
+}
+
+void NETWinInfo::setKDESystemTrayWinFor(Window window) {
+    if (role != Client) return;
+
+    p->kde_system_tray_win_for = window;
+    XChangeProperty(p->display, p->window, kde_net_wm_system_tray_window_for,
+                    ((Atom) 33), 32, 0,
+                    (unsigned char *) &(p->kde_system_tray_win_for), 1);
+}
+
+
+void NETWinInfo::setKDEFrameStrut(NETStrut strut) {
+    if (role != WindowManager) return;
+
+    p->frame_strut = strut;
+
+    long d[4];
+    d[0] = strut.left;
+    d[1] = strut.right;
+    d[2] = strut.top;
+    d[3] = strut.bottom;
+
+    XChangeProperty(p->display, p->window, kde_net_wm_frame_strut, ((Atom) 6), 32,
+                    0, (unsigned char *) d, 4);
+}
+
+
+void NETWinInfo::kdeGeometry(NETRect& frame, NETRect& window) {
+    if (p->win_geom.size.width == 0 || p->win_geom.size.height == 0) {
+        Window unused;
+        int x, y;
+        unsigned int w, h, junk;
+        XGetGeometry(p->display, p->window, &unused, &x, &y, &w, &h, &junk, &junk);
+        XTranslateCoordinates(p->display, p->window, p->root, 0, 0, &x, &y, &unused
+                              );
+
+        p->win_geom.pos.x = x;
+        p->win_geom.pos.y = y;
+
+        p->win_geom.size.width = w;
+        p->win_geom.size.height = h;
+    }
+
+    window = p->win_geom;
+
+    frame.pos.x = window.pos.x - p->frame_strut.left;
+    frame.pos.y = window.pos.y - p->frame_strut.top;
+    frame.size.width = window.size.width + p->frame_strut.left + p->frame_strut.right;
+    frame.size.height = window.size.height + p->frame_strut.top + p->frame_strut.bottom;
+}
+
+
+NETIcon NETWinInfo::icon(int width, int height) const {
+    NETIcon result;
+
+    if ( !p->icon_count ) {
+        result.size.width = 0;
+        result.size.height = 0;
+        result.data = 0;
+        return result;
+    }
+
+    result = p->icons[0];
+
+
+
+    if (width == height && height == -1) return result;
+
+    int i;
+    for (i = 0; i < p->icons.size(); i++) {
+        if ((p->icons[i].size.width >= width &&
+             p->icons[i].size.width < result.size.width) &&
+            (p->icons[i].size.height >= height &&
+             p->icons[i].size.height < result.size.height))
+            result = p->icons[i];
+    }
+
+    return result;
+}
+
+void NETWinInfo::setUserTime( Time time ) {
+    if (role != Client) return;
+
+    p->user_time = time;
+    long d = time;
+    XChangeProperty(p->display, p->window, net_wm_user_time, ((Atom) 6), 32,
+                    0, (unsigned char *) &d, 1);
+}
+
+
+unsigned long NETWinInfo::event(XEvent *ev )
+{
+    unsigned long props[ 1 ];
+    event( ev, props, 1 );
+    return props[ 0 ];
+}
+
+void NETWinInfo::event(XEvent *event, unsigned long* properties, int properties_size ) {
+    unsigned long props[ PROPERTIES_SIZE ] = { 0, 0 };
+    (static_cast<void> ((PROPERTIES_SIZE == 2) ? 0 : (__assert_fail ("PROPERTIES_SIZE == 2", "/coolo/prod/kdelibs/kdecore/netwm.cpp", 3128, __PRETTY_FUNCTION__), 0)));
+    unsigned long& dirty = props[ PROTOCOLS ];
+    unsigned long& dirty2 = props[ PROTOCOLS2 ];
+    bool do_update = false;
+
+    if (role == WindowManager && event->type == 33 &&
+        event->xclient.format == 32) {
+
+
+
+
+
+        if (event->xclient.message_type == net_wm_state) {
+            dirty = WMState;
+            int i;
+            long state = 0, mask = 0;
+
+            for (i = 1; i < 3; i++) {
+
+
+
+
+
+
+                if ((Atom) event->xclient.data.l[i] == net_wm_state_modal)
+                    mask |= Modal;
+                else if ((Atom) event->xclient.data.l[i] == net_wm_state_sticky)
+                    mask |= Sticky;
+                else if ((Atom) event->xclient.data.l[i] == net_wm_state_max_vert)
+                    mask |= MaxVert;
+                else if ((Atom) event->xclient.data.l[i] == net_wm_state_max_horiz)
+                    mask |= MaxHoriz;
+                else if ((Atom) event->xclient.data.l[i] == net_wm_state_shaded)
+                    mask |= Shaded;
+                else if ((Atom) event->xclient.data.l[i] == net_wm_state_skip_taskbar)
+                    mask |= SkipTaskbar;
+                else if ((Atom) event->xclient.data.l[i] == net_wm_state_skip_pager)
+                    mask |= SkipPager;
+                else if ((Atom) event->xclient.data.l[i] == net_wm_state_hidden)
+                    mask |= Hidden;
+                else if ((Atom) event->xclient.data.l[i] == net_wm_state_fullscreen)
+                    mask |= FullScreen;
+                else if ((Atom) event->xclient.data.l[i] == net_wm_state_above)
+                    mask |= KeepAbove;
+                else if ((Atom) event->xclient.data.l[i] == net_wm_state_below)
+                    mask |= KeepBelow;
+                else if ((Atom) event->xclient.data.l[i] == net_wm_state_demands_attention)
+                    mask |= DemandsAttention;
+                else if ((Atom) event->xclient.data.l[i] == net_wm_state_stays_on_top)
+                    mask |= StaysOnTop;
+            }
+
+
+            switch (event->xclient.data.l[0]) {
+            case 1:
+
+                state = mask;
+                break;
+
+            case 2:
+
+                state = (p->state & mask) ^ mask;
+                break;
+
+            default:
+
+                ;
+            }
+
+
+
+
+
+
+            changeState(state, mask);
+        } else if (event->xclient.message_type == net_wm_desktop) {
+            dirty = WMDesktop;
+
+            if( event->xclient.data.l[0] == OnAllDesktops )
+                changeDesktop( OnAllDesktops );
+            else
+                changeDesktop(event->xclient.data.l[0] + 1);
+        }
+    }
+
+    if (event->type == 28) {
+
+
+
+
+
+        XEvent pe = *event;
+
+        Bool done = 0;
+        Bool compaction = 0;
+        while (! done) {
+
+
+
+
+
+            if (pe.xproperty.atom == net_wm_name)
+                dirty |= WMName;
+            else if (pe.xproperty.atom == net_wm_visible_name)
+                dirty |= WMVisibleName;
+            else if (pe.xproperty.atom == net_wm_desktop)
+                dirty |= WMDesktop;
+            else if (pe.xproperty.atom == net_wm_window_type)
+                dirty |=WMWindowType;
+            else if (pe.xproperty.atom == net_wm_state)
+                dirty |= WMState;
+            else if (pe.xproperty.atom == net_wm_strut)
+                dirty |= WMStrut;
+            else if (pe.xproperty.atom == net_wm_icon_geometry)
+                dirty |= WMIconGeometry;
+            else if (pe.xproperty.atom == net_wm_icon)
+                dirty |= WMIcon;
+            else if (pe.xproperty.atom == net_wm_pid)
+                dirty |= WMPid;
+            else if (pe.xproperty.atom == net_wm_handled_icons)
+                dirty |= WMHandledIcons;
+            else if (pe.xproperty.atom == net_startup_id)
+                dirty2 |= WM2StartupId;
+            else if (pe.xproperty.atom == net_wm_allowed_actions)
+                dirty2 |= WM2AllowedActions;
+            else if (pe.xproperty.atom == kde_net_wm_system_tray_window_for)
+                dirty |= WMKDESystemTrayWinFor;
+            else if (pe.xproperty.atom == xa_wm_state)
+                dirty |= XAWMState;
+            else if (pe.xproperty.atom == kde_net_wm_frame_strut)
+                dirty |= WMKDEFrameStrut;
+            else if (pe.xproperty.atom == net_wm_icon_name)
+                dirty |= WMIconName;
+            else if (pe.xproperty.atom == net_wm_visible_icon_name)
+                dirty |= WMVisibleIconName;
+            else if (pe.xproperty.atom == net_wm_user_time)
+                dirty2 |= WM2UserTime;
+            else if (pe.xproperty.atom == ((Atom) 35))
+                dirty2 |= WM2GroupLeader;
+            else if (pe.xproperty.atom == ((Atom) 68))
+                dirty2 |= WM2TransientFor;
+            else {
+
+
+
+
+
+                if ( compaction )
+                    XPutBackEvent(p->display, &pe);
+                break;
+            }
+
+            if (XCheckTypedWindowEvent(p->display, p->window, 28, &pe) )
+                compaction = 1;
+            else
+                break;
+        }
+
+        do_update = true;
+    } else if (event->type == 22) {
+
+
+
+
+
+        dirty |= WMGeometry;
+
+
+        p->win_geom.pos.x = event->xconfigure.x;
+        p->win_geom.pos.y = event->xconfigure.y;
+        p->win_geom.size.width = event->xconfigure.width;
+        p->win_geom.size.height = event->xconfigure.height;
+    }
+
+    if( do_update )
+        update( props );
+
+    if( properties_size > PROPERTIES_SIZE )
+        properties_size = PROPERTIES_SIZE;
+    for( int i = 0;
+         i < properties_size;
+         ++i )
+        properties[ i ] = props[ i ];
+}
+
+void NETWinInfo::updateWMState() {
+    unsigned long props[ PROPERTIES_SIZE ] = { XAWMState, 0 };
+    (static_cast<void> ((PROPERTIES_SIZE == 2) ? 0 : (__assert_fail ("PROPERTIES_SIZE == 2", "/coolo/prod/kdelibs/kdecore/netwm.cpp", 3323, __PRETTY_FUNCTION__), 0)));
+    update( props );
+}
+
+void NETWinInfo::update(const unsigned long dirty_props[]) {
+    Atom type_ret;
+    int format_ret;
+    unsigned long nitems_ret, unused;
+    unsigned char *data_ret;
+    unsigned long props[ PROPERTIES_SIZE ];
+    for( int i = 0;
+         i < PROPERTIES_SIZE;
+         ++i )
+        props[ i ] = dirty_props[ i ] & p->properties[ i ];
+    const unsigned long& dirty = props[ PROTOCOLS ];
+    const unsigned long& dirty2 = props[ PROTOCOLS2 ];
+
+
+    if( dirty_props[ PROTOCOLS ] & XAWMState )
+        props[ PROTOCOLS ] |= XAWMState;
+
+    if (dirty & XAWMState) {
+        p->mapping_state = Withdrawn;
+        if (XGetWindowProperty(p->display, p->window, xa_wm_state, 0l, 1l,
+                               0, xa_wm_state, &type_ret, &format_ret,
+                               &nitems_ret, &unused, &data_ret)
+            == Success) {
+            if (type_ret == xa_wm_state && format_ret == 32 &&
+                nitems_ret == 1) {
+                long *state = (long *) data_ret;
+
+                switch(*state) {
+                    case 3:
+                        p->mapping_state = Iconic;
+                        break;
+                    case 1:
+                        p->mapping_state = Visible;
+                        break;
+                    case 0:
+                    default:
+                        p->mapping_state = Withdrawn;
+                        break;
+                }
+
+                p->mapping_state_dirty = 0;
+            }
+            if ( data_ret )
+                XFree(data_ret);
+        }
+    }
+
+    if (dirty & WMState) {
+        p->state = 0;
+        if (XGetWindowProperty(p->display, p->window, net_wm_state, 0l, 2048l,
+                               0, ((Atom) 4), &type_ret, &format_ret,
+                               &nitems_ret, &unused, &data_ret)
+            == Success) {
+            if (type_ret == ((Atom) 4) && format_ret == 32 && nitems_ret > 0) {
+
+
+
+
+
+
+                long *states = (long *) data_ret;
+                unsigned long count;
+
+                for (count = 0; count < nitems_ret; count++) {
+
+
+
+
+
+
+
+                    if ((Atom) states[count] == net_wm_state_modal)
+                        p->state |= Modal;
+                    else if ((Atom) states[count] == net_wm_state_sticky)
+                        p->state |= Sticky;
+                    else if ((Atom) states[count] == net_wm_state_max_vert)
+                        p->state |= MaxVert;
+                    else if ((Atom) states[count] == net_wm_state_max_horiz)
+                        p->state |= MaxHoriz;
+                    else if ((Atom) states[count] == net_wm_state_shaded)
+                        p->state |= Shaded;
+                    else if ((Atom) states[count] == net_wm_state_skip_taskbar)
+                        p->state |= SkipTaskbar;
+                    else if ((Atom) states[count] == net_wm_state_skip_pager)
+                        p->state |= SkipPager;
+                    else if ((Atom) states[count] == net_wm_state_hidden)
+                        p->state |= Hidden;
+                    else if ((Atom) states[count] == net_wm_state_fullscreen)
+                        p->state |= FullScreen;
+                    else if ((Atom) states[count] == net_wm_state_above)
+                        p->state |= KeepAbove;
+                    else if ((Atom) states[count] == net_wm_state_below)
+                        p->state |= KeepBelow;
+                    else if ((Atom) states[count] == net_wm_state_demands_attention)
+                        p->state |= DemandsAttention;
+                    else if ((Atom) states[count] == net_wm_state_stays_on_top)
+                        p->state |= StaysOnTop;
+                }
+            }
+            if ( data_ret )
+                XFree(data_ret);
+        }
+    }
+
+    if (dirty & WMDesktop) {
+        p->desktop = 0;
+        if (XGetWindowProperty(p->display, p->window, net_wm_desktop, 0l, 1l,
+                               0, ((Atom) 6), &type_ret,
+                               &format_ret, &nitems_ret,
+                               &unused, &data_ret)
+            == Success) {
+            if (type_ret == ((Atom) 6) && format_ret == 32 &&
+                nitems_ret == 1) {
+                p->desktop = *((long *) data_ret);
+                if ((signed) p->desktop != OnAllDesktops)
+                    p->desktop++;
+
+                if ( p->desktop == 0 )
+                    p->desktop = OnAllDesktops;
+            }
+            if ( data_ret )
+                XFree(data_ret);
+        }
+    }
+
+    if (dirty & WMName) {
+        delete[] p->name;
+        p->name = __null;
+        if (XGetWindowProperty(p->display, p->window, net_wm_name, 0l,
+                               MAX_PROP_SIZE, 0, UTF8_STRING, &type_ret,
+                               &format_ret, &nitems_ret, &unused, &data_ret)
+            == Success) {
+            if (type_ret == UTF8_STRING && format_ret == 8 && nitems_ret > 0) {
+                p->name = nstrndup((const char *) data_ret, nitems_ret);
+            }
+
+            if( data_ret )
+                XFree(data_ret);
+        }
+    }
+
+    if (dirty & WMVisibleName) {
+        delete[] p->visible_name;
+        p->visible_name = __null;
+        if (XGetWindowProperty(p->display, p->window, net_wm_visible_name, 0l,
+                               MAX_PROP_SIZE, 0, UTF8_STRING, &type_ret,
+                               &format_ret, &nitems_ret, &unused, &data_ret)
+            == Success) {
+            if (type_ret == UTF8_STRING && format_ret == 8 && nitems_ret > 0) {
+                p->visible_name = nstrndup((const char *) data_ret, nitems_ret);
+            }
+
+            if( data_ret )
+                XFree(data_ret);
+        }
+    }
+
+    if (dirty & WMIconName) {
+        delete[] p->icon_name;
+        p->icon_name = __null;
+        char* text_ret = 0;
+        if (XGetWindowProperty(p->display, p->window, net_wm_icon_name, 0l,
+                               MAX_PROP_SIZE, 0, UTF8_STRING, &type_ret,
+                               &format_ret, &nitems_ret, &unused, &data_ret)
+            == Success) {
+            if (type_ret == UTF8_STRING && format_ret == 8 && nitems_ret > 0) {
+                p->icon_name = nstrndup((const char *) data_ret, nitems_ret);
+            }
+
+            if( data_ret )
+                XFree(data_ret);
+        }
+
+        if ( !p->visible_icon_name && XGetIconName(p->display, p->window, &text_ret) ) {
+            p->icon_name = nstrdup(text_ret);
+
+            if( text_ret )
+                XFree(text_ret);
+        }
+    }
+
+    if (dirty & WMVisibleIconName)
+    {
+        delete[] p->visible_icon_name;
+        p->visible_icon_name = __null;
+        if (XGetWindowProperty(p->display, p->window, net_wm_visible_icon_name, 0l,
+                               MAX_PROP_SIZE, 0, UTF8_STRING, &type_ret,
+                               &format_ret, &nitems_ret, &unused, &data_ret)
+            == Success) {
+            if (type_ret == UTF8_STRING && format_ret == 8 && nitems_ret > 0) {
+                p->visible_icon_name = nstrndup((const char *) data_ret, nitems_ret);
+            }
+
+            if( data_ret )
+                XFree(data_ret);
+        }
+    }
+
+    if (dirty & WMWindowType) {
+        p->types.reset();
+        p->types[ 0 ] = Unknown;
+        if (XGetWindowProperty(p->display, p->window, net_wm_window_type, 0l, 2048l,
+                               0, ((Atom) 4), &type_ret, &format_ret,
+                               &nitems_ret, &unused, &data_ret)
+            == Success) {
+            if (type_ret == ((Atom) 4) && format_ret == 32 && nitems_ret > 0) {
+
+
+
+
+
+
+                unsigned long count = 0;
+                long *types = (long *) data_ret;
+                int pos = 0;
+
+                while (count < nitems_ret) {
+                    if ((Atom) types[count] == net_wm_window_type_normal)
+                        p->types[ pos++ ] = Normal;
+                    else if ((Atom) types[count] == net_wm_window_type_desktop)
+                        p->types[ pos++ ] = Desktop;
+                    else if ((Atom) types[count] == net_wm_window_type_dock)
+                        p->types[ pos++ ] = Dock;
+                    else if ((Atom) types[count] == net_wm_window_type_toolbar)
+                        p->types[ pos++ ] = Tool;
+                    else if ((Atom) types[count] == net_wm_window_type_menu)
+                        p->types[ pos++ ] = Menu;
+                    else if ((Atom) types[count] == net_wm_window_type_dialog)
+                        p->types[ pos++ ] = Dialog;
+                    else if ((Atom) types[count] == net_wm_window_type_utility)
+                        p->types[ pos++ ] = Utility;
+                    else if ((Atom) types[count] == net_wm_window_type_splash)
+                        p->types[ pos++ ] = Splash;
+                    else if ((Atom) types[count] == kde_net_wm_window_type_override)
+                        p->types[ pos++ ] = Override;
+                    else if ((Atom) types[count] == kde_net_wm_window_type_topmenu)
+                        p->types[ pos++ ] = TopMenu;
+
+                    count++;
+                }
+            }
+
+            if ( data_ret )
+                XFree(data_ret);
+        }
+    }
+
+    if (dirty & WMStrut) {
+        p->strut = NETStrut();
+        if (XGetWindowProperty(p->display, p->window, net_wm_strut, 0l, 4l,
+                               0, ((Atom) 6), &type_ret, &format_ret,
+                               &nitems_ret, &unused, &data_ret)
+            == Success) {
+            if (type_ret == ((Atom) 6) && format_ret == 32 &&
+                nitems_ret == 4) {
+                long *d = (long *) data_ret;
+                p->strut.left = d[0];
+                p->strut.right = d[1];
+                p->strut.top = d[2];
+                p->strut.bottom = d[3];
+            }
+            if ( data_ret )
+                XFree(data_ret);
+        }
+    }
+
+    if (dirty & WMIconGeometry) {
+        p->icon_geom = NETRect();
+        if (XGetWindowProperty(p->display, p->window, net_wm_icon_geometry, 0l, 4l,
+                               0, ((Atom) 6), &type_ret, &format_ret,
+                               &nitems_ret, &unused, &data_ret)
+            == Success) {
+            if (type_ret == ((Atom) 6) && format_ret == 32 &&
+                nitems_ret == 4) {
+                long *d = (long *) data_ret;
+                p->icon_geom.pos.x = d[0];
+                p->icon_geom.pos.y = d[1];
+                p->icon_geom.size.width = d[2];
+                p->icon_geom.size.height = d[3];
+            }
+            if ( data_ret )
+                XFree(data_ret);
+        }
+    }
+
+    if (dirty & WMIcon) {
+        readIcon(p);
+    }
+
+    if (dirty & WMKDESystemTrayWinFor) {
+        p->kde_system_tray_win_for = 0;
+        if (XGetWindowProperty(p->display, p->window, kde_net_wm_system_tray_window_for,
+                               0l, 1l, 0, ((Atom) 33), &type_ret, &format_ret,
+                               &nitems_ret, &unused, &data_ret)
+            == Success) {
+            if (type_ret == ((Atom) 33) && format_ret == 32 &&
+                nitems_ret == 1) {
+                p->kde_system_tray_win_for = *((Window *) data_ret);
+                if ( p->kde_system_tray_win_for == 0 )
+                    p->kde_system_tray_win_for = p->root;
+            }
+            if ( data_ret )
+                XFree(data_ret);
+        }
+    }
+
+    if (dirty & WMKDEFrameStrut) {
+        p->frame_strut = NETStrut();
+        if (XGetWindowProperty(p->display, p->window, kde_net_wm_frame_strut,
+                               0l, 4l, 0, ((Atom) 6), &type_ret, &format_ret,
+                               &nitems_ret, &unused, &data_ret) == Success) {
+            if (type_ret == ((Atom) 6) && format_ret == 32 && nitems_ret == 4) {
+                long *d = (long *) data_ret;
+
+                p->frame_strut.left = d[0];
+                p->frame_strut.right = d[1];
+                p->frame_strut.top = d[2];
+                p->frame_strut.bottom = d[3];
+            }
+            if ( data_ret )
+                XFree(data_ret);
+        }
+    }
+
+    if (dirty & WMPid) {
+        p->pid = 0;
+        if (XGetWindowProperty(p->display, p->window, net_wm_pid, 0l, 1l,
+                               0, ((Atom) 6), &type_ret, &format_ret,
+                               &nitems_ret, &unused, &data_ret) == Success) {
+            if (type_ret == ((Atom) 6) && format_ret == 32 && nitems_ret == 1) {
+                p->pid = *((long *) data_ret);
+            }
+            if ( data_ret )
+                XFree(data_ret);
+        }
+    }
+
+    if (dirty2 & WM2StartupId)
+    {
+        delete[] p->startup_id;
+        p->startup_id = __null;
+        if (XGetWindowProperty(p->display, p->window, net_startup_id, 0l,
+                               MAX_PROP_SIZE, 0, ((Atom) 31), &type_ret,
+
+                               &format_ret, &nitems_ret, &unused, &data_ret)
+            == Success) {
+            if (type_ret == ((Atom) 31) && format_ret == 8 && nitems_ret > 0) {
+                p->startup_id = nstrndup((const char *) data_ret, nitems_ret);
+            }
+
+            if( data_ret )
+                XFree(data_ret);
+        }
+    }
+
+    if( dirty2 & WM2AllowedActions ) {
+        p->allowed_actions = 0;
+        if (XGetWindowProperty(p->display, p->window, net_wm_allowed_actions, 0l, 2048l,
+                               0, ((Atom) 4), &type_ret, &format_ret,
+                               &nitems_ret, &unused, &data_ret)
+            == Success) {
+            if (type_ret == ((Atom) 4) && format_ret == 32 && nitems_ret > 0) {
+
+
+
+
+
+
+                long *actions = (long *) data_ret;
+                unsigned long count;
+
+                for (count = 0; count < nitems_ret; count++) {
+
+
+
+
+
+
+
+                    if ((Atom) actions[count] == net_wm_action_move)
+                        p->allowed_actions |= ActionMove;
+                    if ((Atom) actions[count] == net_wm_action_resize)
+                        p->allowed_actions |= ActionResize;
+                    if ((Atom) actions[count] == net_wm_action_minimize)
+                        p->allowed_actions |= ActionMinimize;
+                    if ((Atom) actions[count] == net_wm_action_shade)
+                        p->allowed_actions |= ActionShade;
+                    if ((Atom) actions[count] == net_wm_action_stick)
+                        p->allowed_actions |= ActionStick;
+                    if ((Atom) actions[count] == net_wm_action_max_vert)
+                        p->allowed_actions |= ActionMaxVert;
+                    if ((Atom) actions[count] == net_wm_action_max_horiz)
+                        p->allowed_actions |= ActionMaxHoriz;
+                    if ((Atom) actions[count] == net_wm_action_fullscreen)
+                        p->allowed_actions |= ActionFullScreen;
+                    if ((Atom) actions[count] == net_wm_action_change_desk)
+                        p->allowed_actions |= ActionChangeDesktop;
+                    if ((Atom) actions[count] == net_wm_action_close)
+                        p->allowed_actions |= ActionClose;
+                }
+            }
+            if ( data_ret )
+                XFree(data_ret);
+        }
+    }
+
+    if (dirty2 & WM2UserTime) {
+        p->user_time = -1U;
+        if (XGetWindowProperty(p->display, p->window, net_wm_user_time, 0l, 1l,
+                               0, ((Atom) 6), &type_ret, &format_ret,
+                               &nitems_ret, &unused, &data_ret) == Success) {
+
+            if (type_ret == ((Atom) 6) && format_ret == 32 ) {
+                p->user_time = *((long *) data_ret);
+            }
+            if ( data_ret )
+                XFree(data_ret);
+        }
+    }
+
+    if (dirty2 & WM2TransientFor) {
+        p->transient_for = None;
+        XGetTransientForHint(p->display, p->window, &p->transient_for);
+    }
+
+    if (dirty2 & WM2GroupLeader) {
+        XWMHints *hints = XGetWMHints(p->display, p->window);
+        p->window_group = None;
+        if ( hints )
+        {
+            if( hints->flags & (1L << 6) )
+                p->window_group = hints->window_group;
+            XFree( reinterpret_cast< char* >( hints ));
+        }
+    }
+
+}
+
+
+NETRect NETWinInfo::iconGeometry() const {
+    return p->icon_geom;
+}
+
+
+unsigned long NETWinInfo::state() const {
+    return p->state;
+}
+
+
+NETStrut NETWinInfo::strut() const {
+    return p->strut;
+}
+
+NET::WindowType NETWinInfo::windowType( unsigned long supported_types ) const {
+    for( int i = 0;
+         i < p->types.size();
+         ++i ) {
+        switch( p->types[ i ] ) {
+
+
+
+
+
+            case Normal: if( supported_types & NormalMask ) return Normal; break;
+            case Desktop: if( supported_types & DesktopMask ) return Desktop; break;
+            case Dock: if( supported_types & DockMask ) return Dock; break;
+            case Toolbar: if( supported_types & ToolbarMask ) return Toolbar; break;
+            case Menu: if( supported_types & MenuMask ) return Menu; break;
+            case Dialog: if( supported_types & DialogMask ) return Dialog; break;
+            case Override: if( supported_types & OverrideMask ) return Override; break;
+            case TopMenu: if( supported_types & TopMenuMask ) return TopMenu; break;
+            case Utility: if( supported_types & UtilityMask ) return Utility; break;
+            case Splash: if( supported_types & SplashMask ) return Splash; break;
+            default:
+                break;
+        }
+    }
+    return Unknown;
+}
+
+NET::WindowType NETWinInfo::windowType() const {
+    return p->types[ 0 ];
+}
+
+
+const char *NETWinInfo::name() const {
+    return p->name;
+}
+
+
+const char *NETWinInfo::visibleName() const {
+    return p->visible_name;
+}
+
+
+const char *NETWinInfo::iconName() const {
+    return p->icon_name;
+}
+
+
+const char *NETWinInfo::visibleIconName() const {
+    return p->visible_icon_name;
+}
+
+
+int NETWinInfo::desktop() const {
+    return p->desktop;
+}
+
+int NETWinInfo::pid() const {
+    return p->pid;
+}
+
+Time NETWinInfo::userTime() const {
+    return p->user_time;
+}
+
+const char* NETWinInfo::startupId() const {
+    return p->startup_id;
+}
+
+unsigned long NETWinInfo::allowedActions() const {
+    return p->allowed_actions;
+}
+
+Window NETWinInfo::transientFor() const {
+    return p->transient_for;
+}
+
+Window NETWinInfo::groupLeader() const {
+    return p->window_group;
+}
+
+Bool NETWinInfo::handledIcons() const {
+    return p->handled_icons;
+}
+
+
+Window NETWinInfo::kdeSystemTrayWinFor() const {
+    return p->kde_system_tray_win_for;
+}
+
+const unsigned long* NETWinInfo::passedProperties() const {
+    return p->properties;
+}
+
+unsigned long NETWinInfo::properties() const {
+    return p->properties[ PROTOCOLS ];
+}
+
+
+NET::MappingState NETWinInfo::mappingState() const {
+    return p->mapping_state;
+}
+
+void NETRootInfo::virtual_hook( int, void* )
+{ }
+
+void NETWinInfo::virtual_hook( int, void* )
+{ }
+
+
+
+
+
+
+class KGlobal;
+class KCharsetsPrivate;
+
+class QTextCodec;
+class KCharsets
+{
+    friend class KGlobal;
+
+protected:
+
+
+
+    KCharsets();
+
+public:
+
+
+
+
+    virtual ~KCharsets();
+
+
+
+
+
+
+
+    QTextCodec *codecForName(const QString &name) const;
+    QTextCodec *codecForName(const QString &n, bool &ok) const;
+
+
+
+
+
+
+
+    static QChar fromEntity(const QString &str);
+    static QChar fromEntity(const QString &str, int &len);
+
+
+
+
+
+
+
+    static QString toEntity(const QChar &ch);
+    static QString resolveEntities( const QString &text );
+
+
+
+
+
+    QStringList availableEncodingNames();
+
+
+
+
+
+    QStringList descriptiveEncodingNames();
+
+
+
+
+
+    QStringList languages();
+
+
+
+
+
+
+    QStringList encodingsForLanguage( const QString &language );
+
+
+
+
+
+
+    QString languageForEncoding( const QString &encoding );
+
+
+
+
+
+
+    QString encodingForName( const QString &descriptiveName );
+
+private:
+    KCharsetsPrivate *d;
+};
+
+
+
+
+
+
+
+class QFile;
+class KConfigBackEndPrivate;
+class KConfigBackEnd
+{
+  friend class KConfig;
+public:
+  KConfigBackEnd(KConfigBase *_config, const QString &_fileName,
+                 const char * _resType, bool _useKDEGlobals);
+
+
+
+
+  virtual ~KConfigBackEnd() {};
+
+
+
+
+
+
+
+  virtual bool parseConfigFiles() = 0;
+  virtual void sync(bool bMerge = true) = 0;
+  void changeFileName(const QString &_fileName, const char * _resType,
+                      bool _useKDEGlobals);
+
+
+
+
+
+
+  virtual KConfigBase::ConfigState getConfigState() const
+    { return mConfigState; }
+
+
+
+
+
+  QString fileName() const { return mfileName; }
+
+
+
+
+
+  const char * resource() const { return resType; }
+
+
+
+
+
+
+  void setLocaleString(const QCString &_localeString) { localeString = _localeString; }
+
+
+
+
+
+  void setFileWriteMode(int mode);
+
+
+
+
+
+
+  bool checkConfigFilesWritable(bool warnUser);
+
+
+
+
+
+
+
+  __attribute__ ((deprecated)) QString filename() const { return mfileName; }
+
+
+protected:
+  KConfigBase *pConfig;
+
+  QString mfileName;
+  QCString resType;
+  bool useKDEGlobals : 1;
+  bool bFileImmutable : 1;
+  QCString localeString;
+  QString mLocalFileName;
+  QString mGlobalFileName;
+  KConfigBase::ConfigState mConfigState;
+  int mFileMode;
+
+protected:
+  virtual void virtual_hook( int id, void* data );
+private:
+  KConfigBackEndPrivate *d;
+};
+
+class KConfigINIBackEndPrivate;
+class KConfigINIBackEnd : public KConfigBackEnd
+{
+
+public:
+  KConfigINIBackEnd(KConfigBase *_config, const QString &_fileName,
+                    const char * _resType, bool _useKDEGlobals = true)
+    : KConfigBackEnd(_config, _fileName, _resType, _useKDEGlobals) {}
+
+
+
+
+  virtual ~KConfigINIBackEnd() {};
+
+
+
+
+
+
+  bool parseConfigFiles();
+  virtual void sync(bool bMerge = true);
+
+protected:
+  void parseSingleConfigFile(QFile& rFile, KEntryMap *pWriteBackMap = 0L,
+                             bool bGlobal = false, bool bDefault = false);
+  bool writeConfigFile(QString filename, bool bGlobal = false, bool bMerge = true);
+  bool getEntryMap(KEntryMap &map, bool bGlobal, QFile *mergeFile);
+
+
+  void writeEntries(FILE *pStream, const KEntryMap &aTempMap);
+
+protected:
+  virtual void virtual_hook( int id, void* data );
+private:
+  KConfigINIBackEndPrivate *d;
+};
+
+
+
+static bool isUtf8(const char *buf) {
+  int i, n;
+  register unsigned char c;
+  bool gotone = false;
+
+
+  static const unsigned char text_chars[256] = {
+
+        0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0,
+
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
+        1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+        1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+        1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+        1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+        1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+        1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
+
+        3, 3, 3, 3, 3, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+        3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+        2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+        2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+        2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+        2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+        2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+        2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
+  };
+
+
+  for (i = 0; (c = buf[i]); i++) {
+    if ((c & 0x80) == 0) {
+
+
+
+
+
+      if (text_chars[c] != 1)
+        return false;
+
+    } else if ((c & 0x40) == 0) {
+      return false;
+    } else {
+      int following;
+
+    if ((c & 0x20) == 0) {
+      following = 1;
+    } else if ((c & 0x10) == 0) {
+      following = 2;
+    } else if ((c & 0x08) == 0) {
+      following = 3;
+    } else if ((c & 0x04) == 0) {
+      following = 4;
+    } else if ((c & 0x02) == 0) {
+      following = 5;
+    } else
+      return false;
+
+      for (n = 0; n < following; n++) {
+        i++;
+        if (!(c = buf[i]))
+          goto done;
+
+        if ((c & 0x80) == 0 || (c & 0x40))
+          return false;
+      }
+      gotone = true;
+    }
+  }
+done:
+  return gotone;
+}
+
+
+class KConfigBase::KConfigBasePrivate
+{
+public:
+     KConfigBasePrivate() : readDefaults(false) { };
+
+public:
+     bool readDefaults;
+};
+
+KConfigBase::KConfigBase()
+  : backEnd(0L), bDirty(false), bLocaleInitialized(false),
+    bReadOnly(false), bExpand(false), d(0)
+{
+    setGroup(QString::null);
+}
+
+KConfigBase::~KConfigBase()
+{
+    delete d;
+}
+
+void KConfigBase::setLocale()
+{
+  bLocaleInitialized = true;
+
+  if (KGlobal::locale())
+    aLocaleString = KGlobal::locale()->language().utf8();
+  else
+    aLocaleString = KLocale::defaultLanguage().utf8();
+  if (backEnd)
+     backEnd->setLocaleString(aLocaleString);
+}
+
+QString KConfigBase::locale() const
+{
+  return QString::fromUtf8(aLocaleString);
+}
+
+void KConfigBase::setGroup( const QString& group )
+{
+  if ( group.isEmpty() )
+    mGroup = "<default>";
+  else
+    mGroup = group.utf8();
+}
+
+void KConfigBase::setGroup( const char *pGroup )
+{
+  setGroup(QCString(pGroup));
+}
+
+void KConfigBase::setGroup( const QCString &group )
+{
+  if ( group.isEmpty() )
+    mGroup = "<default>";
+  else
+    mGroup = group;
+}
+
+QString KConfigBase::group() const {
+  return QString::fromUtf8(mGroup);
+}
+
+void KConfigBase::setDesktopGroup()
+{
+  mGroup = "Desktop Entry";
+}
+
+bool KConfigBase::hasKey(const QString &key) const
+{
+   return hasKey(key.utf8().data());
+}
+
+bool KConfigBase::hasKey(const char *pKey) const
+{
+  KEntryKey aEntryKey(mGroup, 0);
+  aEntryKey.c_key = pKey;
+  aEntryKey.bDefault = readDefaults();
+
+  if (!locale().isNull()) {
+
+    aEntryKey.bLocal = true;
+    KEntry entry = lookupData(aEntryKey);
+    if (!entry.mValue.isNull())
+       return true;
+    aEntryKey.bLocal = false;
+  }
+
+
+  KEntry entry = lookupData(aEntryKey);
+  return !entry.mValue.isNull();
+}
+
+bool KConfigBase::hasGroup(const QString &group) const
+{
+  return internalHasGroup( group.utf8());
+}
+
+bool KConfigBase::hasGroup(const char *_pGroup) const
+{
+  return internalHasGroup( QCString(_pGroup));
+}
+
+bool KConfigBase::hasGroup(const QCString &_pGroup) const
+{
+  return internalHasGroup( _pGroup);
+}
+
+bool KConfigBase::isImmutable() const
+{
+  return (getConfigState() != ReadWrite);
+}
+
+bool KConfigBase::groupIsImmutable(const QString &group) const
+{
+  if (getConfigState() != ReadWrite)
+     return true;
+
+  KEntryKey groupKey(group.utf8(), 0);
+  KEntry entry = lookupData(groupKey);
+  return entry.bImmutable;
+}
+
+bool KConfigBase::entryIsImmutable(const QString &key) const
+{
+  if (getConfigState() != ReadWrite)
+     return true;
+
+  KEntryKey entryKey(mGroup, 0);
+  KEntry aEntryData = lookupData(entryKey);
+  if (aEntryData.bImmutable)
+    return true;
+
+  QCString utf8_key = key.utf8();
+  entryKey.c_key = utf8_key.data();
+  aEntryData = lookupData(entryKey);
+  if (aEntryData.bImmutable)
+    return true;
+
+  entryKey.bLocal = true;
+  aEntryData = lookupData(entryKey);
+  return aEntryData.bImmutable;
+}
+
+
+QString KConfigBase::readEntryUntranslated( const QString& pKey,
+                                const QString& aDefault ) const
+{
+   return KConfigBase::readEntryUntranslated(pKey.utf8().data(), aDefault);
+}
+
+
+QString KConfigBase::readEntryUntranslated( const char *pKey,
+                                const QString& aDefault ) const
+{
+   QCString result = readEntryUtf8(pKey);
+   if (result.isNull())
+      return aDefault;
+   return QString::fromUtf8(result);
+}
+
+
+QString KConfigBase::readEntry( const QString& pKey,
+                                const QString& aDefault ) const
+{
+   return KConfigBase::readEntry(pKey.utf8().data(), aDefault);
+}
+
+QString KConfigBase::readEntry( const char *pKey,
+                                const QString& aDefault ) const
+{
+
+
+
+
+  if (!bLocaleInitialized && KGlobal::_locale) {
+
+    KConfigBase *that = const_cast<KConfigBase *>(this);
+    that->setLocale();
+  }
+
+  QString aValue;
+
+  bool expand = false;
+
+
+  KEntry aEntryData;
+  KEntryKey entryKey(mGroup, 0);
+  entryKey.c_key = pKey;
+  entryKey.bDefault = readDefaults();
+  entryKey.bLocal = true;
+  aEntryData = lookupData(entryKey);
+  if (!aEntryData.mValue.isNull()) {
+
+
+
+    if ( isUtf8(aEntryData.mValue.data() ) )
+      aValue = QString::fromUtf8( aEntryData.mValue.data() );
+    else
+      aValue = QString::fromLocal8Bit(aEntryData.mValue.data());
+    expand = aEntryData.bExpand;
+
+
+
+    if (aValue.isNull())
+    {
+      static const QString &emptyString = KGlobal::staticQString("");
+      aValue = emptyString;
+    }
+  } else {
+    entryKey.bLocal = false;
+    aEntryData = lookupData(entryKey);
+    if (!aEntryData.mValue.isNull()) {
+      aValue = QString::fromUtf8(aEntryData.mValue.data());
+      if (aValue.isNull())
+      {
+        static const QString &emptyString = KGlobal::staticQString("");
+        aValue = emptyString;
+      }
+      expand = aEntryData.bExpand;
+    } else {
+      aValue = aDefault;
+    }
+  }
+
+
+  if( expand || bExpand )
+    {
+
+      int nDollarPos = aValue.find( '$' );
+
+      while( nDollarPos != -1 && nDollarPos+1 < static_cast<int>(aValue.length())) {
+
+        if( (aValue)[nDollarPos+1] == '(' ) {
+          uint nEndPos = nDollarPos+1;
+
+          while ( (nEndPos <= aValue.length()) && (aValue[nEndPos]!=')') )
+              nEndPos++;
+          nEndPos++;
+          QString cmd = aValue.mid( nDollarPos+2, nEndPos-nDollarPos-3 );
+
+          QString result;
+          FILE *fs = popen(QFile::encodeName(cmd).data(), "r");
+          if (fs)
+          {
+             QTextStream ts(fs, 0x0001);
+             result = ts.read().stripWhiteSpace();
+             pclose(fs);
+          }
+          aValue.replace( nDollarPos, nEndPos-nDollarPos, result );
+        } else if( (aValue)[nDollarPos+1] != '$' ) {
+          uint nEndPos = nDollarPos+1;
+
+          QString aVarName;
+          if (aValue[nEndPos]=='{')
+          {
+            while ( (nEndPos <= aValue.length()) && (aValue[nEndPos]!='}') )
+                nEndPos++;
+            nEndPos++;
+            aVarName = aValue.mid( nDollarPos+2, nEndPos-nDollarPos-3 );
+          }
+          else
+          {
+            while ( nEndPos <= aValue.length() && (aValue[nEndPos].isNumber()
+                    || aValue[nEndPos].isLetter() || aValue[nEndPos]=='_' ) )
+                nEndPos++;
+            aVarName = aValue.mid( nDollarPos+1, nEndPos-nDollarPos-1 );
+          }
+          const char* pEnv = 0;
+          if (!aVarName.isEmpty())
+               pEnv = getenv( aVarName.ascii() );
+          if( pEnv ) {
+
+
+
+            if (isUtf8( pEnv ))
+                aValue.replace( nDollarPos, nEndPos-nDollarPos, QString::fromUtf8(pEnv) );
+            else
+                aValue.replace( nDollarPos, nEndPos-nDollarPos, QString::fromLocal8Bit(pEnv) );
+          } else
+            aValue.remove( nDollarPos, nEndPos-nDollarPos );
+        } else {
+
+          aValue.remove( nDollarPos, 1 );
+          nDollarPos++;
+        }
+        nDollarPos = aValue.find( '$', nDollarPos );
+      }
+    }
+
+  return aValue;
+}
+
+QCString KConfigBase::readEntryUtf8( const char *pKey) const
+{
+
+  KEntryKey entryKey(mGroup, 0);
+  entryKey.bDefault = readDefaults();
+  entryKey.c_key = pKey;
+  KEntry aEntryData = lookupData(entryKey);
+  if (aEntryData.bExpand)
+  {
+
+     return readEntry(pKey, QString::null).utf8();
+  }
+  return aEntryData.mValue;
+}
+
+QVariant KConfigBase::readPropertyEntry( const QString& pKey,
+                                          QVariant::Type type ) const
+{
+  return readPropertyEntry(pKey.utf8().data(), type);
+}
+
+QVariant KConfigBase::readPropertyEntry( const char *pKey,
+                                          QVariant::Type type ) const
+{
+  QVariant va;
+  if ( !hasKey( pKey ) ) return va;
+  (void)va.cast(type);
+  return readPropertyEntry(pKey, va);
+}
+
+QVariant KConfigBase::readPropertyEntry( const QString& pKey,
+                                         const QVariant &aDefault ) const
+{
+  return readPropertyEntry(pKey.utf8().data(), aDefault);
+}
+
+QVariant KConfigBase::readPropertyEntry( const char *pKey,
+                                         const QVariant &aDefault ) const
+{
+  if ( !hasKey( pKey ) ) return aDefault;
+
+  QVariant tmp = aDefault;
+
+  switch( aDefault.type() )
+  {
+      case QVariant::Invalid:
+          return QVariant();
+      case QVariant::String:
+          return QVariant( readEntry( pKey, aDefault.toString() ) );
+      case QVariant::StringList:
+          return QVariant( readListEntry( pKey ) );
+      case QVariant::List: {
+          QStringList strList = readListEntry( pKey );
+          QStringList::ConstIterator it = strList.begin();
+          QStringList::ConstIterator end = strList.end();
+          QValueList<QVariant> list;
+
+          for (; it != end; ++it ) {
+              tmp = *it;
+              list.append( tmp );
+          }
+          return QVariant( list );
+      }
+      case QVariant::Font:
+          return QVariant( readFontEntry( pKey, &tmp.asFont() ) );
+      case QVariant::Point:
+          return QVariant( readPointEntry( pKey, &tmp.asPoint() ) );
+      case QVariant::Rect:
+          return QVariant( readRectEntry( pKey, &tmp.asRect() ) );
+      case QVariant::Size:
+          return QVariant( readSizeEntry( pKey, &tmp.asSize() ) );
+      case QVariant::Color:
+          return QVariant( readColorEntry( pKey, &tmp.asColor() ) );
+      case QVariant::Int:
+          return QVariant( readNumEntry( pKey, aDefault.toInt() ) );
+      case QVariant::UInt:
+          return QVariant( readUnsignedNumEntry( pKey, aDefault.toUInt() ) );
+      case QVariant::Bool:
+          return QVariant( readBoolEntry( pKey, aDefault.toBool() ), 0 );
+      case QVariant::Double:
+          return QVariant( readDoubleNumEntry( pKey, aDefault.toDouble() ) );
+      case QVariant::DateTime:
+          return QVariant( readDateTimeEntry( pKey, &tmp.asDateTime() ) );
+      case QVariant::Date:
+          return QVariant(readDateTimeEntry( pKey, &tmp.asDateTime() ).date());
+
+      case QVariant::Pixmap:
+      case QVariant::Image:
+      case QVariant::Brush:
+      case QVariant::Palette:
+      case QVariant::ColorGroup:
+      case QVariant::Map:
+      case QVariant::IconSet:
+      case QVariant::CString:
+      case QVariant::PointArray:
+      case QVariant::Region:
+      case QVariant::Bitmap:
+      case QVariant::Cursor:
+      case QVariant::SizePolicy:
+      case QVariant::Time:
+      case QVariant::ByteArray:
+      case QVariant::BitArray:
+      case QVariant::KeySequence:
+      case QVariant::Pen:
+          break;
+  }
+
+  ((0) ? (void)0 : qWarning("ASSERT: \"%s\" in %s (%d)","0","/coolo/prod/kdelibs/kdecore/kconfigbase.cpp",521));
+  return QVariant();
+}
+
+int KConfigBase::readListEntry( const QString& pKey,
+                                QStrList &list, char sep ) const
+{
+  return readListEntry(pKey.utf8().data(), list, sep);
+}
+
+int KConfigBase::readListEntry( const char *pKey,
+                                QStrList &list, char sep ) const
+{
+  if( !hasKey( pKey ) )
+    return 0;
+
+  QCString str_list = readEntryUtf8( pKey );
+  if (str_list.isEmpty())
+    return 0;
+
+  list.clear();
+  QCString value = "";
+  int len = str_list.length();
+
+  for (int i = 0; i < len; i++) {
+    if (str_list[i] != sep && str_list[i] != '\\') {
+      value += str_list[i];
+      continue;
+    }
+    if (str_list[i] == '\\') {
+      i++;
+      if ( i < len )
+        value += str_list[i];
+      continue;
+    }
+
+
+
+
+
+    list.append( value );
+    value.truncate(0);
+  }
+
+  if ( str_list[len-1] != sep || ( len > 1 && str_list[len-2] == '\\' ) )
+    list.append( value );
+  return list.count();
+}
+
+QStringList KConfigBase::readListEntry( const QString& pKey, char sep ) const
+{
+  return readListEntry(pKey.utf8().data(), sep);
+}
+
+QStringList KConfigBase::readListEntry( const char *pKey, char sep ) const
+{
+  static const QString& emptyString = KGlobal::staticQString("");
+
+  QStringList list;
+  if( !hasKey( pKey ) )
+    return list;
+  QString str_list = readEntry( pKey );
+  if( str_list.isEmpty() )
+    return list;
+  QString value(emptyString);
+  int len = str_list.length();
+
+  value.reserve( len );
+  for( int i = 0; i < len; i++ )
+    {
+      if( str_list[i] != sep && str_list[i] != '\\' )
+        {
+          value += str_list[i];
+          continue;
+        }
+      if( str_list[i] == '\\' )
+        {
+          i++;
+          if ( i < len )
+            value += str_list[i];
+          continue;
+        }
+      QString finalvalue( value );
+      finalvalue.squeeze();
+      list.append( finalvalue );
+      value.truncate( 0 );
+    }
+  if ( str_list[len-1] != sep || ( len > 1 && str_list[len-2] == '\\' ) )
+  {
+    value.squeeze();
+    list.append( value );
+  }
+  return list;
+}
+
+QValueList<int> KConfigBase::readIntListEntry( const QString& pKey ) const
+{
+  return readIntListEntry(pKey.utf8().data());
+}
+
+QValueList<int> KConfigBase::readIntListEntry( const char *pKey ) const
+{
+  QStringList strlist = readListEntry(pKey);
+  QValueList<int> list;
+  for (QStringList::ConstIterator it = strlist.begin(); it != strlist.end(); it++)
+
+
+    list << (*it).toInt();
+
+  return list;
+}
+
+QString KConfigBase::readPathEntry( const QString& pKey, const QString& pDefault ) const
+{
+  return readPathEntry(pKey.utf8().data(), pDefault);
+}
+
+QString KConfigBase::readPathEntry( const char *pKey, const QString& pDefault ) const
+{
+  const bool bExpandSave = bExpand;
+  bExpand = true;
+  QString aValue = readEntry( pKey, pDefault );
+  bExpand = bExpandSave;
+  return aValue;
+}
+
+QStringList KConfigBase::readPathListEntry( const QString& pKey, char sep ) const
+{
+  return readPathListEntry(pKey.utf8().data(), sep);
+}
+
+QStringList KConfigBase::readPathListEntry( const char *pKey, char sep ) const
+{
+  const bool bExpandSave = bExpand;
+  bExpand = true;
+  QStringList aValue = readListEntry( pKey, sep );
+  bExpand = bExpandSave;
+  return aValue;
+}
+
+int KConfigBase::readNumEntry( const QString& pKey, int nDefault) const
+{
+  return readNumEntry(pKey.utf8().data(), nDefault);
+}
+
+int KConfigBase::readNumEntry( const char *pKey, int nDefault) const
+{
+  QCString aValue = readEntryUtf8( pKey );
+  if( aValue.isNull() )
+    return nDefault;
+  else if( aValue == "true" || aValue == "on" || aValue == "yes" )
+    return 1;
+  else
+    {
+      bool ok;
+      int rc = aValue.toInt( &ok );
+      return( ok ? rc : nDefault );
+    }
+}
+
+
+unsigned int KConfigBase::readUnsignedNumEntry( const QString& pKey, unsigned int nDefault) const
+{
+  return readUnsignedNumEntry(pKey.utf8().data(), nDefault);
+}
+
+unsigned int KConfigBase::readUnsignedNumEntry( const char *pKey, unsigned int nDefault) const
+{
+  QCString aValue = readEntryUtf8( pKey );
+  if( aValue.isNull() )
+    return nDefault;
+  else
+    {
+      bool ok;
+      unsigned int rc = aValue.toUInt( &ok );
+      return( ok ? rc : nDefault );
+    }
+}
+
+
+long KConfigBase::readLongNumEntry( const QString& pKey, long nDefault) const
+{
+  return readLongNumEntry(pKey.utf8().data(), nDefault);
+}
+
+long KConfigBase::readLongNumEntry( const char *pKey, long nDefault) const
+{
+  QCString aValue = readEntryUtf8( pKey );
+  if( aValue.isNull() )
+    return nDefault;
+  else
+    {
+      bool ok;
+      long rc = aValue.toLong( &ok );
+      return( ok ? rc : nDefault );
+    }
+}
+
+
+unsigned long KConfigBase::readUnsignedLongNumEntry( const QString& pKey, unsigned long nDefault) const
+{
+  return readUnsignedLongNumEntry(pKey.utf8().data(), nDefault);
+}
+
+unsigned long KConfigBase::readUnsignedLongNumEntry( const char *pKey, unsigned long nDefault) const
+{
+  QCString aValue = readEntryUtf8( pKey );
+  if( aValue.isNull() )
+    return nDefault;
+  else
+    {
+      bool ok;
+      unsigned long rc = aValue.toULong( &ok );
+      return( ok ? rc : nDefault );
+    }
+}
+
+double KConfigBase::readDoubleNumEntry( const QString& pKey, double nDefault) const
+{
+  return readDoubleNumEntry(pKey.utf8().data(), nDefault);
+}
+
+double KConfigBase::readDoubleNumEntry( const char *pKey, double nDefault) const
+{
+  QCString aValue = readEntryUtf8( pKey );
+  if( aValue.isNull() )
+    return nDefault;
+  else
+    {
+      bool ok;
+      double rc = aValue.toDouble( &ok );
+      return( ok ? rc : nDefault );
+    }
+}
+
+
+bool KConfigBase::readBoolEntry( const QString& pKey, const bool bDefault ) const
+{
+   return readBoolEntry(pKey.utf8().data(), bDefault);
+}
+
+bool KConfigBase::readBoolEntry( const char *pKey, const bool bDefault ) const
+{
+  QCString aValue = readEntryUtf8( pKey );
+
+  if( aValue.isNull() )
+    return bDefault;
+  else
+    {
+      if( aValue == "true" || aValue == "on" || aValue == "yes" || aValue == "1" )
+        return true;
+      else
+        {
+          bool bOK;
+          int val = aValue.toInt( &bOK );
+          if( bOK && val != 0 )
+            return true;
+          else
+            return false;
+        }
+    }
+}
+
+QFont KConfigBase::readFontEntry( const QString& pKey, const QFont* pDefault ) const
+{
+  return readFontEntry(pKey.utf8().data(), pDefault);
+}
+
+QFont KConfigBase::readFontEntry( const char *pKey, const QFont* pDefault ) const
+{
+  QFont aRetFont;
+
+  QString aValue = readEntry( pKey );
+  if( !aValue.isNull() ) {
+    if ( aValue.contains( ',' ) > 5 ) {
+
+      if ( !aRetFont.fromString( aValue ) && pDefault )
+        aRetFont = *pDefault;
+    }
+    else {
+
+
+
+      int nIndex = aValue.find( ',' );
+      if( nIndex == -1 ){
+        if( pDefault )
+          aRetFont = *pDefault;
+        return aRetFont;
+      }
+      aRetFont.setFamily( aValue.left( nIndex ) );
+
+
+      int nOldIndex = nIndex;
+      nIndex = aValue.find( ',', nOldIndex+1 );
+      if( nIndex == -1 ){
+        if( pDefault )
+          aRetFont = *pDefault;
+        return aRetFont;
+      }
+
+      aRetFont.setPointSize( aValue.mid( nOldIndex+1,
+                                         nIndex-nOldIndex-1 ).toInt() );
+
+
+      nOldIndex = nIndex;
+      nIndex = aValue.find( ',', nOldIndex+1 );
+
+      if( nIndex == -1 ){
+        if( pDefault )
+          aRetFont = *pDefault;
+        return aRetFont;
+      }
+
+      aRetFont.setStyleHint( (QFont::StyleHint)aValue.mid( nOldIndex+1, nIndex-nOldIndex-1 ).toUInt() );
+
+
+      nOldIndex = nIndex;
+      nIndex = aValue.find( ',', nOldIndex+1 );
+
+      if( nIndex == -1 ){
+        if( pDefault )
+          aRetFont = *pDefault;
+        return aRetFont;
+      }
+
+      QString chStr=aValue.mid( nOldIndex+1,
+                                nIndex-nOldIndex-1 );
+
+      nOldIndex = nIndex;
+      nIndex = aValue.find( ',', nOldIndex+1 );
+
+      if( nIndex == -1 ){
+        if( pDefault )
+          aRetFont = *pDefault;
+        return aRetFont;
+      }
+
+      aRetFont.setWeight( aValue.mid( nOldIndex+1,
+                                      nIndex-nOldIndex-1 ).toUInt() );
+
+
+      uint nFontBits = aValue.right( aValue.length()-nIndex-1 ).toUInt();
+
+      aRetFont.setItalic( nFontBits & 0x01 );
+      aRetFont.setUnderline( nFontBits & 0x02 );
+      aRetFont.setStrikeOut( nFontBits & 0x04 );
+      aRetFont.setFixedPitch( nFontBits & 0x08 );
+      aRetFont.setRawMode( nFontBits & 0x20 );
+    }
+  }
+  else
+    {
+      if( pDefault )
+        aRetFont = *pDefault;
+    }
+
+  return aRetFont;
+}
+
+
+QRect KConfigBase::readRectEntry( const QString& pKey, const QRect* pDefault ) const
+{
+  return readRectEntry(pKey.utf8().data(), pDefault);
+}
+
+QRect KConfigBase::readRectEntry( const char *pKey, const QRect* pDefault ) const
+{
+  QCString aValue = readEntryUtf8(pKey);
+
+  if (!aValue.isEmpty())
+  {
+    int left, top, width, height;
+
+    if (sscanf(aValue.data(), "%d,%d,%d,%d", &left, &top, &width, &height) == 4)
+    {
+       return QRect(left, top, width, height);
+    }
+  }
+  if (pDefault)
+    return *pDefault;
+  return QRect();
+}
+
+
+QPoint KConfigBase::readPointEntry( const QString& pKey,
+                                    const QPoint* pDefault ) const
+{
+  return readPointEntry(pKey.utf8().data(), pDefault);
+}
+
+QPoint KConfigBase::readPointEntry( const char *pKey,
+                                    const QPoint* pDefault ) const
+{
+  QCString aValue = readEntryUtf8(pKey);
+
+  if (!aValue.isEmpty())
+  {
+    int x,y;
+
+    if (sscanf(aValue.data(), "%d,%d", &x, &y) == 2)
+    {
+       return QPoint(x,y);
+    }
+  }
+  if (pDefault)
+    return *pDefault;
+  return QPoint();
+}
+
+QSize KConfigBase::readSizeEntry( const QString& pKey,
+                                  const QSize* pDefault ) const
+{
+  return readSizeEntry(pKey.utf8().data(), pDefault);
+}
+
+QSize KConfigBase::readSizeEntry( const char *pKey,
+                                  const QSize* pDefault ) const
+{
+  QCString aValue = readEntryUtf8(pKey);
+
+  if (!aValue.isEmpty())
+  {
+    int width,height;
+
+    if (sscanf(aValue.data(), "%d,%d", &width, &height) == 2)
+    {
+       return QSize(width, height);
+    }
+  }
+  if (pDefault)
+    return *pDefault;
+  return QSize();
+}
+
+
+QColor KConfigBase::readColorEntry( const QString& pKey,
+                                    const QColor* pDefault ) const
+{
+  return readColorEntry(pKey.utf8().data(), pDefault);
+}
+
+QColor KConfigBase::readColorEntry( const char *pKey,
+                                    const QColor* pDefault ) const
+{
+  QColor aRetColor;
+  int nRed = 0, nGreen = 0, nBlue = 0;
+
+  QString aValue = readEntry( pKey );
+  if( !aValue.isEmpty() )
+    {
+      if ( aValue.at(0) == '#' )
+        {
+          aRetColor.setNamedColor(aValue);
+        }
+      else
+        {
+
+          bool bOK;
+
+
+          int nIndex = aValue.find( ',' );
+
+          if( nIndex == -1 ){
+
+            if( pDefault )
+              aRetColor = *pDefault;
+            return aRetColor;
+          }
+
+          nRed = aValue.left( nIndex ).toInt( &bOK );
+
+
+          int nOldIndex = nIndex;
+          nIndex = aValue.find( ',', nOldIndex+1 );
+
+          if( nIndex == -1 ){
+
+            if( pDefault )
+              aRetColor = *pDefault;
+            return aRetColor;
+          }
+          nGreen = aValue.mid( nOldIndex+1,
+                               nIndex-nOldIndex-1 ).toInt( &bOK );
+
+
+          nBlue = aValue.right( aValue.length()-nIndex-1 ).toInt( &bOK );
+
+          aRetColor.setRgb( nRed, nGreen, nBlue );
+        }
+    }
+  else {
+
+    if( pDefault )
+      aRetColor = *pDefault;
+  }
+
+  return aRetColor;
+}
+
+
+QDateTime KConfigBase::readDateTimeEntry( const QString& pKey,
+                                          const QDateTime* pDefault ) const
+{
+  return readDateTimeEntry(pKey.utf8().data(), pDefault);
+}
+
+
+QDateTime KConfigBase::readDateTimeEntry( const char *pKey,
+                                          const QDateTime* pDefault ) const
+{
+  if( !hasKey( pKey ) )
+    {
+      if( pDefault )
+        return *pDefault;
+      else
+        return QDateTime::currentDateTime();
+    }
+
+  QStrList list;
+  int count = readListEntry( pKey, list, ',' );
+  if( count == 6 ) {
+    QDate date( atoi( list.at( 0 ) ), atoi( list.at( 1 ) ),
+                atoi( list.at( 2 ) ) );
+    QTime time( atoi( list.at( 3 ) ), atoi( list.at( 4 ) ),
+                atoi( list.at( 5 ) ) );
+
+    return QDateTime( date, time );
+  }
+
+  return QDateTime::currentDateTime();
+}
+
+void KConfigBase::writeEntry( const QString& pKey, const QString& value,
+                                 bool bPersistent,
+                                 bool bGlobal,
+                                 bool bNLS )
+{
+   writeEntry(pKey.utf8().data(), value, bPersistent, bGlobal, bNLS);
+}
+
+void KConfigBase::writeEntry( const char *pKey, const QString& value,
+                                 bool bPersistent,
+                                 bool bGlobal,
+                                 bool bNLS )
+{
+
+
+
+
+
+  if( bPersistent )
+    setDirty(true);
+
+  if (!bLocaleInitialized && KGlobal::locale())
+    setLocale();
+
+  KEntryKey entryKey(mGroup, pKey);
+  entryKey.bLocal = bNLS;
+
+  KEntry aEntryData;
+  aEntryData.mValue = value.utf8();
+  aEntryData.bGlobal = bGlobal;
+  aEntryData.bNLS = bNLS;
+
+  if (bPersistent)
+    aEntryData.bDirty = true;
+
+
+  putData(entryKey, aEntryData, true);
+}
+
+void KConfigBase::writePathEntry( const QString& pKey, const QString & path,
+                                  bool bPersistent, bool bGlobal,
+                                  bool bNLS)
+{
+   writePathEntry(pKey.utf8().data(), path, bPersistent, bGlobal, bNLS);
+}
+
+
+static bool cleanHomeDirPath( QString &path, const QString &homeDir )
+{
+   if (!path.startsWith(homeDir))
+        return false;
+
+   unsigned int len = homeDir.length();
+
+   if (path.length() == len || path[len] == '/') {
+        path = path.replace(0, len, QString::fromLatin1("$HOME"));
+        return true;
+   } else
+        return false;
+}
+
+static QString translatePath( QString path )
+{
+   if (path.isEmpty())
+       return path;
+
+   bool startsWithFile = path.left(5).lower() == QString::fromLatin1("file:");
+
+
+
+   if (!startsWithFile && path[0] != '/' ||
+        startsWithFile && path[5] != '/')
+        return path;
+
+   if (startsWithFile)
+        path.remove(0,5);
+
+
+
+
+
+   QString homeDir0 = QFile::decodeName(getenv("HOME"));
+   QString homeDir1 = QDir::homeDirPath();
+   QString homeDir2 = QDir(homeDir1).canonicalPath();
+   if (cleanHomeDirPath(path, homeDir0) ||
+       cleanHomeDirPath(path, homeDir1) ||
+       cleanHomeDirPath(path, homeDir2) ) {
+
+   }
+
+   if (startsWithFile)
+      path.prepend( "file:" );
+
+   return path;
+}
+
+void KConfigBase::writePathEntry( const char *pKey, const QString & path,
+                                  bool bPersistent, bool bGlobal,
+                                  bool bNLS)
+{
+   writeEntry(pKey, translatePath(path), bPersistent, bGlobal, bNLS);
+}
+
+void KConfigBase::writePathEntry ( const QString& pKey, const QStringList &list,
+                               char sep , bool bPersistent,
+                               bool bGlobal, bool bNLS )
+{
+  writePathEntry(pKey.utf8().data(), list, sep, bPersistent, bGlobal, bNLS);
+}
+
+void KConfigBase::writePathEntry ( const char *pKey, const QStringList &list,
+                               char sep , bool bPersistent,
+                               bool bGlobal, bool bNLS )
+{
+  if( list.isEmpty() )
+    {
+      writeEntry( pKey, QString::fromLatin1(""), bPersistent );
+      return;
+    }
+  QStringList new_list;
+  QStringList::ConstIterator it = list.begin();
+  for( ; it != list.end(); ++it )
+    {
+      QString value = *it;
+      new_list.append( translatePath(value) );
+    }
+  writeEntry( pKey, new_list, sep, bPersistent, bGlobal, bNLS );
+}
+
+void KConfigBase::deleteEntry( const QString& pKey,
+                                 bool bNLS,
+                                 bool bGlobal)
+{
+   deleteEntry(pKey.utf8().data(), bNLS, bGlobal);
+}
+
+void KConfigBase::deleteEntry( const char *pKey,
+                                 bool bNLS,
+                                 bool bGlobal)
+{
+
+
+
+
+
+  setDirty(true);
+
+  if (!bLocaleInitialized && KGlobal::locale())
+    setLocale();
+
+  KEntryKey entryKey(mGroup, pKey);
+  KEntry aEntryData;
+
+  aEntryData.bGlobal = bGlobal;
+  aEntryData.bNLS = bNLS;
+  aEntryData.bDirty = true;
+  aEntryData.bDeleted = true;
+
+
+  putData(entryKey, aEntryData, true);
+}
+
+bool KConfigBase::deleteGroup( const QString& group, bool bDeep, bool bGlobal )
+{
+  KEntryMap aEntryMap = internalEntryMap(group);
+
+  if (!bDeep) {
+
+    return aEntryMap.isEmpty();
+  }
+
+  bool dirty = false;
+  bool checkGroup = true;
+
+  KEntryMapIterator aIt;
+  for (aIt = aEntryMap.begin(); aIt != aEntryMap.end(); ++aIt)
+  {
+    if (!aIt.key().mKey.isEmpty() && !aIt.key().bDefault && !(*aIt).bDeleted)
+    {
+      (*aIt).bDeleted = true;
+      (*aIt).bDirty = true;
+      (*aIt).bGlobal = bGlobal;
+      (*aIt).mValue = 0;
+      putData(aIt.key(), *aIt, checkGroup);
+      checkGroup = false;
+      dirty = true;
+    }
+  }
+  if (dirty)
+     setDirty(true);
+  return true;
+}
+
+void KConfigBase::writeEntry ( const QString& pKey, const QVariant &prop,
+                               bool bPersistent,
+                               bool bGlobal, bool bNLS )
+{
+  writeEntry(pKey.utf8().data(), prop, bPersistent, bGlobal, bNLS);
+}
+
+void KConfigBase::writeEntry ( const char *pKey, const QVariant &prop,
+                               bool bPersistent,
+                               bool bGlobal, bool bNLS )
+{
+  switch( prop.type() )
+    {
+    case QVariant::Invalid:
+      writeEntry( pKey, "", bPersistent, bGlobal, bNLS );
+      return;
+    case QVariant::String:
+      writeEntry( pKey, prop.toString(), bPersistent, bGlobal, bNLS );
+      return;
+    case QVariant::StringList:
+      writeEntry( pKey, prop.toStringList(), ',', bPersistent, bGlobal, bNLS );
+      return;
+    case QVariant::List: {
+        QValueList<QVariant> list = prop.toList();
+        QValueList<QVariant>::ConstIterator it = list.begin();
+        QValueList<QVariant>::ConstIterator end = list.end();
+        QStringList strList;
+
+        for (; it != end; ++it )
+            strList.append( (*it).toString() );
+
+        writeEntry( pKey, strList, ',', bPersistent, bGlobal, bNLS );
+
+        return;
+    }
+    case QVariant::Font:
+      writeEntry( pKey, prop.toFont(), bPersistent, bGlobal, bNLS );
+      return;
+    case QVariant::Point:
+      writeEntry( pKey, prop.toPoint(), bPersistent, bGlobal, bNLS );
+      return;
+    case QVariant::Rect:
+      writeEntry( pKey, prop.toRect(), bPersistent, bGlobal, bNLS );
+      return;
+    case QVariant::Size:
+      writeEntry( pKey, prop.toSize(), bPersistent, bGlobal, bNLS );
+      return;
+    case QVariant::Color:
+      writeEntry( pKey, prop.toColor(), bPersistent, bGlobal, bNLS );
+      return;
+    case QVariant::Int:
+      writeEntry( pKey, prop.toInt(), bPersistent, bGlobal, bNLS );
+      return;
+    case QVariant::UInt:
+      writeEntry( pKey, prop.toUInt(), bPersistent, bGlobal, bNLS );
+      return;
+    case QVariant::Bool:
+      writeEntry( pKey, prop.toBool(), bPersistent, bGlobal, bNLS );
+      return;
+    case QVariant::Double:
+      writeEntry( pKey, prop.toDouble(), bPersistent, bGlobal, 'g', 6, bNLS );
+      return;
+    case QVariant::DateTime:
+      writeEntry( pKey, prop.toDateTime(), bPersistent, bGlobal, bNLS);
+      return;
+    case QVariant::Date:
+      writeEntry( pKey, QDateTime(prop.toDate()), bPersistent, bGlobal, bNLS);
+      return;
+
+    case QVariant::Pixmap:
+    case QVariant::Image:
+    case QVariant::Brush:
+    case QVariant::Palette:
+    case QVariant::ColorGroup:
+    case QVariant::Map:
+    case QVariant::IconSet:
+    case QVariant::CString:
+    case QVariant::PointArray:
+    case QVariant::Region:
+    case QVariant::Bitmap:
+    case QVariant::Cursor:
+    case QVariant::SizePolicy:
+    case QVariant::Time:
+    case QVariant::ByteArray:
+    case QVariant::BitArray:
+    case QVariant::KeySequence:
+    case QVariant::Pen:
+        break;
+    }
+
+  ((0) ? (void)0 : qWarning("ASSERT: \"%s\" in %s (%d)","0","/coolo/prod/kdelibs/kdecore/kconfigbase.cpp",1336));
+}
+
+void KConfigBase::writeEntry ( const QString& pKey, const QStrList &list,
+                               char sep , bool bPersistent,
+                               bool bGlobal, bool bNLS )
+{
+  writeEntry(pKey.utf8().data(), list, sep, bPersistent, bGlobal, bNLS);
+}
+
+void KConfigBase::writeEntry ( const char *pKey, const QStrList &list,
+                               char sep , bool bPersistent,
+                               bool bGlobal, bool bNLS )
+{
+  if( list.isEmpty() )
+    {
+      writeEntry( pKey, QString::fromLatin1(""), bPersistent );
+      return;
+    }
+  QString str_list;
+  QStrListIterator it( list );
+  for( ; it.current(); ++it )
+    {
+      uint i;
+      QString value;
+
+
+
+      if (isUtf8(it.current()))
+        value = QString::fromUtf8(it.current());
+      else
+        value = QString::fromLocal8Bit(it.current());
+      for( i = 0; i < value.length(); i++ )
+        {
+          if( value[i] == sep || value[i] == '\\' )
+            str_list += '\\';
+          str_list += value[i];
+        }
+      str_list += sep;
+    }
+  if( str_list.at(str_list.length() - 1) == sep )
+    str_list.truncate( str_list.length() -1 );
+  writeEntry( pKey, str_list, bPersistent, bGlobal, bNLS );
+}
+
+void KConfigBase::writeEntry ( const QString& pKey, const QStringList &list,
+                               char sep , bool bPersistent,
+                               bool bGlobal, bool bNLS )
+{
+  writeEntry(pKey.utf8().data(), list, sep, bPersistent, bGlobal, bNLS);
+}
+
+void KConfigBase::writeEntry ( const char *pKey, const QStringList &list,
+                               char sep , bool bPersistent,
+                               bool bGlobal, bool bNLS )
+{
+  if( list.isEmpty() )
+    {
+      writeEntry( pKey, QString::fromLatin1(""), bPersistent );
+      return;
+    }
+  QString str_list;
+  QStringList::ConstIterator it = list.begin();
+  for( ; it != list.end(); ++it )
+    {
+      QString value = *it;
+      uint i;
+      for( i = 0; i < value.length(); i++ )
+        {
+          if( value[i] == sep || value[i] == '\\' )
+            str_list += '\\';
+          str_list += value[i];
+        }
+      str_list += sep;
+    }
+  if( str_list.at(str_list.length() - 1) == sep )
+    str_list.truncate( str_list.length() -1 );
+  writeEntry( pKey, str_list, bPersistent, bGlobal, bNLS );
+}
+
+void KConfigBase::writeEntry ( const QString& pKey, const QValueList<int> &list,
+                               bool bPersistent, bool bGlobal, bool bNLS )
+{
+  writeEntry(pKey.utf8().data(), list, bPersistent, bGlobal, bNLS);
+}
+
+void KConfigBase::writeEntry ( const char *pKey, const QValueList<int> &list,
+                               bool bPersistent, bool bGlobal, bool bNLS )
+{
+    QStringList strlist;
+    QValueList<int>::ConstIterator end = list.end();
+    for (QValueList<int>::ConstIterator it = list.begin(); it != end; it++)
+        strlist << QString::number(*it);
+    writeEntry(pKey, strlist, ',', bPersistent, bGlobal, bNLS );
+}
+
+void KConfigBase::writeEntry( const QString& pKey, int nValue,
+                                 bool bPersistent, bool bGlobal,
+                                 bool bNLS )
+{
+  writeEntry( pKey, QString::number(nValue), bPersistent, bGlobal, bNLS );
+}
+
+void KConfigBase::writeEntry( const char *pKey, int nValue,
+                                 bool bPersistent, bool bGlobal,
+                                 bool bNLS )
+{
+  writeEntry( pKey, QString::number(nValue), bPersistent, bGlobal, bNLS );
+}
+
+
+void KConfigBase::writeEntry( const QString& pKey, unsigned int nValue,
+                                 bool bPersistent, bool bGlobal,
+                                 bool bNLS )
+{
+  writeEntry( pKey, QString::number(nValue), bPersistent, bGlobal, bNLS );
+}
+
+void KConfigBase::writeEntry( const char *pKey, unsigned int nValue,
+                                 bool bPersistent, bool bGlobal,
+                                 bool bNLS )
+{
+  writeEntry( pKey, QString::number(nValue), bPersistent, bGlobal, bNLS );
+}
+
+
+void KConfigBase::writeEntry( const QString& pKey, long nValue,
+                                 bool bPersistent, bool bGlobal,
+                                 bool bNLS )
+{
+  writeEntry( pKey, QString::number(nValue), bPersistent, bGlobal, bNLS );
+}
+
+void KConfigBase::writeEntry( const char *pKey, long nValue,
+                                 bool bPersistent, bool bGlobal,
+                                 bool bNLS )
+{
+  writeEntry( pKey, QString::number(nValue), bPersistent, bGlobal, bNLS );
+}
+
+
+void KConfigBase::writeEntry( const QString& pKey, unsigned long nValue,
+                                 bool bPersistent, bool bGlobal,
+                                 bool bNLS )
+{
+  writeEntry( pKey, QString::number(nValue), bPersistent, bGlobal, bNLS );
+}
+
+void KConfigBase::writeEntry( const char *pKey, unsigned long nValue,
+                                 bool bPersistent, bool bGlobal,
+                                 bool bNLS )
+{
+  writeEntry( pKey, QString::number(nValue), bPersistent, bGlobal, bNLS );
+}
+
+
+void KConfigBase::writeEntry( const QString& pKey, double nValue,
+                                 bool bPersistent, bool bGlobal,
+                                 char format, int precision,
+                                 bool bNLS )
+{
+  writeEntry( pKey, QString::number(nValue, format, precision),
+                     bPersistent, bGlobal, bNLS );
+}
+
+void KConfigBase::writeEntry( const char *pKey, double nValue,
+                                 bool bPersistent, bool bGlobal,
+                                 char format, int precision,
+                                 bool bNLS )
+{
+  writeEntry( pKey, QString::number(nValue, format, precision),
+                     bPersistent, bGlobal, bNLS );
+}
+
+
+void KConfigBase::writeEntry( const QString& pKey, bool bValue,
+                                 bool bPersistent,
+                                 bool bGlobal,
+                                 bool bNLS )
+{
+  writeEntry(pKey.utf8().data(), bValue, bPersistent, bGlobal, bNLS);
+}
+
+void KConfigBase::writeEntry( const char *pKey, bool bValue,
+                                 bool bPersistent,
+                                 bool bGlobal,
+                                 bool bNLS )
+{
+  QString aValue;
+
+  if( bValue )
+    aValue = "true";
+  else
+    aValue = "false";
+
+  writeEntry( pKey, aValue, bPersistent, bGlobal, bNLS );
+}
+
+
+void KConfigBase::writeEntry( const QString& pKey, const QFont& rFont,
+                                 bool bPersistent, bool bGlobal,
+                                 bool bNLS )
+{
+  writeEntry(pKey.utf8().data(), rFont, bPersistent, bGlobal, bNLS);
+}
+
+void KConfigBase::writeEntry( const char *pKey, const QFont& rFont,
+                                 bool bPersistent, bool bGlobal,
+                                 bool bNLS )
+{
+  writeEntry( pKey, rFont.toString(), bPersistent, bGlobal, bNLS );
+}
+
+
+void KConfigBase::writeEntry( const QString& pKey, const QRect& rRect,
+                              bool bPersistent, bool bGlobal,
+                              bool bNLS )
+{
+  writeEntry(pKey.utf8().data(), rRect, bPersistent, bGlobal, bNLS);
+}
+
+void KConfigBase::writeEntry( const char *pKey, const QRect& rRect,
+                              bool bPersistent, bool bGlobal,
+                              bool bNLS )
+{
+  QStrList list;
+  QCString tempstr;
+  list.insert( 0, tempstr.setNum( rRect.left() ) );
+  list.insert( 1, tempstr.setNum( rRect.top() ) );
+  list.insert( 2, tempstr.setNum( rRect.width() ) );
+  list.insert( 3, tempstr.setNum( rRect.height() ) );
+
+  writeEntry( pKey, list, ',', bPersistent, bGlobal, bNLS );
+}
+
+
+void KConfigBase::writeEntry( const QString& pKey, const QPoint& rPoint,
+                              bool bPersistent, bool bGlobal,
+                              bool bNLS )
+{
+  writeEntry(pKey.utf8().data(), rPoint, bPersistent, bGlobal, bNLS);
+}
+
+void KConfigBase::writeEntry( const char *pKey, const QPoint& rPoint,
+                              bool bPersistent, bool bGlobal,
+                              bool bNLS )
+{
+  QStrList list;
+  QCString tempstr;
+  list.insert( 0, tempstr.setNum( rPoint.x() ) );
+  list.insert( 1, tempstr.setNum( rPoint.y() ) );
+
+  writeEntry( pKey, list, ',', bPersistent, bGlobal, bNLS );
+}
+
+
+void KConfigBase::writeEntry( const QString& pKey, const QSize& rSize,
+                              bool bPersistent, bool bGlobal,
+                              bool bNLS )
+{
+  writeEntry(pKey.utf8().data(), rSize, bPersistent, bGlobal, bNLS);
+}
+
+void KConfigBase::writeEntry( const char *pKey, const QSize& rSize,
+                              bool bPersistent, bool bGlobal,
+                              bool bNLS )
+{
+  QStrList list;
+  QCString tempstr;
+  list.insert( 0, tempstr.setNum( rSize.width() ) );
+  list.insert( 1, tempstr.setNum( rSize.height() ) );
+
+  writeEntry( pKey, list, ',', bPersistent, bGlobal, bNLS );
+}
+
+void KConfigBase::writeEntry( const QString& pKey, const QColor& rColor,
+                              bool bPersistent,
+                              bool bGlobal,
+                              bool bNLS )
+{
+  writeEntry( pKey.utf8().data(), rColor, bPersistent, bGlobal, bNLS);
+}
+
+void KConfigBase::writeEntry( const char *pKey, const QColor& rColor,
+                              bool bPersistent,
+                              bool bGlobal,
+                              bool bNLS )
+{
+  QString aValue;
+  if (rColor.isValid())
+      aValue.sprintf( "%d,%d,%d", rColor.red(), rColor.green(), rColor.blue() );
+  else
+      aValue = "invalid";
+
+  writeEntry( pKey, aValue, bPersistent, bGlobal, bNLS );
+}
+
+void KConfigBase::writeEntry( const QString& pKey, const QDateTime& rDateTime,
+                              bool bPersistent, bool bGlobal,
+                              bool bNLS )
+{
+  writeEntry(pKey.utf8().data(), rDateTime, bPersistent, bGlobal, bNLS);
+}
+
+void KConfigBase::writeEntry( const char *pKey, const QDateTime& rDateTime,
+                              bool bPersistent, bool bGlobal,
+                              bool bNLS )
+{
+  QStrList list;
+  QCString tempstr;
+
+  QTime time = rDateTime.time();
+  QDate date = rDateTime.date();
+
+  list.insert( 0, tempstr.setNum( date.year() ) );
+  list.insert( 1, tempstr.setNum( date.month() ) );
+  list.insert( 2, tempstr.setNum( date.day() ) );
+
+  list.insert( 3, tempstr.setNum( time.hour() ) );
+  list.insert( 4, tempstr.setNum( time.minute() ) );
+  list.insert( 5, tempstr.setNum( time.second() ) );
+
+  writeEntry( pKey, list, ',', bPersistent, bGlobal, bNLS );
+}
+
+void KConfigBase::parseConfigFiles()
+{
+  if (!bLocaleInitialized && KGlobal::_locale) {
+    setLocale();
+  }
+  if (backEnd)
+  {
+     backEnd->parseConfigFiles();
+     bReadOnly = (backEnd->getConfigState() == ReadOnly);
+  }
+}
+
+void KConfigBase::sync()
+{
+  if (isReadOnly())
+    return;
+
+  if (backEnd)
+     backEnd->sync();
+  if (bDirty)
+    rollback();
+}
+
+KConfigBase::ConfigState KConfigBase::getConfigState() const {
+    if (backEnd)
+       return backEnd->getConfigState();
+    return ReadOnly;
+}
+
+void KConfigBase::rollback( bool )
+{
+  bDirty = false;
+}
+
+
+void KConfigBase::setReadDefaults(bool b)
+{
+  if (!d)
+  {
+     if (!b) return;
+     d = new KConfigBasePrivate();
+  }
+
+  d->readDefaults = b;
+}
+
+bool KConfigBase::readDefaults() const
+{
+  return (d && d->readDefaults);
+}
+
+void KConfigBase::revertToDefault(const QString &key)
+{
+  setDirty(true);
+
+  KEntryKey aEntryKey(mGroup, key.utf8());
+  aEntryKey.bDefault = true;
+
+  if (!locale().isNull()) {
+
+    aEntryKey.bLocal = true;
+    KEntry entry = lookupData(aEntryKey);
+    if (entry.mValue.isNull())
+        entry.bDeleted = true;
+
+    entry.bDirty = true;
+    putData(aEntryKey, entry, true);
+    aEntryKey.bLocal = false;
+  }
+
+
+  KEntry entry = lookupData(aEntryKey);
+  if (entry.mValue.isNull())
+     entry.bDeleted = true;
+  entry.bDirty = true;
+  putData(aEntryKey, entry, true);
+}
+
+bool KConfigBase::hasDefault(const QString &key) const
+{
+  KEntryKey aEntryKey(mGroup, key.utf8());
+  aEntryKey.bDefault = true;
+
+  if (!locale().isNull()) {
+
+    aEntryKey.bLocal = true;
+    KEntry entry = lookupData(aEntryKey);
+    if (!entry.mValue.isNull())
+        return true;
+
+    aEntryKey.bLocal = false;
+  }
+
+
+  KEntry entry = lookupData(aEntryKey);
+  if (!entry.mValue.isNull())
+     return true;
+
+  return false;
+}
+
+
+
+KConfigGroup::KConfigGroup(KConfigBase *master, const QString &group)
+{
+  mMaster = master;
+  backEnd = mMaster->backEnd;
+  bLocaleInitialized = true;
+  bReadOnly = mMaster->bReadOnly;
+  bExpand = false;
+  bDirty = false;
+  mGroup = group.utf8();
+  aLocaleString = mMaster->aLocaleString;
+  setReadDefaults(mMaster->readDefaults());
+}
+
+KConfigGroup::KConfigGroup(KConfigBase *master, const QCString &group)
+{
+  mMaster = master;
+  backEnd = mMaster->backEnd;
+  bLocaleInitialized = true;
+  bReadOnly = mMaster->bReadOnly;
+  bExpand = false;
+  bDirty = false;
+  mGroup = group;
+  aLocaleString = mMaster->aLocaleString;
+  setReadDefaults(mMaster->readDefaults());
+}
+
+KConfigGroup::KConfigGroup(KConfigBase *master, const char * group)
+{
+  mMaster = master;
+  backEnd = mMaster->backEnd;
+  bLocaleInitialized = true;
+  bReadOnly = mMaster->bReadOnly;
+  bExpand = false;
+  bDirty = false;
+  mGroup = group;
+  aLocaleString = mMaster->aLocaleString;
+  setReadDefaults(mMaster->readDefaults());
+}
+
+void KConfigGroup::deleteGroup(bool bGlobal)
+{
+  mMaster->deleteGroup(KConfigBase::group(), false, bGlobal);
+}
+
+void KConfigGroup::setDirty(bool b)
+{
+  mMaster->setDirty(b);
+}
+
+void KConfigGroup::putData(const KEntryKey &_key, const KEntry &_data, bool _checkGroup)
+{
+  mMaster->putData(_key, _data, _checkGroup);
+}
+
+KEntry KConfigGroup::lookupData(const KEntryKey &_key) const
+{
+  return mMaster->lookupData(_key);
+}
+
+void KConfigGroup::sync()
+{
+  mMaster->sync();
+}
+
+void KConfigBase::virtual_hook( int, void* )
+{ }
+
+void KConfigGroup::virtual_hook( int id, void* data )
+{ KConfigBase::virtual_hook( id, data ); }
+
+bool KConfigBase::checkConfigFilesWritable(bool warnUser)
+{
+  if (backEnd)
+    return backEnd->checkConfigFilesWritable(warnUser);
+  else
+    return FALSE;
+}
+
+const char *KConfigBase::className() const
+{
+    return "KConfigBase";
+}
+
+QMetaObject *KConfigBase::metaObj = 0;
+static QMetaObjectCleanUp cleanUp_KConfigBase( "KConfigBase", &KConfigBase::staticMetaObject );
+QMetaObject* KConfigBase::staticMetaObject()
+{
+    if ( metaObj )
+        return metaObj;
+    QMetaObject* parentObject = QObject::staticMetaObject();
+    metaObj = QMetaObject::new_metaobject(
+        "KConfigBase", parentObject,
+        0, 0,
+        0, 0,
+
+        0, 0,
+        0, 0,
+
+        0, 0 );
+    cleanUp_KConfigBase.setMetaObject( metaObj );
+    return metaObj;
+}
+
+void* KConfigBase::qt_cast( const char* clname )
+{
+    if ( !qstrcmp( clname, "KConfigBase" ) )
+        return this;
+    return QObject::qt_cast( clname );
+}
+
+bool KConfigBase::qt_invoke( int _id, QUObject* _o )
+{
+    return QObject::qt_invoke(_id,_o);
+}
+
+bool KConfigBase::qt_emit( int _id, QUObject* _o )
+{
+    return QObject::qt_emit(_id,_o);
+}
+
+
+bool KConfigBase::qt_property( int id, int f, QVariant* v)
+{
+    return QObject::qt_property( id, f, v);
+}
+
+bool KConfigBase::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C"
+
+int mkstemps(char *, int);
+extern "C"
+
+unsigned long strlcat(char*, const char*, unsigned long);
+
+
+
+
+
+
+extern "C"
+
+unsigned long strlcpy(char*, const char*, unsigned long);
+
+
+
+
+KConfig::KConfig( const QString& fileName,
+                 bool bReadOnly, bool bUseKderc, const char *resType )
+  : KConfigBase(), bGroupImmutable(false), bFileImmutable(false),
+    bForceGlobal(false)
+{
+
+  setReadOnly(bReadOnly);
+
+
+
+
+  KConfigINIBackEnd *aBackEnd = new KConfigINIBackEnd(this,
+                                                      fileName,
+                                                      resType,
+                                                      bUseKderc);
+
+  backEnd = aBackEnd;
+
+
+  reparseConfiguration();
+  if (KGlobal::dirs()->addCustomized(this))
+      reparseConfiguration();
+}
+
+KConfig::KConfig(KConfigBackEnd *aBackEnd, bool bReadOnly)
+    : bGroupImmutable(false), bFileImmutable(false),
+    bForceGlobal(false)
+{
+  setReadOnly(bReadOnly);
+  backEnd = aBackEnd;
+  reparseConfiguration();
+}
+
+KConfig::~KConfig()
+{
+  sync();
+
+  delete backEnd;
+}
+
+void KConfig::rollback(bool bDeep)
+{
+  KConfigBase::rollback(bDeep);
+
+  if (!bDeep)
+    return;
+
+
+  for (KEntryMapIterator aIt = aEntryMap.begin();
+       aIt != aEntryMap.end(); ++aIt)
+    (*aIt).bDirty = false;
+}
+
+QStringList KConfig::groupList() const
+{
+  QStringList retList;
+
+  KEntryMapConstIterator aIt = aEntryMap.begin();
+  KEntryMapConstIterator aEnd = aEntryMap.end();
+  for (; aIt != aEnd; ++aIt)
+  {
+    while(aIt.key().mKey.isEmpty())
+    {
+      QCString group = aIt.key().mGroup;
+      ++aIt;
+      while (true)
+      {
+         if (aIt == aEnd)
+            return retList;
+
+         if (aIt.key().mKey.isEmpty())
+            break;
+
+         if (!aIt.key().bDefault && !(*aIt).bDeleted)
+         {
+            if (group != "$Version")
+               retList.append(QString::fromUtf8(group));
+            break;
+         }
+         ++aIt;
+      }
+    }
+  }
+
+  return retList;
+}
+
+QMap<QString, QString> KConfig::entryMap(const QString &pGroup) const
+{
+  QCString pGroup_utf = pGroup.utf8();
+  KEntryKey groupKey( pGroup_utf, 0 );
+  QMap<QString, QString> tmpMap;
+
+  KEntryMapConstIterator aIt = aEntryMap.find(groupKey);
+  if (aIt == aEntryMap.end())
+     return tmpMap;
+  ++aIt;
+  for (; aIt.key().mGroup == pGroup_utf && aIt != aEntryMap.end(); ++aIt)
+  {
+
+    if (!aIt.key().bDefault && !(*aIt).bDeleted)
+      tmpMap.insert(QString::fromUtf8(aIt.key().mKey), QString::fromUtf8((*aIt).mValue.data(), (*aIt).mValue.length()));
+  }
+
+  return tmpMap;
+}
+
+void KConfig::reparseConfiguration()
+{
+  aEntryMap.clear();
+
+
+  KEntryKey groupKey("<default>", 0);
+  aEntryMap.insert(groupKey, KEntry());
+
+  bFileImmutable = false;
+  parseConfigFiles();
+  bFileImmutable = bReadOnly;
+}
+
+KEntryMap KConfig::internalEntryMap(const QString &pGroup) const
+{
+  QCString pGroup_utf = pGroup.utf8();
+  KEntry aEntry;
+  KEntryMapConstIterator aIt;
+  KEntryKey aKey(pGroup_utf, 0);
+  KEntryMap tmpEntryMap;
+
+  aIt = aEntryMap.find(aKey);
+  if (aIt == aEntryMap.end()) {
+
+
+
+    return tmpEntryMap;
+  }
+
+  for (; aIt.key().mGroup == pGroup_utf && aIt != aEntryMap.end(); ++aIt)
+  {
+    tmpEntryMap.insert(aIt.key(), *aIt);
+  }
+
+  return tmpEntryMap;
+}
+
+void KConfig::putData(const KEntryKey &_key, const KEntry &_data, bool _checkGroup)
+{
+  if (bFileImmutable)
+    return;
+
+
+
+  if (_checkGroup)
+  {
+    KEntryKey groupKey( _key.mGroup, 0);
+    KEntry &entry = aEntryMap[groupKey];
+    bGroupImmutable = entry.bImmutable;
+  }
+  if (bGroupImmutable)
+    return;
+
+
+  KEntry &entry = aEntryMap[_key];
+  if (entry.bImmutable)
+    return;
+
+  entry = _data;
+
+  entry.bGlobal |= bForceGlobal;
+
+  if (_key.bDefault)
+  {
+
+
+     KEntryKey key(_key);
+     key.bDefault = false;
+     aEntryMap[key] = _data;
+  }
+}
+
+KEntry KConfig::lookupData(const KEntryKey &_key) const
+{
+  KEntryMapConstIterator aIt = aEntryMap.find(_key);
+  if (aIt != aEntryMap.end())
+  {
+    const KEntry &entry = *aIt;
+    if (entry.bDeleted)
+       return KEntry();
+    else
+       return entry;
+  }
+  else {
+    return KEntry();
+  }
+}
+
+bool KConfig::internalHasGroup(const QCString &group) const
+{
+  KEntryKey groupKey( group, 0);
+
+  KEntryMapConstIterator aIt = aEntryMap.find(groupKey);
+  KEntryMapConstIterator aEnd = aEntryMap.end();
+
+  if (aIt == aEnd)
+     return false;
+  ++aIt;
+  for(; (aIt != aEnd); ++aIt)
+  {
+     if (aIt.key().mKey.isEmpty())
+        break;
+
+     if (!aIt.key().bDefault && !(*aIt).bDeleted)
+        return true;
+  }
+  return false;
+}
+
+void KConfig::setFileWriteMode(int mode)
+{
+  backEnd->setFileWriteMode(mode);
+}
+
+void KConfig::checkUpdate(const QString &id, const QString &updateFile)
+{
+  QString oldGroup = group();
+  setGroup("$Version");
+  QString cfg_id = updateFile+":"+id;
+  QStringList ids = readListEntry("update_info");
+  if (!ids.contains(cfg_id))
+  {
+     QStringList args;
+     args << "--check" << updateFile;
+     KApplication::kdeinitExecWait("kconf_update", args);
+     reparseConfiguration();
+  }
+  setGroup(oldGroup);
+}
+
+KConfig* KConfig::copyTo(const QString &file)
+{
+  KConfig *config = new KConfig(QString::null, false, false);
+  config->backEnd->changeFileName(file, "config", false);
+  config->setReadOnly(false);
+  config->bFileImmutable = false;
+  config->backEnd->mConfigState = ReadWrite;
+
+  QStringList groups = groupList();
+  for(QStringList::ConstIterator it = groups.begin();
+      it != groups.end(); ++it)
+  {
+     QMap<QString, QString> map = entryMap(*it);
+     config->setGroup(*it);
+     for (QMap<QString,QString>::Iterator it2 = map.begin();
+          it2 != map.end(); ++it2)
+     {
+        config->writeEntry(it2.key(), it2.data());
+     }
+
+  }
+  return config;
+}
+
+void KConfig::virtual_hook( int id, void* data )
+{ KConfigBase::virtual_hook( id, data ); }
+
+
+
+const char *KConfig::className() const
+{
+    return "KConfig";
+}
+
+QMetaObject *KConfig::metaObj = 0;
+static QMetaObjectCleanUp cleanUp_KConfig( "KConfig", &KConfig::staticMetaObject );
+QMetaObject* KConfig::staticMetaObject()
+{
+    if ( metaObj )
+        return metaObj;
+    QMetaObject* parentObject = KConfigBase::staticMetaObject();
+    metaObj = QMetaObject::new_metaobject(
+        "KConfig", parentObject,
+        0, 0,
+        0, 0,
+
+        0, 0,
+        0, 0,
+
+        0, 0 );
+    cleanUp_KConfig.setMetaObject( metaObj );
+    return metaObj;
+}
+
+void* KConfig::qt_cast( const char* clname )
+{
+    if ( !qstrcmp( clname, "KConfig" ) )
+        return this;
+    return KConfigBase::qt_cast( clname );
+}
+
+bool KConfig::qt_invoke( int _id, QUObject* _o )
+{
+    return KConfigBase::qt_invoke(_id,_o);
+}
+
+bool KConfig::qt_emit( int _id, QUObject* _o )
+{
+    return KConfigBase::qt_emit(_id,_o);
+}
+
+
+bool KConfig::qt_property( int id, int f, QVariant* v)
+{
+    return KConfigBase::qt_property( id, f, v);
+}
+
+bool KConfig::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C"
+
+int mkstemps(char *, int);
+extern "C"
+
+unsigned long strlcat(char*, const char*, unsigned long);
+
+
+
+
+
+
+extern "C"
+
+unsigned long strlcpy(char*, const char*, unsigned long);
+
+
+
+
+KSimpleConfig::KSimpleConfig(const QString &fileName, bool bReadOnly)
+  : KConfig(QString::fromLatin1(""), bReadOnly, false)
+{
+
+
+  if (!fileName.isNull() && fileName[0] != '/') {
+     backEnd->changeFileName( KGlobal::dirs()->
+        saveLocation("config", QString::null, !bReadOnly)+fileName, "config", false);
+  } else {
+     backEnd->changeFileName(fileName, "config", false);
+  }
+  setReadOnly( bReadOnly );
+  reparseConfiguration();
+}
+
+KSimpleConfig::KSimpleConfig(KConfigBackEnd *backEnd, bool bReadOnly)
+  : KConfig(backEnd, bReadOnly)
+{}
+
+KSimpleConfig::~KSimpleConfig()
+{
+
+
+
+
+  sync();
+}
+
+void KSimpleConfig::sync()
+{
+   if (isReadOnly())
+       return;
+   backEnd->sync(false);
+
+   if (isDirty())
+     rollback();
+}
+
+void KSimpleConfig::virtual_hook( int id, void* data )
+{ KConfig::virtual_hook( id, data ); }
+
+const char *KSimpleConfig::className() const
+{
+    return "KSimpleConfig";
+}
+
+QMetaObject *KSimpleConfig::metaObj = 0;
+static QMetaObjectCleanUp cleanUp_KSimpleConfig( "KSimpleConfig", &KSimpleConfig::staticMetaObject );
+QMetaObject* KSimpleConfig::staticMetaObject()
+{
+    if ( metaObj )
+        return metaObj;
+    QMetaObject* parentObject = KConfig::staticMetaObject();
+    metaObj = QMetaObject::new_metaobject(
+        "KSimpleConfig", parentObject,
+        0, 0,
+        0, 0,
+
+        0, 0,
+        0, 0,
+
+        0, 0 );
+    cleanUp_KSimpleConfig.setMetaObject( metaObj );
+    return metaObj;
+}
+
+void* KSimpleConfig::qt_cast( const char* clname )
+{
+    if ( !qstrcmp( clname, "KSimpleConfig" ) )
+        return this;
+    return KConfig::qt_cast( clname );
+}
+
+bool KSimpleConfig::qt_invoke( int _id, QUObject* _o )
+{
+    return KConfig::qt_invoke(_id,_o);
+}
+
+bool KSimpleConfig::qt_emit( int _id, QUObject* _o )
+{
+    return KConfig::qt_emit(_id,_o);
+}
+
+
+bool KSimpleConfig::qt_property( int id, int f, QVariant* v)
+{
+    return KConfig::qt_property( id, f, v);
+}
+
+bool KSimpleConfig::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C"
+
+int mkstemps(char *, int);
+extern "C"
+
+unsigned long strlcat(char*, const char*, unsigned long);
+
+
+
+
+
+
+extern "C"
+
+unsigned long strlcpy(char*, const char*, unsigned long);
+
+
+
+
+
+
+
+
+
+
+
+class QTextCodec;
+class QIODevice;
+class QFont;
+
+class QTextEncoder {
+public:
+    virtual ~QTextEncoder();
+    virtual QCString fromUnicode(const QString& uc, int& lenInOut) = 0;
+};
+
+class QTextDecoder {
+public:
+    virtual ~QTextDecoder();
+    virtual QString toUnicode(const char* chars, int len) = 0;
+};
+
+class QTextCodec {
+public:
+    virtual ~QTextCodec();
+
+
+    static QTextCodec* loadCharmap(QIODevice*);
+    static QTextCodec* loadCharmapFile(QString filename);
+
+    static QTextCodec* codecForMib(int mib);
+    static QTextCodec* codecForName(const char* hint, int accuracy=0);
+    static QTextCodec* codecForContent(const char* chars, int len);
+    static QTextCodec* codecForIndex(int i);
+    static QTextCodec* codecForLocale();
+    static void setCodecForLocale(QTextCodec *c);
+
+    static QTextCodec* codecForTr();
+    static void setCodecForTr(QTextCodec *c);
+    static QTextCodec* codecForCStrings();
+    static void setCodecForCStrings(QTextCodec *c);
+
+    static void deleteAllCodecs();
+
+    static const char* locale();
+
+    virtual const char* name() const = 0;
+    virtual const char* mimeName() const;
+    virtual int mibEnum() const = 0;
+
+    virtual QTextDecoder* makeDecoder() const;
+    virtual QTextEncoder* makeEncoder() const;
+
+    virtual QString toUnicode(const char* chars, int len) const;
+    virtual QCString fromUnicode(const QString& uc, int& lenInOut) const;
+
+    QCString fromUnicode(const QString& uc) const;
+    QString toUnicode(const QByteArray&, int len) const;
+    QString toUnicode(const QByteArray&) const;
+    QString toUnicode(const QCString&, int len) const;
+    QString toUnicode(const QCString&) const;
+    QString toUnicode(const char* chars) const;
+    virtual bool canEncode( QChar ) const;
+    virtual bool canEncode( const QString& ) const;
+
+    virtual int heuristicContentMatch(const char* chars, int len) const = 0;
+    virtual int heuristicNameMatch(const char* hint) const;
+
+    virtual QByteArray fromUnicode(const QString& uc, int from, int len) const;
+    virtual unsigned short characterFromUnicode(const QString &str, int pos) const;
+
+protected:
+    QTextCodec();
+    static int simpleHeuristicNameMatch(const char* name, const char* hint);
+
+private:
+    friend class QFont;
+    friend class QFontEngineXLFD;
+    void fromUnicodeInternal( const QChar *in, unsigned short *out, int length );
+
+    static QTextCodec *cftr;
+    static QTextCodec *cfcs;
+};
+
+inline QTextCodec* QTextCodec::codecForTr() { return cftr; }
+inline void QTextCodec::setCodecForTr(QTextCodec *c) { cftr = c; }
+inline QTextCodec* QTextCodec::codecForCStrings() { return cfcs; }
+inline void QTextCodec::setCodecForCStrings(QTextCodec *c) { cfcs = c; }
+
+
+
+
+
+
+
+class QFile;
+class QTextStream;
+class QDataStream;
+class KSaveFile;
+class KTempFilePrivate;
+class KTempFile
+{
+   friend class KSaveFile;
+public:
+   KTempFile(QString filePrefix=QString::null,
+             QString fileExtension=QString::null,
+             int mode = 0600 );
+
+
+
+
+
+
+   ~KTempFile();
+
+
+
+
+
+
+   void setAutoDelete(bool autoDelete) { bAutoDelete = autoDelete; }
+   int status() const;
+   QString name() const;
+
+
+
+
+
+
+   int handle() const;
+
+
+
+
+
+
+   FILE *fstream();
+
+
+
+
+
+
+   QTextStream *textStream();
+
+
+
+
+
+
+   QDataStream *dataStream();
+
+
+
+
+
+
+   QFile *file();
+
+
+
+
+
+   void unlink();
+
+
+
+
+
+
+
+   bool close();
+
+protected:
+
+
+
+   KTempFile(bool);
+
+
+
+
+
+   bool create(const QString &filePrefix,
+               const QString &fileExtension, int mode);
+
+   void setError(int error) { mError = error; }
+private:
+   int mError;
+   QString mTmpName;
+   int mFd;
+   FILE *mStream;
+   QFile *mFile;
+   QTextStream *mTextStream;
+   QDataStream *mDataStream;
+   bool bOpen;
+   bool bAutoDelete;
+
+   KTempFilePrivate *d;
+};
+
+class KSaveFilePrivate;
+class KSaveFile
+{
+public:
+
+
+
+
+
+   KSaveFile(const QString &filename, int mode = 0666 );
+
+
+
+
+   ~KSaveFile();
+   int status() const
+        { return mTempFile.status(); }
+
+
+
+
+
+
+   QString name() const;
+
+
+
+
+
+
+   int handle() const
+        { return mTempFile.handle(); }
+
+
+
+
+
+
+   FILE *fstream()
+        { return mTempFile.fstream(); }
+
+
+
+
+
+
+   QFile *file()
+        { return mTempFile.file(); }
+
+
+
+
+
+
+   QTextStream *textStream()
+        { return mTempFile.textStream(); }
+
+
+
+
+
+
+   QDataStream *dataStream()
+        { return mTempFile.dataStream(); }
+
+
+
+
+
+   void abort();
+
+
+
+
+
+
+
+   bool close();
+   static bool backupFile( const QString& filename,
+                           const QString& backupDir = QString::null,
+                           const QString& backupExtension = QString::fromLatin1( "~" ) );
+
+private:
+   QString mFileName;
+   KTempFile mTempFile;
+
+   KSaveFilePrivate *d;
+};
+
+
+extern bool checkAccess(const QString& pathname, int mode);
+
+static QCString printableToString(const char *str, int l)
+{
+
+  while((l>0) &&
+        ((*str == ' ') || (*str == '\t') || (*str == '\r')))
+  {
+     str++; l--;
+  }
+
+
+  while((l>0) &&
+        ((str[l-1] == ' ') || (str[l-1] == '\t') || (str[l-1] == '\r')))
+  {
+     l--;
+  }
+
+  QCString result(l + 1);
+  char *r = result.data();
+
+  for(int i = 0; i < l;i++, str++)
+  {
+     if (*str == '\\')
+     {
+        i++, str++;
+        if (i >= l)
+        {
+           *r++ = '\\';
+           break;
+        }
+        switch(*str)
+        {
+           case 's':
+              *r++ = ' ';
+              break;
+           case 't':
+              *r++ = '\t';
+              break;
+           case 'n':
+              *r++ = '\n';
+              break;
+           case 'r':
+              *r++ = '\r';
+              break;
+           case '\\':
+              *r++ = '\\';
+              break;
+           default:
+              *r++ = '\\';
+              *r++ = *str;
+        }
+     }
+     else
+     {
+        *r++ = *str;
+     }
+  }
+  result.truncate(r-result.data());
+  return result;
+}
+
+static QCString stringToPrintable(const QCString& str){
+  QCString result(str.length()*2);
+  register char *r = result.data();
+  register char *s = str.data();
+
+  if (!s) return QCString("");
+
+
+  if (*s == ' ')
+  {
+     *r++ = '\\'; *r++ = 's';
+     s++;
+  }
+
+  if (*s)
+  {
+   while(*s)
+   {
+    if (*s == '\n')
+    {
+      *r++ = '\\'; *r++ = 'n';
+    }
+    else if (*s == '\t')
+    {
+      *r++ = '\\'; *r++ = 't';
+    }
+    else if (*s == '\r')
+    {
+      *r++ = '\\'; *r++ = 'r';
+    }
+    else if (*s == '\\')
+    {
+      *r++ = '\\'; *r++ = '\\';
+    }
+    else
+    {
+      *r++ = *s;
+    }
+    s++;
+   }
+
+   if (*(r-1) == ' ')
+   {
+      *(r-1) = '\\'; *r++ = 's';
+   }
+  }
+
+  result.truncate(r - result.data());
+  return result;
+}
+
+void KConfigBackEnd::changeFileName(const QString &_fileName,
+                                    const char * _resType,
+                                    bool _useKDEGlobals)
+{
+   mfileName = _fileName;
+   resType = _resType;
+   useKDEGlobals = _useKDEGlobals;
+   if (mfileName.isEmpty())
+      mLocalFileName = QString::null;
+   else if (mfileName[0] == '/')
+      mLocalFileName = mfileName;
+   else
+      mLocalFileName = KGlobal::dirs()->saveLocation(resType) + mfileName;
+
+   if (useKDEGlobals)
+      mGlobalFileName = KGlobal::dirs()->saveLocation("config") +
+              QString::fromLatin1("kdeglobals");
+   else
+      mGlobalFileName = QString::null;
+}
+
+KConfigBackEnd::KConfigBackEnd(KConfigBase *_config,
+                               const QString &_fileName,
+                               const char * _resType,
+                               bool _useKDEGlobals)
+  : pConfig(_config), bFileImmutable(false), mConfigState(KConfigBase::NoAccess), mFileMode(-1)
+{
+   changeFileName(_fileName, _resType, _useKDEGlobals);
+}
+
+void KConfigBackEnd::setFileWriteMode(int mode)
+{
+  mFileMode = mode;
+}
+
+bool KConfigINIBackEnd::parseConfigFiles()
+{
+
+  mConfigState = KConfigBase::ReadOnly;
+  if (!mLocalFileName.isEmpty() && !pConfig->isReadOnly())
+  {
+     if (checkAccess(mLocalFileName, 2))
+     {
+        mConfigState = KConfigBase::ReadWrite;
+     }
+     else
+     {
+
+        KURL path;
+        path.setPath(mLocalFileName);
+        QString dir=path.directory();
+        KStandardDirs::makeDir(dir);
+
+        if (checkAccess(mLocalFileName, 2))
+        {
+           mConfigState = KConfigBase::ReadWrite;
+        }
+     }
+  }
+
+
+  bFileImmutable = false;
+
+
+  if (useKDEGlobals) {
+    QStringList kdercs = KGlobal::dirs()->
+      findAllResources("config", QString::fromLatin1("kdeglobals"));
+
+    if (checkAccess(QString::fromLatin1("/etc/kderc"), 4))
+      kdercs += QString::fromLatin1("/etc/kderc");
+
+    kdercs += KGlobal::dirs()->
+      findAllResources("config", QString::fromLatin1("system.kdeglobals"));
+
+    QStringList::ConstIterator it;
+
+    for (it = kdercs.fromLast(); it != kdercs.end(); --it) {
+
+      QFile aConfigFile( *it );
+      if (!aConfigFile.open( 0x0001 ))
+           continue;
+      parseSingleConfigFile( aConfigFile, 0L, true, (*it != mGlobalFileName) );
+      aConfigFile.close();
+      if (bFileImmutable)
+         break;
+    }
+  }
+
+  bool bReadFile = !mfileName.isEmpty();
+  while(bReadFile) {
+    bReadFile = false;
+    QString bootLanguage;
+    if (useKDEGlobals && localeString.isEmpty() && !KGlobal::_locale) {
+
+       bootLanguage = KLocale::_initLanguage(pConfig);
+       setLocaleString(bootLanguage.utf8());
+    }
+
+    bFileImmutable = false;
+    QStringList list = KGlobal::dirs()->
+      findAllResources(resType, mfileName);
+
+    QStringList::ConstIterator it;
+
+    for (it = list.fromLast(); it != list.end(); --it) {
+
+      QFile aConfigFile( *it );
+
+      bool bIsLocal = (*it == mLocalFileName);
+      if (aConfigFile.open( 0x0001 )) {
+         parseSingleConfigFile( aConfigFile, 0L, false, !bIsLocal );
+         aConfigFile.close();
+         if (bFileImmutable)
+            break;
+      }
+    }
+    if (KGlobal::dirs()->isRestrictedResource(resType, mfileName))
+       bFileImmutable = true;
+    QString currentLanguage;
+    if (!bootLanguage.isEmpty())
+    {
+       currentLanguage = KLocale::_initLanguage(pConfig);
+
+
+       if (bootLanguage != currentLanguage)
+       {
+          bReadFile = true;
+          setLocaleString(currentLanguage.utf8());
+       }
+    }
+  }
+  if (bFileImmutable)
+     mConfigState = KConfigBase::ReadOnly;
+
+  return true;
+}
+
+
+
+static const char **mmap_pEof;
+
+static void mmap_sigbus_handler(int)
+{
+   *mmap_pEof = 0;
+   write(2, "SIGBUS\n", 7);
+   signal(7, mmap_sigbus_handler);
+}
+
+
+
+void KConfigINIBackEnd::parseSingleConfigFile(QFile &rFile,
+                                              KEntryMap *pWriteBackMap,
+                                              bool bGlobal, bool bDefault)
+{
+   void (*old_sighandler)(int) = 0;
+
+   if (!rFile.isOpen())
+      return;
+
+
+
+
+
+
+   QCString aCurrentGroup("<default>");
+
+   const char *s, *eof;
+   QByteArray data;
+
+   unsigned int ll = localeString.length();
+
+
+   const char *map = ( const char* ) mmap(0, rFile.size(), 0x1, 0x02,
+                                          rFile.handle(), 0);
+
+   if (map)
+   {
+      s = map;
+      eof = s + rFile.size();
+
+
+      mmap_pEof = &eof;
+      old_sighandler = signal(7, mmap_sigbus_handler);
+
+   }
+   else
+
+   {
+      rFile.at(0);
+      data = rFile.readAll();
+      s = data.data();
+      eof = s + data.size();
+   }
+
+   bool fileOptionImmutable = false;
+   bool groupOptionImmutable = false;
+   bool groupSkip = false;
+
+   int line = 0;
+   for(; s < eof; s++)
+   {
+      line++;
+
+      while((s < eof) && isspace(*s) && (*s != '\n'))
+         s++;
+
+
+      if ((s < eof) && ((*s == '\n') || (*s == '#')))
+      {
+    sktoeol:
+         while ((s < eof) && (*s != '\n'))
+            s++;
+         continue;
+      }
+      const char *startLine = s;
+
+      if (*s == '[')
+      {
+         while ((s < eof) && (*s != '\n') && (*s != ']')) s++;
+         const char *e = s;
+         while ((s < eof) && (*s != '\n')) s++;
+         if ((e >= eof) || (*e != ']'))
+         {
+            fprintf(stderr, "Invalid group header at %s:%d\n", rFile.name().latin1(), line);
+            continue;
+         }
+
+
+         if ((e-startLine == 3) &&
+             (startLine[1] == '$') &&
+             (startLine[2] == 'i'))
+         {
+            fileOptionImmutable = true;
+            continue;
+         }
+
+         aCurrentGroup = QCString(startLine + 1, e - startLine);
+
+
+
+         if (aCurrentGroup == "KDE Desktop Entry")
+            aCurrentGroup = "Desktop Entry";
+
+         groupOptionImmutable = fileOptionImmutable;
+
+         e++;
+         if ((e+2 < eof) && (*e++ == '[') && (*e++ == '$'))
+         {
+            if (*e == 'i')
+            {
+               groupOptionImmutable = true;
+            }
+         }
+
+         KEntryKey groupKey(aCurrentGroup, 0);
+         KEntry entry = pConfig->lookupData(groupKey);
+         groupSkip = entry.bImmutable;
+
+         if (groupSkip)
+            continue;
+
+         entry.bImmutable = groupOptionImmutable;
+         pConfig->putData(groupKey, entry, false);
+
+         if (pWriteBackMap)
+         {
+
+            (*pWriteBackMap)[groupKey] = entry;
+         }
+
+         continue;
+      }
+      if (groupSkip)
+        goto sktoeol;
+
+      bool optionImmutable = groupOptionImmutable;
+      bool optionDeleted = false;
+      bool optionExpand = false;
+      const char *endOfKey = 0, *locale = 0, *elocale = 0;
+      for (; (s < eof) && (*s != '\n'); s++)
+      {
+         if (*s == '=')
+         {
+            if (!endOfKey)
+                endOfKey = s;
+            goto haveeq;
+         }
+         if (*s == '[')
+         {
+            const char *option;
+            const char *eoption;
+            endOfKey = s;
+            option = ++s;
+            for (;; s++)
+            {
+                if ((s >= eof) || (*s == '\n') || (*s == '=')) {
+                    fprintf(stderr, "Invalid entry (missing ']') at %s:%d\n", rFile.name().latin1(), line);
+                    goto sktoeol;
+                }
+                if (*s == ']')
+                    break;
+            }
+            eoption = s;
+            if (*option != '$')
+            {
+
+              if (locale) {
+                fprintf(stderr, "Invalid entry (second locale!?) at %s:%d\n", rFile.name().latin1(), line);
+                goto sktoeol;
+              }
+              locale = option;
+              elocale = eoption;
+            }
+            else
+            {
+
+              while (option < eoption)
+              {
+                 option++;
+                 if (*option == 'i')
+                    optionImmutable = true;
+                 else if (*option == 'e')
+                    optionExpand = true;
+                 else if (*option == 'd')
+                 {
+                    optionDeleted = true;
+                    goto haveeq;
+                 }
+                 else if (*option == ']')
+                    break;
+              }
+            }
+         }
+      }
+      fprintf(stderr, "Invalid entry (missing '=') at %s:%d\n", rFile.name().latin1(), line);
+      continue;
+
+   haveeq:
+      for (endOfKey--; ; endOfKey--)
+      {
+         if (endOfKey < startLine)
+         {
+           fprintf(stderr, "Invalid entry (empty key) at %s:%d\n", rFile.name().latin1(), line);
+           goto sktoeol;
+         }
+         if (!isspace(*endOfKey))
+            break;
+      }
+
+      const char *st = ++s;
+      while ((s < eof) && (*s != '\n')) s++;
+
+      if (locale) {
+          unsigned int cl = static_cast<unsigned int>(elocale - locale);
+          if ((ll != cl) || memcmp(locale, localeString.data(), ll))
+          {
+
+              if ( cl != 1 || ll != 5 || memcmp(locale, "C", 1) || memcmp(localeString.data(), "en_US", 5)) {
+
+
+                  if (!pWriteBackMap)
+                      continue;
+
+                  endOfKey = elocale;
+                  locale = 0;
+              }
+          }
+      }
+
+
+      QCString key(startLine, endOfKey - startLine + 2);
+      QCString val = printableToString(st, s - st);
+
+
+      KEntryKey aEntryKey(aCurrentGroup, key);
+      aEntryKey.bLocal = (locale != 0);
+      aEntryKey.bDefault = bDefault;
+
+      KEntry aEntry;
+      aEntry.mValue = val;
+      aEntry.bGlobal = bGlobal;
+      aEntry.bImmutable = optionImmutable;
+      aEntry.bDeleted = optionDeleted;
+      aEntry.bExpand = optionExpand;
+      aEntry.bNLS = (locale != 0);
+
+      if (pWriteBackMap) {
+
+
+         pWriteBackMap->insert(aEntryKey, aEntry);
+      } else {
+
+
+
+         pConfig->putData(aEntryKey, aEntry, false);
+      }
+   }
+   if (fileOptionImmutable)
+      bFileImmutable = true;
+
+
+   if (map)
+   {
+      munmap(( char* )map, rFile.size());
+
+      signal(7, old_sighandler);
+
+   }
+
+}
+
+
+void KConfigINIBackEnd::sync(bool bMerge)
+{
+
+  if (!pConfig->isDirty())
+    return;
+
+  bool bEntriesLeft = true;
+
+
+
+
+  if (!mfileName.isEmpty()) {
+
+    if ((resType!="config") && mLocalFileName[0]=='/')
+    {
+       KURL path;
+       path.setPath(mLocalFileName);
+       QString dir=path.directory();
+       KStandardDirs::makeDir(dir);
+    }
+
+
+
+
+
+    if (checkAccess(mLocalFileName, 2)) {
+
+      bEntriesLeft = writeConfigFile( mLocalFileName, false, bMerge );
+    }
+  }
+
+
+
+
+  if (bEntriesLeft && useKDEGlobals) {
+
+
+
+    if (checkAccess ( mGlobalFileName, 2 )) {
+      writeConfigFile( mGlobalFileName, true, bMerge );
+    }
+  }
+
+}
+
+static void writeEntries(FILE *pStream, const KEntryMap& entryMap, bool defaultGroup, bool &firstEntry, const QCString &localeString)
+{
+
+  QCString currentGroup;
+  for (KEntryMapConstIterator aIt = entryMap.begin();
+       aIt != entryMap.end(); ++aIt)
+  {
+     const KEntryKey &key = aIt.key();
+
+
+     if ((key.mGroup != "<default>") == defaultGroup)
+        continue;
+
+
+     if ((key.bDefault) || key.mKey.isEmpty())
+        continue;
+
+     const KEntry &currentEntry = *aIt;
+
+     KEntryMapConstIterator aTestIt = aIt;
+     ++aTestIt;
+     bool hasDefault = (aTestIt != entryMap.end());
+     if (hasDefault)
+     {
+        const KEntryKey &defaultKey = aTestIt.key();
+        if ((!defaultKey.bDefault) ||
+            (defaultKey.mKey != key.mKey) ||
+            (defaultKey.mGroup != key.mGroup) ||
+            (defaultKey.bLocal != key.bLocal))
+           hasDefault = false;
+     }
+
+
+     if (hasDefault)
+     {
+
+        if ((currentEntry.mValue == (*aTestIt).mValue) &&
+            (currentEntry.bDeleted == (*aTestIt).bDeleted))
+           continue;
+     }
+     else
+     {
+
+        if (currentEntry.bDeleted)
+           continue;
+     }
+
+     if (!defaultGroup && (currentGroup != key.mGroup)) {
+        if (!firstEntry)
+            fprintf(pStream, "\n");
+        currentGroup = key.mGroup;
+        fprintf(pStream, "[%s]\n", currentGroup.data());
+     }
+
+     firstEntry = false;
+
+     fputs(key.mKey.data(), pStream);
+
+     if ( currentEntry.bNLS )
+     {
+        fputc('[', pStream);
+        fputs(localeString.data(), pStream);
+        fputc(']', pStream);
+     }
+
+     if (currentEntry.bDeleted)
+     {
+        fputs("[$d]\n", pStream);
+     }
+     else
+     {
+        if (currentEntry.bImmutable || currentEntry.bExpand)
+        {
+           fputc('[', pStream);
+           fputc('$', pStream);
+           if (currentEntry.bImmutable)
+              fputc('i', pStream);
+           if (currentEntry.bExpand)
+              fputc('e', pStream);
+
+           fputc(']', pStream);
+        }
+        fputc('=', pStream);
+        fputs(stringToPrintable(currentEntry.mValue).data(), pStream);
+        fputc('\n', pStream);
+     }
+  }
+}
+
+bool KConfigINIBackEnd::getEntryMap(KEntryMap &aTempMap, bool bGlobal,
+                                    QFile *mergeFile)
+{
+  bool bEntriesLeft = false;
+  bFileImmutable = false;
+  if (mergeFile)
+  {
+
+    if (mergeFile->open(0x0001))
+    {
+
+       parseSingleConfigFile(*mergeFile, &aTempMap, bGlobal, false );
+
+       if (bFileImmutable)
+          return bEntriesLeft;
+    }
+
+    KEntryMap aMap = pConfig->internalEntryMap();
+
+
+    for (KEntryMapIterator aIt = aMap.begin();
+          aIt != aMap.end(); ++aIt)
+    {
+      const KEntry &currentEntry = *aIt;
+      if(aIt.key().bDefault)
+      {
+         aTempMap.replace(aIt.key(), currentEntry);
+         continue;
+      }
+
+      if (!currentEntry.bDirty)
+         continue;
+
+
+
+      if (currentEntry.bGlobal != bGlobal)
+      {
+
+        bEntriesLeft = true;
+        continue;
+      }
+
+
+
+      KEntryMapIterator aIt2 = aTempMap.find(aIt.key());
+      if (aIt2 != aTempMap.end() && (*aIt2).bImmutable)
+        continue;
+
+      aTempMap.insert(aIt.key(), currentEntry, true);
+    }
+  }
+  else
+  {
+
+    aTempMap = pConfig->internalEntryMap();
+    bEntriesLeft = true;
+  }
+
+  return bEntriesLeft;
+}
+
+
+bool KConfigINIBackEnd::writeConfigFile(QString filename, bool bGlobal,
+                                        bool bMerge)
+{
+
+  if (pConfig->isReadOnly())
+    return true;
+
+  KEntryMap aTempMap;
+  QFile *mergeFile = (bMerge ? new QFile(filename) : 0);
+  bool bEntriesLeft = getEntryMap(aTempMap, bGlobal, mergeFile);
+  delete mergeFile;
+  if (bFileImmutable) return true;
+
+
+
+
+
+
+  int fileMode = -1;
+  bool createNew = true;
+
+  struct stat buf;
+  if (lstat(QFile::encodeName(filename), &buf) == 0)
+  {
+     if (((((buf.st_mode)) & 0170000) == (0120000)))
+     {
+
+        if (stat(QFile::encodeName(filename), &buf) == 0)
+        {
+
+           createNew = false;
+        }
+     }
+     else if (buf.st_uid == getuid())
+     {
+
+        fileMode = buf.st_mode & 0777;
+     }
+     else
+     {
+
+
+        createNew = false;
+     }
+  }
+
+  KSaveFile *pConfigFile = 0;
+  FILE *pStream = 0;
+
+  if (createNew)
+  {
+     pConfigFile = new KSaveFile( filename, 0600 );
+
+     if (pConfigFile->status() != 0)
+     {
+        delete pConfigFile;
+        return bEntriesLeft;
+     }
+
+     if (!bGlobal && (fileMode == -1))
+        fileMode = mFileMode;
+
+     if (fileMode != -1)
+     {
+        fchmod(pConfigFile->handle(), fileMode);
+     }
+
+     pStream = pConfigFile->fstream();
+  }
+  else
+  {
+
+
+     int fd = open( QFile::encodeName(filename), 01 | 01000);
+     if (fd < 0)
+        return bEntriesLeft;
+     pStream = fdopen( fd, "w");
+     if (!pStream)
+     {
+        close(fd);
+        return bEntriesLeft;
+     }
+  }
+
+  writeEntries(pStream, aTempMap);
+
+  if (pConfigFile)
+  {
+     pConfigFile->close();
+     delete pConfigFile;
+  }
+  else
+  {
+     fclose(pStream);
+  }
+
+  return bEntriesLeft;
+}
+
+void KConfigINIBackEnd::writeEntries(FILE *pStream, const KEntryMap &aTempMap)
+{
+  bool firstEntry = true;
+
+
+  ::writeEntries(pStream, aTempMap, true, firstEntry, localeString);
+
+
+  ::writeEntries(pStream, aTempMap, false, firstEntry, localeString);
+}
+
+void KConfigBackEnd::virtual_hook( int, void* )
+{ }
+
+void KConfigINIBackEnd::virtual_hook( int id, void* data )
+{ KConfigBackEnd::virtual_hook( id, data ); }
+
+bool KConfigBackEnd::checkConfigFilesWritable(bool warnUser)
+{
+
+  bool allWritable = TRUE;
+  QString errorMsg( ("Will not save configuration.\n") );
+  if ( !mLocalFileName.isEmpty() && !bFileImmutable && !checkAccess(mLocalFileName,2) )
+  {
+    allWritable = FALSE;
+    errorMsg = errorMsg + QString(("Configuration file \"%1\" not writable.\n")).arg(mLocalFileName);
+  }
+
+
+  if ( !mGlobalFileName.isEmpty() && useKDEGlobals && !bFileImmutable && !checkAccess(mGlobalFileName,2) )
+  {
+    errorMsg = errorMsg + QString(("Configuration file \"%1\" not writable.\n")).arg(mGlobalFileName);
+    allWritable = FALSE;
+  }
+
+  if (warnUser && !allWritable)
+  {
+
+    errorMsg = errorMsg + QString(("Please contact your systems administrator.\n"));
+    QString cmdToExec = KStandardDirs::findExe(QString("kdialog"));
+    KApplication *app = KApplication::kApplication();
+    if (!cmdToExec.isEmpty() && app)
+    {
+      KProcess lprocess;
+      lprocess << cmdToExec << "--title" << app->instanceName() << "--msgbox" << errorMsg;
+      lprocess.start( KProcess::Block );
+    }
+  }
+  return allWritable;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C"
+
+int mkstemps(char *, int);
+extern "C"
+
+unsigned long strlcat(char*, const char*, unsigned long);
+
+
+
+
+
+
+extern "C"
+
+unsigned long strlcpy(char*, const char*, unsigned long);
+
+
+
+
+
+
+
+
+
+
+class KSelectionOwnerPrivate;
+
+
+class KSelectionOwner
+    : public QObject
+    {
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+    public:
+        KSelectionOwner( Atom selection, int screen_P = -1 );
+        KSelectionOwner( const char* selection, int screen_P = -1 );
+        virtual ~KSelectionOwner();
+        bool claim( bool force, bool force_kill = true );
+        void release();
+        void filterEvent( XEvent* ev_P );
+    protected:
+        void lostOwnership();
+    protected:
+        virtual bool genericReply( Atom target, Atom property, Window requestor );
+        virtual void replyTargets( Atom property, Window requestor );
+        virtual void getAtoms();
+        void setData( long extra1, long extra2 );
+    private:
+        void filter_selection_request( XSelectionRequestEvent& ev_P );
+        bool handle_selection( Atom target_P, Atom property_P, Window requestor_P );
+        const Atom selection;
+        const int screen;
+        Window window;
+        Time timestamp;
+        long extra1, extra2;
+        static Atom manager_atom;
+        static Atom xa_multiple;
+        static Atom xa_targets;
+        static Atom xa_timestamp;
+    protected:
+        virtual void virtual_hook( int id, void* data );
+    private:
+        KSelectionOwnerPrivate* d;
+    };
+
+class KSelectionWatcherPrivate;
+
+
+class KSelectionWatcher
+    : public QObject
+    {
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+    public:
+        KSelectionWatcher( Atom selection_P, int screen_P = -1 );
+        KSelectionWatcher( const char* selection_P, int screen_P = -1 );
+        virtual ~KSelectionWatcher();
+        Window owner();
+        void filterEvent( XEvent* ev_P );
+    protected:
+        void newOwner( Window owner );
+        void lostOwner();
+    private:
+        void init();
+        const Atom selection;
+        const int screen;
+        Window selection_owner;
+        static Atom manager_atom;
+    protected:
+        virtual void virtual_hook( int id, void* data );
+    private:
+        KSelectionWatcherPrivate* d;
+    };
+
+
+
+
+class KXErrorHandler
+    {
+    public:
+
+
+
+
+        KXErrorHandler( Display* dpy = qt_xdisplay());
+
+
+
+
+
+        KXErrorHandler( bool (*handler)( int request, int error_code, unsigned long resource_id ), Display* dpy = qt_xdisplay());
+
+
+
+
+
+
+        KXErrorHandler( int (*handler)( Display*, XErrorEvent* ), Display* dpy = qt_xdisplay());
+        bool error( bool sync ) const;
+        ~KXErrorHandler();
+    private:
+        void addHandler();
+        int handle( Display* dpy, XErrorEvent* e );
+        bool (*user_handler1)( int request, int error_code, unsigned long resource_id );
+        int (*user_handler2)( Display*, XErrorEvent* );
+        int (*old_handler)( Display*, XErrorEvent* );
+        unsigned long first_request;
+        Display* display;
+        bool was_error;
+        static int handler_wrapper( Display*, XErrorEvent* );
+        static KXErrorHandler** handlers;
+        static int pos;
+        static int size;
+        class KXErrorHandlerPrivate* d;
+    };
+
+
+class KSelectionOwnerPrivate
+    : public QWidget
+    {
+    public:
+        KSelectionOwnerPrivate( KSelectionOwner* owner );
+    protected:
+        virtual bool x11Event( XEvent* ev );
+    private:
+        KSelectionOwner* owner;
+    };
+
+KSelectionOwnerPrivate::KSelectionOwnerPrivate( KSelectionOwner* owner_P )
+    : owner( owner_P )
+    {
+    KApplication::kApplication()->installX11EventFilter( this );
+    }
+
+bool KSelectionOwnerPrivate::x11Event( XEvent* ev_P )
+    {
+    owner->filterEvent( ev_P );
+    return false;
+    }
+
+KSelectionOwner::KSelectionOwner( Atom selection_P, int screen_P )
+    : selection( selection_P ),
+        screen( screen_P >= 0 ? screen_P : (((_XPrivDisplay)qt_xdisplay())->default_screen)),
+        window( None ),
+        timestamp( 0L ),
+        extra1( 0 ), extra2( 0 ),
+        d( new KSelectionOwnerPrivate( this ))
+    {
+    }
+
+KSelectionOwner::KSelectionOwner( const char* selection_P, int screen_P )
+    : selection( XInternAtom( qt_xdisplay(), selection_P, 0 )),
+        screen( screen_P >= 0 ? screen_P : (((_XPrivDisplay)qt_xdisplay())->default_screen)),
+        window( None ),
+        timestamp( 0L ),
+        extra1( 0 ), extra2( 0 ),
+        d( new KSelectionOwnerPrivate( this ))
+    {
+    }
+
+KSelectionOwner::~KSelectionOwner()
+    {
+    release();
+    delete d;
+    }
+
+bool KSelectionOwner::claim( bool force_P, bool force_kill_P )
+    {
+    if( manager_atom == None )
+        getAtoms();
+    if( timestamp != 0L )
+        release();
+    Display* const dpy = qt_xdisplay();
+    Window prev_owner = XGetSelectionOwner( dpy, selection );
+    if( prev_owner != None )
+        {
+        if( !force_P )
+            {
+
+            return false;
+            }
+        XSelectInput( dpy, prev_owner, (1L<<17) );
+        }
+    XSetWindowAttributes attrs;
+    attrs.override_redirect = 1;
+    window = XCreateWindow( dpy, ((&((_XPrivDisplay)dpy)->screens[screen])->root), 0, 0, 1, 1,
+        0, 0L, 2, 0L, (1L<<9), &attrs );
+
+    Atom tmp = ((Atom) 4);
+    XSelectInput( dpy, window, (1L<<22) );
+    XChangeProperty( dpy, window, ((Atom) 4), ((Atom) 4), 32, 0,
+        reinterpret_cast< unsigned char* >( &tmp ), 1 );
+    XEvent ev;
+    XSync( dpy, 0 );
+    XCheckTypedWindowEvent( dpy, window, 28, &ev );
+    timestamp = ev.xproperty.time;
+    XSelectInput( dpy, window, (1L<<17) );
+    XSetSelectionOwner( dpy, selection, window, timestamp );
+    Window new_owner = XGetSelectionOwner( dpy, selection );
+    if( new_owner != window )
+        {
+
+        XDestroyWindow( dpy, window );
+        timestamp = 0L;
+        return false;
+        }
+    if( prev_owner != None )
+        {
+
+        for( int cnt = 0;
+             ;
+             ++cnt )
+            {
+            if( XCheckTypedWindowEvent( dpy, prev_owner, 17, &ev ) == 1 )
+                break;
+            struct timeval tm = { 0, 50000 };
+            select( 0, __null, __null, __null, &tm );
+            if( cnt == 19 )
+                {
+                if( force_kill_P )
+                    {
+
+                    XKillClient( dpy, prev_owner );
+                    }
+                break;
+                }
+            }
+        }
+    ev.type = 33;
+    ev.xclient.window = ((&((_XPrivDisplay)dpy)->screens[screen])->root);
+    ev.xclient.display = dpy;
+    ev.xclient.message_type = manager_atom;
+    ev.xclient.format = 32;
+    ev.xclient.data.l[ 0 ] = timestamp;
+    ev.xclient.data.l[ 1 ] = selection;
+    ev.xclient.data.l[ 2 ] = window;
+    ev.xclient.data.l[ 3 ] = extra1;
+    ev.xclient.data.l[ 4 ] = extra2;
+    XSendEvent( dpy, ((&((_XPrivDisplay)dpy)->screens[screen])->root), 0, (1L<<17), &ev );
+
+    return true;
+    }
+
+
+void KSelectionOwner::release()
+    {
+    if( timestamp == 0L )
+        return;
+    XDestroyWindow( qt_xdisplay(), window );
+
+    timestamp = 0L;
+    }
+
+void KSelectionOwner::setData( long extra1_P, long extra2_P )
+    {
+    extra1 = extra1_P;
+    extra2 = extra2_P;
+    }
+
+void KSelectionOwner::filterEvent( XEvent* ev_P )
+    {
+    switch( ev_P->type )
+        {
+        case 29:
+            {
+            if( timestamp == 0L || ev_P->xselectionclear.selection != selection )
+                return;
+            timestamp = 0L;
+
+            lostOwnership();
+            XSelectInput( qt_xdisplay(), window, 0 );
+            XDestroyWindow( qt_xdisplay(), window );
+          return;
+            }
+        case 17:
+            {
+            if( timestamp == 0L || ev_P->xdestroywindow.window != window )
+                return;
+            timestamp = 0L;
+
+            lostOwnership();
+          return;
+            }
+        case 31:
+            {
+            if( timestamp == 0L || ev_P->xselection.selection != selection )
+                return;
+
+          return;
+            }
+        case 30:
+            filter_selection_request( ev_P->xselectionrequest );
+          return;
+        }
+    }
+
+void KSelectionOwner::filter_selection_request( XSelectionRequestEvent& ev_P )
+    {
+    if( timestamp == 0L || ev_P.selection != selection )
+        return;
+    if( ev_P.time != 0L
+        && ev_P.time - timestamp > 1U << 31 )
+        return;
+
+    bool handled = false;
+    if( ev_P.target == xa_multiple )
+        {
+        if( ev_P.property != None )
+            {
+            const int MAX_ATOMS = 100;
+            int format;
+            Atom type;
+            unsigned long items;
+            unsigned long after;
+            unsigned char* data;
+            if( XGetWindowProperty( qt_xdisplay(), ev_P.requestor, ev_P.property, 0,
+                MAX_ATOMS, 0, 0L, &type, &format, &items, &after,
+                &data ) == Success && format == 32 && items % 2 == 0 )
+                {
+                bool handled_array[ MAX_ATOMS ];
+                Atom* atoms = reinterpret_cast< Atom* >( data );
+                for( unsigned int i = 0;
+                     i < items / 2;
+                     ++i )
+                    handled_array[ i ] = handle_selection(
+                        atoms[ i * 2 ], atoms[ i * 2 + 1 ], ev_P.requestor );
+                bool all_handled = true;
+                for( unsigned int i = 0;
+                     i < items / 2;
+                     ++i )
+                    if( !handled_array[ i ] )
+                        {
+                        all_handled = false;
+                        atoms[ i * 2 + 1 ] = None;
+                        }
+                if( !all_handled )
+                    XChangeProperty( qt_xdisplay(), ev_P.requestor, ev_P.property, ((Atom) 4),
+                        32, 0, reinterpret_cast< unsigned char* >( atoms ), items );
+                handled = true;
+                XFree( data );
+                }
+            }
+        }
+    else
+        {
+        if( ev_P.property == None )
+            ev_P.property = ev_P.target;
+        handled = handle_selection( ev_P.target, ev_P.property, ev_P.requestor );
+        }
+    XEvent ev;
+    ev.xselection.type = 31;
+    ev.xselection.display = qt_xdisplay();
+    ev.xselection.requestor = ev_P.requestor;
+    ev.xselection.target = ev_P.target;
+    ev.xselection.property = handled ? ev_P.property : None;
+    XSendEvent( qt_xdisplay(), ev_P.requestor, 0, 0, &ev );
+    }
+
+bool KSelectionOwner::handle_selection( Atom target_P, Atom property_P, Window requestor_P )
+    {
+    if( target_P == xa_timestamp )
+        {
+
+        XChangeProperty( qt_xdisplay(), requestor_P, property_P, ((Atom) 19), 32,
+            0, reinterpret_cast< unsigned char* >( &timestamp ), 1 );
+        }
+    else if( target_P == xa_targets )
+        replyTargets( property_P, requestor_P );
+    else if( genericReply( target_P, property_P, requestor_P ))
+        ;
+    else
+        return false;
+    return true;
+    }
+
+void KSelectionOwner::replyTargets( Atom property_P, Window requestor_P )
+    {
+    Atom atoms[ 3 ] = { xa_multiple, xa_timestamp, xa_targets };
+
+    XChangeProperty( qt_xdisplay(), requestor_P, property_P, ((Atom) 4), 32, 0,
+        reinterpret_cast< unsigned char* >( atoms ), 3 );
+    }
+
+bool KSelectionOwner::genericReply( Atom, Atom, Window )
+    {
+    return false;
+    }
+
+void KSelectionOwner::getAtoms()
+    {
+    if( manager_atom == None )
+        {
+        Atom atoms[ 4 ];
+        const char* const names[] =
+            { "MANAGER", "MULTIPLE", "TARGETS", "TIMESTAMP" };
+        XInternAtoms( qt_xdisplay(), const_cast< char** >( names ), 4, 0, atoms );
+        manager_atom = atoms[ 0 ];
+        xa_multiple = atoms[ 1];
+        xa_targets = atoms[ 2 ];
+        xa_timestamp = atoms[ 3 ];
+        }
+    }
+
+Atom KSelectionOwner::manager_atom = None;
+Atom KSelectionOwner::xa_multiple = None;
+Atom KSelectionOwner::xa_targets = None;
+Atom KSelectionOwner::xa_timestamp = None;
+
+
+
+
+
+
+class KSelectionWatcherPrivate
+    : public QWidget
+    {
+    public:
+        KSelectionWatcherPrivate( KSelectionWatcher* watcher );
+    protected:
+        virtual bool x11Event( XEvent* ev );
+    private:
+        KSelectionWatcher* watcher;
+    };
+
+KSelectionWatcherPrivate::KSelectionWatcherPrivate( KSelectionWatcher* watcher_P )
+    : watcher( watcher_P )
+    {
+    KApplication::kApplication()->installX11EventFilter( this );
+    }
+
+bool KSelectionWatcherPrivate::x11Event( XEvent* ev_P )
+    {
+    watcher->filterEvent( ev_P );
+    return false;
+    }
+
+
+KSelectionWatcher::KSelectionWatcher( Atom selection_P, int screen_P )
+    : selection( selection_P ),
+        screen( screen_P >= 0 ? screen_P : (((_XPrivDisplay)qt_xdisplay())->default_screen)),
+        selection_owner( None ),
+        d( new KSelectionWatcherPrivate( this ))
+    {
+    init();
+    }
+
+KSelectionWatcher::KSelectionWatcher( const char* selection_P, int screen_P )
+    : selection( XInternAtom( qt_xdisplay(), selection_P, 0 )),
+        screen( screen_P >= 0 ? screen_P : (((_XPrivDisplay)qt_xdisplay())->default_screen)),
+        selection_owner( None ),
+        d( new KSelectionWatcherPrivate( this ))
+    {
+    init();
+    }
+
+KSelectionWatcher::~KSelectionWatcher()
+    {
+    delete d;
+    }
+
+void KSelectionWatcher::init()
+    {
+    if( manager_atom == None )
+        {
+        Display* const dpy = qt_xdisplay();
+        manager_atom = XInternAtom( dpy, "MANAGER", 0 );
+        XWindowAttributes attrs;
+        XGetWindowAttributes( dpy, ((&((_XPrivDisplay)dpy)->screens[screen])->root), &attrs );
+        long event_mask = attrs.your_event_mask;
+
+        XSelectInput( dpy, ((&((_XPrivDisplay)dpy)->screens[screen])->root), event_mask | (1L<<17) );
+        }
+    }
+
+Window KSelectionWatcher::owner()
+    {
+    Display* const dpy = qt_xdisplay();
+    KXErrorHandler handler;
+    Window current_owner = XGetSelectionOwner( dpy, selection );
+    if( current_owner == None )
+        return None;
+    if( current_owner == selection_owner )
+        return selection_owner;
+    XSelectInput( dpy, current_owner, (1L<<17) );
+    if( !handler.error( true ) && current_owner == XGetSelectionOwner( dpy, selection ))
+        {
+
+        selection_owner = current_owner;
+        }
+    else
+        selection_owner = None;
+    return selection_owner;
+    }
+
+
+void KSelectionWatcher::filterEvent( XEvent* ev_P )
+    {
+    if( ev_P->type == 33 )
+        {
+
+        if( ev_P->xclient.message_type != manager_atom
+            || ev_P->xclient.data.l[ 1 ] != static_cast< long >( selection ))
+            return;
+
+        if( ev_P->xclient.data.l[ 2 ] == static_cast< long >( selection_owner ))
+            {
+
+            return;
+            }
+        if( static_cast< long >( owner()) == ev_P->xclient.data.l[ 2 ] )
+            {
+
+            newOwner( selection_owner );
+            }
+        return;
+        }
+    if( ev_P->type == 17 )
+        {
+        if( selection_owner == None || ev_P->xdestroywindow.window != selection_owner )
+            return;
+        if( owner() == None )
+            lostOwner();
+        else
+            newOwner( selection_owner );
+        return;
+        }
+    return;
+    }
+
+Atom KSelectionWatcher::manager_atom = None;
+
+void KSelectionOwner::virtual_hook( int, void* )
+{ }
+
+void KSelectionWatcher::virtual_hook( int, void* )
+{ }
+
+const char *KSelectionOwner::className() const
+{
+    return "KSelectionOwner";
+}
+
+QMetaObject *KSelectionOwner::metaObj = 0;
+static QMetaObjectCleanUp cleanUp_KSelectionOwner( "KSelectionOwner", &KSelectionOwner::staticMetaObject );
+QMetaObject* KSelectionOwner::staticMetaObject()
+{
+    if ( metaObj )
+        return metaObj;
+    QMetaObject* parentObject = QObject::staticMetaObject();
+    static const QUMethod signal_0 = {"lostOwnership", 0, 0 };
+    static const QMetaData signal_tbl[] = {
+        { "lostOwnership()", &signal_0, QMetaData::Public }
+    };
+    metaObj = QMetaObject::new_metaobject(
+        "KSelectionOwner", parentObject,
+        0, 0,
+        signal_tbl, 1,
+
+        0, 0,
+        0, 0,
+
+        0, 0 );
+    cleanUp_KSelectionOwner.setMetaObject( metaObj );
+    return metaObj;
+}
+
+void* KSelectionOwner::qt_cast( const char* clname )
+{
+    if ( !qstrcmp( clname, "KSelectionOwner" ) )
+        return this;
+    return QObject::qt_cast( clname );
+}
+
+
+void KSelectionOwner::lostOwnership()
+{
+    activate_signal( staticMetaObject()->signalOffset() + 0 );
+}
+
+bool KSelectionOwner::qt_invoke( int _id, QUObject* _o )
+{
+    return QObject::qt_invoke(_id,_o);
+}
+
+bool KSelectionOwner::qt_emit( int _id, QUObject* _o )
+{
+    switch ( _id - staticMetaObject()->signalOffset() ) {
+    case 0: lostOwnership(); break;
+    default:
+        return QObject::qt_emit(_id,_o);
+    }
+    return TRUE;
+}
+
+
+bool KSelectionOwner::qt_property( int id, int f, QVariant* v)
+{
+    return QObject::qt_property( id, f, v);
+}
+
+bool KSelectionOwner::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; }
+
+
+
+const char *KSelectionWatcher::className() const
+{
+    return "KSelectionWatcher";
+}
+
+QMetaObject *KSelectionWatcher::metaObj = 0;
+static QMetaObjectCleanUp cleanUp_KSelectionWatcher( "KSelectionWatcher", &KSelectionWatcher::staticMetaObject );
+QMetaObject* KSelectionWatcher::staticMetaObject()
+{
+    if ( metaObj )
+        return metaObj;
+    QMetaObject* parentObject = QObject::staticMetaObject();
+    static const QUParameter param_signal_0[] = {
+        { "owner", &static_QUType_ptr, "Window", QUParameter::In }
+    };
+    static const QUMethod signal_0 = {"newOwner", 1, param_signal_0 };
+    static const QUMethod signal_1 = {"lostOwner", 0, 0 };
+    static const QMetaData signal_tbl[] = {
+        { "newOwner(Window)", &signal_0, QMetaData::Public },
+        { "lostOwner()", &signal_1, QMetaData::Public }
+    };
+    metaObj = QMetaObject::new_metaobject(
+        "KSelectionWatcher", parentObject,
+        0, 0,
+        signal_tbl, 2,
+
+        0, 0,
+        0, 0,
+
+        0, 0 );
+    cleanUp_KSelectionWatcher.setMetaObject( metaObj );
+    return metaObj;
+}
+
+void* KSelectionWatcher::qt_cast( const char* clname )
+{
+    if ( !qstrcmp( clname, "KSelectionWatcher" ) )
+        return this;
+    return QObject::qt_cast( clname );
+}
+
+
+
+
+
+void KSelectionWatcher::newOwner( Window t0 )
+{
+    if ( signalsBlocked() )
+        return;
+    QConnectionList *clist = receivers( staticMetaObject()->signalOffset() + 0 );
+    if ( !clist )
+        return;
+    QUObject o[2];
+    static_QUType_ptr.set(o+1,&t0);
+    activate_signal( clist, o );
+}
+
+
+void KSelectionWatcher::lostOwner()
+{
+    activate_signal( staticMetaObject()->signalOffset() + 1 );
+}
+
+bool KSelectionWatcher::qt_invoke( int _id, QUObject* _o )
+{
+    return QObject::qt_invoke(_id,_o);
+}
+
+bool KSelectionWatcher::qt_emit( int _id, QUObject* _o )
+{
+    switch ( _id - staticMetaObject()->signalOffset() ) {
+    case 0: newOwner((Window)(*((Window*)static_QUType_ptr.get(_o+1)))); break;
+    case 1: lostOwner(); break;
+    default:
+        return QObject::qt_emit(_id,_o);
+    }
+    return TRUE;
+}
+
+
+bool KSelectionWatcher::qt_property( int id, int f, QVariant* v)
+{
+    return QObject::qt_property( id, f, v);
+}
+
+bool KSelectionWatcher::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; }
+class KMountPoint : public KShared
+{
+   typedef signed long long int filesize_t;
+public:
+  typedef KSharedPtr<KMountPoint> Ptr;
+  typedef QValueList<Ptr> List;
+public:
+   enum { NeedMountOptions = 1, NeedRealDeviceName = 2 };
+
+
+
+
+
+
+   static KMountPoint::List possibleMountPoints(int infoNeeded=0);
+
+
+
+
+
+
+   static KMountPoint::List currentMountPoints(int infoNeeded=0);
+
+
+
+
+
+   QString mountedFrom() const { return m_mountedFrom; }
+
+
+
+
+
+
+   QString realDeviceName() const { return m_device; }
+
+
+
+
+   QString mountPoint() const { return m_mountPoint; }
+
+
+
+
+   QString mountType() const { return m_mountType; }
+
+
+
+
+
+   QStringList mountOptions() const { return m_mountOptions; }
+
+
+
+
+   ~KMountPoint();
+
+private:
+
+
+
+   KMountPoint();
+
+   QString m_mountedFrom;
+   QString m_device;
+   QString m_mountPoint;
+   QString m_mountType;
+   QStringList m_mountOptions;
+
+   class KMountPointPrivate;
+   KMountPointPrivate *d;
+};
+
+
+
+
+
+class KDesktopFilePrivate;
+class KDesktopFile : public KConfig
+{
+  public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+
+public:
+  KDesktopFile( const QString &fileName, bool readOnly = false,
+                const char * resType = "apps");
+
+
+
+
+
+
+  virtual ~KDesktopFile();
+  static bool isDesktopFile(const QString& path);
+  static bool isAuthorizedDesktopFile(const QString& path);
+
+
+
+
+
+
+  static QString locateLocal(const QString &path);
+
+
+
+
+
+  QString readType() const;
+
+
+
+
+
+  QString readIcon() const;
+
+
+
+
+
+  QString readName() const;
+
+
+
+
+
+  QString readComment() const;
+
+
+
+
+
+  QString readGenericName() const;
+
+
+
+
+
+
+  QString readPath() const __attribute__ ((deprecated));
+
+
+
+
+
+  QString readDevice() const;
+
+
+
+
+
+  QString readURL() const;
+
+
+
+
+
+  QStringList readActions() const;
+
+
+
+
+
+  void setActionGroup(const QString &group);
+
+
+
+
+
+
+  bool hasActionGroup(const QString &group) const;
+
+
+
+
+
+
+
+  bool hasLinkType() const;
+
+
+
+
+
+  bool hasApplicationType() const;
+
+
+
+
+
+  bool hasMimeTypeType() const;
+
+
+
+
+
+  bool hasDeviceType() const;
+
+
+
+
+
+
+  bool tryExec() const;
+
+
+
+
+
+  QString fileName() const;
+
+
+
+
+
+  QString resource() const;
+
+
+
+
+
+
+  QString readDocPath() const;
+
+
+
+
+
+  QStringList sortOrder() const;
+    __attribute__ ((deprecated)) QString filename() const { return fileName(); };
+
+private:
+
+
+  KDesktopFile( const KDesktopFile& );
+  KDesktopFile& operator= ( const KDesktopFile& );
+
+protected:
+  virtual void virtual_hook( int id, void* data );
+private:
+  KDesktopFilePrivate *d;
+};
+const char *KDesktopFile::className() const
+{
+    return "KDesktopFile";
+}
+
+QMetaObject *KDesktopFile::metaObj = 0;
+static QMetaObjectCleanUp cleanUp_KDesktopFile( "KDesktopFile", &KDesktopFile::staticMetaObject );
+QMetaObject* KDesktopFile::staticMetaObject()
+{
+    if ( metaObj )
+        return metaObj;
+    QMetaObject* parentObject = KConfig::staticMetaObject();
+    metaObj = QMetaObject::new_metaobject(
+        "KDesktopFile", parentObject,
+        0, 0,
+        0, 0,
+
+        0, 0,
+        0, 0,
+
+        0, 0 );
+    cleanUp_KDesktopFile.setMetaObject( metaObj );
+    return metaObj;
+}
+
+void* KDesktopFile::qt_cast( const char* clname )
+{
+    if ( !qstrcmp( clname, "KDesktopFile" ) )
+        return this;
+    return KConfig::qt_cast( clname );
+}
+
+bool KDesktopFile::qt_invoke( int _id, QUObject* _o )
+{
+    return KConfig::qt_invoke(_id,_o);
+}
+
+bool KDesktopFile::qt_emit( int _id, QUObject* _o )
+{
+    return KConfig::qt_emit(_id,_o);
+}
+
+
+bool KDesktopFile::qt_property( int id, int f, QVariant* v)
+{
+    return KConfig::qt_property( id, f, v);
+}
+
+bool KDesktopFile::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; }
+
+KDesktopFile::KDesktopFile(const QString &fileName, bool bReadOnly,
+                           const char * resType)
+  : KConfig(QString::fromLatin1(""), bReadOnly, false)
+{
+
+
+
+  backEnd->changeFileName(fileName, resType, false);
+  setReadOnly(bReadOnly);
+  reparseConfiguration();
+  setDesktopGroup();
+}
+
+KDesktopFile::~KDesktopFile()
+{
+
+}
+
+QString KDesktopFile::locateLocal(const QString &path)
+{
+  QString local;
+  if (path.endsWith(".directory"))
+  {
+    if (!path.startsWith("/"))
+    {
+      local = ::locateLocal("apps", path);
+    }
+    else
+    {
+
+
+      local = KGlobal::dirs()->relativeLocation("xdgdata-dirs", path);
+      if (local.startsWith("/"))
+      {
+
+        local = path.mid(path.findRev('/')+1);
+      }
+      local = ::locateLocal("xdgdata-dirs", local);
+    }
+  }
+  else
+  {
+    if (!path.startsWith("/"))
+    {
+      local = ::locateLocal("apps", path);
+    }
+    else
+    {
+
+
+      local = KGlobal::dirs()->relativeLocation("xdgdata-apps", path);
+      if (local.startsWith("/"))
+      {
+
+        local = path.mid(path.findRev('/')+1);
+      }
+      local = ::locateLocal("xdgdata-apps", local);
+    }
+  }
+  return local;
+}
+
+bool KDesktopFile::isDesktopFile(const QString& path)
+{
+  int len = path.length();
+
+  if(len > 8 && path.right(8) == QString::fromLatin1(".desktop"))
+    return true;
+  else if(len > 7 && path.right(7) == QString::fromLatin1(".kdelnk"))
+    return true;
+  else
+    return false;
+}
+
+bool KDesktopFile::isAuthorizedDesktopFile(const QString& path)
+{
+  if (!KApplication::kApplication() || KApplication::kApplication()->authorize("run_desktop_files"))
+     return true;
+
+  if (path.isEmpty())
+     return false;
+
+  if (path[0] != '/')
+     return true;
+
+  KStandardDirs *dirs = KGlobal::dirs();
+  if (dirs->relativeLocation("apps", path)[0] != '/')
+     return true;
+  if (dirs->relativeLocation("xdgdata-apps", path)[0] != '/')
+     return true;
+  if (dirs->relativeLocation("services", path)[0] != '/')
+     return true;
+  if (dirs->relativeLocation("data", path).startsWith("kdesktop/Desktop"))
+     return true;
+  return false;
+}
+
+QString KDesktopFile::readType() const
+{
+  return readEntry("Type");
+}
+
+QString KDesktopFile::readIcon() const
+{
+  return readEntry("Icon");
+}
+
+QString KDesktopFile::readName() const
+{
+  return readEntry("Name");
+}
+
+QString KDesktopFile::readComment() const
+{
+  return readEntry("Comment");
+}
+
+QString KDesktopFile::readGenericName() const
+{
+  return readEntry("GenericName");
+}
+
+QString KDesktopFile::readPath() const
+{
+  return readPathEntry("Path");
+}
+
+QString KDesktopFile::readDevice() const
+{
+  return readEntry("Dev");
+}
+
+QString KDesktopFile::readURL() const
+{
+    if (hasDeviceType()) {
+        QString device = readDevice();
+        KMountPoint::List mountPoints = KMountPoint::possibleMountPoints();
+
+        for(KMountPoint::List::ConstIterator it = mountPoints.begin();
+            it != mountPoints.end(); ++it)
+        {
+            KMountPoint *mp = *it;
+            if (mp->mountedFrom() == device)
+            {
+                KURL u;
+                u.setPath( mp->mountPoint() );
+                return u.url();
+            }
+        }
+        return QString::null;
+    } else {
+        QString url = readPathEntry("URL");
+        if ( !url.isEmpty() && url[0] == '/' )
+        {
+
+            KURL u;
+            u.setPath( url );
+            return u.url();
+        }
+        return url;
+    }
+}
+
+QStringList KDesktopFile::readActions() const
+{
+    return readListEntry("Actions", ';');
+}
+
+void KDesktopFile::setActionGroup(const QString &group)
+{
+    setGroup(QString::fromLatin1("Desktop Action ") + group);
+}
+
+bool KDesktopFile::hasActionGroup(const QString &group) const
+{
+  return hasGroup(QString::fromLatin1("Desktop Action ") + group);
+}
+
+bool KDesktopFile::hasLinkType() const
+{
+  return readEntry("Type") == QString::fromLatin1("Link");
+}
+
+bool KDesktopFile::hasApplicationType() const
+{
+  return readEntry("Type") == QString::fromLatin1("Application");
+}
+
+bool KDesktopFile::hasMimeTypeType() const
+{
+  return readEntry("Type") == QString::fromLatin1("MimeType");
+}
+
+bool KDesktopFile::hasDeviceType() const
+{
+  return readEntry("Type") == QString::fromLatin1("FSDev") ||
+         readEntry("Type") == QString::fromLatin1("FSDevice");
+}
+
+bool KDesktopFile::tryExec() const
+{
+
+  QString te = readPathEntry("TryExec");
+
+  if (!te.isEmpty()) {
+    if (te[0] == '/') {
+      if (::access(QFile::encodeName(te), 4 | 1))
+        return false;
+    } else {
+
+
+
+      QStringList dirs = QStringList::split(':', QFile::decodeName(::getenv("PATH")));
+      QStringList::Iterator it(dirs.begin());
+      bool match = false;
+      for (; it != dirs.end(); ++it) {
+        QString fName = *it + "/" + te;
+        if (::access(QFile::encodeName(fName), 4 | 1) == 0)
+        {
+          match = true;
+          break;
+        }
+      }
+
+      if (!match)
+        return false;
+    }
+  }
+  QStringList list = readListEntry("X-KDE-AuthorizeAction");
+  if (KApplication::kApplication() && !list.isEmpty())
+  {
+     for(QStringList::ConstIterator it = list.begin();
+         it != list.end();
+         ++it)
+     {
+        if (!KApplication::kApplication()->authorize((*it).stripWhiteSpace()))
+           return false;
+     }
+  }
+
+
+  bool su = readBoolEntry("X-KDE-SubstituteUID");
+  if (su)
+  {
+      QString user = readEntry("X-KDE-Username");
+      if (user.isEmpty())
+        user = ::getenv("ADMIN_ACCOUNT");
+      if (user.isEmpty())
+        user = "root";
+      if (!KApplication::kApplication()->authorize("user/"+user))
+        return false;
+  }
+
+  return true;
+}
+
+
+
+
+QString
+KDesktopFile::fileName() const { return backEnd->fileName(); }
+
+
+
+
+QString
+KDesktopFile::resource() const { return backEnd->resource(); }
+
+QStringList
+KDesktopFile::sortOrder() const
+{
+  return readListEntry("SortOrder");
+}
+
+void KDesktopFile::virtual_hook( int id, void* data )
+{ KConfig::virtual_hook( id, data ); }
+
+QString KDesktopFile::readDocPath() const
+{
+        return readPathEntry( "DocPath" );
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C"
+
+int mkstemps(char *, int);
+extern "C"
+
+unsigned long strlcat(char*, const char*, unsigned long);
+
+
+
+
+
+
+extern "C"
+
+unsigned long strlcpy(char*, const char*, unsigned long);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (__const char *__assertion, __const char *__file,
+                           unsigned int __line, __const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, __const char *__file,
+                                  unsigned int __line,
+                                  __const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C" {
+struct dirent
+  {
+
+    __ino_t d_ino;
+    __off_t d_off;
+
+
+
+
+    unsigned short int d_reclen;
+    unsigned char d_type;
+    char d_name[256];
+  };
+
+
+struct dirent64
+  {
+    __ino64_t d_ino;
+    __off64_t d_off;
+    unsigned short int d_reclen;
+    unsigned char d_type;
+    char d_name[256];
+  };
+
+
+
+
+
+enum
+  {
+    DT_UNKNOWN = 0,
+    DT_FIFO = 1,
+    DT_CHR = 2,
+    DT_DIR = 4,
+    DT_BLK = 6,
+    DT_REG = 8,
+    DT_LNK = 10,
+    DT_SOCK = 12,
+    DT_WHT = 14
+  };
+
+
+
+
+
+
+
+typedef struct __dirstream DIR;
+
+
+
+extern DIR *opendir (__const char *__name) throw ();
+
+
+
+extern int closedir (DIR *__dirp) throw ();
+extern struct dirent *readdir (DIR *__dirp) throw ();
+extern struct dirent64 *readdir64 (DIR *__dirp) throw ();
+
+
+
+
+
+
+extern int readdir_r (DIR *__restrict __dirp,
+                      struct dirent *__restrict __entry,
+                      struct dirent **__restrict __result) throw ();
+extern int readdir64_r (DIR *__restrict __dirp,
+                        struct dirent64 *__restrict __entry,
+                        struct dirent64 **__restrict __result) throw ();
+
+
+
+
+extern void rewinddir (DIR *__dirp) throw ();
+
+
+
+
+
+extern void seekdir (DIR *__dirp, long int __pos) throw ();
+
+
+extern long int telldir (DIR *__dirp) throw ();
+
+
+
+
+
+extern int dirfd (DIR *__dirp) throw ();
+
+
+
+
+
+
+
+
+
+
+
+
+extern int scandir (__const char *__restrict __dir,
+                    struct dirent ***__restrict __namelist,
+                    int (*__selector) (__const struct dirent *),
+                    int (*__cmp) (__const void *, __const void *)) throw ();
+extern int scandir64 (__const char *__restrict __dir,
+                      struct dirent64 ***__restrict __namelist,
+                      int (*__selector) (__const struct dirent64 *),
+                      int (*__cmp) (__const void *, __const void *)) throw ();
+
+
+
+
+extern int alphasort (__const void *__e1, __const void *__e2)
+     throw () __attribute__ ((__pure__));
+extern int alphasort64 (__const void *__e1, __const void *__e2)
+     throw () __attribute__ ((__pure__));
+
+
+
+
+
+extern int versionsort (__const void *__e1, __const void *__e2)
+     throw () __attribute__ ((__pure__));
+extern int versionsort64 (__const void *__e1, __const void *__e2)
+     throw () __attribute__ ((__pure__));
+extern __ssize_t getdirentries (int __fd, char *__restrict __buf,
+                                size_t __nbytes,
+                                __off_t *__restrict __basep) throw ();
+extern __ssize_t getdirentries64 (int __fd, char *__restrict __buf,
+                                  size_t __nbytes,
+                                  __off64_t *__restrict __basep) throw ();
+
+
+
+
+}
+
+
+
+extern "C" {
+
+
+
+
+struct passwd
+{
+  char *pw_name;
+  char *pw_passwd;
+  __uid_t pw_uid;
+  __gid_t pw_gid;
+  char *pw_gecos;
+  char *pw_dir;
+  char *pw_shell;
+};
+
+
+
+
+
+
+
+
+
+extern void setpwent (void) throw ();
+
+
+extern void endpwent (void) throw ();
+
+
+extern struct passwd *getpwent (void) throw ();
+
+
+
+
+extern struct passwd *fgetpwent (FILE *__stream) throw ();
+
+
+extern int putpwent (__const struct passwd *__restrict __p,
+                     FILE *__restrict __f) throw ();
+
+
+
+extern struct passwd *getpwuid (__uid_t __uid) throw ();
+
+
+extern struct passwd *getpwnam (__const char *__name) throw ();
+
+
+
+
+
+
+extern int getpwent_r (struct passwd *__restrict __resultbuf,
+                       char *__restrict __buffer, size_t __buflen,
+                       struct passwd **__restrict __result) throw ();
+
+
+extern int getpwuid_r (__uid_t __uid,
+                       struct passwd *__restrict __resultbuf,
+                       char *__restrict __buffer, size_t __buflen,
+                       struct passwd **__restrict __result) throw ();
+
+extern int getpwnam_r (__const char *__restrict __name,
+                       struct passwd *__restrict __resultbuf,
+                       char *__restrict __buffer, size_t __buflen,
+                       struct passwd **__restrict __result) throw ();
+
+
+
+
+
+extern int fgetpwent_r (FILE *__restrict __stream,
+                        struct passwd *__restrict __resultbuf,
+                        char *__restrict __buffer, size_t __buflen,
+                        struct passwd **__restrict __result) throw ();
+extern int getpw (__uid_t __uid, char *__buffer) throw ();
+
+
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+template class QDict<QStringList>;
+
+class KStandardDirs::KStandardDirsPrivate
+{
+public:
+   KStandardDirsPrivate()
+    : restrictionsActive(false),
+      dataRestrictionActive(false)
+   { }
+
+   bool restrictionsActive;
+   bool dataRestrictionActive;
+   QAsciiDict<bool> restrictions;
+   QStringList xdgdata_prefixes;
+   QStringList xdgconf_prefixes;
+};
+
+static const char* const types[] = {"html", "icon", "apps", "sound",
+                              "data", "locale", "services", "mime",
+                              "servicetypes", "config", "exe",
+                              "wallpaper", "lib", "pixmap", "templates",
+                              "module", "qtplugins",
+                              "xdgdata-apps", "xdgdata-dirs", "xdgconf-menu", 0 };
+
+static int tokenize( QStringList& token, const QString& str,
+                const QString& delim );
+
+KStandardDirs::KStandardDirs( ) : addedCustoms(false)
+{
+    d = new KStandardDirsPrivate;
+    dircache.setAutoDelete(true);
+    relatives.setAutoDelete(true);
+    absolutes.setAutoDelete(true);
+    savelocations.setAutoDelete(true);
+    addKDEDefaults();
+}
+
+KStandardDirs::~KStandardDirs()
+{
+    delete d;
+}
+
+bool KStandardDirs::isRestrictedResource(const char *type, const QString& relPath) const
+{
+   if (!d || !d->restrictionsActive)
+      return false;
+
+   if (d->restrictions[type])
+      return true;
+
+   if (strcmp(type, "data")==0)
+   {
+      applyDataRestrictions(relPath);
+      if (d->dataRestrictionActive)
+      {
+         d->dataRestrictionActive = false;
+         return true;
+      }
+   }
+   return false;
+}
+
+void KStandardDirs::applyDataRestrictions(const QString &relPath) const
+{
+   QString key;
+   int i = relPath.find('/');
+   if (i != -1)
+      key = "data_"+relPath.left(i);
+   else
+      key = "data_"+relPath;
+
+   if (d && d->restrictions[key.latin1()])
+      d->dataRestrictionActive = true;
+}
+
+
+QStringList KStandardDirs::allTypes() const
+{
+    QStringList list;
+    for (int i = 0; types[i] != 0; ++i)
+        list.append(QString::fromLatin1(types[i]));
+    return list;
+}
+
+void KStandardDirs::addPrefix( const QString& _dir )
+{
+    if (_dir.isNull())
+        return;
+
+    QString dir = _dir;
+    if (dir.at(dir.length() - 1) != '/')
+        dir += '/';
+
+    if (!prefixes.contains(dir)) {
+        prefixes.append(dir);
+        dircache.clear();
+    }
+}
+
+void KStandardDirs::addXdgConfigPrefix( const QString& _dir )
+{
+    if (_dir.isNull())
+        return;
+
+    QString dir = _dir;
+    if (dir.at(dir.length() - 1) != '/')
+        dir += '/';
+
+    if (!d->xdgconf_prefixes.contains(dir)) {
+        d->xdgconf_prefixes.append(dir);
+        dircache.clear();
+    }
+}
+
+void KStandardDirs::addXdgDataPrefix( const QString& _dir )
+{
+    if (_dir.isNull())
+        return;
+
+    QString dir = _dir;
+    if (dir.at(dir.length() - 1) != '/')
+        dir += '/';
+
+    if (!d->xdgdata_prefixes.contains(dir)) {
+        d->xdgdata_prefixes.append(dir);
+        dircache.clear();
+    }
+}
+
+
+QString KStandardDirs::kfsstnd_prefixes()
+{
+   return prefixes.join(":");
+}
+
+bool KStandardDirs::addResourceType( const char *type,
+                                     const QString& relativename )
+{
+    if (relativename.isNull())
+       return false;
+
+    QStringList *rels = relatives.find(type);
+    if (!rels) {
+        rels = new QStringList();
+        relatives.insert(type, rels);
+    }
+    QString copy = relativename;
+    if (copy.at(copy.length() - 1) != '/')
+        copy += '/';
+    if (!rels->contains(copy)) {
+        rels->prepend(copy);
+        dircache.remove(type);
+        return true;
+    }
+    return false;
+}
+
+bool KStandardDirs::addResourceDir( const char *type,
+                                    const QString& absdir)
+{
+    QStringList *paths = absolutes.find(type);
+    if (!paths) {
+        paths = new QStringList();
+        absolutes.insert(type, paths);
+    }
+    QString copy = absdir;
+    if (copy.at(copy.length() - 1) != '/')
+      copy += '/';
+
+    if (!paths->contains(copy)) {
+        paths->append(copy);
+        dircache.remove(type);
+        return true;
+    }
+    return false;
+}
+
+QString KStandardDirs::findResource( const char *type,
+                                     const QString& filename ) const
+{
+    if (filename.at(0) == '/')
+        return filename;
+    QString dir = findResourceDir(type, filename);
+    if (dir.isNull())
+        return dir;
+    else return dir + filename;
+}
+
+static Q_UINT32 updateHash(const QString &file, Q_UINT32 hash)
+{
+    QCString cFile = QFile::encodeName(file);
+    struct stat buff;
+    if ((access(cFile, 4) == 0) &&
+        (stat( cFile, &buff ) == 0) &&
+        (((((buff.st_mode)) & 0170000) == (0100000))))
+    {
+       hash = hash + (Q_UINT32) buff.st_ctim.tv_sec;
+    }
+    return hash;
+}
+
+Q_UINT32 KStandardDirs::calcResourceHash( const char *type,
+                              const QString& filename, bool deep) const
+{
+    Q_UINT32 hash = 0;
+
+    if (filename.at(0) == '/')
+    {
+
+        return updateHash(filename, hash);
+    }
+    if (d && d->restrictionsActive && (strcmp(type, "data")==0))
+       applyDataRestrictions(filename);
+    QStringList candidates = resourceDirs(type);
+    QString fullPath;
+
+    for (QStringList::ConstIterator it = candidates.begin();
+         it != candidates.end(); it++)
+    {
+        hash = updateHash(*it + filename, hash);
+        if (!deep && hash)
+           return hash;
+    }
+    return hash;
+}
+
+
+QStringList KStandardDirs::findDirs( const char *type,
+                                     const QString& reldir ) const
+{
+    QStringList list;
+
+    checkConfig();
+
+    if (d && d->restrictionsActive && (strcmp(type, "data")==0))
+       applyDataRestrictions(reldir);
+    QStringList candidates = resourceDirs(type);
+    QDir testdir;
+
+    for (QStringList::ConstIterator it = candidates.begin();
+         it != candidates.end(); it++) {
+        testdir.setPath(*it + reldir);
+        if (testdir.exists())
+            list.append(testdir.absPath() + '/');
+    }
+
+    return list;
+}
+
+QString KStandardDirs::findResourceDir( const char *type,
+                                        const QString& filename) const
+{
+
+    if (filename.isEmpty()) {
+      kdWarning() << "filename for type " << type << " in KStandardDirs::findResourceDir is not supposed to be empty!!" << endl;
+      return QString::null;
+    }
+
+
+    if (d && d->restrictionsActive && (strcmp(type, "data")==0))
+       applyDataRestrictions(filename);
+    QStringList candidates = resourceDirs(type);
+    QString fullPath;
+
+    for (QStringList::ConstIterator it = candidates.begin();
+         it != candidates.end(); it++)
+      if (exists(*it + filename))
+        return *it;
+
+
+    if(false && type != "locale")
+      kdDebug() << "KStdDirs::findResDir(): can't find \"" << filename << "\" in type \"" << type << "\"." << endl;
+
+
+    return QString::null;
+}
+
+bool KStandardDirs::exists(const QString &fullPath)
+{
+    struct stat buff;
+    if (access(QFile::encodeName(fullPath), 4) == 0 && stat( QFile::encodeName(fullPath), &buff ) == 0)
+        if (fullPath.at(fullPath.length() - 1) != '/') {
+            if (((((buff.st_mode)) & 0170000) == (0100000)))
+                return true;
+        } else
+            if (((((buff.st_mode)) & 0170000) == (0040000)))
+                return true;
+    return false;
+}
+
+static void lookupDirectory(const QString& path, const QString &relPart,
+                            const QRegExp &regexp,
+                            QStringList& list,
+                            QStringList& relList,
+                            bool recursive, bool uniq)
+{
+  QString pattern = regexp.pattern();
+  if (recursive || pattern.contains('?') || pattern.contains('*'))
+  {
+
+    DIR *dp = opendir( QFile::encodeName(path));
+    if (!dp)
+      return;
+
+    (static_cast<void> ((path.at(path.length() - 1) == '/') ? 0 : (__assert_fail ("path.at(path.length() - 1) == '/'", "/coolo/prod/kdelibs/kdecore/kstandarddirs.cpp", 370, __PRETTY_FUNCTION__), 0)));
+
+    struct dirent *ep;
+    struct stat buff;
+
+    QString _dot(".");
+    QString _dotdot("..");
+
+    while( ( ep = readdir( dp ) ) != 0L )
+    {
+      QString fn( QFile::decodeName(ep->d_name));
+      if (fn == _dot || fn == _dotdot || fn.at(fn.length() - 1).latin1() == '~')
+        continue;
+
+      if (!recursive && !regexp.exactMatch(fn))
+        continue;
+
+      QString pathfn = path + fn;
+      if ( stat( QFile::encodeName(pathfn), &buff ) != 0 ) {
+        kdDebug() << "Error stat'ing " << pathfn << " : " << perror << endl;
+        continue;
+      }
+      if ( recursive ) {
+        if ( ((((buff.st_mode)) & 0170000) == (0040000))) {
+          lookupDirectory(pathfn + '/', relPart + fn + '/', regexp, list, relList, recursive, uniq);
+        }
+        if (!regexp.exactMatch(fn))
+          continue;
+      }
+      if ( ((((buff.st_mode)) & 0170000) == (0100000)))
+      {
+        if (!uniq || !relList.contains(relPart + fn))
+        {
+            list.append( pathfn );
+            relList.append( relPart + fn );
+        }
+      }
+    }
+    closedir( dp );
+  }
+  else
+  {
+
+     QString fn = pattern;
+     QString pathfn = path + fn;
+     struct stat buff;
+     if ( stat( QFile::encodeName(pathfn), &buff ) != 0 )
+        return;
+     if ( ((((buff.st_mode)) & 0170000) == (0100000)))
+     {
+       if (!uniq || !relList.contains(relPart + fn))
+       {
+         list.append( pathfn );
+         relList.append( relPart + fn );
+       }
+     }
+  }
+}
+
+static void lookupPrefix(const QString& prefix, const QString& relpath,
+                         const QString& relPart,
+                         const QRegExp &regexp,
+                         QStringList& list,
+                         QStringList& relList,
+                         bool recursive, bool uniq)
+{
+    if (relpath.isNull()) {
+       lookupDirectory(prefix, relPart, regexp, list,
+                       relList, recursive, uniq);
+       return;
+    }
+    QString path;
+    QString rest;
+
+    if (relpath.length())
+    {
+       int slash = relpath.find('/');
+       if (slash < 0)
+           rest = relpath.left(relpath.length() - 1);
+       else {
+           path = relpath.left(slash);
+           rest = relpath.mid(slash + 1);
+       }
+    }
+
+    (static_cast<void> ((prefix.at(prefix.length() - 1) == '/') ? 0 : (__assert_fail ("prefix.at(prefix.length() - 1) == '/'", "/coolo/prod/kdelibs/kdecore/kstandarddirs.cpp", 455, __PRETTY_FUNCTION__), 0)));
+
+    struct stat buff;
+
+    if (path.contains('*') || path.contains('?')) {
+
+        QRegExp pathExp(path, true, true);
+        DIR *dp = opendir( QFile::encodeName(prefix) );
+        if (!dp) {
+            return;
+        }
+
+        struct dirent *ep;
+
+        QString _dot(".");
+        QString _dotdot("..");
+
+        while( ( ep = readdir( dp ) ) != 0L )
+            {
+                QString fn( QFile::decodeName(ep->d_name));
+                if (fn == _dot || fn == _dotdot || fn.at(fn.length() - 1) == '~')
+                    continue;
+
+                if (pathExp.search(fn) == -1)
+                    continue;
+                QString rfn = relPart+fn;
+                fn = prefix + fn;
+                if ( stat( QFile::encodeName(fn), &buff ) != 0 ) {
+                    kdDebug() << "Error statting " << fn << " : " << perror << endl;
+                    continue;
+                }
+                if ( ((((buff.st_mode)) & 0170000) == (0040000)))
+                    lookupPrefix(fn + '/', rest, rfn + '/', regexp, list, relList, recursive, uniq);
+            }
+
+        closedir( dp );
+    } else {
+
+
+        lookupPrefix(prefix + path + '/', rest,
+                     relPart + path + '/', regexp, list,
+                     relList, recursive, uniq);
+    }
+}
+
+QStringList
+KStandardDirs::findAllResources( const char *type,
+                                 const QString& filter,
+                                 bool recursive,
+                                 bool uniq,
+                                 QStringList &relList) const
+{
+    QStringList list;
+    if (filter.at(0) == '/')
+    {
+        list.append( filter);
+        return list;
+    }
+
+    QString filterPath;
+    QString filterFile;
+
+    if (filter.length())
+    {
+       int slash = filter.findRev('/');
+       if (slash < 0)
+           filterFile = filter;
+       else {
+           filterPath = filter.left(slash + 1);
+           filterFile = filter.mid(slash + 1);
+       }
+    }
+
+    checkConfig();
+
+    if (d && d->restrictionsActive && (strcmp(type, "data")==0))
+       applyDataRestrictions(filter);
+    QStringList candidates = resourceDirs(type);
+    if (filterFile.isEmpty())
+        filterFile = "*";
+
+    QRegExp regExp(filterFile, true, true);
+
+    for (QStringList::ConstIterator it = candidates.begin();
+         it != candidates.end(); it++)
+    {
+        lookupPrefix(*it, filterPath, "", regExp, list,
+                     relList, recursive, uniq);
+    }
+
+    return list;
+}
+
+QStringList
+KStandardDirs::findAllResources( const char *type,
+                                 const QString& filter,
+                                 bool recursive,
+                                 bool uniq) const
+{
+    QStringList relList;
+    return findAllResources(type, filter, recursive, uniq, relList);
+}
+
+QString
+KStandardDirs::realPath(const QString &dirname)
+{
+    char realpath_buffer[4096 + 1];
+    memset(realpath_buffer, 0, 4096 + 1);
+
+
+    if (realpath( QFile::encodeName(dirname).data(), realpath_buffer) != 0) {
+
+        int len = strlen(realpath_buffer);
+        realpath_buffer[len] = '/';
+        realpath_buffer[len+1] = 0;
+        return QFile::decodeName(realpath_buffer);
+    }
+
+    return dirname;
+}
+
+void KStandardDirs::createSpecialResource(const char *type)
+{
+   char hostname[256];
+   hostname[0] = 0;
+   gethostname(hostname, 255);
+   QString dir = QString("%1%2-%3").arg(localkdedir()).arg(type).arg(hostname);
+   char link[1024];
+   link[1023] = 0;
+   int result = readlink(QFile::encodeName(dir).data(), link, 1023);
+   if ((result == -1) && ((*__errno_location ()) == 2))
+   {
+      QString srv = findExe(QString::fromLatin1("lnusertemp"), "/coolo/KDE"+QString::fromLatin1("/bin"));
+      if (srv.isEmpty())
+         srv = findExe(QString::fromLatin1("lnusertemp"));
+      if (!srv.isEmpty())
+      {
+         system(QFile::encodeName(srv)+" "+type);
+         result = readlink(QFile::encodeName(dir).data(), link, 1023);
+      }
+   }
+   if (result > 0)
+   {
+      link[result] = 0;
+      if (link[0] == '/')
+         dir = QFile::decodeName(link);
+      else
+         dir = QDir::cleanDirPath(dir+QFile::decodeName(link));
+   }
+   addResourceDir(type, dir+'/');
+}
+
+QStringList KStandardDirs::resourceDirs(const char *type) const
+{
+    QStringList *candidates = dircache.find(type);
+
+    if (!candidates) {
+        if (strcmp(type, "socket") == 0)
+           const_cast<KStandardDirs *>(this)->createSpecialResource(type);
+        else if (strcmp(type, "tmp") == 0)
+           const_cast<KStandardDirs *>(this)->createSpecialResource(type);
+        else if (strcmp(type, "cache") == 0)
+           const_cast<KStandardDirs *>(this)->createSpecialResource(type);
+
+        QDir testdir;
+
+        candidates = new QStringList();
+        QStringList *dirs;
+
+        bool restrictionActive = false;
+        if (d && d->restrictionsActive)
+        {
+           if (d->dataRestrictionActive)
+              restrictionActive = true;
+           else if (d->restrictions["all"])
+              restrictionActive = true;
+           else if (d->restrictions[type])
+              restrictionActive = true;
+           d->dataRestrictionActive = false;
+        }
+
+        dirs = relatives.find(type);
+        if (dirs)
+        {
+            bool local = true;
+            const QStringList *prefixList = 0;
+            if (strncmp(type, "xdgdata-", 8) == 0)
+                prefixList = &(d->xdgdata_prefixes);
+            else if (strncmp(type, "xdgconf-", 8) == 0)
+                prefixList = &(d->xdgconf_prefixes);
+            else
+                prefixList = &prefixes;
+
+            for (QStringList::ConstIterator pit = prefixList->begin();
+                 pit != prefixList->end();
+                 pit++)
+            {
+                for (QStringList::ConstIterator it = dirs->begin();
+                     it != dirs->end(); ++it) {
+                    QString path = realPath(*pit + *it);
+                    testdir.setPath(path);
+                    if (local && restrictionActive)
+                       continue;
+                    if ((local || testdir.exists()) && !candidates->contains(path))
+                        candidates->append(path);
+                }
+                local = false;
+            }
+        }
+        dirs = absolutes.find(type);
+        if (dirs)
+            for (QStringList::ConstIterator it = dirs->begin();
+                 it != dirs->end(); ++it)
+            {
+                testdir.setPath(*it);
+                if (testdir.exists())
+                {
+                    QString filename = realPath(*it);
+                    if (!candidates->contains(filename))
+                        candidates->append(filename);
+                }
+            }
+        dircache.insert(type, candidates);
+    }
+  return *candidates;
+}
+
+QString KStandardDirs::findExe( const QString& appname,
+                                const QString& pstr, bool ignore)
+{
+    QFileInfo info;
+
+
+    if (appname.startsWith(QString::fromLatin1("/")))
+    {
+        info.setFile( appname );
+        if( info.exists() && ( ignore || info.isExecutable() )
+            && info.isFile() ) {
+            return appname;
+        }
+        return QString::null;
+    }
+
+    QString p = QString("%1/%2").arg("/coolo/KDE/bin").arg(appname);
+    info.setFile( p );
+    if( info.exists() && ( ignore || info.isExecutable() )
+         && ( info.isFile() || info.isSymLink() ) ) {
+         return p;
+    }
+
+    QStringList tokens;
+    p = pstr;
+
+    if( p.isNull() ) {
+        p = getenv( "PATH" );
+    }
+
+    tokenize( tokens, p, ":\b" );
+
+
+    for( unsigned i = 0; i < tokens.count(); i++ ) {
+        p = tokens[ i ];
+
+        if ( p[ 0 ] == '~' )
+        {
+            int len = p.find( '/' );
+            if ( len == -1 )
+                len = p.length();
+            if ( len == 1 )
+                p.replace( 0, 1, QDir::homeDirPath() );
+            else
+            {
+                QString user = p.mid( 1, len - 1 );
+                struct passwd *dir = getpwnam( user.local8Bit().data() );
+                if ( dir && strlen( dir->pw_dir ) )
+                    p.replace( 0, len, QString::fromLocal8Bit( dir->pw_dir ) );
+            }
+        }
+
+        p += "/";
+        p += appname;
+
+
+        info.setFile( p );
+
+        if( info.exists() && ( ignore || info.isExecutable() )
+           && ( info.isFile() || info.isSymLink() ) ) {
+            return p;
+        }
+    }
+
+
+
+
+    return QString::null;
+}
+
+int KStandardDirs::findAllExe( QStringList& list, const QString& appname,
+                        const QString& pstr, bool ignore )
+{
+    QString p = pstr;
+    QFileInfo info;
+    QStringList tokens;
+
+    if( p.isNull() ) {
+        p = getenv( "PATH" );
+    }
+
+    list.clear();
+    tokenize( tokens, p, ":\b" );
+
+    for ( unsigned i = 0; i < tokens.count(); i++ ) {
+        p = tokens[ i ];
+        p += "/";
+        p += appname;
+
+        info.setFile( p );
+
+        if( info.exists() && (ignore || info.isExecutable())
+            && info.isFile() ) {
+            list.append( p );
+        }
+
+    }
+
+    return list.count();
+}
+
+static int tokenize( QStringList& tokens, const QString& str,
+                     const QString& delim )
+{
+    int len = str.length();
+    QString token = "";
+
+    for( int index = 0; index < len; index++)
+    {
+        if ( delim.find( str[ index ] ) >= 0 )
+        {
+            tokens.append( token );
+            token = "";
+        }
+        else
+        {
+            token += str[ index ];
+        }
+    }
+    if ( token.length() > 0 )
+    {
+        tokens.append( token );
+    }
+
+    return tokens.count();
+}
+
+QString KStandardDirs::kde_default(const char *type) {
+    if (!strcmp(type, "data"))
+        return "share/apps/";
+    if (!strcmp(type, "html"))
+        return "share/doc/HTML/";
+    if (!strcmp(type, "icon"))
+        return "share/icons/";
+    if (!strcmp(type, "config"))
+        return "share/config/";
+    if (!strcmp(type, "pixmap"))
+        return "share/pixmaps/";
+    if (!strcmp(type, "apps"))
+        return "share/applnk/";
+    if (!strcmp(type, "sound"))
+        return "share/sounds/";
+    if (!strcmp(type, "locale"))
+        return "share/locale/";
+    if (!strcmp(type, "services"))
+        return "share/services/";
+    if (!strcmp(type, "servicetypes"))
+        return "share/servicetypes/";
+    if (!strcmp(type, "mime"))
+        return "share/mimelnk/";
+    if (!strcmp(type, "cgi"))
+        return "cgi-bin/";
+    if (!strcmp(type, "wallpaper"))
+        return "share/wallpapers/";
+    if (!strcmp(type, "templates"))
+        return "share/templates/";
+    if (!strcmp(type, "exe"))
+        return "bin/";
+    if (!strcmp(type, "lib"))
+        return "lib/";
+    if (!strcmp(type, "module"))
+        return "lib/kde3/";
+    if (!strcmp(type, "qtplugins"))
+        return "lib/kde3/plugins";
+    if (!strcmp(type, "xdgdata-apps"))
+        return "applications/";
+    if (!strcmp(type, "xdgdata-dirs"))
+        return "desktop-directories/";
+    if (!strcmp(type, "xdgconf-menu"))
+        return "menus/";
+    qFatal("unknown resource type %s", type);
+    return QString::null;
+}
+
+QString KStandardDirs::saveLocation(const char *type,
+                                    const QString& suffix,
+                                    bool create) const
+{
+    checkConfig();
+
+    QString *pPath = savelocations.find(type);
+    if (!pPath)
+    {
+       QStringList *dirs = relatives.find(type);
+       if (!dirs && (
+                     (strcmp(type, "socket") == 0) ||
+                     (strcmp(type, "tmp") == 0) ||
+                     (strcmp(type, "cache") == 0) ))
+       {
+          (void) resourceDirs(type);
+          dirs = relatives.find(type);
+       }
+       if (dirs)
+       {
+
+          if (strncmp(type, "xdgdata-", 8) == 0)
+             pPath = new QString(realPath(localxdgdatadir() + dirs->last()));
+          else if (strncmp(type, "xdgconf-", 8) == 0)
+             pPath = new QString(realPath(localxdgconfdir() + dirs->last()));
+          else
+             pPath = new QString(realPath(localkdedir() + dirs->last()));
+       }
+       else {
+          dirs = absolutes.find(type);
+          if (!dirs)
+             qFatal("KStandardDirs: The resource type %s is not registered", type);
+          pPath = new QString(realPath(dirs->last()));
+       }
+
+       savelocations.insert(type, pPath);
+    }
+    QString fullPath = *pPath + suffix;
+
+    struct stat st;
+    if (stat(QFile::encodeName(fullPath), &st) != 0 || !(((((st.st_mode)) & 0170000) == (0040000)))) {
+        if(!create) {
+
+            qDebug("save location %s doesn't exist", fullPath.latin1());
+
+            return fullPath;
+        }
+        if(!makeDir(fullPath, 0700)) {
+            qWarning("failed to create %s", fullPath.latin1());
+            return fullPath;
+        }
+        dircache.remove(type);
+    }
+    return fullPath;
+}
+
+QString KStandardDirs::relativeLocation(const char *type, const QString &absPath)
+{
+    QString fullPath = absPath;
+    int i = absPath.findRev('/');
+    if (i != -1)
+    {
+       fullPath = realPath(absPath.left(i+1))+absPath.mid(i+1);
+    }
+
+    QStringList candidates = resourceDirs(type);
+
+    for (QStringList::ConstIterator it = candidates.begin();
+         it != candidates.end(); it++)
+      if (fullPath.startsWith(*it))
+      {
+        return fullPath.mid((*it).length());
+      }
+
+    return absPath;
+}
+
+
+bool KStandardDirs::makeDir(const QString& dir, int mode)
+{
+
+    if (dir.at(0) != '/')
+        return false;
+
+    QString target = dir;
+    uint len = target.length();
+
+
+    if (dir.at(len - 1) != '/')
+        target += '/';
+
+    QString base("");
+    uint i = 1;
+
+    while( i < len )
+    {
+        struct stat st;
+        int pos = target.find('/', i);
+        base += target.mid(i - 1, pos - i + 1);
+        QCString baseEncoded = QFile::encodeName(base);
+
+        if (stat(baseEncoded, &st) != 0)
+        {
+
+
+          if (lstat(baseEncoded, &st) == 0)
+              (void)unlink(baseEncoded);
+
+          if ( mkdir(baseEncoded, (mode_t) mode) != 0) {
+            perror("trying to create local folder");
+            return false;
+          }
+        }
+        i = pos + 1;
+    }
+    return true;
+}
+
+static QString readEnvPath(const char *env)
+{
+   QCString c_path = getenv(env);
+   if (c_path.isEmpty())
+      return QString::null;
+   return QFile::decodeName(c_path);
+}
+
+void KStandardDirs::addKDEDefaults()
+{
+    QStringList kdedirList;
+
+
+    QString kdedirs = readEnvPath("KDEDIRS");
+    if (!kdedirs.isEmpty())
+    {
+        tokenize(kdedirList, kdedirs, ":");
+    }
+    else
+    {
+        QString kdedir = readEnvPath("KDEDIR");
+        if (!kdedir.isEmpty())
+        {
+           kdedir = KShell::tildeExpand(kdedir);
+           kdedirList.append(kdedir);
+        }
+    }
+    kdedirList.append("/coolo/KDE");
+
+
+    QString execPrefix("NONE");
+    if (execPrefix!="NONE")
+       kdedirList.append(execPrefix);
+
+
+    QString localKdeDir;
+    if (getuid())
+    {
+       localKdeDir = readEnvPath("KDEHOME");
+       if (!localKdeDir.isEmpty())
+       {
+          if (localKdeDir[localKdeDir.length()-1] != '/')
+             localKdeDir += '/';
+       }
+       else
+       {
+          localKdeDir = QDir::homeDirPath() + "/.kde/";
+       }
+    }
+    else
+    {
+
+
+       localKdeDir = readEnvPath("KDEROOTHOME");
+       if (!localKdeDir.isEmpty())
+       {
+          if (localKdeDir[localKdeDir.length()-1] != '/')
+             localKdeDir += '/';
+       }
+       else
+       {
+          struct passwd *pw = getpwuid(0);
+          localKdeDir = QFile::decodeName((pw && pw->pw_dir) ? pw->pw_dir : "/root") + "/.kde/";
+       }
+
+    }
+
+    if (localKdeDir != "-/")
+    {
+        localKdeDir = KShell::tildeExpand(localKdeDir);
+        addPrefix(localKdeDir);
+    }
+
+    for (QStringList::ConstIterator it = kdedirList.begin();
+         it != kdedirList.end(); it++)
+    {
+        QString dir = KShell::tildeExpand(*it);
+        addPrefix(dir);
+    }
+
+
+
+    QStringList xdgdirList;
+    QString xdgdirs = readEnvPath("XDG_CONFIG_DIRS");
+    if (!xdgdirs.isEmpty())
+    {
+        tokenize(xdgdirList, xdgdirs, ":");
+    }
+    else
+    {
+        xdgdirList.clear();
+        xdgdirList.append("/etc/xdg");
+    }
+
+    QString localXdgDir = readEnvPath("XDG_CONFIG_HOME");
+    if (!localXdgDir.isEmpty())
+    {
+       if (localXdgDir[localXdgDir.length()-1] != '/')
+          localXdgDir += '/';
+    }
+    else
+    {
+       if (getuid())
+       {
+          localXdgDir = QDir::homeDirPath() + "/.config/";
+       }
+       else
+       {
+          struct passwd *pw = getpwuid(0);
+          localXdgDir = QFile::decodeName((pw && pw->pw_dir) ? pw->pw_dir : "/root") + "/.config/";
+       }
+    }
+
+    localXdgDir = KShell::tildeExpand(localXdgDir);
+    addXdgConfigPrefix(localXdgDir);
+
+    for (QStringList::ConstIterator it = xdgdirList.begin();
+         it != xdgdirList.end(); it++)
+    {
+        QString dir = KShell::tildeExpand(*it);
+        addXdgConfigPrefix(dir);
+    }
+
+
+
+    xdgdirs = readEnvPath("XDG_DATA_DIRS");
+    if (!xdgdirs.isEmpty())
+    {
+        tokenize(xdgdirList, xdgdirs, ":");
+    }
+    else
+    {
+        xdgdirList.clear();
+        for (QStringList::ConstIterator it = kdedirList.begin();
+           it != kdedirList.end(); it++)
+        {
+           QString dir = *it;
+           if (dir[dir.length()-1] != '/')
+             dir += '/';
+           xdgdirList.append(dir+"share/");
+        }
+
+        xdgdirList.append("/usr/local/share/");
+        xdgdirList.append("/usr/share/");
+    }
+
+    localXdgDir = readEnvPath("XDG_DATA_HOME");
+    if (!localXdgDir.isEmpty())
+    {
+       if (localXdgDir[localXdgDir.length()-1] != '/')
+          localXdgDir += '/';
+    }
+    else
+    {
+       if (getuid())
+       {
+          localXdgDir = QDir::homeDirPath() + "/.local/share/";
+       }
+       else
+       {
+          struct passwd *pw = getpwuid(0);
+          localXdgDir = QFile::decodeName((pw && pw->pw_dir) ? pw->pw_dir : "/root") + "/.local/share/";
+       }
+    }
+
+    localXdgDir = KShell::tildeExpand(localXdgDir);
+    addXdgDataPrefix(localXdgDir);
+
+    for (QStringList::ConstIterator it = xdgdirList.begin();
+         it != xdgdirList.end(); it++)
+    {
+        QString dir = KShell::tildeExpand(*it);
+        addXdgDataPrefix(dir);
+    }
+
+
+
+    uint index = 0;
+    while (types[index] != 0) {
+        addResourceType(types[index], kde_default(types[index]));
+        index++;
+    }
+
+    addResourceDir("home", QDir::homeDirPath());
+}
+
+void KStandardDirs::checkConfig() const
+{
+    if (!addedCustoms && KGlobal::_instance && KGlobal::_instance->_config)
+        const_cast<KStandardDirs*>(this)->addCustomized(KGlobal::_instance->_config);
+}
+
+bool KStandardDirs::addCustomized(KConfig *config)
+{
+    if (addedCustoms)
+        return false;
+
+
+
+    uint configdirs = resourceDirs("config").count();
+
+
+    QString oldGroup = config->group();
+    config->setGroup("Directories");
+
+    QStringList list;
+    QStringList::ConstIterator it;
+    list = config->readListEntry("prefixes");
+    for (it = list.begin(); it != list.end(); it++)
+        addPrefix(*it);
+
+
+
+    QMap<QString, QString> entries = config->entryMap("Directories");
+
+    QMap<QString, QString>::ConstIterator it2;
+    for (it2 = entries.begin(); it2 != entries.end(); it2++)
+    {
+        QString key = it2.key();
+        if (key.left(4) == "dir_") {
+
+            QStringList dirs = QStringList::split(',',
+                                                  *it2);
+            QStringList::Iterator sIt(dirs.begin());
+            QString resType = key.mid(4, key.length());
+            for (; sIt != dirs.end(); ++sIt) {
+                addResourceDir(resType.latin1(), *sIt);
+            }
+        }
+    }
+
+
+    config->setGroup("KDE Resource Restrictions");
+    entries = config->entryMap("KDE Resource Restrictions");
+    for (it2 = entries.begin(); it2 != entries.end(); it2++)
+    {
+        QString key = it2.key();
+        if (!config->readBoolEntry(key, true))
+        {
+           d->restrictionsActive = true;
+           d->restrictions.insert(key.latin1(), &d->restrictionsActive);
+           dircache.remove(key.latin1());
+        }
+    }
+
+
+    addedCustoms = true;
+    config->setGroup(oldGroup);
+
+
+    return (resourceDirs("config").count() != configdirs);
+}
+
+QString KStandardDirs::localkdedir() const
+{
+
+    return prefixes.first();
+}
+
+QString KStandardDirs::localxdgdatadir() const
+{
+
+    return d->xdgdata_prefixes.first();
+}
+
+QString KStandardDirs::localxdgconfdir() const
+{
+
+    return d->xdgconf_prefixes.first();
+}
+
+
+QString locate( const char *type,
+                const QString& filename, const KInstance* inst )
+{
+    return inst->dirs()->findResource(type, filename);
+}
+
+QString locateLocal( const char *type,
+                     const QString& filename, const KInstance* inst )
+{
+    return locateLocal(type, filename, true, inst);
+}
+
+QString locateLocal( const char *type,
+                     const QString& filename, bool createDir, const KInstance* inst )
+{
+
+
+    int slash = filename.findRev('/')+1;
+    if (!slash)
+        return inst->dirs()->saveLocation(type, QString::null, createDir) + filename;
+
+
+    QString dir = filename.left(slash);
+    QString file = filename.mid(slash);
+    return inst->dirs()->saveLocation(type, dir, createDir) + file;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C"
+
+int mkstemps(char *, int);
+extern "C"
+
+unsigned long strlcat(char*, const char*, unsigned long);
+
+
+
+
+
+
+extern "C"
+
+unsigned long strlcpy(char*, const char*, unsigned long);
+
+
+
+
+
+
+
+
+
+
+
+extern "C" {
+
+
+
+
+
+
+extern "C" {
+
+
+
+
+
+struct iovec
+  {
+    void *iov_base;
+    size_t iov_len;
+  };
+
+
+
+
+
+
+
+extern ssize_t readv (int __fd, __const struct iovec *__vector, int __count)
+     throw ();
+
+
+
+
+
+
+extern ssize_t writev (int __fd, __const struct iovec *__vector, int __count)
+     throw ();
+
+}
+
+struct osockaddr
+  {
+    unsigned short int sa_family;
+    unsigned char sa_data[14];
+  };
+
+
+
+
+enum
+{
+  SHUT_RD = 0,
+  SHUT_WR,
+  SHUT_RDWR
+};
+extern int socket (int __domain, int __type, int __protocol) throw ();
+
+
+
+
+
+extern int socketpair (int __domain, int __type, int __protocol,
+                       int __fds[2]) throw ();
+
+
+extern int bind (int __fd, __const struct sockaddr * __addr, socklen_t __len)
+     throw ();
+
+
+extern int getsockname (int __fd, struct sockaddr *__restrict __addr,
+                        socklen_t *__restrict __len) throw ();
+
+
+
+
+
+extern int connect (int __fd, __const struct sockaddr * __addr, socklen_t __len)
+     throw ();
+
+
+
+extern int getpeername (int __fd, struct sockaddr *__restrict __addr,
+                        socklen_t *__restrict __len) throw ();
+
+
+
+extern ssize_t send (int __fd, __const void *__buf, size_t __n, int __flags)
+     throw ();
+
+
+
+extern ssize_t recv (int __fd, void *__buf, size_t __n, int __flags)
+     throw ();
+
+
+
+extern ssize_t sendto (int __fd, __const void *__buf, size_t __n,
+                       int __flags, __const struct sockaddr * __addr,
+                       socklen_t __addr_len) throw ();
+
+
+
+
+
+extern ssize_t recvfrom (int __fd, void *__restrict __buf, size_t __n, int __flags,
+                         struct sockaddr *__restrict __addr, socklen_t *__restrict __addr_len)
+     throw ();
+
+
+
+
+extern ssize_t sendmsg (int __fd, __const struct msghdr *__message, int __flags)
+     throw ();
+
+
+
+extern ssize_t recvmsg (int __fd, struct msghdr *__message, int __flags)
+     throw ();
+
+
+
+
+
+extern int getsockopt (int __fd, int __level, int __optname,
+                       void *__restrict __optval,
+                       socklen_t *__restrict __optlen) throw ();
+
+
+
+
+extern int setsockopt (int __fd, int __level, int __optname,
+                       __const void *__optval, socklen_t __optlen) throw ();
+
+
+
+
+
+extern int listen (int __fd, int __n) throw ();
+
+
+
+
+
+
+extern int accept (int __fd, struct sockaddr *__restrict __addr,
+                   socklen_t *__restrict __addr_len)
+     throw ();
+
+
+
+
+
+
+
+extern int shutdown (int __fd, int __how) throw ();
+
+
+
+
+extern int sockatmark (int __fd) throw ();
+
+
+
+
+
+
+
+extern int isfdtype (int __fd, int __fdtype) throw ();
+
+
+}
+
+
+
+
+
+
+
+
+extern "C" {
+
+
+struct sockaddr_un
+  {
+    sa_family_t sun_family;
+    char sun_path[108];
+  };
+
+
+
+
+
+
+
+
+
+}
+
+
+
+extern "C" {
+
+
+extern "C" {
+
+
+
+extern in_addr_t inet_addr (__const char *__cp) throw ();
+
+
+extern in_addr_t inet_lnaof (struct in_addr __in) throw ();
+
+
+
+extern struct in_addr inet_makeaddr (in_addr_t __net, in_addr_t __host)
+     throw ();
+
+
+extern in_addr_t inet_netof (struct in_addr __in) throw ();
+
+
+
+extern in_addr_t inet_network (__const char *__cp) throw ();
+
+
+
+extern char *inet_ntoa (struct in_addr __in) throw ();
+
+
+
+
+extern int inet_pton (int __af, __const char *__restrict __cp,
+                      void *__restrict __buf) throw ();
+
+
+
+
+extern __const char *inet_ntop (int __af, __const void *__restrict __cp,
+                                char *__restrict __buf, socklen_t __len)
+     throw ();
+
+
+
+
+
+
+extern in_addr_t inet_aton (__const char *__cp, struct in_addr *__inp) throw ();
+
+
+
+extern char *inet_neta (in_addr_t __net, char *__buf, size_t __len) throw ();
+
+
+
+
+extern char *inet_net_ntop (int __af, __const void *__cp, int __bits,
+                            char *__buf, size_t __len) throw ();
+
+
+
+
+extern int inet_net_pton (int __af, __const char *__cp,
+                          void *__buf, size_t __len) throw ();
+
+
+
+
+extern unsigned int inet_nsap_addr (__const char *__cp,
+                                    unsigned char *__buf, int __len) throw ();
+
+
+
+extern char *inet_nsap_ntoa (int __len, __const unsigned char *__cp,
+                             char *__buf) throw ();
+
+
+}
+}
+
+
+class QSocketNotifier;
+typedef sockaddr_in ksockaddr_in;
+
+
+
+class KSocketPrivate;
+class KServerSocketPrivate;
+class KSocket : public QObject
+{
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+public:
+
+
+
+
+    KSocket( int _sock );
+
+
+
+
+
+
+    KSocket( const char *_host, unsigned short int _port, int timeOut = 30);
+
+
+
+
+
+    KSocket( const char * _path );
+
+
+
+
+    virtual ~KSocket();
+
+
+
+
+
+    int socket() const { return sock; }
+    void enableRead( bool enable );
+    void enableWrite( bool enable );
+    unsigned long ipv4_addr() __attribute__ ((deprecated));
+
+
+
+
+
+
+
+    static bool initSockaddr(ksockaddr_in *server_name, const char *hostname, unsigned short int port, int domain = 2) __attribute__ ((deprecated));
+
+
+protected:
+
+
+
+
+
+
+
+    void readEvent( KSocket *s );
+    void writeEvent( KSocket *s );
+
+
+
+
+
+    void closeEvent( KSocket *s );
+
+public :
+
+
+
+
+
+
+
+    void slotWrite( int x);
+    void slotRead( int x );
+
+protected:
+    bool connect( const QString& _host, unsigned short int _port, int timeout = 0 );
+    bool connect( const char *_path );
+
+
+
+
+
+    int sock;
+
+private:
+    KSocket(const KSocket&);
+    KSocket& operator=(const KSocket&);
+
+    KSocketPrivate *d;
+
+};
+class KServerSocket : public QObject
+{
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+public:
+
+
+
+
+
+
+
+    KServerSocket( unsigned short int _port, bool _bind = true );
+    KServerSocket( const char *_path, bool _bind = true);
+
+
+
+
+    virtual ~KServerSocket();
+
+
+
+
+
+
+
+    bool bindAndListen();
+
+
+
+
+
+
+    int socket() const { return sock; }
+
+
+
+
+
+    unsigned short int port();
+    unsigned long ipv4_addr();
+
+
+public :
+
+
+
+    virtual void slotAccept( int );
+
+protected:
+    void accepted( KSocket*s );
+
+protected:
+    bool init( unsigned short int );
+    bool init( const char *_path );
+
+
+
+
+
+    int sock;
+
+private:
+    KServerSocket(const KServerSocket&);
+    KServerSocket& operator=(const KServerSocket&);
+
+    KServerSocketPrivate *d;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+class KAsyncIOPrivate;
+class KAsyncIO: public QObject, public QIODevice
+{
+  public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+protected:
+  KAsyncIO()
+  { }
+
+private:
+  KAsyncIO(KAsyncIO&);
+
+  KAsyncIO& operator=(KAsyncIO&);
+
+public:
+
+
+
+
+
+
+  virtual void enableRead(bool enable) = 0;
+
+
+
+
+
+
+
+  virtual void enableWrite(bool enable) = 0;
+
+protected:
+
+
+
+
+  void readyRead();
+
+
+
+
+  void readyWrite();
+protected:
+
+  virtual void virtual_hook( int id, void* data );
+private:
+  KAsyncIOPrivate* d;
+};
+
+class KBufferedIOPrivate;
+class KBufferedIO: public KAsyncIO
+{
+  public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+
+protected:
+
+  KBufferedIO();
+
+public:
+
+
+
+  enum closeModes
+  {
+    availRead = 0x01,
+    dirtyWrite = 0x02,
+    involuntary = 0x10,
+    delayed = 0x20,
+    closedNow = 0x40
+  };
+
+
+
+
+
+  virtual ~KBufferedIO();
+  virtual void closeNow() = 0;
+  virtual bool setBufferSize(int rsize, int wsize = -2);
+
+
+
+
+
+  virtual int bytesAvailable() const;
+
+
+
+
+
+
+
+  virtual int waitForMore(int msec) = 0;
+
+
+
+
+
+  virtual int bytesToWrite() const;
+  virtual bool canReadLine() const;
+  virtual int peekBlock(char *data, uint maxlen) = 0;
+  virtual int unreadBlock(const char *data, uint len);
+
+protected:
+
+
+
+
+  void bytesWritten(int nbytes);
+  void closed(int state);
+
+protected:
+
+
+
+
+  QPtrList<QByteArray> inBuf;
+
+
+
+
+
+  QPtrList<QByteArray> outBuf;
+
+  unsigned inBufIndex, outBufIndex;
+  virtual unsigned consumeReadBuffer(unsigned nbytes, char *destbuffer, bool discard = true);
+  virtual void consumeWriteBuffer(unsigned nbytes);
+  virtual unsigned feedReadBuffer(unsigned nbytes, const char *buffer, bool atBeginning = false);
+  virtual unsigned feedWriteBuffer(unsigned nbytes, const char *buffer);
+
+
+
+
+
+  virtual unsigned readBufferSize() const;
+
+
+
+
+
+  virtual unsigned writeBufferSize() const;
+
+protected:
+  virtual void virtual_hook( int id, void* data );
+private:
+  KBufferedIOPrivate *d;
+};
+typedef unsigned ksocklen_t;
+
+struct sockaddr;
+
+class KExtendedSocket;
+
+class KSocketAddressPrivate;
+class KSocketAddress: public QObject
+{
+  public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+protected:
+
+
+
+  KSocketAddress() { init(); }
+
+
+
+
+
+
+  KSocketAddress(const sockaddr* sa, ksocklen_t size);
+
+public:
+
+
+
+  virtual ~KSocketAddress();
+
+
+
+
+
+  virtual QString pretty() const;
+
+
+
+
+
+  const sockaddr* address() const
+  { return data; }
+
+
+
+
+
+  virtual ksocklen_t size() const
+  { return datasize; }
+
+
+
+
+
+
+  operator const sockaddr*() const
+  { return data; }
+
+
+
+
+
+  int family() const;
+
+
+
+
+
+
+  inline int ianaFamily() const
+  { return ianaFamily(family()); }
+
+
+
+
+
+
+  virtual bool isEqual(const KSocketAddress& other) const;
+  bool isEqual(const KSocketAddress* other) const
+  { return isEqual(*other); }
+
+
+
+
+
+  bool operator==(const KSocketAddress& other) const
+  { return isEqual(other); }
+  bool isCoreEqual(const KSocketAddress& other) const;
+  bool isCoreEqual(const KSocketAddress* other) const
+  { return isCoreEqual(*other); }
+  virtual QString nodeName() const;
+  virtual QString serviceName() const;
+
+protected:
+  sockaddr* data;
+  ksocklen_t datasize;
+  bool owndata;
+
+private:
+  void init();
+
+  KSocketAddress(KSocketAddress&);
+  KSocketAddress& operator=(KSocketAddress&);
+
+public:
+
+
+
+
+
+
+
+  static KSocketAddress* newAddress(const struct sockaddr *sa, ksocklen_t size);
+  static int ianaFamily(int af);
+
+
+
+
+
+  static int fromIanaFamily(int iana);
+
+  friend class KExtendedSocket;
+protected:
+  virtual void virtual_hook( int id, void* data );
+private:
+  KSocketAddressPrivate* d;
+};
+
+
+
+
+
+struct sockaddr_in;
+struct sockaddr_in6;
+struct in_addr;
+struct in6_addr;
+
+class KInetSocketAddressPrivate;
+class KInetSocketAddress: public KSocketAddress
+{
+  public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+public:
+
+
+
+  KInetSocketAddress();
+
+
+
+
+  KInetSocketAddress(const KInetSocketAddress&);
+
+
+
+
+
+
+  KInetSocketAddress(const sockaddr_in* sin, ksocklen_t len);
+
+
+
+
+
+
+  KInetSocketAddress(const sockaddr_in6* sin6, ksocklen_t len);
+
+
+
+
+
+
+  KInetSocketAddress(const in_addr& addr, unsigned short port);
+
+
+
+
+
+
+  KInetSocketAddress(const in6_addr& addr, unsigned short port);
+  KInetSocketAddress(const QString& addr, unsigned short port, int family = -1);
+
+
+
+
+  virtual ~KInetSocketAddress();
+
+
+
+
+
+
+  bool setAddress(const KInetSocketAddress& ksa);
+
+
+
+
+
+
+
+  bool setAddress(const sockaddr_in* sin, ksocklen_t len);
+  bool setAddress(const sockaddr_in6* sin6, ksocklen_t len);
+
+
+
+
+
+
+
+  bool setAddress(const in_addr& addr, unsigned short port);
+
+
+
+
+
+
+
+  bool setAddress(const in6_addr& addr, unsigned short port);
+  bool setAddress(const QString& addr, unsigned short port, int family = -1);
+
+
+
+
+
+
+  bool setHost(const in_addr& addr);
+
+
+
+
+
+
+  bool setHost(const in6_addr& addr);
+
+
+
+
+
+
+
+  bool setHost(const QString& addr, int family = -1);
+
+
+
+
+
+
+  bool setPort(unsigned short port);
+  bool setFamily(int family);
+
+
+
+
+
+
+  bool setFlowinfo(Q_UINT32 flowinfo);
+
+
+
+
+
+
+  bool setScopeId(int scopeid);
+
+
+
+
+
+  virtual QString pretty() const;
+
+
+
+
+
+  virtual QString nodeName() const;
+
+
+
+
+
+
+  virtual QString serviceName() const;
+  const sockaddr_in* addressV4() const;
+
+
+
+
+
+  const sockaddr_in6* addressV6() const;
+
+
+
+
+
+
+  in_addr hostV4() const;
+
+
+
+
+
+
+
+  in6_addr hostV6() const;
+
+
+
+
+
+  unsigned short port() const;
+
+
+
+
+
+  Q_UINT32 flowinfo() const;
+
+
+
+
+
+  int scopeId() const;
+
+
+
+
+
+
+  virtual ksocklen_t size() const;
+  static bool areEqualInet(const KSocketAddress &s1, const KSocketAddress &s2, bool coreOnly);
+  static bool areEqualInet6(const KSocketAddress &s1, const KSocketAddress &s2, bool coreOnly);
+  operator const sockaddr_in*() const
+  { return addressV4(); }
+
+
+
+
+
+
+  operator const sockaddr_in6*() const
+  { return addressV6(); }
+
+
+
+
+  KInetSocketAddress& operator=(const KInetSocketAddress &other)
+  { setAddress(other); return *this; }
+
+private:
+
+  void fromV4();
+  void fromV6();
+
+public:
+
+
+
+
+
+
+
+  static QString addrToString(int family, const void *addr);
+  static bool stringToAddr(int family, const char *text, void *dest);
+
+  friend class KExtendedSocket;
+protected:
+  virtual void virtual_hook( int id, void* data );
+private:
+  KInetSocketAddressPrivate* d;
+};
+
+extern const KInetSocketAddress addressAny, addressLoopback;
+
+
+
+
+struct sockaddr_un;
+
+class KUnixSocketAddressPrivate;
+class KUnixSocketAddress: public KSocketAddress
+{
+  public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+public:
+
+
+
+  KUnixSocketAddress();
+
+
+
+
+
+
+  KUnixSocketAddress(const sockaddr_un* raw_data, ksocklen_t size);
+
+
+
+
+
+  KUnixSocketAddress(QCString pathname);
+
+
+
+
+  virtual ~KUnixSocketAddress();
+
+
+
+
+
+
+
+  bool setAddress(const sockaddr_un* socket_address, ksocklen_t size);
+
+
+
+
+
+
+  bool setAddress(QCString path);
+
+
+
+
+
+
+  QCString pathname() const;
+
+
+
+
+
+  virtual QString pretty() const;
+
+
+
+
+
+
+
+  virtual QString serviceName() const;
+
+
+
+
+
+  const sockaddr_un* address() const;
+
+
+
+
+
+
+  operator const sockaddr_un*() const
+  { return address(); }
+  static bool areEqualUnix(const KSocketAddress &s1, const KSocketAddress &s2, bool coreOnly);
+
+private:
+  void init();
+
+  friend class KExtendedSocket;
+protected:
+  virtual void virtual_hook( int id, void* data );
+private:
+  KUnixSocketAddressPrivate* d;
+};
+
+
+struct addrinfo;
+struct kde_addrinfo;
+class KAddressInfo;
+class QSocketNotifier;
+
+class KExtendedSocketPrivate;
+class KExtendedSocket: public KBufferedIO
+{
+  public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+
+public:
+
+
+
+  enum Flags
+  {
+
+
+
+
+
+    anySocket = 0x00,
+    knownSocket = 0x01,
+    unixSocket = knownSocket | 0x02,
+    inetSocket = knownSocket | 0x04,
+    ipv4Socket = inetSocket | 0x100,
+    ipv6Socket = inetSocket | 0x200,
+
+    passiveSocket = 0x1000,
+    canonName = 0x2000,
+    noResolve = 0x4000,
+
+    streamSocket = 0x8000,
+    datagramSocket = 0x10000,
+    rawSocket = 0x20000,
+
+    inputBufferedSocket = 0x200000,
+    outputBufferedSocket = 0x400000,
+    bufferedSocket = 0x600000
+  };
+
+
+
+
+
+
+  enum SockStatus
+  {
+
+    error = -1,
+
+    nothing = 0,
+
+    lookupInProgress = 50,
+    lookupDone = 70,
+
+
+    created = 100,
+    bound = 140,
+
+    connecting = 200,
+    connected = 220,
+
+    listening = 200,
+    accepting = 220,
+
+    closing = 350,
+
+    done = 400
+  };
+
+public:
+
+
+
+  KExtendedSocket();
+
+
+
+
+
+
+
+  KExtendedSocket(const QString& host, int port, int flags = 0);
+
+
+
+
+
+
+
+  KExtendedSocket(const QString& host, const QString& service, int flags = 0);
+
+
+
+
+
+  virtual ~KExtendedSocket();
+
+
+
+
+
+
+  void reset();
+  int socketStatus() const;
+
+
+
+
+
+
+
+  int systemError() const;
+
+
+
+
+
+
+  int setSocketFlags(int flags);
+
+
+
+
+
+
+  int socketFlags() const;
+
+
+
+
+
+
+  bool setHost(const QString& host);
+
+
+
+
+
+  QString host() const;
+
+
+
+
+
+  bool setPort(int port);
+
+
+
+
+
+
+  bool setPort(const QString& port);
+
+
+
+
+
+  QString port() const;
+
+
+
+
+
+
+
+  bool setAddress(const QString& host, int port);
+
+
+
+
+
+
+
+  bool setAddress(const QString& host, const QString& serv);
+
+
+
+
+
+
+  bool setBindHost(const QString& host);
+
+
+
+
+
+  bool unsetBindHost();
+
+
+
+
+
+  QString bindHost() const;
+
+
+
+
+
+
+  bool setBindPort(int port);
+
+
+
+
+
+
+  bool setBindPort(const QString& service);
+
+
+
+
+
+  bool unsetBindPort();
+
+
+
+
+
+  QString bindPort() const;
+  bool setBindAddress(const QString& host, int port);
+  bool setBindAddress(const QString& host, const QString& service);
+
+
+
+
+
+
+  bool unsetBindAddress();
+  bool setTimeout(int secs, int usecs = 0);
+
+
+
+
+
+  timeval timeout() const;
+  bool setBlockingMode(bool enable);
+
+
+
+
+
+  bool blockingMode();
+  bool setAddressReusable(bool enable);
+
+
+
+
+
+  bool addressReusable();
+  bool setIPv6Only(bool enable);
+
+
+
+
+
+
+
+  bool isIPv6Only();
+  virtual bool setBufferSize(int rsize, int wsize = -2);
+
+
+
+
+
+
+  const KSocketAddress *localAddress();
+
+
+
+
+
+
+
+  const KSocketAddress *peerAddress();
+
+
+
+
+
+  inline int fd() const
+  { return sockfd; }
+  virtual int lookup();
+  virtual int startAsyncLookup();
+
+
+
+
+  virtual void cancelAsyncLookup();
+  virtual int listen(int N = 5);
+  virtual int accept(KExtendedSocket *&sock);
+  virtual int connect();
+  virtual int startAsyncConnect();
+
+
+
+
+  virtual void cancelAsyncConnect();
+  virtual bool open(int mode = 0x0040 | 0x0003);
+  virtual void close();
+
+
+
+
+
+
+  virtual void closeNow();
+  virtual void release();
+  virtual void flush();
+
+
+
+
+
+  virtual inline Q_ULONG size() const
+  { return 0; }
+
+
+
+
+
+  virtual inline Q_ULONG at() const
+  { return 0; }
+
+
+
+
+
+
+  virtual inline bool at(int i)
+  { (void)i;;return true; }
+
+
+
+
+
+
+  virtual inline bool atEnd() const
+  { return false; }
+  virtual Q_LONG readBlock(char *data, Q_ULONG maxlen);
+  virtual Q_LONG writeBlock(const char *data, Q_ULONG len);
+  virtual int peekBlock(char *data, uint maxlen);
+
+
+
+
+
+
+
+  virtual int unreadBlock(const char *data, uint len);
+  virtual int bytesAvailable() const;
+  virtual int waitForMore(int msec);
+
+
+
+
+
+  virtual int getch();
+
+
+
+
+
+
+  virtual int putch(int ch);
+
+
+
+
+
+  virtual int ungetch(int)
+  { return -1; }
+  virtual void enableRead(bool enable);
+  virtual void enableWrite(bool enable);
+
+protected:
+
+
+
+
+
+  void lookupFinished(int count);
+
+
+
+
+  void connectionSuccess();
+
+
+
+
+
+
+  void connectionFailed(int error);
+
+
+
+
+
+
+  void readyAccept();
+
+protected:
+  int sockfd;
+
+protected :
+
+  void socketActivityRead();
+  void socketActivityWrite();
+  void dnsResultsReady();
+  void startAsyncConnectSlot();
+  void connectionEvent();
+
+protected:
+
+  QSocketNotifier *readNotifier();
+  QSocketNotifier *writeNotifier();
+
+private:
+
+
+  KExtendedSocket(KExtendedSocket&);
+  KExtendedSocket& operator=(KExtendedSocket&);
+
+
+
+
+
+  static int doLookup(const QString& host, const QString& serv, addrinfo& hint,
+                      kde_addrinfo** result);
+
+protected:
+
+
+
+  void setError(int errorkind, int error);
+
+  inline void cleanError()
+  { setError(0, 0); }
+
+
+
+
+  void setSocketStatus(int status);
+
+public:
+  static int resolve(sockaddr* sock, ksocklen_t len, QString& host, QString& port, int flags = 0);
+  static int resolve(KSocketAddress* sock, QString& host, QString& port, int flags = 0);
+  static QPtrList<KAddressInfo> lookup(const QString& host, const QString& port, int flags = 0, int *error = 0);
+
+
+
+
+
+
+
+  static KSocketAddress *localAddress(int fd);
+  static KSocketAddress *peerAddress(int fd);
+
+
+
+
+
+
+
+  static QString strError(int code, int syserr);
+  static bool setAddressReusable(int fd, bool enable);
+
+protected:
+  virtual void virtual_hook( int id, void* data );
+private:
+  KExtendedSocketPrivate *d;
+
+  friend class KSocket;
+  friend class KServerSocket;
+};
+
+
+
+
+
+class KAddressInfo
+{
+private:
+  addrinfo *ai;
+  KSocketAddress *addr;
+
+  inline KAddressInfo() : ai(0), addr(0)
+  { }
+
+  KAddressInfo(addrinfo *ai);
+  KAddressInfo(KAddressInfo&) { }
+  KAddressInfo& operator=(KAddressInfo&) { return *this; }
+
+public:
+  ~KAddressInfo();
+
+
+
+
+
+  inline operator const KSocketAddress*() const
+  { return addr; }
+
+
+
+
+  inline operator const addrinfo&() const
+  { return *ai; }
+
+
+
+
+
+  inline operator const addrinfo*() const
+  { return ai; }
+
+
+
+
+
+
+  inline const KSocketAddress* address() const
+  { return addr; }
+
+
+
+
+
+  int flags() const;
+
+
+
+
+
+  int family() const;
+
+
+
+
+
+  int socktype() const;
+
+
+
+
+
+  int protocol() const;
+
+
+
+
+
+
+
+  const char* canonname() const;
+
+
+
+
+
+  inline int length() const
+  { if (addr) return addr->size(); return 0; }
+
+  friend class KExtendedSocket;
+};
+
+
+
+
+
+
+
+
+
+class KSocksTable;
+class KSocksPrivate;
+class KLibrary;
+class KConfigBase;
+struct sockaddr;
+class KSocks {
+   friend class KStaticDeleter<KSocks>;
+
+public:
+
+
+
+
+
+
+   static KSocks *self();
+
+
+
+
+
+   static bool activated();
+
+
+
+
+   void disableSocks();
+
+
+
+
+   void enableSocks();
+
+
+
+
+
+   bool usingSocks();
+
+
+
+
+
+   bool hasSocks();
+
+
+
+
+
+   bool hasWorkingAsyncConnect();
+    int connect (int sockfd, const sockaddr *serv_addr,
+                                ksocklen_t addrlen);
+
+
+
+
+    signed long int read (int fd, void *buf, unsigned long int count);
+
+
+
+
+    signed long int write (int fd, const void *buf, unsigned long int count);
+
+
+
+
+    int recvfrom (int s, void *buf, unsigned long int len, int flags,
+                                sockaddr *from, ksocklen_t *fromlen);
+
+
+
+
+    int sendto (int s, const void *msg, unsigned long int len, int flags,
+                             const sockaddr *to, ksocklen_t tolen);
+
+
+
+
+    int recv (int s, void *buf, unsigned long int len, int flags);
+
+
+
+
+    int send (int s, const void *msg, unsigned long int len, int flags);
+
+
+
+
+    int getsockname (int s, sockaddr *name, ksocklen_t *namelen);
+
+
+
+
+    int getpeername (int s, sockaddr *name, ksocklen_t *namelen);
+
+
+
+
+    int accept (int s, sockaddr *addr, ksocklen_t *addrlen);
+
+
+
+
+    int select (int n, fd_set *readfds, fd_set *writefds,
+                                fd_set *exceptfds, struct timeval *timeout);
+
+
+
+
+    int listen (int s, int backlog);
+
+
+
+
+
+    int bind (int sockfd, sockaddr *my_addr,
+                                     ksocklen_t addrlen);
+    int bind (int sockfd, const sockaddr *my_addr,
+                                     ksocklen_t addrlen);
+
+
+
+
+
+
+   void die();
+
+
+
+
+
+   static void disable();
+
+
+
+
+
+   static void setConfig(KConfigBase *config);
+
+private:
+   KSocks(KConfigBase *config);
+   ~KSocks();
+
+   void stopSocks();
+
+   static KSocks *_me;
+   static bool _disabled;
+   QStringList _libNames;
+   QStringList _libPaths;
+   bool _useSocks, _hasSocks;
+   KLibrary* _socksLib;
+
+
+   KSocksTable *_st;
+   KSocksPrivate *d;
+};
+
+extern "C" {
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef enum __ns_sect {
+        ns_s_qd = 0,
+        ns_s_zn = 0,
+        ns_s_an = 1,
+        ns_s_pr = 1,
+        ns_s_ns = 2,
+        ns_s_ud = 2,
+        ns_s_ar = 3,
+        ns_s_max = 4
+} ns_sect;
+
+
+
+
+
+
+typedef struct __ns_msg {
+        const u_char *_msg, *_eom;
+        u_int16_t _id, _flags, _counts[ns_s_max];
+        const u_char *_sections[ns_s_max];
+        ns_sect _sect;
+        int _rrnum;
+        const u_char *_ptr;
+} ns_msg;
+
+
+struct _ns_flagdata { int mask, shift; };
+extern struct _ns_flagdata _ns_flagdata[];
+
+
+
+
+
+
+
+
+
+typedef struct __ns_rr {
+        char name[1025];
+        u_int16_t type;
+        u_int16_t rr_class;
+        u_int32_t ttl;
+        u_int16_t rdlength;
+        const u_char * rdata;
+} ns_rr;
+
+
+
+
+
+
+
+
+typedef enum __ns_flag {
+        ns_f_qr,
+        ns_f_opcode,
+        ns_f_aa,
+        ns_f_tc,
+        ns_f_rd,
+        ns_f_ra,
+        ns_f_z,
+        ns_f_ad,
+        ns_f_cd,
+        ns_f_rcode,
+        ns_f_max
+} ns_flag;
+
+
+
+
+typedef enum __ns_opcode {
+        ns_o_query = 0,
+        ns_o_iquery = 1,
+        ns_o_status = 2,
+
+        ns_o_notify = 4,
+        ns_o_update = 5,
+        ns_o_max = 6
+} ns_opcode;
+
+
+
+
+typedef enum __ns_rcode {
+        ns_r_noerror = 0,
+        ns_r_formerr = 1,
+        ns_r_servfail = 2,
+        ns_r_nxdomain = 3,
+        ns_r_notimpl = 4,
+        ns_r_refused = 5,
+
+        ns_r_yxdomain = 6,
+        ns_r_yxrrset = 7,
+        ns_r_nxrrset = 8,
+        ns_r_notauth = 9,
+        ns_r_notzone = 10,
+        ns_r_max = 11,
+
+        ns_r_badsig = 16,
+        ns_r_badkey = 17,
+        ns_r_badtime = 18
+} ns_rcode;
+
+
+typedef enum __ns_update_operation {
+        ns_uop_delete = 0,
+        ns_uop_add = 1,
+        ns_uop_max = 2
+} ns_update_operation;
+
+
+
+
+struct ns_tsig_key {
+        char name[1025], alg[1025];
+        unsigned char *data;
+        int len;
+};
+typedef struct ns_tsig_key ns_tsig_key;
+
+
+
+
+struct ns_tcp_tsig_state {
+        int counter;
+        struct dst_key *key;
+        void *ctx;
+        unsigned char sig[512];
+        int siglen;
+};
+typedef struct ns_tcp_tsig_state ns_tcp_tsig_state;
+
+
+
+
+
+
+typedef enum __ns_type {
+        ns_t_invalid = 0,
+        ns_t_a = 1,
+        ns_t_ns = 2,
+        ns_t_md = 3,
+        ns_t_mf = 4,
+        ns_t_cname = 5,
+        ns_t_soa = 6,
+        ns_t_mb = 7,
+        ns_t_mg = 8,
+        ns_t_mr = 9,
+        ns_t_null = 10,
+        ns_t_wks = 11,
+        ns_t_ptr = 12,
+        ns_t_hinfo = 13,
+        ns_t_minfo = 14,
+        ns_t_mx = 15,
+        ns_t_txt = 16,
+        ns_t_rp = 17,
+        ns_t_afsdb = 18,
+        ns_t_x25 = 19,
+        ns_t_isdn = 20,
+        ns_t_rt = 21,
+        ns_t_nsap = 22,
+        ns_t_nsap_ptr = 23,
+        ns_t_sig = 24,
+        ns_t_key = 25,
+        ns_t_px = 26,
+        ns_t_gpos = 27,
+        ns_t_aaaa = 28,
+        ns_t_loc = 29,
+        ns_t_nxt = 30,
+        ns_t_eid = 31,
+        ns_t_nimloc = 32,
+        ns_t_srv = 33,
+        ns_t_atma = 34,
+        ns_t_naptr = 35,
+        ns_t_kx = 36,
+        ns_t_cert = 37,
+        ns_t_a6 = 38,
+        ns_t_dname = 39,
+        ns_t_sink = 40,
+        ns_t_opt = 41,
+        ns_t_tsig = 250,
+        ns_t_ixfr = 251,
+        ns_t_axfr = 252,
+        ns_t_mailb = 253,
+        ns_t_maila = 254,
+        ns_t_any = 255,
+        ns_t_zxfr = 256,
+        ns_t_max = 65536
+} ns_type;
+
+
+
+
+
+
+
+
+
+
+typedef enum __ns_class {
+        ns_c_invalid = 0,
+        ns_c_in = 1,
+        ns_c_2 = 2,
+        ns_c_chaos = 3,
+        ns_c_hs = 4,
+
+        ns_c_none = 254,
+        ns_c_any = 255,
+        ns_c_max = 65536
+} ns_class;
+
+
+
+typedef enum __ns_key_types {
+        ns_kt_rsa = 1,
+        ns_kt_dh = 2,
+        ns_kt_dsa = 3,
+        ns_kt_private = 254
+} ns_key_types;
+
+typedef enum __ns_cert_types {
+        cert_t_pkix = 1,
+        cert_t_spki = 2,
+        cert_t_pgp = 3,
+        cert_t_url = 253,
+        cert_t_oid = 254
+} ns_cert_types;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C" {
+u_int __ns_get16 (const u_char *) throw ();
+u_long __ns_get32 (const u_char *) throw ();
+void __ns_put16 (u_int, u_char *) throw ();
+void __ns_put32 (u_long, u_char *) throw ();
+int __ns_initparse (const u_char *, int, ns_msg *) throw ();
+int __ns_skiprr (const u_char *, const u_char *, ns_sect, int) throw ();
+int __ns_parserr (ns_msg *, ns_sect, int, ns_rr *) throw ();
+int __ns_sprintrr (const ns_msg *, const ns_rr *, const char *, const char *, char *, size_t) throw ();
+
+int __ns_sprintrrf (const u_char *, size_t, const char *, ns_class, ns_type, u_long, const u_char *, size_t, const char *, const char *, char *, size_t) throw ();
+
+
+
+int __ns_format_ttl (u_long, char *, size_t) throw ();
+int __ns_parse_ttl (const char *, u_long *) throw ();
+u_int32_t __ns_datetosecs (const char *cp, int *errp) throw ();
+int __ns_name_ntol (const u_char *, u_char *, size_t) throw ();
+int __ns_name_ntop (const u_char *, char *, size_t) throw ();
+int __ns_name_pton (const char *, u_char *, size_t) throw ();
+int __ns_name_unpack (const u_char *, const u_char *, const u_char *, u_char *, size_t) throw ();
+
+int __ns_name_pack (const u_char *, u_char *, int, const u_char **, const u_char **) throw ();
+
+int __ns_name_uncompress (const u_char *, const u_char *, const u_char *, char *, size_t) throw ();
+
+int __ns_name_compress (const char *, u_char *, size_t, const u_char **, const u_char **) throw ();
+
+int __ns_name_skip (const u_char **, const u_char *) throw ();
+void __ns_name_rollback (const u_char *, const u_char **, const u_char **) throw ();
+
+int __ns_sign (u_char *, int *, int, int, void *, const u_char *, int, u_char *, int *, time_t) throw ();
+
+int __ns_sign_tcp (u_char *, int *, int, int, ns_tcp_tsig_state *, int) throw ();
+
+int __ns_sign_tcp_init (void *, const u_char *, int, ns_tcp_tsig_state *) throw ();
+
+u_char *__ns_find_tsig (u_char *, u_char *) throw ();
+int __ns_verify (u_char *, int *, void *, const u_char *, int, u_char *, int *, time_t *, int) throw ();
+
+
+int __ns_verify_tcp (u_char *, int *, ns_tcp_tsig_state *, int) throw ();
+int __ns_verify_tcp_init (void *, const u_char *, int, ns_tcp_tsig_state *) throw ();
+
+int __ns_samedomain (const char *, const char *) throw ();
+int __ns_subdomain (const char *, const char *) throw ();
+int __ns_makecanon (const char *, char *, size_t) throw ();
+int __ns_samename (const char *, const char *) throw ();
+}
+
+
+
+typedef struct {
+        unsigned id :16;
+        unsigned rd :1;
+        unsigned tc :1;
+        unsigned aa :1;
+        unsigned opcode :4;
+        unsigned qr :1;
+
+        unsigned rcode :4;
+        unsigned cd: 1;
+        unsigned ad: 1;
+        unsigned unused :1;
+        unsigned ra :1;
+
+
+        unsigned qdcount :16;
+        unsigned ancount :16;
+        unsigned nscount :16;
+        unsigned arcount :16;
+} HEADER;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef enum { res_goahead, res_nextns, res_modified, res_done, res_error }
+        res_sendhookact;
+
+typedef res_sendhookact (*res_send_qhook) (struct sockaddr_in * const *ns,
+                                           const u_char **query,
+                                           int *querylen,
+                                           u_char *ans,
+                                           int anssiz,
+                                           int *resplen);
+
+typedef res_sendhookact (*res_send_rhook) (const struct sockaddr_in *ns,
+                                           const u_char *query,
+                                           int querylen,
+                                           u_char *ans,
+                                           int anssiz,
+                                           int *resplen);
+
+
+
+
+
+
+struct __res_state {
+        int retrans;
+        int retry;
+        u_long options;
+        int nscount;
+        struct sockaddr_in
+                nsaddr_list[3];
+        u_short id;
+        char *dnsrch[6 +1];
+        char defdname[256];
+        u_long pfcode;
+        unsigned ndots:4;
+        unsigned nsort:4;
+        char unused[3];
+        struct {
+                struct in_addr addr;
+                u_int32_t mask;
+        } sort_list[10];
+        res_send_qhook qhook;
+        res_send_rhook rhook;
+        int res_h_errno;
+        int _vcsock;
+        u_int _flags;
+        union {
+                char pad[52];
+                struct {
+                        u_int16_t nscount;
+                        u_int16_t nsmap[3];
+                        int nssocks[3];
+                        u_int16_t nscount6;
+                        u_int16_t nsinit;
+                        struct sockaddr_in6 *nsaddrs[3];
+                } _ext;
+        } _u;
+};
+
+typedef struct __res_state *res_state;
+
+
+struct res_sym {
+        int number;
+        char * name;
+        char * humanname;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C" {
+extern struct __res_state *__res_state(void) __attribute__ ((__const__));
+}
+
+
+
+extern "C" {
+void __fp_nquery (const u_char *, int, FILE *) throw ();
+void __fp_query (const u_char *, FILE *) throw ();
+const char * __hostalias (const char *) throw ();
+void __p_query (const u_char *) throw ();
+void __res_close (void) throw ();
+int __res_init (void) throw ();
+int __res_isourserver (const struct sockaddr_in *) throw ();
+int __res_mkquery (int, const char *, int, int, const u_char *, int, const u_char *, u_char *, int) throw ();
+
+int __res_query (const char *, int, int, u_char *, int) throw ();
+int __res_querydomain (const char *, const char *, int, int, u_char *, int) throw ();
+
+int __res_search (const char *, int, int, u_char *, int) throw ();
+int __res_send (const u_char *, int, u_char *, int) throw ();
+}
+
+
+extern "C" {
+int __res_hnok (const char *) throw ();
+int __res_ownok (const char *) throw ();
+int __res_mailok (const char *) throw ();
+int __res_dnok (const char *) throw ();
+int __sym_ston (const struct res_sym *, const char *, int *) throw ();
+const char * __sym_ntos (const struct res_sym *, int, int *) throw ();
+const char * __sym_ntop (const struct res_sym *, int, int *) throw ();
+int __b64_ntop (u_char const *, size_t, char *, size_t) throw ();
+int __b64_pton (char const *, u_char *, size_t) throw ();
+int __loc_aton (const char *ascii, u_char *binary) throw ();
+const char * __loc_ntoa (const u_char *binary, char *ascii) throw ();
+int __dn_skipname (const u_char *, const u_char *) throw ();
+void __putlong (u_int32_t, u_char *) throw ();
+void __putshort (u_int16_t, u_char *) throw ();
+const char * __p_class (int) throw ();
+const char * __p_time (u_int32_t) throw ();
+const char * __p_type (int) throw ();
+const char * __p_rcode (int) throw ();
+const u_char * __p_cdnname (const u_char *, const u_char *, int, FILE *) throw ();
+const u_char * __p_cdname (const u_char *, const u_char *, FILE *) throw ();
+const u_char * __p_fqnname (const u_char *cp, const u_char *msg, int, char *, int) throw ();
+
+const u_char * __p_fqname (const u_char *, const u_char *, FILE *) throw ();
+const char * __p_option (u_long option) throw ();
+char * __p_secstodate (u_long) throw ();
+int __dn_count_labels (const char *) throw ();
+int __dn_comp (const char *, u_char *, int, u_char **, u_char **) throw ();
+
+int __dn_expand (const u_char *, const u_char *, const u_char *, char *, int) throw ();
+
+u_int __res_randomid (void) throw ();
+int __res_nameinquery (const char *, int, int, const u_char *, const u_char *) throw ();
+
+int __res_queriesmatch (const u_char *, const u_char *, const u_char *, const u_char *) throw ();
+
+const char * __p_section (int section, int opcode) throw ();
+
+int __res_ninit (res_state) throw ();
+int __res_nisourserver (const res_state, const struct sockaddr_in *) throw ();
+
+void __fp_resstat (const res_state, FILE *) throw ();
+void __res_npquery (const res_state, const u_char *, int, FILE *) throw ();
+const char * __res_hostalias (const res_state, const char *, char *, size_t) throw ();
+
+int __res_nquery (res_state, const char *, int, int, u_char *, int) throw ();
+
+int __res_nsearch (res_state, const char *, int, int, u_char *, int) throw ();
+
+int __res_nquerydomain (res_state, const char *, const char *, int, int, u_char *, int) throw ();
+
+
+int __res_nmkquery (res_state, int, const char *, int, int, const u_char *, int, const u_char *, u_char *, int) throw ();
+
+
+int __res_nsend (res_state, const u_char *, int, u_char *, int) throw ();
+void __res_nclose (res_state) throw ();
+}
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (__const char *__assertion, __const char *__file,
+                           unsigned int __line, __const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, __const char *__file,
+                                  unsigned int __line,
+                                  __const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+
+
+
+
+
+
+
+
+class QSocketNotifier : public QObject
+{
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+public:
+    enum Type { Read, Write, Exception };
+
+    QSocketNotifier( int socket, Type, QObject *parent=0, const char *name=0 );
+   ~QSocketNotifier();
+
+    int socket() const;
+    Type type() const;
+
+    bool isEnabled() const;
+    virtual void setEnabled( bool );
+
+protected:
+    void activated( int socket );
+
+protected:
+    bool event( QEvent * );
+
+private:
+    int sockfd;
+    Type sntype;
+    bool snenabled;
+
+private:
+
+    QSocketNotifier( const QSocketNotifier & );
+    QSocketNotifier &operator=( const QSocketNotifier & );
+
+};
+
+
+inline int QSocketNotifier::socket() const
+{ return sockfd; }
+
+inline QSocketNotifier::Type QSocketNotifier::type() const
+{ return sntype; }
+
+inline bool QSocketNotifier::isEnabled() const
+{ return snenabled; }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C"
+
+int mkstemps(char *, int);
+extern "C"
+
+unsigned long strlcat(char*, const char*, unsigned long);
+
+
+
+
+
+
+extern "C"
+
+unsigned long strlcpy(char*, const char*, unsigned long);
+
+
+
+
+struct kde_in6_addr
+{
+  unsigned char __u6_addr[16];
+};
+
+
+
+
+
+struct kde_sockaddr_in6
+{
+
+
+
+
+  Q_UINT16 sin6_family;
+
+  unsigned short sin6_port;
+  Q_UINT32 sin6_flowinfo;
+  struct kde_in6_addr sin6_addr;
+  Q_UINT32 sin6_scope_id;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct addrinfo;
+struct kde_addrinfo
+{
+  struct addrinfo *data;
+  int origin;
+};
+
+extern int kde_getaddrinfo(const char *name, const char *service,
+                           const struct addrinfo* hint,
+                           struct kde_addrinfo** result);
+extern void kde_freeaddrinfo(struct kde_addrinfo *p);
+
+class KSocketPrivate
+{
+public:
+  QSocketNotifier *readNotifier;
+  QSocketNotifier *writeNotifier;
+
+  KSocketPrivate() :
+    readNotifier(0), writeNotifier(0)
+  { }
+};
+
+
+
+KSocket::KSocket( int _sock)
+  : sock(_sock), d(new KSocketPrivate)
+{
+  struct sockaddr_in sin;
+  ksocklen_t len = sizeof(sin);
+
+  memset(&sin, 0, len);
+
+
+
+
+  KSocks::self()->getsockname(_sock, (struct sockaddr *)&sin, &len);
+}
+
+KSocket::KSocket( const char *_host, unsigned short int _port, int _timeout ) :
+  sock( -1 ), d(new KSocketPrivate)
+{
+    connect( _host, _port, _timeout );
+}
+
+KSocket::KSocket( const char *_path ) :
+  sock( -1 ), d(new KSocketPrivate)
+{
+  connect( _path );
+}
+
+void KSocket::enableRead( bool _state )
+{
+  if ( _state )
+    {
+          if ( !d->readNotifier )
+                {
+                  d->readNotifier = new QSocketNotifier( sock, QSocketNotifier::Read );
+                  QObject::connect( d->readNotifier, "2""activated(int)", this, "1""slotRead(int)" );
+                }
+          else
+            d->readNotifier->setEnabled( true );
+    }
+  else if ( d->readNotifier )
+        d->readNotifier->setEnabled( false );
+}
+
+void KSocket::enableWrite( bool _state )
+{
+  if ( _state )
+    {
+          if ( !d->writeNotifier )
+                {
+                  d->writeNotifier = new QSocketNotifier( sock, QSocketNotifier::Write );
+                  QObject::connect( d->writeNotifier, "2""activated(int)", this,
+                                                        "1""slotWrite(int)" );
+                }
+          else
+            d->writeNotifier->setEnabled( true );
+    }
+  else if ( d->writeNotifier )
+        d->writeNotifier->setEnabled( false );
+}
+
+void KSocket::slotRead( int )
+{
+  char buffer[2];
+
+  int n = recv( sock, buffer, 1, MSG_PEEK );
+  if ( n <= 0 )
+        closeEvent( this );
+  else
+        readEvent( this );
+}
+
+void KSocket::slotWrite( int )
+{
+  writeEvent( this );
+}
+
+
+
+
+bool KSocket::connect( const char *_path )
+{
+  KExtendedSocket ks(QString::null, _path, KExtendedSocket::unixSocket);
+
+  ks.connect();
+  sock = ks.fd();
+  ks.release();
+
+  return sock >= 0;
+}
+
+
+
+
+bool KSocket::connect( const QString& _host, unsigned short int _port, int _timeout )
+{
+  KExtendedSocket ks(_host, _port, KExtendedSocket::inetSocket);
+  ks.setTimeout(_timeout, 0);
+
+  ks.connect();
+  sock = ks.fd();
+  ks.release();
+
+  return sock >= 0;
+}
+
+
+
+unsigned long KSocket::ipv4_addr()
+{
+  unsigned long retval = 0;
+  KSocketAddress *sa = KExtendedSocket::peerAddress(sock);
+  if (sa == __null)
+    return 0;
+
+  if (sa->address() != __null && (sa->address()->sa_family == 2
+
+                                || sa->address()->sa_family == 10
+
+      ))
+    {
+      KInetSocketAddress *ksin = (KInetSocketAddress*)sa;
+      const sockaddr_in *sin = ksin->addressV4();
+      if (sin != __null)
+        retval = *(unsigned long*)&sin->sin_addr;
+    }
+  delete sa;
+  return retval;
+}
+
+bool KSocket::initSockaddr (ksockaddr_in *server_name, const char *hostname, unsigned short int port, int domain)
+{
+
+
+
+  kdWarning(170) << "deprecated KSocket::initSockaddr called" << endl;
+
+  if (domain != 2)
+    return false;
+
+  QPtrList<KAddressInfo> list = KExtendedSocket::lookup(hostname, QString::number(port),
+                                                        KExtendedSocket::ipv4Socket);
+  list.setAutoDelete(true);
+
+  if (list.isEmpty())
+    return false;
+
+  memset(server_name, 0, sizeof(*server_name));
+
+
+  KInetSocketAddress *sin = (KInetSocketAddress*)list.getFirst()->address();
+  if (sin == __null)
+    return false;
+
+  memcpy(server_name, sin->addressV4(), sizeof(*server_name));
+  kdDebug(170) << "KSocket::initSockaddr: returning " << sin->pretty() << endl;
+  return true;
+}
+
+
+
+KSocket::~KSocket()
+{
+
+  delete d->readNotifier;
+  delete d->writeNotifier;
+
+  delete d;
+
+  if (sock != -1) {
+    ::close( sock );
+  }
+}
+
+class KServerSocketPrivate
+{
+public:
+   bool bind;
+   QCString path;
+   unsigned short int port;
+   KExtendedSocket *ks;
+};
+
+
+KServerSocket::KServerSocket( const char *_path, bool _bind ) :
+  sock( -1 )
+{
+  d = new KServerSocketPrivate();
+  d->bind = _bind;
+
+  init ( _path );
+}
+
+KServerSocket::KServerSocket( unsigned short int _port, bool _bind ) :
+  sock( -1 )
+{
+  d = new KServerSocketPrivate();
+  d->bind = _bind;
+
+  init ( _port );
+}
+
+bool KServerSocket::init( const char *_path )
+{
+  unlink(_path );
+  d->path = _path;
+
+  KExtendedSocket *ks = new KExtendedSocket(QString::null, _path, KExtendedSocket::passiveSocket |
+                                            KExtendedSocket::unixSocket);
+  d->ks = ks;
+
+  if (d->bind)
+    return bindAndListen();
+  return true;
+}
+
+
+bool KServerSocket::init( unsigned short int _port )
+{
+  d->port = _port;
+  KExtendedSocket *ks;
+  ks = new KExtendedSocket(QString::null, _port, KExtendedSocket::passiveSocket |
+                           KExtendedSocket::inetSocket);
+  d->ks = ks;
+
+  if (d->bind)
+    return bindAndListen();
+  return true;
+}
+
+bool KServerSocket::bindAndListen()
+{
+  if (d == __null || d->ks == __null)
+    return false;
+
+
+  int ret = d->ks->listen( 128 );
+  if (ret < 0)
+    {
+        kdWarning(170) << "Error listening on socket: " << ret << "\n";
+        delete d->ks;
+        d->ks = __null;
+        sock = -1;
+        return false;
+    }
+
+
+  sock = d->ks->fd();
+
+  connect( d->ks->readNotifier(), "2""activated(int)", this, "1""slotAccept(int)" );
+  return true;
+}
+
+
+unsigned short int KServerSocket::port()
+{
+  if (d == __null || d->ks == __null || sock == -1)
+    return 0;
+  const KSocketAddress *sa = d->ks->localAddress();
+  if (sa == __null)
+    return 0;
+
+
+  sockaddr_in *sin = (sockaddr_in*)sa->address();
+
+  if (sin->sin_family == 2)
+
+    return sin->sin_port;
+
+  else if (sin->sin_family == 10)
+    {
+      kde_sockaddr_in6 *sin6 = (kde_sockaddr_in6*)sin;
+      return sin6->sin6_port;
+    }
+
+  return 0;
+}
+
+unsigned long KServerSocket::ipv4_addr()
+{
+  if (d == __null || d->ks == __null || sock == -1)
+    return 0;
+  const KSocketAddress *sa = d->ks->localAddress();
+
+  const sockaddr_in *sin = (sockaddr_in*)sa->address();
+
+  if (sin->sin_family == 2)
+
+    return ntohl(*(unsigned long*)&sin->sin_addr);
+
+  else if (sin->sin_family == 10)
+    {
+      KInetSocketAddress *ksin = (KInetSocketAddress*)sa;
+      sin = ksin->addressV4();
+      if (sin != __null)
+        return *(unsigned long*)&sin->sin_addr;
+    }
+
+  return 0;
+}
+
+void KServerSocket::slotAccept( int )
+{
+  if (d == __null || d->ks == __null || sock == -1)
+    return;
+
+  KExtendedSocket *s;
+  if (d->ks->accept(s) < 0)
+    {
+        kdWarning(170) << "Error accepting\n";
+        return;
+    }
+
+  int new_sock = s->fd();
+  s->release();
+  delete s;
+
+  accepted( new KSocket( new_sock ) );
+}
+
+KServerSocket::~KServerSocket()
+{
+  if (d != __null)
+    {
+      if (d->ks != __null)
+        delete d->ks;
+      delete d;
+    }
+
+
+}
+
+const char *KSocket::className() const
+{
+    return "KSocket";
+}
+
+QMetaObject *KSocket::metaObj = 0;
+static QMetaObjectCleanUp cleanUp_KSocket( "KSocket", &KSocket::staticMetaObject );
+QMetaObject* KSocket::staticMetaObject()
+{
+    if ( metaObj )
+        return metaObj;
+    QMetaObject* parentObject = QObject::staticMetaObject();
+    static const QUParameter param_slot_0[] = {
+        { "x", &static_QUType_int, 0, QUParameter::In }
+    };
+    static const QUMethod slot_0 = {"slotWrite", 1, param_slot_0 };
+    static const QUParameter param_slot_1[] = {
+        { "x", &static_QUType_int, 0, QUParameter::In }
+    };
+    static const QUMethod slot_1 = {"slotRead", 1, param_slot_1 };
+    static const QMetaData slot_tbl[] = {
+        { "slotWrite(int)", &slot_0, QMetaData::Public },
+        { "slotRead(int)", &slot_1, QMetaData::Public }
+    };
+    static const QUParameter param_signal_0[] = {
+        { "s", &static_QUType_ptr, "KSocket", QUParameter::In }
+    };
+    static const QUMethod signal_0 = {"readEvent", 1, param_signal_0 };
+    static const QUParameter param_signal_1[] = {
+        { "s", &static_QUType_ptr, "KSocket", QUParameter::In }
+    };
+    static const QUMethod signal_1 = {"writeEvent", 1, param_signal_1 };
+    static const QUParameter param_signal_2[] = {
+        { "s", &static_QUType_ptr, "KSocket", QUParameter::In }
+    };
+    static const QUMethod signal_2 = {"closeEvent", 1, param_signal_2 };
+    static const QMetaData signal_tbl[] = {
+        { "readEvent(KSocket*)", &signal_0, QMetaData::Public },
+        { "writeEvent(KSocket*)", &signal_1, QMetaData::Public },
+        { "closeEvent(KSocket*)", &signal_2, QMetaData::Public }
+    };
+    metaObj = QMetaObject::new_metaobject(
+        "KSocket", parentObject,
+        slot_tbl, 2,
+        signal_tbl, 3,
+
+        0, 0,
+        0, 0,
+
+        0, 0 );
+    cleanUp_KSocket.setMetaObject( metaObj );
+    return metaObj;
+}
+
+void* KSocket::qt_cast( const char* clname )
+{
+    if ( !qstrcmp( clname, "KSocket" ) )
+        return this;
+    return QObject::qt_cast( clname );
+}
+
+
+
+
+
+void KSocket::readEvent( KSocket* t0 )
+{
+    if ( signalsBlocked() )
+        return;
+    QConnectionList *clist = receivers( staticMetaObject()->signalOffset() + 0 );
+    if ( !clist )
+        return;
+    QUObject o[2];
+    static_QUType_ptr.set(o+1,t0);
+    activate_signal( clist, o );
+}
+
+
+void KSocket::writeEvent( KSocket* t0 )
+{
+    if ( signalsBlocked() )
+        return;
+    QConnectionList *clist = receivers( staticMetaObject()->signalOffset() + 1 );
+    if ( !clist )
+        return;
+    QUObject o[2];
+    static_QUType_ptr.set(o+1,t0);
+    activate_signal( clist, o );
+}
+
+
+void KSocket::closeEvent( KSocket* t0 )
+{
+    if ( signalsBlocked() )
+        return;
+    QConnectionList *clist = receivers( staticMetaObject()->signalOffset() + 2 );
+    if ( !clist )
+        return;
+    QUObject o[2];
+    static_QUType_ptr.set(o+1,t0);
+    activate_signal( clist, o );
+}
+
+bool KSocket::qt_invoke( int _id, QUObject* _o )
+{
+    switch ( _id - staticMetaObject()->slotOffset() ) {
+    case 0: slotWrite((int)static_QUType_int.get(_o+1)); break;
+    case 1: slotRead((int)static_QUType_int.get(_o+1)); break;
+    default:
+        return QObject::qt_invoke( _id, _o );
+    }
+    return TRUE;
+}
+
+bool KSocket::qt_emit( int _id, QUObject* _o )
+{
+    switch ( _id - staticMetaObject()->signalOffset() ) {
+    case 0: readEvent((KSocket*)static_QUType_ptr.get(_o+1)); break;
+    case 1: writeEvent((KSocket*)static_QUType_ptr.get(_o+1)); break;
+    case 2: closeEvent((KSocket*)static_QUType_ptr.get(_o+1)); break;
+    default:
+        return QObject::qt_emit(_id,_o);
+    }
+    return TRUE;
+}
+
+
+bool KSocket::qt_property( int id, int f, QVariant* v)
+{
+    return QObject::qt_property( id, f, v);
+}
+
+bool KSocket::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; }
+
+
+
+const char *KServerSocket::className() const
+{
+    return "KServerSocket";
+}
+
+QMetaObject *KServerSocket::metaObj = 0;
+static QMetaObjectCleanUp cleanUp_KServerSocket( "KServerSocket", &KServerSocket::staticMetaObject );
+QMetaObject* KServerSocket::staticMetaObject()
+{
+    if ( metaObj )
+        return metaObj;
+    QMetaObject* parentObject = QObject::staticMetaObject();
+    static const QUParameter param_slot_0[] = {
+        { 0, &static_QUType_int, 0, QUParameter::In }
+    };
+    static const QUMethod slot_0 = {"slotAccept", 1, param_slot_0 };
+    static const QMetaData slot_tbl[] = {
+        { "slotAccept(int)", &slot_0, QMetaData::Public }
+    };
+    static const QUParameter param_signal_0[] = {
+        { "s", &static_QUType_ptr, "KSocket", QUParameter::In }
+    };
+    static const QUMethod signal_0 = {"accepted", 1, param_signal_0 };
+    static const QMetaData signal_tbl[] = {
+        { "accepted(KSocket*)", &signal_0, QMetaData::Public }
+    };
+    metaObj = QMetaObject::new_metaobject(
+        "KServerSocket", parentObject,
+        slot_tbl, 1,
+        signal_tbl, 1,
+
+        0, 0,
+        0, 0,
+
+        0, 0 );
+    cleanUp_KServerSocket.setMetaObject( metaObj );
+    return metaObj;
+}
+
+void* KServerSocket::qt_cast( const char* clname )
+{
+    if ( !qstrcmp( clname, "KServerSocket" ) )
+        return this;
+    return QObject::qt_cast( clname );
+}
+
+
+void KServerSocket::accepted( KSocket* t0 )
+{
+    if ( signalsBlocked() )
+        return;
+    QConnectionList *clist = receivers( staticMetaObject()->signalOffset() + 0 );
+    if ( !clist )
+        return;
+    QUObject o[2];
+    static_QUType_ptr.set(o+1,t0);
+    activate_signal( clist, o );
+}
+
+bool KServerSocket::qt_invoke( int _id, QUObject* _o )
+{
+    switch ( _id - staticMetaObject()->slotOffset() ) {
+    case 0: slotAccept((int)static_QUType_int.get(_o+1)); break;
+    default:
+        return QObject::qt_invoke( _id, _o );
+    }
+    return TRUE;
+}
+
+bool KServerSocket::qt_emit( int _id, QUObject* _o )
+{
+    switch ( _id - staticMetaObject()->signalOffset() ) {
+    case 0: accepted((KSocket*)static_QUType_ptr.get(_o+1)); break;
+    default:
+        return QObject::qt_emit(_id,_o);
+    }
+    return TRUE;
+}
+
+
+bool KServerSocket::qt_property( int id, int f, QVariant* v)
+{
+    return QObject::qt_property( id, f, v);
+}
+
+bool KServerSocket::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; }
+
+struct KPtyPrivate;
+class KPty {
+
+public:
+
+
+
+
+  KPty();
+
+
+
+
+
+
+
+  ~KPty();
+
+
+
+
+
+
+  bool open();
+
+
+
+
+  void close();
+
+
+
+
+
+  void setCTty();
+  void login(const char *user = 0, const char *remotehost = 0);
+
+
+
+
+  void logout();
+  void setWinSize(int lines, int columns);
+  void setXonXoff(bool useXonXoff);
+
+
+
+
+
+
+  const char *ttyName() const;
+
+
+
+
+
+
+  int masterFd() const;
+
+
+
+
+
+
+  int slaveFd() const;
+
+private:
+  bool chownpty(bool grant);
+
+  KPtyPrivate *d;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C"
+
+int mkstemps(char *, int);
+extern "C"
+
+unsigned long strlcat(char*, const char*, unsigned long);
+
+
+
+
+
+
+extern "C"
+
+unsigned long strlcpy(char*, const char*, unsigned long);
+
+
+
+
+
+
+
+extern "C" {
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct winsize
+  {
+    unsigned short int ws_row;
+    unsigned short int ws_col;
+    unsigned short int ws_xpixel;
+    unsigned short int ws_ypixel;
+  };
+
+struct termio
+  {
+    unsigned short int c_iflag;
+    unsigned short int c_oflag;
+    unsigned short int c_cflag;
+    unsigned short int c_lflag;
+    unsigned char c_line;
+    unsigned char c_cc[8];
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern int ioctl (int __fd, unsigned long int __request, ...) throw ();
+
+}
+
+
+
+
+
+
+
+typedef long int __t_scalar_t;
+typedef unsigned long int __t_uscalar_t;
+typedef __t_uscalar_t t_uscalar_t;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+struct bandinfo
+  {
+    unsigned char bi_pri;
+    int bi_flag;
+  };
+
+struct strbuf
+  {
+    int maxlen;
+    int len;
+    char *buf;
+  };
+
+struct strpeek
+  {
+    struct strbuf ctlbuf;
+    struct strbuf databuf;
+    t_uscalar_t flags;
+  };
+
+struct strfdinsert
+  {
+    struct strbuf ctlbuf;
+    struct strbuf databuf;
+    t_uscalar_t flags;
+    int fildes;
+    int offset;
+  };
+
+struct strioctl
+  {
+    int ic_cmd;
+    int ic_timout;
+    int ic_len;
+    char *ic_dp;
+  };
+
+struct strrecvfd
+  {
+    int fd;
+    uid_t uid;
+    gid_t gid;
+    char __fill[8];
+  };
+
+
+struct str_mlist
+  {
+    char l_name[8 + 1];
+  };
+
+struct str_list
+  {
+    int sl_nmods;
+    struct str_mlist *sl_modlist;
+  };
+
+
+extern "C" {
+
+
+extern int isastream (int __fildes) throw ();
+
+
+extern int getmsg (int __fildes, struct strbuf *__restrict __ctlptr,
+                   struct strbuf *__restrict __dataptr,
+                   int *__restrict __flagsp) throw ();
+
+
+
+extern int getpmsg (int __fildes, struct strbuf *__restrict __ctlptr,
+                    struct strbuf *__restrict __dataptr,
+                    int *__restrict __bandp, int *__restrict __flagsp)
+     throw ();
+
+
+
+
+extern int ioctl (int __fd, unsigned long int __request, ...) throw ();
+
+
+extern int putmsg (int __fildes, __const struct strbuf *__ctlptr,
+                   __const struct strbuf *__dataptr, int __flags) throw ();
+
+
+extern int putpmsg (int __fildes, __const struct strbuf *__ctlptr,
+                    __const struct strbuf *__dataptr, int __band, int __flags)
+     throw ();
+
+
+
+extern int fattach (int __fildes, __const char *__path) throw ();
+
+
+extern int fdetach (__const char *__path) throw ();
+
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C" {
+
+
+
+
+struct group
+  {
+    char *gr_name;
+    char *gr_passwd;
+    __gid_t gr_gid;
+    char **gr_mem;
+  };
+
+
+
+
+
+
+
+
+
+extern void setgrent (void) throw ();
+
+
+extern void endgrent (void) throw ();
+
+
+extern struct group *getgrent (void) throw ();
+
+
+
+
+extern struct group *fgetgrent (FILE *__stream) throw ();
+
+
+
+
+extern int putgrent (__const struct group *__restrict __p,
+                     FILE *__restrict __f) throw ();
+
+
+
+extern struct group *getgrgid (__gid_t __gid) throw ();
+
+
+extern struct group *getgrnam (__const char *__name) throw ();
+
+
+
+
+
+
+extern int getgrent_r (struct group *__restrict __resultbuf,
+                       char *__restrict __buffer, size_t __buflen,
+                       struct group **__restrict __result) throw ();
+
+
+
+extern int getgrgid_r (__gid_t __gid, struct group *__restrict __resultbuf,
+                       char *__restrict __buffer, size_t __buflen,
+                       struct group **__restrict __result) throw ();
+
+
+extern int getgrnam_r (__const char *__restrict __name,
+                       struct group *__restrict __resultbuf,
+                       char *__restrict __buffer, size_t __buflen,
+                       struct group **__restrict __result) throw ();
+
+
+
+
+extern int fgetgrent_r (FILE *__restrict __stream,
+                        struct group *__restrict __resultbuf,
+                        char *__restrict __buffer, size_t __buflen,
+                        struct group **__restrict __result) throw ();
+
+
+
+
+
+
+
+
+
+
+extern int setgroups (size_t __n, __const __gid_t *__groups) throw ();
+
+
+
+
+extern int getgrouplist (__const char *__user, __gid_t __group,
+                         __gid_t *__groups, int *__ngroups) throw ();
+
+
+
+
+extern int initgroups (__const char *__user, __gid_t __group) throw ();
+
+
+
+}
+extern "C" {
+extern "C" {
+
+
+
+typedef unsigned char cc_t;
+typedef unsigned int speed_t;
+typedef unsigned int tcflag_t;
+
+struct termios
+  {
+    tcflag_t c_iflag;
+    tcflag_t c_oflag;
+    tcflag_t c_cflag;
+    tcflag_t c_lflag;
+    cc_t c_line;
+    cc_t c_cc[32];
+    speed_t c_ispeed;
+    speed_t c_ospeed;
+  };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern speed_t cfgetospeed (__const struct termios *__termios_p) throw ();
+
+
+extern speed_t cfgetispeed (__const struct termios *__termios_p) throw ();
+
+
+extern int cfsetospeed (struct termios *__termios_p, speed_t __speed) throw ();
+
+
+extern int cfsetispeed (struct termios *__termios_p, speed_t __speed) throw ();
+
+
+
+extern int cfsetspeed (struct termios *__termios_p, speed_t __speed) throw ();
+
+
+
+
+extern int tcgetattr (int __fd, struct termios *__termios_p) throw ();
+
+
+
+extern int tcsetattr (int __fd, int __optional_actions,
+                      __const struct termios *__termios_p) throw ();
+
+
+
+
+extern void cfmakeraw (struct termios *__termios_p) throw ();
+
+
+
+extern int tcsendbreak (int __fd, int __duration) throw ();
+
+
+extern int tcdrain (int __fd) throw ();
+
+
+
+extern int tcflush (int __fd, int __queue_selector) throw ();
+
+
+
+extern int tcflow (int __fd, int __action) throw ();
+
+
+
+
+extern __pid_t tcgetsid (int __fd) throw ();
+
+
+
+
+
+
+}
+}
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C" {
+
+
+
+
+extern int openpty (int *__amaster, int *__aslave, char *__name,
+                    struct termios *__termp, struct winsize *__winp) throw ();
+
+
+
+extern int forkpty (int *__amaster, char *__name,
+                    struct termios *__termp, struct winsize *__winp) throw ();
+
+}
+
+
+
+
+
+class KProcess_Utmp : public KProcess
+{
+public:
+   int commSetupDoneC()
+   {
+     dup2(cmdFd, 0);
+     dup2(cmdFd, 1);
+     dup2(cmdFd, 3);
+     return 1;
+   }
+   int cmdFd;
+};
+
+
+
+
+
+
+
+
+struct KPtyPrivate {
+   KPtyPrivate() :
+     xonXoff(false), needGrantPty(false),
+     masterFd(-1), slaveFd(-1)
+   {
+     memset(&winSize, 0, sizeof(winSize));
+     winSize.ws_row = 24;
+     winSize.ws_col = 80;
+   }
+
+   bool xonXoff : 1;
+   bool needGrantPty : 1;
+   int masterFd;
+   int slaveFd;
+   struct winsize winSize;
+
+   QCString ttyName;
+};
+
+
+
+
+
+KPty::KPty()
+{
+  d = new KPtyPrivate;
+}
+
+KPty::~KPty()
+{
+  close();
+  delete d;
+}
+
+bool KPty::open()
+{
+  if (d->masterFd >= 0)
+    return true;
+
+  QCString ptyName;
+
+  d->needGrantPty = true;
+    if (openpty(&d->masterFd, &d->slaveFd, __null, __null, __null) == 0)
+    {
+      d->ttyName = ttyname(d->slaveFd);
+
+      d->needGrantPty = false;
+
+
+      struct group* p = getgrnam("tty");
+      gid_t gid = p ? p->gr_gid : getgid ();
+
+      if (fchown(d->slaveFd, (uid_t) -1, gid) < 0)
+      {
+         int e = (*__errno_location ());
+         d->needGrantPty = true;
+         kdWarning(175) << "Cannot chown " << d->ttyName << endl
+                        << "Reason " << strerror(e) << endl;
+      }
+      else if (fchmod(d->slaveFd, 0400|0200|(0200 >> 3)) < 0)
+      {
+         int e = (*__errno_location ());
+         d->needGrantPty = true;
+         kdWarning(175) << "Cannot chmod " << d->ttyName << endl
+                        << "Reason " << strerror(e) << endl;
+      }
+      goto gotpty;
+    }
+
+
+
+
+
+
+
+    d->masterFd = ::open("/dev/ptmx",02);
+
+    if (d->masterFd >= 0)
+    {
+      char *ptsn = ptsname(d->masterFd);
+      if (ptsn) {
+          d->ttyName = ptsn;
+          grantpt(d->masterFd);
+          d->needGrantPty = false;
+          goto gotpty;
+      } else {
+          ::close(d->masterFd);
+          d->masterFd = -1;
+      }
+    }
+
+
+
+    for (const char* s3 = "pqrstuvwxyzabcdefghijklmno"; *s3 != 0; s3++)
+    {
+      for (const char* s4 = "0123456789abcdefghijklmnopqrstuvwxyz"; *s4 != 0; s4++)
+      {
+        ptyName.sprintf("/dev/pty%c%c", *s3, *s4);
+        d->ttyName.sprintf("/dev/tty%c%c", *s3, *s4);
+
+
+
+        d->masterFd = ::open(ptyName.data(), 02);
+        if (d->masterFd >= 0)
+        {
+          if (geteuid() == 0 || access(d->ttyName.data(),4|2) == 0)
+            goto gotpty;
+          ::close(d->masterFd);
+          d->masterFd = -1;
+        }
+      }
+    }
+
+    kdWarning(175) << "Can't open a pseudo teletype" << endl;
+    return false;
+
+ gotpty:
+  if (!chownpty(true))
+  {
+    kdWarning(175)
+      << "chownpty failed for device " << ptyName << "::" << d->ttyName
+      << "\nThis means the communication can be eavesdropped." << endl;
+  }
+
+
+
+
+  unlockpt(d->masterFd);
+
+
+  if (d->slaveFd < 0) {
+    d->slaveFd = ::open(d->ttyName, 02);
+    if (d->slaveFd < 0)
+    {
+      kdWarning(175) << "Can't open slave pseudo teletype" << endl;
+      ::close(d->masterFd);
+      d->masterFd = -1;
+      return false;
+    }
+  }
+  struct ::termios ttmode;
+
+  ioctl(d->slaveFd, 0x5401, (char *)&ttmode);
+
+  if (!d->xonXoff)
+    ttmode.c_iflag &= ~(0010000 | 0002000);
+  else
+    ttmode.c_iflag |= (0010000 | 0002000);
+
+  ttmode.c_cc[0] = ('C' - '@'&037);
+  ttmode.c_cc[1] = ('\\' - '@'&037);
+  ttmode.c_cc[2] = 0177;
+
+  ioctl(d->slaveFd, 0x5402, (char *)&ttmode);
+
+
+  ioctl(d->slaveFd, 0x5414, (char *)&d->winSize);
+
+  fcntl(d->masterFd, 2, 1);
+  fcntl(d->slaveFd, 2, 1);
+
+  return true;
+}
+
+void KPty::close()
+{
+   if (d->masterFd < 0)
+      return;
+   chownpty(false);
+   ::close(d->slaveFd);
+   ::close(d->masterFd);
+   d->masterFd = d->slaveFd = -1;
+}
+
+void KPty::setCTty()
+{
+
+
+
+
+    setsid();
+
+
+
+    ioctl(d->slaveFd, 0x540E, 0);
+
+
+
+
+
+
+    int pgrp = getpid();
+
+    tcsetpgrp (d->slaveFd, pgrp);
+
+
+
+}
+
+void KPty::login(const char *user, const char *remotehost)
+{
+    (void)user;;
+    (void)remotehost;;
+
+}
+
+void KPty::logout()
+{
+}
+
+void KPty::setWinSize(int lines, int columns)
+{
+  d->winSize.ws_row = (unsigned short)lines;
+  d->winSize.ws_col = (unsigned short)columns;
+  if (d->masterFd >= 0)
+    ioctl( d->masterFd, 0x5414, (char *)&d->winSize );
+}
+
+void KPty::setXonXoff(bool useXonXoff)
+{
+  d->xonXoff = useXonXoff;
+  if (d->masterFd >= 0) {
+
+
+
+    struct ::termios ttmode;
+
+    ioctl(d->masterFd, 0x5401, (char *)&ttmode);
+
+    if (!useXonXoff)
+      ttmode.c_iflag &= ~(0010000 | 0002000);
+    else
+      ttmode.c_iflag |= (0010000 | 0002000);
+
+    ioctl(d->masterFd, 0x5402, (char *)&ttmode);
+  }
+}
+
+const char *KPty::ttyName() const
+{
+    return d->ttyName.data();
+}
+
+int KPty::masterFd() const
+{
+    return d->masterFd;
+}
+
+int KPty::slaveFd() const
+{
+    return d->slaveFd;
+}
+
+
+bool KPty::chownpty(bool grant)
+{
+  if (!d->needGrantPty)
+    return true;
+
+
+  pid_t pid = fork();
+  if (pid == 0)
+  {
+
+    if (d->masterFd != 3 &&
+        dup2(d->masterFd , 3) < 0)
+      exit(1);
+    QString path = locate("exe", "kgrantpty");
+    execle(path.ascii(), "kgrantpty", grant?"--grant":"--revoke", (void *)0,
+        __null);
+    exit(1);
+  }
+  else if (pid > 0)
+  {
+    int w;
+
+retry:
+    int rc = waitpid(pid, &w, 0);
+    if ((rc == -1) && ((*__errno_location ()) == 4))
+      goto retry;
+
+    return (rc != -1 && ((((*(int *) &(w))) & 0x7f) == 0) && ((((*(int *) &(w))) & 0xff00) >> 8) == 0);
+  }
+
+  return false;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C"
+
+int mkstemps(char *, int);
+extern "C"
+
+unsigned long strlcat(char*, const char*, unsigned long);
+
+
+
+
+
+
+extern "C"
+
+unsigned long strlcpy(char*, const char*, unsigned long);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (__const char *__assertion, __const char *__file,
+                           unsigned int __line, __const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, __const char *__file,
+                                  unsigned int __line,
+                                  __const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+
+
+class KProcessPrivate {
+public:
+   KProcessPrivate() :
+     usePty(KProcess::NoCommunication),
+     addUtmp(false), useShell(false),
+     pty(0), priority(0)
+   {
+   }
+
+   KProcess::Communication usePty;
+   bool addUtmp : 1;
+   bool useShell : 1;
+
+   KPty *pty;
+   const char *user;
+
+   int priority;
+
+   QMap<QString,QString> env;
+   QString wd;
+   QCString shell;
+   QCString executable;
+};
+
+
+
+
+
+KProcess::KProcess( QObject* parent, const char *name )
+  : QObject( parent, name ),
+    run_mode(NotifyOnExit),
+    runs(false),
+    pid_(0),
+    status(0),
+    keepPrivs(false),
+    innot(0),
+    outnot(0),
+    errnot(0),
+    communication(NoCommunication),
+    input_data(0),
+    input_sent(0),
+    input_total(0)
+{
+  KProcessController::ref();
+  KProcessController::theKProcessController->addKProcess(this);
+
+  d = new KProcessPrivate;
+
+  out[0] = out[1] = -1;
+  in[0] = in[1] = -1;
+  err[0] = err[1] = -1;
+}
+
+KProcess::KProcess()
+  : QObject(),
+    run_mode(NotifyOnExit),
+    runs(false),
+    pid_(0),
+    status(0),
+    keepPrivs(false),
+    innot(0),
+    outnot(0),
+    errnot(0),
+    communication(NoCommunication),
+    input_data(0),
+    input_sent(0),
+    input_total(0)
+{
+  KProcessController::ref();
+  KProcessController::theKProcessController->addKProcess(this);
+
+  d = new KProcessPrivate;
+
+  out[0] = out[1] = -1;
+  in[0] = in[1] = -1;
+  err[0] = err[1] = -1;
+}
+
+void
+KProcess::setEnvironment(const QString &name, const QString &value)
+{
+   d->env.insert(name, value);
+}
+
+void
+KProcess::setWorkingDirectory(const QString &dir)
+{
+   d->wd = dir;
+}
+
+void
+KProcess::setupEnvironment()
+{
+   QMap<QString,QString>::Iterator it;
+   for(it = d->env.begin(); it != d->env.end(); ++it)
+   {
+      setenv(QFile::encodeName(it.key()).data(),
+             QFile::encodeName(it.data()).data(), 1);
+   }
+   if (!d->wd.isEmpty())
+   {
+      chdir(QFile::encodeName(d->wd).data());
+   }
+}
+
+void
+KProcess::setRunPrivileged(bool keepPrivileges)
+{
+   keepPrivs = keepPrivileges;
+}
+
+bool
+KProcess::runPrivileged() const
+{
+   return keepPrivs;
+}
+
+bool
+KProcess::setPriority(int prio)
+{
+    if (runs) {
+        if (setpriority(PRIO_PROCESS, pid_, prio))
+            return false;
+    } else {
+        if (prio > 19 || prio < (geteuid() ? getpriority(PRIO_PROCESS, 0) : -20))
+            return false;
+    }
+    d->priority = prio;
+    return true;
+}
+
+KProcess::~KProcess()
+{
+  if (run_mode != DontCare)
+    kill(9);
+  detach();
+
+  delete d->pty;
+  delete d;
+
+  KProcessController::theKProcessController->removeKProcess(this);
+  KProcessController::deref();
+}
+
+void KProcess::detach()
+{
+  if (runs) {
+    KProcessController::theKProcessController->addProcess(pid_);
+    runs = false;
+    pid_ = 0;
+    commClose();
+  }
+}
+
+void KProcess::setBinaryExecutable(const char *filename)
+{
+   d->executable = filename;
+}
+
+bool KProcess::setExecutable(const QString& proc)
+{
+  if (runs) return false;
+
+  if (proc.isEmpty()) return false;
+
+  if (!arguments.isEmpty())
+     arguments.remove(arguments.begin());
+  arguments.prepend(QFile::encodeName(proc));
+
+  return true;
+}
+
+KProcess &KProcess::operator<<(const QStringList& args)
+{
+  QStringList::ConstIterator it = args.begin();
+  for ( ; it != args.end() ; ++it )
+      arguments.append(QFile::encodeName(*it));
+  return *this;
+}
+
+KProcess &KProcess::operator<<(const QCString& arg)
+{
+  return operator<< (arg.data());
+}
+
+KProcess &KProcess::operator<<(const char* arg)
+{
+  arguments.append(arg);
+  return *this;
+}
+
+KProcess &KProcess::operator<<(const QString& arg)
+{
+  arguments.append(QFile::encodeName(arg));
+  return *this;
+}
+
+void KProcess::clearArguments()
+{
+  arguments.clear();
+}
+
+bool KProcess::start(RunMode runmode, Communication comm)
+{
+  if (runs) {
+    kdDebug(175) << "Attempted to start an already running process" << endl;
+    return false;
+  }
+
+  uint n = arguments.count();
+  if (n == 0) {
+    kdDebug(175) << "Attempted to start a process without arguments" << endl;
+    return false;
+  }
+  char **arglist;
+  QCString shellCmd;
+  if (d->useShell)
+  {
+      if (d->shell.isEmpty()) {
+        kdDebug(175) << "Invalid shell specified" << endl;
+        return false;
+      }
+
+      for (uint i = 0; i < n; i++) {
+          shellCmd += arguments[i];
+          shellCmd += " ";
+      }
+
+      arglist = static_cast<char **>(malloc( 4 * sizeof(char *)));
+      arglist[0] = d->shell.data();
+      arglist[1] = (char *) "-c";
+      arglist[2] = shellCmd.data();
+      arglist[3] = 0;
+  }
+  else
+  {
+      arglist = static_cast<char **>(malloc( (n + 1) * sizeof(char *)));
+      for (uint i = 0; i < n; i++)
+         arglist[i] = arguments[i].data();
+      arglist[n] = 0;
+  }
+
+  run_mode = runmode;
+
+  if (!setupCommunication(comm))
+  {
+      kdDebug(175) << "Could not setup Communication!" << endl;
+      free(arglist);
+      return false;
+  }
+
+
+
+
+  struct passwd *pw = geteuid() ? 0 : getpwuid(getuid());
+
+
+  int fd[2];
+  if (pipe(fd))
+     fd[0] = fd[1] = -1;
+
+  QApplication::flushX();
+
+
+
+
+  pid_ = fork();
+  if (pid_ == 0) {
+
+
+        close(fd[0]);
+
+        fcntl(fd[1], 2, 1);
+
+
+        struct sigaction act;
+        sigemptyset(&act.sa_mask);
+        act.__sigaction_handler.sa_handler = ((__sighandler_t) 0);
+        act.sa_flags = 0;
+        for (int sig = 1; sig < 64; sig++)
+          sigaction(sig, &act, 0L);
+
+        if (!commSetupDoneC())
+          kdDebug(175) << "Could not finish comm setup in child!" << endl;
+
+        if (d->priority)
+            setpriority(PRIO_PROCESS, 0, d->priority);
+
+        if (!runPrivileged())
+        {
+           setgid(getgid());
+
+           if (pw)
+              initgroups(pw->pw_name, pw->pw_gid);
+
+           setuid(getuid());
+        }
+
+        setupEnvironment();
+
+        if (runmode == DontCare || runmode == OwnGroup)
+          setsid();
+
+        const char *executable = arglist[0];
+        if (!d->executable.isEmpty())
+           executable = d->executable.data();
+        execvp(executable, arglist);
+
+        char resultByte = 1;
+        write(fd[1], &resultByte, 1);
+        _exit(-1);
+  } else if (pid_ == -1) {
+
+
+
+        pid_ = 0;
+        free(arglist);
+        return false;
+  }
+
+  free(arglist);
+
+  if (!commSetupDoneP())
+    kdDebug(175) << "Could not finish comm setup in parent!" << endl;
+
+
+  close(fd[1]);
+  for(;;)
+  {
+     char resultByte;
+     int n = ::read(fd[0], &resultByte, 1);
+     if (n == 1)
+     {
+
+         close(fd[0]);
+         waitpid(pid_, 0, 0);
+         pid_ = 0;
+         commClose();
+         return false;
+     }
+     if (n == -1)
+     {
+        if ((*__errno_location ()) == 4)
+           continue;
+     }
+     break;
+  }
+  close(fd[0]);
+
+  runs = true;
+  switch (runmode)
+  {
+  case Block:
+    for (;;)
+    {
+      commClose();
+      if (!runs)
+      {
+
+        KProcessController::theKProcessController->unscheduleCheck();
+        if (waitpid(pid_, &status, 1) != 0)
+        {
+          commClose();
+          KProcessController::theKProcessController->rescheduleCheck();
+          break;
+        }
+        runs = true;
+      }
+      else
+      {
+
+
+
+        waitpid(pid_, &status, 0);
+        runs = false;
+        break;
+      }
+    }
+
+
+    processExited(this);
+    break;
+  default:
+    input_data = 0;
+    break;
+  }
+
+  return true;
+}
+
+
+
+bool KProcess::kill(int signo)
+{
+  if (runs && pid_ > 0 && !::kill(run_mode == OwnGroup ? -pid_ : pid_, signo))
+    return true;
+  return false;
+}
+
+
+
+bool KProcess::isRunning() const
+{
+  return runs;
+}
+
+
+
+pid_t KProcess::pid() const
+{
+  return pid_;
+}
+bool KProcess::wait(int timeout)
+{
+  if (!runs)
+    return true;
+
+
+
+
+  struct timeval tv, *tvp;
+  if (timeout < 0)
+    tvp = 0;
+  else
+  {
+
+
+
+
+    tv.tv_sec = timeout;
+    tv.tv_usec = 0;
+
+    tvp = &tv;
+  }
+
+  int fd = KProcessController::theKProcessController->notifierFd();
+  for(;;)
+  {
+    fd_set fds;
+    memset ((void*)&fds, 0, sizeof (fds));
+    FD_SET(fd,&fds);
+    switch( select( fd+1, &fds, 0, 0, tvp ) )
+    {
+    case -1:
+      if( (*__errno_location ()) == 4 )
+        break;
+
+    case 0:
+      KProcessController::theKProcessController->rescheduleCheck();
+      return false;
+    default:
+      KProcessController::theKProcessController->unscheduleCheck();
+      if (waitpid(pid_, &status, 1) != 0)
+      {
+        processHasExited(status);
+        KProcessController::theKProcessController->rescheduleCheck();
+        return true;
+      }
+    }
+  }
+}
+
+
+
+bool KProcess::normalExit() const
+{
+  return (pid_ != 0) && !runs && ((((*(int *) &(status))) & 0x7f) == 0);
+}
+
+
+
+int KProcess::exitStatus() const
+{
+  return ((((*(int *) &(status))) & 0xff00) >> 8);
+}
+
+
+
+bool KProcess::writeStdin(const char *buffer, int buflen)
+{
+
+
+
+  if (input_data != 0)
+    return false;
+
+  if (communication & Stdin) {
+    input_data = buffer;
+    input_sent = 0;
+    input_total = buflen;
+    innot->setEnabled(true);
+    if (input_total)
+       slotSendData(0);
+    return true;
+  } else
+    return false;
+}
+
+void KProcess::suspend()
+{
+  if (outnot)
+     outnot->setEnabled(false);
+}
+
+void KProcess::resume()
+{
+  if (outnot)
+     outnot->setEnabled(true);
+}
+
+bool KProcess::closeStdin()
+{
+  if (communication & Stdin) {
+    communication = (Communication) (communication & ~Stdin);
+    delete innot;
+    innot = 0;
+    if (!(d->usePty & Stdin))
+      close(in[1]);
+    in[1] = -1;
+    return true;
+  } else
+    return false;
+}
+
+bool KProcess::closeStdout()
+{
+  if (communication & Stdout) {
+    communication = (Communication) (communication & ~Stdout);
+    delete outnot;
+    outnot = 0;
+    if (!(d->usePty & Stdout))
+      close(out[0]);
+    out[0] = -1;
+    return true;
+  } else
+    return false;
+}
+
+bool KProcess::closeStderr()
+{
+  if (communication & Stderr) {
+    communication = (Communication) (communication & ~Stderr);
+    delete errnot;
+    errnot = 0;
+    if (!(d->usePty & Stderr))
+      close(err[0]);
+    err[0] = -1;
+    return true;
+  } else
+    return false;
+}
+
+bool KProcess::closePty()
+{
+  if (d->pty && d->pty->masterFd() >= 0) {
+    if (d->addUtmp)
+      d->pty->logout();
+    d->pty->close();
+    return true;
+  } else
+    return false;
+}
+
+void KProcess::closeAll()
+{
+  closeStdin();
+  closeStdout();
+  closeStderr();
+  closePty();
+}
+
+
+
+
+
+
+
+void KProcess::slotChildOutput(int fdno)
+{
+  if (!childOutput(fdno))
+     closeStdout();
+}
+
+
+void KProcess::slotChildError(int fdno)
+{
+  if (!childError(fdno))
+     closeStderr();
+}
+
+
+void KProcess::slotSendData(int)
+{
+  if (input_sent == input_total) {
+    innot->setEnabled(false);
+    input_data = 0;
+    wroteStdin(this);
+  } else
+    input_sent += ::write(in[1], input_data+input_sent, input_total-input_sent);
+}
+
+void KProcess::setUseShell(bool useShell, const char *shell)
+{
+  d->useShell = useShell;
+  d->shell = (shell && *shell) ? shell : "/bin/sh";
+}
+
+void KProcess::setUsePty(Communication usePty, bool addUtmp)
+{
+  d->usePty = usePty;
+  d->addUtmp = addUtmp;
+  if (usePty) {
+    if (!d->pty)
+      d->pty = new KPty;
+  } else {
+    delete d->pty;
+    d->pty = 0;
+  }
+}
+
+KPty *KProcess::pty() const
+{
+  return d->pty;
+}
+
+QString KProcess::quote(const QString &arg)
+{
+    QChar q('\'');
+    return QString(arg).replace(q, "'\\''").prepend(q).append(q);
+}
+
+
+
+
+
+
+
+void KProcess::processHasExited(int state)
+{
+
+
+    status = state;
+    runs = false;
+
+    commClose();
+
+    if (run_mode != DontCare)
+      processExited(this);
+}
+
+
+
+int KProcess::childOutput(int fdno)
+{
+  if (communication & NoRead) {
+     int len = -1;
+     receivedStdout(fdno, len);
+     (*__errno_location ()) = 0;
+     return len;
+  }
+  else
+  {
+     char buffer[1025];
+     int len;
+
+     len = ::read(fdno, buffer, 1024);
+
+     if (len > 0) {
+        buffer[len] = 0;
+        receivedStdout(this, buffer, len);
+     }
+     return len;
+  }
+}
+
+int KProcess::childError(int fdno)
+{
+  char buffer[1025];
+  int len;
+
+  len = ::read(fdno, buffer, 1024);
+
+  if (len > 0) {
+     buffer[len] = 0;
+     receivedStderr(this, buffer, len);
+  }
+  return len;
+}
+
+
+int KProcess::setupCommunication(Communication comm)
+{
+
+  if (d->usePty)
+  {
+
+    if (!(~(comm & d->usePty) & (Stdout | Stderr))) {
+       kdWarning(175) << "Invalid usePty/communication combination (" << d->usePty << "/" << comm << ")" << endl;
+       return 0;
+    }
+    if (!d->pty->open())
+       return 0;
+
+    int rcomm = comm & d->usePty;
+    int mfd = d->pty->masterFd();
+    if (rcomm & Stdin)
+      in[1] = mfd;
+    if (rcomm & Stdout)
+      out[0] = mfd;
+    if (rcomm & Stderr)
+      err[0] = mfd;
+
+
+    d->user = getlogin();
+    if (!d->user)
+      d->user = getenv("LOGNAME");
+  }
+
+  communication = comm;
+
+  comm = (Communication) (comm & ~d->usePty);
+  if (comm & Stdin) {
+    if (socketpair(1, SOCK_STREAM, 0, in))
+      goto fail0;
+    fcntl(in[0], 2, 1);
+    fcntl(in[1], 2, 1);
+  }
+  if (comm & Stdout) {
+    if (socketpair(1, SOCK_STREAM, 0, out))
+      goto fail1;
+    fcntl(out[0], 2, 1);
+    fcntl(out[1], 2, 1);
+  }
+  if (comm & Stderr) {
+    if (socketpair(1, SOCK_STREAM, 0, err))
+      goto fail2;
+    fcntl(err[0], 2, 1);
+    fcntl(err[1], 2, 1);
+  }
+  return 1;
+ fail2:
+  if (comm & Stdout)
+  {
+    close(out[0]);
+    close(out[1]);
+    out[0] = out[1] = -1;
+  }
+ fail1:
+  if (comm & Stdin)
+  {
+    close(in[0]);
+    close(in[1]);
+    in[0] = in[1] = -1;
+  }
+ fail0:
+  communication = NoCommunication;
+  return 0;
+}
+
+
+
+int KProcess::commSetupDoneP()
+{
+  int rcomm = communication & ~d->usePty;
+  if (rcomm & Stdin)
+    close(in[0]);
+  if (rcomm & Stdout)
+    close(out[1]);
+  if (rcomm & Stderr)
+    close(err[1]);
+  in[0] = out[1] = err[1] = -1;
+
+
+  if (run_mode != NotifyOnExit && run_mode != OwnGroup)
+    return 1;
+
+  if (communication & Stdin) {
+    innot = new QSocketNotifier(in[1], QSocketNotifier::Write, this);
+    (qt_check_pointer((innot)==0,"/coolo/prod/kdelibs/kdecore/kprocess.cpp",886));
+    innot->setEnabled(false);
+    QObject::connect(innot, "2""activated(int)",
+                     this, "1""slotSendData(int)");
+  }
+
+  if (communication & Stdout) {
+    outnot = new QSocketNotifier(out[0], QSocketNotifier::Read, this);
+    (qt_check_pointer((outnot)==0,"/coolo/prod/kdelibs/kdecore/kprocess.cpp",894));
+    QObject::connect(outnot, "2""activated(int)",
+                     this, "1""slotChildOutput(int)");
+    if (communication & NoRead)
+        suspend();
+  }
+
+  if (communication & Stderr) {
+    errnot = new QSocketNotifier(err[0], QSocketNotifier::Read, this );
+    (qt_check_pointer((errnot)==0,"/coolo/prod/kdelibs/kdecore/kprocess.cpp",903));
+    QObject::connect(errnot, "2""activated(int)",
+                     this, "1""slotChildError(int)");
+  }
+
+  return 1;
+}
+
+
+
+int KProcess::commSetupDoneC()
+{
+  int ok = 1;
+
+  if (d->usePty & Stdin) {
+    if (dup2(d->pty->slaveFd(), 0) < 0) ok = 0;
+  } else if (communication & Stdin) {
+    if (dup2(in[0], 0) < 0) ok = 0;
+  } else {
+    int null_fd = open( "/dev/null", 00 );
+    if (dup2( null_fd, 0 ) < 0) ok = 0;
+    close( null_fd );
+  }
+  struct linger so;
+  memset(&so, 0, sizeof(so));
+  if (d->usePty & Stdout) {
+    if (dup2(d->pty->slaveFd(), 1) < 0) ok = 0;
+  } else if (communication & Stdout) {
+    if (dup2(out[1], 1) < 0 ||
+        setsockopt(out[1], 1, 13, (char *)&so, sizeof(so)))
+      ok = 0;
+  }
+  if (d->usePty & Stderr) {
+    if (dup2(d->pty->slaveFd(), 2) < 0) ok = 0;
+  } else if (communication & Stderr) {
+    if (dup2(err[1], 2) < 0 ||
+        setsockopt(err[1], 1, 13, (char *)&so, sizeof(so)))
+      ok = 0;
+  }
+
+
+
+
+  if (d->usePty) {
+    d->pty->setCTty();
+    if (d->addUtmp)
+      d->pty->login(d->user, getenv("DISPLAY"));
+  }
+
+  return ok;
+}
+
+
+
+void KProcess::commClose()
+{
+  closeStdin();
+
+  if (pid_) {
+
+
+
+
+    int notfd = KProcessController::theKProcessController->notifierFd();
+
+    while ((communication & (Stdout | Stderr)) || runs) {
+      fd_set rfds;
+      memset ((void*)&rfds, 0, sizeof(rfds));
+      struct timeval timeout, *p_timeout;
+
+      int max_fd = 0;
+      if (communication & Stdout) {
+        FD_SET(out[0], &rfds);
+        max_fd = out[0];
+      }
+      if (communication & Stderr) {
+        FD_SET(err[0], &rfds);
+        if (err[0] > max_fd)
+          max_fd = err[0];
+      }
+      if (runs) {
+        FD_SET(notfd, &rfds);
+        if (notfd > max_fd)
+          max_fd = notfd;
+
+
+        p_timeout = 0;
+      } else {
+
+
+        timeout.tv_sec = timeout.tv_usec = 0;
+        p_timeout = &timeout;
+      }
+
+      int fds_ready = select(max_fd+1, &rfds, 0, 0, p_timeout);
+      if (fds_ready < 0) {
+        if ((*__errno_location ()) == 4)
+          continue;
+        break;
+      } else if (!fds_ready)
+        break;
+
+      if ((communication & Stdout) && FD_ISSET(out[0], &rfds))
+        slotChildOutput(out[0]);
+
+      if ((communication & Stderr) && FD_ISSET(err[0], &rfds))
+        slotChildError(err[0]);
+
+      if (runs && FD_ISSET (notfd, &rfds)) {
+        runs = false;
+        return;
+      }
+    }
+  }
+
+  closeStdout();
+  closeStderr();
+
+  closePty();
+}
+
+
+void KProcess::virtual_hook( int, void* )
+{ }
+
+
+
+
+
+
+KShellProcess::KShellProcess(const char *shellname):
+  KProcess()
+{
+  setUseShell( true, shellname ? shellname : getenv("SHELL") );
+}
+
+KShellProcess::~KShellProcess() {
+}
+
+QString KShellProcess::quote(const QString &arg)
+{
+    return KProcess::quote(arg);
+}
+
+bool KShellProcess::start(RunMode runmode, Communication comm)
+{
+  return KProcess::start(runmode, comm);
+}
+
+void KShellProcess::virtual_hook( int id, void* data )
+{ KProcess::virtual_hook( id, data ); }
+
+const char *KProcess::className() const
+{
+    return "KProcess";
+}
+
+QMetaObject *KProcess::metaObj = 0;
+static QMetaObjectCleanUp cleanUp_KProcess( "KProcess", &KProcess::staticMetaObject );
+QMetaObject* KProcess::staticMetaObject()
+{
+    if ( metaObj )
+        return metaObj;
+    QMetaObject* parentObject = QObject::staticMetaObject();
+    static const QUParameter param_slot_0[] = {
+        { "fdno", &static_QUType_int, 0, QUParameter::In }
+    };
+    static const QUMethod slot_0 = {"slotChildOutput", 1, param_slot_0 };
+    static const QUParameter param_slot_1[] = {
+        { "fdno", &static_QUType_int, 0, QUParameter::In }
+    };
+    static const QUMethod slot_1 = {"slotChildError", 1, param_slot_1 };
+    static const QUParameter param_slot_2[] = {
+        { "dummy", &static_QUType_int, 0, QUParameter::In }
+    };
+    static const QUMethod slot_2 = {"slotSendData", 1, param_slot_2 };
+    static const QMetaData slot_tbl[] = {
+        { "slotChildOutput(int)", &slot_0, QMetaData::Protected },
+        { "slotChildError(int)", &slot_1, QMetaData::Protected },
+        { "slotSendData(int)", &slot_2, QMetaData::Protected }
+    };
+    static const QUParameter param_signal_0[] = {
+        { "proc", &static_QUType_ptr, "KProcess", QUParameter::In }
+    };
+    static const QUMethod signal_0 = {"processExited", 1, param_signal_0 };
+    static const QUParameter param_signal_1[] = {
+        { "proc", &static_QUType_ptr, "KProcess", QUParameter::In },
+        { "buffer", &static_QUType_charstar, 0, QUParameter::In },
+        { "buflen", &static_QUType_int, 0, QUParameter::In }
+    };
+    static const QUMethod signal_1 = {"receivedStdout", 3, param_signal_1 };
+    static const QUParameter param_signal_2[] = {
+        { "fd", &static_QUType_int, 0, QUParameter::In },
+        { "len", &static_QUType_int, 0, QUParameter::InOut }
+    };
+    static const QUMethod signal_2 = {"receivedStdout", 2, param_signal_2 };
+    static const QUParameter param_signal_3[] = {
+        { "proc", &static_QUType_ptr, "KProcess", QUParameter::In },
+        { "buffer", &static_QUType_charstar, 0, QUParameter::In },
+        { "buflen", &static_QUType_int, 0, QUParameter::In }
+    };
+    static const QUMethod signal_3 = {"receivedStderr", 3, param_signal_3 };
+    static const QUParameter param_signal_4[] = {
+        { "proc", &static_QUType_ptr, "KProcess", QUParameter::In }
+    };
+    static const QUMethod signal_4 = {"wroteStdin", 1, param_signal_4 };
+    static const QMetaData signal_tbl[] = {
+        { "processExited(KProcess*)", &signal_0, QMetaData::Public },
+        { "receivedStdout(KProcess*,char*,int)", &signal_1, QMetaData::Public },
+        { "receivedStdout(int,int&)", &signal_2, QMetaData::Public },
+        { "receivedStderr(KProcess*,char*,int)", &signal_3, QMetaData::Public },
+        { "wroteStdin(KProcess*)", &signal_4, QMetaData::Public }
+    };
+    metaObj = QMetaObject::new_metaobject(
+        "KProcess", parentObject,
+        slot_tbl, 3,
+        signal_tbl, 5,
+
+        0, 0,
+        0, 0,
+
+        0, 0 );
+    cleanUp_KProcess.setMetaObject( metaObj );
+    return metaObj;
+}
+
+void* KProcess::qt_cast( const char* clname )
+{
+    if ( !qstrcmp( clname, "KProcess" ) )
+        return this;
+    return QObject::qt_cast( clname );
+}
+
+
+
+
+
+void KProcess::processExited( KProcess* t0 )
+{
+    if ( signalsBlocked() )
+        return;
+    QConnectionList *clist = receivers( staticMetaObject()->signalOffset() + 0 );
+    if ( !clist )
+        return;
+    QUObject o[2];
+    static_QUType_ptr.set(o+1,t0);
+    activate_signal( clist, o );
+}
+
+
+void KProcess::receivedStdout( KProcess* t0, char* t1, int t2 )
+{
+    if ( signalsBlocked() )
+        return;
+    QConnectionList *clist = receivers( staticMetaObject()->signalOffset() + 1 );
+    if ( !clist )
+        return;
+    QUObject o[4];
+    static_QUType_ptr.set(o+1,t0);
+    static_QUType_charstar.set(o+2,t1);
+    static_QUType_int.set(o+3,t2);
+    activate_signal( clist, o );
+}
+
+
+void KProcess::receivedStdout( int t0, int& t1 )
+{
+    if ( signalsBlocked() )
+        return;
+    QConnectionList *clist = receivers( staticMetaObject()->signalOffset() + 2 );
+    if ( !clist )
+        return;
+    QUObject o[3];
+    static_QUType_int.set(o+1,t0);
+    static_QUType_int.set(o+2,t1);
+    activate_signal( clist, o );
+    t1 = static_QUType_int.get(o+2);
+}
+
+
+void KProcess::receivedStderr( KProcess* t0, char* t1, int t2 )
+{
+    if ( signalsBlocked() )
+        return;
+    QConnectionList *clist = receivers( staticMetaObject()->signalOffset() + 3 );
+    if ( !clist )
+        return;
+    QUObject o[4];
+    static_QUType_ptr.set(o+1,t0);
+    static_QUType_charstar.set(o+2,t1);
+    static_QUType_int.set(o+3,t2);
+    activate_signal( clist, o );
+}
+
+
+void KProcess::wroteStdin( KProcess* t0 )
+{
+    if ( signalsBlocked() )
+        return;
+    QConnectionList *clist = receivers( staticMetaObject()->signalOffset() + 4 );
+    if ( !clist )
+        return;
+    QUObject o[2];
+    static_QUType_ptr.set(o+1,t0);
+    activate_signal( clist, o );
+}
+
+bool KProcess::qt_invoke( int _id, QUObject* _o )
+{
+    switch ( _id - staticMetaObject()->slotOffset() ) {
+    case 0: slotChildOutput((int)static_QUType_int.get(_o+1)); break;
+    case 1: slotChildError((int)static_QUType_int.get(_o+1)); break;
+    case 2: slotSendData((int)static_QUType_int.get(_o+1)); break;
+    default:
+        return QObject::qt_invoke( _id, _o );
+    }
+    return TRUE;
+}
+
+bool KProcess::qt_emit( int _id, QUObject* _o )
+{
+    switch ( _id - staticMetaObject()->signalOffset() ) {
+    case 0: processExited((KProcess*)static_QUType_ptr.get(_o+1)); break;
+    case 1: receivedStdout((KProcess*)static_QUType_ptr.get(_o+1),(char*)static_QUType_charstar.get(_o+2),(int)static_QUType_int.get(_o+3)); break;
+    case 2: receivedStdout((int)static_QUType_int.get(_o+1),(int&)static_QUType_int.get(_o+2)); break;
+    case 3: receivedStderr((KProcess*)static_QUType_ptr.get(_o+1),(char*)static_QUType_charstar.get(_o+2),(int)static_QUType_int.get(_o+3)); break;
+    case 4: wroteStdin((KProcess*)static_QUType_ptr.get(_o+1)); break;
+    default:
+        return QObject::qt_emit(_id,_o);
+    }
+    return TRUE;
+}
+
+
+bool KProcess::qt_property( int id, int f, QVariant* v)
+{
+    return QObject::qt_property( id, f, v);
+}
+
+bool KProcess::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; }
+
+
+
+const char *KShellProcess::className() const
+{
+    return "KShellProcess";
+}
+
+QMetaObject *KShellProcess::metaObj = 0;
+static QMetaObjectCleanUp cleanUp_KShellProcess( "KShellProcess", &KShellProcess::staticMetaObject );
+QMetaObject* KShellProcess::staticMetaObject()
+{
+    if ( metaObj )
+        return metaObj;
+    QMetaObject* parentObject = KProcess::staticMetaObject();
+    metaObj = QMetaObject::new_metaobject(
+        "KShellProcess", parentObject,
+        0, 0,
+        0, 0,
+
+        0, 0,
+        0, 0,
+
+        0, 0 );
+    cleanUp_KShellProcess.setMetaObject( metaObj );
+    return metaObj;
+}
+
+void* KShellProcess::qt_cast( const char* clname )
+{
+    if ( !qstrcmp( clname, "KShellProcess" ) )
+        return this;
+    return KProcess::qt_cast( clname );
+}
+
+bool KShellProcess::qt_invoke( int _id, QUObject* _o )
+{
+    return KProcess::qt_invoke(_id,_o);
+}
+
+bool KShellProcess::qt_emit( int _id, QUObject* _o )
+{
+    return KProcess::qt_emit(_id,_o);
+}
+
+
+bool KShellProcess::qt_property( int id, int f, QVariant* v)
+{
+    return KProcess::qt_property( id, f, v);
+}
+
+bool KShellProcess::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C"
+
+int mkstemps(char *, int);
+extern "C"
+
+unsigned long strlcat(char*, const char*, unsigned long);
+
+
+
+
+
+
+extern "C"
+
+unsigned long strlcpy(char*, const char*, unsigned long);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+KProcessController *KProcessController::theKProcessController;
+int KProcessController::refCount;
+
+void KProcessController::ref()
+{
+  if( !refCount )
+    theKProcessController = new KProcessController;
+  refCount++;
+}
+
+void KProcessController::deref()
+{
+  refCount--;
+  if( !refCount ) {
+    delete theKProcessController;
+    theKProcessController = 0;
+  }
+}
+
+KProcessController::KProcessController()
+  : needcheck( false )
+{
+  if( pipe( fd ) )
+  {
+    perror( "pipe" );
+    abort();
+  }
+
+  fcntl( fd[0], 4, 04000 );
+  fcntl( fd[1], 4, 04000 );
+  fcntl( fd[0], 2, 1 );
+  fcntl( fd[1], 2, 1 );
+
+  notifier = new QSocketNotifier( fd[0], QSocketNotifier::Read );
+  notifier->setEnabled( true );
+  QObject::connect( notifier, "2""activated(int)",
+                    "1""slotDoHousekeeping()");
+
+  setupHandlers();
+}
+
+KProcessController::~KProcessController()
+{
+  resetHandlers();
+
+  delete notifier;
+
+  close( fd[0] );
+  close( fd[1] );
+}
+
+
+struct sigaction KProcessController::oldChildHandlerData;
+bool KProcessController::handlerSet = false;
+
+void KProcessController::setupHandlers()
+{
+  if( handlerSet )
+      return;
+  handlerSet = true;
+
+  struct sigaction act;
+  sigemptyset( &act.sa_mask );
+
+  act.__sigaction_handler.sa_handler = ((__sighandler_t) 1);
+  act.sa_flags = 0;
+  sigaction( 13, &act, 0L );
+
+  act.__sigaction_handler.sa_handler = theSigCHLDHandler;
+  act.sa_flags = 1;
+
+
+
+  act.sa_flags |= 0x10000000;
+
+  sigaction( 17, &act, &oldChildHandlerData );
+
+  sigaddset( &act.sa_mask, 17 );
+
+  sigprocmask( 1, &act.sa_mask, 0 );
+}
+
+void KProcessController::resetHandlers()
+{
+  if( !handlerSet )
+      return;
+  handlerSet = false;
+
+  sigaction( 17, &oldChildHandlerData, 0 );
+
+}
+
+
+
+
+void KProcessController::theSigCHLDHandler( int arg )
+{
+  int saved_errno = (*__errno_location ());
+
+  char dummy = 0;
+  ::write( theKProcessController->fd[1], &dummy, 1 );
+
+  if( oldChildHandlerData.__sigaction_handler.sa_handler != ((__sighandler_t) 1) &&
+      oldChildHandlerData.__sigaction_handler.sa_handler != ((__sighandler_t) 0) )
+     oldChildHandlerData.__sigaction_handler.sa_handler( arg );
+
+  (*__errno_location ()) = saved_errno;
+}
+
+int KProcessController::notifierFd() const
+{
+  return fd[0];
+}
+
+void KProcessController::unscheduleCheck()
+{
+  char dummy[16];
+  if( ::read( fd[0], dummy, sizeof(dummy) ) > 0 )
+    needcheck = true;
+}
+
+void
+KProcessController::rescheduleCheck()
+{
+  if( needcheck )
+  {
+    needcheck = false;
+    char dummy = 0;
+    ::write( fd[1], &dummy, 1 );
+  }
+}
+
+void KProcessController::slotDoHousekeeping()
+{
+  char dummy[16];
+  ::read( fd[0], dummy, sizeof(dummy) );
+
+  int status;
+ again:
+  QValueListIterator<KProcess*> it( kProcessList.begin() );
+  QValueListIterator<KProcess*> eit( kProcessList.end() );
+  while( it != eit )
+  {
+    KProcess *prc = *it;
+    if( prc->runs && waitpid( prc->pid_, &status, 1 ) > 0 )
+    {
+      prc->processHasExited( status );
+
+      if (!theKProcessController)
+        return;
+      goto again;
+    }
+    ++it;
+  }
+  QValueListIterator<int> uit( unixProcessList.begin() );
+  QValueListIterator<int> ueit( unixProcessList.end() );
+  while( uit != ueit )
+  {
+    if( waitpid( *uit, 0, 1 ) > 0 )
+    {
+      uit = unixProcessList.remove( uit );
+      deref();
+    } else
+      ++uit;
+  }
+}
+
+bool KProcessController::waitForProcessExit( int timeout )
+{
+  for(;;)
+  {
+    struct timeval tv, *tvp;
+    if (timeout < 0)
+      tvp = 0;
+    else
+    {
+      tv.tv_sec = timeout;
+      tv.tv_usec = 0;
+      tvp = &tv;
+    }
+
+    fd_set fds;
+    memset ((void*)&fds, 0, sizeof(fds));
+    FD_SET(fd[0], &fds);
+
+    switch( select( fd[0]+1, &fds, 0, 0, tvp ) )
+    {
+    case -1:
+      if( (*__errno_location ()) == 4 )
+        continue;
+
+    case 0:
+      return false;
+    default:
+      slotDoHousekeeping();
+      return true;
+    }
+  }
+}
+
+void KProcessController::addKProcess( KProcess* p )
+{
+  kProcessList.append( p );
+}
+
+void KProcessController::removeKProcess( KProcess* p )
+{
+  kProcessList.remove( p );
+}
+
+void KProcessController::addProcess( int pid )
+{
+  unixProcessList.append( pid );
+  ref();
+}
+
+const char *KProcessController::className() const
+{
+    return "KProcessController";
+}
+
+QMetaObject *KProcessController::metaObj = 0;
+static QMetaObjectCleanUp cleanUp_KProcessController( "KProcessController", &KProcessController::staticMetaObject );
+QMetaObject* KProcessController::staticMetaObject()
+{
+    if ( metaObj )
+        return metaObj;
+    QMetaObject* parentObject = QObject::staticMetaObject();
+    static const QUMethod slot_0 = {"slotDoHousekeeping", 0, 0 };
+    static const QMetaData slot_tbl[] = {
+        { "slotDoHousekeeping()", &slot_0, QMetaData::Private }
+    };
+    metaObj = QMetaObject::new_metaobject(
+        "KProcessController", parentObject,
+        slot_tbl, 1,
+        0, 0,
+
+        0, 0,
+        0, 0,
+
+        0, 0 );
+    cleanUp_KProcessController.setMetaObject( metaObj );
+    return metaObj;
+}
+
+void* KProcessController::qt_cast( const char* clname )
+{
+    if ( !qstrcmp( clname, "KProcessController" ) )
+        return this;
+    return QObject::qt_cast( clname );
+}
+
+bool KProcessController::qt_invoke( int _id, QUObject* _o )
+{
+    switch ( _id - staticMetaObject()->slotOffset() ) {
+    case 0: slotDoHousekeeping(); break;
+    default:
+        return QObject::qt_invoke( _id, _o );
+    }
+    return TRUE;
+}
+
+bool KProcessController::qt_emit( int _id, QUObject* _o )
+{
+    return QObject::qt_emit(_id,_o);
+}
+
+
+bool KProcessController::qt_property( int id, int f, QVariant* v)
+{
+    return QObject::qt_property( id, f, v);
+}
+
+bool KProcessController::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C"
+
+int mkstemps(char *, int);
+extern "C"
+
+unsigned long strlcat(char*, const char*, unsigned long);
+
+
+
+
+
+
+extern "C"
+
+unsigned long strlcpy(char*, const char*, unsigned long);
+
+
+
+
+
+
+
+
+
+
+
+class QPrinterPrivate;
+
+class QPrinter : public QPaintDevice
+{
+public:
+    enum PrinterMode { ScreenResolution, PrinterResolution, HighResolution, Compatible };
+
+    QPrinter( PrinterMode mode = ScreenResolution );
+   ~QPrinter();
+
+    enum Orientation { Portrait, Landscape };
+
+    enum PageSize { A4, B5, Letter, Legal, Executive,
+                       A0, A1, A2, A3, A5, A6, A7, A8, A9, B0, B1,
+                       B10, B2, B3, B4, B6, B7, B8, B9, C5E, Comm10E,
+                       DLE, Folio, Ledger, Tabloid, Custom, NPageSize = Custom };
+
+    enum PageOrder { FirstPageFirst, LastPageFirst };
+
+    enum ColorMode { GrayScale, Color };
+
+    enum PaperSource { OnlyOne, Lower, Middle, Manual, Envelope,
+                       EnvelopeManual, Auto, Tractor, SmallFormat,
+                       LargeFormat, LargeCapacity, Cassette, FormSource };
+
+    enum PrintRange { AllPages,
+                        Selection,
+                        PageRange };
+
+    enum PrinterOption { PrintToFile,
+                         PrintSelection,
+                         PrintPageRange };
+
+    QString printerName() const;
+    virtual void setPrinterName( const QString &);
+    bool outputToFile() const;
+    virtual void setOutputToFile( bool );
+    QString outputFileName()const;
+    virtual void setOutputFileName( const QString &);
+
+    QString printProgram() const;
+    virtual void setPrintProgram( const QString &);
+
+    QString printerSelectionOption() const;
+    virtual void setPrinterSelectionOption( const QString & );
+
+    QString docName() const;
+    virtual void setDocName( const QString &);
+    QString creator() const;
+    virtual void setCreator( const QString &);
+
+    Orientation orientation() const;
+    virtual void setOrientation( Orientation );
+    PageSize pageSize() const;
+    virtual void setPageSize( PageSize );
+    virtual void setPageOrder( PageOrder );
+    PageOrder pageOrder() const;
+
+    void setResolution( int );
+    int resolution() const;
+
+    virtual void setColorMode( ColorMode );
+    ColorMode colorMode() const;
+
+    virtual void setFullPage( bool );
+    bool fullPage() const;
+    QSize margins() const;
+    void setMargins( uint top, uint left, uint bottom, uint right );
+    void margins( uint *top, uint *left, uint *bottom, uint *right ) const;
+
+    int fromPage() const;
+    int toPage() const;
+    virtual void setFromTo( int fromPage, int toPage );
+    int minPage() const;
+    int maxPage() const;
+    virtual void setMinMax( int minPage, int maxPage );
+    int numCopies() const;
+    virtual void setNumCopies( int );
+
+    bool collateCopiesEnabled() const;
+    void setCollateCopiesEnabled(bool );
+
+    bool collateCopies() const;
+    void setCollateCopies( bool );
+
+    PrintRange printRange() const;
+    void setPrintRange( PrintRange range );
+
+    bool newPage();
+    bool abort();
+    bool aborted() const;
+
+    bool setup( QWidget *parent = 0 );
+
+    PaperSource paperSource() const;
+    virtual void setPaperSource( PaperSource );
+
+    void setOptionEnabled( PrinterOption, bool enable );
+    bool isOptionEnabled( PrinterOption );
+
+protected:
+    bool cmd( int, QPainter *, QPDevCmdParam * );
+    int metric( int ) const;
+
+
+
+
+
+
+private:
+
+    QPaintDevice *pdrv;
+    int pid;
+    int state;
+    QString printer_name;
+    QString option_string;
+    QString output_filename;
+    bool output_file;
+    QString print_prog;
+    QString doc_name;
+    QString creator_name;
+
+    PageSize page_size;
+    PaperSource paper_source;
+    PageOrder page_order;
+    ColorMode color_mode;
+    Orientation orient;
+    uint to_edge : 1;
+    uint appcolcopies : 1;
+    uint usercolcopies : 1;
+    uint res_set : 1;
+    short from_pg, to_pg;
+    short min_pg, max_pg;
+    short ncopies;
+    int res;
+    QPrinterPrivate *d;
+
+private:
+
+    QPrinter( const QPrinter & );
+    QPrinter &operator=( const QPrinter & );
+
+};
+
+
+inline QString QPrinter::printerName() const
+{ return printer_name; }
+
+inline bool QPrinter::outputToFile() const
+{ return output_file; }
+
+inline QString QPrinter::outputFileName() const
+{ return output_filename; }
+
+inline QString QPrinter::printProgram() const
+{ return print_prog; }
+
+inline QString QPrinter::docName() const
+{ return doc_name; }
+
+inline QString QPrinter::creator() const
+{ return creator_name; }
+
+inline QPrinter::PageSize QPrinter::pageSize() const
+{ return page_size; }
+
+inline QPrinter::Orientation QPrinter::orientation() const
+{ return orient; }
+
+inline int QPrinter::fromPage() const
+{ return from_pg; }
+
+inline int QPrinter::toPage() const
+{ return to_pg; }
+
+inline int QPrinter::minPage() const
+{ return min_pg; }
+
+inline int QPrinter::maxPage() const
+{ return max_pg; }
+
+inline int QPrinter::numCopies() const
+{ return ncopies; }
+
+inline bool QPrinter::collateCopiesEnabled() const
+{ return appcolcopies; }
+
+inline void QPrinter::setCollateCopiesEnabled(bool v)
+{ appcolcopies = v; }
+
+inline bool QPrinter::collateCopies() const
+{ return usercolcopies; }
+
+
+
+
+
+
+
+struct kde_loaded_l10nfile;
+
+class KCataloguePrivate;
+class KCatalogue
+{
+public:
+
+
+
+
+
+  explicit KCatalogue(const QString & name = QString::null);
+
+
+
+
+  KCatalogue(const KCatalogue & rhs);
+
+
+
+
+  KCatalogue & operator = ( const KCatalogue & rhs);
+
+
+
+
+  virtual ~KCatalogue();
+
+
+
+
+
+
+  QString name() const;
+
+
+
+
+
+
+
+  void setFileName( const QString & fileName );
+  const char * translate( const char * msgid ) const;
+
+private:
+
+
+
+
+
+  QString fileName() const;
+
+
+
+
+  void doUnload();
+
+private:
+  KCataloguePrivate * d;
+};
+
+
+
+
+
+
+
+
+
+
+class KLocale;
+
+class KCalendarSystemPrivate;
+class KCalendarSystem
+{
+public:
+
+
+
+
+
+  KCalendarSystem(const KLocale * locale = 0);
+
+
+
+
+  virtual ~KCalendarSystem();
+
+
+
+
+
+
+
+  virtual int year (const QDate & date) const = 0;
+  virtual QString yearString(const QDate & pDate, bool bShort) const;
+  virtual int yearStringToInteger(const QString & sNum, int & iLength) const;
+
+
+
+
+
+
+
+  virtual int month (const QDate & date) const = 0;
+  virtual QString monthString(const QDate & pDate, bool bShort) const;
+  virtual int monthStringToInteger(const QString & sNum, int & iLength) const;
+
+
+
+
+
+
+
+  virtual int day (const QDate & date) const = 0;
+  virtual QString dayString(const QDate & pDate, bool bShort) const;
+  virtual int dayStringToInteger(const QString & sNum, int & iLength) const;
+  virtual int dayOfWeek (const QDate & date) const = 0;
+
+
+
+
+
+
+
+  virtual int dayOfYear (const QDate & date) const = 0;
+  virtual bool setYMD(QDate & date, int y, int m, int d) const = 0;
+  virtual QDate addYears(const QDate & date, int nyears) const = 0;
+  virtual QDate addMonths(const QDate & date, int nmonths) const = 0;
+  virtual QDate addDays(const QDate & date, int ndays) const = 0;
+
+
+
+
+
+
+
+  virtual int monthsInYear (const QDate & date) const = 0;
+
+
+
+
+
+
+
+  virtual int daysInYear (const QDate & date) const = 0;
+
+
+
+
+
+
+
+  virtual int daysInMonth (const QDate & date) const = 0;
+
+
+
+
+
+
+
+  virtual int weeksInYear(int year) const = 0;
+
+
+
+
+
+
+
+  virtual int weekNumber(const QDate& date, int * yearNum = 0) const = 0;
+  virtual QString yearLiteral (int year) const = 0;
+  virtual QString yearLiteral (const QDate & date) const = 0;
+  virtual QString monthName (int month, int year, bool shortName = false) const = 0;
+  virtual QString monthName (const QDate & date, bool shortName = false ) const = 0;
+  virtual QString monthNamePossessive(int month, int year, bool shortName = false) const = 0;
+  virtual QString monthNamePossessive(const QDate & date, bool shortName = false) const = 0;
+  virtual QString weekDayName (int weekDay, bool shortName = false) const = 0;
+  virtual QString weekDayName (const QDate & date, bool shortName = false) const = 0;
+
+
+
+
+
+
+
+  virtual int minValidYear () const = 0;
+
+
+
+
+
+
+
+  virtual int maxValidYear () const = 0;
+
+
+
+
+
+
+  virtual int weekDayOfPray () const = 0;
+
+
+
+
+  virtual QString calendarName() const = 0;
+
+
+
+
+
+
+  virtual bool isLunar() const = 0;
+
+
+
+
+
+
+  virtual bool isLunisolar() const = 0;
+
+
+
+
+
+
+  virtual bool isSolar() const = 0;
+
+protected:
+  const KLocale * locale() const;
+
+private:
+  KCalendarSystemPrivate * d;
+};
+
+
+
+
+class KCalendarSystem;
+class KLocale;
+
+
+
+
+
+
+
+class KCalendarSystemFactory
+{
+public:
+  KCalendarSystemFactory ();
+  ~KCalendarSystemFactory ();
+  static KCalendarSystem *create (const QString & calType = QString::fromLatin1("gregorian"),
+                                  const KLocale * locale = 0);
+
+
+
+
+
+
+  static QStringList calendarSystems();
+
+private:
+};
+
+
+static const char * const SYSTEM_MESSAGES = "kdelibs";
+
+static const char *maincatalogue = 0;
+
+class KLocalePrivate
+{
+public:
+  int weekStartDay;
+  int plural_form;
+  bool nounDeclension;
+  bool dateMonthNamePossessive;
+  QStringList languageList;
+  QValueList<KCatalogue> catalogues;
+  QString encoding;
+  QTextCodec * codecForEncoding;
+  KConfig * config;
+  bool formatInited;
+  int pageSize;
+  KLocale::MeasureSystem measureSystem;
+  QStringList langTwoAlpha;
+  KConfig *languages;
+
+  QString calendarType;
+  KCalendarSystem * calendar;
+  QString first_language;
+  bool utf8FileEncoding;
+};
+
+static KLocale *this_klocale = 0;
+
+KLocale::KLocale( const QString & catalogue, KConfig * config )
+{
+  d = new KLocalePrivate;
+  d->config = config;
+  d->languages = 0;
+  d->calendar = 0;
+
+  initCatalogue(catalogue);
+  initEncoding(0);
+  initFileNameEncoding(0);
+
+  KConfig *cfg = d->config;
+  this_klocale = this;
+  if (!cfg) cfg = KGlobal::instance()->config();
+  this_klocale = 0;
+  ((cfg) ? (void)0 : qWarning("ASSERT: \"%s\" in %s (%d)","cfg","/coolo/prod/kdelibs/kdecore/klocale.cpp",91));
+
+  if (m_language.isEmpty())
+     initLanguage(cfg, config == 0);
+}
+
+QString KLocale::_initLanguage(KConfigBase *config)
+{
+  if (this_klocale)
+  {
+
+     this_klocale->initLanguage((KConfig *) config, true);
+     return this_klocale->language();
+  }
+  return QString::null;
+}
+
+void KLocale::initCatalogue(const QString & catalogue)
+{
+
+  QString mainCatalogue = catalogue;
+  if (maincatalogue)
+    mainCatalogue = QString::fromLatin1(maincatalogue);
+
+  if (mainCatalogue.isEmpty()) {
+    kdDebug(173) << "KLocale instance created called without valid "
+                 << "catalogue! Give an argument or call setMainCatalogue "
+                 << "before init" << endl;
+  }
+  else
+    d->catalogues.append( KCatalogue(mainCatalogue ) );
+
+
+  d->catalogues.append( KCatalogue( SYSTEM_MESSAGES ) );
+  d->catalogues.append( KCatalogue( "kio" ) );
+}
+
+void KLocale::initLanguage(KConfig * config, bool useEnv)
+{
+  KConfigGroupSaver saver(config, "Locale");
+
+  m_country = config->readEntry( "Country" );
+  if ( m_country.isEmpty() )
+    m_country = defaultCountry();
+
+
+  QStringList languageList;
+  if ( useEnv )
+    languageList += QStringList::split
+      (':', QFile::decodeName( ::getenv("KDE_LANG") ));
+
+  languageList += config->readListEntry("Language", ':');
+
+
+  if ( useEnv )
+    {
+
+      QStringList langs;
+
+      langs << QFile::decodeName( ::getenv("LC_ALL") );
+      langs << QFile::decodeName( ::getenv("LC_MESSAGES") );
+      langs << QFile::decodeName( ::getenv("LANG") );
+      langs << QFile::decodeName( ::getenv("LC_CTYPE") );
+
+      for ( QStringList::Iterator it = langs.begin();
+            it != langs.end();
+            ++it )
+        {
+          QString ln, ct, chrset;
+          splitLocale(*it, ln, ct, chrset);
+
+          if (!ct.isEmpty()) {
+            langs.insert(it, ln + '_' + ct);
+            if (!chrset.isEmpty())
+              langs.insert(it, ln + '_' + ct + '.' + chrset);
+          }
+
+          langs.insert(it, ln);
+        }
+
+      languageList += langs;
+    }
+
+
+  setLanguage( languageList );
+}
+
+void KLocale::doBindInit()
+{
+  for ( QValueList<KCatalogue>::Iterator it = d->catalogues.begin();
+        it != d->catalogues.end();
+        ++it )
+    initCatalogue( *it );
+
+  if ( useDefaultLanguage() )
+    d->plural_form = -1;
+  else
+    {
+      QString pf = translate_priv
+        ( ("_: Dear translator, please do not translate this string " "in any form, but pick the _right_ value out of " "NoPlural/TwoForms/French... If not sure what to do mail " "thd@kde.org and coolo@kde.org, they will tell you. " "Better leave that out if unsure, the programs will " "crash!!\nDefinition of PluralForm - to be set by the " "translator of kdelibs.po"), 0);
+
+
+
+
+
+
+      if ( pf.isEmpty() ) {
+        kdWarning(173) << "found no definition of PluralForm for " << m_language << endl;
+        d->plural_form = -1;
+      } else if ( pf == "NoPlural" )
+        d->plural_form = 0;
+      else if ( pf == "TwoForms" )
+        d->plural_form = 1;
+      else if ( pf == "French" )
+        d->plural_form = 2;
+      else if ( pf == "OneTwoRest" || pf == "Gaeilge" )
+        d->plural_form = 3;
+      else if ( pf == "Russian" )
+        d->plural_form = 4;
+      else if ( pf == "Polish" )
+        d->plural_form = 5;
+      else if ( pf == "Slovenian" )
+        d->plural_form = 6;
+      else if ( pf == "Lithuanian" )
+        d->plural_form = 7;
+      else if ( pf == "Czech" )
+        d->plural_form = 8;
+      else if ( pf == "Slovak" )
+        d->plural_form = 9;
+      else if ( pf == "Maltese" )
+        d->plural_form = 10;
+      else if ( pf == "Arabic" )
+        d->plural_form = 11;
+      else if ( pf == "Balcan" )
+        d->plural_form = 12;
+      else if ( pf == "Macedonian" )
+        d->plural_form = 13;
+      else {
+        kdWarning(173) << "Definition of PluralForm is none of "
+                       << "NoPlural/"
+                       << "TwoForms/"
+                       << "French/"
+                       << "OneTwoRest/"
+                       << "Russian/"
+                       << "Polish/"
+                       << "Slovenian/"
+                       << "Lithuanian/"
+                       << "Czech/"
+                       << "Slovak/"
+                       << "Arabic/"
+                       << "Balcan/"
+                       << "Macedonian/"
+                       << "Maltese: " << pf << endl;
+        exit(1);
+      }
+    }
+
+  d->formatInited = false;
+}
+
+void KLocale::doFormatInit() const
+{
+  if ( d->formatInited ) return;
+
+  KLocale * that = const_cast<KLocale *>(this);
+  that->initFormat();
+
+  d->formatInited = true;
+}
+
+void KLocale::initFormat()
+{
+  KConfig *config = d->config;
+  if (!config) config = KGlobal::instance()->config();
+  ((config) ? (void)0 : qWarning("ASSERT: \"%s\" in %s (%d)","config","/coolo/prod/kdelibs/kdecore/klocale.cpp",265));
+
+  kdDebug(173) << "KLocale::initFormat" << endl;
+
+
+
+
+  KLocale *lsave = KGlobal::_locale;
+  KGlobal::_locale = this;
+
+  KConfigGroupSaver saver(config, "Locale");
+
+  KSimpleConfig entry(locate("locale",
+                             QString::fromLatin1("l10n/%1/entry.desktop")
+                             .arg(m_country)), true);
+  entry.setGroup("KCM Locale");
+
+
+
+
+
+
+
+
+
+
+
+  m_decimalSymbol = entry.readEntry("DecimalSymbol", QString::fromLatin1(".")); m_decimalSymbol = config->readEntry("DecimalSymbol", m_decimalSymbol);;
+  m_thousandsSeparator = entry.readEntry("ThousandsSeparator", QString::fromLatin1(",")); m_thousandsSeparator = config->readEntry("ThousandsSeparator", m_thousandsSeparator);;
+  m_thousandsSeparator.replace( QString::fromLatin1("$0"), QString::null );
+
+
+  m_positiveSign = entry.readEntry("PositiveSign", QString::fromLatin1("")); m_positiveSign = config->readEntry("PositiveSign", m_positiveSign);;
+  m_negativeSign = entry.readEntry("NegativeSign", QString::fromLatin1("-")); m_negativeSign = config->readEntry("NegativeSign", m_negativeSign);;
+
+
+  m_currencySymbol = entry.readEntry("CurrencySymbol", QString::fromLatin1("$")); m_currencySymbol = config->readEntry("CurrencySymbol", m_currencySymbol);;
+  m_monetaryDecimalSymbol = entry.readEntry("MonetaryDecimalSymbol", QString::fromLatin1(".")); m_monetaryDecimalSymbol = config->readEntry("MonetaryDecimalSymbol", m_monetaryDecimalSymbol);;
+  m_monetaryThousandsSeparator = entry.readEntry("MonetaryThousandsSeparator", QString::fromLatin1(",")); m_monetaryThousandsSeparator = config->readEntry("MonetaryThousandsSeparator", m_monetaryThousandsSeparator);;
+
+  m_monetaryThousandsSeparator.replace(QString::fromLatin1("$0"), QString::null);
+
+  m_fracDigits = (int)entry.readNumEntry("FracDigits", 2); m_fracDigits = (int)config->readNumEntry("FracDigits", m_fracDigits);;
+  m_positivePrefixCurrencySymbol = entry.readBoolEntry("PositivePrefixCurrencySymbol", true); m_positivePrefixCurrencySymbol = config->readBoolEntry("PositivePrefixCurrencySymbol", m_positivePrefixCurrencySymbol);;
+
+  m_negativePrefixCurrencySymbol = entry.readBoolEntry("NegativePrefixCurrencySymbol", true); m_negativePrefixCurrencySymbol = config->readBoolEntry("NegativePrefixCurrencySymbol", m_negativePrefixCurrencySymbol);;
+
+  m_positiveMonetarySignPosition = (SignPosition)entry.readNumEntry("PositiveMonetarySignPosition", (int)BeforeQuantityMoney); m_positiveMonetarySignPosition = (SignPosition)config->readNumEntry("PositiveMonetarySignPosition", m_positiveMonetarySignPosition);;
+
+  m_negativeMonetarySignPosition = (SignPosition)entry.readNumEntry("NegativeMonetarySignPosition", (int)ParensAround); m_negativeMonetarySignPosition = (SignPosition)config->readNumEntry("NegativeMonetarySignPosition", m_negativeMonetarySignPosition);;
+
+
+
+  d->nounDeclension = entry.readBoolEntry("NounDeclension", false); d->nounDeclension = config->readBoolEntry("NounDeclension", d->nounDeclension);;
+
+
+  m_timeFormat = entry.readEntry("TimeFormat", QString::fromLatin1("%H:%M:%S")); m_timeFormat = config->readEntry("TimeFormat", m_timeFormat);;
+  m_dateFormat = entry.readEntry("DateFormat", QString::fromLatin1("%A %d %B %Y")); m_dateFormat = config->readEntry("DateFormat", m_dateFormat);;
+  m_dateFormatShort = entry.readEntry("DateFormatShort", QString::fromLatin1("%Y-%m-%d")); m_dateFormatShort = config->readEntry("DateFormatShort", m_dateFormatShort);;
+  d->dateMonthNamePossessive = entry.readBoolEntry("DateMonthNamePossessive", false); d->dateMonthNamePossessive = config->readBoolEntry("DateMonthNamePossessive", d->dateMonthNamePossessive);;
+
+  d->weekStartDay = (int)entry.readNumEntry("WeekStartDay", 1); d->weekStartDay = (int)config->readNumEntry("WeekStartDay", d->weekStartDay);;
+
+
+  d->pageSize = (int)entry.readNumEntry("PageSize", (int)QPrinter::A4); d->pageSize = (int)config->readNumEntry("PageSize", d->pageSize);;
+  d->measureSystem = (MeasureSystem)entry.readNumEntry("MeasureSystem", (int)Metric); d->measureSystem = (MeasureSystem)config->readNumEntry("MeasureSystem", d->measureSystem);;
+
+  d->calendarType = entry.readEntry("CalendarSystem", QString::fromLatin1("gregorian")); d->calendarType = config->readEntry("CalendarSystem", d->calendarType);;
+  delete d->calendar;
+  d->calendar = 0;
+
+
+  KGlobal::_locale = lsave;
+}
+
+bool KLocale::setCountry(const QString & country)
+{
+
+  if ( country.isEmpty() )
+    return false;
+
+  m_country = country;
+
+  d->formatInited = false;
+
+  return true;
+}
+
+QString KLocale::catalogueFileName(const QString & language,
+                                   const KCatalogue & catalogue)
+{
+  QString path = QString::fromLatin1("%1/LC_MESSAGES/%2.mo")
+    .arg( language )
+    .arg( catalogue.name() );
+
+  return locate( "locale", path );
+}
+
+bool KLocale::isLanguageInstalled(const QString & language) const
+{
+
+  if ( language.isEmpty() ) return false;
+
+  bool bRes = true;
+  if ( language != defaultLanguage() )
+    for ( QValueList<KCatalogue>::ConstIterator it = d->catalogues.begin();
+          it != d->catalogues.end() && bRes;
+          ++it )
+      {
+        bRes = !catalogueFileName( language, *it ).isNull();
+        if ( !bRes )
+          kdDebug(173) << "message catalogue not found: "
+                       << (*it).name() << endl;
+      }
+
+  return bRes;
+}
+
+bool KLocale::setLanguage(const QString & language)
+{
+  bool bRes = true;
+
+  if (d->first_language.isNull() || language != d->first_language)
+    bRes = isLanguageInstalled( language );
+
+  if ( bRes )
+    {
+      m_language = language;
+
+
+      if (d->first_language.isNull())
+        d->first_language = language;
+
+      doBindInit();
+    }
+
+  return bRes;
+}
+
+bool KLocale::setLanguage(const QStringList & languages)
+{
+  QStringList languageList(languages);
+
+
+
+  for( QStringList::Iterator it = languageList.fromLast();
+         it != languageList.begin();
+         --it )
+    if ( languageList.contains(*it) > 1 || (*it).isEmpty() )
+      it = languageList.remove( it );
+
+  bool bRes = false;
+  for ( QStringList::ConstIterator it = languageList.begin();
+        it != languageList.end();
+        ++it )
+    if ( bRes = setLanguage( *it ) )
+      break;
+
+  if ( !bRes )
+    setLanguage(defaultLanguage());
+
+  d->languageList = languageList;
+  d->langTwoAlpha.clear();
+
+  return bRes;
+}
+
+void KLocale::splitLocale(const QString & aStr,
+                          QString & language,
+                          QString & country,
+                          QString & chrset)
+{
+  QString str = aStr;
+
+
+  int f = str.find(':');
+  if (f >= 0)
+    str.truncate(f);
+
+  country = QString::null;
+  chrset = QString::null;
+  language = QString::null;
+
+  f = str.find('.');
+  if (f >= 0)
+    {
+      chrset = str.mid(f + 1);
+      str.truncate(f);
+    }
+
+  f = str.find('_');
+  if (f >= 0)
+    {
+      country = str.mid(f + 1);
+      str.truncate(f);
+    }
+
+  language = str;
+}
+
+QString KLocale::language() const
+{
+  return m_language;
+}
+
+QString KLocale::country() const
+{
+  return m_country;
+}
+
+QString KLocale::monthName(int i, bool shortName) const
+{
+  if ( shortName )
+    switch ( i )
+      {
+      case 1: return translate("January", "Jan");
+      case 2: return translate("February", "Feb");
+      case 3: return translate("March", "Mar");
+      case 4: return translate("April", "Apr");
+      case 5: return translate("May short", "May");
+      case 6: return translate("June", "Jun");
+      case 7: return translate("July", "Jul");
+      case 8: return translate("August", "Aug");
+      case 9: return translate("September", "Sep");
+      case 10: return translate("October", "Oct");
+      case 11: return translate("November", "Nov");
+      case 12: return translate("December", "Dec");
+      }
+  else
+    switch (i)
+      {
+      case 1: return translate("January");
+      case 2: return translate("February");
+      case 3: return translate("March");
+      case 4: return translate("April");
+      case 5: return translate("May long", "May");
+      case 6: return translate("June");
+      case 7: return translate("July");
+      case 8: return translate("August");
+      case 9: return translate("September");
+      case 10: return translate("October");
+      case 11: return translate("November");
+      case 12: return translate("December");
+      }
+
+  return QString::null;
+}
+
+QString KLocale::monthNamePossessive(int i, bool shortName) const
+{
+  if ( shortName )
+    switch ( i )
+      {
+      case 1: return translate("of January", "of Jan");
+      case 2: return translate("of February", "of Feb");
+      case 3: return translate("of March", "of Mar");
+      case 4: return translate("of April", "of Apr");
+      case 5: return translate("of May short", "of May");
+      case 6: return translate("of June", "of Jun");
+      case 7: return translate("of July", "of Jul");
+      case 8: return translate("of August", "of Aug");
+      case 9: return translate("of September", "of Sep");
+      case 10: return translate("of October", "of Oct");
+      case 11: return translate("of November", "of Nov");
+      case 12: return translate("of December", "of Dec");
+      }
+  else
+    switch (i)
+      {
+      case 1: return translate("of January");
+      case 2: return translate("of February");
+      case 3: return translate("of March");
+      case 4: return translate("of April");
+      case 5: return translate("of May long", "of May");
+      case 6: return translate("of June");
+      case 7: return translate("of July");
+      case 8: return translate("of August");
+      case 9: return translate("of September");
+      case 10: return translate("of October");
+      case 11: return translate("of November");
+      case 12: return translate("of December");
+      }
+
+  return QString::null;
+}
+
+QString KLocale::weekDayName (int i, bool shortName) const
+{
+  if ( shortName )
+    switch ( i )
+      {
+      case 1: return translate("Monday", "Mon");
+      case 2: return translate("Tuesday", "Tue");
+      case 3: return translate("Wednesday", "Wed");
+      case 4: return translate("Thursday", "Thu");
+      case 5: return translate("Friday", "Fri");
+      case 6: return translate("Saturday", "Sat");
+      case 7: return translate("Sunday", "Sun");
+      }
+  else
+    switch ( i )
+      {
+      case 1: return translate("Monday");
+      case 2: return translate("Tuesday");
+      case 3: return translate("Wednesday");
+      case 4: return translate("Thursday");
+      case 5: return translate("Friday");
+      case 6: return translate("Saturday");
+      case 7: return translate("Sunday");
+      }
+
+  return QString::null;
+}
+
+void KLocale::insertCatalogue( const QString & catalogue )
+{
+  KCatalogue cat( catalogue );
+
+  initCatalogue( cat );
+
+  d->catalogues.append( cat );
+}
+
+void KLocale::removeCatalogue(const QString &catalogue)
+{
+  for ( QValueList<KCatalogue>::Iterator it = d->catalogues.begin();
+        it != d->catalogues.end(); )
+    if ((*it).name() == catalogue) {
+      it = d->catalogues.remove(it);
+      return;
+    } else
+      ++it;
+}
+
+void KLocale::setActiveCatalogue(const QString &catalogue)
+{
+  for ( QValueList<KCatalogue>::Iterator it = d->catalogues.begin();
+        it != d->catalogues.end(); ++it)
+    if ((*it).name() == catalogue) {
+      KCatalogue save = *it;
+      d->catalogues.remove(it);
+      d->catalogues.prepend(save);
+      return;
+    }
+}
+
+KLocale::~KLocale()
+{
+  delete d->calendar;
+  delete d->languages;
+  delete d;
+  d = 0L;
+}
+
+QString KLocale::translate_priv(const char *msgid,
+                                const char *fallback,
+                                const char **translated) const
+{
+  if (!msgid || !msgid[0])
+    {
+      kdWarning() << "KLocale: trying to look up \"\" in catalogue. "
+                   << "Fix the program" << endl;
+      return QString::null;
+    }
+
+  if ( useDefaultLanguage() )
+    return QString::fromUtf8( fallback );
+
+  for ( QValueList<KCatalogue>::ConstIterator it = d->catalogues.begin();
+        it != d->catalogues.end();
+        ++it )
+    {
+
+      const char * text = (*it).translate( msgid );
+
+      if ( text )
+        {
+
+          if (translated)
+            *translated = text;
+          return QString::fromUtf8( text );
+        }
+    }
+
+
+  return QString::fromUtf8( fallback );
+}
+
+QString KLocale::translate(const char* msgid) const
+{
+  return translate_priv(msgid, msgid);
+}
+
+QString KLocale::translate( const char *index, const char *fallback) const
+{
+  if (!index || !index[0] || !fallback || !fallback[0])
+    {
+      kdDebug(173) << "KLocale: trying to look up \"\" in catalogue. "
+                   << "Fix the program" << endl;
+      return QString::null;
+    }
+
+  if ( useDefaultLanguage() )
+    return QString::fromUtf8( fallback );
+
+  char *newstring = new char[strlen(index) + strlen(fallback) + 5];
+  sprintf(newstring, "_: %s\n%s", index, fallback);
+
+  QString r = translate_priv(newstring, fallback);
+  delete [] newstring;
+
+  return r;
+}
+
+static QString put_n_in(const QString &orig, unsigned long n)
+{
+  QString ret = orig;
+  int index = ret.find("%n");
+  if (index == -1)
+    return ret;
+  ret.replace(index, 2, QString::number(n));
+  return ret;
+}
+
+
+
+
+
+QString KLocale::translate( const char *singular, const char *plural,
+                            unsigned long n ) const
+{
+  if (!singular || !singular[0] || !plural || !plural[0])
+    {
+      kdWarning() << "KLocale: trying to look up \"\" in catalogue. "
+                   << "Fix the program" << endl;
+      return QString::null;
+    }
+
+  char *newstring = new char[strlen(singular) + strlen(plural) + 6];
+  sprintf(newstring, "_n: %s\n%s", singular, plural);
+
+  QString r = translate_priv(newstring, 0);
+  delete [] newstring;
+
+  if ( r.isEmpty() || useDefaultLanguage() || d->plural_form == -1) {
+    if ( n == 1 ) {
+      return put_n_in( QString::fromUtf8( singular ), n );
+        } else {
+          QString tmp = QString::fromUtf8( plural );
+
+          if (tmp.find("%n") == -1) {
+                          kdWarning() << "the message for i18n should contain a '%n'! " << plural << endl;
+          }
+
+      return put_n_in( tmp, n );
+        }
+  }
+
+  QStringList forms = QStringList::split( "\n", r, false );
+  switch ( d->plural_form ) {
+  case 0:
+    if (forms.count() != 1) { kdError() << "translation of \"" << singular << "\" doesn't contain " << 1 << " different plural forms as expected\n"; return QString( "BROKEN TRANSLATION %1" ).arg( singular ); };
+    return put_n_in( forms[0], n);
+  case 1:
+    if (forms.count() != 2) { kdError() << "translation of \"" << singular << "\" doesn't contain " << 2 << " different plural forms as expected\n"; return QString( "BROKEN TRANSLATION %1" ).arg( singular ); };
+    if ( n == 1 )
+      return put_n_in( forms[0], n);
+    else
+      return put_n_in( forms[1], n);
+  case 2:
+    if (forms.count() != 2) { kdError() << "translation of \"" << singular << "\" doesn't contain " << 2 << " different plural forms as expected\n"; return QString( "BROKEN TRANSLATION %1" ).arg( singular ); };
+    if ( n == 1 || n == 0 )
+      return put_n_in( forms[0], n);
+    else
+      return put_n_in( forms[1], n);
+  case 3:
+    if (forms.count() != 3) { kdError() << "translation of \"" << singular << "\" doesn't contain " << 3 << " different plural forms as expected\n"; return QString( "BROKEN TRANSLATION %1" ).arg( singular ); };
+    if ( n == 1 )
+      return put_n_in( forms[0], n);
+    else if ( n == 2 )
+      return put_n_in( forms[1], n);
+    else
+      return put_n_in( forms[2], n);
+  case 4:
+    if (forms.count() != 3) { kdError() << "translation of \"" << singular << "\" doesn't contain " << 3 << " different plural forms as expected\n"; return QString( "BROKEN TRANSLATION %1" ).arg( singular ); };
+    if ( n%10 == 1 && n%100 != 11)
+      return put_n_in( forms[0], n);
+    else if (( n%10 >= 2 && n%10 <=4 ) && (n%100<10 || n%100>20))
+      return put_n_in( forms[1], n);
+    else
+      return put_n_in( forms[2], n);
+  case 5:
+    if (forms.count() != 3) { kdError() << "translation of \"" << singular << "\" doesn't contain " << 3 << " different plural forms as expected\n"; return QString( "BROKEN TRANSLATION %1" ).arg( singular ); };
+    if ( n == 1 )
+      return put_n_in( forms[0], n);
+    else if ( n%10 >= 2 && n%10 <=4 && (n%100<10 || n%100>=20) )
+      return put_n_in( forms[1], n);
+    else
+      return put_n_in( forms[2], n);
+  case 6:
+    if (forms.count() != 4) { kdError() << "translation of \"" << singular << "\" doesn't contain " << 4 << " different plural forms as expected\n"; return QString( "BROKEN TRANSLATION %1" ).arg( singular ); };
+    if ( n%100 == 1 )
+      return put_n_in( forms[1], n);
+    else if ( n%100 == 2 )
+      return put_n_in( forms[2], n);
+    else if ( n%100 == 3 || n%100 == 4 )
+      return put_n_in( forms[3], n);
+    else
+      return put_n_in( forms[0], n);
+  case 7:
+    if (forms.count() != 3) { kdError() << "translation of \"" << singular << "\" doesn't contain " << 3 << " different plural forms as expected\n"; return QString( "BROKEN TRANSLATION %1" ).arg( singular ); };
+    if ( n%10 == 0 || (n%100>=11 && n%100<=19) )
+      return put_n_in( forms[2], n);
+    else if ( n%10 == 1 )
+      return put_n_in( forms[0], n);
+    else
+      return put_n_in( forms[1], n);
+  case 8:
+    if (forms.count() != 3) { kdError() << "translation of \"" << singular << "\" doesn't contain " << 3 << " different plural forms as expected\n"; return QString( "BROKEN TRANSLATION %1" ).arg( singular ); };
+    if ( n%100 == 1 )
+      return put_n_in( forms[0], n);
+    else if (( n%100 >= 2 ) && ( n%100 <= 4 ))
+      return put_n_in( forms[1], n);
+    else
+      return put_n_in( forms[2], n);
+  case 9:
+    if (forms.count() != 3) { kdError() << "translation of \"" << singular << "\" doesn't contain " << 3 << " different plural forms as expected\n"; return QString( "BROKEN TRANSLATION %1" ).arg( singular ); };
+    if ( n == 1 )
+      return put_n_in( forms[0], n);
+    else if (( n >= 2 ) && ( n <= 4 ))
+      return put_n_in( forms[1], n);
+    else
+      return put_n_in( forms[2], n);
+  case 10:
+    if (forms.count() != 4) { kdError() << "translation of \"" << singular << "\" doesn't contain " << 4 << " different plural forms as expected\n"; return QString( "BROKEN TRANSLATION %1" ).arg( singular ); };
+    if ( n == 1 )
+      return put_n_in( forms[0], n );
+    else if ( ( n == 0 ) || ( n%100 > 0 && n%100 <= 10 ) )
+      return put_n_in( forms[1], n );
+    else if ( n%100 > 10 && n%100 < 20 )
+      return put_n_in( forms[2], n );
+    else
+      return put_n_in( forms[3], n );
+  case 11:
+    if (forms.count() != 4) { kdError() << "translation of \"" << singular << "\" doesn't contain " << 4 << " different plural forms as expected\n"; return QString( "BROKEN TRANSLATION %1" ).arg( singular ); };
+    if (n == 1)
+      return put_n_in(forms[0], n);
+    else if (n == 2)
+      return put_n_in(forms[1], n);
+    else if ( n < 11)
+      return put_n_in(forms[2], n);
+    else
+      return put_n_in(forms[3], n);
+  case 12:
+     if (forms.count() != 3) { kdError() << "translation of \"" << singular << "\" doesn't contain " << 3 << " different plural forms as expected\n"; return QString( "BROKEN TRANSLATION %1" ).arg( singular ); };
+     if (n != 11 && n % 10 == 1)
+        return put_n_in(forms[0], n);
+     else if (n / 10 != 1 && n % 10 >= 2 && n % 10 <= 4)
+        return put_n_in(forms[1], n);
+     else
+        return put_n_in(forms[2], n);
+  case 13:
+     if (forms.count() != 3) { kdError() << "translation of \"" << singular << "\" doesn't contain " << 3 << " different plural forms as expected\n"; return QString( "BROKEN TRANSLATION %1" ).arg( singular ); };
+     if (n % 10 == 1)
+        return put_n_in(forms[0], n);
+     else if (n % 10 == 2)
+        return put_n_in(forms[1], n);
+     else
+        return put_n_in(forms[2], n);
+  }
+  kdFatal() << "The function should have been returned in another way\n";
+
+  return QString::null;
+}
+
+QString KLocale::translateQt( const char *context, const char *source,
+                              const char *message) const
+{
+  if (!source || !source[0]) {
+    kdWarning() << "KLocale: trying to look up \"\" in catalogue. "
+                << "Fix the program" << endl;
+    return QString::null;
+  }
+
+  if ( useDefaultLanguage() ) {
+    return QString::null;
+  }
+
+  char *newstring = 0;
+  const char *translation = 0;
+  QString r;
+
+  if ( message && message[0]) {
+    char *newstring = new char[strlen(source) + strlen(message) + 5];
+    sprintf(newstring, "_: %s\n%s", source, message);
+    const char *translation = 0;
+
+    r = translate_priv(newstring, source, &translation);
+    delete [] newstring;
+    if (translation)
+      return r;
+  }
+
+  if ( context && context[0] && message && message[0]) {
+    newstring = new char[strlen(context) + strlen(message) + 5];
+    sprintf(newstring, "_: %s\n%s", context, message);
+
+    r = translate_priv(newstring, source, &translation);
+    delete [] newstring;
+    if (translation)
+      return r;
+  }
+
+  r = translate_priv(source, source, &translation);
+  if (translation)
+    return r;
+  return QString::null;
+}
+
+bool KLocale::nounDeclension() const
+{
+  doFormatInit();
+  return d->nounDeclension;
+}
+
+bool KLocale::dateMonthNamePossessive() const
+{
+  doFormatInit();
+  return d->dateMonthNamePossessive;
+}
+
+int KLocale::weekStartDay() const
+{
+  doFormatInit();
+  return d->weekStartDay;
+}
+
+bool KLocale::weekStartsMonday() const
+{
+  doFormatInit();
+  return (d->weekStartDay==1);
+}
+
+QString KLocale::decimalSymbol() const
+{
+  doFormatInit();
+  return m_decimalSymbol;
+}
+
+QString KLocale::thousandsSeparator() const
+{
+  doFormatInit();
+  return m_thousandsSeparator;
+}
+
+QString KLocale::currencySymbol() const
+{
+  doFormatInit();
+  return m_currencySymbol;
+}
+
+QString KLocale::monetaryDecimalSymbol() const
+{
+  doFormatInit();
+  return m_monetaryDecimalSymbol;
+}
+
+QString KLocale::monetaryThousandsSeparator() const
+{
+  doFormatInit();
+  return m_monetaryThousandsSeparator;
+}
+
+QString KLocale::positiveSign() const
+{
+  doFormatInit();
+  return m_positiveSign;
+}
+
+QString KLocale::negativeSign() const
+{
+  doFormatInit();
+  return m_negativeSign;
+}
+
+int KLocale::fracDigits() const
+{
+  doFormatInit();
+  return m_fracDigits;
+}
+
+bool KLocale::positivePrefixCurrencySymbol() const
+{
+  doFormatInit();
+  return m_positivePrefixCurrencySymbol;
+}
+
+bool KLocale::negativePrefixCurrencySymbol() const
+{
+  doFormatInit();
+  return m_negativePrefixCurrencySymbol;
+}
+
+KLocale::SignPosition KLocale::positiveMonetarySignPosition() const
+{
+  doFormatInit();
+  return m_positiveMonetarySignPosition;
+}
+
+KLocale::SignPosition KLocale::negativeMonetarySignPosition() const
+{
+  doFormatInit();
+  return m_negativeMonetarySignPosition;
+}
+
+static inline void put_it_in( QChar *buffer, uint& index, const QString &s )
+{
+  for ( uint l = 0; l < s.length(); l++ )
+    buffer[index++] = s.at( l );
+}
+
+static inline void put_it_in( QChar *buffer, uint& index, int number )
+{
+  buffer[index++] = number / 10 + '0';
+  buffer[index++] = number % 10 + '0';
+}
+
+QString KLocale::formatMoney(double num,
+                             const QString & symbol,
+                             int precision) const
+{
+
+  QString currency = symbol.isNull()
+    ? currencySymbol()
+    : symbol;
+  if (precision < 0) precision = fracDigits();
+
+
+  bool neg = num < 0;
+  QString res = QString::number(neg?-num:num, 'f', precision);
+  int pos = res.find('.');
+  if (pos == -1) pos = res.length();
+  else res.replace(pos, 1, monetaryDecimalSymbol());
+
+  while (0 < (pos -= 3))
+    res.insert(pos, monetaryThousandsSeparator());
+
+
+  int signpos = neg
+    ? negativeMonetarySignPosition()
+    : positiveMonetarySignPosition();
+  QString sign = neg
+    ? negativeSign()
+    : positiveSign();
+
+  switch (signpos)
+    {
+    case ParensAround:
+      res.prepend('(');
+      res.append (')');
+      break;
+    case BeforeQuantityMoney:
+      res.prepend(sign);
+      break;
+    case AfterQuantityMoney:
+      res.append(sign);
+      break;
+    case BeforeMoney:
+      currency.prepend(sign);
+      break;
+    case AfterMoney:
+      currency.append(sign);
+      break;
+    }
+
+  if (neg?negativePrefixCurrencySymbol():
+      positivePrefixCurrencySymbol())
+    {
+      res.prepend(' ');
+      res.prepend(currency);
+    } else {
+      res.append (' ');
+      res.append (currency);
+    }
+
+  return res;
+}
+
+QString KLocale::formatMoney(const QString &numStr) const
+{
+  return formatMoney(numStr.toDouble());
+}
+
+QString KLocale::formatNumber(double num, int precision) const
+{
+  bool neg = num < 0;
+  if (precision == -1) precision = 2;
+  QString res = QString::number(neg?-num:num, 'f', precision);
+  int pos = res.find('.');
+  if (pos == -1) pos = res.length();
+  else res.replace(pos, 1, decimalSymbol());
+
+  while (0 < (pos -= 3))
+    res.insert(pos, thousandsSeparator());
+
+
+  res.prepend(neg?negativeSign():positiveSign());
+
+  return res;
+}
+
+QString KLocale::formatLong(long num) const
+{
+  return formatNumber((double)num, 0);
+}
+
+QString KLocale::formatNumber(const QString &numStr) const
+{
+  return formatNumber(numStr.toDouble());
+}
+
+QString KLocale::formatDate(const QDate &pDate, bool shortFormat) const
+{
+  const QString rst = shortFormat?dateFormatShort():dateFormat();
+
+  QString buffer;
+
+  bool escape = false;
+  int number = 0;
+
+  int year = calendar()->year(pDate);
+  int month = calendar()->month(pDate);
+  int day = calendar()->day(pDate);
+
+  for ( uint format_index = 0; format_index < rst.length(); ++format_index )
+    {
+      if ( !escape )
+        {
+          if ( rst.at( format_index ).unicode() == '%' )
+            escape = true;
+          else
+            buffer.append(rst.at(format_index));
+        }
+      else
+        {
+          switch ( rst.at( format_index ).unicode() )
+            {
+            case '%':
+              buffer.append('%');
+              break;
+            case 'Y':
+              buffer.append(calendar()->yearString(pDate, false));
+              break;
+            case 'y':
+              buffer.append(calendar()->yearString(pDate, true));
+              break;
+            case 'n':
+              buffer.append(calendar()->monthString(pDate, true));
+              break;
+            case 'e':
+              buffer.append(calendar()->dayString(pDate, false));
+              break;
+            case 'm':
+              buffer.append(calendar()->monthString(pDate, false));
+              break;
+            case 'b':
+              if (d->nounDeclension && d->dateMonthNamePossessive)
+                buffer.append(calendar()->monthNamePossessive(month, year, true));
+              else
+                buffer.append(calendar()->monthName(month, year, true));
+              break;
+            case 'B':
+              if (d->nounDeclension && d->dateMonthNamePossessive)
+                buffer.append(calendar()->monthNamePossessive(month, year, false));
+              else
+                buffer.append(calendar()->monthName(month, year, false));
+              break;
+            case 'd':
+              buffer.append(calendar()->dayString(pDate, false));
+              break;
+            case 'a':
+              buffer.append(calendar()->weekDayName(pDate, true));
+              break;
+            case 'A':
+              buffer.append(calendar()->weekDayName(pDate, false));
+              break;
+            default:
+              buffer.append(rst.at(format_index));
+              break;
+            }
+          escape = false;
+        }
+    }
+  return buffer;
+}
+
+void KLocale::setMainCatalogue(const char *catalogue)
+{
+  maincatalogue = catalogue;
+}
+
+double KLocale::readNumber(const QString &_str, bool * ok) const
+{
+  QString str = _str.stripWhiteSpace();
+  bool neg = str.find(negativeSign()) == 0;
+  if (neg)
+    str.remove( 0, negativeSign().length() );
+
+
+
+
+  QString exponentialPart;
+  int EPos;
+
+  EPos = str.find('E', 0, false);
+
+  if (EPos != -1)
+  {
+    exponentialPart = str.mid(EPos);
+    str = str.left(EPos);
+  }
+
+  int pos = str.find(decimalSymbol());
+  QString major;
+  QString minor;
+  if ( pos == -1 )
+    major = str;
+  else
+    {
+      major = str.left(pos);
+      minor = str.mid(pos + decimalSymbol().length());
+    }
+
+
+  int thlen = thousandsSeparator().length();
+  int lastpos = 0;
+  while ( ( pos = major.find( thousandsSeparator() ) ) > 0 )
+  {
+
+    int fromEnd = major.length() - pos;
+    if ( fromEnd % (3+thlen) != 0
+        || pos - lastpos > 3
+        || pos == 0
+        || (lastpos>0 && pos-lastpos!=3))
+    {
+      if (ok) *ok = false;
+      return 0.0;
+    }
+
+    lastpos = pos;
+    major.remove( pos, thlen );
+  }
+  if (lastpos>0 && major.length()-lastpos!=3)
+  {
+    if (ok) *ok = false;
+    return 0.0;
+  }
+
+  QString tot;
+  if (neg) tot = '-';
+
+  tot += major + '.' + minor + exponentialPart;
+
+  return tot.toDouble(ok);
+}
+
+double KLocale::readMoney(const QString &_str, bool * ok) const
+{
+  QString str = _str.stripWhiteSpace();
+  bool neg = false;
+  bool currencyFound = false;
+
+  int pos = str.find(currencySymbol());
+  if ( pos == 0 || pos == (int) str.length()-1 )
+    {
+      str.remove(pos,currencySymbol().length());
+      str = str.stripWhiteSpace();
+      currencyFound = true;
+    }
+  if (str.isEmpty())
+    {
+      if (ok) *ok = false;
+      return 0;
+    }
+
+
+  if (negativeMonetarySignPosition() == ParensAround)
+    {
+      if (str[0] == '(' && str[str.length()-1] == ')')
+        {
+          neg = true;
+          str.remove(str.length()-1,1);
+          str.remove(0,1);
+        }
+    }
+  else
+    {
+      int i1 = str.find(negativeSign());
+      if ( i1 == 0 || i1 == (int) str.length()-1 )
+        {
+          neg = true;
+          str.remove(i1,negativeSign().length());
+        }
+    }
+  if (neg) str = str.stripWhiteSpace();
+
+
+
+  if ( !currencyFound )
+    {
+      pos = str.find(currencySymbol());
+      if ( pos == 0 || pos == (int) str.length()-1 )
+        {
+          str.remove(pos,currencySymbol().length());
+          str = str.stripWhiteSpace();
+        }
+    }
+
+
+  pos = str.find(monetaryDecimalSymbol());
+  QString major;
+  QString minior;
+  if (pos == -1)
+    major = str;
+  else
+    {
+      major = str.left(pos);
+      minior = str.mid(pos + monetaryDecimalSymbol().length());
+    }
+
+
+  int thlen = monetaryThousandsSeparator().length();
+  int lastpos = 0;
+  while ( ( pos = major.find( monetaryThousandsSeparator() ) ) > 0 )
+  {
+
+    int fromEnd = major.length() - pos;
+    if ( fromEnd % (3+thlen) != 0
+        || pos - lastpos > 3
+        || pos == 0
+        || (lastpos>0 && pos-lastpos!=3))
+    {
+      if (ok) *ok = false;
+      return 0.0;
+    }
+    lastpos = pos;
+    major.remove( pos, thlen );
+  }
+  if (lastpos>0 && major.length()-lastpos!=3)
+  {
+    if (ok) *ok = false;
+    return 0.0;
+  }
+
+  QString tot;
+  if (neg) tot = '-';
+  tot += major + '.' + minior;
+  return tot.toDouble(ok);
+}
+
+
+
+
+
+
+
+static int readInt(const QString &str, uint &pos)
+{
+  if (!str.at(pos).isDigit()) return -1;
+  int result = 0;
+  for (; str.length() > pos && str.at(pos).isDigit(); pos++)
+    {
+      result *= 10;
+      result += str.at(pos).digitValue();
+    }
+
+  return result;
+}
+
+QDate KLocale::readDate(const QString &intstr, bool* ok) const
+{
+  QDate date;
+  date = readDate(intstr, ShortFormat, ok);
+  if (date.isValid()) return date;
+  return readDate(intstr, NormalFormat, ok);
+}
+
+QDate KLocale::readDate(const QString &intstr, ReadDateFlags flags, bool* ok) const
+{
+  QString fmt = ((flags & ShortFormat) ? dateFormatShort() : dateFormat()).simplifyWhiteSpace();
+  return readDate( intstr, fmt, ok );
+}
+
+QDate KLocale::readDate(const QString &intstr, const QString &fmt, bool* ok) const
+{
+
+  QString str = intstr.simplifyWhiteSpace().lower();
+  int day = -1, month = -1;
+
+  int year = calendar()->year(QDate::currentDate());
+  uint strpos = 0;
+  uint fmtpos = 0;
+
+  int iLength;
+
+  bool error = false;
+
+  while (fmt.length() > fmtpos && str.length() > strpos && !error)
+  {
+
+    QChar c = fmt.at(fmtpos++);
+
+    if (c != '%') {
+      if (c.isSpace() && str.at(strpos).isSpace())
+        strpos++;
+      else if (c != str.at(strpos++))
+        error = true;
+    }
+    else
+    {
+      int j;
+
+      if (str.length() > strpos && str.at(strpos).isSpace())
+        strpos++;
+
+      c = fmt.at(fmtpos++);
+      switch (c)
+      {
+        case 'a':
+        case 'A':
+
+          error = true;
+          j = 1;
+          while (error && (j < 8)) {
+            QString s = weekDayName(j, c == 'a').lower();
+            int len = s.length();
+            if (str.mid(strpos, len) == s)
+            {
+              strpos += len;
+              error = false;
+            }
+            j++;
+          }
+          break;
+        case 'b':
+        case 'B':
+
+          error = true;
+          if (d->nounDeclension && d->dateMonthNamePossessive) {
+            j = 1;
+            while (error && (j < 13)) {
+              QString s = calendar()->monthNamePossessive(j, year, c == 'b').lower();
+              int len = s.length();
+              if (str.mid(strpos, len) == s) {
+                month = j;
+                strpos += len;
+                error = false;
+              }
+              j++;
+            }
+          }
+          j = 1;
+          while (error && (j < 13)) {
+            QString s = calendar()->monthName(j, year, c == 'b').lower();
+            int len = s.length();
+            if (str.mid(strpos, len) == s) {
+              month = j;
+              strpos += len;
+              error = false;
+            }
+            j++;
+          }
+          break;
+        case 'd':
+        case 'e':
+          day = calendar()->dayStringToInteger(str.mid(strpos), iLength);
+          strpos += iLength;
+
+          error = iLength <= 0;
+          break;
+
+        case 'n':
+        case 'm':
+          month = calendar()->monthStringToInteger(str.mid(strpos), iLength);
+          strpos += iLength;
+
+          error = iLength <= 0;
+          break;
+
+        case 'Y':
+        case 'y':
+          year = calendar()->yearStringToInteger(str.mid(strpos), iLength);
+          strpos += iLength;
+
+          error = iLength <= 0;
+          break;
+      }
+    }
+  }
+
+
+
+  if ( fmt.length() > fmtpos || str.length() > strpos )
+  {
+    error = true;
+  }
+
+
+  if ( year != -1 && month != -1 && day != -1 && !error)
+  {
+    if (ok) *ok = true;
+
+    QDate result;
+    calendar()->setYMD(result, year, month, day);
+
+    return result;
+  }
+  else
+  {
+    if (ok) *ok = false;
+    return QDate();
+  }
+}
+
+QTime KLocale::readTime(const QString &intstr, bool *ok) const
+{
+  QTime _time;
+  _time = readTime(intstr, WithSeconds, ok);
+  if (_time.isValid()) return _time;
+  return readTime(intstr, WithoutSeconds, ok);
+}
+
+QTime KLocale::readTime(const QString &intstr, ReadTimeFlags flags, bool *ok) const
+{
+  QString str = intstr.simplifyWhiteSpace().lower();
+  QString Format = timeFormat().simplifyWhiteSpace();
+  if (flags & WithoutSeconds)
+    Format.remove(QRegExp(".%S"));
+
+  int hour = -1, minute = -1;
+  int second = ( flags & WithoutSeconds == 0 ) ? -1 : 0;
+  bool g_12h = false;
+  bool pm = false;
+  uint strpos = 0;
+  uint Formatpos = 0;
+
+  while (Format.length() > Formatpos || str.length() > strpos)
+    {
+      if ( !(Format.length() > Formatpos && str.length() > strpos) ) goto error;
+
+      QChar c = Format.at(Formatpos++);
+
+      if (c != '%')
+        {
+          if (c.isSpace())
+            strpos++;
+          else if (c != str.at(strpos++))
+            goto error;
+          continue;
+        }
+
+
+      if (str.length() > strpos && str.at(strpos).isSpace())
+        strpos++;
+
+      c = Format.at(Formatpos++);
+      switch (c)
+        {
+        case 'p':
+          {
+            QString s;
+            s = translate("pm").lower();
+            int len = s.length();
+            if (str.mid(strpos, len) == s)
+              {
+                pm = true;
+                strpos += len;
+              }
+            else
+              {
+                s = translate("am").lower();
+                len = s.length();
+                if (str.mid(strpos, len) == s) {
+                  pm = false;
+                  strpos += len;
+                }
+                else
+                  goto error;
+              }
+          }
+          break;
+
+        case 'k':
+        case 'H':
+          g_12h = false;
+          hour = readInt(str, strpos);
+          if (hour < 0 || hour > 23)
+            goto error;
+
+          break;
+
+        case 'l':
+        case 'I':
+          g_12h = true;
+          hour = readInt(str, strpos);
+          if (hour < 1 || hour > 12)
+            goto error;
+
+          break;
+
+        case 'M':
+          minute = readInt(str, strpos);
+          if (minute < 0 || minute > 59)
+            goto error;
+
+          break;
+
+        case 'S':
+          second = readInt(str, strpos);
+          if (second < 0 || second > 59)
+            goto error;
+
+          break;
+        }
+    }
+  if (g_12h) {
+    hour %= 12;
+    if (pm) hour += 12;
+  }
+
+  if (ok) *ok = true;
+  return QTime(hour, minute, second);
+
+ error:
+  if (ok) *ok = false;
+  return QTime(-1, -1, -1);
+}
+
+QString KLocale::formatTime(const QTime &pTime, bool includeSecs) const
+{
+  const QString rst = timeFormat();
+
+
+
+  QChar *buffer = new QChar[rst.length() * 3 / 2 + 30];
+
+  uint index = 0;
+  bool escape = false;
+  int number = 0;
+
+  for ( uint format_index = 0; format_index < rst.length(); format_index++ )
+    {
+      if ( !escape )
+        {
+          if ( rst.at( format_index ).unicode() == '%' )
+            escape = true;
+          else
+            buffer[index++] = rst.at( format_index );
+        }
+      else
+        {
+          switch ( rst.at( format_index ).unicode() )
+            {
+            case '%':
+              buffer[index++] = '%';
+              break;
+            case 'H':
+              put_it_in( buffer, index, pTime.hour() );
+              break;
+            case 'I':
+              put_it_in( buffer, index, ( pTime.hour() + 11) % 12 + 1 );
+              break;
+            case 'M':
+              put_it_in( buffer, index, pTime.minute() );
+              break;
+            case 'S':
+              if (includeSecs)
+                put_it_in( buffer, index, pTime.second() );
+              else if ( index > 0 )
+                {
+
+
+                  --index;
+                  break;
+                }
+              break;
+            case 'k':
+              number = pTime.hour();
+            case 'l':
+
+              if ( rst.at( format_index ).unicode() == 'l' )
+                number = (pTime.hour() + 11) % 12 + 1;
+              if ( number / 10 )
+                buffer[index++] = number / 10 + '0';
+              buffer[index++] = number % 10 + '0';
+              break;
+            case 'p':
+              {
+                QString s;
+                if ( pTime.hour() >= 12 )
+                  put_it_in( buffer, index, translate("pm") );
+                else
+                  put_it_in( buffer, index, translate("am") );
+                break;
+              }
+            default:
+              buffer[index++] = rst.at( format_index );
+              break;
+            }
+          escape = false;
+        }
+    }
+  QString ret( buffer, index );
+  delete [] buffer;
+  return ret;
+}
+
+bool KLocale::use12Clock() const
+{
+  if ((timeFormat().contains(QString::fromLatin1("%I")) > 0) ||
+      (timeFormat().contains(QString::fromLatin1("%l")) > 0))
+    return true;
+  else
+    return false;
+}
+
+QString KLocale::languages() const
+{
+  return d->languageList.join( QString::fromLatin1(":") );
+}
+
+QStringList KLocale::languageList() const
+{
+  return d->languageList;
+}
+
+QString KLocale::formatDateTime(const QDateTime &pDateTime,
+                                bool shortFormat,
+                                bool includeSeconds) const
+{
+  return translate("concatenation of dates and time", "%1 %2")
+    .arg( formatDate( pDateTime.date(), shortFormat ) )
+    .arg( formatTime( pDateTime.time(), includeSeconds ) );
+}
+
+QString i18n(const char* text)
+{
+  register KLocale *instance = KGlobal::locale();
+  if (instance)
+    return instance->translate(text);
+  return QString::fromUtf8(text);
+}
+
+QString i18n(const char* index, const char *text)
+{
+  register KLocale *instance = KGlobal::locale();
+  if (instance)
+    return instance->translate(index, text);
+  return QString::fromUtf8(text);
+}
+
+QString i18n(const char* singular, const char* plural, unsigned long n)
+{
+  register KLocale *instance = KGlobal::locale();
+  if (instance)
+    return instance->translate(singular, plural, n);
+  if (n == 1)
+    return put_n_in(QString::fromUtf8(singular), n);
+  else
+    return put_n_in(QString::fromUtf8(plural), n);
+}
+
+void KLocale::initInstance()
+{
+  if (KGlobal::_locale)
+    return;
+
+  KInstance *app = KGlobal::instance();
+  if (app) {
+    KGlobal::_locale = new KLocale(QString::fromLatin1(app->instanceName()));
+
+
+    QTextCodec::setCodecForLocale(KGlobal::_locale->codecForEncoding());
+  }
+  else
+    kdDebug(173) << "no app name available using KLocale - nothing to do\n";
+}
+
+QString KLocale::langLookup(const QString &fname, const char *rtype)
+{
+  QStringList search;
+
+
+  const QStringList localDoc = KGlobal::dirs()->resourceDirs(rtype);
+
+
+  for (int id=localDoc.count()-1; id >= 0; --id)
+    {
+      QStringList langs = KGlobal::locale()->languageList();
+      langs.append( "en" );
+      langs.remove( defaultLanguage() );
+      QStringList::ConstIterator lang;
+      for (lang = langs.begin(); lang != langs.end(); ++lang)
+        search.append(QString("%1%2/%3").arg(localDoc[id]).arg(*lang).arg(fname));
+    }
+
+
+  QStringList::Iterator it;
+  for (it = search.begin(); it != search.end(); ++it)
+    {
+      kdDebug(173) << "Looking for help in: " << *it << endl;
+
+      QFileInfo info(*it);
+      if (info.exists() && info.isFile() && info.isReadable())
+        return *it;
+    }
+
+  return QString::null;
+}
+
+bool KLocale::useDefaultLanguage() const
+{
+  return language() == defaultLanguage();
+}
+
+void KLocale::initEncoding(KConfig *)
+{
+  const int mibDefault = 4;
+
+
+  setEncoding( QTextCodec::codecForLocale()->mibEnum() );
+
+  if ( !d->codecForEncoding )
+    {
+      kdWarning(173) << " Defaulting to ISO 8859-1 encoding." << endl;
+      setEncoding(mibDefault);
+    }
+
+  ((d->codecForEncoding) ? (void)0 : qWarning("ASSERT: \"%s\" in %s (%d)","d->codecForEncoding","/coolo/prod/kdelibs/kdecore/klocale.cpp",1817));
+}
+
+void KLocale::initFileNameEncoding(KConfig *)
+{
+
+
+  d->utf8FileEncoding = getenv("KDE_UTF8_FILENAMES") != 0;
+  if (d->utf8FileEncoding)
+  {
+    QFile::setEncodingFunction(KLocale::encodeFileNameUTF8);
+    QFile::setDecodingFunction(KLocale::decodeFileNameUTF8);
+  }
+
+
+}
+
+QCString KLocale::encodeFileNameUTF8( const QString & fileName )
+{
+  return fileName.utf8();
+}
+
+QString KLocale::decodeFileNameUTF8( const QCString & localFileName )
+{
+  return QString::fromUtf8(localFileName);
+}
+
+void KLocale::initCatalogue( KCatalogue & catalogue )
+{
+  catalogue.setFileName( catalogueFileName( language(), catalogue ) );
+}
+
+void KLocale::setDateFormat(const QString & format)
+{
+  doFormatInit();
+  m_dateFormat = format.stripWhiteSpace();
+}
+
+void KLocale::setDateFormatShort(const QString & format)
+{
+  doFormatInit();
+  m_dateFormatShort = format.stripWhiteSpace();
+}
+
+void KLocale::setDateMonthNamePossessive(bool possessive)
+{
+  doFormatInit();
+  d->dateMonthNamePossessive = possessive;
+}
+
+void KLocale::setTimeFormat(const QString & format)
+{
+  doFormatInit();
+  m_timeFormat = format.stripWhiteSpace();
+}
+
+void KLocale::setWeekStartsMonday(bool start)
+{
+  doFormatInit();
+  if (start)
+    d->weekStartDay = 1;
+  else
+    d->weekStartDay = 7;
+}
+
+void KLocale::setWeekStartDay(int day)
+{
+  doFormatInit();
+  if (day>7 || day<1)
+    d->weekStartDay = 1;
+  else
+    d->weekStartDay = day;
+}
+
+QString KLocale::dateFormat() const
+{
+  doFormatInit();
+  return m_dateFormat;
+}
+
+QString KLocale::dateFormatShort() const
+{
+  doFormatInit();
+  return m_dateFormatShort;
+}
+
+QString KLocale::timeFormat() const
+{
+  doFormatInit();
+  return m_timeFormat;
+}
+
+void KLocale::setDecimalSymbol(const QString & symbol)
+{
+  doFormatInit();
+  m_decimalSymbol = symbol.stripWhiteSpace();
+}
+
+void KLocale::setThousandsSeparator(const QString & separator)
+{
+  doFormatInit();
+
+  m_thousandsSeparator = separator;
+}
+
+void KLocale::setPositiveSign(const QString & sign)
+{
+  doFormatInit();
+  m_positiveSign = sign.stripWhiteSpace();
+}
+
+void KLocale::setNegativeSign(const QString & sign)
+{
+  doFormatInit();
+  m_negativeSign = sign.stripWhiteSpace();
+}
+
+void KLocale::setPositiveMonetarySignPosition(SignPosition signpos)
+{
+  doFormatInit();
+  m_positiveMonetarySignPosition = signpos;
+}
+
+void KLocale::setNegativeMonetarySignPosition(SignPosition signpos)
+{
+  doFormatInit();
+  m_negativeMonetarySignPosition = signpos;
+}
+
+void KLocale::setPositivePrefixCurrencySymbol(bool prefix)
+{
+  doFormatInit();
+  m_positivePrefixCurrencySymbol = prefix;
+}
+
+void KLocale::setNegativePrefixCurrencySymbol(bool prefix)
+{
+  doFormatInit();
+  m_negativePrefixCurrencySymbol = prefix;
+}
+
+void KLocale::setFracDigits(int digits)
+{
+  doFormatInit();
+  m_fracDigits = digits;
+}
+
+void KLocale::setMonetaryThousandsSeparator(const QString & separator)
+{
+  doFormatInit();
+
+  m_monetaryThousandsSeparator = separator;
+}
+
+void KLocale::setMonetaryDecimalSymbol(const QString & symbol)
+{
+  doFormatInit();
+  m_monetaryDecimalSymbol = symbol.stripWhiteSpace();
+}
+
+void KLocale::setCurrencySymbol(const QString & symbol)
+{
+  doFormatInit();
+  m_currencySymbol = symbol.stripWhiteSpace();
+}
+
+int KLocale::pageSize() const
+{
+  doFormatInit();
+  return d->pageSize;
+}
+
+void KLocale::setPageSize(int pageSize)
+{
+
+  doFormatInit();
+  d->pageSize = pageSize;
+}
+
+KLocale::MeasureSystem KLocale::measureSystem() const
+{
+  doFormatInit();
+  return d->measureSystem;
+}
+
+void KLocale::setMeasureSystem(MeasureSystem value)
+{
+  doFormatInit();
+  d->measureSystem = value;
+}
+
+QString KLocale::defaultLanguage()
+{
+  return QString::fromLatin1("en_US");
+}
+
+QString KLocale::defaultCountry()
+{
+  return QString::fromLatin1("C");
+}
+
+const char * KLocale::encoding() const
+{
+  return codecForEncoding()->name();
+}
+
+int KLocale::encodingMib() const
+{
+  return codecForEncoding()->mibEnum();
+}
+
+int KLocale::fileEncodingMib() const
+{
+  if (d->utf8FileEncoding)
+     return 106;
+  return codecForEncoding()->mibEnum();
+}
+
+QTextCodec * KLocale::codecForEncoding() const
+{
+  return d->codecForEncoding;
+}
+
+bool KLocale::setEncoding(int mibEnum)
+{
+  QTextCodec * codec = QTextCodec::codecForMib(mibEnum);
+  if (codec)
+    d->codecForEncoding = codec;
+
+  return codec != 0;
+}
+
+QStringList KLocale::languagesTwoAlpha() const
+{
+  if (d->langTwoAlpha.count())
+     return d->langTwoAlpha;
+
+  const QStringList &origList = languageList();
+
+  QStringList result;
+
+  KConfig config(QString::fromLatin1("language.codes"), true, false);
+  config.setGroup("TwoLetterCodes");
+
+  for ( QStringList::ConstIterator it = origList.begin();
+        it != origList.end();
+        ++it )
+    {
+      QString lang = *it;
+      QStringList langLst;
+      if (config.hasKey( lang ))
+         langLst = config.readListEntry( lang );
+      else
+      {
+         int i = lang.find('_');
+         if (i >= 0)
+            lang.truncate(i);
+         langLst << lang;
+      }
+
+      for ( QStringList::ConstIterator langIt = langLst.begin();
+            langIt != langLst.end();
+            ++langIt )
+        {
+          if ( !(*langIt).isEmpty() && !result.contains( *langIt ) )
+            result += *langIt;
+        }
+    }
+  d->langTwoAlpha = result;
+  return result;
+}
+
+QStringList KLocale::allLanguagesTwoAlpha() const
+{
+  if (!d->languages)
+    d->languages = new KConfig("all_languages", true, false, "locale");
+
+  return d->languages->groupList();
+}
+
+QString KLocale::twoAlphaToLanguageName(const QString &code) const
+{
+  if (!d->languages)
+    d->languages = new KConfig("all_languages", true, false, "locale");
+
+  d->languages->setGroup(code.lower());
+  return d->languages->readEntry("Name");
+}
+
+QStringList KLocale::allCountriesTwoAlpha() const
+{
+  QStringList countries;
+  QStringList paths = KGlobal::dirs()->findAllResources("locale", "l10n/*/entry.desktop");
+  for(QStringList::ConstIterator it = paths.begin();
+      it != paths.end(); ++it)
+  {
+    QString code = (*it).mid((*it).length()-16, 2);
+    if (code != "/C")
+       countries.append(code);
+  }
+  return countries;
+}
+
+QString KLocale::twoAlphaToCountryName(const QString &code) const
+{
+  KConfig cfg("l10n/"+code.lower()+"/entry.desktop", true, false, "locale");
+  cfg.setGroup("KCM Locale");
+  return cfg.readEntry("Name");
+}
+
+void KLocale::setCalendar(const QString & calType)
+{
+  doFormatInit();
+
+  d->calendarType = calType;
+
+  delete d->calendar;
+  d->calendar = 0;
+}
+
+QString KLocale::calendarType() const
+{
+  doFormatInit();
+
+  return d->calendarType;
+}
+
+const KCalendarSystem * KLocale::calendar() const
+{
+  doFormatInit();
+
+
+  if ( !d->calendar )
+    d->calendar = KCalendarSystemFactory::create( d->calendarType, this );
+
+  return d->calendar;
+}
+
+KLocale::KLocale(const KLocale & rhs)
+{
+  d = new KLocalePrivate;
+
+  *this = rhs;
+}
+
+KLocale & KLocale::operator=(const KLocale & rhs)
+{
+
+  m_decimalSymbol = rhs.m_decimalSymbol;
+  m_thousandsSeparator = rhs.m_thousandsSeparator;
+  m_currencySymbol = rhs.m_currencySymbol;
+  m_monetaryDecimalSymbol = rhs.m_monetaryDecimalSymbol;
+  m_monetaryThousandsSeparator = rhs.m_monetaryThousandsSeparator;
+  m_positiveSign = rhs.m_positiveSign;
+  m_negativeSign = rhs.m_negativeSign;
+  m_fracDigits = rhs.m_fracDigits;
+  m_positivePrefixCurrencySymbol = rhs.m_positivePrefixCurrencySymbol;
+  m_negativePrefixCurrencySymbol = rhs.m_negativePrefixCurrencySymbol;
+  m_positiveMonetarySignPosition = rhs.m_positiveMonetarySignPosition;
+  m_negativeMonetarySignPosition = rhs.m_negativeMonetarySignPosition;
+
+
+  m_timeFormat = rhs.m_timeFormat;
+  m_dateFormat = rhs.m_dateFormat;
+  m_dateFormatShort = rhs.m_dateFormatShort;
+
+  m_language = rhs.m_language;
+  m_country = rhs.m_country;
+
+
+  *d = *rhs.d;
+  d->languages = 0;
+  d->calendar = 0;
+
+  return *this;
+}
+
+bool KLocale::setCharset(const QString & ) { return true; }
+QString KLocale::charset() const { return QString::fromLatin1("UTF-8"); }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C"
+
+int mkstemps(char *, int);
+extern "C"
+
+unsigned long strlcat(char*, const char*, unsigned long);
+
+
+
+
+
+
+extern "C"
+
+unsigned long strlcpy(char*, const char*, unsigned long);
+
+
+
+
+
+
+
+
+
+
+
+class KRFCDate
+{
+public:
+   static time_t parseDate(const QString &date);
+   static time_t parseDateISO8601(const QString &date);
+
+
+
+
+
+   static int localUTCOffset();
+   static QCString rfc2822DateString(time_t utcTime, int utcOffset);
+   static QCString rfc2822DateString(time_t utcTime);
+
+};
+
+static unsigned int ymdhms_to_seconds(int year, int mon, int day, int hour, int minute, int second)
+{
+    if (sizeof(time_t) == 4)
+    {
+       if ((time_t)-1 < 0)
+       {
+          if (year >= 2038)
+          {
+             year = 2038;
+             mon = 0;
+             day = 1;
+             hour = 0;
+             minute = 0;
+             second = 0;
+          }
+       }
+       else
+       {
+          if (year >= 2115)
+          {
+             year = 2115;
+             mon = 0;
+             day = 1;
+             hour = 0;
+             minute = 0;
+             second = 0;
+          }
+       }
+    }
+
+    unsigned int ret = (day - 32075)
+            + 1461L * (year + 4800L + (mon - 14) / 12) / 4
+            + 367 * (mon - 2 - (mon - 14) / 12 * 12) / 12
+            - 3 * ((year + 4900L + (mon - 14) / 12) / 100) / 4
+            - 2440588;
+    ret = 24*ret + hour;
+    ret = 60*ret + minute;
+    ret = 60*ret + second;
+
+    return ret;
+}
+
+static const char haystack[37]="janfebmaraprmayjunjulaugsepoctnovdec";
+
+
+
+static const struct {
+    const char *tzName;
+    int tzOffset;
+} known_zones[] = {
+    { "UT", 0 },
+    { "GMT", 0 },
+    { "EST", -300 },
+    { "EDT", -240 },
+    { "CST", -360 },
+    { "CDT", -300 },
+    { "MST", -420 },
+    { "MDT", -360 },
+    { "PST", -480 },
+    { "PDT", -420 },
+    { 0, 0 }
+};
+
+time_t
+KRFCDate::parseDate(const QString &_date)
+{
+     time_t result = 0;
+     int offset = 0;
+     char *newPosStr;
+     const char *dateString = _date.latin1();
+     int day = 0;
+     char monthStr[4];
+     int month = -1;
+     int year = 0;
+     int hour = 0;
+     int minute = 0;
+     int second = 0;
+
+
+     while(*dateString && isspace(*dateString))
+        dateString++;
+
+
+     while(*dateString && !isdigit(*dateString) && !isspace(*dateString))
+        dateString++;
+
+
+     while(*dateString && isspace(*dateString))
+        dateString++;
+
+     if (!*dateString)
+        return result;
+
+     if (isalpha(*dateString))
+     {
+
+
+        while(*dateString && isspace(*dateString))
+           dateString++;
+
+        for(int i=0; i < 3;i++)
+        {
+           if (!*dateString || (*dateString == '-') || isspace(*dateString))
+              return result;
+           monthStr[i] = tolower(*dateString++);
+        }
+        monthStr[3] = '\0';
+
+        newPosStr = (char*)strstr(haystack, monthStr);
+
+        if (!newPosStr)
+           return result;
+
+        month = (newPosStr-haystack)/3;
+
+        if ((month < 0) || (month > 11))
+           return result;
+
+        while (*dateString && isalpha(*dateString))
+           dateString++;
+     }
+
+
+
+     day = strtol(dateString, &newPosStr, 10);
+     dateString = newPosStr;
+
+     if ((day < 1) || (day > 31))
+         return result;
+
+     if (!*dateString)
+        return result;
+
+     while(*dateString && (isspace(*dateString) || (*dateString == '-')))
+        dateString++;
+
+     if (month == -1)
+     {
+        for(int i=0; i < 3;i++)
+        {
+           if (!*dateString || (*dateString == '-') || isspace(*dateString))
+              return result;
+           monthStr[i] = tolower(*dateString++);
+        }
+        monthStr[3] = '\0';
+
+        newPosStr = (char*)strstr(haystack, monthStr);
+
+        if (!newPosStr)
+           return result;
+
+        month = (newPosStr-haystack)/3;
+
+        if ((month < 0) || (month > 11))
+           return result;
+
+        while (*dateString && isalpha(*dateString))
+           dateString++;
+
+     }
+
+
+     while(*dateString && (isspace(*dateString) || (*dateString == '-')))
+        dateString++;
+
+     if (!*dateString || !isdigit(*dateString))
+        return result;
+
+
+     year = strtol(dateString, &newPosStr, 10);
+     dateString = newPosStr;
+
+
+     if ((year >= 0) && (year < 50))
+         year += 2000;
+
+     if ((year >= 50) && (year < 100))
+         year += 1900;
+
+     if ((year < 1900) || (year > 2500))
+        return result;
+
+
+     if (*dateString)
+     {
+
+        if (!isspace(*dateString++))
+           return result;
+
+        hour = strtol(dateString, &newPosStr, 10);
+        dateString = newPosStr;
+
+        if ((hour < 0) || (hour > 23))
+           return result;
+
+        if (!*dateString)
+           return result;
+
+
+        if (*dateString++ != ':')
+           return result;
+
+        minute = strtol(dateString, &newPosStr, 10);
+        dateString = newPosStr;
+
+        if ((minute < 0) || (minute > 59))
+           return result;
+
+        if (!*dateString)
+           return result;
+
+
+        if (*dateString != ':' && !isspace(*dateString))
+           return result;
+
+
+        if (*dateString ==':') {
+           dateString++;
+
+           second = strtol(dateString, &newPosStr, 10);
+           dateString = newPosStr;
+
+           if ((second < 0) || (second > 59))
+              return result;
+        } else {
+           dateString++;
+        }
+
+        while(*dateString && isspace(*dateString))
+           dateString++;
+     }
+
+
+
+     if (*dateString) {
+        if ((strncasecmp(dateString, "gmt", 3) == 0) ||
+            (strncasecmp(dateString, "utc", 3) == 0))
+        {
+           dateString += 3;
+           while(*dateString && isspace(*dateString))
+              dateString++;
+        }
+
+        if ((*dateString == '+') || (*dateString == '-')) {
+           offset = strtol(dateString, &newPosStr, 10);
+           if (abs(offset) < 30)
+           {
+              dateString = newPosStr;
+
+              offset = offset * 100;
+
+              if (*dateString && *(dateString+1))
+              {
+                 dateString++;
+                 int minutes = strtol(dateString, &newPosStr, 10);
+                 if (offset > 0)
+                    offset += minutes;
+                 else
+                    offset -= minutes;
+              }
+           }
+
+           if ((offset < -9959) || (offset > 9959))
+              return result;
+
+           int sgn = (offset < 0)? -1:1;
+           offset = abs(offset);
+           offset = ((offset / 100)*60 + (offset % 100))*sgn;
+        } else {
+           for (int i=0; known_zones[i].tzName != 0; i++) {
+              if (0 == strncasecmp(dateString, known_zones[i].tzName, strlen(known_zones[i].tzName))) {
+                 offset = known_zones[i].tzOffset;
+                 break;
+              }
+           }
+        }
+     }
+
+     result = ymdhms_to_seconds(year, month+1, day, hour, minute, second);
+
+
+     if ((offset > 0) && (offset > result))
+        offset = 0;
+
+     result -= offset*60;
+
+
+
+
+     if (result < 1) result = 1;
+
+     return result;
+}
+
+time_t
+KRFCDate::parseDateISO8601( const QString& input)
+{
+
+
+
+
+
+
+  unsigned int year = 0;
+  unsigned int month = 0;
+  unsigned int mday = 0;
+  unsigned int hour = 0;
+  unsigned int min = 0;
+  unsigned int sec = 0;
+
+  int offset = 0;
+
+
+  int tPos = input.find('T');
+
+  if (-1 == tPos)
+    return 0;
+
+
+
+  QString dateString = input.left(tPos).stripWhiteSpace();
+
+  QString timeString = input.mid(tPos + 1).stripWhiteSpace();
+
+  QStringList l = QStringList::split('-', dateString);
+
+  year = l[0].toUInt();
+  month = l[1].toUInt();
+  mday = l[2].toUInt();
+
+
+  if ('Z' == timeString.at(timeString.length() - 1)) {
+    timeString.remove(timeString.length() - 1, 1);
+  }
+
+
+
+  int plusPos = timeString.findRev('+');
+
+  if (-1 != plusPos) {
+    QString offsetString = timeString.mid(plusPos + 1);
+
+    offset = offsetString.left(2).toUInt() * 60 + offsetString.right(2).toUInt();
+
+    timeString = timeString.left(plusPos);
+  } else {
+    int minusPos = timeString.findRev('-');
+
+    if (-1 != minusPos) {
+      QString offsetString = timeString.mid(minusPos + 1);
+
+      offset = - (offsetString.left(2).toUInt() * 60 + offsetString.right(2).toUInt());
+
+      timeString = timeString.left(minusPos);
+    }
+  }
+
+
+  int dotPos = timeString.findRev('.');
+
+  if (-1 != dotPos) {
+    timeString = timeString.left(dotPos);
+  }
+
+
+
+  l = QStringList::split(':', timeString);
+
+  hour = l[0].toUInt();
+  min = l[1].toUInt();
+  sec = l[2].toUInt();
+
+  time_t result = ymdhms_to_seconds(year, month, mday, hour, min, sec);
+
+
+  if ((offset > 0) && (offset > result))
+     offset = 0;
+
+  result -= offset*60;
+
+
+
+
+  if (result < 1) result = 1;
+
+  return result;
+}
+
+
+int KRFCDate::localUTCOffset()
+{
+  time_t timeNow = time((time_t*) 0);
+
+  tm *tM = gmtime(&timeNow);
+  unsigned int timeUTC = ymdhms_to_seconds(tM->tm_year+1900, tM->tm_mon+1, tM->tm_mday,
+                                           tM->tm_hour, tM->tm_min, tM->tm_sec);
+
+  tM = localtime(&timeNow);
+  unsigned int timeLocal = ymdhms_to_seconds(tM->tm_year+1900, tM->tm_mon+1, tM->tm_mday,
+                                             tM->tm_hour, tM->tm_min, tM->tm_sec);
+
+  return ((int)(timeLocal-timeUTC))/60;
+}
+
+
+static const char * const day_names[] = {
+    "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
+};
+
+static const char * const month_names[] = {
+    "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+    "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
+};
+
+
+QCString KRFCDate::rfc2822DateString(time_t utcTime, int utcOffset)
+{
+    utcTime += utcOffset * 60;
+    tm *tM = gmtime(&utcTime);
+    char sgn = (utcOffset < 0) ? '-' : '+';
+    int z = (utcOffset < 0) ? -utcOffset : utcOffset;
+    QCString dateStr;
+
+    dateStr.sprintf("%s, %02d %s %04d %02d:%02d:%02d %c%02d%02d",
+                    day_names[tM->tm_wday], tM->tm_mday,
+                    month_names[tM->tm_mon], tM->tm_year+1900,
+                    tM->tm_hour, tM->tm_min, tM->tm_sec,
+                    sgn, z/60%24, z%60);
+
+    return dateStr;
+}
+
+
+QCString KRFCDate::rfc2822DateString(time_t utcTime)
+{
+    return rfc2822DateString(utcTime, localUTCOffset());
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C"
+
+int mkstemps(char *, int);
+extern "C"
+
+unsigned long strlcat(char*, const char*, unsigned long);
+
+
+
+
+
+
+extern "C"
+
+unsigned long strlcpy(char*, const char*, unsigned long);
+
+
+
+
+
+
+
+
+extern "C" {
+
+
+
+
+
+
+
+
+
+
+
+
+typedef long double float_t;
+
+typedef long double double_t;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern double acos (double __x) throw (); extern double __acos (double __x) throw ();
+
+extern double asin (double __x) throw (); extern double __asin (double __x) throw ();
+
+extern double atan (double __x) throw (); extern double __atan (double __x) throw ();
+
+extern double atan2 (double __y, double __x) throw (); extern double __atan2 (double __y, double __x) throw ();
+
+
+extern double cos (double __x) throw (); extern double __cos (double __x) throw ();
+
+extern double sin (double __x) throw (); extern double __sin (double __x) throw ();
+
+extern double tan (double __x) throw (); extern double __tan (double __x) throw ();
+
+
+
+
+extern double cosh (double __x) throw (); extern double __cosh (double __x) throw ();
+
+extern double sinh (double __x) throw (); extern double __sinh (double __x) throw ();
+
+extern double tanh (double __x) throw (); extern double __tanh (double __x) throw ();
+
+
+
+
+extern void sincos (double __x, double *__sinx, double *__cosx) throw (); extern void __sincos (double __x, double *__sinx, double *__cosx) throw ();
+
+
+
+
+
+
+extern double acosh (double __x) throw (); extern double __acosh (double __x) throw ();
+
+extern double asinh (double __x) throw (); extern double __asinh (double __x) throw ();
+
+extern double atanh (double __x) throw (); extern double __atanh (double __x) throw ();
+
+
+
+
+
+
+
+extern double exp (double __x) throw (); extern double __exp (double __x) throw ();
+
+
+extern double frexp (double __x, int *__exponent) throw (); extern double __frexp (double __x, int *__exponent) throw ();
+
+
+extern double ldexp (double __x, int __exponent) throw (); extern double __ldexp (double __x, int __exponent) throw ();
+
+
+extern double log (double __x) throw (); extern double __log (double __x) throw ();
+
+
+extern double log10 (double __x) throw (); extern double __log10 (double __x) throw ();
+
+
+extern double modf (double __x, double *__iptr) throw (); extern double __modf (double __x, double *__iptr) throw ();
+
+
+
+
+extern double exp10 (double __x) throw (); extern double __exp10 (double __x) throw ();
+
+extern double pow10 (double __x) throw (); extern double __pow10 (double __x) throw ();
+
+
+
+
+
+extern double expm1 (double __x) throw (); extern double __expm1 (double __x) throw ();
+
+
+extern double log1p (double __x) throw (); extern double __log1p (double __x) throw ();
+
+
+extern double logb (double __x) throw (); extern double __logb (double __x) throw ();
+
+
+
+
+
+
+extern double exp2 (double __x) throw (); extern double __exp2 (double __x) throw ();
+
+
+extern double log2 (double __x) throw (); extern double __log2 (double __x) throw ();
+
+
+
+
+
+
+
+
+extern double pow (double __x, double __y) throw (); extern double __pow (double __x, double __y) throw ();
+
+
+extern double sqrt (double __x) throw (); extern double __sqrt (double __x) throw ();
+
+
+
+
+
+extern double hypot (double __x, double __y) throw (); extern double __hypot (double __x, double __y) throw ();
+
+
+
+
+
+
+extern double cbrt (double __x) throw (); extern double __cbrt (double __x) throw ();
+
+
+
+
+
+
+
+
+extern double ceil (double __x) throw () __attribute__ ((__const__)); extern double __ceil (double __x) throw () __attribute__ ((__const__));
+
+
+extern double fabs (double __x) throw () __attribute__ ((__const__)); extern double __fabs (double __x) throw () __attribute__ ((__const__));
+
+
+extern double floor (double __x) throw () __attribute__ ((__const__)); extern double __floor (double __x) throw () __attribute__ ((__const__));
+
+
+extern double fmod (double __x, double __y) throw (); extern double __fmod (double __x, double __y) throw ();
+
+
+
+
+extern int __isinf (double __value) throw () __attribute__ ((__const__));
+
+
+extern int __finite (double __value) throw () __attribute__ ((__const__));
+
+
+
+
+
+extern int isinf (double __value) throw () __attribute__ ((__const__));
+
+
+extern int finite (double __value) throw () __attribute__ ((__const__));
+
+
+extern double drem (double __x, double __y) throw (); extern double __drem (double __x, double __y) throw ();
+
+
+
+extern double significand (double __x) throw (); extern double __significand (double __x) throw ();
+
+
+
+
+
+extern double copysign (double __x, double __y) throw () __attribute__ ((__const__)); extern double __copysign (double __x, double __y) throw () __attribute__ ((__const__));
+
+
+
+
+
+
+extern double nan (__const char *__tagb) throw () __attribute__ ((__const__)); extern double __nan (__const char *__tagb) throw () __attribute__ ((__const__));
+
+
+
+
+
+extern int __isnan (double __value) throw () __attribute__ ((__const__));
+
+
+
+extern int isnan (double __value) throw () __attribute__ ((__const__));
+
+
+extern double j0 (double) throw (); extern double __j0 (double) throw ();
+extern double j1 (double) throw (); extern double __j1 (double) throw ();
+extern double jn (int, double) throw (); extern double __jn (int, double) throw ();
+extern double y0 (double) throw (); extern double __y0 (double) throw ();
+extern double y1 (double) throw (); extern double __y1 (double) throw ();
+extern double yn (int, double) throw (); extern double __yn (int, double) throw ();
+
+
+
+
+
+
+extern double erf (double) throw (); extern double __erf (double) throw ();
+extern double erfc (double) throw (); extern double __erfc (double) throw ();
+extern double lgamma (double) throw (); extern double __lgamma (double) throw ();
+
+
+
+
+
+
+extern double tgamma (double) throw (); extern double __tgamma (double) throw ();
+
+
+
+
+
+extern double gamma (double) throw (); extern double __gamma (double) throw ();
+
+
+
+
+
+
+extern double lgamma_r (double, int *__signgamp) throw (); extern double __lgamma_r (double, int *__signgamp) throw ();
+
+
+
+
+
+
+
+extern double rint (double __x) throw (); extern double __rint (double __x) throw ();
+
+
+extern double nextafter (double __x, double __y) throw () __attribute__ ((__const__)); extern double __nextafter (double __x, double __y) throw () __attribute__ ((__const__));
+
+extern double nexttoward (double __x, long double __y) throw () __attribute__ ((__const__)); extern double __nexttoward (double __x, long double __y) throw () __attribute__ ((__const__));
+
+
+
+extern double remainder (double __x, double __y) throw (); extern double __remainder (double __x, double __y) throw ();
+
+
+
+extern double scalbn (double __x, int __n) throw (); extern double __scalbn (double __x, int __n) throw ();
+
+
+
+extern int ilogb (double __x) throw (); extern int __ilogb (double __x) throw ();
+
+
+
+
+extern double scalbln (double __x, long int __n) throw (); extern double __scalbln (double __x, long int __n) throw ();
+
+
+
+extern double nearbyint (double __x) throw (); extern double __nearbyint (double __x) throw ();
+
+
+
+extern double round (double __x) throw () __attribute__ ((__const__)); extern double __round (double __x) throw () __attribute__ ((__const__));
+
+
+
+extern double trunc (double __x) throw () __attribute__ ((__const__)); extern double __trunc (double __x) throw () __attribute__ ((__const__));
+
+
+
+
+extern double remquo (double __x, double __y, int *__quo) throw (); extern double __remquo (double __x, double __y, int *__quo) throw ();
+
+
+
+
+
+
+extern long int lrint (double __x) throw (); extern long int __lrint (double __x) throw ();
+extern long long int llrint (double __x) throw (); extern long long int __llrint (double __x) throw ();
+
+
+
+extern long int lround (double __x) throw (); extern long int __lround (double __x) throw ();
+extern long long int llround (double __x) throw (); extern long long int __llround (double __x) throw ();
+
+
+
+extern double fdim (double __x, double __y) throw (); extern double __fdim (double __x, double __y) throw ();
+
+
+extern double fmax (double __x, double __y) throw (); extern double __fmax (double __x, double __y) throw ();
+
+
+extern double fmin (double __x, double __y) throw (); extern double __fmin (double __x, double __y) throw ();
+
+
+
+extern int __fpclassify (double __value) throw ()
+     __attribute__ ((__const__));
+
+
+extern int __signbit (double __value) throw ()
+     __attribute__ ((__const__));
+
+
+
+extern double fma (double __x, double __y, double __z) throw (); extern double __fma (double __x, double __y, double __z) throw ();
+
+
+
+
+extern double scalb (double __x, double __n) throw (); extern double __scalb (double __x, double __n) throw ();
+
+
+
+
+
+
+
+extern float acosf (float __x) throw (); extern float __acosf (float __x) throw ();
+
+extern float asinf (float __x) throw (); extern float __asinf (float __x) throw ();
+
+extern float atanf (float __x) throw (); extern float __atanf (float __x) throw ();
+
+extern float atan2f (float __y, float __x) throw (); extern float __atan2f (float __y, float __x) throw ();
+
+
+extern float cosf (float __x) throw (); extern float __cosf (float __x) throw ();
+
+extern float sinf (float __x) throw (); extern float __sinf (float __x) throw ();
+
+extern float tanf (float __x) throw (); extern float __tanf (float __x) throw ();
+
+
+
+
+extern float coshf (float __x) throw (); extern float __coshf (float __x) throw ();
+
+extern float sinhf (float __x) throw (); extern float __sinhf (float __x) throw ();
+
+extern float tanhf (float __x) throw (); extern float __tanhf (float __x) throw ();
+
+
+
+
+extern void sincosf (float __x, float *__sinx, float *__cosx) throw (); extern void __sincosf (float __x, float *__sinx, float *__cosx) throw ();
+
+
+
+
+
+
+extern float acoshf (float __x) throw (); extern float __acoshf (float __x) throw ();
+
+extern float asinhf (float __x) throw (); extern float __asinhf (float __x) throw ();
+
+extern float atanhf (float __x) throw (); extern float __atanhf (float __x) throw ();
+
+
+
+
+
+
+
+extern float expf (float __x) throw (); extern float __expf (float __x) throw ();
+
+
+extern float frexpf (float __x, int *__exponent) throw (); extern float __frexpf (float __x, int *__exponent) throw ();
+
+
+extern float ldexpf (float __x, int __exponent) throw (); extern float __ldexpf (float __x, int __exponent) throw ();
+
+
+extern float logf (float __x) throw (); extern float __logf (float __x) throw ();
+
+
+extern float log10f (float __x) throw (); extern float __log10f (float __x) throw ();
+
+
+extern float modff (float __x, float *__iptr) throw (); extern float __modff (float __x, float *__iptr) throw ();
+
+
+
+
+extern float exp10f (float __x) throw (); extern float __exp10f (float __x) throw ();
+
+extern float pow10f (float __x) throw (); extern float __pow10f (float __x) throw ();
+
+
+
+
+
+extern float expm1f (float __x) throw (); extern float __expm1f (float __x) throw ();
+
+
+extern float log1pf (float __x) throw (); extern float __log1pf (float __x) throw ();
+
+
+extern float logbf (float __x) throw (); extern float __logbf (float __x) throw ();
+
+
+
+
+
+
+extern float exp2f (float __x) throw (); extern float __exp2f (float __x) throw ();
+
+
+extern float log2f (float __x) throw (); extern float __log2f (float __x) throw ();
+
+
+
+
+
+
+
+
+extern float powf (float __x, float __y) throw (); extern float __powf (float __x, float __y) throw ();
+
+
+extern float sqrtf (float __x) throw (); extern float __sqrtf (float __x) throw ();
+
+
+
+
+
+extern float hypotf (float __x, float __y) throw (); extern float __hypotf (float __x, float __y) throw ();
+
+
+
+
+
+
+extern float cbrtf (float __x) throw (); extern float __cbrtf (float __x) throw ();
+
+
+
+
+
+
+
+
+extern float ceilf (float __x) throw () __attribute__ ((__const__)); extern float __ceilf (float __x) throw () __attribute__ ((__const__));
+
+
+extern float fabsf (float __x) throw () __attribute__ ((__const__)); extern float __fabsf (float __x) throw () __attribute__ ((__const__));
+
+
+extern float floorf (float __x) throw () __attribute__ ((__const__)); extern float __floorf (float __x) throw () __attribute__ ((__const__));
+
+
+extern float fmodf (float __x, float __y) throw (); extern float __fmodf (float __x, float __y) throw ();
+
+
+
+
+extern int __isinff (float __value) throw () __attribute__ ((__const__));
+
+
+extern int __finitef (float __value) throw () __attribute__ ((__const__));
+
+
+
+
+
+extern int isinff (float __value) throw () __attribute__ ((__const__));
+
+
+extern int finitef (float __value) throw () __attribute__ ((__const__));
+
+
+extern float dremf (float __x, float __y) throw (); extern float __dremf (float __x, float __y) throw ();
+
+
+
+extern float significandf (float __x) throw (); extern float __significandf (float __x) throw ();
+
+
+
+
+
+extern float copysignf (float __x, float __y) throw () __attribute__ ((__const__)); extern float __copysignf (float __x, float __y) throw () __attribute__ ((__const__));
+
+
+
+
+
+
+extern float nanf (__const char *__tagb) throw () __attribute__ ((__const__)); extern float __nanf (__const char *__tagb) throw () __attribute__ ((__const__));
+
+
+
+
+
+extern int __isnanf (float __value) throw () __attribute__ ((__const__));
+
+
+
+extern int isnanf (float __value) throw () __attribute__ ((__const__));
+
+
+extern float j0f (float) throw (); extern float __j0f (float) throw ();
+extern float j1f (float) throw (); extern float __j1f (float) throw ();
+extern float jnf (int, float) throw (); extern float __jnf (int, float) throw ();
+extern float y0f (float) throw (); extern float __y0f (float) throw ();
+extern float y1f (float) throw (); extern float __y1f (float) throw ();
+extern float ynf (int, float) throw (); extern float __ynf (int, float) throw ();
+
+
+
+
+
+
+extern float erff (float) throw (); extern float __erff (float) throw ();
+extern float erfcf (float) throw (); extern float __erfcf (float) throw ();
+extern float lgammaf (float) throw (); extern float __lgammaf (float) throw ();
+
+
+
+
+
+
+extern float tgammaf (float) throw (); extern float __tgammaf (float) throw ();
+
+
+
+
+
+extern float gammaf (float) throw (); extern float __gammaf (float) throw ();
+
+
+
+
+
+
+extern float lgammaf_r (float, int *__signgamp) throw (); extern float __lgammaf_r (float, int *__signgamp) throw ();
+
+
+
+
+
+
+
+extern float rintf (float __x) throw (); extern float __rintf (float __x) throw ();
+
+
+extern float nextafterf (float __x, float __y) throw () __attribute__ ((__const__)); extern float __nextafterf (float __x, float __y) throw () __attribute__ ((__const__));
+
+extern float nexttowardf (float __x, long double __y) throw () __attribute__ ((__const__)); extern float __nexttowardf (float __x, long double __y) throw () __attribute__ ((__const__));
+
+
+
+extern float remainderf (float __x, float __y) throw (); extern float __remainderf (float __x, float __y) throw ();
+
+
+
+extern float scalbnf (float __x, int __n) throw (); extern float __scalbnf (float __x, int __n) throw ();
+
+
+
+extern int ilogbf (float __x) throw (); extern int __ilogbf (float __x) throw ();
+
+
+
+
+extern float scalblnf (float __x, long int __n) throw (); extern float __scalblnf (float __x, long int __n) throw ();
+
+
+
+extern float nearbyintf (float __x) throw (); extern float __nearbyintf (float __x) throw ();
+
+
+
+extern float roundf (float __x) throw () __attribute__ ((__const__)); extern float __roundf (float __x) throw () __attribute__ ((__const__));
+
+
+
+extern float truncf (float __x) throw () __attribute__ ((__const__)); extern float __truncf (float __x) throw () __attribute__ ((__const__));
+
+
+
+
+extern float remquof (float __x, float __y, int *__quo) throw (); extern float __remquof (float __x, float __y, int *__quo) throw ();
+
+
+
+
+
+
+extern long int lrintf (float __x) throw (); extern long int __lrintf (float __x) throw ();
+extern long long int llrintf (float __x) throw (); extern long long int __llrintf (float __x) throw ();
+
+
+
+extern long int lroundf (float __x) throw (); extern long int __lroundf (float __x) throw ();
+extern long long int llroundf (float __x) throw (); extern long long int __llroundf (float __x) throw ();
+
+
+
+extern float fdimf (float __x, float __y) throw (); extern float __fdimf (float __x, float __y) throw ();
+
+
+extern float fmaxf (float __x, float __y) throw (); extern float __fmaxf (float __x, float __y) throw ();
+
+
+extern float fminf (float __x, float __y) throw (); extern float __fminf (float __x, float __y) throw ();
+
+
+
+extern int __fpclassifyf (float __value) throw ()
+     __attribute__ ((__const__));
+
+
+extern int __signbitf (float __value) throw ()
+     __attribute__ ((__const__));
+
+
+
+extern float fmaf (float __x, float __y, float __z) throw (); extern float __fmaf (float __x, float __y, float __z) throw ();
+
+
+
+
+extern float scalbf (float __x, float __n) throw (); extern float __scalbf (float __x, float __n) throw ();
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern long double acosl (long double __x) throw (); extern long double __acosl (long double __x) throw ();
+
+extern long double asinl (long double __x) throw (); extern long double __asinl (long double __x) throw ();
+
+extern long double atanl (long double __x) throw (); extern long double __atanl (long double __x) throw ();
+
+extern long double atan2l (long double __y, long double __x) throw (); extern long double __atan2l (long double __y, long double __x) throw ();
+
+
+extern long double cosl (long double __x) throw (); extern long double __cosl (long double __x) throw ();
+
+extern long double sinl (long double __x) throw (); extern long double __sinl (long double __x) throw ();
+
+extern long double tanl (long double __x) throw (); extern long double __tanl (long double __x) throw ();
+
+
+
+
+extern long double coshl (long double __x) throw (); extern long double __coshl (long double __x) throw ();
+
+extern long double sinhl (long double __x) throw (); extern long double __sinhl (long double __x) throw ();
+
+extern long double tanhl (long double __x) throw (); extern long double __tanhl (long double __x) throw ();
+
+
+
+
+extern void sincosl (long double __x, long double *__sinx, long double *__cosx) throw (); extern void __sincosl (long double __x, long double *__sinx, long double *__cosx) throw ();
+
+
+
+
+
+
+extern long double acoshl (long double __x) throw (); extern long double __acoshl (long double __x) throw ();
+
+extern long double asinhl (long double __x) throw (); extern long double __asinhl (long double __x) throw ();
+
+extern long double atanhl (long double __x) throw (); extern long double __atanhl (long double __x) throw ();
+
+
+
+
+
+
+
+extern long double expl (long double __x) throw (); extern long double __expl (long double __x) throw ();
+
+
+extern long double frexpl (long double __x, int *__exponent) throw (); extern long double __frexpl (long double __x, int *__exponent) throw ();
+
+
+extern long double ldexpl (long double __x, int __exponent) throw (); extern long double __ldexpl (long double __x, int __exponent) throw ();
+
+
+extern long double logl (long double __x) throw (); extern long double __logl (long double __x) throw ();
+
+
+extern long double log10l (long double __x) throw (); extern long double __log10l (long double __x) throw ();
+
+
+extern long double modfl (long double __x, long double *__iptr) throw (); extern long double __modfl (long double __x, long double *__iptr) throw ();
+
+
+
+
+extern long double exp10l (long double __x) throw (); extern long double __exp10l (long double __x) throw ();
+
+extern long double pow10l (long double __x) throw (); extern long double __pow10l (long double __x) throw ();
+
+
+
+
+
+extern long double expm1l (long double __x) throw (); extern long double __expm1l (long double __x) throw ();
+
+
+extern long double log1pl (long double __x) throw (); extern long double __log1pl (long double __x) throw ();
+
+
+extern long double logbl (long double __x) throw (); extern long double __logbl (long double __x) throw ();
+
+
+
+
+
+
+extern long double exp2l (long double __x) throw (); extern long double __exp2l (long double __x) throw ();
+
+
+extern long double log2l (long double __x) throw (); extern long double __log2l (long double __x) throw ();
+
+
+
+
+
+
+
+
+extern long double powl (long double __x, long double __y) throw (); extern long double __powl (long double __x, long double __y) throw ();
+
+
+extern long double sqrtl (long double __x) throw (); extern long double __sqrtl (long double __x) throw ();
+
+
+
+
+
+extern long double hypotl (long double __x, long double __y) throw (); extern long double __hypotl (long double __x, long double __y) throw ();
+
+
+
+
+
+
+extern long double cbrtl (long double __x) throw (); extern long double __cbrtl (long double __x) throw ();
+
+
+
+
+
+
+
+
+extern long double ceill (long double __x) throw () __attribute__ ((__const__)); extern long double __ceill (long double __x) throw () __attribute__ ((__const__));
+
+
+extern long double fabsl (long double __x) throw () __attribute__ ((__const__)); extern long double __fabsl (long double __x) throw () __attribute__ ((__const__));
+
+
+extern long double floorl (long double __x) throw () __attribute__ ((__const__)); extern long double __floorl (long double __x) throw () __attribute__ ((__const__));
+
+
+extern long double fmodl (long double __x, long double __y) throw (); extern long double __fmodl (long double __x, long double __y) throw ();
+
+
+
+
+extern int __isinfl (long double __value) throw () __attribute__ ((__const__));
+
+
+extern int __finitel (long double __value) throw () __attribute__ ((__const__));
+
+
+
+
+
+extern int isinfl (long double __value) throw () __attribute__ ((__const__));
+
+
+extern int finitel (long double __value) throw () __attribute__ ((__const__));
+
+
+extern long double dreml (long double __x, long double __y) throw (); extern long double __dreml (long double __x, long double __y) throw ();
+
+
+
+extern long double significandl (long double __x) throw (); extern long double __significandl (long double __x) throw ();
+
+
+
+
+
+extern long double copysignl (long double __x, long double __y) throw () __attribute__ ((__const__)); extern long double __copysignl (long double __x, long double __y) throw () __attribute__ ((__const__));
+
+
+
+
+
+
+extern long double nanl (__const char *__tagb) throw () __attribute__ ((__const__)); extern long double __nanl (__const char *__tagb) throw () __attribute__ ((__const__));
+
+
+
+
+
+extern int __isnanl (long double __value) throw () __attribute__ ((__const__));
+
+
+
+extern int isnanl (long double __value) throw () __attribute__ ((__const__));
+
+
+extern long double j0l (long double) throw (); extern long double __j0l (long double) throw ();
+extern long double j1l (long double) throw (); extern long double __j1l (long double) throw ();
+extern long double jnl (int, long double) throw (); extern long double __jnl (int, long double) throw ();
+extern long double y0l (long double) throw (); extern long double __y0l (long double) throw ();
+extern long double y1l (long double) throw (); extern long double __y1l (long double) throw ();
+extern long double ynl (int, long double) throw (); extern long double __ynl (int, long double) throw ();
+
+
+
+
+
+
+extern long double erfl (long double) throw (); extern long double __erfl (long double) throw ();
+extern long double erfcl (long double) throw (); extern long double __erfcl (long double) throw ();
+extern long double lgammal (long double) throw (); extern long double __lgammal (long double) throw ();
+
+
+
+
+
+
+extern long double tgammal (long double) throw (); extern long double __tgammal (long double) throw ();
+
+
+
+
+
+extern long double gammal (long double) throw (); extern long double __gammal (long double) throw ();
+
+
+
+
+
+
+extern long double lgammal_r (long double, int *__signgamp) throw (); extern long double __lgammal_r (long double, int *__signgamp) throw ();
+
+
+
+
+
+
+
+extern long double rintl (long double __x) throw (); extern long double __rintl (long double __x) throw ();
+
+
+extern long double nextafterl (long double __x, long double __y) throw () __attribute__ ((__const__)); extern long double __nextafterl (long double __x, long double __y) throw () __attribute__ ((__const__));
+
+extern long double nexttowardl (long double __x, long double __y) throw () __attribute__ ((__const__)); extern long double __nexttowardl (long double __x, long double __y) throw () __attribute__ ((__const__));
+
+
+
+extern long double remainderl (long double __x, long double __y) throw (); extern long double __remainderl (long double __x, long double __y) throw ();
+
+
+
+extern long double scalbnl (long double __x, int __n) throw (); extern long double __scalbnl (long double __x, int __n) throw ();
+
+
+
+extern int ilogbl (long double __x) throw (); extern int __ilogbl (long double __x) throw ();
+
+
+
+
+extern long double scalblnl (long double __x, long int __n) throw (); extern long double __scalblnl (long double __x, long int __n) throw ();
+
+
+
+extern long double nearbyintl (long double __x) throw (); extern long double __nearbyintl (long double __x) throw ();
+
+
+
+extern long double roundl (long double __x) throw () __attribute__ ((__const__)); extern long double __roundl (long double __x) throw () __attribute__ ((__const__));
+
+
+
+extern long double truncl (long double __x) throw () __attribute__ ((__const__)); extern long double __truncl (long double __x) throw () __attribute__ ((__const__));
+
+
+
+
+extern long double remquol (long double __x, long double __y, int *__quo) throw (); extern long double __remquol (long double __x, long double __y, int *__quo) throw ();
+
+
+
+
+
+
+extern long int lrintl (long double __x) throw (); extern long int __lrintl (long double __x) throw ();
+extern long long int llrintl (long double __x) throw (); extern long long int __llrintl (long double __x) throw ();
+
+
+
+extern long int lroundl (long double __x) throw (); extern long int __lroundl (long double __x) throw ();
+extern long long int llroundl (long double __x) throw (); extern long long int __llroundl (long double __x) throw ();
+
+
+
+extern long double fdiml (long double __x, long double __y) throw (); extern long double __fdiml (long double __x, long double __y) throw ();
+
+
+extern long double fmaxl (long double __x, long double __y) throw (); extern long double __fmaxl (long double __x, long double __y) throw ();
+
+
+extern long double fminl (long double __x, long double __y) throw (); extern long double __fminl (long double __x, long double __y) throw ();
+
+
+
+extern int __fpclassifyl (long double __value) throw ()
+     __attribute__ ((__const__));
+
+
+extern int __signbitl (long double __value) throw ()
+     __attribute__ ((__const__));
+
+
+
+extern long double fmal (long double __x, long double __y, long double __z) throw (); extern long double __fmal (long double __x, long double __y, long double __z) throw ();
+
+
+
+
+extern long double scalbl (long double __x, long double __n) throw (); extern long double __scalbl (long double __x, long double __n) throw ();
+
+
+
+
+
+
+
+
+extern int signgam;
+enum
+  {
+    FP_NAN,
+    FP_INFINITE,
+    FP_ZERO,
+    FP_SUBNORMAL,
+    FP_NORMAL
+  };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef enum
+{
+  _IEEE_ = -1,
+  _SVID_,
+  _XOPEN_,
+  _POSIX_,
+  _ISOC_
+} _LIB_VERSION_TYPE;
+
+
+
+
+extern _LIB_VERSION_TYPE _LIB_VERSION;
+struct __exception
+
+
+
+  {
+    int type;
+    char *name;
+    double arg1;
+    double arg2;
+    double retval;
+  };
+
+
+extern int matherr (struct __exception *__exc) throw ();
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+}
+
+
+
+
+
+
+
+
+
+class QBitmap : public QPixmap
+{
+public:
+    QBitmap();
+    QBitmap( int w, int h, bool clear = FALSE,
+             QPixmap::Optimization = QPixmap::DefaultOptim );
+    QBitmap( const QSize &, bool clear = FALSE,
+             QPixmap::Optimization = QPixmap::DefaultOptim );
+    QBitmap( int w, int h, const uchar *bits, bool isXbitmap=FALSE );
+    QBitmap( const QSize &, const uchar *bits, bool isXbitmap=FALSE );
+    QBitmap( const QBitmap & );
+
+    QBitmap( const QString &fileName, const char *format=0 );
+
+    QBitmap &operator=( const QBitmap & );
+    QBitmap &operator=( const QPixmap & );
+    QBitmap &operator=( const QImage & );
+
+
+    QBitmap xForm( const QWMatrix & ) const;
+
+};
+
+
+
+
+
+
+
+
+class QImageDataMisc;
+
+class QImageTextKeyLang {
+public:
+    QImageTextKeyLang(const char* k, const char* l) : key(k), lang(l) { }
+    QImageTextKeyLang() { }
+
+    QCString key;
+    QCString lang;
+
+    bool operator< (const QImageTextKeyLang& other) const
+        { return key < other.key || key==other.key && lang < other.lang; }
+    bool operator== (const QImageTextKeyLang& other) const
+        { return key==other.key && lang==other.lang; }
+};
+
+
+
+class QImage
+{
+public:
+    enum Endian { IgnoreEndian, BigEndian, LittleEndian };
+
+    QImage();
+    QImage( int width, int height, int depth, int numColors=0,
+            Endian bitOrder=IgnoreEndian );
+    QImage( const QSize&, int depth, int numColors=0,
+            Endian bitOrder=IgnoreEndian );
+
+    QImage( const QString &fileName, const char* format=0 );
+    QImage( const char * const xpm[] );
+    QImage( const QByteArray &data );
+
+    QImage( uchar* data, int w, int h, int depth,
+                QRgb* colortable, int numColors,
+                Endian bitOrder );
+
+
+
+
+
+    QImage( const QImage & );
+   ~QImage();
+
+    QImage &operator=( const QImage & );
+    QImage &operator=( const QPixmap & );
+    bool operator==( const QImage & ) const;
+    bool operator!=( const QImage & ) const;
+    void detach();
+    QImage copy() const;
+    QImage copy(int x, int y, int w, int h, int conversion_flags=0) const;
+    QImage copy(const QRect&) const;
+
+    static QImage fromMimeSource( const QString& abs_name );
+
+    bool isNull() const { return data->bits == 0; }
+
+    int width() const { return data->w; }
+    int height() const { return data->h; }
+    QSize size() const { return QSize(data->w,data->h); }
+    QRect rect() const { return QRect(0,0,data->w,data->h); }
+    int depth() const { return data->d; }
+    int numColors() const { return data->ncols; }
+    Endian bitOrder() const { return (Endian) data->bitordr; }
+
+    QRgb color( int i ) const;
+    void setColor( int i, QRgb c );
+    void setNumColors( int );
+
+    bool hasAlphaBuffer() const;
+    void setAlphaBuffer( bool );
+
+    bool allGray() const;
+    bool isGrayscale() const;
+
+    uchar *bits() const;
+    uchar *scanLine( int ) const;
+    uchar **jumpTable() const;
+    QRgb *colorTable() const;
+    int numBytes() const;
+    int bytesPerLine() const;
+
+
+
+
+
+    bool create( int width, int height, int depth, int numColors=0,
+                        Endian bitOrder=IgnoreEndian );
+    bool create( const QSize&, int depth, int numColors=0,
+                        Endian bitOrder=IgnoreEndian );
+    void reset();
+
+    void fill( uint pixel );
+    void invertPixels( bool invertAlpha = TRUE );
+
+    QImage convertDepth( int ) const;
+
+    QImage convertDepthWithPalette( int, QRgb* p, int pc, int cf=0 ) const;
+
+    QImage convertDepth( int, int conversion_flags ) const;
+    QImage convertBitOrder( Endian ) const;
+
+    enum ScaleMode {
+        ScaleFree,
+        ScaleMin,
+        ScaleMax
+    };
+
+    QImage smoothScale( int w, int h, ScaleMode mode=ScaleFree ) const;
+    QImage smoothScale( const QSize& s, ScaleMode mode=ScaleFree ) const;
+
+
+    QImage scale( int w, int h, ScaleMode mode=ScaleFree ) const;
+    QImage scale( const QSize& s, ScaleMode mode=ScaleFree ) const;
+    QImage scaleWidth( int w ) const;
+    QImage scaleHeight( int h ) const;
+    QImage xForm( const QWMatrix &matrix ) const;
+
+
+
+    QImage createAlphaMask( int conversion_flags=0 ) const;
+
+
+    QImage createHeuristicMask( bool clipTight=TRUE ) const;
+
+
+    QImage mirror() const;
+    QImage mirror(bool horizontally, bool vertically) const;
+
+    QImage swapRGB() const;
+
+    static Endian systemBitOrder();
+    static Endian systemByteOrder();
+
+
+    static const char* imageFormat( const QString &fileName );
+    static QStrList inputFormats();
+    static QStrList outputFormats();
+
+    static QStringList inputFormatList();
+    static QStringList outputFormatList();
+
+    bool load( const QString &fileName, const char* format=0 );
+    bool loadFromData( const uchar *buf, uint len,
+                              const char *format=0 );
+    bool loadFromData( QByteArray data, const char* format=0 );
+    bool save( const QString &fileName, const char* format,
+                      int quality=-1 ) const;
+    bool save( QIODevice * device, const char* format,
+                      int quality=-1 ) const;
+
+
+    bool valid( int x, int y ) const;
+    int pixelIndex( int x, int y ) const;
+    QRgb pixel( int x, int y ) const;
+    void setPixel( int x, int y, uint index_or_rgb );
+
+
+    int dotsPerMeterX() const;
+    int dotsPerMeterY() const;
+    void setDotsPerMeterX(int);
+    void setDotsPerMeterY(int);
+    QPoint offset() const;
+    void setOffset(const QPoint&);
+
+    QValueList<QImageTextKeyLang> textList() const;
+    QStringList textLanguages() const;
+    QStringList textKeys() const;
+    QString text(const char* key, const char* lang=0) const;
+    QString text(const QImageTextKeyLang&) const;
+    void setText(const char* key, const char* lang, const QString&);
+
+private:
+    void init();
+    void reinit();
+    void freeBits();
+    static void warningIndexRange( const char *, int );
+
+    struct QImageData : public QShared {
+        int w;
+        int h;
+        int d;
+        int ncols;
+        int nbytes;
+        int bitordr;
+        QRgb *ctbl;
+        uchar **bits;
+        bool alpha;
+        int dpmx;
+        int dpmy;
+        QPoint offset;
+
+        QImageDataMisc* misc;
+
+        bool ctbl_mine;
+    } *data;
+
+    QImageDataMisc& misc() const;
+
+
+    bool doImageIO( QImageIO* io, int quality ) const;
+
+    friend void bitBlt( QImage* dst, int dx, int dy,
+                                 const QImage* src, int sx, int sy,
+                                 int sw, int sh, int conversion_flags );
+};
+
+
+
+
+
+ QDataStream &operator<<( QDataStream &, const QImage & );
+ QDataStream &operator>>( QDataStream &, QImage & );
+
+
+
+class QIODevice;
+typedef void (*image_io_handler)( QImageIO * );
+
+
+struct QImageIOData;
+
+
+class QImageIO
+{
+public:
+    QImageIO();
+    QImageIO( QIODevice *ioDevice, const char *format );
+    QImageIO( const QString &fileName, const char* format );
+   ~QImageIO();
+
+
+    const QImage &image() const { return im; }
+    int status() const { return iostat; }
+    const char *format() const { return frmt; }
+    QIODevice *ioDevice() const { return iodev; }
+    QString fileName() const { return fname; }
+    int quality() const;
+    QString description() const { return descr; }
+    const char *parameters() const;
+    float gamma() const;
+
+    void setImage( const QImage & );
+    void setStatus( int );
+    void setFormat( const char * );
+    void setIODevice( QIODevice * );
+    void setFileName( const QString & );
+    void setQuality( int );
+    void setDescription( const QString & );
+    void setParameters( const char * );
+    void setGamma( float );
+
+    bool read();
+    bool write();
+
+    static const char* imageFormat( const QString &fileName );
+    static const char *imageFormat( QIODevice * );
+    static QStrList inputFormats();
+    static QStrList outputFormats();
+
+    static void defineIOHandler( const char *format,
+                                 const char *header,
+                                 const char *flags,
+                                 image_io_handler read_image,
+                                 image_io_handler write_image );
+
+private:
+    void init();
+
+    QImage im;
+    int iostat;
+    QCString frmt;
+    QIODevice *iodev;
+    QString fname;
+    char *params;
+    QString descr;
+    QImageIOData *d;
+
+private:
+
+    QImageIO( const QImageIO & );
+    QImageIO &operator=( const QImageIO & );
+
+};
+
+
+
+ void bitBlt( QImage* dst, int dx, int dy, const QImage* src,
+                      int sx=0, int sy=0, int sw=-1, int sh=-1,
+                      int conversion_flags=0 );
+
+
+
+
+
+
+inline bool QImage::hasAlphaBuffer() const
+{
+    return data->alpha;
+}
+
+inline uchar *QImage::bits() const
+{
+    return data->bits ? data->bits[0] : 0;
+}
+
+inline uchar **QImage::jumpTable() const
+{
+    return data->bits;
+}
+
+inline QRgb *QImage::colorTable() const
+{
+    return data->ctbl;
+}
+
+inline int QImage::numBytes() const
+{
+    return data->nbytes;
+}
+
+inline int QImage::bytesPerLine() const
+{
+    return data->h ? data->nbytes/data->h : 0;
+}
+
+inline QImage QImage::copy(const QRect& r) const
+{
+    return copy(r.x(), r.y(), r.width(), r.height());
+}
+
+inline QRgb QImage::color( int i ) const
+{
+
+    if ( i >= data->ncols )
+        warningIndexRange( "color", i );
+
+    return data->ctbl ? data->ctbl[i] : (QRgb)-1;
+}
+
+inline void QImage::setColor( int i, QRgb c )
+{
+
+    if ( i >= data->ncols )
+        warningIndexRange( "setColor", i );
+
+    if ( data->ctbl )
+        data->ctbl[i] = c;
+}
+
+inline uchar *QImage::scanLine( int i ) const
+{
+
+    if ( i >= data->h )
+        warningIndexRange( "scanLine", i );
+
+    return data->bits ? data->bits[i] : 0;
+}
+
+inline int QImage::dotsPerMeterX() const
+{
+    return data->dpmx;
+}
+
+inline int QImage::dotsPerMeterY() const
+{
+    return data->dpmy;
+}
+
+inline QPoint QImage::offset() const
+{
+    return data->offset;
+}
+
+
+class QPointArray : public QMemArray<QPoint>
+{
+public:
+    QPointArray() {}
+    ~QPointArray() {}
+    QPointArray( int size ) : QMemArray<QPoint>( size ) {}
+    QPointArray( const QPointArray &a ) : QMemArray<QPoint>( a ) {}
+    QPointArray( const QRect &r, bool closed=FALSE );
+    QPointArray( int nPoints, const QCOORD *points );
+
+    QPointArray &operator=( const QPointArray &a )
+        { return (QPointArray&)assign( a ); }
+
+    QPointArray copy() const
+        { QPointArray tmp; return *((QPointArray*)&tmp.duplicate(*this)); }
+
+    void translate( int dx, int dy );
+    QRect boundingRect() const;
+
+    void point( uint i, int *x, int *y ) const;
+    QPoint point( uint i ) const;
+    void setPoint( uint i, int x, int y );
+    void setPoint( uint i, const QPoint &p );
+    bool setPoints( int nPoints, const QCOORD *points );
+    bool setPoints( int nPoints, int firstx, int firsty, ... );
+    bool putPoints( int index, int nPoints, const QCOORD *points );
+    bool putPoints( int index, int nPoints, int firstx, int firsty, ... );
+    bool putPoints( int index, int nPoints,
+                       const QPointArray & from, int fromIndex=0 );
+
+    void makeArc( int x, int y, int w, int h, int a1, int a2 );
+    void makeEllipse( int x, int y, int w, int h );
+    void makeArc( int x, int y, int w, int h, int a1, int a2,
+                     const QWMatrix& );
+    QPointArray cubicBezier() const;
+
+    void* shortPoints( int index = 0, int nPoints = -1 ) const;
+    static void cleanBuffers();
+
+protected:
+    static uint splen;
+    static void* sp;
+};
+
+
+
+
+
+
+ QDataStream &operator<<( QDataStream &, const QPointArray & );
+ QDataStream &operator>>( QDataStream &, QPointArray & );
+
+
+
+
+
+
+inline void QPointArray::setPoint( uint i, const QPoint &p )
+{
+    setPoint( i, p.x(), p.y() );
+}
+class QWMatrix
+{
+public:
+    QWMatrix();
+    QWMatrix( double m11, double m12, double m21, double m22,
+              double dx, double dy );
+
+    void setMatrix( double m11, double m12, double m21, double m22,
+                           double dx, double dy );
+
+    double m11() const { return _m11; }
+    double m12() const { return _m12; }
+    double m21() const { return _m21; }
+    double m22() const { return _m22; }
+    double dx() const { return _dx; }
+    double dy() const { return _dy; }
+
+    void map( int x, int y, int *tx, int *ty ) const;
+    void map( double x, double y, double *tx, double *ty ) const;
+    QRect mapRect( const QRect & ) const;
+
+    QPoint map( const QPoint &p ) const { return operator *( p ); }
+    QRect map( const QRect &r ) const { return mapRect ( r ); }
+    QPointArray map( const QPointArray &a ) const { return operator * ( a ); }
+    QRegion map( const QRegion &r ) const { return operator *( r ); }
+    QRegion mapToRegion( const QRect &r ) const { return operator *( r ); }
+    QPointArray mapToPolygon( const QRect &r ) const;
+
+    void reset();
+    bool isIdentity() const;
+
+    QWMatrix &translate( double dx, double dy );
+    QWMatrix &scale( double sx, double sy );
+    QWMatrix &shear( double sh, double sv );
+    QWMatrix &rotate( double a );
+
+    bool isInvertible() const { return (_m11*_m22 - _m12*_m21) != 0; }
+    double det() const { return _m11*_m22 - _m12*_m21; }
+
+    QWMatrix invert( bool * = 0 ) const;
+
+    bool operator==( const QWMatrix & ) const;
+    bool operator!=( const QWMatrix & ) const;
+    QWMatrix &operator*=( const QWMatrix & );
+
+
+    QPoint operator * (const QPoint & ) const;
+    QRegion operator * (const QRect & ) const;
+    QRegion operator * (const QRegion & ) const;
+    QPointArray operator * ( const QPointArray &a ) const;
+
+    enum TransformationMode {
+        Points, Areas
+    };
+    static void setTransformationMode( QWMatrix::TransformationMode m );
+    static TransformationMode transformationMode();
+private:
+    double _m11, _m12;
+    double _m21, _m22;
+    double _dx, _dy;
+};
+
+ QWMatrix operator*( const QWMatrix &, const QWMatrix & );
+
+
+
+
+
+
+ QDataStream &operator<<( QDataStream &, const QWMatrix & );
+ QDataStream &operator>>( QDataStream &, QWMatrix & );
+
+
+class QGfx;
+class QTextCodec;
+class QTextParag;
+class QPaintDevice;
+class QTextItem;
+
+
+
+class QPainterPrivate;
+
+class QPainter : public Qt
+{
+public:
+    enum CoordinateMode { CoordDevice, CoordPainter };
+
+    QPainter();
+    QPainter( const QPaintDevice *, bool unclipped = FALSE );
+    QPainter( const QPaintDevice *, const QWidget *, bool unclipped = FALSE );
+   ~QPainter();
+
+    bool begin( const QPaintDevice *, bool unclipped = FALSE );
+    bool begin( const QPaintDevice *, const QWidget *, bool unclipped = FALSE );
+    bool end();
+    QPaintDevice *device() const;
+
+
+
+
+
+    static void redirect( QPaintDevice *pdev, QPaintDevice *replacement );
+    static QPaintDevice *redirect( QPaintDevice *pdev );
+
+    bool isActive() const;
+
+    void flush( const QRegion &region, CoordinateMode cm = CoordDevice );
+    void flush();
+    void save();
+    void restore();
+
+
+
+    QFontMetrics fontMetrics() const;
+    QFontInfo fontInfo() const;
+
+    const QFont &font() const;
+    void setFont( const QFont & );
+    const QPen &pen() const;
+    void setPen( const QPen & );
+    void setPen( PenStyle );
+    void setPen( const QColor & );
+    const QBrush &brush() const;
+    void setBrush( const QBrush & );
+    void setBrush( BrushStyle );
+    void setBrush( const QColor & );
+    QPoint pos() const;
+
+
+
+    const QColor &backgroundColor() const;
+    void setBackgroundColor( const QColor & );
+    BGMode backgroundMode() const;
+    void setBackgroundMode( BGMode );
+    RasterOp rasterOp() const;
+    void setRasterOp( RasterOp );
+    const QPoint &brushOrigin() const;
+    void setBrushOrigin( int x, int y );
+    void setBrushOrigin( const QPoint & );
+
+
+
+
+
+
+    bool hasViewXForm() const;
+    bool hasWorldXForm() const;
+
+
+    void setViewXForm( bool );
+    QRect window() const;
+    void setWindow( const QRect & );
+    void setWindow( int x, int y, int w, int h );
+    QRect viewport() const;
+    void setViewport( const QRect & );
+    void setViewport( int x, int y, int w, int h );
+
+    void setWorldXForm( bool );
+    const QWMatrix &worldMatrix() const;
+    void setWorldMatrix( const QWMatrix &, bool combine=FALSE );
+
+    void saveWorldMatrix();
+    void restoreWorldMatrix();
+
+    void scale( double sx, double sy );
+    void shear( double sh, double sv );
+    void rotate( double a );
+
+    void translate( double dx, double dy );
+    void resetXForm();
+    double translationX() const;
+    double translationY() const;
+
+    QPoint xForm( const QPoint & ) const;
+    QRect xForm( const QRect & ) const;
+    QPointArray xForm( const QPointArray & ) const;
+    QPointArray xForm( const QPointArray &, int index, int npoints ) const;
+    QPoint xFormDev( const QPoint & ) const;
+    QRect xFormDev( const QRect & ) const;
+    QPointArray xFormDev( const QPointArray & ) const;
+    QPointArray xFormDev( const QPointArray &, int index, int npoints ) const;
+
+
+
+    void setClipping( bool );
+    bool hasClipping() const;
+    QRegion clipRegion( CoordinateMode = CoordDevice ) const;
+    void setClipRect( const QRect &, CoordinateMode = CoordDevice );
+    void setClipRect( int x, int y, int w, int h, CoordinateMode = CoordDevice );
+    void setClipRegion( const QRegion &, CoordinateMode = CoordDevice );
+
+
+
+    void drawPoint( int x, int y );
+    void drawPoint( const QPoint & );
+    void drawPoints( const QPointArray& a,
+                            int index=0, int npoints=-1 );
+    void moveTo( int x, int y );
+    void moveTo( const QPoint & );
+    void lineTo( int x, int y );
+    void lineTo( const QPoint & );
+    void drawLine( int x1, int y1, int x2, int y2 );
+    void drawLine( const QPoint &, const QPoint & );
+    void drawRect( int x, int y, int w, int h );
+    void drawRect( const QRect & );
+    void drawWinFocusRect( int x, int y, int w, int h );
+    void drawWinFocusRect( int x, int y, int w, int h,
+                                  const QColor &bgColor );
+    void drawWinFocusRect( const QRect & );
+    void drawWinFocusRect( const QRect &,
+                                  const QColor &bgColor );
+    void drawRoundRect( int x, int y, int w, int h, int = 25, int = 25 );
+    void drawRoundRect( const QRect &, int = 25, int = 25 );
+    void drawEllipse( int x, int y, int w, int h );
+    void drawEllipse( const QRect & );
+    void drawArc( int x, int y, int w, int h, int a, int alen );
+    void drawArc( const QRect &, int a, int alen );
+    void drawPie( int x, int y, int w, int h, int a, int alen );
+    void drawPie( const QRect &, int a, int alen );
+    void drawChord( int x, int y, int w, int h, int a, int alen );
+    void drawChord( const QRect &, int a, int alen );
+    void drawLineSegments( const QPointArray &,
+                                  int index=0, int nlines=-1 );
+    void drawPolyline( const QPointArray &,
+                              int index=0, int npoints=-1 );
+    void drawPolygon( const QPointArray &, bool winding=FALSE,
+                             int index=0, int npoints=-1 );
+    void drawConvexPolygon( const QPointArray &,
+                             int index=0, int npoints=-1 );
+
+    void drawCubicBezier( const QPointArray &, int index=0 );
+
+    void drawPixmap( int x, int y, const QPixmap &,
+                            int sx=0, int sy=0, int sw=-1, int sh=-1 );
+    void drawPixmap( const QPoint &, const QPixmap &,
+                            const QRect &sr );
+    void drawPixmap( const QPoint &, const QPixmap & );
+    void drawPixmap( const QRect &, const QPixmap & );
+    void drawImage( int x, int y, const QImage &,
+                           int sx = 0, int sy = 0, int sw = -1, int sh = -1,
+                           int conversionFlags = 0 );
+    void drawImage( const QPoint &, const QImage &,
+                           const QRect &sr, int conversionFlags = 0 );
+    void drawImage( const QPoint &, const QImage &,
+                           int conversion_flags = 0 );
+    void drawImage( const QRect &, const QImage & );
+    void drawTiledPixmap( int x, int y, int w, int h, const QPixmap &,
+                                 int sx=0, int sy=0 );
+    void drawTiledPixmap( const QRect &, const QPixmap &,
+                                 const QPoint & );
+    void drawTiledPixmap( const QRect &, const QPixmap & );
+
+    void drawPicture( const QPicture & );
+    void drawPicture( int x, int y, const QPicture & );
+    void drawPicture( const QPoint &, const QPicture & );
+
+
+    void fillRect( int x, int y, int w, int h, const QBrush & );
+    void fillRect( const QRect &, const QBrush & );
+    void eraseRect( int x, int y, int w, int h );
+    void eraseRect( const QRect & );
+
+
+
+    enum TextDirection {
+        Auto,
+        RTL,
+        LTR
+    };
+
+    void drawText( int x, int y, const QString &, int len = -1, TextDirection dir = Auto );
+    void drawText( const QPoint &, const QString &, int len = -1, TextDirection dir = Auto );
+
+    void drawText( int x, int y, const QString &, int pos, int len, TextDirection dir = Auto );
+    void drawText( const QPoint &p, const QString &, int pos, int len, TextDirection dir = Auto );
+
+    void drawText( int x, int y, int w, int h, int flags,
+                          const QString&, int len = -1, QRect *br=0,
+                          QTextParag **intern=0 );
+    void drawText( const QRect &, int flags,
+                          const QString&, int len = -1, QRect *br=0,
+                          QTextParag **intern=0 );
+
+    void drawTextItem( int x, int y, const QTextItem &ti, int textflags = 0 );
+    void drawTextItem( const QPoint& p, const QTextItem &ti, int textflags = 0 );
+
+    QRect boundingRect( int x, int y, int w, int h, int flags,
+                              const QString&, int len = -1, QTextParag **intern=0 );
+    QRect boundingRect( const QRect &, int flags,
+                              const QString&, int len = -1, QTextParag **intern=0 );
+
+    int tabStops() const;
+    void setTabStops( int );
+    int *tabArray() const;
+    void setTabArray( int * );
+
+
+
+
+
+
+    HANDLE handle() const;
+
+
+
+    static void initialize();
+    static void cleanup();
+
+private:
+    void init();
+    void destroy();
+    void updateFont();
+    void updatePen();
+    void updateBrush();
+
+    void updateXForm();
+    void updateInvXForm();
+
+    void map( int, int, int *rx, int *ry ) const;
+    void map( int, int, int, int, int *, int *, int *, int * ) const;
+    void mapInv( int, int, int *, int * ) const;
+    void mapInv( int, int, int, int, int *, int *, int *, int * ) const;
+
+
+
+    void drawPolyInternal( const QPointArray &, bool close=TRUE );
+
+    void drawWinFocusRect( int x, int y, int w, int h, bool xorPaint,
+                                  const QColor &penColor );
+
+    enum { IsActive=0x01, ExtDev=0x02, IsStartingUp=0x04, NoCache=0x08,
+           VxF=0x10, WxF=0x20, ClipOn=0x40, SafePolygon=0x80, MonoDev=0x100,
+           DirtyFont=0x200, DirtyPen=0x400, DirtyBrush=0x800,
+           RGBColor=0x1000, FontMet=0x2000, FontInf=0x4000, CtorBegin=0x8000,
+           UsePrivateCx = 0x10000, VolatileDC = 0x20000, Qt2Compat = 0x40000 };
+    uint flags;
+    bool testf( uint b ) const { return (flags&b)!=0; }
+    void setf( uint b ) { flags |= b; }
+    void setf( uint b, bool v );
+    void clearf( uint b ) { flags &= (uint)(~b); }
+    void fix_neg_rect( int *x, int *y, int *w, int *h );
+
+    QPainterPrivate *d;
+    QPaintDevice *pdev;
+    QColor bg_col;
+    uchar bg_mode;
+    uchar rop;
+    uchar pu;
+    QPoint bro;
+    QFont cfont;
+    QFont *pfont;
+    QPen cpen;
+    QBrush cbrush;
+    QRegion crgn;
+    int tabstops;
+    int *tabarray;
+    int tabarraylen;
+    bool block_ext;
+
+
+
+    QCOORD wx, wy, ww, wh;
+    QCOORD vx, vy, vw, vh;
+    QWMatrix wxmat;
+
+
+    QWMatrix xmat;
+    QWMatrix ixmat;
+
+
+
+    double m11() const { return xmat.m11(); }
+    double m12() const { return xmat.m12(); }
+    double m21() const { return xmat.m21(); }
+    double m22() const { return xmat.m22(); }
+    double dx() const { return xmat.dx(); }
+    double dy() const { return xmat.dy(); }
+    double im11() const { return ixmat.m11(); }
+    double im12() const { return ixmat.m12(); }
+    double im21() const { return ixmat.m21(); }
+    double im22() const { return ixmat.m22(); }
+    double idx() const { return ixmat.dx(); }
+    double idy() const { return ixmat.dy(); }
+
+    int txop;
+    bool txinv;
+
+
+
+
+
+
+
+    void *penRef;
+    void *brushRef;
+    void *ps_stack;
+    void *wm_stack;
+    void killPStack();
+
+protected:
+    friend class QFontEngineXLFD;
+    friend class QFontEngineXft;
+    friend class QFontEngineBox;
+    Display *dpy;
+    int scrn;
+    Qt::HANDLE hd;
+    Qt::HANDLE rendhd;
+    GC gc;
+    GC gc_brush;
+    QPoint curPt;
+    uint clip_serial;
+    friend class QFontMetrics;
+    friend class QFontInfo;
+    friend class QTextLayout;
+    friend void qt_format_text( const QFont &, const QRect &r,
+                     int tf, const QString& str, int len, QRect *brect,
+                     int tabstops, int* tabarray, int tabarraylen,
+                     QTextParag **internal, QPainter* painter );
+    friend void qt_draw_background( QPainter *p, int x, int y, int w, int h );
+    friend void qt_draw_transformed_rect( QPainter *p, int x, int y, int w, int h, bool fill );
+    friend class QPrinter;
+
+private:
+
+    QPainter( const QPainter & );
+    QPainter &operator=( const QPainter & );
+
+
+    enum TransformationCodes {
+        TxNone = 0,
+        TxTranslate = 1,
+        TxScale = 2,
+        TxRotShear = 3
+    };
+};
+
+
+
+
+
+
+inline QPaintDevice *QPainter::device() const
+{
+    return pdev;
+}
+
+inline bool QPainter::isActive() const
+{
+    return testf(IsActive);
+}
+
+inline const QFont &QPainter::font() const
+{
+    return cfont;
+}
+
+inline const QPen &QPainter::pen() const
+{
+    return cpen;
+}
+
+inline const QBrush &QPainter::brush() const
+{
+    return cbrush;
+}
+inline const QColor &QPainter::backgroundColor() const
+{
+    return bg_col;
+}
+
+inline Qt::BGMode QPainter::backgroundMode() const
+{
+    return (BGMode)bg_mode;
+}
+
+inline Qt::RasterOp QPainter::rasterOp() const
+{
+    return (RasterOp)rop;
+}
+
+inline const QPoint &QPainter::brushOrigin() const
+{
+    return bro;
+}
+
+inline bool QPainter::hasViewXForm() const
+{
+
+    return testf(VxF);
+
+
+
+}
+
+inline bool QPainter::hasWorldXForm() const
+{
+
+    return testf(WxF);
+
+
+
+}
+
+inline double QPainter::translationX() const
+{
+
+    return worldMatrix().dx();
+
+
+
+}
+
+inline double QPainter::translationY() const
+{
+
+    return worldMatrix().dy();
+
+
+
+}
+
+
+inline bool QPainter::hasClipping() const
+{
+    return testf(ClipOn);
+}
+
+inline int QPainter::tabStops() const
+{
+    return tabstops;
+}
+
+inline int *QPainter::tabArray() const
+{
+    return tabarray;
+}
+
+
+
+
+
+
+
+inline Qt::HANDLE QPainter::handle() const
+{
+    return hd;
+}
+
+
+inline void QPainter::setBrushOrigin( const QPoint &p )
+{
+    setBrushOrigin( p.x(), p.y() );
+}
+
+
+inline void QPainter::setWindow( const QRect &r )
+{
+    setWindow( r.x(), r.y(), r.width(), r.height() );
+}
+
+inline void QPainter::setViewport( const QRect &r )
+{
+    setViewport( r.x(), r.y(), r.width(), r.height() );
+}
+
+
+inline void QPainter::setClipRect( int x, int y, int w, int h, CoordinateMode m )
+{
+    setClipRect( QRect(x,y,w,h), m );
+}
+
+inline void QPainter::drawPoint( const QPoint &p )
+{
+    drawPoint( p.x(), p.y() );
+}
+
+inline void QPainter::moveTo( const QPoint &p )
+{
+    moveTo( p.x(), p.y() );
+}
+
+inline void QPainter::lineTo( const QPoint &p )
+{
+    lineTo( p.x(), p.y() );
+}
+
+inline void QPainter::drawLine( const QPoint &p1, const QPoint &p2 )
+{
+    drawLine( p1.x(), p1.y(), p2.x(), p2.y() );
+}
+
+inline void QPainter::drawRect( const QRect &r )
+{
+    drawRect( r.x(), r.y(), r.width(), r.height() );
+}
+
+inline void QPainter::drawWinFocusRect( const QRect &r )
+{
+    drawWinFocusRect( r.x(), r.y(), r.width(), r.height() );
+}
+
+inline void QPainter::drawWinFocusRect( const QRect &r,const QColor &penColor )
+{
+    drawWinFocusRect( r.x(), r.y(), r.width(), r.height(), penColor );
+}
+
+inline void QPainter::drawRoundRect( const QRect &r, int xRnd, int yRnd )
+{
+    drawRoundRect( r.x(), r.y(), r.width(), r.height(), xRnd, yRnd );
+}
+
+inline void QPainter::drawEllipse( const QRect &r )
+{
+    drawEllipse( r.x(), r.y(), r.width(), r.height() );
+}
+
+inline void QPainter::drawArc( const QRect &r, int a, int alen )
+{
+    drawArc( r.x(), r.y(), r.width(), r.height(), a, alen );
+}
+
+inline void QPainter::drawPie( const QRect &r, int a, int alen )
+{
+    drawPie( r.x(), r.y(), r.width(), r.height(), a, alen );
+}
+
+inline void QPainter::drawChord( const QRect &r, int a, int alen )
+{
+    drawChord( r.x(), r.y(), r.width(), r.height(), a, alen );
+}
+
+inline void QPainter::drawPixmap( const QPoint &p, const QPixmap &pm,
+                                  const QRect &sr )
+{
+    drawPixmap( p.x(), p.y(), pm, sr.x(), sr.y(), sr.width(), sr.height() );
+}
+
+inline void QPainter::drawImage( const QPoint &p, const QImage &pm,
+                                 const QRect &sr, int conversionFlags )
+{
+    drawImage( p.x(), p.y(), pm,
+               sr.x(), sr.y(), sr.width(), sr.height(), conversionFlags );
+}
+
+inline void QPainter::drawTiledPixmap( const QRect &r, const QPixmap &pm,
+                                       const QPoint &sp )
+{
+    drawTiledPixmap( r.x(), r.y(), r.width(), r.height(), pm, sp.x(), sp.y() );
+}
+
+inline void QPainter::drawTiledPixmap( const QRect &r, const QPixmap &pm )
+{
+    drawTiledPixmap( r.x(), r.y(), r.width(), r.height(), pm, 0, 0 );
+}
+
+inline void QPainter::fillRect( const QRect &r, const QBrush &brush )
+{
+    fillRect( r.x(), r.y(), r.width(), r.height(), brush );
+}
+
+inline void QPainter::eraseRect( int x, int y, int w, int h )
+{
+    fillRect( x, y, w, h, backgroundColor() );
+}
+
+inline void QPainter::eraseRect( const QRect &r )
+{
+    fillRect( r.x(), r.y(), r.width(), r.height(), backgroundColor() );
+}
+
+inline void QPainter::drawText( const QPoint &p, const QString &s, int len, TextDirection dir )
+{
+    drawText( p.x(), p.y(), s, 0, len, dir );
+}
+
+inline void QPainter::drawText( const QPoint &p, const QString &s, int pos, int len, TextDirection dir )
+{
+    drawText( p.x(), p.y(), s, pos, len, dir );
+}
+
+inline void QPainter::drawText( int x, int y, int w, int h, int tf,
+                                const QString& str, int len, QRect *br, QTextParag **i )
+{
+    QRect r(x, y, w, h);
+    drawText( r, tf, str, len, br, i );
+}
+
+inline void QPainter::drawTextItem( const QPoint& p, const QTextItem &ti, int textflags )
+{
+    drawTextItem( p.x(), p.y(), ti, textflags );
+}
+
+inline QRect QPainter::boundingRect( int x, int y, int w, int h, int tf,
+                                     const QString& str, int len, QTextParag **i )
+{
+    QRect r(x, y, w, h);
+    return boundingRect( r, tf, str, len, i );
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+class QWidget;
+
+class KIconEffectPrivate;
+class KIconEffect
+{
+public:
+
+
+
+    KIconEffect();
+    ~KIconEffect();
+    enum Effects { NoEffect, ToGray, Colorize, ToGamma, DeSaturate, LastEffect };
+
+
+
+
+    void init();
+    bool hasEffect(int group, int state) const;
+     QString fingerprint(int group, int state) const;
+    QImage apply(QImage src, int group, int state) const;
+    QImage apply(QImage src, int effect, float value, const QColor rgb, bool trans) const;
+    QPixmap apply(QPixmap src, int group, int state) const;
+    QPixmap apply(QPixmap src, int effect, float value, const QColor rgb, bool trans) const;
+
+
+
+
+
+
+    QImage doublePixels(QImage src) const;
+    static void visualActivate(QWidget *widget, QRect rect);
+
+
+
+
+
+
+
+    static void toGray(QImage &image, float value);
+    static void colorize(QImage &image, const QColor &col, float value);
+
+
+
+
+
+
+
+    static void deSaturate(QImage &image, float value);
+
+
+
+
+
+
+
+    static void toGamma(QImage &image, float value);
+
+
+
+
+
+
+    static void semiTransparent(QImage &image);
+
+
+
+
+
+
+    static void semiTransparent(QPixmap &pixmap);
+
+
+
+
+
+
+
+    static void overlay(QImage &src, QImage &overlay);
+
+private:
+    int mEffect[6][3];
+    float mValue[6][3];
+    QColor mColor[6][3];
+    bool mTrans[6][3];
+    KIconEffectPrivate *d;
+};
+
+extern bool qt_use_xrender;
+extern bool qt_has_xft;
+
+class KIconEffectPrivate
+{
+public:
+        QString mKey[6][3];
+};
+
+KIconEffect::KIconEffect()
+{
+    d = new KIconEffectPrivate;
+    init();
+}
+
+KIconEffect::~KIconEffect()
+{
+    delete d;
+    d = 0L;
+}
+
+void KIconEffect::init()
+{
+    KConfig *config = KGlobal::config();
+
+    int i, j, effect=-1;
+    QStringList groups;
+    groups += "Desktop";
+    groups += "Toolbar";
+    groups += "MainToolbar";
+    groups += "Small";
+    groups += "Panel";
+
+    QStringList states;
+    states += "Default";
+    states += "Active";
+    states += "Disabled";
+
+    QStringList::ConstIterator it, it2;
+    QString _togray("togray");
+    QString _colorize("colorize");
+    QString _desaturate("desaturate");
+    QString _togamma("togamma");
+    QString _none("none");
+
+    KConfigGroupSaver cs(config, "default");
+
+    for (it=groups.begin(), i=0; it!=groups.end(); it++, i++)
+    {
+
+        mEffect[i][0] = NoEffect;
+        mEffect[i][1] = ((i==0)||(i==4)) ? ToGamma : NoEffect;
+        mEffect[i][2] = ToGray;
+
+        mTrans[i][0] = false;
+        mTrans[i][1] = false;
+        mTrans[i][2] = true;
+        mValue[i][0] = 1.0;
+        mValue[i][1] = ((i==0)||(i==4)) ? 0.7 : 1.0;
+        mValue[i][2] = 1.0;
+        mColor[i][0] = QColor(144,128,248);
+        mColor[i][1] = QColor(169,156,255);
+        mColor[i][2] = QColor(34,202,0);
+
+        config->setGroup(*it + "Icons");
+        for (it2=states.begin(), j=0; it2!=states.end(); it2++, j++)
+        {
+            QString tmp = config->readEntry(*it2 + "Effect");
+            if (tmp == _togray)
+                effect = ToGray;
+            else if (tmp == _colorize)
+                effect = Colorize;
+            else if (tmp == _desaturate)
+                effect = DeSaturate;
+            else if (tmp == _togamma)
+                effect = ToGamma;
+            else if (tmp == _none)
+                effect = NoEffect;
+            else
+                continue;
+            if(effect != -1)
+                mEffect[i][j] = effect;
+            mValue[i][j] = config->readDoubleNumEntry(*it2 + "Value");
+            mColor[i][j] = config->readColorEntry(*it2 + "Color");
+            mTrans[i][j] = config->readBoolEntry(*it2 + "SemiTransparent");
+
+        }
+    }
+}
+
+bool KIconEffect::hasEffect(int group, int state) const
+{
+    return mEffect[group][state] != NoEffect;
+}
+
+QString KIconEffect::fingerprint(int group, int state) const
+{
+    if ( group >= KIcon::LastGroup ) return "";
+    QString cached = d->mKey[group][state];
+    if (cached.isEmpty())
+    {
+        QString tmp;
+        cached = tmp.setNum(mEffect[group][state]);
+        cached += ':';
+        cached += tmp.setNum(mValue[group][state]);
+        cached += ':';
+        cached += mTrans[group][state] ? QString::fromLatin1("trans")
+            : QString::fromLatin1("notrans");
+        if (mEffect[group][state] == Colorize)
+        {
+            cached += ':';
+            cached += mColor[group][state].name();
+        }
+
+        d->mKey[group][state] = cached;
+    }
+
+    return cached;
+}
+
+QImage KIconEffect::apply(QImage image, int group, int state) const
+{
+    if (state >= KIcon::LastState)
+    {
+        kdDebug(265) << "Illegal icon state: " << state << "\n";
+        return image;
+    }
+    if (group >= KIcon::LastGroup)
+    {
+        kdDebug(265) << "Illegal icon group: " << group << "\n";
+        return image;
+    }
+    return apply(image, mEffect[group][state], mValue[group][state],
+            mColor[group][state], mTrans[group][state]);
+}
+
+QImage KIconEffect::apply(QImage image, int effect, float value, const QColor col, bool trans) const
+{
+    if (effect >= LastEffect )
+    {
+        kdDebug(265) << "Illegal icon effect: " << effect << "\n";
+        return image;
+    }
+    if (value > 1.0)
+        value = 1.0;
+    else if (value < 0.0)
+        value = 0.0;
+    switch (effect)
+    {
+    case ToGray:
+        toGray(image, value);
+        break;
+    case DeSaturate:
+        deSaturate(image, value);
+        break;
+    case Colorize:
+        colorize(image, col, value);
+        break;
+    case ToGamma:
+        toGamma(image, value);
+        break;
+    }
+    if (trans == true)
+    {
+        semiTransparent(image);
+    }
+    return image;
+}
+
+QPixmap KIconEffect::apply(QPixmap pixmap, int group, int state) const
+{
+    if (state >= KIcon::LastState)
+    {
+        kdDebug(265) << "Illegal icon state: " << state << "\n";
+        return pixmap;
+    }
+    if (group >= KIcon::LastGroup)
+    {
+        kdDebug(265) << "Illegal icon group: " << group << "\n";
+        return pixmap;
+    }
+    return apply(pixmap, mEffect[group][state], mValue[group][state],
+            mColor[group][state], mTrans[group][state]);
+}
+
+QPixmap KIconEffect::apply(QPixmap pixmap, int effect, float value,
+        const QColor col, bool trans) const
+{
+    QPixmap result;
+
+    if (effect >= LastEffect )
+    {
+        kdDebug(265) << "Illegal icon effect: " << effect << "\n";
+        return result;
+    }
+
+    if ((trans == true) && (effect == NoEffect))
+    {
+        result = pixmap;
+        semiTransparent(result);
+    }
+    else if ( effect != NoEffect )
+    {
+        QImage tmpImg = pixmap.convertToImage();
+        tmpImg = apply(tmpImg, effect, value, col, trans);
+        result.convertFromImage(tmpImg);
+    }
+    else
+        result = pixmap;
+
+    return result;
+}
+
+
+
+
+void KIconEffect::toGray(QImage &img, float value)
+{
+    int pixels = (img.depth() > 8) ? img.width()*img.height()
+            : img.numColors();
+    unsigned int *data = img.depth() > 8 ? (unsigned int *) img.bits()
+            : (unsigned int *) img.colorTable();
+    int rval, gval, bval, val, alpha, i;
+    for (i=0; i<pixels; i++)
+    {
+        val = qGray(data[i]);
+        alpha = qAlpha(data[i]);
+        if (value < 1.0)
+        {
+            rval = static_cast<int>(value*val+(1.0-value)*qRed(data[i]));
+            gval = static_cast<int>(value*val+(1.0-value)*qGreen(data[i]));
+            bval = static_cast<int>(value*val+(1.0-value)*qBlue(data[i]));
+            data[i] = qRgba(rval, gval, bval, alpha);
+        } else
+            data[i] = qRgba(val, val, val, alpha);
+    }
+}
+
+void KIconEffect::colorize(QImage &img, const QColor &col, float value)
+{
+    int pixels = (img.depth() > 8) ? img.width()*img.height()
+            : img.numColors();
+    unsigned int *data = img.depth() > 8 ? (unsigned int *) img.bits()
+            : (unsigned int *) img.colorTable();
+    int rval, gval, bval, val, alpha, i;
+    float rcol = col.red(), gcol = col.green(), bcol = col.blue();
+    for (i=0; i<pixels; i++)
+    {
+        val = qGray(data[i]);
+        if (val < 128)
+        {
+             rval = static_cast<int>(rcol/128*val);
+             gval = static_cast<int>(gcol/128*val);
+             bval = static_cast<int>(bcol/128*val);
+        }
+        else if (val > 128)
+        {
+             rval = static_cast<int>((val-128)*(2-rcol/128)+rcol-1);
+             gval = static_cast<int>((val-128)*(2-gcol/128)+gcol-1);
+             bval = static_cast<int>((val-128)*(2-bcol/128)+bcol-1);
+        }
+        else
+        {
+             rval = static_cast<int>(rcol);
+             gval = static_cast<int>(gcol);
+             bval = static_cast<int>(bcol);
+        }
+        if (value < 1.0)
+        {
+            rval = static_cast<int>(value*rval+(1.0 - value)*qRed(data[i]));
+            gval = static_cast<int>(value*gval+(1.0 - value)*qGreen(data[i]));
+            bval = static_cast<int>(value*bval+(1.0 - value)*qBlue(data[i]));
+        }
+
+        alpha = qAlpha(data[i]);
+        data[i] = qRgba(rval, gval, bval, alpha);
+    }
+}
+
+void KIconEffect::deSaturate(QImage &img, float value)
+{
+    int pixels = (img.depth() > 8) ? img.width()*img.height()
+            : img.numColors();
+    unsigned int *data = (img.depth() > 8) ? (unsigned int *) img.bits()
+            : (unsigned int *) img.colorTable();
+    QColor color;
+    int h, s, v, i;
+    for (i=0; i<pixels; i++)
+    {
+        color.setRgb(data[i]);
+        color.hsv(&h, &s, &v);
+        color.setHsv(h, (int) (s * (1.0 - value) + 0.5), v);
+        data[i] = qRgba(color.red(), color.green(), color.blue(),
+                qAlpha(data[i]));
+    }
+}
+
+void KIconEffect::toGamma(QImage &img, float value)
+{
+    int pixels = (img.depth() > 8) ? img.width()*img.height()
+            : img.numColors();
+    unsigned int *data = (img.depth() > 8) ? (unsigned int *) img.bits()
+            : (unsigned int *) img.colorTable();
+    QColor color;
+    int i, rval, gval, bval;
+    float gamma;
+    gamma = 1/(2*value+0.5);
+
+    for (i=0; i<pixels; i++)
+    {
+        color.setRgb(data[i]);
+        color.rgb(&rval, &gval, &bval);
+        rval = static_cast<int>(pow(static_cast<float>(rval)/255 , gamma)*255);
+        gval = static_cast<int>(pow(static_cast<float>(gval)/255 , gamma)*255);
+        bval = static_cast<int>(pow(static_cast<float>(bval)/255 , gamma)*255);
+        data[i] = qRgba(rval, gval, bval, qAlpha(data[i]));
+    }
+}
+
+void KIconEffect::semiTransparent(QImage &img)
+{
+    img.setAlphaBuffer(true);
+
+    int x, y;
+    if (img.depth() == 32)
+    {
+        int width = img.width();
+        int height = img.height();
+
+        if (qt_use_xrender && qt_has_xft )
+          for (y=0; y<height; y++)
+          {
+
+
+
+            uchar *line = (uchar*) img.scanLine(y) + 3;
+
+            for (x=0; x<width; x++)
+            {
+                *line >>= 1;
+                line += 4;
+            }
+          }
+        else
+          for (y=0; y<height; y++)
+          {
+            QRgb *line = (QRgb *) img.scanLine(y);
+            for (x=(y%2); x<width; x+=2)
+                line[x] &= 0x00ffffff;
+          }
+
+    } else
+    {
+
+        int transColor = -1;
+
+
+        for (x=0; x<img.numColors(); x++)
+        {
+
+            if (qAlpha(img.color(x)) < 127)
+            {
+                transColor = x;
+                break;
+            }
+        }
+
+
+
+        if(transColor < 0 || transColor >= img.numColors())
+            return;
+
+        img.setColor(transColor, 0);
+        if(img.depth() == 8)
+        {
+            for (y=0; y<img.height(); y++)
+            {
+                unsigned char *line = img.scanLine(y);
+                for (x=(y%2); x<img.width(); x+=2)
+                    line[x] = transColor;
+            }
+        }
+        else
+        {
+
+
+            for (y=0; y<img.height(); y++)
+                for (x=(y%2); x<img.width(); x+=2)
+                    img.setPixel(x, y, transColor);
+        }
+    }
+}
+
+void KIconEffect::semiTransparent(QPixmap &pix)
+{
+    if ( qt_use_xrender && qt_has_xft )
+    {
+        QImage img=pix.convertToImage();
+        semiTransparent(img);
+        pix.convertFromImage(img);
+        return;
+    }
+
+    QImage img;
+    if (pix.mask() != 0L)
+        img = pix.mask()->convertToImage();
+    else
+    {
+        img.create(pix.size(), 1, 2, QImage::BigEndian);
+        img.fill(1);
+    }
+
+    for (int y=0; y<img.height(); y++)
+    {
+        QRgb *line = (QRgb *) img.scanLine(y);
+        QRgb pattern = (y % 2) ? 0x55555555 : 0xaaaaaaaa;
+        for (int x=0; x<(img.width()+31)/32; x++)
+            line[x] &= pattern;
+    }
+    QBitmap mask;
+    mask.convertFromImage(img);
+    pix.setMask(mask);
+}
+
+QImage KIconEffect::doublePixels(QImage src) const
+{
+    QImage dst;
+    if (src.depth() == 1)
+    {
+        kdDebug(265) << "image depth 1 not supported\n";
+        return dst;
+    }
+
+    int w = src.width();
+    int h = src.height();
+    dst.create(w*2, h*2, src.depth());
+    dst.setAlphaBuffer(src.hasAlphaBuffer());
+
+    int x, y;
+    if (src.depth() == 32)
+    {
+        QRgb *l1, *l2;
+        for (y=0; y<h; y++)
+        {
+            l1 = (QRgb *) src.scanLine(y);
+            l2 = (QRgb *) dst.scanLine(y*2);
+            for (x=0; x<w; x++)
+            {
+                l2[x*2] = l2[x*2+1] = l1[x];
+            }
+            memcpy(dst.scanLine(y*2+1), l2, dst.bytesPerLine());
+        }
+    } else
+    {
+        for (x=0; x<src.numColors(); x++)
+            dst.setColor(x, src.color(x));
+
+        unsigned char *l1, *l2;
+        for (y=0; y<h; y++)
+        {
+            l1 = src.scanLine(y);
+            l2 = dst.scanLine(y*2);
+            for (x=0; x<w; x++)
+            {
+                l2[x*2] = l1[x];
+                l2[x*2+1] = l1[x];
+            }
+            memcpy(dst.scanLine(y*2+1), l2, dst.bytesPerLine());
+        }
+    }
+    return dst;
+}
+
+void KIconEffect::overlay(QImage &src, QImage &overlay)
+{
+    if (src.depth() != overlay.depth())
+    {
+        kdDebug(265) << "Image depth src != overlay!\n";
+        return;
+    }
+    if (src.size() != overlay.size())
+    {
+        kdDebug(265) << "Image size src != overlay\n";
+        return;
+    }
+    if (!overlay.hasAlphaBuffer())
+    {
+        kdDebug(265) << "Overlay doesn't have alpha buffer!\n";
+        return;
+    }
+
+    int i, j;
+
+
+
+    if (src.depth() == 1)
+    {
+        kdDebug(265) << "1bpp not supported!\n";
+        return;
+    }
+
+
+
+    if (src.depth() == 8)
+    {
+        if (src.numColors() + overlay.numColors() > 255)
+        {
+            kdDebug(265) << "Too many colors in src + overlay!\n";
+            return;
+        }
+
+
+        int trans;
+        for (trans=0; trans<overlay.numColors(); trans++)
+        {
+            if (qAlpha(overlay.color(trans)) == 0)
+            {
+                kdDebug(265) << "transparent pixel found at " << trans << "\n";
+                break;
+            }
+        }
+        if (trans == overlay.numColors())
+        {
+            kdDebug(265) << "transparent pixel not found!\n";
+            return;
+        }
+
+
+        int nc = src.numColors();
+        src.setNumColors(nc + overlay.numColors());
+        for (i=0; i<overlay.numColors(); i++)
+        {
+            src.setColor(nc+i, overlay.color(i));
+        }
+
+
+        unsigned char *oline, *sline;
+        for (i=0; i<src.height(); i++)
+        {
+            oline = overlay.scanLine(i);
+            sline = src.scanLine(i);
+            for (j=0; j<src.width(); j++)
+            {
+                if (oline[j] != trans)
+                    sline[j] = oline[j]+nc;
+            }
+        }
+    }
+
+
+
+    if (src.depth() == 32)
+    {
+        QRgb *oline, *sline;
+        int r1, g1, b1, a1;
+        int r2, g2, b2, a2;
+
+        for (i=0; i<src.height(); i++)
+        {
+            oline = (QRgb *) overlay.scanLine(i);
+            sline = (QRgb *) src.scanLine(i);
+
+            for (j=0; j<src.width(); j++)
+            {
+                r1 = qRed(oline[j]);
+                g1 = qGreen(oline[j]);
+                b1 = qBlue(oline[j]);
+                a1 = qAlpha(oline[j]);
+
+                r2 = qRed(sline[j]);
+                g2 = qGreen(sline[j]);
+                b2 = qBlue(sline[j]);
+                a2 = qAlpha(sline[j]);
+
+                r2 = (a1 * r1 + (0xff - a1) * r2) >> 8;
+                g2 = (a1 * g1 + (0xff - a1) * g2) >> 8;
+                b2 = (a1 * b1 + (0xff - a1) * b2) >> 8;
+                a2 = ((a2) < (a1) ? (a1) : (a2));
+
+                sline[j] = qRgba(r2, g2, b2, a2);
+            }
+        }
+    }
+
+    return;
+}
+
+    void
+KIconEffect::visualActivate(QWidget * widget, QRect rect)
+{
+    if (!KGlobalSettings::visualActivate())
+        return;
+
+    uint actSpeed = KGlobalSettings::visualActivateSpeed();
+
+    uint actCount = ((rect.width()) < (rect.height()) ? (rect.width()) : (rect.height())) / 2;
+
+
+
+    if (actCount < 1)
+        actCount = 1;
+
+    else if (actCount > 10)
+        actCount = 10;
+
+
+
+    if (actSpeed < 1)
+        actSpeed = 1;
+
+    else if (actSpeed > 100)
+        actSpeed = 100;
+
+
+
+
+
+
+    unsigned int actDelay = (1000 * (100 - actSpeed)) / actCount;
+
+
+
+    QPoint c = rect.center();
+
+    QPainter p(widget);
+
+
+    p.setPen(QPen(Qt::black, 2, Qt::DotLine));
+    p.setRasterOp(Qt::NotROP);
+
+
+
+
+
+
+
+    unsigned int deltaX = rect.width() / actCount;
+    unsigned int deltaY = rect.height() / actCount;
+
+    for (unsigned int i = 1; i < actCount; i++) {
+
+        int w = i * deltaX;
+        int h = i * deltaY;
+
+        rect.setRect(c.x() - w / 2, c.y() - h / 2, w, h);
+
+        p.drawRect(rect);
+        p.flush();
+
+        usleep(actDelay);
+
+        p.drawRect(rect);
+    }
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C"
+
+int mkstemps(char *, int);
+extern "C"
+
+unsigned long strlcat(char*, const char*, unsigned long);
+
+
+
+
+
+
+extern "C"
+
+unsigned long strlcpy(char*, const char*, unsigned long);
+
+
+
+
+class KIconThemePrivate
+{
+public:
+    QString example, screenshot;
+    QString linkOverlay, lockOverlay, zipOverlay, shareOverlay;
+    bool hidden;
+};
+
+
+
+
+class KIconThemeDir
+{
+public:
+    KIconThemeDir(const QString& dir, const KConfigBase *config);
+
+    bool isValid() const { return mbValid; }
+    QString iconPath(const QString& name) const;
+    QStringList iconList() const;
+    QString dir() const { return mDir; }
+
+    KIcon::Context context() const { return mContext; }
+    KIcon::Type type() const { return mType; }
+    int size() const { return mSize; }
+    int minSize() const { return mMinSize; }
+    int maxSize() const { return mMaxSize; }
+    int threshold() const { return mThreshold; }
+
+private:
+    bool mbValid;
+    KIcon::Type mType;
+    KIcon::Context mContext;
+    int mSize, mMinSize, mMaxSize;
+    int mThreshold;
+
+    QString mDir;
+};
+
+
+
+
+KIconTheme::KIconTheme(const QString& name, const QString& appName)
+{
+    d = new KIconThemePrivate;
+
+    QStringList icnlibs;
+    QStringList::ConstIterator it, itDir;
+    QStringList themeDirs;
+    QString cDir;
+
+
+
+
+
+    if (!appName.isEmpty() &&
+       ( name == "crystalsvg" || name== "hicolor" || name == "locolor" ) )
+    {
+        icnlibs = KGlobal::dirs()->resourceDirs("data");
+        for (it=icnlibs.begin(); it!=icnlibs.end(); it++)
+        {
+            cDir = *it + appName + "/icons/" + name;
+            if (QFile::exists( cDir ))
+                themeDirs += cDir + "/";
+        }
+    }
+
+
+    icnlibs = KGlobal::dirs()->resourceDirs("icon");
+    for (it=icnlibs.begin(); it!=icnlibs.end(); it++)
+    {
+        cDir = *it + name + "/";
+        if (KStandardDirs::exists(cDir))
+        {
+            themeDirs += cDir;
+            if (mDir.isEmpty()
+                    && (KStandardDirs::exists( cDir + "index.desktop") || KStandardDirs::exists( cDir + "index.theme")))
+                mDir = cDir;
+        }
+    }
+
+    if (mDir.isEmpty())
+    {
+        kdDebug(264) << "Icon theme " << name << " not found.\n";
+        return;
+    }
+
+    QString fileName, mainSection;
+    if(QFile::exists(mDir + "index.desktop")) {
+        fileName = mDir + "index.desktop";
+        mainSection="KDE Icon Theme";
+    } else {
+        fileName = mDir + "index.theme";
+        mainSection="Icon Theme";
+    }
+    KSimpleConfig cfg(fileName);
+    cfg.setGroup(mainSection);
+    mName = cfg.readEntry("Name");
+    mDesc = cfg.readEntry("Comment");
+    mDepth = cfg.readNumEntry("DisplayDepth", 32);
+    mInherits = cfg.readListEntry("Inherits");
+    if ( name != "crystalsvg" )
+      for ( QStringList::Iterator it = mInherits.begin(); it != mInherits.end(); ++it )
+         if ( *it == "default" || *it == "hicolor" ) *it="crystalsvg";
+
+    d->hidden = cfg.readBoolEntry("Hidden", false);
+    d->example = cfg.readPathEntry("Example");
+    d->screenshot = cfg.readPathEntry("ScreenShot");
+    d->linkOverlay = cfg.readEntry("LinkOverlay", "link");
+    d->lockOverlay = cfg.readEntry("LockOverlay", "lock");
+    d->zipOverlay = cfg.readEntry("ZipOverlay", "zip");
+    d->shareOverlay = cfg.readEntry("ShareOverlay","share");
+
+    QStringList dirs = cfg.readPathListEntry("Directories");
+    mDirs.setAutoDelete(true);
+    for (it=dirs.begin(); it!=dirs.end(); it++)
+    {
+        cfg.setGroup(*it);
+        for (itDir=themeDirs.begin(); itDir!=themeDirs.end(); itDir++)
+        {
+            if (KStandardDirs::exists(*itDir + *it + "/"))
+            {
+                KIconThemeDir *dir = new KIconThemeDir(*itDir + *it, &cfg);
+                if (!dir->isValid())
+                {
+                    kdWarning(264) << "Icon directory " << *itDir << " group " << *it << " not valid.\n";
+                    delete dir;
+                }
+                else
+                    mDirs.append(dir);
+            }
+        }
+    }
+
+
+    int i;
+    QMap<int,QValueList<int> > scIcons;
+    for (KIconThemeDir *dir=mDirs.first(); dir!=0L; dir=mDirs.next())
+    {
+        if ((dir->type() == KIcon::Scalable) && !scIcons.contains(dir->size()))
+        {
+            QValueList<int> lst;
+            for (i=dir->minSize(); i<=dir->maxSize(); i++)
+                lst += i;
+            scIcons[dir->size()] = lst;
+        }
+    }
+
+    QStringList groups;
+    groups += "Desktop";
+    groups += "Toolbar";
+    groups += "MainToolbar";
+    groups += "Small";
+    groups += "Panel";
+    const int defDefSizes[] = { 32, 22, 22, 16, 32 };
+    cfg.setGroup(mainSection);
+    for (it=groups.begin(), i=0; it!=groups.end(); it++, i++)
+    {
+        mDefSize[i] = cfg.readNumEntry(*it + "Default", defDefSizes[i]);
+        QValueList<int> lst = cfg.readIntListEntry(*it + "Sizes"), exp;
+        QValueList<int>::ConstIterator it2;
+        for (it2=lst.begin(); it2!=lst.end(); it2++)
+        {
+            if (scIcons.contains(*it2))
+                exp += scIcons[*it2];
+            else
+                exp += *it2;
+        }
+        mSizes[i] = exp;
+    }
+
+}
+
+KIconTheme::~KIconTheme()
+{
+    delete d;
+}
+
+bool KIconTheme::isValid() const
+{
+    return !mDirs.isEmpty();
+}
+
+bool KIconTheme::isHidden() const
+{
+    return d->hidden;
+}
+
+QString KIconTheme::example() const { return d->example; }
+QString KIconTheme::screenshot() const { return d->screenshot; }
+QString KIconTheme::linkOverlay() const { return d->linkOverlay; }
+QString KIconTheme::lockOverlay() const { return d->lockOverlay; }
+QString KIconTheme::zipOverlay() const { return d->zipOverlay; }
+QString KIconTheme::shareOverlay() const { return d->shareOverlay; }
+
+int KIconTheme::defaultSize(KIcon::Group group) const
+{
+    if ((group < 0) || (group >= KIcon::LastGroup))
+    {
+        kdDebug(264) << "Illegal icon group: " << group << "\n";
+        return -1;
+    }
+    return mDefSize[group];
+}
+
+QValueList<int> KIconTheme::querySizes(KIcon::Group group) const
+{
+    QValueList<int> empty;
+    if ((group < 0) || (group >= KIcon::LastGroup))
+    {
+        kdDebug(264) << "Illegal icon group: " << group << "\n";
+        return empty;
+    }
+    return mSizes[group];
+}
+
+QStringList KIconTheme::queryIcons(int size, KIcon::Context context) const
+{
+    int delta = 1000, dw;
+
+    QPtrListIterator<KIconThemeDir> dirs(mDirs);
+    KIconThemeDir *dir;
+
+
+    QStringList result;
+    for ( ; dirs.current(); ++dirs)
+    {
+        dir = dirs.current();
+        if ((context != KIcon::Any) && (context != dir->context()))
+            continue;
+        if ((dir->type() == KIcon::Fixed) && (dir->size() == size))
+        {
+            result += dir->iconList();
+            continue;
+        }
+        if ((dir->type() == KIcon::Scalable) &&
+            (size >= dir->minSize()) && (size <= dir->maxSize()))
+        {
+            result += dir->iconList();
+            continue;
+        }
+        if ((dir->type() == KIcon::Threshold) &&
+            (abs(size-dir->size())<dir->threshold()))
+            result+=dir->iconList();
+    }
+
+    return result;
+
+    dirs.toFirst();
+
+
+    KIconThemeDir *best = 0L;
+    for ( ; dirs.current(); ++dirs)
+    {
+        dir = dirs.current();
+        if ((context != KIcon::Any) && (context != dir->context()))
+            continue;
+        dw = dir->size() - size;
+        if ((dw > 6) || (abs(dw) >= abs(delta)))
+            continue;
+        delta = dw;
+        best = dir;
+    }
+    if (best == 0L)
+        return QStringList();
+
+    return best->iconList();
+}
+
+QStringList KIconTheme::queryIconsByContext(int size, KIcon::Context context) const
+{
+    QPtrListIterator<KIconThemeDir> dirs(mDirs);
+    int dw;
+    KIconThemeDir *dir;
+
+
+
+
+    QStringList iconlist[128];
+
+
+
+
+    for ( ; dirs.current(); ++dirs)
+    {
+        dir = dirs.current();
+        if ((context != KIcon::Any) && (context != dir->context()))
+            continue;
+        dw = abs(dir->size() - size);
+        iconlist[(dw<127)?dw:127]+=dir->iconList();
+    }
+
+    QStringList iconlistResult;
+    for (int i=0; i<128; i++) iconlistResult+=iconlist[i];
+
+    return iconlistResult;
+}
+
+KIcon KIconTheme::iconPath(const QString& name, int size, KIcon::MatchType match) const
+{
+    KIcon icon;
+    QString path;
+    int delta = 1000, dw;
+    KIconThemeDir *dir;
+
+    dw = 1000;
+    QPtrListIterator<KIconThemeDir> dirs(mDirs);
+    for ( ; dirs.current(); ++dirs)
+    {
+        dir = dirs.current();
+
+        if (match == KIcon::MatchExact)
+        {
+            if ((dir->type() == KIcon::Fixed) && (dir->size() != size))
+                continue;
+            if ((dir->type() == KIcon::Scalable) &&
+                ((size < dir->minSize()) || (size > dir->maxSize())))
+              continue;
+            if ((dir->type() == KIcon::Threshold) &&
+                (abs(dir->size()-size) > dir->threshold()))
+                continue;
+        } else
+        {
+            dw = dir->size() - size;
+            if (dir->type() != KIcon::Threshold &&
+               ((dw > 7) || (abs(dw) >= abs(delta))))
+                continue;
+        }
+
+        path = dir->iconPath(name);
+        if (path.isEmpty())
+            continue;
+        icon.path = path;
+        icon.size = dir->size();
+        icon.type = dir->type();
+        icon.threshold = dir->threshold();
+        icon.context = dir->context();
+
+
+        if (match == KIcon::MatchExact)
+            return icon;
+        else
+        {
+            delta = dw;
+            if (delta==0) return icon;
+        }
+    }
+    return icon;
+}
+
+
+QString *KIconTheme::_theme = 0L;
+
+
+QStringList *KIconTheme::_theme_list = 0L;
+
+
+QString KIconTheme::current()
+{
+
+    if (_theme != 0L)
+        return *_theme;
+
+    _theme = new QString();
+    KConfig *config = KGlobal::config();
+    KConfigGroupSaver saver(config, "Icons");
+    *_theme = config->readEntry("Theme",defaultThemeName());
+    if ( *_theme == QString::fromLatin1("hicolor") ) *_theme = defaultThemeName();
+
+
+
+
+
+
+
+    return *_theme;
+}
+
+
+QStringList KIconTheme::list()
+{
+
+    if (_theme_list != 0L)
+        return *_theme_list;
+
+    _theme_list = new QStringList();
+    QStringList icnlibs = KGlobal::dirs()->resourceDirs("icon");
+    QStringList::ConstIterator it;
+    for (it=icnlibs.begin(); it!=icnlibs.end(); it++)
+    {
+        QDir dir(*it);
+        if (!dir.exists())
+            continue;
+        QStringList lst = dir.entryList(QDir::Dirs);
+        QStringList::ConstIterator it2;
+        for (it2=lst.begin(); it2!=lst.end(); it2++)
+        {
+            if ((*it2 == ".") || (*it2 == "..") || (*it2).startsWith("default.") )
+                continue;
+            if (!KStandardDirs::exists(*it + *it2 + "/index.desktop") && !KStandardDirs::exists(*it + *it2 + "/index.theme"))
+                continue;
+            if (!_theme_list->contains(*it2))
+                _theme_list->append(*it2);
+        }
+    }
+    return *_theme_list;
+}
+
+
+void KIconTheme::reconfigure()
+{
+    delete _theme;
+    _theme=0L;
+    delete _theme_list;
+    _theme_list=0L;
+}
+
+
+QString KIconTheme::defaultThemeName()
+{
+    return QString::fromLatin1("crystalsvg");
+}
+
+
+
+KIconThemeDir::KIconThemeDir(const QString& dir, const KConfigBase *config)
+{
+    mbValid = false;
+    mDir = dir;
+    mSize = config->readNumEntry("Size");
+    mMinSize = 1;
+    mMaxSize = 50;
+    mType = KIcon::Fixed;
+
+    if (mSize == 0)
+        return;
+
+    QString tmp = config->readEntry("Context");
+    if (tmp == "Devices")
+        mContext = KIcon::Device;
+    else if (tmp == "MimeTypes")
+        mContext = KIcon::MimeType;
+    else if (tmp == "FileSystems")
+        mContext = KIcon::FileSystem;
+    else if (tmp == "Applications")
+        mContext = KIcon::Application;
+    else if (tmp == "Actions")
+        mContext = KIcon::Action;
+    else {
+        kdDebug(264) << "Invalid Context= line for icon theme: " << mDir << "\n";
+        return;
+    }
+    tmp = config->readEntry("Type");
+    if (tmp == "Fixed")
+        mType = KIcon::Fixed;
+    else if (tmp == "Scalable")
+        mType = KIcon::Scalable;
+    else if (tmp == "Threshold")
+        mType = KIcon::Threshold;
+    else {
+        kdDebug(264) << "Invalid Type= line for icon theme: " << mDir << "\n";
+        return;
+    }
+    if (mType == KIcon::Scalable)
+    {
+        mMinSize = config->readNumEntry("MinSize", mSize);
+        mMaxSize = config->readNumEntry("MaxSize", mSize);
+    } else if (mType == KIcon::Threshold)
+        mThreshold = config->readNumEntry("Threshold", 2);
+    mbValid = true;
+}
+
+QString KIconThemeDir::iconPath(const QString& name) const
+{
+    if (!mbValid)
+        return QString::null;
+    QString file = mDir + "/" + name;
+
+    if (access(QFile::encodeName(file), 4) == 0)
+        return file;
+
+    return QString::null;
+}
+
+QStringList KIconThemeDir::iconList() const
+{
+    QDir dir(mDir);
+
+    QStringList lst = dir.entryList("*.png;*.svg;*.svgz;*.xpm", QDir::Files);
+
+
+
+    QStringList result;
+    QStringList::ConstIterator it;
+    for (it=lst.begin(); it!=lst.end(); it++)
+        result += mDir + "/" + *it;
+    return result;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C"
+
+int mkstemps(char *, int);
+extern "C"
+
+unsigned long strlcat(char*, const char*, unsigned long);
+
+
+
+
+
+
+extern "C"
+
+unsigned long strlcpy(char*, const char*, unsigned long);
+
+
+
+
+
+
+
+
+
+class KSVGIconPainter;
+
+class KSVGIconEngine
+{
+public:
+        KSVGIconEngine();
+        ~KSVGIconEngine();
+
+        bool load(int width, int height, const QString &path);
+
+        KSVGIconPainter *painter();
+        QImage *image();
+
+        double width();
+        double height();
+
+private:
+        struct Private;
+        Private *d;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef unsigned char art_u8;
+typedef unsigned short art_u16;
+typedef unsigned int art_u32;
+
+
+
+
+
+
+
+
+
+
+
+typedef int art_boolean;
+
+
+
+
+
+
+
+
+extern "C" {
+
+
+void __attribute__((noreturn))
+art_die (const char *fmt, ...) __attribute__((format (printf, 1, 2)));
+
+void
+art_warn (const char *fmt, ...) __attribute__((format (printf, 1, 2)));
+
+void
+art_dprint (const char *fmt, ...) __attribute__((format (printf, 1, 2)));
+
+
+}
+
+
+
+
+
+extern "C" {
+
+
+typedef struct _ArtAlphaGamma ArtAlphaGamma;
+
+struct _ArtAlphaGamma {
+
+  double gamma;
+  int invtable_size;
+  int table[256];
+  art_u8 invtable[1];
+};
+
+ArtAlphaGamma *
+art_alphagamma_new (double gamma);
+
+void
+art_alphagamma_free (ArtAlphaGamma *alphagamma);
+
+
+}
+
+
+
+extern "C" {
+
+
+
+
+
+
+
+
+typedef art_u16 ArtPixMaxDepth;
+
+typedef struct _ArtRender ArtRender;
+typedef struct _ArtRenderCallback ArtRenderCallback;
+typedef struct _ArtRenderMaskRun ArtRenderMaskRun;
+typedef struct _ArtImageSource ArtImageSource;
+typedef struct _ArtMaskSource ArtMaskSource;
+
+typedef enum {
+  ART_ALPHA_NONE = 0,
+  ART_ALPHA_SEPARATE = 1,
+  ART_ALPHA_PREMUL = 2
+} ArtAlphaType;
+
+typedef enum {
+  ART_COMPOSITE_NORMAL,
+  ART_COMPOSITE_MULTIPLY,
+
+  ART_COMPOSITE_CUSTOM
+} ArtCompositingMode;
+
+typedef enum {
+  ART_IMAGE_SOURCE_CAN_CLEAR = 1,
+  ART_IMAGE_SOURCE_CAN_COMPOSITE = 2
+} ArtImageSourceFlags;
+
+struct _ArtRenderMaskRun {
+  int x;
+  int alpha;
+};
+
+struct _ArtRenderCallback {
+  void (*render) (ArtRenderCallback *self, ArtRender *render,
+                  art_u8 *dest, int y);
+  void (*done) (ArtRenderCallback *self, ArtRender *render);
+};
+
+struct _ArtImageSource {
+  ArtRenderCallback super;
+  void (*negotiate) (ArtImageSource *self, ArtRender *render,
+                     ArtImageSourceFlags *p_flags,
+                     int *p_buf_depth, ArtAlphaType *p_alpha_type);
+};
+
+struct _ArtMaskSource {
+  ArtRenderCallback super;
+  int (*can_drive) (ArtMaskSource *self, ArtRender *render);
+
+
+  void (*invoke_driver) (ArtMaskSource *self, ArtRender *render);
+  void (*prepare) (ArtMaskSource *self, ArtRender *render, art_boolean first);
+};
+
+struct _ArtRender {
+
+  int x0, y0;
+  int x1, y1;
+  art_u8 *pixels;
+  int rowstride;
+  int n_chan;
+  int depth;
+  ArtAlphaType alpha_type;
+
+  art_boolean clear;
+  ArtPixMaxDepth clear_color[16 + 1];
+  art_u32 opacity;
+
+  ArtCompositingMode compositing_mode;
+
+  ArtAlphaGamma *alphagamma;
+
+  art_u8 *alpha_buf;
+
+
+  int buf_depth;
+  ArtAlphaType buf_alpha;
+  art_u8 *image_buf;
+
+
+
+  int n_run;
+  ArtRenderMaskRun *run;
+
+
+  int n_span;
+  int *span_x;
+
+  art_boolean need_span;
+};
+
+ArtRender *
+art_render_new (int x0, int y0, int x1, int y1,
+                art_u8 *pixels, int rowstride,
+                int n_chan, int depth, ArtAlphaType alpha_type,
+                ArtAlphaGamma *alphagamma);
+
+void
+art_render_invoke (ArtRender *render);
+
+void
+art_render_clear (ArtRender *render, const ArtPixMaxDepth *clear_color);
+
+void
+art_render_clear_rgb (ArtRender *render, art_u32 clear_rgb);
+
+void
+art_render_mask_solid (ArtRender *render, int opacity);
+
+void
+art_render_image_solid (ArtRender *render, ArtPixMaxDepth *color);
+
+
+void
+art_render_add_mask_source (ArtRender *render, ArtMaskSource *mask_source);
+
+void
+art_render_invoke_callbacks (ArtRender *render, art_u8 *dest, int y);
+
+
+void
+art_render_add_image_source (ArtRender *render, ArtImageSource *image_source);
+
+
+}
+
+
+
+
+
+
+
+extern "C" {
+
+
+typedef enum {
+  ART_FILTER_NEAREST,
+  ART_FILTER_TILES,
+  ART_FILTER_BILINEAR,
+  ART_FILTER_HYPER
+} ArtFilterLevel;
+}
+
+
+
+
+extern "C" {
+
+
+typedef struct _ArtGradientLinear ArtGradientLinear;
+typedef struct _ArtGradientRadial ArtGradientRadial;
+typedef struct _ArtGradientStop ArtGradientStop;
+
+typedef enum {
+  ART_GRADIENT_PAD,
+  ART_GRADIENT_REFLECT,
+  ART_GRADIENT_REPEAT
+} ArtGradientSpread;
+
+struct _ArtGradientLinear {
+  double a;
+  double b;
+  double c;
+  ArtGradientSpread spread;
+  int n_stops;
+  ArtGradientStop *stops;
+};
+
+struct _ArtGradientRadial {
+  double affine[6];
+  double fx, fy;
+  int n_stops;
+  ArtGradientStop *stops;
+};
+
+struct _ArtGradientStop {
+  double offset;
+  ArtPixMaxDepth color[16 + 1];
+};
+
+void
+art_render_gradient_linear (ArtRender *render,
+                            const ArtGradientLinear *gradient,
+                            ArtFilterLevel level);
+
+void
+art_render_gradient_radial (ArtRender *render,
+                            const ArtGradientRadial *gradient,
+                            ArtFilterLevel level);
+
+
+}
+
+class QImage;
+class QColor;
+class QWMatrix;
+class QDomElement;
+class QPointArray;
+
+class KSVGIconPainter
+{
+public:
+        KSVGIconPainter(int width, int height, int dwidth, int dheight);
+        ~KSVGIconPainter();
+
+        QImage *image();
+
+        QWMatrix *worldMatrix();
+
+        void finish();
+
+        void setUseFill(bool fill);
+        void setUseStroke(bool stroke);
+
+        void setStrokeWidth(double width);
+        void setStrokeMiterLimit(const QString &miter);
+        void setCapStyle(const QString &cap);
+        void setJoinStyle(const QString &join);
+        void setStrokeColor(const QString &stroke);
+        void setFillColor(const QString &fill);
+        void setFillRule(const QString &fillRule);
+        void setOpacity(const QString &opacity);
+        void setFillOpacity(const QString &fillOpacity);
+        void setStrokeOpacity(const QString &strokeOpacity);
+        void setStrokeDashOffset(const QString &dashOffset);
+        void setStrokeDashArray(const QString &dashes);
+
+        void setWorldMatrix(QWMatrix *worldMatrix);
+        void setClippingRect(int x, int y, int w, int h);
+
+        void drawRectangle(double x, double y, double w, double h, double rx, double ry);
+        void drawEllipse(double cx, double cy, double rx, double ry);
+        void drawLine(double x1, double y1, double x2, double y2);
+        void drawPolyline(QPointArray polyArray, int points = -1);
+        void drawPolygon(QPointArray polyArray);
+        void drawPath(const QString &data, bool fill);
+        void drawImage(double x, double y, QImage &image);
+
+        QColor parseColor(const QString &param);
+        Q_UINT32 toArtColor(QColor color);
+        Q_UINT32 parseOpacity(QString data);
+
+        double toPixel(const QString &s, bool hmode);
+        double dpi();
+
+        ArtGradientLinear *linearGradient(const QString &id);
+        void addLinearGradient(const QString &id, ArtGradientLinear *gradient);
+
+        QDomElement linearGradientElement(ArtGradientLinear *linear);
+        void addLinearGradientElement(ArtGradientLinear *gradient, QDomElement element);
+
+        ArtGradientRadial *radialGradient(const QString &id);
+        void addRadialGradient(const QString &id, ArtGradientRadial *gradient);
+
+        QDomElement radialGradientElement(ArtGradientRadial *radial);
+        void addRadialGradientElement(ArtGradientRadial *gradient, QDomElement element);
+
+        QWMatrix parseTransform(const QString &transform);
+
+private:
+        struct Private;
+        Private *d;
+};
+
+
+
+
+class KIconThemeNode
+{
+public:
+
+    KIconThemeNode(KIconTheme *_theme);
+    ~KIconThemeNode();
+
+    void queryIcons(QStringList *lst, int size, KIcon::Context context) const;
+    void queryIconsByContext(QStringList *lst, int size, KIcon::Context context) const;
+    KIcon findIcon(const QString& name, int size, KIcon::MatchType match) const;
+    void printTree(QString& dbgString) const;
+
+    KIconTheme *theme;
+};
+
+KIconThemeNode::KIconThemeNode(KIconTheme *_theme)
+{
+    theme = _theme;
+}
+
+KIconThemeNode::~KIconThemeNode()
+{
+    delete theme;
+}
+
+void KIconThemeNode::printTree(QString& dbgString) const
+{
+
+
+    dbgString += "(";
+    dbgString += theme->name();
+    dbgString += ")";
+}
+
+void KIconThemeNode::queryIcons(QStringList *result,
+                                int size, KIcon::Context context) const
+{
+
+    *result += theme->queryIcons(size, context);
+}
+
+void KIconThemeNode::queryIconsByContext(QStringList *result,
+                                int size, KIcon::Context context) const
+{
+
+    *result += theme->queryIconsByContext(size, context);
+}
+
+KIcon KIconThemeNode::findIcon(const QString& name, int size,
+                               KIcon::MatchType match) const
+{
+    return theme->iconPath(name, size, match);
+}
+
+
+
+
+struct KIconGroup
+{
+    int size;
+    bool dblPixels;
+    bool alphaBlending;
+};
+
+
+
+
+struct KIconLoaderPrivate
+{
+    QStringList mThemeList;
+    QStringList mThemesInTree;
+    KIconGroup *mpGroups;
+    KIconThemeNode *mpThemeRoot;
+    KStandardDirs *mpDirs;
+    KIconEffect mpEffect;
+    QDict<QImage> imgDict;
+    QImage lastImage;
+    QString lastImageKey;
+    int lastIconType;
+    int lastIconThreshold;
+    QPtrList<KIconThemeNode> links;
+    bool extraDesktopIconsLoaded :1;
+    bool delayedLoading :1;
+};
+
+
+
+KIconLoader::KIconLoader(const QString& _appname, KStandardDirs *_dirs)
+{
+    init( _appname, _dirs );
+}
+
+void KIconLoader::reconfigure( const QString& _appname, KStandardDirs *_dirs )
+{
+    delete d;
+    init( _appname, _dirs );
+}
+
+void KIconLoader::init( const QString& _appname, KStandardDirs *_dirs )
+{
+    d = new KIconLoaderPrivate;
+    d->imgDict.setAutoDelete( true );
+    d->links.setAutoDelete(true);
+    d->extraDesktopIconsLoaded=false;
+    d->delayedLoading=false;
+
+    if (_dirs)
+        d->mpDirs = _dirs;
+    else
+        d->mpDirs = KGlobal::dirs();
+
+
+
+    d->mpThemeRoot = 0L;
+
+
+    d->mThemeList = KIconTheme::list();
+    if (!d->mThemeList.contains(KIconTheme::defaultThemeName()))
+    {
+        kdError(264) << "Error: standard icon theme"
+                     << " \"" << KIconTheme::defaultThemeName() << "\" "
+                     << " not found!" << endl;
+        d->mpGroups=0L;
+
+        return;
+    }
+
+    QString appname = _appname;
+    if (appname.isEmpty())
+        appname = KGlobal::instance()->instanceName();
+
+
+    KIconTheme *def = new KIconTheme(KIconTheme::current(), appname);
+    if (!def->isValid())
+    {
+        delete def;
+        def = new KIconTheme(KIconTheme::defaultThemeName(), appname);
+    }
+    d->mpThemeRoot = new KIconThemeNode(def);
+    d->links.append(d->mpThemeRoot);
+    d->mThemesInTree += KIconTheme::current();
+    addBaseThemes(d->mpThemeRoot, appname);
+
+
+    static const char * const groups[] = { "Desktop", "Toolbar", "MainToolbar", "Small", "Panel", 0L };
+    KConfig *config = KGlobal::config();
+    KConfigGroupSaver cs(config, "dummy");
+
+
+    d->mpGroups = new KIconGroup[(int) KIcon::LastGroup];
+    for (KIcon::Group i=KIcon::FirstGroup; i<KIcon::LastGroup; i++)
+    {
+        if (groups[i] == 0L)
+            break;
+        config->setGroup(QString::fromLatin1(groups[i]) + "Icons");
+        d->mpGroups[i].size = config->readNumEntry("Size", 0);
+        d->mpGroups[i].dblPixels = config->readBoolEntry("DoublePixels", false);
+        if (QPixmap::defaultDepth()>8)
+            d->mpGroups[i].alphaBlending = config->readBoolEntry("AlphaBlending", true);
+        else
+            d->mpGroups[i].alphaBlending = false;
+
+        if (!d->mpGroups[i].size)
+            d->mpGroups[i].size = d->mpThemeRoot->theme->defaultSize(i);
+    }
+
+
+    d->mpDirs->addResourceType("appicon", KStandardDirs::kde_default("data") +
+                appname + "/pics/");
+    d->mpDirs->addResourceType("appicon", KStandardDirs::kde_default("data") +
+                appname + "/toolbar/");
+
+
+    QStringList dirs;
+    dirs += d->mpDirs->resourceDirs("icon");
+    dirs += d->mpDirs->resourceDirs("pixmap");
+    for (QStringList::ConstIterator it = dirs.begin(); it != dirs.end(); it++)
+        d->mpDirs->addResourceDir("appicon", *it);
+
+
+    QString dbgString = "Theme tree: ";
+    d->mpThemeRoot->printTree(dbgString);
+    kdDebug(264) << dbgString << endl;
+
+}
+
+KIconLoader::~KIconLoader()
+{
+
+
+    d->mpThemeRoot=0;
+    delete[] d->mpGroups;
+    delete d;
+}
+
+void KIconLoader::enableDelayedIconSetLoading( bool enable )
+{
+    d->delayedLoading = enable;
+}
+
+bool KIconLoader::isDelayedIconSetLoadingEnabled() const
+{
+    return d->delayedLoading;
+}
+
+void KIconLoader::addAppDir(const QString& appname)
+{
+    d->mpDirs->addResourceType("appicon", KStandardDirs::kde_default("data") +
+                appname + "/pics/");
+    d->mpDirs->addResourceType("appicon", KStandardDirs::kde_default("data") +
+                appname + "/toolbar/");
+    addAppThemes(appname);
+}
+
+void KIconLoader::addAppThemes(const QString& appname)
+{
+    if ( KIconTheme::current() != KIconTheme::defaultThemeName() )
+    {
+        KIconTheme *def = new KIconTheme(KIconTheme::current(), appname);
+        if (def->isValid())
+        {
+            KIconThemeNode* node = new KIconThemeNode(def);
+            d->links.append(node);
+            addBaseThemes(node, appname);
+        }
+        else
+            delete def;
+    }
+
+    KIconTheme *def = new KIconTheme(KIconTheme::defaultThemeName(), appname);
+    KIconThemeNode* node = new KIconThemeNode(def);
+    d->links.append(node);
+    addBaseThemes(node, appname);
+}
+
+void KIconLoader::addBaseThemes(KIconThemeNode *node, const QString &appname)
+{
+    QStringList lst = node->theme->inherits();
+    QStringList::ConstIterator it;
+
+    for (it=lst.begin(); it!=lst.end(); it++)
+    {
+        if (!d->mThemeList.contains(*it) ||
+            ( d->mThemesInTree.contains(*it) && (*it) != "hicolor"))
+            continue;
+        KIconTheme *theme = new KIconTheme(*it,appname);
+        if (!theme->isValid()) {
+            delete theme;
+            continue;
+        }
+        KIconThemeNode *n = new KIconThemeNode(theme);
+        d->mThemesInTree.append(*it);
+        addBaseThemes(n, appname);
+        d->links.append(n);
+    }
+}
+
+void KIconLoader::addExtraDesktopThemes()
+{
+    if ( d->extraDesktopIconsLoaded ) return;
+
+    QStringList list;
+    QStringList icnlibs = KGlobal::dirs()->resourceDirs("icon");
+    QStringList::ConstIterator it;
+    char buf[1000];
+    int r;
+    for (it=icnlibs.begin(); it!=icnlibs.end(); it++)
+    {
+        QDir dir(*it);
+        if (!dir.exists())
+            continue;
+        QStringList lst = dir.entryList("default.*", QDir::Dirs);
+        QStringList::ConstIterator it2;
+        for (it2=lst.begin(); it2!=lst.end(); it2++)
+        {
+            if (!KStandardDirs::exists(*it + *it2 + "/index.desktop")
+                && !KStandardDirs::exists(*it + *it2 + "/index.theme"))
+                continue;
+            r=readlink( QFile::encodeName(*it + *it2) , buf, sizeof(buf)-1);
+            if ( r>0 )
+            {
+              buf[r]=0;
+              QDir dir2( buf );
+              QString themeName=dir2.dirName();
+
+              if (!list.contains(themeName))
+                list.append(themeName);
+            }
+        }
+    }
+
+    for (it=list.begin(); it!=list.end(); it++)
+    {
+        if ( d->mThemesInTree.contains(*it) )
+                continue;
+        if ( *it == QString("default.kde") ) continue;
+
+        KIconTheme *def = new KIconTheme( *it, "" );
+        KIconThemeNode* node = new KIconThemeNode(def);
+        d->mThemesInTree.append(*it);
+        d->links.append(node);
+        addBaseThemes(node, "" );
+    }
+
+    d->extraDesktopIconsLoaded=true;
+
+}
+
+bool KIconLoader::extraDesktopThemesAdded() const
+{
+    return d->extraDesktopIconsLoaded;
+}
+
+QString KIconLoader::removeIconExtension(const QString &name) const
+{
+    int extensionLength=0;
+
+    QString ext = name.right(4);
+
+    static const QString &png_ext = KGlobal::staticQString(".png");
+    static const QString &xpm_ext = KGlobal::staticQString(".xpm");
+    if (ext == png_ext || ext == xpm_ext)
+      extensionLength=4;
+
+    else
+    {
+        static const QString &svgz_ext = KGlobal::staticQString(".svgz");
+        static const QString &svg_ext = KGlobal::staticQString(".svg");
+
+        if (name.right(5) == svgz_ext)
+            extensionLength=5;
+        else if (ext == svg_ext)
+            extensionLength=4;
+    }
+
+
+    if ( extensionLength > 0 )
+    {
+
+        kdDebug(264) << "Application " << KGlobal::instance()->instanceName()
+                     << " loads icon " << name << " with extension.\n";
+
+
+        return name.left(name.length() - extensionLength);
+    }
+    return name;
+}
+
+
+KIcon KIconLoader::findMatchingIcon(const QString& name, int size) const
+{
+    KIcon icon;
+
+    const QString *ext[4];
+    int count=0;
+    static const QString &png_ext = KGlobal::staticQString(".png");
+    ext[count++]=&png_ext;
+
+    static const QString &svgz_ext = KGlobal::staticQString(".svgz");
+    ext[count++]=&svgz_ext;
+    static const QString &svg_ext = KGlobal::staticQString(".svg");
+    ext[count++]=&svg_ext;
+
+    static const QString &xpm_ext = KGlobal::staticQString(".xpm");
+    ext[count++]=&xpm_ext;
+    for ( KIconThemeNode *themeNode = d->links.first() ; themeNode ;
+        themeNode = d->links.next() )
+    {
+        for (int i = 0 ; i < count ; i++)
+        {
+            icon = themeNode->theme->iconPath(name + *ext[i], size, KIcon::MatchExact);
+            if (icon.isValid())
+                return icon;
+        }
+
+    }
+
+    for ( KIconThemeNode *themeNode = d->links.first() ; themeNode ;
+        themeNode = d->links.next() )
+    {
+        for (int i = 0 ; i < count ; i++)
+        {
+            icon = themeNode->theme->iconPath(name + *ext[i], size, KIcon::MatchBest);
+            if (icon.isValid())
+                return icon;
+        }
+
+    }
+
+    return icon;
+}
+
+inline QString KIconLoader::unknownIconPath( int size ) const
+{
+    static const QString &str_unknown = KGlobal::staticQString("unknown");
+
+    KIcon icon = findMatchingIcon(str_unknown, size);
+    if (!icon.isValid())
+    {
+        kdDebug(264) << "Warning: could not find \"Unknown\" icon for size = "
+                     << size << "\n";
+        return QString::null;
+    }
+    return icon.path;
+}
+
+
+
+QString KIconLoader::iconPath(const QString& _name, int group_or_size,
+                              bool canReturnNull) const
+{
+    if (d->mpThemeRoot == 0L)
+        return QString::null;
+
+    if (_name.at(0) == '/')
+        return _name;
+
+    QString name = removeIconExtension( _name );
+
+    QString path;
+    if (group_or_size == KIcon::User)
+    {
+        static const QString &png_ext = KGlobal::staticQString(".png");
+        static const QString &xpm_ext = KGlobal::staticQString(".xpm");
+        path = d->mpDirs->findResource("appicon", name + png_ext);
+
+
+        static const QString &svgz_ext = KGlobal::staticQString(".svgz");
+        static const QString &svg_ext = KGlobal::staticQString(".svg");
+        if (path.isEmpty())
+            path = d->mpDirs->findResource("appicon", name + svgz_ext);
+        if (path.isEmpty())
+           path = d->mpDirs->findResource("appicon", name + svg_ext);
+
+        if (path.isEmpty())
+             path = d->mpDirs->findResource("appicon", name + xpm_ext);
+        return path;
+    }
+
+    if (group_or_size >= KIcon::LastGroup)
+    {
+        kdDebug(264) << "Illegal icon group: " << group_or_size << "\n";
+        return path;
+    }
+
+    int size;
+    if (group_or_size >= 0)
+        size = d->mpGroups[group_or_size].size;
+    else
+        size = -group_or_size;
+
+    if (_name.isEmpty()) {
+        if (canReturnNull)
+            return QString::null;
+        else
+            return unknownIconPath(size);
+    }
+
+    KIcon icon = findMatchingIcon(name, size);
+
+    if (!icon.isValid())
+    {
+
+        path = iconPath(name, KIcon::User, true);
+        if (!path.isEmpty() || canReturnNull)
+            return path;
+
+        if (canReturnNull)
+            return QString::null;
+        else
+            return unknownIconPath(size);
+    }
+    return icon.path;
+}
+
+QPixmap KIconLoader::loadIcon(const QString& _name, KIcon::Group group, int size,
+                              int state, QString *path_store, bool canReturnNull) const
+{
+    QString name = _name;
+    QPixmap pix;
+    QString key;
+    bool absolutePath=false, favIconOverlay=false;
+
+    if (d->mpThemeRoot == 0L)
+        return pix;
+
+
+    if (name.startsWith("favicons/"))
+    {
+       favIconOverlay = true;
+       name = locateLocal("cache", name+".png");
+    }
+    if (name.at(0) == '/') absolutePath=true;
+
+    static const QString &str_unknown = KGlobal::staticQString("unknown");
+
+
+    if (group == KIcon::User)
+    {
+        key = "$kicou_";
+        key += QString::number(size); key += '_';
+        key += name;
+        bool inCache = QPixmapCache::find(key, pix);
+        if (inCache && (path_store == 0L))
+            return pix;
+
+        QString path = (absolutePath) ? name :
+                        iconPath(name, KIcon::User, canReturnNull);
+        if (path.isEmpty())
+        {
+            if (canReturnNull)
+                return pix;
+
+            path = iconPath(str_unknown, KIcon::Small, true);
+            if (path.isEmpty())
+            {
+                kdDebug(264) << "Warning: Cannot find \"unknown\" icon.\n";
+                return pix;
+            }
+        }
+
+        if (path_store != 0L)
+            *path_store = path;
+        if (inCache)
+            return pix;
+        QImage img(path);
+        if (size != 0)
+            img=img.smoothScale(size,size);
+
+        pix.convertFromImage(img);
+        QPixmapCache::insert(key, pix);
+        return pix;
+    }
+
+
+
+    if ((group < -1) || (group >= KIcon::LastGroup))
+    {
+        kdDebug(264) << "Illegal icon group: " << group << "\n";
+        group = KIcon::Desktop;
+    }
+
+    int overlay = (state & KIcon::OverlayMask);
+    state &= ~KIcon::OverlayMask;
+    if ((state < 0) || (state >= KIcon::LastState))
+    {
+        kdDebug(264) << "Illegal icon state: " << state << "\n";
+        state = KIcon::DefaultState;
+    }
+
+    if ((size == 0) && (group < 0))
+    {
+        kdDebug(264) << "Neither size nor group specified!\n";
+        group = KIcon::Desktop;
+    }
+
+    if (!absolutePath)
+    {
+        if (!canReturnNull && name.isEmpty())
+            name = str_unknown;
+        else
+            name = removeIconExtension(name);
+    }
+
+
+    if (size == 0)
+    {
+        size = d->mpGroups[group].size;
+    }
+    favIconOverlay = favIconOverlay && (size > 22);
+
+
+
+    key = "$kico_";
+    key += name; key += '_';
+    key += QString::number(size); key += '_';
+
+    QString overlayStr = QString::number( overlay );
+
+    QString noEffectKey = key + '_' + overlayStr;
+
+    if (group >= 0)
+    {
+        key += d->mpEffect.fingerprint(group, state);
+        if (d->mpGroups[group].dblPixels)
+            key += QString::fromLatin1(":dblsize");
+    } else
+        key += QString::fromLatin1("noeffect");
+    key += '_';
+    key += overlayStr;
+
+
+    bool inCache = QPixmapCache::find(key, pix);
+    if (inCache && (path_store == 0L))
+        return pix;
+
+    QImage *img = 0;
+    int iconType;
+    int iconThreshold;
+
+    if ( ( path_store != 0L ) ||
+         noEffectKey != d->lastImageKey )
+    {
+
+        KIcon icon;
+        if (absolutePath && !favIconOverlay)
+        {
+            icon.context=KIcon::Any;
+            icon.type=KIcon::Scalable;
+            icon.path=name;
+        }
+        else
+        {
+            if (!name.isEmpty())
+                icon = findMatchingIcon(favIconOverlay ? QString("www") : name, size);
+
+            if (!icon.isValid())
+            {
+
+                if (!name.isEmpty())
+                    pix = loadIcon(name, KIcon::User, size, state, path_store, true);
+                if (!pix.isNull() || canReturnNull)
+                    return pix;
+
+                icon = findMatchingIcon(str_unknown, size);
+                if (!icon.isValid())
+                {
+                    kdDebug(264)
+                        << "Warning: could not find \"Unknown\" icon for size = "
+                        << size << "\n";
+                    return pix;
+                }
+            }
+        }
+
+        if (path_store != 0L)
+            *path_store = icon.path;
+        if (inCache)
+            return pix;
+
+
+        QString ext = icon.path.right(3).upper();
+        if(ext != "SVG" && ext != "VGZ")
+        {
+            img = new QImage(icon.path, ext.latin1());
+            if (img->isNull()) {
+                delete img;
+                return pix;
+            }
+        }
+
+        else
+        {
+
+            KSVGIconEngine *svgEngine = new KSVGIconEngine();
+
+            if(svgEngine->load(size, size, icon.path))
+                img = svgEngine->painter()->image();
+            else
+                img = new QImage();
+
+            delete svgEngine;
+        }
+
+
+        iconType = icon.type;
+        iconThreshold = icon.threshold;
+
+        d->lastImage = img->copy();
+        d->lastImageKey = noEffectKey;
+        d->lastIconType = iconType;
+        d->lastIconThreshold = iconThreshold;
+    }
+    else
+    {
+        img = new QImage( d->lastImage.copy() );
+        iconType = d->lastIconType;
+        iconThreshold = d->lastIconThreshold;
+    }
+
+
+    if (overlay)
+    {
+        QImage *ovl;
+        KIconTheme *theme = d->mpThemeRoot->theme;
+        if ((overlay & KIcon::LockOverlay) &&
+                ((ovl = loadOverlay(theme->lockOverlay(), size)) != 0L))
+            KIconEffect::overlay(*img, *ovl);
+        if ((overlay & KIcon::LinkOverlay) &&
+                ((ovl = loadOverlay(theme->linkOverlay(), size)) != 0L))
+            KIconEffect::overlay(*img, *ovl);
+        if ((overlay & KIcon::ZipOverlay) &&
+                ((ovl = loadOverlay(theme->zipOverlay(), size)) != 0L))
+            KIconEffect::overlay(*img, *ovl);
+        if ((overlay & KIcon::ShareOverlay) &&
+            ((ovl = loadOverlay(theme->shareOverlay(), size)) != 0L))
+          KIconEffect::overlay(*img, *ovl);
+        if (overlay & KIcon::HiddenOverlay)
+            for (int y = 0; y < img->height(); y++)
+            {
+                Q_UINT32 *line = reinterpret_cast<Q_UINT32 *>(img->scanLine(y));
+                for (int x = 0; x < img->width(); x++)
+                    line[x] = (line[x] & 0x00ffffff) | (((0x80) < (qAlpha(line[x])) ? (0x80) : (qAlpha(line[x]))) << 24);
+            }
+    }
+
+
+    if ((iconType == KIcon::Scalable) && (size != img->width()))
+    {
+        *img = img->smoothScale(size, size);
+    }
+    if ((iconType == KIcon::Threshold) && (size != img->width()))
+    {
+        if ( abs(size-img->width())>iconThreshold )
+            *img = img->smoothScale(size, size);
+    }
+    if ((group >= 0) && d->mpGroups[group].dblPixels)
+    {
+        *img = d->mpEffect.doublePixels(*img);
+    }
+    if (group >= 0)
+    {
+        *img = d->mpEffect.apply(*img, group, state);
+    }
+
+    pix.convertFromImage(*img);
+
+    delete img;
+
+    if (favIconOverlay)
+    {
+        QPixmap favIcon(name, "PNG");
+        int x = pix.width() - favIcon.width() - 1,
+            y = pix.height() - favIcon.height() - 1;
+        if (pix.mask())
+        {
+            QBitmap mask = *pix.mask();
+            QBitmap fmask;
+            if (favIcon.mask())
+                fmask = *favIcon.mask();
+            else {
+
+                fmask = favIcon.createHeuristicMask();
+            }
+
+            bitBlt(&mask, x, y, &fmask,
+                   0, 0, favIcon.width(), favIcon.height(),
+                   favIcon.mask() ? Qt::OrROP : Qt::SetROP);
+            pix.setMask(mask);
+        }
+        bitBlt(&pix, x, y, &favIcon);
+    }
+
+    QPixmapCache::insert(key, pix);
+    return pix;
+}
+
+QImage *KIconLoader::loadOverlay(const QString &name, int size) const
+{
+    QString key = name + '_' + QString::number(size);
+    QImage *image = d->imgDict.find(key);
+    if (image != 0L)
+        return image;
+
+    KIcon icon = findMatchingIcon(name, size);
+    if (!icon.isValid())
+    {
+        kdDebug(264) << "Overlay " << name << "not found.\n";
+        return 0L;
+    }
+    image = new QImage(icon.path);
+    d->imgDict.insert(key, image);
+    return image;
+}
+
+
+
+QMovie KIconLoader::loadMovie(const QString& name, KIcon::Group group, int size) const
+{
+    QString file = moviePath( name, group, size );
+    if (file.isEmpty())
+        return QMovie();
+    int dirLen = file.findRev('/');
+    QString icon = iconPath(name, size ? -size : group, true);
+    if (!icon.isEmpty() && file.left(dirLen) != icon.left(dirLen))
+        return QMovie();
+    return QMovie(file);
+}
+
+QString KIconLoader::moviePath(const QString& name, KIcon::Group group, int size) const
+{
+    if (!d->mpGroups) return QString::null;
+
+    if ( ((group < -1) || (group >= KIcon::LastGroup)) && (group != KIcon::User) )
+    {
+        kdDebug(264) << "Illegal icon group: " << group << "\n";
+        group = KIcon::Desktop;
+    }
+    if ((size == 0) && (group < 0))
+    {
+        kdDebug(264) << "Neither size nor group specified!\n";
+        group = KIcon::Desktop;
+    }
+
+    QString file = name + ".mng";
+    if (group == KIcon::User)
+    {
+        file = d->mpDirs->findResource("appicon", file);
+    }
+    else
+    {
+        if (size == 0)
+            size = d->mpGroups[group].size;
+
+        KIcon icon;
+        icon = d->mpThemeRoot->findIcon(file, size, KIcon::MatchExact);
+        if (!icon.isValid())
+        {
+           icon = d->mpThemeRoot->findIcon(file, size, KIcon::MatchBest);
+        }
+        file = icon.isValid() ? icon.path : QString::null;
+
+    }
+    return file;
+}
+
+
+QStringList KIconLoader::loadAnimated(const QString& name, KIcon::Group group, int size) const
+{
+    QStringList lst;
+
+    if (!d->mpGroups) return lst;
+
+    if ((group < -1) || (group >= KIcon::LastGroup))
+    {
+        kdDebug(264) << "Illegal icon group: " << group << "\n";
+        group = KIcon::Desktop;
+    }
+    if ((size == 0) && (group < 0))
+    {
+        kdDebug(264) << "Neither size nor group specified!\n";
+        group = KIcon::Desktop;
+    }
+
+    QString file = name + "/0001";
+    if (group == KIcon::User)
+    {
+        file = d->mpDirs->findResource("appicon", file + ".png");
+    } else
+    {
+        if (size == 0)
+            size = d->mpGroups[group].size;
+        KIcon icon = findMatchingIcon(file, size);
+        file = icon.isValid() ? icon.path : QString::null;
+
+    }
+    if (file.isEmpty())
+        return lst;
+
+    QString path = file.left(file.length()-8);
+    DIR* dp = opendir( QFile::encodeName(path) );
+    if(!dp)
+        return lst;
+
+    struct dirent* ep;
+    while( ( ep = readdir( dp ) ) != 0L )
+    {
+        QString fn(QFile::decodeName(ep->d_name));
+        if(!(fn.left(4)).toUInt())
+            continue;
+
+        lst += path + fn;
+    }
+    closedir ( dp );
+    lst.sort();
+    return lst;
+}
+
+KIconTheme *KIconLoader::theme() const
+{
+    if (d->mpThemeRoot) return d->mpThemeRoot->theme;
+    return 0L;
+}
+
+int KIconLoader::currentSize(KIcon::Group group) const
+{
+    if (!d->mpGroups) return -1;
+
+    if ((group < 0) || (group >= KIcon::LastGroup))
+    {
+        kdDebug(264) << "Illegal icon group: " << group << "\n";
+        return -1;
+    }
+    return d->mpGroups[group].size;
+}
+
+QStringList KIconLoader::queryIconsByDir( const QString& iconsDir ) const
+{
+  QDir dir(iconsDir);
+  QStringList lst = dir.entryList("*.png;*.xpm", QDir::Files);
+  QStringList result;
+  QStringList::ConstIterator it;
+  for (it=lst.begin(); it!=lst.end(); it++)
+    result += iconsDir + "/" + *it;
+  return result;
+}
+
+QStringList KIconLoader::queryIconsByContext(int group_or_size,
+                                            KIcon::Context context) const
+{
+    QStringList result;
+    if (group_or_size >= KIcon::LastGroup)
+    {
+        kdDebug(264) << "Illegal icon group: " << group_or_size << "\n";
+        return result;
+    }
+    int size;
+    if (group_or_size >= 0)
+        size = d->mpGroups[group_or_size].size;
+    else
+        size = -group_or_size;
+
+    for ( KIconThemeNode *themeNode = d->links.first() ; themeNode ;
+            themeNode = d->links.next() )
+       themeNode->queryIconsByContext(&result, size, context);
+
+
+    QString name;
+    QStringList res2, entries;
+    QStringList::ConstIterator it;
+    for (it=result.begin(); it!=result.end(); it++)
+    {
+        int n = (*it).findRev('/');
+        if (n == -1)
+            name = *it;
+        else
+            name = (*it).mid(n+1);
+        if (!entries.contains(name))
+        {
+            entries += name;
+            res2 += *it;
+        }
+    }
+    return res2;
+
+}
+
+QStringList KIconLoader::queryIcons(int group_or_size, KIcon::Context context) const
+{
+    QStringList result;
+    if (group_or_size >= KIcon::LastGroup)
+    {
+        kdDebug(264) << "Illegal icon group: " << group_or_size << "\n";
+        return result;
+    }
+    int size;
+    if (group_or_size >= 0)
+        size = d->mpGroups[group_or_size].size;
+    else
+        size = -group_or_size;
+
+    for ( KIconThemeNode *themeNode = d->links.first() ; themeNode ;
+            themeNode = d->links.next() )
+       themeNode->queryIcons(&result, size, context);
+
+
+    QString name;
+    QStringList res2, entries;
+    QStringList::ConstIterator it;
+    for (it=result.begin(); it!=result.end(); it++)
+    {
+        int n = (*it).findRev('/');
+        if (n == -1)
+            name = *it;
+        else
+            name = (*it).mid(n+1);
+        if (!entries.contains(name))
+        {
+            entries += name;
+            res2 += *it;
+        }
+    }
+    return res2;
+}
+
+KIconEffect * KIconLoader::iconEffect() const
+{
+    return &d->mpEffect;
+}
+
+bool KIconLoader::alphaBlending(KIcon::Group group) const
+{
+    if (!d->mpGroups) return -1;
+
+    if ((group < 0) || (group >= KIcon::LastGroup))
+    {
+        kdDebug(264) << "Illegal icon group: " << group << "\n";
+        return -1;
+    }
+    return d->mpGroups[group].alphaBlending;
+}
+
+QIconSet KIconLoader::loadIconSet(const QString& name, KIcon::Group group, int size)
+{
+    return loadIconSet( name, group, size, false );
+}
+
+
+
+class KIconFactory
+    : public QIconFactory
+    {
+    public:
+        KIconFactory( const QString& iconName_P, KIcon::Group group_P,
+            int size_P, KIconLoader* loader_P );
+        virtual QPixmap* createPixmap( const QIconSet&, QIconSet::Size, QIconSet::Mode, QIconSet::State );
+    private:
+        QString iconName;
+        KIcon::Group group;
+        int size;
+        KIconLoader* loader;
+    };
+
+
+QIconSet KIconLoader::loadIconSet( const QString& name, KIcon::Group group, int size,
+    bool canReturnNull)
+{
+    if ( !d->delayedLoading )
+        return loadIconSetNonDelayed( name, group, size, canReturnNull );
+
+    if(canReturnNull)
+    {
+        QPixmap pm = loadIcon( name, group, size, KIcon::DefaultState, __null, true );
+        if( pm.isNull())
+            return QIconSet();
+
+        QIconSet ret( pm );
+        ret.installIconFactory( new KIconFactory( name, group, size, this ));
+        return ret;
+    }
+
+    QIconSet ret;
+    ret.installIconFactory( new KIconFactory( name, group, size, this ));
+    return ret;
+}
+
+QIconSet KIconLoader::loadIconSetNonDelayed( const QString& name,
+                                             KIcon::Group group,
+                                             int size, bool canReturnNull )
+{
+    QIconSet iconset;
+    QPixmap tmp = loadIcon(name, group, size, KIcon::ActiveState, __null, canReturnNull);
+    iconset.setPixmap( tmp, QIconSet::Small, QIconSet::Active );
+
+    iconset.setPixmap( tmp, QIconSet::Large, QIconSet::Active );
+    tmp = loadIcon(name, group, size, KIcon::DisabledState, __null, canReturnNull);
+    iconset.setPixmap( tmp, QIconSet::Small, QIconSet::Disabled );
+    iconset.setPixmap( tmp, QIconSet::Large, QIconSet::Disabled );
+    tmp = loadIcon(name, group, size, KIcon::DefaultState, __null, canReturnNull);
+    iconset.setPixmap( tmp, QIconSet::Small, QIconSet::Normal );
+    iconset.setPixmap( tmp, QIconSet::Large, QIconSet::Normal );
+    return iconset;
+}
+
+KIconFactory::KIconFactory( const QString& iconName_P, KIcon::Group group_P,
+    int size_P, KIconLoader* loader_P )
+    : iconName( iconName_P ), group( group_P ), size( size_P ), loader( loader_P )
+{
+    setAutoDelete( true );
+}
+
+QPixmap* KIconFactory::createPixmap( const QIconSet&, QIconSet::Size, QIconSet::Mode mode_P, QIconSet::State )
+    {
+
+    static const KIcon::States tbl[] = { KIcon::DefaultState, KIcon::DisabledState, KIcon::ActiveState };
+    int state = KIcon::DefaultState;
+    if( mode_P <= QIconSet::Active )
+        state = tbl[ mode_P ];
+    if( group >= 0 && state == KIcon::ActiveState )
+    {
+        if( loader->iconEffect()->fingerprint(group, KIcon::ActiveState )
+            == loader->iconEffect()->fingerprint(group, KIcon::DefaultState ))
+            return __null;
+    }
+
+
+    QPixmap pm = loader->loadIcon( iconName, group, size, state );
+    return new QPixmap( pm );
+    }
+
+
+
+QPixmap DesktopIcon(const QString& name, int force_size, int state,
+        KInstance *instance)
+{
+    KIconLoader *loader = instance->iconLoader();
+    return loader->loadIcon(name, KIcon::Desktop, force_size, state);
+}
+
+QPixmap DesktopIcon(const QString& name, KInstance *instance)
+{
+    return DesktopIcon(name, 0, KIcon::DefaultState, instance);
+}
+
+QIconSet DesktopIconSet(const QString& name, int force_size, KInstance *instance)
+{
+    KIconLoader *loader = instance->iconLoader();
+    return loader->loadIconSet( name, KIcon::Desktop, force_size );
+}
+
+QPixmap BarIcon(const QString& name, int force_size, int state,
+        KInstance *instance)
+{
+    KIconLoader *loader = instance->iconLoader();
+    return loader->loadIcon(name, KIcon::Toolbar, force_size, state);
+}
+
+QPixmap BarIcon(const QString& name, KInstance *instance)
+{
+    return BarIcon(name, 0, KIcon::DefaultState, instance);
+}
+
+QIconSet BarIconSet(const QString& name, int force_size, KInstance *instance)
+{
+    KIconLoader *loader = instance->iconLoader();
+    return loader->loadIconSet( name, KIcon::Toolbar, force_size );
+}
+
+QPixmap SmallIcon(const QString& name, int force_size, int state,
+        KInstance *instance)
+{
+    KIconLoader *loader = instance->iconLoader();
+    return loader->loadIcon(name, KIcon::Small, force_size, state);
+}
+
+QPixmap SmallIcon(const QString& name, KInstance *instance)
+{
+    return SmallIcon(name, 0, KIcon::DefaultState, instance);
+}
+
+QIconSet SmallIconSet(const QString& name, int force_size, KInstance *instance)
+{
+    KIconLoader *loader = instance->iconLoader();
+    return loader->loadIconSet( name, KIcon::Small, force_size );
+}
+
+QPixmap MainBarIcon(const QString& name, int force_size, int state,
+        KInstance *instance)
+{
+    KIconLoader *loader = instance->iconLoader();
+    return loader->loadIcon(name, KIcon::MainToolbar, force_size, state);
+}
+
+QPixmap MainBarIcon(const QString& name, KInstance *instance)
+{
+    return MainBarIcon(name, 0, KIcon::DefaultState, instance);
+}
+
+QIconSet MainBarIconSet(const QString& name, int force_size, KInstance *instance)
+{
+    KIconLoader *loader = instance->iconLoader();
+    return loader->loadIconSet( name, KIcon::MainToolbar, force_size );
+}
+
+QPixmap UserIcon(const QString& name, int state, KInstance *instance)
+{
+    KIconLoader *loader = instance->iconLoader();
+    return loader->loadIcon(name, KIcon::User, 0, state);
+}
+
+QPixmap UserIcon(const QString& name, KInstance *instance)
+{
+    return UserIcon(name, KIcon::DefaultState, instance);
+}
+
+QIconSet UserIconSet(const QString& name, KInstance *instance)
+{
+    KIconLoader *loader = instance->iconLoader();
+    return loader->loadIconSet( name, KIcon::User );
+}
+
+int IconSize(KIcon::Group group, KInstance *instance)
+{
+    KIconLoader *loader = instance->iconLoader();
+    return loader->currentSize(group);
+}
+
+QPixmap KIconLoader::unknown()
+{
+    QPixmap pix;
+    if ( QPixmapCache::find("unknown", pix) )
+            return pix;
+
+    QString path = KGlobal::iconLoader()->iconPath("unknown", KIcon::Small, true);
+    if (path.isEmpty())
+    {
+        kdDebug(264) << "Warning: Cannot find \"unknown\" icon.\n";
+        pix.resize(32,32);
+    } else
+    {
+        pix.load(path);
+        QPixmapCache::insert("unknown", pix);
+    }
+
+    return pix;
+}
+
+
+
+
+
+
+
+struct QCursorData;
+
+
+class QCursor : public Qt
+{
+public:
+    QCursor();
+    QCursor( int shape );
+    QCursor( const QBitmap &bitmap, const QBitmap &mask,
+             int hotX=-1, int hotY=-1 );
+    QCursor( const QPixmap &pixmap,
+             int hotX=-1, int hotY=-1 );
+    QCursor( const QCursor & );
+   ~QCursor();
+    QCursor &operator=( const QCursor & );
+
+    int shape() const;
+    void setShape( int );
+
+    const QBitmap *bitmap() const;
+    const QBitmap *mask() const;
+    QPoint hotSpot() const;
+
+
+
+
+
+    HANDLE handle() const;
+
+
+
+
+
+
+    static QPoint pos();
+    static void setPos( int x, int y );
+    static void setPos( const QPoint & );
+
+    static void initialize();
+    static void cleanup();
+
+
+    static int x11Screen();
+
+private:
+    void setBitmap( const QBitmap &bitmap, const QBitmap &mask,
+                                 int hotX, int hotY );
+    void update() const;
+    QCursorData *data;
+    QCursor *find_cur(int);
+
+
+
+};
+ QDataStream &operator<<( QDataStream &, const QCursor & );
+ QDataStream &operator>>( QDataStream &, QCursor & );
+
+
+
+
+inline void QCursor::setPos( const QPoint &p )
+{
+    setPos( p.x(), p.y() );
+}
+
+class QToolButton;
+class QPopupMenu;
+class QStyleSheet;
+
+class QWhatsThis: public Qt
+{
+public:
+    QWhatsThis( QWidget *);
+    virtual ~QWhatsThis();
+
+    virtual QString text( const QPoint & );
+    virtual bool clicked( const QString& href );
+
+
+    static void setFont( const QFont &font );
+
+    static void add( QWidget *, const QString &);
+    static void remove( QWidget * );
+    static QString textFor( QWidget *, const QPoint & pos = QPoint(), bool includeParents = FALSE );
+
+    static QToolButton * whatsThisButton( QWidget * parent );
+
+    static void enterWhatsThisMode();
+    static bool inWhatsThisMode();
+    static void leaveWhatsThisMode( const QString& = QString::null, const QPoint& pos = QCursor::pos(), QWidget* w = 0 );
+
+    static void display( const QString& text, const QPoint& pos = QCursor::pos(), QWidget* w = 0 );
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C"
+
+int mkstemps(char *, int);
+extern "C"
+
+unsigned long strlcat(char*, const char*, unsigned long);
+
+
+
+
+
+
+extern "C"
+
+unsigned long strlcpy(char*, const char*, unsigned long);
+
+
+
+
+static bool atoms_created = FALSE;
+extern Atom qt_wm_protocols;
+extern Time qt_x_last_input_time;
+
+static Atom net_wm_context_help;
+static Atom kde_wm_change_state;
+static void kwin_net_create_atoms() {
+    if (!atoms_created){
+        const int max = 20;
+        Atom* atoms[max];
+        const char* names[max];
+        Atom atoms_return[max];
+        int n = 0;
+
+        atoms[n] = &net_wm_context_help;
+        names[n++] = "_NET_WM_CONTEXT_HELP";
+
+        atoms[n] = &kde_wm_change_state;
+        names[n++] = "_KDE_WM_CHANGE_STATE";
+
+
+        XInternAtoms( qt_xdisplay(), const_cast<char**>(names), n, FALSE, atoms_return );
+        for (int i = 0; i < n; i++ )
+            *atoms[i] = atoms_return[i];
+
+        atoms_created = 1;
+    }
+}
+
+
+
+
+
+static void sendClientMessageToRoot(Window w, Atom a, long x, long y = 0, long z = 0 ){
+
+  XEvent ev;
+  long mask;
+
+  memset(&ev, 0, sizeof(ev));
+  ev.xclient.type = 33;
+  ev.xclient.window = w;
+  ev.xclient.message_type = a;
+  ev.xclient.format = 32;
+  ev.xclient.data.l[0] = x;
+  ev.xclient.data.l[1] = y;
+  ev.xclient.data.l[2] = z;
+  mask = (1L<<20);
+  XSendEvent(qt_xdisplay(), qt_xrootwin(), 0, mask, &ev);
+
+}
+
+
+
+
+static void sendClientMessage(Window w, Atom a, long x){
+
+  XEvent ev;
+  long mask;
+
+  memset(&ev, 0, sizeof(ev));
+  ev.xclient.type = 33;
+  ev.xclient.window = w;
+  ev.xclient.message_type = a;
+  ev.xclient.format = 32;
+  ev.xclient.data.l[0] = x;
+  ev.xclient.data.l[1] = 0L;
+  mask = 0L;
+  if (w == qt_xrootwin())
+    mask = (1L<<20);
+  XSendEvent(qt_xdisplay(), w, 0, mask, &ev);
+
+}
+
+namespace
+{
+class ContextWidget : public QWidget
+{
+public:
+    ContextWidget();
+    virtual bool x11Event( XEvent * ev);
+};
+
+ContextWidget::ContextWidget()
+        : QWidget(0,0)
+    {
+
+        kwin_net_create_atoms();
+        KApplication::kApplication()->installX11EventFilter( this );
+        QWhatsThis::enterWhatsThisMode();
+        QCursor c = *QApplication::overrideCursor();
+        QWhatsThis::leaveWhatsThisMode();
+        XGrabPointer( qt_xdisplay(), qt_xrootwin(), TRUE,
+                      (uint)( (1L<<2) | (1L<<3) |
+                              (1L<<6) | (1L<<4) |
+                              (1L<<5) ),
+                      1, 1,
+                      None, c.handle(), 0L );
+        qApp->enter_loop();
+
+    }
+
+
+bool ContextWidget::x11Event( XEvent * ev)
+    {
+
+        if ( ev->type == 4 && ev->xbutton.button == 1 ) {
+            XUngrabPointer( qt_xdisplay(), ev->xbutton.time );
+            Window root;
+            Window child = qt_xrootwin();
+            int root_x, root_y, lx, ly;
+            uint state;
+            Window w;
+            do {
+                w = child;
+                XQueryPointer( qt_xdisplay(), w, &root, &child,
+                               &root_x, &root_y, &lx, &ly, &state );
+            } while ( child != None && child != w );
+
+            ::sendClientMessage(w, qt_wm_protocols, net_wm_context_help);
+            XEvent e = *ev;
+            e.xbutton.window = w;
+            e.xbutton.subwindow = w;
+            e.xbutton.x = lx;
+            e.xbutton.y = ly;
+            XSendEvent( qt_xdisplay(), w, TRUE, (1L<<2), &e );
+            qApp->exit_loop();
+            return TRUE;
+        }
+        return FALSE;
+
+    }
+}
+
+void KWin::invokeContextHelp()
+{
+    ContextWidget w;
+}
+
+void KWin::setSystemTrayWindowFor( WId trayWin, WId forWin )
+{
+
+    NETWinInfo info( qt_xdisplay(), trayWin, qt_xrootwin(), 0 );
+    if ( !forWin )
+        forWin = qt_xrootwin();
+    info.setKDESystemTrayWinFor( forWin );
+
+}
+
+void KWin::activateWindow( WId win, long time )
+{
+
+    NETRootInfo info( qt_xdisplay(), 0 );
+    if( time == 0 )
+        time = qt_x_last_input_time;
+    info.setActiveWindow( win, NET::FromApplication, time );
+
+}
+
+void KWin::setActiveWindow( WId win, long time )
+{
+
+    NETRootInfo info( qt_xdisplay(), 0 );
+        time = qt_x_last_input_time;
+    info.setActiveWindow( win, NET::FromTool, time );
+
+}
+
+void KWin::setActiveWindow( WId win )
+{
+    setActiveWindow( win, 0 );
+}
+
+void KWin::demandAttention( WId win, bool set )
+{
+
+    NETWinInfo info( qt_xdisplay(), win, qt_xrootwin(), 0 );
+    info.setState( set ? NET::DemandsAttention : 0, NET::DemandsAttention );
+
+}
+
+void KWin::setUserTime( WId win, long time )
+{
+
+    NETWinInfo info( qt_xdisplay(), win, qt_xrootwin(), 0 );
+    info.setUserTime( time );
+
+}
+
+KWin::WindowInfo KWin::windowInfo( WId win, unsigned long properties, unsigned long properties2 )
+{
+    return WindowInfo( win, properties, properties2 );
+}
+
+
+WId KWin::transientFor( WId win )
+{
+
+    KXErrorHandler handler;
+    Window transient_for = None;
+    if( XGetTransientForHint( qt_xdisplay(), win, &transient_for ))
+        return transient_for;
+
+    return None;
+
+
+
+}
+
+WId KWin::groupLeader( WId win )
+{
+
+    KXErrorHandler handler;
+    XWMHints *hints = XGetWMHints( qt_xdisplay(), win );
+    Window window_group = None;
+    if ( hints )
+    {
+        if( hints->flags & (1L << 6) )
+            window_group = hints->window_group;
+        XFree( reinterpret_cast< char* >( hints ));
+    }
+
+    return window_group;
+
+
+
+}
+
+
+KWin::Info KWin::info( WId win )
+{
+    Info w;
+
+    NETWinInfo inf( qt_xdisplay(), win, qt_xrootwin(),
+                    NET::WMState |
+                    NET::WMStrut |
+                    NET::WMWindowType |
+                    NET::WMName |
+                    NET::WMVisibleName |
+                    NET::WMDesktop |
+                    NET::WMPid |
+                    NET::WMKDEFrameStrut |
+                    NET::XAWMState
+                    );
+
+    w.win = win;
+    w.state = inf.state();
+    w.mappingState = inf.mappingState();
+    w.strut = inf.strut();
+    w.windowType = inf.windowType();
+    if ( inf.name() ) {
+        w.name = QString::fromUtf8( inf.name() );
+    } else {
+        char* c = 0;
+        if ( XFetchName( qt_xdisplay(), win, &c ) != 0 ) {
+            w.name = QString::fromLocal8Bit( c );
+            XFree( c );
+        }
+    }
+    if ( inf.visibleName() )
+        w.visibleName = QString::fromUtf8( inf.visibleName() );
+    else
+        w.visibleName = w.name;
+
+    w.desktop = inf.desktop();
+    w.onAllDesktops = inf.desktop() == NETWinInfo::OnAllDesktops;
+    w.pid = inf.pid();
+    NETRect frame, geom;
+    inf.kdeGeometry( frame, geom );
+    w.geometry.setRect( geom.pos.x, geom.pos.y, geom.size.width, geom.size.height );
+    w.frameGeometry.setRect( frame.pos.x, frame.pos.y, frame.size.width, frame.size.height );
+
+    return w;
+}
+
+QPixmap KWin::icon( WId win, int width, int height, bool scale )
+{
+    return icon( win, width, height, scale, NETWM | WMHints | ClassHint | XApp );
+}
+
+
+QPixmap KWin::icon( WId win, int width, int height, bool scale, int flags )
+{
+
+    KXErrorHandler handler;
+
+    QPixmap result;
+
+    if( flags & NETWM ) {
+        NETWinInfo info( qt_xdisplay(), win, qt_xrootwin(), NET::WMIcon );
+        NETIcon ni = info.icon( width, height );
+        if ( ni.data && ni.size.width > 0 && ni.size.height > 0 ) {
+            QImage img( (uchar*) ni.data, (int) ni.size.width, (int) ni.size.height, 32, 0, 0, QImage::IgnoreEndian );
+            img.setAlphaBuffer( TRUE );
+            if ( scale && width > 0 && height > 0 &&img.size() != QSize( width, height ) && !img.isNull() )
+                img = img.smoothScale( width, height );
+            if ( !img.isNull() )
+                result.convertFromImage( img );
+            return result;
+        }
+    }
+
+    if( flags & WMHints ) {
+        Pixmap p = None;
+        Pixmap p_mask = None;
+
+        XWMHints *hints = XGetWMHints(qt_xdisplay(), win );
+        if (hints && (hints->flags & (1L << 2))){
+            p = hints->icon_pixmap;
+        }
+        if (hints && (hints->flags & (1L << 5))){
+            p_mask = hints->icon_mask;
+        }
+        if (hints)
+            XFree((char*)hints);
+
+        if (p != None){
+            Window root;
+            int x, y;
+            unsigned int w = 0;
+            unsigned int h = 0;
+            unsigned int border_w, depth;
+            XGetGeometry(qt_xdisplay(), p, &root,
+                         &x, &y, &w, &h, &border_w, &depth);
+            if (w > 0 && h > 0){
+                QPixmap pm(w, h, depth);
+
+                pm.detach();
+                XCopyArea(qt_xdisplay(), p, pm.handle(),
+                          qt_xget_temp_gc(qt_xscreen(), depth==1),
+                          0, 0, w, h, 0, 0);
+                if (p_mask != None){
+                    QBitmap bm(w, h);
+                    XCopyArea(qt_xdisplay(), p_mask, bm.handle(),
+                              qt_xget_temp_gc(qt_xscreen(), true),
+                              0, 0, w, h, 0, 0);
+                    pm.setMask(bm);
+                }
+                if ( scale && width > 0 && height > 0 && !pm.isNull() &&
+                     ( (int) w != width || (int) h != height) ){
+                    result.convertFromImage( pm.convertToImage().smoothScale( width, height ) );
+                } else {
+                    result = pm;
+                }
+            }
+        }
+    }
+
+
+
+
+    int iconWidth;
+    if( width < 24 )
+        iconWidth = 16;
+    else if( width < 40 )
+        iconWidth = 32;
+    else
+        iconWidth = 48;
+
+    if( flags & ClassHint ) {
+
+
+        if( result.isNull() ) {
+
+            XClassHint hint;
+            if( XGetClassHint( qt_xdisplay(), win, &hint ) ) {
+                QString className = hint.res_class;
+
+                QPixmap pm = KGlobal::instance()->iconLoader()->loadIcon( className.lower(), KIcon::Small, iconWidth,
+                                                                          KIcon::DefaultState, 0, true );
+                if( scale && !pm.isNull() )
+                    result.convertFromImage( pm.convertToImage().smoothScale( width, height ) );
+                else
+                    result = pm;
+
+                XFree( hint.res_name );
+                XFree( hint.res_class );
+            }
+        }
+    }
+
+    if( flags & XApp ) {
+
+
+        if ( result.isNull() ) {
+            QPixmap pm = KGlobal::instance()->iconLoader()->loadIcon( "xapp", KIcon::Small, iconWidth,
+                                                                       KIcon::DefaultState, 0, true );
+            if( scale && !pm.isNull() )
+                result.convertFromImage( pm.convertToImage().smoothScale( width, height ) );
+            else
+                result = pm;
+        }
+    }
+
+    return result;
+}
+
+void KWin::setIcons( WId win, const QPixmap& icon, const QPixmap& miniIcon )
+{
+
+    if ( icon.isNull() )
+        return;
+    NETWinInfo info( qt_xdisplay(), win, qt_xrootwin(), 0 );
+    QImage img = icon.convertToImage().convertDepth( 32 );
+    NETIcon ni;
+    ni.size.width = img.size().width();
+    ni.size.height = img.size().height();
+    ni.data = (unsigned char *) img.bits();
+    info.setIcon( ni, true );
+    if ( miniIcon.isNull() )
+        return;
+    img = miniIcon.convertToImage().convertDepth( 32 );
+    ni.size.width = img.size().width();
+    ni.size.height = img.size().height();
+    ni.data = (unsigned char *) img.bits();
+    info.setIcon( ni, false );
+
+}
+
+void KWin::setType( WId win, NET::WindowType windowType )
+{
+
+    NETWinInfo info( qt_xdisplay(), win, qt_xrootwin(), 0 );
+    info.setWindowType( windowType );
+
+}
+
+void KWin::setState( WId win, unsigned long state )
+{
+
+    NETWinInfo info( qt_xdisplay(), win, qt_xrootwin(), NET::WMState );
+    info.setState( state, state );
+
+}
+
+void KWin::clearState( WId win, unsigned long state )
+{
+
+    NETWinInfo info( qt_xdisplay(), win, qt_xrootwin(), NET::WMState );
+    info.setState( 0, state );
+
+}
+
+void KWin::setOnAllDesktops( WId win, bool b )
+{
+
+    NETWinInfo info( qt_xdisplay(), win, qt_xrootwin(), NET::WMDesktop );
+    if ( b )
+        info.setDesktop( NETWinInfo::OnAllDesktops );
+    else if ( info.desktop() == NETWinInfo::OnAllDesktops ) {
+        NETRootInfo rinfo( qt_xdisplay(), NET::CurrentDesktop );
+        info.setDesktop( rinfo.currentDesktop() );
+    }
+
+}
+
+void KWin::setOnDesktop( WId win, int desktop )
+{
+
+    NETWinInfo info( qt_xdisplay(), win, qt_xrootwin(), NET::WMDesktop );
+    info.setDesktop( desktop );
+
+}
+
+void KWin::setStrut( WId win, int left, int right, int top, int bottom )
+{
+
+    NETWinInfo info( qt_xdisplay(), win, qt_xrootwin(), 0 );
+    NETStrut strut;
+    strut.left = left;
+    strut.right = right;
+    strut.top = top;
+    strut.bottom = bottom;
+    info.setStrut( strut );
+
+}
+
+int KWin::currentDesktop()
+{
+
+    if (!qt_xdisplay())
+
+      return 1;
+
+    NETRootInfo info( qt_xdisplay(), NET::CurrentDesktop );
+    return info.currentDesktop();
+
+}
+
+int KWin::numberOfDesktops()
+{
+
+    if (!qt_xdisplay())
+
+      return 0;
+
+    NETRootInfo info( qt_xdisplay(), NET::NumberOfDesktops );
+    return info.numberOfDesktops();
+
+}
+
+void KWin::setCurrentDesktop( int desktop )
+{
+
+    NETRootInfo info( qt_xdisplay(), NET::CurrentDesktop );
+    info.setCurrentDesktop( desktop );
+
+}
+
+
+void KWin::iconifyWindow( WId win, bool animation)
+{
+
+    if ( !animation )
+    {
+        kwin_net_create_atoms();
+        sendClientMessageToRoot( win, kde_wm_change_state, 3, 1 );
+    }
+    XIconifyWindow( qt_xdisplay(), win, qt_xscreen() );
+
+}
+
+
+void KWin::deIconifyWindow( WId win, bool animation )
+{
+
+    if ( !animation )
+    {
+        kwin_net_create_atoms();
+        sendClientMessageToRoot( win, kde_wm_change_state, 1, 1 );
+    }
+    XMapWindow( qt_xdisplay(), win );
+
+}
+
+void KWin::appStarted()
+{
+
+    KStartupInfo::appStarted();
+
+}
+
+class KWin::WindowInfoPrivate
+{
+    public:
+        WindowInfoPrivate()
+
+        : info( __null )
+
+        {}
+
+        ~WindowInfoPrivate() { delete info; }
+        NETWinInfo* info;
+
+        WId win_;
+        QString name_;
+        QString iconic_name_;
+        QRect geometry_;
+        QRect frame_geometry_;
+        int ref;
+        bool valid;
+    private:
+        WindowInfoPrivate( const WindowInfoPrivate& );
+        void operator=( const WindowInfoPrivate& );
+};
+
+
+KWin::WindowInfo::WindowInfo( WId win, unsigned long properties, unsigned long properties2 )
+{
+
+    KXErrorHandler handler;
+    d = new WindowInfoPrivate;
+    d->ref = 1;
+    if( properties == 0 )
+        properties = NET::WMState |
+                     NET::WMStrut |
+                     NET::WMWindowType |
+                     NET::WMName |
+                     NET::WMVisibleName |
+                     NET::WMIconName |
+                     NET::WMVisibleIconName |
+                     NET::WMDesktop |
+                     NET::WMPid |
+                     NET::WMKDEFrameStrut |
+                     NET::XAWMState |
+                     NET::WMGeometry;
+    if( properties & NET::WMVisibleIconName )
+        properties |= NET::WMIconName | NET::WMVisibleName;
+    if( properties & NET::WMVisibleName )
+        properties |= NET::WMName;
+    properties |= NET::XAWMState;
+    unsigned long props[ 2 ] = { properties, properties2 };
+    d->info = new NETWinInfo( qt_xdisplay(), win, qt_xrootwin(), props, 2 );
+    d->win_ = win;
+    if( properties & NET::WMName ) {
+        if( d->info->name())
+            d->name_ = QString::fromUtf8( d->info->name() );
+        else
+            d->name_ = readNameProperty( win, ((Atom) 39) );
+    }
+    if( properties & NET::WMIconName ) {
+        if( d->info->iconName())
+            d->iconic_name_ = QString::fromUtf8( d->info->iconName());
+        else
+            d->iconic_name_ = readNameProperty( win, ((Atom) 37) );
+    }
+    if( properties & ( NET::WMGeometry | NET::WMKDEFrameStrut )) {
+        NETRect frame, geom;
+        d->info->kdeGeometry( frame, geom );
+        d->geometry_.setRect( geom.pos.x, geom.pos.y, geom.size.width, geom.size.height );
+        d->frame_geometry_.setRect( frame.pos.x, frame.pos.y, frame.size.width, frame.size.height );
+    }
+    d->valid = !handler.error( false );
+
+}
+
+
+KWin::WindowInfo::WindowInfo()
+    : d( __null )
+{
+}
+
+KWin::WindowInfo::~WindowInfo()
+{
+    if( d != __null ) {
+        if( --d->ref == 0 ) {
+            delete d;
+        }
+    }
+}
+
+KWin::WindowInfo::WindowInfo( const WindowInfo& wininfo )
+    : d( wininfo.d )
+{
+    if( d != __null )
+        ++d->ref;
+}
+
+KWin::WindowInfo& KWin::WindowInfo::operator=( const WindowInfo& wininfo )
+{
+    if( d != wininfo.d ) {
+        if( d != __null )
+            if( --d->ref == 0 )
+                delete d;
+        d = wininfo.d;
+        if( d != __null )
+            ++d->ref;
+    }
+    return *this;
+}
+
+bool KWin::WindowInfo::valid( bool withdrawn_is_valid ) const
+{
+    if( !d->valid )
+        return false;
+    if( !withdrawn_is_valid && mappingState() == NET::Withdrawn )
+        return false;
+    return true;
+}
+
+WId KWin::WindowInfo::win() const
+{
+    return d->win_;
+}
+
+unsigned long KWin::WindowInfo::state() const
+{
+
+    kdWarning(( d->info->passedProperties()[ NETWinInfo::PROTOCOLS ] & NET::WMState ) == 0, 176 )
+        << "Pass NET::WMState to KWin::windowInfo()" << endl;
+    return d->info->state();
+
+
+
+}
+
+NET::MappingState KWin::WindowInfo::mappingState() const
+{
+
+    kdWarning(( d->info->passedProperties()[ NETWinInfo::PROTOCOLS ] & NET::XAWMState ) == 0, 176 )
+        << "Pass NET::XAWMState to KWin::windowInfo()" << endl;
+    return d->info->mappingState();
+
+
+
+}
+
+NETStrut KWin::WindowInfo::strut() const
+{
+
+    kdWarning(( d->info->passedProperties()[ NETWinInfo::PROTOCOLS ] & NET::WMStrut ) == 0, 176 )
+        << "Pass NET::WMStrut to KWin::windowInfo()" << endl;
+    return d->info->strut();
+
+
+
+
+}
+
+NET::WindowType KWin::WindowInfo::windowType( int supported_types ) const
+{
+
+    kdWarning(( d->info->passedProperties()[ NETWinInfo::PROTOCOLS ] & NET::WMWindowType ) == 0, 176 )
+        << "Pass NET::WMWindowType to KWin::windowInfo()" << endl;
+    return d->info->windowType( supported_types );
+
+
+
+}
+
+QString KWin::WindowInfo::visibleNameMatchingState() const
+{
+    if( mappingState() == NET::Iconic )
+        return visibleIconName();
+    else
+        return visibleName();
+}
+
+QString KWin::WindowInfo::visibleNameWithState() const
+{
+    QString s = visibleName();
+    if ( isMinimized() ) {
+        s.prepend('(');
+        s.append(')');
+    }
+    return s;
+}
+
+QString KWin::Info::visibleNameWithState() const
+{
+    QString s = visibleName;
+    if ( isMinimized() ) {
+        s.prepend('(');
+        s.append(')');
+    }
+    return s;
+}
+
+QString KWin::WindowInfo::visibleName() const
+{
+
+    kdWarning(( d->info->passedProperties()[ NETWinInfo::PROTOCOLS ] & NET::WMVisibleName ) == 0, 176 )
+        << "Pass NET::WMVisibleName to KWin::windowInfo()" << endl;
+    return d->info->visibleName() ? QString::fromUtf8(d->info->visibleName()) : name();
+
+
+
+}
+
+QString KWin::WindowInfo::name() const
+{
+
+    kdWarning(( d->info->passedProperties()[ NETWinInfo::PROTOCOLS ] & NET::WMName ) == 0, 176 )
+        << "Pass NET::WMName to KWin::windowInfo()" << endl;
+    return d->name_;
+
+
+
+}
+
+QString KWin::WindowInfo::visibleIconName() const
+{
+
+    kdWarning(( d->info->passedProperties()[ NETWinInfo::PROTOCOLS ] & NET::WMVisibleIconName ) == 0, 176 )
+        << "Pass NET::WMVisibleIconName to KWin::windowInfo()" << endl;
+    if( d->info->visibleIconName())
+        return QString::fromUtf8( d->info->visibleIconName());
+    if( d->info->iconName())
+        return QString::fromUtf8( d->info->iconName());
+    if( !d->iconic_name_.isEmpty())
+        return d->iconic_name_;
+
+    return visibleName();
+}
+
+QString KWin::WindowInfo::iconName() const
+{
+
+    kdWarning(( d->info->passedProperties()[ NETWinInfo::PROTOCOLS ] & NET::WMIconName ) == 0, 176 )
+        << "Pass NET::WMIconName to KWin::windowInfo()" << endl;
+    if( d->info->iconName())
+        return QString::fromUtf8( d->info->iconName());
+    if( !d->iconic_name_.isEmpty())
+        return d->iconic_name_;
+
+    return name();
+}
+
+bool KWin::WindowInfo::isOnCurrentDesktop() const
+{
+
+    return isOnDesktop( KWin::currentDesktop());
+
+
+
+}
+
+bool KWin::WindowInfo::isOnDesktop( int desktop ) const
+{
+
+    kdWarning(( d->info->passedProperties()[ NETWinInfo::PROTOCOLS ] & NET::WMDesktop ) == 0, 176 )
+        << "Pass NET::WMDesktop to KWin::windowInfo()" << endl;
+    return d->info->desktop() == desktop || d->info->desktop() == NET::OnAllDesktops;
+
+
+
+}
+
+bool KWin::WindowInfo::onAllDesktops() const
+{
+
+    kdWarning(( d->info->passedProperties()[ NETWinInfo::PROTOCOLS ] & NET::WMDesktop ) == 0, 176 )
+        << "Pass NET::WMDesktop to KWin::windowInfo()" << endl;
+    return d->info->desktop() == NET::OnAllDesktops;
+
+
+
+}
+
+int KWin::WindowInfo::desktop() const
+{
+
+    kdWarning(( d->info->passedProperties()[ NETWinInfo::PROTOCOLS ] & NET::WMDesktop ) == 0, 176 )
+        << "Pass NET::WMDesktop to KWin::windowInfo()" << endl;
+    return d->info->desktop();
+
+
+
+}
+
+QRect KWin::WindowInfo::geometry() const
+{
+
+    kdWarning(( d->info->passedProperties()[ NETWinInfo::PROTOCOLS ] & NET::WMGeometry ) == 0, 176 )
+        << "Pass NET::WMGeometry to KWin::windowInfo()" << endl;
+    return d->geometry_;
+
+
+
+}
+
+QRect KWin::WindowInfo::frameGeometry() const
+{
+    kdWarning(( d->info->passedProperties()[ NETWinInfo::PROTOCOLS ] & NET::WMKDEFrameStrut ) == 0, 176 )
+        << "Pass NET::WMKDEFrameStrut to KWin::windowInfo()" << endl;
+    return d->frame_geometry_;
+}
+
+WId KWin::WindowInfo::transientFor() const
+{
+
+    kdWarning(( d->info->passedProperties()[ NETWinInfo::PROTOCOLS2 ] & NET::WM2TransientFor ) == 0, 176 )
+        << "Pass NET::WM2TransientFor to KWin::windowInfo()" << endl;
+    return d->info->transientFor();
+
+
+
+}
+
+WId KWin::WindowInfo::groupLeader() const
+{
+
+    kdWarning(( d->info->passedProperties()[ NETWinInfo::PROTOCOLS2 ] & NET::WM2GroupLeader ) == 0, 176 )
+        << "Pass NET::WM2GroupLeader to KWin::windowInfo()" << endl;
+    return d->info->groupLeader();
+
+
+
+}
+
+bool KWin::WindowInfo::actionSupported( NET::Action action ) const
+{
+
+    kdWarning(( d->info->passedProperties()[ NETWinInfo::PROTOCOLS2 ] & NET::WM2AllowedActions ) == 0, 176 )
+        << "Pass NET::WM2AllowedActions to KWin::windowInfo()" << endl;
+    if( allowedActionsSupported())
+        return d->info->allowedActions() & action;
+    else
+
+        return true;
+}
+
+
+bool KWin::WindowInfo::isMinimized() const
+{
+
+    if( mappingState() != NET::Iconic )
+        return false;
+
+    if(( state() & NET::Hidden ) != 0
+        && ( state() & NET::Shaded ) == 0 )
+        return true;
+
+
+    return icccmCompliantMappingState() ? false : true;
+
+
+
+}
+
+bool KWin::Info::isMinimized() const
+{
+
+    if( mappingState != NET::Iconic )
+        return false;
+
+    if(( state & NET::Hidden ) != 0
+        && ( state & NET::Shaded ) == 0 )
+        return true;
+
+
+    return icccmCompliantMappingState() ? false : true;
+
+
+
+}
+
+bool KWin::Info::isIconified() const
+{
+    return isMinimized();
+}
+
+bool KWin::icccmCompliantMappingState()
+{
+
+    static enum { noidea, yes, no } wm_is_1_2_compliant = noidea;
+    if( wm_is_1_2_compliant == noidea ) {
+        NETRootInfo info( qt_xdisplay(), NET::Supported );
+        wm_is_1_2_compliant = info.isSupported( NET::Hidden ) ? yes : no;
+    }
+    return wm_is_1_2_compliant == yes;
+
+
+
+}
+
+bool KWin::allowedActionsSupported()
+{
+
+    static enum { noidea, yes, no } wm_supports_allowed_actions = noidea;
+    if( wm_supports_allowed_actions == noidea ) {
+        NETRootInfo info( qt_xdisplay(), NET::Supported );
+        wm_supports_allowed_actions = info.isSupported( NET::WM2AllowedActions ) ? yes : no;
+    }
+    return wm_supports_allowed_actions == yes;
+
+
+
+}
+
+QString KWin::readNameProperty( WId win, unsigned long atom )
+{
+
+    XTextProperty tp;
+    char **text = __null;
+    int count;
+
+    QString result;
+
+    if ( XGetTextProperty( qt_xdisplay(), win, &tp, atom ) != 0 && tp.value != __null ) {
+        if ( tp.encoding == ((Atom) 31) )
+            result = QString::fromLocal8Bit( (const char*) tp.value );
+        else if ( XmbTextPropertyToTextList( qt_xdisplay(), &tp, &text, &count) == Success &&
+                  text != __null && count > 0 ) {
+            result = QString::fromLocal8Bit( text[0] );
+        }
+        if( text != __null )
+            XFreeStringList( text );
+        XFree( tp.value );
+    }
+
+    return result;
+}
+
+
+
+
+
+class KWinModulePrivate;
+class KWinModule : public QObject
+{
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+
+public:
+
+
+
+
+
+
+    KWinModule( QObject* parent = 0 );
+
+
+
+
+    ~KWinModule();
+    const QValueList<WId>& windows() const;
+
+
+
+
+
+
+
+    const QValueList<WId>& stackingOrder() const;
+
+
+
+
+
+
+    bool hasWId(WId id) const;
+
+
+
+
+
+    const QValueList<WId>& systemTrayWindows() const;
+
+
+
+
+
+    int currentDesktop() const;
+
+
+
+
+
+    int numberOfDesktops() const;
+
+
+
+
+
+
+    WId activeWindow() const;
+    QRect workArea( int desktop = - 1 ) const;
+    QRect workArea( const QValueList<WId> &excludes, int desktop = -1) const;
+
+
+
+
+
+
+    QString desktopName( int desktop ) const;
+
+
+
+
+
+
+    void setDesktopName( int desktop, const QString& name );
+    void doNotManage( const QString& title );
+
+
+protected:
+
+
+
+
+
+    void currentDesktopChanged( int desktop);
+
+
+
+
+
+    void windowAdded(WId id);
+
+
+
+
+
+    void windowRemoved(WId id);
+
+
+
+
+
+    void activeWindowChanged(WId id);
+
+
+
+
+    void desktopNamesChanged();
+
+
+
+
+
+    void numberOfDesktopsChanged(int num);
+
+
+
+
+
+    void systemTrayWindowAdded(WId id);
+
+
+
+
+
+    void systemTrayWindowRemoved(WId id);
+
+
+
+
+    void workAreaChanged();
+
+
+
+
+
+
+    void strutChanged();
+
+
+
+
+
+    void stackingOrderChanged();
+    void windowChanged(WId id, const unsigned long* properties );
+    void windowChanged(WId id, unsigned int properties) ;
+
+
+
+
+
+    void windowChanged(WId id);
+
+protected:
+    virtual void connectNotify( const char* signal );
+
+private:
+    KWinModulePrivate* d;
+
+    friend class KWinModulePrivate;
+};
+static KWinModulePrivate* static_d = 0;
+
+class KWinModulePrivate : public QWidget, public NETRootInfo
+{
+public:
+    KWinModulePrivate()
+        : QWidget(0,0), NETRootInfo( qt_xdisplay(),
+                                     ClientList |
+                                     ClientListStacking |
+                                     NumberOfDesktops |
+                                     DesktopGeometry |
+                                     CurrentDesktop |
+                                     DesktopNames |
+                                     ActiveWindow |
+                                     WorkArea |
+                                     KDESystemTrayWindows,
+                                     -1, false
+                                     ),
+          strutSignalConnected( false )
+    {
+        KApplication::kApplication()->installX11EventFilter( this );
+        (void ) KApplication::kApplication()->desktop();
+        activate();
+        updateStackingOrder();
+    }
+    ~KWinModulePrivate()
+    {
+    }
+
+
+
+
+    QPtrList<KWinModule> modules;
+
+    QValueList<WId> windows;
+    QValueList<WId> stackingOrder;
+    QValueList<WId> systemTrayWindows;
+
+    struct StrutData
+    {
+        StrutData( WId window_, const NETStrut& strut_, int desktop_ )
+            : window( window_ ), strut( strut_ ), desktop( desktop_ ) {};
+        StrutData() {};
+        WId window;
+        NETStrut strut;
+        int desktop;
+    };
+    QValueList<StrutData> strutWindows;
+    QValueList<WId> possibleStrutWindows;
+    bool strutSignalConnected;
+
+    void addClient(Window);
+    void removeClient(Window);
+    void addSystemTrayWin(Window);
+    void removeSystemTrayWin(Window);
+
+    bool x11Event( XEvent * ev );
+
+    void updateStackingOrder();
+    bool removeStrutWindow( WId );
+};
+
+
+KWinModule::KWinModule( QObject* parent )
+    : QObject( parent, "kwin_module" )
+{
+    if ( !static_d )
+        static_d = new KWinModulePrivate;
+    d = static_d;
+    d->modules.append( this );
+}
+
+KWinModule::~KWinModule()
+{
+    d->modules.removeRef( this );
+    if ( d->modules.isEmpty() ) {
+        delete d;
+        static_d = 0;
+    }
+}
+
+const QValueList<WId>& KWinModule::windows() const
+{
+    return d->windows;
+}
+
+const QValueList<WId>& KWinModule::stackingOrder() const
+{
+    return d->stackingOrder;
+}
+
+
+bool KWinModule::hasWId(WId w) const
+{
+    return d->windows.contains( w );
+}
+
+const QValueList<WId>& KWinModule::systemTrayWindows() const
+{
+    return d->systemTrayWindows;
+}
+
+bool KWinModulePrivate::x11Event( XEvent * ev )
+{
+    if ( ev->xany.window == qt_xrootwin() ) {
+        int m = NETRootInfo::event( ev );
+
+        if ( m & CurrentDesktop )
+            for ( QPtrListIterator<KWinModule> mit( modules ); mit.current(); ++mit )
+                (*mit)->currentDesktopChanged( currentDesktop() );
+        if ( m & ActiveWindow )
+            for ( QPtrListIterator<KWinModule> mit( modules ); mit.current(); ++mit )
+                (*mit)->activeWindowChanged( activeWindow() );
+        if ( m & DesktopNames )
+            for ( QPtrListIterator<KWinModule> mit( modules ); mit.current(); ++mit )
+                (*mit)->desktopNamesChanged();
+        if ( m & NumberOfDesktops )
+            for ( QPtrListIterator<KWinModule> mit( modules ); mit.current(); ++mit )
+                (*mit)->numberOfDesktopsChanged( numberOfDesktops() );
+        if ( m & WorkArea )
+            for ( QPtrListIterator<KWinModule> mit( modules ); mit.current(); ++mit )
+                (*mit)->workAreaChanged();
+        if ( m & ClientListStacking ) {
+            updateStackingOrder();
+            for ( QPtrListIterator<KWinModule> mit( modules ); mit.current(); ++mit )
+                (*mit)->stackingOrderChanged();
+        }
+    } else if ( windows.contains( ev->xany.window ) ){
+        NETWinInfo ni( qt_xdisplay(), ev->xany.window, qt_xrootwin(), 0 );
+        unsigned long dirty[ 2 ];
+        ni.event( ev, dirty, 2 );
+        if ( !dirty[ 0 ] && !dirty[ 1 ] && ev->type ==28 && ev->xproperty.atom == ((Atom) 35) )
+            dirty[ NETWinInfo::PROTOCOLS ] |= NET::WMIcon;
+        if ( (dirty[ NETWinInfo::PROTOCOLS ] & NET::WMStrut) != 0 ) {
+            removeStrutWindow( ev->xany.window );
+            if ( !possibleStrutWindows.contains( ev->xany.window ) )
+                possibleStrutWindows.append( ev->xany.window );
+        }
+        if ( dirty[ NETWinInfo::PROTOCOLS ] || dirty[ NETWinInfo::PROTOCOLS2 ] ) {
+            for ( QPtrListIterator<KWinModule> mit( modules ); mit.current(); ++mit ) {
+                (*mit)->windowChanged( ev->xany.window );
+                (*mit)->windowChanged( ev->xany.window, dirty );
+                (*mit)->windowChanged( ev->xany.window, dirty[ NETWinInfo::PROTOCOLS ] );
+                if ( (dirty[ NETWinInfo::PROTOCOLS ] & NET::WMStrut) != 0 )
+                    (*mit)->strutChanged();
+            }
+        }
+    }
+
+    return FALSE;
+}
+
+bool KWinModulePrivate::removeStrutWindow( WId w )
+{
+    for( QValueList< StrutData >::Iterator it = strutWindows.begin();
+         it != strutWindows.end();
+         ++it )
+        if( (*it).window == w ) {
+            strutWindows.remove( it );
+            return true;
+        }
+    return false;
+}
+
+void KWinModulePrivate::updateStackingOrder()
+{
+    stackingOrder.clear();
+    for ( int i = 0; i < clientListStackingCount(); i++ )
+        stackingOrder.append( clientListStacking()[i] );
+}
+
+void KWinModulePrivate::addClient(Window w)
+{
+    if ( !QWidget::find( w ) )
+        XSelectInput( qt_xdisplay(), w, (1L<<22) | (1L<<17) );
+    bool emit_strutChanged = FALSE;
+    if( strutSignalConnected && modules.count() > 0 ) {
+        NETWinInfo info( qt_xdisplay(), w, qt_xrootwin(), NET::WMStrut | NET::WMDesktop );
+        NETStrut strut = info.strut();
+        if ( strut.left || strut.top || strut.right || strut.bottom ) {
+            strutWindows.append( StrutData( w, strut, info.desktop()));
+            emit_strutChanged = TRUE;
+        }
+    } else
+        possibleStrutWindows.append( w );
+    windows.append( w );
+    for ( QPtrListIterator<KWinModule> mit( modules ); mit.current(); ++mit ) {
+        (*mit)->windowAdded( w );
+        if ( emit_strutChanged )
+            (*mit)->strutChanged();
+    }
+}
+
+void KWinModulePrivate::removeClient(Window w)
+{
+    bool emit_strutChanged = removeStrutWindow( w );
+    if( strutSignalConnected && possibleStrutWindows.contains( w ) && modules.count() > 0 ) {
+        NETWinInfo info( qt_xdisplay(), w, qt_xrootwin(), NET::WMStrut );
+        NETStrut strut = info.strut();
+        if ( strut.left || strut.top || strut.right || strut.bottom ) {
+            emit_strutChanged = TRUE;
+        }
+    }
+    possibleStrutWindows.remove( w );
+    windows.remove( w );
+    for ( QPtrListIterator<KWinModule> mit( modules ); mit.current(); ++mit ) {
+        (*mit)->windowRemoved( w );
+        if ( emit_strutChanged )
+            (*mit)->strutChanged();
+    }
+}
+
+void KWinModulePrivate::addSystemTrayWin(Window w)
+{
+    systemTrayWindows.append( w );
+    for ( QPtrListIterator<KWinModule> mit( modules ); mit.current(); ++mit )
+        (*mit)->systemTrayWindowAdded( w );
+}
+
+void KWinModulePrivate::removeSystemTrayWin(Window w)
+{
+    systemTrayWindows.remove( w );
+    for ( QPtrListIterator<KWinModule> mit( modules ); mit.current(); ++mit )
+        (*mit)->systemTrayWindowRemoved( w );
+}
+
+int KWinModule::currentDesktop() const
+{
+    return d->currentDesktop();
+}
+
+int KWinModule::numberOfDesktops() const
+{
+    return d->numberOfDesktops();
+}
+
+WId KWinModule::activeWindow() const
+{
+    return d->activeWindow();
+}
+
+QRect KWinModule::workArea( int desktop ) const
+{
+    int desk = (desktop > 0 && desktop <= (int) d->numberOfDesktops() ) ? desktop : currentDesktop();
+    if ( desk <= 0 )
+        return QApplication::desktop()->geometry();
+    NETRect r = d->workArea( desk );
+    return QRect( r.pos.x, r.pos.y, r.size.width, r.size.height );
+}
+
+QRect KWinModule::workArea( const QValueList<WId>& exclude, int desktop ) const
+{
+    QRect all = QApplication::desktop()->geometry();
+    QRect a = all;
+
+    if (desktop == -1)
+        desktop = d->currentDesktop();
+
+    QValueList<WId>::ConstIterator it1;
+    for( it1 = d->windows.begin(); it1 != d->windows.end(); ++it1 ) {
+
+        if(exclude.contains(*it1) > 0) continue;
+
+
+
+
+        NETStrut strut;
+        QValueList< KWinModulePrivate::StrutData >::Iterator it2 = d->strutWindows.begin();
+        for( ;
+             it2 != d->strutWindows.end();
+             ++it2 )
+            if( (*it2).window == *it1 )
+                break;
+        if( it2 != d->strutWindows.end()) {
+            if(!((*it2).desktop == desktop || (*it2).desktop == NETWinInfo::OnAllDesktops ))
+                continue;
+            strut = (*it2).strut;
+        } else if( d->possibleStrutWindows.contains( *it1 )) {
+            NETWinInfo info( qt_xdisplay(), (*it1), qt_xrootwin(), NET::WMStrut | NET::WMDesktop);
+            strut = info.strut();
+            d->possibleStrutWindows.remove( *it1 );
+            d->strutWindows.append( KWinModulePrivate::StrutData( *it1, info.strut(), info.desktop()));
+            if(!(info.desktop() == desktop || info.desktop() == NETWinInfo::OnAllDesktops))
+                continue;
+        } else
+            continue;
+
+        QRect r = all;
+        if ( strut.left > 0 )
+            r.setLeft( r.left() + (int) strut.left );
+        if ( strut.top > 0 )
+            r.setTop( r.top() + (int) strut.top );
+        if ( strut.right > 0 )
+            r.setRight( r.right() - (int) strut.right );
+        if ( strut.bottom > 0 )
+            r.setBottom( r.bottom() - (int) strut.bottom );
+
+        a = a.intersect(r);
+    }
+    return a;
+}
+
+void KWinModule::connectNotify( const char* signal )
+{
+    if( !d->strutSignalConnected && qstrcmp( signal, "2""strutChanged()") == 0 )
+        d->strutSignalConnected = true;
+    QObject::connectNotify( signal );
+}
+
+QString KWinModule::desktopName( int desktop ) const
+{
+    const char* name = d->desktopName( (desktop > 0 && desktop <= (int) d->numberOfDesktops() ) ? desktop : currentDesktop() );
+    if ( name && name[0] )
+        return QString::fromUtf8( name );
+    return i18n("Desktop %1").arg( desktop );
+}
+
+void KWinModule::setDesktopName( int desktop, const QString& name )
+{
+    if (desktop <= 0 || desktop > (int) d->numberOfDesktops() )
+        desktop = currentDesktop();
+    d->setDesktopName( desktop, name.utf8().data() );
+}
+
+
+void KWinModule::doNotManage( const QString& title )
+{
+    if ( !KApplication::kApplication()->dcopClient()->isAttached() )
+        KApplication::kApplication()->dcopClient()->attach();
+    QByteArray data, replyData;
+    QCString replyType;
+    QDataStream arg(data, 0x0002);
+    arg << title;
+    KApplication::kApplication()->dcopClient()->call("kwin", "", "doNotManage(QString)",
+                             data, replyType, replyData);
+}
+
+const char *KWinModule::className() const
+{
+    return "KWinModule";
+}
+
+QMetaObject *KWinModule::metaObj = 0;
+static QMetaObjectCleanUp cleanUp_KWinModule( "KWinModule", &KWinModule::staticMetaObject );
+QMetaObject* KWinModule::staticMetaObject()
+{
+    if ( metaObj )
+        return metaObj;
+    QMetaObject* parentObject = QObject::staticMetaObject();
+    static const QUParameter param_signal_0[] = {
+        { "desktop", &static_QUType_int, 0, QUParameter::In }
+    };
+    static const QUMethod signal_0 = {"currentDesktopChanged", 1, param_signal_0 };
+    static const QUParameter param_signal_1[] = {
+        { "id", &static_QUType_ptr, "WId", QUParameter::In }
+    };
+    static const QUMethod signal_1 = {"windowAdded", 1, param_signal_1 };
+    static const QUParameter param_signal_2[] = {
+        { "id", &static_QUType_ptr, "WId", QUParameter::In }
+    };
+    static const QUMethod signal_2 = {"windowRemoved", 1, param_signal_2 };
+    static const QUParameter param_signal_3[] = {
+        { "id", &static_QUType_ptr, "WId", QUParameter::In }
+    };
+    static const QUMethod signal_3 = {"activeWindowChanged", 1, param_signal_3 };
+    static const QUMethod signal_4 = {"desktopNamesChanged", 0, 0 };
+    static const QUParameter param_signal_5[] = {
+        { "num", &static_QUType_int, 0, QUParameter::In }
+    };
+    static const QUMethod signal_5 = {"numberOfDesktopsChanged", 1, param_signal_5 };
+    static const QUParameter param_signal_6[] = {
+        { "id", &static_QUType_ptr, "WId", QUParameter::In }
+    };
+    static const QUMethod signal_6 = {"systemTrayWindowAdded", 1, param_signal_6 };
+    static const QUParameter param_signal_7[] = {
+        { "id", &static_QUType_ptr, "WId", QUParameter::In }
+    };
+    static const QUMethod signal_7 = {"systemTrayWindowRemoved", 1, param_signal_7 };
+    static const QUMethod signal_8 = {"workAreaChanged", 0, 0 };
+    static const QUMethod signal_9 = {"strutChanged", 0, 0 };
+    static const QUMethod signal_10 = {"stackingOrderChanged", 0, 0 };
+    static const QUParameter param_signal_11[] = {
+        { "id", &static_QUType_ptr, "WId", QUParameter::In },
+        { "properties", &static_QUType_ptr, "unsigned long", QUParameter::In }
+    };
+    static const QUMethod signal_11 = {"windowChanged", 2, param_signal_11 };
+    static const QUParameter param_signal_12[] = {
+        { "id", &static_QUType_ptr, "WId", QUParameter::In },
+        { "properties", &static_QUType_ptr, "unsigned int", QUParameter::In }
+    };
+    static const QUMethod signal_12 = {"windowChanged", 2, param_signal_12 };
+    static const QUParameter param_signal_13[] = {
+        { "id", &static_QUType_ptr, "WId", QUParameter::In }
+    };
+    static const QUMethod signal_13 = {"windowChanged", 1, param_signal_13 };
+    static const QMetaData signal_tbl[] = {
+        { "currentDesktopChanged(int)", &signal_0, QMetaData::Public },
+        { "windowAdded(WId)", &signal_1, QMetaData::Public },
+        { "windowRemoved(WId)", &signal_2, QMetaData::Public },
+        { "activeWindowChanged(WId)", &signal_3, QMetaData::Public },
+        { "desktopNamesChanged()", &signal_4, QMetaData::Public },
+        { "numberOfDesktopsChanged(int)", &signal_5, QMetaData::Public },
+        { "systemTrayWindowAdded(WId)", &signal_6, QMetaData::Public },
+        { "systemTrayWindowRemoved(WId)", &signal_7, QMetaData::Public },
+        { "workAreaChanged()", &signal_8, QMetaData::Public },
+        { "strutChanged()", &signal_9, QMetaData::Public },
+        { "stackingOrderChanged()", &signal_10, QMetaData::Public },
+        { "windowChanged(WId,const unsigned long*)", &signal_11, QMetaData::Public },
+        { "windowChanged(WId,unsigned int)", &signal_12, QMetaData::Public },
+        { "windowChanged(WId)", &signal_13, QMetaData::Public }
+    };
+    metaObj = QMetaObject::new_metaobject(
+        "KWinModule", parentObject,
+        0, 0,
+        signal_tbl, 14,
+
+        0, 0,
+        0, 0,
+
+        0, 0 );
+    cleanUp_KWinModule.setMetaObject( metaObj );
+    return metaObj;
+}
+
+void* KWinModule::qt_cast( const char* clname )
+{
+    if ( !qstrcmp( clname, "KWinModule" ) )
+        return this;
+    return QObject::qt_cast( clname );
+}
+
+
+void KWinModule::currentDesktopChanged( int t0 )
+{
+    activate_signal( staticMetaObject()->signalOffset() + 0, t0 );
+}
+
+
+
+
+
+void KWinModule::windowAdded( WId t0 )
+{
+    if ( signalsBlocked() )
+        return;
+    QConnectionList *clist = receivers( staticMetaObject()->signalOffset() + 1 );
+    if ( !clist )
+        return;
+    QUObject o[2];
+    static_QUType_ptr.set(o+1,&t0);
+    activate_signal( clist, o );
+}
+
+
+void KWinModule::windowRemoved( WId t0 )
+{
+    if ( signalsBlocked() )
+        return;
+    QConnectionList *clist = receivers( staticMetaObject()->signalOffset() + 2 );
+    if ( !clist )
+        return;
+    QUObject o[2];
+    static_QUType_ptr.set(o+1,&t0);
+    activate_signal( clist, o );
+}
+
+
+void KWinModule::activeWindowChanged( WId t0 )
+{
+    if ( signalsBlocked() )
+        return;
+    QConnectionList *clist = receivers( staticMetaObject()->signalOffset() + 3 );
+    if ( !clist )
+        return;
+    QUObject o[2];
+    static_QUType_ptr.set(o+1,&t0);
+    activate_signal( clist, o );
+}
+
+
+void KWinModule::desktopNamesChanged()
+{
+    activate_signal( staticMetaObject()->signalOffset() + 4 );
+}
+
+
+void KWinModule::numberOfDesktopsChanged( int t0 )
+{
+    activate_signal( staticMetaObject()->signalOffset() + 5, t0 );
+}
+
+
+void KWinModule::systemTrayWindowAdded( WId t0 )
+{
+    if ( signalsBlocked() )
+        return;
+    QConnectionList *clist = receivers( staticMetaObject()->signalOffset() + 6 );
+    if ( !clist )
+        return;
+    QUObject o[2];
+    static_QUType_ptr.set(o+1,&t0);
+    activate_signal( clist, o );
+}
+
+
+void KWinModule::systemTrayWindowRemoved( WId t0 )
+{
+    if ( signalsBlocked() )
+        return;
+    QConnectionList *clist = receivers( staticMetaObject()->signalOffset() + 7 );
+    if ( !clist )
+        return;
+    QUObject o[2];
+    static_QUType_ptr.set(o+1,&t0);
+    activate_signal( clist, o );
+}
+
+
+void KWinModule::workAreaChanged()
+{
+    activate_signal( staticMetaObject()->signalOffset() + 8 );
+}
+
+
+void KWinModule::strutChanged()
+{
+    activate_signal( staticMetaObject()->signalOffset() + 9 );
+}
+
+
+void KWinModule::stackingOrderChanged()
+{
+    activate_signal( staticMetaObject()->signalOffset() + 10 );
+}
+
+
+void KWinModule::windowChanged( WId t0, const unsigned long* t1 )
+{
+    if ( signalsBlocked() )
+        return;
+    QConnectionList *clist = receivers( staticMetaObject()->signalOffset() + 11 );
+    if ( !clist )
+        return;
+    QUObject o[3];
+    static_QUType_ptr.set(o+1,&t0);
+    static_QUType_ptr.set(o+2,t1);
+    activate_signal( clist, o );
+}
+
+
+void KWinModule::windowChanged( WId t0, unsigned int t1 )
+{
+    if ( signalsBlocked() )
+        return;
+    QConnectionList *clist = receivers( staticMetaObject()->signalOffset() + 12 );
+    if ( !clist )
+        return;
+    QUObject o[3];
+    static_QUType_ptr.set(o+1,&t0);
+    static_QUType_ptr.set(o+2,&t1);
+    activate_signal( clist, o );
+}
+
+
+void KWinModule::windowChanged( WId t0 )
+{
+    if ( signalsBlocked() )
+        return;
+    QConnectionList *clist = receivers( staticMetaObject()->signalOffset() + 13 );
+    if ( !clist )
+        return;
+    QUObject o[2];
+    static_QUType_ptr.set(o+1,&t0);
+    activate_signal( clist, o );
+}
+
+bool KWinModule::qt_invoke( int _id, QUObject* _o )
+{
+    return QObject::qt_invoke(_id,_o);
+}
+
+bool KWinModule::qt_emit( int _id, QUObject* _o )
+{
+    switch ( _id - staticMetaObject()->signalOffset() ) {
+    case 0: currentDesktopChanged((int)static_QUType_int.get(_o+1)); break;
+    case 1: windowAdded((WId)(*((WId*)static_QUType_ptr.get(_o+1)))); break;
+    case 2: windowRemoved((WId)(*((WId*)static_QUType_ptr.get(_o+1)))); break;
+    case 3: activeWindowChanged((WId)(*((WId*)static_QUType_ptr.get(_o+1)))); break;
+    case 4: desktopNamesChanged(); break;
+    case 5: numberOfDesktopsChanged((int)static_QUType_int.get(_o+1)); break;
+    case 6: systemTrayWindowAdded((WId)(*((WId*)static_QUType_ptr.get(_o+1)))); break;
+    case 7: systemTrayWindowRemoved((WId)(*((WId*)static_QUType_ptr.get(_o+1)))); break;
+    case 8: workAreaChanged(); break;
+    case 9: strutChanged(); break;
+    case 10: stackingOrderChanged(); break;
+    case 11: windowChanged((WId)(*((WId*)static_QUType_ptr.get(_o+1))),(const unsigned long*)static_QUType_ptr.get(_o+2)); break;
+    case 12: windowChanged((WId)(*((WId*)static_QUType_ptr.get(_o+1))),(unsigned int)(*((unsigned int*)static_QUType_ptr.get(_o+2)))); break;
+    case 13: windowChanged((WId)(*((WId*)static_QUType_ptr.get(_o+1)))); break;
+    default:
+        return QObject::qt_emit(_id,_o);
+    }
+    return TRUE;
+}
+
+
+bool KWinModule::qt_property( int id, int f, QVariant* v)
+{
+    return QObject::qt_property( id, f, v);
+}
+
+bool KWinModule::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C"
+
+int mkstemps(char *, int);
+extern "C"
+
+unsigned long strlcat(char*, const char*, unsigned long);
+
+
+
+
+
+
+extern "C"
+
+unsigned long strlcpy(char*, const char*, unsigned long);
+
+
+
+
+
+
+
+typedef unsigned long Atom;
+
+
+
+
+
+
+class KRootPropPrivate;
+class KRootProp
+{
+private:
+  Atom atom;
+  QMap<QString,QString> propDict;
+  QString property_;
+  bool dirty;
+  KRootPropPrivate *d;
+
+public:
+
+
+
+
+
+
+   KRootProp( const QString& rProp = QString::null );
+
+
+
+
+
+  ~KRootProp();
+
+
+
+
+
+   void setProp(const QString& rProp=QString());
+
+
+
+
+   QString prop() const;
+
+
+
+
+
+
+
+   void destroy();
+ QString readEntry( const QString& rKey,
+                    const QString& pDefault = QString::null ) const ;
+ int readNumEntry( const QString& rKey, int nDefault = 0 ) const;
+ QFont readFontEntry( const QString& rKey,
+                      const QFont* pDefault = 0 ) const;
+ QColor readColorEntry( const QString& rKey,
+                        const QColor* pDefault = 0 ) const;
+ QString writeEntry( const QString& rKey, const QString& rValue );
+ QString writeEntry( const QString& rKey, int nValue );
+  QString writeEntry( const QString& rKey, const QFont& rFont );
+  QString writeEntry( const QString& rKey, const QColor& rColor );
+
+
+
+
+
+
+
+  QString removeEntry(const QString& rKey);
+
+
+
+
+
+  QStringList listEntries() const;
+
+
+
+
+
+
+  void sync();
+};
+KRootProp::KRootProp(const QString& rProp )
+{
+  atom = 0;
+  dirty = FALSE;
+  setProp( rProp );
+}
+
+KRootProp::~KRootProp()
+{
+  sync();
+  propDict.clear();
+}
+
+void KRootProp::sync()
+{
+  if ( !dirty )
+      return;
+
+  QString propString;
+  if ( !propDict.isEmpty() )
+  {
+    QMap<QString,QString>::Iterator it = propDict.begin();
+    QString keyvalue;
+
+    while ( it != propDict.end() )
+    {
+      keyvalue = QString( "%1=%2\n").arg(it.key()).arg(it.data());
+      propString += keyvalue;
+      ++it;
+    }
+  }
+
+  XChangeProperty( qt_xdisplay(), qt_xrootwin(), atom,
+                  ((Atom) 31), 8, 0,
+                  (const unsigned char *)propString.utf8().data(),
+                  propString.length());
+  XFlush( qt_xdisplay() );
+}
+
+void KRootProp::setProp( const QString& rProp )
+{
+  Atom type;
+  int format;
+  unsigned long nitems;
+  unsigned long bytes_after;
+  long offset;
+  char *buf;
+
+
+
+
+  if( atom )
+    sync();
+
+  property_ = rProp;
+  if( rProp.isEmpty() )
+    return;
+
+  atom = XInternAtom( qt_xdisplay(), rProp.utf8(), 0);
+
+  QString s;
+  offset = 0; bytes_after = 1;
+  while (bytes_after != 0)
+  {
+    XGetWindowProperty( qt_xdisplay(), qt_xrootwin(), atom, offset, 256,
+                        0, ((Atom) 31), &type, &format, &nitems, &bytes_after,
+                        (unsigned char **)&buf);
+    s += QString::fromUtf8(buf);
+    offset += nitems/4;
+    if (buf)
+      XFree(buf);
+  }
+
+
+
+
+  QString keypair;
+  int i=0;
+  QString key;
+  QString value;
+
+  while(s.length() >0 )
+  {
+
+
+    i = s.find("\n");
+    if(i == -1)
+      i = s.length();
+
+
+
+    keypair = s.left(i);
+    s.remove(0,i+1);
+
+
+
+    keypair.simplifyWhiteSpace();
+
+    i = keypair.find( "=" );
+    if( i != -1 )
+    {
+      key = keypair.left( i );
+      value = keypair.mid( i+1 );
+      propDict.insert( key, value );
+    }
+  }
+}
+
+
+QString KRootProp::prop() const
+{
+    return property_;
+}
+
+void KRootProp::destroy()
+{
+    dirty = FALSE;
+    propDict.clear();
+    if( atom ) {
+        XDeleteProperty( qt_xdisplay(), qt_xrootwin(), atom );
+        atom = 0;
+    }
+}
+
+QString KRootProp::readEntry( const QString& rKey,
+                            const QString& pDefault ) const
+{
+  if( propDict.contains( rKey ) )
+      return propDict[ rKey ];
+  else
+      return pDefault;
+}
+
+int KRootProp::readNumEntry( const QString& rKey, int nDefault ) const
+{
+
+  QString aValue = readEntry( rKey );
+  if( !aValue.isNull() )
+  {
+    bool ok;
+
+    int rc = aValue.toInt( &ok );
+    if (ok)
+      return rc;
+  }
+  return nDefault;
+}
+
+
+QFont KRootProp::readFontEntry( const QString& rKey,
+                                const QFont* pDefault ) const
+{
+  QFont aRetFont;
+  QFont aDefFont;
+
+  if (pDefault)
+    aDefFont = *pDefault;
+
+  QString aValue = readEntry( rKey );
+  if( aValue.isNull() )
+    return aDefFont;
+
+  if ( !aRetFont.fromString( aValue ) && pDefault )
+    aRetFont = aDefFont;
+
+  return aRetFont;
+}
+
+
+QColor KRootProp::readColorEntry( const QString& rKey,
+                                                                const QColor* pDefault ) const
+{
+  QColor aRetColor;
+  int nRed = 0, nGreen = 0, nBlue = 0;
+
+  if( pDefault )
+    aRetColor = *pDefault;
+
+  QString aValue = readEntry( rKey );
+  if( aValue.isNull() )
+    return aRetColor;
+
+
+
+  if( aValue.find("#") == 0 ) {
+    aRetColor.setNamedColor( aValue );
+    return aRetColor;
+  }
+
+
+
+  int nIndex1 = aValue.find( ',' );
+  if( nIndex1 == -1 )
+    return aRetColor;
+
+  int nIndex2 = aValue.find( ',', nIndex1+1 );
+  if( nIndex2 == -1 )
+    return aRetColor;
+
+  bool bOK;
+  nRed = aValue.left( nIndex1 ).toInt( &bOK );
+  nGreen = aValue.mid( nIndex1+1,
+                       nIndex2-nIndex1-1 ).toInt( &bOK );
+  nBlue = aValue.mid( nIndex2+1 ).toInt( &bOK );
+
+  aRetColor.setRgb( nRed, nGreen, nBlue );
+
+  return aRetColor;
+}
+
+QString KRootProp::writeEntry( const QString& rKey, const QString& rValue )
+{
+    dirty = TRUE;
+    if ( propDict.contains( rKey ) ) {
+        QString aValue = propDict[ rKey ];
+        propDict.replace( rKey, rValue );
+        return aValue;
+    }
+    else {
+        propDict.insert( rKey, rValue );
+        return QString::null;
+    }
+}
+
+QString KRootProp::writeEntry( const QString& rKey, int nValue )
+{
+  QString aValue;
+
+  aValue.setNum( nValue );
+
+  return writeEntry( rKey, aValue );
+}
+
+QString KRootProp::writeEntry( const QString& rKey, const QFont& rFont )
+{
+  return writeEntry( rKey, rFont.toString() );
+}
+
+QString KRootProp::writeEntry( const QString& rKey, const QColor& rColor )
+{
+  QString aValue = QString( "%1,%2,%3").arg(rColor.red()).arg(rColor.green()).arg(rColor.blue() );
+
+  return writeEntry( rKey, aValue );
+}
+
+QString KRootProp::removeEntry(const QString& rKey)
+{
+    if (propDict.contains(rKey)) {
+        dirty = TRUE;
+        QString aValue = propDict[rKey];
+        propDict.remove(rKey);
+        return aValue;
+    } else
+        return QString::null;
+}
+
+QStringList KRootProp::listEntries() const
+{
+    QMap<QString,QString>::ConstIterator it;
+    QStringList list;
+
+    for (it=propDict.begin(); it!=propDict.end(); it++)
+        list += it.key();
+
+    return list;
+}
+struct entity {
+    const char *name;
+    int code;
+};
+
+
+
+
+__inline
+
+
+
+
+
+static unsigned int
+hash (register const char *str, register unsigned int len)
+{
+  static const unsigned short asso_values[] =
+    {
+      1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887,
+      1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887,
+      1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887,
+      1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887,
+      1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887, 5,
+        15, 10, 0, 1887, 1887, 1887, 1887, 1887, 1887, 1887,
+      1887, 1887, 1887, 1887, 1887, 115, 0, 40, 50, 90,
+      1887, 0, 0, 45, 1887, 5, 25, 0, 20, 225,
+        10, 0, 30, 60, 10, 20, 1887, 1887, 20, 30,
+        55, 1887, 1887, 1887, 1887, 1887, 1887, 0, 285, 5,
+        75, 25, 55, 390, 335, 10, 5, 0, 30, 120,
+       205, 40, 430, 110, 0, 580, 320, 5, 100, 0,
+         5, 75, 15, 1887, 1887, 1887, 1887, 1887, 1887, 1887,
+      1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887,
+      1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887,
+      1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887,
+      1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887,
+      1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887,
+      1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887,
+      1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887,
+      1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887,
+      1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887,
+      1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887,
+      1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887,
+      1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887, 1887,
+      1887, 1887, 1887, 1887, 1887, 1887
+    };
+  register int hval = len;
+
+  switch (hval)
+    {
+      default:
+      case 8:
+        hval += asso_values[(unsigned char)str[7]];
+      case 7:
+        hval += asso_values[(unsigned char)str[6]];
+      case 6:
+        hval += asso_values[(unsigned char)str[5]];
+      case 5:
+        hval += asso_values[(unsigned char)str[4]];
+      case 4:
+        hval += asso_values[(unsigned char)str[3]];
+      case 3:
+        hval += asso_values[(unsigned char)str[2]];
+      case 2:
+        hval += asso_values[(unsigned char)str[1]];
+      case 1:
+        hval += asso_values[(unsigned char)str[0]];
+        break;
+    }
+  return hval;
+}
+
+static const struct entity wordlist[] =
+  {
+    {"rarr", 0x2192},
+    {"Mu", 0x039c},
+    {"uarr", 0x2191},
+    {"crarr", 0x21b5},
+    {"GT", 62},
+    {"xi", 0x03be},
+    {"Tau", 0x03a4},
+    {"Pi", 0x03a0},
+    {"zwj", 0x200d},
+    {"circ", 0x02c6},
+    {"acirc", 0x00e2},
+    {"Nu", 0x039d},
+    {"ucirc", 0x00fb},
+    {"Xi", 0x039e},
+    {"larr", 0x2190},
+    {"icirc", 0x00ee},
+    {"LT", 60},
+    {"or", 0x22a6},
+    {"Ucirc", 0x00db},
+    {"ecirc", 0x00ea},
+    {"le", 0x2264},
+    {"real", 0x211c},
+    {"ocirc", 0x00f4},
+    {"Icirc", 0x00ce},
+    {"frac14", 0x00bc},
+    {"euro", 0x20ac},
+    {"rceil", 0x2309},
+    {"frac34", 0x00be},
+    {"darr", 0x2193},
+    {"iexcl", 0x00a1},
+    {"frac12", 0x00bd},
+    {"loz", 0x25ca},
+    {"radic", 0x221a},
+    {"ETH", 0x00d0},
+    {"lceil", 0x2308},
+    {"Ecirc", 0x00ca},
+    {"rArr", 0x21d2},
+    {"uArr", 0x21d1},
+    {"mu", 0x03bc},
+    {"AMP", 38},
+    {"macr", 0x00af},
+    {"Acirc", 0x00c2},
+    {"lArr", 0x21d0},
+    {"cedil", 0x00b8},
+    {"lrm", 0x200e},
+    {"rlm", 0x200f},
+    {"ccedil", 0x00e7},
+    {"uml", 0x00a8},
+    {"auml", 0x00e4},
+    {"raquo", 0x00bb},
+    {"forall", 0x2200},
+    {"uuml", 0x00fc},
+    {"iuml", 0x00ef},
+    {"Prime", 0x2033},
+    {"rfloor", 0x230b},
+    {"ordf", 0x00aa},
+    {"Uuml", 0x00dc},
+    {"micro", 0x00b5},
+    {"euml", 0x00eb},
+    {"Yuml", 0x0178},
+    {"laquo", 0x00ab},
+    {"Ccedil", 0x00c7},
+    {"dArr", 0x21d3},
+    {"ouml", 0x00f6},
+    {"lfloor", 0x230a},
+    {"Iuml", 0x00cf},
+    {"nu", 0x03bd},
+    {"ni", 0x220b},
+    {"zwnj", 0x200c},
+    {"ne", 0x2260},
+    {"yuml", 0x00ff},
+    {"rdquo", 0x201d},
+    {"ordm", 0x00ba},
+    {"Gamma", 0x0393},
+    {"curren", 0x00a4},
+    {"Euml", 0x00cb},
+    {"Ocirc", 0x00d4},
+    {"equiv", 0x2261},
+    {"rcaron", 0x0159},
+    {"QUOT", 34},
+    {"ccaron", 0x010d},
+    {"ldquo", 0x201c},
+    {"Tcaron", 0x0164},
+    {"zcaron", 0x017e},
+    {"Auml", 0x00c4},
+    {"Ncaron", 0x0147},
+    {"ecaron", 0x011b},
+    {"and", 0x22a5},
+    {"Rcaron", 0x0158},
+    {"THORN", 0x00de},
+    {"Ccaron", 0x010c},
+    {"divide", 0x00f7},
+    {"Dcaron", 0x010e},
+    {"yen", 0x00a5},
+    {"Zcaron", 0x017d},
+    {"oline", 0x203e},
+    {"Scaron", 0x0160},
+    {"tau", 0x03c4},
+    {"dcaron", 0x10f},
+    {"harr", 0x2194},
+    {"Ecaron", 0x011a},
+    {"eta", 0x03b7},
+    {"Beta", 0x0392},
+    {"lt", 60},
+    {"chi", 0x03c7},
+    {"bull", 0x2022},
+    {"Phi", 0x03a6},
+    {"fnof", 0x0192},
+    {"acute", 0x00b4},
+    {"aacute", 0x00e1},
+    {"zeta", 0x03b6},
+    {"uacute", 0x00fa},
+    {"iacute", 0x00ed},
+    {"iota", 0x03b9},
+    {"rho", 0x03c1},
+    {"Uacute", 0x00da},
+    {"Ouml", 0x00d6},
+    {"eacute", 0x00e9},
+    {"Chi", 0x03a7},
+    {"Yacute", 0x00dd},
+    {"oacute", 0x00f3},
+    {"Zeta", 0x0396},
+    {"Iacute", 0x00cd},
+    {"Rho", 0x03a1},
+    {"Iota", 0x0399},
+    {"Eta", 0x0397},
+    {"ge", 0x2265},
+    {"reg", 0x00ae},
+    {"trade", 0x2122},
+    {"omicron", 0x03bf},
+    {"Delta", 0x0394},
+    {"para", 0x00b6},
+    {"yacute", 0x00fd},
+    {"cap", 0x2229},
+    {"pi", 0x03c0},
+    {"cup", 0x222a},
+    {"Eacute", 0x00c9},
+    {"hArr", 0x21d4},
+    {"delta", 0x03b4},
+    {"aelig", 0x00e6},
+    {"ncaron", 0x0148},
+    {"tilde", 0x02dc},
+    {"atilde", 0x00e3},
+    {"Aacute", 0x00c1},
+    {"quot", 34},
+    {"Ntilde", 0x00d1},
+    {"infin", 0x221e},
+    {"deg", 0x00b0},
+    {"weierp", 0x2118},
+    {"oelig", 0x0153},
+    {"otilde", 0x00f5},
+    {"Lambda", 0x039b},
+    {"lambda", 0x03bb},
+    {"bdquo", 0x201e},
+    {"agrave", 0x00e0},
+    {"nabla", 0x2207},
+    {"ugrave", 0x00f9},
+    {"igrave", 0x00ec},
+    {"int", 0x222b},
+    {"Ugrave", 0x00d9},
+    {"piv", 0x03d6},
+    {"egrave", 0x00e8},
+    {"prod", 0x220f},
+    {"image", 0x2111},
+    {"amp", 38},
+    {"copy", 0x00a9},
+    {"cent", 0x00a2},
+    {"ograve", 0x00f2},
+    {"Igrave", 0x00cc},
+    {"not", 0x00ac},
+    {"tcaron", 0x0165},
+    {"omega", 0x03c9},
+    {"Atilde", 0x00c3},
+    {"Sigma", 0x03a3},
+    {"Oacute", 0x00d3},
+    {"prime", 0x2032},
+    {"ang", 0x2220},
+    {"rang", 0x232a},
+    {"Psi", 0x03a8},
+    {"aring", 0x00e5},
+    {"Egrave", 0x00c8},
+    {"Omicron", 0x039f},
+    {"uring", 0x016f},
+    {"permil", 0x2030},
+    {"lang", 0x2329},
+    {"Uring", 0x016e},
+    {"beta", 0x03b2},
+    {"gamma", 0x03b3},
+    {"Agrave", 0x00c0},
+    {"AElig", 0x00c6},
+    {"cong", 0x2245},
+    {"middot", 0x00b7},
+    {"frasl", 0x2044},
+    {"ntilde", 0x00f1},
+    {"brvbar", 0x00a6},
+    {"eth", 0x00f0},
+    {"Otilde", 0x00d5},
+    {"Theta", 0x0398},
+    {"sum", 0x2211},
+    {"there4", 0x2234},
+    {"gt", 62},
+    {"sim", 0x223c},
+    {"Aring", 0x00c5},
+    {"rsquo", 0x2019},
+    {"rsaquo", 0x203a},
+    {"Ograve", 0x00d2},
+    {"OElig", 0x0152},
+    {"part", 0x2202},
+    {"pound", 0x00a3},
+    {"Omega", 0x03a9},
+    {"lsquo", 0x2018},
+    {"lsaquo", 0x2039},
+    {"phi", 0x03c6},
+    {"notin", 0x2209},
+    {"diams", 0x2666},
+    {"alpha", 0x03b1},
+    {"isin", 0x2208},
+    {"scaron", 0x0161},
+    {"Dagger", 0x2021},
+    {"kappa", 0x03ba},
+    {"hellip", 0x2026},
+    {"Kappa", 0x039a},
+    {"sub", 0x2282},
+    {"dagger", 0x2020},
+    {"perp", 0x22a5},
+    {"alefsym", 0x2135},
+    {"sube", 0x2286},
+    {"prop", 0x221d},
+    {"thorn", 0x00fe},
+    {"clubs", 0x2663},
+    {"Alpha", 0x0391},
+    {"minus", 0x2212},
+    {"sect", 0x00a7},
+    {"exist", 0x2203},
+    {"empty", 0x2205},
+    {"lowast", 0x2217},
+    {"percnt", 0x0025},
+    {"shy", 0x00ad},
+    {"theta", 0x03b8},
+    {"sup", 0x2283},
+    {"sdot", 0x22c5},
+    {"psi", 0x03c8},
+    {"sup1", 0x00b9},
+    {"sbquo", 0x201a},
+    {"sup3", 0x00b3},
+    {"szlig", 0x00df},
+    {"sup2", 0x00b2},
+    {"supe", 0x2287},
+    {"apos", 0x0027},
+    {"iquest", 0x00bf},
+    {"times", 0x00d7},
+    {"nsub", 0x2284},
+    {"oplus", 0x2295},
+    {"otimes", 0x2297},
+    {"sigma", 0x03c3},
+    {"mdash", 0x2014},
+    {"emdash", 0x2014},
+    {"emsp", 0x2003},
+    {"sigmaf", 0x03c2},
+    {"ndash", 0x2013},
+    {"asymp", 0x2248},
+    {"endash", 0x2013},
+    {"ensp", 0x2002},
+    {"hearts", 0x2665},
+    {"upsilon", 0x03c5},
+    {"Upsilon", 0x03a5},
+    {"epsilon", 0x03b5},
+    {"upsih", 0x03d2},
+    {"plusmn", 0x00b1},
+    {"Epsilon", 0x0395},
+    {"nbsp", 0x00a0},
+    {"oslash", 0x00f8},
+    {"spades", 0x2660},
+    {"Oslash", 0x00d8},
+    {"thetasym", 0x03d1},
+    {"thinsp", 0x2009}
+  };
+
+static const short lookup[] =
+  {
+      -1, -1, -1, -1, 0, -1, -1, 1,
+      -1, 2, 3, -1, 4, -1, -1, -1,
+      -1, 5, 6, -1, -1, -1, 7, 8,
+       9, 10, -1, 11, -1, -1, 12, -1,
+      13, -1, 14, 15, -1, 16, -1, -1,
+      -1, -1, 17, -1, -1, 18, -1, -1,
+      -1, -1, 19, -1, -1, -1, -1, -1,
+      -1, 20, -1, 21, -1, -1, -1, -1,
+      -1, 22, -1, -1, -1, -1, 23, 24,
+      -1, -1, 25, 26, 27, -1, -1, 28,
+      29, -1, -1, -1, -1, -1, 30, -1,
+      31, -1, -1, -1, -1, -1, -1, 32,
+      -1, -1, -1, -1, -1, -1, -1, 33,
+      -1, 34, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, 35, -1, -1, -1, 36,
+      -1, -1, -1, -1, 37, -1, -1, 38,
+      39, 40, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, 41, -1, -1, -1,
+      -1, -1, -1, -1, -1, 42, 43, -1,
+      -1, -431, -232, -2, 46, -1, 47, 48,
+      49, 50, -1, -1, 51, -1, -1, -1,
+      -1, 52, 53, 54, -1, -1, 55, -1,
+      -1, -1, -1, 56, 57, -1, -1, -1,
+      58, -1, -1, -1, -1, 59, 60, 61,
+      -1, -1, 62, -1, -1, -1, -1, 63,
+      -1, 64, -1, -1, 65, -1, -1, -1,
+      -1, -1, -1, -1, 66, -1, -1, -1,
+      -1, 67, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, 68, -1, -1,
+      69, -1, 70, 71, -1, -1, -1, 72,
+      -1, -1, -1, -1, -1, 73, 74, -1,
+      -1, 75, 76, -1, -1, -1, -1, 77,
+      78, -1, -1, 79, -1, 80, -1, -1,
+      -1, 81, 82, -1, -1, -1, -1, 83,
+      -1, -1, 84, -1, 85, -1, -1, -1,
+      -1, 86, -1, 87, -1, -1, 88, -1,
+      -1, -1, 89, -1, -1, -1, -1, -1,
+      90, -1, -1, -1, -1, 91, -1, -1,
+      -1, -1, 92, -1, 93, -1, -1, 94,
+      -1, -1, -1, 95, 96, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      97, -1, -1, 98, -1, -1, -1, -1,
+      -1, -1, -1, 99, -1, -1, -1, -1,
+      -1, -1, 100, -1, 101, 102, -1, -1,
+     103, 104, 105, -1, -1, -1, 106, 107,
+     108, 109, -1, -1, 110, -1, 111, -1,
+      -1, -1, -1, 112, -1, -1, 113, -1,
+      -1, -1, 114, -1, -1, 115, -1, -1,
+     116, -1, 117, -1, 118, -1, -1, 119,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, 120, -1, -1, 121, -1, 122, -1,
+     123, 124, -1, -1, -1, 125, -1, -1,
+      -1, 126, 127, -1, -1, -1, -1, -1,
+      -1, 128, -1, 129, -1, -1, 130, -1,
+      -1, -1, 131, -1, 132, -1, 133, -1,
+      -1, -1, 134, 135, -1, -1, -1, -1,
+      -1, -1, -1, 136, -1, -1, 137, 138,
+      -1, -1, -1, -1, 139, 140, -1, -1,
+      -1, 141, 142, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, 143, -1, -1, 144,
+      -1, -1, -1, -1, -1, -1, 145, -1,
+      -1, -1, 146, -1, -1, 147, -1, -1,
+     148, -1, -1, -1, 149, -1, -1, -1,
+      -1, -1, 150, -1, -1, -1, -1, 151,
+      -1, -1, -1, -1, 152, -1, -1, -1,
+     153, 154, -1, -1, -1, 155, 156, -1,
+      -1, -1, -1, 157, -1, -1, -1, -1,
+      -1, -1, 158, -1, -1, 159, -1, 160,
+      -1, -1, 161, -1, -1, 162, 163, -1,
+      -1, 164, 165, -1, -1, -1, -1, 166,
+      -1, 167, -1, -1, -1, -1, 168, -1,
+     169, -1, -1, -1, -1, -1, -1, -1,
+     170, -1, -1, -1, 171, 172, -1, -1,
+      -1, 173, 174, -1, -1, -1, 175, -1,
+      -1, -1, -1, -1, -1, -1, 176, 177,
+      -1, -1, -1, 178, -1, -1, -1, -1,
+      -1, -1, 179, 180, 181, -1, -1, 182,
+      -1, -1, -1, -1, -1, 183, -1, -1,
+      -1, -1, -1, -1, -1, 184, 185, -1,
+      -1, -1, 186, 187, 188, -1, -1, -1,
+     189, -1, -1, -1, 190, -1, 191, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, 192, 193,
+      -1, -1, -1, -1, 194, -1, -1, -1,
+      -1, -1, -1, 195, -1, -1, -1, -1,
+      -1, -1, -1, 196, -1, -1, -1, 197,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, 198, -1, -1, 199,
+     200, 201, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, 202, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, 203, 204, -1, -1,
+      -1, -1, 205, -1, -1, -1, 206, -1,
+      -1, -1, 207, -1, -1, -1, -1, -1,
+     208, -1, -1, -1, -1, 209, -1, -1,
+      -1, -1, 210, 211, -1, -1, -1, -1,
+      -1, -1, 212, -1, -1, -1, -1, -1,
+      -1, 213, -1, -1, -1, -1, 214, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+     215, -1, -1, -1, -1, -1, -1, -1,
+      -1, 216, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, 217, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, 218, -1, -1,
+      -1, 219, 220, -1, -1, -1, 221, -1,
+      -1, 222, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, 223, -1,
+      -1, 224, -1, -1, 225, -1, -1, -1,
+      -1, -1, -1, 226, -1, -1, -1, -1,
+     227, 228, -1, -1, -1, -1, 229, -1,
+      -1, -1, -1, 230, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, 231, -1, -1,
+      -1, -1, -1, -1, -1, -1, 232, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, 233, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, 234,
+     235, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, 236,
+      -1, 237, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, 238, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, 239, 240, -1, -1, -1, 241,
+     242, 243, -1, -1, -1, 244, 245, -1,
+      -1, -1, 246, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, 247, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, 248, -1,
+     249, -1, -1, -1, 250, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, 251,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, 252, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, 253, -1, -1,
+      -1, 254, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, 255, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, 256, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, 257,
+      -1, 258, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+     259, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, 260, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, 261, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, 262, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, 263, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, 264, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, 265, -1, -1, -1, -1, 266,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, 267, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+     268, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+     269, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+     270, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, 271, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+     272, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, 273, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, 274,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, -1, -1,
+      -1, -1, -1, -1, -1, -1, 275
+  };
+
+
+__inline
+
+const struct entity *
+kde_findEntity (register const char *str, register unsigned int len)
+{
+  if (len <= 8 && len >= 2)
+    {
+      register int key = hash (str, len);
+
+      if (key <= 1886 && key >= 0)
+        {
+          register int index = lookup[key];
+
+          if (index >= 0)
+            {
+              register const char *s = wordlist[index].name;
+
+              if (*str == *s && !strncmp (str + 1, s + 1, len - 1) && s[len] == '\0')
+                return &wordlist[index];
+            }
+          else if (index < -276)
+            {
+              register int offset = - 1 - 276 - index;
+              register const struct entity *wordptr = &wordlist[276 + lookup[offset]];
+              register const struct entity *wordendptr = wordptr + -lookup[offset + 1];
+
+              while (wordptr < wordendptr)
+                {
+                  register const char *s = wordptr->name;
+
+                  if (*str == *s && !strncmp (str + 1, s + 1, len - 1) && s[len] == '\0')
+                    return wordptr;
+                  wordptr++;
+                }
+            }
+        }
+    }
+  return 0;
+}
+class QFontStylePrivate;
+struct QtFontStyle;
+struct QtFontFamily;
+struct QtFontFoundry;
+struct QFontDef;
+class QFontEngine;
+
+
+
+
+class QFontDatabasePrivate;
+
+class QFontDatabase
+{
+public:
+    static QValueList<int> standardSizes();
+
+    QFontDatabase();
+
+    QStringList families() const;
+    QStringList families( QFont::Script ) const;
+    QStringList styles( const QString & ) const;
+    QValueList<int> pointSizes( const QString &, const QString & = QString::null);
+    QValueList<int> smoothSizes( const QString &, const QString &);
+    QString styleString( const QFont &);
+
+    QFont font( const QString &, const QString &, int);
+
+    bool isBitmapScalable( const QString &, const QString & = QString::null) const;
+    bool isSmoothlyScalable( const QString &, const QString & = QString::null) const;
+    bool isScalable( const QString &, const QString & = QString::null) const;
+    bool isFixedPitch( const QString &, const QString & = QString::null) const;
+
+    bool italic( const QString &, const QString &) const;
+    bool bold( const QString &, const QString &) const;
+    int weight( const QString &, const QString &) const;
+
+    static QString scriptName(QFont::Script);
+    static QString scriptSample(QFont::Script);
+    QStringList families(bool) const;
+    QStringList styles( const QString &, const QString & ) const;
+    QValueList<int> pointSizes( const QString &, const QString &, const QString & );
+    QValueList<int> smoothSizes( const QString &, const QString &, const QString & );
+
+    QFont font( const QString &, const QString &, int, const QString &);
+
+    bool isBitmapScalable( const QString &, const QString &, const QString & ) const;
+    bool isSmoothlyScalable( const QString &, const QString &, const QString & ) const;
+    bool isScalable( const QString &, const QString &, const QString & ) const;
+    bool isFixedPitch( const QString &, const QString &, const QString & ) const;
+
+    bool italic( const QString &, const QString &, const QString & ) const;
+    bool bold( const QString &, const QString &, const QString & ) const;
+    int weight( const QString &, const QString &, const QString & ) const;
+
+
+
+private:
+
+    static QFontEngine *findFont( QFont::Script script, const QFontPrivate *fp,
+                                  const QFontDef &request, int force_encoding_id = -1 );
+
+
+    static void createDatabase();
+
+    static void parseFontName(const QString &name, QString &foundry, QString &family);
+
+    friend struct QFontDef;
+    friend class QFontPrivate;
+    friend class QFontDialog;
+    friend class QFontEngineLatinXLFD;
+
+    QFontDatabasePrivate *d;
+};
+
+
+
+
+inline QStringList QFontDatabase::families( bool ) const
+{
+    return families();
+}
+
+inline QStringList QFontDatabase::styles( const QString &family,
+                                          const QString & ) const
+{
+    return styles(family);
+}
+
+inline QValueList<int> QFontDatabase::pointSizes( const QString &family,
+                                                  const QString &style ,
+                                                  const QString & )
+{
+    return pointSizes(family, style);
+}
+
+inline QValueList<int> QFontDatabase::smoothSizes( const QString &family,
+                                                   const QString &style,
+                                                   const QString & )
+{
+    return smoothSizes(family, style);
+}
+
+inline QFont QFontDatabase::font( const QString &familyName,
+                                  const QString &style,
+                                  int pointSize,
+                                  const QString &)
+{
+    return font(familyName, style, pointSize);
+}
+
+inline bool QFontDatabase::isBitmapScalable( const QString &family,
+                                             const QString &style,
+                                             const QString & ) const
+{
+    return isBitmapScalable(family, style);
+}
+
+inline bool QFontDatabase::isSmoothlyScalable( const QString &family,
+                                               const QString &style,
+                                               const QString & ) const
+{
+    return isSmoothlyScalable(family, style);
+}
+
+inline bool QFontDatabase::isScalable( const QString &family,
+                                       const QString &style,
+                                       const QString & ) const
+{
+    return isScalable(family, style);
+}
+
+inline bool QFontDatabase::isFixedPitch( const QString &family,
+                                         const QString &style,
+                                         const QString & ) const
+{
+    return isFixedPitch(family, style);
+}
+
+inline bool QFontDatabase::italic( const QString &family,
+                                   const QString &style,
+                                   const QString & ) const
+{
+    return italic(family, style);
+}
+
+inline bool QFontDatabase::bold( const QString &family,
+                                 const QString &style,
+                                 const QString & ) const
+{
+    return bold(family, style);
+}
+
+inline int QFontDatabase::weight( const QString &family,
+                                  const QString &style,
+                                  const QString & ) const
+{
+    return weight(family, style);
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (__const char *__assertion, __const char *__file,
+                           unsigned int __line, __const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, __const char *__file,
+                                  unsigned int __line,
+                                  __const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+
+
+
+
+static const char * const language_names[] = {
+        ("Other"),
+        ("Arabic"),
+        ("Baltic"),
+        ("Central European"),
+        ("Chinese Simplified"),
+        ("Chinese Traditional"),
+        ("Cyrillic"),
+        ("Greek"),
+        ("Hebrew"),
+        ("Japanese"),
+        ("Korean"),
+        ("Thai"),
+        ("Turkish"),
+        ("Western European"),
+        ("Tamil"),
+        ("Unicode"),
+        ("Northern Saami")
+};
+static const char* const charsets_for_encoding[] = {
+    "koi8-r", "koi8-r","cp 1251","koi8-u","iso-8859-5", 0,
+    "koi8-u", "koi8-u","cp 1251","iso-8859-5","koi8-r", 0,
+    "iso 8859-1", "iso8859-1","iso8859-15", 0,
+    "iso 8859-2", "iso8859-2","unicode","iso8859-1", 0,
+    "iso 8859-3", "iso8859-3","unicode","iso8859-1", 0,
+    "iso 8859-4", "iso8859-4","unicode","iso8859-13", "iso8859-1", 0,
+    "iso 8859-5", "iso8859-5","koi8-u","koi8-r", 0,
+    "iso 8859-6", "unicode","iso8859-6", 0,
+    "iso 8859-7", "iso8859-7", 0,
+    "iso 8859-8", "iso8859-8", 0,
+    "iso 8859-8-i", "iso8859-8", 0,
+    "iso 8859-9", "iso8859-9","unicode","iso8859-1", 0,
+    "iso 8859-11", "iso8859-11", 0,
+    "iso 8859-13", "iso8859-13","unicode","iso8859-4", "iso8859-1", 0,
+    "iso 8859-15", "iso8859-15","unicode","iso8859-1", 0,
+    "utf8", "unicode","iso8859-1", 0,
+    "utf16", "unicode","iso8859-1", 0,
+    "iso-10646-ucs-2", "unicode","iso8859-1", 0,
+    "cp 1250", "iso8859-2", 0,
+    "cp 1251", "cp 1251","koi8-u","koi8-r","iso8859-5", 0,
+    "cp 1252", "iso8859-1", 0,
+    "cp 1253", "iso8859-7", 0,
+    "cp 1254", "iso8859-9", 0,
+    "cp 1255", "iso8859-8", 0,
+    "cp 1256", "unicode","iso8859-6", 0,
+    "cp 1257", "iso8859-13", "iso8859-4", 0,
+    "ibm852", "unicode","iso-8859-2", 0,
+    "tis620", "iso8859-11", 0,
+    "eucjp", "eucjp","unicode","iso8859-1", 0,
+    "sjis", "eucjp","unicode","iso8859-1", 0,
+    "jis7", "eucjp","unicode","iso8859-1", 0,
+    "big5", "big5","unicode","iso8859-1", 0,
+    "gbk", "gb2312.1980-0","gbk-0","unicode","iso8859-1", 0,
+    "gb18030", "gb18030.2000-1", "gb18030.2000-0", "unicode", "gbk-0", "gb2313.1980-0", "iso8859-1", 0,
+    "gb2312", "gb2312.1980-0","unicode","iso8859-1", 0,
+    "euckr", "euckr","unicode","iso8859-1", 0,
+    "tscii", "tscii", 0,
+    "pt 154", "pt 154","cp 1251","koi8-u","koi8-r","iso8859-5", 0,
+    "winsami2", "winsami2", "cp1252", "unicode", 0,
+    0 };
+static struct LanguageForEncoding
+    {
+    const char* index;
+    int data;
+    } const language_for_encoding[] = {
+    { "iso 8859-1", 13 },
+    { "iso 8859-15", 13 },
+    { "cp 1252", 13 },
+    { "iso 8859-2", 3 },
+    { "iso 8859-3", 3 },
+    { "iso 8859-4", 2 },
+    { "iso 8859-13", 2 },
+    { "cp 1250", 3 },
+    { "cp 1254", 12 },
+    { "cp 1257", 2 },
+    { "ibm852", 3 },
+    { "koi8-r", 6 },
+    { "iso 8859-5", 6 },
+    { "cp 1251", 6 },
+    { "koi8-u", 6 },
+    { "pt 154", 6 },
+    { "big5", 5 },
+    { "gb18030", 4 },
+    { "gbk", 4 },
+    { "gb2312", 4 },
+    { "euckr", 10 },
+    { "sjis", 9 },
+    { "jis7", 9 },
+    { "eucjp", 9 },
+    { "iso 8859-7", 7 },
+    { "cp 1253", 7 },
+    { "iso 8859-6", 1 },
+    { "cp 1256", 1 },
+    { "iso 8859-8", 8 },
+    { "iso 8859-8-i", 8 },
+    { "cp 1255", 8 },
+    { "iso 8859-9", 12 },
+    { "tis620", 11 },
+    { "iso 8859-11", 11 },
+    { "utf8", 15 },
+    { "utf16", 15 },
+    { "utf7", 15 },
+    { "ucs2", 15 },
+    { "iso-10646-ucs-2", 15 },
+    { "winsami2", 16},
+    { 0, 0 } };
+
+
+static struct Builtin
+    {
+    const char* index;
+    const char* data;
+    } const builtin[] = {
+    { "iso-ir-111", "koi8-r" },
+    { "koi8-ru", "koi8-u" },
+    { "koi8r", "koi8-r" },
+    { "koi8u", "koi8-u" },
+    { "koi unified", "koi8-r" },
+    { "us-ascii", "iso 8859-1" },
+    { "usascii", "iso 8859-1" },
+    { "x-utf-8", "utf-8" },
+    { "x-utf-7", "utf-7" },
+    { "unicode-1-1-utf-7", "utf-7" },
+    { "ucs2", "iso-10646-ucs-2" },
+    { "iso10646-1", "iso-10646-ucs-2" },
+    { "gb18030.2000-1", "gb18030" },
+    { "gb18030.2000-0", "gb18030" },
+    { "gbk-0", "gbk" },
+    { "gb2312", "gbk" },
+    { "gb2312.1980-0", "gbk" },
+    { "big5-0", "big5" },
+    { "euc-kr", "euckr" },
+    { "x-euc-kr", "euckr" },
+    { "euc-jp", "eucjp" },
+    { "x-euc-jp", "eucjp" },
+    { "jisx0201.1976-0", "eucjp" },
+    { "jisx0208.1983-0", "eucjp" },
+    { "jisx0208.1990-0", "eucjp" },
+    { "jisx0208.1997-0", "eucjp" },
+    { "jisx0212.1990-0", "eucjp" },
+    { "jisx0213.2000-1", "eucjp" },
+    { "jisx0213.2000-2", "eucjp" },
+    { "shift_jis", "sjis" },
+    { "shift-jis", "sjis" },
+    { "x-sjis", "sjis" },
+    { "iso-2022-jp", "jis7" },
+    { "windows1250", "cp 1250" },
+    { "windows1251", "cp 1251" },
+    { "windows1252", "cp 1252" },
+    { "windows1253", "cp 1253" },
+    { "windows1254", "cp 1254" },
+    { "windows1255", "cp 1255" },
+    { "windows1256", "cp 1256" },
+    { "windows1257", "cp 1257" },
+    { "windows-1250", "cp 1250" },
+    { "windows-1251", "cp 1251" },
+    { "windows-1252", "cp 1252" },
+    { "windows-1253", "cp 1253" },
+    { "windows-1254", "cp 1254" },
+    { "windows-1255", "cp 1255" },
+    { "windows-1256", "cp 1256" },
+    { "windows-1257", "cp 1257" },
+    { "x-windows-1250", "cp 1250" },
+    { "x-windows-1251", "cp 1251" },
+    { "x-windows-1252", "cp 1252" },
+    { "x-windows-1253", "cp 1253" },
+    { "x-windows-1254", "cp 1254" },
+    { "x-windows-1255", "cp 1255" },
+    { "x-windows-1256", "cp 1256" },
+    { "x-windows-1257", "cp 1257" },
+    { "cp-1250", "cp 1250" },
+    { "cp-1251", "cp 1251" },
+    { "cp-1252", "cp 1252" },
+    { "cp-1253", "cp 1253" },
+    { "cp-1254", "cp 1254" },
+    { "cp-1255", "cp 1255" },
+    { "cp-1256", "cp 1256" },
+    { "cp-1257", "cp 1257" },
+    { "x-cp-1250", "cp 1250" },
+    { "x-cp-1251", "cp 1251" },
+    { "x-cp-1252", "cp 1252" },
+    { "x-cp-1253", "cp 1253" },
+    { "x-cp-1254", "cp 1254" },
+    { "x-cp-1255", "cp 1255" },
+    { "x-cp-1256", "cp 1256" },
+    { "x-cp-1257", "cp 1257" },
+    { "tis620", "iso 8859-11" },
+    { "tis-620", "iso 8859-11" },
+    { "thai-tis620", "iso 8859-11" },
+    { "windows-874", "iso 8859-11" },
+    { "windows874", "iso 8859-11" },
+    { "x-windows-874", "iso 8859-11" },
+    { "cp874", "iso 8859-11" },
+    { "cp-874", "iso 8859-11" },
+    { "x-cp-874", "iso 8859-11" },
+    { "ksc5601.1987-0", "euckr" },
+    { "ks_c_5601-1987", "euckr" },
+    { "iso-8859-1", "iso 8859-1" },
+    { "iso-8859-2", "iso 8859-2" },
+    { "iso-8859-3", "iso 8859-3" },
+    { "iso-8859-4", "iso 8859-4" },
+    { "iso-8859-5", "iso 8859-5" },
+    { "iso-8859-6", "iso 8859-6" },
+    { "iso-8859-7", "iso 8859-7" },
+    { "iso-8859-8", "iso 8859-8" },
+    { "iso-8859-9", "iso 8859-9" },
+    { "iso-8859-10", "iso 8859-10" },
+    { "iso-8859-11", "iso 8859-11" },
+    { "iso-8859-12", "iso 8859-12" },
+    { "iso-8859-13", "iso 8859-13" },
+    { "iso-8859-14", "iso 8859-14" },
+    { "iso-8859-15", "iso 8859-15" },
+    { "tscii", "tscii" },
+    { "paratype-154", "pt 154" },
+    { "pt-154", "pt 154" },
+    { "x-winsami2", "winsami2" },
+    { 0, 0 }};
+
+
+
+static struct Aliases
+    {
+    const char* index;
+    const char* data;
+    } const aliases[] = {
+    { "cp852", "ibm852" },
+    { 0, 0 }};
+
+
+
+
+static struct ConversionHints
+    {
+    const char* index;
+    const char* data;
+    } const conversion_hints[] = {
+    { "cp1250", "iso-8859-2" },
+    { "koi8-r", "iso-8859-5" },
+    { "koi8-u", "koi8-r" },
+    { "utf16", "iso-10646-ucs-2" },
+    { 0, 0 }};
+
+
+
+
+template< typename T, typename Data >
+static Data kcharsets_array_search( const T* start, const char* entry )
+{
+    for( const T* pos = start;
+         pos->index != 0;
+         ++pos )
+        if( qstrcmp( pos->index, entry ) == 0 )
+            return pos->data;
+    return 0;
+}
+
+
+class KCharsetsPrivate
+{
+public:
+    KCharsetsPrivate(KCharsets* _kc)
+        : codecForNameDict(43, false)
+    {
+        db = 0;
+        kc = _kc;
+    }
+    ~KCharsetsPrivate()
+    {
+        delete db;
+    }
+    QFontDatabase *db;
+    QAsciiDict<QTextCodec> codecForNameDict;
+    KCharsets* kc;
+};
+
+
+
+KCharsets::KCharsets()
+{
+    d = new KCharsetsPrivate(this);
+}
+
+KCharsets::~KCharsets()
+{
+    delete d;
+}
+
+QChar KCharsets::fromEntity(const QString &str)
+{
+    QChar res = QChar::null;
+
+    int pos = 0;
+    if(str[pos] == '&') pos++;
+
+
+    if (str[pos] == '#' && str.length()-pos > 1) {
+        bool ok;
+        pos++;
+        if (str[pos] == 'x' || str[pos] == 'X') {
+            pos++;
+
+            QString tmp(str.unicode()+pos, str.length()-pos);
+            res = tmp.toInt(&ok, 16);
+        } else {
+
+            QString tmp(str.unicode()+pos, str.length()-pos);
+            res = tmp.toInt(&ok, 10);
+        }
+        return res;
+    }
+
+    const entity *e = kde_findEntity(str.ascii(), str.length());
+
+    if(!e)
+    {
+
+        return QChar::null;
+    }
+
+
+    return QChar(e->code);
+}
+
+QChar KCharsets::fromEntity(const QString &str, int &len)
+{
+
+
+    len = 8;
+    while(len > 0)
+    {
+        QString tmp = str.left(len);
+        QChar res = fromEntity(tmp);
+        if( res != QChar::null ) return res;
+        len--;
+    }
+    return QChar::null;
+}
+
+
+QString KCharsets::toEntity(const QChar &ch)
+{
+    QString ent;
+    ent.sprintf("&#0x%x;", ch.unicode());
+    return ent;
+}
+
+QString KCharsets::resolveEntities( const QString &input )
+{
+    QString text = input;
+    const QChar *p = text.unicode();
+    const QChar *end = p + text.length();
+    const QChar *ampersand = 0;
+    bool scanForSemicolon = false;
+
+    for ( ; p < end; ++p ) {
+        const QChar ch = *p;
+
+        if ( ch == '&' ) {
+            ampersand = p;
+            scanForSemicolon = true;
+            continue;
+        }
+
+        if ( ch != ';' || scanForSemicolon == false )
+            continue;
+
+        (static_cast<void> ((ampersand) ? 0 : (__assert_fail ("ampersand", "/coolo/prod/kdelibs/kdecore/kcharsets.cpp", 435, __PRETTY_FUNCTION__), 0)));
+
+        scanForSemicolon = false;
+
+        const QChar *entityBegin = ampersand + 1;
+
+        const uint entityLength = p - entityBegin;
+        if ( entityLength == 0 )
+            continue;
+
+        const QChar entityValue = KCharsets::fromEntity( QConstString( entityBegin, entityLength ).string() );
+        if ( entityValue.isNull() )
+            continue;
+
+        const uint ampersandPos = ampersand - text.unicode();
+
+        text[ ampersandPos ] = entityValue;
+        text.remove( ampersandPos + 1, entityLength + 1 );
+        p = text.unicode() + ampersandPos;
+        end = text.unicode() + text.length();
+        ampersand = 0;
+    }
+
+    return text;
+}
+
+QStringList KCharsets::availableEncodingNames()
+{
+    QStringList available;
+
+    const char* const* pos = charsets_for_encoding;
+    while( *pos != 0 ) {
+
+
+
+
+        for( const char* const* charsets = pos + 1;
+             *charsets != 0;
+             ++charsets ) {
+
+
+
+
+            if( true ) {
+
+                available.append( QString::fromLatin1( *pos ));
+                break;
+            }
+        }
+        while( *pos != 0 )
+            ++pos;
+        ++pos;
+    }
+    return available;
+}
+
+QString KCharsets::languageForEncoding( const QString &encoding )
+{
+    int lang = kcharsets_array_search< LanguageForEncoding, int >
+        ( language_for_encoding, encoding.latin1());
+    return i18n( language_names[lang] );
+}
+
+QString KCharsets::encodingForName( const QString &descriptiveName )
+{
+    const int left = descriptiveName.find( '(' );
+
+    if (left<0)
+        return descriptiveName;
+
+    QString name(descriptiveName.mid(left+2));
+
+    const int right = name.find( ')' );
+
+    if (right<0)
+        return name;
+
+    return name.left(right-1);
+}
+
+QStringList KCharsets::descriptiveEncodingNames()
+{
+  QStringList encodings = availableEncodingNames();
+  QStringList::Iterator it;
+  for( it = encodings.begin(); it != encodings.end(); ++it ) {
+      QString lang = KGlobal::charsets()->languageForEncoding( *it );
+      *it = i18n("Descriptive Encoding Name", "%1 ( %2 )") .arg(lang) .arg(*it);
+  }
+  encodings.sort();
+  return encodings;
+}
+
+QTextCodec *KCharsets::codecForName(const QString &n) const
+{
+    bool b;
+    return codecForName( n, b );
+}
+
+QTextCodec *KCharsets::codecForName(const QString &n, bool &ok) const
+{
+    ok = true;
+
+    QTextCodec* codec = 0;
+
+    if((codec = d->codecForNameDict[n.isEmpty() ? "->locale<-" : n.latin1()]))
+        return codec;
+
+    if (n.isEmpty()) {
+        codec = KGlobal::locale()->codecForEncoding();
+        d->codecForNameDict.replace("->locale<-", codec);
+        return codec;
+    }
+
+    QCString name = n.lower().latin1();
+    QCString key = name;
+    if (name.right(8) == "_charset")
+       name.truncate(name.length()-8);
+
+    if (name.isEmpty()) {
+      ok = false;
+      return QTextCodec::codecForName("iso8859-1");
+    }
+
+    codec = QTextCodec::codecForName(name);
+
+    if(codec) {
+        d->codecForNameDict.replace(key, codec);
+        return codec;
+    }
+
+
+
+    QCString cname = kcharsets_array_search< Builtin, const char* >( builtin, name.data());
+
+    if(!cname.isEmpty())
+        codec = QTextCodec::codecForName(cname);
+
+    if(codec)
+    {
+        d->codecForNameDict.replace(key, codec);
+        return codec;
+    }
+
+    QString dir;
+    {
+    KConfigGroupSaver cfgsav( KGlobal::config(), "i18n" );
+    dir = KGlobal::config()->readPathEntry("i18ndir", QString::fromLatin1("/usr/share/i18n/charmaps"));
+    dir += "/";
+    }
+
+
+
+    cname = kcharsets_array_search< Aliases, const char* >( aliases, name.data());
+
+    if(cname.isEmpty())
+        cname = name;
+    cname = cname.upper();
+
+    codec = QTextCodec::loadCharmapFile((QString)(dir + cname.data()));
+
+    if(codec) {
+        d->codecForNameDict.replace(key, codec);
+        return codec;
+    }
+
+
+
+    cname = cname.lower();
+    cname = kcharsets_array_search< ConversionHints, const char* >( conversion_hints, (const char*)cname );
+
+    if(!cname.isEmpty())
+        codec = QTextCodec::codecForName(cname);
+
+    if(codec) {
+        d->codecForNameDict.replace(key, codec);
+        return codec;
+    }
+
+
+    ok = false;
+    return QTextCodec::codecForName("iso8859-1");
+}
+
+
+
+
+
+
+
+
+typedef struct {
+        const char *name;
+        int code;
+} KKeys;
+
+extern const KKeys kde_KKEYS[278];
+
+const KKeys kde_KKEYS[278] = {
+        { "Escape", 0x1000 },
+        { "Tab", 0x1001 },
+        { "Backtab", 0x1002 },
+        { "Backspace", 0x1003 },
+        { "Return", 0x1004 },
+        { "Enter", 0x1005 },
+        { "Insert", 0x1006 },
+        { "Delete", 0x1007 },
+        { "Pause", 0x1008 },
+        { "Print", 0x1009 },
+        { "SysReq", 0x100a },
+        { "Clear", 0x100b },
+        { "Home", 0x1010 },
+        { "End", 0x1011 },
+        { "Left", 0x1012 },
+        { "Up", 0x1013 },
+        { "Right", 0x1014 },
+        { "Down", 0x1015 },
+        { "Prior", 0x1016 },
+        { "Next", 0x1017 },
+        { "Shift", 0x1020 },
+        { "Control", 0x1021 },
+        { "Meta", 0x1022 },
+        { "Alt", 0x1023 },
+        { "CapsLock", 0x1024 },
+        { "NumLock", 0x1025 },
+        { "ScrollLock", 0x1026 },
+        { "F1", 0x1030 },
+        { "F2", 0x1031 },
+        { "F3", 0x1032 },
+        { "F4", 0x1033 },
+        { "F5", 0x1034 },
+        { "F6", 0x1035 },
+        { "F7", 0x1036 },
+        { "F8", 0x1037 },
+        { "F9", 0x1038 },
+        { "F10", 0x1039 },
+        { "F11", 0x103a },
+        { "F12", 0x103b },
+        { "F13", 0x103c },
+        { "F14", 0x103d },
+        { "F15", 0x103e },
+        { "F16", 0x103f },
+        { "F17", 0x1040 },
+        { "F18", 0x1041 },
+        { "F19", 0x1042 },
+        { "F20", 0x1043 },
+        { "F21", 0x1044 },
+        { "F22", 0x1045 },
+        { "F23", 0x1046 },
+        { "F24", 0x1047 },
+        { "F25", 0x1048 },
+        { "F26", 0x1049 },
+        { "F27", 0x104a },
+        { "F28", 0x104b },
+        { "F29", 0x104c },
+        { "F30", 0x104d },
+        { "F31", 0x104e },
+        { "F32", 0x104f },
+        { "F33", 0x1050 },
+        { "F34", 0x1051 },
+        { "F35", 0x1052 },
+        { "Super_L", 0x1053 },
+        { "Super_R", 0x1054 },
+        { "Menu", 0x1055 },
+        { "Hyper_L", 0x1056 },
+        { "Hyper_R", 0x1057 },
+        { "Help", 0x1058 },
+        { "Direction_L", 0x1059 },
+        { "Direction_R", 0x1060 },
+        { "Space", 0x20 },
+        { "Any", Qt::Key_Space },
+        { "Exclam", 0x21 },
+        { "QuoteDbl", 0x22 },
+        { "NumberSign", 0x23 },
+        { "Dollar", 0x24 },
+        { "Percent", 0x25 },
+        { "Ampersand", 0x26 },
+        { "Apostrophe", 0x27 },
+        { "ParenLeft", 0x28 },
+        { "ParenRight", 0x29 },
+        { "Asterisk", 0x2a },
+        { "Plus", 0x2b },
+        { "Comma", 0x2c },
+        { "Minus", 0x2d },
+        { "Period", 0x2e },
+        { "Slash", 0x2f },
+        { "0", 0x30 },
+        { "1", 0x31 },
+        { "2", 0x32 },
+        { "3", 0x33 },
+        { "4", 0x34 },
+        { "5", 0x35 },
+        { "6", 0x36 },
+        { "7", 0x37 },
+        { "8", 0x38 },
+        { "9", 0x39 },
+        { "Colon", 0x3a },
+        { "Semicolon", 0x3b },
+        { "Less", 0x3c },
+        { "Equal", 0x3d },
+        { "Greater", 0x3e },
+        { "Question", 0x3f },
+        { "At", 0x40 },
+        { "A", 0x41 },
+        { "B", 0x42 },
+        { "C", 0x43 },
+        { "D", 0x44 },
+        { "E", 0x45 },
+        { "F", 0x46 },
+        { "G", 0x47 },
+        { "H", 0x48 },
+        { "I", 0x49 },
+        { "J", 0x4a },
+        { "K", 0x4b },
+        { "L", 0x4c },
+        { "M", 0x4d },
+        { "N", 0x4e },
+        { "O", 0x4f },
+        { "P", 0x50 },
+        { "Q", 0x51 },
+        { "R", 0x52 },
+        { "S", 0x53 },
+        { "T", 0x54 },
+        { "U", 0x55 },
+        { "V", 0x56 },
+        { "W", 0x57 },
+        { "X", 0x58 },
+        { "Y", 0x59 },
+        { "Z", 0x5a },
+        { "BracketLeft", 0x5b },
+        { "Backslash", 0x5c },
+        { "BracketRight", 0x5d },
+        { "AsciiCircum", 0x5e },
+        { "Underscore", 0x5f },
+        { "QuoteLeft", 0x60 },
+        { "BraceLeft", 0x7b },
+        { "Bar", 0x7c },
+        { "BraceRight", 0x7d },
+        { "AsciiTilde", 0x7e },
+        { "nobreakspace", 0x0a0 },
+        { "exclamdown", 0x0a1 },
+        { "cent", 0x0a2 },
+        { "sterling", 0x0a3 },
+        { "currency", 0x0a4 },
+        { "yen", 0x0a5 },
+        { "brokenbar", 0x0a6 },
+        { "section", 0x0a7 },
+        { "diaeresis", 0x0a8 },
+        { "copyright", 0x0a9 },
+        { "ordfeminine", 0x0aa },
+        { "guillemotleft", 0x0ab },
+        { "notsign", 0x0ac },
+        { "hyphen", 0x0ad },
+        { "registered", 0x0ae },
+        { "macron", 0x0af },
+        { "degree", 0x0b0 },
+        { "plusminus", 0x0b1 },
+        { "twosuperior", 0x0b2 },
+        { "threesuperior", 0x0b3 },
+        { "acute", 0x0b4 },
+        { "mu", 0x0b5 },
+        { "paragraph", 0x0b6 },
+        { "periodcentered", 0x0b7 },
+        { "cedilla", 0x0b8 },
+        { "onesuperior", 0x0b9 },
+        { "masculine", 0x0ba },
+        { "guillemotright", 0x0bb },
+        { "onequarter", 0x0bc },
+        { "onehalf", 0x0bd },
+        { "threequarters", 0x0be },
+        { "questiondown", 0x0bf },
+        { "Agrave", 0x0c0 },
+        { "Aacute", 0x0c1 },
+        { "Acircumflex", 0x0c2 },
+        { "Atilde", 0x0c3 },
+        { "Adiaeresis", 0x0c4 },
+        { "Aring", 0x0c5 },
+        { "AE", 0x0c6 },
+        { "Ccedilla", 0x0c7 },
+        { "Egrave", 0x0c8 },
+        { "Eacute", 0x0c9 },
+        { "Ecircumflex", 0x0ca },
+        { "Ediaeresis", 0x0cb },
+        { "Igrave", 0x0cc },
+        { "Iacute", 0x0cd },
+        { "Icircumflex", 0x0ce },
+        { "Idiaeresis", 0x0cf },
+        { "ETH", 0x0d0 },
+        { "Ntilde", 0x0d1 },
+        { "Ograve", 0x0d2 },
+        { "Oacute", 0x0d3 },
+        { "Ocircumflex", 0x0d4 },
+        { "Otilde", 0x0d5 },
+        { "Odiaeresis", 0x0d6 },
+        { "multiply", 0x0d7 },
+        { "Ooblique", 0x0d8 },
+        { "Ugrave", 0x0d9 },
+        { "Uacute", 0x0da },
+        { "Ucircumflex", 0x0db },
+        { "Udiaeresis", 0x0dc },
+        { "Yacute", 0x0dd },
+        { "THORN", 0x0de },
+        { "ssharp", 0x0df },
+        { "agrave", 0x0e0 },
+        { "aacute", 0x0e1 },
+        { "acircumflex", 0x0e2 },
+        { "atilde", 0x0e3 },
+        { "adiaeresis", 0x0e4 },
+        { "aring", 0x0e5 },
+        { "ae", 0x0e6 },
+        { "ccedilla", 0x0e7 },
+        { "egrave", 0x0e8 },
+        { "eacute", 0x0e9 },
+        { "ecircumflex", 0x0ea },
+        { "ediaeresis", 0x0eb },
+        { "igrave", 0x0ec },
+        { "iacute", 0x0ed },
+        { "icircumflex", 0x0ee },
+        { "idiaeresis", 0x0ef },
+        { "eth", 0x0f0 },
+        { "ntilde", 0x0f1 },
+        { "ograve", 0x0f2 },
+        { "oacute", 0x0f3 },
+        { "ocircumflex", 0x0f4 },
+        { "otilde", 0x0f5 },
+        { "odiaeresis", 0x0f6 },
+        { "division", 0x0f7 },
+        { "oslash", 0x0f8 },
+        { "ugrave", 0x0f9 },
+        { "uacute", 0x0fa },
+        { "ucircumflex", 0x0fb },
+        { "udiaeresis", 0x0fc },
+        { "yacute", 0x0fd },
+        { "thorn", 0x0fe },
+        { "ydiaeresis", 0x0ff },
+        { "Back ", 0x1061 },
+        { "Forward ", 0x1062 },
+        { "Stop ", 0x1063 },
+        { "Refresh ", 0x1064 },
+        { "VolumeDown", 0x1070 },
+        { "VolumeMute ", 0x1071 },
+        { "VolumeUp", 0x1072 },
+        { "BassBoost", 0x1073 },
+        { "BassUp", 0x1074 },
+        { "BassDown", 0x1075 },
+        { "TrebleUp", 0x1076 },
+        { "TrebleDown", 0x1077 },
+        { "MediaPlay ", 0x1080 },
+        { "MediaStop ", 0x1081 },
+        { "MediaPrev ", 0x1082 },
+        { "MediaNext ", 0x1083 },
+        { "MediaRecord", 0x1084 },
+        { "HomePage ", 0x1090 },
+        { "Favorites ", 0x1091 },
+        { "Search ", 0x1092 },
+        { "Standby", 0x1093 },
+        { "OpenUrl", 0x1094 },
+        { "LaunchMail ", 0x10a0 },
+        { "LaunchMedia", 0x10a1 },
+        { "Launch0 ", 0x10a2 },
+        { "Launch1 ", 0x10a3 },
+        { "Launch2 ", 0x10a4 },
+        { "Launch3 ", 0x10a5 },
+        { "Launch4 ", 0x10a6 },
+        { "Launch5 ", 0x10a7 },
+        { "Launch6 ", 0x10a8 },
+        { "Launch7 ", 0x10a9 },
+        { "Launch8 ", 0x10aa },
+        { "Launch9 ", 0x10ab },
+        { "LaunchA ", 0x10ac },
+        { "LaunchB ", 0x10ad },
+        { "LaunchC ", 0x10ae },
+        { "LaunchD ", 0x10af },
+        { "LaunchE ", 0x10b0 },
+        { "LaunchF ", 0x10b1 },
+        { "MediaLast", 0x1fff },
+        { "unknown", 0xffff }
+};
+
+
+
+
+typedef union _XEvent XEvent;
+
+
+class KKeyNativePrivate;
+
+
+
+
+class KKeyNative
+{
+ public:
+
+
+
+
+
+
+        KKeyNative();
+
+
+
+
+
+
+        KKeyNative( const XEvent* xevent );
+
+
+
+
+
+
+        KKeyNative( const KKey& key );
+
+
+
+
+        KKeyNative( const KKeyNative& );
+
+
+
+
+        KKeyNative( uint code, uint mod, uint sym );
+        ~KKeyNative();
+
+
+
+
+
+        void clear();
+
+
+
+
+
+
+
+        bool init( const XEvent* xevent );
+
+
+
+
+
+
+        bool init( const KKey& key );
+
+
+
+
+
+
+        bool init( const KKeyNative& key );
+
+
+
+
+
+
+        KKeyNative& operator =( const KKeyNative& key )
+                { init( key ); return *this; }
+
+
+
+
+
+
+
+        int keyCodeQt() const;
+
+
+
+
+
+        KKey key() const;
+
+
+
+
+
+
+        operator KKey() const { return key(); }
+
+
+
+
+
+        uint code() const;
+
+
+
+
+
+        uint mod() const;
+
+
+
+
+
+        uint sym() const;
+        bool isNull() const;
+        int compare( const KKeyNative& key ) const;
+
+
+
+
+
+        bool operator == ( const KKeyNative& key ) const
+                { return compare( key ) == 0; }
+
+
+
+
+
+        bool operator != ( const KKeyNative& key ) const
+                { return compare( key ) != 0; }
+
+
+
+
+
+        bool operator < ( const KKeyNative& key ) const
+                { return compare( key ) < 0; }
+
+
+
+
+
+
+
+        static KKeyNative& null();
+
+
+
+
+
+
+        static bool keyboardHasWinKey();
+
+
+
+
+
+
+        static uint modX( KKey::ModFlag modFlag );
+
+
+
+
+
+
+        static uint accelModMaskX();
+
+
+
+
+
+
+        static uint modXNumLock();
+
+
+
+
+
+
+        static uint modXLock();
+
+
+
+
+
+
+        static uint modXScrollLock();
+
+ private:
+        uint m_code, m_mod, m_sym;
+        KKeyNativePrivate* d;
+};
+
+
+namespace KKeyServer
+{
+
+
+
+
+        enum ExtraModFlag { MODE_SWITCH = 0x2000 };
+
+
+
+
+
+
+        struct Sym
+        {
+         public:
+
+                uint m_sym;
+
+
+                Sym()
+                        { m_sym = 0; }
+
+
+
+
+                Sym( uint sym )
+                        { m_sym = sym; }
+
+
+
+
+
+                Sym( const QString& s )
+                        { init( s ); }
+
+
+
+
+
+
+
+                bool initQt( int keyQt );
+
+
+
+
+
+
+
+                bool init( const QString &s );
+
+
+
+
+
+                int qt() const;
+
+
+
+
+                QString toStringInternal() const;
+
+
+
+
+
+                QString toString() const;
+                uint getModsRequired() const;
+
+
+
+
+                uint getSymVariation() const;
+
+
+
+
+                operator uint() const { return m_sym; }
+
+
+
+
+                Sym& operator =( uint sym ) { m_sym = sym; return *this; }
+
+         private:
+                QString toString( bool bUserSpace ) const;
+
+                static void capitalizeKeyname( QString& );
+        };
+
+
+
+
+
+        struct Key
+        {
+
+                enum { CODE_FOR_QT = 256 };
+
+
+                uint m_code;
+
+
+                uint m_mod;
+
+
+                uint m_sym;
+                bool init( const KKey& key, bool bQt );
+                bool isNative() const { return m_code != CODE_FOR_QT; }
+
+
+
+
+
+                uint code() const { return m_code; }
+
+
+
+
+
+                uint mod() const { return m_mod; }
+
+
+
+
+
+                uint sym() const { return m_sym; }
+
+
+
+
+
+                int keyCodeQt() const { return (int) m_sym; }
+
+
+
+
+
+                void setKeycodeQt( int keyQt )
+                        { m_code = CODE_FOR_QT; m_sym = keyQt; }
+
+
+
+
+
+                Key& operator =( const KKeyNative& key );
+                int compare( const Key& key ) const;
+
+
+
+
+
+                bool operator ==( const Key& b ) const
+                        { return compare( b ) == 0; }
+
+
+
+
+
+                bool operator <( const Key& b ) const
+                        { return compare( b ) < 0; }
+
+
+
+
+
+                KKey key() const;
+        };
+
+
+
+
+        struct Variations
+        {
+                enum { MAX_VARIATIONS = 4 };
+
+                Key m_rgkey[MAX_VARIATIONS];
+                uint m_nVariations;
+
+                Variations() { m_nVariations = 0; }
+
+                void init( const KKey&, bool bQt );
+
+                uint count() const { return m_nVariations; }
+                const Key& key( uint i ) const { return m_rgkey[i]; }
+        };
+
+
+        bool initializeMods();
+
+
+
+
+
+
+        uint modX( KKey::ModFlag modFlag );
+
+
+
+
+
+
+
+        bool keyboardHasWinKey();
+
+
+
+
+
+
+        uint modXShift();
+
+
+
+
+
+
+        uint modXLock();
+
+
+
+
+
+
+        uint modXCtrl();
+
+
+
+
+
+
+        uint modXAlt();
+
+
+
+
+
+
+        uint modXNumLock();
+
+
+
+
+
+
+
+        uint modXWin();
+
+
+
+
+
+
+        uint modXScrollLock();
+        uint accelModMaskX();
+        bool keyQtToSym( int keyQt, uint& sym );
+        bool keyQtToMod( int keyQt, uint& mod );
+        bool symToKeyQt( uint sym, int& keyQt );
+        bool modToModQt( uint mod, int& modQt );
+        bool modToModX( uint mod, uint& modX );
+        bool modXToModQt( uint modX, int& modQt );
+        bool modXToMod( uint modX, uint& mod );
+        bool codeXToSym( uchar codeX, uint modX, uint& symX );
+
+
+
+
+        QString modToStringInternal( uint mod );
+
+
+
+
+
+
+
+        QString modToStringUser( uint mod );
+
+
+
+
+
+        bool stringToSymMod( const QString&, uint& sym, uint& mod );
+
+
+
+
+
+        void keyQtToKeyX( uint keyCombQt, unsigned char *pKeyCodeX, uint *pKeySymX, uint *pKeyModX );
+}
+static KKey* g_pspec = 0;
+static KKeySequence* g_pseq = 0;
+static KShortcut* g_pcut = 0;
+
+
+
+
+
+KKey::KKey() { clear(); }
+KKey::KKey( uint key, uint modFlags ) { init( key, modFlags ); }
+KKey::KKey( int keyQt ) { init( keyQt ); }
+KKey::KKey( const QKeySequence& seq ) { init( seq ); }
+KKey::KKey( const QKeyEvent* pEvent ) { init( pEvent ); }
+KKey::KKey( const KKey& key ) { init( key ); }
+KKey::KKey( const QString& sKey ) { init( sKey ); }
+
+KKey::~KKey()
+{
+}
+
+void KKey::clear()
+{
+        m_sym = 0;
+        m_mod = 0;
+}
+
+bool KKey::init( uint key, uint modFlags )
+{
+        m_sym = key;
+        m_mod = modFlags;
+        return true;
+}
+
+bool KKey::init( int keyQt )
+{
+
+
+
+        if( KKeyServer::keyQtToSym( keyQt, m_sym )
+            && KKeyServer::keyQtToMod( keyQt, m_mod ) )
+                return true;
+        else {
+                m_sym = 0;
+                m_mod = 0;
+                return false;
+        }
+}
+
+bool KKey::init( const QKeySequence& key )
+{
+
+        return init( (int) key );
+}
+
+bool KKey::init( const QKeyEvent* pEvent )
+{
+        int keyQt = pEvent->key();
+        if( pEvent->state() & Qt::ShiftButton ) keyQt |= Qt::SHIFT;
+        if( pEvent->state() & Qt::ControlButton ) keyQt |= Qt::CTRL;
+        if( pEvent->state() & Qt::AltButton ) keyQt |= Qt::ALT;
+        return init( keyQt );
+}
+
+bool KKey::init( const KKey& key )
+{
+        m_sym = key.m_sym;
+        m_mod = key.m_mod;
+        return true;
+}
+
+bool KKey::init( const QString& sSpec )
+{
+        clear();
+
+        QString sKey = sSpec.stripWhiteSpace();
+        if( sKey.startsWith( "default(" ) && sKey.endsWith( ")" ) )
+                sKey = sKey.mid( 8, sKey.length() - 9 );
+
+        if( sKey.endsWith( "++" ) )
+                sKey = sKey.left( sKey.length() - 1 ) + "plus";
+        QStringList rgs = QStringList::split( '+', sKey, true );
+
+        uint i;
+
+        for( i = 0; i < rgs.size(); i++ ) {
+                QString s = rgs[i].lower();
+                if( s == "shift" ) m_mod |= KKey::SHIFT;
+                else if( s == "ctrl" ) m_mod |= KKey::CTRL;
+                else if( s == "alt" ) m_mod |= KKey::ALT;
+                else if( s == "win" ) m_mod |= KKey::WIN;
+                else if( s == "meta" ) m_mod |= KKey::WIN;
+                else break;
+        }
+
+        if( (i == rgs.size() - 1 && !rgs[i].isEmpty()) ) {
+                KKeyServer::Sym sym( rgs[i] );
+                m_sym = sym.m_sym;
+        }
+
+        if( m_sym == 0 )
+                m_mod = 0;
+
+        kdDebug(125) << "KKey::init( \"" << sSpec << "\" ):"
+                << " m_sym = " << QString::number(m_sym, 16)
+                << ", m_mod = " << QString::number(m_mod, 16) << endl;
+
+        return m_sym != 0;
+}
+
+bool KKey::isNull() const { return m_sym == 0; }
+uint KKey::sym() const { return m_sym; }
+uint KKey::modFlags() const { return m_mod; }
+
+int KKey::compare( const KKey& spec ) const
+{
+        if( m_sym != spec.m_sym )
+                return m_sym - spec.m_sym;
+        if( m_mod != spec.m_mod )
+                return m_mod - spec.m_mod;
+        return 0;
+}
+
+int KKey::keyCodeQt() const
+{
+        return KKeyNative( *this ).keyCodeQt();
+}
+
+QString KKey::toString() const
+{
+        QString s;
+
+        s = KKeyServer::modToStringUser( m_mod );
+        if( !s.isEmpty() )
+                s += '+';
+        s += KKeyServer::Sym(m_sym).toString();
+
+        return s;
+}
+
+QString KKey::toStringInternal() const
+{
+
+
+
+        QString s;
+
+        s = KKeyServer::modToStringInternal( m_mod );
+        if( !s.isEmpty() )
+                s += '+';
+        s += KKeyServer::Sym(m_sym).toStringInternal();
+        return s;
+}
+
+KKey& KKey::null()
+{
+        if( !g_pspec )
+                g_pspec = new KKey;
+        if( !g_pspec->isNull() )
+                g_pspec->clear();
+        return *g_pspec;
+}
+
+QString KKey::modFlagLabel( ModFlag modFlag )
+{
+        return KKeyServer::modToStringUser( modFlag );
+}
+
+
+
+
+
+KKeySequence::KKeySequence() { clear(); }
+KKeySequence::KKeySequence( const QKeySequence& seq ) { init( seq ); }
+KKeySequence::KKeySequence( const KKey& key ) { init( key ); }
+KKeySequence::KKeySequence( const KKeySequence& seq ) { init( seq ); }
+KKeySequence::KKeySequence( const QString& s ) { init( s ); }
+
+KKeySequence::~KKeySequence()
+{
+}
+
+void KKeySequence::clear()
+{
+        m_nKeys = 0;
+        m_bTriggerOnRelease = false;
+}
+
+bool KKeySequence::init( const QKeySequence& seq )
+{
+        clear();
+
+        if( !seq.isEmpty() ) {
+                for( uint i = 0; i < seq.count(); i++ ) {
+                        m_rgvar[i].init( seq[i] );
+                        if( m_rgvar[i].isNull() )
+                                return false;
+                }
+                m_nKeys = seq.count();
+                m_bTriggerOnRelease = false;
+        }
+        return true;
+}
+
+bool KKeySequence::init( const KKey& key )
+{
+        if( !key.isNull() ) {
+                m_nKeys = 1;
+                m_rgvar[0].init( key );
+                m_bTriggerOnRelease = false;
+        } else
+                clear();
+        return true;
+}
+
+bool KKeySequence::init( const KKeySequence& seq )
+{
+        m_bTriggerOnRelease = false;
+        m_nKeys = seq.m_nKeys;
+        for( uint i = 0; i < m_nKeys; i++ ) {
+                if( seq.m_rgvar[i].isNull() ) {
+                        kdWarning(125) << "KKeySequence::init( seq ): key[" << i << "] is null." << endl;
+                        m_nKeys = 0;
+                        return false;
+                }
+                m_rgvar[i] = seq.m_rgvar[i];
+        }
+        return true;
+}
+
+bool KKeySequence::init( const QString& s )
+{
+        m_bTriggerOnRelease = false;
+
+        QStringList rgs = QStringList::split( ',', s );
+        if( s == "none" || rgs.size() == 0 ) {
+                clear();
+                return true;
+        } else if( rgs.size() <= MAX_KEYS ) {
+                m_nKeys = rgs.size();
+                for( uint i = 0; i < m_nKeys; i++ ) {
+                        m_rgvar[i].init( KKey(rgs[i]) );
+
+                }
+                return true;
+        } else {
+                clear();
+                return false;
+        }
+}
+
+uint KKeySequence::count() const
+{
+        return m_nKeys;
+}
+
+const KKey& KKeySequence::key( uint i ) const
+{
+        if( i < m_nKeys )
+                return m_rgvar[i];
+        else
+                return KKey::null();
+}
+
+bool KKeySequence::isTriggerOnRelease() const
+        { return m_bTriggerOnRelease; }
+
+bool KKeySequence::setKey( uint iKey, const KKey& key )
+{
+        if( iKey <= m_nKeys && iKey < MAX_KEYS ) {
+                m_rgvar[iKey].init( key );
+                if( iKey == m_nKeys )
+                        m_nKeys++;
+                return true;
+        } else
+                return false;
+}
+
+bool KKeySequence::isNull() const
+{
+        return m_nKeys == 0;
+}
+
+bool KKeySequence::startsWith( const KKeySequence& seq ) const
+{
+        if( m_nKeys < seq.m_nKeys )
+                return false;
+
+        for( uint i = 0; i < seq.m_nKeys; i++ ) {
+                if( m_rgvar[i] != seq.m_rgvar[i] )
+                        return false;
+        }
+
+        return true;
+}
+
+int KKeySequence::compare( const KKeySequence& seq ) const
+{
+        for( uint i = 0; i < m_nKeys && i < seq.m_nKeys; i++ ) {
+                int ret = m_rgvar[i].compare( seq.m_rgvar[i] );
+                if( ret != 0 )
+                        return ret;
+        }
+        if( m_nKeys != seq.m_nKeys )
+                return m_nKeys - seq.m_nKeys;
+        else
+                return 0;
+}
+
+QKeySequence KKeySequence::qt() const
+{
+        int k[4] = { 0, 0, 0, 0 };
+
+        for( uint i = 0; i < count(); i++ )
+                k[i] = KKeyNative(key(i)).keyCodeQt();
+
+        QKeySequence seq( k[0], k[1], k[2], k[3] );
+
+
+
+
+
+        return seq;
+}
+
+int KKeySequence::keyCodeQt() const
+{
+        return (count() == 1) ? KKeyNative(key(0)).keyCodeQt() : 0;
+}
+
+QString KKeySequence::toString() const
+{
+        if( m_nKeys < 1 ) return QString::null;
+
+        QString s;
+        s = m_rgvar[0].toString();
+        for( uint i = 1; i < m_nKeys; i++ ) {
+                s += ",";
+                s += m_rgvar[i].toString();
+        }
+
+        return s;
+}
+
+QString KKeySequence::toStringInternal() const
+{
+        if( m_nKeys < 1 ) return QString::null;
+
+        QString s;
+        s = m_rgvar[0].toStringInternal();
+        for( uint i = 1; i < m_nKeys; i++ ) {
+                s += ",";
+                s += m_rgvar[i].toStringInternal();
+        }
+
+        return s;
+}
+
+KKeySequence& KKeySequence::null()
+{
+        if( !g_pseq )
+                g_pseq = new KKeySequence;
+        if( !g_pseq->isNull() )
+                g_pseq->clear();
+        return *g_pseq;
+}
+
+
+
+
+
+KShortcut::KShortcut() { clear(); }
+KShortcut::KShortcut( int keyQt ) { init( keyQt ); }
+KShortcut::KShortcut( const QKeySequence& key ) { init( key ); }
+KShortcut::KShortcut( const KKey& key ) { init( key ); }
+KShortcut::KShortcut( const KKeySequence& seq ) { init( seq ); }
+KShortcut::KShortcut( const KShortcut& cut ) { init( cut ); }
+KShortcut::KShortcut( const char* ps ) { init( QString(ps) ); }
+KShortcut::KShortcut( const QString& s ) { init( s ); }
+
+KShortcut::~KShortcut()
+{
+}
+
+void KShortcut::clear()
+{
+        m_nSeqs = 0;
+}
+
+bool KShortcut::init( int keyQt )
+{
+        if( keyQt ) {
+                m_nSeqs = 1;
+                m_rgseq[0].init( QKeySequence(keyQt) );
+        } else
+                clear();
+        return true;
+}
+
+bool KShortcut::init( const QKeySequence& key )
+{
+        m_nSeqs = 1;
+        m_rgseq[0].init( key );
+        return true;
+}
+
+bool KShortcut::init( const KKey& spec )
+{
+        m_nSeqs = 1;
+        m_rgseq[0].init( spec );
+        return true;
+}
+
+bool KShortcut::init( const KKeySequence& seq )
+{
+        m_nSeqs = 1;
+        m_rgseq[0] = seq;
+        return true;
+}
+
+bool KShortcut::init( const KShortcut& cut )
+{
+        m_nSeqs = cut.m_nSeqs;
+        for( uint i = 0; i < m_nSeqs; i++ )
+                m_rgseq[i] = cut.m_rgseq[i];
+        return true;
+}
+
+bool KShortcut::init( const QString& s )
+{
+        bool bRet = true;
+        QStringList rgs = QStringList::split( ';', s );
+
+        if( s == "none" || rgs.size() == 0 )
+                clear();
+        else if( rgs.size() <= MAX_SEQUENCES ) {
+                m_nSeqs = rgs.size();
+                for( uint i = 0; i < m_nSeqs; i++ ) {
+                        QString& sSeq = rgs[i];
+                        if( sSeq.startsWith( "default(" ) )
+                                sSeq = sSeq.mid( 8, sSeq.length() - 9 );
+                        m_rgseq[i].init( sSeq );
+
+                }
+        } else {
+                clear();
+                bRet = false;
+        }
+
+        if( !s.isEmpty() ) {
+                QString sDebug;
+                QTextStream os( &sDebug, 0x0002 );
+                os << "KShortcut::init( \"" << s << "\" ): ";
+                for( uint i = 0; i < m_nSeqs; i++ ) {
+                        os << " m_rgseq[" << i << "]: ";
+                        KKeyServer::Variations vars;
+                        vars.init( m_rgseq[i].key(0), true );
+                        for( uint j = 0; j < vars.count(); j++ )
+                                os << QString::number(vars.m_rgkey[j].keyCodeQt(),16) << ',';
+                }
+                kdDebug(125) << sDebug << endl;
+        }
+
+        return bRet;
+}
+
+uint KShortcut::count() const
+{
+        return m_nSeqs;
+}
+
+const KKeySequence& KShortcut::seq( uint i ) const
+{
+        return (i < m_nSeqs) ? m_rgseq[i] : KKeySequence::null();
+}
+
+int KShortcut::keyCodeQt() const
+{
+        if( m_nSeqs >= 1 )
+                return m_rgseq[0].keyCodeQt();
+        return QKeySequence();
+}
+
+bool KShortcut::isNull() const
+{
+        return m_nSeqs == 0;
+}
+
+int KShortcut::compare( const KShortcut& cut ) const
+{
+        for( uint i = 0; i < m_nSeqs && i < cut.m_nSeqs; i++ ) {
+                int ret = m_rgseq[i].compare( cut.m_rgseq[i] );
+                if( ret != 0 )
+                        return ret;
+        }
+        return m_nSeqs - cut.m_nSeqs;
+}
+
+bool KShortcut::contains( const KKey& key ) const
+{
+        return contains( KKeySequence(key) );
+}
+
+bool KShortcut::contains( const KKeyNative& keyNative ) const
+{
+        KKey key = keyNative.key();
+        key.simplify();
+
+        for( uint i = 0; i < count(); i++ ) {
+                if( !m_rgseq[i].isNull()
+                    && m_rgseq[i].count() == 1
+                    && m_rgseq[i].key(0) == key )
+                        return true;
+        }
+        return false;
+}
+
+bool KShortcut::contains( const KKeySequence& seq ) const
+{
+        for( uint i = 0; i < count(); i++ ) {
+                if( !m_rgseq[i].isNull() && m_rgseq[i] == seq )
+                        return true;
+        }
+        return false;
+}
+
+bool KShortcut::setSeq( uint iSeq, const KKeySequence& seq )
+{
+
+        if( iSeq <= m_nSeqs && iSeq < MAX_SEQUENCES ) {
+                m_rgseq[iSeq] = seq;
+                if( iSeq == m_nSeqs )
+                        m_nSeqs++;
+                return true;
+        } else
+                return false;
+}
+
+bool KShortcut::append( const KKeySequence& seq )
+{
+        if( m_nSeqs < MAX_SEQUENCES ) {
+                if( !seq.isNull() ) {
+                        m_rgseq[m_nSeqs] = seq;
+                        m_nSeqs++;
+                }
+                return true;
+        } else
+                return false;
+}
+
+bool KShortcut::append( const KKey& spec )
+{
+        if( m_nSeqs < MAX_SEQUENCES ) {
+                m_rgseq[m_nSeqs].init( spec );
+                m_nSeqs++;
+                return true;
+        } else
+                return false;
+}
+
+bool KShortcut::append( const KShortcut& cut )
+{
+        uint seqs = m_nSeqs, co = cut.count();
+        for( uint i=0; i<co; i++ ) {
+            if (!contains(cut.seq(i))) seqs++;
+        }
+        if( seqs > MAX_SEQUENCES ) return false;
+
+        for( uint i=0; i<co; i++ ) {
+                const KKeySequence& seq = cut.seq(i);
+                if(!contains(seq)) {
+                        m_rgseq[m_nSeqs] = seq;
+                        m_nSeqs++;
+                }
+        }
+        return true;
+}
+
+KShortcut::operator QKeySequence () const
+{
+        if( count() >= 1 )
+                return m_rgseq[0].qt();
+        else
+                return QKeySequence();
+}
+
+QString KShortcut::toString() const
+{
+        QString s;
+
+        for( uint i = 0; i < count(); i++ ) {
+                s += m_rgseq[i].toString();
+                if( i < count() - 1 )
+                        s += ';';
+        }
+
+        return s;
+}
+
+QString KShortcut::toStringInternal( const KShortcut* pcutDefault ) const
+{
+        QString s;
+
+        for( uint i = 0; i < count(); i++ ) {
+                const KKeySequence& seq = m_rgseq[i];
+                if( pcutDefault && i < pcutDefault->count() && seq == (*pcutDefault).seq(i) ) {
+                        s += "default(";
+                        s += seq.toStringInternal();
+                        s += ")";
+                } else
+                        s += seq.toStringInternal();
+                if( i < count() - 1 )
+                        s += ';';
+        }
+
+        return s;
+}
+
+KShortcut& KShortcut::null()
+{
+        if( !g_pcut )
+                g_pcut = new KShortcut;
+        if( !g_pcut->isNull() )
+                g_pcut->clear();
+        return *g_pcut;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+static KKeyNative* gx_pkey = 0;
+
+
+
+
+
+KKeyNative::KKeyNative() { clear(); }
+KKeyNative::KKeyNative( const KKey& key ) { init( key ); }
+KKeyNative::KKeyNative( const KKeyNative& key ) { init( key ); }
+KKeyNative::KKeyNative( const XEvent* pEvent ) { init( pEvent ); }
+
+KKeyNative::KKeyNative( uint code, uint mod, uint sym )
+{
+        m_code = code;
+        m_mod = mod;
+        m_sym = sym;
+}
+
+KKeyNative::~KKeyNative()
+        { }
+
+void KKeyNative::clear()
+{
+        m_code = 0;
+        m_mod = 0;
+        m_sym = 0;
+}
+
+bool KKeyNative::init( const XEvent* pEvent )
+{
+        m_code = pEvent->xkey.keycode;
+        m_mod = pEvent->xkey.state;
+        XLookupString( (XKeyEvent*) pEvent, 0, 0, (KeySym*) &m_sym, 0 );
+        return true;
+}
+
+bool KKeyNative::init( const KKey& key )
+{
+
+
+        m_sym = key.sym();
+        uint modExtra = KKeyServer::Sym(m_sym).getModsRequired();
+
+        if( !m_sym || !KKeyServer::modToModX( key.modFlags() | modExtra, m_mod ) ) {
+                m_sym = m_mod = 0;
+                m_code = 0;
+                return false;
+        }
+
+
+
+
+        if( m_sym == 0xFF61 && !(m_mod & (1<<3)) )
+                m_code = 111;
+        else if( m_sym == 0xFF6B || (m_sym == 0xFF13 && (m_mod & (1<<2))) )
+                m_code = 114;
+        else
+                m_code = XKeysymToKeycode( qt_xdisplay(), m_sym );
+
+        if( !m_code && m_sym )
+                kdDebug(125) << "Couldn't get code for sym" << endl;
+
+
+        if( key.modFlags() )
+                KKeyServer::codeXToSym( m_code, m_mod, m_sym );
+
+        return true;
+}
+
+bool KKeyNative::init( const KKeyNative& key )
+{
+        m_code = key.m_code;
+        m_mod = key.m_mod;
+        m_sym = key.m_sym;
+        return true;
+}
+
+uint KKeyNative::code() const { return m_code; }
+uint KKeyNative::mod() const { return m_mod; }
+uint KKeyNative::sym() const { return m_sym; }
+
+bool KKeyNative::isNull() const
+{
+        return m_sym == 0;
+}
+
+int KKeyNative::compare( const KKeyNative& key ) const
+{
+        if( m_sym != key.m_sym ) return m_sym - key.m_sym;
+        if( m_mod != key.m_mod ) return m_mod - key.m_mod;
+        if( m_code != key.m_code ) return m_code - key.m_code;
+        return 0;
+}
+
+KKeyNative& KKeyNative::null()
+{
+        if( !gx_pkey )
+                gx_pkey = new KKeyNative;
+        if( !gx_pkey->isNull() )
+                gx_pkey->clear();
+        return *gx_pkey;
+}
+
+KKey KKeyNative::key() const
+{
+        uint modSpec;
+        if( KKeyServer::modXToMod( m_mod, modSpec ) )
+                return KKey( m_sym, modSpec );
+        else
+                return KKey();
+}
+
+int KKeyNative::keyCodeQt() const
+{
+        int keyQt = KKeyServer::Sym(m_sym).qt(), modQt;
+
+        if( keyQt != Qt::Key_unknown && KKeyServer::modXToModQt( m_mod, modQt ) )
+                return keyQt | modQt;
+
+        return 0;
+}
+
+uint KKeyNative::modX( KKey::ModFlag modFlag ) { return KKeyServer::modX( modFlag ); }
+bool KKeyNative::keyboardHasWinKey() { return KKeyServer::keyboardHasWinKey(); }
+uint KKeyNative::accelModMaskX() { return KKeyServer::accelModMaskX(); }
+uint KKeyNative::modXNumLock() { return KKeyServer::modXNumLock(); }
+uint KKeyNative::modXLock() { return KKeyServer::modXLock(); }
+uint KKeyNative::modXScrollLock() { return KKeyServer::modXScrollLock(); }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C"
+
+int mkstemps(char *, int);
+extern "C"
+
+unsigned long strlcat(char*, const char*, unsigned long);
+
+
+
+
+
+
+extern "C"
+
+unsigned long strlcpy(char*, const char*, unsigned long);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+namespace KKeyServer
+{
+
+
+
+
+
+struct Mod
+{
+        int m_mod;
+};
+
+
+
+
+
+struct ModInfo
+{
+        KKey::ModFlag mod;
+        int modQt;
+        uint modX;
+        const char* psName;
+        QString sLabel;
+};
+
+struct SymVariation
+{
+        uint sym, symVariation;
+        bool bActive;
+};
+
+struct SymName
+{
+        uint sym;
+        const char* psName;
+};
+
+struct TransKey {
+        int keySymQt;
+        uint keySymX;
+};
+
+
+
+
+
+static ModInfo g_rgModInfo[KKey::MOD_FLAG_COUNT] =
+{
+        { KKey::SHIFT, Qt::SHIFT, (1<<0), ("Shift"), QString() },
+        { KKey::CTRL, Qt::CTRL, (1<<2), ("Ctrl"), QString() },
+        { KKey::ALT, Qt::ALT, (1<<3), ("Alt"), QString() },
+        { KKey::WIN, KKey::QtWIN, (1<<6), ("Win"), QString() }
+};
+
+static SymVariation g_rgSymVariation[] =
+{
+        { '/', 0xFFAF, false },
+        { '*', 0xFFAA, false },
+        { '-', 0xFFAD, false },
+        { '+', 0xFFAB, false },
+        { 0xFF0D, 0xFF8D, false },
+        { 0, 0, false }
+};
+
+
+static const SymName g_rgSymNames[] = {
+        { 0xFE20, "Backtab" },
+        { 0xFF08, ("Backspace") },
+        { 0xFF15, ("SysReq") },
+        { 0xFFE5, ("CapsLock") },
+        { 0xFF7F, ("NumLock") },
+        { 0xFF14, ("ScrollLock") },
+        { 0xFF55, ("PageUp") },
+        { 0xFF56, ("PageDown") },
+        { 0, 0 }
+};
+
+
+
+
+static const TransKey g_rgQtToSymX[] =
+{
+        { Qt::Key_Escape, 0xFF1B },
+        { Qt::Key_Tab, 0xFF09 },
+        { Qt::Key_Backtab, 0xFE20 },
+        { Qt::Key_Backspace, 0xFF08 },
+        { Qt::Key_Return, 0xFF0D },
+        { Qt::Key_Enter, 0xFF8D },
+        { Qt::Key_Insert, 0xFF63 },
+        { Qt::Key_Delete, 0xFFFF },
+        { Qt::Key_Pause, 0xFF13 },
+
+
+
+        { Qt::Key_Print, 0xFF61 },
+
+        { Qt::Key_SysReq, 0xFF15 },
+        { Qt::Key_Home, 0xFF50 },
+        { Qt::Key_End, 0xFF57 },
+        { Qt::Key_Left, 0xFF51 },
+        { Qt::Key_Up, 0xFF52 },
+        { Qt::Key_Right, 0xFF53 },
+        { Qt::Key_Down, 0xFF54 },
+        { Qt::Key_Prior, 0xFF55 },
+        { Qt::Key_Next, 0xFF56 },
+
+
+
+
+        { Qt::Key_CapsLock, 0xFFE5 },
+        { Qt::Key_NumLock, 0xFF7F },
+        { Qt::Key_ScrollLock, 0xFF14 },
+        { Qt::Key_F1, 0xFFBE },
+        { Qt::Key_F2, 0xFFBF },
+        { Qt::Key_F3, 0xFFC0 },
+        { Qt::Key_F4, 0xFFC1 },
+        { Qt::Key_F5, 0xFFC2 },
+        { Qt::Key_F6, 0xFFC3 },
+        { Qt::Key_F7, 0xFFC4 },
+        { Qt::Key_F8, 0xFFC5 },
+        { Qt::Key_F9, 0xFFC6 },
+        { Qt::Key_F10, 0xFFC7 },
+        { Qt::Key_F11, 0xFFC8 },
+        { Qt::Key_F12, 0xFFC9 },
+        { Qt::Key_F13, 0xFFCA },
+        { Qt::Key_F14, 0xFFCB },
+        { Qt::Key_F15, 0xFFCC },
+        { Qt::Key_F16, 0xFFCD },
+        { Qt::Key_F17, 0xFFCE },
+        { Qt::Key_F18, 0xFFCF },
+        { Qt::Key_F19, 0xFFD0 },
+        { Qt::Key_F20, 0xFFD1 },
+        { Qt::Key_F21, 0xFFD2 },
+        { Qt::Key_F22, 0xFFD3 },
+        { Qt::Key_F23, 0xFFD4 },
+        { Qt::Key_F24, 0xFFD5 },
+        { Qt::Key_F25, 0xFFD6 },
+        { Qt::Key_F26, 0xFFD7 },
+        { Qt::Key_F27, 0xFFD8 },
+        { Qt::Key_F28, 0xFFD9 },
+        { Qt::Key_F29, 0xFFDA },
+        { Qt::Key_F30, 0xFFDB },
+        { Qt::Key_F31, 0xFFDC },
+        { Qt::Key_F32, 0xFFDD },
+        { Qt::Key_F33, 0xFFDE },
+        { Qt::Key_F34, 0xFFDF },
+        { Qt::Key_F35, 0xFFE0 },
+        { Qt::Key_Super_L, 0xFFEB },
+        { Qt::Key_Super_R, 0xFFEC },
+        { Qt::Key_Menu, 0xFF67 },
+        { Qt::Key_Hyper_L, 0xFFED },
+        { Qt::Key_Hyper_R, 0xFFEE },
+        { Qt::Key_Help, 0xFF6A },
+
+
+
+        { '/', 0xFFAF },
+        { '*', 0xFFAA },
+        { '-', 0xFFAD },
+        { '+', 0xFFAB },
+        { Qt::Key_Return, 0xFF8D }
+
+
+
+
+
+        ,
+        { Qt::Key_Standby, 0x1008FF10 },
+        { Qt::Key_VolumeDown, 0x1008FF11 },
+        { Qt::Key_VolumeMute, 0x1008FF12 },
+        { Qt::Key_VolumeUp, 0x1008FF13 },
+        { Qt::Key_MediaPlay, 0x1008FF14 },
+        { Qt::Key_MediaStop, 0x1008FF15 },
+        { Qt::Key_MediaPrev, 0x1008FF16 },
+        { Qt::Key_MediaNext, 0x1008FF17 },
+        { Qt::Key_HomePage, 0x1008FF18 },
+        { Qt::Key_LaunchMail, 0x1008FF19 },
+        { Qt::Key_Search, 0x1008FF1B },
+        { Qt::Key_MediaRecord, 0x1008FF1C },
+        { Qt::Key_LaunchMedia, 0x1008FF32 },
+        { Qt::Key_Launch1, 0x1008FF1D },
+        { Qt::Key_Back, 0x1008FF26 },
+        { Qt::Key_Forward, 0x1008FF27 },
+        { Qt::Key_Stop, 0x1008FF28 },
+        { Qt::Key_Refresh, 0x1008FF29 },
+        { Qt::Key_Favorites, 0x1008FF30 },
+        { Qt::Key_Launch0, 0x1008FF33 },
+        { Qt::Key_OpenUrl, 0x1008FF38 },
+        { Qt::Key_Launch2, 0x1008FF40 },
+        { Qt::Key_Launch3, 0x1008FF41 },
+        { Qt::Key_Launch4, 0x1008FF42 },
+        { Qt::Key_Launch5, 0x1008FF43 },
+        { Qt::Key_Launch6, 0x1008FF44 },
+        { Qt::Key_Launch7, 0x1008FF45 },
+        { Qt::Key_Launch8, 0x1008FF46 },
+        { Qt::Key_Launch9, 0x1008FF47 },
+        { Qt::Key_LaunchA, 0x1008FF48 },
+        { Qt::Key_LaunchB, 0x1008FF49 },
+        { Qt::Key_LaunchC, 0x1008FF4A },
+        { Qt::Key_LaunchD, 0x1008FF4B },
+        { Qt::Key_LaunchE, 0x1008FF4C },
+        { Qt::Key_LaunchF, 0x1008FF4D },
+
+};
+
+
+
+
+static bool g_bInitializedMods, g_bInitializedVariations, g_bInitializedKKeyLabels;
+static bool g_bMacLabels;
+static uint g_modXNumLock, g_modXScrollLock;
+
+bool initializeMods()
+{
+        XModifierKeymap* xmk = XGetModifierMapping( qt_xdisplay() );
+
+        g_rgModInfo[3].modX = g_modXNumLock = g_modXScrollLock = 0;
+
+
+        for( int i = 4; i < 8; i++ ) {
+                uint mask = (1 << i);
+                uint keySymX = XKeycodeToKeysym( qt_xdisplay(), xmk->modifiermap[xmk->max_keypermod * i], 0 );
+                switch( keySymX ) {
+                        case 0xFF7F: g_modXNumLock = mask; break;
+                        case 0xFFEB:
+                        case 0xFFEC: g_rgModInfo[3].modX = mask; break;
+                        case 0xFFE7:
+                        case 0xFFE8: if( !g_rgModInfo[3].modX ) g_rgModInfo[3].modX = mask; break;
+                        case 0xFF14: g_modXScrollLock = mask; break;
+                }
+        }
+
+        XFreeModifiermap( xmk );
+
+
+
+
+        g_bInitializedMods = true;
+
+        kdDebug(125) << "KKeyServer::initializeMods(): Win Mod = 0x" << QString::number(g_rgModInfo[3].modX, 16) << endl;
+        return true;
+}
+
+static void initializeVariations()
+{
+        for( int i = 0; g_rgSymVariation[i].sym != 0; i++ )
+                g_rgSymVariation[i].bActive = (XKeysymToKeycode( qt_xdisplay(), g_rgSymVariation[i].symVariation ) != 0);
+        g_bInitializedVariations = true;
+}
+
+static void intializeKKeyLabels()
+{
+        KConfigGroupSaver cgs( KGlobal::config(), "Keyboard" );
+        g_rgModInfo[0].sLabel = KGlobal::config()->readEntry( "Label Shift", i18n(g_rgModInfo[0].psName) );
+        g_rgModInfo[1].sLabel = KGlobal::config()->readEntry( "Label Ctrl", i18n(g_rgModInfo[1].psName) );
+        g_rgModInfo[2].sLabel = KGlobal::config()->readEntry( "Label Alt", i18n(g_rgModInfo[2].psName) );
+        g_rgModInfo[3].sLabel = KGlobal::config()->readEntry( "Label Win", i18n(g_rgModInfo[3].psName) );
+        g_bMacLabels = (g_rgModInfo[2].sLabel == "Command");
+        g_bInitializedKKeyLabels = true;
+}
+bool Sym::initQt( int keyQt )
+{
+        int symQt = keyQt & 0xffff;
+
+        if( (keyQt & Qt::UNICODE_ACCEL) || symQt < 0x1000 ) {
+                m_sym = QChar(symQt).lower().unicode();
+                return true;
+        }
+
+        for( uint i = 0; i < sizeof(g_rgQtToSymX)/sizeof(TransKey); i++ ) {
+                if( g_rgQtToSymX[i].keySymQt == symQt ) {
+                        m_sym = g_rgQtToSymX[i].keySymX;
+                        return true;
+                }
+        }
+
+        m_sym = 0;
+        if( symQt != Qt::Key_Shift && symQt != Qt::Key_Control && symQt != Qt::Key_Alt &&
+            symQt != Qt::Key_Meta && symQt != Qt::Key_Direction_L && symQt != Qt::Key_Direction_R )
+                kdDebug(125) << "Sym::initQt( " << QString::number(keyQt,16) << " ): failed to convert key." << endl;
+        return false;
+}
+
+bool Sym::init( const QString& s )
+{
+
+        if( s.length() == 1 ) {
+                m_sym = s[0].lower().unicode();
+                return true;
+        }
+
+
+        for( int i = 0; g_rgSymNames[i].sym != 0; i++ ) {
+                if( qstricmp( s.latin1(), g_rgSymNames[i].psName ) == 0 ) {
+                        m_sym = g_rgSymNames[i].sym;
+                        return true;
+                }
+        }
+
+
+        m_sym = XStringToKeysym( s.latin1() );
+        if( !m_sym ) {
+                m_sym = XStringToKeysym( s.lower().latin1() );
+                if( !m_sym ) {
+                        QString s2 = s;
+                        s2[0] = s2[0].upper();
+                        m_sym = XStringToKeysym( s2.latin1() );
+                }
+        }
+
+        return m_sym != 0;
+}
+
+int Sym::qt() const
+{
+        if( m_sym < 0x1000 ) {
+                if( m_sym >= 'a' && m_sym <= 'z' )
+                        return QChar(m_sym).upper();
+                return m_sym;
+        }
+        if( m_sym < 0x3000 )
+                return m_sym | Qt::UNICODE_ACCEL;
+
+        for( uint i = 0; i < sizeof(g_rgQtToSymX)/sizeof(TransKey); i++ )
+                if( g_rgQtToSymX[i].keySymX == m_sym )
+                        return g_rgQtToSymX[i].keySymQt;
+        return Qt::Key_unknown;
+}
+
+QString Sym::toString( bool bUserSpace ) const
+{
+        if( m_sym == 0 )
+                return QString::null;
+
+
+        else if( m_sym < 0x3000 ) {
+                QChar c = QChar(m_sym).upper();
+
+
+                if( (c.latin1() && c.isLetterOrNumber())
+                    || (bUserSpace && !c.isSpace()) )
+                                return c;
+        }
+
+
+        for( int i = 0; g_rgSymNames[i].sym != 0; i++ ) {
+                if( m_sym == g_rgSymNames[i].sym )
+                        return bUserSpace ? i18n(g_rgSymNames[i].psName) : QString(g_rgSymNames[i].psName);
+        }
+
+
+        QString s = XKeysymToString( m_sym );
+        capitalizeKeyname( s );
+        return bUserSpace ? i18n("QAccel", s.latin1()) : s;
+}
+
+QString Sym::toStringInternal() const { return toString( false ); }
+QString Sym::toString() const { return toString( true ); }
+
+uint Sym::getModsRequired() const
+{
+        uint mod = 0;
+
+
+        if( m_sym == 0xFF15 ) return KKey::ALT;
+        if( m_sym == 0xFF6B ) return KKey::CTRL;
+
+        if( m_sym < 0x3000 ) {
+                QChar c(m_sym);
+                if( c.isLetter() && c.lower() != c.upper() && m_sym == c.upper().unicode() )
+                        return KKey::SHIFT;
+        }
+
+        uchar code = XKeysymToKeycode( qt_xdisplay(), m_sym );
+        if( code ) {
+
+
+
+                if( m_sym == XKeycodeToKeysym( qt_xdisplay(), code, 0 ) )
+                        ;
+                else if( m_sym == XKeycodeToKeysym( qt_xdisplay(), code, 1 ) )
+                        mod = KKey::SHIFT;
+                else if( m_sym == XKeycodeToKeysym( qt_xdisplay(), code, 2 ) )
+                        mod = KKeyServer::MODE_SWITCH;
+                else if( m_sym == XKeycodeToKeysym( qt_xdisplay(), code, 3 ) )
+                        mod = KKey::SHIFT | KKeyServer::MODE_SWITCH;
+        }
+
+        return mod;
+}
+
+uint Sym::getSymVariation() const
+{
+        if( !g_bInitializedVariations )
+                initializeVariations();
+
+        for( int i = 0; g_rgSymVariation[i].sym != 0; i++ )
+                if( g_rgSymVariation[i].sym == m_sym && g_rgSymVariation[i].bActive )
+                        return g_rgSymVariation[i].symVariation;
+        return 0;
+}
+
+void Sym::capitalizeKeyname( QString& s )
+{
+        s[0] = s[0].upper();
+        int len = s.length();
+        if( s.endsWith( "left" ) ) s[len-4] = 'L';
+        else if( s.endsWith( "right" ) ) s[len-5] = 'R';
+        else if( s == "Sysreq" ) s[len-3] = 'R';
+}
+
+
+
+
+
+uint modX( KKey::ModFlag mod )
+{
+        if( mod == KKey::WIN && !g_bInitializedMods )
+                initializeMods();
+
+        for( uint i = 0; i < KKey::MOD_FLAG_COUNT; i++ ) {
+                if( g_rgModInfo[i].mod == mod )
+                        return g_rgModInfo[i].modX;
+        }
+        return 0;
+}
+
+bool keyboardHasWinKey() { if( !g_bInitializedMods ) { initializeMods(); } return g_rgModInfo[3].modX != 0; }
+uint modXShift() { return (1<<0); }
+uint modXLock() { return (1<<1); }
+uint modXCtrl() { return (1<<2); }
+uint modXAlt() { return (1<<3); }
+uint modXNumLock() { if( !g_bInitializedMods ) { initializeMods(); } return g_modXNumLock; }
+uint modXWin() { if( !g_bInitializedMods ) { initializeMods(); } return g_rgModInfo[3].modX; }
+uint modXScrollLock() { if( !g_bInitializedMods ) { initializeMods(); } return g_modXScrollLock; }
+
+uint accelModMaskX()
+{
+        if( !g_bInitializedMods )
+                initializeMods();
+        return (1<<0) | (1<<2) | (1<<3) | g_rgModInfo[3].modX;
+}
+
+bool keyQtToSym( int keyQt, uint& keySym )
+{
+        Sym sym;
+        if( sym.initQt( keyQt ) ) {
+                keySym = sym.m_sym;
+                return true;
+        } else
+                return false;
+}
+
+bool keyQtToMod( int keyQt, uint& mod )
+{
+        mod = 0;
+
+        if( keyQt & Qt::SHIFT ) mod |= KKey::SHIFT;
+        if( keyQt & Qt::CTRL ) mod |= KKey::CTRL;
+        if( keyQt & Qt::ALT ) mod |= KKey::ALT;
+        if( keyQt & (Qt::ALT<<1) ) mod |= KKey::WIN;
+
+        return true;
+}
+
+bool symToKeyQt( uint keySym, int& keyQt )
+{
+        Sym sym( keySym );
+        keyQt = sym.qt();
+        return (keyQt != Qt::Key_unknown);
+}
+
+bool modToModQt( uint mod, int& modQt )
+{
+        modQt = 0;
+        for( int i = 0; i < KKey::MOD_FLAG_COUNT; i++ ) {
+                if( mod & g_rgModInfo[i].mod ) {
+                        if( !g_rgModInfo[i].modQt ) {
+                                modQt = 0;
+                                return false;
+                        }
+                        modQt |= g_rgModInfo[i].modQt;
+                }
+        }
+        return true;
+}
+
+bool modToModX( uint mod, uint& modX )
+{
+        if( !g_bInitializedMods )
+                initializeMods();
+
+        modX = 0;
+        for( int i = 0; i < KKey::MOD_FLAG_COUNT; i++ ) {
+                if( mod & g_rgModInfo[i].mod ) {
+                        if( !g_rgModInfo[i].modX ) {
+                                kdDebug(125) << "Invalid modifier flag." << endl;
+                                modX = 0;
+                                return false;
+                        }
+                        modX |= g_rgModInfo[i].modX;
+                }
+        }
+
+        if( mod & 0x2000 )
+          modX |= 0x2000;
+        return true;
+}
+
+bool modXToModQt( uint modX, int& modQt )
+{
+        if( !g_bInitializedMods )
+                initializeMods();
+
+        modQt = 0;
+        for( int i = 0; i < KKey::MOD_FLAG_COUNT; i++ ) {
+                if( modX & g_rgModInfo[i].modX ) {
+                        if( !g_rgModInfo[i].modQt ) {
+                                modQt = 0;
+                                return false;
+                        }
+                        modQt |= g_rgModInfo[i].modQt;
+                }
+        }
+        return true;
+}
+
+bool modXToMod( uint modX, uint& mod )
+{
+        if( !g_bInitializedMods )
+                initializeMods();
+
+        mod = 0;
+        for( int i = 0; i < KKey::MOD_FLAG_COUNT; i++ ) {
+                if( modX & g_rgModInfo[i].modX )
+                        mod |= g_rgModInfo[i].mod;
+        }
+        return true;
+}
+
+bool codeXToSym( uchar codeX, uint modX, uint& sym )
+{
+        XKeyPressedEvent event;
+
+        event.type = KeyPress;
+        event.display = qt_xdisplay();
+        event.state = modX;
+        event.keycode = codeX;
+
+        XLookupString( &event, 0, 0, (KeySym*) &sym, 0 );
+        return true;
+}
+
+static QString modToString( uint mod, bool bUserSpace )
+{
+        if( bUserSpace && !g_bInitializedKKeyLabels )
+                intializeKKeyLabels();
+
+        QString s;
+        for( int i = KKey::MOD_FLAG_COUNT-1; i >= 0; i-- ) {
+                if( mod & g_rgModInfo[i].mod ) {
+                        if( !s.isEmpty() )
+                                s += '+';
+                        s += (bUserSpace)
+                                  ? g_rgModInfo[i].sLabel
+                                  : QString(g_rgModInfo[i].psName);
+                }
+        }
+        return s;
+}
+
+QString modToStringInternal( uint mod ) { return modToString( mod, false ); }
+QString modToStringUser( uint mod ) { return modToString( mod, true ); }
+bool Key::init( const KKey& key, bool bQt )
+{
+        if( bQt ) {
+                m_code = CODE_FOR_QT;
+                m_sym = key.keyCodeQt();
+        } else {
+                KKeyNative keyNative( key );
+                *this = keyNative;
+        }
+        return true;
+}
+
+KKey Key::key() const
+{
+        if( m_code == CODE_FOR_QT )
+                return KKey( keyCodeQt() );
+        else {
+                uint mod;
+                modXToMod( m_mod, mod );
+                return KKey( m_sym, mod );
+        }
+}
+
+Key& Key::operator =( const KKeyNative& key )
+{
+        m_code = key.code(); m_mod = key.mod(); m_sym = key.sym();
+        return *this;
+}
+
+int Key::compare( const Key& b ) const
+{
+        if( m_code == CODE_FOR_QT )
+                return m_sym - b.m_sym;
+        if( m_sym != b.m_sym ) return m_sym - b.m_sym;
+        if( m_mod != b.m_mod ) return m_mod - b.m_mod;
+        return m_code - b.m_code;
+}
+
+
+
+
+
+
+void Variations::init( const KKey& key, bool bQt )
+{
+        if( key.isNull() ) {
+                m_nVariations = 0;
+                return;
+        }
+
+        m_nVariations = 1;
+        m_rgkey[0] = KKeyNative(key);
+        uint symVar = Sym(key.sym()).getSymVariation();
+        if( symVar ) {
+                uint modReq = Sym(m_rgkey[0].sym()).getModsRequired();
+                uint modReqVar = Sym(symVar).getModsRequired();
+
+
+                if( (key.modFlags() & modReq) == (key.modFlags() & modReqVar) ) {
+                        m_rgkey[1] = KKeyNative(KKey(symVar, key.modFlags()));
+                        m_nVariations = 2;
+                }
+        }
+
+        if( bQt ) {
+                uint nVariations = 0;
+                for( uint i = 0; i < m_nVariations; i++ ) {
+                        int keyQt = KKeyNative( m_rgkey[i].code(), m_rgkey[i].mod(), m_rgkey[i].sym() ).keyCodeQt();
+                        if( keyQt )
+                                m_rgkey[nVariations++].setKeycodeQt( keyQt );
+                }
+                m_nVariations = nVariations;
+
+
+
+                for( uint i = 1; i < m_nVariations; i++ ) {
+                        for( uint j = 0; j < i; j++ ) {
+
+                                if( m_rgkey[i].keyCodeQt() == m_rgkey[j].keyCodeQt() ) {
+                                        for( uint k = i; k < m_nVariations - 1; k++ )
+                                                m_rgkey[k].setKeycodeQt( m_rgkey[k+1].keyCodeQt() );
+                                        m_nVariations--;
+                                        i--;
+                                        break;
+                                }
+                        }
+                }
+        }
+}
+
+}
+
+
+
+
+
+
+
+void KKey::simplify()
+{
+        if( m_sym == 0xFF15 ) {
+                m_sym = 0xFF61;
+                m_mod |= ALT;
+        } else if( m_sym == 0xFE20 ) {
+                m_sym = 0xFF09;
+                m_mod |= SHIFT;
+        } else {
+
+                m_sym = KKeyNative(*this).sym();
+        }
+
+
+        if( m_sym < 0x3000 && QChar(m_sym).isLetter() )
+                m_sym = QChar(m_sym).lower().unicode();
+
+
+
+        m_mod &= ~KKeyServer::Sym(m_sym).getModsRequired();
+}
+
+
+
+
+template <class T>
+class QValueVectorPrivate : public QShared
+{
+public:
+    typedef T value_type;
+    typedef T* pointer;
+
+    QValueVectorPrivate()
+        : start( 0 ), finish( 0 ), end( 0 )
+    {
+    }
+
+    QValueVectorPrivate( const QValueVectorPrivate<T>& x );
+    QValueVectorPrivate( size_t size );
+
+    void derefAndDelete()
+    {
+        if ( deref() )
+            delete this;
+    }
+
+
+
+
+
+    ~QValueVectorPrivate()
+    {
+        delete[] start;
+    }
+
+    size_t size() const
+    {
+        return finish - start;
+    }
+
+    bool empty() const
+    {
+        return start == finish;
+    }
+
+    size_t capacity() const
+    {
+        return end - start;
+    }
+
+    void insert( pointer pos, const T& x );
+    void insert( pointer pos, size_t n, const T& x );
+    void reserve( size_t n );
+
+    void clear()
+    {
+        delete[] start;
+        start = 0;
+        finish = 0;
+        end = 0;
+    }
+
+
+    pointer start;
+    pointer finish;
+    pointer end;
+
+private:
+    pointer growAndCopy( size_t n, pointer s, pointer f );
+
+    QValueVectorPrivate<T>& operator=( const QValueVectorPrivate<T>& x );
+
+};
+
+template <class T>
+ QValueVectorPrivate<T>::QValueVectorPrivate( const QValueVectorPrivate<T>& x )
+    : QShared()
+{
+    int i = x.size();
+    if ( i > 0 ) {
+        start = new T[ i ];
+        finish = start + i;
+        end = start + i;
+
+
+
+        qCopy( x.start, x.finish, start );
+
+    } else {
+        start = 0;
+        finish = 0;
+        end = 0;
+    }
+}
+
+template <class T>
+ QValueVectorPrivate<T>::QValueVectorPrivate( size_t size )
+{
+    if ( size > 0 ) {
+        start = new T[size];
+        finish = start + size;
+        end = start + size;
+    } else {
+        start = 0;
+        finish = 0;
+        end = 0;
+    }
+}
+
+template <class T>
+ void QValueVectorPrivate<T>::insert( pointer pos, const T& x )
+{
+    const size_t lastSize = size();
+    const size_t n = lastSize !=0 ? 2*lastSize : 1;
+    const size_t offset = pos - start;
+    pointer newStart = new T[n];
+    pointer newFinish = newStart + offset;
+    qCopy( start, pos, newStart );
+    *newFinish = x;
+    qCopy( pos, finish, ++newFinish );
+    delete[] start;
+    start = newStart;
+    finish = newStart + lastSize + 1;
+    end = newStart + n;
+}
+
+template <class T>
+ void QValueVectorPrivate<T>::insert( pointer pos, size_t n, const T& x )
+{
+    if ( size_t( end - finish ) >= n ) {
+
+        const size_t elems_after = finish - pos;
+        pointer old_finish = finish;
+        if ( elems_after > n ) {
+            qCopy( finish - n, finish, finish );
+            finish += n;
+            qCopyBackward( pos, old_finish - n, old_finish );
+            qFill( pos, pos + n, x );
+        } else {
+            pointer filler = finish;
+            size_t i = n - elems_after;
+            for ( ; i > 0; --i, ++filler )
+                *filler = x;
+            finish += n - elems_after;
+            qCopy( pos, old_finish, finish );
+            finish += elems_after;
+            qFill( pos, old_finish, x );
+        }
+    } else {
+
+        const size_t lastSize = size();
+        const size_t len = lastSize + ((n) < (lastSize) ? (lastSize) : (n));
+        pointer newStart = new T[len];
+        pointer newFinish = qCopy( start, pos, newStart );
+
+        size_t i = n;
+        for ( ; i > 0; --i, ++newFinish )
+            *newFinish = x;
+        newFinish = qCopy( pos, finish, newFinish );
+        delete[] start;
+        start = newStart;
+        finish = newFinish;
+        end = newStart + len;
+    }
+}
+
+template <class T>
+ void QValueVectorPrivate<T>::reserve( size_t n )
+{
+    const size_t lastSize = size();
+    pointer tmp = growAndCopy( n, start, finish );
+    start = tmp;
+    finish = tmp + lastSize;
+    end = start + n;
+}
+
+template <class T>
+ typename QValueVectorPrivate<T>::pointer QValueVectorPrivate<T>::growAndCopy( size_t n, pointer s, pointer f )
+{
+    pointer newStart = new T[n];
+    qCopy( s, f, newStart );
+    delete[] start;
+    return newStart;
+}
+
+template <class T> class QDeepCopy;
+
+template <class T>
+class QValueVector
+{
+public:
+    typedef T value_type;
+    typedef value_type* pointer;
+    typedef const value_type* const_pointer;
+    typedef value_type* iterator;
+    typedef const value_type* const_iterator;
+    typedef value_type& reference;
+    typedef const value_type& const_reference;
+    typedef size_t size_type;
+
+
+
+    typedef int difference_type;
+
+
+    QValueVector()
+    {
+        sh = new QValueVectorPrivate<T>;
+    }
+
+    QValueVector( const QValueVector<T>& v )
+    {
+        sh = v.sh;
+        sh->ref();
+    }
+
+    QValueVector( size_type n, const T& val = T() );
+    ~QValueVector()
+    {
+        sh->derefAndDelete();
+    }
+
+    QValueVector<T>& operator= ( const QValueVector<T>& v )
+    {
+        v.sh->ref();
+        sh->derefAndDelete();
+        sh = v.sh;
+        return *this;
+    }
+    size_type size() const { return sh->size(); }
+
+    bool empty() const { return sh->empty(); }
+
+    size_type capacity() const
+    {
+        return size_type( sh->capacity() );
+    }
+
+    iterator begin()
+    {
+        detach();
+        return sh->start;
+    }
+
+    const_iterator begin() const
+    {
+        return sh->start;
+    }
+
+    const_iterator constBegin() const
+    {
+        return sh->start;
+    }
+
+    iterator end()
+    {
+        detach();
+        return sh->finish;
+    }
+
+    const_iterator end() const
+    {
+        return sh->finish;
+    }
+
+    const_iterator constEnd() const
+    {
+        return sh->finish;
+    }
+
+    reference at( size_type i, bool* ok = 0 )
+    {
+        detach();
+        if ( ok )
+            *ok = ( i < size() );
+        return *( begin() + i );
+    }
+
+    const_reference at( size_type i, bool* ok = 0 ) const
+    {
+        if ( ok )
+            *ok = ( i < size() );
+        return *( begin() + i );
+    }
+
+    reference operator[]( size_type i )
+    {
+        detach();
+        return *( begin() + i );
+    }
+
+    const_reference operator[]( size_type i ) const
+    {
+        return *( begin() + i );
+    }
+
+    reference front()
+    {
+        ((!empty()) ? (void)0 : qWarning("ASSERT: \"%s\" in %s (%d)","!empty()","/coolo/prod/qt-copy/include/qvaluevector.h",368));
+        detach();
+        return *begin();
+    }
+
+    const_reference front() const
+    {
+        ((!empty()) ? (void)0 : qWarning("ASSERT: \"%s\" in %s (%d)","!empty()","/coolo/prod/qt-copy/include/qvaluevector.h",375));
+        return *begin();
+    }
+
+    reference back()
+    {
+        ((!empty()) ? (void)0 : qWarning("ASSERT: \"%s\" in %s (%d)","!empty()","/coolo/prod/qt-copy/include/qvaluevector.h",381));
+        detach();
+        return *( end() - 1 );
+    }
+
+    const_reference back() const
+    {
+        ((!empty()) ? (void)0 : qWarning("ASSERT: \"%s\" in %s (%d)","!empty()","/coolo/prod/qt-copy/include/qvaluevector.h",388));
+        return *( end() - 1 );
+    }
+
+    void push_back( const T& x )
+    {
+        detach();
+        if ( sh->finish == sh->end ) {
+            sh->reserve( size()+size()/2+1 );
+        }
+        *sh->finish = x;
+        ++sh->finish;
+    }
+
+    void pop_back()
+    {
+        detach();
+        if ( empty() )
+            return;
+        --sh->finish;
+    }
+
+    iterator insert( iterator pos, const T& x );
+    iterator insert( iterator pos, size_type n, const T& x );
+
+    void reserve( size_type n )
+    {
+        if ( capacity() < n ) {
+            detach();
+            sh->reserve( n );
+        }
+    }
+
+    void resize( size_type n, const T& val = T() )
+    {
+        if ( n < size() )
+            erase( begin() + n, end() );
+        else
+            insert( end(), n - size(), val );
+    }
+
+    void clear()
+    {
+        detach();
+        sh->clear();
+    }
+
+    iterator erase( iterator pos )
+    {
+        detach();
+        if ( pos + 1 != end() )
+            qCopy( pos + 1, sh->finish, pos );
+        --sh->finish;
+        return pos;
+    }
+
+    iterator erase( iterator first, iterator last )
+    {
+        detach();
+        qCopy( last, sh->finish, first );
+        sh->finish = sh->finish - ( last - first );
+        return first;
+    }
+
+
+    bool operator==( const QValueVector<T>& x )
+    {
+        return size()==x.size() ? qEqual( constBegin(), constEnd(), x.begin()) : FALSE;
+    }
+
+    bool operator==( const QValueVector<T>& x ) const
+    {
+        return size()==x.size() ? qEqual( begin(), end(), x.begin() ) : FALSE;
+    }
+
+    typedef T ValueType;
+    typedef ValueType *Iterator;
+    typedef const ValueType *ConstIterator;
+
+    size_type count() const { return size(); }
+    bool isEmpty() const { return empty(); }
+
+    reference first() { return front(); }
+    const_reference first() const { return front(); }
+    reference last() { return back(); }
+    const_reference last() const { return back(); }
+    void append( const T& x ) { push_back( x ); }
+
+protected:
+    void detach()
+    {
+        if ( sh->count > 1 ) { detachInternal(); }
+    }
+    void detachInternal();
+    QValueVectorPrivate<T>* sh;
+
+private:
+    friend class QDeepCopy< QValueVector<T> >;
+};
+
+template <class T>
+ QValueVector<T>::QValueVector( size_type n, const T& val )
+{
+    sh = new QValueVectorPrivate<T>( n );
+    qFill( begin(), end(), val );
+}
+
+template <class T>
+ void QValueVector<T>::detachInternal()
+{
+    sh->deref();
+    sh = new QValueVectorPrivate<T>( *sh );
+}
+
+template <class T>
+ typename QValueVector<T>::iterator QValueVector<T>::insert( iterator pos, const T& x )
+{
+    size_type offset = pos - sh->start;
+    detach();
+    if ( pos == end() ) {
+        if ( sh->finish == sh->end )
+            push_back( x );
+        else {
+            *sh->finish = x;
+            ++sh->finish;
+        }
+    } else {
+        if ( sh->finish == sh->end ) {
+            sh->insert( pos, x );
+        } else {
+            *sh->finish = *(sh->finish - 1);
+            ++sh->finish;
+            qCopyBackward( pos, sh->finish - 2, sh->finish - 1 );
+            *pos = x;
+        }
+    }
+    return begin() + offset;
+}
+
+template <class T>
+ typename QValueVector<T>::iterator QValueVector<T>::insert( iterator pos, size_type n, const T& x )
+{
+    if ( n != 0 ) {
+        size_type offset = pos - sh->start;
+        detach();
+        pos = begin() + offset;
+        sh->insert( pos, n, x );
+    }
+    return pos;
+}
+
+
+
+template<class T>
+ QDataStream& operator>>( QDataStream& s, QValueVector<T>& v )
+{
+    v.clear();
+    Q_UINT32 c;
+    s >> c;
+    v.resize( c );
+    for( Q_UINT32 i = 0; i < c; ++i )
+    {
+        T t;
+        s >> t;
+        v[i] = t;
+    }
+    return s;
+}
+
+template<class T>
+ QDataStream& operator<<( QDataStream& s, const QValueVector<T>& v )
+{
+    s << (Q_UINT32)v.size();
+
+
+    const T* it = v.begin();
+    for( ; it != v.end(); ++it )
+        s << *it;
+    return s;
+}
+
+
+
+
+
+class KAccelBase;
+
+class QObject;
+class KConfig;
+class KConfigBase;
+class KAccelAction
+{
+ public:
+
+
+
+
+        KAccelAction();
+
+
+
+
+        KAccelAction( const KAccelAction& );
+        KAccelAction( const QString& sName, const QString& sLabel, const QString& sWhatsThis,
+                        const KShortcut& cutDef3, const KShortcut& cutDef4,
+                        const QObject* pObjSlot, const char* psMethodSlot,
+                        bool bConfigurable, bool bEnabled );
+        ~KAccelAction();
+
+
+
+
+        void clear();
+        bool init( const QString& sName, const QString& sLabel, const QString& sWhatsThis,
+                        const KShortcut& cutDef3, const KShortcut& cutDef4,
+                        const QObject* pObjSlot, const char* psMethodSlot,
+                        bool bConfigurable, bool bEnabled );
+
+
+
+
+        KAccelAction& operator=( const KAccelAction& );
+
+
+
+
+
+
+        const QString& name() const { return m_sName; }
+
+
+
+
+
+
+        const QString& label() const { return m_sLabel; }
+
+
+
+
+
+
+        const QString& whatsThis() const { return m_sWhatsThis; }
+
+
+
+
+
+
+        const KShortcut& shortcut() const { return m_cut; }
+        const KShortcut& shortcutDefault() const;
+        const KShortcut& shortcutDefault3() const { return m_cutDefault3; }
+        const KShortcut& shortcutDefault4() const { return m_cutDefault4; }
+
+
+
+
+
+        const QObject* objSlotPtr() const { return m_pObjSlot; }
+
+
+
+
+
+        const char* methodSlotPtr() const { return m_psMethodSlot; }
+
+
+
+
+
+        bool isConfigurable() const { return m_bConfigurable; }
+
+
+
+
+
+        bool isEnabled() const { return m_bEnabled; }
+
+
+
+
+
+        void setName( const QString& name );
+
+
+
+
+
+        void setLabel( const QString& label );
+
+
+
+
+
+        void setWhatsThis( const QString& whatsThis );
+
+
+
+
+
+
+        bool setShortcut( const KShortcut& rgCuts );
+
+
+
+
+
+
+        void setSlot( const QObject* pObjSlot, const char* psMethodSlot );
+
+
+
+
+
+        void setConfigurable( bool configurable );
+
+
+
+
+
+        void setEnabled( bool enable );
+
+
+
+
+
+        int getID() const { return m_nIDAccel; }
+        void setID( int n ) { m_nIDAccel = n; }
+
+
+
+
+
+        bool isConnected() const;
+        bool setKeySequence( uint i, const KKeySequence &keySeq );
+
+
+
+
+
+
+        void clearShortcut();
+
+
+
+
+
+
+
+        bool contains( const KKeySequence &keySeq );
+
+
+
+
+
+
+        QString toString() const;
+
+
+
+
+        QString toStringInternal() const;
+
+
+
+
+
+        static bool useFourModifierKeys();
+
+
+
+
+
+
+        static void useFourModifierKeys( bool use );
+
+ protected:
+        QString m_sName,
+                m_sLabel,
+                m_sWhatsThis;
+        KShortcut m_cut;
+        KShortcut m_cutDefault3, m_cutDefault4;
+        const QObject* m_pObjSlot;
+        const char* m_psMethodSlot;
+        bool m_bConfigurable,
+             m_bEnabled;
+        int m_nIDAccel;
+        uint m_nConnections;
+
+        void incConnections();
+        void decConnections();
+
+ private:
+        static int g_bUseFourModifierKeys;
+        class KAccelActionPrivate* d;
+
+        friend class KAccelActions;
+        friend class KAccelBase;
+};
+class KAccelActions
+{
+ public:
+
+
+
+        KAccelActions();
+
+
+
+
+        KAccelActions( const KAccelActions& );
+        virtual ~KAccelActions();
+
+
+
+
+        void clear();
+
+
+
+
+
+
+
+        bool init( const KAccelActions &actions );
+        bool init( KConfigBase& config, const QString& sGroup );
+
+
+
+
+
+
+
+        void updateShortcuts( KAccelActions &shortcuts );
+
+
+
+
+
+
+        int actionIndex( const QString& sAction ) const;
+        KAccelAction* actionPtr( uint index );
+        const KAccelAction* actionPtr( uint index ) const;
+
+
+
+
+
+
+
+        KAccelAction* actionPtr( const QString& sAction );
+
+
+
+
+
+
+
+        const KAccelAction* actionPtr( const QString& sAction ) const;
+
+
+
+
+
+
+
+        KAccelAction* actionPtr( KKeySequence cut );
+        KAccelAction& operator []( uint index );
+        const KAccelAction& operator []( uint index ) const;
+        KAccelAction* insert( const QString& sAction, const QString& sLabel, const QString& sWhatsThis,
+                        const KShortcut& rgCutDefaults3, const KShortcut& rgCutDefaults4,
+                        const QObject* pObjSlot = 0, const char* psMethodSlot = 0,
+                        bool bConfigurable = true, bool bEnabled = true );
+
+
+
+
+
+
+
+        KAccelAction* insert( const QString& sName, const QString& sLabel );
+
+
+
+
+
+
+        bool remove( const QString& sAction );
+        bool readActions( const QString& sConfigGroup = "Shortcuts", KConfigBase* pConfig = 0 );
+        bool writeActions( const QString& sConfigGroup = "Shortcuts", KConfigBase* pConfig = 0,
+                        bool bWriteAll = false, bool bGlobal = false ) const;
+
+
+
+
+        void emitKeycodeChanged();
+
+
+
+
+
+        uint count() const;
+
+ protected:
+        KAccelBase* m_pKAccelBase;
+        KAccelAction** m_prgActions;
+        uint m_nSizeAllocated, m_nSize;
+
+        void resize( uint );
+        void insertPtr( KAccelAction* );
+
+ private:
+        class KAccelActionsPrivate* d;
+
+        KAccelActions( KAccelBase* );
+        void initPrivate( KAccelBase* );
+        KAccelActions& operator =( KAccelActions& );
+
+        friend class KAccelBase;
+};
+class QPopupMenu;
+class QWidget;
+class KAccelBase
+{
+ public:
+        enum Init { QT_KEYS = 0x00, NATIVE_KEYS = 0x01 };
+        enum Signal { KEYCODE_CHANGED };
+
+        KAccelBase( int fInitCode );
+        virtual ~KAccelBase();
+
+        uint actionCount() const;
+        KAccelActions& actions();
+        bool isEnabled() const;
+
+        KAccelAction* actionPtr( const QString& sAction );
+        const KAccelAction* actionPtr( const QString& sAction ) const;
+        KAccelAction* actionPtr( const KKey& key );
+        KAccelAction* actionPtr( const KKeyServer::Key& key );
+
+        const QString& configGroup() const { return m_sConfigGroup; }
+        void setConfigGroup( const QString& group );
+        void setConfigGlobal( bool global );
+        virtual void setEnabled( bool bEnabled ) = 0;
+        bool getAutoUpdate() { return m_bAutoUpdate; }
+
+        bool setAutoUpdate( bool bAuto );
+
+
+
+
+        KAccelAction* insert( const QString& sName, const QString& sDesc );
+        KAccelAction* insert(
+                         const QString& sAction, const QString& sDesc, const QString& sHelp,
+                         const KShortcut& rgCutDefaults3, const KShortcut& rgCutDefaults4,
+                         const QObject* pObjSlot, const char* psMethodSlot,
+                         bool bConfigurable = true, bool bEnabled = true );
+        bool remove( const QString& sAction );
+        bool setActionSlot( const QString& sAction, const QObject* pObjSlot, const char* psMethodSlot );
+
+        bool updateConnections();
+
+        bool setShortcut( const QString& sAction, const KShortcut& cut );
+
+
+        bool setActionEnabled( const QString& sAction, bool bEnable );
+        void readSettings( KConfigBase* pConfig = 0 );
+
+
+
+
+
+
+        void writeSettings( KConfigBase* pConfig = 0 ) const;
+
+        QPopupMenu* createPopupMenu( QWidget* pParent, const KKeySequence& );
+
+
+ protected:
+        void slotRemoveAction( KAccelAction* );
+
+        struct X;
+        void createKeyList( QValueVector<struct X>& rgKeys );
+        bool insertConnection( KAccelAction* );
+        bool removeConnection( KAccelAction* );
+
+        virtual bool emitSignal( Signal ) = 0;
+        virtual bool connectKey( KAccelAction&, const KKeyServer::Key& ) = 0;
+        virtual bool connectKey( const KKeyServer::Key& ) = 0;
+        virtual bool disconnectKey( KAccelAction&, const KKeyServer::Key& ) = 0;
+        virtual bool disconnectKey( const KKeyServer::Key& ) = 0;
+
+ protected:
+        struct ActionInfo
+        {
+                KAccelAction* pAction;
+                uint iSeq, iVariation;
+
+
+                ActionInfo() { pAction = 0; iSeq = 0xffff; iVariation = 0xffff; }
+                ActionInfo( KAccelAction* _pAction, uint _iSeq, uint _iVariation )
+                        { pAction = _pAction; iSeq = _iSeq; iVariation = _iVariation; }
+        };
+        typedef QMap<KKeyServer::Key, ActionInfo> KKeyToActionMap;
+
+        KAccelActions m_rgActions;
+        KKeyToActionMap m_mapKeyToAction;
+        QValueList<KAccelAction*> m_rgActionsNonUnique;
+        bool m_bNativeKeys;
+        bool m_bEnabled;
+        bool m_bConfigIsGlobal;
+        QString m_sConfigGroup;
+        bool m_bAutoUpdate;
+        KAccelAction* mtemp_pActionRemoving;
+
+ private:
+        KAccelBase& operator =( const KAccelBase& );
+
+        friend class KAccelActions;
+};
+
+
+
+
+
+
+
+
+
+
+
+class QVariant;
+class KConfigBase;
+class KInstance;
+class KKeySequence;
+class KShortcut;
+class KShortcutList
+{
+ public:
+
+
+
+        KShortcutList();
+        virtual ~KShortcutList();
+
+
+
+
+
+        virtual uint count() const = 0;
+
+
+
+
+
+
+        virtual QString name( uint index ) const = 0;
+
+
+
+
+
+
+        virtual QString label( uint index ) const = 0;
+
+
+
+
+
+
+        virtual QString whatsThis( uint index ) const = 0;
+
+
+
+
+
+
+
+        virtual const KShortcut& shortcut( uint index ) const = 0;
+
+
+
+
+
+
+
+        virtual const KShortcut& shortcutDefault( uint index ) const = 0;
+
+
+
+
+
+
+        virtual bool isConfigurable( uint index ) const = 0;
+
+
+
+
+
+
+        virtual bool setShortcut( uint index, const KShortcut &shortcut ) = 0;
+
+
+
+
+
+
+
+        virtual bool isGlobal( uint index ) const;
+
+
+
+
+
+
+        virtual int index( const QString& sName ) const;
+
+
+
+
+
+
+        virtual int index( const KKeySequence& keySeq ) const;
+
+
+
+
+
+        virtual const KInstance* instance() const;
+
+
+        enum Other { };
+
+        virtual QVariant getOther( Other, uint index ) const = 0;
+
+        virtual bool setOther( Other, uint index, QVariant ) = 0;
+
+
+
+
+
+        virtual bool save() const = 0;
+        virtual bool readSettings( const QString& sConfigGroup = QString::null, KConfigBase* pConfig = 0 );
+        virtual bool writeSettings( const QString& sConfigGroup = QString::null, KConfigBase* pConfig = 0,
+                        bool bWriteAll = false, bool bGlobal = false ) const;
+
+ protected:
+
+        virtual void virtual_hook( int id, void* data );
+ private:
+        class KShortcutListPrivate* d;
+};
+
+
+
+
+
+class KAccel;
+class KAccelActions;
+class KGlobalAccel;
+
+
+
+
+
+class KAccelShortcutList : public KShortcutList
+{
+ public:
+
+
+
+
+        KAccelShortcutList( KAccel* accel );
+
+
+
+
+
+
+        KAccelShortcutList( KGlobalAccel* accel );
+        KAccelShortcutList( KAccelActions &actions, bool bGlobal );
+        virtual ~KAccelShortcutList();
+
+        virtual uint count() const;
+        virtual QString name( uint index ) const;
+        virtual QString label( uint index ) const;
+        virtual QString whatsThis( uint index ) const;
+        virtual const KShortcut& shortcut( uint index ) const;
+        virtual const KShortcut& shortcutDefault( uint index ) const;
+        virtual bool isConfigurable( uint index ) const;
+        virtual bool setShortcut( uint index , const KShortcut& shortcut );
+        virtual bool isGlobal( uint index ) const;
+
+
+        virtual QVariant getOther( Other, uint index ) const;
+
+        virtual bool setOther( Other, uint index, QVariant );
+
+        virtual bool save() const;
+
+ protected:
+        KAccelActions& m_actions;
+        bool m_bGlobal;
+
+ protected:
+        virtual void virtual_hook( int id, void* data );
+ private:
+        class KAccelShortcutListPrivate* d;
+};
+
+namespace KStdAccel {
+class ShortcutList : public KShortcutList
+{
+ public:
+
+
+
+        ShortcutList();
+        virtual ~ShortcutList();
+
+        virtual uint count() const;
+        virtual QString name( uint index ) const;
+        virtual QString label( uint index ) const;
+        virtual QString whatsThis( uint index ) const;
+        virtual const KShortcut& shortcut( uint index ) const;
+        virtual const KShortcut& shortcutDefault( uint index ) const;
+        virtual bool isConfigurable( uint index ) const;
+        virtual bool setShortcut( uint index , const KShortcut& shortcut );
+
+
+        virtual QVariant getOther( Other, uint index ) const;
+
+        virtual bool setOther( Other, uint index, QVariant );
+
+        virtual bool save() const;
+
+ protected:
+        virtual void virtual_hook( int id, void* data );
+ private:
+        class ShortcutListPrivate* d;
+};
+}
+
+
+
+
+
+class KAccelActionPrivate
+{
+ public:
+        uint m_nConnections;
+};
+
+KAccelAction::KAccelAction()
+{
+
+        d = new KAccelActionPrivate;
+        m_pObjSlot = 0;
+        m_psMethodSlot = 0;
+        m_bConfigurable = true;
+        m_bEnabled = true;
+        m_nIDAccel = 0;
+        d->m_nConnections = 0;
+}
+
+KAccelAction::KAccelAction( const KAccelAction& action )
+{
+
+        d = new KAccelActionPrivate;
+        *this = action;
+}
+
+KAccelAction::KAccelAction( const QString& sName, const QString& sLabel, const QString& sWhatsThis,
+                        const KShortcut& cutDef3, const KShortcut& cutDef4,
+                        const QObject* pObjSlot, const char* psMethodSlot,
+                        bool bConfigurable, bool bEnabled )
+{
+
+        d = new KAccelActionPrivate;
+        init( sName, sLabel, sWhatsThis,
+                cutDef3, cutDef4,
+                pObjSlot, psMethodSlot,
+                bConfigurable, bEnabled );
+}
+
+KAccelAction::~KAccelAction()
+{
+
+        delete d;
+}
+
+void KAccelAction::clear()
+{
+        m_cut.clear();
+        m_pObjSlot = 0;
+        m_psMethodSlot = 0;
+        m_bConfigurable = true;
+        m_bEnabled = true;
+        m_nIDAccel = 0;
+        d->m_nConnections = 0;
+}
+
+bool KAccelAction::init( const QString& sName, const QString& sLabel, const QString& sWhatsThis,
+                        const KShortcut& rgCutDefaults3, const KShortcut& rgCutDefaults4,
+                        const QObject* pObjSlot, const char* psMethodSlot,
+                        bool bConfigurable, bool bEnabled )
+{
+        m_sName = sName;
+        m_sLabel = sLabel;
+        m_sWhatsThis = sWhatsThis;
+        m_cutDefault3 = rgCutDefaults3;
+        m_cutDefault4 = rgCutDefaults4;
+        m_pObjSlot = pObjSlot;
+        m_psMethodSlot = psMethodSlot;
+        m_bConfigurable = bConfigurable;
+        m_bEnabled = bEnabled;
+        m_nIDAccel = 0;
+        m_cut = shortcutDefault();
+        d->m_nConnections = 0;
+        if( !m_bEnabled )
+                kdDebug(125) << "KAccelAction::init( \"" << sName << "\" ): created with enabled = false" << endl;
+        return true;
+}
+
+KAccelAction& KAccelAction::operator =( const KAccelAction& action )
+{
+        m_sName = action.m_sName;
+        m_sLabel = action.m_sLabel;
+        m_sWhatsThis = action.m_sWhatsThis;
+        m_cutDefault3 = action.m_cutDefault3;
+        m_cutDefault4 = action.m_cutDefault4;
+        m_pObjSlot = action.m_pObjSlot;
+        m_psMethodSlot = action.m_psMethodSlot;
+        m_bConfigurable = action.m_bConfigurable;
+        m_bEnabled = action.m_bEnabled;
+        m_nIDAccel = action.m_nIDAccel;
+        m_cut = action.m_cut;
+        d->m_nConnections = action.d->m_nConnections;
+
+        return *this;
+}
+
+void KAccelAction::setName( const QString& s )
+        { m_sName = s; }
+void KAccelAction::setLabel( const QString& s )
+        { m_sLabel = s; }
+void KAccelAction::setWhatsThis( const QString& s )
+        { m_sWhatsThis = s; }
+
+bool KAccelAction::setShortcut( const KShortcut& cut )
+{
+        m_cut = cut;
+        return true;
+}
+
+void KAccelAction::setSlot( const QObject* pObjSlot, const char* psMethodSlot )
+{
+        m_pObjSlot = pObjSlot;
+        m_psMethodSlot = psMethodSlot;
+}
+
+void KAccelAction::setConfigurable( bool b )
+        { m_bConfigurable = b; }
+void KAccelAction::setEnabled( bool b )
+        { m_bEnabled = b; }
+
+QString KAccelAction::toString() const
+        { return m_cut.toString(); }
+
+QString KAccelAction::toStringInternal() const
+        { return m_cut.toStringInternal( &shortcutDefault() ); }
+
+bool KAccelAction::setKeySequence( uint i, const KKeySequence& seq )
+{
+        if( i < m_cut.count() ) {
+                m_cut.setSeq( i, seq );
+                return true;
+        } else if( i == m_cut.count() )
+                return m_cut.append( seq );
+        return false;
+}
+
+void KAccelAction::clearShortcut()
+{
+        m_cut.clear();
+}
+
+bool KAccelAction::contains( const KKeySequence& seq )
+{
+        return m_cut.contains( seq );
+        for( uint i = 0; i < m_cut.count(); i++ ) {
+                if( m_cut.seq(i) == seq )
+                        return true;
+        }
+        return false;
+}
+
+const KShortcut& KAccelAction::shortcutDefault() const
+        { return (useFourModifierKeys()) ? m_cutDefault4 : m_cutDefault3; }
+bool KAccelAction::isConnected() const
+        { return d->m_nConnections; }
+void KAccelAction::incConnections()
+        { d->m_nConnections++; }
+void KAccelAction::decConnections()
+        { if( d->m_nConnections > 0 ) d->m_nConnections--; }
+
+
+int KAccelAction::g_bUseFourModifierKeys = -1;
+
+bool KAccelAction::useFourModifierKeys()
+{
+        if( KAccelAction::g_bUseFourModifierKeys == -1 ) {
+
+                KConfigGroupSaver cgs( KGlobal::config(), "Keyboard" );
+                bool b = KGlobal::config()->readBoolEntry( "Use Four Modifier Keys", false );
+                KAccelAction::g_bUseFourModifierKeys = b && KKeyNative::keyboardHasWinKey();
+        }
+        return KAccelAction::g_bUseFourModifierKeys == 1;
+}
+
+void KAccelAction::useFourModifierKeys( bool b )
+{
+        if( KAccelAction::g_bUseFourModifierKeys != (int)b ) {
+                KAccelAction::g_bUseFourModifierKeys = b && KKeyNative::keyboardHasWinKey();
+
+
+                if( b && !KKeyNative::keyboardHasWinKey() )
+                        kdDebug(125) << "Tried to use four modifier keys on a keyboard layout without a Meta key.\n";
+        }
+        KConfigGroupSaver cgs( KGlobal::config(), "Keyboard" );
+        KGlobal::config()->writeEntry( "Use Four Modifier Keys", KAccelAction::g_bUseFourModifierKeys, true, true);
+
+        kdDebug(125) << "bUseFourModifierKeys = " << KAccelAction::g_bUseFourModifierKeys << endl;
+}
+
+
+
+
+
+class KAccelActionsPrivate
+{
+ public:
+};
+
+KAccelActions::KAccelActions()
+{
+        kdDebug(125) << "KAccelActions(): this = " << this << endl;
+        initPrivate( 0 );
+}
+
+KAccelActions::KAccelActions( const KAccelActions& actions )
+{
+        kdDebug(125) << "KAccelActions( actions = " << &actions << " ): this = " << this << endl;
+        initPrivate( 0 );
+        init( actions );
+}
+
+KAccelActions::KAccelActions( KAccelBase* pKAccelBase )
+{
+        kdDebug(125) << "KAccelActions( KAccelBase = " << pKAccelBase << " ): this = " << this << endl;
+        initPrivate( pKAccelBase );
+}
+
+KAccelActions::~KAccelActions()
+{
+
+        clear();
+
+}
+
+void KAccelActions::initPrivate( KAccelBase* pKAccelBase )
+{
+        m_pKAccelBase = pKAccelBase;
+        m_nSizeAllocated = m_nSize = 0;
+        m_prgActions = 0;
+
+}
+
+void KAccelActions::clear()
+{
+        kdDebug(125) << "\tKAccelActions::clear()" << endl;
+        for( uint i = 0; i < m_nSize; i++ )
+                delete m_prgActions[i];
+        delete[] m_prgActions;
+
+        m_nSizeAllocated = m_nSize = 0;
+        m_prgActions = 0;
+}
+
+bool KAccelActions::init( const KAccelActions& actions )
+{
+        clear();
+        resize( actions.count() );
+        for( uint i = 0; i < m_nSize; i++ ) {
+                KAccelAction* pAction = actions.m_prgActions[i];
+                if( pAction )
+                        m_prgActions[i] = new KAccelAction( *pAction );
+                else
+                        m_prgActions[i] = 0;
+        }
+
+        return true;
+}
+
+bool KAccelActions::init( KConfigBase& config, const QString& sGroup )
+{
+        kdDebug(125) << "KAccelActions::init( " << sGroup << " )" << endl;
+        QMap<QString, QString> mapEntry = config.entryMap( sGroup );
+        resize( mapEntry.count() );
+
+        QMap<QString, QString>::Iterator it( mapEntry.begin() );
+        for( uint i = 0; it != mapEntry.end(); ++it, i++ ) {
+                QString sShortcuts = *it;
+                KShortcut cuts;
+
+                kdDebug(125) << it.key() << " = " << sShortcuts << endl;
+                if( !sShortcuts.isEmpty() && sShortcuts != "none" )
+                        cuts.init( sShortcuts );
+
+                m_prgActions[i] = new KAccelAction( it.key(), it.key(), it.key(),
+                        cuts, cuts,
+                        0, 0,
+                        true, false );
+        }
+
+        return true;
+}
+
+void KAccelActions::resize( uint nSize )
+{
+        if( nSize > m_nSizeAllocated ) {
+                uint nSizeAllocated = ((nSize/10) + 1) * 10;
+                KAccelAction** prgActions = new KAccelAction* [nSizeAllocated];
+
+
+                for( uint i = 0; i < m_nSizeAllocated; i++ )
+                        prgActions[i] = m_prgActions[i];
+
+
+                for( uint i = m_nSizeAllocated; i < nSizeAllocated; i++ )
+                        prgActions[i] = 0;
+
+                delete[] m_prgActions;
+                m_prgActions = prgActions;
+                m_nSizeAllocated = nSizeAllocated;
+        }
+
+        m_nSize = nSize;
+}
+
+void KAccelActions::insertPtr( KAccelAction* pAction )
+{
+        resize( m_nSize + 1 );
+        m_prgActions[m_nSize-1] = pAction;
+}
+
+void KAccelActions::updateShortcuts( KAccelActions& actions2 )
+{
+        kdDebug(125) << "KAccelActions::updateShortcuts()" << endl;
+        bool bChanged = false;
+
+        for( uint i = 0; i < m_nSize; i++ ) {
+                KAccelAction* pAction = m_prgActions[i];
+                if( pAction && pAction->m_bConfigurable ) {
+                        KAccelAction* pAction2 = actions2.actionPtr( pAction->m_sName );
+                        if( pAction2 ) {
+                                QString sOld = pAction->m_cut.toStringInternal();
+                                pAction->m_cut = pAction2->m_cut;
+                                kdDebug(125) << "\t" << pAction->m_sName
+                                        << " found: " << sOld
+                                        << " => " << pAction2->m_cut.toStringInternal()
+                                        << " = " << pAction->m_cut.toStringInternal() << endl;
+                                bChanged = true;
+                        }
+                }
+        }
+
+        if( bChanged )
+                emitKeycodeChanged();
+}
+
+int KAccelActions::actionIndex( const QString& sAction ) const
+{
+        for( uint i = 0; i < m_nSize; i++ ) {
+                if( m_prgActions[i] == 0 )
+                        kdWarning(125) << "KAccelActions::actionPtr( " << sAction << " ): encountered null pointer at m_prgActions[" << i << "]" << endl;
+                else if( m_prgActions[i]->m_sName == sAction )
+                        return (int) i;
+        }
+        return -1;
+}
+
+KAccelAction* KAccelActions::actionPtr( uint i )
+{
+        return m_prgActions[i];
+}
+
+const KAccelAction* KAccelActions::actionPtr( uint i ) const
+{
+        return m_prgActions[i];
+}
+
+KAccelAction* KAccelActions::actionPtr( const QString& sAction )
+{
+        int i = actionIndex( sAction );
+        return (i >= 0) ? m_prgActions[i] : 0;
+}
+
+const KAccelAction* KAccelActions::actionPtr( const QString& sAction ) const
+{
+        int i = actionIndex( sAction );
+        return (i >= 0) ? m_prgActions[i] : 0;
+}
+
+KAccelAction* KAccelActions::actionPtr( KKeySequence cut )
+{
+        for( uint i = 0; i < m_nSize; i++ ) {
+                if( m_prgActions[i] == 0 )
+                        kdWarning(125) << "KAccelActions::actionPtr( " << cut.toStringInternal() << " ): encountered null pointer at m_prgActions[" << i << "]" << endl;
+                else if( m_prgActions[i]->contains( cut ) )
+                        return m_prgActions[i];
+        }
+        return 0;
+}
+
+KAccelAction& KAccelActions::operator []( uint i )
+{
+        return *actionPtr( i );
+}
+
+const KAccelAction& KAccelActions::operator []( uint i ) const
+{
+        return *actionPtr( i );
+}
+
+KAccelAction* KAccelActions::insert( const QString& sName, const QString& sLabel )
+{
+        if( actionPtr( sName ) ) {
+                kdWarning(125) << "KAccelActions::insertLabel( " << sName << ", " << sLabel << " ): action with same name already present." << endl;
+                return 0;
+        }
+
+        KAccelAction* pAction = new KAccelAction;
+        pAction->m_sName = sName;
+        pAction->m_sLabel = sLabel;
+        pAction->m_bConfigurable = false;
+        pAction->m_bEnabled = false;
+
+        insertPtr( pAction );
+        return pAction;
+}
+
+KAccelAction* KAccelActions::insert( const QString& sAction, const QString& sLabel, const QString& sWhatsThis,
+                        const KShortcut& rgCutDefaults3, const KShortcut& rgCutDefaults4,
+                        const QObject* pObjSlot, const char* psMethodSlot,
+                        bool bConfigurable, bool bEnabled )
+{
+
+        if( actionPtr( sAction ) ) {
+                kdWarning(125) << "KAccelActions::insert( " << sAction << " ): action with same name already present." << endl;
+                return 0;
+        }
+
+        KAccelAction* pAction = new KAccelAction(
+                sAction, sLabel, sWhatsThis,
+                rgCutDefaults3, rgCutDefaults4,
+                pObjSlot, psMethodSlot,
+                bConfigurable, bEnabled );
+        insertPtr( pAction );
+
+
+        return pAction;
+}
+
+bool KAccelActions::remove( const QString& sAction )
+{
+        kdDebug(125) << "KAccelActions::remove( \"" << sAction << "\" ): this = " << this << " m_pKAccelBase = " << m_pKAccelBase << endl;
+
+        int iAction = actionIndex( sAction );
+        if( iAction < 0 )
+                return false;
+
+        if( m_pKAccelBase )
+                m_pKAccelBase->slotRemoveAction( m_prgActions[iAction] );
+        delete m_prgActions[iAction];
+
+        for( uint i = iAction; i < m_nSize - 1; i++ )
+                m_prgActions[i] = m_prgActions[i+1];
+        m_nSize--;
+
+        return true;
+}
+
+bool KAccelActions::readActions( const QString& sConfigGroup, KConfigBase* pConfig )
+{
+        return KAccelShortcutList(*this, false).readSettings( sConfigGroup, pConfig );
+}
+bool KAccelActions::writeActions( const QString &sGroup, KConfigBase* pConfig,
+                        bool bWriteAll, bool bGlobal ) const
+{
+        kdDebug(125) << "KAccelActions::writeActions( " << sGroup << ", " << pConfig << ", " << bWriteAll << ", " << bGlobal << " )" << endl;
+        if( !pConfig )
+                pConfig = KGlobal::config();
+        KConfigGroupSaver cs( pConfig, sGroup );
+
+        for( uint i = 0; i < m_nSize; i++ ) {
+                if( m_prgActions[i] == 0 ) {
+                        kdWarning(125) << "KAccelActions::writeActions(): encountered null pointer at m_prgActions[" << i << "]" << endl;
+                        continue;
+                }
+                const KAccelAction& action = *m_prgActions[i];
+
+                QString s;
+                bool bConfigHasAction = !pConfig->readEntry( action.m_sName ).isEmpty();
+                bool bSameAsDefault = true;
+                bool bWriteAction = false;
+
+                if( action.m_bConfigurable ) {
+                        s = action.toStringInternal();
+                        bSameAsDefault = (action.m_cut == action.shortcutDefault());
+
+
+                        if( s.isEmpty() )
+                                s = "none";
+
+
+
+                        if( bWriteAll || !bSameAsDefault )
+                                bWriteAction = true;
+
+                        if( bWriteAction ) {
+                                kdDebug(125) << "\twriting " << action.m_sName << " = " << s << endl;
+
+
+                                pConfig->writeEntry( action.m_sName, s, true, bGlobal );
+                        }
+
+
+                        else if( bConfigHasAction ) {
+                                kdDebug(125) << "\tremoving " << action.m_sName << " because == default" << endl;
+                                pConfig->deleteEntry( action.m_sName, bGlobal );
+                        }
+
+                }
+        }
+
+        pConfig->sync();
+        return true;
+}
+
+void KAccelActions::emitKeycodeChanged()
+{
+        if( m_pKAccelBase )
+                m_pKAccelBase->emitSignal( KAccelBase::KEYCODE_CHANGED );
+}
+
+uint KAccelActions::count() const
+        { return m_nSize; }
+
+
+
+
+
+
+
+class QSimpleRichText;
+class QLabelPrivate;
+
+class QLabel : public QFrame
+{
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+   
+   
+   
+   
+   
+   
+   
+
+public:
+    QLabel( QWidget *parent, const char* name=0, WFlags f=0 );
+    QLabel( const QString &text, QWidget *parent, const char* name=0,
+            WFlags f=0 );
+    QLabel( QWidget *buddy, const QString &,
+            QWidget *parent, const char* name=0, WFlags f=0 );
+    ~QLabel();
+
+    QString text() const { return ltext; }
+    QPixmap *pixmap() const { return lpixmap; }
+
+    QPicture *picture() const { return lpicture; }
+
+
+    QMovie *movie() const;
+
+
+    TextFormat textFormat() const;
+    void setTextFormat( TextFormat );
+
+    int alignment() const { return align; }
+    virtual void setAlignment( int );
+    int indent() const { return extraMargin; }
+    void setIndent( int );
+
+    bool autoResize() const { return autoresize; }
+    virtual void setAutoResize( bool );
+
+    bool hasScaledContents() const;
+    void setScaledContents( bool );
+
+    QSize sizeHint() const;
+    QSize minimumSizeHint() const;
+
+    virtual void setBuddy( QWidget * );
+    QWidget *buddy() const;
+
+    int heightForWidth(int) const;
+
+    void setFont( const QFont &f );
+
+public :
+    virtual void setText( const QString &);
+    virtual void setPixmap( const QPixmap & );
+
+    virtual void setPicture( const QPicture & );
+
+
+    virtual void setMovie( const QMovie & );
+
+    virtual void setNum( int );
+    virtual void setNum( double );
+    void clear();
+
+protected:
+    void drawContents( QPainter * );
+    void fontChange( const QFont & );
+    void resizeEvent( QResizeEvent* );
+
+private :
+
+    void acceleratorSlot();
+    void buddyDied();
+
+
+    void movieUpdated(const QRect&);
+    void movieResized(const QSize&);
+
+
+private:
+    void init();
+    void clearContents();
+    void updateLabel( QSize oldSizeHint );
+    QSize sizeForWidth( int w ) const;
+    QString ltext;
+    QPixmap *lpixmap;
+
+    QPicture *lpicture;
+
+
+    QMovie * lmovie;
+
+
+    QWidget * lbuddy;
+
+    ushort align;
+    short extraMargin;
+    uint autoresize:1;
+    uint scaledcontents :1;
+    TextFormat textformat;
+
+    QSimpleRichText* doc;
+
+
+    QAccel * accel;
+
+    QLabelPrivate* d;
+
+    friend class QTipLabel;
+
+private:
+
+    QLabel( const QLabel & );
+    QLabel &operator=( const QLabel & );
+
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+class QSignal : public QObject
+{
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+
+public:
+    QSignal( QObject *parent=0, const char *name=0 );
+    ~QSignal();
+
+    bool connect( const QObject *receiver, const char *member );
+    bool disconnect( const QObject *receiver, const char *member=0 );
+
+    void activate();
+
+
+    bool isBlocked() const { return QObject::signalsBlocked(); }
+    void block( bool b ) { QObject::blockSignals( b ); }
+
+    void setParameter( int value );
+    int parameter() const;
+
+
+
+
+    void setValue( const QVariant &value );
+    QVariant value() const;
+
+protected:
+
+    void signal( const QVariant& );
+
+    void intSignal( int );
+
+private:
+
+    QVariant val;
+
+private:
+
+    QSignal( const QSignal & );
+    QSignal &operator=( const QSignal & );
+
+};
+
+
+
+
+
+class QPopupMenu;
+class QMenuDataData;
+class QObject;
+
+class QCustomMenuItem;
+class QMenuItemData;
+
+class QMenuItem
+{
+friend class QMenuData;
+public:
+    QMenuItem();
+   ~QMenuItem();
+
+    int id() const { return ident; }
+    QIconSet *iconSet() const { return iconset_data; }
+    QString text() const { return text_data; }
+    QString whatsThis() const { return whatsthis_data; }
+    QPixmap *pixmap() const { return pixmap_data; }
+    QPopupMenu *popup() const { return popup_menu; }
+    QWidget *widget() const { return widget_item; }
+    QCustomMenuItem *custom() const;
+
+    QKeySequence key() const { return accel_key; }
+
+    QSignal *signal() const { return signal_data; }
+    bool isSeparator() const { return is_separator; }
+    bool isEnabled() const { return is_enabled; }
+    bool isChecked() const { return is_checked; }
+    bool isDirty() const { return is_dirty; }
+    bool isVisible() const { return is_visible; }
+    bool isEnabledAndVisible() const { return is_enabled && is_visible; }
+
+    void setText( const QString &text ) { text_data = text; }
+    void setDirty( bool dirty ) { is_dirty = dirty; }
+    void setVisible( bool visible ) { is_visible = visible; }
+    void setWhatsThis( const QString &text ) { whatsthis_data = text; }
+
+private:
+    int ident;
+    QIconSet *iconset_data;
+    QString text_data;
+    QString whatsthis_data;
+    QPixmap *pixmap_data;
+    QPopupMenu *popup_menu;
+    QWidget *widget_item;
+
+    QKeySequence accel_key;
+
+    QSignal *signal_data;
+    uint is_separator : 1;
+    uint is_enabled : 1;
+    uint is_checked : 1;
+    uint is_dirty : 1;
+    uint is_visible : 1;
+    QMenuItemData* d;
+
+    QMenuItemData* extra();
+
+private:
+
+    QMenuItem( const QMenuItem & );
+    QMenuItem &operator=( const QMenuItem & );
+
+};
+
+
+typedef QPtrList<QMenuItem> QMenuItemList;
+typedef QPtrListIterator<QMenuItem> QMenuItemListIt;
+
+
+class QCustomMenuItem : public Qt
+{
+public:
+    QCustomMenuItem();
+    virtual ~QCustomMenuItem();
+    virtual bool fullSpan() const;
+    virtual bool isSeparator() const;
+    virtual void setFont( const QFont& font );
+    virtual void paint( QPainter* p, const QColorGroup& cg, bool act,
+                        bool enabled, int x, int y, int w, int h ) = 0;
+    virtual QSize sizeHint() = 0;
+};
+
+
+class QMenuData
+{
+friend class QMenuBar;
+friend class QPopupMenu;
+public:
+    QMenuData();
+    virtual ~QMenuData();
+
+    uint count() const;
+
+
+    int insertItem( const QString &text,
+                            const QObject *receiver, const char* member,
+                            const QKeySequence& accel = 0, int id = -1, int index = -1 );
+    int insertItem( const QIconSet& icon,
+                            const QString &text,
+                            const QObject *receiver, const char* member,
+                            const QKeySequence& accel = 0, int id = -1, int index = -1 );
+    int insertItem( const QPixmap &pixmap,
+                            const QObject *receiver, const char* member,
+                            const QKeySequence& accel = 0, int id = -1, int index = -1 );
+    int insertItem( const QIconSet& icon,
+                            const QPixmap &pixmap,
+                            const QObject *receiver, const char* member,
+                            const QKeySequence& accel = 0, int id = -1, int index = -1 );
+
+    int insertItem( const QString &text, int id=-1, int index=-1 );
+    int insertItem( const QIconSet& icon,
+                            const QString &text, int id=-1, int index=-1 );
+
+    int insertItem( const QString &text, QPopupMenu *popup,
+                            int id=-1, int index=-1 );
+    int insertItem( const QIconSet& icon,
+                            const QString &text, QPopupMenu *popup,
+                            int id=-1, int index=-1 );
+
+
+    int insertItem( const QPixmap &pixmap, int id=-1, int index=-1 );
+    int insertItem( const QIconSet& icon,
+                            const QPixmap &pixmap, int id=-1, int index=-1 );
+    int insertItem( const QPixmap &pixmap, QPopupMenu *popup,
+                            int id=-1, int index=-1 );
+    int insertItem( const QIconSet& icon,
+                            const QPixmap &pixmap, QPopupMenu *popup,
+                            int id=-1, int index=-1 );
+
+    int insertItem( QWidget* widget, int id=-1, int index=-1 );
+
+    int insertItem( const QIconSet& icon, QCustomMenuItem* custom, int id=-1, int index=-1 );
+    int insertItem( QCustomMenuItem* custom, int id=-1, int index=-1 );
+
+
+    int insertSeparator( int index=-1 );
+
+    void removeItem( int id );
+    void removeItemAt( int index );
+    void clear();
+
+
+    QKeySequence accel( int id ) const;
+    void setAccel( const QKeySequence& key, int id );
+
+
+    QIconSet *iconSet( int id ) const;
+    QString text( int id ) const;
+    QPixmap *pixmap( int id ) const;
+
+    void setWhatsThis( int id, const QString& );
+    QString whatsThis( int id ) const;
+
+
+    void changeItem( int id, const QString &text );
+    void changeItem( int id, const QPixmap &pixmap );
+    void changeItem( int id, const QIconSet &icon, const QString &text );
+    void changeItem( int id, const QIconSet &icon, const QPixmap &pixmap );
+
+    void changeItem( const QString &text, int id ) { changeItem( id, text); }
+    void changeItem( const QPixmap &pixmap, int id ) { changeItem( id, pixmap ); }
+    void changeItem( const QIconSet &icon, const QString &text, int id ) {
+        changeItem( id, icon, text );
+    }
+
+    bool isItemActive( int id ) const;
+
+    bool isItemEnabled( int id ) const;
+    void setItemEnabled( int id, bool enable );
+
+    bool isItemChecked( int id ) const;
+    void setItemChecked( int id, bool check );
+
+    bool isItemVisible( int id ) const;
+    void setItemVisible( int id, bool visible );
+
+    virtual void updateItem( int id );
+
+    int indexOf( int id ) const;
+    int idAt( int index ) const;
+    virtual void setId( int index, int id );
+
+    bool connectItem( int id,
+                             const QObject *receiver, const char* member );
+    bool disconnectItem( int id,
+                                const QObject *receiver, const char* member );
+
+    bool setItemParameter( int id, int param );
+    int itemParameter( int id ) const;
+
+    QMenuItem *findItem( int id ) const;
+    QMenuItem *findItem( int id, QMenuData ** parent ) const;
+    QMenuItem * findPopup( QPopupMenu *, int *index = 0 );
+
+    virtual void activateItemAt( int index );
+
+protected:
+    int actItem;
+    QMenuItemList *mitems;
+    QMenuData *parentMenu;
+    uint isPopupMenu : 1;
+    uint isMenuBar : 1;
+    uint badSize : 1;
+    uint mouseBtDn : 1;
+    uint avoid_circularity : 1;
+    uint actItemDown : 1;
+    virtual void menuContentsChanged();
+    virtual void menuStateChanged();
+    virtual void menuInsPopup( QPopupMenu * );
+    virtual void menuDelPopup( QPopupMenu * );
+
+private:
+    int insertAny( const QString *, const QPixmap *, QPopupMenu *,
+                           const QIconSet*, int, int, QWidget* = 0, QCustomMenuItem* = 0);
+    void removePopup( QPopupMenu * );
+    void changeItemIconSet( int id, const QIconSet &icon );
+
+    QMenuDataData *d;
+
+private:
+
+    QMenuData( const QMenuData & );
+    QMenuData &operator=( const QMenuData & );
+
+};
+
+
+
+class QPopupMenuPrivate;
+
+class QPopupMenu : public QFrame, public QMenuData
+{
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+   
+public:
+    QPopupMenu( QWidget* parent=0, const char* name=0 );
+    ~QPopupMenu();
+
+    void popup( const QPoint & pos, int indexAtPoint = -1 );
+    void updateItem( int id );
+
+    virtual void setCheckable( bool );
+    bool isCheckable() const;
+
+    void setFont( const QFont & );
+    void show();
+    void hide();
+
+    int exec();
+    int exec( const QPoint & pos, int indexAtPoint = 0 );
+
+    virtual void setActiveItem( int );
+    QSize sizeHint() const;
+
+    int idAt( int index ) const { return QMenuData::idAt( index ); }
+    int idAt( const QPoint& pos ) const;
+
+    bool customWhatsThis() const;
+
+    int insertTearOffHandle( int id=-1, int index=-1 );
+
+    void activateItemAt( int index );
+    QRect itemGeometry( int index );
+
+
+protected:
+    void activated( int itemId );
+    void highlighted( int itemId );
+    void activatedRedirect( int itemId );
+    void highlightedRedirect( int itemId );
+    void aboutToShow();
+    void aboutToHide();
+
+protected:
+    int itemHeight( int ) const;
+    int itemHeight( QMenuItem* mi ) const;
+    void drawItem( QPainter* p, int tab, QMenuItem* mi,
+                   bool act, int x, int y, int w, int h);
+
+    void drawContents( QPainter * );
+
+    void closeEvent( QCloseEvent *e );
+    void paintEvent( QPaintEvent * );
+    void mousePressEvent( QMouseEvent * );
+    void mouseReleaseEvent( QMouseEvent * );
+    void mouseMoveEvent( QMouseEvent * );
+    void keyPressEvent( QKeyEvent * );
+    void focusInEvent( QFocusEvent * );
+    void focusOutEvent( QFocusEvent * );
+    void timerEvent( QTimerEvent * );
+    void leaveEvent( QEvent * );
+    void styleChange( QStyle& );
+    void enabledChange( bool );
+    int columns() const;
+
+    bool focusNextPrevChild( bool next );
+
+    int itemAtPos( const QPoint &, bool ignoreSeparator = TRUE ) const;
+
+private :
+    void subActivated( int itemId );
+    void subHighlighted( int itemId );
+
+    void accelActivated( int itemId );
+    void accelDestroyed();
+
+    void popupDestroyed( QObject* );
+    void modalActivation( int );
+
+    void subMenuTimer();
+    void subScrollTimer();
+    void allowAnimation();
+    void toggleTearOff();
+
+    void performDelayedChanges();
+
+private:
+    void updateScrollerState();
+    void menuContentsChanged();
+    void menuStateChanged();
+    void performDelayedContentsChanged();
+    void performDelayedStateChanged();
+    void menuInsPopup( QPopupMenu * );
+    void menuDelPopup( QPopupMenu * );
+    void frameChanged();
+
+    void actSig( int, bool = FALSE );
+    void hilitSig( int );
+    virtual void setFirstItemActive();
+    void hideAllPopups();
+    void hidePopups();
+    bool tryMenuBar( QMouseEvent * );
+    void byeMenuBar();
+
+    void updateSize();
+    void updateRow( int row );
+
+    void updateAccel( QWidget * );
+    void enableAccel( bool );
+
+    QPopupMenuPrivate *d;
+
+    QAccel *autoaccel;
+
+
+
+
+
+
+
+    int popupActive;
+    int tab;
+    uint accelDisabled : 1;
+    uint checkable : 1;
+    uint connectModalRecursionSafety : 1;
+    uint tornOff : 1;
+    uint pendingDelayedContentsChanges : 1;
+    uint pendingDelayedStateChanges : 1;
+    int maxPMWidth;
+    int ncols;
+    bool snapToMouse;
+    bool tryMouseEvent( QPopupMenu *, QMouseEvent * );
+
+    friend class QMenuData;
+    friend class QMenuBar;
+
+    void connectModal(QPopupMenu* receiver, bool doConnect);
+
+private:
+
+    QPopupMenu( const QPopupMenu & );
+    QPopupMenu &operator=( const QPopupMenu & );
+
+};
+
+
+
+
+
+
+
+
+
+
+class QLabel;
+
+class KAccelActions;
+
+
+
+
+class KShortcutMenu : public QPopupMenu
+{
+        public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+ public:
+        KShortcutMenu( QWidget* pParent, KAccelActions* pActions, KKeySequence seq );
+
+        bool insertAction( uint iAction, KKeySequence seq );
+
+        void updateShortcuts();
+
+ protected:
+        void keyPressEvent( QKeyEvent* pEvent );
+
+ private:
+        int searchForKey( KKey key );
+        void keepItemsMatching( KKey key );
+
+ private:
+        typedef QMap<uint, KKeySequence> IndexToKKeySequence;
+
+        KAccelActions* m_pActions;
+        KKeySequence m_seq;
+        QLabel* pTitle;
+        IndexToKKeySequence m_seqs;
+};
+
+
+KShortcutMenu::KShortcutMenu( QWidget* pParent, KAccelActions* pActions, KKeySequence seq )
+: QPopupMenu( pParent ),
+        m_pActions( pActions ),
+        m_seq( seq )
+{
+        kdDebug() << seq.toStringInternal() << endl;
+
+        QFont fontTitle = KGlobalSettings::menuFont();
+        fontTitle.setBold( true );
+
+        pTitle = new QLabel( "", (QWidget*)0 );
+        pTitle->setFont( fontTitle );
+        pTitle->setFrameShape( QFrame::Panel );
+
+        insertItem( pTitle );
+}
+
+bool KShortcutMenu::insertAction( uint iAction, KKeySequence seq )
+{
+        KAccelAction* pAction = m_pActions->actionPtr( iAction );
+
+        if( pAction ) {
+                insertItem( "", iAction );
+                m_seqs[indexOf(iAction)] = seq;
+                return true;
+        } else
+                return false;
+}
+
+
+void KShortcutMenu::updateShortcuts()
+{
+        pTitle->setText( m_seq.toString() + ",..." );
+
+        for( uint iItem = 1; iItem < count(); iItem++ ) {
+                int iAction = idAt( iItem );
+                if( iAction >= 0 ) {
+                        KAccelAction* pAction = m_pActions->actionPtr( iAction );
+                        if( pAction ) {
+                                KKeySequence seq = m_seqs[iItem];
+                                QString sSeq = seq.key(m_seq.count()).toString();
+                                for( uint iKey = m_seq.count() + 1; iKey < seq.count(); iKey++ )
+                                        sSeq += QString(",") + seq.key(iKey).toString();
+
+                                kdDebug(125) << "seq = " << seq.toStringInternal() << " sSeq = " << sSeq << endl;
+                                changeItem( iAction, pAction->label() + "\t" + sSeq );
+                        }
+                }
+        }
+}
+
+void KShortcutMenu::keyPressEvent( QKeyEvent* pEvent )
+{
+        kdDebug() << "keypress; " << pEvent->key() << endl;
+        KKey key( pEvent );
+
+        switch( pEvent->key() ) {
+         case Key_Shift:
+         case Key_Control:
+         case Key_Alt:
+         case Key_Meta:
+         case Key_Super_L:
+         case Key_Super_R:
+         case Key_Hyper_L:
+         case Key_Hyper_R:
+                break;
+         default:
+                int iItem = searchForKey( key );
+
+                if( iItem == -1 ) {
+                        key = pEvent->key();
+                        iItem = searchForKey( key );
+                }
+
+                if( iItem == -1 ) {
+
+
+                        if( pEvent->key() == Qt::Key_Up || pEvent->key() == Qt::Key_Down ||
+                            pEvent->key() == Qt::Key_Enter || pEvent->key() == Qt::Key_Return )
+                                QPopupMenu::keyPressEvent( pEvent );
+                        else
+                                close();
+                }
+                else if( iItem == 0 )
+                        keepItemsMatching( key );
+                else
+                        activateItemAt( iItem );
+        }
+}
+
+int KShortcutMenu::searchForKey( KKey key )
+{
+        int iItemFound = -1;
+        uint iKey = m_seq.count();
+
+        for( uint iItem = 1; iItem < count(); iItem++ ) {
+                if( m_seqs.contains( iItem ) ) {
+                        KKey keyItem = m_seqs[iItem].key( iKey );
+
+                        if( key == keyItem ) {
+                                if( iItemFound == -1 )
+                                        iItemFound = iItem;
+                                else
+                                        return 0;
+                        }
+                }
+        }
+
+        return iItemFound;
+}
+
+void KShortcutMenu::keepItemsMatching( KKey key )
+{
+        kdDebug(125) << "MyAccel::keepItemsMatching( " << key.toStringInternal() << " )" << endl;
+
+        uint iKey = m_seq.count();
+        m_seq.setKey( iKey, key );
+
+        for( uint iItem = 1; iItem < count(); iItem++ ) {
+                if( m_seqs.contains( iItem ) ) {
+                        KKey keyItem = m_seqs[iItem].key( iKey );
+                        if( key != keyItem ) {
+                                m_seqs.remove( iItem );
+                                removeItemAt( iItem-- );
+                        }
+                }
+        }
+
+        updateShortcuts();
+}
+
+const char *KShortcutMenu::className() const
+{
+    return "KShortcutMenu";
+}
+
+QMetaObject *KShortcutMenu::metaObj = 0;
+static QMetaObjectCleanUp cleanUp_KShortcutMenu( "KShortcutMenu", &KShortcutMenu::staticMetaObject );
+QMetaObject* KShortcutMenu::staticMetaObject()
+{
+    if ( metaObj )
+        return metaObj;
+    QMetaObject* parentObject = QPopupMenu::staticMetaObject();
+    metaObj = QMetaObject::new_metaobject(
+        "KShortcutMenu", parentObject,
+        0, 0,
+        0, 0,
+
+        0, 0,
+        0, 0,
+
+        0, 0 );
+    cleanUp_KShortcutMenu.setMetaObject( metaObj );
+    return metaObj;
+}
+
+void* KShortcutMenu::qt_cast( const char* clname )
+{
+    if ( !qstrcmp( clname, "KShortcutMenu" ) )
+        return this;
+    return QPopupMenu::qt_cast( clname );
+}
+
+bool KShortcutMenu::qt_invoke( int _id, QUObject* _o )
+{
+    return QPopupMenu::qt_invoke(_id,_o);
+}
+
+bool KShortcutMenu::qt_emit( int _id, QUObject* _o )
+{
+    return QPopupMenu::qt_emit(_id,_o);
+}
+
+
+bool KShortcutMenu::qt_property( int id, int f, QVariant* v)
+{
+    return QPopupMenu::qt_property( id, f, v);
+}
+
+bool KShortcutMenu::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; }
+KAccelBase::KAccelBase( int fInitCode )
+: m_rgActions( this )
+{
+        kdDebug(125) << "KAccelBase(): this = " << this << endl;
+        m_bNativeKeys = fInitCode & NATIVE_KEYS;
+        m_bEnabled = true;
+        m_sConfigGroup = "Shortcuts";
+        m_bConfigIsGlobal = false;
+        m_bAutoUpdate = false;
+        mtemp_pActionRemoving = 0;
+}
+
+KAccelBase::~KAccelBase()
+{
+        kdDebug(125) << "~KAccelBase(): this = " << this << endl;
+}
+
+uint KAccelBase::actionCount() const { return m_rgActions.count(); }
+KAccelActions& KAccelBase::actions() { return m_rgActions; }
+bool KAccelBase::isEnabled() const { return m_bEnabled; }
+
+KAccelAction* KAccelBase::actionPtr( const QString& sAction )
+        { return m_rgActions.actionPtr( sAction ); }
+
+const KAccelAction* KAccelBase::actionPtr( const QString& sAction ) const
+        { return m_rgActions.actionPtr( sAction ); }
+
+KAccelAction* KAccelBase::actionPtr( const KKeyServer::Key& key )
+{
+        if( !m_mapKeyToAction.contains( key ) )
+                return 0;
+
+        return m_mapKeyToAction[key].pAction;
+}
+
+KAccelAction* KAccelBase::actionPtr( const KKey& key )
+{
+        KKeyServer::Key k2;
+        k2.init( key, !m_bNativeKeys );
+        return actionPtr( k2 );
+}
+
+void KAccelBase::setConfigGroup( const QString& sConfigGroup )
+        { m_sConfigGroup = sConfigGroup; }
+
+void KAccelBase::setConfigGlobal( bool global )
+        { m_bConfigIsGlobal = global; }
+
+bool KAccelBase::setActionEnabled( const QString& sAction, bool bEnable )
+{
+        KAccelAction* pAction = actionPtr( sAction );
+        if( pAction ) {
+                if( pAction->m_bEnabled != bEnable ) {
+                        kdDebug(125) << "KAccelBase::setActionEnabled( " << sAction << ", " << bEnable << " )" << endl;
+                        pAction->m_bEnabled = bEnable;
+                        if( m_bAutoUpdate ) {
+
+                                if( bEnable )
+                                        insertConnection( pAction );
+                                else if( pAction->isConnected() )
+                                        removeConnection( pAction );
+                        }
+                }
+                return true;
+        }
+        return false;
+}
+
+bool KAccelBase::setAutoUpdate( bool bAuto )
+{
+        kdDebug(125) << "KAccelBase::setAutoUpdate( " << bAuto << " ): m_bAutoUpdate on entrance = " << m_bAutoUpdate << endl;
+        bool b = m_bAutoUpdate;
+        if( !m_bAutoUpdate && bAuto )
+                updateConnections();
+        m_bAutoUpdate = bAuto;
+        return b;
+}
+
+KAccelAction* KAccelBase::insert( const QString& sAction, const QString& sDesc, const QString& sHelp,
+                        const KShortcut& rgCutDefaults3, const KShortcut& rgCutDefaults4,
+                        const QObject* pObjSlot, const char* psMethodSlot,
+                        bool bConfigurable, bool bEnabled )
+{
+
+        KAccelAction* pAction = m_rgActions.insert(
+                sAction, sDesc, sHelp,
+                rgCutDefaults3, rgCutDefaults4,
+                pObjSlot, psMethodSlot,
+                bConfigurable, bEnabled );
+
+        if( pAction && m_bAutoUpdate )
+                insertConnection( pAction );
+
+
+        return pAction;
+}
+
+KAccelAction* KAccelBase::insert( const QString& sName, const QString& sDesc )
+        { return m_rgActions.insert( sName, sDesc ); }
+
+bool KAccelBase::remove( const QString& sAction )
+{
+        return m_rgActions.remove( sAction );
+}
+
+void KAccelBase::slotRemoveAction( KAccelAction* pAction )
+{
+        removeConnection( pAction );
+}
+
+bool KAccelBase::setActionSlot( const QString& sAction, const QObject* pObjSlot, const char* psMethodSlot )
+{
+        kdDebug(125) << "KAccelBase::setActionSlot( " << sAction << ", " << pObjSlot << ", " << psMethodSlot << " )\n";
+        KAccelAction* pAction = m_rgActions.actionPtr( sAction );
+        if( pAction ) {
+
+                if( m_bAutoUpdate && pAction->isConnected() ) {
+                        kdDebug(125) << "\tm_pObjSlot = " << pAction->m_pObjSlot << " m_psMethodSlot = " << pAction->m_psMethodSlot << endl;
+                        removeConnection( pAction );
+                }
+
+                pAction->m_pObjSlot = pObjSlot;
+                pAction->m_psMethodSlot = psMethodSlot;
+
+
+                if( m_bAutoUpdate && pObjSlot && psMethodSlot )
+                        insertConnection( pAction );
+
+                return true;
+        } else
+                return false;
+}
+struct KAccelBase::X
+{
+        uint iAction, iSeq, iVari;
+        KKeyServer::Key key;
+
+        X() {}
+        X( uint _iAction, uint _iSeq, uint _iVari, const KKeyServer::Key& _key )
+                { iAction = _iAction; iSeq = _iSeq; iVari = _iVari; key = _key; }
+
+        int compare( const X& x )
+        {
+                int n = key.compare( x.key );
+                if( n != 0 ) return n;
+                if( iVari != x.iVari ) return iVari - x.iVari;
+                if( iSeq != x.iSeq ) return iSeq - x.iSeq;
+                return 0;
+        }
+
+        bool operator <( const X& x ) { return compare( x ) < 0; }
+        bool operator >( const X& x ) { return compare( x ) > 0; }
+        bool operator <=( const X& x ) { return compare( x ) <= 0; }
+};
+bool KAccelBase::updateConnections()
+{
+        kdDebug(125) << "KAccelBase::updateConnections()  this = " << this << endl;
+
+
+        QValueVector<X> rgKeys;
+        createKeyList( rgKeys );
+        m_rgActionsNonUnique.clear();
+
+        KKeyToActionMap mapKeyToAction;
+        for( uint i = 0; i < rgKeys.size(); i++ ) {
+                X& x = rgKeys[i];
+                KKeyServer::Key& key = x.key;
+                ActionInfo info;
+                bool bNonUnique = false;
+
+                info.pAction = m_rgActions.actionPtr( x.iAction );
+                info.iSeq = x.iSeq;
+                info.iVariation = x.iVari;
+
+
+                if( info.pAction->shortcut().seq(info.iSeq).count() > 1 )
+                        bNonUnique = true;
+
+                else if( i < rgKeys.size() - 1 && key == rgKeys[i+1].key ) {
+
+
+                        if( info.iVariation == rgKeys[i+1].iVari && info.iSeq == rgKeys[i+1].iSeq )
+                                bNonUnique = true;
+
+                        kdDebug(125) << "key conflict = " << key.key().toStringInternal()
+                                << " action1 = " << info.pAction->name()
+                                << " action2 = " << m_rgActions.actionPtr( rgKeys[i+1].iAction )->name()
+                                << " non-unique = " << bNonUnique << endl;
+
+
+                        while( i < rgKeys.size() - 1 && key == rgKeys[i+1].key )
+                                i++;
+                }
+
+                if( bNonUnique ) {
+
+                        if( m_mapKeyToAction.contains( key ) ) {
+                                KAccelAction* pAction = m_mapKeyToAction[key].pAction;
+                                if( pAction ) {
+                                        m_mapKeyToAction.remove( key );
+                                        disconnectKey( *pAction, key );
+                                        pAction->decConnections();
+                                        m_rgActionsNonUnique.append( pAction );
+                                }
+                        }
+
+                        m_rgActionsNonUnique.append( info.pAction );
+                        info.pAction = 0;
+                }
+
+
+                mapKeyToAction[key] = info;
+        }
+
+
+        for( KKeyToActionMap::iterator it = m_mapKeyToAction.begin(); it != m_mapKeyToAction.end(); ++it ) {
+                const KKeyServer::Key& key = it.key();
+                KAccelAction* pAction = (*it).pAction;
+
+                if( !mapKeyToAction.contains( key ) || mapKeyToAction[key].pAction != pAction ) {
+                        if( pAction ) {
+                                disconnectKey( *pAction, key );
+                                pAction->decConnections();
+                        } else
+                                disconnectKey( key );
+                }
+        }
+
+
+
+
+        for( KKeyToActionMap::iterator it = mapKeyToAction.begin(); it != mapKeyToAction.end(); ++it ) {
+                const KKeyServer::Key& key = it.key();
+                KAccelAction* pAction = (*it).pAction;
+                if( !m_mapKeyToAction.contains( key ) || m_mapKeyToAction[key].pAction != pAction ) {
+
+
+                        if( pAction ) {
+                                if( connectKey( *pAction, key ) )
+                                        pAction->incConnections();
+                        } else
+                                connectKey( key );
+                }
+        }
+
+
+        m_mapKeyToAction = mapKeyToAction;
+
+
+        for( KKeyToActionMap::iterator it = m_mapKeyToAction.begin(); it != m_mapKeyToAction.end(); ++it ) {
+                kdDebug(125) << "Key: " << it.key().key().toStringInternal() << " => '"
+                        << (((*it).pAction) ? (*it).pAction->name() : QString::null) << "'" << endl;
+        }
+
+        return true;
+}
+
+
+void KAccelBase::createKeyList( QValueVector<struct X>& rgKeys )
+{
+
+        if( !m_bEnabled )
+                return;
+
+
+
+        for( uint iAction = 0; iAction < m_rgActions.count(); iAction++ ) {
+                KAccelAction* pAction = m_rgActions.actionPtr( iAction );
+                if( pAction && pAction->m_pObjSlot && pAction->m_psMethodSlot && pAction != mtemp_pActionRemoving ) {
+
+                        for( uint iSeq = 0; iSeq < pAction->shortcut().count(); iSeq++ ) {
+                                const KKeySequence& seq = pAction->shortcut().seq(iSeq);
+                                if( seq.count() > 0 ) {
+                                        KKeyServer::Variations vars;
+                                        vars.init( seq.key(0), !m_bNativeKeys );
+                                        for( uint iVari = 0; iVari < vars.count(); iVari++ ) {
+                                                if( vars.key(iVari).code() && vars.key(iVari).sym() )
+                                                        rgKeys.push_back( X( iAction, iSeq, iVari, vars.key( iVari ) ) );
+
+                                        }
+                                }
+
+
+                        }
+                }
+        }
+
+
+        qHeapSort( rgKeys.begin(), rgKeys.end() );
+}
+
+bool KAccelBase::insertConnection( KAccelAction* pAction )
+{
+        if( !pAction->m_pObjSlot || !pAction->m_psMethodSlot )
+                return true;
+
+        kdDebug(125) << "KAccelBase::insertConnection( " << pAction << "=\"" << pAction->m_sName << "\"; shortcut = " << pAction->shortcut().toStringInternal() << " )  this = " << this << endl;
+
+
+        for( uint iSeq = 0; iSeq < pAction->shortcut().count(); iSeq++ ) {
+
+                KKeyServer::Variations vars;
+                vars.init( pAction->shortcut().seq(iSeq).key(0), !m_bNativeKeys );
+                for( uint iVari = 0; iVari < vars.count(); iVari++ ) {
+                        const KKeyServer::Key& key = vars.key( iVari );
+
+
+                        if( key.sym() ) {
+                                if( !m_mapKeyToAction.contains( key ) ) {
+
+                                        if( pAction->shortcut().seq(iSeq).count() == 1 ) {
+                                                m_mapKeyToAction[key] = ActionInfo( pAction, iSeq, iVari );
+                                                if( connectKey( *pAction, key ) )
+                                                        pAction->incConnections();
+                                        }
+
+                                        else {
+                                                m_mapKeyToAction[key] = ActionInfo( 0, 0, 0 );
+
+                                                if( m_rgActionsNonUnique.findIndex( pAction ) == -1 )
+                                                        m_rgActionsNonUnique.append( pAction );
+                                                if( connectKey( key ) )
+                                                        pAction->incConnections();
+                                        }
+                                } else {
+
+
+
+                                        if( m_mapKeyToAction[key].pAction != pAction
+                                            && m_mapKeyToAction[key].pAction != 0 ) {
+                                                kdDebug(125) << "Key conflict: call updateConnections():"
+                                                        << " key = " << key.key().toStringInternal() << endl;
+                                                return updateConnections();
+                                        }
+                                }
+                        }
+                }
+        }
+        return true;
+}
+
+bool KAccelBase::removeConnection( KAccelAction* pAction )
+{
+        kdDebug(125) << "KAccelBase::removeConnection( " << pAction << " = \"" << pAction->m_sName << "\"; shortcut = " << pAction->m_cut.toStringInternal() << " ): this = " << this << endl;
+
+
+
+
+        if( m_rgActionsNonUnique.findIndex( pAction ) >= 0 ) {
+                mtemp_pActionRemoving = pAction;
+                bool b = updateConnections();
+                mtemp_pActionRemoving = 0;
+                return b;
+        }
+
+        KKeyToActionMap::iterator it = m_mapKeyToAction.begin();
+        while( it != m_mapKeyToAction.end() ) {
+                KKeyServer::Key key = it.key();
+                ActionInfo* pInfo = &(*it);
+
+
+                if( pAction == pInfo->pAction ) {
+                        disconnectKey( *pAction, key );
+                        pAction->decConnections();
+
+                        KKeyToActionMap::iterator itRemove = it++;
+                        m_mapKeyToAction.remove( itRemove );
+                } else
+                        ++it;
+        }
+        return true;
+}
+
+bool KAccelBase::setShortcut( const QString& sAction, const KShortcut& cut )
+{
+        KAccelAction* pAction = actionPtr( sAction );
+        if( pAction ) {
+                if( m_bAutoUpdate )
+                        removeConnection( pAction );
+
+                pAction->setShortcut( cut );
+
+                if( m_bAutoUpdate && !pAction->shortcut().isNull() )
+                        insertConnection( pAction );
+                return true;
+        } else
+                return false;
+}
+
+void KAccelBase::readSettings( KConfigBase* pConfig )
+{
+        m_rgActions.readActions( m_sConfigGroup, pConfig );
+        if( m_bAutoUpdate )
+                updateConnections();
+}
+
+void KAccelBase::writeSettings( KConfigBase* pConfig ) const
+{
+        m_rgActions.writeActions( m_sConfigGroup, pConfig, m_bConfigIsGlobal, m_bConfigIsGlobal );
+}
+
+QPopupMenu* KAccelBase::createPopupMenu( QWidget* pParent, const KKeySequence& seq )
+{
+        KShortcutMenu* pMenu = new KShortcutMenu( pParent, &actions(), seq );
+
+        bool bActionInserted = false;
+        bool bInsertSeparator = false;
+        for( uint i = 0; i < actionCount(); i++ ) {
+                const KAccelAction* pAction = actions().actionPtr( i );
+
+                if( !pAction->isEnabled() )
+                        continue;
+
+
+
+
+                if( bActionInserted && !pAction->isConfigurable() && pAction->name().contains( ':' ) )
+                        bInsertSeparator = true;
+
+                for( uint iSeq = 0; iSeq < pAction->shortcut().count(); iSeq++ ) {
+                        const KKeySequence& seqAction = pAction->shortcut().seq(iSeq);
+                        if( seqAction.startsWith( seq ) ) {
+                                if( bInsertSeparator ) {
+                                        pMenu->insertSeparator();
+                                        bInsertSeparator = false;
+                                }
+
+                                pMenu->insertAction( i, seqAction );
+
+
+
+                                bActionInserted = true;
+                                break;
+                        }
+                }
+        }
+        pMenu->updateShortcuts();
+        return pMenu;
+}
+
+
+
+
+
+
+
+
+class KAccelPrivate : public QObject, public KAccelBase
+{
+        public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+ public:
+        KAccel* m_pAccel;
+        QWidget* m_pWatch;
+        QMap<int, int> m_mapIDToKey;
+        QMap<int, KAccelAction*> m_mapIDToAction;
+        QTimer m_timerShowMenu;
+
+        KAccelPrivate( KAccel* pParent, QWidget* pWatch );
+
+        virtual void setEnabled( bool );
+
+        bool setEnabled( const QString& sAction, bool bEnable );
+
+        virtual bool removeAction( const QString& sAction );
+
+        virtual bool emitSignal( KAccelBase::Signal );
+        virtual bool connectKey( KAccelAction&, const KKeyServer::Key& );
+        virtual bool connectKey( const KKeyServer::Key& );
+        virtual bool disconnectKey( KAccelAction&, const KKeyServer::Key& );
+        virtual bool disconnectKey( const KKeyServer::Key& );
+
+ protected:
+        void menuItemActivated();
+        void activateInt( int );
+
+ private :
+        void slotKeyPressed( int id );
+        void slotShowMenu();
+        void slotMenuActivated( int iAction );
+
+        bool eventFilter( QObject* pWatched, QEvent* pEvent );
+};
+bool kde_g_bKillAccelOverride = false;
+
+class KAccelEventHandler : public QWidget
+{
+ public:
+        static KAccelEventHandler* self()
+        {
+                if( !g_pSelf )
+                        g_pSelf = new KAccelEventHandler;
+                return g_pSelf;
+        }
+
+        static bool active() { return g_bActive; }
+        static void accelActivated( bool b ) { g_bAccelActivated = b; }
+
+ private:
+        KAccelEventHandler();
+
+
+        bool x11Event( XEvent* pEvent );
+
+
+        static KAccelEventHandler* g_pSelf;
+        static bool g_bActive;
+        static bool g_bAccelActivated;
+};
+
+KAccelEventHandler* KAccelEventHandler::g_pSelf = 0;
+bool KAccelEventHandler::g_bActive = false;
+bool KAccelEventHandler::g_bAccelActivated = false;
+
+KAccelEventHandler::KAccelEventHandler()
+{
+
+                KApplication::kApplication()->installX11EventFilter( this );
+
+}
+
+
+bool KAccelEventHandler::x11Event( XEvent* pEvent )
+{
+        if( QWidget::keyboardGrabber() || !KApplication::kApplication()->focusWidget() )
+                return false;
+
+        if( pEvent->type == XKeyPress ) {
+                KKeyNative keyNative( pEvent );
+                KKey key( keyNative );
+                key.simplify();
+                int keyCodeQt = key.keyCodeQt();
+                int state = 0;
+                if( key.modFlags() & KKey::SHIFT ) state |= Qt::ShiftButton;
+                if( key.modFlags() & KKey::CTRL ) state |= Qt::ControlButton;
+                if( key.modFlags() & KKey::ALT ) state |= Qt::AltButton;
+
+                QKeyEvent ke( QEvent::AccelOverride, keyCodeQt, 0, state );
+                ke.ignore();
+
+                g_bActive = true;
+                g_bAccelActivated = false;
+                KApplication::kApplication()->sendEvent( KApplication::kApplication()->focusWidget(), &ke );
+                g_bActive = false;
+
+
+
+                if( ke.isAccepted() && !g_bAccelActivated )
+                        kde_g_bKillAccelOverride = true;
+
+
+                return g_bAccelActivated;
+        }
+
+        return false;
+}
+
+
+
+
+
+
+KAccelPrivate::KAccelPrivate( KAccel* pParent, QWidget* pWatch )
+: KAccelBase( KAccelBase::QT_KEYS )
+{
+
+        m_pAccel = pParent;
+        m_pWatch = pWatch;
+        m_bAutoUpdate = true;
+        connect( (QAccel*)m_pAccel, "2""activated(int)", this, "1""slotKeyPressed(int)" );
+
+        if( m_pWatch )
+                m_pWatch->installEventFilter( this );
+        KAccelEventHandler::self();
+}
+
+void KAccelPrivate::setEnabled( bool bEnabled )
+{
+        m_bEnabled = bEnabled;
+        ((QAccel*)m_pAccel)->setEnabled( bEnabled );
+}
+
+bool KAccelPrivate::setEnabled( const QString& sAction, bool bEnable )
+{
+        kdDebug(125) << "KAccelPrivate::setEnabled( \"" << sAction << "\", " << bEnable << " ): this = " << this << endl;
+        KAccelAction* pAction = actionPtr( sAction );
+        if( !pAction )
+                return false;
+        if( pAction->isEnabled() == bEnable )
+                return true;
+
+        pAction->setEnabled( bEnable );
+
+        QMap<int, KAccelAction*>::iterator it = m_mapIDToAction.begin();
+        for( ; it != m_mapIDToAction.end(); ++it ) {
+                if( *it == pAction )
+                        ((QAccel*)m_pAccel)->setItemEnabled( it.key(), bEnable );
+        }
+        return true;
+}
+
+bool KAccelPrivate::removeAction( const QString& sAction )
+{
+
+
+
+        KAccelAction* pAction = actions().actionPtr( sAction );
+        if( pAction ) {
+                int nID = pAction->getID();
+
+                bool b = KAccelBase::remove( sAction );
+                ((QAccel*)m_pAccel)->removeItem( nID );
+                return b;
+        } else
+                return false;
+}
+
+bool KAccelPrivate::emitSignal( KAccelBase::Signal signal )
+{
+        if( signal == KAccelBase::KEYCODE_CHANGED ) {
+                m_pAccel->emitKeycodeChanged();
+                return true;
+        }
+        return false;
+}
+
+bool KAccelPrivate::connectKey( KAccelAction& action, const KKeyServer::Key& key )
+{
+        uint keyQt = key.keyCodeQt();
+        int nID = ((QAccel*)m_pAccel)->insertItem( keyQt );
+        m_mapIDToAction[nID] = &action;
+        m_mapIDToKey[nID] = keyQt;
+
+        if( action.objSlotPtr() && action.methodSlotPtr() ) {
+                ((QAccel*)m_pAccel)->connectItem( nID, action.objSlotPtr(), action.methodSlotPtr() );
+                if( !action.isEnabled() )
+                        ((QAccel*)m_pAccel)->setItemEnabled( nID, false );
+        }
+
+        kdDebug(125) << "KAccelPrivate::connectKey( \"" << action.name() << "\", " << key.key().toStringInternal() << " = 0x" << QString::number(keyQt,16) << " ): id = " << nID << " m_pObjSlot = " << action.objSlotPtr() << endl;
+
+        return nID != 0;
+}
+
+bool KAccelPrivate::connectKey( const KKeyServer::Key& key )
+{
+        uint keyQt = key.keyCodeQt();
+        int nID = ((QAccel*)m_pAccel)->insertItem( keyQt );
+
+        m_mapIDToKey[nID] = keyQt;
+
+        kdDebug(125) << "KAccelPrivate::connectKey( " << key.key().toStringInternal() << " = 0x" << QString::number(keyQt,16) << " ): id = " << nID << endl;
+        return nID != 0;
+}
+
+bool KAccelPrivate::disconnectKey( KAccelAction& action, const KKeyServer::Key& key )
+{
+        int keyQt = key.keyCodeQt();
+        QMap<int, int>::iterator it = m_mapIDToKey.begin();
+        for( ; it != m_mapIDToKey.end(); ++it ) {
+
+                if( *it == keyQt ) {
+                        int nID = it.key();
+                        kdDebug(125) << "KAccelPrivate::disconnectKey( \"" << action.name() << "\", 0x" << QString::number(keyQt,16) << " ) : id = " << nID << " m_pObjSlot = " << action.objSlotPtr() << endl;
+                        ((QAccel*)m_pAccel)->removeItem( nID );
+                        m_mapIDToAction.remove( nID );
+                        m_mapIDToKey.remove( it );
+                        return true;
+                }
+        }
+
+        kdWarning(125) << "Didn't find key in m_mapIDToKey." << endl;
+        return false;
+}
+
+bool KAccelPrivate::disconnectKey( const KKeyServer::Key& key )
+{
+        int keyQt = key.keyCodeQt();
+        kdDebug(125) << "KAccelPrivate::disconnectKey( 0x" << QString::number(keyQt,16) << " )" << endl;
+        QMap<int, int>::iterator it = m_mapIDToKey.begin();
+        for( ; it != m_mapIDToKey.end(); ++it ) {
+                if( *it == keyQt ) {
+                        ((QAccel*)m_pAccel)->removeItem( it.key() );
+                        m_mapIDToKey.remove( it );
+                        return true;
+                }
+        }
+
+        kdWarning(125) << "Didn't find key in m_mapIDTokey." << endl;
+        return false;
+}
+
+void KAccelPrivate::slotKeyPressed( int id )
+{
+        kdDebug(125) << "KAccelPrivate::slotKeyPressed( " << id << " )" << endl;
+
+        if( m_mapIDToKey.contains( id ) ) {
+                KKey key = m_mapIDToKey[id];
+                KKeySequence seq( key );
+                QPopupMenu* pMenu = createPopupMenu( m_pWatch, seq );
+
+
+
+
+
+
+
+                if( pMenu->count() == 2 && static_cast<int>( pMenu->accel(1) ) == 0 ) {
+                        int iAction = pMenu->idAt(1);
+                        slotMenuActivated( iAction );
+                } else {
+                        connect( pMenu, "2""activated(int)", this, "1""slotMenuActivated(int)" );
+                        pMenu->exec( m_pWatch->mapToGlobal( QPoint( 0, 0 ) ) );
+                        disconnect( pMenu, "2""activated(int)", this, "1""slotMenuActivated(int)" );
+                }
+                delete pMenu;
+        }
+}
+
+void KAccelPrivate::slotShowMenu()
+{
+}
+
+void KAccelPrivate::slotMenuActivated( int iAction )
+{
+        kdDebug(125) << "KAccelPrivate::slotMenuActivated( " << iAction << " )" << endl;
+        KAccelAction* pAction = actions().actionPtr( iAction );
+        if( pAction ) {
+                connect( this, "2""menuItemActivated()", pAction->objSlotPtr(), pAction->methodSlotPtr() );
+                menuItemActivated();
+                disconnect( this, "2""menuItemActivated()", pAction->objSlotPtr(), pAction->methodSlotPtr() );
+        }
+}
+
+bool KAccelPrivate::eventFilter( QObject* , QEvent* pEvent )
+{
+        if( KAccelEventHandler::active() && pEvent->type() == QEvent::AccelOverride && m_bEnabled ) {
+                QKeyEvent* pKeyEvent = (QKeyEvent*) pEvent;
+                KKey key( pKeyEvent );
+                kdDebug(125) << "KAccelPrivate::eventFilter( AccelOverride ): this = " << this << ", key = " << key.toStringInternal() << endl;
+                int keyCodeQt = key.keyCodeQt();
+                QMap<int, int>::iterator it = m_mapIDToKey.begin();
+                for( ; it != m_mapIDToKey.end(); ++it ) {
+                        if( (*it) == keyCodeQt ) {
+                                int nID = it.key();
+                                kdDebug(125) << "shortcut found!" << endl;
+                                if( m_mapIDToAction.contains( nID ) ) {
+
+                                        KAccelAction* pAction = m_mapIDToAction[nID];
+                                        if( !pAction->isEnabled() )
+                                                continue;
+                                        connect( this, "2""menuItemActivated()", pAction->objSlotPtr(), pAction->methodSlotPtr() );
+                                        menuItemActivated();
+                                        disconnect( this, "2""menuItemActivated()", pAction->objSlotPtr(), pAction->methodSlotPtr() );
+                                } else
+                                        slotKeyPressed( nID );
+
+                                pKeyEvent->accept();
+                                KAccelEventHandler::accelActivated( true );
+                                return true;
+                        }
+                }
+        }
+        return false;
+}
+
+
+
+
+
+KAccel::KAccel( QWidget* pParent, const char* psName )
+: QAccel( pParent, (psName) ? psName : "KAccel-QAccel" )
+{
+        kdDebug(125) << "KAccel( pParent = " << pParent << ", psName = " << psName << " ): this = " << this << endl;
+        d = new KAccelPrivate( this, pParent );
+}
+
+KAccel::KAccel( QWidget* watch, QObject* pParent, const char* psName )
+: QAccel( watch, pParent, (psName) ? psName : "KAccel-QAccel" )
+{
+        kdDebug(125) << "KAccel( watch = " << watch << ", pParent = " << pParent << ", psName = " << psName << " ): this = " << this << endl;
+        if( !watch )
+                kdDebug(125) << kdBacktrace() << endl;
+        d = new KAccelPrivate( this, watch );
+}
+
+KAccel::~KAccel()
+{
+        kdDebug(125) << "~KAccel(): this = " << this << endl;
+        delete d;
+}
+
+KAccelActions& KAccel::actions() { return d->actions(); }
+const KAccelActions& KAccel::actions() const { return d->actions(); }
+bool KAccel::isEnabled() { return d->isEnabled(); }
+void KAccel::setEnabled( bool bEnabled ) { d->setEnabled( bEnabled ); }
+bool KAccel::setAutoUpdate( bool bAuto ) { return d->setAutoUpdate( bAuto ); }
+
+KAccelAction* KAccel::insert( const QString& sAction, const QString& sLabel, const QString& sWhatsThis,
+                const KShortcut& cutDef,
+                const QObject* pObjSlot, const char* psMethodSlot,
+                bool bConfigurable, bool bEnabled )
+{
+        return d->insert( sAction, sLabel, sWhatsThis,
+                cutDef, cutDef,
+                pObjSlot, psMethodSlot,
+                bConfigurable, bEnabled );
+}
+
+KAccelAction* KAccel::insert( const QString& sAction, const QString& sLabel, const QString& sWhatsThis,
+                const KShortcut& cutDef3, const KShortcut& cutDef4,
+                const QObject* pObjSlot, const char* psMethodSlot,
+                bool bConfigurable, bool bEnabled )
+{
+        return d->insert( sAction, sLabel, sWhatsThis,
+                cutDef3, cutDef4,
+                pObjSlot, psMethodSlot,
+                bConfigurable, bEnabled );
+}
+
+KAccelAction* KAccel::insert( const char* psAction, const KShortcut& cutDef,
+                const QObject* pObjSlot, const char* psMethodSlot,
+                bool bConfigurable, bool bEnabled )
+{
+        return d->insert( psAction, i18n(psAction), QString::null,
+                cutDef, cutDef,
+                pObjSlot, psMethodSlot,
+                bConfigurable, bEnabled );
+}
+
+KAccelAction* KAccel::insert( KStdAccel::StdAccel id,
+                const QObject* pObjSlot, const char* psMethodSlot,
+                bool bConfigurable, bool bEnabled )
+{
+        QString sAction = KStdAccel::name( id );
+        if( sAction.isEmpty() )
+                return 0;
+
+        KAccelAction* pAction = d->insert( sAction, KStdAccel::label( id ), KStdAccel::whatsThis( id ),
+                KStdAccel::shortcutDefault3( id ), KStdAccel::shortcutDefault4( id ),
+                pObjSlot, psMethodSlot,
+                bConfigurable, bEnabled );
+        if( pAction )
+                pAction->setShortcut( KStdAccel::shortcut( id ) );
+
+        return pAction;
+}
+
+bool KAccel::remove( const QString& sAction )
+        { return d->removeAction( sAction ); }
+bool KAccel::updateConnections()
+        { return d->updateConnections(); }
+
+const KShortcut& KAccel::shortcut( const QString& sAction ) const
+{
+        const KAccelAction* pAction = actions().actionPtr( sAction );
+        return (pAction) ? pAction->shortcut() : KShortcut::null();
+}
+
+bool KAccel::setSlot( const QString& sAction, const QObject* pObjSlot, const char* psMethodSlot )
+        { return d->setActionSlot( sAction, pObjSlot, psMethodSlot ); }
+
+bool KAccel::setEnabled( const QString& sAction, bool bEnable )
+        { return d->setEnabled( sAction, bEnable ); }
+
+bool KAccel::setShortcut( const QString& sAction, const KShortcut& cut )
+{
+        kdDebug(125) << "KAccel::setShortcut( \"" << sAction << "\", " << cut.toStringInternal() << " )" << endl;
+        KAccelAction* pAction = actions().actionPtr( sAction );
+        if( pAction ) {
+                if( pAction->shortcut() != cut )
+                        return d->setShortcut( sAction, cut );
+                return true;
+        }
+        return false;
+}
+
+const QString& KAccel::configGroup() const
+        { return d->configGroup(); }
+
+void KAccel::setConfigGroup( const QString& s )
+        { d->setConfigGroup( s ); }
+
+bool KAccel::readSettings( KConfigBase* pConfig )
+{
+        d->readSettings( pConfig );
+        return true;
+}
+
+bool KAccel::writeSettings( KConfigBase* pConfig ) const
+        { d->writeSettings( pConfig ); return true; }
+
+void KAccel::emitKeycodeChanged()
+{
+        kdDebug(125) << "KAccel::emitKeycodeChanged()" << endl;
+        keycodeChanged();
+}
+
+
+
+
+
+
+bool KAccel::insertItem( const QString& sLabel, const QString& sAction,
+                const char* cutsDef,
+                int , QPopupMenu *, bool bConfigurable )
+{
+        KShortcut cut( cutsDef );
+        bool b = d->insert( sAction, sLabel, QString::null,
+                cut, cut,
+                0, 0,
+                bConfigurable ) != 0;
+        return b;
+}
+
+bool KAccel::insertItem( const QString& sLabel, const QString& sAction,
+                int key,
+                int , QPopupMenu*, bool bConfigurable )
+{
+        KShortcut cut;
+        cut.init( QKeySequence(key) );
+        KAccelAction* pAction = d->insert( sAction, sLabel, QString::null,
+                cut, cut,
+                0, 0,
+                bConfigurable );
+        return pAction != 0;
+}
+
+
+bool KAccel::insertStdItem( KStdAccel::StdAccel id, const QString& sLabel )
+{
+        KAccelAction* pAction = d->insert( KStdAccel::action( id ), sLabel, QString::null,
+                KStdAccel::shortcutDefault3( id ), KStdAccel::shortcutDefault4( id ),
+                0, 0 );
+        if( pAction )
+                pAction->setShortcut( KStdAccel::shortcut( id ) );
+
+        return true;
+}
+
+bool KAccel::connectItem( const QString& sAction, const QObject* pObjSlot, const char* psMethodSlot, bool bActivate )
+{
+        kdDebug(125) << "KAccel::connectItem( " << sAction << ", " << pObjSlot << ", " << psMethodSlot << " )" << endl;
+        if( bActivate == false )
+                d->setActionEnabled( sAction, false );
+        bool b = setSlot( sAction, pObjSlot, psMethodSlot );
+        if( bActivate == true )
+                d->setActionEnabled( sAction, true );
+        return b;
+}
+
+bool KAccel::removeItem( const QString& sAction )
+        { return d->removeAction( sAction ); }
+
+bool KAccel::setItemEnabled( const QString& sAction, bool bEnable )
+        { return setEnabled( sAction, bEnable ); }
+
+void KAccel::changeMenuAccel( QPopupMenu *menu, int id, const QString& action )
+{
+        KAccelAction* pAction = actions().actionPtr( action );
+        QString s = menu->text( id );
+        if( !pAction || s.isEmpty() )
+                return;
+
+        int i = s.find( '\t' );
+
+        QString k = pAction->shortcut().seq(0).toString();
+        if( k.isEmpty() )
+                return;
+
+        if ( i >= 0 )
+                s.replace( i+1, s.length()-i, k );
+        else {
+                s += '\t';
+                s += k;
+        }
+
+        QPixmap *pp = menu->pixmap(id);
+        if( pp && !pp->isNull() )
+                menu->changeItem( *pp, s, id );
+        else
+                menu->changeItem( s, id );
+}
+
+void KAccel::changeMenuAccel( QPopupMenu *menu, int id, KStdAccel::StdAccel accel )
+{
+        changeMenuAccel( menu, id, KStdAccel::name( accel ) );
+}
+
+int KAccel::stringToKey( const QString& sKey )
+{
+        return KKey( sKey ).keyCodeQt();
+}
+
+int KAccel::currentKey( const QString& sAction ) const
+{
+        KAccelAction* pAction = d->actionPtr( sAction );
+        if( pAction )
+                return pAction->shortcut().keyCodeQt();
+        return 0;
+}
+
+QString KAccel::findKey( int key ) const
+{
+        KAccelAction* pAction = d->actionPtr( KKey(key) );
+        if( pAction )
+                return pAction->name();
+        else
+                return QString::null;
+}
+
+
+void KAccel::virtual_hook( int, void* )
+{ }
+
+const char *KAccel::className() const
+{
+    return "KAccel";
+}
+
+QMetaObject *KAccel::metaObj = 0;
+static QMetaObjectCleanUp cleanUp_KAccel( "KAccel", &KAccel::staticMetaObject );
+QMetaObject* KAccel::staticMetaObject()
+{
+    if ( metaObj )
+        return metaObj;
+    QMetaObject* parentObject = QAccel::staticMetaObject();
+    static const QUMethod signal_0 = {"keycodeChanged", 0, 0 };
+    static const QMetaData signal_tbl[] = {
+        { "keycodeChanged()", &signal_0, QMetaData::Public }
+    };
+    metaObj = QMetaObject::new_metaobject(
+        "KAccel", parentObject,
+        0, 0,
+        signal_tbl, 1,
+
+        0, 0,
+        0, 0,
+
+        0, 0 );
+    cleanUp_KAccel.setMetaObject( metaObj );
+    return metaObj;
+}
+
+void* KAccel::qt_cast( const char* clname )
+{
+    if ( !qstrcmp( clname, "KAccel" ) )
+        return this;
+    return QAccel::qt_cast( clname );
+}
+
+
+void KAccel::keycodeChanged()
+{
+    activate_signal( staticMetaObject()->signalOffset() + 0 );
+}
+
+bool KAccel::qt_invoke( int _id, QUObject* _o )
+{
+    return QAccel::qt_invoke(_id,_o);
+}
+
+bool KAccel::qt_emit( int _id, QUObject* _o )
+{
+    switch ( _id - staticMetaObject()->signalOffset() ) {
+    case 0: keycodeChanged(); break;
+    default:
+        return QAccel::qt_emit(_id,_o);
+    }
+    return TRUE;
+}
+
+
+bool KAccel::qt_property( int id, int f, QVariant* v)
+{
+    return QAccel::qt_property( id, f, v);
+}
+
+bool KAccel::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; }
+const char *KAccelPrivate::className() const
+{
+    return "KAccelPrivate";
+}
+
+QMetaObject *KAccelPrivate::metaObj = 0;
+static QMetaObjectCleanUp cleanUp_KAccelPrivate( "KAccelPrivate", &KAccelPrivate::staticMetaObject );
+QMetaObject* KAccelPrivate::staticMetaObject()
+{
+    if ( metaObj )
+        return metaObj;
+    QMetaObject* parentObject = QObject::staticMetaObject();
+    static const QUParameter param_slot_0[] = {
+        { "id", &static_QUType_int, 0, QUParameter::In }
+    };
+    static const QUMethod slot_0 = {"slotKeyPressed", 1, param_slot_0 };
+    static const QUMethod slot_1 = {"slotShowMenu", 0, 0 };
+    static const QUParameter param_slot_2[] = {
+        { "iAction", &static_QUType_int, 0, QUParameter::In }
+    };
+    static const QUMethod slot_2 = {"slotMenuActivated", 1, param_slot_2 };
+    static const QUParameter param_slot_3[] = {
+        { 0, &static_QUType_bool, 0, QUParameter::Out },
+        { "pWatched", &static_QUType_ptr, "QObject", QUParameter::In },
+        { "pEvent", &static_QUType_ptr, "QEvent", QUParameter::In }
+    };
+    static const QUMethod slot_3 = {"eventFilter", 3, param_slot_3 };
+    static const QMetaData slot_tbl[] = {
+        { "slotKeyPressed(int)", &slot_0, QMetaData::Private },
+        { "slotShowMenu()", &slot_1, QMetaData::Private },
+        { "slotMenuActivated(int)", &slot_2, QMetaData::Private },
+        { "eventFilter(QObject*,QEvent*)", &slot_3, QMetaData::Private }
+    };
+    static const QUMethod signal_0 = {"menuItemActivated", 0, 0 };
+    static const QUParameter param_signal_1[] = {
+        { 0, &static_QUType_int, 0, QUParameter::In }
+    };
+    static const QUMethod signal_1 = {"activateInt", 1, param_signal_1 };
+    static const QMetaData signal_tbl[] = {
+        { "menuItemActivated()", &signal_0, QMetaData::Public },
+        { "activateInt(int)", &signal_1, QMetaData::Public }
+    };
+    metaObj = QMetaObject::new_metaobject(
+        "KAccelPrivate", parentObject,
+        slot_tbl, 4,
+        signal_tbl, 2,
+
+        0, 0,
+        0, 0,
+
+        0, 0 );
+    cleanUp_KAccelPrivate.setMetaObject( metaObj );
+    return metaObj;
+}
+
+void* KAccelPrivate::qt_cast( const char* clname )
+{
+    if ( !qstrcmp( clname, "KAccelPrivate" ) )
+        return this;
+    if ( !qstrcmp( clname, "KAccelBase" ) )
+        return (KAccelBase*)this;
+    return QObject::qt_cast( clname );
+}
+
+
+void KAccelPrivate::menuItemActivated()
+{
+    activate_signal( staticMetaObject()->signalOffset() + 0 );
+}
+
+
+void KAccelPrivate::activateInt( int t0 )
+{
+    activate_signal( staticMetaObject()->signalOffset() + 1, t0 );
+}
+
+bool KAccelPrivate::qt_invoke( int _id, QUObject* _o )
+{
+    switch ( _id - staticMetaObject()->slotOffset() ) {
+    case 0: slotKeyPressed((int)static_QUType_int.get(_o+1)); break;
+    case 1: slotShowMenu(); break;
+    case 2: slotMenuActivated((int)static_QUType_int.get(_o+1)); break;
+    case 3: static_QUType_bool.set(_o,eventFilter((QObject*)static_QUType_ptr.get(_o+1),(QEvent*)static_QUType_ptr.get(_o+2))); break;
+    default:
+        return QObject::qt_invoke( _id, _o );
+    }
+    return TRUE;
+}
+
+bool KAccelPrivate::qt_emit( int _id, QUObject* _o )
+{
+    switch ( _id - staticMetaObject()->signalOffset() ) {
+    case 0: menuItemActivated(); break;
+    case 1: activateInt((int)static_QUType_int.get(_o+1)); break;
+    default:
+        return QObject::qt_emit(_id,_o);
+    }
+    return TRUE;
+}
+
+
+bool KAccelPrivate::qt_property( int id, int f, QVariant* v)
+{
+    return QObject::qt_property( id, f, v);
+}
+
+bool KAccelPrivate::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C"
+
+int mkstemps(char *, int);
+extern "C"
+
+unsigned long strlcat(char*, const char*, unsigned long);
+
+
+
+
+
+
+extern "C"
+
+unsigned long strlcpy(char*, const char*, unsigned long);
+
+
+
+
+
+
+
+
+
+class KGlobalAccelPrivate : public QWidget, public KAccelBase
+{
+        friend class KGlobalAccel;
+        public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+ public:
+        KGlobalAccelPrivate();
+        virtual ~KGlobalAccelPrivate();
+
+        virtual void setEnabled( bool );
+
+        virtual bool emitSignal( Signal );
+        virtual bool connectKey( KAccelAction&, const KKeyServer::Key& );
+        virtual bool connectKey( const KKeyServer::Key& );
+        virtual bool disconnectKey( KAccelAction&, const KKeyServer::Key& );
+        virtual bool disconnectKey( const KKeyServer::Key& );
+
+ protected:
+
+
+
+
+        class CodeMod
+        {
+         public:
+
+
+
+                uchar code;
+
+
+
+                uint mod;
+
+
+
+
+                bool operator < ( const CodeMod& b ) const
+                {
+                        if( code < b.code ) return true;
+                        if( code == b.code && mod < b.mod ) return true;
+                        return false;
+                }
+        };
+        typedef QMap<CodeMod, KAccelAction*> CodeModMap;
+
+        CodeModMap m_rgCodeModToAction;
+
+
+
+
+        bool grabKey( const KKeyServer::Key&, bool bGrab, KAccelAction* );
+        virtual bool x11Event( XEvent* );
+        void x11MappingNotify();
+        bool x11KeyPress( const XEvent *pEvent );
+        void activate( KAccelAction* pAction, const KKeySequence& seq );
+
+ protected :
+        void slotActivated( int iAction );
+};
+
+
+
+
+class QPopupMenu;
+class QWidget;
+class KAccelAction;
+class KAccelActions;
+class KConfigBase;
+
+class KGlobalAccelPrivate;
+class KGlobalAccel : public QObject
+{
+        public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+ public:
+
+
+
+
+
+
+        KGlobalAccel( QObject* pParent, const char* psName = 0 );
+        virtual ~KGlobalAccel();
+
+
+
+
+
+        bool isEnabled();
+
+
+
+
+
+        void setEnabled( bool bEnabled );
+        KAccelAction* insert( const QString& sAction, const QString& sLabel, const QString& sWhatsThis,
+                         const KShortcut& cutDef3, const KShortcut& cutDef4,
+                         const QObject* pObjSlot, const char* psMethodSlot,
+                         bool bConfigurable = true, bool bEnabled = true );
+
+
+
+
+
+
+
+        bool remove( const QString& sAction );
+        KAccelAction* insert( const QString& sName, const QString& sLabel );
+
+
+
+
+
+        bool updateConnections();
+
+
+
+
+
+
+        const KShortcut& shortcut( const QString& sAction ) const;
+
+
+
+
+
+
+        bool setShortcut( const QString& sAction, const KShortcut &shortcut );
+        bool setSlot( const QString& sAction, const QObject* pObjSlot, const char* psMethodSlot );
+
+
+
+
+
+
+        bool setEnabled( const QString& sAction, bool bEnabled );
+
+
+
+
+
+
+        const QString& configGroup() const;
+
+
+
+
+
+
+        void setConfigGroup( const QString &cg );
+        bool readSettings( KConfigBase* pConfig = 0 );
+        bool writeSettings( KConfigBase* pConfig = 0 ) const;
+        bool writeSettings( KConfigBase* pConfig, bool bGlobal ) const;
+
+
+
+
+
+        static bool useFourModifierKeys();
+
+ private:
+
+        KAccelActions& actions();
+        const KAccelActions& actions() const;
+
+        friend class KGlobalAccelPrivate;
+        friend class KAccelShortcutList;
+protected:
+
+        virtual void virtual_hook( int id, void* data );
+private:
+        class KGlobalAccelPrivate* d;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+namespace X
+{
+}
+
+using namespace X;
+
+extern "C" {
+  static int XGrabErrorHandler( Display *, XErrorEvent *e ) {
+        if ( e->error_code != 10 ) {
+            kdWarning() << "grabKey: got X error " << e->type << " instead of BadAccess\n";
+        }
+        return 1;
+  }
+}
+
+
+
+
+
+
+
+static uint g_keyModMaskXAccel = 0;
+static uint g_keyModMaskXOnOrOff = 0;
+
+static void calculateGrabMasks()
+{
+        g_keyModMaskXAccel = KKeyServer::accelModMaskX();
+        g_keyModMaskXOnOrOff =
+                        KKeyServer::modXLock() |
+                        KKeyServer::modXNumLock() |
+                        KKeyServer::modXScrollLock();
+
+
+}
+
+
+
+KGlobalAccelPrivate::KGlobalAccelPrivate()
+: KAccelBase( KAccelBase::NATIVE_KEYS )
+{
+        m_sConfigGroup = "Global Shortcuts";
+        KApplication::kApplication()->installX11EventFilter( this );
+}
+
+KGlobalAccelPrivate::~KGlobalAccelPrivate()
+{
+
+
+
+
+}
+
+void KGlobalAccelPrivate::setEnabled( bool bEnable )
+{
+        m_bEnabled = bEnable;
+
+}
+
+bool KGlobalAccelPrivate::emitSignal( Signal )
+{
+        return false;
+}
+
+bool KGlobalAccelPrivate::connectKey( KAccelAction& action, const KKeyServer::Key& key )
+        { return grabKey( key, true, &action ); }
+bool KGlobalAccelPrivate::connectKey( const KKeyServer::Key& key )
+        { return grabKey( key, true, 0 ); }
+bool KGlobalAccelPrivate::disconnectKey( KAccelAction& action, const KKeyServer::Key& key )
+        { return grabKey( key, false, &action ); }
+bool KGlobalAccelPrivate::disconnectKey( const KKeyServer::Key& key )
+        { return grabKey( key, false, 0 ); }
+
+bool KGlobalAccelPrivate::grabKey( const KKeyServer::Key& key, bool bGrab, KAccelAction* pAction )
+{
+        if( !key.code() ) {
+                kdWarning(125) << "KGlobalAccelPrivate::grabKey( " << key.key().toStringInternal() << ", " << bGrab << ", \"" << (pAction ? pAction->name().latin1() : "(null)") << "\" ): Tried to grab key with null code." << endl;
+                return false;
+        }
+
+
+        if( g_keyModMaskXOnOrOff == 0 )
+                calculateGrabMasks();
+
+        uchar keyCodeX = key.code();
+        uint keyModX = key.mod() & g_keyModMaskXAccel;
+
+
+
+        kdDebug(125) << QString( "grabKey( key: '%1', bGrab: %2 ): keyCodeX: %3 keyModX: %4\n" )
+                .arg( key.key().toStringInternal() ).arg( bGrab )
+                .arg( keyCodeX, 0, 16 ).arg( keyModX, 0, 16 );
+
+        if( !keyCodeX )
+                return false;
+
+
+        KXErrorHandler handler( XGrabErrorHandler );
+
+
+
+
+
+
+
+        QString sDebug = QString("\tcode: 0x%1 state: 0x%2 | ").arg(keyCodeX,0,16).arg(keyModX,0,16);
+
+        uint keyModMaskX = ~g_keyModMaskXOnOrOff;
+        for( uint irrelevantBitsMask = 0; irrelevantBitsMask <= 0xff; irrelevantBitsMask++ ) {
+                if( (irrelevantBitsMask & keyModMaskX) == 0 ) {
+
+                        sDebug += QString("0x%3, ").arg(irrelevantBitsMask, 0, 16);
+
+                        if( bGrab )
+                                XGrabKey( qt_xdisplay(), keyCodeX, keyModX | irrelevantBitsMask,
+                                        qt_xrootwin(), 1, 1, 0 );
+                        else
+                                XUngrabKey( qt_xdisplay(), keyCodeX, keyModX | irrelevantBitsMask, qt_xrootwin() );
+                }
+        }
+
+        kdDebug(125) << sDebug << endl;
+
+
+        bool failed = false;
+        if( bGrab ) {
+
+                failed = handler.error( true );
+
+
+                if( failed ) {
+                        kdDebug(125) << "grab failed!\n";
+                        for( uint m = 0; m <= 0xff; m++ ) {
+                                if( m & keyModMaskX == 0 )
+                                        XUngrabKey( qt_xdisplay(), keyCodeX, keyModX | m, qt_xrootwin() );
+                                }
+                }
+        }
+        if( !failed )
+        {
+                CodeMod codemod;
+                codemod.code = keyCodeX;
+                codemod.mod = keyModX;
+                if( key.mod() & KKeyServer::MODE_SWITCH )
+                        codemod.mod |= KKeyServer::MODE_SWITCH;
+
+                if( bGrab )
+                        m_rgCodeModToAction.insert( codemod, pAction );
+                else
+                        m_rgCodeModToAction.remove( codemod );
+        }
+        return !failed;
+}
+
+bool KGlobalAccelPrivate::x11Event( XEvent* pEvent )
+{
+
+        switch( pEvent->type ) {
+         case 34:
+                XRefreshKeyboardMapping( &pEvent->xmapping );
+                x11MappingNotify();
+                return false;
+         case XKeyPress:
+                if( x11KeyPress( pEvent ) )
+                        return true;
+         default:
+                return QWidget::x11Event( pEvent );
+        }
+}
+
+void KGlobalAccelPrivate::x11MappingNotify()
+{
+        kdDebug(125) << "KGlobalAccelPrivate::x11MappingNotify()" << endl;
+        if( m_bEnabled ) {
+
+                KKeyServer::initializeMods();
+                calculateGrabMasks();
+
+                updateConnections();
+        }
+}
+
+bool KGlobalAccelPrivate::x11KeyPress( const XEvent *pEvent )
+{
+
+        if ( !QWidget::keyboardGrabber() && !QApplication::activePopupWidget() ) {
+                XUngrabKeyboard( qt_xdisplay(), pEvent->xkey.time );
+                XFlush( qt_xdisplay());
+        }
+
+        if( !m_bEnabled )
+                return false;
+
+        CodeMod codemod;
+        codemod.code = pEvent->xkey.keycode;
+        codemod.mod = pEvent->xkey.state & (g_keyModMaskXAccel | KKeyServer::MODE_SWITCH);
+
+
+
+        if( pEvent->xkey.state & KKeyServer::modXNumLock() ) {
+
+                uint sym = XKeycodeToKeysym( qt_xdisplay(), codemod.code, 0 );
+
+                if( sym >= 0xFF80 && sym <= 0xFFB9 ) {
+                        switch( sym ) {
+
+
+                                case 0xFFAA:
+                                case 0xFFAB:
+                                case 0xFFAD:
+                                case 0xFFAF:
+                                        break;
+                                default:
+                                        if( codemod.mod & KKeyServer::modXShift() )
+                                                codemod.mod &= ~KKeyServer::modXShift();
+                                        else
+                                                codemod.mod |= KKeyServer::modXShift();
+                        }
+                }
+        }
+
+        KKeyNative keyNative( pEvent );
+        KKey key = keyNative;
+
+        kdDebug(125) << "x11KeyPress: seek " << key.toStringInternal()
+                << QString( " keyCodeX: %1 state: %2 keyModX: %3" )
+                        .arg( codemod.code, 0, 16 ).arg( pEvent->xkey.state, 0, 16 ).arg( codemod.mod, 0, 16 ) << endl;
+
+
+        if( !m_rgCodeModToAction.contains( codemod ) ) {
+
+                for( CodeModMap::ConstIterator it = m_rgCodeModToAction.begin(); it != m_rgCodeModToAction.end(); ++it ) {
+                        KAccelAction* pAction = *it;
+                        kdDebug(125) << "\tcode: " << QString::number(it.key().code, 16) << " mod: " << QString::number(it.key().mod, 16)
+                                << (pAction ? QString(" name: \"%1\" shortcut: %2").arg(pAction->name()).arg(pAction->shortcut().toStringInternal()) : QString::null)
+                                << endl;
+                }
+
+                return false;
+        }
+        KAccelAction* pAction = m_rgCodeModToAction[codemod];
+
+        if( !pAction ) {
+                static bool recursion_block = false;
+                if( !recursion_block ) {
+                        recursion_block = true;
+                        QPopupMenu* pMenu = createPopupMenu( 0, KKeySequence(key) );
+                        connect( pMenu, "2""activated(int)", this, "1""slotActivated(int)" );
+                        pMenu->exec( QPoint( 0, 0 ) );
+                        disconnect( pMenu, "2""activated(int)", this, "1""slotActivated(int)");
+                        delete pMenu;
+                        recursion_block = false;
+                }
+        } else if( !pAction->objSlotPtr() || !pAction->isEnabled() )
+                return false;
+        else
+                activate( pAction, KKeySequence(key) );
+
+        return true;
+}
+
+void KGlobalAccelPrivate::activate( KAccelAction* pAction, const KKeySequence& seq )
+{
+        kdDebug(125) << "KGlobalAccelPrivate::activate( \"" << pAction->name() << "\" ) " << endl;
+
+        QRegExp rexPassIndex( "([ ]*int[ ]*)" );
+        QRegExp rexPassInfo( " QString" );
+        QRegExp rexIndex( " ([0-9]+)$" );
+
+
+
+
+        if( rexPassIndex.search( pAction->methodSlotPtr() ) >= 0 && rexIndex.search( pAction->name() ) >= 0 ) {
+                int n = rexIndex.cap(1).toInt();
+                kdDebug(125) << "Calling " << pAction->methodSlotPtr() << " int = " << n << endl;
+                int slot_id = pAction->objSlotPtr()->metaObject()->findSlot( normalizeSignalSlot( pAction->methodSlotPtr() ).data() + 1, true );
+                if( slot_id >= 0 ) {
+                    QUObject o[2];
+                    static_QUType_int.set(o+1,n);
+                    const_cast< QObject* >( pAction->objSlotPtr())->qt_invoke( slot_id, o );
+                }
+        } else if( rexPassInfo.search( pAction->methodSlotPtr() ) ) {
+                int slot_id = pAction->objSlotPtr()->metaObject()->findSlot( normalizeSignalSlot( pAction->methodSlotPtr() ).data() + 1, true );
+                if( slot_id >= 0 ) {
+                    QUObject o[4];
+                    static_QUType_QString.set(o+1,pAction->name());
+                    static_QUType_QString.set(o+2,pAction->label());
+                    static_QUType_ptr.set(o+3,&seq);
+                    const_cast< QObject* >( pAction->objSlotPtr())->qt_invoke( slot_id, o );
+                }
+        } else {
+                int slot_id = pAction->objSlotPtr()->metaObject()->findSlot( normalizeSignalSlot( pAction->methodSlotPtr() ).data() + 1, true );
+                if( slot_id >= 0 )
+                    const_cast< QObject* >( pAction->objSlotPtr())->qt_invoke( slot_id, 0 );
+        }
+}
+
+void KGlobalAccelPrivate::slotActivated( int iAction )
+{
+        KAccelAction* pAction = actions().actionPtr( iAction );
+        if( pAction )
+                activate( pAction, KKeySequence() );
+}
+
+const char *KGlobalAccelPrivate::className() const
+{
+    return "KGlobalAccelPrivate";
+}
+
+QMetaObject *KGlobalAccelPrivate::metaObj = 0;
+static QMetaObjectCleanUp cleanUp_KGlobalAccelPrivate( "KGlobalAccelPrivate", &KGlobalAccelPrivate::staticMetaObject );
+QMetaObject* KGlobalAccelPrivate::staticMetaObject()
+{
+    if ( metaObj )
+        return metaObj;
+    QMetaObject* parentObject = QWidget::staticMetaObject();
+    static const QUParameter param_slot_0[] = {
+        { "iAction", &static_QUType_int, 0, QUParameter::In }
+    };
+    static const QUMethod slot_0 = {"slotActivated", 1, param_slot_0 };
+    static const QMetaData slot_tbl[] = {
+        { "slotActivated(int)", &slot_0, QMetaData::Protected }
+    };
+    metaObj = QMetaObject::new_metaobject(
+        "KGlobalAccelPrivate", parentObject,
+        slot_tbl, 1,
+        0, 0,
+
+        0, 0,
+        0, 0,
+
+        0, 0 );
+    cleanUp_KGlobalAccelPrivate.setMetaObject( metaObj );
+    return metaObj;
+}
+
+void* KGlobalAccelPrivate::qt_cast( const char* clname )
+{
+    if ( !qstrcmp( clname, "KGlobalAccelPrivate" ) )
+        return this;
+    if ( !qstrcmp( clname, "KAccelBase" ) )
+        return (KAccelBase*)this;
+    return QWidget::qt_cast( clname );
+}
+
+bool KGlobalAccelPrivate::qt_invoke( int _id, QUObject* _o )
+{
+    switch ( _id - staticMetaObject()->slotOffset() ) {
+    case 0: slotActivated((int)static_QUType_int.get(_o+1)); break;
+    default:
+        return QWidget::qt_invoke( _id, _o );
+    }
+    return TRUE;
+}
+
+bool KGlobalAccelPrivate::qt_emit( int _id, QUObject* _o )
+{
+    return QWidget::qt_emit(_id,_o);
+}
+
+
+bool KGlobalAccelPrivate::qt_property( int id, int f, QVariant* v)
+{
+    return QWidget::qt_property( id, f, v);
+}
+
+bool KGlobalAccelPrivate::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; }
+KGlobalAccel::KGlobalAccel( QObject* pParent, const char* psName )
+: QObject( pParent, psName )
+{
+        kdDebug(125) << "KGlobalAccel(): this = " << this << endl;
+        d = new KGlobalAccelPrivate();
+}
+
+KGlobalAccel::~KGlobalAccel()
+{
+        kdDebug(125) << "~KGlobalAccel(): this = " << this << endl;
+        delete d;
+}
+
+
+
+
+
+KAccelActions& KGlobalAccel::actions()
+        { return d->actions(); }
+
+const KAccelActions& KGlobalAccel::actions() const
+        { return d->actions(); }
+
+bool KGlobalAccel::isEnabled()
+        { return ((KAccelBase*)d)->isEnabled(); }
+
+void KGlobalAccel::setEnabled( bool bEnabled )
+        { d->setEnabled( bEnabled ); }
+
+KAccelAction* KGlobalAccel::insert( const QString& sAction, const QString& sDesc, const QString& sHelp,
+                const KShortcut& cutDef3, const KShortcut& cutDef4,
+                const QObject* pObjSlot, const char* psMethodSlot,
+                bool bConfigurable, bool bEnabled )
+{
+        return d->insert( sAction, sDesc, sHelp,
+                cutDef3, cutDef4,
+                pObjSlot, psMethodSlot,
+                bConfigurable, bEnabled );
+}
+
+KAccelAction* KGlobalAccel::insert( const QString& sName, const QString& sDesc )
+        { return d->insert( sName, sDesc ); }
+bool KGlobalAccel::updateConnections()
+        { return d->updateConnections(); }
+
+bool KGlobalAccel::remove( const QString& sAction )
+        { return d->remove( sAction ); }
+
+const KShortcut& KGlobalAccel::shortcut( const QString& sAction ) const
+{
+        const KAccelAction* pAction = d->actions().actionPtr( sAction );
+        return (pAction) ? pAction->shortcut() : KShortcut::null();
+}
+
+bool KGlobalAccel::setShortcut( const QString& sAction, const KShortcut& cut )
+        { return d->setShortcut( sAction, cut ); }
+bool KGlobalAccel::setSlot( const QString& sAction, const QObject* pObjSlot, const char* psMethodSlot )
+        { return d->setActionSlot( sAction, pObjSlot, psMethodSlot ); }
+
+const QString& KGlobalAccel::configGroup() const
+        { return d->configGroup(); }
+
+void KGlobalAccel::setConfigGroup( const QString& s )
+        { d->setConfigGroup( s ); }
+
+bool KGlobalAccel::readSettings( KConfigBase* pConfig )
+        { d->readSettings( pConfig ); return true; }
+bool KGlobalAccel::writeSettings( KConfigBase* pConfig ) const
+        { d->writeSettings( pConfig ); return true; }
+bool KGlobalAccel::writeSettings( KConfigBase* pConfig, bool bGlobal ) const
+{
+        d->setConfigGlobal( bGlobal );
+        d->writeSettings( pConfig );
+        return true;
+}
+
+bool KGlobalAccel::useFourModifierKeys()
+        { return KAccelAction::useFourModifierKeys(); }
+
+void KGlobalAccel::virtual_hook( int, void* )
+{ }
+
+const char *KGlobalAccel::className() const
+{
+    return "KGlobalAccel";
+}
+
+QMetaObject *KGlobalAccel::metaObj = 0;
+static QMetaObjectCleanUp cleanUp_KGlobalAccel( "KGlobalAccel", &KGlobalAccel::staticMetaObject );
+QMetaObject* KGlobalAccel::staticMetaObject()
+{
+    if ( metaObj )
+        return metaObj;
+    QMetaObject* parentObject = QObject::staticMetaObject();
+    metaObj = QMetaObject::new_metaobject(
+        "KGlobalAccel", parentObject,
+        0, 0,
+        0, 0,
+
+        0, 0,
+        0, 0,
+
+        0, 0 );
+    cleanUp_KGlobalAccel.setMetaObject( metaObj );
+    return metaObj;
+}
+
+void* KGlobalAccel::qt_cast( const char* clname )
+{
+    if ( !qstrcmp( clname, "KGlobalAccel" ) )
+        return this;
+    return QObject::qt_cast( clname );
+}
+
+bool KGlobalAccel::qt_invoke( int _id, QUObject* _o )
+{
+    return QObject::qt_invoke(_id,_o);
+}
+
+bool KGlobalAccel::qt_emit( int _id, QUObject* _o )
+{
+    return QObject::qt_emit(_id,_o);
+}
+
+
+bool KGlobalAccel::qt_property( int id, int f, QVariant* v)
+{
+    return QObject::qt_property( id, f, v);
+}
+
+bool KGlobalAccel::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; }
+namespace KStdAccel
+{
+
+struct KStdAccelInfo
+{
+        StdAccel id;
+        const char* psName;
+        const char* psDesc;
+        int cutDefault, cutDefault4, cutDefault3B, cutDefault4B;
+        KShortcut cut;
+        bool bInitialized;
+};
+
+static KStdAccelInfo g_infoStdAccel[] =
+{
+        {AccelNone, "Group:File", ("File"), 0, 0, 0, 0, KShortcut(), false },
+        { Open, ("Open"), 0, Qt::CTRL+Qt::Key_O, 0, 0, 0, KShortcut(), false },
+        { New, ("New"), 0, Qt::CTRL+Qt::Key_N, 0, 0, 0, KShortcut(), false },
+        { Close, ("Close"), 0, Qt::CTRL+Qt::Key_W, Qt::CTRL+Qt::Key_Escape, 0, Qt::CTRL+Qt::Key_W, KShortcut(), false },
+        { Save, ("Save"), 0, Qt::CTRL+Qt::Key_S, 0, 0, 0, KShortcut(), false },
+        { Print, ("Print"), 0, Qt::CTRL+Qt::Key_P, 0, 0, 0, KShortcut(), false },
+        { Quit, ("Quit"), 0, Qt::CTRL+Qt::Key_Q, 0, 0, 0, KShortcut(), false },
+        {AccelNone, "Group:Edit", ("Edit"), 0, 0, 0, 0, KShortcut(), false },
+        { Undo, ("Undo"), 0, Qt::CTRL+Qt::Key_Z, 0, 0, 0, KShortcut(), false },
+        { Redo, ("Redo"), 0, Qt::CTRL+Qt::SHIFT+Qt::Key_Z, 0, 0, 0, KShortcut(), false },
+        { Cut, ("Cut"), 0, Qt::CTRL+Qt::Key_X, 0, Qt::SHIFT+Qt::Key_Delete, 0, KShortcut(), false },
+        { Copy, ("Copy"), 0, Qt::CTRL+Qt::Key_C, 0, Qt::CTRL+Qt::Key_Insert, 0, KShortcut(), false },
+        { Paste, ("Paste"), 0, Qt::CTRL+Qt::Key_V, 0, Qt::SHIFT+Qt::Key_Insert, 0, KShortcut(), false },
+        { SelectAll, "SelectAll", ("Select All"), Qt::CTRL+Qt::Key_A, 0, 0, 0, KShortcut(), false },
+        { Deselect, ("Deselect"), 0, Qt::CTRL+Qt::SHIFT+Qt::Key_A, 0, 0, 0, KShortcut(), false },
+        { DeleteWordBack, "DeleteWordBack", ("Delete Word Backwards"), Qt::CTRL+Qt::Key_Backspace, 0, 0, 0, KShortcut(), false },
+        { DeleteWordForward, "DeleteWordForward", ("Delete Word Forward"), Qt::CTRL+Qt::Key_Delete, 0, 0, 0, KShortcut(), false },
+        { Find, ("Find"), 0, Qt::CTRL+Qt::Key_F, 0, 0, 0, KShortcut(), false },
+        { FindNext, "FindNext", ("Find Next"), Qt::Key_F3, 0, 0, 0, KShortcut(), false },
+        { FindPrev, "FindPrev", ("Find Prev"), Qt::SHIFT+Qt::Key_F3, 0, 0, 0, KShortcut(), false },
+        { Replace, ("Replace"), 0, Qt::CTRL+Qt::Key_R, 0, 0, 0, KShortcut(), false },
+        {AccelNone, "Group:Navigation", ("Navigation"), 0, 0, 0, 0, KShortcut(), false },
+        { Home, ("Home"), 0, Qt::CTRL+Qt::Key_Home, 0, 0, 0, KShortcut(), false },
+        { End, ("End"), 0, Qt::CTRL+Qt::Key_End, 0, 0, 0, KShortcut(), false },
+        { Prior, ("Prior"), 0, Qt::Key_Prior, 0, 0, 0, KShortcut(), false },
+        { Next, ("Next"), 0, Qt::Key_Next, 0, 0, 0, KShortcut(), false },
+        { GotoLine, "GotoLine", ("Go to Line"), Qt::CTRL+Qt::Key_G, 0, 0, 0, KShortcut(), false },
+        { AddBookmark, "AddBookmark", ("Add Bookmark"), Qt::CTRL+Qt::Key_B, 0, 0, 0, KShortcut(), false },
+        { ZoomIn, "ZoomIn", ("Zoom In"), Qt::CTRL+Qt::Key_Plus, 0, 0, 0, KShortcut(), false },
+        { ZoomOut, "ZoomOut", ("Zoom Out"), Qt::CTRL+Qt::Key_Minus, 0, 0, 0, KShortcut(), false },
+        { Up, ("Up"), 0, Qt::ALT+Qt::Key_Up, 0, 0, 0, KShortcut(), false },
+        { Back, ("Back"), 0, Qt::ALT+Qt::Key_Left, 0, 0, 0, KShortcut(), false },
+        { Forward, ("Forward"), 0, Qt::ALT+Qt::Key_Right, 0, 0, 0, KShortcut(), false },
+        { Reload, ("Reload"), 0, Qt::Key_F5, 0, 0, 0, KShortcut(), false },
+        { PopupMenuContext, "PopupMenuContext", ("Popup Menu Context"), Qt::Key_Menu, 0, 0, 0, KShortcut(), false },
+        { ShowMenubar, "ShowMenubar", ("Show Menu Bar"), Qt::CTRL+Qt::Key_M, 0, 0, 0, KShortcut(), false },
+        { TabNext, ("Activate Next Tab"), 0, Qt::CTRL+Qt::Key_Less, 0, Qt::CTRL+Qt::Key_BracketRight, 0, KShortcut(), false },
+        { TabPrev, ("Activate Previous Tab"), 0, Qt::CTRL+Qt::Key_Greater, 0, Qt::CTRL+Qt::Key_BracketLeft, 0, KShortcut(), false },
+        { FullScreen, "FullScreen", ("Full Screen Mode"), Qt::CTRL+Qt::SHIFT+Qt::Key_F, 0, 0, 0, KShortcut(), false },
+        {AccelNone, "Group:Help", ("Help"), 0, 0, 0, 0, KShortcut(), false },
+        { Help, ("Help"), 0, Qt::Key_F1, 0, 0, 0, KShortcut(), false },
+        { WhatsThis, "WhatsThis", ("What's This"), Qt::SHIFT+Qt::Key_F1, 0, 0, 0, KShortcut(), false },
+        {AccelNone, "Group:TextCompletion", ("Text Completion"), 0, 0, 0, 0, KShortcut(), false },
+        { TextCompletion, "TextCompletion", ("Text Completion"), Qt::CTRL+Qt::Key_E, 0, 0, 0, KShortcut(), false },
+        { PrevCompletion, "PrevCompletion", ("Previous Completion Match"), Qt::CTRL+Qt::Key_Up, 0, 0, 0, KShortcut(), false },
+        { NextCompletion, "NextCompletion", ("Next Completion Match"), Qt::CTRL+Qt::Key_Down, 0, 0, 0, KShortcut(), false },
+        { SubstringCompletion, "SubstringCompletion", ("Substring Completion"), Qt::CTRL+Qt::Key_T, 0, 0, 0, KShortcut(), false },
+        { RotateUp, "RotateUp", ("Previous Item in List"), Qt::Key_Up, 0, 0, 0, KShortcut(), false },
+        { RotateDown, "RotateDown", ("Next Item in List"), Qt::Key_Down, 0, 0, 0, KShortcut(), false },
+        { AccelNone, 0, 0, 0, 0, 0, 0, KShortcut(), false }
+};
+
+static KStdAccelInfo* infoPtr( StdAccel id )
+{
+        if( id != AccelNone ) {
+                for( uint i = 0; g_infoStdAccel[i].psName != 0; i++ ) {
+                        if( g_infoStdAccel[i].id == id )
+                                return &g_infoStdAccel[i];
+                }
+        }
+        return 0;
+}
+
+static void initialize( StdAccel id )
+{
+        KConfigGroupSaver saver( KGlobal::config(), "Shortcuts" );
+        KStdAccelInfo* pInfo = infoPtr( id );
+
+        if( !pInfo ) {
+                kdWarning(125) << "KStdAccel: id not found!" << endl;
+                return;
+        }
+
+        if( saver.config()->hasKey( pInfo->psName ) ) {
+                QString s = saver.config()->readEntry( pInfo->psName );
+                if( s != "none" )
+                        pInfo->cut.init( s );
+                else
+                        pInfo->cut.clear();
+        } else
+                pInfo->cut = shortcutDefault( id );
+        pInfo->bInitialized = true;
+}
+
+QString name( StdAccel id )
+{
+        KStdAccelInfo* pInfo = infoPtr( id );
+        if( !pInfo )
+                return QString::null;
+        return pInfo->psName;
+}
+
+QString label( StdAccel id )
+{
+        KStdAccelInfo* pInfo = infoPtr( id );
+        if( !pInfo )
+                return QString::null;
+        return i18n((pInfo->psDesc) ? pInfo->psDesc : pInfo->psName);
+}
+
+
+QString whatsThis( StdAccel )
+{
+
+
+
+
+                return QString::null;
+}
+
+const KShortcut& shortcut( StdAccel id )
+{
+        KStdAccelInfo* pInfo = infoPtr( id );
+        if( !pInfo )
+                return KShortcut::null();
+
+        if( !pInfo->bInitialized )
+                initialize( id );
+
+        return pInfo->cut;
+}
+
+StdAccel findStdAccel( const KKeySequence& seq )
+{
+        if( !seq.isNull() ) {
+                for( uint i = 0; g_infoStdAccel[i].psName != 0; i++ ) {
+                        StdAccel id = g_infoStdAccel[i].id;
+                        if( id != AccelNone ) {
+                                if( !g_infoStdAccel[i].bInitialized )
+                                        initialize( id );
+                                if( g_infoStdAccel[i].cut.contains( seq ) )
+                                        return id;
+                        }
+                }
+        }
+        return AccelNone;
+}
+
+KShortcut shortcutDefault( StdAccel id )
+{
+        return (KAccelAction::useFourModifierKeys())
+                ? shortcutDefault4(id) : shortcutDefault3(id);
+}
+
+KShortcut shortcutDefault3( StdAccel id )
+{
+        KShortcut cut;
+
+        KStdAccelInfo* pInfo = infoPtr( id );
+        if( pInfo ) {
+                if( pInfo->cutDefault )
+                        cut.init( pInfo->cutDefault );
+
+
+                if( pInfo->cutDefault3B )
+                        cut.append( KKey(pInfo->cutDefault3B) );
+        }
+
+        return cut;
+}
+
+KShortcut shortcutDefault4( StdAccel id )
+{
+        KShortcut cut;
+
+        KStdAccelInfo* pInfo = infoPtr( id );
+        if( pInfo ) {
+                KStdAccelInfo& info = *pInfo;
+                KKeySequence key2;
+
+                cut.init( (info.cutDefault4) ?
+                        QKeySequence(info.cutDefault) : QKeySequence(info.cutDefault4) );
+
+                if( info.cutDefault4B )
+                        key2.init( QKeySequence(info.cutDefault4B) );
+                else if( info.cutDefault3B )
+                        key2.init( QKeySequence(info.cutDefault3B) );
+
+                if( key2.count() )
+                        cut.append( key2 );
+        }
+
+        return cut;
+}
+
+void createAccelActions( KAccelActions& actions )
+{
+        actions.clear();
+
+        for( uint i = 0; g_infoStdAccel[i].psName != 0; i++ ) {
+                StdAccel id = g_infoStdAccel[i].id;
+                KStdAccelInfo* pInfo = &g_infoStdAccel[i];
+
+                if( id != AccelNone ) {
+                        actions.insert( pInfo->psName,
+                                i18n((pInfo->psDesc) ? pInfo->psDesc : pInfo->psName),
+                                QString::null,
+                                shortcutDefault3(id),
+                                shortcutDefault4(id) );
+                } else
+                        actions.insert( pInfo->psName, i18n(pInfo->psDesc) );
+        }
+}
+
+const KShortcut& open() { return shortcut( Open ); }
+const KShortcut& openNew() { return shortcut( New ); }
+const KShortcut& close() { return shortcut( Close ); }
+const KShortcut& save() { return shortcut( Save ); }
+const KShortcut& print() { return shortcut( Print ); }
+const KShortcut& quit() { return shortcut( Quit ); }
+const KShortcut& cut() { return shortcut( Cut ); }
+const KShortcut& copy() { return shortcut( Copy ); }
+const KShortcut& paste() { return shortcut( Paste ); }
+const KShortcut& deleteWordBack() { return shortcut( DeleteWordBack ); }
+const KShortcut& deleteWordForward() { return shortcut( DeleteWordForward ); }
+const KShortcut& undo() { return shortcut( Undo ); }
+const KShortcut& redo() { return shortcut( Redo ); }
+const KShortcut& find() { return shortcut( Find ); }
+const KShortcut& findNext() { return shortcut( FindNext ); }
+const KShortcut& findPrev() { return shortcut( FindPrev ); }
+const KShortcut& replace() { return shortcut( Replace ); }
+const KShortcut& home() { return shortcut( Home ); }
+const KShortcut& end() { return shortcut( End ); }
+const KShortcut& prior() { return shortcut( Prior ); }
+const KShortcut& next() { return shortcut( Next ); }
+const KShortcut& gotoLine() { return shortcut( GotoLine ); }
+const KShortcut& addBookmark() { return shortcut( AddBookmark ); }
+const KShortcut& tabNext() { return shortcut( TabNext ); }
+const KShortcut& tabPrev() { return shortcut( TabPrev ); }
+const KShortcut& fullScreen() { return shortcut( FullScreen ); }
+const KShortcut& zoomIn() { return shortcut( ZoomIn ); }
+const KShortcut& zoomOut() { return shortcut( ZoomOut ); }
+const KShortcut& help() { return shortcut( Help ); }
+const KShortcut& completion() { return shortcut( TextCompletion ); }
+const KShortcut& prevCompletion() { return shortcut( PrevCompletion ); }
+const KShortcut& nextCompletion() { return shortcut( NextCompletion ); }
+const KShortcut& rotateUp() { return shortcut( RotateUp ); }
+const KShortcut& rotateDown() { return shortcut( RotateDown ); }
+const KShortcut& substringCompletion() { return shortcut( SubstringCompletion ); }
+const KShortcut& popupMenuContext() { return shortcut( PopupMenuContext ); }
+const KShortcut& whatsThis() { return shortcut( WhatsThis ); }
+const KShortcut& reload() { return shortcut( Reload ); }
+const KShortcut& selectAll() { return shortcut( SelectAll ); }
+const KShortcut& up() { return shortcut( Up ); }
+const KShortcut& back() { return shortcut( Back ); }
+const KShortcut& forward() { return shortcut( Forward ); }
+const KShortcut& showMenubar() { return shortcut( ShowMenubar ); }
+
+
+
+
+
+ShortcutList::ShortcutList()
+        { }
+
+ShortcutList::~ShortcutList()
+        { }
+
+uint ShortcutList::count() const
+{
+        static uint g_nAccels = 0;
+        if( g_nAccels == 0 ) {
+                for( ; g_infoStdAccel[g_nAccels].psName != 0; g_nAccels++ )
+                        ;
+        }
+        return g_nAccels;
+}
+
+QString ShortcutList::name( uint i ) const
+        { return g_infoStdAccel[i].psName; }
+
+QString ShortcutList::label( uint i ) const
+        { return i18n((g_infoStdAccel[i].psDesc) ? g_infoStdAccel[i].psDesc : g_infoStdAccel[i].psName); }
+
+QString ShortcutList::whatsThis( uint ) const
+        { return QString::null; }
+
+const KShortcut& ShortcutList::shortcut( uint i ) const
+{
+        if( !g_infoStdAccel[i].bInitialized )
+                initialize( g_infoStdAccel[i].id );
+        return g_infoStdAccel[i].cut;
+}
+
+const KShortcut& ShortcutList::shortcutDefault( uint i ) const
+{
+        static KShortcut cut;
+        cut = KStdAccel::shortcutDefault( g_infoStdAccel[i].id );
+        return cut;
+}
+
+bool ShortcutList::isConfigurable( uint i ) const
+        { return (g_infoStdAccel[i].id != AccelNone); }
+
+bool ShortcutList::setShortcut( uint i, const KShortcut& cut )
+        { g_infoStdAccel[i].cut = cut; return true; }
+
+QVariant ShortcutList::getOther( Other, uint ) const
+        { return QVariant(); }
+
+bool ShortcutList::setOther( Other, uint, QVariant )
+        { return false; }
+
+bool ShortcutList::save() const
+{
+        return writeSettings( QString::null, 0, false, true );
+}
+
+QString action(StdAccel id)
+        { return name(id); }
+QString description(StdAccel id)
+        { return label(id); }
+int key(StdAccel id)
+        { return shortcut(id).keyCodeQt(); }
+int defaultKey(StdAccel id)
+        { return shortcutDefault(id).keyCodeQt(); }
+
+bool isEqual(const QKeyEvent* ev, int keyQt)
+{
+        KKey key1( ev ), key2( keyQt );
+        return key1 == key2;
+}
+
+}
+
+KShortcutList::KShortcutList()
+{
+}
+
+KShortcutList::~KShortcutList()
+{
+}
+
+bool KShortcutList::isGlobal( uint ) const
+{
+        return false;
+}
+
+int KShortcutList::index( const QString& sName ) const
+{
+        uint nSize = count();
+        for( uint i = 0;
+             i < nSize;
+             ++i )
+            if( name( i ) == sName )
+                return i;
+        return -1;
+}
+
+int KShortcutList::index( const KKeySequence& seq ) const
+{
+        if( seq.isNull() )
+                return -1;
+
+        uint nSize = count();
+        for( uint i = 0; i < nSize; i++ ) {
+                if( shortcut(i).contains( seq ) )
+                        return i;
+        }
+
+        return -1;
+}
+
+const KInstance* KShortcutList::instance() const
+{
+        return 0;
+}
+
+QVariant KShortcutList::getOther( Other, uint ) const
+{
+        return QVariant();
+}
+
+bool KShortcutList::setOther( Other, uint, QVariant )
+{
+        return false;
+}
+
+bool KShortcutList::readSettings( const QString& sConfigGroup, KConfigBase* pConfig )
+{
+        kdDebug(125) << "KShortcutList::readSettings( \"" << sConfigGroup << "\", " << pConfig << " ) start" << endl;
+        if( !pConfig )
+                pConfig = KGlobal::config();
+        QString sGroup = (!sConfigGroup.isEmpty()) ? sConfigGroup : QString("Shortcuts");
+
+
+
+        if( sGroup == "Shortcuts" && pConfig->hasGroup( "Keys" ) ) {
+                readSettings( "Keys", pConfig );
+        }
+
+        kdDebug(125) << "\treadSettings( \"" << sGroup << "\", " << pConfig << " )" << endl;
+        if( !pConfig->hasGroup( sGroup ) )
+                return true;
+        KConfigGroupSaver cgs( pConfig, sGroup );
+
+        uint nSize = count();
+        for( uint i = 0; i < nSize; i++ ) {
+                if( isConfigurable(i) ) {
+                        QString sEntry = pConfig->readEntry( name(i) );
+                        if( !sEntry.isEmpty() ) {
+                                if( sEntry == "none" )
+                                        setShortcut( i, KShortcut() );
+                                else
+                                        setShortcut( i, KShortcut(sEntry) );
+                        }
+                        else
+                                setShortcut( i, shortcutDefault(i) );
+                        kdDebug(125) << "\t" << name(i) << " = '" << sEntry << "'" << endl;
+                }
+        }
+
+        kdDebug(125) << "KShortcutList::readSettings done" << endl;
+        return true;
+}
+
+bool KShortcutList::writeSettings( const QString &sConfigGroup, KConfigBase* pConfig, bool bWriteAll, bool bGlobal ) const
+{
+        kdDebug(125) << "KShortcutList::writeSettings( " << sConfigGroup << ", " << pConfig << ", " << bWriteAll << ", " << bGlobal << " )" << endl;
+        if( !pConfig )
+                pConfig = KGlobal::config();
+
+        QString sGroup = (!sConfigGroup.isEmpty()) ? sConfigGroup : QString("Shortcuts");
+
+
+        if( pConfig->hasGroup( "Keys" ) )
+                pConfig->deleteGroup( "Keys", true );
+
+        KConfigGroupSaver cs( pConfig, sGroup );
+
+        uint nSize = count();
+        for( uint i = 0; i < nSize; i++ ) {
+                if( isConfigurable(i) ) {
+                        const QString& sName = name(i);
+                        bool bConfigHasAction = !pConfig->readEntry( sName ).isEmpty();
+                        bool bSameAsDefault = (shortcut(i) == shortcutDefault(i));
+
+
+                        if( bWriteAll || !bSameAsDefault ) {
+                                QString s = shortcut(i).toStringInternal();
+                                if( s.isEmpty() )
+                                        s = "none";
+                                kdDebug(125) << "\twriting " << sName << " = " << s << endl;
+                                pConfig->writeEntry( sName, s, true, bGlobal );
+                        }
+
+
+                        else if( bConfigHasAction ) {
+                                kdDebug(125) << "\tremoving " << sName << " because == default" << endl;
+                                pConfig->deleteEntry( sName, false, bGlobal );
+                        }
+                }
+        }
+
+        pConfig->sync();
+        return true;
+}
+
+
+
+
+
+KAccelShortcutList::KAccelShortcutList( KAccel* pAccel )
+: m_actions( pAccel->actions() )
+{
+        m_bGlobal = false;
+}
+
+KAccelShortcutList::KAccelShortcutList( KGlobalAccel* pAccel )
+: m_actions( pAccel->actions() )
+{
+        m_bGlobal = true;
+}
+
+KAccelShortcutList::KAccelShortcutList( KAccelActions& actions, bool bGlobal )
+: m_actions( actions )
+{
+        m_bGlobal = bGlobal;
+}
+
+
+KAccelShortcutList::~KAccelShortcutList()
+        { }
+uint KAccelShortcutList::count() const
+        { return m_actions.count(); }
+QString KAccelShortcutList::name( uint i ) const
+        { return m_actions.actionPtr(i)->name(); }
+QString KAccelShortcutList::label( uint i ) const
+        { return m_actions.actionPtr(i)->label(); }
+QString KAccelShortcutList::whatsThis( uint i ) const
+        { return m_actions.actionPtr(i)->whatsThis(); }
+const KShortcut& KAccelShortcutList::shortcut( uint i ) const
+        { return m_actions.actionPtr(i)->shortcut(); }
+const KShortcut& KAccelShortcutList::shortcutDefault( uint i ) const
+        { return m_actions.actionPtr(i)->shortcutDefault(); }
+bool KAccelShortcutList::isConfigurable( uint i ) const
+        { return m_actions.actionPtr(i)->isConfigurable(); }
+bool KAccelShortcutList::setShortcut( uint i, const KShortcut& cut )
+        { return m_actions.actionPtr(i)->setShortcut( cut ); }
+QVariant KAccelShortcutList::getOther( Other, uint ) const
+        { return QVariant(); }
+bool KAccelShortcutList::isGlobal( uint ) const
+        { return m_bGlobal; }
+bool KAccelShortcutList::setOther( Other, uint, QVariant )
+        { return false; }
+bool KAccelShortcutList::save() const
+        { return writeSettings(); }
+
+void KShortcutList::virtual_hook( int, void* )
+{ }
+
+void KAccelShortcutList::virtual_hook( int id, void* data )
+{ KShortcutList::virtual_hook( id, data ); }
+
+void KStdAccel::ShortcutList::virtual_hook( int id, void* data )
+{ KShortcutList::virtual_hook( id, data ); }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C"
+
+int mkstemps(char *, int);
+extern "C"
+
+unsigned long strlcat(char*, const char*, unsigned long);
+
+
+
+
+
+
+extern "C"
+
+unsigned long strlcpy(char*, const char*, unsigned long);
+
+
+
+
+KCrash::HandlerType KCrash::_emergencySaveFunction = 0;
+KCrash::HandlerType KCrash::_crashHandler = 0;
+const char *KCrash::appName = 0;
+const char *KCrash::appPath = 0;
+
+
+
+
+void
+KCrash::setEmergencySaveFunction (HandlerType saveFunction)
+{
+  _emergencySaveFunction = saveFunction;
+
+
+
+
+
+  if (_emergencySaveFunction && !_crashHandler)
+    _crashHandler = defaultCrashHandler;
+}
+
+
+
+
+void
+KCrash::setCrashHandler (HandlerType handler)
+{
+  if (!handler)
+    handler = ((__sighandler_t) 0);
+
+  sigset_t mask;
+  sigemptyset(&mask);
+
+
+  signal (11, handler);
+  sigaddset(&mask, 11);
+
+
+  signal (8, handler);
+  sigaddset(&mask, 8);
+
+
+  signal (4, handler);
+  sigaddset(&mask, 4);
+
+
+  signal (6, handler);
+  sigaddset(&mask, 6);
+
+
+  sigprocmask(1, &mask, 0);
+
+  _crashHandler = handler;
+}
+
+void
+KCrash::defaultCrashHandler (int sig)
+{
+
+
+  static int crashRecursionCounter = 0;
+  crashRecursionCounter++;
+
+  signal(14, ((__sighandler_t) 0));
+  alarm(3);
+
+  if (crashRecursionCounter < 2) {
+    if (_emergencySaveFunction) {
+      _emergencySaveFunction (sig);
+    }
+    crashRecursionCounter++;
+  }
+
+
+  DCOPClient::emergencyClose();
+
+  struct rlimit rlp;
+  getrlimit(RLIMIT_NOFILE, &rlp);
+  for (int i = 0; i < (int)rlp.rlim_cur; i++)
+    close(i);
+
+  bool shuttingDown = false;
+
+
+  if ( !shuttingDown )
+  {
+    if (crashRecursionCounter < 3)
+    {
+      if (appName)
+      {
+
+        fprintf(stderr, "KCrash: crashing... crashRecursionCounter = %d\n", crashRecursionCounter);
+        fprintf(stderr, "KCrash: Application Name = %s path = %s pid = %d\n", appName ? appName : "<unknown>" , appPath ? appPath : "<unknown>", getpid());
+
+
+
+
+        pid_t pid = fork();
+
+        if (pid <= 0) {
+
+
+          char * argv[18];
+          int i = 0;
+
+
+          argv[i++] = qstrdup("drkonqi");
+
+
+          argv[i++] = qstrdup("-display");
+
+          if ( qt_xdisplay() )
+            argv[i++] = XDisplayString(qt_xdisplay());
+          else
+            argv[i++] = getenv("DISPLAY");
+
+
+
+
+
+          argv[i++] = qstrdup("--appname");
+          argv[i++] = qstrdup(appName);
+          if (KApplication::loadedByKdeinit)
+            argv[i++] = qstrdup("--kdeinit");
+
+
+          if (appPath) {
+            argv[i++] = qstrdup("--apppath");
+            argv[i++] = qstrdup(appPath);
+          }
+
+
+          QCString tmp;
+          tmp.setNum(sig);
+          argv[i++] = qstrdup("--signal");
+          argv[i++] = qstrdup(tmp.data());
+
+
+
+          if (pid == 0) {
+            tmp.setNum(getppid());
+            argv[i++] = qstrdup("--pid");
+            argv[i++] = qstrdup(tmp.data());
+          }
+
+          const KInstance *instance = KGlobal::_instance;
+          const KAboutData *about = instance ? instance->aboutData() : 0;
+          if (about) {
+            if (!about->version().isNull()) {
+              argv[i++] = qstrdup("--appversion");
+              argv[i++] = qstrdup(about->version().utf8());
+            }
+
+            if (!about->programName().isNull()) {
+              argv[i++] = qstrdup("--programname");
+              argv[i++] = qstrdup(about->programName().utf8());
+            }
+
+            if (!about->bugAddress().isNull()) {
+              argv[i++] = qstrdup("--bugaddress");
+              argv[i++] = qstrdup(about->bugAddress().utf8());
+            }
+          }
+
+          if ( KApplication::kApplication() && !KApplication::kApplication()->startupId().isNull()) {
+            argv[i++] = qstrdup("--startupid");
+            argv[i++] = qstrdup(KApplication::kApplication()->startupId());
+          }
+
+
+          argv[i++] = __null;
+
+          setgid(getgid());
+          setuid(getuid());
+
+          execvp("drkonqi", argv);
+
+
+
+
+
+        }
+        else
+        {
+
+          alarm(0);
+
+
+          waitpid(pid, __null, 0);
+          _exit(253);
+        }
+      }
+      else {
+        fprintf(stderr, "Unknown appname\n");
+      }
+    }
+
+    if (crashRecursionCounter < 4)
+    {
+      fprintf(stderr, "Unable to start Dr. Konqi\n");
+    }
+  }
+
+  _exit(255);
+}
+
+
+
+namespace KIDNA {
+
+
+
+
+
+
+    QCString toAsciiCString(const QString &idna);
+
+
+
+
+
+
+
+    QString toAscii(const QString &idna);
+
+
+
+
+
+    QString toUnicode(const QString &idna);
+}
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (__const char *__assertion, __const char *__file,
+                           unsigned int __line, __const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, __const char *__file,
+                                  unsigned int __line,
+                                  __const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+class QUrlPrivate;
+
+class QUrl
+{
+public:
+    QUrl();
+    QUrl( const QString& url );
+    QUrl( const QUrl& url );
+    QUrl( const QUrl& url, const QString& relUrl, bool checkSlash = FALSE );
+    virtual ~QUrl();
+
+    QString protocol() const;
+    virtual void setProtocol( const QString& protocol );
+
+    QString user() const;
+    virtual void setUser( const QString& user );
+    bool hasUser() const;
+
+    QString password() const;
+    virtual void setPassword( const QString& pass );
+    bool hasPassword() const;
+
+    QString host() const;
+    virtual void setHost( const QString& user );
+    bool hasHost() const;
+
+    int port() const;
+    virtual void setPort( int port );
+    bool hasPort() const;
+
+    QString path( bool correct = TRUE ) const;
+    virtual void setPath( const QString& path );
+    bool hasPath() const;
+
+    virtual void setEncodedPathAndQuery( const QString& enc );
+    QString encodedPathAndQuery();
+
+    virtual void setQuery( const QString& txt );
+    QString query() const;
+
+    QString ref() const;
+    virtual void setRef( const QString& txt );
+    bool hasRef() const;
+
+    bool isValid() const;
+    bool isLocalFile() const;
+
+    virtual void addPath( const QString& path );
+    virtual void setFileName( const QString& txt );
+
+    QString fileName() const;
+    QString dirPath() const;
+
+    QUrl& operator=( const QUrl& url );
+    QUrl& operator=( const QString& url );
+
+    bool operator==( const QUrl& url ) const;
+    bool operator==( const QString& url ) const;
+
+    static void decode( QString& url );
+    static void encode( QString& url );
+
+    operator QString() const;
+    virtual QString toString( bool encodedPath = FALSE, bool forcePrependProtocol = TRUE ) const;
+
+    virtual bool cdUp();
+
+    static bool isRelativeUrl( const QString &url );
+
+protected:
+    virtual void reset();
+    virtual bool parse( const QString& url );
+
+private:
+    QUrlPrivate *d;
+
+};
+
+
+
+
+
+
+
+static const QString fileProt = "file";
+
+static QTextCodec * codecForHint( int encoding_hint )
+{
+    return QTextCodec::codecForMib( encoding_hint );
+}
+
+static QString encode( const QString& segment, bool encode_slash, int encoding_hint )
+{
+  const char *encode_string;
+  if (encode_slash)
+    encode_string = "<>#@\"&%?={}|^~[]\'`\\:+/";
+  else
+    encode_string = "<>#@\"&%?={}|^~[]\'`\\:+";
+
+  QCString local;
+  if (encoding_hint==0)
+    local = segment.local8Bit();
+  else
+  {
+      QTextCodec * textCodec = codecForHint( encoding_hint );
+      if (!textCodec)
+          local = segment.local8Bit();
+      else
+          local = textCodec->fromUnicode( segment );
+  }
+
+  int old_length = local.length();
+
+  if ( !old_length )
+    return segment.isNull() ? QString::null : QString("");
+
+
+  QChar *new_segment = new QChar[ old_length * 3 + 1 ];
+  int new_length = 0;
+
+  for ( int i = 0; i < old_length; i++ )
+  {
+
+
+
+
+    unsigned char character = local[i];
+    if ( (character <= 32) || (character >= 127) ||
+         strchr(encode_string, character) )
+    {
+      new_segment[ new_length++ ] = '%';
+
+      unsigned int c = character / 16;
+      c += (c > 9) ? ('A' - 10) : '0';
+      new_segment[ new_length++ ] = c;
+
+      c = character % 16;
+      c += (c > 9) ? ('A' - 10) : '0';
+      new_segment[ new_length++ ] = c;
+
+    }
+    else
+      new_segment[ new_length++ ] = local[i];
+  }
+
+  QString result = QString(new_segment, new_length);
+  delete [] new_segment;
+  return result;
+}
+
+static QString encodeHost( const QString& segment, bool encode_slash, int encoding_hint )
+{
+
+
+
+
+
+  (void)encode_slash;;
+  (void)encoding_hint;;
+  return KIDNA::toAscii(segment);
+
+
+
+}
+
+static int hex2int( unsigned int _char )
+{
+  if ( _char >= 'A' && _char <='F')
+    return _char - 'A' + 10;
+  if ( _char >= 'a' && _char <='f')
+    return _char - 'a' + 10;
+  if ( _char >= '0' && _char <='9')
+    return _char - '0';
+  return -1;
+}
+static QString lazy_encode( const QString& segment )
+{
+  int old_length = segment.length();
+
+  if ( !old_length )
+    return QString::null;
+
+
+  QChar *new_segment = new QChar[ old_length * 3 + 1 ];
+  int new_length = 0;
+
+  for ( int i = 0; i < old_length; i++ )
+  {
+    unsigned int character = segment[i].unicode();
+
+
+    if ((character < 32) ||
+        ((character == '%') &&
+           (i+2 < old_length) &&
+          (hex2int(segment[i+1].unicode())!= -1) &&
+          (hex2int(segment[i+2].unicode())!= -1)) ||
+        (character == '?') ||
+        (character == '@') ||
+        (character == '#') ||
+        ((character == 32) && (i+1 == old_length)))
+    {
+      new_segment[ new_length++ ] = '%';
+
+      unsigned int c = character / 16;
+      c += (c > 9) ? ('A' - 10) : '0';
+      new_segment[ new_length++ ] = c;
+
+      c = character % 16;
+      c += (c > 9) ? ('A' - 10) : '0';
+      new_segment[ new_length++ ] = c;
+    }
+    else
+    new_segment[ new_length++ ] = segment[i];
+  }
+
+  QString result = QString(new_segment, new_length);
+  delete [] new_segment;
+  return result;
+}
+
+static void decode( const QString& segment, QString &decoded, QString &encoded, int encoding_hint=0, bool updateDecoded = true )
+{
+  decoded = QString::null;
+  encoded = segment;
+
+  int old_length = segment.length();
+  if ( !old_length )
+    return;
+
+  QTextCodec *textCodec = 0;
+  if (encoding_hint)
+      textCodec = codecForHint( encoding_hint );
+
+  if (!textCodec)
+      textCodec = QTextCodec::codecForLocale();
+
+  QCString csegment = textCodec->fromUnicode(segment);
+
+  if (textCodec->toUnicode(csegment) != segment)
+  {
+
+      textCodec = codecForHint( 106 );
+      csegment = textCodec->fromUnicode(segment);
+  }
+  old_length = csegment.length();
+
+  int new_length = 0;
+  int new_length2 = 0;
+
+
+  char *new_segment = new char[ old_length + 1 ];
+  QChar *new_usegment = new QChar[ old_length * 3 + 1 ];
+
+  int i = 0;
+  while( i < old_length )
+  {
+    bool bReencode = false;
+    unsigned char character = csegment[ i++ ];
+    if ((character <= ' ') || (character > 127))
+       bReencode = true;
+
+    new_usegment [ new_length2++ ] = character;
+    if (character == '%' )
+    {
+      int a = i+1 < old_length ? hex2int( csegment[i] ) : -1;
+      int b = i+1 < old_length ? hex2int( csegment[i+1] ) : -1;
+      if ((a == -1) || (b == -1))
+      {
+
+         bReencode = true;
+      }
+      else
+      {
+
+         character = a * 16 + b;
+         if (!character && updateDecoded)
+            break;
+
+         new_usegment [ new_length2++ ] = (unsigned char) csegment[i++];
+         new_usegment [ new_length2++ ] = (unsigned char) csegment[i++];
+      }
+    }
+    if (bReencode)
+    {
+      new_length2--;
+      new_usegment [ new_length2++ ] = '%';
+
+      unsigned int c = character / 16;
+      c += (c > 9) ? ('A' - 10) : '0';
+      new_usegment[ new_length2++ ] = c;
+
+      c = character % 16;
+      c += (c > 9) ? ('A' - 10) : '0';
+      new_usegment[ new_length2++ ] = c;
+    }
+
+    new_segment [ new_length++ ] = character;
+  }
+  new_segment [ new_length ] = 0;
+
+  encoded = QString( new_usegment, new_length2);
+
+
+  if (updateDecoded)
+  {
+     QByteArray array;
+     array.setRawData(new_segment, new_length);
+     decoded = textCodec->toUnicode( array, new_length );
+     array.resetRawData(new_segment, new_length);
+     QCString validate = textCodec->fromUnicode(decoded);
+
+     if (strcmp(validate.data(), new_segment) != 0)
+     {
+        decoded = QString::fromLocal8Bit(new_segment, new_length);
+     }
+  }
+
+  delete [] new_segment;
+  delete [] new_usegment;
+}
+
+static QString decode(const QString &segment, int encoding_hint = 0)
+{
+  QString result;
+  QString tmp;
+  decode(segment, result, tmp, encoding_hint);
+  return result;
+}
+
+static QString cleanpath(const QString &path, bool cleanDirSeparator=true)
+{
+  if (path.isEmpty()) return QString::null;
+  int len = path.length();
+  bool slash = (len && path[len-1] == '/') ||
+               (len > 1 && path[len-2] == '/' && path[len-1] == '.');
+
+
+
+
+
+
+
+  QString result;
+  int cdUp, orig_pos, pos;
+
+  cdUp = 0;
+  pos = orig_pos = len;
+  while ( pos && (pos = path.findRev('/',--pos)) != -1 )
+  {
+    len = orig_pos - pos - 1;
+    if ( len == 2 && path[pos+1] == '.' && path[pos+2] == '.' )
+      cdUp++;
+    else
+    {
+
+
+      if ( (len || !cleanDirSeparator) &&
+           (len != 1 || path[pos+1] != '.' ) )
+      {
+          if ( !cdUp )
+              result.prepend(path.mid(pos, len+1));
+          else
+              cdUp--;
+      }
+    }
+    orig_pos = pos;
+  }
+
+  if ( result.isEmpty() )
+    result = "/";
+  else if ( slash && result[result.length()-1] != '/' )
+       result.append('/');
+
+  return result;
+}
+
+bool KURL::isRelativeURL(const QString &_url)
+{
+  int len = _url.length();
+  if (!len) return true;
+  const QChar *str = _url.unicode();
+
+
+  if (!isalpha(str[0].latin1()))
+     return true;
+
+  for(int i = 1; i < len; i++)
+  {
+     char c = str[i].latin1();
+     if (c == ':')
+        return false;
+
+
+     if (!isalpha(c) && !isdigit(c) && (c != '+') && (c != '-'))
+        return true;
+  }
+
+  return true;
+}
+
+KURL::List::List(const KURL &url)
+{
+    append( url );
+}
+
+KURL::List::List(const QStringList &list)
+{
+  for (QStringList::ConstIterator it = list.begin();
+       it != list.end();
+       it++)
+    {
+      append( KURL(*it) );
+    }
+}
+
+QStringList KURL::List::toStringList() const
+{
+  QStringList lst;
+   for( KURL::List::ConstIterator it = begin();
+        it != end();
+        it++)
+   {
+      lst.append( (*it).url() );
+   }
+   return lst;
+}
+
+
+KURL::KURL()
+{
+  reset();
+}
+
+KURL::~KURL()
+{
+}
+
+
+KURL::KURL( const QString &url, int encoding_hint )
+{
+  reset();
+  parse( url, encoding_hint );
+}
+
+KURL::KURL( const char * url, int encoding_hint )
+{
+  reset();
+  parse( QString::fromLatin1(url), encoding_hint );
+}
+
+KURL::KURL( const QCString& url, int encoding_hint )
+{
+  reset();
+  parse( QString::fromLatin1(url), encoding_hint );
+}
+
+KURL::KURL( const KURL& _u )
+{
+  *this = _u;
+}
+
+QDataStream & operator<< (QDataStream & s, const KURL & a)
+{
+  QString QueryForWire=a.m_strQuery_encoded;
+  if (!a.m_strQuery_encoded.isNull())
+    QueryForWire.prepend("?");
+
+    s << a.m_strProtocol << a.m_strUser << a.m_strPass << a.m_strHost
+      << a.m_strPath << a.m_strPath_encoded << QueryForWire << a.m_strRef_encoded
+      << Q_INT8(a.m_bIsMalformed ? 1 : 0) << a.m_iPort;
+    return s;
+}
+
+QDataStream & operator>> (QDataStream & s, KURL & a)
+{
+    Q_INT8 malf;
+    QString QueryFromWire;
+    s >> a.m_strProtocol >> a.m_strUser >> a.m_strPass >> a.m_strHost
+      >> a.m_strPath >> a.m_strPath_encoded >> QueryFromWire >> a.m_strRef_encoded
+      >> malf >> a.m_iPort;
+    a.m_bIsMalformed = (malf != 0);
+
+    if ( QueryFromWire.isEmpty() )
+      a.m_strQuery_encoded = QString::null;
+    else
+      a.m_strQuery_encoded = QueryFromWire.mid(1);
+
+    return s;
+}
+
+
+KURL::KURL( const QUrl &u )
+{
+  *this = u;
+}
+
+
+KURL::KURL( const KURL& _u, const QString& _rel_url, int encoding_hint )
+{
+  if (_u.hasSubURL())
+  {
+    KURL::List lst = split( _u );
+    KURL u(lst.last(), _rel_url, encoding_hint);
+    lst.remove( lst.last() );
+    lst.append( u );
+    *this = join( lst );
+    return;
+  }
+
+
+
+  QString rUrl = _rel_url;
+  int len = _u.m_strProtocol.length();
+  if ( !_u.m_strHost.isEmpty() && !rUrl.isEmpty() &&
+       rUrl.find( _u.m_strProtocol, 0, false ) == 0 &&
+       rUrl[len] == ':' && (rUrl[len+1] != '/' ||
+       (rUrl[len+1] == '/' && rUrl[len+2] != '/')) )
+  {
+    rUrl.remove( 0, rUrl.find( ':' ) + 1 );
+  }
+
+  if ( rUrl.isEmpty() )
+  {
+    *this = _u;
+  }
+  else if ( rUrl[0] == '#' )
+  {
+    *this = _u;
+    QString ref = decode(rUrl.mid(1), encoding_hint);
+    if ( ref.isNull() )
+        ref = "";
+    setHTMLRef( ref );
+  }
+  else if ( isRelativeURL( rUrl) )
+  {
+    *this = _u;
+    m_strQuery_encoded = QString::null;
+    m_strRef_encoded = QString::null;
+    if ( rUrl[0] == '/')
+    {
+        if ((rUrl.length() > 1) && (rUrl[1] == '/'))
+        {
+           m_strHost = QString::null;
+        }
+        m_strPath = QString::null;
+        m_strPath_encoded = QString::null;
+    }
+    else if ( rUrl[0] != '?' )
+    {
+       int pos = m_strPath.findRev( '/' );
+       if (pos >= 0)
+          m_strPath.truncate(pos);
+       m_strPath += '/';
+       if (!m_strPath_encoded.isEmpty())
+       {
+          pos = m_strPath_encoded.findRev( '/' );
+          if (pos >= 0)
+             m_strPath_encoded.truncate(pos);
+          m_strPath_encoded += '/';
+       }
+    }
+    else
+    {
+       if ( m_strPath.isEmpty() )
+          m_strPath = '/';
+    }
+    KURL tmp( url() + rUrl, encoding_hint);
+    *this = tmp;
+    cleanPath(false);
+  }
+  else
+  {
+    KURL tmp( rUrl, encoding_hint);
+    *this = tmp;
+
+    if (!_u.m_strUser.isEmpty() && m_strUser.isEmpty() && (_u.m_strHost == m_strHost) && (_u.m_strProtocol == m_strProtocol))
+    {
+       m_strUser = _u.m_strUser;
+       m_strPass = _u.m_strPass;
+    }
+  }
+}
+
+void KURL::reset()
+{
+  m_strProtocol = QString::null;
+  m_strUser = QString::null;
+  m_strPass = QString::null;
+  m_strHost = QString::null;
+  m_strPath = QString::null;
+  m_strPath_encoded = QString::null;
+  m_strQuery_encoded = QString::null;
+  m_strRef_encoded = QString::null;
+  m_bIsMalformed = true;
+  m_iPort = 0;
+}
+
+bool KURL::isEmpty() const
+{
+  return (m_strPath.isEmpty() && m_strProtocol.isEmpty());
+}
+
+void KURL::parse( const QString& _url, int encoding_hint )
+{
+
+
+
+  if ( _url.isEmpty() )
+  {
+    m_strProtocol = _url;
+    return;
+  }
+
+  QString port;
+  bool badHostName = false;
+  int start = 0;
+  uint len = _url.length();
+  const QChar* buf = _url.unicode();
+  const QChar* orig = buf;
+
+  QChar delim;
+  QString tmp;
+
+  uint pos = 0;
+
+
+  QChar x = buf[pos++];
+  if ( x == '/' )
+    goto Node9;
+  if ( !isalpha( (int)x ) )
+    goto NodeErr;
+
+
+
+
+  while( pos < len && (isalpha((int)buf[pos]) || isdigit((int)buf[pos]) ||
+          buf[pos] == '+' || buf[pos] == '-')) pos++;
+
+  if ( pos+2 < len && buf[pos] == ':' && buf[pos+1] == '/' && buf[pos+2] == '/' )
+    {
+      m_strProtocol = QString( orig, pos ).lower();
+      pos += 3;
+    }
+  else if (pos+1 < len && buf[pos] == ':' )
+    {
+      m_strProtocol = QString( orig, pos ).lower();
+
+      pos++;
+      start = pos;
+      goto Node9;
+    }
+  else
+    goto NodeErr;
+
+
+  if ( pos == len )
+      goto NodeErr;
+  start = pos;
+
+
+  if (buf[pos] == '[')
+      goto Node8;
+
+  x = buf[pos];
+  while( (x != ':') && (x != '@') && (x != '/') && (x != '?') && (x != '#') )
+  {
+     if ((x == '\"') || (x == ';') || (x == '<'))
+        badHostName = true;
+     if (++pos == len)
+        break;
+     x = buf[pos];
+  }
+  if ( pos == len )
+    {
+      if (badHostName)
+         goto NodeErr;
+
+      setHost(decode(QString( buf + start, pos - start ), encoding_hint));
+      goto NodeOk;
+    }
+  if ( x == '@' )
+    {
+      m_strUser = decode(QString( buf + start, pos - start ), encoding_hint);
+      pos++;
+      goto Node7;
+    }
+  else if ( (x == '/') || (x == '?') || (x == '#'))
+    {
+      if (badHostName)
+         goto NodeErr;
+
+      setHost(decode(QString( buf + start, pos - start ), encoding_hint));
+      start = pos;
+      goto Node9;
+    }
+  else if ( x != ':' )
+    goto NodeErr;
+  m_strUser = decode(QString( buf + start, pos - start ), encoding_hint);
+  pos++;
+
+
+  if ( pos == len )
+    goto NodeErr;
+  start = pos++;
+
+
+  while( (pos < len) &&
+                (buf[pos] != '@') &&
+                (buf[pos] != '/') &&
+                (buf[pos] != '?') &&
+                (buf[pos] != '#')) pos++;
+
+
+  if ( (pos == len) || (buf[pos] != '@') )
+    {
+
+      if (badHostName)
+         goto NodeErr;
+      setHost(m_strUser);
+      m_strUser = QString::null;
+      QString tmp( buf + start, pos - start );
+      char *endptr;
+      m_iPort = (unsigned short int)strtol(tmp.ascii(), &endptr, 10);
+      if ((pos == len) && (strlen(endptr) == 0))
+        goto NodeOk;
+
+      pos -= strlen(endptr);
+      if ((buf[pos] != '@') &&
+          (buf[pos] != '/') &&
+          (buf[pos] != '?') &&
+          (buf[pos] != '#'))
+        goto NodeErr;
+
+      start = pos++;
+      goto Node9;
+    }
+  m_strPass = decode(QString( buf + start, pos - start), encoding_hint);
+  pos++;
+
+
+ Node7:
+  if ( pos == len )
+    goto NodeErr;
+
+ Node8:
+  if (buf[pos] == '[')
+  {
+
+    start = ++pos;
+
+    if (pos == len)
+    {
+       badHostName = true;
+       goto NodeErr;
+    }
+
+    badHostName = false;
+    x = buf[pos];
+    while( (x != ']') )
+    {
+       if ((x == '\"') || (x == ';') || (x == '<'))
+          badHostName = true;
+       if (++pos == len)
+       {
+          badHostName = true;
+          break;
+       }
+       x = buf[pos];
+    }
+    if (badHostName)
+       goto NodeErr;
+    setHost(decode(QString( buf + start, pos - start ), encoding_hint));
+    if (pos < len) pos++;
+    if (pos == len)
+       goto NodeOk;
+  }
+  else
+  {
+
+    start = pos;
+
+
+    badHostName = false;
+    x = buf[pos];
+    while( (x != ':') && (x != '@') && (x != '/') && (x != '?') && (x != '#') )
+    {
+       if ((x == '\"') || (x == ';') || (x == '<'))
+          badHostName = true;
+       if (++pos == len)
+          break;
+       x = buf[pos];
+    }
+    if (badHostName)
+       goto NodeErr;
+    if ( pos == len )
+    {
+       setHost(decode(QString( buf + start, pos - start ), encoding_hint));
+       goto NodeOk;
+    }
+    setHost(decode(QString( buf + start, pos - start ), encoding_hint));
+  }
+  x = buf[pos];
+  if ( x == '/' )
+    {
+      start = pos++;
+      goto Node9;
+    }
+  else if ( x != ':' )
+    goto NodeErr;
+  pos++;
+
+
+  if ( pos == len )
+    goto NodeErr;
+  start = pos;
+  if ( !isdigit( buf[pos++] ) )
+    goto NodeErr;
+
+
+  while( pos < len && isdigit( buf[pos] ) ) pos++;
+  port = QString( buf + start, pos - start );
+  m_iPort = port.toUShort();
+  if ( pos == len )
+    goto NodeOk;
+  start = pos++;
+
+ Node9:
+
+  while( pos < len && buf[pos] != '#' && buf[pos]!='?' ) pos++;
+
+  tmp = QString( buf + start, pos - start );
+
+  setEncodedPath( tmp, encoding_hint );
+
+  if ( pos == len )
+      goto NodeOk;
+
+
+  delim = (buf[pos++]=='#'?'?':'#');
+
+  start = pos;
+
+  while(pos < len && buf[pos]!=delim ) pos++;
+
+  tmp = QString(buf + start, pos - start);
+  if (delim=='#')
+      setQuery(tmp, encoding_hint);
+  else
+      m_strRef_encoded = tmp;
+
+  if (pos == len)
+      goto NodeOk;
+
+
+  tmp = QString( buf + pos + 1, len - pos - 1);
+  if (delim == '#')
+      m_strRef_encoded = tmp;
+  else
+      setQuery(tmp, encoding_hint);
+
+ NodeOk:
+
+  m_bIsMalformed = false;
+
+
+  if (m_strProtocol.isEmpty())
+  {
+    m_strProtocol = fileProt;
+  }
+  return;
+
+ NodeErr:
+
+  reset();
+  m_strProtocol = _url;
+}
+
+KURL& KURL::operator=( const QString& _url )
+{
+  reset();
+  parse( _url );
+
+  return *this;
+}
+
+KURL& KURL::operator=( const char * _url )
+{
+  reset();
+  parse( QString::fromLatin1(_url) );
+
+  return *this;
+}
+
+
+KURL& KURL::operator=( const QUrl & u )
+{
+  m_strProtocol = u.protocol();
+  m_strUser = u.user();
+  m_strPass = u.password();
+  m_strHost = u.host();
+  m_strPath = u.path( FALSE );
+  m_strPath_encoded = QString::null;
+  m_strQuery_encoded = u.query();
+  m_strRef_encoded = u.ref();
+  m_bIsMalformed = !u.isValid();
+  m_iPort = u.port();
+
+  return *this;
+}
+
+
+KURL& KURL::operator=( const KURL& _u )
+{
+  m_strProtocol = _u.m_strProtocol;
+  m_strUser = _u.m_strUser;
+  m_strPass = _u.m_strPass;
+  m_strHost = _u.m_strHost;
+  m_strPath = _u.m_strPath;
+  m_strPath_encoded = _u.m_strPath_encoded;
+  m_strQuery_encoded = _u.m_strQuery_encoded;
+  m_strRef_encoded = _u.m_strRef_encoded;
+  m_bIsMalformed = _u.m_bIsMalformed;
+  m_iPort = _u.m_iPort;
+
+  return *this;
+}
+
+bool KURL::operator<( const KURL& _u) const
+{
+  int i;
+  if (!_u.isValid())
+  {
+     if (!isValid())
+     {
+        i = m_strProtocol.compare(_u.m_strProtocol);
+        return (i < 0);
+     }
+     return false;
+  }
+  if (!isValid())
+     return true;
+
+  i = m_strProtocol.compare(_u.m_strProtocol);
+  if (i) return (i < 0);
+
+  i = m_strHost.compare(_u.m_strHost);
+  if (i) return (i < 0);
+
+  if (m_iPort != _u.m_iPort) return (m_iPort < _u.m_iPort);
+
+  i = m_strPath.compare(_u.m_strPath);
+  if (i) return (i < 0);
+
+  i = m_strQuery_encoded.compare(_u.m_strQuery_encoded);
+  if (i) return (i < 0);
+
+  i = m_strRef_encoded.compare(_u.m_strRef_encoded);
+  if (i) return (i < 0);
+
+  i = m_strUser.compare(_u.m_strUser);
+  if (i) return (i < 0);
+
+  i = m_strPass.compare(_u.m_strPass);
+  if (i) return (i < 0);
+
+  return false;
+}
+
+bool KURL::operator==( const KURL& _u ) const
+{
+  if ( !isValid() || !_u.isValid() )
+    return false;
+
+  if ( m_strProtocol == _u.m_strProtocol &&
+       m_strUser == _u.m_strUser &&
+       m_strPass == _u.m_strPass &&
+       m_strHost == _u.m_strHost &&
+       m_strPath == _u.m_strPath &&
+
+       ( m_strPath_encoded.isNull() || _u.m_strPath_encoded.isNull() ||
+         m_strPath_encoded == _u.m_strPath_encoded ) &&
+       m_strQuery_encoded == _u.m_strQuery_encoded &&
+       m_strRef_encoded == _u.m_strRef_encoded &&
+       m_iPort == _u.m_iPort )
+  {
+    return true;
+  }
+
+  return false;
+}
+
+bool KURL::operator==( const QString& _u ) const
+{
+  KURL u( _u );
+  return ( *this == u );
+}
+
+bool KURL::cmp( const KURL &u, bool ignore_trailing ) const
+{
+  return equals( u, ignore_trailing );
+}
+
+bool KURL::equals( const KURL &_u, bool ignore_trailing ) const
+{
+  if ( !isValid() || !_u.isValid() )
+    return false;
+
+  if ( ignore_trailing )
+  {
+    QString path1 = path(1);
+    QString path2 = _u.path(1);
+    if ( path1 != path2 )
+      return false;
+
+    if ( m_strProtocol == _u.m_strProtocol &&
+         m_strUser == _u.m_strUser &&
+         m_strPass == _u.m_strPass &&
+         m_strHost == _u.m_strHost &&
+         m_strQuery_encoded == _u.m_strQuery_encoded &&
+         m_strRef_encoded == _u.m_strRef_encoded &&
+         m_iPort == _u.m_iPort )
+      return true;
+
+    return false;
+  }
+
+  return ( *this == _u );
+}
+
+bool KURL::isParentOf( const KURL& _u ) const
+{
+  if ( !isValid() || !_u.isValid() )
+    return false;
+
+  if ( m_strProtocol == _u.m_strProtocol &&
+       m_strUser == _u.m_strUser &&
+       m_strPass == _u.m_strPass &&
+       m_strHost == _u.m_strHost &&
+       m_strQuery_encoded == _u.m_strQuery_encoded &&
+       m_strRef_encoded == _u.m_strRef_encoded &&
+       m_iPort == _u.m_iPort )
+  {
+    if ( path().isEmpty() || _u.path().isEmpty() )
+        return false;
+
+    QString p1( cleanpath( path() ) );
+    if ( p1[p1.length()-1] != '/' )
+        p1 += '/';
+    QString p2( cleanpath( _u.path() ) );
+    if ( p2[p2.length()-1] != '/' )
+        p2 += '/';
+
+
+
+
+
+    return p2.startsWith( p1 );
+  }
+  return false;
+}
+
+void KURL::setFileName( const QString& _txt )
+{
+  m_strRef_encoded = QString::null;
+  int i = 0;
+  while( _txt[i] == '/' ) ++i;
+  QString tmp;
+  if ( i )
+    tmp = _txt.mid( i );
+  else
+    tmp = _txt;
+
+  QString path = m_strPath_encoded.isEmpty() ? m_strPath : m_strPath_encoded;
+  if ( path.isEmpty() )
+    path = "/";
+  else
+  {
+    int lastSlash = path.findRev( '/' );
+    if ( lastSlash == -1)
+    {
+
+
+      path = "/";
+    }
+    else if ( path.right(1) != "/" )
+      path.truncate( lastSlash+1 );
+  }
+  if (m_strPath_encoded.isEmpty())
+  {
+     path += tmp;
+     setPath( path );
+  }
+  else
+  {
+     path += encode_string(tmp);
+     setEncodedPath( path );
+  }
+  cleanPath();
+}
+
+void KURL::cleanPath( bool cleanDirSeparator )
+{
+  m_strPath = cleanpath(m_strPath, cleanDirSeparator);
+
+  m_strPath_encoded = cleanpath(m_strPath_encoded, cleanDirSeparator);
+}
+
+static QString trailingSlash( int _trailing, const QString &path )
+{
+  QString result = path;
+
+  if ( _trailing == 0 )
+    return result;
+  else if ( _trailing == 1 )
+  {
+    int len = result.length();
+    if ( len == 0 )
+      result = QString::null;
+    else if ( result[ len - 1 ] != '/' )
+      result += "/";
+    return result;
+  }
+  else if ( _trailing == -1 )
+  {
+    if ( result == "/" )
+      return result;
+    int len = result.length();
+    if ( len != 0 && result[ len - 1 ] == '/' )
+      result.truncate( len - 1 );
+    return result;
+  }
+  else {
+    (static_cast<void> ((0) ? 0 : (__assert_fail ("0", "/coolo/prod/kdelibs/kdecore/kurl.cpp", 1101, __PRETTY_FUNCTION__), 0)));
+    return QString::null;
+  }
+}
+
+void KURL::adjustPath( int _trailing )
+{
+  if (!m_strPath_encoded.isEmpty())
+  {
+     m_strPath_encoded = trailingSlash( _trailing, m_strPath_encoded );
+  }
+  m_strPath = trailingSlash( _trailing, m_strPath );
+}
+
+
+QString KURL::encodedPathAndQuery( int _trailing, bool _no_empty_path, int encoding_hint ) const
+{
+  QString tmp;
+  if (!m_strPath_encoded.isEmpty() && encoding_hint == 0)
+  {
+     tmp = trailingSlash( _trailing, m_strPath_encoded );
+  }
+  else
+  {
+     tmp = path( _trailing );
+     if ( _no_empty_path && tmp.isEmpty() )
+        tmp = "/";
+     tmp = encode( tmp, false, encoding_hint );
+  }
+
+
+  if (!m_strQuery_encoded.isNull())
+      tmp += '?' + m_strQuery_encoded;
+  return tmp;
+}
+
+void KURL::setEncodedPath( const QString& _txt, int encoding_hint )
+{
+  m_strPath_encoded = _txt;
+
+  decode( m_strPath_encoded, m_strPath, m_strPath_encoded, encoding_hint );
+
+  if (m_strProtocol == fileProt)
+     m_strPath_encoded = QString::null;
+}
+
+
+void KURL::setEncodedPathAndQuery( const QString& _txt, int encoding_hint )
+{
+  int pos = _txt.find( '?' );
+  if ( pos == -1 )
+  {
+    setEncodedPath(_txt, encoding_hint);
+    m_strQuery_encoded = QString::null;
+  }
+  else
+  {
+    setEncodedPath(_txt.left( pos ), encoding_hint);
+    setQuery(_txt.right(_txt.length() - pos - 1), encoding_hint);
+  }
+}
+
+QString KURL::path( int _trailing ) const
+{
+  return trailingSlash( _trailing, path() );
+}
+
+bool KURL::isLocalFile() const
+{
+  if ( (m_strProtocol != fileProt ) || hasSubURL() )
+     return false;
+
+  if (m_strHost.isEmpty() || (m_strHost == "localhost"))
+     return true;
+
+  char hostname[ 256 ];
+  hostname[ 0 ] = '\0';
+  if (!gethostname( hostname, 255 ))
+     hostname[sizeof(hostname)-1] = '\0';
+
+  for(char *p = hostname; *p; p++)
+     *p = tolower(*p);
+
+  return (m_strHost == hostname);
+}
+
+void KURL::setFileEncoding(const QString &encoding)
+{
+  if (!isLocalFile())
+     return;
+
+  QString q = query();
+
+  if (!q.isEmpty() && (q[0] == '?'))
+     q = q.mid(1);
+
+  QStringList args = QStringList::split('&', q);
+  for(QStringList::Iterator it = args.begin();
+      it != args.end();)
+  {
+      QString s = decode_string(*it);
+      if (s.startsWith("charset="))
+         it = args.erase(it);
+      else
+         ++it;
+  }
+  if (!encoding.isEmpty())
+     args.append("charset="+encode_string(encoding));
+
+  if (args.isEmpty())
+     setQuery(QString::null);
+  else
+     setQuery(args.join("&"));
+}
+
+QString KURL::fileEncoding() const
+{
+  if (!isLocalFile())
+     return QString::null;
+
+  QString q = query();
+
+  if (q.isEmpty())
+     return QString::null;
+
+  if (q[0] == '?')
+     q = q.mid(1);
+
+  QStringList args = QStringList::split('&', q);
+  for(QStringList::ConstIterator it = args.begin();
+      it != args.end();
+      ++it)
+  {
+      QString s = decode_string(*it);
+      if (s.startsWith("charset="))
+         return s.mid(8);
+  }
+  return QString::null;
+}
+
+bool KURL::hasSubURL() const
+{
+  if ( m_strProtocol.isEmpty() || m_bIsMalformed )
+    return false;
+  if (m_strRef_encoded.isEmpty())
+     return false;
+  if (m_strRef_encoded.startsWith("gzip:"))
+     return true;
+  if (m_strRef_encoded.startsWith("bzip:"))
+     return true;
+  if (m_strRef_encoded.startsWith("bzip2:"))
+     return true;
+  if (m_strRef_encoded.startsWith("tar:"))
+     return true;
+  if (m_strRef_encoded.startsWith("ar:"))
+     return true;
+  if (m_strRef_encoded.startsWith("zip:"))
+     return true;
+  if ( m_strProtocol == "error" )
+     return true;
+  return false;
+}
+
+QString KURL::url( int _trailing, int encoding_hint ) const
+{
+  if( m_bIsMalformed )
+  {
+
+
+
+    return m_strProtocol;
+  }
+
+  QString u = m_strProtocol;
+  if (!u.isEmpty())
+     u += ":";
+
+  if ( hasHost() )
+  {
+    u += "//";
+    if ( hasUser() )
+    {
+      u += encode(m_strUser, true, encoding_hint);
+      if ( hasPass() )
+      {
+        u += ":";
+        u += encode(m_strPass, true, encoding_hint);
+      }
+      u += "@";
+    }
+    bool IPv6 = (m_strHost.find(':') != -1);
+    if (IPv6)
+       u += '[' + m_strHost + ']';
+    else
+       u += encodeHost(m_strHost, true, encoding_hint);
+    if ( m_iPort != 0 ) {
+      QString buffer;
+      buffer.sprintf( ":%u", m_iPort );
+      u += buffer;
+    }
+  }
+
+  u += encodedPathAndQuery( _trailing, false, encoding_hint );
+
+  if ( hasRef() )
+  {
+    u += "#";
+    u += m_strRef_encoded;
+  }
+
+  return u;
+}
+
+QString KURL::prettyURL( int _trailing ) const
+{
+  if( m_bIsMalformed )
+  {
+
+
+
+    return m_strProtocol;
+  }
+
+  QString u = m_strProtocol;
+  if (!u.isEmpty())
+     u += ":";
+
+  if ( hasHost() )
+  {
+    u += "//";
+    if ( hasUser() )
+    {
+      u += lazy_encode(m_strUser);
+
+      u += "@";
+    }
+    bool IPv6 = (m_strHost.find(':') != -1);
+    if (IPv6)
+    {
+       u += '[' + m_strHost + ']';
+    }
+    else
+    {
+       u += lazy_encode(m_strHost);
+    }
+    if ( m_iPort != 0 ) {
+      QString buffer;
+      buffer.sprintf( ":%u", m_iPort );
+      u += buffer;
+    }
+  }
+
+  u += trailingSlash( _trailing, lazy_encode( m_strPath ) );
+  if (!m_strQuery_encoded.isNull())
+      u += '?' + m_strQuery_encoded;
+
+  if ( hasRef() )
+  {
+    u += "#";
+    u += m_strRef_encoded;
+  }
+
+  return u;
+}
+
+QString KURL::prettyURL( int _trailing, AdjustementFlags _flags) const
+{
+        QString u = prettyURL(_trailing);
+        if (_flags & StripFileProtocol && u.startsWith("file:"))
+                u.remove(0, 5);
+        return u;
+}
+
+QString KURL::htmlURL() const
+{
+  return QStyleSheet::escape(prettyURL());
+}
+
+KURL::List KURL::split( const KURL& _url )
+{
+  QString ref;
+  KURL::List lst;
+  KURL url = _url;
+
+  while(true)
+  {
+     KURL u = url;
+     u.m_strRef_encoded = QString::null;
+     lst.append(u);
+     if (url.hasSubURL())
+     {
+        url = KURL(url.m_strRef_encoded);
+     }
+     else
+     {
+        ref = url.m_strRef_encoded;
+        break;
+     }
+  }
+
+
+  KURL::List::Iterator it;
+  for( it = lst.begin() ; it != lst.end(); ++it )
+  {
+     (*it).m_strRef_encoded = ref;
+  }
+
+  return lst;
+}
+
+KURL::List KURL::split( const QString& _url )
+{
+  return split(KURL(_url));
+}
+
+KURL KURL::join( const KURL::List & lst )
+{
+  if (lst.isEmpty()) return KURL();
+  KURL tmp;
+
+  KURL::List::ConstIterator first = lst.fromLast();
+  for( KURL::List::ConstIterator it = first; it != lst.end(); --it )
+  {
+     KURL u(*it);
+     if (it != first)
+     {
+        if (!u.m_strRef_encoded) u.m_strRef_encoded = tmp.url();
+        else u.m_strRef_encoded += "#" + tmp.url();
+     }
+     tmp = u;
+  }
+
+  return tmp;
+}
+
+QString KURL::fileName( bool _strip_trailing_slash ) const
+{
+  QString fname;
+  if (hasSubURL()) {
+    KURL::List list = KURL::split(*this);
+    KURL::List::Iterator it = list.fromLast();
+    return (*it).fileName(_strip_trailing_slash);
+  }
+  const QString &path = m_strPath;
+
+  int len = path.length();
+  if ( len == 0 )
+    return fname;
+
+  if ( _strip_trailing_slash )
+  {
+    while ( len >= 1 && path[ len - 1 ] == '/' )
+      len--;
+  }
+  else if ( path[ len - 1 ] == '/' )
+    return fname;
+
+
+  if ( len == 1 && path[ 0 ] == '/' )
+    return fname;
+
+
+  int n = 1;
+  if (!m_strPath_encoded.isEmpty())
+  {
+
+
+
+     int i = m_strPath_encoded.findRev( '/', len - 1 );
+     QString fileName_encoded = m_strPath_encoded.mid(i+1);
+     n += fileName_encoded.contains("%2f", false);
+  }
+  int i = len;
+  do {
+    i = path.findRev( '/', i - 1 );
+  }
+  while (--n && (i > 0));
+
+
+
+  if ( i == -1 ) {
+    if ( len == (int)path.length() )
+      fname = path;
+    else
+
+      fname = path.left( len );
+  }
+  else
+  {
+     fname = path.mid( i + 1, len - i - 1 );
+  }
+  return fname;
+}
+
+void KURL::addPath( const QString& _txt )
+{
+  if (hasSubURL())
+  {
+     KURL::List lst = split( *this );
+     KURL &u = lst.last();
+     u.addPath(_txt);
+     *this = join( lst );
+     return;
+  }
+
+  m_strPath_encoded = QString::null;
+
+  if ( _txt.isEmpty() )
+    return;
+
+  int i = 0;
+  int len = m_strPath.length();
+
+  if ( len == 0 ) {
+    while( _txt[i] == '/' ) ++i;
+  }
+
+  else if ( _txt[0] != '/' && ( len == 0 || m_strPath[ len - 1 ] != '/' ) )
+    m_strPath += "/";
+
+
+  i = 0;
+  if ( len != 0 && m_strPath[ len - 1 ] == '/' )
+  {
+    while( _txt[i] == '/' )
+      ++i;
+  }
+
+  m_strPath += _txt.mid( i );
+}
+
+QString KURL::directory( bool _strip_trailing_slash_from_result,
+                         bool _ignore_trailing_slash_in_path ) const
+{
+  QString result = m_strPath_encoded.isEmpty() ? m_strPath : m_strPath_encoded;
+  if ( _ignore_trailing_slash_in_path )
+    result = trailingSlash( -1, result );
+
+  if ( result.isEmpty() || result == "/" )
+    return result;
+
+  int i = result.findRev( "/" );
+
+
+  if ( i == -1 )
+    return QString::null;
+
+  if ( i == 0 )
+  {
+    result = "/";
+    return result;
+  }
+
+  if ( _strip_trailing_slash_from_result )
+    result = result.left( i );
+  else
+    result = result.left( i + 1 );
+
+  if (!m_strPath_encoded.isEmpty())
+    result = decode(result);
+
+  return result;
+}
+
+
+bool KURL::cd( const QString& _dir )
+{
+  if ( _dir.isEmpty() || m_bIsMalformed )
+    return false;
+
+  if (hasSubURL())
+  {
+     KURL::List lst = split( *this );
+     KURL &u = lst.last();
+     u.cd(_dir);
+     *this = join( lst );
+     return true;
+  }
+
+
+  if ( _dir[0] == '/' )
+  {
+    m_strPath_encoded = QString::null;
+    m_strPath = _dir;
+    setHTMLRef( QString::null );
+    m_strQuery_encoded = QString::null;
+    return true;
+  }
+
+
+  if ( ( _dir[0] == '~' ) && ( m_strProtocol == fileProt ))
+  {
+    m_strPath_encoded = QString::null;
+    m_strPath = QDir::homeDirPath();
+    m_strPath += "/";
+    m_strPath += _dir.right(m_strPath.length() - 1);
+    setHTMLRef( QString::null );
+    m_strQuery_encoded = QString::null;
+    return true;
+  }
+
+
+
+
+
+
+  QString p = path(1);
+  p += _dir;
+  p = cleanpath( p );
+  setPath( p );
+
+  setHTMLRef( QString::null );
+  m_strQuery_encoded = QString::null;
+
+  return true;
+}
+
+KURL KURL::upURL( ) const
+{
+  if (!query().isEmpty())
+  {
+     KURL u(*this);
+     u.setQuery(QString::null);
+     return u;
+  };
+
+  if (!hasSubURL())
+  {
+     KURL u(*this);
+     u.cd("../");
+     return u;
+  }
+
+
+  KURL::List lst = split( *this );
+  if (lst.isEmpty())
+      return KURL();
+  while (true)
+  {
+     KURL &u = lst.last();
+     QString old = u.path();
+     u.cd("../");
+     if (u.path() != old)
+         break;
+     if (lst.count() == 1)
+         break;
+     lst.remove(lst.fromLast());
+  }
+  return join( lst );
+}
+
+QString KURL::htmlRef() const
+{
+  if ( !hasSubURL() )
+  {
+    return decode( ref() );
+  }
+
+  List lst = split( *this );
+  return decode( (*lst.begin()).ref() );
+}
+
+QString KURL::encodedHtmlRef() const
+{
+  if ( !hasSubURL() )
+  {
+    return ref();
+  }
+
+  List lst = split( *this );
+  return (*lst.begin()).ref();
+}
+
+void KURL::setHTMLRef( const QString& _ref )
+{
+  if ( !hasSubURL() )
+  {
+    m_strRef_encoded = encode( _ref, true, 0 );
+    return;
+  }
+
+  List lst = split( *this );
+
+  (*lst.begin()).setRef( encode( _ref, true, 0 ) );
+
+  *this = join( lst );
+}
+
+bool KURL::hasHTMLRef() const
+{
+  if ( !hasSubURL() )
+  {
+    return hasRef();
+  }
+
+  List lst = split( *this );
+  return (*lst.begin()).hasRef();
+}
+
+void
+KURL::setProtocol( const QString& _txt )
+{
+   m_strProtocol = _txt;
+   m_bIsMalformed = false;
+}
+
+void
+KURL::setUser( const QString& _txt )
+{
+   m_strUser = _txt;
+}
+
+void
+KURL::setPass( const QString& _txt )
+{
+   m_strPass = _txt;
+}
+
+void
+KURL::setHost( const QString& _txt )
+{
+
+   m_strHost = KIDNA::toUnicode(_txt);
+   if (m_strHost.isEmpty())
+      m_strHost = _txt.lower();
+
+
+
+}
+
+void
+KURL::setPort( unsigned short int _p )
+{
+   m_iPort = _p;
+}
+
+void KURL::setPath( const QString & path )
+{
+  if (isEmpty())
+    m_bIsMalformed = false;
+  if (m_strProtocol.isEmpty())
+  {
+    m_strProtocol = fileProt;
+  }
+  m_strPath = path;
+  m_strPath_encoded = QString::null;
+}
+
+void KURL::setDirectory( const QString &dir)
+{
+  if ( dir.endsWith("/"))
+     setPath(dir);
+  else
+     setPath(dir+"/");
+}
+
+void KURL::setQuery( const QString &_txt, int encoding_hint)
+{
+   if (!_txt.length())
+   {
+      m_strQuery_encoded = _txt;
+      return;
+   }
+   if (_txt[0] =='?')
+      m_strQuery_encoded = _txt.mid(1);
+   else
+      m_strQuery_encoded = _txt;
+
+   int l = m_strQuery_encoded.length();
+   int i = 0;
+   QString result;
+   while (i < l)
+   {
+      int s = i;
+
+
+      while(i < l)
+      {
+         char c = m_strQuery_encoded[i].latin1();
+         if ((c == '&') || (c == ':') || (c == ';') ||
+             (c == '=') || (c == '/') || (c == '?'))
+            break;
+         i++;
+      }
+      if (i > s)
+      {
+         QString tmp = m_strQuery_encoded.mid(s, i-s);
+         QString newTmp;
+         decode( tmp, newTmp, tmp, encoding_hint, false );
+         result += tmp;
+      }
+      if (i < l)
+      {
+         result += m_strQuery_encoded[i];
+         i++;
+      }
+   }
+   m_strQuery_encoded = result;
+}
+
+QString KURL::query() const
+{
+    if (m_strQuery_encoded.isNull())
+        return QString::null;
+    return '?'+m_strQuery_encoded;
+}
+
+QString KURL::decode_string(const QString &str, int encoding_hint)
+{
+   return decode(str, encoding_hint);
+}
+
+QString KURL::encode_string(const QString &str, int encoding_hint)
+{
+   return encode(str, false, encoding_hint);
+}
+
+QString KURL::encode_string_no_slash(const QString &str, int encoding_hint)
+{
+   return encode(str, true, encoding_hint);
+}
+
+bool urlcmp( const QString& _url1, const QString& _url2 )
+{
+
+  if ( _url1.isEmpty() && _url2.isEmpty() )
+    return true;
+
+  if ( _url1.isEmpty() || _url2.isEmpty() )
+    return false;
+
+  KURL::List list1 = KURL::split( _url1 );
+  KURL::List list2 = KURL::split( _url2 );
+
+
+  if ( list1.isEmpty() || list2.isEmpty() )
+    return false;
+
+  return ( list1 == list2 );
+}
+
+bool urlcmp( const QString& _url1, const QString& _url2, bool _ignore_trailing, bool _ignore_ref )
+{
+
+  if ( _url1.isEmpty() && _url2.isEmpty() )
+    return true;
+
+  if ( _url1.isEmpty() || _url2.isEmpty() )
+    return false;
+
+  KURL::List list1 = KURL::split( _url1 );
+  KURL::List list2 = KURL::split( _url2 );
+
+
+  if ( list1.isEmpty() || list2.isEmpty() )
+    return false;
+
+  unsigned int size = list1.count();
+  if ( list2.count() != size )
+    return false;
+
+  if ( _ignore_ref )
+  {
+    (*list1.begin()).setRef(QString::null);
+    (*list2.begin()).setRef(QString::null);
+  }
+
+  KURL::List::Iterator it1 = list1.begin();
+  KURL::List::Iterator it2 = list2.begin();
+  for( ; it1 != list1.end() ; ++it1, ++it2 )
+    if ( !(*it1).equals( *it2, _ignore_trailing ) )
+      return false;
+
+  return true;
+}
+
+QMap< QString, QString > KURL::queryItems( int options ) const {
+  return queryItems(options, 0);
+}
+
+QMap< QString, QString > KURL::queryItems( int options, int encoding_hint ) const {
+  if ( m_strQuery_encoded.isEmpty() )
+    return QMap<QString,QString>();
+
+  QMap< QString, QString > result;
+  QStringList items = QStringList::split( '&', m_strQuery_encoded );
+  for ( QStringList::const_iterator it = items.begin() ; it != items.end() ; ++it ) {
+    int equal_pos = (*it).find( '=' );
+    if ( equal_pos > 0 ) {
+      QString name = (*it).left( equal_pos );
+      if ( options & CaseInsensitiveKeys )
+        name = name.lower();
+      QString value = (*it).mid( equal_pos + 1 );
+      if ( value.isEmpty() )
+        result.insert( name, QString::fromLatin1("") );
+      else {
+
+        value.replace( '+', ' ' );
+        result.insert( name, decode_string( value, encoding_hint ) );
+      }
+    } else if ( equal_pos < 0 ) {
+      QString name = (*it);
+      if ( options & CaseInsensitiveKeys )
+        name = name.lower();
+      result.insert( name, QString::null );
+    }
+  }
+
+  return result;
+}
+
+QString KURL::queryItem( const QString& _item ) const
+{
+  return queryItem( _item, 0 );
+}
+
+QString KURL::queryItem( const QString& _item, int encoding_hint ) const
+{
+  QString item = _item + '=';
+  if ( m_strQuery_encoded.length() <= 1 )
+    return QString::null;
+
+  QStringList items = QStringList::split( '&', m_strQuery_encoded );
+  unsigned int _len = item.length();
+  for ( QStringList::ConstIterator it = items.begin(); it != items.end(); ++it )
+  {
+    if ( (*it).startsWith( item ) )
+    {
+      if ( (*it).length() > _len )
+      {
+        QString str = (*it).mid( _len );
+        str.replace( '+', ' ' );
+        return decode_string( str, encoding_hint );
+      }
+      else
+        return QString::fromLatin1("");
+    }
+  }
+
+  return QString::null;
+}
+
+void KURL::removeQueryItem( const QString& _item )
+{
+  QString item = _item + '=';
+  if ( m_strQuery_encoded.length() <= 1 )
+    return;
+
+  QStringList items = QStringList::split( '&', m_strQuery_encoded );
+  for ( QStringList::Iterator it = items.begin(); it != items.end(); )
+  {
+    if ( (*it).startsWith( item ) || (*it == _item) )
+    {
+      QStringList::Iterator deleteIt = it;
+      ++it;
+      items.remove(deleteIt);
+    }
+    else
+    {
+       ++it;
+    }
+  }
+  m_strQuery_encoded = items.join( "&" );
+}
+
+void KURL::addQueryItem( const QString& _item, const QString& _value, int encoding_hint )
+{
+  QString item = _item + '=';
+  QString value = encode( _value, true, encoding_hint );
+
+  if (!m_strQuery_encoded.isEmpty())
+     m_strQuery_encoded += '&';
+  m_strQuery_encoded += item + value;
+}
+
+
+KURL KURL::fromPathOrURL( const QString& text )
+{
+    if ( text.isEmpty() )
+        return KURL();
+
+    KURL url;
+    if ( text[0] == '/' )
+        url.setPath( text );
+    else
+        url = text;
+
+    return url;
+}
+
+static QString _relativePath(const QString &base_dir, const QString &path, bool &isParent)
+{
+   QString _base_dir(QDir::cleanDirPath(base_dir));
+   QString _path(QDir::cleanDirPath(path.isEmpty() || (path[0] != '/') ? _base_dir+"/"+path : path));
+
+   if (_base_dir.isEmpty())
+      return _path;
+
+   if (_base_dir[_base_dir.length()-1] != '/')
+      _base_dir.append('/');
+
+   QStringList list1 = QStringList::split('/', _base_dir);
+   QStringList list2 = QStringList::split('/', _path);
+
+
+   uint level = 0;
+   uint maxLevel = ((list1.count()) < (list2.count()) ? (list1.count()) : (list2.count()));
+   while((level < maxLevel) && (list1[level] == list2[level])) level++;
+
+   QString result;
+
+   for(uint i = level; i < list1.count(); i++)
+      result.append("../");
+
+
+   for(uint i = level; i < list2.count(); i++)
+      result.append(list2[i]).append("/");
+
+   if ((level < list2.count()) && (path[path.length()-1] != '/'))
+      result.truncate(result.length()-1);
+
+   isParent = (level == list1.count());
+
+   return result;
+}
+
+QString KURL::relativePath(const QString &base_dir, const QString &path, bool *isParent)
+{
+   bool parent;
+   QString result = _relativePath(base_dir, path, parent);
+   if (parent)
+      result.prepend("./");
+
+   if (isParent)
+      *isParent = parent;
+
+   return result;
+}
+
+
+QString KURL::relativeURL(const KURL &base_url, const KURL &url, int encoding_hint)
+{
+   if ((url.protocol() != base_url.protocol()) ||
+       (url.host() != base_url.host()) ||
+       (url.port() && url.port() != base_url.port()) ||
+       (url.hasUser() && url.user() != base_url.user()) ||
+       (url.hasPass() && url.pass() != base_url.pass()))
+   {
+      return url.url(0, encoding_hint);
+   }
+
+   QString relURL;
+
+   if ((base_url.path() != url.path()) || (base_url.query() != url.query()))
+   {
+      bool dummy;
+      QString basePath = base_url.directory(false, false);
+      relURL = encode( _relativePath(basePath, url.path(), dummy), false, encoding_hint);
+      relURL += url.query();
+   }
+
+   if ( url.hasRef() )
+   {
+      relURL += "#";
+      relURL += url.ref();
+   }
+
+   if ( relURL.isEmpty() )
+      return "./";
+
+   return relURL;
+}
+
+
+
+
+
+
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (__const char *__assertion, __const char *__file,
+                           unsigned int __line, __const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, __const char *__file,
+                                  unsigned int __line,
+                                  __const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+
+
+
+
+
+
+
+class KRegExpPrivate;
+class __attribute__ ((deprecated)) KRegExp
+{
+public:
+
+
+
+
+  KRegExp();
+
+
+
+
+
+
+
+  KRegExp( const char *_pattern, const char *_mode = "" );
+  ~KRegExp();
+  bool compile( const char *_pattern, const char *_mode = "" );
+
+
+
+
+
+
+  bool match( const char *_string );
+  const char *group( int _grp );
+
+
+
+
+
+
+
+  int groupStart( int _grp );
+
+
+
+
+
+
+
+  int groupEnd( int _grp );
+
+private:
+  KRegExpPrivate *m_pPrivate;
+};
+
+extern "C" {
+
+
+
+extern "C" {
+typedef long int s_reg_t;
+typedef unsigned long int active_reg_t;
+
+
+
+
+
+
+typedef unsigned long int reg_syntax_t;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern reg_syntax_t re_syntax_options;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef enum
+{
+
+  REG_ENOSYS = -1,
+
+
+  REG_NOERROR = 0,
+  REG_NOMATCH,
+
+
+
+  REG_BADPAT,
+  REG_ECOLLATE,
+  REG_ECTYPE,
+  REG_EESCAPE,
+  REG_ESUBREG,
+  REG_EBRACK,
+  REG_EPAREN,
+  REG_EBRACE,
+  REG_BADBR,
+  REG_ERANGE,
+  REG_ESPACE,
+  REG_BADRPT,
+
+
+  REG_EEND,
+  REG_ESIZE,
+  REG_ERPAREN
+} reg_errcode_t;
+
+
+struct re_pattern_buffer
+{
+
+
+
+
+  unsigned char *buffer;
+
+
+  unsigned long int allocated;
+
+
+  unsigned long int used;
+
+
+  reg_syntax_t syntax;
+
+
+
+
+  char *fastmap;
+
+
+
+
+
+  char * translate;
+
+
+  size_t re_nsub;
+
+
+
+
+
+
+  unsigned can_be_null : 1;
+
+
+
+
+
+  unsigned regs_allocated : 2;
+
+
+
+  unsigned fastmap_accurate : 1;
+
+
+
+  unsigned no_sub : 1;
+
+
+
+  unsigned not_bol : 1;
+
+
+  unsigned not_eol : 1;
+
+
+  unsigned newline_anchor : 1;
+
+
+};
+
+typedef struct re_pattern_buffer regex_t;
+
+
+typedef int regoff_t;
+
+
+
+
+struct re_registers
+{
+  unsigned num_regs;
+  regoff_t *start;
+  regoff_t *end;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+typedef struct
+{
+  regoff_t rm_so;
+  regoff_t rm_eo;
+} regmatch_t;
+extern reg_syntax_t re_set_syntax (reg_syntax_t syntax);
+
+
+
+
+extern const char *re_compile_pattern
+  (const char *pattern, size_t length, struct re_pattern_buffer *buffer);
+
+
+
+
+
+
+extern int re_compile_fastmap (struct re_pattern_buffer *buffer);
+
+
+
+
+
+
+
+extern int re_search
+  (struct re_pattern_buffer *buffer, const char *string, int length, int start, int range, struct re_registers *regs);
+
+
+
+
+
+extern int re_search_2
+  (struct re_pattern_buffer *buffer, const char *string1, int length1, const char *string2, int length2, int start, int range, struct re_registers *regs, int stop);
+
+
+
+
+
+
+extern int re_match
+  (struct re_pattern_buffer *buffer, const char *string, int length, int start, struct re_registers *regs);
+
+
+
+
+extern int re_match_2
+  (struct re_pattern_buffer *buffer, const char *string1, int length1, const char *string2, int length2, int start, struct re_registers *regs, int stop);
+extern void re_set_registers
+  (struct re_pattern_buffer *buffer, struct re_registers *regs, unsigned num_regs, regoff_t *starts, regoff_t *ends);
+extern int regcomp (regex_t *__restrict __preg, const char *__restrict __pattern, int __cflags);
+
+
+
+extern int regexec (const regex_t *__restrict __preg, const char *__restrict __string, size_t __nmatch, regmatch_t __pmatch[], int __eflags);
+
+
+
+
+extern size_t regerror (int __errcode, const regex_t *__preg, char *__errbuf, size_t __errbuf_size);
+
+
+extern void regfree (regex_t *__preg);
+
+
+
+}
+}
+
+class KRegExpDataPtr;
+
+
+
+
+
+
+
+class KRegExpPrivate
+{
+public:
+  KRegExpPrivate();
+  KRegExpPrivate( const char *_pattern, const char *_mode = "" );
+  ~KRegExpPrivate();
+
+  bool compile( const char *_pattern, const char *_mode = "" );
+
+  bool match( const char *_string );
+  const char *group( int _grp );
+  int groupStart( int _grp );
+  int groupEnd( int _grp );
+
+protected:
+  regex_t m_pattern;
+  regmatch_t m_matches[ 10 ];
+  char* m_strMatches[10];
+  bool m_bInit;
+
+private:
+  KRegExpDataPtr *d;
+};
+
+
+KRegExpPrivate::KRegExpPrivate()
+{
+  m_bInit = false;
+
+  for ( int i = 0; i < 10; i++ )
+    m_strMatches[i] = 0L;
+}
+
+KRegExpPrivate::KRegExpPrivate( const char *_pattern, const char *_mode )
+{
+  m_bInit = false;
+
+  for ( int i = 0; i < 10; i++ )
+    m_strMatches[i] = 0L;
+
+  compile( _pattern, _mode );
+}
+
+KRegExpPrivate::~KRegExpPrivate()
+{
+  for ( int i = 0; i < 10; i++ )
+    if ( m_strMatches[i] )
+      free( m_strMatches[i] );
+
+  if ( m_bInit )
+    regfree( &m_pattern );
+}
+
+bool KRegExpPrivate::compile( const char *_pattern, const char *_mode )
+{
+  if ( m_bInit )
+    regfree( &m_pattern );
+
+  int res = regcomp( &m_pattern, _pattern, ( strchr( _mode, 'i' ) != 0L ? (1 << 1) : 0 ) | 1 );
+  if ( res == 0 )
+    m_bInit = true;
+
+  return ( res == 0 );
+}
+
+bool KRegExpPrivate::match( const char *_string )
+{
+  if ( !m_bInit )
+  {
+    kdDebug(128) << "You must compile a pattern before you can try to match it" << endl;
+    (static_cast<void> ((0) ? 0 : (__assert_fail ("0", "/coolo/prod/kdelibs/kdecore/kregexp.cpp", 74, __PRETTY_FUNCTION__), 0)));
+  }
+
+  for ( int i = 0; i < 10; i++ )
+  {
+    m_matches[i].rm_so = -1;
+    m_matches[i].rm_eo = -1;
+    if ( m_strMatches[i] )
+    {
+      free( m_strMatches[i] );
+      m_strMatches[i] = 0L;
+    }
+  }
+
+  int res = regexec( &m_pattern, _string, 10, m_matches, 0 );
+  if ( res != 0 )
+    return false;
+
+  int slen = strlen( _string );
+
+  for ( int j = 0; j < 10; j++ )
+  {
+    if ( m_matches[j].rm_so >= 0 && m_matches[j].rm_eo >= 0 &&
+         m_matches[j].rm_so <= slen && m_matches[j].rm_eo <= slen &&
+         m_matches[j].rm_so <= m_matches[j].rm_eo )
+    {
+      int len = m_matches[j].rm_eo - m_matches[j].rm_so;
+      m_strMatches[j] = ( char* )malloc( len + 1 );
+      memcpy( m_strMatches[j], _string + m_matches[j].rm_so, len );
+      m_strMatches[j][ len ] = 0;
+    }
+  }
+
+  return true;
+}
+
+const char* KRegExpPrivate::group( int _grp )
+{
+  if ( _grp < 0 || _grp >= 10 )
+  {
+    kdDebug(128) << "You may only use a group in the range of 0..9" << endl;
+    (static_cast<void> ((0) ? 0 : (__assert_fail ("0", "/coolo/prod/kdelibs/kdecore/kregexp.cpp", 115, __PRETTY_FUNCTION__), 0)));
+  }
+
+  return m_strMatches[ _grp ];
+}
+
+int KRegExpPrivate::groupStart( int _grp )
+{
+  if ( _grp < 0 || _grp >= 10 )
+  {
+    kdDebug(128) << "You may only use a group in the range of 0..9" << endl;
+    (static_cast<void> ((0) ? 0 : (__assert_fail ("0", "/coolo/prod/kdelibs/kdecore/kregexp.cpp", 126, __PRETTY_FUNCTION__), 0)));
+  }
+
+  return m_matches[ _grp ].rm_so;
+}
+
+int KRegExpPrivate::groupEnd( int _grp )
+{
+  if ( _grp < 0 || _grp >= 10 )
+  {
+    kdDebug(128) << "You may only use a group in the range of 0..9" << endl;
+    (static_cast<void> ((0) ? 0 : (__assert_fail ("0", "/coolo/prod/kdelibs/kdecore/kregexp.cpp", 137, __PRETTY_FUNCTION__), 0)));
+  }
+
+  return m_matches[ _grp ].rm_eo;
+}
+
+KRegExp::KRegExp()
+{
+  m_pPrivate = new KRegExpPrivate;
+}
+
+KRegExp::KRegExp( const char *_pattern, const char *_mode)
+{
+  m_pPrivate = new KRegExpPrivate( _pattern, _mode );
+}
+
+KRegExp::~KRegExp()
+{
+  delete m_pPrivate;
+}
+
+bool KRegExp::compile( const char *_pattern, const char *_mode)
+{
+  return m_pPrivate->compile( _pattern, _mode );
+}
+
+bool KRegExp::match( const char *_string )
+{
+  return m_pPrivate->match( _string );
+}
+
+const char* KRegExp::group( int _grp )
+{
+  return m_pPrivate->group( _grp );
+}
+
+int KRegExp::groupStart( int _grp )
+{
+  return m_pPrivate->groupStart( _grp );
+}
+
+int KRegExp::groupEnd( int _grp )
+{
+  return m_pPrivate->groupEnd( _grp );
+}
+
+
+
+
+
+
+
+static void kglobal_init();
+
+KStandardDirs *KGlobal::dirs()
+{
+    if (!_instance) qFatal("Fatal error: you need to have a KInstance object before\n" "you do anything that requires it! Examples of this are config\n" "objects, standard directories or translations.");;
+
+    return _instance->dirs();
+}
+
+KConfig *KGlobal::config()
+{
+    if (!_instance) qFatal("Fatal error: you need to have a KInstance object before\n" "you do anything that requires it! Examples of this are config\n" "objects, standard directories or translations.");;
+
+    return _instance->config();
+}
+
+KIconLoader *KGlobal::iconLoader()
+{
+    if (!_instance) qFatal("Fatal error: you need to have a KInstance object before\n" "you do anything that requires it! Examples of this are config\n" "objects, standard directories or translations.");;
+
+    return _instance->iconLoader();
+}
+
+KInstance *KGlobal::instance()
+{
+    if (!_instance) qFatal("Fatal error: you need to have a KInstance object before\n" "you do anything that requires it! Examples of this are config\n" "objects, standard directories or translations.");;
+    return _instance;
+}
+
+KLocale *KGlobal::locale()
+{
+    if( _locale == 0 ) {
+        if (!_instance)
+           return 0;
+        kglobal_init();
+
+
+        KLocale::initInstance();
+    }
+
+    return _locale;
+}
+
+KCharsets *KGlobal::charsets()
+{
+    if( _charsets == 0 ) {
+        _charsets =new KCharsets();
+        kglobal_init();
+    }
+
+    return _charsets;
+}
+
+void KGlobal::setActiveInstance(KInstance *i)
+{
+    _activeInstance = i;
+    if (i && _locale)
+        _locale->setActiveCatalogue(QString::fromUtf8(i->instanceName()));
+}
+
+
+
+
+
+
+
+const QString &
+KGlobal::staticQString(const char *str)
+{
+   return staticQString(QString::fromLatin1(str));
+}
+
+class KStringDict : public QDict<QString>
+{
+public:
+   KStringDict() : QDict<QString>(139) { };
+};
+
+
+
+
+
+
+
+const QString &
+KGlobal::staticQString(const QString &str)
+{
+    if (!_stringDict) {
+      _stringDict = new KStringDict;
+      _stringDict->setAutoDelete( true );
+      kglobal_init();
+    }
+   QString *result = _stringDict->find(str);
+   if (!result)
+   {
+      result = new QString(str);
+      _stringDict->insert(str, result);
+   }
+   return *result;
+}
+
+class KStaticDeleterList: public QPtrList<KStaticDeleterBase>
+{
+public:
+   KStaticDeleterList() { };
+};
+
+void
+KGlobal::registerStaticDeleter(KStaticDeleterBase *obj)
+{
+   if (!_staticDeleters)
+      kglobal_init();
+   if (_staticDeleters->find(obj) == -1)
+      _staticDeleters->append(obj);
+}
+
+void
+KGlobal::unregisterStaticDeleter(KStaticDeleterBase *obj)
+{
+   if (_staticDeleters)
+      _staticDeleters->removeRef(obj);
+}
+
+void
+KGlobal::deleteStaticDeleters()
+{
+    if (!KGlobal::_staticDeleters)
+        return;
+
+    for(;_staticDeleters->count();)
+    {
+        _staticDeleters->take(0)->destructObject();
+    }
+
+    delete KGlobal::_staticDeleters;
+    KGlobal::_staticDeleters = 0;
+}
+
+
+
+KStringDict *KGlobal::_stringDict = 0;
+KInstance *KGlobal::_instance = 0;
+KInstance *KGlobal::_activeInstance = 0;
+KLocale *KGlobal::_locale = 0;
+KCharsets *KGlobal::_charsets = 0;
+KStaticDeleterList *KGlobal::_staticDeleters = 0;
+
+static void kglobal_freeAll()
+{
+    delete KGlobal::_locale;
+    KGlobal::_locale = 0;
+    delete KGlobal::_charsets;
+    KGlobal::_charsets = 0;
+    delete KGlobal::_stringDict;
+    KGlobal::_stringDict = 0;
+    KGlobal::deleteStaticDeleters();
+
+    KGlobal::setActiveInstance(0);
+}
+
+static bool addedFreeAll = false;
+
+static void kglobal_init()
+{
+    if (addedFreeAll)
+        return;
+
+    addedFreeAll = true;
+    KGlobal::_staticDeleters = new KStaticDeleterList;
+
+    qAddPostRoutine( kglobal_freeAll );
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C"
+
+int mkstemps(char *, int);
+extern "C"
+
+unsigned long strlcat(char*, const char*, unsigned long);
+
+
+
+
+
+
+extern "C"
+
+unsigned long strlcpy(char*, const char*, unsigned long);
+
+
+
+
+QString* KGlobalSettings::s_desktopPath = 0;
+QString* KGlobalSettings::s_autostartPath = 0;
+QString* KGlobalSettings::s_trashPath = 0;
+QString* KGlobalSettings::s_documentPath = 0;
+QFont *KGlobalSettings::_generalFont = 0;
+QFont *KGlobalSettings::_fixedFont = 0;
+QFont *KGlobalSettings::_toolBarFont = 0;
+QFont *KGlobalSettings::_menuFont = 0;
+QFont *KGlobalSettings::_windowTitleFont = 0;
+QFont *KGlobalSettings::_taskbarFont = 0;
+QFont *KGlobalSettings::_largeFont = 0;
+QColor *KGlobalSettings::kde2Blue = 0;
+QColor *KGlobalSettings::kde2Gray = 0;
+QColor *KGlobalSettings::kde2AlternateColor = 0;
+
+KGlobalSettings::KMouseSettings *KGlobalSettings::s_mouseSettings = 0;
+
+int KGlobalSettings::dndEventDelay()
+{
+    KConfig *c = KGlobal::config();
+    KConfigGroupSaver cgs( c, "General" );
+    return c->readNumEntry("StartDragDist", QApplication::startDragDistance());
+}
+
+bool KGlobalSettings::singleClick()
+{
+    KConfig *c = KGlobal::config();
+    KConfigGroupSaver cgs( c, "KDE" );
+    return c->readBoolEntry("SingleClick", true);
+}
+
+KGlobalSettings::TearOffHandle KGlobalSettings::insertTearOffHandle()
+{
+    int tearoff;
+    KConfig *c = KGlobal::config();
+    KConfigGroupSaver cgs( c, "KDE" );
+    tearoff =c->readNumEntry("InsertTearOffHandle", 0);
+    return (TearOffHandle) tearoff;
+}
+
+bool KGlobalSettings::changeCursorOverIcon()
+{
+    KConfig *c = KGlobal::config();
+    KConfigGroupSaver cgs( c, "KDE" );
+    return c->readBoolEntry("ChangeCursor", true);
+}
+
+bool KGlobalSettings::visualActivate()
+{
+    KConfig *c = KGlobal::config();
+    KConfigGroupSaver cgs( c, "KDE" );
+    return c->readBoolEntry("VisualActivate", true);
+}
+
+unsigned int KGlobalSettings::visualActivateSpeed()
+{
+    KConfig *c = KGlobal::config();
+    KConfigGroupSaver cgs( c, "KDE" );
+    return
+        c->readNumEntry(
+            "VisualActivateSpeed",
+            50
+        );
+}
+
+
+
+int KGlobalSettings::autoSelectDelay()
+{
+    KConfig *c = KGlobal::config();
+    KConfigGroupSaver cgs( c, "KDE" );
+    return c->readNumEntry("AutoSelectDelay", -1);
+}
+
+KGlobalSettings::Completion KGlobalSettings::completionMode()
+{
+    int completion;
+    KConfig *c = KGlobal::config();
+    KConfigGroupSaver cgs( c, "General" );
+    completion = c->readNumEntry("completionMode", -1);
+    if ((completion < (int) CompletionNone) ||
+        (completion > (int) CompletionPopupAuto))
+      {
+        completion = (int) CompletionPopup;
+      }
+  return (Completion) completion;
+}
+
+bool KGlobalSettings::showContextMenusOnPress ()
+{
+    KConfig *c = KGlobal::config();
+    KConfigGroupSaver cgs (c, "ContextMenus");
+
+    return cgs.config()->readBoolEntry("ShowOnPress", true);
+}
+
+int KGlobalSettings::contextMenuKey ()
+{
+    KConfig *c = KGlobal::config();
+    KConfigGroupSaver cgs (c, "Shortcuts");
+
+    KShortcut cut (cgs.config()->readEntry ("PopupMenuContext", "Menu"));
+    return cut.keyCodeQt();
+}
+
+QColor KGlobalSettings::toolBarHighlightColor()
+{
+    initColors();
+    KConfig *c = KGlobal::config();
+    KConfigGroupSaver cgs( c, QString::fromLatin1("Toolbar style") );
+    return c->readColorEntry("HighlightColor", kde2Blue);
+}
+
+QColor KGlobalSettings::inactiveTitleColor()
+{
+    if (!kde2Gray)
+        kde2Gray = new QColor(220, 220, 220);
+    KConfig *c = KGlobal::config();
+    KConfigGroupSaver cgs( c, QString::fromLatin1("WM") );
+    return c->readColorEntry( "inactiveBackground", kde2Gray );
+}
+
+QColor KGlobalSettings::inactiveTextColor()
+{
+    KConfig *c = KGlobal::config();
+    KConfigGroupSaver cgs( c, QString::fromLatin1("WM") );
+    return c->readColorEntry( "inactiveForeground", &Qt::darkGray );
+}
+
+QColor KGlobalSettings::activeTitleColor()
+{
+    initColors();
+    KConfig *c = KGlobal::config();
+    KConfigGroupSaver cgs( c, QString::fromLatin1("WM") );
+    return c->readColorEntry( "activeBackground", kde2Blue);
+}
+
+QColor KGlobalSettings::activeTextColor()
+{
+    KConfig *c = KGlobal::config();
+    KConfigGroupSaver cgs( c, QString::fromLatin1("WM") );
+    return c->readColorEntry( "activeForeground", &Qt::white );
+}
+
+int KGlobalSettings::contrast()
+{
+    KConfig *c = KGlobal::config();
+    KConfigGroupSaver cgs( c, QString::fromLatin1("KDE") );
+    return c->readNumEntry( "contrast", 7 );
+}
+
+
+
+
+QColor KGlobalSettings::baseColor()
+{
+    KConfig *c = KGlobal::config();
+    KConfigGroupSaver cgs( c, QString::fromLatin1("General") );
+    return c->readColorEntry( "windowBackground", &Qt::white );
+}
+
+
+
+
+QColor KGlobalSettings::textColor()
+{
+    KConfig *c = KGlobal::config();
+    KConfigGroupSaver cgs( c, QString::fromLatin1("General") );
+    return c->readColorEntry( "windowForeground", &Qt::black );
+}
+
+
+
+
+QColor KGlobalSettings::highlightedTextColor()
+{
+    KConfig *c = KGlobal::config();
+    KConfigGroupSaver cgs( c, QString::fromLatin1("General") );
+    return c->readColorEntry( "selectForeground", &Qt::white );
+}
+
+
+
+
+QColor KGlobalSettings::highlightColor()
+{
+    initColors();
+    KConfig *c = KGlobal::config();
+    KConfigGroupSaver cgs( c, QString::fromLatin1("General") );
+    return c->readColorEntry( "selectBackground", kde2Blue );
+}
+
+QColor KGlobalSettings::alternateBackgroundColor()
+{
+    initColors();
+    KConfig *c = KGlobal::config();
+    KConfigGroupSaver cgs( c, QString::fromLatin1("General") );
+    *kde2AlternateColor = calculateAlternateBackgroundColor( baseColor() );
+    return c->readColorEntry( "alternateBackground", kde2AlternateColor );
+}
+
+QColor KGlobalSettings::calculateAlternateBackgroundColor(const QColor& base)
+{
+    if (base == Qt::white)
+        return QColor(238,246,255);
+    else
+    {
+        int h, s, v;
+        base.hsv( &h, &s, &v );
+        if (v > 128)
+            return base.dark(106);
+        else if (base != Qt::black)
+            return base.light(110);
+
+        return QColor(32,32,32);
+    }
+}
+
+QColor KGlobalSettings::linkColor()
+{
+    initColors();
+    KConfig *c = KGlobal::config();
+    KConfigGroupSaver cgs( c, QString::fromLatin1("General") );
+    return c->readColorEntry( "linkColor", kde2Blue );
+}
+
+QColor KGlobalSettings::visitedLinkColor()
+{
+    KConfig *c = KGlobal::config();
+    KConfigGroupSaver cgs( c, QString::fromLatin1("General") );
+    return c->readColorEntry( "visitedLinkColor", &Qt::magenta );
+}
+
+QFont KGlobalSettings::generalFont()
+{
+    if (_generalFont)
+        return *_generalFont;
+
+
+    _generalFont = new QFont("helvetica", 12);
+    _generalFont->setPointSize(12);
+    _generalFont->setStyleHint(QFont::SansSerif);
+
+    KConfig *c = KGlobal::config();
+    KConfigGroupSaver cgs( c, QString::fromLatin1("General") );
+    *_generalFont = c->readFontEntry("font", _generalFont);
+
+    return *_generalFont;
+}
+
+QFont KGlobalSettings::fixedFont()
+{
+    if (_fixedFont)
+        return *_fixedFont;
+
+
+    _fixedFont = new QFont("courier", 12);
+    _fixedFont->setPointSize(12);
+    _fixedFont->setStyleHint(QFont::TypeWriter);
+
+    KConfig *c = KGlobal::config();
+    KConfigGroupSaver cgs( c, QString::fromLatin1("General") );
+    *_fixedFont = c->readFontEntry("fixed", _fixedFont);
+
+    return *_fixedFont;
+}
+
+QFont KGlobalSettings::toolBarFont()
+{
+    if(_toolBarFont)
+        return *_toolBarFont;
+
+
+    _toolBarFont = new QFont("helvetica", 10);
+    _toolBarFont->setPointSize(10);
+    _toolBarFont->setStyleHint(QFont::SansSerif);
+
+    KConfig *c = KGlobal::config();
+    KConfigGroupSaver cgs( c, QString::fromLatin1("General") );
+    *_toolBarFont = c->readFontEntry("toolBarFont", _toolBarFont);
+
+    return *_toolBarFont;
+}
+
+QFont KGlobalSettings::menuFont()
+{
+    if(_menuFont)
+        return *_menuFont;
+
+
+    _menuFont = new QFont("helvetica", 12);
+    _menuFont->setPointSize(12);
+    _menuFont->setStyleHint(QFont::SansSerif);
+
+    KConfig *c = KGlobal::config();
+    KConfigGroupSaver cgs( c, QString::fromLatin1("General") );
+    *_menuFont = c->readFontEntry("menuFont", _menuFont);
+
+    return *_menuFont;
+}
+
+QFont KGlobalSettings::windowTitleFont()
+{
+    if(_windowTitleFont)
+        return *_windowTitleFont;
+
+
+    _windowTitleFont = new QFont("helvetica", 12, QFont::Bold);
+    _windowTitleFont->setPointSize(12);
+    _windowTitleFont->setStyleHint(QFont::SansSerif);
+
+    KConfig *c = KGlobal::config();
+    KConfigGroupSaver cgs( c, QString::fromLatin1("WM") );
+    *_windowTitleFont = c->readFontEntry("activeFont", _windowTitleFont);
+
+    return *_windowTitleFont;
+}
+
+QFont KGlobalSettings::taskbarFont()
+{
+    if(_taskbarFont)
+        return *_taskbarFont;
+
+
+    _taskbarFont = new QFont("helvetica", 11);
+    _taskbarFont->setPointSize(11);
+    _taskbarFont->setStyleHint(QFont::SansSerif);
+
+    KConfig *c = KGlobal::config();
+    KConfigGroupSaver cgs( c, QString::fromLatin1("General") );
+    *_taskbarFont = c->readFontEntry("taskbarFont", _taskbarFont);
+
+    return *_taskbarFont;
+}
+
+
+QFont KGlobalSettings::largeFont(const QString &text)
+{
+    QFontDatabase db;
+    QStringList fam = db.families();
+
+
+    if (fam.remove("Arial"))
+       fam.prepend("Arial");
+    if (fam.remove("Verdana"))
+       fam.prepend("Verdana");
+    if (fam.remove("Tahoma"))
+       fam.prepend("Tahoma");
+    if (fam.remove("Lucida Sans"))
+       fam.prepend("Lucida Sans");
+    if (fam.remove("Lucidux Sans"))
+       fam.prepend("Lucidux Sans");
+    if (fam.remove("Nimbus Sans"))
+       fam.prepend("Nimbus Sans");
+    if (fam.remove("Gothic I"))
+       fam.prepend("Gothic I");
+
+    if (_largeFont)
+        fam.prepend(_largeFont->family());
+
+    for(QStringList::ConstIterator it = fam.begin();
+        it != fam.end(); ++it)
+    {
+        if (db.isSmoothlyScalable(*it) && !db.isFixedPitch(*it))
+        {
+            QFont font(*it);
+            font.setPixelSize(75);
+            QFontMetrics metrics(font);
+            int h = metrics.height();
+            if ((h < 60) || ( h > 90))
+                continue;
+
+            bool ok = true;
+            for(unsigned int i = 0; i < text.length(); i++)
+            {
+                if (!metrics.inFont(text[i]))
+                {
+                    ok = false;
+                    break;
+                }
+            }
+            if (!ok)
+                continue;
+
+            font.setPointSize(48);
+            _largeFont = new QFont(font);
+            return *_largeFont;
+        }
+    }
+    _largeFont = new QFont(KGlobalSettings::generalFont());
+    _largeFont->setPointSize(48);
+    return *_largeFont;
+}
+
+void KGlobalSettings::initStatic()
+{
+    if ( s_desktopPath != 0 )
+        return;
+
+    s_desktopPath = new QString();
+    s_autostartPath = new QString();
+    s_trashPath = new QString();
+    s_documentPath = new QString();
+
+    KConfig *config = KGlobal::config();
+    KConfigGroupSaver cgs( config, "Paths" );
+
+
+    *s_desktopPath = QDir::homeDirPath() + "/Desktop/";
+    *s_desktopPath = config->readPathEntry( "Desktop", *s_desktopPath);
+    if ( !s_desktopPath->startsWith("/") )
+      s_desktopPath->prepend( QDir::homeDirPath() + "/" );
+    *s_desktopPath = QDir::cleanDirPath( *s_desktopPath );
+    if ( !s_desktopPath->endsWith("/") )
+      s_desktopPath->append('/');
+
+
+    *s_trashPath = *s_desktopPath + i18n("Trash") + "/";
+    *s_trashPath = config->readPathEntry( "Trash" , *s_trashPath);
+    if ( !s_trashPath->startsWith("/") )
+      s_trashPath->prepend( QDir::homeDirPath() + "/" );
+    *s_trashPath = QDir::cleanDirPath( *s_trashPath );
+    if ( !s_trashPath->endsWith("/") )
+      s_trashPath->append('/');
+
+    if ( !config->hasKey( "Trash" ) )
+    {
+      config->writePathEntry( "Trash", *s_trashPath, true, true );
+      config->sync();
+    }
+
+
+    *s_autostartPath = KGlobal::dirs()->localkdedir() + "Autostart/";
+    *s_autostartPath = config->readPathEntry( "Autostart" , *s_autostartPath);
+    if ( !s_autostartPath->startsWith("/") )
+      s_autostartPath->prepend( QDir::homeDirPath() + "/" );
+    *s_autostartPath = QDir::cleanDirPath( *s_autostartPath );
+    if ( !s_autostartPath->endsWith("/") )
+      s_autostartPath->append('/');
+
+
+    *s_documentPath = config->readPathEntry( "Documents" );
+    if ( !s_documentPath->startsWith("/") )
+      s_documentPath->prepend( QDir::homeDirPath() + "/" );
+    *s_documentPath = QDir::cleanDirPath( *s_documentPath );
+    if ( !s_documentPath->endsWith("/"))
+      s_documentPath->append('/');
+
+
+
+    if (KApplication::kApplication())
+        KApplication::kApplication()->addKipcEventMask(KIPC::SettingsChanged);
+
+}
+
+void KGlobalSettings::initColors()
+{
+    if (!kde2Blue) {
+      if (QPixmap::defaultDepth() > 8)
+        kde2Blue = new QColor(84, 112, 152);
+      else
+        kde2Blue = new QColor(0, 0, 192);
+    }
+    if (!kde2AlternateColor)
+      kde2AlternateColor = new QColor(240, 240, 240);
+}
+
+void KGlobalSettings::rereadFontSettings()
+{
+    delete _generalFont;
+    _generalFont = 0L;
+    delete _fixedFont;
+    _fixedFont = 0L;
+    delete _menuFont;
+    _menuFont = 0L;
+    delete _toolBarFont;
+    _toolBarFont = 0L;
+    delete _windowTitleFont;
+    _windowTitleFont = 0L;
+    delete _taskbarFont;
+    _taskbarFont = 0L;
+}
+
+void KGlobalSettings::rereadPathSettings()
+{
+    kdDebug() << "KGlobalSettings::rereadPathSettings" << endl;
+    delete s_autostartPath;
+    s_autostartPath = 0L;
+    delete s_trashPath;
+    s_trashPath = 0L;
+    delete s_desktopPath;
+    s_desktopPath = 0L;
+    delete s_documentPath;
+    s_documentPath = 0L;
+}
+
+KGlobalSettings::KMouseSettings & KGlobalSettings::mouseSettings()
+{
+    if ( ! s_mouseSettings )
+    {
+        s_mouseSettings = new KMouseSettings;
+        KMouseSettings & s = *s_mouseSettings;
+
+        KConfigGroupSaver cgs( KGlobal::config(), "Mouse" );
+        QString setting = KGlobal::config()->readEntry("MouseButtonMapping");
+        if (setting == "RightHanded")
+            s.handed = KMouseSettings::RightHanded;
+        else if (setting == "LeftHanded")
+            s.handed = KMouseSettings::LeftHanded;
+        else
+        {
+
+
+
+
+            s.handed = KMouseSettings::RightHanded;
+            unsigned char map[5];
+            switch (XGetPointerMapping(KApplication::kApplication()->getDisplay(), map, 5))
+            {
+                case 2:
+                    if ( (int)map[0] == 1 && (int)map[1] == 2 )
+                        s.handed = KMouseSettings::RightHanded;
+                    else if ( (int)map[0] == 2 && (int)map[1] == 1 )
+                        s.handed = KMouseSettings::LeftHanded;
+                    break;
+                case 3:
+                case 5:
+                    if ( (int)map[0] == 1 && (int)map[2] == 3 )
+                        s.handed = KMouseSettings::RightHanded;
+                    else if ( (int)map[0] == 3 && (int)map[2] == 1 )
+                        s.handed = KMouseSettings::LeftHanded;
+                    break;
+                default:
+                    break;
+            }
+
+
+
+        }
+    }
+    return *s_mouseSettings;
+}
+
+void KGlobalSettings::rereadMouseSettings()
+{
+    delete s_mouseSettings;
+    s_mouseSettings = 0L;
+}
+
+bool KGlobalSettings::isMultiHead()
+{
+    QCString multiHead = getenv("KDE_MULTIHEAD");
+    if (!multiHead.isEmpty()) {
+        return (multiHead.lower() == "true");
+    }
+    return false;
+}
+
+bool KGlobalSettings::wheelMouseZooms()
+{
+    KConfig *c = KGlobal::config();
+    KConfigGroupSaver cgs( c, "KDE" );
+    return c->readBoolEntry( "WheelMouseZooms", false );
+}
+
+QRect KGlobalSettings::splashScreenDesktopGeometry()
+{
+    QDesktopWidget *dw = QApplication::desktop();
+
+    if (dw->isVirtualDesktop()) {
+        KConfigGroup group(KGlobal::config(), "Windows");
+        int scr = group.readNumEntry("Unmanaged", -3);
+        if (group.readBoolEntry("XineramaEnabled", true) && scr != -2) {
+            if (scr == -3)
+                scr = dw->screenNumber(QCursor::pos());
+            return dw->screenGeometry(scr);
+        } else {
+            return dw->geometry();
+        }
+    } else {
+        return dw->geometry();
+    }
+}
+
+QRect KGlobalSettings::desktopGeometry(const QPoint& point)
+{
+    QDesktopWidget *dw = QApplication::desktop();
+
+    if (dw->isVirtualDesktop()) {
+        KConfigGroup group(KGlobal::config(), "Windows");
+        if (group.readBoolEntry("XineramaEnabled", true) &&
+            group.readBoolEntry("XineramaPlacementEnabled", true)) {
+            return dw->screenGeometry(dw->screenNumber(point));
+        } else {
+            return dw->geometry();
+        }
+    } else {
+        return dw->geometry();
+    }
+}
+
+QRect KGlobalSettings::desktopGeometry(QWidget* w)
+{
+    QDesktopWidget *dw = QApplication::desktop();
+
+    if (dw->isVirtualDesktop()) {
+        KConfigGroup group(KGlobal::config(), "Windows");
+        if (group.readBoolEntry("XineramaEnabled", true) &&
+            group.readBoolEntry("XineramaPlacementEnabled", true)) {
+            if (w)
+                return dw->screenGeometry(dw->screenNumber(w));
+            else return dw->screenGeometry(-1);
+        } else {
+            return dw->geometry();
+        }
+    } else {
+        return dw->geometry();
+    }
+}
+
+bool KGlobalSettings::showIconsOnPushButtons()
+{
+    KConfig *c = KGlobal::config();
+    KConfigGroupSaver cgs( c, "KDE" );
+    return c->readBoolEntry("ShowIconsOnPushButtons",
+        false);
+}
+
+bool KGlobalSettings::showFilePreview(const KURL &url)
+{
+    KConfigGroup g(KGlobal::config(), "PreviewSettings");
+    QString protocol = url.protocol();
+    QString protocolClass = KProtocolInfo::protocolClass(protocol);
+    return g.readBoolEntry(protocol, (protocolClass == ":local") );
+}
+
+
+
+class KZoneAllocatorPrivate;
+class KZoneAllocator
+{
+public:
+
+
+
+
+    KZoneAllocator(unsigned long _blockSize = 8*1024);
+
+
+
+
+    ~KZoneAllocator();
+
+
+
+
+
+
+    void* allocate(size_t _size);
+    void deallocate(void *ptr);
+    void free_since(void *ptr);
+
+protected:
+    class MemBlock;
+    typedef QValueList<MemBlock *> MemList;
+    void addBlock(MemBlock *b);
+    void delBlock(MemBlock *b);
+    void insertHash(MemBlock *b);
+    void initHash();
+    MemBlock *currentBlock;
+    unsigned long blockSize;
+    unsigned long blockOffset;
+    unsigned int log2;
+    unsigned int num_blocks;
+    MemList **hashList;
+    unsigned int hashSize;
+    bool hashDirty;
+private:
+    KZoneAllocatorPrivate *d;
+};
+
+
+class KZoneAllocator::MemBlock
+{
+  public:
+    MemBlock(size_t s) : size(s), ref(0), older(0), newer(0)
+      { begin = new char[s]; }
+    ~MemBlock() { delete [] begin; }
+    bool is_in(void *ptr) const {return !(begin > (char *)ptr
+                                          || (begin + size) <= (char *)ptr); }
+    size_t size;
+    unsigned int ref;
+    char *begin;
+    MemBlock *older;
+    MemBlock *newer;
+};
+
+KZoneAllocator::KZoneAllocator(unsigned long _blockSize)
+: currentBlock(0), blockSize(1), blockOffset(0), log2(0), num_blocks(0),
+  hashList(0), hashSize(0), hashDirty(true)
+{
+  while (blockSize < _blockSize)
+    blockSize <<= 1, log2++;
+
+
+  blockOffset = blockSize + 1;
+}
+
+KZoneAllocator::~KZoneAllocator()
+{
+  unsigned int count = 0;
+  if (hashList) {
+
+
+    for (unsigned int i = 0; i < hashSize; i++)
+      delete hashList[i];
+    delete [] hashList;
+    hashList = 0;
+  }
+  MemBlock *next;
+  for (; currentBlock; currentBlock = next) {
+    next = currentBlock->older;
+    delete currentBlock;
+    count++;
+  }
+
+
+  if (count > 1)
+    qDebug("zone still contained %d blocks", count);
+
+}
+
+void KZoneAllocator::insertHash(MemBlock *b)
+{
+  unsigned int adr = ((unsigned long)b->begin) & (~(blockSize - 1));
+  unsigned int end = ((unsigned long)b->begin) + blockSize;
+  while (adr < end) {
+    unsigned int key = adr >> log2;
+    key = key & (hashSize - 1);
+    if (!hashList[key])
+      hashList[key] = new QValueList<MemBlock *>;
+    hashList[key]->append(b);
+    adr += blockSize;
+  }
+}
+
+void KZoneAllocator::addBlock(MemBlock *b)
+{
+  b->newer = 0;
+  b->older = currentBlock;
+  if (currentBlock)
+    b->older->newer = b;
+  currentBlock = b;
+  num_blocks++;
+
+
+
+  if (hashList && ((num_blocks / 4) > hashSize && hashSize < 64*1024))
+    hashDirty = true;
+
+
+  if (hashList && !hashDirty)
+    insertHash (b);
+}
+
+void KZoneAllocator::initHash()
+{
+  if (hashList) {
+    for (unsigned int i = 0; i < hashSize; i++)
+      delete hashList[i];
+    delete [] hashList;
+    hashList = 0;
+  }
+  hashSize = 1;
+  while (hashSize < num_blocks)
+    hashSize <<= 1;
+  if (hashSize < 1024)
+    hashSize = 1024;
+  if (hashSize > 64*1024)
+    hashSize = 64*1024;
+  hashList = new QValueList<MemBlock *> *[hashSize];
+  memset (hashList, 0, sizeof(QValueList<MemBlock*> *) * hashSize);
+  hashDirty = false;
+  for (MemBlock *b = currentBlock; b; b = b->older)
+    insertHash(b);
+}
+
+void KZoneAllocator::delBlock(MemBlock *b)
+{
+
+
+  if (hashList && !hashDirty) {
+    unsigned int adr = ((unsigned long)b->begin) & (~(blockSize - 1));
+    unsigned int end = ((unsigned long)b->begin) + blockSize;
+    while (adr < end) {
+      unsigned int key = adr >> log2;
+      key = key & (hashSize - 1);
+      if (hashList[key]) {
+        QValueList<MemBlock *> *list = hashList[key];
+        QValueList<MemBlock *>::Iterator it = list->begin();
+        QValueList<MemBlock *>::Iterator endit = list->end();
+        for (; it != endit; ++it)
+          if (*it == b) {
+            list->remove(it);
+            break;
+          }
+      }
+      adr += blockSize;
+    }
+  }
+  if (b->older)
+    b->older->newer = b->newer;
+  if (b->newer)
+    b->newer->older = b->older;
+  if (b == currentBlock) {
+    currentBlock = 0;
+    blockOffset = blockSize;
+  }
+  delete b;
+  num_blocks--;
+}
+
+void *
+KZoneAllocator::allocate(size_t _size)
+{
+
+   const size_t alignment = sizeof(void *) - 1;
+   _size = (_size + alignment) & ~alignment;
+
+   if ((unsigned long) _size + blockOffset > blockSize)
+   {
+      if (_size > blockSize) {
+        qDebug("KZoneAllocator: allocating more than %lu bytes", blockSize);
+        return 0;
+      }
+      addBlock(new MemBlock(blockSize));
+      blockOffset = 0;
+
+   }
+   void *result = (void *)(currentBlock->begin+blockOffset);
+   currentBlock->ref++;
+   blockOffset += _size;
+   return result;
+}
+
+void
+KZoneAllocator::deallocate(void *ptr)
+{
+  if (hashDirty)
+    initHash();
+
+  unsigned int key = (((unsigned long)ptr) >> log2) & (hashSize - 1);
+  QValueList<MemBlock *> *list = hashList[key];
+  if (!list) {
+
+
+
+    return;
+  }
+  QValueList<MemBlock*>::ConstIterator it = list->begin();
+  QValueList<MemBlock*>::ConstIterator endit = list->end();
+  for (; it != endit; ++it) {
+    MemBlock *cur = *it;
+    if (cur->is_in(ptr)) {
+      if (!--cur->ref) {
+        if (cur != currentBlock)
+          delBlock (cur);
+        else
+          blockOffset = 0;
+      }
+      return;
+    }
+  }
+
+
+
+}
+
+void
+KZoneAllocator::free_since(void *ptr)
+{
+
+
+
+  if (hashList && !hashDirty)
+    {
+      const MemBlock *b;
+      unsigned int removed = 0;
+      for (b = currentBlock; b; b = b->older, removed++)
+        if (b->is_in (ptr))
+          break;
+      if (hashSize >= 4 * (num_blocks - removed))
+        hashDirty = true;
+    }
+  while (currentBlock && !currentBlock->is_in(ptr)) {
+    currentBlock = currentBlock->older;
+    delBlock (currentBlock->newer);
+  }
+  blockOffset = ((char*)ptr) - currentBlock->begin;
+}
+
+
+
+
+class KVMAllocatorPrivate;
+class KVMAllocator
+{
+public:
+    struct Block;
+
+
+
+
+    KVMAllocator();
+
+
+
+
+    ~KVMAllocator();
+
+
+
+
+
+
+    Block *allocate(size_t _size);
+
+
+
+
+
+    void free(Block *block);
+    bool copyBlock(void *dest, Block *src, int _offset = 0, size_t length = 0);
+
+
+
+
+
+    void copy(void *dest, Block *src, int _offset = 0, size_t length = 0) __attribute__ ((deprecated));
+    bool copyBlock(Block *dest, void *src, int _offset = 0, size_t length = 0);
+
+
+
+
+
+    void copy(Block *dest, void *src, int _offset = 0, size_t length = 0) __attribute__ ((deprecated));
+
+
+
+
+
+    void *map(Block *block);
+
+
+
+
+
+    void unmap(Block *block);
+
+private:
+    KVMAllocatorPrivate *d;
+};
+
+
+
+struct KVMAllocator::Block
+{
+   off_t start;
+   size_t length;
+   size_t size;
+   void *mmap;
+};
+
+
+class KVMAllocatorPrivate
+{
+public:
+   KTempFile *tempfile;
+   off_t max_length;
+   QMap<off_t, KVMAllocator::Block> used_blocks;
+   QMap<off_t, KVMAllocator::Block> free_blocks;
+};
+
+
+
+
+KVMAllocator::KVMAllocator()
+{
+   d = new KVMAllocatorPrivate;
+   d->tempfile = 0;
+   d->max_length = 0;
+}
+
+
+
+
+KVMAllocator::~KVMAllocator()
+{
+   delete d->tempfile;
+   delete d;
+}
+
+
+
+
+
+KVMAllocator::Block *
+KVMAllocator::allocate(size_t _size)
+{
+   if (!d->tempfile)
+   {
+      d->tempfile = new KTempFile(QString::null, "vmdata");
+      d->tempfile->unlink();
+   }
+
+   QMap<off_t,KVMAllocator::Block>::iterator it;
+   it = d->free_blocks.begin();
+   while (it != d->free_blocks.end())
+   {
+      if (it.data().size > _size)
+      {
+         Block &free_block = it.data();
+         Block block;
+         kdDebug(13020)<<"VM alloc: using block from free list "<<(long)free_block.start<<" size ="<<(long)free_block.size<<" request = "<<_size<< endl;
+         block.start = free_block.start;
+         block.length = _size;
+         block.size = (_size + 4095) & ~4095;
+         block.mmap = 0;
+         free_block.size -= block.size;
+         free_block.start += block.size;
+         if (!free_block.size)
+            d->free_blocks.remove(it);
+         it = d->used_blocks.replace(block.start, block);
+         return &(it.data());
+      }
+      ++it;
+   }
+
+
+
+   Block block;
+   block.start = d->max_length;
+   block.length = _size;
+   block.size = (_size + 4095) & ~4095;
+   block.mmap = 0;
+   kdDebug(13020)<<"VM alloc: using new block "<<(long)block.start<<" size ="<<(long)block.size<<" request = "<<_size<< endl;
+   it = d->used_blocks.replace(block.start, block);
+   d->max_length += block.size;
+   return &(it.data());
+}
+
+
+
+
+void
+KVMAllocator::free(Block *block_p)
+{
+   Block block = *block_p;
+   if (block.mmap)
+   {
+      kdDebug(13020)<<"VM free: Block "<<(long)block.start<<" is still mmapped!"<<endl;
+      return;
+   }
+   QMap<off_t,KVMAllocator::Block>::iterator it;
+   it = d->used_blocks.find(block.start);
+   if (it == d->used_blocks.end())
+   {
+      kdDebug(13020)<<"VM free: Block "<<(long)block.start<<" is not allocated."<<endl;
+      return;
+   }
+   d->used_blocks.remove(it);
+   it = d->free_blocks.replace(block.start, block);
+   QMap<off_t,KVMAllocator::Block>::iterator before = it;
+   --before;
+   if (before != d->free_blocks.end())
+   {
+      Block &block_before = before.data();
+      if ((block_before.start + off_t(block_before.size)) == block.start)
+      {
+
+         kdDebug(13020) << "VM merging: Block "<< (long)block_before.start<<
+                           " with "<< (long)block.start<< " (before)" << endl;
+         block.size += block_before.size;
+         block.start = block_before.start;
+         it.data() = block;
+         d->free_blocks.remove(before);
+      }
+   }
+
+   QMap<off_t,KVMAllocator::Block>::iterator after = it;
+   ++after;
+   if (after != d->free_blocks.end())
+   {
+      Block &block_after = after.data();
+      if ((block.start + off_t(block.size)) == block_after.start)
+      {
+
+         kdDebug(13020) << "VM merging: Block "<< (long)block.start<<
+                           " with "<< (long)block_after.start<< " (after)" << endl;
+         block.size += block_after.size;
+         it.data() = block;
+         d->free_blocks.remove(after);
+      }
+   }
+}
+
+
+
+
+void
+KVMAllocator::copy(void *dest, Block *src, int _offset, size_t length)
+{
+   (void) copyBlock(dest, src, _offset, length);
+}
+
+bool
+KVMAllocator::copyBlock(void *dest, Block *src, int _offset, size_t length)
+{
+
+   lseek(d->tempfile->handle(), src->start+_offset, 0);
+   if (length == 0)
+      length = src->length - _offset;
+   int to_go = length;
+   int done = 0;
+   char *buf = (char *) dest;
+   while(done < to_go)
+   {
+      int n = read(d->tempfile->handle(), buf+done, to_go);
+      if (n <= 0)
+      {
+         if (n < 0)
+            return false;
+         else
+            return true;
+      }
+      done += n;
+      to_go -= n;
+   }
+
+   return true;
+}
+
+
+
+
+void
+KVMAllocator::copy(Block *dest, void *src, int _offset, size_t length)
+{
+   (void) copyBlock(dest, src, _offset, length);
+}
+
+bool
+KVMAllocator::copyBlock(Block *dest, void *src, int _offset, size_t length)
+{
+
+   lseek(d->tempfile->handle(), dest->start+_offset, 0);
+   if (length == 0)
+      length = dest->length - _offset;
+   int to_go = length;
+   int done = 0;
+   char *buf = (char *) src;
+   while(done < to_go)
+   {
+      int n = write(d->tempfile->handle(), buf+done, to_go);
+      if (n <= 0) return false;
+      done += n;
+      to_go -= n;
+   }
+
+   return true;
+}
+
+
+
+
+void *
+KVMAllocator::map(Block *block)
+{
+   if (block->mmap)
+      return block->mmap;
+
+   void *result = mmap(0, block->length, 0x1| 0x2,
+                       0x01, d->tempfile->handle(), block->start);
+   block->mmap = result;
+   return block->mmap;
+}
+
+
+
+
+void
+KVMAllocator::unmap(Block *block)
+{
+
+
+   munmap((char *)block->mmap, block->length);
+   block->mmap = 0;
+}
+class KMimeSourceFactoryPrivate
+{
+public:
+  inline KMimeSourceFactoryPrivate (KIconLoader* loader)
+        : kil (loader)
+  {}
+
+  KIconLoader* kil;
+};
+
+KMimeSourceFactory::KMimeSourceFactory (KIconLoader* loader)
+  : QMimeSourceFactory (),
+        d (new KMimeSourceFactoryPrivate (loader))
+{
+}
+
+KMimeSourceFactory::~KMimeSourceFactory()
+{
+  delete d;
+}
+
+QString KMimeSourceFactory::makeAbsolute (const QString& absOrRelName, const QString& context) const
+{
+  QString myName;
+  QString myContext;
+
+  const int pos = absOrRelName.find ('|');
+  if (pos > -1)
+        {
+          myContext = absOrRelName.left (pos);
+          myName = absOrRelName.right (absOrRelName.length() - myContext.length() - 1);
+        }
+
+  QString result;
+
+  if (myContext == "desktop")
+        {
+          result = d->kil->iconPath (myName, KIcon::Desktop);
+        }
+  else if (myContext == "toolbar")
+        {
+          result = d->kil->iconPath (myName, KIcon::Toolbar);
+        }
+  else if (myContext == "maintoolbar")
+        {
+          result = d->kil->iconPath (myName, KIcon::MainToolbar);
+        }
+  else if (myContext == "small")
+        {
+          result = d->kil->iconPath (myName, KIcon::Small);
+        }
+  else if (myContext == "user")
+        {
+          result = d->kil->iconPath (myName, KIcon::User);
+        }
+
+  if (result.isEmpty())
+        result = QMimeSourceFactory::makeAbsolute (absOrRelName, context);
+
+  return result;
+}
+
+void KMimeSourceFactory::virtual_hook( int, void* )
+{ }
+
+
+
+
+
+
+
+class KInstancePrivate
+{
+public:
+    KInstancePrivate ()
+    {
+        mimeSourceFactory = 0L;
+    }
+
+    ~KInstancePrivate ()
+    {
+        delete mimeSourceFactory;
+    }
+
+    KMimeSourceFactory* mimeSourceFactory;
+    QString configName;
+    bool ownAboutdata;
+};
+
+KInstance::KInstance( const QCString& name)
+  : _dirs (0L),
+    _config (0L),
+    _iconLoader (0L),
+    _name( name ), _aboutData( new KAboutData( name, "", 0 ) )
+{
+    ((!name.isEmpty()) ? (void)0 : qWarning("ASSERT: \"%s\" in %s (%d)","!name.isEmpty()","/coolo/prod/kdelibs/kdecore/kinstance.cpp",56));
+    if (!KGlobal::_instance)
+    {
+      KGlobal::_instance = this;
+      KGlobal::setActiveInstance(this);
+    }
+
+    d = new KInstancePrivate ();
+    d->ownAboutdata = true;
+}
+
+KInstance::KInstance( const KAboutData * aboutData )
+  : _dirs (0L),
+    _config (0L),
+    _iconLoader (0L),
+    _name( aboutData->appName() ), _aboutData( aboutData )
+{
+    ((!_name.isEmpty()) ? (void)0 : qWarning("ASSERT: \"%s\" in %s (%d)","!_name.isEmpty()","/coolo/prod/kdelibs/kdecore/kinstance.cpp",73));
+
+    if (!KGlobal::_instance)
+    {
+      KGlobal::_instance = this;
+      KGlobal::setActiveInstance(this);
+    }
+
+    d = new KInstancePrivate ();
+    d->ownAboutdata = false;
+}
+
+KInstance::KInstance( KInstance* src )
+  : _dirs ( src->_dirs ),
+    _config ( src->_config ),
+    _iconLoader ( src->_iconLoader ),
+    _name( src->_name ), _aboutData( src->_aboutData )
+{
+    ((!_name.isEmpty()) ? (void)0 : qWarning("ASSERT: \"%s\" in %s (%d)","!_name.isEmpty()","/coolo/prod/kdelibs/kdecore/kinstance.cpp",91));
+
+    if (!KGlobal::_instance || KGlobal::_instance == src )
+    {
+      KGlobal::_instance = this;
+      KGlobal::setActiveInstance(this);
+    }
+
+    d = new KInstancePrivate ();
+    d->ownAboutdata = src->d->ownAboutdata;
+
+    src->_dirs = 0L;
+    src->_config = 0L;
+    src->_iconLoader = 0L;
+    src->_aboutData = 0L;
+    delete src;
+}
+
+KInstance::~KInstance()
+{
+    if (d->ownAboutdata)
+        delete _aboutData;
+    _aboutData = 0;
+
+    delete d;
+    d = 0;
+
+    delete _iconLoader;
+    _iconLoader = 0;
+    delete _config;
+    _config = 0;
+    delete _dirs;
+    _dirs = 0;
+
+    if (KGlobal::_instance == this)
+        KGlobal::_instance = 0;
+    if (KGlobal::activeInstance() == this)
+        KGlobal::setActiveInstance(0);
+}
+
+
+KStandardDirs *KInstance::dirs() const
+{
+    if( _dirs == 0 ) {
+        _dirs = new KStandardDirs( );
+        if (_config)
+            if (_dirs->addCustomized(_config))
+                _config->reparseConfiguration();
+    }
+
+    return _dirs;
+}
+
+KConfig *KInstance::config() const
+{
+    if( _config == 0 ) {
+        if ( !d->configName.isEmpty() )
+        {
+            _config = new KConfig( d->configName );
+
+            _config->setGroup( "KDE Action Restrictions" );
+            if (_config->readBoolEntry( "custom_config", true))
+            {
+               _config->setGroup(QString::null);
+            }
+            else
+            {
+               delete _config;
+               _config = 0;
+            }
+
+        }
+
+        if ( _config == 0 )
+        {
+            if ( !_name.isEmpty() )
+                _config = new KConfig( _name + "rc");
+            else
+                _config = new KConfig();
+        }
+        if (_dirs)
+            if (_dirs->addCustomized(_config))
+                _config->reparseConfiguration();
+    }
+
+    return _config;
+}
+
+void KInstance::setConfigName(const QString &configName)
+{
+    d->configName = configName;
+}
+
+KIconLoader *KInstance::iconLoader() const
+{
+    if( _iconLoader == 0 ) {
+        _iconLoader = new KIconLoader( _name, dirs() );
+    _iconLoader->enableDelayedIconSetLoading( true );
+    }
+
+    return _iconLoader;
+}
+
+void KInstance::newIconLoader() const
+{
+    KIconTheme::reconfigure();
+    _iconLoader->reconfigure( _name, dirs() );
+}
+
+const KAboutData * KInstance::aboutData() const
+{
+    return _aboutData;
+}
+
+QCString KInstance::instanceName() const
+{
+    return _name;
+}
+
+KMimeSourceFactory* KInstance::mimeSourceFactory () const
+{
+  if (!d->mimeSourceFactory)
+  {
+    d->mimeSourceFactory = new KMimeSourceFactory(iconLoader());
+  }
+
+  return d->mimeSourceFactory;
+}
+
+void KInstance::virtual_hook( int, void* )
+{ }
+
+
+
+
+
+
+class KPalettePrivate;
+class KPalette
+{
+public:
+
+
+
+
+
+   static QStringList getPaletteList();
+
+
+
+
+
+
+   KPalette(const QString &name=QString::null);
+
+
+
+
+   KPalette(const KPalette &);
+
+
+
+
+   virtual ~KPalette();
+
+
+
+
+   KPalette& operator=( const KPalette &);
+
+
+
+
+
+
+   bool save();
+
+
+
+
+
+   QString description() const
+        { return mDesc; }
+
+
+
+
+
+   void setDescription(const QString &desc)
+        { mDesc = desc; }
+
+
+
+
+
+   QString name() const
+        { return mName; }
+
+
+
+
+
+   void setName(const QString &name)
+        { mName = name; }
+
+
+
+
+
+
+   enum Editable { Yes,
+                   No,
+                   Ask
+   };
+
+
+
+
+
+   Editable editable() const
+        { return mEditable; }
+
+
+
+
+
+   void setEditable(Editable editable)
+        { mEditable = editable; }
+
+
+
+
+
+   int nrColors() const
+        { return (int) mKolorList.count(); }
+
+
+
+
+
+
+   QColor color(int index);
+
+
+
+
+
+
+
+   int findColor(const QColor &color) const;
+   QString colorName(int index);
+   QString colorName(const QColor &color)
+        { return colorName( findColor(color)); }
+   int addColor(const QColor &newColor,
+                const QString &newColorName = QString::null);
+   int changeColor(int index,
+                   const QColor &newColor,
+                   const QString &newColorName = QString::null);
+   int changeColor(const QColor &oldColor,
+                   const QColor &newColor,
+                   const QString &newColorName = QString::null)
+        { return changeColor( findColor(oldColor), newColor, newColorName); }
+
+private:
+   typedef struct { QColor color; QString name; } kolor;
+   QPtrList<kolor> mKolorList;
+
+   QString mName;
+   QString mDesc;
+   Editable mEditable;
+
+   KPalettePrivate *d;
+};
+
+
+
+
+
+
+class KStringHandler
+{
+public:
+
+
+
+
+
+
+
+    static QString word( const QString &text , uint pos );
+    static QString word( const QString &text , const char *range );
+    static QString insword( const QString &text , const QString &word , uint pos );
+    static QString setword( const QString &text , const QString &word , uint pos );
+    static QString remrange( const QString &text , const char *range );
+    static QString remword( const QString &text , uint pos );
+
+
+
+
+
+
+
+    static QString remword( const QString &text , const QString &word );
+
+
+
+
+
+
+    static QString capwords( const QString &text );
+
+
+
+
+
+
+    static QStringList capwords( const QStringList &list );
+
+
+
+
+
+
+    static QString reverse( const QString &text );
+
+
+
+
+
+
+    static QStringList reverse( const QStringList &list );
+    static QString ljust( const QString &text , uint width );
+    static QString rjust( const QString &text , uint width );
+    static QString center( const QString &text , uint width );
+
+
+
+
+
+
+
+    static QString lsqueeze( const QString & str, uint maxlen = 40 );
+    static QString lEmSqueeze( const QString & name,
+                               const QFontMetrics& fontMetrics,
+                               uint maxlen = 30 );
+    static QString lPixelSqueeze( const QString & name,
+                                  const QFontMetrics& fontMetrics,
+                                  uint maxPixels );
+
+
+
+
+
+
+
+    static QString csqueeze( const QString & str, uint maxlen = 40 );
+    static QString cEmSqueeze( const QString & name,
+                               const QFontMetrics& fontMetrics,
+                               uint maxlen = 30 );
+    static QString cPixelSqueeze( const QString & name,
+                                  const QFontMetrics& fontMetrics,
+                                  uint maxPixels );
+
+
+
+
+
+
+
+    static QString rsqueeze( const QString & str, uint maxlen = 40 );
+    static QString rEmSqueeze( const QString & name,
+                               const QFontMetrics& fontMetrics,
+                               uint maxlen = 30 );
+    static QString rPixelSqueeze( const QString & name,
+                                  const QFontMetrics& fontMetrics,
+                                  uint maxPixels );
+    static bool matchFileName( const QString& filename, const QString& pattern );
+    static QStringList perlSplit
+      (const QString & sep, const QString & s, uint max = 0);
+    static QStringList perlSplit
+      (const QChar & sep, const QString & s, uint max = 0);
+    static QStringList perlSplit
+      (const QRegExp & sep, const QString & s, uint max = 0);
+    static QString tagURLs( const QString& text );
+    static QString obscure( const QString &str );
+
+
+
+
+
+
+
+    static __attribute__ ((deprecated)) bool matchFilename( const QString& filename, const QString& pattern )
+    {
+        return matchFileName (filename, pattern);
+    };
+
+};
+
+template class QPtrList<KPalette::kolor>;
+
+QStringList
+KPalette::getPaletteList()
+{
+  QStringList paletteList;
+  KGlobal::dirs()->findAllResources("config", "colors/*", false, true, paletteList);
+
+  int strip = strlen("colors/");
+  for(QStringList::Iterator it = paletteList.begin();
+      it != paletteList.end();
+      it++)
+  {
+      (*it) = (*it).mid(strip);
+  }
+
+  return paletteList;
+}
+
+KPalette::KPalette(const QString &name)
+ : mName(name)
+{
+  mKolorList.setAutoDelete(true);
+  if (mName.isEmpty()) return;
+
+  QString filename = locate("config", "colors/"+mName);
+  if (filename.isEmpty()) return;
+
+  QFile paletteFile(filename);
+  if (!paletteFile.exists()) return;
+  if (!paletteFile.open(0x0001)) return;
+
+  uint maxLength = 1024;
+  QString line;
+
+
+
+  if (paletteFile.readLine(line, maxLength) == -1) return;
+  if (line.find(" Palette") == -1) return;
+
+  char *buffer = new char[maxLength];
+
+  while( paletteFile.readLine(line, maxLength) != -1)
+  {
+     if (line[0] == '#')
+     {
+
+        line = line.mid(1);
+        line = line.stripWhiteSpace();
+        if (!line.isEmpty())
+        {
+           mDesc += line+"\n";
+        }
+     }
+     else
+     {
+
+        line = line.stripWhiteSpace();
+        if (line.isEmpty()) continue;
+        int red, green, blue;
+        int pos = 0;
+        buffer[0] = '\0';
+        if (sscanf(line.ascii(), "%d %d %d%n", &red, &green, &blue, &pos) >= 3)
+        {
+           if (red > 255) red = 255;
+           if (red < 0) red = 0;
+           if (green > 255) green = 255;
+           if (green < 0) green = 0;
+           if (blue > 255) blue = 255;
+           if (blue < 0) blue = 0;
+           kolor *node = new kolor();
+           node->color.setRgb(red, green, blue);
+           node->name = line.mid(pos).stripWhiteSpace();
+           if (node->name.isNull()) node->name = "";
+           mKolorList.append( node );
+        }
+     }
+  }
+  delete [] buffer;
+}
+
+KPalette::KPalette(const KPalette &p)
+ : mName(p.mName), mDesc(p.mDesc), mEditable(p.mEditable)
+{
+   mKolorList.setAutoDelete(true);
+
+
+
+   QPtrList<kolor> *nonConstList = (QPtrList<kolor> *) &p.mKolorList;
+   for(kolor *node = nonConstList->first(); node; node = nonConstList->next())
+   {
+       mKolorList.append(new kolor(*node));
+   }
+}
+
+KPalette::~KPalette()
+{
+
+}
+
+bool
+KPalette::save()
+{
+   QString filename = locateLocal("config", "colors/"+mName);
+   KSaveFile sf(filename);
+   if (sf.status() != 0) return false;
+
+   QTextStream *str = sf.textStream();
+
+   QString description = mDesc.stripWhiteSpace();
+   description = "#"+QStringList::split("\n", description, true).join("\n#");
+
+   (*str) << "KDE RGB Palette\n";
+   (*str) << description << "\n";
+
+
+   QPtrList<kolor> *nonConstList = (QPtrList<kolor> *) (&mKolorList);
+   for(kolor *node = nonConstList->first(); node; node = nonConstList->next())
+   {
+       int r,g,b;
+       node->color.rgb(&r, &g, &b);
+       (*str) << r << " " << g << " " << b << " " << node->name << "\n";
+   }
+   return sf.close();
+}
+
+
+KPalette&
+KPalette::operator=( const KPalette &p)
+{
+  if (&p == this) return *this;
+  mKolorList.clear();
+
+
+
+  QPtrList<kolor> *nonConstList = (QPtrList<kolor> *) &p.mKolorList;
+  for(kolor *node = nonConstList->first(); node; node = nonConstList->next())
+  {
+     mKolorList.append(new kolor(*node));
+  }
+  mName = p.mName;
+  mDesc = p.mDesc;
+  mEditable = p.mEditable;
+  return *this;
+}
+
+QColor
+KPalette::color(int index)
+{
+  if ((index < 0) || (index >= nrColors()))
+        return QColor();
+
+  kolor *node = mKolorList.at(index);
+  if (!node)
+        return QColor();
+
+  return node->color;
+}
+
+int
+KPalette::findColor(const QColor &color) const
+{
+  int index;
+  QPtrListIterator<kolor> it( mKolorList );
+  for (index = 0; it.current(); ++it, ++index)
+  {
+     if (it.current()->color == color)
+         return index;
+  }
+  return -1;
+}
+
+QString
+KPalette::colorName(int index)
+{
+  if ((index < 0) || (index >= nrColors()))
+        return QString::null;
+
+  kolor *node = mKolorList.at(index);
+  if (!node)
+        return QString::null;
+
+  return node->name;
+}
+
+int
+KPalette::addColor(const QColor &newColor, const QString &newColorName)
+{
+  kolor *node = new kolor();
+  node->color = newColor;
+  node->name = newColorName;
+  mKolorList.append( node );
+  return nrColors()-1;
+}
+
+int
+KPalette::changeColor(int index,
+                      const QColor &newColor,
+                      const QString &newColorName)
+{
+  if ((index < 0) || (index >= nrColors()))
+        return -1;
+
+  kolor *node = mKolorList.at(index);
+  if (!node)
+        return -1;
+
+  node->color = newColor;
+  node->name = newColorName;
+  return index;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C"
+
+int mkstemps(char *, int);
+extern "C"
+
+unsigned long strlcat(char*, const char*, unsigned long);
+
+
+
+
+
+
+extern "C"
+
+unsigned long strlcpy(char*, const char*, unsigned long);
+
+
+
+
+static long getSimpleProperty(Window w, Atom a)
+{
+    Atom real_type;
+    int format;
+    unsigned long n, extra, *p = 0, res;
+    int status;
+
+    res = 0;
+    status = XGetWindowProperty(qt_xdisplay(), w, a, 0L, 1L, 0, a,
+            &real_type, &format, &n, &extra, (unsigned char **) &p);
+    if ((status == Success) && (n == 1) && (format == 32))
+        res = p[0];
+    if (p) XFree((char *) p);
+    return res;
+}
+
+
+void KIPC::sendMessage(Message msg, WId w, int data)
+{
+
+    static Atom a = 0;
+    if (a == 0)
+        a = XInternAtom(qt_xdisplay(), "KIPC_COMM_ATOM", 0);
+    XEvent ev;
+    ev.xclient.type = 33;
+    ev.xclient.display = qt_xdisplay();
+    ev.xclient.window = (Window) w;
+    ev.xclient.message_type = a;
+    ev.xclient.format = 32;
+    ev.xclient.data.l[0] = msg;
+    ev.xclient.data.l[1] = data;
+    XSendEvent(qt_xdisplay(), (Window) w, 0, 0L, &ev);
+
+
+    static Atom kde1 = 0;
+    if ( msg == PaletteChanged || msg == FontChanged ) {
+        if ( kde1 == 0 )
+            kde1 = XInternAtom(qt_xdisplay(), "KDEChangeGeneral", 0 );
+        ev.xclient.message_type = kde1;
+        XSendEvent(qt_xdisplay(), (Window) w, 0, 0L, &ev);
+    }
+
+
+}
+
+
+void KIPC::sendMessageAll(Message msg, int data)
+{
+
+    unsigned int i, nrootwins;
+    Window dw1, dw2, *rootwins = 0;
+    Display *dpy = qt_xdisplay();
+    int screen_count = (((_XPrivDisplay)dpy)->nscreens);
+
+    KXErrorHandler handler;
+    for (int s = 0; s < screen_count; s++) {
+        Window root = ((&((_XPrivDisplay)dpy)->screens[s])->root);
+
+        XQueryTree(dpy, root, &dw1, &dw2, &rootwins, &nrootwins);
+        Atom a = XInternAtom(qt_xdisplay(), "KDE_DESKTOP_WINDOW", 0);
+        for (i = 0; i < nrootwins; i++)
+            {
+                if (getSimpleProperty(rootwins[i], a) != 0L)
+                    sendMessage(msg, rootwins[i], data);
+            }
+        XFree((char *) rootwins);
+    }
+    XSync(dpy,0);
+
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C"
+
+int mkstemps(char *, int);
+extern "C"
+
+unsigned long strlcat(char*, const char*, unsigned long);
+
+
+
+
+
+
+extern "C"
+
+unsigned long strlcpy(char*, const char*, unsigned long);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C"
+
+int mkstemps(char *, int);
+extern "C"
+
+unsigned long strlcat(char*, const char*, unsigned long);
+
+
+
+
+
+
+extern "C"
+
+unsigned long strlcpy(char*, const char*, unsigned long);
+
+
+
+
+
+
+
+class QObjectDictionary : public QAsciiDict<QMetaObject>
+{
+public:
+    QObjectDictionary(int size=17,bool cs=TRUE,bool ck=TRUE)
+        : QAsciiDict<QMetaObject>(size,cs,ck) {}
+    QObjectDictionary( const QObjectDictionary &dict )
+        : QAsciiDict<QMetaObject>(dict) {}
+   ~QObjectDictionary() { clear(); }
+    QObjectDictionary &operator=(const QObjectDictionary &dict)
+        { return (QObjectDictionary&)QAsciiDict<QMetaObject>::operator=(dict);}
+};
+
+
+
+
+
+extern "C" {
+
+
+
+
+
+
+
+
+
+
+
+
+typedef struct lt_dlhandle_struct *lt_dlhandle;
+
+
+extern int lt_dlinit (void);
+extern int lt_dlexit (void);
+
+
+extern int lt_dladdsearchdir (const char *search_dir);
+extern int lt_dlsetsearchpath (const char *search_path);
+extern const char *lt_dlgetsearchpath (void);
+
+
+extern lt_dlhandle lt_dlopen (const char *filename);
+extern lt_dlhandle lt_dlopenext (const char *filename);
+extern void* lt_dlsym (lt_dlhandle handle, const char *name);
+
+extern const char *lt_dlerror (void);
+extern int lt_dlclose (lt_dlhandle handle);
+
+
+extern int lt_dlmakeresident (lt_dlhandle handle);
+extern int lt_dlisresident (lt_dlhandle handle);
+
+
+
+
+
+
+
+typedef void lt_dlmutex_lock (void);
+typedef void lt_dlmutex_unlock (void);
+typedef void lt_dlmutex_seterror (const char *error);
+typedef const char *lt_dlmutex_geterror (void);
+
+extern int lt_dlmutex_register (lt_dlmutex_lock *lock, lt_dlmutex_unlock *unlock, lt_dlmutex_seterror *seterror, lt_dlmutex_geterror *geterror);
+extern void* (*lt_dlmalloc) (size_t size);
+extern void (*lt_dlfree) (void* ptr);
+typedef struct {
+  const char *name;
+  void* address;
+} lt_dlsymlist;
+
+extern int lt_dlpreload (const lt_dlsymlist *preloaded);
+extern int lt_dlpreload_default
+                                (const lt_dlsymlist *preloaded);
+
+typedef struct {
+  char *filename;
+  char *name;
+  int ref_count;
+
+} lt_dlinfo;
+
+extern const lt_dlinfo *lt_dlgetinfo (lt_dlhandle handle);
+extern lt_dlhandle lt_dlhandle_next (lt_dlhandle place);
+extern int lt_dlforeach ( int (*func) (lt_dlhandle handle, void* data), void* data);
+
+
+
+
+typedef unsigned lt_dlcaller_id;
+
+extern lt_dlcaller_id lt_dlcaller_register (void);
+extern void* lt_dlcaller_set_data (lt_dlcaller_id key, lt_dlhandle handle, void* data);
+
+
+extern void* lt_dlcaller_get_data (lt_dlcaller_id key, lt_dlhandle handle);
+
+
+
+
+
+
+
+typedef struct lt_dlloader lt_dlloader;
+typedef void* lt_user_data;
+typedef void* lt_module;
+
+
+typedef lt_module lt_module_open (lt_user_data loader_data, const char *filename);
+
+typedef int lt_module_close (lt_user_data loader_data, lt_module handle);
+
+typedef void* lt_find_sym (lt_user_data loader_data, lt_module handle, const char *symbol);
+
+
+typedef int lt_dlloader_exit (lt_user_data loader_data);
+
+struct lt_user_dlloader {
+  const char *sym_prefix;
+  lt_module_open *module_open;
+  lt_module_close *module_close;
+  lt_find_sym *find_sym;
+  lt_dlloader_exit *dlloader_exit;
+  lt_user_data dlloader_data;
+};
+
+extern lt_dlloader *lt_dlloader_next (lt_dlloader *place);
+extern lt_dlloader *lt_dlloader_find ( const char *loader_name);
+
+extern const char *lt_dlloader_name (lt_dlloader *place);
+extern lt_user_data *lt_dlloader_data (lt_dlloader *place);
+extern int lt_dlloader_add (lt_dlloader *place, const struct lt_user_dlloader *dlloader, const char *loader_name);
+
+
+extern int lt_dlloader_remove ( const char *loader_name);
+enum {
+        LT_ERROR_UNKNOWN, LT_ERROR_DLOPEN_NOT_SUPPORTED, LT_ERROR_INVALID_LOADER, LT_ERROR_INIT_LOADER, LT_ERROR_REMOVE_LOADER, LT_ERROR_FILE_NOT_FOUND, LT_ERROR_DEPLIB_NOT_FOUND, LT_ERROR_NO_SYMBOLS, LT_ERROR_CANNOT_OPEN, LT_ERROR_CANNOT_CLOSE, LT_ERROR_SYMBOL_NOT_FOUND, LT_ERROR_NO_MEMORY, LT_ERROR_INVALID_HANDLE, LT_ERROR_BUFFER_OVERFLOW, LT_ERROR_INVALID_ERRORCODE, LT_ERROR_SHUTDOWN, LT_ERROR_CLOSE_RESIDENT_MODULE, LT_ERROR_INVALID_MUTEX_ARGS,
+
+        LT_ERROR_MAX
+};
+
+
+extern int lt_dladderror (const char *diagnostic);
+extern int lt_dlseterror (int errorcode);
+
+
+
+
+
+
+
+
+
+
+
+
+}
+
+
+
+
+
+
+template class QAsciiDict<KLibrary>;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C" {
+
+
+extern void _dl_mcount_wrapper_check (void *__selfpc) throw ();
+
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C" {
+
+
+
+extern void *dlopen (__const char *__file, int __mode) throw ();
+
+
+
+extern int dlclose (void *__handle) throw ();
+
+
+
+extern void *dlsym (void *__restrict __handle,
+                    __const char *__restrict __name) throw ();
+
+
+
+
+extern void *dlvsym (void *__restrict __handle,
+                     __const char *__restrict __name,
+                     __const char *__restrict __version) throw ();
+
+
+
+
+
+extern char *dlerror (void) throw ();
+
+
+
+
+
+typedef struct
+{
+  __const char *dli_fname;
+  void *dli_fbase;
+  __const char *dli_sname;
+  void *dli_saddr;
+} Dl_info;
+
+
+
+extern int dladdr (__const void *__address, Dl_info *__info) throw ();
+
+
+}
+
+
+
+extern "C" {
+extern int lt_dlopen_flag;
+}
+
+class KLibLoaderPrivate
+{
+public:
+    QPtrList<KLibWrapPrivate> loaded_stack;
+    QPtrList<KLibWrapPrivate> pending_close;
+    enum {UNKNOWN, UNLOAD, DONT_UNLOAD} unload_mode;
+
+    QString errorMessage;
+};
+
+KLibLoader* KLibLoader::s_self = 0;
+
+
+
+KLibFactory::KLibFactory( QObject* parent, const char* name )
+    : QObject( parent, name )
+{
+}
+
+KLibFactory::~KLibFactory()
+{
+
+}
+
+QObject* KLibFactory::create( QObject* parent, const char* name, const char* classname, const QStringList &args )
+{
+    QObject* obj = createObject( parent, name, classname, args );
+    if ( obj )
+        objectCreated( obj );
+    return obj;
+}
+
+
+QObject* KLibFactory::createObject( QObject*, const char*, const char*, const QStringList &)
+{
+    return 0;
+}
+
+
+
+
+KLibrary::KLibrary( const QString& libname, const QString& filename, void * handle )
+{
+
+    (void) KLibLoader::self();
+    m_libname = libname;
+    m_filename = filename;
+    m_handle = handle;
+    m_factory = 0;
+    m_timer = 0;
+}
+
+KLibrary::~KLibrary()
+{
+
+    if ( m_timer && m_timer->isActive() )
+        m_timer->stop();
+
+
+    if ( m_objs.count() > 0 )
+        {
+            QPtrListIterator<QObject> it( m_objs );
+            for ( ; it.current() ; ++it )
+                {
+                    kdDebug(150) << "Factory still has object " << it.current() << " " << it.current()->name () << " Library = " << m_libname << endl;
+                    disconnect( it.current(), "2""destroyed()",
+                                this, "1""slotObjectDestroyed()" );
+                }
+            m_objs.setAutoDelete(true);
+            m_objs.clear();
+        }
+
+    if ( m_factory ) {
+
+        delete m_factory;
+        m_factory = 0L;
+    }
+}
+
+QString KLibrary::name() const
+{
+    return m_libname;
+}
+
+QString KLibrary::fileName() const
+{
+    return m_filename;
+}
+
+KLibFactory* KLibrary::factory()
+{
+    if ( m_factory )
+        return m_factory;
+
+        QCString symname;
+        symname.sprintf("init_%s", name().latin1() );
+
+    void* sym = symbol( symname );
+        if ( !sym )
+        {
+            KLibLoader::self()->d->errorMessage = i18n( "The library %1 does not offer an %2 function." ).arg( name() ).arg( "init_" + name() );
+            kdWarning(150) << KLibLoader::self()->d->errorMessage << endl;
+            return 0;
+    }
+
+    typedef KLibFactory* (*t_func)();
+    t_func func = (t_func)sym;
+    m_factory = func();
+
+    if( !m_factory )
+    {
+        KLibLoader::self()->d->errorMessage = i18n( "The library %1 does not offer a KDE compatible factory." ).arg( name() );
+        kdWarning(150) << KLibLoader::self()->d->errorMessage << endl;
+        return 0;
+    }
+
+    connect( m_factory, "2""objectCreated( QObject * )",
+             this, "1""slotObjectCreated( QObject * )" );
+
+    return m_factory;
+}
+
+void* KLibrary::symbol( const char* symname ) const
+{
+    void* sym = lt_dlsym( (lt_dlhandle) m_handle, symname );
+    if ( !sym )
+    {
+        KLibLoader::self()->d->errorMessage = "KLibrary: " + QString::fromLatin1( lt_dlerror() );
+        kdWarning(150) << KLibLoader::self()->d->errorMessage << endl;
+        return 0;
+    }
+
+    return sym;
+}
+
+bool KLibrary::hasSymbol( const char* symname ) const
+{
+    void* sym = lt_dlsym( (lt_dlhandle) m_handle, symname );
+    return (sym != 0L );
+}
+
+void KLibrary::unload() const
+{
+   if (KLibLoader::s_self)
+      KLibLoader::s_self->unloadLibrary(QFile::encodeName(name()));
+}
+
+void KLibrary::slotObjectCreated( QObject *obj )
+{
+  if ( !obj )
+    return;
+
+  if ( m_timer && m_timer->isActive() )
+    m_timer->stop();
+
+  if ( m_objs.containsRef( obj ) )
+      return;
+
+  connect( obj, "2""destroyed()",
+           this, "1""slotObjectDestroyed()" );
+
+  m_objs.append( obj );
+}
+
+void KLibrary::slotObjectDestroyed()
+{
+  m_objs.removeRef( sender() );
+
+  if ( m_objs.count() == 0 )
+  {
+
+
+
+    if ( !m_timer )
+    {
+      m_timer = new QTimer( this, "klibrary_shutdown_timer" );
+      connect( m_timer, "2""timeout()",
+               this, "1""slotTimeout()" );
+    }
+
+
+
+
+    m_timer->start( 1000*10, true );
+  }
+}
+
+void KLibrary::slotTimeout()
+{
+  if ( m_objs.count() != 0 )
+    return;
+
+
+
+
+
+  delete this;
+}
+
+
+
+
+
+
+class KLibWrapPrivate
+{
+public:
+    KLibWrapPrivate(KLibrary *l, lt_dlhandle h);
+
+    KLibrary *lib;
+    enum {UNKNOWN, UNLOAD, DONT_UNLOAD} unload_mode;
+    int ref_count;
+    lt_dlhandle handle;
+    QString name;
+    QString filename;
+};
+
+KLibWrapPrivate::KLibWrapPrivate(KLibrary *l, lt_dlhandle h)
+ : lib(l), ref_count(1), handle(h), name(l->name()), filename(l->fileName())
+{
+    unload_mode = UNKNOWN;
+    if (lt_dlsym(handle, "__kde_do_not_unload") != 0) {
+
+        unload_mode = DONT_UNLOAD;
+    } else if (lt_dlsym(handle, "__kde_do_unload") != 0) {
+        unload_mode = UNLOAD;
+    }
+}
+
+KLibLoader* KLibLoader::self()
+{
+    if ( !s_self )
+        s_self = new KLibLoader;
+    return s_self;
+}
+
+void KLibLoader::cleanUp()
+{
+  if ( !s_self )
+    return;
+
+  delete s_self;
+  s_self = 0L;
+}
+
+KLibLoader::KLibLoader( QObject* parent, const char* name )
+    : QObject( parent, name )
+{
+    s_self = this;
+    d = new KLibLoaderPrivate;
+    lt_dlinit();
+    d->unload_mode = KLibLoaderPrivate::UNKNOWN;
+    if (getenv("KDE_NOUNLOAD") != 0)
+        d->unload_mode = KLibLoaderPrivate::DONT_UNLOAD;
+    else if (getenv("KDE_DOUNLOAD") != 0)
+        d->unload_mode = KLibLoaderPrivate::UNLOAD;
+    d->loaded_stack.setAutoDelete( true );
+}
+
+KLibLoader::~KLibLoader()
+{
+
+
+    QAsciiDictIterator<KLibWrapPrivate> it( m_libs );
+    for (; it.current(); ++it )
+    {
+      kdDebug(150) << "The KLibLoader contains the library " << it.current()->name
+        << " (" << it.current()->lib << ")" << endl;
+      d->pending_close.append(it.current());
+    }
+
+    close_pending(0);
+
+    delete d;
+    d = 0L;
+}
+
+
+QString KLibLoader::findLibrary( const char * name, const KInstance * instance )
+{
+    QCString libname( name );
+
+
+
+
+    int pos = libname.findRev('/');
+    if (pos < 0)
+      pos = 0;
+    if (libname.find('.', pos) < 0)
+      libname += ".la";
+
+
+
+    QString libfile;
+    if (libname[0] == '/')
+      libfile = libname;
+    else
+    {
+      libfile = instance->dirs()->findResource( "module", libname );
+      if ( libfile.isEmpty() )
+      {
+        libfile = instance->dirs()->findResource( "lib", libname );
+
+        if ( !libfile.isEmpty() && libname.left(3) == "lib" )
+          kdDebug(150) << "library " << libname << " not found under 'module' but under 'lib'" << endl;
+
+      }
+      if ( libfile.isEmpty() )
+      {
+
+        kdDebug(150) << "library=" << libname << ": No file names " << libname.data() << " found in paths." << endl;
+
+            self()->d->errorMessage = i18n("Library files for \"%1\" not found in paths").arg(libname);
+      }
+      else
+            self()->d->errorMessage = QString::null;
+    }
+    return libfile;
+}
+
+
+KLibrary* KLibLoader::globalLibrary( const char *name )
+{
+KLibrary *tmp;
+int olt_dlopen_flag = lt_dlopen_flag;
+
+   lt_dlopen_flag |= 0x00100;
+   kdDebug(150) << "Loading the next library global with flag "
+                << lt_dlopen_flag
+                << "." << endl;
+   tmp = library(name);
+   lt_dlopen_flag = olt_dlopen_flag;
+
+return tmp;
+}
+
+
+KLibrary* KLibLoader::library( const char *name )
+{
+    if (!name)
+        return 0;
+
+    KLibWrapPrivate* wrap = m_libs[name];
+    if (wrap) {
+
+      wrap->ref_count++;
+      return wrap->lib;
+    }
+
+
+
+    QPtrListIterator<KLibWrapPrivate> it(d->loaded_stack);
+    for (; it.current(); ++it) {
+      if (it.current()->name == name)
+        wrap = it.current();
+    }
+
+    if (wrap) {
+      d->pending_close.removeRef(wrap);
+      if (!wrap->lib) {
+
+        wrap->lib = new KLibrary( name, wrap->filename, wrap->handle );
+      }
+      wrap->ref_count++;
+    } else {
+      QString libfile = findLibrary( name );
+      if ( libfile.isEmpty() )
+        return 0;
+
+      lt_dlhandle handle = lt_dlopen( libfile.latin1() );
+      if ( !handle )
+      {
+        const char* errmsg = lt_dlerror();
+        if(errmsg)
+            d->errorMessage = QString::fromLatin1(errmsg);
+        else
+            d->errorMessage = QString::null;
+        return 0;
+      }
+      else
+        d->errorMessage = QString::null;
+
+      KLibrary *lib = new KLibrary( name, libfile, handle );
+      wrap = new KLibWrapPrivate(lib, handle);
+      d->loaded_stack.prepend(wrap);
+    }
+    m_libs.insert( name, wrap );
+
+    connect( wrap->lib, "2""destroyed()",
+             this, "1""slotLibraryDestroyed()" );
+
+    return wrap->lib;
+}
+
+QString KLibLoader::lastErrorMessage() const
+{
+    return d->errorMessage;
+}
+
+void KLibLoader::unloadLibrary( const char *libname )
+{
+  KLibWrapPrivate *wrap = m_libs[ libname ];
+  if (!wrap)
+    return;
+  if (--wrap->ref_count)
+    return;
+
+
+
+  m_libs.remove( libname );
+
+  disconnect( wrap->lib, "2""destroyed()",
+              this, "1""slotLibraryDestroyed()" );
+  close_pending( wrap );
+}
+
+KLibFactory* KLibLoader::factory( const char* name )
+{
+    KLibrary* lib = library( name );
+    if ( !lib )
+        return 0;
+
+    return lib->factory();
+}
+
+void KLibLoader::slotLibraryDestroyed()
+{
+  const KLibrary *lib = static_cast<const KLibrary *>( sender() );
+
+  QAsciiDictIterator<KLibWrapPrivate> it( m_libs );
+  for (; it.current(); ++it )
+    if ( it.current()->lib == lib )
+    {
+      KLibWrapPrivate *wrap = it.current();
+      wrap->lib = 0;
+      m_libs.remove( it.currentKey() );
+      close_pending( wrap );
+      return;
+    }
+}
+
+void KLibLoader::close_pending(KLibWrapPrivate *wrap)
+{
+  if (wrap && !d->pending_close.containsRef( wrap ))
+    d->pending_close.append( wrap );
+
+
+
+  QPtrListIterator<KLibWrapPrivate> it(d->pending_close);
+  for (; it.current(); ++it) {
+    wrap = it.current();
+    if (wrap->lib) {
+      disconnect( wrap->lib, "2""destroyed()",
+                  this, "1""slotLibraryDestroyed()" );
+      delete wrap->lib;
+      wrap->lib = 0L;
+    }
+  }
+
+  if (d->unload_mode == KLibLoaderPrivate::DONT_UNLOAD) return;
+
+  bool deleted_one = false;
+  while ((wrap = d->loaded_stack.first())) {
+
+
+
+
+    if (d->unload_mode != KLibLoaderPrivate::UNLOAD
+        && wrap->unload_mode != KLibWrapPrivate::UNLOAD)
+      break;
+
+
+
+    if (!d->pending_close.containsRef( wrap )) {
+      if (!deleted_one)
+
+
+      break;
+    }
+
+
+
+
+
+    if ( !deleted_one ) {
+      QWidgetList *widgetlist = QApplication::topLevelWidgets();
+      QWidget *co = widgetlist->first();
+      while (co) {
+        if (qstrcmp(co->name(), "internal clipboard owner") == 0) {
+          if (XGetSelectionOwner(co->x11Display(), ((Atom) 1)) == co->winId())
+            KApplication::kApplication()->clipboard()->setText(KApplication::kApplication()->clipboard()->text());
+
+          break;
+        }
+        co = widgetlist->next();
+      }
+      delete widgetlist;
+    }
+
+
+
+
+    deleted_one = true;
+    lt_dlclose(wrap->handle);
+    d->pending_close.removeRef(wrap);
+
+    d->loaded_stack.remove();
+  }
+}
+
+void KLibLoader::virtual_hook( int, void* )
+{ }
+
+void KLibFactory::virtual_hook( int, void* )
+{ }
+
+const char *KLibrary::className() const
+{
+    return "KLibrary";
+}
+
+QMetaObject *KLibrary::metaObj = 0;
+static QMetaObjectCleanUp cleanUp_KLibrary( "KLibrary", &KLibrary::staticMetaObject );
+QMetaObject* KLibrary::staticMetaObject()
+{
+    if ( metaObj )
+        return metaObj;
+    QMetaObject* parentObject = QObject::staticMetaObject();
+    static const QUParameter param_slot_0[] = {
+        { "obj", &static_QUType_ptr, "QObject", QUParameter::In }
+    };
+    static const QUMethod slot_0 = {"slotObjectCreated", 1, param_slot_0 };
+    static const QUMethod slot_1 = {"slotObjectDestroyed", 0, 0 };
+    static const QUMethod slot_2 = {"slotTimeout", 0, 0 };
+    static const QMetaData slot_tbl[] = {
+        { "slotObjectCreated(QObject*)", &slot_0, QMetaData::Private },
+        { "slotObjectDestroyed()", &slot_1, QMetaData::Private },
+        { "slotTimeout()", &slot_2, QMetaData::Private }
+    };
+    metaObj = QMetaObject::new_metaobject(
+        "KLibrary", parentObject,
+        slot_tbl, 3,
+        0, 0,
+
+        0, 0,
+        0, 0,
+
+        0, 0 );
+    cleanUp_KLibrary.setMetaObject( metaObj );
+    return metaObj;
+}
+
+void* KLibrary::qt_cast( const char* clname )
+{
+    if ( !qstrcmp( clname, "KLibrary" ) )
+        return this;
+    return QObject::qt_cast( clname );
+}
+
+bool KLibrary::qt_invoke( int _id, QUObject* _o )
+{
+    switch ( _id - staticMetaObject()->slotOffset() ) {
+    case 0: slotObjectCreated((QObject*)static_QUType_ptr.get(_o+1)); break;
+    case 1: slotObjectDestroyed(); break;
+    case 2: slotTimeout(); break;
+    default:
+        return QObject::qt_invoke( _id, _o );
+    }
+    return TRUE;
+}
+
+bool KLibrary::qt_emit( int _id, QUObject* _o )
+{
+    return QObject::qt_emit(_id,_o);
+}
+
+
+bool KLibrary::qt_property( int id, int f, QVariant* v)
+{
+    return QObject::qt_property( id, f, v);
+}
+
+bool KLibrary::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; }
+
+
+
+const char *KLibLoader::className() const
+{
+    return "KLibLoader";
+}
+
+QMetaObject *KLibLoader::metaObj = 0;
+static QMetaObjectCleanUp cleanUp_KLibLoader( "KLibLoader", &KLibLoader::staticMetaObject );
+QMetaObject* KLibLoader::staticMetaObject()
+{
+    if ( metaObj )
+        return metaObj;
+    QMetaObject* parentObject = QObject::staticMetaObject();
+    static const QUMethod slot_0 = {"slotLibraryDestroyed", 0, 0 };
+    static const QMetaData slot_tbl[] = {
+        { "slotLibraryDestroyed()", &slot_0, QMetaData::Private }
+    };
+    metaObj = QMetaObject::new_metaobject(
+        "KLibLoader", parentObject,
+        slot_tbl, 1,
+        0, 0,
+
+        0, 0,
+        0, 0,
+
+        0, 0 );
+    cleanUp_KLibLoader.setMetaObject( metaObj );
+    return metaObj;
+}
+
+void* KLibLoader::qt_cast( const char* clname )
+{
+    if ( !qstrcmp( clname, "KLibLoader" ) )
+        return this;
+    return QObject::qt_cast( clname );
+}
+
+bool KLibLoader::qt_invoke( int _id, QUObject* _o )
+{
+    switch ( _id - staticMetaObject()->slotOffset() ) {
+    case 0: slotLibraryDestroyed(); break;
+    default:
+        return QObject::qt_invoke( _id, _o );
+    }
+    return TRUE;
+}
+
+bool KLibLoader::qt_emit( int _id, QUObject* _o )
+{
+    return QObject::qt_emit(_id,_o);
+}
+
+
+bool KLibLoader::qt_property( int id, int f, QVariant* v)
+{
+    return QObject::qt_property( id, f, v);
+}
+
+bool KLibLoader::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; }
+
+
+
+const char *KLibFactory::className() const
+{
+    return "KLibFactory";
+}
+
+QMetaObject *KLibFactory::metaObj = 0;
+static QMetaObjectCleanUp cleanUp_KLibFactory( "KLibFactory", &KLibFactory::staticMetaObject );
+QMetaObject* KLibFactory::staticMetaObject()
+{
+    if ( metaObj )
+        return metaObj;
+    QMetaObject* parentObject = QObject::staticMetaObject();
+    static const QUParameter param_signal_0[] = {
+        { "obj", &static_QUType_ptr, "QObject", QUParameter::In }
+    };
+    static const QUMethod signal_0 = {"objectCreated", 1, param_signal_0 };
+    static const QMetaData signal_tbl[] = {
+        { "objectCreated(QObject*)", &signal_0, QMetaData::Public }
+    };
+    metaObj = QMetaObject::new_metaobject(
+        "KLibFactory", parentObject,
+        0, 0,
+        signal_tbl, 1,
+
+        0, 0,
+        0, 0,
+
+        0, 0 );
+    cleanUp_KLibFactory.setMetaObject( metaObj );
+    return metaObj;
+}
+
+void* KLibFactory::qt_cast( const char* clname )
+{
+    if ( !qstrcmp( clname, "KLibFactory" ) )
+        return this;
+    return QObject::qt_cast( clname );
+}
+
+
+
+
+
+void KLibFactory::objectCreated( QObject* t0 )
+{
+    if ( signalsBlocked() )
+        return;
+    QConnectionList *clist = receivers( staticMetaObject()->signalOffset() + 0 );
+    if ( !clist )
+        return;
+    QUObject o[2];
+    static_QUType_ptr.set(o+1,t0);
+    activate_signal( clist, o );
+}
+
+bool KLibFactory::qt_invoke( int _id, QUObject* _o )
+{
+    return QObject::qt_invoke(_id,_o);
+}
+
+bool KLibFactory::qt_emit( int _id, QUObject* _o )
+{
+    switch ( _id - staticMetaObject()->signalOffset() ) {
+    case 0: objectCreated((QObject*)static_QUType_ptr.get(_o+1)); break;
+    default:
+        return QObject::qt_emit(_id,_o);
+    }
+    return TRUE;
+}
+
+
+bool KLibFactory::qt_property( int id, int f, QVariant* v)
+{
+    return QObject::qt_property( id, f, v);
+}
+
+bool KLibFactory::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C"
+
+int mkstemps(char *, int);
+extern "C"
+
+unsigned long strlcat(char*, const char*, unsigned long);
+
+
+
+
+
+
+extern "C"
+
+unsigned long strlcpy(char*, const char*, unsigned long);
+
+
+
+
+KTempFile::KTempFile(QString filePrefix, QString fileExtension, int mode)
+{
+   bAutoDelete = false;
+   mFd = -1;
+   mStream = 0;
+   mFile = 0;
+   mTextStream = 0;
+   mDataStream = 0;
+   mError = 0;
+   bOpen = false;
+   if (fileExtension.isEmpty())
+      fileExtension = ".tmp";
+   if (filePrefix.isEmpty())
+   {
+      filePrefix = locateLocal("tmp", KGlobal::instance()->instanceName());
+   }
+   (void) create(filePrefix, fileExtension, mode);
+}
+
+KTempFile::KTempFile(bool)
+{
+   bAutoDelete = false;
+   mFd = -1;
+   mStream = 0;
+   mFile = 0;
+   mTextStream = 0;
+   mDataStream = 0;
+   mError = 0;
+   bOpen = false;
+}
+
+bool
+KTempFile::create(const QString &filePrefix, const QString &fileExtension,
+                  int mode)
+{
+
+   (void) KApplication::random();
+
+   QCString ext = QFile::encodeName(fileExtension);
+   QCString nme = QFile::encodeName(filePrefix) + "XXXXXX" + ext;
+   if((mFd = mkstemps(nme.data(), ext.length())) < 0)
+   {
+
+       QCString nme = QFile::encodeName(filePrefix) + "XXXXXX" + ext;
+       qWarning("KTempFile: Error trying to create %s: %s", nme.data(), strerror((*__errno_location ())));
+       mError = (*__errno_location ());
+       mTmpName = QString::null;
+       return false;
+   }
+
+
+   mTmpName = QFile::decodeName(nme);
+   mode_t tmp = 0;
+   mode_t umsk = umask(tmp);
+   umask(umsk);
+   chmod(nme, mode&(~umsk));
+
+
+   bOpen = true;
+
+
+   chown(nme, getuid(), getgid());
+   return true;
+}
+
+KTempFile::~KTempFile()
+{
+   close();
+   if (bAutoDelete)
+      unlink();
+}
+
+int
+KTempFile::status() const
+{
+   return mError;
+}
+
+QString
+KTempFile::name() const
+{
+   return mTmpName;
+}
+
+int
+KTempFile::handle() const
+{
+   return mFd;
+}
+
+FILE *
+KTempFile::fstream()
+{
+   if (mStream) return mStream;
+   if (mFd < 0) return 0;
+
+
+   mStream = fdopen(mFd, "r+");
+   if (!mStream) {
+     qWarning("KTempFile: Error trying to open %s: %s", mTmpName.latin1(), strerror((*__errno_location ())));
+     mError = (*__errno_location ());
+   }
+   return mStream;
+}
+
+QFile *
+KTempFile::file()
+{
+   if (mFile) return mFile;
+   if ( !fstream() ) return 0;
+
+   mFile = new QFile();
+   mFile->setName( name() );
+   mFile->open(0x0003, mStream);
+   return mFile;
+}
+
+QTextStream *
+KTempFile::textStream()
+{
+   if (mTextStream) return mTextStream;
+   if ( !file() ) return 0;
+
+   mTextStream = new QTextStream( mFile );
+   return mTextStream;
+}
+
+QDataStream *
+KTempFile::dataStream()
+{
+   if (mDataStream) return mDataStream;
+   if ( !file() ) return 0;
+
+   mDataStream = new QDataStream( mFile );
+   return mDataStream;
+}
+
+void
+KTempFile::unlink()
+{
+   if (!mTmpName.isEmpty())
+      QFile::remove( mTmpName );
+   mTmpName = QString::null;
+}
+
+bool
+KTempFile::close()
+{
+   int result = 0;
+   delete mTextStream; mTextStream = 0;
+   delete mDataStream; mDataStream = 0;
+   delete mFile; mFile = 0;
+
+   if (mStream)
+   {
+      result = ferror(mStream);
+      if (result)
+         mError = 28;
+
+      result = fclose(mStream);
+      mStream = 0;
+      mFd = -1;
+      if (result != 0) {
+         qWarning("KTempFile: Error trying to closing %s: %s", mTmpName.latin1(), strerror((*__errno_location ())));
+         mError = (*__errno_location ());
+      }
+   }
+
+
+   if (mFd >= 0)
+   {
+      result = ::close(mFd);
+      mFd = -1;
+      if (result != 0) {
+         qWarning("KTempFile: Error trying to closing %s: %s", mTmpName.latin1(), strerror((*__errno_location ())));
+         mError = (*__errno_location ());
+      }
+   }
+
+   bOpen = false;
+   return (mError == 0);
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C"
+
+int mkstemps(char *, int);
+extern "C"
+
+unsigned long strlcat(char*, const char*, unsigned long);
+
+
+
+
+
+
+extern "C"
+
+unsigned long strlcpy(char*, const char*, unsigned long);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (__const char *__assertion, __const char *__file,
+                           unsigned int __line, __const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, __const char *__file,
+                                  unsigned int __line,
+                                  __const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+
+
+
+
+
+
+class KUniqueApplicationPrivate;
+class KUniqueApplication : public KApplication, public DCOPObject
+{
+  public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+public:
+  KUniqueApplication( bool allowStyles=true,
+                      bool GUIenabled=true,
+                      bool configUnique=false);
+
+
+
+
+
+
+
+  static void addCmdLineOptions();
+  static bool start();
+
+
+
+
+  virtual ~KUniqueApplication();
+  bool process(const QCString &fun, const QByteArray &data,
+               QCString &replyType, QByteArray &replyData);
+  virtual int newInstance();
+
+private:
+
+
+
+  void delayRequest(const QCString &fun, const QByteArray &data);
+
+private :
+
+
+
+  void processDelayed();
+
+  void newInstanceNoFork();
+
+  static KInstance* initHack( bool configUnique );
+
+private:
+  static bool s_nofork;
+  static bool s_multipleInstances;
+  static bool s_uniqueTestDone;
+
+protected:
+  virtual void virtual_hook( int id, void* data );
+private:
+  KUniqueApplicationPrivate *d;
+};
+
+
+
+
+bool KUniqueApplication::s_nofork = false;
+bool KUniqueApplication::s_multipleInstances = false;
+bool KUniqueApplication::s_uniqueTestDone = false;
+
+static KCmdLineOptions kunique_options[] =
+{
+  { "nofork", "Don't run in the background.", 0 },
+  { 0, 0, 0 }
+};
+
+struct DCOPRequest {
+   QCString fun;
+   QByteArray data;
+   DCOPClientTransaction *transaction;
+};
+
+class KUniqueApplicationPrivate {
+public:
+   QPtrList <DCOPRequest> requestList;
+   bool processingRequest;
+   bool firstInstance;
+   QCString asn_id;
+};
+
+void
+KUniqueApplication::addCmdLineOptions()
+{
+  KCmdLineArgs::addCmdLineOptions(kunique_options, 0, "kuniqueapp", "kde" );
+}
+
+bool
+KUniqueApplication::start()
+{
+  if( s_uniqueTestDone )
+    return true;
+  s_uniqueTestDone = true;
+  addCmdLineOptions();
+  KCmdLineArgs *args = KCmdLineArgs::parsedArgs("kuniqueapp");
+  s_nofork = !args->isSet("fork");
+  delete args;
+
+  QCString appName = KCmdLineArgs::about->appName();
+
+  if (s_nofork)
+  {
+     if (s_multipleInstances)
+     {
+        QCString pid;
+        pid.setNum(getpid());
+        appName = appName + "-" + pid;
+     }
+     dcopClient()->registerAs(appName, false );
+
+     return true;
+  }
+  DCOPClient *dc;
+  int fd[2];
+  signed char result;
+  if (0 > pipe(fd))
+  {
+     kdError() << "KUniqueApplication: pipe() failed!" << endl;
+     ::exit(255);
+  }
+  int fork_result = fork();
+  switch(fork_result) {
+  case -1:
+     kdError() << "KUniqueApplication: fork() failed!" << endl;
+     ::exit(255);
+     break;
+  case 0:
+
+     ::close(fd[0]);
+     if (s_multipleInstances)
+        appName.append("-").append(QCString().setNum(getpid()));
+     dc = dcopClient();
+     {
+        QCString regName = dc->registerAs(appName, false);
+        if (regName.isEmpty())
+        {
+
+           if (QCString(getenv("DISPLAY")).isEmpty())
+           {
+              kdError() << "KUniqueApplication: Can't determine DISPLAY. Aborting." << endl;
+              result = -1;
+              ::write(fd[1], &result, 1);
+              ::exit(255);
+           }
+
+
+           startKdeinit();
+           regName = dc->registerAs(appName, false);
+           if (regName.isEmpty())
+           {
+              kdError() << "KUniqueApplication: Can't setup DCOP communication." << endl;
+              result = -1;
+              delete dc;
+              ::write(fd[1], &result, 1);
+              ::exit(255);
+           }
+        }
+        if (regName != appName)
+        {
+
+           result = 0;
+           delete dc;
+           ::write(fd[1], &result, 1);
+           ::close(fd[1]);
+
+
+
+           KStartupInfoId id;
+           if( KApplication::kApplication() != __null )
+               id.initId( KApplication::kApplication()->startupId());
+           else
+               id = KStartupInfo::currentStartupIdEnv();
+           if( !id.none())
+           {
+               Display* disp = XOpenDisplay( __null );
+               if( disp != __null )
+               {
+                   KStartupInfo::sendFinishX( disp, id );
+                   XCloseDisplay( disp );
+               }
+           }
+
+
+           return false;
+        }
+     }
+
+     {
+
+
+         KStartupInfoId id;
+         if( KApplication::kApplication() != __null )
+             id.initId( KApplication::kApplication()->startupId());
+         else
+             id = KStartupInfo::currentStartupIdEnv();
+         if( !id.none())
+         {
+            Display* disp = XOpenDisplay( __null );
+            if( disp != __null )
+               {
+               KStartupInfoData data;
+               data.addPid( getpid());
+               KStartupInfo::sendChangeX( disp, id, data );
+               XCloseDisplay( disp );
+               }
+         }
+
+
+     }
+     result = 0;
+     ::write(fd[1], &result, 1);
+     ::close(fd[1]);
+     return true;
+  default:
+
+
+
+     if (s_multipleInstances)
+        appName.append("-").append(QCString().setNum(fork_result));
+     ::close(fd[1]);
+     for(;;)
+     {
+       int n = ::read(fd[0], &result, 1);
+       if (n == 1) break;
+       if (n == 0)
+       {
+          kdError() << "KUniqueApplication: Pipe closed unexpectedly." << endl;
+          ::exit(255);
+       }
+       if ((*__errno_location ()) != 4)
+       {
+          kdError() << "KUniqueApplication: Error reading from pipe." << endl;
+          ::exit(255);
+       }
+     }
+     ::close(fd[0]);
+
+     if (result != 0)
+        ::exit(result);
+
+     dc = new DCOPClient();
+     if (!dc->attach())
+     {
+        kdError() << "KUniqueApplication: Parent process can't attach to DCOP." << endl;
+        delete dc;
+        ::exit(255);
+     }
+     if (!dc->isApplicationRegistered(appName)) {
+        kdError() << "KUniqueApplication: Registering failed!" << endl;
+     }
+
+     QCString new_asn_id;
+
+     KStartupInfoId id;
+     if( KApplication::kApplication() != __null )
+         id.initId( KApplication::kApplication()->startupId());
+     else
+         id = KStartupInfo::currentStartupIdEnv();
+     if( !id.none())
+         new_asn_id = id.id();
+
+
+     QByteArray data, reply;
+     QDataStream ds(data, 0x0002);
+
+     KCmdLineArgs::saveAppArgs(ds);
+     ds << new_asn_id;
+
+     QCString replyType;
+     if (!dc->call(appName, KCmdLineArgs::about->appName(), "newInstance()", data, replyType, reply))
+     {
+        kdError() << "Communication problem with " << KCmdLineArgs::about->appName() << ", it probably crashed." << endl;
+        delete dc;
+        ::exit(255);
+     }
+     if (replyType != "int")
+     {
+        kdError() << "KUniqueApplication: DCOP communication error!" << endl;
+        delete dc;
+        ::exit(255);
+     }
+     QDataStream rs(reply, 0x0001);
+     int exitCode;
+     rs >> exitCode;
+     delete dc;
+     ::exit(exitCode);
+     break;
+  }
+  return false;
+}
+
+
+KUniqueApplication::KUniqueApplication(bool allowStyles, bool GUIenabled, bool configUnique)
+  : KApplication( allowStyles, GUIenabled, initHack( configUnique )),
+    DCOPObject(KCmdLineArgs::about->appName())
+{
+  d = new KUniqueApplicationPrivate;
+  d->processingRequest = false;
+  d->firstInstance = true;
+
+  if (s_nofork)
+
+    QTimer::singleShot( 0, this, "1""newInstanceNoFork()" );
+}
+
+KUniqueApplication::~KUniqueApplication()
+{
+  delete d;
+}
+
+
+KInstance* KUniqueApplication::initHack( bool configUnique )
+{
+  KInstance* inst = new KInstance( KCmdLineArgs::about );
+  if (configUnique)
+  {
+    KConfigGroupSaver saver( inst->config(), "KDE" );
+    s_multipleInstances = inst->config()->readBoolEntry("MultipleInstances", false);
+  }
+  if( !start())
+
+      ::exit( 0 );
+  return inst;
+}
+
+void KUniqueApplication::newInstanceNoFork()
+{
+  if (dcopClient()->isSuspended())
+  {
+
+    QTimer::singleShot( 200, this, "1""newInstanceNoFork()" );
+    return;
+  }
+
+  newInstance();
+
+}
+
+bool KUniqueApplication::process(const QCString &fun, const QByteArray &data,
+                                 QCString &replyType, QByteArray &replyData)
+{
+  if (fun == "newInstance()")
+  {
+    delayRequest(fun, data);
+    return true;
+  } else
+    return DCOPObject::process(fun, data, replyType, replyData);
+}
+
+void
+KUniqueApplication::delayRequest(const QCString &fun, const QByteArray &data)
+{
+  DCOPRequest *request = new DCOPRequest;
+  request->fun = fun;
+  request->data = data;
+  request->transaction = dcopClient()->beginTransaction();
+  d->requestList.append(request);
+  if (!d->processingRequest)
+  {
+     QTimer::singleShot(0, this, "1""processDelayed()");
+  }
+}
+
+void
+KUniqueApplication::processDelayed()
+{
+  if (dcopClient()->isSuspended())
+  {
+
+    QTimer::singleShot( 200, this, "1""processDelayed()");
+    return;
+  }
+  d->processingRequest = true;
+  while( !d->requestList.isEmpty() )
+  {
+     DCOPRequest *request = d->requestList.take(0);
+     QByteArray replyData;
+     QCString replyType;
+     if (request->fun == "newInstance()") {
+       QDataStream ds(request->data, 0x0001);
+       KCmdLineArgs::loadAppArgs(ds);
+       if( !ds.atEnd())
+           ds >> d->asn_id;
+       int exitCode = newInstance();
+       d->asn_id = QCString();
+       QDataStream rs(replyData, 0x0002);
+       rs << exitCode;
+       replyType = "int";
+     }
+     dcopClient()->endTransaction( request->transaction, replyType, replyData);
+     delete request;
+  }
+
+  d->processingRequest = false;
+}
+
+
+
+extern Time qt_x_time;
+
+
+int KUniqueApplication::newInstance()
+{
+  if (!d->firstInstance)
+  {
+
+    if ( mainWidget() )
+    {
+      mainWidget()->show();
+
+      long activate = true;
+      if( !d->asn_id.isEmpty())
+      {
+          NETRootInfo i( qt_xdisplay(), NET::Supported );
+          if( i.isSupported( NET::WM2StartupId ))
+          {
+              KStartupInfo::setWindowStartupId( mainWidget()->winId(), d->asn_id );
+              activate = false;
+          }
+      }
+      if( activate )
+
+
+
+
+          KWin::setActiveWindow( mainWidget()->winId(), qt_x_time );
+
+    }
+  }
+  d->firstInstance = false;
+  return 0;
+}
+
+void KUniqueApplication::virtual_hook( int id, void* data )
+{ KApplication::virtual_hook( id, data );
+  DCOPObject::virtual_hook( id, data ); }
+
+const char *KUniqueApplication::className() const
+{
+    return "KUniqueApplication";
+}
+
+QMetaObject *KUniqueApplication::metaObj = 0;
+static QMetaObjectCleanUp cleanUp_KUniqueApplication( "KUniqueApplication", &KUniqueApplication::staticMetaObject );
+QMetaObject* KUniqueApplication::staticMetaObject()
+{
+    if ( metaObj )
+        return metaObj;
+    QMetaObject* parentObject = KApplication::staticMetaObject();
+    static const QUMethod slot_0 = {"processDelayed", 0, 0 };
+    static const QUMethod slot_1 = {"newInstanceNoFork", 0, 0 };
+    static const QMetaData slot_tbl[] = {
+        { "processDelayed()", &slot_0, QMetaData::Private },
+        { "newInstanceNoFork()", &slot_1, QMetaData::Private }
+    };
+    metaObj = QMetaObject::new_metaobject(
+        "KUniqueApplication", parentObject,
+        slot_tbl, 2,
+        0, 0,
+
+        0, 0,
+        0, 0,
+
+        0, 0 );
+    cleanUp_KUniqueApplication.setMetaObject( metaObj );
+    return metaObj;
+}
+
+void* KUniqueApplication::qt_cast( const char* clname )
+{
+    if ( !qstrcmp( clname, "KUniqueApplication" ) )
+        return this;
+    if ( !qstrcmp( clname, "DCOPObject" ) )
+        return (DCOPObject*)this;
+    return KApplication::qt_cast( clname );
+}
+
+bool KUniqueApplication::qt_invoke( int _id, QUObject* _o )
+{
+    switch ( _id - staticMetaObject()->slotOffset() ) {
+    case 0: processDelayed(); break;
+    case 1: newInstanceNoFork(); break;
+    default:
+        return KApplication::qt_invoke( _id, _o );
+    }
+    return TRUE;
+}
+
+bool KUniqueApplication::qt_emit( int _id, QUObject* _o )
+{
+    return KApplication::qt_emit(_id,_o);
+}
+
+
+bool KUniqueApplication::qt_property( int id, int f, QVariant* v)
+{
+    return KApplication::qt_property( id, f, v);
+}
+
+bool KUniqueApplication::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; }
+class QPopupMenu;
+
+class QMenuBar : public QFrame, public QMenuData
+{
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+   
+   
+   
+
+public:
+    QMenuBar( QWidget* parent=0, const char* name=0 );
+    ~QMenuBar();
+
+    void updateItem( int id );
+
+    void show();
+    void hide();
+
+    bool eventFilter( QObject *, QEvent * );
+
+    int heightForWidth(int) const;
+
+    enum Separator { Never=0, InWindowsStyle=1 };
+    Separator separator() const;
+    virtual void setSeparator( Separator when );
+
+    void setDefaultUp( bool );
+    bool isDefaultUp() const;
+
+    bool customWhatsThis() const;
+
+    QSize sizeHint() const;
+    QSize minimumSize() const;
+    QSize minimumSizeHint() const;
+
+    void activateItemAt( int index );
+
+
+
+
+
+
+protected:
+    void activated( int itemId );
+    void highlighted( int itemId );
+
+protected:
+    void drawContents( QPainter * );
+    void fontChange( const QFont & );
+    void mousePressEvent( QMouseEvent * );
+    void mouseReleaseEvent( QMouseEvent * );
+    void mouseMoveEvent( QMouseEvent * );
+    void keyPressEvent( QKeyEvent * );
+    void focusInEvent( QFocusEvent * );
+    void focusOutEvent( QFocusEvent * );
+    void resizeEvent( QResizeEvent * );
+    void leaveEvent( QEvent * );
+    void menuContentsChanged();
+    void menuStateChanged();
+    void styleChange( QStyle& );
+    int itemAtPos( const QPoint & );
+    void hidePopups();
+    QRect itemRect( int item );
+
+private :
+    void subActivated( int itemId );
+    void subHighlighted( int itemId );
+
+    void accelActivated( int itemId );
+    void accelDestroyed();
+
+    void popupDestroyed( QObject* );
+    void performDelayedChanges();
+
+    void languageChange();
+
+private:
+    void performDelayedContentsChanged();
+    void performDelayedStateChanged();
+    void menuInsPopup( QPopupMenu * );
+    void menuDelPopup( QPopupMenu * );
+    void frameChanged();
+
+    bool tryMouseEvent( QPopupMenu *, QMouseEvent * );
+    void tryKeyEvent( QPopupMenu *, QKeyEvent * );
+    void goodbye( bool cancelled = FALSE );
+    void openActPopup();
+
+    void setActiveItem( int index, bool show = TRUE, bool activate_first_item = TRUE );
+    void setAltMode( bool );
+
+    int calculateRects( int max_width = -1 );
+
+
+    void setupAccelerators();
+    QAccel *autoaccel;
+
+    QRect *irects;
+    int rightSide;
+
+    uint mseparator : 1;
+    uint waitforalt : 1;
+    uint popupvisible : 1;
+    uint hasmouse : 1;
+    uint defaultup : 1;
+    uint toggleclose : 1;
+    uint pendingDelayedContentsChanges : 1;
+    uint pendingDelayedStateChanges : 1;
+
+    friend class QPopupMenu;
+private:
+
+
+    QMenuBar( const QMenuBar & );
+    QMenuBar &operator=( const QMenuBar & );
+
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+class QDockWindowHandle;
+class QDockWindowTitleBar;
+class QPainter;
+class QDockWindowResizeHandle;
+class QBoxLayout;
+class QHBoxLayout;
+class QVBoxLayout;
+class QDockArea;
+class QWidgetResizeHandler;
+class QMainWindow;
+class QDockAreaLayout;
+class QDockWindowPrivate;
+class QToolBar;
+class QWindowsXPStyle;
+
+class QDockWindow : public QFrame
+{
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+
+    friend class QDockWindowHandle;
+    friend class QDockWindowTitleBar;
+    friend class QDockArea;
+    friend class QDockAreaLayout;
+    friend class QMainWindow;
+    friend class QToolBar;
+    friend class QWindowsXPStyle;
+
+public:
+    enum Place { InDock, OutsideDock };
+    enum CloseMode { Never = 0, Docked = 1, Undocked = 2, Always = Docked | Undocked };
+
+    QDockWindow( Place p = InDock, QWidget* parent=0, const char* name=0, WFlags f = 0 );
+    QDockWindow( QWidget* parent, const char* name=0, WFlags f = 0 );
+    ~QDockWindow();
+
+    virtual void setWidget( QWidget *w );
+    QWidget *widget() const;
+
+    Place place() const { return curPlace; }
+
+    QDockArea *area() const;
+
+    virtual void setCloseMode( int m );
+    bool isCloseEnabled() const;
+    int closeMode() const;
+
+    virtual void setResizeEnabled( bool b );
+    virtual void setMovingEnabled( bool b );
+    bool isResizeEnabled() const;
+    bool isMovingEnabled() const;
+
+    virtual void setHorizontallyStretchable( bool b );
+    virtual void setVerticallyStretchable( bool b );
+    bool isHorizontallyStretchable() const;
+    bool isVerticallyStretchable() const;
+    void setHorizontalStretchable( bool b ) { setHorizontallyStretchable( b ); }
+    void setVerticalStretchable( bool b ) { setVerticallyStretchable( b ); }
+    bool isHorizontalStretchable() const { return isHorizontallyStretchable(); }
+    bool isVerticalStretchable() const { return isVerticallyStretchable(); }
+    bool isStretchable() const;
+
+    virtual void setOffset( int o );
+    int offset() const;
+
+    virtual void setFixedExtentWidth( int w );
+    virtual void setFixedExtentHeight( int h );
+    QSize fixedExtent() const;
+
+    virtual void setNewLine( bool b );
+    bool newLine() const;
+
+    Qt::Orientation orientation() const;
+
+    QSize sizeHint() const;
+    QSize minimumSize() const;
+    QSize minimumSizeHint() const;
+
+    QBoxLayout *boxLayout();
+
+    virtual void setOpaqueMoving( bool b );
+    bool opaqueMoving() const;
+
+    bool eventFilter( QObject *o, QEvent *e );
+
+
+
+
+
+protected:
+    void orientationChanged( Orientation o );
+    void placeChanged( QDockWindow::Place p );
+    void visibilityChanged( bool );
+
+public :
+    virtual void undock( QWidget *w );
+    virtual void undock() { undock( 0 ); }
+    virtual void dock();
+    virtual void setOrientation( Orientation o );
+    void setCaption( const QString &s );
+
+protected:
+    void resizeEvent( QResizeEvent *e );
+    void showEvent( QShowEvent *e );
+    void hideEvent( QHideEvent *e );
+    void contextMenuEvent( QContextMenuEvent *e );
+
+    void drawFrame( QPainter * );
+    void drawContents( QPainter * );
+
+    bool event( QEvent *e );
+
+private :
+    void toggleVisible() { if ( !isVisible() ) show(); else hide(); }
+
+private:
+    QDockWindow( Place p, QWidget* parent, const char* name, WFlags f, bool toolbar );
+
+    void handleMove( const QPoint &pos, const QPoint &gp, bool drawRect );
+    void updateGui();
+    void updateSplitterVisibility( bool visible );
+
+    void startRectDraw( const QPoint &so, bool drawRect );
+    void endRectDraw( bool drawRect );
+    void updatePosition( const QPoint &globalPos );
+    QWidget *areaAt( const QPoint &gp );
+    void removeFromDock( bool fixNewLines = TRUE );
+    void swapRect( QRect &r, Qt::Orientation o, const QPoint &offset, QDockArea *area );
+    void init();
+
+private:
+    QDockWindowHandle *horHandle, *verHandle;
+    QDockWindowTitleBar *titleBar;
+    QWidget *wid;
+    QPainter *unclippedPainter;
+    QDockArea *dockArea, *tmpDockArea;
+    QRect currRect;
+    Place curPlace;
+    Place state;
+    bool resizeEnabled : 1;
+    bool moveEnabled : 1;
+    bool nl : 1;
+    bool opaque : 1;
+    bool isToolbar : 1;
+    bool stretchable[ 3 ];
+    Orientation startOrientation;
+    int cMode;
+    QPoint startOffset;
+    int offs;
+    QSize fExtent;
+    QDockWindowResizeHandle *hHandleTop, *hHandleBottom, *vHandleLeft, *vHandleRight;
+    QVBoxLayout *hbox;
+    QHBoxLayout *vbox;
+    QBoxLayout *childBox;
+    void *dockWindowData;
+    QPoint lastPos;
+    QSize lastSize;
+    QWidgetResizeHandler *widgetResizeHandler;
+    QDockWindowPrivate *d;
+
+private:
+
+    QDockWindow( const QDockWindow & );
+    QDockWindow& operator=( const QDockWindow & );
+
+};
+
+inline QDockArea *QDockWindow::area() const
+{
+    return dockArea;
+}
+
+
+
+
+
+class QMainWindow;
+class QButton;
+class QBoxLayout;
+class QToolBarPrivate;
+
+class QToolBar: public QDockWindow
+{
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+   
+
+public:
+    QToolBar( const QString &label,
+              QMainWindow *, ToolBarDock = DockTop,
+              bool newLine = FALSE, const char* name=0 );
+    QToolBar( const QString &label, QMainWindow *, QWidget *,
+              bool newLine = FALSE, const char* name=0, WFlags f = 0 );
+    QToolBar( QMainWindow* parent=0, const char* name=0 );
+    ~QToolBar();
+
+    void addSeparator();
+
+    void show();
+    void hide();
+
+    QMainWindow * mainWindow() const;
+
+    virtual void setStretchableWidget( QWidget * );
+
+    bool event( QEvent * e );
+
+    virtual void setLabel( const QString & );
+    QString label() const;
+
+    virtual void clear();
+
+    QSize minimumSize() const;
+    QSize minimumSizeHint() const;
+
+    void setOrientation( Orientation o );
+    void setMinimumSize( int minw, int minh );
+
+protected:
+    void resizeEvent( QResizeEvent *e );
+    void styleChange( QStyle & );
+
+private :
+    void createPopup();
+
+private:
+    void init();
+    void checkForExtension( const QSize &sz );
+    QToolBarPrivate * d;
+    QMainWindow * mw;
+    QWidget * sw;
+    QString l;
+
+    friend class QMainWindow;
+
+private:
+
+    QToolBar( const QToolBar & );
+    QToolBar& operator=( const QToolBar & );
+
+};
+
+
+
+
+
+
+class QMenuBar;
+class QStatusBar;
+class QToolTipGroup;
+class QMainWindowPrivate;
+class QMainWindowLayout;
+class QPopupMenu;
+
+class QMainWindow: public QWidget
+{
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+   
+   
+   
+   
+   
+
+public:
+    QMainWindow( QWidget* parent=0, const char* name=0, WFlags f = WType_TopLevel );
+    ~QMainWindow();
+
+
+    QMenuBar * menuBar() const;
+
+    QStatusBar * statusBar() const;
+
+    QToolTipGroup * toolTipGroup() const;
+
+
+    virtual void setCentralWidget( QWidget * );
+    QWidget * centralWidget() const;
+
+    virtual void setDockEnabled( Dock dock, bool enable );
+    bool isDockEnabled( Dock dock ) const;
+    bool isDockEnabled( QDockArea *area ) const;
+    virtual void setDockEnabled( QDockWindow *tb, Dock dock, bool enable );
+    bool isDockEnabled( QDockWindow *tb, Dock dock ) const;
+    bool isDockEnabled( QDockWindow *tb, QDockArea *area ) const;
+
+    virtual void addDockWindow( QDockWindow *, Dock = DockTop, bool newLine = FALSE );
+    virtual void addDockWindow( QDockWindow *, const QString &label,
+                                Dock = DockTop, bool newLine = FALSE );
+    virtual void moveDockWindow( QDockWindow *, Dock = DockTop );
+    virtual void moveDockWindow( QDockWindow *, Dock, bool nl, int index, int extraOffset = -1 );
+    virtual void removeDockWindow( QDockWindow * );
+
+    void show();
+    void hide();
+    QSize sizeHint() const;
+    QSize minimumSizeHint() const;
+
+    bool rightJustification() const;
+    bool usesBigPixmaps() const;
+    bool usesTextLabel() const;
+    bool dockWindowsMovable() const;
+    bool opaqueMoving() const;
+
+    bool eventFilter( QObject*, QEvent* );
+
+    bool getLocation( QDockWindow *tb, Dock &dock, int &index, bool &nl, int &extraOffset ) const;
+
+    QPtrList<QDockWindow> dockWindows( Dock dock ) const;
+    QPtrList<QDockWindow> dockWindows() const;
+    void lineUpDockWindows( bool keepNewLines = FALSE );
+
+    bool isDockMenuEnabled() const;
+
+
+    bool hasDockWindow( QDockWindow *dw );
+
+    void addToolBar( QDockWindow *, Dock = DockTop, bool newLine = FALSE );
+    void addToolBar( QDockWindow *, const QString &label,
+                     Dock = DockTop, bool newLine = FALSE );
+    void moveToolBar( QDockWindow *, Dock = DockTop );
+    void moveToolBar( QDockWindow *, Dock, bool nl, int index, int extraOffset = -1 );
+    void removeToolBar( QDockWindow * );
+
+    bool toolBarsMovable() const;
+    QPtrList<QToolBar> toolBars( Dock dock ) const;
+    void lineUpToolBars( bool keepNewLines = FALSE );
+
+
+    virtual QDockArea *dockingArea( const QPoint &p );
+    QDockArea *leftDock() const;
+    QDockArea *rightDock() const;
+    QDockArea *topDock() const;
+    QDockArea *bottomDock() const;
+
+    virtual bool isCustomizable() const;
+
+    bool appropriate( QDockWindow *dw ) const;
+
+    enum DockWindows { OnlyToolBars, NoToolBars, AllDockWindows };
+    QPopupMenu *createDockWindowMenu( DockWindows dockWindows = AllDockWindows ) const;
+
+public :
+    virtual void setRightJustification( bool );
+    virtual void setUsesBigPixmaps( bool );
+    virtual void setUsesTextLabel( bool );
+    virtual void setDockWindowsMovable( bool );
+    virtual void setOpaqueMoving( bool );
+    virtual void setDockMenuEnabled( bool );
+    virtual void whatsThis();
+    virtual void setAppropriate( QDockWindow *dw, bool a );
+    virtual void customize();
+
+
+    void setToolBarsMovable( bool );
+
+protected:
+    void pixmapSizeChanged( bool );
+    void usesTextLabelChanged( bool );
+    void dockWindowPositionChanged( QDockWindow * );
+
+
+
+    void toolBarPositionChanged( QToolBar * );
+
+
+protected :
+    virtual void setUpLayout();
+    virtual bool showDockMenu( const QPoint &globalPos );
+    void menuAboutToShow();
+
+protected:
+    void paintEvent( QPaintEvent * );
+    void childEvent( QChildEvent * );
+    bool event( QEvent * );
+    void styleChange( QStyle& );
+
+private :
+    void slotPlaceChanged();
+    void doLineUp() { lineUpDockWindows( TRUE ); }
+
+private:
+    QMainWindowPrivate * d;
+    void triggerLayout( bool deleteLayout = TRUE);
+    bool dockMainWindow( QObject *dock );
+
+
+    virtual void setMenuBar( QMenuBar * );
+
+    virtual void setStatusBar( QStatusBar * );
+
+    virtual void setToolTipGroup( QToolTipGroup * );
+
+
+    friend class QDockWindow;
+    friend class QMenuBar;
+    friend class QHideDock;
+    friend class QToolBar;
+    friend class QMainWindowLayout;
+private:
+
+    QMainWindow( const QMainWindow & );
+    QMainWindow& operator=( const QMainWindow & );
+
+};
+
+
+inline void QMainWindow::addToolBar( QDockWindow *w, ToolBarDock dock, bool newLine )
+{
+    addDockWindow( w, dock, newLine );
+}
+
+inline void QMainWindow::addToolBar( QDockWindow *w, const QString &label,
+                              ToolBarDock dock, bool newLine )
+{
+    addDockWindow( w, label, dock, newLine );
+}
+
+inline void QMainWindow::moveToolBar( QDockWindow *w, ToolBarDock dock )
+{
+    moveDockWindow( w, dock );
+}
+
+inline void QMainWindow::moveToolBar( QDockWindow *w, ToolBarDock dock, bool nl, int index, int extraOffset )
+{
+    moveDockWindow( w, dock, nl, index, extraOffset );
+}
+
+inline void QMainWindow::removeToolBar( QDockWindow *w )
+{
+    removeDockWindow( w );
+}
+
+inline bool QMainWindow::toolBarsMovable() const
+{
+    return dockWindowsMovable();
+}
+
+inline void QMainWindow::lineUpToolBars( bool keepNewLines )
+{
+    lineUpDockWindows( keepNewLines );
+}
+
+inline void QMainWindow::setToolBarsMovable( bool b )
+{
+    setDockWindowsMovable( b );
+}
+
+
+
+ QTextStream &operator<<( QTextStream &, const QMainWindow & );
+ QTextStream &operator>>( QTextStream &, QMainWindow & );
+class QTabBar;
+class QIconSet;
+
+class QTab : public Qt
+{
+    friend class QTabBar;
+    friend class QTabWidget;
+
+public:
+    QTab();
+    virtual ~QTab();
+    QTab( const QString& text );
+    QTab( const QIconSet& icon, const QString& text = QString::null );
+
+    void setText( const QString& text);
+    QString text() const { return label; }
+    void setIconSet( const QIconSet& icon );
+    QIconSet* iconSet() const { return iconset; }
+    void setRect( const QRect& rect ) { r = rect; }
+    QRect rect() const { return r; }
+    void setEnabled( bool enable ) { enabled = enable; }
+    bool isEnabled() const { return enabled; }
+    void setIdentifier( int i ) { id = i; }
+    int identifier() const { return id; }
+
+private:
+    void setTabBar( QTabBar *tb );
+    QString label;
+    QRect r;
+    bool enabled;
+    int id;
+    QIconSet* iconset;
+    QTabBar *tb;
+};
+
+
+struct QTabPrivate;
+
+
+class QTabBar: public QWidget
+{
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+   
+   
+   
+   
+   
+
+public:
+    QTabBar( QWidget* parent=0, const char* name=0 );
+    ~QTabBar();
+
+    enum Shape { RoundedAbove, RoundedBelow,
+                 TriangularAbove, TriangularBelow };
+
+    Shape shape() const;
+    virtual void setShape( Shape );
+
+    void show();
+
+    virtual int addTab( QTab * );
+    virtual int insertTab( QTab *, int index = -1 );
+    virtual void removeTab( QTab * );
+
+    virtual void setTabEnabled( int, bool );
+    bool isTabEnabled( int ) const;
+
+
+    QSize sizeHint() const;
+    QSize minimumSizeHint() const;
+
+    int currentTab() const;
+    int keyboardFocusTab() const;
+
+    QTab * tab( int ) const;
+    QTab * tabAt( int ) const;
+    int indexOf( int ) const;
+    int count() const;
+
+    virtual void layoutTabs();
+    virtual QTab * selectTab( const QPoint & p ) const;
+
+    void removeToolTip( int index );
+    void setToolTip( int index, const QString & tip );
+    QString toolTip( int index ) const;
+
+public :
+    virtual void setCurrentTab( int );
+    virtual void setCurrentTab( QTab * );
+
+protected:
+    void selected( int );
+    void layoutChanged();
+
+protected:
+    virtual void paint( QPainter *, QTab *, bool ) const;
+    virtual void paintLabel( QPainter*, const QRect&, QTab*, bool ) const;
+
+    void focusInEvent( QFocusEvent *e );
+    void focusOutEvent( QFocusEvent *e );
+
+    void resizeEvent( QResizeEvent * );
+    void paintEvent( QPaintEvent * );
+    void mousePressEvent ( QMouseEvent * );
+    void mouseMoveEvent ( QMouseEvent * );
+    void mouseReleaseEvent ( QMouseEvent * );
+    void keyPressEvent( QKeyEvent * );
+    void styleChange( QStyle& );
+    void fontChange ( const QFont & );
+
+    bool event( QEvent *e );
+
+    QPtrList<QTab> * tabList();
+
+private :
+    void scrollTabs();
+
+private:
+    QPtrList<QTab> * l;
+    QPtrList<QTab> * lstatic;
+    void makeVisible( QTab* t = 0 );
+    void updateArrowButtons();
+    QTabPrivate * d;
+
+    friend class QTabBarToolTip;
+    friend class QTab;
+
+private:
+
+    QTabBar( const QTabBar & );
+    QTabBar& operator=( const QTabBar & );
+
+};
+class QWidgetStackPrivate;
+
+
+class QWidgetStack: public QFrame
+{
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+public:
+    QWidgetStack( QWidget* parent=0, const char* name=0 );
+    QWidgetStack( QWidget* parent, const char* name, WFlags f);
+
+    ~QWidgetStack();
+
+    int addWidget( QWidget *, int = -1 );
+    void removeWidget( QWidget * );
+
+    QSize sizeHint() const;
+    QSize minimumSizeHint() const;
+    void show();
+
+    QWidget * widget( int ) const;
+    int id( QWidget * ) const;
+
+    QWidget * visibleWidget() const;
+
+    void setFrameRect( const QRect & );
+
+protected:
+    void aboutToShow( int );
+    void aboutToShow( QWidget * );
+
+public :
+    void raiseWidget( int );
+    void raiseWidget( QWidget * );
+
+protected:
+    void frameChanged();
+    void resizeEvent( QResizeEvent * );
+
+    virtual void setChildGeometries();
+    void childEvent( QChildEvent * );
+
+private:
+    void init();
+
+    QWidgetStackPrivate * d;
+    QIntDict<QWidget> * dict;
+    QPtrDict<QWidget> * focusWidgets;
+    QWidget * topWidget;
+    QWidget * invisible;
+
+private:
+
+    QWidgetStack( const QWidgetStack & );
+    QWidgetStack& operator=( const QWidgetStack & );
+
+};
+
+
+
+
+class QObject;
+class KAction;
+class KActionCollection;
+class KRecentFilesAction;
+class KToggleAction;
+class KToggleToolBarAction;
+namespace KStdAction
+{
+
+
+
+        enum StdAction {
+                ActionNone,
+
+
+                New, Open, OpenRecent, Save, SaveAs, Revert, Close,
+                Print, PrintPreview, Mail, Quit,
+
+
+                Undo, Redo, Cut, Copy, Paste, SelectAll, Deselect, Find, FindNext, FindPrev,
+                Replace,
+
+
+                ActualSize, FitToPage, FitToWidth, FitToHeight, ZoomIn, ZoomOut,
+                Zoom, Redisplay,
+
+
+                Up, Back, Forward, Home, Prior, Next, Goto, GotoPage, GotoLine,
+                FirstPage, LastPage,
+
+
+                AddBookmark, EditBookmarks,
+
+
+                Spelling,
+
+
+                ShowMenubar, ShowToolbar, ShowStatusbar,
+                SaveOptions, KeyBindings,
+                Preferences, ConfigureToolbars,
+
+
+                Help, HelpContents, WhatsThis, ReportBug, AboutApp, AboutKDE,
+                TipofDay,
+
+
+                ConfigureNotifications,
+                FullScreen,
+                Clear
+        };
+
+
+
+
+
+        KAction* create( StdAction id, const char *name,
+                const QObject *recvr, const char *slot,
+                KActionCollection* parent );
+
+        inline KAction* create( StdAction id,
+                const QObject *recvr, const char *slot,
+                KActionCollection* parent )
+                { return KStdAction::create( id, 0, recvr, slot, parent ); }
+
+
+
+
+
+        inline KAction *action(StdAction act_enum,
+                const QObject *recvr, const char *slot,
+                KActionCollection *parent, const char *name = 0L )
+                { return KStdAction::create( act_enum, name, recvr, slot, parent ); }
+
+
+
+
+        const char* name( StdAction id );
+
+
+        inline const char* stdName(StdAction act_enum) { return name( act_enum ); }
+
+
+
+
+
+
+        QStringList stdNames();
+
+
+
+
+        KAction *openNew(const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 );
+
+
+
+
+        KAction *open(const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 );
+
+
+
+
+
+
+        KRecentFilesAction *openRecent(const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 );
+
+
+
+
+        KAction *save(const QObject *recvr, const char *slot,
+                KActionCollection* parent, const char *name = 0 );
+
+
+
+
+        KAction *saveAs(const QObject *recvr, const char *slot,
+                KActionCollection* parent, const char *name = 0 );
+
+
+
+
+
+        KAction *revert(const QObject *recvr, const char *slot,
+                KActionCollection* parent, const char *name = 0 );
+
+
+
+
+        KAction *close(const QObject *recvr, const char *slot,
+                KActionCollection* parent, const char *name = 0 );
+
+
+
+
+        KAction *print(const QObject *recvr, const char *slot,
+                KActionCollection* parent, const char *name = 0 );
+
+
+
+
+        KAction *printPreview(const QObject *recvr, const char *slot,
+                KActionCollection* parent, const char *name = 0 );
+
+
+
+
+        KAction *mail(const QObject *recvr, const char *slot,
+                KActionCollection* parent, const char *name = 0 );
+
+
+
+
+        KAction *quit(const QObject *recvr, const char *slot,
+                KActionCollection* parent, const char *name = 0 );
+
+
+
+
+        KAction *undo(const QObject *recvr, const char *slot,
+                KActionCollection* parent, const char *name = 0 );
+
+
+
+
+        KAction *redo(const QObject *recvr, const char *slot,
+                KActionCollection* parent, const char *name = 0 );
+
+
+
+
+        KAction *cut(const QObject *recvr, const char *slot,
+                KActionCollection* parent, const char *name = 0 );
+
+
+
+
+        KAction *copy(const QObject *recvr, const char *slot,
+                KActionCollection* parent, const char *name = 0 );
+
+
+
+
+
+        KAction *paste(const QObject *recvr, const char *slot,
+                KActionCollection* parent, const char *name = 0 );
+
+
+
+
+
+        KAction *clear(const QObject *recvr, const char *slot,
+                KActionCollection* parent, const char *name = 0 );
+
+
+
+
+        KAction *selectAll(const QObject *recvr, const char *slot,
+                KActionCollection* parent, const char *name = 0 );
+
+
+
+
+        KAction *deselect(const QObject *recvr, const char *slot,
+                KActionCollection* parent, const char *name = 0 );
+
+
+
+
+        KAction *find(const QObject *recvr, const char *slot,
+                KActionCollection* parent, const char *name = 0 );
+
+
+
+
+        KAction *findNext(const QObject *recvr, const char *slot,
+                KActionCollection* parent, const char *name = 0 );
+
+
+
+
+        KAction *findPrev(const QObject *recvr, const char *slot,
+                KActionCollection* parent, const char *name = 0 );
+
+
+
+
+        KAction *replace(const QObject *recvr, const char *slot,
+                KActionCollection* parent, const char *name = 0 );
+
+
+
+
+        KAction *actualSize(const QObject *recvr, const char *slot,
+                KActionCollection* parent, const char *name = 0 );
+
+
+
+
+        KAction *fitToPage(const QObject *recvr, const char *slot,
+                KActionCollection* parent, const char *name = 0 );
+
+
+
+
+        KAction *fitToWidth(const QObject *recvr, const char *slot,
+                KActionCollection* parent, const char *name = 0 );
+
+
+
+
+        KAction *fitToHeight(const QObject *recvr, const char *slot,
+                                        KActionCollection* parent, const char *name = 0 );
+
+
+
+
+        KAction *zoomIn(const QObject *recvr, const char *slot,
+                                KActionCollection* parent, const char *name = 0 );
+
+
+
+
+        KAction *zoomOut(const QObject *recvr, const char *slot,
+                                KActionCollection* parent, const char *name = 0 );
+
+
+
+
+        KAction *zoom(const QObject *recvr, const char *slot,
+                                KActionCollection* parent, const char *name = 0 );
+
+
+
+
+        KAction *redisplay(const QObject *recvr, const char *slot,
+                                KActionCollection* parent, const char *name = 0 );
+
+
+
+
+        KAction *up(const QObject *recvr, const char *slot,
+                        KActionCollection* parent, const char *name = 0 );
+
+
+
+
+        KAction *back(const QObject *recvr, const char *slot,
+                                KActionCollection* parent, const char *name = 0 );
+
+
+
+
+        KAction *forward(const QObject *recvr, const char *slot,
+                                KActionCollection* parent, const char *name = 0 );
+
+
+
+
+        KAction *home(const QObject *recvr, const char *slot,
+                                KActionCollection* parent, const char *name = 0 );
+
+
+
+
+        KAction *prior(const QObject *recvr, const char *slot,
+                                KActionCollection* parent, const char *name = 0 );
+
+
+
+
+        KAction *next(const QObject *recvr, const char *slot,
+                                KActionCollection* parent, const char *name = 0 );
+
+
+
+
+        KAction *goTo(const QObject *recvr, const char *slot,
+                                KActionCollection* parent, const char *name = 0 );
+
+
+
+
+
+        KAction *gotoPage(const QObject *recvr, const char *slot,
+                                KActionCollection* parent, const char *name = 0 );
+
+
+
+
+        KAction *gotoLine(const QObject *recvr, const char *slot,
+                                KActionCollection* parent, const char *name = 0 );
+
+
+
+
+        KAction *firstPage(const QObject *recvr, const char *slot,
+                                KActionCollection* parent, const char *name = 0 );
+
+
+
+
+        KAction *lastPage(const QObject *recvr, const char *slot,
+                                KActionCollection* parent, const char *name = 0 );
+
+
+
+
+        KAction *addBookmark(const QObject *recvr, const char *slot,
+                                        KActionCollection* parent, const char *name = 0 );
+
+
+
+
+        KAction *editBookmarks(const QObject *recvr, const char *slot,
+                                        KActionCollection* parent, const char *name = 0 );
+
+
+
+
+        KAction *spelling(const QObject *recvr, const char *slot,
+                                        KActionCollection* parent, const char *name = 0 );
+
+
+
+
+
+        KToggleAction *showMenubar(const QObject *recvr, const char *slot,
+                                        KActionCollection* parent, const char *name = 0 );
+        KToggleAction *showToolbar(const QObject *recvr, const char *slot,
+                                        KActionCollection* parent, const char *name = 0 );
+
+
+
+
+
+
+        KToggleToolBarAction *showToolbar(const char* toolBarName,
+                                        KActionCollection* parent, const char *name = 0 );
+
+
+
+
+        KToggleAction *showStatusbar(const QObject *recvr, const char *slot,
+                                        KActionCollection* parent, const char *name = 0 );
+
+
+
+
+
+        KToggleAction *fullScreen(const QObject *recvr, const char *slot,
+                                        KActionCollection* parent, const char *name = 0 );
+
+
+
+
+        KAction *saveOptions(const QObject *recvr, const char *slot,
+                                        KActionCollection* parent, const char *name = 0 );
+
+
+
+
+        KAction *keyBindings(const QObject *recvr, const char *slot,
+                                        KActionCollection* parent, const char *name = 0 );
+
+
+
+
+        KAction *preferences(const QObject *recvr, const char *slot,
+                                        KActionCollection* parent, const char *name = 0 );
+
+
+
+
+        KAction *configureToolbars(const QObject *recvr,
+                                        const char *slot,
+                                        KActionCollection* parent,
+                                        const char *name = 0 );
+
+
+
+
+
+        KAction *configureNotifications(const QObject *recvr,
+                                        const char *slot,
+                                        KActionCollection *parent,
+                                        const char *name = 0);
+
+
+
+
+        KAction *help(const QObject *recvr, const char *slot,
+                                KActionCollection* parent, const char *name = 0 );
+
+
+
+
+        KAction *helpContents(const QObject *recvr, const char *slot,
+                                        KActionCollection* parent, const char *name = 0 );
+
+
+
+
+        KAction *whatsThis(const QObject *recvr, const char *slot,
+                                KActionCollection* parent, const char *name = 0 );
+
+
+
+
+
+        KAction *tipOfDay(const QObject *recvr, const char *slot,
+                                KActionCollection* parent, const char *name = 0 );
+
+
+
+
+        KAction *reportBug(const QObject *recvr, const char *slot,
+                                KActionCollection* parent, const char *name = 0 );
+
+
+
+
+        KAction *aboutApp(const QObject *recvr, const char *slot,
+                                KActionCollection* parent, const char *name = 0 );
+
+
+
+
+        KAction *aboutKDE(const QObject *recvr, const char *slot,
+                                KActionCollection* parent, const char *name = 0 );
+}
+
+
+
+
+class KAccelString
+{
+public:
+
+  KAccelString() : m_pureText(), m_accel(-1) {};
+  KAccelString(const QString &input, int initalWeight=-1);
+
+  void calculateWeights(int initialWeight);
+
+  const QString &pure() const { return m_pureText; };
+  QString accelerated() const;
+
+  int accel() const { return m_accel; };
+  void setAccel(int accel) { m_accel = accel; };
+
+  int originalAccel() const { return m_orig_accel; }
+  QString originalText() const { return m_origText; }
+
+  QChar accelerator() const;
+
+  int maxWeight(int &index, const QString &used);
+
+  bool operator == (const KAccelString &c) const { return m_pureText == c.m_pureText && m_accel == c.m_accel && m_orig_accel == c.m_orig_accel; }
+
+
+private:
+
+  int stripAccelerator(QString &input);
+
+  void dump();
+
+  QString m_pureText, m_origText;
+  int m_accel, m_orig_accel;
+  QMemArray<int> m_weight;
+
+};
+
+
+typedef QValueList<KAccelString> KAccelStringList;
+class KAccelManagerAlgorithm
+{
+public:
+
+  static const int DEFAULT_WEIGHT;
+
+  static const int FIRST_CHARACTER_EXTRA_WEIGHT;
+  static const int WORD_BEGINNING_EXTRA_WEIGHT;
+  static const int WANTED_ACCEL_EXTRA_WEIGHT;
+  static const int DIALOG_BUTTON_EXTRA_WEIGHT;
+  static const int STANDARD_ACCEL;
+
+  static const int ACTION_ELEMENT_WEIGHT;
+  static const int GROUP_BOX_WEIGHT;
+  static const int MENU_TITLE_WEIGHT;
+
+  static void findAccelerators(KAccelStringList &result, QString &used);
+
+};
+
+
+class QPopupMenu;
+class KPopupAccelManager : public QObject
+{
+  public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+
+public:
+
+  static void manage(QPopupMenu *popup);
+
+
+protected:
+
+  KPopupAccelManager(QPopupMenu *popup);
+
+
+private :
+
+  void aboutToShow();
+
+
+private:
+
+  void calculateAccelerators();
+
+  void findMenuEntries(KAccelStringList &list);
+  void setMenuEntries(const KAccelStringList &list);
+
+  QPopupMenu *m_popup;
+  KAccelStringList m_entries;
+  int m_count;
+
+};
+
+
+
+
+
+namespace KStdAction
+{
+
+struct KStdActionInfo
+{
+        StdAction id;
+        KStdAccel::StdAccel idAccel;
+        const char* psName;
+        const char* psLabel;
+        const char* psWhatsThis;
+        const char* psIconName;
+};
+
+static const KStdActionInfo g_rgActionInfo[] =
+{
+        { New, KStdAccel::New, "file_new", ("&New"), 0, "filenew" },
+        { Open, KStdAccel::Open, "file_open", ("&Open..."), 0, "fileopen" },
+        { OpenRecent, KStdAccel::AccelNone, "file_open_recent", ("Open &Recent"), 0, 0 },
+        { Save, KStdAccel::Save, "file_save", ("&Save"), 0, "filesave" },
+        { SaveAs, KStdAccel::AccelNone, "file_save_as", ("Save &As..."), 0, "filesaveas" },
+        { Revert, KStdAccel::AccelNone, "file_revert", ("Re&vert"), 0, "revert" },
+        { Close, KStdAccel::Close, "file_close", ("&Close"), 0, "fileclose" },
+        { Print, KStdAccel::Print, "file_print", ("&Print..."), 0, "fileprint" },
+        { PrintPreview, KStdAccel::AccelNone, "file_print_preview", ("Print Previe&w..."), 0, "filequickprint" },
+        { Mail, KStdAccel::AccelNone, "file_mail", ("&Mail..."), 0, "mail_send" },
+        { Quit, KStdAccel::Quit, "file_quit", ("&Quit"), 0, "exit" },
+
+        { Undo, KStdAccel::Undo, "edit_undo", ("&Undo"), 0, "undo" },
+        { Redo, KStdAccel::Redo, "edit_redo", ("Re&do"), 0, "redo" },
+        { Cut, KStdAccel::Cut, "edit_cut", ("Cu&t"), 0, "editcut" },
+        { Copy, KStdAccel::Copy, "edit_copy", ("&Copy"), 0, "editcopy" },
+        { Paste, KStdAccel::Paste, "edit_paste", ("&Paste"), 0, "editpaste" },
+        { Clear, KStdAccel::AccelNone, "edit_clear", ("C&lear"), 0, "editclear" },
+        { SelectAll, KStdAccel::SelectAll, "edit_select_all", ("Select &All"), 0, 0 },
+        { Deselect, KStdAccel::Deselect, "edit_deselect", ("Dese&lect"), 0, 0 },
+        { Find, KStdAccel::Find, "edit_find", ("&Find..."), 0, "find" },
+        { FindNext, KStdAccel::FindNext, "edit_find_next", ("Find &Next"), 0, "next" },
+
+        { FindPrev, KStdAccel::FindPrev, "edit_find_last", ("Find Pre&vious"), 0, "previous" },
+        { Replace, KStdAccel::Replace, "edit_replace", ("&Replace..."), 0, 0 },
+
+        { ActualSize, KStdAccel::AccelNone, "view_actual_size", ("&Actual Size"), 0, 0 },
+        { FitToPage, KStdAccel::AccelNone, "view_fit_to_page", ("&Fit to Page"), 0, 0 },
+        { FitToWidth, KStdAccel::AccelNone, "view_fit_to_width", ("Fit to Page &Width"), 0, 0 },
+        { FitToHeight, KStdAccel::AccelNone, "view_fit_to_height", ("Fit to Page &Height"), 0, 0 },
+        { ZoomIn, KStdAccel::ZoomIn, "view_zoom_in", ("Zoom &In"), 0, "viewmag+" },
+        { ZoomOut, KStdAccel::ZoomOut, "view_zoom_out", ("Zoom &Out"), 0, "viewmag-" },
+        { Zoom, KStdAccel::AccelNone, "view_zoom", ("&Zoom..."), 0, "viewmag" },
+        { Redisplay, KStdAccel::AccelNone, "view_redisplay", ("&Redisplay"), 0, "reload" },
+
+        { Up, KStdAccel::Up, "go_up", ("&Up"), 0, "up" },
+
+        { Back, KStdAccel::Back, "go_back", 0, 0, "back" },
+        { Forward, KStdAccel::Forward, "go_forward", 0, 0, "forward" },
+        { Home, KStdAccel::Home, "go_home", 0, 0, "gohome" },
+        { Prior, KStdAccel::Prior, "go_previous", ("&Previous Page"), 0, "previous" },
+        { Next, KStdAccel::Next, "go_next", ("&Next Page"), 0, "next" },
+        { Goto, KStdAccel::AccelNone, "go_goto", ("&Go To..."), 0, 0 },
+        { GotoPage, KStdAccel::AccelNone, "go_goto_page", ("&Go to Page..."), 0, "goto" },
+        { GotoLine, KStdAccel::GotoLine, "go_goto_line", ("&Go to Line..."), 0, 0 },
+        { FirstPage, KStdAccel::Home, "go_first", ("&First Page"), 0, "top" },
+        { LastPage, KStdAccel::End, "go_last", ("&Last Page"), 0, "bottom" },
+
+        { AddBookmark, KStdAccel::AddBookmark, "bookmark_add", ("&Add Bookmark"), 0, "bookmark_add" },
+        { EditBookmarks, KStdAccel::AccelNone, "bookmark_edit", ("&Edit Bookmarks"), 0, "bookmark" },
+
+        { Spelling, KStdAccel::AccelNone, "tools_spelling", ("&Spelling..."), 0, "spellcheck" },
+
+        { ShowMenubar, KStdAccel::ShowMenubar, "options_show_menubar", ("Show &Menubar"), 0, "showmenu" },
+        { ShowToolbar, KStdAccel::AccelNone, "options_show_toolbar", ("Show &Toolbar"), 0, 0 },
+        { ShowStatusbar, KStdAccel::AccelNone, "options_show_statusbar", ("Show St&atusbar"), 0, 0 },
+        { FullScreen, KStdAccel::FullScreen, "fullscreen", ("F&ull Screen Mode"), 0, "window_fullscreen" },
+        { SaveOptions, KStdAccel::AccelNone, "options_save_options", ("&Save Settings"), 0, 0 },
+        { KeyBindings, KStdAccel::AccelNone, "options_configure_keybinding", ("Configure S&hortcuts..."), 0,"configure_shortcuts" },
+        { Preferences, KStdAccel::AccelNone, "options_configure", ("&Configure %1..."), 0, "configure" },
+        { ConfigureToolbars, KStdAccel::AccelNone, "options_configure_toolbars", ("Configure Tool&bars..."), 0,"configure_toolbars" },
+        { ConfigureNotifications, KStdAccel::AccelNone, "options_configure_notifications", ("Configure &Notifications..."), 0, "knotify" },
+
+        { Help, KStdAccel::Help, "help", 0, 0, "help" },
+        { HelpContents, KStdAccel::AccelNone, "help_contents", ("%1 &Handbook"), 0, "contents" },
+        { WhatsThis, KStdAccel::WhatsThis, "help_whats_this", ("What's &This?"), 0, "contexthelp" },
+        { TipofDay, KStdAccel::AccelNone, "help_show_tip", ("Tip of the &Day"), 0, "idea" },
+        { ReportBug, KStdAccel::AccelNone, "help_report_bug", ("&Report Bug..."), 0, 0 },
+        { AboutApp, KStdAccel::AccelNone, "help_about_app", ("&About %1"), 0, 0 },
+        { AboutKDE, KStdAccel::AccelNone, "help_about_kde", ("About &KDE"), 0,"about_kde" },
+        { ActionNone, KStdAccel::AccelNone, 0, 0, 0, 0 }
+};
+
+inline const KStdActionInfo* infoPtr( StdAction id )
+{
+        for( uint i = 0; g_rgActionInfo[i].id != ActionNone; i++ ) {
+                if( g_rgActionInfo[i].id == id )
+                        return &g_rgActionInfo[i];
+        }
+        return 0;
+}
+
+static inline QStringList internal_stdNames()
+{
+    QStringList result;
+
+    for( uint i = 0; g_rgActionInfo[i].id != ActionNone; i++ )
+        if (g_rgActionInfo[i].psLabel)
+            result.append(i18n(g_rgActionInfo[i].psLabel));
+    return result;
+}
+
+}
+
+
+
+class QWidget;
+class QString;
+class KAcceleratorManager
+{
+public:
+  static void manage(QWidget *widget);
+  static void manage(QWidget *widget, bool programmers_mode);
+
+
+    static void last_manage(QString &added, QString &changed, QString &removed);
+};
+
+
+const int KAccelManagerAlgorithm::DEFAULT_WEIGHT = 50;
+
+const int KAccelManagerAlgorithm::FIRST_CHARACTER_EXTRA_WEIGHT = 50;
+
+const int KAccelManagerAlgorithm::WORD_BEGINNING_EXTRA_WEIGHT = 50;
+
+const int KAccelManagerAlgorithm::DIALOG_BUTTON_EXTRA_WEIGHT = 300;
+
+const int KAccelManagerAlgorithm::WANTED_ACCEL_EXTRA_WEIGHT = 150;
+
+const int KAccelManagerAlgorithm::ACTION_ELEMENT_WEIGHT = 50;
+
+const int KAccelManagerAlgorithm::GROUP_BOX_WEIGHT = 0;
+
+const int KAccelManagerAlgorithm::MENU_TITLE_WEIGHT = 250;
+
+const int KAccelManagerAlgorithm::STANDARD_ACCEL = 300;
+class KAcceleratorManagerPrivate
+{
+public:
+
+    static void manage(QWidget *widget);
+    static bool programmers_mode;
+    static bool standardName(const QString &str);
+
+    static bool checkChange(const KAccelString &as) {
+        QString t2 = as.accelerated();
+        QString t1 = as.originalText();
+        if (t1 != t2)
+        {
+            if (as.accel() == -1) {
+                removed_string += "<tr><td>" + t1 + "</td></tr>";
+            } else if (as.originalAccel() == -1) {
+                added_string += "<tr><td>" + t2 + "</td></tr>";
+            } else {
+                changed_string += "<tr><td>" + t1 + "</td>";
+                changed_string += "<td>" + t2 + "</td></tr>";
+            }
+            return true;
+        }
+        return false;
+    }
+    static QString changed_string;
+    static QString added_string;
+    static QString removed_string;
+
+private:
+  class Item;
+  typedef QPtrList<Item> ItemList;
+
+
+  static void traverseChildren(QWidget *widget, Item *item);
+
+  static void manageMenuBar(QMenuBar *mbar, Item *item);
+  static void manageTabBar(QTabBar *bar, Item *item);
+
+  static void calculateAccelerators(Item *item, QString &used);
+
+  class Item
+  {
+  public:
+
+    Item() : m_widget(0), m_children(0), m_index(-1) {};
+    ~Item();
+
+    void addChild(Item *item);
+
+    QWidget *m_widget;
+    KAccelString m_content;
+    ItemList *m_children;
+    int m_index;
+
+  };
+};
+
+
+bool KAcceleratorManagerPrivate::programmers_mode = false;
+QString KAcceleratorManagerPrivate::changed_string;
+QString KAcceleratorManagerPrivate::added_string;
+QString KAcceleratorManagerPrivate::removed_string;
+static QStringList *kaccmp_sns = 0;
+static KStaticDeleter<QStringList> kaccmp_sns_d;
+
+bool KAcceleratorManagerPrivate::standardName(const QString &str)
+{
+    if (!kaccmp_sns)
+        kaccmp_sns_d.setObject(kaccmp_sns, new QStringList(KStdAction::internal_stdNames()));
+        return kaccmp_sns->contains(str);
+}
+
+KAcceleratorManagerPrivate::Item::~Item()
+{
+    delete m_children;
+}
+
+
+void KAcceleratorManagerPrivate::Item::addChild(Item *item)
+{
+    if (!m_children)
+        m_children = new ItemList;
+
+    m_children->append(item);
+}
+
+void KAcceleratorManagerPrivate::manage(QWidget *widget)
+{
+    if (widget->inherits("QPopupMenu"))
+    {
+
+        KPopupAccelManager::manage(static_cast<QPopupMenu*>(widget));
+        return;
+    }
+
+    Item *root = new Item;
+
+    traverseChildren(widget, root);
+
+    QString used;
+    calculateAccelerators(root, used);
+    delete root;
+}
+
+
+void KAcceleratorManagerPrivate::calculateAccelerators(Item *item, QString &used)
+{
+    if (!item->m_children)
+        return;
+
+
+    KAccelStringList contents;
+    for (Item *it = item->m_children->first(); it != 0;
+         it = item->m_children->next())
+    {
+        contents << it->m_content;
+    }
+
+
+    KAccelManagerAlgorithm::findAccelerators(contents, used);
+
+
+    int cnt = -1;
+    for (Item *it = item->m_children->first(); it != 0;
+         it = item->m_children->next())
+    {
+        cnt++;
+
+        if (it->m_widget->inherits("QTabBar"))
+        {
+            QTabBar *bar = static_cast<QTabBar*>(it->m_widget);
+            if (checkChange(contents[cnt]))
+                bar->tabAt(it->m_index)->setText(contents[cnt].accelerated());
+            continue;
+        }
+        if (it->m_widget->inherits("QMenuBar"))
+        {
+            QMenuBar *bar = static_cast<QMenuBar*>(it->m_widget);
+            if (it->m_index >= 0)
+            {
+                QMenuItem *mitem = bar->findItem(bar->idAt(it->m_index));
+                if (mitem)
+                {
+                    checkChange(contents[cnt]);
+                    mitem->setText(contents[cnt].accelerated());
+                }
+                continue;
+            }
+        }
+        int tprop = it->m_widget->metaObject()->findProperty("text", true);
+        if (tprop != -1) {
+            if (checkChange(contents[cnt]))
+                it->m_widget->setProperty("text", contents[cnt].accelerated());
+        } else {
+            if (checkChange(contents[cnt]))
+                it->m_widget->setProperty("title", contents[cnt].accelerated());
+        }
+    }
+
+
+    for (Item *it = item->m_children->first(); it != 0;
+         it = item->m_children->next())
+    {
+        if (it->m_widget && it->m_widget->isVisibleTo( item->m_widget ))
+            calculateAccelerators(it, used);
+    }
+}
+
+
+void KAcceleratorManagerPrivate::traverseChildren(QWidget *widget, Item *item)
+{
+  QObjectList *childList = widget->queryList("QWidget", 0, false, false);
+  for ( QObject *it = childList->first(); it; it = childList->next() )
+  {
+    QWidget *w = static_cast<QWidget*>(it);
+
+    if ( !w->isVisibleTo( widget ) )
+        continue;
+
+
+
+    if (w->inherits("QTabBar"))
+    {
+        manageTabBar(static_cast<QTabBar*>(w), item);
+        continue;
+    }
+
+    if (w->inherits("QPopupMenu"))
+    {
+
+        KPopupAccelManager::manage(static_cast<QPopupMenu*>(w));
+        continue;
+    }
+
+    if (w->inherits("QMenuBar"))
+    {
+        manageMenuBar(static_cast<QMenuBar*>(w), item);
+        continue;
+    }
+
+    if (w->inherits("QComboBox") || w->inherits("QLineEdit") ||
+        w->inherits("QTextEdit") || w->inherits("QTextView") ||
+        w->inherits("QSpinBox"))
+        continue;
+
+
+    if (w->isFocusEnabled() || (w->inherits("QLabel") && static_cast<QLabel*>(w)->buddy()) || w->inherits("QGroupBox"))
+    {
+      QString content;
+      QVariant variant;
+      int tprop = w->metaObject()->findProperty("text", true);
+      if (tprop != -1) {
+          const QMetaProperty* p = w->metaObject()->property( tprop, true );
+          if ( p && p->isValid() )
+              w->qt_property( tprop, 1, &variant );
+          else
+              tprop = -1;
+      }
+
+      if (tprop == -1) {
+          tprop = w->metaObject()->findProperty("title", true);
+          if (tprop != -1) {
+              const QMetaProperty* p = w->metaObject()->property( tprop, true );
+              if ( p && p->isValid() )
+                  w->qt_property( tprop, 1, &variant );
+          }
+      }
+
+      if (variant.isValid())
+          content = variant.toString();
+
+      if (!content.isEmpty())
+      {
+          Item *i = new Item;
+          i->m_widget = w;
+
+
+          int weight = KAccelManagerAlgorithm::DEFAULT_WEIGHT;
+          if (w->inherits("QPushButton") || w->inherits("QCheckBox") || w->inherits("QRadioButton") || w->inherits("QLabel"))
+              weight = KAccelManagerAlgorithm::ACTION_ELEMENT_WEIGHT;
+
+
+          if (w->inherits("QGroupBox"))
+              weight = KAccelManagerAlgorithm::GROUP_BOX_WEIGHT;
+
+
+          if (w->inherits("KDialogBaseButton"))
+              weight += KAccelManagerAlgorithm::DIALOG_BUTTON_EXTRA_WEIGHT;
+
+          i->m_content = KAccelString(content, weight);
+          item->addChild(i);
+      }
+    }
+
+    traverseChildren(w, item);
+  }
+  delete childList;
+}
+
+
+void KAcceleratorManagerPrivate::manageTabBar(QTabBar *bar, Item *item)
+{
+  for (int i=0; i<bar->count(); i++)
+  {
+    QString content = bar->tabAt(i)->text();
+    if (content.isEmpty())
+      continue;
+
+    Item *it = new Item;
+    item->addChild(it);
+    it->m_widget = bar;
+    it->m_index = i;
+    it->m_content = KAccelString(content);
+  }
+}
+
+
+void KAcceleratorManagerPrivate::manageMenuBar(QMenuBar *mbar, Item *item)
+{
+    QMenuItem *mitem;
+    QString s;
+
+    for (uint i=0; i<mbar->count(); ++i)
+    {
+        mitem = mbar->findItem(mbar->idAt(i));
+        if (!mitem)
+            continue;
+
+
+        if (mitem->isSeparator())
+            continue;
+
+        s = mitem->text();
+        if (!s.isEmpty())
+        {
+            Item *it = new Item;
+            item->addChild(it);
+            it->m_content =
+                KAccelString(s,
+
+                             KAccelManagerAlgorithm::MENU_TITLE_WEIGHT);
+
+            it->m_widget = mbar;
+            it->m_index = i;
+        }
+
+
+        if (mitem->popup())
+            KPopupAccelManager::manage(mitem->popup());
+    }
+}
+void KAcceleratorManager::manage(QWidget *widget)
+{
+    KAcceleratorManager::manage(widget, false);
+}
+
+void KAcceleratorManager::manage(QWidget *widget, bool programmers_mode)
+{
+    KAcceleratorManagerPrivate::changed_string = QString::null;
+    KAcceleratorManagerPrivate::added_string = QString::null;
+    KAcceleratorManagerPrivate::removed_string = QString::null;
+    KAcceleratorManagerPrivate::programmers_mode = programmers_mode;
+    KAcceleratorManagerPrivate::manage(widget);
+}
+
+void KAcceleratorManager::last_manage(QString &added, QString &changed, QString &removed)
+{
+    added = KAcceleratorManagerPrivate::added_string;
+    changed = KAcceleratorManagerPrivate::changed_string;
+    removed = KAcceleratorManagerPrivate::removed_string;
+}
+KAccelString::KAccelString(const QString &input, int initialWeight)
+  : m_pureText(input), m_weight()
+{
+    if (m_pureText.contains('\t'))
+        m_pureText = m_pureText.left(m_pureText.find('\t'));
+    m_origText = m_pureText;
+    m_orig_accel = m_pureText.find("(!)&");
+    m_pureText.replace(m_orig_accel, 4, "");
+    m_orig_accel = m_pureText.find("(&&)");
+    if (m_orig_accel != -1)
+        m_pureText.replace(m_orig_accel, 4, "&");
+    m_orig_accel = m_accel = stripAccelerator(m_pureText);
+
+    kdDebug(125) << input << " " << m_orig_accel << " " << m_accel << " " << m_pureText << endl;
+    if (initialWeight == -1)
+        initialWeight = KAccelManagerAlgorithm::DEFAULT_WEIGHT;
+
+    calculateWeights(initialWeight);
+
+
+}
+
+
+QString KAccelString::accelerated() const
+{
+  QString result = m_pureText;
+  if (result.isEmpty())
+      return result;
+
+  if (KAcceleratorManagerPrivate::programmers_mode)
+  {
+      int oa = m_orig_accel;
+
+      if (m_accel >= 0) {
+          if (m_accel != m_orig_accel) {
+              result.insert(m_accel, "(!)&");
+              if (m_accel < m_orig_accel)
+                  oa += 4;
+          } else {
+              result.insert(m_accel, "&");
+              if (m_accel < m_orig_accel)
+                  oa++;
+          }
+      }
+
+      if (m_accel != m_orig_accel && m_orig_accel >= 0)
+          result.insert(oa, "(&&)");
+  } else {
+    if (m_accel >= 0)
+        result.insert(m_accel, "&");
+  }
+  return result;
+}
+
+
+QChar KAccelString::accelerator() const
+{
+  if ((m_accel < 0) || (m_accel > (int)m_pureText.length()))
+    return QChar();
+
+  return m_pureText[m_accel].lower();
+}
+
+
+void KAccelString::calculateWeights(int initialWeight)
+{
+  m_weight.resize(m_pureText.length());
+
+  uint pos = 0;
+  bool start_character = true;
+
+  while (pos<m_pureText.length())
+  {
+    QChar c = m_pureText[pos];
+
+    int weight = initialWeight+1;
+
+
+    if (pos == 0)
+      weight += KAccelManagerAlgorithm::FIRST_CHARACTER_EXTRA_WEIGHT;
+
+
+    if (start_character)
+    {
+      weight += KAccelManagerAlgorithm::WORD_BEGINNING_EXTRA_WEIGHT;
+      start_character = false;
+    }
+
+
+    if (pos < 50)
+      weight += (50-pos);
+
+
+    if ((int)pos == accel()) {
+        weight += KAccelManagerAlgorithm::WANTED_ACCEL_EXTRA_WEIGHT;
+
+        if (KAcceleratorManagerPrivate::standardName(m_origText)) {
+            weight += KAccelManagerAlgorithm::STANDARD_ACCEL;
+        }
+    }
+
+
+    if (!c.isLetterOrNumber())
+    {
+      weight = 0;
+      start_character = true;
+    }
+
+    m_weight[pos] = weight;
+
+    ++pos;
+  }
+}
+
+
+int KAccelString::stripAccelerator(QString &text)
+{
+
+  int p = 0;
+
+  while (p >= 0)
+  {
+    p = text.find('&', p)+1;
+
+    if (p <= 0 || p >= (int)text.length())
+      return -1;
+
+    if (text[p] != '&')
+    {
+      QChar c = text[p];
+      if (c.isPrint())
+      {
+        text.remove(p-1,1);
+        return p-1;
+      }
+    }
+
+    p++;
+  }
+
+  return -1;
+}
+
+
+int KAccelString::maxWeight(int &index, const QString &used)
+{
+  int max = 0;
+  index = -1;
+
+  for (uint pos=0; pos<m_pureText.length(); ++pos)
+    if (!used.contains(m_pureText[pos].lower()))
+      if (m_weight[pos] > max)
+      {
+        max = m_weight[pos];
+        index = pos;
+      }
+
+  return max;
+}
+
+
+void KAccelString::dump()
+{
+  QString s;
+  for (uint i=0; i<m_weight.count(); ++i)
+    s += QString("%1(%2) ").arg(pure()[i]).arg(m_weight[i]);
+  kdDebug() << "s " << s << endl;
+}
+void KAccelManagerAlgorithm::findAccelerators(KAccelStringList &result, QString &used)
+{
+  KAccelStringList accel_strings = result;
+
+
+  for (KAccelStringList::Iterator it = result.begin(); it != result.end(); ++it)
+    (*it).setAccel(-1);
+
+
+  for (uint cnt=0; cnt<accel_strings.count(); ++cnt)
+  {
+    int max = 0, index = -1, accel = -1;
+
+
+    for (uint i=0; i<accel_strings.count(); ++i)
+    {
+      int a;
+      int m = accel_strings[i].maxWeight(a, used);
+      if (m>max)
+      {
+        max = m;
+        index = i;
+        accel = a;
+      }
+    }
+
+
+    if (index < 0)
+      return;
+
+
+    if (accel >= 0)
+    {
+      result[index].setAccel(accel);
+      used.append(result[index].accelerator());
+    }
+
+
+    accel_strings[index] = KAccelString();
+  }
+}
+KPopupAccelManager::KPopupAccelManager(QPopupMenu *popup)
+  : QObject(popup), m_popup(popup), m_count(-1)
+{
+    aboutToShow();
+    connect(popup, "2""aboutToShow()", "1""aboutToShow()");
+}
+
+
+void KPopupAccelManager::aboutToShow()
+{
+
+
+
+
+
+  if (m_count != (int)m_popup->count())
+  {
+    findMenuEntries(m_entries);
+    calculateAccelerators();
+    m_count = m_popup->count();
+  }
+  else
+  {
+    KAccelStringList entries;
+    findMenuEntries(entries);
+    if (entries != m_entries)
+    {
+      m_entries = entries;
+      calculateAccelerators();
+    }
+  }
+}
+
+
+void KPopupAccelManager::calculateAccelerators()
+{
+
+  QString used;
+  KAccelManagerAlgorithm::findAccelerators(m_entries, used);
+
+
+  setMenuEntries(m_entries);
+}
+
+
+void KPopupAccelManager::findMenuEntries(KAccelStringList &list)
+{
+  QMenuItem *mitem;
+  QString s;
+
+  list.clear();
+
+
+  for (uint i=0; i<m_popup->count(); i++)
+  {
+    mitem = m_popup->findItem(m_popup->idAt(i));
+    if (mitem->isSeparator())
+      continue;
+
+    s = mitem->text();
+
+
+    int weight = 50;
+    if (s.contains('\t'))
+        weight = 0;
+
+    list.append(KAccelString(s, weight));
+
+
+    if (mitem->popup())
+        KPopupAccelManager::manage(mitem->popup());
+  }
+}
+
+
+void KPopupAccelManager::setMenuEntries(const KAccelStringList &list)
+{
+  QMenuItem *mitem;
+
+  uint cnt = 0;
+  for (uint i=0; i<m_popup->count(); i++)
+  {
+    mitem = m_popup->findItem(m_popup->idAt(i));
+    if (mitem->isSeparator())
+      continue;
+
+    if (KAcceleratorManagerPrivate::checkChange(list[cnt]))
+        mitem->setText(list[cnt].accelerated());
+    cnt++;
+  }
+}
+
+
+void KPopupAccelManager::manage(QPopupMenu *popup)
+{
+
+  if (popup->child(0, "KPopupAccelManager", false) == 0 )
+    new KPopupAccelManager(popup);
+}
+
+
+const char *KPopupAccelManager::className() const
+{
+    return "KPopupAccelManager";
+}
+
+QMetaObject *KPopupAccelManager::metaObj = 0;
+static QMetaObjectCleanUp cleanUp_KPopupAccelManager( "KPopupAccelManager", &KPopupAccelManager::staticMetaObject );
+QMetaObject* KPopupAccelManager::staticMetaObject()
+{
+    if ( metaObj )
+        return metaObj;
+    QMetaObject* parentObject = QObject::staticMetaObject();
+    static const QUMethod slot_0 = {"aboutToShow", 0, 0 };
+    static const QMetaData slot_tbl[] = {
+        { "aboutToShow()", &slot_0, QMetaData::Private }
+    };
+    metaObj = QMetaObject::new_metaobject(
+        "KPopupAccelManager", parentObject,
+        slot_tbl, 1,
+        0, 0,
+
+        0, 0,
+        0, 0,
+
+        0, 0 );
+    cleanUp_KPopupAccelManager.setMetaObject( metaObj );
+    return metaObj;
+}
+
+void* KPopupAccelManager::qt_cast( const char* clname )
+{
+    if ( !qstrcmp( clname, "KPopupAccelManager" ) )
+        return this;
+    return QObject::qt_cast( clname );
+}
+
+bool KPopupAccelManager::qt_invoke( int _id, QUObject* _o )
+{
+    switch ( _id - staticMetaObject()->slotOffset() ) {
+    case 0: aboutToShow(); break;
+    default:
+        return QObject::qt_invoke( _id, _o );
+    }
+    return TRUE;
+}
+
+bool KPopupAccelManager::qt_emit( int _id, QUObject* _o )
+{
+    return QObject::qt_emit(_id,_o);
+}
+
+
+bool KPopupAccelManager::qt_property( int id, int f, QVariant* v)
+{
+    return QObject::qt_property( id, f, v);
+}
+
+bool KPopupAccelManager::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C"
+
+int mkstemps(char *, int);
+extern "C"
+
+unsigned long strlcat(char*, const char*, unsigned long);
+
+
+
+
+
+
+extern "C"
+
+unsigned long strlcpy(char*, const char*, unsigned long);
+
+
+
+
+KSaveFile::KSaveFile(const QString &filename, int mode)
+ : mTempFile(true)
+{
+
+
+
+   if (!checkAccess(filename, 2))
+   {
+      mTempFile.setError(13);
+      return;
+   }
+
+   if (mTempFile.create(filename, QString::fromLatin1(".new"), mode))
+   {
+      mFileName = filename;
+   }
+   return;
+}
+
+KSaveFile::~KSaveFile()
+{
+   close();
+}
+
+QString
+KSaveFile::name() const
+{
+   return mFileName;
+}
+
+void
+KSaveFile::abort()
+{
+   mTempFile.unlink();
+   mTempFile.close();
+}
+
+bool
+KSaveFile::close()
+{
+   if (mTempFile.name().isEmpty())
+      return false;
+   if (mTempFile.close())
+   {
+      QDir dir;
+      bool result = dir.rename( mTempFile.name(), mFileName);
+      if ( result )
+      {
+         return true;
+      }
+      mTempFile.setError((*__errno_location ()));
+   }
+
+
+   mTempFile.unlink();
+   return false;
+}
+
+static int
+write_all(int fd, const char *buf, size_t len)
+{
+   while (len > 0)
+   {
+      int written = write(fd, buf, len);
+      if (written < 0)
+      {
+          if ((*__errno_location ()) == 4)
+             continue;
+          return -1;
+      }
+      buf += written;
+      len -= written;
+   }
+   return 0;
+}
+
+bool KSaveFile::backupFile( const QString& qFilename, const QString& backupDir,
+                            const QString& backupExtension)
+{
+   QCString cFilename = QFile::encodeName(qFilename);
+   const char *filename = cFilename.data();
+
+   int fd = open( filename, 00);
+   if (fd < 0)
+      return false;
+
+   struct stat buff;
+   if ( fstat( fd, &buff) < 0 )
+   {
+      ::close( fd );
+      return false;
+   }
+
+   QCString cBackup;
+   if ( backupDir.isEmpty() )
+       cBackup = cFilename;
+   else
+   {
+       QCString nameOnly;
+       int slash = cFilename.findRev('/');
+       if (slash < 0)
+           nameOnly = cFilename;
+       else
+           nameOnly = cFilename.mid(slash + 1);
+       cBackup = QFile::encodeName(backupDir);
+       if ( backupDir[backupDir.length()-1] != '/' )
+           cBackup += '/';
+       cBackup += nameOnly;
+   }
+   cBackup += QFile::encodeName(backupExtension);
+   const char *backup = cBackup.data();
+   int permissions = buff.st_mode & 07777;
+
+   if ( stat( backup, &buff) == 0)
+   {
+      if ( unlink( backup ) != 0 )
+      {
+         ::close(fd);
+         return false;
+      }
+   }
+
+   mode_t old_umask = umask(0);
+   int fd2 = open( backup, 01 | 0100 | 0200, permissions | 0200);
+   umask(old_umask);
+
+   if ( fd2 < 0 )
+   {
+      ::close(fd);
+      return false;
+   }
+
+    char buffer[ 32*1024 ];
+
+    while( 1 )
+    {
+       int n = ::read( fd, buffer, 32*1024 );
+       if (n == -1)
+       {
+          if ((*__errno_location ()) == 4)
+              continue;
+          ::close(fd);
+          ::close(fd2);
+          return false;
+       }
+       if (n == 0)
+          break;
+
+       if (write_all( fd2, buffer, n))
+       {
+          ::close(fd);
+          ::close(fd2);
+          return false;
+       }
+    }
+
+    ::close( fd );
+
+    if (::close(fd2))
+        return false;
+    return true;
+}
+
+class KRandomSequencePrivate;
+class QGList;
+class KRandomSequence
+{
+public:
+  KRandomSequence( long lngSeed = 0 );
+
+
+
+
+  virtual ~KRandomSequence();
+
+
+
+
+  KRandomSequence(const KRandomSequence &a);
+
+
+
+
+  KRandomSequence &operator=(const KRandomSequence &a);
+
+
+
+
+
+
+
+  void setSeed( long lngSeed = 1 );
+
+
+
+
+
+
+  double getDouble();
+
+
+
+
+
+
+
+  unsigned long getLong(unsigned long max);
+
+
+
+
+
+
+  bool getBool();
+
+
+
+
+
+
+  void randomize(QGList *list);
+  void modulate(int i);
+
+private:
+  void Draw();
+  long m_lngSeed1;
+  long m_lngSeed2;
+  long m_lngShufflePos;
+
+  static const int m_nShuffleTableSize;
+  long *m_ShuffleArray;
+
+  KRandomSequencePrivate *d;
+};
+
+
+const int KRandomSequence::m_nShuffleTableSize = 32;
+
+
+
+
+
+KRandomSequence::KRandomSequence( long lngSeed1 )
+{
+
+  setSeed( lngSeed1 );
+
+
+
+  m_ShuffleArray = new long [m_nShuffleTableSize];
+}
+
+KRandomSequence::~KRandomSequence()
+{
+  delete [] m_ShuffleArray;
+}
+
+KRandomSequence::KRandomSequence(const KRandomSequence &a)
+{
+
+  m_ShuffleArray = new long [m_nShuffleTableSize];
+  *this = a;
+}
+
+KRandomSequence &
+KRandomSequence::operator=(const KRandomSequence &a)
+{
+  m_lngSeed1 = a.m_lngSeed1;
+  m_lngSeed2 = a.m_lngSeed2;
+  m_lngShufflePos = a.m_lngShufflePos;
+  memcpy(m_ShuffleArray, a.m_ShuffleArray, sizeof(long)*m_nShuffleTableSize);
+  return *this;
+}
+
+
+
+
+
+
+void KRandomSequence::setSeed( long lngSeed1 )
+{
+
+
+
+
+  if ( lngSeed1 < 0 )
+  {
+    m_lngSeed1 = -1;
+  }
+  else if (lngSeed1 == 0)
+  {
+    m_lngSeed1 = -((KApplication::random() & ~1)+1);
+  }
+  else
+  {
+    m_lngSeed1 = -lngSeed1;
+  }
+}
+
+static const long sMod1 = 2147483563;
+static const long sMod2 = 2147483399;
+
+void KRandomSequence::Draw()
+{
+  static const long sMM1 = sMod1 - 1;
+  static const long sA1 = 40014;
+  static const long sA2 = 40692;
+  static const long sQ1 = 53668;
+  static const long sQ2 = 52774;
+  static const long sR1 = 12211;
+  static const long sR2 = 3791;
+  static const long sDiv = 1 + sMM1 / m_nShuffleTableSize;
+  int j;
+  long k;
+
+
+  if ( m_lngSeed1 <= 0 )
+  {
+    m_lngSeed2 = m_lngSeed1;
+
+
+    for ( j = m_nShuffleTableSize + 7; j >= 0; j-- )
+    {
+      k = m_lngSeed1 / sQ1;
+      m_lngSeed1 = sA1 * ( m_lngSeed1 - k*sQ1) - k*sR1;
+      if ( m_lngSeed1 < 0 )
+      {
+        m_lngSeed1 += sMod1;
+      }
+
+      if ( j < m_nShuffleTableSize )
+      {
+        m_ShuffleArray[j] = m_lngSeed1;
+      }
+    }
+
+    m_lngShufflePos = m_ShuffleArray[0];
+  }
+
+
+
+
+
+  k = m_lngSeed1 / sQ1;
+  m_lngSeed1 = sA1 * ( m_lngSeed1 - k*sQ1 ) - k*sR1;
+  if ( m_lngSeed1 < 0 )
+  {
+    m_lngSeed1 += sMod1;
+  }
+
+
+
+  k = m_lngSeed2 / sQ2;
+  m_lngSeed2 = sA2 * ( m_lngSeed2 - k*sQ2 ) - k*sR2;
+  if ( m_lngSeed2 < 0 )
+  {
+    m_lngSeed2 += sMod2;
+  }
+
+  j = m_lngShufflePos / sDiv;
+  m_lngShufflePos = m_ShuffleArray[j] - m_lngSeed2;
+  m_ShuffleArray[j] = m_lngSeed1;
+
+  if ( m_lngShufflePos < 1 )
+  {
+    m_lngShufflePos += sMM1;
+  }
+}
+
+void
+KRandomSequence::modulate(int i)
+{
+  m_lngSeed2 -= i;
+  if ( m_lngSeed2 < 0 )
+  {
+    m_lngShufflePos += sMod2;
+  }
+  Draw();
+  m_lngSeed1 -= i;
+  if ( m_lngSeed1 < 0 )
+  {
+    m_lngSeed1 += sMod1;
+  }
+  Draw();
+}
+
+double
+KRandomSequence::getDouble()
+{
+  static const double finalAmp = 1.0 / double( sMod1 );
+  static const double epsilon = 1.2E-7;
+  static const double maxRand = 1.0 - epsilon;
+  double temp;
+  Draw();
+
+  if ( ( temp = finalAmp * m_lngShufflePos ) > maxRand )
+  {
+
+    return maxRand;
+  }
+  else
+  {
+    return temp;
+  }
+}
+
+unsigned long
+KRandomSequence::getLong(unsigned long max)
+{
+  Draw();
+
+  return max ? (((unsigned long) m_lngShufflePos) % max) : 0;
+}
+
+bool
+KRandomSequence::getBool()
+{
+  Draw();
+
+  return (((unsigned long) m_lngShufflePos) & 1);
+}
+
+class KRandomSequenceList : public QGList
+{
+  friend class KRandomSequence;
+public:
+  KRandomSequenceList() : QGList() { }
+  virtual void deleteItem( QPtrCollection::Item ) {}
+};
+
+void
+KRandomSequence::randomize(QGList *_list)
+{
+  KRandomSequenceList *list = (KRandomSequenceList *)_list;
+  KRandomSequenceList l;
+  while(list->count())
+     l.append(list->takeFirst());
+
+  list->append(l.takeFirst());
+  while(l.count())
+     list->insertAt(getLong(list->count()+1), l.takeFirst());
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C"
+
+int mkstemps(char *, int);
+extern "C"
+
+unsigned long strlcat(char*, const char*, unsigned long);
+
+
+
+
+
+
+extern "C"
+
+unsigned long strlcpy(char*, const char*, unsigned long);
+
+
+
+
+
+
+
+QString KStringHandler::word( const QString &text , uint pos )
+{
+    QStringList list = QStringList::split( " ", text , true );
+
+    if ( pos < list.count() )
+        return list[ pos ];
+
+    return "";
+}
+
+QString KStringHandler::word( const QString &text , const char *range )
+{
+
+
+
+
+
+    QStringList list = QStringList::split( " ", text , true );
+    QString tmp = "";
+    QString r = range;
+
+    if ( text.isEmpty() )
+        return tmp;
+
+
+    QRegExp reg;
+
+    int at = 0;
+    int pos = 0;
+    int cnt = 0;
+
+    if ( r.find(QRegExp("[0-9]+:[0-9]+")) != -1 )
+    {
+        at = r.find(":");
+        pos = atoi( r.left(at).ascii() );
+        cnt = atoi( r.remove(0,at+1).ascii() );
+    }
+    else if ( r.find(QRegExp(":+[0-9]+")) != -1 )
+    {
+        at = r.find(":");
+        pos = 0;
+        cnt = atoi( r.remove(0,at+1).ascii() );
+    }
+    else if ( r.find(QRegExp("[0-9]+:+")) != -1 )
+    {
+        at = r.find(":");
+        pos = atoi( r.left(at).ascii() );
+        cnt = list.count();
+    }
+    else if ( r.find(QRegExp("[0-9]+")) != -1 )
+    {
+        pos = atoi( r.ascii() );
+        cnt = pos;
+    }
+    else
+    {
+        return tmp;
+    }
+
+
+
+
+    int wordsToExtract = cnt-pos+1;
+    QStringList::Iterator it = list.at( pos);
+
+    while ( (it != list.end()) && (wordsToExtract-- > 0))
+    {
+       tmp += *it;
+       tmp += " ";
+       it++;
+    }
+
+    return tmp.stripWhiteSpace();
+}
+
+
+
+
+QString KStringHandler::insword( const QString &text , const QString &word , uint pos )
+{
+    if ( text.isEmpty() )
+        return word;
+
+    if ( word.isEmpty() )
+        return text;
+
+
+    QStringList list = QStringList::split( " ", text, true );
+
+    if ( pos >= list.count() )
+        list.append( word );
+    else
+        list.insert( list.at(pos) , word );
+
+
+    return list.join( " " );
+}
+
+QString KStringHandler::setword( const QString &text , const QString &word , uint pos )
+{
+    if ( text.isEmpty() )
+        return word;
+
+    if ( word.isEmpty() )
+        return text;
+
+
+    QStringList list = QStringList::split( " ", text, true );
+
+    if ( pos >= list.count() )
+        list.append( word );
+    else
+    {
+        list.insert( list.remove( list.at(pos) ) , word );
+    }
+
+
+    return list.join( " " );
+}
+
+QString KStringHandler::remrange( const QString &text , const char *range )
+{
+
+
+
+
+
+    QStringList list = QStringList::split( " ", text , true );
+    QString tmp = "";
+    QString r = range;
+
+    if ( text.isEmpty() )
+        return tmp;
+
+
+    QRegExp reg;
+
+    int at = 0;
+    int pos = 0;
+    int cnt = 0;
+
+    if ( r.find(QRegExp("[0-9]+:[0-9]+")) != -1 )
+    {
+        at = r.find(':');
+        pos = atoi( r.left(at).ascii() );
+        cnt = atoi( r.remove(0,at+1).ascii() );
+    }
+    else if ( r.find(QRegExp(":+[0-9]+")) != -1 )
+    {
+        at = r.find(':');
+        pos = 0;
+        cnt = atoi( r.remove(0,at+1).ascii() );
+    }
+    else if ( r.find(QRegExp("[0-9]+:+")) != -1 )
+    {
+        at = r.find(':');
+        pos = atoi( r.left(at).ascii() );
+        cnt = list.count();
+    }
+    else if ( r.find(QRegExp("[0-9]+")) != -1 )
+    {
+        pos = atoi( r.ascii() );
+        cnt = pos;
+    }
+    else
+    {
+        return text;
+    }
+
+
+
+
+    int wordsToDelete = cnt-pos+1;
+    QStringList::Iterator it = list.at( pos);
+
+    while ( (it != list.end()) && (wordsToDelete-- > 0))
+       it = list.remove( it );
+
+    return list.join( " " );
+}
+
+QString KStringHandler::remword( const QString &text , uint pos )
+{
+    QString tmp = "";
+
+    if ( text.isEmpty() )
+        return tmp;
+
+
+    QStringList list = QStringList::split( " ", text, true );
+
+    if ( pos < list.count() )
+        list.remove( list.at( pos ) );
+
+
+    return list.join( " " );
+}
+
+QString KStringHandler::remword( const QString &text , const QString &word )
+{
+    QString tmp = "";
+
+    if ( text.isEmpty() )
+        return tmp;
+
+    if ( word.isEmpty() )
+        return text;
+
+
+    QStringList list = QStringList::split( " ", text, true );
+
+    QStringList::Iterator it = list.find(word);
+
+    if (it != list.end())
+       list.remove( it );
+
+
+    return list.join( " " );
+}
+
+
+
+
+QString KStringHandler::capwords( const QString &text )
+{
+    QString tmp = "";
+
+    if ( text.isEmpty() )
+        return tmp;
+
+    QStringList list = QStringList::split( " ", text, true );
+
+    return capwords( QStringList::split( " ", text, true )).join( " " );
+}
+
+QStringList KStringHandler::capwords( const QStringList &list )
+{
+    QStringList tmp;
+    QString word;
+
+    if ( list.count() == 0 )
+        return tmp;
+
+    for ( QStringList::ConstIterator it= list.begin();
+          it != list.end();
+          it++)
+    {
+        word = *it;
+        word = word.left(1).upper() + word.remove(0,1);
+
+        tmp.append( word );
+    }
+
+    return tmp;
+}
+
+
+
+
+QString KStringHandler::reverse( const QString &text )
+{
+    QString tmp;
+
+    if ( text.isEmpty() )
+        return tmp;
+
+    QStringList list;
+    list = QStringList::split( " ", text, true );
+    list = reverse( list );
+
+    return list.join( " " );
+}
+
+QStringList KStringHandler::reverse( const QStringList &list )
+{
+    QStringList tmp;
+
+    if ( list.count() == 0 )
+        return tmp;
+
+    for ( QStringList::ConstIterator it= list.begin();
+          it != list.end();
+          it++)
+        tmp.prepend( *it );
+
+    return tmp;
+}
+
+
+
+
+QString KStringHandler::ljust( const QString &text , uint width )
+{
+    QString tmp = text;
+    tmp = tmp.stripWhiteSpace();
+
+    if ( tmp.length() >= width )
+        return tmp;
+
+    for ( uint pos = tmp.length() ; pos < width ; pos++ )
+        tmp.append(" ");
+
+    return tmp;
+}
+
+QString KStringHandler::rjust( const QString &text , uint width )
+{
+    QString tmp = text;
+    tmp = tmp.stripWhiteSpace();
+
+    if ( tmp.length() >= width )
+        return tmp;
+
+    for ( uint pos = tmp.length() ; pos < width ; pos++ )
+        tmp.prepend(" ");
+
+    return tmp;
+}
+
+QString KStringHandler::center( const QString &text , uint width )
+{
+
+
+
+
+    QString tmp = text;
+    tmp = tmp.stripWhiteSpace();
+
+    if ( tmp.length() >= width )
+        return tmp;
+
+    bool left = false;
+
+    for ( uint pos = tmp.length() ; pos < width ; pos++ )
+    {
+        if ( left )
+            tmp.prepend(" ");
+        else
+            tmp.append(" ");
+
+
+        left = !left;
+    }
+
+    return tmp;
+}
+
+QString KStringHandler::lsqueeze( const QString & str, uint maxlen )
+{
+  if (str.length() > maxlen) {
+    int part = maxlen-3;
+    return QString("..." + str.right(part));
+  }
+  else return str;
+}
+
+QString KStringHandler::csqueeze( const QString & str, uint maxlen )
+{
+  if (str.length() > maxlen && maxlen > 3) {
+    int part = (maxlen-3)/2;
+    return QString(str.left(part) + "..." + str.right(part));
+  }
+  else return str;
+}
+
+QString KStringHandler::rsqueeze( const QString & str, uint maxlen )
+{
+  if (str.length() > maxlen) {
+    int part = maxlen-3;
+    return QString(str.left(part) + "...");
+  }
+  else return str;
+}
+
+QString KStringHandler::lEmSqueeze(const QString &name, const QFontMetrics& fontMetrics, uint maxlen)
+{
+  return lPixelSqueeze(name, fontMetrics, fontMetrics.maxWidth() * maxlen);
+}
+
+static inline int emSqueezeLimit(int delta, int min, int max)
+{
+  if (delta < min) return min;
+  if (delta > max) return max;
+  return delta;
+}
+
+QString KStringHandler::lPixelSqueeze(const QString& name, const QFontMetrics& fontMetrics, uint maxPixels)
+{
+  uint nameWidth = fontMetrics.width(name);
+
+  if (maxPixels < nameWidth)
+  {
+    QString tmp = name;
+    const uint em = fontMetrics.maxWidth();
+    maxPixels -= fontMetrics.width("...");
+
+    while (maxPixels < nameWidth && !tmp.isEmpty())
+    {
+      int delta = (nameWidth - maxPixels) / em;
+      delta = emSqueezeLimit(delta, 1, delta);
+
+      tmp.remove(0, delta);
+      nameWidth = fontMetrics.width(tmp);
+    }
+
+    return ("..." + tmp);
+  }
+
+  return name;
+}
+
+QString KStringHandler::cEmSqueeze(const QString& name, const QFontMetrics& fontMetrics, uint maxlen)
+{
+  return cPixelSqueeze(name, fontMetrics, fontMetrics.maxWidth() * maxlen);
+}
+
+QString KStringHandler::cPixelSqueeze(const QString& name, const QFontMetrics& fontMetrics, uint maxPixels)
+{
+  uint nameWidth = fontMetrics.width(name);
+
+  if (maxPixels < nameWidth)
+  {
+    QString tmp = name;
+    const uint em = fontMetrics.maxWidth();
+    maxPixels -= fontMetrics.width("...");
+
+    while (maxPixels < nameWidth && !tmp.isEmpty())
+    {
+      int length = tmp.length();
+      int delta = (nameWidth - maxPixels) / em;
+      delta = emSqueezeLimit(delta, 1, length) ;
+
+      tmp.remove((length / 2) - (delta / 2), delta);
+      nameWidth = fontMetrics.width(tmp);
+    }
+
+    return tmp.insert((tmp.length() + 1) / 2, "...");
+  }
+
+  return name;
+}
+
+QString KStringHandler::rEmSqueeze(const QString& name, const QFontMetrics& fontMetrics, uint maxlen)
+{
+  return rPixelSqueeze(name, fontMetrics, fontMetrics.maxWidth() * maxlen);
+}
+
+QString KStringHandler::rPixelSqueeze(const QString& name, const QFontMetrics& fontMetrics, uint maxPixels)
+{
+  uint nameWidth = fontMetrics.width(name);
+
+  if (maxPixels < nameWidth)
+  {
+    QString tmp = name;
+    const uint em = fontMetrics.maxWidth();
+    maxPixels -= fontMetrics.width("...");
+
+    while (maxPixels < nameWidth && !tmp.isEmpty())
+    {
+      int length = tmp.length();
+      int delta = (nameWidth - maxPixels) / em;
+      delta = emSqueezeLimit(delta, 1, length) ;
+
+      tmp.remove(length - delta, delta);
+      nameWidth = fontMetrics.width(tmp);
+    }
+
+    return (tmp + "...");
+  }
+
+  return name;
+}
+
+
+
+bool KStringHandler::matchFileName( const QString& filename, const QString& pattern )
+{
+   int len = filename.length();
+   int pattern_len = pattern.length();
+
+   if (!pattern_len)
+      return false;
+
+
+   if ( pattern[ pattern_len - 1 ] == '*' && len + 1 >= pattern_len ) {
+      if ( pattern[ 0 ] == '*' )
+      {
+         return filename.find(pattern.mid(1, pattern_len - 2)) != -1;
+      }
+
+      const QChar *c1 = pattern.unicode();
+      const QChar *c2 = filename.unicode();
+      int cnt = 1;
+      while ( cnt < pattern_len && *c1++ == *c2++ )
+         ++cnt;
+      return cnt == pattern_len;
+   }
+
+
+   if ( pattern[ 0 ] == '*' && len + 1 >= pattern_len )
+   {
+     const QChar *c1 = pattern.unicode() + pattern_len - 1;
+     const QChar *c2 = filename.unicode() + len - 1;
+     int cnt = 1;
+     while ( cnt < pattern_len && *c1-- == *c2-- )
+        ++cnt;
+     return cnt == pattern_len;
+  }
+
+
+   return ( filename == pattern );
+}
+
+  QStringList
+KStringHandler::perlSplit(const QString & sep, const QString & s, uint max)
+{
+  bool ignoreMax = 0 == max;
+
+  QStringList l;
+
+  int searchStart = 0;
+
+  int tokenStart = s.find(sep, searchStart);
+
+  while (-1 != tokenStart && (ignoreMax || l.count() < max - 1))
+  {
+    if (!s.mid(searchStart, tokenStart - searchStart).isEmpty())
+      l << s.mid(searchStart, tokenStart - searchStart);
+
+    searchStart = tokenStart + sep.length();
+    tokenStart = s.find(sep, searchStart);
+  }
+
+  if (!s.mid(searchStart, s.length() - searchStart).isEmpty())
+    l << s.mid(searchStart, s.length() - searchStart);
+
+  return l;
+}
+
+  QStringList
+KStringHandler::perlSplit(const QChar & sep, const QString & s, uint max)
+{
+  bool ignoreMax = 0 == max;
+
+  QStringList l;
+
+  int searchStart = 0;
+
+  int tokenStart = s.find(sep, searchStart);
+
+  while (-1 != tokenStart && (ignoreMax || l.count() < max - 1))
+  {
+    if (!s.mid(searchStart, tokenStart - searchStart).isEmpty())
+      l << s.mid(searchStart, tokenStart - searchStart);
+
+    searchStart = tokenStart + 1;
+    tokenStart = s.find(sep, searchStart);
+  }
+
+  if (!s.mid(searchStart, s.length() - searchStart).isEmpty())
+    l << s.mid(searchStart, s.length() - searchStart);
+
+  return l;
+}
+
+  QStringList
+KStringHandler::perlSplit(const QRegExp & sep, const QString & s, uint max)
+{
+  bool ignoreMax = 0 == max;
+
+  QStringList l;
+
+  int searchStart = 0;
+  int tokenStart = sep.search(s, searchStart);
+  int len = sep.matchedLength();
+
+  while (-1 != tokenStart && (ignoreMax || l.count() < max - 1))
+  {
+    if (!s.mid(searchStart, tokenStart - searchStart).isEmpty())
+      l << s.mid(searchStart, tokenStart - searchStart);
+
+    searchStart = tokenStart + len;
+    tokenStart = sep.search(s, searchStart);
+    len = sep.matchedLength();
+  }
+
+  if (!s.mid(searchStart, s.length() - searchStart).isEmpty())
+    l << s.mid(searchStart, s.length() - searchStart);
+
+  return l;
+}
+
+ QString
+KStringHandler::tagURLs( const QString& text )
+{
+               QRegExp urlEx("(www\\.(?!\\.)|(f|ht)tp(|s)://)[\\d\\w\\./,:_~\\?=&;#@\\-\\+\\%]+[\\d\\w/]");
+
+    QString richText( text );
+    int urlPos = 0, urlLen;
+    while ((urlPos = urlEx.search(richText, urlPos)) >= 0)
+    {
+        urlLen = urlEx.matchedLength();
+        QString href = richText.mid( urlPos, urlLen );
+
+        if((urlPos > 0) && richText[urlPos-1].isLetterOrNumber()){
+            urlPos++;
+            continue;
+        }
+
+        QString anchor = "<a href=\"" + href + "\">" + href + "</a>";
+        richText.replace( urlPos, urlLen, anchor );
+
+
+        urlPos += anchor.length();
+    }
+    return richText;
+}
+
+QString KStringHandler::obscure( const QString &str )
+{
+  QString result;
+  for ( uint i = 0; i < str.length(); ++i )
+    result += ( str[ i ].unicode() < 0x20 ) ? str[ i ] :
+        QChar( 0x1001F - str[ i ].unicode() );
+
+  return result;
+}
+
+
+
+class KInstance;
+namespace KNotifyClient
+{
+    struct InstancePrivate;
+        class InstanceStack;
+    class Instance
+    {
+    public:
+
+
+
+
+
+        Instance(KInstance *instance);
+
+
+
+
+        ~Instance();
+
+
+
+
+
+        bool useSystemBell() const;
+
+
+
+
+        static KInstance *current();
+
+
+
+
+
+        static Instance *currentInstance();
+
+    private:
+                static InstanceStack *instances();
+                InstancePrivate *d;
+                static InstanceStack *s_instances;
+    };
+
+
+
+
+
+        enum {
+                Default = -1,
+                None = 0,
+                Sound = 1,
+                Messagebox = 2,
+                Logfile = 4,
+                Stderr = 8,
+                PassivePopup = 16,
+                Execute = 32,
+                Taskbar = 64
+        };
+
+
+
+
+        enum {
+                Notification=1,
+                Warning=2,
+                Error=4,
+                Catastrophe=8
+        };
+
+
+
+
+        enum StandardEvent {
+                cannotOpenFile,
+                notification,
+                warning,
+                fatalError,
+                catastrophe
+        };
+        bool startDaemon();
+        int event(const QString &message, const QString &text=QString::null) ;
+        int event( StandardEvent event, const QString& text=QString::null ) ;
+        int userEvent(const QString &text=QString::null, int present=Default, int level=Default,
+                              const QString &sound=QString::null, const QString &file=QString::null) ;
+        int event( int winId, const QString& message,
+                    const QString& text = QString::null );
+        int event( int winId, StandardEvent event,
+                    const QString& text = QString::null );
+        int userEvent(int winId, const QString &text=QString::null, int present=Default, int level=Default,
+                              const QString &sound=QString::null, const QString &file=QString::null);
+        void beep(const QString& reason=QString::null);
+        int getPresentation(const QString &eventname);
+        QString getFile(const QString &eventname, int present);
+        int getDefaultPresentation(const QString &eventname);
+        QString getDefaultFile(const QString &eventname, int present);
+
+
+
+
+
+        KInstance * instance();
+}
+
+
+
+
+template<class T, class Key = int> class KSortableItem : public QPair<Key,T>
+{
+public:
+
+
+
+
+
+    KSortableItem( Key i, const T& t ) : QPair<Key, T>( i, t ) {}
+
+
+
+
+    KSortableItem( const KSortableItem<T, Key> &rhs )
+        : QPair<Key,T>( rhs.first, rhs.second ) {}
+
+
+
+
+    KSortableItem() {}
+
+
+
+
+    KSortableItem<T, Key> &operator=( const KSortableItem<T, Key>& i ) {
+        this->first = i.first;
+        this->second = i.second;
+        return *this;
+    }
+
+
+
+
+
+
+    bool operator> ( const KSortableItem<T, Key>& i2 ) const {
+        return (i2.first < this->first);
+    }
+
+
+
+
+    bool operator< ( const KSortableItem<T, Key>& i2 ) const {
+        return (this->first < i2.first);
+    }
+
+
+
+
+    bool operator>= ( const KSortableItem<T, Key>& i2 ) const {
+        return (this->first >= i2.first);
+    }
+
+
+
+
+    bool operator<= ( const KSortableItem<T, Key>& i2 ) const {
+        return !(i2.first < this->first);
+    }
+
+
+
+
+    bool operator== ( const KSortableItem<T, Key>& i2 ) const {
+        return (this->first == i2.first);
+    }
+
+
+
+
+    bool operator!= ( const KSortableItem<T, Key>& i2 ) const {
+        return (this->first != i2.first);
+    }
+
+
+
+
+    T& value() { return this->second; }
+
+
+
+
+    const T& value() const { return this->second; }
+
+
+
+
+    Key index() const { return this->first; }
+};
+template <class T, class Key = int>
+class KSortableValueList : public QValueList<KSortableItem<T, Key> >
+{
+public:
+
+
+
+
+
+    void insert( Key i, const T& t ) {
+        QValueList<KSortableItem<T, Key> >::append( KSortableItem<T, Key>( i, t ) );
+    }
+
+
+
+
+
+
+    T& operator[]( Key i ) {
+        return QValueList<KSortableItem<T, Key> >::operator[]( i ).value();
+    }
+
+
+
+
+
+    const T& operator[]( Key i ) const {
+        return QValueList<KSortableItem<T, Key> >::operator[]( i ).value();
+    }
+
+
+
+
+    void sort() {
+        qHeapSort( *this );
+    }
+};
+
+
+class KCompTreeNode;
+class KCompletionPrivate;
+class KCompletionBasePrivate;
+class KCompletionMatchesWrapper;
+class KCompletionMatches;
+class QPopupMenu;
+class KCompletion : public QObject
+{
+   
+   
+   
+   
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+
+public:
+
+
+
+
+    enum CompOrder { Sorted,
+                     Insertion,
+                     Weighted
+    };
+
+
+
+
+    KCompletion();
+
+
+
+
+
+
+    virtual ~KCompletion();
+    virtual QString makeCompletion( const QString& string );
+    QStringList substringCompletion( const QString& string ) const;
+    QString previousMatch();
+    QString nextMatch();
+
+
+
+
+
+
+
+    virtual const QString& lastMatch() const { return myLastMatch; }
+    QStringList items() const;
+    virtual void setCompletionMode( KGlobalSettings::Completion mode );
+    KGlobalSettings::Completion completionMode() const {
+        return myCompletionMode;
+    }
+    virtual void setOrder( CompOrder order );
+
+
+
+
+
+
+    CompOrder order() const { return myOrder; }
+    virtual void setIgnoreCase( bool ignoreCase );
+
+
+
+
+
+
+
+    bool ignoreCase() const { return myIgnoreCase; }
+
+
+
+
+
+
+
+    QStringList allMatches();
+
+
+
+
+
+
+    QStringList allMatches( const QString& string );
+    KCompletionMatches allWeightedMatches();
+
+
+
+
+
+
+    KCompletionMatches allWeightedMatches( const QString& string );
+    virtual void setEnableSounds( bool enable ) { myBeep = enable; }
+    bool isSoundsEnabled() const { return myBeep; }
+
+
+
+
+
+
+    bool hasMultipleMatches() const { return myHasMultipleMatches; }
+
+
+
+
+
+
+    void enableSounds() { myBeep = true; }
+
+
+
+
+
+    void disableSounds() { myBeep = false; }
+
+
+public :
+
+
+
+
+
+
+    void slotMakeCompletion( const QString& string ) {
+        (void) makeCompletion( string );
+    }
+
+
+
+
+
+
+    void slotPreviousMatch() {
+        (void) previousMatch();
+    }
+
+
+
+
+
+
+    void slotNextMatch() {
+        (void) nextMatch();
+    }
+
+
+
+
+
+
+    void insertItems( const QStringList& items );
+    virtual void setItems( const QStringList& list);
+
+
+
+
+
+
+
+    void addItem( const QString& item);
+    void addItem( const QString& item, uint weight );
+
+
+
+
+
+
+
+    void removeItem( const QString& item);
+
+
+
+
+    virtual void clear();
+
+
+protected:
+
+
+
+
+
+
+    void match( const QString& item);
+
+
+
+
+
+
+
+    void matches( const QStringList& matchlist);
+
+
+
+
+
+
+    void multipleMatches();
+
+protected:
+    virtual void postProcessMatch( QString *match ) const { (void)match; }
+    virtual void postProcessMatches( QStringList * matches ) const { (void)matches;}
+    virtual void postProcessMatches( KCompletionMatches * matches ) const {(void)matches;}
+
+private:
+    void addWeightedItem( const QString& );
+    QString findCompletion( const QString& string );
+    void findAllCompletions( const QString&,
+                                        KCompletionMatchesWrapper *matches,
+                                        bool& hasMultipleMatches ) const;
+
+    void extractStringsFromNode( const KCompTreeNode *,
+                                 const QString& beginning,
+                                 KCompletionMatchesWrapper *matches,
+                                 bool addWeight = false ) const;
+    void extractStringsFromNodeCI( const KCompTreeNode *,
+                                   const QString& beginning,
+                                   const QString& restString,
+                                   KCompletionMatchesWrapper *matches) const;
+
+    enum BeepMode { NoMatch, PartialMatch, Rotation };
+    void doBeep( BeepMode ) const;
+
+    KGlobalSettings::Completion myCompletionMode;
+
+    CompOrder myOrder;
+    QString myLastString;
+    QString myLastMatch;
+    QString myCurrentMatch;
+    KCompTreeNode * myTreeRoot;
+    QStringList myRotations;
+    bool myBeep;
+    bool myIgnoreCase;
+    bool myHasMultipleMatches;
+    uint myRotationIndex;
+
+
+protected:
+    virtual void virtual_hook( int id, void* data );
+private:
+    KCompletionPrivate *d;
+};
+
+
+typedef KSortableValueList<QString> KCompletionMatchesList;
+class KCompletionMatchesPrivate;
+class KCompletionMatches : public KCompletionMatchesList
+{
+public:
+    KCompletionMatches( bool sort );
+
+
+
+    KCompletionMatches( const KCompletionMatchesWrapper& matches );
+    ~KCompletionMatches();
+
+
+
+
+    void removeDuplicates();
+
+
+
+
+
+
+    QStringList list( bool sort = true ) const;
+
+
+
+
+
+    bool sorting() const {
+        return _sorting;
+    }
+private:
+    bool _sorting;
+    KCompletionMatchesPrivate* d;
+};
+class KCompletionBase
+{
+public:
+
+
+
+
+
+    enum KeyBindingType {
+
+
+
+        TextCompletion,
+
+
+
+        PrevCompletionMatch,
+
+
+
+        NextCompletionMatch,
+
+
+
+        SubstringCompletion
+    };
+
+
+
+    typedef QMap<KeyBindingType, KShortcut> KeyBindingMap;
+
+
+
+
+    KCompletionBase();
+
+
+
+
+    virtual ~KCompletionBase();
+    KCompletion* completionObject( bool hsig = true );
+    virtual void setCompletionObject( KCompletion* compObj, bool hsig = true );
+    virtual void setHandleSignals( bool handle );
+    bool isCompletionObjectAutoDeleted() const {
+        return m_delegate ? m_delegate->isCompletionObjectAutoDeleted() : m_bAutoDelCompObj;
+    }
+    void setAutoDeleteCompletionObject( bool autoDelete ) {
+        if ( m_delegate )
+            m_delegate->setAutoDeleteCompletionObject( autoDelete );
+        else
+            m_bAutoDelCompObj = autoDelete;
+    }
+    void setEnableSignals( bool enable ) {
+        if ( m_delegate )
+            m_delegate->setEnableSignals( enable );
+        else
+            m_bEmitSignals = enable;
+    }
+
+
+
+
+
+
+    bool handleSignals() const { return m_delegate ? m_delegate->handleSignals() : m_bHandleSignals; }
+
+
+
+
+
+
+    bool emitSignals() const { return m_delegate ? m_delegate->emitSignals() : m_bEmitSignals; }
+    virtual void setCompletionMode( KGlobalSettings::Completion mode );
+    KGlobalSettings::Completion completionMode() const {
+        return m_delegate ? m_delegate->completionMode() : m_iCompletionMode;
+    }
+    bool setKeyBinding( KeyBindingType item , const KShortcut& key );
+    const KShortcut& getKeyBinding( KeyBindingType item ) const {
+        return m_delegate ? m_delegate->getKeyBinding( item ) : m_keyMap[ item ];
+    }
+    void useGlobalKeyBindings();
+    virtual void setCompletedText( const QString& text ) = 0;
+
+
+
+
+
+
+    virtual void setCompletedItems( const QStringList& items ) = 0;
+    KCompletion* compObj() const { return m_delegate ? m_delegate->compObj() : (KCompletion*) m_pCompObj; }
+
+protected:
+    KeyBindingMap getKeyBindings() const { return m_delegate ? m_delegate->getKeyBindings() : m_keyMap; }
+
+
+
+
+
+
+    void setDelegate( KCompletionBase *delegate );
+
+
+
+
+
+
+    KCompletionBase *delegate() const { return m_delegate; }
+
+private:
+
+
+
+    void setup( bool, bool, bool );
+
+
+
+    bool m_bAutoDelCompObj;
+
+
+    bool m_bHandleSignals;
+
+    bool m_bEmitSignals;
+
+    KGlobalSettings::Completion m_iCompletionMode;
+
+    QGuardedPtr<KCompletion> m_pCompObj;
+
+    KeyBindingMap m_keyMap;
+
+    KCompletionBase *m_delegate;
+
+
+protected:
+    virtual void virtual_hook( int id, void* data );
+private:
+    KCompletionBasePrivate *d;
+};
+
+
+
+
+class KCompTreeNode;
+
+
+
+
+
+
+class KCompTreeNodeList
+{
+public:
+    KCompTreeNodeList() : first(0), last(0), m_count(0) {}
+    KCompTreeNode *begin() const { return first; }
+    KCompTreeNode *end() const { return last; }
+
+    KCompTreeNode *at(uint index) const;
+    void append(KCompTreeNode *item);
+    void prepend(KCompTreeNode *item);
+    void insert(KCompTreeNode *after, KCompTreeNode *item);
+    KCompTreeNode *remove(KCompTreeNode *item);
+    uint count() const { return m_count; }
+
+private:
+    KCompTreeNode *first, *last;
+    uint m_count;
+};
+
+typedef KCompTreeNodeList KCompTreeChildren;
+class KCompTreeNode : public QChar
+{
+public:
+    KCompTreeNode() : QChar(), myWeight(0) {}
+    KCompTreeNode( const QChar& ch, uint weight = 0 )
+        : QChar( ch ),
+          myWeight( weight ) {}
+    ~KCompTreeNode();
+
+    void * operator new( size_t s ) {
+      return alloc.allocate( s );
+    }
+    void operator delete( void * s ) {
+      alloc.deallocate( s );
+    }
+
+
+
+    inline KCompTreeNode * find( const QChar& ch ) const {
+      KCompTreeNode * cur = myChildren.begin();
+      while (cur && (*cur != ch)) cur = cur->next;
+      return cur;
+    }
+    KCompTreeNode * insert( const QChar&, bool sorted );
+    void remove( const QString& );
+
+    inline int childrenCount() const { return myChildren.count(); }
+
+
+    inline void confirm() { myWeight++; }
+    inline void confirm(uint w) { myWeight += w; }
+    inline void decline() { myWeight--; }
+    inline uint weight() const { return myWeight; }
+
+    inline const KCompTreeChildren * children() const {
+        return &myChildren;
+    }
+    inline const KCompTreeNode * childAt(int index) const {
+        return myChildren.at(index);
+    }
+    inline const KCompTreeNode * firstChild() const {
+        return myChildren.begin();
+    }
+    inline const KCompTreeNode * lastChild() const {
+        return myChildren.end();
+    }
+
+
+
+
+    KCompTreeNode *next;
+private:
+    uint myWeight;
+    KCompTreeNodeList myChildren;
+    static KZoneAllocator alloc;
+};
+
+
+
+
+typedef KSortableValueList<QString> KCompletionMatchesList;
+
+
+
+
+class KCompletionMatchesWrapper
+{
+public:
+    KCompletionMatchesWrapper( bool sort = false )
+        : sortedList( sort ? new KCompletionMatchesList : 0L ),
+          dirty( false )
+    {}
+    ~KCompletionMatchesWrapper() {
+        delete sortedList;
+    }
+
+    void setSorting( bool sort ) {
+        if ( sort && !sortedList )
+            sortedList = new KCompletionMatchesList;
+        else if ( !sort ) {
+            delete sortedList;
+            sortedList = 0L;
+        }
+        stringList.clear();
+        dirty = false;
+    }
+
+    bool sorting() const {
+        return sortedList != 0L;
+    }
+
+    void append( int i, const QString& string ) {
+        if ( sortedList )
+            sortedList->insert( i, string );
+        else
+            stringList.append( string );
+        dirty = true;
+    }
+
+    void clear() {
+        if ( sortedList )
+            sortedList->clear();
+        stringList.clear();
+        dirty = false;
+    }
+
+    uint count() const {
+        if ( sortedList )
+            return sortedList->count();
+        return stringList.count();
+    }
+
+    bool isEmpty() const {
+        return count() == 0;
+    }
+
+    QString first() const {
+        return list().first();
+    }
+
+    QString last() const {
+        return list().last();
+    }
+
+    QStringList list() const;
+
+    mutable QStringList stringList;
+    KCompletionMatchesList *sortedList;
+    mutable bool dirty;
+};
+
+
+class KCompletionPrivate
+{
+public:
+
+
+    KCompletionMatchesWrapper matches;
+};
+
+KCompletion::KCompletion()
+{
+    d = new KCompletionPrivate;
+
+    myCompletionMode = KGlobalSettings::completionMode();
+    myTreeRoot = new KCompTreeNode;
+    myBeep = true;
+    myIgnoreCase = false;
+    myHasMultipleMatches = false;
+    myRotationIndex = 0;
+    setOrder( Insertion );
+}
+
+KCompletion::~KCompletion()
+{
+    delete d;
+    delete myTreeRoot;
+}
+
+void KCompletion::setOrder( CompOrder order )
+{
+    myOrder = order;
+    d->matches.setSorting( order == Weighted );
+}
+
+void KCompletion::setIgnoreCase( bool ignoreCase )
+{
+    myIgnoreCase = ignoreCase;
+}
+
+void KCompletion::setItems( const QStringList& items )
+{
+    clear();
+    insertItems( items );
+}
+
+
+void KCompletion::insertItems( const QStringList& items )
+{
+    bool weighted = (myOrder == Weighted);
+    QStringList::ConstIterator it;
+    if ( weighted ) {
+        for ( it = items.begin(); it != items.end(); ++it )
+            addWeightedItem( *it );
+    }
+    else {
+        for ( it = items.begin(); it != items.end(); ++it )
+            addItem( *it, 0 );
+    }
+}
+
+
+QStringList KCompletion::items() const
+{
+    KCompletionMatchesWrapper list;
+    bool addWeight = (myOrder == Weighted);
+    extractStringsFromNode( myTreeRoot, QString::null, &list, addWeight );
+
+    return list.list();
+}
+
+
+void KCompletion::addItem( const QString& item )
+{
+    d->matches.clear();
+    myRotationIndex = 0;
+    myLastString = QString::null;
+
+    addItem( item, 0 );
+}
+
+void KCompletion::addItem( const QString& item, uint weight )
+{
+    if ( item.isEmpty() )
+        return;
+
+    KCompTreeNode *node = myTreeRoot;
+    uint len = item.length();
+
+    bool sorted = (myOrder == Sorted);
+    bool weighted = ((myOrder == Weighted) && weight > 1);
+
+
+
+
+    for ( uint i = 0; i < len; i++ ) {
+        node = node->insert( item.at(i), sorted );
+        if ( weighted )
+            node->confirm( weight -1 );
+    }
+
+
+    node = node->insert( 0x0, true );
+    if ( weighted )
+        node->confirm( weight -1 );
+
+}
+
+void KCompletion::addWeightedItem( const QString& item )
+{
+    if ( myOrder != Weighted ) {
+        addItem( item, 0 );
+        return;
+    }
+
+    uint len = item.length();
+    uint weight = 0;
+
+
+    int index = item.findRev(':');
+    if ( index > 0 ) {
+        bool ok;
+        weight = item.mid( index + 1 ).toUInt( &ok );
+        if ( !ok )
+            weight = 0;
+
+        len = index;
+    }
+
+    addItem( item.left( len ), weight );
+    return;
+}
+
+
+void KCompletion::removeItem( const QString& item )
+{
+    d->matches.clear();
+    myRotationIndex = 0;
+    myLastString = QString::null;
+
+    myTreeRoot->remove( item );
+}
+
+
+void KCompletion::clear()
+{
+    d->matches.clear();
+    myRotationIndex = 0;
+    myLastString = QString::null;
+
+    delete myTreeRoot;
+    myTreeRoot = new KCompTreeNode;
+}
+
+
+QString KCompletion::makeCompletion( const QString& string )
+{
+    if ( myCompletionMode == KGlobalSettings::CompletionNone )
+        return QString::null;
+
+
+
+    d->matches.clear();
+    myRotationIndex = 0;
+    myHasMultipleMatches = false;
+    myLastMatch = myCurrentMatch;
+
+
+
+    if ( myCompletionMode == KGlobalSettings::CompletionShell &&
+         string == myLastString ) {
+
+
+
+
+        findAllCompletions( string, &d->matches, myHasMultipleMatches );
+        QStringList l = d->matches.list();
+        postProcessMatches( &l );
+        matches( l );
+
+        if ( l.isEmpty() )
+            doBeep( NoMatch );
+
+        return QString::null;
+    }
+
+    QString completion;
+
+    if ( myCompletionMode == KGlobalSettings::CompletionPopup ||
+         myCompletionMode == KGlobalSettings::CompletionPopupAuto ) {
+        findAllCompletions( string, &d->matches, myHasMultipleMatches );
+        if ( !d->matches.isEmpty() )
+            completion = d->matches.first();
+    }
+    else
+        completion = findCompletion( string );
+
+    if ( myHasMultipleMatches )
+        multipleMatches();
+
+    myLastString = string;
+    myCurrentMatch = completion;
+
+    postProcessMatch( &completion );
+
+    if ( !string.isEmpty() ) {
+
+        match( completion );
+    }
+
+    if ( completion.isNull() )
+        doBeep( NoMatch );
+
+    return completion;
+}
+
+
+QStringList KCompletion::substringCompletion( const QString& string ) const
+{
+
+    bool sorted = (myOrder == Weighted);
+    KCompletionMatchesWrapper allItems( sorted );
+    extractStringsFromNode( myTreeRoot, QString::null, &allItems, false );
+
+    QStringList list = allItems.list();
+
+
+
+    if ( list.isEmpty() ) {
+        doBeep( NoMatch );
+        return list;
+    }
+
+    if ( string.isEmpty() ) {
+        postProcessMatches( &list );
+        return list;
+    }
+
+    QStringList matches;
+    QStringList::ConstIterator it = list.begin();
+
+    for( ; it != list.end(); ++it ) {
+        QString item = *it;
+        if ( item.find( string, 0, false ) != -1 ) {
+            postProcessMatch( &item );
+            matches.append( item );
+        }
+    }
+
+    if ( matches.isEmpty() )
+        doBeep( NoMatch );
+
+    return matches;
+}
+
+
+void KCompletion::setCompletionMode( KGlobalSettings::Completion mode )
+{
+    myCompletionMode = mode;
+}
+
+
+QStringList KCompletion::allMatches()
+{
+
+
+
+    KCompletionMatchesWrapper matches( myOrder == Weighted );
+    bool dummy;
+    findAllCompletions( myLastString, &matches, dummy );
+    QStringList l = matches.list();
+    postProcessMatches( &l );
+    return l;
+}
+
+KCompletionMatches KCompletion::allWeightedMatches()
+{
+
+
+
+    KCompletionMatchesWrapper matches( myOrder == Weighted );
+    bool dummy;
+    findAllCompletions( myLastString, &matches, dummy );
+    KCompletionMatches ret( matches );
+    postProcessMatches( &ret );
+    return ret;
+}
+
+QStringList KCompletion::allMatches( const QString &string )
+{
+    KCompletionMatchesWrapper matches( myOrder == Weighted );
+    bool dummy;
+    findAllCompletions( string, &matches, dummy );
+    QStringList l = matches.list();
+    postProcessMatches( &l );
+    return l;
+}
+
+KCompletionMatches KCompletion::allWeightedMatches( const QString &string )
+{
+    KCompletionMatchesWrapper matches( myOrder == Weighted );
+    bool dummy;
+    findAllCompletions( string, &matches, dummy );
+    KCompletionMatches ret( matches );
+    postProcessMatches( &ret );
+    return ret;
+}
+
+
+
+
+
+QString KCompletion::nextMatch()
+{
+    QString completion;
+    myLastMatch = myCurrentMatch;
+
+    if ( d->matches.isEmpty() ) {
+        findAllCompletions( myLastString, &d->matches, myHasMultipleMatches );
+        completion = d->matches.first();
+        myCurrentMatch = completion;
+        myRotationIndex = 0;
+        postProcessMatch( &completion );
+        match( completion );
+        return completion;
+    }
+
+    QStringList matches = d->matches.list();
+    myLastMatch = matches[ myRotationIndex++ ];
+
+    if ( myRotationIndex == matches.count() -1 )
+        doBeep( Rotation );
+
+    else if ( myRotationIndex == matches.count() )
+        myRotationIndex = 0;
+
+    completion = matches[ myRotationIndex ];
+    myCurrentMatch = completion;
+    postProcessMatch( &completion );
+    match( completion );
+    return completion;
+}
+
+
+
+QString KCompletion::previousMatch()
+{
+    QString completion;
+    myLastMatch = myCurrentMatch;
+
+    if ( d->matches.isEmpty() ) {
+        findAllCompletions( myLastString, &d->matches, myHasMultipleMatches );
+        completion = d->matches.last();
+        myCurrentMatch = completion;
+        myRotationIndex = 0;
+        postProcessMatch( &completion );
+        match( completion );
+        return completion;
+    }
+
+    QStringList matches = d->matches.list();
+    myLastMatch = matches[ myRotationIndex ];
+    if ( myRotationIndex == 1 )
+        doBeep( Rotation );
+
+    else if ( myRotationIndex == 0 )
+        myRotationIndex = matches.count();
+
+    myRotationIndex--;
+
+    completion = matches[ myRotationIndex ];
+    myCurrentMatch = completion;
+    postProcessMatch( &completion );
+    match( completion );
+    return completion;
+}
+
+
+
+
+QString KCompletion::findCompletion( const QString& string )
+{
+    QChar ch;
+    QString completion;
+    const KCompTreeNode *node = myTreeRoot;
+
+
+    for( uint i = 0; i < string.length(); i++ ) {
+        ch = string.at( i );
+        node = node->find( ch );
+
+        if ( node )
+            completion += ch;
+        else
+            return QString::null;
+    }
+
+
+
+
+
+    while ( node->childrenCount() == 1 ) {
+        node = node->firstChild();
+        if ( !node->isNull() )
+            completion += *node;
+    }
+
+
+    if ( node && node->childrenCount() > 1 ) {
+        myHasMultipleMatches = true;
+
+        if ( myCompletionMode == KGlobalSettings::CompletionAuto ) {
+            myRotationIndex = 1;
+            if (myOrder != Weighted) {
+                while ( (node = node->firstChild()) ) {
+                    if ( !node->isNull() )
+                        completion += *node;
+                    else
+                        break;
+                }
+            }
+            else {
+
+
+
+                const KCompTreeNode* temp_node = 0L;
+                while(1) {
+                    int count = node->childrenCount();
+                    temp_node = node->firstChild();
+                    uint weight = temp_node->weight();
+                    const KCompTreeNode* hit = temp_node;
+                    for( int i = 1; i < count; i++ ) {
+                        temp_node = node->childAt(i);
+                        if( temp_node->weight() > weight ) {
+                            hit = temp_node;
+                            weight = hit->weight();
+                        }
+                    }
+
+                    if ( hit->isNull() )
+                        break;
+
+                    node = hit;
+                    completion += *node;
+                }
+            }
+        }
+
+        else
+            doBeep( PartialMatch );
+    }
+
+    return completion;
+}
+
+
+void KCompletion::findAllCompletions(const QString& string,
+                                     KCompletionMatchesWrapper *matches,
+                                     bool& hasMultipleMatches) const
+{
+
+
+    if ( string.isEmpty() )
+        return;
+
+    if ( myIgnoreCase ) {
+        extractStringsFromNodeCI( myTreeRoot, QString::null, string, matches );
+        hasMultipleMatches = (matches->count() > 1);
+        return;
+    }
+
+    QChar ch;
+    QString completion;
+    const KCompTreeNode *node = myTreeRoot;
+
+
+    for( uint i = 0; i < string.length(); i++ ) {
+        ch = string.at( i );
+        node = node->find( ch );
+
+        if ( node )
+            completion += ch;
+        else
+            return;
+    }
+
+
+
+
+
+    while ( node->childrenCount() == 1 ) {
+        node = node->firstChild();
+        if ( !node->isNull() )
+            completion += *node;
+
+    }
+
+
+
+    if ( node->childrenCount() == 0 )
+        matches->append( node->weight(), completion );
+
+    else {
+
+
+        hasMultipleMatches = true;
+        extractStringsFromNode( node, completion, matches );
+    }
+}
+
+
+void KCompletion::extractStringsFromNode( const KCompTreeNode *node,
+                                          const QString& beginning,
+                                          KCompletionMatchesWrapper *matches,
+                                          bool addWeight ) const
+{
+    if ( !node || !matches )
+        return;
+
+
+    const KCompTreeChildren *list = node->children();
+    QString string;
+    QString w;
+
+
+    for ( KCompTreeNode *cur = list->begin(); cur ; cur = cur->next) {
+        string = beginning;
+        node = cur;
+        if ( !node->isNull() )
+            string += *node;
+
+        while ( node && node->childrenCount() == 1 ) {
+            node = node->firstChild();
+            if ( node->isNull() )
+                break;
+            string += *node;
+        }
+
+        if ( node && node->isNull() ) {
+            if ( addWeight ) {
+
+                string += ':';
+                w.setNum( node->weight() );
+                string.append( w );
+            }
+            matches->append( node->weight(), string );
+        }
+
+
+        if ( node && node->childrenCount() > 1 )
+            extractStringsFromNode( node, string, matches, addWeight );
+    }
+}
+
+void KCompletion::extractStringsFromNodeCI( const KCompTreeNode *node,
+                                            const QString& beginning,
+                                            const QString& restString,
+                                            KCompletionMatchesWrapper *matches ) const
+{
+    if ( restString.isEmpty() ) {
+        extractStringsFromNode( node, beginning, matches, false );
+        return;
+    }
+
+    QChar ch1 = restString.at(0);
+    QString newRest = restString.mid(1);
+    KCompTreeNode *child1, *child2;
+
+    child1 = node->find( ch1 );
+    if ( child1 )
+        extractStringsFromNodeCI( child1, beginning + *child1, newRest,
+                                  matches );
+
+
+    if ( ch1.isLetter() ) {
+
+        QChar ch2 = ch1.lower();
+        if ( ch1 == ch2 )
+            ch2 = ch1.upper();
+        if ( ch1 != ch2 ) {
+            child2 = node->find( ch2 );
+            if ( child2 )
+                extractStringsFromNodeCI( child2, beginning + *child2, newRest,
+                                          matches );
+        }
+    }
+}
+
+
+void KCompletion::doBeep( BeepMode mode ) const
+{
+    if ( !myBeep )
+        return;
+
+    QString text, event;
+
+    switch ( mode ) {
+        case Rotation:
+            event = QString::fromLatin1("Textcompletion: rotation");
+            text = i18n("You reached the end of the list\nof matching items.\n");
+            break;
+        case PartialMatch:
+            if ( myCompletionMode == KGlobalSettings::CompletionShell ||
+                 myCompletionMode == KGlobalSettings::CompletionMan ) {
+                event = QString::fromLatin1("Textcompletion: partial match");
+                text = i18n("The completion is ambiguous, more than one\nmatch is available.\n");
+            }
+            break;
+        case NoMatch:
+            if ( myCompletionMode == KGlobalSettings::CompletionShell ) {
+                event = QString::fromLatin1("Textcompletion: no match");
+                text = i18n("There is no matching item available.\n");
+            }
+            break;
+    }
+
+    if ( !text.isEmpty() )
+        KNotifyClient::event( event, text );
+}
+KCompTreeNode::~KCompTreeNode()
+{
+
+    KCompTreeNode *cur = myChildren.begin();
+    while (cur) {
+        KCompTreeNode * next = cur->next;
+        delete myChildren.remove(cur);
+        cur = next;
+    }
+}
+
+
+
+
+KCompTreeNode * KCompTreeNode::insert( const QChar& ch, bool sorted )
+{
+    KCompTreeNode *child = find( ch );
+    if ( !child ) {
+        child = new KCompTreeNode( ch );
+
+
+        if ( sorted ) {
+            KCompTreeNode * prev = 0;
+            KCompTreeNode * cur = myChildren.begin();
+            while ( cur ) {
+                if ( ch > *cur ) {
+                    prev = cur;
+                    cur = cur->next;
+                } else
+                    break;
+            }
+            if (prev)
+                myChildren.insert( prev, child );
+            else
+                myChildren.prepend(child);
+        }
+
+        else
+            myChildren.append( child );
+    }
+
+
+
+    child->confirm();
+
+    return child;
+}
+
+
+
+
+void KCompTreeNode::remove( const QString& str )
+{
+    QString string = str;
+    string += QChar(0x0);
+
+    QPtrVector<KCompTreeNode> deletables( string.length() + 1 );
+
+    KCompTreeNode *child = 0L;
+    KCompTreeNode *parent = this;
+    deletables.insert( 0, parent );
+
+    uint i = 0;
+    for ( ; i < string.length(); i++ )
+    {
+        child = parent->find( string.at( i ) );
+        if ( child )
+            deletables.insert( i + 1, child );
+        else
+            break;
+
+        parent = child;
+    }
+
+    for ( ; i >= 1; i-- )
+    {
+        parent = deletables.at( i - 1 );
+        child = deletables.at( i );
+        if ( child->myChildren.count() == 0 )
+            delete parent->myChildren.remove( child );
+    }
+}
+
+QStringList KCompletionMatchesWrapper::list() const
+{
+    if ( sortedList && dirty ) {
+        sortedList->sort();
+        dirty = false;
+
+        stringList.clear();
+
+
+        QValueListConstIterator<KSortableItem<QString> > it;
+        for ( it = sortedList->begin(); it != sortedList->end(); ++it )
+            stringList.prepend( (*it).value() );
+    }
+
+    return stringList;
+}
+
+KCompletionMatches::KCompletionMatches( bool sort_P )
+    : _sorting( sort_P )
+{
+}
+
+KCompletionMatches::KCompletionMatches( const KCompletionMatchesWrapper& matches )
+    : _sorting( matches.sorting())
+{
+    if( matches.sortedList != 0L )
+        KCompletionMatchesList::operator=( *matches.sortedList );
+    else {
+        QStringList l = matches.list();
+        for( QStringList::ConstIterator it = l.begin();
+             it != l.end();
+             ++it )
+            prepend( KSortableItem<QString, int>( 1, *it ) );
+    }
+}
+
+KCompletionMatches::~KCompletionMatches()
+{
+}
+
+QStringList KCompletionMatches::list( bool sort_P ) const
+{
+    if( _sorting && sort_P )
+        const_cast< KCompletionMatches* >( this )->sort();
+    QStringList stringList;
+
+    for ( ConstIterator it = begin(); it != end(); ++it )
+        stringList.prepend( (*it).value() );
+    return stringList;
+}
+
+void KCompletionMatches::removeDuplicates()
+{
+    Iterator it1, it2;
+    for ( it1 = begin(); it1 != end(); ++it1 ) {
+        for ( (it2 = it1), ++it2; it2 != end();) {
+            if( (*it1).value() == (*it2).value()) {
+
+                (*it1).first = kMax( (*it1).index(), (*it2).index());
+                it2 = remove( it2 );
+                continue;
+            }
+            ++it2;
+        }
+    }
+}
+
+void KCompTreeNodeList::append(KCompTreeNode *item)
+{
+    m_count++;
+    if (!last) {
+        last = item;
+        last->next = 0;
+        first = item;
+        return;
+    }
+    last->next = item;
+    item->next = 0;
+    last = item;
+}
+
+void KCompTreeNodeList::prepend(KCompTreeNode *item)
+{
+    m_count++;
+    if (!last) {
+        last = item;
+        last->next = 0;
+        first = item;
+        return;
+    }
+    item->next = first;
+    first = item;
+}
+
+void KCompTreeNodeList::insert(KCompTreeNode *after, KCompTreeNode *item)
+{
+    if (!after) {
+        append(item);
+        return;
+    }
+
+    m_count++;
+
+    item->next = after->next;
+    after->next = item;
+
+    if (after == last)
+        last = item;
+}
+
+KCompTreeNode *KCompTreeNodeList::remove(KCompTreeNode *item)
+{
+    if (!first || !item)
+        return 0;
+    KCompTreeNode *cur = 0;
+
+    if (item == first)
+        first = first->next;
+    else {
+        cur = first;
+        while (cur && cur->next != item) cur = cur->next;
+        if (!cur)
+            return 0;
+        cur->next = item->next;
+    }
+    if (item == last)
+        last = cur;
+    m_count--;
+    return item;
+}
+
+KCompTreeNode *KCompTreeNodeList::at(uint index) const
+{
+    KCompTreeNode *cur = first;
+    while (index-- && cur) cur = cur->next;
+    return cur;
+}
+
+KZoneAllocator KCompTreeNode::alloc(8192);
+
+void KCompletion::virtual_hook( int, void* )
+{ }
+
+void KCompletionBase::virtual_hook( int, void* )
+{ }
+
+const char *KCompletion::className() const
+{
+    return "KCompletion";
+}
+
+QMetaObject *KCompletion::metaObj = 0;
+static QMetaObjectCleanUp cleanUp_KCompletion( "KCompletion", &KCompletion::staticMetaObject );
+QMetaObject* KCompletion::staticMetaObject()
+{
+    if ( metaObj )
+        return metaObj;
+    QMetaObject* parentObject = QObject::staticMetaObject();
+
+    static const QMetaEnum::Item enum_0[] = {
+        { "Sorted", (int) KCompletion::Sorted },
+        { "Insertion", (int) KCompletion::Insertion },
+        { "Weighted", (int) KCompletion::Weighted }
+    };
+    static const QMetaEnum enum_tbl[] = {
+        { "CompOrder", 3, enum_0, FALSE }
+    };
+
+    static const QUParameter param_slot_0[] = {
+        { "string", &static_QUType_QString, 0, QUParameter::In }
+    };
+    static const QUMethod slot_0 = {"slotMakeCompletion", 1, param_slot_0 };
+    static const QUMethod slot_1 = {"slotPreviousMatch", 0, 0 };
+    static const QUMethod slot_2 = {"slotNextMatch", 0, 0 };
+    static const QUParameter param_slot_3[] = {
+        { "items", &static_QUType_varptr, "\x04", QUParameter::In }
+    };
+    static const QUMethod slot_3 = {"insertItems", 1, param_slot_3 };
+    static const QUParameter param_slot_4[] = {
+        { "list", &static_QUType_varptr, "\x04", QUParameter::In }
+    };
+    static const QUMethod slot_4 = {"setItems", 1, param_slot_4 };
+    static const QUParameter param_slot_5[] = {
+        { "item", &static_QUType_QString, 0, QUParameter::In }
+    };
+    static const QUMethod slot_5 = {"addItem", 1, param_slot_5 };
+    static const QUParameter param_slot_6[] = {
+        { "item", &static_QUType_QString, 0, QUParameter::In },
+        { "weight", &static_QUType_varptr, "\x11", QUParameter::In }
+    };
+    static const QUMethod slot_6 = {"addItem", 2, param_slot_6 };
+    static const QUParameter param_slot_7[] = {
+        { "item", &static_QUType_QString, 0, QUParameter::In }
+    };
+    static const QUMethod slot_7 = {"removeItem", 1, param_slot_7 };
+    static const QUMethod slot_8 = {"clear", 0, 0 };
+    static const QMetaData slot_tbl[] = {
+        { "slotMakeCompletion(const QString&)", &slot_0, QMetaData::Public },
+        { "slotPreviousMatch()", &slot_1, QMetaData::Public },
+        { "slotNextMatch()", &slot_2, QMetaData::Public },
+        { "insertItems(const QStringList&)", &slot_3, QMetaData::Public },
+        { "setItems(const QStringList&)", &slot_4, QMetaData::Public },
+        { "addItem(const QString&)", &slot_5, QMetaData::Public },
+        { "addItem(const QString&,uint)", &slot_6, QMetaData::Public },
+        { "removeItem(const QString&)", &slot_7, QMetaData::Public },
+        { "clear()", &slot_8, QMetaData::Public }
+    };
+    static const QUParameter param_signal_0[] = {
+        { "item", &static_QUType_QString, 0, QUParameter::In }
+    };
+    static const QUMethod signal_0 = {"match", 1, param_signal_0 };
+    static const QUParameter param_signal_1[] = {
+        { "matchlist", &static_QUType_varptr, "\x04", QUParameter::In }
+    };
+    static const QUMethod signal_1 = {"matches", 1, param_signal_1 };
+    static const QUMethod signal_2 = {"multipleMatches", 0, 0 };
+    static const QMetaData signal_tbl[] = {
+        { "match(const QString&)", &signal_0, QMetaData::Public },
+        { "matches(const QStringList&)", &signal_1, QMetaData::Public },
+        { "multipleMatches()", &signal_2, QMetaData::Public }
+    };
+
+    static const QMetaProperty props_tbl[3] = {
+        { "CompOrder","order", 0x0107, &KCompletion::metaObj, &enum_tbl[0], -1 },
+        { "bool","ignoreCase", 0x12000103, &KCompletion::metaObj, 0, -1 },
+        { "QStringList","items", 0x4000103, &KCompletion::metaObj, 0, -1 }
+    };
+
+    metaObj = QMetaObject::new_metaobject(
+        "KCompletion", parentObject,
+        slot_tbl, 9,
+        signal_tbl, 3,
+
+        props_tbl, 3,
+        enum_tbl, 1,
+
+        0, 0 );
+    cleanUp_KCompletion.setMetaObject( metaObj );
+    return metaObj;
+}
+
+void* KCompletion::qt_cast( const char* clname )
+{
+    if ( !qstrcmp( clname, "KCompletion" ) )
+        return this;
+    return QObject::qt_cast( clname );
+}
+
+
+void KCompletion::match( const QString& t0 )
+{
+    activate_signal( staticMetaObject()->signalOffset() + 0, t0 );
+}
+
+
+
+
+
+void KCompletion::matches( const QStringList& t0 )
+{
+    if ( signalsBlocked() )
+        return;
+    QConnectionList *clist = receivers( staticMetaObject()->signalOffset() + 1 );
+    if ( !clist )
+        return;
+    QUObject o[2];
+    static_QUType_varptr.set(o+1,&t0);
+    activate_signal( clist, o );
+}
+
+
+void KCompletion::multipleMatches()
+{
+    activate_signal( staticMetaObject()->signalOffset() + 2 );
+}
+
+bool KCompletion::qt_invoke( int _id, QUObject* _o )
+{
+    switch ( _id - staticMetaObject()->slotOffset() ) {
+    case 0: slotMakeCompletion((const QString&)static_QUType_QString.get(_o+1)); break;
+    case 1: slotPreviousMatch(); break;
+    case 2: slotNextMatch(); break;
+    case 3: insertItems((const QStringList&)*((const QStringList*)static_QUType_ptr.get(_o+1))); break;
+    case 4: setItems((const QStringList&)*((const QStringList*)static_QUType_ptr.get(_o+1))); break;
+    case 5: addItem((const QString&)static_QUType_QString.get(_o+1)); break;
+    case 6: addItem((const QString&)static_QUType_QString.get(_o+1),(uint)(*((uint*)static_QUType_ptr.get(_o+2)))); break;
+    case 7: removeItem((const QString&)static_QUType_QString.get(_o+1)); break;
+    case 8: clear(); break;
+    default:
+        return QObject::qt_invoke( _id, _o );
+    }
+    return TRUE;
+}
+
+bool KCompletion::qt_emit( int _id, QUObject* _o )
+{
+    switch ( _id - staticMetaObject()->signalOffset() ) {
+    case 0: match((const QString&)static_QUType_QString.get(_o+1)); break;
+    case 1: matches((const QStringList&)*((const QStringList*)static_QUType_ptr.get(_o+1))); break;
+    case 2: multipleMatches(); break;
+    default:
+        return QObject::qt_emit(_id,_o);
+    }
+    return TRUE;
+}
+
+
+bool KCompletion::qt_property( int id, int f, QVariant* v)
+{
+    switch ( id - staticMetaObject()->propertyOffset() ) {
+    case 0: switch( f ) {
+        case 0: setOrder((CompOrder&)v->asInt()); break;
+        case 1: *v = QVariant( (int)this->order() ); break;
+        case 3: case 4: case 5: break;
+        default: return FALSE;
+    } break;
+    case 1: switch( f ) {
+        case 0: setIgnoreCase(v->asBool()); break;
+        case 1: *v = QVariant( this->ignoreCase(), 0 ); break;
+        case 3: case 4: case 5: break;
+        default: return FALSE;
+    } break;
+    case 2: switch( f ) {
+        case 0: setItems(v->asStringList()); break;
+        case 1: *v = QVariant( this->items() ); break;
+        case 3: case 4: case 5: break;
+        default: return FALSE;
+    } break;
+    default:
+        return QObject::qt_property( id, f, v );
+    }
+    return TRUE;
+}
+
+bool KCompletion::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C"
+
+int mkstemps(char *, int);
+extern "C"
+
+unsigned long strlcat(char*, const char*, unsigned long);
+
+
+
+
+
+
+extern "C"
+
+unsigned long strlcpy(char*, const char*, unsigned long);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (__const char *__assertion, __const char *__file,
+                           unsigned int __line, __const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, __const char *__file,
+                                  unsigned int __line,
+                                  __const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+template class QAsciiDict<QCString>;
+template class QPtrList<KCmdLineArgs>;
+
+class KCmdLineParsedOptions : public QAsciiDict<QCString>
+{
+public:
+   KCmdLineParsedOptions()
+     : QAsciiDict<QCString>( 7 ) { }
+
+
+
+
+
+
+   QDataStream& save( QDataStream &s) const
+   { return QGDict::write(s); }
+
+   QDataStream& load( QDataStream &s)
+   { return QGDict::read(s); }
+
+protected:
+   virtual QDataStream& write( QDataStream &s, QPtrCollection::Item data) const
+   {
+      QCString *str = (QCString *) data;
+      s << (*str);
+      return s;
+   }
+
+   virtual QDataStream& read( QDataStream &s, QPtrCollection::Item &item)
+   {
+      QCString *str = new QCString;
+      s >> (*str);
+      item = (void *)str;
+      return s;
+   }
+
+};
+
+class KCmdLineParsedArgs : public QStrList
+{
+public:
+   KCmdLineParsedArgs()
+     : QStrList( true ) { }
+   QDataStream& save( QDataStream &s) const
+   { return QGList::write(s); }
+
+   QDataStream& load( QDataStream &s)
+   { return QGList::read(s); }
+};
+
+
+class KCmdLineArgsList: public QPtrList<KCmdLineArgs>
+{
+public:
+   KCmdLineArgsList() { }
+};
+
+KCmdLineArgsList *KCmdLineArgs::argsList = 0;
+int KCmdLineArgs::argc = 0;
+char **KCmdLineArgs::argv = 0;
+char *KCmdLineArgs::mCwd = 0;
+static KStaticDeleter <char> mCwdd;
+const KAboutData *KCmdLineArgs::about = 0;
+bool KCmdLineArgs::parsed = false;
+bool KCmdLineArgs::ignoreUnknown = false;
+
+
+
+
+
+void
+KCmdLineArgs::init(int _argc, char **_argv, const char *_appname, const char* programName,
+                   const char *_description, const char *_version, bool noKApp)
+{
+   init(_argc, _argv,
+        new KAboutData(_appname, programName, _version, _description),
+        noKApp);
+}
+
+void
+KCmdLineArgs::init(int _argc, char **_argv, const char *_appname,
+                   const char *_description, const char *_version, bool noKApp)
+{
+   init(_argc, _argv,
+        new KAboutData(_appname, _appname, _version, _description),
+        noKApp);
+}
+
+void
+KCmdLineArgs::initIgnore(int _argc, char **_argv, const char *_appname )
+{
+   init(_argc, _argv,
+        new KAboutData(_appname, _appname, "unknown", "KDE Application", false));
+   ignoreUnknown = true;
+}
+
+void
+KCmdLineArgs::init(const KAboutData* ab)
+{
+   char **_argv = (char **) malloc(sizeof(char *));
+   _argv[0] = (char *) ab->appName();
+   init(1,_argv,ab, true);
+}
+
+
+void
+KCmdLineArgs::init(int _argc, char **_argv, const KAboutData *_about, bool noKApp)
+{
+   (static_cast<void> ((argsList == 0) ? 0 : (__assert_fail ("argsList == 0", "/coolo/prod/kdelibs/kdecore/kcmdlineargs.cpp", 159, __PRETTY_FUNCTION__), 0)));
+   (static_cast<void> ((argc == 0) ? 0 : (__assert_fail ("argc == 0", "/coolo/prod/kdelibs/kdecore/kcmdlineargs.cpp", 160, __PRETTY_FUNCTION__), 0)));
+   (static_cast<void> ((argv == 0) ? 0 : (__assert_fail ("argv == 0", "/coolo/prod/kdelibs/kdecore/kcmdlineargs.cpp", 161, __PRETTY_FUNCTION__), 0)));
+   (static_cast<void> ((about == 0) ? 0 : (__assert_fail ("about == 0", "/coolo/prod/kdelibs/kdecore/kcmdlineargs.cpp", 162, __PRETTY_FUNCTION__), 0)));
+   argc = _argc;
+   argv = _argv;
+
+   if (!argv)
+   {
+      fprintf(stderr, "\n\nFAILURE (KCmdLineArgs):\n");
+      fprintf(stderr, "Passing null-pointer to 'argv' is not allowed.\n\n");
+
+      (static_cast<void> ((0) ? 0 : (__assert_fail ("0", "/coolo/prod/kdelibs/kdecore/kcmdlineargs.cpp", 171, __PRETTY_FUNCTION__), 0)));
+      exit(255);
+   }
+
+
+   if (argc) {
+     char *p = strrchr( argv[0], '/');
+     if (p)
+       argv[0] = p+1;
+   }
+
+   about = _about;
+   parsed = false;
+   mCwd = mCwdd.setObject(mCwd, new char [4096 +1], true);
+   getcwd(mCwd, 4096);
+   if (!noKApp)
+      KApplication::addCmdLineOptions();
+}
+
+QString KCmdLineArgs::cwd()
+{
+   return QFile::decodeName(QCString(mCwd));
+}
+
+const char * KCmdLineArgs::appName()
+{
+   if (!argc) return 0;
+   return argv[0];
+}
+
+void
+KCmdLineArgs::addCmdLineOptions( const KCmdLineOptions *options, const char *name,
+                                 const char *id, const char *afterId)
+{
+   if (!argsList)
+      argsList = new KCmdLineArgsList();
+
+   int pos = argsList->count();
+
+   if (pos && id && argsList->last() && !argsList->last()->name)
+      pos--;
+
+   KCmdLineArgs *args;
+   int i = 0;
+   for(args = argsList->first(); args; args = argsList->next(), i++)
+   {
+      if (!id && !args->id)
+         return;
+
+      if (id && args->id && (::qstrcmp(id, args->id) == 0))
+         return;
+
+      if (afterId && args->id && (::qstrcmp(afterId, args->id) == 0))
+         pos = i+1;
+   }
+
+   (static_cast<void> ((parsed == false) ? 0 : (__assert_fail ("parsed == false", "/coolo/prod/kdelibs/kdecore/kcmdlineargs.cpp", 227, __PRETTY_FUNCTION__), 0)));
+
+   args = new KCmdLineArgs(options, name, id);
+   argsList->insert(pos, args);
+}
+
+void
+KCmdLineArgs::saveAppArgs( QDataStream &ds)
+{
+   if (!parsed)
+      parseAllArgs();
+
+
+   removeArgs("qt");
+   removeArgs("kde");
+
+   QCString qCwd = mCwd;
+   ds << qCwd;
+
+   uint count = argsList ? argsList->count() : 0;
+   ds << count;
+
+   if (!count) return;
+
+   KCmdLineArgs *args;
+   for(args = argsList->first(); args; args = argsList->next())
+   {
+      args->save(ds);
+   }
+}
+
+void
+KCmdLineArgs::loadAppArgs( QDataStream &ds)
+{
+
+   removeArgs("qt");
+   removeArgs("kde");
+
+   KCmdLineArgs *args;
+   if (argsList)
+   {
+      for(args = argsList->first(); args; args = argsList->next())
+      {
+         args->clear();
+      }
+   }
+
+   QCString qCwd;
+   ds >> qCwd;
+   if (mCwd)
+      delete [] mCwd;
+
+   mCwd = mCwdd.setObject(mCwd, new char[qCwd.length()+1], true);
+   strncpy(mCwd, qCwd.data(), qCwd.length()+1);
+
+   uint count;
+   ds >> count;
+
+   if (count == 0)
+      return;
+
+   if (!argsList || (count != argsList->count()))
+   {
+      fprintf(stderr, "loadAppArgs:: Unexpected number of command line sets "
+                      "(%d instead of %d)\n", count, argsList ? argsList->count() : 0);
+      return;
+   }
+
+   for(args = argsList->first(); args; args = argsList->next())
+   {
+      args->load(ds);
+   }
+}
+
+KCmdLineArgs *KCmdLineArgs::parsedArgs(const char *id)
+{
+   KCmdLineArgs *args = argsList ? argsList->first() : 0;
+   while(args)
+   {
+      if ((id && ::qstrcmp(args->id, id) == 0) || (!id && !args->id))
+      {
+          if (!parsed)
+             parseAllArgs();
+          return args;
+      }
+      args = argsList->next();
+   }
+
+   if (!args)
+   {
+
+      fprintf(stderr, "WARNING (KCmdLineArgs):\n");
+      fprintf(stderr, "Application requests for parsedArgs(\"%s\") without a prior call\n", id?id:"null");
+      fprintf(stderr, "to addCmdLineOptions( ..., \"%s\")\n\n", id?id:"null");
+
+   }
+   return args;
+}
+
+void KCmdLineArgs::removeArgs(const char *id)
+{
+   KCmdLineArgs *args = argsList ? argsList->first() : 0;
+   while(args)
+   {
+      if (args->id && id && ::qstrcmp(args->id, id) == 0)
+      {
+          if (!parsed)
+             parseAllArgs();
+          break;
+      }
+      args = argsList->next();
+   }
+
+   if (args)
+      delete args;
+}
+static int
+findOption(const KCmdLineOptions *options, QCString &opt,
+           const char *&opt_name, const char *&def, bool &enabled)
+{
+   int result;
+   bool inverse;
+   int len = opt.length();
+   while(options && options->name)
+   {
+      result = 0;
+      inverse = false;
+      opt_name = options->name;
+      if (opt_name[0] == '!')
+      {
+         opt_name++;
+         result = 4;
+      }
+      if ((opt_name[0] == 'n') && (opt_name[1] == 'o'))
+      {
+         opt_name += 2;
+         inverse = true;
+      }
+      if (strncmp(opt.data(), opt_name, len) == 0)
+      {
+         opt_name += len;
+         if (!opt_name[0])
+         {
+            if (inverse)
+               return result+2;
+
+            if (!options->description)
+            {
+               options++;
+               if (!options->name)
+                  return result+0;
+               QCString nextOption = options->name;
+               int p = nextOption.find(' ');
+               if (p > 0)
+                  nextOption = nextOption.left(p);
+               if (strncmp(nextOption.data(), "no", 2) == 0)
+               {
+                  nextOption = nextOption.mid(2);
+                  enabled = !enabled;
+               }
+               result = findOption(options, nextOption, opt_name, def, enabled);
+               (static_cast<void> ((result) ? 0 : (__assert_fail ("result", "/coolo/prod/kdelibs/kdecore/kcmdlineargs.cpp", 398, __PRETTY_FUNCTION__), 0)));
+               opt = nextOption;
+               return result;
+            }
+
+            return 1;
+         }
+         if (opt_name[0] == ' ')
+         {
+            opt_name++;
+            def = options->def;
+            return result+3;
+         }
+      }
+
+      options++;
+   }
+   return 0;
+}
+
+
+void
+KCmdLineArgs::findOption(const char *_opt, QCString opt, int &i, bool _enabled, bool &moreOptions)
+{
+   KCmdLineArgs *args = argsList->first();
+   const char *opt_name;
+   const char *def;
+   QCString argument;
+   int j = opt.find('=');
+   if (j != -1)
+   {
+      argument = opt.mid(j+1);
+      opt = opt.left(j);
+   }
+
+   bool enabled = true;
+   int result = 0;
+   while (args)
+   {
+      enabled = _enabled;
+      result = ::findOption(args->options, opt, opt_name, def, enabled);
+      if (result) break;
+      args = argsList->next();
+   }
+   if (!args && (_opt[0] == '-') && _opt[1] && (_opt[1] != '-'))
+   {
+
+
+      int p = 1;
+      while (true)
+      {
+         QCString singleCharOption = " ";
+         singleCharOption[0] = _opt[p];
+         args = argsList->first();
+         while (args)
+         {
+            enabled = _enabled;
+            result = ::findOption(args->options, singleCharOption, opt_name, def, enabled);
+            if (result) break;
+            args = argsList->next();
+         }
+         if (!args)
+            break;
+
+         p++;
+         if (result == 1)
+         {
+            args->setOption(singleCharOption, enabled);
+            if (_opt[p])
+               continue;
+            else
+               return;
+         }
+         else if (result == 3)
+         {
+            if (argument.isEmpty())
+            {
+               argument = _opt+p;
+            }
+            args->setOption(singleCharOption, argument);
+            return;
+         }
+         break;
+      }
+      args = 0;
+      result = 0;
+   }
+
+   if (!args || !result)
+   {
+      if (ignoreUnknown)
+         return;
+      enable_i18n();
+      usage( i18n("Unknown option '%1'.").arg(_opt));
+   }
+
+   if ((result & 4) != 0)
+   {
+      result &= ~4;
+      moreOptions = false;
+   }
+
+   if (result == 3)
+   {
+      if (!enabled)
+      {
+         if (ignoreUnknown)
+            return;
+         enable_i18n();
+         usage( i18n("Unknown option '%1'.").arg(_opt));
+      }
+      if (argument.isEmpty())
+      {
+         i++;
+         if (i >= argc)
+         {
+            enable_i18n();
+            usage( i18n("'%1' missing.").arg( opt_name));
+         }
+         argument = argv[i];
+      }
+      args->setOption(opt, argument);
+   }
+   else
+   {
+      args->setOption(opt, enabled);
+   }
+}
+
+void
+KCmdLineArgs::printQ(const QString &msg)
+{
+   QCString localMsg = msg.local8Bit();
+   fprintf(stdout, "%s", localMsg.data());
+}
+
+void
+KCmdLineArgs::parseAllArgs()
+{
+   bool allowArgs = false;
+   bool inOptions = true;
+   bool everythingAfterArgIsArgs = false;
+   KCmdLineArgs *appOptions = argsList->last();
+   if (!appOptions->id)
+   {
+     const KCmdLineOptions *option = appOptions->options;
+     while(option && option->name)
+     {
+       if (option->name[0] == '+')
+           allowArgs = true;
+       if ( option->name[0] == '!' && option->name[1] == '+' )
+       {
+           allowArgs = true;
+           everythingAfterArgIsArgs = true;
+       }
+       option++;
+     }
+   }
+   for(int i = 1; i < argc; i++)
+   {
+      if (!argv[i])
+         continue;
+
+      if ((argv[i][0] == '-') && argv[i][1] && inOptions)
+      {
+         bool enabled = true;
+         const char *option = &argv[i][1];
+         const char *orig = argv[i];
+         if (option[0] == '-')
+         {
+            option++;
+            argv[i]++;
+            if (!option[0])
+            {
+               inOptions = false;
+               continue;
+            }
+         }
+         if (::qstrcmp(option, "help") == 0)
+         {
+            usage(0);
+         }
+         else if (strncmp(option, "help-",5) == 0)
+         {
+            usage(option+5);
+         }
+         else if ( (::qstrcmp(option, "version") == 0) ||
+                   (::qstrcmp(option, "v") == 0))
+         {
+            printQ( QString("Qt: %1\n").arg(qVersion()));
+            printQ( QString("KDE: %1\n").arg("3.1.90 (CVS >= 20030827)"));
+            printQ( QString("%1: %2\n").
+                        arg(about->programName()).arg(about->version()));
+            exit(0);
+         } else if ( (::qstrcmp(option, "license") == 0) )
+         {
+            enable_i18n();
+            printQ( about->license() );
+            printQ( "\n" );
+            exit(0);
+         } else if ( ::qstrcmp( option, "author") == 0 ) {
+             enable_i18n();
+             if ( about ) {
+                 const QValueList<KAboutPerson> authors = about->authors();
+                 if ( !authors.isEmpty() ) {
+                     QString authorlist;
+                     for (QValueList<KAboutPerson>::ConstIterator it = authors.begin(); it != authors.end(); ++it ) {
+                         QString email;
+                         if ( !(*it).emailAddress().isEmpty() )
+                                 email = " <" + (*it).emailAddress() + ">";
+                         authorlist += QString("    ") + (*it).name() + email + "\n";
+                     }
+                     printQ( i18n("the 2nd argument is a list of name+address, one on each line","%1 was written by\n%2").arg ( QString(about->programName()) ).arg( authorlist ) );
+                 }
+             } else {
+                 printQ( i18n("%1 was written by somebody who wants to remain anonymous.").arg(about->programName()) );
+             }
+             if (!about->bugAddress().isEmpty())
+             {
+                if (about->bugAddress() == "submit@bugs.kde.org")
+                    printQ( i18n( "Please use http://bugs.kde.org to report bugs, do not mail the authors directly.\n" ) );
+                else
+                    printQ( i18n( "Please use %1 to report bugs, do not mail the authors directly.\n" ).arg(about->bugAddress()) );
+             }
+             exit(0);
+         } else {
+           if ((option[0] == 'n') && (option[1] == 'o'))
+           {
+              option += 2;
+              enabled = false;
+           }
+           findOption(orig, option, i, enabled, inOptions);
+         }
+      }
+      else
+      {
+
+         if (!allowArgs)
+         {
+            if (ignoreUnknown)
+               continue;
+            enable_i18n();
+            usage( i18n("Unexpected argument '%1'.").arg( argv[i]));
+         }
+         else
+         {
+            appOptions->addArgument(argv[i]);
+            if (everythingAfterArgIsArgs)
+                inOptions = false;
+         }
+      }
+   }
+   parsed = true;
+}
+
+
+
+
+
+
+int *
+KCmdLineArgs::qt_argc()
+{
+   if (!argsList)
+      KApplication::addCmdLineOptions();
+
+   KCmdLineArgs *args = parsedArgs("qt");
+
+   (static_cast<void> ((args) ? 0 : (__assert_fail ("args", "/coolo/prod/kdelibs/kdecore/kcmdlineargs.cpp", 666, __PRETTY_FUNCTION__), 0)));
+   if (!argv)
+   {
+      fprintf(stderr, "\n\nFAILURE (KCmdLineArgs):\n");
+      fprintf(stderr, "Application has not called KCmdLineArgs::init(...).\n\n");
+
+      (static_cast<void> ((0) ? 0 : (__assert_fail ("0", "/coolo/prod/kdelibs/kdecore/kcmdlineargs.cpp", 672, __PRETTY_FUNCTION__), 0)));
+      exit(255);
+   }
+
+   (static_cast<void> ((argc >= (args->count()+1)) ? 0 : (__assert_fail ("argc >= (args->count()+1)", "/coolo/prod/kdelibs/kdecore/kcmdlineargs.cpp", 676, __PRETTY_FUNCTION__), 0)));
+   argc = args->count() +1;
+   return &argc;
+}
+
+
+
+
+
+
+char ***
+KCmdLineArgs::qt_argv()
+{
+   if (!argsList)
+      KApplication::addCmdLineOptions();
+
+   KCmdLineArgs *args = parsedArgs("qt");
+   (static_cast<void> ((args) ? 0 : (__assert_fail ("args", "/coolo/prod/kdelibs/kdecore/kcmdlineargs.cpp", 693, __PRETTY_FUNCTION__), 0)));
+   if (!argv)
+   {
+      fprintf(stderr, "\n\nFAILURE (KCmdLineArgs):\n");
+      fprintf(stderr, "Application has not called KCmdLineArgs::init(...).\n\n");
+
+      (static_cast<void> ((0) ? 0 : (__assert_fail ("0", "/coolo/prod/kdelibs/kdecore/kcmdlineargs.cpp", 699, __PRETTY_FUNCTION__), 0)));
+      exit(255);
+   }
+
+   int i = 0;
+   for(; i < args->count(); i++)
+   {
+      argv[i+1] = (char *) args->arg(i);
+   }
+   argv[i+1] = 0;
+
+   return &argv;
+}
+
+void
+KCmdLineArgs::enable_i18n()
+{
+
+    if (KGlobal::_locale)
+            return;
+
+    if (!KGlobal::_instance) {
+        KInstance *instance = new KInstance(about);
+        (void) instance->config();
+
+    }
+}
+
+void
+KCmdLineArgs::usage(const QString &error)
+{
+    (static_cast<void> ((KGlobal::_locale) ? 0 : (__assert_fail ("KGlobal::_locale", "/coolo/prod/kdelibs/kdecore/kcmdlineargs.cpp", 730, __PRETTY_FUNCTION__), 0)));
+    QCString localError = error.local8Bit();
+    if (localError[error.length()-1] == '\n')
+        localError = localError.left(error.length()-1);
+    fprintf(stderr, "%s: %s\n", argv[0], localError.data());
+
+    QString tmp = i18n("Use --help to get a list of available command line options.");
+    localError = tmp.local8Bit();
+    fprintf(stderr, "%s: %s\n", argv[0], localError.data());
+    exit(254);
+}
+
+void
+KCmdLineArgs::usage(const char *id)
+{
+   enable_i18n();
+   (static_cast<void> ((argsList != 0) ? 0 : (__assert_fail ("argsList != 0", "/coolo/prod/kdelibs/kdecore/kcmdlineargs.cpp", 746, __PRETTY_FUNCTION__), 0)));
+
+
+   QString optionFormatString = "  %1 %2\n";
+   QString optionFormatStringDef = "  %1 %2 [%3]\n";
+   QString optionHeaderString = i18n("\n%1:\n");
+   QString tmp;
+   QString usage;
+
+   KCmdLineArgs *args = argsList->last();
+
+   if (!(args->id) && (args->options) &&
+       (args->options->name) && (args->options->name[0] != '+'))
+   {
+      usage = i18n("[options] ")+usage;
+   }
+
+   while(args)
+   {
+      if (args->name)
+      {
+         usage = i18n("[%1-options]").arg(args->name)+" "+usage;
+      }
+      args = argsList->prev();
+   }
+
+   KCmdLineArgs *appOptions = argsList->last();
+   if (!appOptions->id)
+   {
+     const KCmdLineOptions *option = appOptions->options;
+     while(option && option->name)
+     {
+       if (option->name[0] == '+')
+          usage = usage + (option->name+1) + " ";
+       else if ( option->name[0] == '!' && option->name[1] == '+' )
+          usage = usage + (option->name+2) + " ";
+
+       option++;
+     }
+   }
+
+   printQ(i18n("Usage: %1 %2\n").arg(argv[0]).arg(usage));
+   printQ("\n"+about->shortDescription()+"\n");
+
+   printQ(optionHeaderString.arg(i18n("Generic options")));
+   printQ(optionFormatString.arg("--help", -25).arg(i18n("Show help about options")));
+
+   args = argsList->first();
+   while(args)
+   {
+      if (args->name && args->id)
+      {
+         QString option = QString("--help-%1").arg(args->id);
+         QString desc = i18n("Show %1 specific options").arg(args->name);
+
+         printQ(optionFormatString.arg(option, -25).arg(desc));
+      }
+      args = argsList->next();
+   }
+
+   printQ(optionFormatString.arg("--help-all",-25).arg(i18n("Show all options")));
+   printQ(optionFormatString.arg("--author",-25).arg(i18n("Show author information")));
+   printQ(optionFormatString.arg("-v, --version",-25).arg(i18n("Show version information")));
+   printQ(optionFormatString.arg("--license",-25).arg(i18n("Show license information")));
+   printQ(optionFormatString.arg("--", -25).arg(i18n("End of options")));
+
+   args = argsList->first();
+
+   bool showAll = id && (::qstrcmp(id, "all") == 0);
+
+   if (!showAll)
+   {
+     while(args)
+     {
+       if (!id && !args->id) break;
+       if (id && (::qstrcmp(args->id, id) == 0)) break;
+       args = argsList->next();
+     }
+   }
+
+   while(args)
+   {
+     bool hasArgs = false;
+     bool hasOptions = false;
+     while (args)
+     {
+       const KCmdLineOptions *option = args->options;
+       QCString opt = "";
+
+       while(option && option->name)
+       {
+         QString description;
+         QString descriptionRest;
+         QStringList dl;
+         if (option->description)
+         {
+            description = i18n(option->description);
+            dl = QStringList::split("\n", description, true);
+            description = dl.first();
+            dl.remove( dl.begin() );
+         }
+         QCString name = option->name;
+         if (name[0] == '!')
+             name = name.mid(1);
+
+         if (name[0] == '+')
+         {
+            if (!hasArgs)
+            {
+               printQ(i18n("\nArguments:\n"));
+               hasArgs = true;
+            }
+
+            name = name.mid(1);
+            if ((name[0] == '[') && (name[name.length()-1] == ']'))
+               name = name.mid(1, name.length()-2);
+            printQ(optionFormatString.arg(name, -25)
+                 .arg(description));
+         }
+         else
+         {
+            if (!hasOptions)
+            {
+               if (!args->name)
+                  printQ(i18n("\nOptions:\n"));
+               else if (args->name)
+                  printQ(optionHeaderString.arg(i18n("%1 options").arg(QString::fromLatin1(args->name))));
+               hasOptions = true;
+            }
+
+            if ((name.length() == 1) || (name[1] == ' '))
+               name = "-"+name;
+            else
+               name = "--"+name;
+            if (!option->description)
+            {
+               opt = name + ", ";
+            }
+            else
+            {
+               opt = opt + name;
+               if (!option->def)
+               {
+                  printQ(optionFormatString.arg(opt, -25)
+                         .arg(description));
+               }
+               else
+               {
+                  printQ(optionFormatStringDef.arg(opt, -25)
+                         .arg(description).arg(option->def));
+               }
+               opt = "";
+            }
+         }
+         for(QStringList::Iterator it = dl.begin();
+             it != dl.end();
+             ++it)
+         {
+            printQ(optionFormatString.arg("", -25).arg(*it));
+         }
+
+         option++;
+       }
+       args = argsList->next();
+       if (!args || args->name || !args->id) break;
+     }
+     if (!showAll) break;
+   }
+
+   exit(254);
+}
+KCmdLineArgs::KCmdLineArgs( const KCmdLineOptions *_options,
+                            const char *_name, const char *_id)
+  : options(_options), name(_name), id(_id)
+{
+  parsedOptionList = 0;
+  parsedArgList = 0;
+  isQt = (::qstrcmp(id, "qt") == 0);
+}
+
+
+
+
+KCmdLineArgs::~KCmdLineArgs()
+{
+  delete parsedOptionList;
+  delete parsedArgList;
+  if (argsList)
+  {
+     argsList->removeRef(this);
+     if (argsList->count() == 0)
+     {
+        delete argsList;
+        argsList = 0;
+     }
+  }
+}
+
+void
+KCmdLineArgs::clear()
+{
+   delete parsedArgList;
+   parsedArgList = 0;
+   delete parsedOptionList;
+   parsedOptionList = 0;
+}
+
+void
+KCmdLineArgs::save( QDataStream &ds) const
+{
+   uint count = 0;
+   if (parsedOptionList)
+      parsedOptionList->save( ds );
+   else
+      ds << count;
+
+   if (parsedArgList)
+      parsedArgList->save( ds );
+   else
+      ds << count;
+}
+
+void
+KCmdLineArgs::load( QDataStream &ds)
+{
+   if (!parsedOptionList) parsedOptionList = new KCmdLineParsedOptions;
+   if (!parsedArgList) parsedArgList = new KCmdLineParsedArgs;
+
+   parsedOptionList->load( ds );
+   parsedArgList->load( ds );
+
+   if (parsedOptionList->count() == 0)
+   {
+      delete parsedOptionList;
+      parsedOptionList = 0;
+   }
+   if (parsedArgList->count() == 0)
+   {
+      delete parsedArgList;
+      parsedArgList = 0;
+   }
+}
+
+void
+KCmdLineArgs::setOption(const QCString &opt, bool enabled)
+{
+   if (isQt)
+   {
+
+      QCString arg = "-";
+      if( !enabled )
+          arg += "no";
+      arg += opt;
+      addArgument(arg);
+   }
+   if (!parsedOptionList) {
+        parsedOptionList = new KCmdLineParsedOptions;
+        parsedOptionList->setAutoDelete(true);
+   }
+
+   if (enabled)
+      parsedOptionList->replace( opt, new QCString("t") );
+   else
+      parsedOptionList->replace( opt, new QCString("f") );
+}
+
+void
+KCmdLineArgs::setOption(const QCString &opt, const char *value)
+{
+   if (isQt)
+   {
+
+      QCString arg = "-";
+      arg += opt;
+      addArgument(arg);
+      addArgument(value);
+
+
+      if (arg == "-display")
+      {
+         setenv("DISPLAY", value, true);
+      }
+   }
+   if (!parsedOptionList) {
+        parsedOptionList = new KCmdLineParsedOptions;
+        parsedOptionList->setAutoDelete(true);
+   }
+
+   parsedOptionList->insert( opt, new QCString(value) );
+}
+
+QCString
+KCmdLineArgs::getOption(const char *_opt) const
+{
+   QCString *value = 0;
+   if (parsedOptionList)
+   {
+      value = parsedOptionList->find(_opt);
+   }
+
+   if (value)
+      return (*value);
+
+
+   const char *opt_name;
+   const char *def;
+   bool dummy = true;
+   QCString opt = _opt;
+   int result = ::findOption( options, opt, opt_name, def, dummy) & ~4;
+
+   if (result != 3)
+   {
+      fprintf(stderr, "\n\nFAILURE (KCmdLineArgs):\n");
+      fprintf(stderr, "Application requests for getOption(\"%s\") but the \"%s\" option\n",
+                      _opt, _opt);
+      fprintf(stderr, "has never been specified via addCmdLineOptions( ... )\n\n");
+
+      (static_cast<void> ((0) ? 0 : (__assert_fail ("0", "/coolo/prod/kdelibs/kdecore/kcmdlineargs.cpp", 1073, __PRETTY_FUNCTION__), 0)));
+      exit(255);
+   }
+   return QCString(def);
+}
+
+QCStringList
+KCmdLineArgs::getOptionList(const char *_opt) const
+{
+   QCStringList result;
+   if (!parsedOptionList)
+      return result;
+
+   while(true)
+   {
+      QCString *value = parsedOptionList->take(_opt);
+      if (!value)
+         break;
+      result.prepend(*value);
+      delete value;
+   }
+
+
+
+
+
+
+   for(QCStringList::ConstIterator it=result.begin();
+       it != result.end();
+       ++it)
+   {
+      parsedOptionList->insert(_opt, new QCString(*it));
+   }
+   return result;
+}
+
+bool
+KCmdLineArgs::isSet(const char *_opt) const
+{
+
+   const char *opt_name;
+   const char *def;
+   bool dummy = true;
+   QCString opt = _opt;
+   int result = ::findOption( options, opt, opt_name, def, dummy) & ~4;
+
+   if (result == 0)
+   {
+      fprintf(stderr, "\n\nFAILURE (KCmdLineArgs):\n");
+      fprintf(stderr, "Application requests for isSet(\"%s\") but the \"%s\" option\n",
+                      _opt, _opt);
+      fprintf(stderr, "has never been specified via addCmdLineOptions( ... )\n\n");
+
+      (static_cast<void> ((0) ? 0 : (__assert_fail ("0", "/coolo/prod/kdelibs/kdecore/kcmdlineargs.cpp", 1126, __PRETTY_FUNCTION__), 0)));
+      exit(255);
+   }
+
+   QCString *value = 0;
+   if (parsedOptionList)
+   {
+      value = parsedOptionList->find(opt);
+   }
+
+   if (value)
+   {
+      if (result == 3)
+         return true;
+      else
+         return ((*value)[0] == 't');
+   }
+
+   if (result == 3)
+      return false;
+
+
+
+   return (result == 2);
+}
+
+int
+KCmdLineArgs::count() const
+{
+   if (!parsedArgList)
+      return 0;
+   return parsedArgList->count();
+}
+
+const char *
+KCmdLineArgs::arg(int n) const
+{
+   if (!parsedArgList || (n >= (int) parsedArgList->count()))
+   {
+      fprintf(stderr, "\n\nFAILURE (KCmdLineArgs): Argument out of bounds\n");
+      fprintf(stderr, "Application requests for arg(%d) without checking count() first.\n",
+                      n);
+
+      (static_cast<void> ((0) ? 0 : (__assert_fail ("0", "/coolo/prod/kdelibs/kdecore/kcmdlineargs.cpp", 1169, __PRETTY_FUNCTION__), 0)));
+      exit(255);
+   }
+
+   return parsedArgList->at(n);
+}
+
+KURL
+KCmdLineArgs::url(int n) const
+{
+   return makeURL( arg(n) );
+}
+
+KURL KCmdLineArgs::makeURL( const char *urlArg )
+{
+   if (*urlArg == '/')
+   {
+      KURL result;
+      result.setPath(QFile::decodeName( urlArg));
+      return result;
+   }
+
+   if ( !KURL::isRelativeURL( QString::fromLocal8Bit(urlArg) ) )
+     return KURL(QString::fromLocal8Bit(urlArg));
+
+   KURL result;
+   result.setPath( cwd()+"/"+QFile::decodeName( urlArg ));
+   result.cleanPath();
+   return result;
+}
+
+void
+KCmdLineArgs::addArgument(const char *argument)
+{
+   if (!parsedArgList)
+      parsedArgList = new KCmdLineParsedArgs;
+
+   parsedArgList->append(argument);
+}
+
+
+
+
+QString
+KAboutPerson::name() const
+{
+   return QString::fromUtf8(mName);
+}
+
+QString
+KAboutPerson::task() const
+{
+   if (mTask && *mTask)
+      return i18n(mTask);
+   else
+      return QString::null;
+}
+
+QString
+KAboutPerson::emailAddress() const
+{
+   return QString::fromUtf8(mEmailAddress);
+}
+
+
+QString
+KAboutPerson::webAddress() const
+{
+   return QString::fromUtf8(mWebAddress);
+}
+
+
+KAboutTranslator::KAboutTranslator(const QString & name,
+                const QString & emailAddress)
+{
+    mName=name;
+    mEmail=emailAddress;
+}
+
+QString KAboutTranslator::name() const
+{
+    return mName;
+}
+
+QString KAboutTranslator::emailAddress() const
+{
+    return mEmail;
+}
+
+class KAboutDataPrivate
+{
+public:
+    KAboutDataPrivate()
+        : translatorName("_: NAME OF TRANSLATORS\nYour names")
+        , translatorEmail("_: EMAIL OF TRANSLATORS\nYour emails")
+        {};
+    const char *translatorName;
+    const char *translatorEmail;
+};
+
+
+
+KAboutData::KAboutData( const char *appName,
+                        const char *programName,
+                        const char *version,
+                        const char *shortDescription,
+                        int licenseType,
+                        const char *copyrightStatement,
+                        const char *text,
+                        const char *homePageAddress,
+                        const char *bugsEmailAddress
+                        ) :
+  mProgramName( programName ),
+  mVersion( version ),
+  mShortDescription( shortDescription ),
+  mLicenseKey( licenseType ),
+  mCopyrightStatement( copyrightStatement ),
+  mOtherText( text ),
+  mHomepageAddress( homePageAddress ),
+  mBugEmailAddress( bugsEmailAddress )
+{
+   d = new KAboutDataPrivate;
+
+   if( appName ) {
+     const char *p = strrchr(appName, '/');
+     if( p )
+         mAppName = p+1;
+     else
+         mAppName = appName;
+   } else
+     mAppName = 0;
+}
+
+KAboutData::~KAboutData()
+{
+    delete d;
+}
+
+void
+KAboutData::addAuthor( const char *name, const char *task,
+                    const char *emailAddress, const char *webAddress )
+{
+  mAuthorList.append(KAboutPerson(name,task,emailAddress,webAddress));
+}
+
+void
+KAboutData::addCredit( const char *name, const char *task,
+                    const char *emailAddress, const char *webAddress )
+{
+  mCreditList.append(KAboutPerson(name,task,emailAddress,webAddress));
+}
+
+void
+KAboutData::setTranslator( const char *name, const char *emailAddress)
+{
+  d->translatorName=name;
+  d->translatorEmail=emailAddress;
+}
+
+void
+KAboutData::setLicenseText( const char *licenseText )
+{
+  mLicenseText = licenseText;
+  mLicenseKey = License_Custom;
+}
+
+void
+KAboutData::setLicenseTextFile( const QString &file )
+{
+  mLicenseText = qstrdup(QFile::encodeName(file));
+  mLicenseKey = License_File;
+}
+
+
+const char *
+KAboutData::appName() const
+{
+   return mAppName;
+}
+
+QString
+KAboutData::programName() const
+{
+   if (mProgramName && *mProgramName)
+      return i18n(mProgramName);
+   else
+      return QString::null;
+}
+
+QString
+KAboutData::version() const
+{
+   return QString::fromLatin1(mVersion);
+}
+
+QString
+KAboutData::shortDescription() const
+{
+   if (mShortDescription && *mShortDescription)
+      return i18n(mShortDescription);
+   else
+      return QString::null;
+}
+
+QString
+KAboutData::homepage() const
+{
+   return QString::fromLatin1(mHomepageAddress);
+}
+
+QString
+KAboutData::bugAddress() const
+{
+   return QString::fromLatin1(mBugEmailAddress);
+}
+
+const QValueList<KAboutPerson>
+KAboutData::authors() const
+{
+   return mAuthorList;
+}
+
+const QValueList<KAboutPerson>
+KAboutData::credits() const
+{
+   return mCreditList;
+}
+
+const QValueList<KAboutTranslator>
+KAboutData::translators() const
+{
+    QValueList<KAboutTranslator> personList;
+
+    if(d->translatorName == 0)
+        return personList;
+
+    QStringList nameList;
+    QStringList emailList;
+
+    QString names = i18n(d->translatorName);
+    if(names != QString::fromUtf8(d->translatorName))
+    {
+        nameList = QStringList::split(',',names);
+    }
+
+
+    if(d->translatorEmail)
+    {
+        QString emails = i18n(d->translatorEmail);
+
+        if(emails != QString::fromUtf8(d->translatorEmail))
+        {
+            emailList = QStringList::split(',',emails,true);
+        }
+    }
+
+
+    QStringList::Iterator nit;
+    QStringList::Iterator eit=emailList.begin();
+
+    for(nit = nameList.begin(); nit != nameList.end(); ++nit)
+    {
+        QString email;
+        if(eit != emailList.end())
+        {
+            email=*eit;
+            ++eit;
+        }
+
+        QString name=*nit;
+
+        personList.append(KAboutTranslator( name, email));
+    }
+
+    return personList;
+}
+
+QString
+KAboutData::aboutTranslationTeam()
+{
+    return i18n("replace this with information about your translation team",
+            "<p>KDE is translated into many languages thanks to the work "
+            "of the translation teams all over the world.</p>"
+            "<p>For more information on KDE internationalization "
+            "visit http://i18n.kde.org</p>");
+}
+
+QString
+KAboutData::otherText() const
+{
+   if (mOtherText && *mOtherText)
+      return i18n(mOtherText);
+   else
+      return QString::null;
+}
+
+
+QString
+KAboutData::license() const
+{
+  QString l;
+  QString f;
+  switch ( mLicenseKey )
+  {
+    case License_File:
+       f = QFile::decodeName(mLicenseText);
+       break;
+    case License_GPL_V2:
+       l = "GPL v2";
+       f = locate("data", "LICENSES/GPL_V2");
+       break;
+    case License_LGPL_V2:
+       l = "LGPL v2";
+       f = locate("data", "LICENSES/LGPL_V2");
+       break;
+    case License_BSD:
+       l = "BSD License";
+       f = locate("data", "LICENSES/BSD");
+       break;
+    case License_Artistic:
+       l = "Artistic License";
+       f = locate("data", "LICENSES/ARTISTIC");
+       break;
+    case License_QPL_V1_0:
+       l = "QPL v1.0";
+       f = locate("data", "LICENSES/QPL_V1.0");
+       break;
+    case License_Custom:
+       if (mLicenseText && *mLicenseText)
+          return( i18n(mLicenseText) );
+
+    default:
+       return i18n("No licensing terms for this program have been specified.\n"
+                   "Please check the documentation or the source for any\n"
+                   "licensing terms.\n");
+      }
+
+  QString result;
+  if (!l.isEmpty())
+     result = i18n("This program is distributed under the terms of the %1.").arg( l );
+
+  if (!f.isEmpty())
+  {
+     QFile file(f);
+     if (file.open(0x0001))
+     {
+        result += '\n';
+        result += '\n';
+        QTextStream str(&file);
+        result += str.read();
+     }
+  }
+
+  return result;
+}
+
+QString
+KAboutData::copyrightStatement() const
+{
+  if (mCopyrightStatement && *mCopyrightStatement)
+     return i18n(mCopyrightStatement);
+  else
+     return QString::null;
+}
+KCompletionBase::KCompletionBase()
+{
+    m_delegate = 0L;
+
+    m_iCompletionMode = KGlobalSettings::completionMode();
+
+
+
+    useGlobalKeyBindings();
+
+
+
+
+    setup( false, false, false );
+}
+
+KCompletionBase::~KCompletionBase()
+{
+    if( m_bAutoDelCompObj && m_pCompObj )
+    {
+        delete m_pCompObj;
+    }
+}
+
+void KCompletionBase::setDelegate( KCompletionBase *delegate )
+{
+    m_delegate = delegate;
+
+    if ( m_delegate ) {
+        m_delegate->m_bAutoDelCompObj = m_bAutoDelCompObj;
+        m_delegate->m_bHandleSignals = m_bHandleSignals;
+        m_delegate->m_bEmitSignals = m_bEmitSignals;
+        m_delegate->m_iCompletionMode = m_iCompletionMode;
+        m_delegate->m_keyMap = m_keyMap;
+    }
+}
+
+KCompletion* KCompletionBase::completionObject( bool hsig )
+{
+    if ( m_delegate )
+        return m_delegate->completionObject( hsig );
+
+    if ( !m_pCompObj )
+    {
+        setCompletionObject( new KCompletion(), hsig );
+        m_bAutoDelCompObj = true;
+    }
+    return m_pCompObj;
+}
+
+void KCompletionBase::setCompletionObject( KCompletion* compObj, bool hsig )
+{
+    if ( m_delegate ) {
+        m_delegate->setCompletionObject( compObj, hsig );
+        return;
+    }
+
+    if ( m_bAutoDelCompObj && compObj != m_pCompObj )
+        delete m_pCompObj;
+
+    m_pCompObj = compObj;
+
+
+
+    setup( false, hsig, !m_pCompObj.isNull() );
+}
+
+
+void KCompletionBase::setHandleSignals( bool handle )
+{
+    if ( m_delegate )
+        m_delegate->setHandleSignals( handle );
+    else
+        m_bHandleSignals = handle;
+}
+
+void KCompletionBase::setCompletionMode( KGlobalSettings::Completion mode )
+{
+    if ( m_delegate ) {
+        m_delegate->setCompletionMode( mode );
+        return;
+    }
+
+    m_iCompletionMode = mode;
+
+
+    if( m_pCompObj && m_iCompletionMode != KGlobalSettings::CompletionNone )
+        m_pCompObj->setCompletionMode( m_iCompletionMode );
+}
+
+bool KCompletionBase::setKeyBinding( KeyBindingType item, const KShortcut& cut )
+{
+    if ( m_delegate )
+        return m_delegate->setKeyBinding( item, cut );
+
+
+    if( !cut.isNull() )
+    {
+        for( KeyBindingMap::Iterator it = m_keyMap.begin(); it != m_keyMap.end(); ++it )
+            if( it.data() == cut ) return false;
+    }
+    m_keyMap.replace( item, cut );
+    return true;
+}
+
+void KCompletionBase::useGlobalKeyBindings()
+{
+    if ( m_delegate ) {
+        m_delegate->useGlobalKeyBindings();
+        return;
+    }
+
+    m_keyMap.clear();
+    m_keyMap.insert( TextCompletion, 0 );
+    m_keyMap.insert( PrevCompletionMatch, 0 );
+    m_keyMap.insert( NextCompletionMatch, 0 );
+    m_keyMap.insert( SubstringCompletion, 0 );
+}
+
+void KCompletionBase::setup( bool autodel, bool hsig, bool esig )
+{
+    if ( m_delegate ) {
+        m_delegate->setup( autodel, hsig, esig );
+        return;
+    }
+
+    m_bAutoDelCompObj = autodel;
+    m_bHandleSignals = hsig;
+    m_bEmitSignals = esig;
+}
+
+
+
+
+
+template<class type>
+class QPtrStack : protected QGList
+{
+public:
+    QPtrStack() { }
+    QPtrStack( const QPtrStack<type> &s ) : QGList( s ) { }
+    ~QPtrStack() { clear(); }
+    QPtrStack<type> &operator=(const QPtrStack<type> &s)
+                        { return (QPtrStack<type>&)QGList::operator=(s); }
+    bool autoDelete() const { return QPtrCollection::autoDelete(); }
+    void setAutoDelete( bool del ) { QPtrCollection::setAutoDelete(del); }
+    uint count() const { return QGList::count(); }
+    bool isEmpty() const { return QGList::count() == 0; }
+    void push( const type *d ) { QGList::insertAt(0,Item(d)); }
+    type *pop() { return (type *)QGList::takeFirst(); }
+    bool remove() { return QGList::removeFirst(); }
+    void clear() { QGList::clear(); }
+    type *top() const { return (type *)QGList::cfirst(); }
+          operator type *() const { return (type *)QGList::cfirst(); }
+    type *current() const { return (type *)QGList::cfirst(); }
+
+
+
+
+
+
+
+private:
+    void deleteItem( Item d );
+};
+
+
+template<> inline void QPtrStack<void>::deleteItem( QPtrCollection::Item )
+{
+}
+
+
+template<class type> inline void QPtrStack<type>::deleteItem( QPtrCollection::Item d )
+{
+    if ( del_item ) delete (type *)d;
+}
+
+
+static const char daemonName[] = "knotify";
+
+static int sendNotifyEvent(const QString &message, const QString &text,
+                            int present, int level, const QString &sound,
+                            const QString &file, int winId )
+{
+  if (!KApplication::kApplication()) return 0;
+
+  DCOPClient *client=KApplication::kApplication()->dcopClient();
+  if (!client->isAttached())
+  {
+    client->attach();
+    if (!client->isAttached())
+      return 0;
+  }
+
+  int uniqueId = kMax( 1, KApplication::kApplication()->random() );
+
+  QByteArray data;
+  QDataStream ds(data, 0x0002);
+  QString appname = KNotifyClient::instance()->instanceName();
+ ds << message << appname << text << sound << file << present << level
+    << winId << uniqueId;
+
+  if ( !KNotifyClient::startDaemon() )
+      return 0;
+
+  if ( client->send(daemonName, "Notify", "notify(QString,QString,QString,QString,QString,int,int,int,int)", data) )
+  {
+      return uniqueId;
+  }
+
+  return 0;
+}
+
+int KNotifyClient::event( StandardEvent type, const QString& text )
+{
+    return event( 0, type, text );
+}
+
+int KNotifyClient::event(const QString &message, const QString &text)
+{
+    return event(0, message, text);
+}
+
+int KNotifyClient::userEvent(const QString &text, int present, int level,
+                              const QString &sound, const QString &file)
+{
+    return userEvent( 0, text, present, level, sound, file );
+}
+
+
+int KNotifyClient::event( int winId, StandardEvent type, const QString& text )
+{
+    QString message;
+    switch ( type ) {
+    case cannotOpenFile:
+        message = QString::fromLatin1("cannotopenfile");
+        break;
+    case warning:
+        message = QString::fromLatin1("warning");
+        break;
+    case fatalError:
+        message = QString::fromLatin1("fatalerror");
+        break;
+    case catastrophe:
+        message = QString::fromLatin1("catastrophe");
+        break;
+    case notification:
+    default:
+        message = QString::fromLatin1("notification");
+        break;
+    }
+
+    return sendNotifyEvent( message, text, Default, Default,
+                            QString::null, QString::null, winId );
+}
+
+int KNotifyClient::event(int winId, const QString &message,
+                          const QString &text)
+{
+  return sendNotifyEvent(message, text, Default, Default, QString::null, QString::null, winId);
+}
+
+int KNotifyClient::userEvent(int winId, const QString &text, int present,
+                              int level,
+                              const QString &sound, const QString &file)
+{
+  return sendNotifyEvent(QString::null, text, present, level, sound, file, winId);
+}
+
+int KNotifyClient::getPresentation(const QString &eventname)
+{
+        int present;
+        if (eventname.isEmpty()) return Default;
+
+        KConfig eventsfile( KNotifyClient::instance()->instanceName()+".eventsrc", true, false);
+        eventsfile.setGroup(eventname);
+
+        present=eventsfile.readNumEntry("presentation", -1);
+
+        return present;
+}
+
+QString KNotifyClient::getFile(const QString &eventname, int present)
+{
+        if (eventname.isEmpty()) return QString::null;
+
+        KConfig eventsfile( KNotifyClient::instance()->instanceName()+".eventsrc", true, false);
+        eventsfile.setGroup(eventname);
+
+        switch (present)
+        {
+        case (Sound):
+                return eventsfile.readPathEntry("soundfile");
+        case (Logfile):
+                return eventsfile.readPathEntry("logfile");
+        }
+
+        return QString::null;
+}
+
+int KNotifyClient::getDefaultPresentation(const QString &eventname)
+{
+        int present;
+        if (eventname.isEmpty()) return Default;
+
+        KConfig eventsfile( KNotifyClient::instance()->instanceName()+"/eventsrc", true, false, "data");
+        eventsfile.setGroup(eventname);
+
+        present=eventsfile.readNumEntry("default_presentation", -1);
+
+        return present;
+}
+
+QString KNotifyClient::getDefaultFile(const QString &eventname, int present)
+{
+        if (eventname.isEmpty()) return QString::null;
+
+        KConfig eventsfile( KNotifyClient::instance()->instanceName()+"/eventsrc", true, false, "data");
+        eventsfile.setGroup(eventname);
+
+        switch (present)
+        {
+        case (Sound):
+                return eventsfile.readPathEntry("default_sound");
+        case (Logfile):
+                return eventsfile.readPathEntry("default_logfile");
+        }
+
+        return QString::null;
+}
+
+bool KNotifyClient::startDaemon()
+{
+  static bool firstTry = true;
+  if (firstTry && !KApplication::kApplication()->dcopClient()->isApplicationRegistered(daemonName)) {
+    firstTry = false;
+    return KApplication::startServiceByDesktopName(daemonName) == 0;
+  }
+  return true;
+}
+
+
+void KNotifyClient::beep(const QString& reason)
+{
+  if ( !KApplication::kApplication() || KNotifyClient::Instance::currentInstance()->useSystemBell() ) {
+    QApplication::beep();
+    return;
+  }
+
+  DCOPClient *client=KApplication::kApplication()->dcopClient();
+  if (!client->isAttached())
+  {
+    client->attach();
+    if (!client->isAttached() || !client->isApplicationRegistered(daemonName))
+    {
+      QApplication::beep();
+      return;
+    }
+  }
+
+  if ( client->isApplicationRegistered( "kaccess" ) )
+  {
+      QApplication::beep();
+      return;
+  }
+
+  KNotifyClient::event(KNotifyClient::notification, reason);
+}
+
+
+KInstance * KNotifyClient::instance() {
+    return KNotifyClient::Instance::current();
+}
+
+
+class KNotifyClient::InstanceStack
+{
+public:
+        InstanceStack() { m_defaultInstance = 0; }
+        virtual ~InstanceStack() { delete m_defaultInstance; }
+        void push(Instance *instance) { m_instances.push(instance); }
+
+        void pop(Instance *instance)
+        {
+                if (m_instances.top() == instance)
+                        m_instances.pop();
+                else if (!m_instances.isEmpty())
+                {
+                        kdWarning(160) << "Tried to remove an Instance that is not the current," << endl;
+                        kdWarning(160) << "Resetting to the main KApplication." << endl;
+                        m_instances.clear();
+                }
+                else
+                        kdWarning(160) << "Tried to remove an Instance, but the stack was empty." << endl;
+    }
+
+        Instance *currentInstance()
+        {
+                if (m_instances.isEmpty())
+                {
+                        m_defaultInstance = new Instance(KApplication::kApplication());
+                }
+                return m_instances.top();
+        }
+
+private:
+        QPtrStack<Instance> m_instances;
+        Instance *m_defaultInstance;
+};
+
+KNotifyClient::InstanceStack * KNotifyClient::Instance::s_instances = 0L;
+static KStaticDeleter<KNotifyClient::InstanceStack > instancesDeleter;
+
+struct KNotifyClient::InstancePrivate
+{
+    KInstance *instance;
+    bool useSystemBell;
+};
+
+KNotifyClient::Instance::Instance(KInstance *instance)
+{
+    d = new InstancePrivate;
+    d->instance = instance;
+    instances()->push(this);
+
+    KConfig *config = instance->config();
+    KConfigGroupSaver cs( config, "General" );
+    d->useSystemBell = config->readBoolEntry( "UseSystemBell", false );
+}
+
+KNotifyClient::Instance::~Instance()
+{
+        if (s_instances)
+                s_instances->pop(this);
+        delete d;
+}
+
+KNotifyClient::InstanceStack *KNotifyClient::Instance::instances()
+{
+        if (!s_instances)
+                instancesDeleter.setObject(s_instances, new InstanceStack);
+        return s_instances;
+}
+
+bool KNotifyClient::Instance::useSystemBell() const
+{
+    return d->useSystemBell;
+}
+KNotifyClient::Instance * KNotifyClient::Instance::currentInstance()
+{
+        return instances()->currentInstance();
+}
+
+KInstance *KNotifyClient::Instance::current()
+{
+    return currentInstance()->d->instance;
+}
+
+
+
+class KAudioPlayerPrivate;
+class KAudioPlayer : public QObject {
+public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+public:
+
+
+
+
+
+
+
+        KAudioPlayer( const QString& filename,
+                        QObject* parent = 0, const char* name = 0 );
+
+
+
+
+        ~KAudioPlayer();
+
+
+
+
+
+
+
+        static void play(const QString &filename);
+
+public :
+
+
+
+
+
+        void play();
+private:
+        KAudioPlayerPrivate *d;
+};
+
+
+class KAudioPlayerPrivate {
+public:
+        QString filename;
+
+        KAudioPlayerPrivate(const QString &filename) : filename(filename) { };
+};
+
+KAudioPlayer::KAudioPlayer( const QString& filename,
+                        QObject* parent, const char* name ) : QObject(parent,name)
+{
+        d = new KAudioPlayerPrivate(filename);
+}
+
+KAudioPlayer::~KAudioPlayer()
+{
+        delete d;
+}
+
+void KAudioPlayer::play(const QString &filename)
+{
+        KAudioPlayer ap(filename);
+        ap.play();
+}
+
+void KAudioPlayer::play()
+{
+        KNotifyClient::userEvent("KAudioPlayer event",
+                                                        KNotifyClient::Sound,KNotifyClient::Notification,d->filename);
+}
+
+const char *KAudioPlayer::className() const
+{
+    return "KAudioPlayer";
+}
+
+QMetaObject *KAudioPlayer::metaObj = 0;
+static QMetaObjectCleanUp cleanUp_KAudioPlayer( "KAudioPlayer", &KAudioPlayer::staticMetaObject );
+QMetaObject* KAudioPlayer::staticMetaObject()
+{
+    if ( metaObj )
+        return metaObj;
+    QMetaObject* parentObject = QObject::staticMetaObject();
+    static const QUMethod slot_0 = {"play", 0, 0 };
+    static const QMetaData slot_tbl[] = {
+        { "play()", &slot_0, QMetaData::Public }
+    };
+    metaObj = QMetaObject::new_metaobject(
+        "KAudioPlayer", parentObject,
+        slot_tbl, 1,
+        0, 0,
+
+        0, 0,
+        0, 0,
+
+        0, 0 );
+    cleanUp_KAudioPlayer.setMetaObject( metaObj );
+    return metaObj;
+}
+
+void* KAudioPlayer::qt_cast( const char* clname )
+{
+    if ( !qstrcmp( clname, "KAudioPlayer" ) )
+        return this;
+    return QObject::qt_cast( clname );
+}
+
+bool KAudioPlayer::qt_invoke( int _id, QUObject* _o )
+{
+    switch ( _id - staticMetaObject()->slotOffset() ) {
+    case 0: play(); break;
+    default:
+        return QObject::qt_invoke( _id, _o );
+    }
+    return TRUE;
+}
+
+bool KAudioPlayer::qt_emit( int _id, QUObject* _o )
+{
+    return QObject::qt_emit(_id,_o);
+}
+
+
+bool KAudioPlayer::qt_property( int id, int f, QVariant* v)
+{
+    return QObject::qt_property( id, f, v);
+}
+
+bool KAudioPlayer::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; }
+
+
+
+
+
+class KDCOPPropertyProxyPrivate;
+class KDCOPPropertyProxy
+{
+public:
+
+
+
+
+
+  KDCOPPropertyProxy( QObject *object );
+
+
+
+  ~KDCOPPropertyProxy();
+
+
+
+
+
+  bool isPropertyRequest( const QCString &fun );
+
+
+
+
+
+  bool processPropertyRequest( const QCString &fun, const QByteArray &data, QCString &replyType,
+                               QByteArray &replyData );
+
+
+
+
+
+  QValueList<QCString> functions();
+  static QValueList<QCString> functions( QObject *object );
+  static bool isPropertyRequest( const QCString &fun, QObject *object );
+
+
+
+
+
+  static bool processPropertyRequest( const QCString &fun, const QByteArray &data, QCString &replyType,
+                                      QByteArray &replyData, QObject *object );
+
+private:
+  static bool decodePropertyRequestInternal( const QCString &fun, QObject *object, bool &set,
+                                             QCString &propName, QCString &arg );
+
+  KDCOPPropertyProxyPrivate *d;
+};
+
+
+
+
+
+
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (__const char *__assertion, __const char *__file,
+                           unsigned int __line, __const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, __const char *__file,
+                                  unsigned int __line,
+                                  __const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+
+
+
+class KDCOPPropertyProxyPrivate
+{
+public:
+  KDCOPPropertyProxyPrivate()
+  {
+  }
+  ~KDCOPPropertyProxyPrivate()
+  {
+  }
+
+  QObject *m_object;
+};
+
+KDCOPPropertyProxy::KDCOPPropertyProxy( QObject *object )
+{
+  d = new KDCOPPropertyProxyPrivate;
+  d->m_object = object;
+}
+
+KDCOPPropertyProxy::~KDCOPPropertyProxy()
+{
+  delete d;
+}
+
+bool KDCOPPropertyProxy::isPropertyRequest( const QCString &fun )
+{
+  return isPropertyRequest( fun, d->m_object );
+}
+
+bool KDCOPPropertyProxy::processPropertyRequest( const QCString &fun, const QByteArray &data,
+                                                 QCString &replyType, QByteArray &replyData )
+{
+  return processPropertyRequest( fun, data, replyType, replyData, d->m_object );
+}
+
+QValueList<QCString> KDCOPPropertyProxy::functions()
+{
+  return functions( d->m_object );
+}
+
+bool KDCOPPropertyProxy::isPropertyRequest( const QCString &fun, QObject *object )
+{
+  if ( fun == "property(QCString)" ||
+       fun == "setProperty(QCString,QVariant)" ||
+       fun == "propertyNames(bool)" )
+    return true;
+
+  bool set;
+  QCString propName, arg;
+  return decodePropertyRequestInternal( fun, object, set, propName, arg );
+}
+
+QValueList<QCString> KDCOPPropertyProxy::functions( QObject *object )
+{
+  QValueList<QCString> res;
+  res << "QVariant property(QCString property)";
+  res << "bool setProperty(QCString name,QVariant property)";
+  res << "QValueList<QCString> propertyNames(bool super)";
+
+  QMetaObject *metaObj = object->metaObject();
+  QStrList properties = metaObj->propertyNames( true );
+  QStrListIterator it( properties );
+  for (; it.current(); ++it )
+  {
+    const QMetaProperty *metaProp = metaObj->property( metaObj->findProperty( it.current(), true ), true );
+
+    (static_cast<void> ((metaProp) ? 0 : (__assert_fail ("metaProp", "/coolo/prod/kdelibs/kdecore/kdcoppropertyproxy.cpp", 104, __PRETTY_FUNCTION__), 0)));
+
+    QCString name = it.current();
+    name.prepend( " " );
+    name.prepend( metaProp->type() );
+    name.append( "()" );
+    res << name;
+
+    if ( metaProp->writable() )
+    {
+      QCString setName = it.current();
+      setName[ 0 ] = toupper( setName[ 0 ] );
+      setName = "void set" + setName + "(" + metaProp->type() + " " + it.current() + ")";
+      res << setName;
+    }
+  }
+
+  return res;
+}
+
+bool KDCOPPropertyProxy::processPropertyRequest( const QCString &fun, const QByteArray &data,
+                                                 QCString &replyType, QByteArray &replyData,
+                                                 QObject *object )
+{
+  if ( fun == "property(QCString)" )
+  {
+    QCString propName;
+    QDataStream stream( data, 0x0001 );
+    stream >> propName;
+
+    replyType = "QVariant";
+    QDataStream reply( replyData, 0x0002 );
+    reply << object->property( propName );
+    return true;
+  }
+
+  if ( fun == "setProperty(QCString,QVariant)" )
+  {
+    QCString propName;
+    QVariant propValue;
+    QDataStream stream( data, 0x0001 );
+    stream >> propName >> propValue;
+
+    replyType = "bool";
+    QDataStream reply( replyData, 0x0002 );
+    reply << (Q_INT8)object->setProperty( propName, propValue );
+    return true;
+  }
+
+  if ( fun == "propertyNames(bool)" )
+  {
+    Q_INT8 b;
+    QDataStream stream( data, 0x0001 );
+    stream >> b;
+
+    QValueList<QCString> res;
+    QStrList props = object->metaObject()->propertyNames( static_cast<bool>( b ) );
+    QStrListIterator it( props );
+    for (; it.current(); ++it )
+      res.append( it.current() );
+
+    replyType = "QValueList<QCString>";
+    QDataStream reply( replyData, 0x0002 );
+    reply << res;
+    return true;
+  }
+
+  bool set;
+  QCString propName, arg;
+
+  bool res = decodePropertyRequestInternal( fun, object, set, propName, arg );
+  if ( !res )
+    return false;
+
+  if ( set )
+  {
+    QVariant prop;
+    QDataStream stream( data, 0x0001 );
+
+    QVariant::Type type = QVariant::nameToType( arg );
+    if ( type == QVariant::Invalid )
+      return false;
+
+    typedef QValueList<QVariant> ListType;
+    typedef QMap<QString,QVariant> MapType;
+
+    switch ( type )
+    {
+      case QVariant::Cursor: { QCursor v; stream >> v; prop = QVariant( v ); } break;
+      case QVariant::Bitmap: { QBitmap v; stream >> v; prop = QVariant( v ); } break;
+      case QVariant::PointArray: { QPointArray v; stream >> v; prop = QVariant( v ); } break;
+      case QVariant::Region: { QRegion v; stream >> v; prop = QVariant( v ); } break;
+      case QVariant::List: { ListType v; stream >> v; prop = QVariant( v ); } break;
+      case QVariant::Map: { MapType v; stream >> v; prop = QVariant( v ); } break;
+      case QVariant::String: { QString v; stream >> v; prop = QVariant( v ); } break;
+      case QVariant::CString: { QCString v; stream >> v; prop = QVariant( v ); } break;
+      case QVariant::StringList: { QStringList v; stream >> v; prop = QVariant( v ); } break;
+      case QVariant::Font: { QFont v; stream >> v; prop = QVariant( v ); } break;
+      case QVariant::Pixmap: { QPixmap v; stream >> v; prop = QVariant( v ); } break;
+      case QVariant::Image: { QImage v; stream >> v; prop = QVariant( v ); } break;
+      case QVariant::Brush: { QBrush v; stream >> v; prop = QVariant( v ); } break;
+      case QVariant::Point: { QPoint v; stream >> v; prop = QVariant( v ); } break;
+      case QVariant::Rect: { QRect v; stream >> v; prop = QVariant( v ); } break;
+      case QVariant::Size: { QSize v; stream >> v; prop = QVariant( v ); } break;
+      case QVariant::Color: { QColor v; stream >> v; prop = QVariant( v ); } break;
+      case QVariant::Palette: { QPalette v; stream >> v; prop = QVariant( v ); } break;
+      case QVariant::ColorGroup: { QColorGroup v; stream >> v; prop = QVariant( v ); } break;
+      case QVariant::IconSet:
+      {
+        QPixmap val;
+        stream >> val;
+        prop = QVariant( QIconSet( val ) );
+      }
+      break;
+      case QVariant::Int: { int v; stream >> v; prop = QVariant( v ); } break;
+      case QVariant::UInt: { uint v; stream >> v; prop = QVariant( v ); } break;
+      case QVariant::Bool:
+      {
+        Q_INT8 v;
+        stream >> v;
+        prop = QVariant( static_cast<bool>( v ), 1 );
+      }
+        break;
+      case QVariant::Double: { double v; stream >> v; prop = QVariant( v ); } break;
+      default:
+        return false;
+    }
+
+    replyType = "void";
+    return object->setProperty( propName, prop );
+  }
+  else
+  {
+    QVariant prop = object->property( propName );
+
+    if ( prop.type() == QVariant::Invalid )
+      return false;
+
+    replyType = prop.typeName();
+    QDataStream reply( replyData, 0x0002 );
+
+
+
+
+
+    switch ( prop.type() )
+    {
+      case QVariant::Cursor: reply << prop.toCursor(); break;
+      case QVariant::Bitmap: reply << prop.toBitmap(); break;
+      case QVariant::PointArray: reply << prop.toPointArray(); break;
+      case QVariant::Region: reply << prop.toRegion(); break;
+      case QVariant::List: reply << prop.toList(); break;
+      case QVariant::Map: reply << prop.toMap(); break;
+      case QVariant::String: reply << prop.toString(); break;
+      case QVariant::CString: reply << prop.toCString(); break;
+      case QVariant::StringList: reply << prop.toStringList(); break;
+      case QVariant::Font: reply << prop.toFont(); break;
+      case QVariant::Pixmap: reply << prop.toPixmap(); break;
+      case QVariant::Image: reply << prop.toImage(); break;
+      case QVariant::Brush: reply << prop.toBrush(); break;
+      case QVariant::Point: reply << prop.toPoint(); break;
+      case QVariant::Rect: reply << prop.toRect(); break;
+      case QVariant::Size: reply << prop.toSize(); break;
+      case QVariant::Color: reply << prop.toColor(); break;
+      case QVariant::Palette: reply << prop.toPalette(); break;
+      case QVariant::ColorGroup: reply << prop.toColorGroup(); break;
+      case QVariant::IconSet:
+        reply << prop.toIconSet().pixmap();
+        break;
+      case QVariant::Int: reply << prop.toInt(); break;
+      case QVariant::UInt: reply << prop.toUInt(); break;
+      case QVariant::Bool:
+        reply << (Q_INT8)prop.toBool();
+        break;
+      case QVariant::Double: reply << prop.toDouble(); break;
+      default:
+        return false;
+    }
+
+
+    return true;
+  }
+
+  return false;
+}
+
+bool KDCOPPropertyProxy::decodePropertyRequestInternal( const QCString &fun, QObject *object, bool &set,
+                                                        QCString &propName, QCString &arg )
+{
+  if ( fun.length() < 3 )
+    return false;
+
+  set = false;
+
+  propName = fun;
+
+  if ( propName.left( 3 ) == "set" )
+  {
+    propName.detach();
+    set = true;
+    propName = propName.mid( 3 );
+    int p1 = propName.find( '(' );
+
+    uint len = propName.length();
+
+    if ( propName[ len - 1 ] != ')' )
+      return false;
+
+    arg = propName.mid( p1+1, len - p1 - 2 );
+    propName.truncate( p1 );
+    propName[ 0 ] = tolower( propName[ 0 ] );
+  }
+  else
+    propName.truncate( propName.length() - 2 );
+
+  if ( !object->metaObject()->propertyNames( true ).contains( propName ) )
+    return false;
+
+  return true;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C"
+
+int mkstemps(char *, int);
+extern "C"
+
+unsigned long strlcat(char*, const char*, unsigned long);
+
+
+
+
+
+
+extern "C"
+
+unsigned long strlcpy(char*, const char*, unsigned long);
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C" {
+
+
+struct tms
+  {
+    clock_t tms_utime;
+    clock_t tms_stime;
+
+    clock_t tms_cutime;
+    clock_t tms_cstime;
+  };
+
+
+
+
+
+
+extern clock_t times (struct tms *__buffer) throw ();
+
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+class QHostAddressPrivate;
+
+class QHostAddress
+{
+public:
+    QHostAddress();
+    QHostAddress( Q_UINT32 ip4Addr );
+    QHostAddress( Q_UINT8 *ip6Addr );
+    QHostAddress( const QHostAddress & );
+    virtual ~QHostAddress();
+
+    QHostAddress & operator=( const QHostAddress & );
+
+    void setAddress( Q_UINT32 ip4Addr );
+    void setAddress( Q_UINT8 *ip6Addr );
+
+    bool setAddress( const QString& address );
+
+    bool isIp4Addr() const;
+    Q_UINT32 ip4Addr() const;
+
+    QString toString() const;
+
+
+    bool operator==( const QHostAddress & ) const;
+    bool isNull() const;
+
+private:
+    QHostAddressPrivate* d;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+class QDnsPrivate;
+
+class QDns: public QObject {
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+public:
+    enum RecordType {
+        None,
+        A, Aaaa,
+        Mx, Srv,
+        Cname,
+        Ptr,
+        Txt
+    };
+
+    QDns();
+    QDns( const QString & label, RecordType rr = A );
+    QDns( const QHostAddress & address, RecordType rr = Ptr );
+    virtual ~QDns();
+
+
+    virtual void setLabel( const QString & label );
+    virtual void setLabel( const QHostAddress & address );
+    QString label() const { return l; }
+
+    virtual void setRecordType( RecordType rr = A );
+    RecordType recordType() const { return t; }
+
+
+    bool isWorking() const;
+
+
+    QValueList<QHostAddress> addresses() const;
+
+    class MailServer {
+    public:
+        MailServer( const QString & n=QString::null, Q_UINT16 p=0 )
+            :name(n), priority(p) {}
+        QString name;
+        Q_UINT16 priority;
+       
+    };
+    QValueList<MailServer> mailServers() const;
+
+    class Server {
+    public:
+        Server(const QString & n=QString::null, Q_UINT16 p=0, Q_UINT16 w=0, Q_UINT16 po=0 )
+            : name(n), priority(p), weight(w), port(po) {}
+        QString name;
+        Q_UINT16 priority;
+        Q_UINT16 weight;
+        Q_UINT16 port;
+       
+    };
+    QValueList<Server> servers() const;
+
+    QStringList hostNames() const;
+
+    QStringList texts() const;
+
+    QString canonicalName() const;
+
+    QStringList qualifiedNames() const { return n; }
+
+
+
+
+
+
+protected:
+    void resultsReady();
+
+private :
+    void startQuery();
+
+private:
+    void setStartQueryTimer();
+    QString toInAddrArpaDomain( const QHostAddress &address );
+
+
+
+
+    QString l;
+    QStringList n;
+    RecordType t;
+    QDnsPrivate * d;
+
+    friend class QDnsAnswer;
+};
+
+
+
+
+class QDnsSocket: public QObject {
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+
+protected:
+    QDnsSocket( QObject *, const char * );
+    virtual ~QDnsSocket();
+
+private :
+    virtual void cleanCache();
+    virtual void retransmit();
+    virtual void answer();
+};
+class KExtendedSocketLookup: public QObject
+{
+  public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+public:
+  QDns dnsIpv4, dnsIpv6;
+  int workingCount;
+  const QString& servname;
+  addrinfo hint;
+
+  KExtendedSocketLookup(const QString& hostname, const QString& servname, const addrinfo& hint) :
+    dnsIpv4(KIDNA::toAscii(hostname), QDns::A), dnsIpv6(KIDNA::toAscii(hostname), QDns::Aaaa), workingCount(2),
+    servname(servname), hint(hint)
+  {
+    connect(&dnsIpv4, "2""resultsReady()", this, "1""slotResultsReady()");
+    connect(&dnsIpv6, "2""resultsReady()", this, "1""slotResultsReady()");
+  }
+
+  inline bool isWorking() const
+  { return workingCount; }
+
+  kde_addrinfo *results();
+  static void freeresults(kde_addrinfo* res);
+
+public :
+  void slotResultsReady()
+  {
+    if (--workingCount == 0)
+      resultsReady();
+  }
+
+protected:
+  void resultsReady();
+
+public:
+  friend class KExtendedSocket;
+};
+
+
+
+
+
+
+class KExtendedSocketPrivate
+{
+public:
+  int flags;
+  int status;
+  int syserror;
+
+  timeval timeout;
+  QString host;
+  QString service;
+  QString localhost;
+  QString localservice;
+  kde_addrinfo *resolution;
+  kde_addrinfo *bindres;
+  addrinfo *current;
+
+  KSocketAddress *local;
+  KSocketAddress *peer;
+
+  QSocketNotifier *qsnIn, *qsnOut;
+  int inMaxSize, outMaxSize;
+  bool emitRead : 1, emitWrite : 1;
+  mutable bool addressReusable : 1, ipv6only : 1;
+
+  KExtendedSocketLookup *dns, *dnsLocal;
+
+  KExtendedSocketPrivate() :
+    flags(0), status(0), syserror(0),
+    host(QString::null), service(QString::null), localhost(QString::null), localservice(QString::null),
+    resolution(0), bindres(0), current(0), local(0), peer(0),
+    qsnIn(0), qsnOut(0), inMaxSize(-1), outMaxSize(-1), emitRead(false), emitWrite(false),
+    addressReusable(false), ipv6only(false), dns(0), dnsLocal(0)
+  {
+    timeout.tv_sec = timeout.tv_usec = 0;
+  }
+};
+
+static bool process_flags(int flags, addrinfo &hint)
+{
+  switch (flags & (KExtendedSocket::streamSocket | KExtendedSocket::datagramSocket | KExtendedSocket::rawSocket))
+    {
+    case 0:
+
+
+    case KExtendedSocket::streamSocket:
+
+      hint.ai_socktype = SOCK_STREAM;
+      break;
+
+    case KExtendedSocket::datagramSocket:
+
+      hint.ai_socktype = SOCK_DGRAM;
+      break;
+
+    case KExtendedSocket::rawSocket:
+
+      hint.ai_socktype = SOCK_RAW;
+      break;
+
+    default:
+
+      return false;
+    }
+
+  if ((flags & KExtendedSocket::unixSocket) == KExtendedSocket::unixSocket)
+     hint.ai_family = 1;
+  else if ((flags & KExtendedSocket::ipv4Socket) == KExtendedSocket::ipv4Socket)
+     hint.ai_family = 2;
+
+  else if ((flags & KExtendedSocket::ipv6Socket) == KExtendedSocket::ipv6Socket)
+     hint.ai_family = 10;
+
+
+
+  hint.ai_flags |= (flags & KExtendedSocket::passiveSocket ? 0x0001 : 0) |
+    (flags & KExtendedSocket::canonName ? 0x0002 : 0) |
+    (flags & KExtendedSocket::noResolve ? 0x0004 : 0);
+  return true;
+}
+
+static bool valid_family(addrinfo *p, int flags)
+{
+  if (flags & KExtendedSocket::knownSocket)
+    {
+      if (p->ai_family == 2)
+        {
+          if (flags & 0x0e && (flags & 0x4) == 0)
+            return false;
+          if (flags & 0xf00 && (flags & 0x100) == 0)
+            return false;
+        }
+
+      else if (p->ai_family == 10)
+        {
+          if (flags & 0x0e && (flags & 0x4) == 0)
+            return false;
+          if (flags & 0xf00 && (flags & 0x200) == 0)
+            return false;
+        }
+
+      else if (p->ai_family == 1)
+        {
+          if (flags & 0x0e && (flags & 0x2) == 0)
+            return false;
+        }
+      if (p->ai_family != 2 && p->ai_family != 1
+
+          && p->ai_family != 10
+
+          )
+        return false;
+
+
+    }
+  return true;
+}
+
+static QString pretty_sock(addrinfo *p)
+{
+  KSocketAddress *sa;
+  QString ret;
+
+  sa = KSocketAddress::newAddress(p->ai_addr, p->ai_addrlen);
+  if (sa == __null)
+    return QString::fromLocal8Bit("<invalid>");
+
+  switch (p->ai_family)
+    {
+    case 1:
+      ret = QString::fromLocal8Bit("Unix ");
+      break;
+
+    case 2:
+      ret = QString::fromLocal8Bit("Inet ");
+      break;
+
+
+    case 10:
+      ret = QString::fromLocal8Bit("Inet6 ");
+      break;
+
+
+    default:
+      ret = QString::fromLocal8Bit("<unknown> ");
+      break;
+    }
+
+  ret += sa->pretty();
+  return ret;
+}
+
+
+
+
+
+static int skipData(int fd, unsigned len)
+{
+  char buf[1024];
+  unsigned skipped = 0;
+  while (len)
+    {
+      int count = sizeof(buf);
+      if ((unsigned)count > len)
+        count = len;
+      count = KSocks::self()->read(fd, buf, count);
+      if (count == -1)
+        return -1;
+      else
+        {
+          len -= count;
+          skipped += count;
+        }
+    }
+  return skipped;
+}
+
+
+
+
+static void local_freeaddrinfo(kde_addrinfo *&p)
+{
+  if (p == __null)
+    return;
+
+  if (p->origin == 2)
+    KExtendedSocketLookup::freeresults(p);
+  else
+    kde_freeaddrinfo(p);
+
+  p = __null;
+}
+
+
+
+
+kde_addrinfo* KExtendedSocketLookup::results()
+{
+  QValueList<QHostAddress> v4 = dnsIpv4.addresses();
+
+  QValueList<QHostAddress> v6 = dnsIpv6.addresses();
+
+  addrinfo *p = __null;
+  kde_addrinfo *res = new kde_addrinfo;
+  res->origin = 2;
+  QValueList<QHostAddress>::Iterator it;
+  unsigned short port;
+
+  QString canon = dnsIpv4.canonicalName();
+
+  if (canon.isNull())
+    canon = dnsIpv6.canonicalName();
+
+  char* canonname;
+  if (!canon.isNull())
+    canonname = strdup(canon.latin1());
+  else
+    canonname = 0L;
+
+  if (hint.ai_socktype == 0)
+    hint.ai_socktype = SOCK_STREAM;
+  if (hint.ai_protocol == 0)
+    hint.ai_protocol = IPPROTO_TCP;
+
+  {
+    bool ok;
+    port = htons(servname.toUShort(&ok));
+    if (!ok)
+      {
+        struct servent *sent;
+        sent = getservbyname(servname.latin1(),
+                             hint.ai_protocol == SOCK_DGRAM ? "udp" : "tcp");
+        if (sent == __null)
+          port = 0;
+        else
+          port = sent->s_port;
+      }
+  }
+
+
+  for (it = v6.begin(); it != v6.end(); ++it)
+    {
+      addrinfo *q = new addrinfo;
+      sockaddr_in6 *sin6 = new sockaddr_in6;
+      q->ai_flags = 0;
+      q->ai_family = 10;
+      q->ai_socktype = hint.ai_socktype;
+      q->ai_protocol = hint.ai_protocol;
+      q->ai_addrlen = sizeof(*sin6);
+      q->ai_addr = (sockaddr*)sin6;
+      q->ai_canonname = canonname;
+      q->ai_next = p;
+
+      memset(sin6, 0, sizeof(*sin6));
+
+
+
+      sin6->sin6_family = 10;
+      sin6->sin6_port = port;
+      KInetSocketAddress::stringToAddr(10, (*it).toString().latin1(),
+                                       (void*)&sin6->sin6_addr);
+
+      p = q;
+    }
+
+
+  for (it = v4.begin(); it != v4.end(); ++it)
+    {
+      addrinfo *q = new addrinfo;
+      sockaddr_in *sin = new sockaddr_in;
+      q->ai_flags = 0;
+      q->ai_family = 2;
+      q->ai_socktype = hint.ai_socktype;
+      q->ai_protocol = hint.ai_protocol;
+      q->ai_addrlen = sizeof(*sin);
+      q->ai_addr = (sockaddr*)sin;
+      q->ai_canonname = canonname;
+      q->ai_next = p;
+
+      memset(sin, 0, sizeof(*sin));
+
+
+
+      sin->sin_family = 2;
+      sin->sin_port = port;
+      *(Q_UINT32*)&sin->sin_addr = htonl((*it).ip4Addr());
+
+      p = q;
+    }
+
+  res->data = p;
+  return res;
+}
+
+void KExtendedSocketLookup::freeresults(kde_addrinfo *res)
+{
+  addrinfo *ai = res->data;
+  if (ai == __null)
+    return;
+
+  if (ai->ai_canonname)
+    free(ai->ai_canonname);
+  while (ai)
+    {
+      struct addrinfo *ai2 = ai;
+
+      if (ai->ai_addr != __null)
+        delete ai->ai_addr;
+
+      ai = ai->ai_next;
+      delete ai2;
+    }
+  delete res;
+}
+
+
+
+
+
+
+KExtendedSocket::KExtendedSocket() :
+  sockfd(-1), d(new KExtendedSocketPrivate)
+{
+}
+
+
+KExtendedSocket::KExtendedSocket(const QString& host, int port, int flags) :
+  sockfd(-1), d(new KExtendedSocketPrivate)
+{
+  setAddress(host, port);
+  setSocketFlags(flags);
+}
+
+
+KExtendedSocket::KExtendedSocket(const QString& host, const QString& service, int flags) :
+  sockfd(-1), d(new KExtendedSocketPrivate)
+{
+  setAddress(host, service);
+  setSocketFlags(flags);
+}
+
+
+KExtendedSocket::~KExtendedSocket()
+{
+  closeNow();
+
+  local_freeaddrinfo(d->resolution);
+  local_freeaddrinfo(d->bindres);
+
+  if (d->local != __null)
+    delete d->local;
+  if (d->peer != __null)
+    delete d->peer;
+
+  if (d->qsnIn != __null)
+    delete d->qsnIn;
+  if (d->qsnOut != __null)
+    delete d->qsnOut;
+
+  delete d;
+}
+
+void KExtendedSocket::reset()
+{
+  closeNow();
+  release();
+  d->current = 0;
+  d->status = nothing;
+  d->syserror = 0;
+}
+
+int KExtendedSocket::socketStatus() const
+{
+  return d->status;
+}
+
+void KExtendedSocket::setSocketStatus(int newstatus)
+{
+  d->status = newstatus;
+}
+
+void KExtendedSocket::setError(int errorcode, int syserror)
+{
+  setStatus(errorcode);
+  d->syserror = syserror;
+}
+
+int KExtendedSocket::systemError() const
+{
+  return d->syserror;
+}
+
+
+
+
+
+int KExtendedSocket::setSocketFlags(int flags)
+{
+  if (d->status > nothing)
+    return -1;
+
+  return d->flags = flags;
+}
+
+int KExtendedSocket::socketFlags() const
+{
+  return d->flags;
+}
+
+
+
+
+
+bool KExtendedSocket::setHost(const QString& host)
+{
+  if (d->status > nothing)
+    return false;
+
+  d->host = host;
+  return true;
+}
+
+
+
+
+QString KExtendedSocket::host() const
+{
+  return d->host;
+}
+
+
+
+
+
+bool KExtendedSocket::setPort(int port)
+{
+  return setPort(QString::number(port));
+}
+
+bool KExtendedSocket::setPort(const QString& service)
+{
+  if (d->status > nothing)
+    return false;
+
+  d->service = service;
+  return true;
+}
+
+
+
+
+QString KExtendedSocket::port() const
+{
+  return d->service;
+}
+
+
+
+
+bool KExtendedSocket::setAddress(const QString& host, int port)
+{
+  return setHost(host) && setPort(port);
+}
+
+
+
+
+bool KExtendedSocket::setAddress(const QString& host, const QString& serv)
+{
+  return setHost(host) && setPort(serv);
+}
+
+
+
+
+
+
+bool KExtendedSocket::setBindHost(const QString& host)
+{
+  if (d->status > nothing || d->flags & passiveSocket)
+    return false;
+
+  d->localhost = host;
+  return true;
+}
+
+
+
+
+
+bool KExtendedSocket::unsetBindHost()
+{
+  if (d->status > nothing || d->flags & passiveSocket)
+    return false;
+
+  d->localhost.truncate(0);
+  return true;
+}
+
+
+
+
+QString KExtendedSocket::bindHost() const
+{
+  return d->localhost;
+}
+
+
+
+
+
+bool KExtendedSocket::setBindPort(int port)
+{
+  return setBindPort(QString::number(port));
+}
+
+bool KExtendedSocket::setBindPort(const QString& service)
+{
+  if (d->status > nothing || d->flags & passiveSocket)
+    return false;
+
+  d->localservice = service;
+  return true;
+}
+
+
+
+
+bool KExtendedSocket::unsetBindPort()
+{
+  if (d->status > nothing || d->flags & passiveSocket)
+    return false;
+
+  d->localservice.truncate(0);
+  return true;
+}
+
+
+
+
+QString KExtendedSocket::bindPort() const
+{
+  return d->localservice;
+}
+
+
+
+
+bool KExtendedSocket::setBindAddress(const QString& host, int port)
+{
+  return setBindHost(host) && setBindPort(port);
+}
+
+
+
+
+bool KExtendedSocket::setBindAddress(const QString& host, const QString& service)
+{
+  return setBindHost(host) && setBindPort(service);
+}
+
+
+
+
+bool KExtendedSocket::unsetBindAddress()
+{
+  return unsetBindHost() && unsetBindPort();
+}
+
+
+
+
+bool KExtendedSocket::setTimeout(int secs, int usecs)
+{
+  if (d->status >= connected)
+    return false;
+
+  d->timeout.tv_sec = secs;
+  d->timeout.tv_usec = usecs;
+  return true;
+}
+
+
+
+
+timeval KExtendedSocket::timeout() const
+{
+  return d->timeout;
+}
+
+
+
+
+bool KExtendedSocket::setBlockingMode(bool enable)
+{
+  cleanError();
+  if (d->status < created)
+    return false;
+
+  if (sockfd == -1)
+    return false;
+
+  int fdflags = fcntl(sockfd, 3, 0);
+  if (fdflags == -1)
+    return false;
+
+  if (!enable)
+    fdflags |= 04000;
+  else
+    fdflags &= ~04000;
+
+  if (fcntl(sockfd, 4, fdflags) == -1)
+    {
+      setError(8, (*__errno_location ()));
+      return false;
+    }
+  return true;
+}
+
+
+
+
+bool KExtendedSocket::blockingMode()
+{
+  cleanError();
+  if (d->status < created)
+    return false;
+
+  if (sockfd == -1)
+    return false;
+
+  int fdflags = fcntl(sockfd, 3, 0);
+  if (fdflags == -1)
+    {
+      setError(8, (*__errno_location ()));
+      return false;
+    }
+  return (fdflags & 04000) == 0;
+}
+
+
+
+
+bool KExtendedSocket::setAddressReusable(bool enable)
+{
+  cleanError();
+  d->addressReusable = enable;
+  if (d->status < created)
+    return true;
+
+  if (sockfd == -1)
+    return true;
+
+  if (!setAddressReusable(sockfd, enable))
+    {
+      setError(8, (*__errno_location ()));
+      return false;
+    }
+  return true;
+}
+
+bool KExtendedSocket::setAddressReusable(int fd, bool enable)
+{
+  if (fd == -1)
+    return false;
+
+  int on = enable;
+
+  if (setsockopt(fd, 1, 2, (char*)&on, sizeof(on)) == -1)
+    return false;
+  return true;
+}
+
+
+
+
+bool KExtendedSocket::addressReusable()
+{
+  cleanError();
+  if (d->status < created)
+    return d->addressReusable;
+
+  if (sockfd == -1)
+    return d->addressReusable;
+
+  int on;
+  socklen_t onsiz = sizeof(on);
+  if (getsockopt(sockfd, 1, 2, (char*)&on, &onsiz) == -1)
+    {
+      setError(8, (*__errno_location ()));
+      return false;
+    }
+
+  return on != 0;
+}
+
+
+
+
+bool KExtendedSocket::setIPv6Only(bool enable)
+{
+  d->ipv6only = enable;
+
+  setError(8, 38);
+  return false;
+
+}
+
+
+
+
+bool KExtendedSocket::isIPv6Only()
+{
+  setError(8, 38);
+  return false;
+
+}
+
+
+
+
+
+bool KExtendedSocket::setBufferSize(int rsize, int wsize)
+{
+  cleanError();
+  if (d->status < created)
+    return false;
+
+  if (sockfd == -1)
+    return false;
+
+  if (d->flags & passiveSocket)
+    return false;
+
+  if (rsize < -2)
+    return false;
+
+  if (wsize < -2)
+    return false;
+
+
+
+
+
+
+  if (d->qsnIn == __null)
+    {
+      d->qsnIn = new QSocketNotifier(sockfd, QSocketNotifier::Read);
+      QObject::connect(d->qsnIn, "2""activated(int)", this, "1""socketActivityRead()");
+      d->qsnIn->setEnabled(true);
+    }
+
+  if (rsize == 0 && d->flags & inputBufferedSocket)
+    {
+
+      d->flags &= ~inputBufferedSocket;
+
+      consumeReadBuffer(readBufferSize(), __null, true);
+      d->inMaxSize = 0;
+    }
+  else if (rsize != -2)
+    {
+
+      if (rsize)
+        d->flags |= inputBufferedSocket;
+      d->inMaxSize = rsize;
+
+      if (rsize > 0 && (unsigned)rsize < readBufferSize())
+
+        consumeReadBuffer(readBufferSize() - rsize, __null, true);
+
+    }
+
+  if (wsize == 0 && d->flags & outputBufferedSocket)
+    {
+
+      d->flags &= ~outputBufferedSocket;
+      if (d->qsnOut && !d->emitWrite)
+        d->qsnOut->setEnabled(false);
+      consumeWriteBuffer(writeBufferSize());
+      d->outMaxSize = 0;
+    }
+  else if (wsize != -2)
+    {
+
+      if (wsize)
+        d->flags |= outputBufferedSocket;
+      d->outMaxSize = wsize;
+
+      if (wsize > 0 && (unsigned)wsize < writeBufferSize())
+
+        consumeWriteBuffer(writeBufferSize() - wsize);
+
+      if (d->qsnOut == __null)
+        {
+          d->qsnOut = new QSocketNotifier(sockfd, QSocketNotifier::Write);
+          QObject::connect(d->qsnOut, "2""activated(int)", this, "1""socketActivityWrite()");
+
+
+
+        }
+    }
+
+
+
+  setFlags((mode() & ~0x0040) | ((d->flags & bufferedSocket) ? 0 : 0x0040));
+
+
+  if (d->emitWrite && d->qsnOut == __null)
+    {
+      d->qsnOut = new QSocketNotifier(sockfd, QSocketNotifier::Write);
+      QObject::connect(d->qsnOut, "2""activated(int)", this, "1""socketActivityWrite()");
+    }
+
+  return true;
+}
+
+
+
+
+
+
+const KSocketAddress *KExtendedSocket::localAddress()
+{
+  if (d->local != __null)
+    return d->local;
+  if (d->status < bound)
+    return __null;
+
+  return d->local = localAddress(sockfd);
+}
+
+
+
+
+
+
+const KSocketAddress* KExtendedSocket::peerAddress()
+{
+  if (d->peer != __null)
+    return d->peer;
+  if (d->flags & passiveSocket || d->status < connected)
+    return __null;
+
+  return d->peer = peerAddress(sockfd);
+}
+
+
+
+
+int KExtendedSocket::lookup()
+{
+  cleanError();
+  if (d->status >= lookupInProgress)
+    return -1;
+
+  addrinfo hint;
+
+  memset(&hint, 0, sizeof(hint));
+  hint.ai_family = 0;
+
+
+  if (d->resolution == __null)
+    {
+
+      if (!process_flags(d->flags, hint))
+        return -1;
+
+      int err = doLookup(d->host, d->service, hint, &d->resolution);
+      if (err != 0)
+        {
+          setError((8 +3), err);
+          return err;
+        }
+    }
+
+  if (d->bindres == __null && (d->localhost.length() > 0 || d->localservice.length() > 0))
+    {
+
+      hint.ai_flags |= 0x0001;
+
+      int err = doLookup(d->localhost, d->localservice, hint, &d->bindres);
+      if (err != 0)
+        {
+          setError((8 +3), err);
+          return err;
+        }
+    }
+
+  d->status = lookupDone;
+  return 0;
+}
+
+
+
+
+int KExtendedSocket::startAsyncLookup()
+{
+  cleanError();
+  if (d->status > lookupInProgress)
+    return -1;
+  if (d->status == lookupInProgress)
+
+    return 0;
+
+  addrinfo hint;
+  memset(&hint, 0, sizeof(hint));
+  hint.ai_family = 0;
+
+  if (!process_flags(d->flags, hint))
+    return -1;
+
+  int n = 0;
+  if (d->host.length() > 0)
+    {
+      if ((d->flags & noResolve) == 0)
+        {
+          d->dns = new KExtendedSocketLookup(d->host, d->service, hint);
+          QObject::connect(d->dns, "2""resultsReady()", this, "1""dnsResultsReady()");
+          n++;
+        }
+      else
+        {
+          int err = doLookup(d->host, d->service, hint, &d->resolution);
+          if (err != 0)
+            {
+              setError((8 +3), err);
+              return -1;
+            }
+        }
+    }
+
+  if (d->localhost.length() > 0)
+    {
+      if ((d->flags & noResolve) == 0)
+        {
+          hint.ai_flags |= 0x0001;
+          d->dnsLocal = new KExtendedSocketLookup(d->localhost, d->localservice, hint);
+          QObject::connect(d->dnsLocal, "2""resultsReady()", this, "1""dnsResultsReady()");
+          n++;
+        }
+      else
+        {
+          int err = doLookup(d->localhost, d->localservice, hint, &d->bindres);
+          if (err != 0)
+            {
+
+              setError((8 +3), err);
+              if (d->dns != __null)
+                {
+                  delete d->dns;
+                  d->dns = __null;
+                }
+              return -1;
+            }
+        }
+    }
+
+
+  if (n)
+    d->status = lookupInProgress;
+  else
+    {
+      d->status = lookupDone;
+      lookupFinished(n);
+    }
+  return 0;
+}
+
+void KExtendedSocket::cancelAsyncLookup()
+{
+  cleanError();
+  if (d->status != lookupInProgress)
+    return;
+
+  d->status = nothing;
+  if (d->dns)
+    {
+      delete d->dns;
+      d->dns = 0;
+    }
+
+  if (d->dnsLocal)
+    {
+      delete d->dnsLocal;
+      d->dnsLocal = 0;
+    }
+
+  local_freeaddrinfo(d->resolution);
+  local_freeaddrinfo(d->bindres);
+}
+
+int KExtendedSocket::listen(int N)
+{
+  cleanError();
+  if ((d->flags & passiveSocket) == 0 || d->status >= listening)
+    return -2;
+  if (d->status < lookupDone)
+    if (lookup() != 0)
+      return -2;
+  if (!d->resolution) return -2;
+
+  addrinfo *p;
+
+
+  for (p = d->resolution->data; p; p = p->ai_next)
+    {
+
+      if (!valid_family(p, d->flags))
+        continue;
+
+
+      sockfd = ::socket(p->ai_family, p->ai_socktype, p->ai_protocol);
+      if (sockfd == -1)
+        {
+
+          kdDebug(170) << "Failed to create: " << perror << endl;
+          continue;
+        }
+
+      if (d->addressReusable)
+        setAddressReusable(sockfd, true);
+      setIPv6Only(d->ipv6only);
+      cleanError();
+      if (KSocks::self()->bind(sockfd, p->ai_addr, p->ai_addrlen) == -1)
+        {
+          kdDebug(170) << "Failed to bind: " << perror << endl;
+          ::close(sockfd);
+          sockfd = -1;
+          continue;
+        }
+
+
+
+
+      d->status = bound;
+      break;
+    }
+
+  if (sockfd == -1)
+    {
+      setError((8 +1), (*__errno_location ()));
+      kdDebug(170) << "Listen error - sockfd is -1 " << endl;
+      return -1;
+    }
+
+  d->status = bound;
+  setFlags(0x0200 | 0x0040 | 0x0003);
+
+  int retval = KSocks::self()->listen(sockfd, N);
+  if (retval == -1)
+    setError((8 +1), (*__errno_location ()));
+  else
+    {
+      d->status = listening;
+      d->qsnIn = new QSocketNotifier(sockfd, QSocketNotifier::Read);
+      QObject::connect(d->qsnIn, "2""activated(int)", this, "1""socketActivityRead()");
+    }
+  return retval == -1 ? -1 : 0;
+}
+
+int KExtendedSocket::accept(KExtendedSocket *&sock)
+{
+  cleanError();
+  sock = __null;
+  if ((d->flags & passiveSocket) == 0 || d->status >= accepting)
+    return -2;
+  if (d->status < listening)
+    if (listen() < 0)
+      return -2;
+
+
+
+
+  bool block = blockingMode();
+  struct sockaddr sa;
+  ksocklen_t len = sizeof(sa);
+  sock = __null;
+
+  if (d->timeout.tv_sec > 0 || d->timeout.tv_usec > 0)
+    {
+      fd_set set;
+
+      setBlockingMode(false);
+      memset ((void*)&set, 0, sizeof(set));
+      FD_SET(sockfd, &set);
+
+
+
+
+      int retval = KSocks::self()->select(sockfd + 1, &set, __null, __null, &d->timeout);
+      if (retval == -1)
+        {
+          setError(8, (*__errno_location ()));
+          return -1;
+        }
+      else if (retval == 0 || !FD_ISSET (sockfd, &set))
+        {
+          setError(7, 0);
+          return -3;
+        }
+    }
+
+
+  int newfd = KSocks::self()->accept(sockfd, &sa, &len);
+
+  if (newfd == -1)
+    {
+      setError((8 +2), (*__errno_location ()));
+      kdWarning(170) << "Error accepting on socket " << sockfd << ":"
+                     << perror << endl;
+      return -1;
+    }
+
+
+
+  setBlockingMode(block);
+
+  sock = new KExtendedSocket;
+  sock->d->status = connected;
+  sock->sockfd = newfd;
+  sock->setFlags(0x0200 | 0x0040 | 0x0003 | 0x1000 | 0x0080);
+  sock->setBufferSize(0, 0);
+
+  return 0;
+}
+
+
+
+
+
+
+
+int KExtendedSocket::connect()
+{
+  cleanError();
+  if (d->flags & passiveSocket || d->status >= connected)
+    return -2;
+  if (d->status < lookupDone)
+    if (lookup() != 0)
+      return -2;
+  if (!d->resolution) return -2;
+
+  addrinfo *p, *q;
+  timeval end, now;
+
+
+
+
+
+
+  bool doingtimeout = d->timeout.tv_sec > 0 || d->timeout.tv_usec > 0;
+  if (doingtimeout)
+    {
+      gettimeofday(&end, __null);
+      end.tv_usec += d->timeout.tv_usec;
+      end.tv_sec += d->timeout.tv_sec;
+      if (end.tv_usec > 1000*1000)
+        {
+          end.tv_usec -= 1000*1000;
+          end.tv_sec++;
+        }
+
+
+    }
+
+  if (d->bindres)
+    q = d->bindres->data;
+  else
+    q = __null;
+  for (p = d->resolution->data; p; p = p->ai_next)
+    {
+
+      if (!valid_family(p, d->flags))
+        continue;
+
+
+      if (q != __null)
+        {
+
+          if (q->ai_family != p->ai_family)
+
+            for (q = d->bindres->data; q; q = q->ai_next)
+              if (q->ai_family == p->ai_family)
+                break;
+
+          if (q == __null || q->ai_family != p->ai_family)
+            {
+
+              kdDebug(170) << "No matching family for bind socket\n";
+              q = d->bindres->data;
+              continue;
+            }
+
+          kdDebug(170) << "Binding on " << pretty_sock(q) << " before connect" << endl;
+          (*__errno_location ()) = 0;
+          sockfd = ::socket(p->ai_family, p->ai_socktype, p->ai_protocol);
+          setError(5, (*__errno_location ()));
+          if (sockfd == -1)
+            continue;
+          if (d->addressReusable)
+            setAddressReusable(sockfd, true);
+          setIPv6Only(d->ipv6only);
+          cleanError();
+          if (KSocks::self()->bind(sockfd, q->ai_addr, q->ai_addrlen) == -1)
+            {
+              kdDebug(170) << "Bind failed: " << perror << endl;
+              ::close(sockfd);
+              sockfd = -1;
+              continue;
+            }
+        }
+      else
+        {
+
+          sockfd = ::socket(p->ai_family, p->ai_socktype, p->ai_protocol);
+          if (sockfd == -1)
+            {
+              setError(5, (*__errno_location ()));
+              continue;
+            }
+          if (d->addressReusable)
+            setAddressReusable(sockfd, true);
+          setIPv6Only(d->ipv6only);
+          cleanError();
+        }
+
+
+      d->status = created;
+
+
+      if (doingtimeout && KSocks::self()->hasWorkingAsyncConnect())
+        {
+          fd_set rd, wr;
+
+          setBlockingMode(false);
+
+
+          if (KSocks::self()->connect(sockfd, p->ai_addr, p->ai_addrlen) == -1)
+            {
+
+              if ((*__errno_location ()) != 11 && (*__errno_location ()) != 115)
+                {
+                  kdDebug(170) << "Socket " << sockfd << " did not connect: " << perror << endl;
+                  setError(5, (*__errno_location ()));
+                  ::close(sockfd);
+                  sockfd = -1;
+                  continue;
+                }
+
+              memset ((void*)&rd, 0, sizeof(rd));
+              memset ((void*)&wr, 0, sizeof(wr));
+	      FD_SET (sockfd, &rd);
+	      FD_SET (sockfd, &wr);
+
+              int retval = KSocks::self()->select(sockfd + 1, &rd, &wr, __null, &d->timeout);
+              if (retval == -1)
+                {
+                  setError(3, (*__errno_location ()));
+                  continue;
+                }
+              else if (retval == 0)
+                {
+                  ::close(sockfd);
+                  sockfd = -1;
+                  kdDebug(170) << "Time out while trying to connect to " <<
+                    pretty_sock(p) << endl;
+                  d->status = lookupDone;
+                  setError(7, 0);
+                  return -3;
+                }
+
+
+              gettimeofday(&now, __null);
+              d->timeout.tv_sec = end.tv_sec - now.tv_sec;
+              d->timeout.tv_usec = end.tv_usec - now.tv_usec;
+              if (d->timeout.tv_usec < 0)
+                {
+                  d->timeout.tv_usec += 1000*1000;
+                  d->timeout.tv_sec--;
+                }
+
+
+
+
+              int errcode;
+              socklen_t len = sizeof(errcode);
+              retval = getsockopt(sockfd, 1, 4, (char*)&errcode,
+                                  &len);
+              if (retval == -1 || errcode != 0)
+                {
+
+                  kdDebug(170) << "Socket " << sockfd << " did not connect: "
+                            << strerror(errcode) << endl;
+                  ::close(sockfd);
+                  sockfd = -1;
+
+
+                  if (d->timeout.tv_sec == 0 && d->timeout.tv_usec == 0)
+                    {
+                      d->status = lookupDone;
+                      setError(7, 0);
+                      return -3;
+                    }
+
+                  setError(5, errcode);
+                  continue;
+                }
+            }
+
+
+
+          setBlockingMode(true);
+          d->status = connected;
+          setFlags(0x0200 | 0x0040 | 0x0003 | 0x1000 | 0x0080);
+          setBufferSize(d->flags & inputBufferedSocket ? -1 : 0,
+                        d->flags & outputBufferedSocket ? -1 : 0);
+          connectionSuccess();
+
+          return 0;
+        }
+      else
+        {
+
+          if (KSocks::self()->connect(sockfd, p->ai_addr, p->ai_addrlen) == -1)
+            {
+              kdDebug(170) << "Socket " << sockfd << " did not connect: " << perror << endl;
+              setError(5, (*__errno_location ()));
+              ::close(sockfd);
+              sockfd = -1;
+              continue;
+            }
+
+          d->status = connected;
+          setFlags(0x0200 | 0x0040 | 0x0003 | 0x1000 | 0x0080);
+          setBufferSize(d->flags & inputBufferedSocket ? -1 : 0,
+                        d->flags & outputBufferedSocket ? -1 : 0);
+          connectionSuccess();
+
+          return 0;
+        }
+    }
+
+
+  connectionFailed(d->syserror);
+  kdDebug(170) << "Failed to connect\n";
+  return -1;
+}
+
+int KExtendedSocket::startAsyncConnect()
+{
+  cleanError();
+
+  if (d->status >= connected || d->flags & passiveSocket)
+    return -2;
+
+  if (d->status == connecting)
+
+    return 0;
+
+
+
+
+  if (d->status < lookupDone)
+    {
+      QObject::connect(this, "2""lookupFinished(int)", this, "1""startAsyncConnectSlot()");
+      if (d->status < lookupInProgress)
+        return startAsyncLookup();
+      else
+        return 0;
+    }
+
+
+
+  d->status = connecting;
+  QGuardedPtr<QObject> p = this;
+  connectionEvent();
+  if (!p)
+    return -1;
+  if (d->status < connecting)
+    return -1;
+  return 0;
+}
+
+void KExtendedSocket::cancelAsyncConnect()
+{
+  if (d->status != connecting)
+    return;
+
+  if (sockfd != -1)
+    {
+
+      if (d->qsnIn)
+        delete d->qsnIn;
+      if (d->qsnOut)
+        delete d->qsnOut;
+      d->qsnIn = d->qsnOut = __null;
+
+      ::close(sockfd);
+      sockfd = -1;
+    }
+  d->status = lookupDone;
+}
+
+bool KExtendedSocket::open(int mode)
+{
+  if (mode != 0x0040 | 0x0003)
+    return false;
+
+  if (d->flags & passiveSocket)
+    return listen() == 0;
+  else if (d->status < connecting)
+    return connect() == 0;
+  else
+    return false;
+}
+
+void KExtendedSocket::close()
+{
+  if (sockfd == -1 || d->status >= closing)
+    return;
+
+
+  if (d->flags & outputBufferedSocket && writeBufferSize() > 0)
+    {
+
+      d->status = closing;
+      if (d->qsnIn)
+        delete d->qsnIn;
+      d->qsnIn = __null;
+
+
+    }
+  else
+    {
+
+
+      if (d->qsnIn)
+        delete d->qsnIn;
+      if (d->qsnOut)
+        delete d->qsnOut;
+      d->qsnIn = d->qsnOut = __null;
+
+      ::close(sockfd);
+      d->status = done;
+      closed(readBufferSize() != 0 ? availRead : 0);
+    }
+
+}
+
+
+void KExtendedSocket::closeNow()
+{
+  if (d->status >= done)
+    return;
+
+
+  delete d->qsnIn;
+  delete d->qsnOut;
+  d->qsnIn = d->qsnOut = __null;
+
+  if (d->status > connecting && sockfd != -1)
+    {
+      ::close(sockfd);
+      sockfd = -1;
+    }
+  else if (d->status == connecting)
+    cancelAsyncConnect();
+  else if (d->status == lookupInProgress)
+    cancelAsyncLookup();
+
+  d->status = done;
+
+  closed(closedNow |
+              (readBufferSize() != 0 ? availRead : 0) |
+              (writeBufferSize() != 0 ? dirtyWrite : 0));
+}
+
+void KExtendedSocket::release()
+{
+
+  sockfd = -1;
+  d->status = done;
+
+
+  local_freeaddrinfo(d->resolution);
+  local_freeaddrinfo(d->bindres);
+
+  d->host = d->service = d->localhost = d->localservice = (const char *)0;
+
+  if (d->local != __null)
+    delete d->local;
+  if (d->peer != __null)
+    delete d->peer;
+
+  d->peer = d->local = __null;
+
+  if (d->qsnIn != __null)
+    delete d->qsnIn;
+  if (d->qsnOut != __null)
+    delete d->qsnOut;
+
+  d->qsnIn = d->qsnOut = __null;
+
+
+  consumeReadBuffer(readBufferSize(), __null, true);
+  consumeWriteBuffer(writeBufferSize());
+
+
+
+}
+
+void KExtendedSocket::flush()
+{
+  cleanError();
+  if (d->status < connected || d->status >= done || d->flags & passiveSocket)
+    return;
+
+  if (sockfd == -1)
+    return;
+
+  if ((d->flags & outputBufferedSocket) == 0)
+    return;
+
+
+
+  unsigned written = 0;
+  unsigned offset = outBufIndex;
+  while (writeBufferSize() - written > 0)
+    {
+
+
+
+
+
+      QByteArray buf(16384);
+      QByteArray *a = outBuf.first();
+      unsigned count = 0;
+
+      while (a && count + (a->size() - offset) < buf.size())
+        {
+          memcpy(buf.data() + count, a->data() + offset, a->size() - offset);
+          offset = 0;
+          count += a->size() - offset;
+          a = outBuf.next();
+        }
+
+
+      int wrote = KSocks::self()->write(sockfd, buf, count);
+
+      if (wrote == -1)
+        {
+
+          setError(2, (*__errno_location ()));
+          break;
+        }
+      written += wrote;
+
+      if ((unsigned)wrote != count)
+        break;
+    }
+  if (written)
+    {
+      consumeWriteBuffer(written);
+      bytesWritten(written);
+    }
+
+
+}
+
+
+Q_LONG KExtendedSocket::readBlock(char *data, Q_ULONG maxlen)
+{
+  cleanError();
+  if (d->status < connected || d->flags & passiveSocket)
+    return -2;
+  if (sockfd == -1)
+    return -2;
+
+  int retval;
+
+  if ((d->flags & inputBufferedSocket) == 0)
+    {
+
+
+
+      if (data)
+        retval = KSocks::self()->read(sockfd, data, maxlen);
+      else
+        retval = skipData(sockfd, maxlen);
+      if (retval == -1)
+        setError(1, (*__errno_location ()));
+    }
+  else
+    {
+
+
+
+
+      retval = consumeReadBuffer(maxlen, data);
+      if (retval == 0)
+        {
+
+
+          setError(1, 11);
+          retval = -1;
+        }
+
+
+
+    }
+  return retval;
+}
+
+Q_LONG KExtendedSocket::writeBlock(const char *data, Q_ULONG len)
+{
+  cleanError();
+  if (d->status < connected || d->status >= closing || d->flags & passiveSocket)
+    return -2;
+  if (sockfd == -1)
+    return -2;
+
+  if (len == 0)
+    return 0;
+
+  int retval;
+
+  if ((d->flags & outputBufferedSocket) == 0)
+    {
+
+      retval = KSocks::self()->write(sockfd, data, len);
+      if (retval == -1)
+        setError(2, (*__errno_location ()));
+      else
+        bytesWritten(retval);
+    }
+  else
+    {
+
+
+
+
+      register unsigned wsize = writeBufferSize();
+      if (d->outMaxSize == (int)wsize)
+        {
+
+          setError(2, 11);
+          retval = -1;
+        }
+      else
+        {
+          if (d->outMaxSize != -1 && wsize + len > (unsigned)d->outMaxSize)
+
+            len = d->outMaxSize - wsize;
+
+
+          retval = feedWriteBuffer(len, data);
+          if (wsize == 0 || d->emitWrite)
+
+            d->qsnOut->setEnabled(true);
+        }
+
+
+    }
+
+  return retval;
+}
+
+int KExtendedSocket::peekBlock(char *data, uint maxlen)
+{
+  if (d->status < connected || d->flags & passiveSocket)
+    return -2;
+  if (sockfd == -1)
+    return -2;
+
+
+
+  if (d->flags & inputBufferedSocket)
+    return consumeReadBuffer(maxlen, data, false);
+
+  return 0;
+}
+
+int KExtendedSocket::unreadBlock(const char *, uint)
+{
+
+  setError(1, 38);
+  return -1;
+}
+
+int KExtendedSocket::bytesAvailable() const
+{
+  if (d->status < connected || d->status >= closing || d->flags & passiveSocket)
+    return -2;
+
+
+
+  if (d->flags & inputBufferedSocket)
+    return KBufferedIO::bytesAvailable();
+
+  return 0;
+}
+
+int KExtendedSocket::waitForMore(int msecs)
+{
+  cleanError();
+  if (d->flags & passiveSocket || d->status < connected || d->status >= closing)
+    return -2;
+  if (sockfd == -1)
+    return -2;
+
+  fd_set rd;
+  memset ((void*)&rd, 0, sizeof(rd));
+  FD_SET (sockfd, &rd);
+  timeval tv;
+  tv.tv_sec = msecs / 1000;
+  tv.tv_usec = (msecs % 1000) * 1000;
+
+  int retval = KSocks::self()->select(sockfd + 1, &rd, __null, __null, &tv);
+  if (retval == -1)
+    {
+      setError(3, (*__errno_location ()));
+      return -1;
+    }
+  else if (retval != 0)
+    socketActivityRead();
+
+  return bytesAvailable();
+}
+
+int KExtendedSocket::getch()
+{
+  unsigned char c;
+  int retval;
+  retval = readBlock((char*)&c, sizeof(c));
+
+  if (retval < 0)
+    return retval;
+  return c;
+}
+
+int KExtendedSocket::putch(int ch)
+{
+  unsigned char c = (char)ch;
+  return writeBlock((char*)&c, sizeof(c));
+}
+
+int KExtendedSocket::doLookup(const QString &host, const QString &serv, addrinfo &hint,
+                              kde_addrinfo** res)
+{
+  int err;
+
+  QCString _host;
+  QCString _serv;
+  if (!host.isNull())
+    _host = KIDNA::toAsciiCString(host);
+  if (!serv.isNull())
+    _serv = serv.latin1();
+
+
+  err = kde_getaddrinfo(_host, _serv, &hint, res);
+
+
+  if (err == -2 || err == -5 || err == -3)
+    {
+
+
+
+
+      __res_init();
+
+
+      err = kde_getaddrinfo(_host, _serv, &hint, res);
+    }
+
+
+  return err;
+}
+
+
+void KExtendedSocket::enableRead(bool enable)
+{
+
+
+
+
+  if (!enable && (d->flags & inputBufferedSocket) == 0 && d->qsnIn)
+    d->qsnIn->setEnabled(false);
+  else if (enable && d->qsnIn)
+
+    d->qsnIn->setEnabled(true);
+  d->emitRead = enable;
+}
+
+
+void KExtendedSocket::enableWrite(bool enable)
+{
+
+  if (!enable && (d->flags & outputBufferedSocket) == 0 && d->qsnOut)
+    d->qsnOut->setEnabled(false);
+  else if (enable && d->qsnOut)
+
+    d->qsnOut->setEnabled(true);
+  d->emitWrite = enable;
+}
+
+
+
+void KExtendedSocket::socketActivityRead()
+{
+  if (d->flags & passiveSocket)
+    {
+      readyAccept();
+      return;
+    }
+  if (d->status == connecting)
+    {
+      connectionEvent();
+      return;
+    }
+  if (d->status != connected)
+    return;
+
+
+  if (d->flags & inputBufferedSocket)
+    {
+
+      QByteArray a;
+      char buf[1024];
+      int len, totalread = 0;
+
+
+
+      unsigned cursize = readBufferSize();
+
+      if (d->inMaxSize == -1 || cursize < (unsigned)d->inMaxSize)
+        {
+          do
+            {
+
+              if (d->inMaxSize != -1 && d->inMaxSize - (cursize + totalread) < sizeof(buf))
+
+
+                len = d->inMaxSize - (cursize + totalread);
+              else
+                len = sizeof(buf);
+
+              len = KSocks::self()->read(sockfd, buf, len);
+              if (len > 0)
+                {
+
+                  a.resize(a.size() + len);
+                  memcpy(a.data() + totalread, buf, len);
+                  totalread += len;
+                }
+              else if (len == 0)
+                {
+
+                  ::close(sockfd);
+                  sockfd = -1;
+                  d->qsnIn->deleteLater();
+                  delete d->qsnOut;
+                  d->qsnIn = d->qsnOut = __null;
+                  d->status = done;
+                  closed(involuntary |
+                              (readBufferSize() ? availRead : 0) |
+                              (writeBufferSize() ? dirtyWrite : 0));
+                  return;
+                }
+              else
+                {
+
+                  setError(1, (*__errno_location ()));
+                  return;
+                }
+
+            }
+          while (len == sizeof(buf));
+
+          feedReadBuffer(a.size(), a.data());
+        }
+
+
+    }
+  else
+    {
+
+
+
+
+
+
+      char c;
+      int len = KSocks::self()->recv(sockfd, &c, sizeof(c), MSG_PEEK);
+      if (len == 0)
+        {
+
+          d->qsnIn->setEnabled(false);
+          ::close(sockfd);
+          sockfd = -1;
+          d->status = done;
+          closed(involuntary);
+          return;
+        }
+    }
+
+  if (d->emitRead)
+    readyRead();
+}
+
+void KExtendedSocket::socketActivityWrite()
+{
+  if (d->flags & passiveSocket)
+    return;
+  if (d->status == connecting)
+    {
+      connectionEvent();
+      return;
+    }
+  if (d->status != connected && d->status != closing)
+    return;
+
+  flush();
+
+  bool empty = writeBufferSize() == 0;
+
+  if (d->emitWrite && empty)
+    readyWrite();
+  else if (!d->emitWrite)
+    {
+
+      d->qsnOut->setEnabled(!empty);
+    }
+  if (d->status == closing && empty)
+    {
+
+      d->status = done;
+
+      delete d->qsnOut;
+      ::close(sockfd);
+
+      d->qsnOut = __null;
+      sockfd = -1;
+      closed(delayed | (readBufferSize() ? availRead : 0));
+    }
+}
+
+
+
+
+void KExtendedSocket::connectionEvent()
+{
+  if (d->status != connecting)
+    return;
+  if (d->resolution == 0 || d->resolution->data == 0)
+    {
+
+      kdError(170) << "KExtendedSocket::connectionEvent() called but no data available!\n";
+      return;
+    }
+
+  int errcode = 0;
+
+  if (sockfd != -1)
+    {
+
+
+      int retval;
+      socklen_t len = sizeof(errcode);
+      retval = getsockopt(sockfd, 1, 4, (char*)&errcode, &len);
+
+      if (retval == -1 || errcode != 0)
+        {
+
+
+          if (d->qsnIn)
+            delete d->qsnIn;
+          if (d->qsnOut)
+            delete d->qsnOut;
+          ::close(sockfd);
+
+          sockfd = -1;
+          d->qsnIn = d->qsnOut = __null;
+          setError(5, errcode);
+        }
+      else
+        {
+
+
+
+          cleanError();
+          d->status = connected;
+          setBlockingMode(true);
+          setFlags(0x0200 | 0x0040 | 0x0003 | 0x1000 | 0x0080);
+          setBufferSize(d->flags & inputBufferedSocket ? -1 : 0,
+                        d->flags & outputBufferedSocket ? -1 : 0);
+          connectionSuccess();
+          return;
+        }
+    }
+
+
+
+  addrinfo *p, *q = __null;
+  if (d->current == 0)
+    p = d->current = d->resolution->data;
+  else
+    p = d->current->ai_next;
+  if (d->bindres)
+    q = d->bindres->data;
+  for ( ; p; p = p->ai_next)
+    {
+
+      if (q != __null)
+        {
+          if (q->ai_family != d->current->ai_family)
+
+            for (q = d->bindres->data; q; q = q->ai_next)
+              if (q->ai_family == p->ai_family)
+                break;
+
+          if (q == __null || q->ai_family != p->ai_family)
+            {
+
+              q = d->bindres->data;
+              continue;
+            }
+
+          (*__errno_location ()) = 0;
+          sockfd = ::socket(p->ai_family, p->ai_socktype, p->ai_protocol);
+          setError(5, (*__errno_location ()));
+          errcode = (*__errno_location ());
+          if (sockfd == -1)
+            continue;
+          if (d->addressReusable)
+            setAddressReusable(sockfd, true);
+          setIPv6Only(d->ipv6only);
+          cleanError();
+          if (KSocks::self()->bind(sockfd, q->ai_addr, q->ai_addrlen) == -1)
+            {
+              ::close(sockfd);
+              sockfd = -1;
+              continue;
+            }
+        }
+      else
+        {
+
+          sockfd = ::socket(p->ai_family, p->ai_socktype, p->ai_protocol);
+          if (sockfd == -1)
+            {
+              setError(5, (*__errno_location ()));
+              errcode = (*__errno_location ());
+              continue;
+            }
+          if (d->addressReusable)
+            setAddressReusable(sockfd, true);
+          setIPv6Only(d->ipv6only);
+          cleanError();
+        }
+
+      if (KSocks::self()->hasWorkingAsyncConnect())
+        setBlockingMode(false);
+      if (KSocks::self()->connect(sockfd, p->ai_addr, p->ai_addrlen) == -1)
+        {
+          if ((*__errno_location ()) != 11 && (*__errno_location ()) != 115)
+            {
+              setError(5, (*__errno_location ()));
+              ::close(sockfd);
+              sockfd = -1;
+              errcode = (*__errno_location ());
+              continue;
+            }
+
+
+
+          d->qsnIn = new QSocketNotifier(sockfd, QSocketNotifier::Read);
+          QObject::connect(d->qsnIn, "2""activated(int)", this, "1""socketActivityRead()");
+          d->qsnOut = new QSocketNotifier(sockfd, QSocketNotifier::Write);
+          QObject::connect(d->qsnOut, "2""activated(int)", this, "1""socketActivityWrite()");
+
+
+
+          d->current = p;
+          return;
+        }
+
+
+
+
+
+      cleanError();
+      d->status = connected;
+      setBlockingMode(true);
+      setFlags(0x0200 | 0x0040 | 0x0003 | 0x1000 | 0x0080);
+      setBufferSize(d->flags & inputBufferedSocket ? -1 : 0,
+                    d->flags & outputBufferedSocket ? -1 : 0);
+      connectionSuccess();
+      return;
+    }
+
+
+  d->status = lookupDone;
+  connectionFailed(errcode);
+}
+
+void KExtendedSocket::dnsResultsReady()
+{
+
+  if (d->status != lookupInProgress)
+    return;
+
+
+  if ((d->dns != __null && d->dns->isWorking()) ||
+      (d->dnsLocal != __null && d->dnsLocal->isWorking()))
+
+    return;
+
+
+
+  int n = 0;
+  addrinfo *p;
+
+  if (d->dns)
+    {
+      d->resolution = d->dns->results();
+      for (p = d->resolution->data; p; p = p->ai_next)
+        n++;
+    }
+
+  if (d->dnsLocal)
+    {
+      d->bindres = d->dnsLocal->results();
+      for (p = d->bindres->data; p; p = p->ai_next)
+        n++;
+    }
+
+  if (n)
+    {
+      d->status = lookupDone;
+      cleanError();
+    }
+  else
+    {
+      d->status = nothing;
+      setError((8 +3), -5);
+    }
+
+  lookupFinished(n);
+
+  return;
+}
+
+void KExtendedSocket::startAsyncConnectSlot()
+{
+  QObject::disconnect(this, "2""lookupFinished(int)", this, "1""startAsyncConnectSlot()");
+
+  if (d->status == lookupDone)
+    startAsyncConnect();
+}
+
+int KExtendedSocket::resolve(sockaddr *sock, ksocklen_t len, QString &host,
+                             QString &port, int flags)
+{
+  int err;
+  char h[1025], s[32];
+
+  h[0] = s[0] = '\0';
+
+  err = getnameinfo(sock, len, h, sizeof(h) - 1, s, sizeof(s) - 1, flags);
+  host = QString::fromUtf8(h);
+  port = QString::fromUtf8(s);
+
+  return err;
+}
+
+int KExtendedSocket::resolve(KSocketAddress *sock, QString &host, QString &port,
+                             int flags)
+{
+  return resolve(sock->data, sock->datasize, host, port, flags);
+}
+
+QPtrList<KAddressInfo> KExtendedSocket::lookup(const QString& host, const QString& port,
+                                            int flags, int *error)
+{
+  int err;
+  addrinfo hint, *p;
+  kde_addrinfo *res;
+  QPtrList<KAddressInfo> l;
+
+  memset(&hint, 0, sizeof(hint));
+  if (!process_flags(flags, hint))
+    {
+      if (error)
+        *error = -1;
+      return l;
+    }
+
+
+  err = doLookup(host, port, hint, &res);
+  if (err)
+    {
+      if (error)
+        *error = err;
+      return l;
+    }
+
+  for (p = res->data; p; p = p->ai_next)
+    if (valid_family(p, flags))
+      {
+        KAddressInfo *ai = new KAddressInfo(p);
+
+
+        l.append(ai);
+      }
+
+  if ( error )
+      *error = 0;
+
+  kde_freeaddrinfo(res);
+  return l;
+}
+
+KSocketAddress *KExtendedSocket::localAddress(int fd)
+{
+  KSocketAddress *local;
+  struct sockaddr static_sa, *sa = &static_sa;
+  ksocklen_t len = sizeof(static_sa);
+
+
+
+
+
+  if (KSocks::self()->getsockname(fd, sa, &len) == -1)
+    return __null;
+
+
+  if (len > sizeof(static_sa)
+
+
+
+      )
+    {
+
+
+
+
+
+
+
+      sa = (sockaddr*)malloc(len);
+      if (sa == __null)
+        return __null;
+
+      if (KSocks::self()->getsockname(fd, sa, &len) == -1)
+        {
+          free(sa);
+          return __null;
+        }
+
+      local = KSocketAddress::newAddress(sa, len);
+      free(sa);
+    }
+  else
+    local = KSocketAddress::newAddress(sa, len);
+
+  return local;
+}
+
+
+
+KSocketAddress *KExtendedSocket::peerAddress(int fd)
+{
+  KSocketAddress *peer;
+  struct sockaddr static_sa, *sa = &static_sa;
+  ksocklen_t len = sizeof(static_sa);
+
+
+
+
+
+  if (KSocks::self()->getpeername(fd, sa, &len) == -1)
+    return __null;
+
+
+  if (len > sizeof(static_sa)
+
+
+
+      )
+    {
+
+
+
+
+
+
+
+      sa = (sockaddr*)malloc(len);
+      if (sa == __null)
+        return __null;
+
+      if (KSocks::self()->getpeername(fd, sa, &len) == -1)
+        {
+          free(sa);
+          return __null;
+        }
+
+      peer = KSocketAddress::newAddress(sa, len);
+      free(sa);
+    }
+  else
+    peer = KSocketAddress::newAddress(sa, len);
+
+  return peer;
+}
+
+QString KExtendedSocket::strError(int code, int syserr)
+{
+  const char * msg;
+  if (code == (8 +3))
+    msg = gai_strerror(syserr);
+  else
+    msg = strerror(syserr);
+
+  return QString::fromLocal8Bit(msg);
+}
+
+
+QSocketNotifier *KExtendedSocket::readNotifier() { return d->qsnIn; }
+QSocketNotifier *KExtendedSocket::writeNotifier() { return d->qsnOut; }
+
+
+
+
+
+KAddressInfo::KAddressInfo(addrinfo *p)
+{
+   ai = (addrinfo *) malloc(sizeof(addrinfo));
+   memcpy(ai, p, sizeof(addrinfo));
+   ai->ai_next = __null;
+   if (p->ai_canonname)
+   {
+      ai->ai_canonname = (char *) malloc(strlen(p->ai_canonname)+1);
+      strcpy(ai->ai_canonname, p->ai_canonname);
+   }
+   if (p->ai_addr && p->ai_addrlen)
+   {
+      ai->ai_addr = (struct sockaddr *) malloc(p->ai_addrlen);
+      memcpy(ai->ai_addr, p->ai_addr, p->ai_addrlen);
+   }
+   else
+   {
+      ai->ai_addr = 0;
+      ai->ai_addrlen = 0;
+   }
+
+   addr = KSocketAddress::newAddress(ai->ai_addr, ai->ai_addrlen);
+}
+
+KAddressInfo::~KAddressInfo()
+{
+  if (ai && ai->ai_canonname)
+    free(ai->ai_canonname);
+
+  if (ai && ai->ai_addr)
+    free(ai->ai_addr);
+
+  if (ai)
+    free(ai);
+  delete addr;
+}
+
+int KAddressInfo::flags() const
+{
+  return ai->ai_flags;
+}
+
+int KAddressInfo::family() const
+{
+  return ai->ai_family;
+}
+
+int KAddressInfo::socktype() const
+{
+  return ai->ai_socktype;
+}
+
+int KAddressInfo::protocol() const
+{
+  return ai->ai_protocol;
+}
+
+const char* KAddressInfo::canonname() const
+{
+  return ai->ai_canonname;
+}
+
+void KExtendedSocket::virtual_hook( int id, void* data )
+{ KBufferedIO::virtual_hook( id, data ); }
+
+const char *KExtendedSocket::className() const
+{
+    return "KExtendedSocket";
+}
+
+QMetaObject *KExtendedSocket::metaObj = 0;
+static QMetaObjectCleanUp cleanUp_KExtendedSocket( "KExtendedSocket", &KExtendedSocket::staticMetaObject );
+QMetaObject* KExtendedSocket::staticMetaObject()
+{
+    if ( metaObj )
+        return metaObj;
+    QMetaObject* parentObject = KBufferedIO::staticMetaObject();
+    static const QUMethod slot_0 = {"socketActivityRead", 0, 0 };
+    static const QUMethod slot_1 = {"socketActivityWrite", 0, 0 };
+    static const QUMethod slot_2 = {"dnsResultsReady", 0, 0 };
+    static const QUMethod slot_3 = {"startAsyncConnectSlot", 0, 0 };
+    static const QUMethod slot_4 = {"connectionEvent", 0, 0 };
+    static const QMetaData slot_tbl[] = {
+        { "socketActivityRead()", &slot_0, QMetaData::Protected },
+        { "socketActivityWrite()", &slot_1, QMetaData::Protected },
+        { "dnsResultsReady()", &slot_2, QMetaData::Protected },
+        { "startAsyncConnectSlot()", &slot_3, QMetaData::Protected },
+        { "connectionEvent()", &slot_4, QMetaData::Protected }
+    };
+    static const QUParameter param_signal_0[] = {
+        { "count", &static_QUType_int, 0, QUParameter::In }
+    };
+    static const QUMethod signal_0 = {"lookupFinished", 1, param_signal_0 };
+    static const QUMethod signal_1 = {"connectionSuccess", 0, 0 };
+    static const QUParameter param_signal_2[] = {
+        { "error", &static_QUType_int, 0, QUParameter::In }
+    };
+    static const QUMethod signal_2 = {"connectionFailed", 1, param_signal_2 };
+    static const QUMethod signal_3 = {"readyAccept", 0, 0 };
+    static const QMetaData signal_tbl[] = {
+        { "lookupFinished(int)", &signal_0, QMetaData::Public },
+        { "connectionSuccess()", &signal_1, QMetaData::Public },
+        { "connectionFailed(int)", &signal_2, QMetaData::Public },
+        { "readyAccept()", &signal_3, QMetaData::Public }
+    };
+    metaObj = QMetaObject::new_metaobject(
+        "KExtendedSocket", parentObject,
+        slot_tbl, 5,
+        signal_tbl, 4,
+
+        0, 0,
+        0, 0,
+
+        0, 0 );
+    cleanUp_KExtendedSocket.setMetaObject( metaObj );
+    return metaObj;
+}
+
+void* KExtendedSocket::qt_cast( const char* clname )
+{
+    if ( !qstrcmp( clname, "KExtendedSocket" ) )
+        return this;
+    return KBufferedIO::qt_cast( clname );
+}
+
+
+void KExtendedSocket::lookupFinished( int t0 )
+{
+    activate_signal( staticMetaObject()->signalOffset() + 0, t0 );
+}
+
+
+void KExtendedSocket::connectionSuccess()
+{
+    activate_signal( staticMetaObject()->signalOffset() + 1 );
+}
+
+
+void KExtendedSocket::connectionFailed( int t0 )
+{
+    activate_signal( staticMetaObject()->signalOffset() + 2, t0 );
+}
+
+
+void KExtendedSocket::readyAccept()
+{
+    activate_signal( staticMetaObject()->signalOffset() + 3 );
+}
+
+bool KExtendedSocket::qt_invoke( int _id, QUObject* _o )
+{
+    switch ( _id - staticMetaObject()->slotOffset() ) {
+    case 0: socketActivityRead(); break;
+    case 1: socketActivityWrite(); break;
+    case 2: dnsResultsReady(); break;
+    case 3: startAsyncConnectSlot(); break;
+    case 4: connectionEvent(); break;
+    default:
+        return KBufferedIO::qt_invoke( _id, _o );
+    }
+    return TRUE;
+}
+
+bool KExtendedSocket::qt_emit( int _id, QUObject* _o )
+{
+    switch ( _id - staticMetaObject()->signalOffset() ) {
+    case 0: lookupFinished((int)static_QUType_int.get(_o+1)); break;
+    case 1: connectionSuccess(); break;
+    case 2: connectionFailed((int)static_QUType_int.get(_o+1)); break;
+    case 3: readyAccept(); break;
+    default:
+        return KBufferedIO::qt_emit(_id,_o);
+    }
+    return TRUE;
+}
+
+
+bool KExtendedSocket::qt_property( int id, int f, QVariant* v)
+{
+    return KBufferedIO::qt_property( id, f, v);
+}
+
+bool KExtendedSocket::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; }
+const char *KExtendedSocketLookup::className() const
+{
+    return "KExtendedSocketLookup";
+}
+
+QMetaObject *KExtendedSocketLookup::metaObj = 0;
+static QMetaObjectCleanUp cleanUp_KExtendedSocketLookup( "KExtendedSocketLookup", &KExtendedSocketLookup::staticMetaObject );
+QMetaObject* KExtendedSocketLookup::staticMetaObject()
+{
+    if ( metaObj )
+        return metaObj;
+    QMetaObject* parentObject = QObject::staticMetaObject();
+    static const QUMethod slot_0 = {"slotResultsReady", 0, 0 };
+    static const QMetaData slot_tbl[] = {
+        { "slotResultsReady()", &slot_0, QMetaData::Public }
+    };
+    static const QUMethod signal_0 = {"resultsReady", 0, 0 };
+    static const QMetaData signal_tbl[] = {
+        { "resultsReady()", &signal_0, QMetaData::Public }
+    };
+    metaObj = QMetaObject::new_metaobject(
+        "KExtendedSocketLookup", parentObject,
+        slot_tbl, 1,
+        signal_tbl, 1,
+
+        0, 0,
+        0, 0,
+
+        0, 0 );
+    cleanUp_KExtendedSocketLookup.setMetaObject( metaObj );
+    return metaObj;
+}
+
+void* KExtendedSocketLookup::qt_cast( const char* clname )
+{
+    if ( !qstrcmp( clname, "KExtendedSocketLookup" ) )
+        return this;
+    return QObject::qt_cast( clname );
+}
+
+
+void KExtendedSocketLookup::resultsReady()
+{
+    activate_signal( staticMetaObject()->signalOffset() + 0 );
+}
+
+bool KExtendedSocketLookup::qt_invoke( int _id, QUObject* _o )
+{
+    switch ( _id - staticMetaObject()->slotOffset() ) {
+    case 0: slotResultsReady(); break;
+    default:
+        return QObject::qt_invoke( _id, _o );
+    }
+    return TRUE;
+}
+
+bool KExtendedSocketLookup::qt_emit( int _id, QUObject* _o )
+{
+    switch ( _id - staticMetaObject()->signalOffset() ) {
+    case 0: resultsReady(); break;
+    default:
+        return QObject::qt_emit(_id,_o);
+    }
+    return TRUE;
+}
+
+
+bool KExtendedSocketLookup::qt_property( int id, int f, QVariant* v)
+{
+    return QObject::qt_property( id, f, v);
+}
+
+bool KExtendedSocketLookup::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C"
+
+int mkstemps(char *, int);
+extern "C"
+
+unsigned long strlcat(char*, const char*, unsigned long);
+
+
+
+
+
+
+extern "C"
+
+unsigned long strlcpy(char*, const char*, unsigned long);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+KSocketAddress::KSocketAddress(const sockaddr* sa, ksocklen_t size)
+{
+    if ( !sa )
+        init();
+    else {
+        data = (sockaddr*)malloc(size);
+        if (data == __null)
+            return;
+        memcpy(data, sa, size);
+        datasize = size;
+        owndata = true;
+    }
+}
+
+void KSocketAddress::init()
+{
+  data = __null;
+  datasize = 0;
+  owndata = false;
+}
+
+KSocketAddress::~KSocketAddress()
+{
+  if (owndata && data != __null)
+    free(data);
+}
+
+QString KSocketAddress::pretty() const
+{
+  return i18n("<unknown socket>");
+}
+
+int KSocketAddress::family() const
+{
+  if (data != __null)
+    return data->sa_family;
+  return 0;
+}
+
+
+KSocketAddress* KSocketAddress::newAddress(const struct sockaddr* sa, ksocklen_t size)
+{
+  if (size == 0)
+    {
+      kdWarning() << "KSocketAddress::newAddress called with size = 0!\n";
+      return __null;
+    }
+
+
+  if (size < (((size_t) &((sockaddr *)0)->sa_family) + sizeof(((sockaddr*)0)->sa_family)))
+    {
+      kdWarning() << "KSocketAddress::newAddress called with invalid size\n";
+      return __null;
+    }
+
+  switch (sa->sa_family)
+    {
+    case 2:
+      if (size >= sizeof(sockaddr_in))
+        return new KInetSocketAddress((const sockaddr_in*)sa, size);
+      return __null;
+
+
+    case 10:
+      if (size >= (((size_t) &((sockaddr_in6 *)0)->sin6_addr) + sizeof(((sockaddr_in6*)0)->sin6_addr)))
+        return new KInetSocketAddress((const sockaddr_in6*)sa, size);
+      return __null;
+
+
+    case 1:
+      return new KUnixSocketAddress((const sockaddr_un*)sa, size);
+    }
+
+  return new KSocketAddress(sa, size);
+}
+
+bool KSocketAddress::isEqual(const KSocketAddress& other) const
+{
+  switch(family())
+  {
+     case 2:
+        return KInetSocketAddress::areEqualInet(*this, other, false);
+
+     case 10:
+        return KInetSocketAddress::areEqualInet6(*this, other, false);
+
+     case 1:
+        return KUnixSocketAddress::areEqualUnix(*this, other, false);
+  }
+
+
+  if (other.datasize != datasize)
+    return false;
+  return memcmp(data, other.data, datasize) == 0;
+}
+
+bool KSocketAddress::isCoreEqual(const KSocketAddress& other) const
+{
+  switch(family())
+  {
+     case 2:
+        return KInetSocketAddress::areEqualInet(*this, other, true);
+
+     case 10:
+        return KInetSocketAddress::areEqualInet6(*this, other, true);
+
+     case 1:
+        return KUnixSocketAddress::areEqualUnix(*this, other, true);
+  }
+
+  return false;
+}
+
+QString KSocketAddress::nodeName() const
+{
+  return QString::null;
+}
+
+QString KSocketAddress::serviceName() const
+{
+  return QString::null;
+}
+
+int KSocketAddress::ianaFamily(int af)
+{
+  switch (af)
+    {
+    case 2:
+      return 1;
+
+    case 10:
+      return 2;
+
+    default:
+      return 0;
+    }
+}
+
+int KSocketAddress::fromIanaFamily(int iana)
+{
+  switch (iana)
+    {
+    case 1:
+      return 2;
+
+    case 2:
+      return 10;
+
+    default:
+      return 0;
+    }
+}
+
+
+
+
+class KInetSocketAddressPrivate
+{
+public:
+  int sockfamily;
+  sockaddr_in sin;
+
+  sockaddr_in6 sin6;
+
+
+  KInetSocketAddressPrivate() :
+    sockfamily(0)
+  {
+    sin.sin_family = 2;
+    sin.sin_port = 0;
+
+
+
+
+    sin6.sin6_family = 10;
+    sin6.sin6_port = 0;
+    sin6.sin6_flowinfo = 0;
+
+    sin6.sin6_scope_id = 0;
+
+
+
+
+
+  }
+
+};
+
+KInetSocketAddress::KInetSocketAddress() :
+  d(new KInetSocketAddressPrivate)
+{
+}
+
+KInetSocketAddress::KInetSocketAddress(const KInetSocketAddress &other) :
+  KSocketAddress(), d(new KInetSocketAddressPrivate)
+{
+  setAddress(other);
+}
+
+KInetSocketAddress::KInetSocketAddress(const sockaddr_in* sin, ksocklen_t len) :
+  d(new KInetSocketAddressPrivate)
+{
+  setAddress(sin, len);
+}
+
+KInetSocketAddress::KInetSocketAddress(const sockaddr_in6* sin6, ksocklen_t len) :
+  d(new KInetSocketAddressPrivate)
+{
+  setAddress(sin6, len);
+}
+
+KInetSocketAddress::KInetSocketAddress(const in_addr& addr, unsigned short port) :
+  d(new KInetSocketAddressPrivate)
+{
+  setAddress(addr, port);
+}
+
+KInetSocketAddress::KInetSocketAddress(const in6_addr& addr, unsigned short port) :
+  d(new KInetSocketAddressPrivate)
+{
+  setAddress(addr, port);
+}
+
+KInetSocketAddress::KInetSocketAddress(const QString& addr, unsigned short port, int family) :
+  d(new KInetSocketAddressPrivate)
+{
+  setAddress(addr, port, family);
+}
+
+KInetSocketAddress::~KInetSocketAddress()
+{
+  delete d;
+
+
+}
+
+bool KInetSocketAddress::setAddress(const KInetSocketAddress &other)
+{
+  if (other.family() == 2)
+    return setAddress(other.addressV4(), other.size());
+
+  else if (other.family() == 10)
+    return setAddress(other.addressV6(), other.size());
+
+  return false;
+}
+
+bool KInetSocketAddress::setAddress(const sockaddr_in* sin, ksocklen_t len)
+{
+
+  if ((len < sizeof(sockaddr_in)) || (sin->sin_family != 2))
+    {
+      kdWarning() << "KInetSocketAddress::setAddress(sockaddr_in*) called with invalid sockaddr_in\n";
+      return false;
+    }
+
+  return setHost(sin->sin_addr) && setPort(ntohs(sin->sin_port));
+}
+
+bool KInetSocketAddress::setAddress(const sockaddr_in6* sin6, ksocklen_t len)
+{
+
+
+  if ((len < (((size_t) &((sockaddr_in6 *)0)->sin6_addr) + sizeof(((sockaddr_in6*)0)->sin6_addr))) || (sin6->sin6_family != 10))
+    {
+      kdWarning() << "KInetSocketAddress::setAddress(sockaddr_in6*) called with invalid sockaddr_in6\n";
+      return 0;
+    }
+
+  memset(&d->sin6, 0, sizeof(d->sin6));
+  if (len > sizeof(d->sin6))
+    len = sizeof(d->sin6);
+  memcpy(&d->sin6, sin6, len);
+
+
+  d->sockfamily = d->sin6.sin6_family = 10;
+
+
+
+
+  fromV6();
+  return true;
+
+
+
+}
+
+bool KInetSocketAddress::setAddress(const in_addr& addr, unsigned short port)
+{
+  return setHost(addr) && setPort(port);
+}
+
+bool KInetSocketAddress::setAddress(const in6_addr& addr, unsigned short port)
+{
+  return setHost(addr) && setPort(port);
+}
+
+bool KInetSocketAddress::setAddress(const QString& addr, unsigned short port, int family)
+{
+  return setHost(addr, family) && setPort(port);
+}
+
+bool KInetSocketAddress::setHost(const in_addr& addr)
+{
+  d->sockfamily = 2;
+  d->sin.sin_addr = addr;
+  fromV4();
+  return true;
+}
+
+bool KInetSocketAddress::setHost(const in6_addr& addr)
+{
+
+  d->sockfamily = 10;
+  d->sin6.sin6_addr = addr;
+  fromV6();
+  return true;
+
+
+
+}
+
+bool KInetSocketAddress::setHost(const QString& addr, int family)
+{
+
+  if ((family != -1) && (family != 2)
+
+      && (family != 10)
+
+      )
+    {
+      kdWarning() << "KInetSocketAddress::setHost(QString, int) called with unknown family address\n";
+      return false;
+    }
+
+  if (family == -1)
+    {
+
+
+
+
+      if (addr.find(':') != -1)
+        family = 10;
+      else
+        family = 2;
+
+
+
+
+
+    }
+
+
+
+
+  if (family == 2)
+    {
+      inet_pton(family, addr.latin1(), (void*)&(d->sin.sin_addr));
+      fromV4();
+    }
+
+  else
+    {
+      inet_pton(family, addr.latin1(), (void*)&(d->sin6.sin6_addr));
+      fromV6();
+    }
+
+  d->sockfamily = family;
+  return true;
+}
+
+bool KInetSocketAddress::setPort(unsigned short port)
+{
+
+  d->sin.sin_port = htons(port);
+
+  d->sin6.sin6_port = htons(port);
+
+
+  return true;
+}
+
+bool KInetSocketAddress::setFamily(int _family)
+{
+  if (_family != 2
+
+      && _family != 10
+
+      )
+    {
+      kdWarning() << "KInetSocketAddress::setFamily(int) called with unknown family\n";
+      return false;
+    }
+
+  d->sockfamily = _family;
+  if (_family == 2)
+    fromV4();
+
+  else if (_family == 10)
+    fromV6();
+
+
+  return true;
+}
+
+bool KInetSocketAddress::setFlowinfo(Q_UINT32 flowinfo)
+{
+
+  if (d->sockfamily == 10)
+    {
+      d->sin6.sin6_flowinfo = flowinfo;
+      return true;
+    }
+
+  return false;
+}
+
+bool KInetSocketAddress::setScopeId(int scopeid)
+{
+
+  if (d->sockfamily == 10)
+    {
+      d->sin6.sin6_scope_id = scopeid;
+      return true;
+    }
+
+  (void)scopeid;
+  return false;
+}
+
+const sockaddr_in* KInetSocketAddress::addressV4() const
+{
+  if (d->sockfamily == 2)
+    return &d->sin;
+
+  else if (d->sockfamily == 10)
+    {
+
+      if ((((((Q_UINT32 *) (&d->sin6.sin6_addr))[0] == 0) && (((Q_UINT32 *) (&d->sin6.sin6_addr))[1] == 0) && (((Q_UINT32 *) (&d->sin6.sin6_addr))[2] == htonl (0xffff))) || ((((Q_UINT32 *) (&d->sin6.sin6_addr))[0] == 0) && (((Q_UINT32 *) (&d->sin6.sin6_addr))[1] == 0) && (((Q_UINT32 *) (&d->sin6.sin6_addr))[2] == 0) && (ntohl (((Q_UINT32 *) (&d->sin6.sin6_addr))[3]) > 1))))
+        return &d->sin;
+      else
+        return __null;
+    }
+
+
+  kdWarning() << "KInetSocketAddress::addressV4() called on uninitialized socket\n";
+  return __null;
+}
+
+const sockaddr_in6* KInetSocketAddress::addressV6() const
+{
+
+  return &d->sin6;
+
+
+
+}
+
+in_addr KInetSocketAddress::hostV4() const
+{
+
+  return d->sin.sin_addr;
+}
+
+
+
+
+
+
+
+in6_addr KInetSocketAddress::hostV6() const
+{
+  return d->sin6.sin6_addr;
+}
+
+
+QString KInetSocketAddress::pretty() const
+{
+  if (d->sockfamily != 2
+
+      && d->sockfamily != 10
+
+      )
+    {
+      kdWarning() << "KInetSocketAddress::pretty() called on uninitialized class\n";
+      return i18n("<empty>");
+    }
+
+  return i18n("1: hostname, 2: port number", "%1 port %2").arg(nodeName()).arg(serviceName());
+}
+
+QString KInetSocketAddress::nodeName() const
+{
+  char buf[46];
+
+  if (d->sockfamily == 2)
+    inet_ntop(d->sockfamily, (void*)&d->sin.sin_addr, buf, sizeof(buf));
+
+  else if (d->sockfamily == 10)
+    inet_ntop(d->sockfamily, (void*)&d->sin6.sin6_addr, buf, sizeof(buf));
+
+  else
+    {
+      kdWarning() << "KInetSocketAddress::nodeName() called on uninitialized class\n";
+      return i18n("<empty>");
+    }
+
+  return QString::fromLatin1(buf);
+}
+
+QString KInetSocketAddress::serviceName() const
+{
+  return QString::number(port());
+}
+
+unsigned short KInetSocketAddress::port() const
+{
+
+
+  return ntohs(d->sin6.sin6_port);
+
+
+
+}
+
+Q_UINT32 KInetSocketAddress::flowinfo() const
+{
+
+  if (d->sockfamily == 10)
+    return (Q_UINT32)d->sin6.sin6_flowinfo;
+
+  return 0;
+}
+
+ksocklen_t KInetSocketAddress::size() const
+{
+  if (d->sockfamily == 2)
+    return sizeof(d->sin);
+
+  else if (d->sockfamily == 10)
+    return sizeof(d->sin6);
+
+  else
+    return 0;
+}
+
+bool KInetSocketAddress::areEqualInet(const KSocketAddress &s1, const KSocketAddress &s2, bool coreOnly)
+{
+   if (s1.family() != s2.family())
+      return false;
+   if ((s1.size() < sizeof(sockaddr_in)) || (s2.size() < sizeof(sockaddr_in)))
+      return false;
+
+   struct sockaddr_in *sin1 = (sockaddr_in *) s1.address();
+   struct sockaddr_in *sin2 = (sockaddr_in *) s2.address();
+
+   if (coreOnly)
+      return (memcmp(&sin1->sin_addr, &sin2->sin_addr, sizeof(struct in_addr)) == 0);
+   else
+      return (sin1->sin_port == sin2->sin_port) &&
+             (memcmp(&sin1->sin_addr, &sin2->sin_addr, sizeof(struct in_addr)) == 0);
+}
+
+bool KInetSocketAddress::areEqualInet6(const KSocketAddress &s1, const KSocketAddress &s2, bool coreOnly)
+{
+
+   if (s1.family() != s2.family())
+      return false;
+
+   if ((s1.size() < sizeof(sockaddr_in6)) || (s2.size() < sizeof(sockaddr_in6)))
+      return false;
+
+   struct sockaddr_in6 *sin1 = (sockaddr_in6 *) s1.address();
+   struct sockaddr_in6 *sin2 = (sockaddr_in6 *) s2.address();
+
+   if (coreOnly)
+     return (memcmp(&sin1->sin6_addr, &sin2->sin6_addr, sizeof(struct in6_addr)) == 0);
+   else
+     return (sin1->sin6_port == sin2->sin6_port) &&
+            (sin1->sin6_flowinfo == sin2->sin6_flowinfo) &&
+
+            (sin1->sin6_scope_id == sin2->sin6_scope_id) &&
+
+            (memcmp(&sin1->sin6_addr, &sin2->sin6_addr, sizeof(struct in6_addr)) == 0);
+
+
+
+}
+
+void KInetSocketAddress::fromV4()
+{
+
+
+
+  d->sin6.sin6_port = d->sin.sin_port;
+
+
+  ((Q_UINT32*)&d->sin6.sin6_addr)[0] = ((Q_UINT32*)&d->sin6.sin6_addr)[1] = 0;
+  ((Q_UINT32*)&d->sin6.sin6_addr)[2] = htonl(0xffff);
+  ((Q_UINT32*)&d->sin6.sin6_addr)[3] = *(Q_UINT32*)&d->sin.sin_addr;
+
+
+  d->sin6.sin6_flowinfo = 0;
+
+  d->sin6.sin6_scope_id = 0;
+
+
+
+
+  data = (sockaddr*)&d->sin;
+  datasize = sizeof( sockaddr_in );
+}
+
+void KInetSocketAddress::fromV6()
+{
+
+
+  if ((((((Q_UINT32 *) (&d->sin6.sin6_addr))[0] == 0) && (((Q_UINT32 *) (&d->sin6.sin6_addr))[1] == 0) && (((Q_UINT32 *) (&d->sin6.sin6_addr))[2] == htonl (0xffff))) || ((((Q_UINT32 *) (&d->sin6.sin6_addr))[0] == 0) && (((Q_UINT32 *) (&d->sin6.sin6_addr))[1] == 0) && (((Q_UINT32 *) (&d->sin6.sin6_addr))[2] == 0) && (ntohl (((Q_UINT32 *) (&d->sin6.sin6_addr))[3]) > 1))))
+    {
+      d->sin.sin_port = d->sin6.sin6_port;
+      *(Q_UINT32*)&d->sin.sin_addr = ((Q_UINT32*)&d->sin6.sin6_addr)[3];
+    }
+  else
+    {
+      d->sin.sin_port = 0;
+      memset(&d->sin.sin_addr, 0, sizeof(d->sin.sin_addr));
+    }
+
+  data = (sockaddr*)&d->sin6;
+  datasize = sizeof( d->sin6 );
+
+}
+
+QString KInetSocketAddress::addrToString(int family, const void* addr)
+{
+  char buf[46 +1];
+
+  return QString::fromLatin1(inet_ntop(family, addr, buf, 46));
+}
+
+bool KInetSocketAddress::stringToAddr(int family, const char *text, void *dest)
+{
+  return inet_pton(family, text, dest) != 0;
+}
+
+
+
+
+
+class KUnixSocketAddressPrivate
+{
+public:
+  sockaddr_un *m_sun;
+
+  KUnixSocketAddressPrivate() : m_sun(__null)
+  { }
+};
+
+KUnixSocketAddress::KUnixSocketAddress() :
+  d(new KUnixSocketAddressPrivate)
+{
+}
+
+KUnixSocketAddress::KUnixSocketAddress(const sockaddr_un* _sun, ksocklen_t size) :
+  d(new KUnixSocketAddressPrivate)
+{
+  setAddress(_sun, size);
+}
+
+KUnixSocketAddress::KUnixSocketAddress(QCString pathname) :
+  d(new KUnixSocketAddressPrivate)
+{
+  setAddress(pathname);
+}
+
+KUnixSocketAddress::~KUnixSocketAddress()
+{
+  delete d;
+}
+
+bool KUnixSocketAddress::setAddress(const sockaddr_un* _sun, ksocklen_t _size)
+{
+  if (_sun->sun_family != 1)
+    {
+      kdWarning() << "KUnixSocketAddress::setAddress called with invalid socket\n";
+      return false;
+    }
+
+  if (owndata && (d->m_sun != __null) && (datasize >= _size))
+    {
+
+      memcpy(d->m_sun, _sun, _size);
+    }
+  else
+    {
+      if (owndata && (d->m_sun != __null))
+        free(d->m_sun);
+
+      d->m_sun = (sockaddr_un*)malloc(_size);
+
+      if (d->m_sun == __null)
+        {
+
+          owndata = false;
+          return false;
+        }
+
+      memcpy(d->m_sun, _sun, _size);
+    }
+
+  datasize = _size;
+  data = (sockaddr*)d->m_sun;
+  owndata = true;
+
+
+
+  return 1;
+}
+
+bool KUnixSocketAddress::setAddress(QCString path)
+{
+
+  ksocklen_t newsize = ((size_t) &((sockaddr_un *)0)->sun_path) + path.length() + 1;
+
+  if (owndata && (d->m_sun != __null) && (datasize >= newsize))
+    {
+
+      strcpy(d->m_sun->sun_path, path);
+
+
+
+      return true;
+    }
+
+
+  if (owndata && (d->m_sun != __null))
+    free(d->m_sun);
+
+  d->m_sun = (sockaddr_un*) malloc(newsize);
+  if (d->m_sun == __null)
+    {
+      owndata = false;
+      return false;
+    }
+
+  d->m_sun->sun_family = 1;
+  strcpy(d->m_sun->sun_path, path);
+  data = (sockaddr*)d->m_sun;
+  datasize = newsize;
+
+
+
+  return 1;
+}
+
+QCString KUnixSocketAddress::pathname() const
+{
+  if (d->m_sun != __null)
+    {
+      if (datasize > ((size_t) &((sockaddr_un *)0)->sun_path))
+        return d->m_sun->sun_path;
+      return "";
+    }
+  return QCString(0);
+}
+
+QString KUnixSocketAddress::pretty() const
+{
+  QCString pname = pathname();
+  if (pname.isEmpty())
+    return i18n("<empty UNIX socket>");
+  return QFile::decodeName(pathname());
+}
+
+QString KUnixSocketAddress::serviceName() const
+{
+  return QString::fromUtf8(pathname());
+}
+
+const sockaddr_un* KUnixSocketAddress::address() const
+{
+  return d->m_sun;
+}
+
+bool KUnixSocketAddress::areEqualUnix(const KSocketAddress &s1, const KSocketAddress &s2, bool )
+{
+   if (s1.family() != s2.family())
+      return false;
+
+   if ((s1.size() < (((size_t) &((sockaddr *)0)->sa_family) + sizeof(((sockaddr*)0)->sa_family))) || (s2.size() < (((size_t) &((sockaddr *)0)->sa_family) + sizeof(((sockaddr*)0)->sa_family))))
+      return false;
+
+   struct sockaddr_un *sun1 = (sockaddr_un *) s1.address();
+   struct sockaddr_un *sun2 = (sockaddr_un *) s2.address();
+
+   if (s1.size() == (((size_t) &((sockaddr *)0)->sa_family) + sizeof(((sockaddr*)0)->sa_family)) && s2.size() == (((size_t) &((sockaddr *)0)->sa_family) + sizeof(((sockaddr*)0)->sa_family)))
+     return true;
+
+   return (strcmp(sun1->sun_path, sun2->sun_path) == 0);
+}
+
+void KSocketAddress::virtual_hook( int, void* )
+{ }
+
+void KInetSocketAddress::virtual_hook( int id, void* data )
+{ KSocketAddress::virtual_hook( id, data ); }
+
+void KUnixSocketAddress::virtual_hook( int id, void* data )
+{ KSocketAddress::virtual_hook( id, data ); }
+
+
+const char *KSocketAddress::className() const
+{
+    return "KSocketAddress";
+}
+
+QMetaObject *KSocketAddress::metaObj = 0;
+static QMetaObjectCleanUp cleanUp_KSocketAddress( "KSocketAddress", &KSocketAddress::staticMetaObject );
+QMetaObject* KSocketAddress::staticMetaObject()
+{
+    if ( metaObj )
+        return metaObj;
+    QMetaObject* parentObject = QObject::staticMetaObject();
+    metaObj = QMetaObject::new_metaobject(
+        "KSocketAddress", parentObject,
+        0, 0,
+        0, 0,
+
+        0, 0,
+        0, 0,
+
+        0, 0 );
+    cleanUp_KSocketAddress.setMetaObject( metaObj );
+    return metaObj;
+}
+
+void* KSocketAddress::qt_cast( const char* clname )
+{
+    if ( !qstrcmp( clname, "KSocketAddress" ) )
+        return this;
+    return QObject::qt_cast( clname );
+}
+
+bool KSocketAddress::qt_invoke( int _id, QUObject* _o )
+{
+    return QObject::qt_invoke(_id,_o);
+}
+
+bool KSocketAddress::qt_emit( int _id, QUObject* _o )
+{
+    return QObject::qt_emit(_id,_o);
+}
+
+
+bool KSocketAddress::qt_property( int id, int f, QVariant* v)
+{
+    return QObject::qt_property( id, f, v);
+}
+
+bool KSocketAddress::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; }
+
+
+
+const char *KInetSocketAddress::className() const
+{
+    return "KInetSocketAddress";
+}
+
+QMetaObject *KInetSocketAddress::metaObj = 0;
+static QMetaObjectCleanUp cleanUp_KInetSocketAddress( "KInetSocketAddress", &KInetSocketAddress::staticMetaObject );
+QMetaObject* KInetSocketAddress::staticMetaObject()
+{
+    if ( metaObj )
+        return metaObj;
+    QMetaObject* parentObject = KSocketAddress::staticMetaObject();
+    metaObj = QMetaObject::new_metaobject(
+        "KInetSocketAddress", parentObject,
+        0, 0,
+        0, 0,
+
+        0, 0,
+        0, 0,
+
+        0, 0 );
+    cleanUp_KInetSocketAddress.setMetaObject( metaObj );
+    return metaObj;
+}
+
+void* KInetSocketAddress::qt_cast( const char* clname )
+{
+    if ( !qstrcmp( clname, "KInetSocketAddress" ) )
+        return this;
+    return KSocketAddress::qt_cast( clname );
+}
+
+bool KInetSocketAddress::qt_invoke( int _id, QUObject* _o )
+{
+    return KSocketAddress::qt_invoke(_id,_o);
+}
+
+bool KInetSocketAddress::qt_emit( int _id, QUObject* _o )
+{
+    return KSocketAddress::qt_emit(_id,_o);
+}
+
+
+bool KInetSocketAddress::qt_property( int id, int f, QVariant* v)
+{
+    return KSocketAddress::qt_property( id, f, v);
+}
+
+bool KInetSocketAddress::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; }
+
+
+
+const char *KUnixSocketAddress::className() const
+{
+    return "KUnixSocketAddress";
+}
+
+QMetaObject *KUnixSocketAddress::metaObj = 0;
+static QMetaObjectCleanUp cleanUp_KUnixSocketAddress( "KUnixSocketAddress", &KUnixSocketAddress::staticMetaObject );
+QMetaObject* KUnixSocketAddress::staticMetaObject()
+{
+    if ( metaObj )
+        return metaObj;
+    QMetaObject* parentObject = KSocketAddress::staticMetaObject();
+    metaObj = QMetaObject::new_metaobject(
+        "KUnixSocketAddress", parentObject,
+        0, 0,
+        0, 0,
+
+        0, 0,
+        0, 0,
+
+        0, 0 );
+    cleanUp_KUnixSocketAddress.setMetaObject( metaObj );
+    return metaObj;
+}
+
+void* KUnixSocketAddress::qt_cast( const char* clname )
+{
+    if ( !qstrcmp( clname, "KUnixSocketAddress" ) )
+        return this;
+    return KSocketAddress::qt_cast( clname );
+}
+
+bool KUnixSocketAddress::qt_invoke( int _id, QUObject* _o )
+{
+    return KSocketAddress::qt_invoke(_id,_o);
+}
+
+bool KUnixSocketAddress::qt_emit( int _id, QUObject* _o )
+{
+    return KSocketAddress::qt_emit(_id,_o);
+}
+
+
+bool KUnixSocketAddress::qt_property( int id, int f, QVariant* v)
+{
+    return KSocketAddress::qt_property( id, f, v);
+}
+
+bool KUnixSocketAddress::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C"
+
+int mkstemps(char *, int);
+extern "C"
+
+unsigned long strlcat(char*, const char*, unsigned long);
+
+
+
+
+
+
+extern "C"
+
+unsigned long strlcpy(char*, const char*, unsigned long);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+static void dofreeaddrinfo(struct addrinfo *ai)
+{
+  while (ai)
+    {
+      struct addrinfo *ai2 = ai;
+      if (ai->ai_canonname != __null)
+        free(ai->ai_canonname);
+
+      if (ai->ai_addr != __null)
+        free(ai->ai_addr);
+
+      ai = ai->ai_next;
+      free(ai2);
+    }
+}
+
+void kde_freeaddrinfo(struct kde_addrinfo *ai)
+{
+  if (ai->origin == 1)
+    {
+      struct addrinfo *p, *last = __null;
+
+
+      for (p = ai->data; p; p = p->ai_next)
+        {
+          if (p->ai_family == 1)
+            {
+              if (last)
+                {
+                  last->ai_next = __null;
+                  freeaddrinfo(ai->data);
+                }
+              dofreeaddrinfo(p);
+              break;
+            }
+          last = p;
+        }
+    }
+  else
+    freeaddrinfo(ai->data);
+
+  free(ai);
+}
+
+static struct addrinfo*
+make_unix(const char *name, const char *serv)
+{
+  const char *buf;
+  struct addrinfo *p;
+  struct sockaddr_un *_sun;
+  int len;
+
+  p = (addrinfo*)malloc(sizeof(*p));
+  if (p == __null)
+    return __null;
+  memset(p, 0, sizeof(*p));
+
+  if (name != __null)
+    buf = name;
+  else
+    buf = serv;
+
+
+  len = strlen(buf) + ((size_t) &((struct sockaddr_un *)0)->sun_path) + 1;
+  if (*buf != '/')
+    len += 5;
+
+  _sun = (sockaddr_un*)malloc(len);
+  if (_sun == __null)
+    {
+
+      free(p);
+      return __null;
+    }
+
+  _sun->sun_family = 1;
+
+
+
+  if (*buf == '/')
+    *_sun->sun_path = '\0';
+  else
+    strcpy(_sun->sun_path, "/tmp/");
+  strcat(_sun->sun_path, buf);
+
+
+  p->ai_family = 1;
+  p->ai_addrlen = len;
+  p->ai_addr = (sockaddr*)_sun;
+  p->ai_canonname = strdup(buf);
+
+  return p;
+}
+static int check_ipv6_stack()
+{
+
+
+
+  int fd = ::socket(10, SOCK_STREAM, 0);
+  if (fd == -1)
+     return 2;
+
+  ::close(fd);
+  return 1;
+
+}
+int kde_getaddrinfo(const char *name, const char *service,
+                    const struct addrinfo* hint,
+                    struct kde_addrinfo** result)
+{
+  struct kde_addrinfo* res;
+  struct addrinfo* p;
+  int err = -8;
+
+
+  static int ipv6_stack = 0;
+
+
+
+  res = (kde_addrinfo*)malloc(sizeof(*res));
+  if (res == __null)
+    return -10;
+  res->data = __null;
+  res->origin = 0;
+
+  struct addrinfo* last = __null;
+
+
+  if (hint && (hint->ai_family == 1))
+  {
+     if (service == __null || *service == '\0')
+       goto out;
+
+
+
+
+     if (name != __null && !(name[0] == '\0' || (name[0] == '*' && name[1] == '\0') ||
+                strcmp("localhost", name) == 0))
+       goto out;
+
+     goto do_unix;
+  }
+
+
+
+
+  if (ipv6_stack == 0)
+    ipv6_stack = check_ipv6_stack();
+
+  if (ipv6_stack == 2)
+    {
+
+
+
+      struct addrinfo our_hint;
+      if (hint != __null)
+        {
+          memcpy(&our_hint, hint, sizeof(our_hint));
+          if (our_hint.ai_family == 0)
+            our_hint.ai_family = 2;
+        }
+      else
+        {
+          memset(&our_hint, 0, sizeof(our_hint));
+          our_hint.ai_family = 2;
+        }
+
+
+      err = getaddrinfo(name, service, &our_hint, &res->data);
+
+    }
+  else
+
+
+
+
+      err = getaddrinfo(name, service, hint, &res->data);
+
+
+
+
+  if (service == __null || *service == '\0')
+    goto out;
+
+
+
+
+  if (name != __null && !(name[0] == '\0' || (name[0] == '*' && name[1] == '\0') ||
+                        strcmp("localhost", name) == 0))
+    goto out;
+
+
+
+  if (hint != __null && (hint->ai_family != 0 && hint->ai_family != 1))
+    goto out;
+
+
+
+
+
+  if (err == 0)
+    for (p = res->data; p; p = p->ai_next)
+      {
+        last = p;
+        if (p->ai_family == 1)
+
+          goto out;
+      }
+
+ do_unix:
+
+  p = make_unix(__null, service);
+  if (p == __null)
+    {
+      err = -10;
+      goto out;
+    }
+  if (hint != __null)
+    p->ai_socktype = hint->ai_socktype;
+  if (p->ai_socktype == 0)
+    p->ai_socktype = SOCK_STREAM;
+
+  if (last)
+    last->ai_next = p;
+  else
+    res->data = p;
+  res->origin = 1;
+  *result = res;
+  return 0;
+
+ out:
+
+  if (err == 0)
+    *result = res;
+  else
+    {
+      if (res->data != __null)
+        freeaddrinfo(res->data);
+      free(res);
+    }
+  return err;
+}
+
+
+
+
+
+
+
+
+
+
+
+namespace KDE
+{
+
+  extern const int resolverFlags = 0 | 0 | 0x01 | 0 | 0;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C"
+
+int mkstemps(char *, int);
+extern "C"
+
+unsigned long strlcat(char*, const char*, unsigned long);
+
+
+
+
+
+
+extern "C"
+
+unsigned long strlcpy(char*, const char*, unsigned long);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+class KProcIOPrivate;
+class QTextCodec;
+class KProcIO : public KProcess
+{
+  public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+
+public:
+
+
+
+  KProcIO ( QTextCodec *codec = 0 );
+
+
+
+
+  ~KProcIO();
+  void setComm (Communication comm);
+  bool start (RunMode runmode = NotifyOnExit, bool includeStderr = false);
+
+
+
+
+
+
+
+  bool writeStdin(const QString &line, bool appendnewline=true);
+
+
+
+
+
+
+
+  bool writeStdin(const QCString &line, bool appendnewline);
+
+
+
+
+
+
+  bool writeStdin(const QByteArray &data);
+   bool fputs (const QString &line, bool AppendNewLine=true)
+    { return writeStdin(line, AppendNewLine); }
+
+
+
+
+  void closeWhenDone();
+  int readln (QString &line, bool autoAck=true, bool *partial=0);
+  int fgets (QString &line, bool autoAck=false)
+    { return readln (line, autoAck); }
+
+
+
+
+  void resetAll ();
+  void ackRead ();
+
+
+
+
+
+
+
+  void enableReadSignals (bool enable);
+
+protected:
+
+
+
+
+
+  void readReady(KProcIO *pio);
+
+protected:
+  QPtrList<QByteArray> outbuffer;
+  QCString recvbuffer;
+  QTextCodec *codec;
+  int rbi;
+  bool needreadsignal, readsignalon, writeready;
+
+  void controlledEmission ();
+
+protected :
+  void received (KProcess *proc, char *buffer, int buflen);
+  void sent (KProcess *);
+
+protected:
+  virtual void virtual_hook( int id, void* data );
+private:
+  KProcIOPrivate *d;
+};
+
+
+
+
+class KProcIOPrivate {
+public:
+  KProcIOPrivate() : comm(KProcess::All) {}
+  KProcess::Communication comm;
+};
+
+KProcIO::KProcIO ( QTextCodec *_codec)
+  : codec(_codec), d(new KProcIOPrivate)
+{
+  rbi=0;
+  readsignalon=writeready=TRUE;
+  outbuffer.setAutoDelete(true);
+
+  if (!codec)
+  {
+     codec = QTextCodec::codecForName("ISO 8859-1");
+     if (!codec)
+     {
+        kdError(174) << "Can't create ISO 8859-1 codec!" << endl;
+     }
+  }
+}
+
+KProcIO::~KProcIO()
+{
+  delete d;
+}
+
+void
+KProcIO::resetAll ()
+{
+  if (isRunning())
+     kill();
+
+  clearArguments();
+  rbi=0;
+  readsignalon=writeready=TRUE;
+
+  disconnect (this, "2""receivedStdout (KProcess *, char *, int)",
+           this, "1""received (KProcess *, char *, int)");
+
+  disconnect (this, "2""receivedStderr (KProcess *, char *, int)",
+           this, "1""received (KProcess *, char *, int)");
+
+  disconnect (this, "2""wroteStdin(KProcess *)",
+           this, "1""sent (KProcess *)");
+
+  outbuffer.clear();
+
+}
+
+void KProcIO::setComm (Communication comm)
+{
+  d->comm = comm;
+}
+
+bool KProcIO::start (RunMode runmode, bool includeStderr)
+{
+  connect (this, "2""receivedStdout (KProcess *, char *, int)",
+           this, "1""received (KProcess *, char *, int)");
+
+  if (includeStderr)
+  {
+     connect (this, "2""receivedStderr (KProcess *, char *, int)",
+              this, "1""received (KProcess *, char *, int)");
+  }
+
+  connect (this, "2""wroteStdin(KProcess *)",
+           this, "1""sent (KProcess *)");
+
+  return KProcess::start (runmode, d->comm);
+}
+
+bool KProcIO::writeStdin (const QString &line, bool appendnewline)
+{
+  return writeStdin(codec->fromUnicode(line), appendnewline);
+}
+
+bool KProcIO::writeStdin (const QCString &line, bool appendnewline)
+{
+  QCString *qs = new QCString(line);
+
+  if (appendnewline)
+  {
+     *qs += '\n';
+  }
+
+  int l = qs->length();
+  if (!l)
+  {
+     delete qs;
+     return true;
+  }
+
+  QByteArray *b = (QByteArray *) qs;
+  b->truncate(l);
+
+  outbuffer.append(b);
+
+  if (writeready)
+  {
+     writeready=FALSE;
+     return KProcess::writeStdin( b->data(), b->size() );
+  }
+  return true;
+}
+
+bool KProcIO::writeStdin(const QByteArray &data)
+{
+  if (!data.size())
+     return true;
+  QByteArray *b = new QByteArray(data);
+  outbuffer.append(b);
+
+  if (writeready)
+  {
+     writeready=FALSE;
+     return KProcess::writeStdin( b->data(), b->size() );
+  }
+  return true;
+}
+
+void KProcIO::closeWhenDone()
+{
+  if (writeready)
+  {
+     closeStdin();
+     return;
+  }
+  outbuffer.append(0);
+
+  return;
+}
+
+void KProcIO::sent(KProcess *)
+{
+  outbuffer.removeFirst();
+
+  if (outbuffer.count()==0)
+  {
+     kdDebug(174) << "Empty" << endl;
+     writeready=TRUE;
+  }
+  else
+  {
+     QByteArray *b = outbuffer.first();
+     if (!b)
+     {
+        kdDebug(174) << "Closing" << endl;
+        closeStdin();
+     }
+     else
+     {
+        kdDebug(174) << "Sending [" << b->size() << "]" << endl;
+        KProcess::writeStdin(b->data(), b->size());
+     }
+  }
+
+}
+
+void KProcIO::received (KProcess *, char *buffer, int buflen)
+{
+  recvbuffer += QCString(buffer, buflen+1);
+
+  controlledEmission();
+}
+
+void KProcIO::ackRead ()
+{
+  readsignalon=TRUE;
+  if (needreadsignal || recvbuffer.length()!=0)
+     controlledEmission();
+}
+
+void KProcIO::controlledEmission ()
+{
+  if (readsignalon)
+  {
+     needreadsignal=FALSE;
+     readsignalon=FALSE;
+     readReady (this);
+  }
+  else
+  {
+    needreadsignal=TRUE;
+  }
+}
+
+void KProcIO::enableReadSignals (bool enable)
+{
+  readsignalon=enable;
+
+  if (enable && needreadsignal)
+     readReady (this);
+}
+
+int KProcIO::readln (QString &line, bool autoAck, bool *partial)
+{
+  int len;
+
+  if (autoAck)
+     readsignalon=TRUE;
+
+
+
+  len=recvbuffer.find ('\n',rbi)-rbi;
+
+
+
+
+  if ((len<0) &&
+      ((unsigned int)rbi<recvbuffer.length()))
+  {
+     recvbuffer=recvbuffer.mid (rbi);
+     rbi=0;
+     if (partial)
+     {
+        len = recvbuffer.length();
+        line = recvbuffer;
+        recvbuffer = "";
+        *partial = true;
+        return len;
+     }
+     return -1;
+  }
+
+  if (len>=0)
+  {
+     line = codec->toUnicode(recvbuffer.mid(rbi,len), len);
+     rbi += len+1;
+     if (partial)
+        *partial = false;
+     return len;
+  }
+
+  recvbuffer="";
+  rbi=0;
+
+
+  return -1;
+
+}
+
+void KProcIO::virtual_hook( int id, void* data )
+{ KProcess::virtual_hook( id, data ); }
+
+const char *KProcIO::className() const
+{
+    return "KProcIO";
+}
+
+QMetaObject *KProcIO::metaObj = 0;
+static QMetaObjectCleanUp cleanUp_KProcIO( "KProcIO", &KProcIO::staticMetaObject );
+QMetaObject* KProcIO::staticMetaObject()
+{
+    if ( metaObj )
+        return metaObj;
+    QMetaObject* parentObject = KProcess::staticMetaObject();
+    static const QUParameter param_slot_0[] = {
+        { "proc", &static_QUType_ptr, "KProcess", QUParameter::In },
+        { "buffer", &static_QUType_charstar, 0, QUParameter::In },
+        { "buflen", &static_QUType_int, 0, QUParameter::In }
+    };
+    static const QUMethod slot_0 = {"received", 3, param_slot_0 };
+    static const QUParameter param_slot_1[] = {
+        { 0, &static_QUType_ptr, "KProcess", QUParameter::In }
+    };
+    static const QUMethod slot_1 = {"sent", 1, param_slot_1 };
+    static const QMetaData slot_tbl[] = {
+        { "received(KProcess*,char*,int)", &slot_0, QMetaData::Protected },
+        { "sent(KProcess*)", &slot_1, QMetaData::Protected }
+    };
+    static const QUParameter param_signal_0[] = {
+        { "pio", &static_QUType_ptr, "KProcIO", QUParameter::In }
+    };
+    static const QUMethod signal_0 = {"readReady", 1, param_signal_0 };
+    static const QMetaData signal_tbl[] = {
+        { "readReady(KProcIO*)", &signal_0, QMetaData::Public }
+    };
+    metaObj = QMetaObject::new_metaobject(
+        "KProcIO", parentObject,
+        slot_tbl, 2,
+        signal_tbl, 1,
+
+        0, 0,
+        0, 0,
+
+        0, 0 );
+    cleanUp_KProcIO.setMetaObject( metaObj );
+    return metaObj;
+}
+
+void* KProcIO::qt_cast( const char* clname )
+{
+    if ( !qstrcmp( clname, "KProcIO" ) )
+        return this;
+    return KProcess::qt_cast( clname );
+}
+
+
+
+
+
+void KProcIO::readReady( KProcIO* t0 )
+{
+    if ( signalsBlocked() )
+        return;
+    QConnectionList *clist = receivers( staticMetaObject()->signalOffset() + 0 );
+    if ( !clist )
+        return;
+    QUObject o[2];
+    static_QUType_ptr.set(o+1,t0);
+    activate_signal( clist, o );
+}
+
+bool KProcIO::qt_invoke( int _id, QUObject* _o )
+{
+    switch ( _id - staticMetaObject()->slotOffset() ) {
+    case 0: received((KProcess*)static_QUType_ptr.get(_o+1),(char*)static_QUType_charstar.get(_o+2),(int)static_QUType_int.get(_o+3)); break;
+    case 1: sent((KProcess*)static_QUType_ptr.get(_o+1)); break;
+    default:
+        return KProcess::qt_invoke( _id, _o );
+    }
+    return TRUE;
+}
+
+bool KProcIO::qt_emit( int _id, QUObject* _o )
+{
+    switch ( _id - staticMetaObject()->signalOffset() ) {
+    case 0: readReady((KProcIO*)static_QUType_ptr.get(_o+1)); break;
+    default:
+        return KProcess::qt_emit(_id,_o);
+    }
+    return TRUE;
+}
+
+
+bool KProcIO::qt_property( int id, int f, QVariant* v)
+{
+    return KProcess::qt_property( id, f, v);
+}
+
+bool KProcIO::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C"
+
+int mkstemps(char *, int);
+extern "C"
+
+unsigned long strlcat(char*, const char*, unsigned long);
+
+
+
+
+
+
+extern "C"
+
+unsigned long strlcpy(char*, const char*, unsigned long);
+
+
+
+
+KBufferedIO::KBufferedIO() :
+  inBufIndex(0), outBufIndex(0)
+{
+  inBuf.setAutoDelete(true);
+  outBuf.setAutoDelete(true);
+}
+
+
+KBufferedIO::~KBufferedIO()
+{
+}
+
+
+
+
+bool KBufferedIO::setBufferSize(int rsize, int wsize )
+{
+  if (wsize != -2 && wsize != -1)
+    return false;
+  if (rsize != -2 && rsize != -1)
+    return false;
+
+  return true;
+}
+
+int KBufferedIO::bytesAvailable() const
+{
+  return readBufferSize();
+}
+
+int KBufferedIO::bytesToWrite() const
+{
+  return writeBufferSize();
+}
+
+
+bool KBufferedIO::canReadLine() const
+{
+  if (bytesAvailable() == 0)
+    return false;
+
+  QByteArray* buf;
+
+
+  QPtrList<QByteArray> &buflist = ((KBufferedIO*)this)->inBuf;
+  buf = buflist.first();
+  char *p = buf->data() + inBufIndex;
+  int n = buf->size() - inBufIndex;
+  while (buf != __null)
+    {
+      while (n--)
+        if (*p++ == '\n')
+          return true;
+      buf = buflist.next();
+      if (buf != __null)
+        {
+          p = buf->data();
+          n = buf->size();
+        }
+    }
+
+  return false;
+}
+
+
+
+int KBufferedIO::unreadBlock(const char *data, uint len)
+{
+  return feedReadBuffer(len, data, true);
+}
+
+
+
+
+
+unsigned KBufferedIO::consumeReadBuffer(unsigned nbytes, char *destbuffer, bool discard)
+{
+  {
+    register unsigned u = readBufferSize();
+    if (nbytes > u)
+      nbytes = u;
+  }
+
+  QByteArray *buf;
+  unsigned copied = 0;
+  unsigned index = inBufIndex;
+
+  buf = inBuf.first();
+  while (nbytes && buf)
+    {
+
+      unsigned to_copy = buf->size() - index;
+      if (to_copy > nbytes)
+        to_copy = nbytes;
+
+      if (destbuffer)
+        memcpy(destbuffer + copied, buf->data() + index, to_copy);
+      nbytes -= to_copy;
+      copied += to_copy;
+
+      if (buf->size() - index > to_copy)
+        {
+          index += to_copy;
+          break;
+
+        }
+      else
+        {
+          index = 0;
+          if (discard)
+            {
+              inBuf.remove();
+              buf = inBuf.first();
+            }
+          else
+            buf = inBuf.next();
+        }
+    }
+
+  if (discard)
+    inBufIndex = index;
+
+  return copied;
+}
+
+void KBufferedIO::consumeWriteBuffer(unsigned nbytes)
+{
+  QByteArray *buf = outBuf.first();
+  if (buf == __null)
+    return;
+
+  if (nbytes < buf->size() - outBufIndex)
+
+    outBufIndex += nbytes;
+  else
+    {
+      nbytes -= buf->size() - outBufIndex;
+      outBufIndex = 0;
+      outBuf.remove();
+
+      while ((buf = outBuf.current()) != __null)
+        if (buf->size() <= nbytes)
+          {
+            nbytes -= buf->size();
+            outBuf.remove();
+          }
+        else
+          {
+            outBufIndex = nbytes;
+            break;
+          }
+    }
+}
+
+unsigned KBufferedIO::feedReadBuffer(unsigned nbytes, const char *buffer, bool atBeginning)
+{
+  if (nbytes == 0)
+    return 0;
+
+  QByteArray *a = new QByteArray(nbytes);
+  a->duplicate(buffer, nbytes);
+
+  if (atBeginning)
+    inBuf.prepend(a);
+  else
+    inBuf.append(a);
+
+  return nbytes;
+}
+
+unsigned KBufferedIO::feedWriteBuffer(unsigned nbytes, const char *buffer)
+{
+  if (nbytes == 0)
+    return 0;
+
+  QByteArray *a = new QByteArray(nbytes);
+  a->duplicate(buffer, nbytes);
+  outBuf.append(a);
+  return nbytes;
+}
+
+unsigned KBufferedIO::readBufferSize() const
+{
+  unsigned count = 0;
+  QByteArray *buf = ((KBufferedIO*)this)->inBuf.first();
+  while (buf != __null)
+    {
+      count += buf->size();
+      buf = ((KBufferedIO*)this)->inBuf.next();
+    }
+
+  return count - inBufIndex;
+}
+
+unsigned KBufferedIO::writeBufferSize() const
+{
+  unsigned count = 0;
+  QByteArray *buf = ((KBufferedIO*)this)->outBuf.first();
+  while (buf != __null)
+    {
+      count += buf->size();
+      buf = (const_cast<KBufferedIO*>(this))->outBuf.next();
+    }
+
+  return count - outBufIndex;
+}
+
+void KBufferedIO::virtual_hook( int id, void* data )
+{ KAsyncIO::virtual_hook( id, data ); }
+
+const char *KBufferedIO::className() const
+{
+    return "KBufferedIO";
+}
+
+QMetaObject *KBufferedIO::metaObj = 0;
+static QMetaObjectCleanUp cleanUp_KBufferedIO( "KBufferedIO", &KBufferedIO::staticMetaObject );
+QMetaObject* KBufferedIO::staticMetaObject()
+{
+    if ( metaObj )
+        return metaObj;
+    QMetaObject* parentObject = KAsyncIO::staticMetaObject();
+    static const QUParameter param_signal_0[] = {
+        { "nbytes", &static_QUType_int, 0, QUParameter::In }
+    };
+    static const QUMethod signal_0 = {"bytesWritten", 1, param_signal_0 };
+    static const QUParameter param_signal_1[] = {
+        { "state", &static_QUType_int, 0, QUParameter::In }
+    };
+    static const QUMethod signal_1 = {"closed", 1, param_signal_1 };
+    static const QMetaData signal_tbl[] = {
+        { "bytesWritten(int)", &signal_0, QMetaData::Public },
+        { "closed(int)", &signal_1, QMetaData::Public }
+    };
+    metaObj = QMetaObject::new_metaobject(
+        "KBufferedIO", parentObject,
+        0, 0,
+        signal_tbl, 2,
+
+        0, 0,
+        0, 0,
+
+        0, 0 );
+    cleanUp_KBufferedIO.setMetaObject( metaObj );
+    return metaObj;
+}
+
+void* KBufferedIO::qt_cast( const char* clname )
+{
+    if ( !qstrcmp( clname, "KBufferedIO" ) )
+        return this;
+    return KAsyncIO::qt_cast( clname );
+}
+
+
+void KBufferedIO::bytesWritten( int t0 )
+{
+    activate_signal( staticMetaObject()->signalOffset() + 0, t0 );
+}
+
+
+void KBufferedIO::closed( int t0 )
+{
+    activate_signal( staticMetaObject()->signalOffset() + 1, t0 );
+}
+
+bool KBufferedIO::qt_invoke( int _id, QUObject* _o )
+{
+    return KAsyncIO::qt_invoke(_id,_o);
+}
+
+bool KBufferedIO::qt_emit( int _id, QUObject* _o )
+{
+    switch ( _id - staticMetaObject()->signalOffset() ) {
+    case 0: bytesWritten((int)static_QUType_int.get(_o+1)); break;
+    case 1: closed((int)static_QUType_int.get(_o+1)); break;
+    default:
+        return KAsyncIO::qt_emit(_id,_o);
+    }
+    return TRUE;
+}
+
+
+bool KBufferedIO::qt_property( int id, int f, QVariant* v)
+{
+    return KAsyncIO::qt_property( id, f, v);
+}
+
+bool KBufferedIO::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; }
+class KPixmapProvider
+{
+public:
+    virtual ~KPixmapProvider();
+
+
+
+
+
+
+
+    virtual QPixmap pixmapFor( const QString& text, int size = 0 ) = 0;
+protected:
+    virtual void virtual_hook( int id, void* data );
+};
+
+KPixmapProvider::~KPixmapProvider() {}
+
+void KPixmapProvider::virtual_hook( int , void* )
+{ }
+
+
+
+class QWidget;
+class QTextDragPrivate;
+class QDragObjectData;
+class QStoredDragData;
+class QImageDragData;
+class QDragObject: public QObject, public QMimeSource {
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+public:
+    QDragObject( QWidget * dragSource = 0, const char * name = 0 );
+    virtual ~QDragObject();
+
+
+    bool drag();
+    bool dragMove();
+    void dragCopy();
+    void dragLink();
+
+    virtual void setPixmap(QPixmap);
+    virtual void setPixmap(QPixmap, const QPoint& hotspot);
+    QPixmap pixmap() const;
+    QPoint pixmapHotSpot() const;
+
+
+    QWidget * source();
+    static QWidget * target();
+
+    static void setTarget(QWidget*);
+
+
+    enum DragMode { DragDefault, DragCopy, DragMove, DragLink, DragCopyOrMove };
+
+protected:
+    virtual bool drag(DragMode);
+
+
+private:
+    QDragObjectData * d;
+
+    QDragObject( const QDragObject & );
+    QDragObject &operator=( const QDragObject & );
+
+};
+
+class QStoredDrag: public QDragObject {
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+    QStoredDragData * d;
+
+public:
+    QStoredDrag( const char * mimeType,
+                 QWidget * dragSource = 0, const char * name = 0 );
+    ~QStoredDrag();
+
+    virtual void setEncodedData( const QByteArray & );
+
+    const char * format(int i) const;
+    virtual QByteArray encodedData(const char*) const;
+
+private:
+
+    QStoredDrag( const QStoredDrag & );
+    QStoredDrag &operator=( const QStoredDrag & );
+
+};
+
+class QTextDrag: public QDragObject {
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+    QTextDragPrivate* d;
+public:
+    QTextDrag( const QString &,
+               QWidget * dragSource = 0, const char * name = 0 );
+    QTextDrag( QWidget * dragSource = 0, const char * name = 0 );
+    ~QTextDrag();
+
+    virtual void setText( const QString &);
+    virtual void setSubtype( const QCString &);
+
+    const char * format(int i) const;
+    virtual QByteArray encodedData(const char*) const;
+
+    static bool canDecode( const QMimeSource* e );
+    static bool decode( const QMimeSource* e, QString& s );
+    static bool decode( const QMimeSource* e, QString& s, QCString& subtype );
+
+private:
+
+    QTextDrag( const QTextDrag & );
+    QTextDrag &operator=( const QTextDrag & );
+
+};
+
+class QImageDrag: public QDragObject {
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+    QImage img;
+    QStrList ofmts;
+    QImageDragData* d;
+
+public:
+    QImageDrag( QImage image, QWidget * dragSource = 0, const char * name = 0 );
+    QImageDrag( QWidget * dragSource = 0, const char * name = 0 );
+    ~QImageDrag();
+
+    virtual void setImage( QImage image );
+
+    const char * format(int i) const;
+    virtual QByteArray encodedData(const char*) const;
+
+    static bool canDecode( const QMimeSource* e );
+    static bool decode( const QMimeSource* e, QImage& i );
+    static bool decode( const QMimeSource* e, QPixmap& i );
+
+private:
+
+    QImageDrag( const QImageDrag & );
+    QImageDrag &operator=( const QImageDrag & );
+
+};
+
+
+class QUriDrag: public QStoredDrag {
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+
+public:
+    QUriDrag( QStrList uris, QWidget * dragSource = 0, const char * name = 0 );
+    QUriDrag( QWidget * dragSource = 0, const char * name = 0 );
+    ~QUriDrag();
+
+    void setFilenames( const QStringList & fnames ) { setFileNames( fnames ); }
+    void setFileNames( const QStringList & fnames );
+    void setUnicodeUris( const QStringList & uuris );
+    virtual void setUris( QStrList uris );
+
+    static QString uriToLocalFile(const char*);
+    static QCString localFileToUri(const QString&);
+    static QString uriToUnicodeUri(const char*);
+    static QCString unicodeUriToUri(const QString&);
+    static bool canDecode( const QMimeSource* e );
+    static bool decode( const QMimeSource* e, QStrList& i );
+    static bool decodeToUnicodeUris( const QMimeSource* e, QStringList& i );
+    static bool decodeLocalFiles( const QMimeSource* e, QStringList& i );
+
+private:
+
+    QUriDrag( const QUriDrag & );
+    QUriDrag &operator=( const QUriDrag & );
+
+};
+
+class QColorDrag : public QStoredDrag
+{
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+    QColor color;
+
+public:
+    QColorDrag( const QColor &col, QWidget *dragsource = 0, const char *name = 0 );
+    QColorDrag( QWidget * dragSource = 0, const char * name = 0 );
+    void setColor( const QColor &col );
+
+    static bool canDecode( QMimeSource * );
+    static bool decode( QMimeSource *, QColor &col );
+
+private:
+
+    QColorDrag( const QColorDrag & );
+    QColorDrag &operator=( const QColorDrag & );
+
+};
+
+
+typedef QUriDrag QUrlDrag;
+class QDragManager: public QObject {
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+
+private:
+    QDragManager();
+    ~QDragManager();
+
+    friend class QDragObject;
+    friend class QDragMoveEvent;
+    friend class QDropEvent;
+    friend class QApplication;
+
+    bool eventFilter( QObject *, QEvent * );
+    void timerEvent( QTimerEvent* );
+
+    bool drag( QDragObject *, QDragObject::DragMode );
+
+    void cancel( bool deleteSource = TRUE );
+    void move( const QPoint & );
+    void drop();
+    void updatePixmap();
+
+private:
+    QDragObject * object;
+    void updateMode( ButtonState newstate );
+    void updateCursor();
+
+    QWidget * dragSource;
+    QWidget * dropWidget;
+    bool beingCancelled;
+    bool restoreCursor;
+    bool willDrop;
+
+    QPixmap *pm_cursor;
+    int n_cursor;
+
+    QDragManager( const QDragManager & );
+    QDragManager &operator=( const QDragManager & );
+
+};
+
+
+class QMimeSource;
+
+class KURLDragPrivate;
+class KURLDrag : public QUriDrag
+{
+public:
+  KURLDrag( const KURL::List &urls, QWidget* dragSource = 0, const char * name = 0 );
+  KURLDrag( const KURL::List &urls, const QMap<QString, QString>& metaData,
+            QWidget* dragSource = 0, const char * name = 0 );
+
+  virtual ~KURLDrag();
+
+
+
+
+  static KURLDrag * newDrag( const KURL::List &urls, QWidget* dragSource = 0, const char * name = 0 ) ;
+
+
+
+
+  static KURLDrag * newDrag( const KURL::List &urls, const QMap<QString, QString>& metaData,
+                             QWidget* dragSource = 0, const char * name = 0 ) __attribute__ ((deprecated));
+  QMap<QString, QString> &metaData() { return m_metaData; }
+  static bool decode( const QMimeSource *e, KURL::List &urls );
+  static bool decode( const QMimeSource *e, KURL::List &urls, QMap<QString,QString>& metaData );
+
+
+
+
+
+  static QString urlToString(const KURL &url);
+
+
+
+
+
+  static KURL stringToUrl(const QCString &s);
+protected:
+
+
+
+  KURLDrag( const QStrList & urls, const QMap<QString,QString>& metaData,
+            QWidget * dragSource, const char* name ) __attribute__ ((deprecated));
+
+  virtual const char * format( int i ) const;
+  virtual QByteArray encodedData( const char* mime ) const;
+
+private:
+  void init(const KURL::List &urls);
+
+  QStrList m_urls;
+  QMap<QString,QString> m_metaData;
+  KURLDragPrivate* d;
+};
+KURLDrag::KURLDrag( const KURL::List &urls, QWidget* dragSource, const char * name )
+    : QUriDrag(dragSource, name), m_metaData()
+{
+    init(urls);
+}
+
+KURLDrag::KURLDrag( const KURL::List &urls, const QMap<QString,QString>& metaData,
+                    QWidget* dragSource, const char * name )
+    : QUriDrag(dragSource, name), m_metaData(metaData)
+{
+    init(urls);
+}
+
+KURLDrag::~KURLDrag()
+{
+}
+
+void KURLDrag::init(const KURL::List &urls)
+{
+    KURL::List::ConstIterator uit = urls.begin();
+    KURL::List::ConstIterator uEnd = urls.end();
+
+
+    for ( ; uit != uEnd ; ++uit )
+    {
+        m_urls.append( urlToString(*uit).latin1() );
+    }
+    setUris(m_urls);
+}
+
+KURLDrag * KURLDrag::newDrag( const KURL::List &urls, QWidget* dragSource, const char * name )
+{
+    return new KURLDrag( urls, QMap<QString, QString>(), dragSource, name );
+}
+
+KURLDrag * KURLDrag::newDrag( const KURL::List &urls, const QMap<QString, QString>& metaData,
+                              QWidget* dragSource, const char * name )
+{
+    return new KURLDrag( urls, metaData, dragSource, name );
+}
+
+bool KURLDrag::decode( const QMimeSource *e, KURL::List &uris )
+{
+    QStrList lst;
+    QUriDrag::decode( e, lst );
+    for (QStrListIterator it(lst); *it; ++it)
+    {
+      KURL url = stringToUrl( *it );
+      if ( !url.isValid() )
+      {
+        uris.clear();
+        break;
+      }
+      uris.append( url );
+    }
+    return !uris.isEmpty();
+}
+
+bool KURLDrag::decode( const QMimeSource *e, KURL::List &uris, QMap<QString,QString>& metaData )
+{
+    if ( decode( e, uris ) )
+    {
+        QByteArray ba = e->encodedData( "application/x-kio-metadata" );
+        if ( ba.size() )
+        {
+            QString s = ba.data();
+            QStringList l = QStringList::split( "$@@$", s );
+            QStringList::ConstIterator it = l.begin();
+            bool readingKey = true;
+            QString key;
+            for ( ; it != l.end(); ++it ) {
+                if ( readingKey )
+                    key = *it;
+                else
+                    metaData.replace( key, *it );
+                readingKey = !readingKey;
+            }
+            ((readingKey) ? (void)0 : qWarning("ASSERT: \"%s\" in %s (%d)","readingKey","/coolo/prod/kdelibs/kdecore/kurldrag.cpp",107));
+        }
+        return true;
+    }
+    return false;
+}
+const char * KURLDrag::format( int i ) const
+{
+    if ( i == 0 )
+        return "text/uri-list";
+    else if ( i == 1 )
+        return "text/plain";
+    else if ( i == 2 )
+        return "application/x-kio-metadata";
+    else if ( i == 3 )
+        return "text/plain;charset=ISO-8859-1";
+    else if ( i == 4 )
+        return "text/plain;charset=UTF-8";
+    else return 0;
+}
+
+QByteArray KURLDrag::encodedData( const char* mime ) const
+{
+    QByteArray a;
+    QCString mimetype( mime );
+    if ( mimetype == "text/uri-list" )
+        return QUriDrag::encodedData( mime );
+    else if ( mimetype == "text/plain" )
+    {
+        QStringList uris;
+        for (QStrListIterator it(m_urls); *it; ++it)
+           uris.append(stringToUrl(*it).prettyURL());
+
+        QCString s = uris.join( "\n" ).local8Bit();
+        if( uris.count() > 1 )
+            s.append( "\n" );
+        a.resize( s.length());
+        memcpy( a.data(), s.data(), s.length());
+    }
+    else if ( mimetype.lower() == "text/plain;charset=iso-8859-1")
+    {
+        QStringList uris;
+        for (QStrListIterator it(m_urls); *it; ++it)
+        for (QStrListIterator it(m_urls); *it; ++it)
+           uris.append(stringToUrl(*it).url(0, 4));
+
+        QCString s = uris.join( "\n" ).latin1();
+        if( uris.count() > 1 )
+            s.append( "\n" );
+        a.resize( s.length());
+        memcpy( a.data(), s.data(), s.length());
+    }
+    else if ( mimetype.lower() == "text/plain;charset=utf-8")
+    {
+        QStringList uris;
+        for (QStrListIterator it(m_urls); *it; ++it)
+           uris.append(stringToUrl(*it).prettyURL());
+
+        QCString s = uris.join( "\n" ).utf8();
+        if( uris.count() > 1 )
+            s.append( "\n" );
+        a.resize( s.length());
+        memcpy( a.data(), s.data(), s.length());
+    }
+    else if ( mimetype == "application/x-kio-metadata" )
+    {
+        if ( !m_metaData.isEmpty() )
+        {
+            QString s;
+            QMap<QString,QString>::ConstIterator it;
+            for( it = m_metaData.begin(); it != m_metaData.end(); ++it )
+            {
+                s += it.key();
+                s += "$@@$";
+                s += it.data();
+                s += "$@@$";
+            }
+            a.resize( s.length() + 1 );
+            memcpy( a.data(), s.latin1(), a.size() );
+        }
+    }
+    return a;
+}
+
+KURL KURLDrag::stringToUrl(const QCString &s)
+{
+    if (strncmp(s.data(), "file:", 5) == 0)
+       return KURL(s, KGlobal::locale()->fileEncodingMib());
+
+    return KURL(s, 106);
+}
+
+QString KURLDrag::urlToString(const KURL &url)
+{
+    if (url.isLocalFile())
+    {
+
+        return url.url(0, KGlobal::locale()->fileEncodingMib());
+    }
+
+    return url.url(0, 106);
+}
+
+
+KURLDrag::KURLDrag( const QStrList & urls, const QMap<QString,QString>& metaData,
+                    QWidget * dragSource, const char* name ) :
+QUriDrag( urls, dragSource, name ), m_urls( urls ), m_metaData( metaData ) {}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C"
+
+int mkstemps(char *, int);
+extern "C"
+
+unsigned long strlcat(char*, const char*, unsigned long);
+
+
+
+
+
+
+extern "C"
+
+unsigned long strlcpy(char*, const char*, unsigned long);
+
+
+
+
+
+
+
+
+
+
+
+
+class KCodecs
+{
+public:
+  static QCString quotedPrintableEncode(const QByteArray & in,
+                                        bool useCRLF = true);
+  static QCString quotedPrintableEncode(const QCString & str,
+                                        bool useCRLF = true);
+  static void quotedPrintableEncode(const QByteArray & in, QByteArray& out,
+                                    bool useCRLF);
+  static QCString quotedPrintableDecode(const QByteArray & in);
+  static QCString quotedPrintableDecode(const QCString & str);
+  static void quotedPrintableDecode(const QByteArray & in, QByteArray& out);
+  static QCString uuencode( const QByteArray& in );
+  static QCString uuencode( const QCString& str );
+  static void uuencode( const QByteArray& in, QByteArray& out );
+  static QCString uudecode( const QByteArray& in );
+  static QCString uudecode( const QCString& str );
+  static void uudecode( const QByteArray& in, QByteArray& out );
+  static QCString base64Encode( const QByteArray& in, bool insertLFs = false);
+  static QCString base64Encode( const QCString& str, bool insertLFs = false );
+  static void base64Encode( const QByteArray& in, QByteArray& out,
+                            bool insertLFs = false );
+  static QCString base64Decode( const QByteArray& in );
+  static QCString base64Decode( const QCString& str );
+  static void base64Decode( const QByteArray& in, QByteArray& out );
+
+
+private:
+  KCodecs();
+
+private:
+  static const char UUEncMap[64];
+  static const char UUDecMap[128];
+  static const char Base64EncMap[64];
+  static const char Base64DecMap[128];
+  static const char hexChars[16];
+  static const unsigned int maxQPLineLength;
+};
+
+class KMD5Private;
+class KMD5
+{
+public:
+
+  typedef unsigned char Digest[16];
+
+  KMD5();
+  KMD5(const char* in, int len = -1);
+
+
+
+
+
+
+  KMD5(const QByteArray& a );
+
+
+
+
+
+
+  KMD5(const QCString& a );
+  void update(const char* in, int len = -1) { update(reinterpret_cast<const unsigned char*>(in), len); }
+
+
+
+
+  void update(const unsigned char* in, int len = -1);
+
+
+
+
+
+
+  void update(const QByteArray& in );
+
+
+
+
+
+
+  void update(const QCString& in );
+  bool update(QIODevice& file);
+
+
+
+
+
+
+  void reset();
+
+
+
+
+  const Digest& rawDigest ();
+  void rawDigest( KMD5::Digest& bin );
+
+
+
+
+
+  QCString hexDigest ();
+
+
+
+
+  void hexDigest(QCString&);
+
+
+
+
+
+  QCString base64Digest ();
+
+
+
+
+
+  bool verify( const KMD5::Digest& digest);
+
+
+
+
+  bool verify(const QCString&);
+
+protected:
+
+
+
+
+  void transform( const unsigned char buffer[64] );
+
+
+
+
+  void finalize();
+
+private:
+  KMD5(const KMD5& u);
+  KMD5& operator=(const KMD5& md);
+
+  void init();
+  void encode( unsigned char* output, Q_UINT32 *in, Q_UINT32 len );
+  void decode( Q_UINT32 *output, const unsigned char* in, Q_UINT32 len );
+
+  Q_UINT32 rotate_left( Q_UINT32 x, Q_UINT32 n );
+  Q_UINT32 F( Q_UINT32 x, Q_UINT32 y, Q_UINT32 z );
+  Q_UINT32 G( Q_UINT32 x, Q_UINT32 y, Q_UINT32 z );
+  Q_UINT32 H( Q_UINT32 x, Q_UINT32 y, Q_UINT32 z );
+  Q_UINT32 I( Q_UINT32 x, Q_UINT32 y, Q_UINT32 z );
+  void FF( Q_UINT32& a, Q_UINT32 b, Q_UINT32 c, Q_UINT32 d, Q_UINT32 x,
+               Q_UINT32 s, Q_UINT32 ac );
+  void GG( Q_UINT32& a, Q_UINT32 b, Q_UINT32 c, Q_UINT32 d, Q_UINT32 x,
+                Q_UINT32 s, Q_UINT32 ac );
+  void HH( Q_UINT32& a, Q_UINT32 b, Q_UINT32 c, Q_UINT32 d, Q_UINT32 x,
+                Q_UINT32 s, Q_UINT32 ac );
+  void II( Q_UINT32& a, Q_UINT32 b, Q_UINT32 c, Q_UINT32 d, Q_UINT32 x,
+             Q_UINT32 s, Q_UINT32 ac );
+
+private:
+  Q_UINT32 m_state[4];
+  Q_UINT32 m_count[2];
+  Q_UINT8 m_buffer[64];
+  Digest m_digest;
+  bool m_finalized;
+
+  KMD5Private* d;
+};
+
+
+const char KCodecs::Base64EncMap[64] =
+{
+  0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48,
+  0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50,
+  0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
+  0x59, 0x5A, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66,
+  0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E,
+  0x6F, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76,
+  0x77, 0x78, 0x79, 0x7A, 0x30, 0x31, 0x32, 0x33,
+  0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x2B, 0x2F
+};
+
+const char KCodecs::Base64DecMap[128] =
+{
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x3F,
+  0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B,
+  0x3C, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
+  0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E,
+  0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16,
+  0x17, 0x18, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20,
+  0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28,
+  0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30,
+  0x31, 0x32, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+
+const char KCodecs::UUEncMap[64] =
+{
+  0x60, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
+  0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F,
+  0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
+  0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F,
+  0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
+  0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F,
+  0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
+  0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F
+};
+
+const char KCodecs::UUDecMap[128] =
+{
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+  0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
+  0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+  0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F,
+  0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
+  0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F,
+  0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
+  0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+
+const char KCodecs::hexChars[16] =
+{
+  '0', '1', '2', '3', '4', '5', '6', '7',
+  '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
+};
+
+const unsigned int KCodecs::maxQPLineLength = 70;
+
+
+
+
+static int rikFindChar(register const char * _s, const char c)
+{
+  register const char * s = _s;
+
+  while (true)
+  {
+    if ((0 == *s) || (c == *s)) break; ++s;
+    if ((0 == *s) || (c == *s)) break; ++s;
+    if ((0 == *s) || (c == *s)) break; ++s;
+    if ((0 == *s) || (c == *s)) break; ++s;
+  }
+
+  return s - _s;
+}
+
+QCString KCodecs::quotedPrintableEncode(const QByteArray& in, bool useCRLF)
+{
+  QByteArray out;
+  quotedPrintableEncode (in, out, useCRLF);
+  return QCString (out.data(), out.size()+1);
+}
+
+QCString KCodecs::quotedPrintableEncode(const QCString& str, bool useCRLF)
+{
+  if (str.isEmpty())
+    return "";
+
+  QByteArray in (str.length());
+  memcpy (in.data(), str.data(), str.length());
+  return quotedPrintableEncode(in, useCRLF);
+}
+
+void KCodecs::quotedPrintableEncode(const QByteArray& in, QByteArray& out, bool useCRLF)
+{
+  out.resize (0);
+  if (in.isEmpty())
+    return;
+
+  char *cursor;
+  const char *data;
+  unsigned int lineLength;
+  unsigned int pos;
+
+  const unsigned int length = in.size();
+  const unsigned int end = length - 1;
+
+
+
+
+
+
+  out.resize ((length*12)/10);
+  cursor = out.data();
+  data = in.data();
+  lineLength = 0;
+  pos = 0;
+
+  for (unsigned int i = 0; i < length; i++)
+  {
+    unsigned char c (data[i]);
+
+
+
+    pos = cursor-out.data();
+    if (out.size()-pos < 16) {
+      out.resize(out.size()+4096);
+      cursor = out.data()+pos;
+    }
+
+
+
+    if ((c >= 33) && (c <= 126) && ('=' != c))
+    {
+      *cursor++ = c;
+      ++lineLength;
+    }
+
+
+
+    else if (' ' == c)
+    {
+      if
+        (
+         (i >= length)
+         ||
+         ((i < end) && ((useCRLF && ('\r' == data[i + 1]) && ('\n' == data[i + 2]))
+                        ||
+                        (!useCRLF && ('\n' == data[i + 1]))))
+        )
+      {
+        *cursor++ = '=';
+        *cursor++ = '2';
+        *cursor++ = '0';
+
+        lineLength += 3;
+      }
+      else
+      {
+        *cursor++ = ' ';
+        ++lineLength;
+      }
+    }
+
+    else if ((useCRLF && ('\r' == c) && (i < end) && ('\n' == data[i + 1])) ||
+             (!useCRLF && ('\n' == c)))
+    {
+      lineLength = 0;
+
+      if (useCRLF) {
+        *cursor++ = '\r';
+        *cursor++ = '\n';
+        ++i;
+      } else {
+        *cursor++ = '\n';
+      }
+    }
+
+
+
+    else
+    {
+      *cursor++ = '=';
+      *cursor++ = hexChars[c / 16];
+      *cursor++ = hexChars[c % 16];
+
+      lineLength += 3;
+    }
+
+
+
+    if ((lineLength > maxQPLineLength) && (i < end))
+    {
+      if (useCRLF) {
+        *cursor++ = '=';
+        *cursor++ = '\r';
+        *cursor++ = '\n';
+      } else {
+        *cursor++ = '=';
+        *cursor++ = '\n';
+      }
+
+      lineLength = 0;
+    }
+  }
+
+  out.truncate(cursor - out.data());
+}
+
+QCString KCodecs::quotedPrintableDecode(const QByteArray & in)
+{
+  QByteArray out;
+  quotedPrintableDecode (in, out);
+  return QCString (out.data(), out.size()+1);
+}
+
+QCString KCodecs::quotedPrintableDecode(const QCString & str)
+{
+  if (str.isEmpty())
+    return "";
+
+  QByteArray in (str.length());
+  memcpy (in.data(), str.data(), str.length());
+  return quotedPrintableDecode (in);
+}
+
+void KCodecs::quotedPrintableDecode(const QByteArray& in, QByteArray& out)
+{
+
+  out.resize (0);
+  if (in.isEmpty())
+      return;
+
+  char *cursor;
+  const char *data;
+  const unsigned int length = in.size();
+
+  data = in.data();
+  out.resize (length);
+  cursor = out.data();
+
+  for (unsigned int i = 0; i < length; i++)
+  {
+    char c(in[i]);
+
+    if ('=' == c)
+    {
+      if (i < length - 2)
+      {
+        char c1 = in[i + 1];
+        char c2 = in[i + 2];
+
+        if (('\n' == c1) || ('\r' == c1 && '\n' == c2))
+        {
+
+          if ('\r' == c1)
+            i += 2;
+          else
+            i += 1;
+        }
+        else
+        {
+
+
+          int hexChar0 = rikFindChar(hexChars, c1);
+          int hexChar1 = rikFindChar(hexChars, c2);
+
+          if (hexChar0 < 16 && hexChar1 < 16)
+          {
+            *cursor++ = char((hexChar0 * 16) | hexChar1);
+            i += 2;
+          }
+        }
+      }
+    }
+    else
+    {
+      *cursor++ = c;
+    }
+  }
+
+  out.truncate(cursor - out.data());
+}
+
+QCString KCodecs::base64Encode( const QCString& str, bool insertLFs )
+{
+    if ( str.isEmpty() )
+        return "";
+
+    QByteArray in (str.length());
+    memcpy( in.data(), str.data(), str.length() );
+    return base64Encode( in, insertLFs );
+}
+
+QCString KCodecs::base64Encode( const QByteArray& in, bool insertLFs )
+{
+    QByteArray out;
+    base64Encode( in, out, insertLFs );
+    return QCString( out.data(), out.size()+1 );
+}
+
+void KCodecs::base64Encode( const QByteArray& in, QByteArray& out,
+                            bool insertLFs )
+{
+
+    out.resize (0);
+    if ( in.isEmpty() )
+        return;
+
+    unsigned int sidx = 0;
+    unsigned int didx = 0;
+    const char* data = in.data();
+    const unsigned int len = in.size();
+
+    unsigned int out_len = ((len+2)/3)*4;
+
+
+
+
+    insertLFs = (insertLFs && out_len > 76);
+    if ( insertLFs )
+      out_len += ((out_len-1)/76);
+
+    int count = 0;
+    out.resize( out_len );
+
+
+    if ( len > 1 )
+    {
+        while (sidx < len-2)
+        {
+            if ( insertLFs )
+            {
+                if ( count && (count%76) == 0 )
+                    out[didx++] = '\n';
+                count += 4;
+            }
+            out[didx++] = Base64EncMap[(data[sidx] >> 2) & 077];
+            out[didx++] = Base64EncMap[(data[sidx+1] >> 4) & 017 |
+                                       (data[sidx] << 4) & 077];
+            out[didx++] = Base64EncMap[(data[sidx+2] >> 6) & 003 |
+                                       (data[sidx+1] << 2) & 077];
+            out[didx++] = Base64EncMap[data[sidx+2] & 077];
+            sidx += 3;
+        }
+    }
+
+    if (sidx < len)
+    {
+        if ( insertLFs && (count > 0) && (count%76) == 0 )
+           out[didx++] = '\n';
+
+        out[didx++] = Base64EncMap[(data[sidx] >> 2) & 077];
+        if (sidx < len-1)
+        {
+            out[didx++] = Base64EncMap[(data[sidx+1] >> 4) & 017 |
+                                       (data[sidx] << 4) & 077];
+            out[didx++] = Base64EncMap[(data[sidx+1] << 2) & 077];
+        }
+        else
+        {
+            out[didx++] = Base64EncMap[(data[sidx] << 4) & 077];
+        }
+    }
+
+
+    while (didx < out.size())
+    {
+        out[didx] = '=';
+        didx++;
+    }
+}
+
+QCString KCodecs::base64Decode( const QCString& str )
+{
+    if ( str.isEmpty() )
+        return "";
+
+    QByteArray in( str.length() );
+    memcpy( in.data(), str.data(), str.length() );
+    return base64Decode( in );
+}
+
+QCString KCodecs::base64Decode( const QByteArray& in )
+{
+    QByteArray out;
+    base64Decode( in, out );
+    return QCString( out.data(), out.size()+1 );
+}
+
+void KCodecs::base64Decode( const QByteArray& in, QByteArray& out )
+{
+    out.resize(0);
+    if ( in.isEmpty() )
+        return;
+
+    unsigned int count = 0;
+    unsigned int len = in.size(), tail = len;
+    const char* data = in.data();
+
+
+    while ( count < len && (data[count] == '\n' || data[count] == '\r' ||
+            data[count] == '\t' || data[count] == ' ') )
+        count++;
+
+    if ( strncasecmp(data+count, "begin", 5) == 0 )
+    {
+        count += 5;
+        while ( count < len && data[count] != '\n' && data[count] != '\r' )
+            count++;
+
+        while ( count < len && (data[count] == '\n' || data[count] == '\r') )
+            count ++;
+
+        data += count;
+        tail = (len -= count);
+    }
+
+
+
+    while ( data[tail-1] == '=' || data[tail-1] == '\n' ||
+            data[tail-1] == '\r' )
+        if ( data[--tail] != '=' ) len = tail;
+
+    unsigned int outIdx = 0;
+    out.resize( (count=len) );
+    for (unsigned int idx = 0; idx < count; idx++)
+    {
+
+
+        unsigned char ch = data[idx];
+        if ((ch > 47 && ch < 58) || (ch > 64 && ch < 91) ||
+            (ch > 96 && ch < 123) || ch == '+' || ch == '/' || ch == '=')
+        {
+            out[outIdx++] = Base64DecMap[ch];
+        }
+        else
+        {
+            len--;
+            tail--;
+        }
+    }
+
+
+
+
+    len = (tail>(len/4)) ? tail-(len/4) : 0;
+    unsigned int sidx = 0, didx = 0;
+    if ( len > 1 )
+    {
+      while (didx < len-2)
+      {
+          out[didx] = (((out[sidx] << 2) & 255) | ((out[sidx+1] >> 4) & 003));
+          out[didx+1] = (((out[sidx+1] << 4) & 255) | ((out[sidx+2] >> 2) & 017));
+          out[didx+2] = (((out[sidx+2] << 6) & 255) | (out[sidx+3] & 077));
+          sidx += 4;
+          didx += 3;
+      }
+    }
+
+    if (didx < len)
+        out[didx] = (((out[sidx] << 2) & 255) | ((out[sidx+1] >> 4) & 003));
+
+    if (++didx < len )
+        out[didx] = (((out[sidx+1] << 4) & 255) | ((out[sidx+2] >> 2) & 017));
+
+
+    if ( len == 0 || len < out.size() )
+      out.resize(len);
+}
+
+QCString KCodecs::uuencode( const QCString& str )
+{
+    if ( str.isEmpty() )
+        return "";
+
+    QByteArray in;
+    in.resize( str.length() );
+    memcpy( in.data(), str.data(), str.length() );
+    return uuencode( in );
+}
+
+QCString KCodecs::uuencode( const QByteArray& in )
+{
+    QByteArray out;
+    uuencode( in, out );
+    return QCString( out.data(), out.size()+1 );
+}
+
+void KCodecs::uuencode( const QByteArray& in, QByteArray& out )
+{
+    out.resize( 0 );
+    if( in.isEmpty() )
+        return;
+
+    unsigned int sidx = 0;
+    unsigned int didx = 0;
+    unsigned int line_len = 45;
+
+    const char nl[] = "\n";
+    const char* data = in.data();
+    const unsigned int nl_len = strlen(nl);
+    const unsigned int len = in.size();
+
+    out.resize( (len+2)/3*4 + ((len+line_len-1)/line_len)*(nl_len+1) );
+
+    while (sidx+line_len < len)
+    {
+
+        out[didx++] = UUEncMap[line_len];
+
+
+        for (unsigned int end = sidx+line_len; sidx < end; sidx += 3)
+        {
+            out[didx++] = UUEncMap[(data[sidx] >> 2) & 077];
+            out[didx++] = UUEncMap[(data[sidx+1] >> 4) & 017 |
+                                   (data[sidx] << 4) & 077];
+            out[didx++] = UUEncMap[(data[sidx+2] >> 6) & 003 |
+                                (data[sidx+1] << 2) & 077];
+            out[didx++] = UUEncMap[data[sidx+2] & 077];
+        }
+
+
+
+
+        memcpy(out.data()+didx, nl, nl_len);
+        didx += nl_len;
+    }
+
+
+    out[didx++] = UUEncMap[len-sidx];
+
+    while (sidx+2 < len)
+    {
+        out[didx++] = UUEncMap[(data[sidx] >> 2) & 077];
+        out[didx++] = UUEncMap[(data[sidx+1] >> 4) & 017 |
+                               (data[sidx] << 4) & 077];
+        out[didx++] = UUEncMap[(data[sidx+2] >> 6) & 003 |
+                               (data[sidx+1] << 2) & 077];
+        out[didx++] = UUEncMap[data[sidx+2] & 077];
+        sidx += 3;
+    }
+
+    if (sidx < len-1)
+    {
+        out[didx++] = UUEncMap[(data[sidx] >> 2) & 077];
+        out[didx++] = UUEncMap[(data[sidx+1] >> 4) & 017 |
+                               (data[sidx] << 4) & 077];
+        out[didx++] = UUEncMap[(data[sidx+1] << 2) & 077];
+        out[didx++] = UUEncMap[0];
+    }
+    else if (sidx < len)
+    {
+        out[didx++] = UUEncMap[(data[sidx] >> 2) & 077];
+        out[didx++] = UUEncMap[(data[sidx] << 4) & 077];
+        out[didx++] = UUEncMap[0];
+        out[didx++] = UUEncMap[0];
+    }
+
+
+    memcpy(out.data()+didx, nl, nl_len);
+    didx += nl_len;
+
+
+    if ( didx != out.size() )
+        out.resize( 0 );
+}
+
+QCString KCodecs::uudecode( const QCString& str )
+{
+    if ( str.isEmpty() )
+        return "";
+
+    QByteArray in;
+    in.resize( str.length() );
+    memcpy( in.data(), str.data(), str.length() );
+    return uudecode( in );
+}
+
+QCString KCodecs::uudecode( const QByteArray& in )
+{
+    QByteArray out;
+    uudecode( in, out );
+    return QCString( out.data(), out.size()+1 );
+}
+
+void KCodecs::uudecode( const QByteArray& in, QByteArray& out )
+{
+    out.resize( 0 );
+    if( in.isEmpty() )
+        return;
+
+    unsigned int sidx = 0;
+    unsigned int didx = 0;
+    unsigned int len = in.size();
+    unsigned int line_len, end;
+    const char* data = in.data();
+
+
+    unsigned int count = 0;
+    while ( count < len && (data[count] == '\n' || data[count] == '\r' ||
+            data[count] == '\t' || data[count] == ' ') )
+        count ++;
+
+    bool hasLF = false;
+    if ( strncasecmp( data+count, "begin", 5) == 0 )
+    {
+        count += 5;
+        while ( count < len && data[count] != '\n' && data[count] != '\r' )
+            count ++;
+
+        while ( count < len && (data[count] == '\n' || data[count] == '\r') )
+            count ++;
+
+        data += count;
+        len -= count;
+        hasLF = true;
+    }
+
+    out.resize( len/4*3 );
+    while ( sidx < len )
+    {
+
+        line_len = UUDecMap[ (unsigned char) data[sidx++]];
+
+        end = didx+line_len;
+        char A, B, C, D;
+        if (end > 2) {
+          while (didx < end-2)
+          {
+             A = UUDecMap[(unsigned char) data[sidx]];
+             B = UUDecMap[(unsigned char) data[sidx+1]];
+             C = UUDecMap[(unsigned char) data[sidx+2]];
+             D = UUDecMap[(unsigned char) data[sidx+3]];
+             out[didx++] = ( ((A << 2) & 255) | ((B >> 4) & 003) );
+             out[didx++] = ( ((B << 4) & 255) | ((C >> 2) & 017) );
+             out[didx++] = ( ((C << 6) & 255) | (D & 077) );
+             sidx += 4;
+          }
+        }
+
+        if (didx < end)
+        {
+            A = UUDecMap[(unsigned char) data[sidx]];
+            B = UUDecMap[(unsigned char) data[sidx+1]];
+            out[didx++] = ( ((A << 2) & 255) | ((B >> 4) & 003) );
+        }
+
+        if (didx < end)
+        {
+            B = UUDecMap[(unsigned char) data[sidx+1]];
+            C = UUDecMap[(unsigned char) data[sidx+2]];
+            out[didx++] = ( ((B << 4) & 255) | ((C >> 2) & 017) );
+        }
+
+
+        while (sidx < len && data[sidx] != '\n' && data[sidx] != '\r')
+            sidx++;
+
+
+        while (sidx < len && (data[sidx] == '\n' || data[sidx] == '\r'))
+            sidx++;
+
+
+        if ( hasLF && strncasecmp( data+sidx, "end", 3) == 0 )
+            break;
+    }
+
+    if ( didx < out.size() )
+        out.resize( didx );
+}
+
+
+KMD5::KMD5()
+{
+    init();
+}
+
+KMD5::KMD5(const char *in, int len)
+{
+    init();
+    update(in, len);
+}
+
+KMD5::KMD5(const QByteArray& in)
+{
+    init();
+    update( in );
+}
+
+KMD5::KMD5(const QCString& in)
+{
+    init();
+    update( in );
+}
+
+void KMD5::update(const QByteArray& in)
+{
+    update(in.data(), int(in.size()));
+}
+
+void KMD5::update(const QCString& in)
+{
+    update(in.data(), int(in.length()));
+}
+
+void KMD5::update(const unsigned char* in, int len)
+{
+    if (len < 0)
+        len = qstrlen(reinterpret_cast<const char*>(in));
+
+    if (!len)
+        return;
+
+    if (m_finalized) {
+        kdWarning() << "KMD5::update called after state was finalized!" << endl;
+        return;
+    }
+
+    Q_UINT32 in_index;
+    Q_UINT32 buffer_index;
+    Q_UINT32 buffer_space;
+    Q_UINT32 in_length = static_cast<Q_UINT32>( len );
+
+    buffer_index = static_cast<Q_UINT32>((m_count[0] >> 3) & 0x3F);
+
+    if ( (m_count[0] += (in_length << 3))<(in_length << 3) )
+        m_count[1]++;
+
+    m_count[1] += (in_length >> 29);
+    buffer_space = 64 - buffer_index;
+
+    if (in_length >= buffer_space)
+    {
+        memcpy (m_buffer + buffer_index, in, buffer_space);
+        transform (m_buffer);
+
+        for (in_index = buffer_space; in_index + 63 < in_length;
+             in_index += 64)
+            transform (reinterpret_cast<const unsigned char*>(in+in_index));
+
+        buffer_index = 0;
+    }
+    else
+        in_index=0;
+
+    memcpy(m_buffer+buffer_index, in+in_index, in_length-in_index);
+}
+
+bool KMD5::update(QIODevice& file)
+{
+    char buffer[1024];
+    int len;
+
+    while ((len=file.readBlock(reinterpret_cast<char*>(buffer), sizeof(buffer))) > 0)
+        update(buffer, len);
+
+    return file.atEnd();
+}
+
+void KMD5::finalize ()
+{
+    if (m_finalized) return;
+
+    Q_UINT8 bits[8];
+    Q_UINT32 index, padLen;
+    static unsigned char PADDING[64]=
+    {
+        0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+    };
+
+    encode (bits, m_count, 8);
+
+
+
+    index = static_cast<Q_UINT32>((m_count[0] >> 3) & 0x3f);
+    padLen = (index < 56) ? (56 - index) : (120 - index);
+    update (reinterpret_cast<const char*>(PADDING), padLen);
+
+
+    update (reinterpret_cast<const char*>(bits), 8);
+
+
+    encode (m_digest, m_state, 16);
+
+
+
+    memset ( (void *)m_buffer, 0, sizeof(*m_buffer));
+
+    m_finalized = true;
+}
+
+
+bool KMD5::verify( const KMD5::Digest& digest)
+{
+    finalize();
+    return (0 == memcmp(rawDigest(), digest, sizeof(KMD5::Digest)));
+}
+
+bool KMD5::verify( const QCString& hexdigest)
+{
+    finalize();
+    return (0 == strcmp(hexDigest().data(), hexdigest));
+}
+
+const KMD5::Digest& KMD5::rawDigest()
+{
+    finalize();
+    return m_digest;
+}
+
+void KMD5::rawDigest( KMD5::Digest& bin )
+{
+    finalize();
+    memcpy( bin, m_digest, 16 );
+}
+
+
+QCString KMD5::hexDigest()
+{
+    QCString s(33);
+
+    finalize();
+    sprintf(s.data(), "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
+            m_digest[0], m_digest[1], m_digest[2], m_digest[3], m_digest[4], m_digest[5],
+            m_digest[6], m_digest[7], m_digest[8], m_digest[9], m_digest[10], m_digest[11],
+            m_digest[12], m_digest[13], m_digest[14], m_digest[15]);
+
+    return s;
+}
+
+void KMD5::hexDigest(QCString& s)
+{
+    finalize();
+    s.resize(33);
+    sprintf(s.data(), "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
+            m_digest[0], m_digest[1], m_digest[2], m_digest[3], m_digest[4], m_digest[5],
+            m_digest[6], m_digest[7], m_digest[8], m_digest[9], m_digest[10], m_digest[11],
+            m_digest[12], m_digest[13], m_digest[14], m_digest[15]);
+}
+
+QCString KMD5::base64Digest()
+{
+    QByteArray ba(16);
+
+    finalize();
+    memcpy(ba.data(), m_digest, 16);
+    return KCodecs::base64Encode(ba);
+}
+
+
+void KMD5::init()
+{
+    d = 0;
+    reset();
+}
+
+void KMD5::reset()
+{
+    m_finalized = false;
+
+    m_count[0] = 0;
+    m_count[1] = 0;
+
+    m_state[0] = 0x67452301;
+    m_state[1] = 0xefcdab89;
+    m_state[2] = 0x98badcfe;
+    m_state[3] = 0x10325476;
+
+    memset ( m_buffer, 0, sizeof(*m_buffer));
+    memset ( m_digest, 0, sizeof(*m_digest));
+}
+
+void KMD5::transform( const unsigned char block[64] )
+{
+
+    Q_UINT32 a = m_state[0], b = m_state[1], c = m_state[2], d = m_state[3], x[16];
+
+    decode (x, block, 64);
+
+
+    ((!m_finalized) ? (void)0 : qWarning("ASSERT: \"%s\" in %s (%d)","!m_finalized","/coolo/prod/kdelibs/kdecore/kmdcodec.cpp",958));
+
+
+    FF (a, b, c, d, x[ 0], 7, 0xd76aa478);
+    FF (d, a, b, c, x[ 1], 12, 0xe8c7b756);
+    FF (c, d, a, b, x[ 2], 17, 0x242070db);
+    FF (b, c, d, a, x[ 3], 22, 0xc1bdceee);
+    FF (a, b, c, d, x[ 4], 7, 0xf57c0faf);
+    FF (d, a, b, c, x[ 5], 12, 0x4787c62a);
+    FF (c, d, a, b, x[ 6], 17, 0xa8304613);
+    FF (b, c, d, a, x[ 7], 22, 0xfd469501);
+    FF (a, b, c, d, x[ 8], 7, 0x698098d8);
+    FF (d, a, b, c, x[ 9], 12, 0x8b44f7af);
+    FF (c, d, a, b, x[10], 17, 0xffff5bb1);
+    FF (b, c, d, a, x[11], 22, 0x895cd7be);
+    FF (a, b, c, d, x[12], 7, 0x6b901122);
+    FF (d, a, b, c, x[13], 12, 0xfd987193);
+    FF (c, d, a, b, x[14], 17, 0xa679438e);
+    FF (b, c, d, a, x[15], 22, 0x49b40821);
+
+
+    GG (a, b, c, d, x[ 1], 5, 0xf61e2562);
+    GG (d, a, b, c, x[ 6], 9, 0xc040b340);
+    GG (c, d, a, b, x[11], 14, 0x265e5a51);
+    GG (b, c, d, a, x[ 0], 20, 0xe9b6c7aa);
+    GG (a, b, c, d, x[ 5], 5, 0xd62f105d);
+    GG (d, a, b, c, x[10], 9, 0x2441453);
+    GG (c, d, a, b, x[15], 14, 0xd8a1e681);
+    GG (b, c, d, a, x[ 4], 20, 0xe7d3fbc8);
+    GG (a, b, c, d, x[ 9], 5, 0x21e1cde6);
+    GG (d, a, b, c, x[14], 9, 0xc33707d6);
+    GG (c, d, a, b, x[ 3], 14, 0xf4d50d87);
+    GG (b, c, d, a, x[ 8], 20, 0x455a14ed);
+    GG (a, b, c, d, x[13], 5, 0xa9e3e905);
+    GG (d, a, b, c, x[ 2], 9, 0xfcefa3f8);
+    GG (c, d, a, b, x[ 7], 14, 0x676f02d9);
+    GG (b, c, d, a, x[12], 20, 0x8d2a4c8a);
+
+
+    HH (a, b, c, d, x[ 5], 4, 0xfffa3942);
+    HH (d, a, b, c, x[ 8], 11, 0x8771f681);
+    HH (c, d, a, b, x[11], 16, 0x6d9d6122);
+    HH (b, c, d, a, x[14], 23, 0xfde5380c);
+    HH (a, b, c, d, x[ 1], 4, 0xa4beea44);
+    HH (d, a, b, c, x[ 4], 11, 0x4bdecfa9);
+    HH (c, d, a, b, x[ 7], 16, 0xf6bb4b60);
+    HH (b, c, d, a, x[10], 23, 0xbebfbc70);
+    HH (a, b, c, d, x[13], 4, 0x289b7ec6);
+    HH (d, a, b, c, x[ 0], 11, 0xeaa127fa);
+    HH (c, d, a, b, x[ 3], 16, 0xd4ef3085);
+    HH (b, c, d, a, x[ 6], 23, 0x4881d05);
+    HH (a, b, c, d, x[ 9], 4, 0xd9d4d039);
+    HH (d, a, b, c, x[12], 11, 0xe6db99e5);
+    HH (c, d, a, b, x[15], 16, 0x1fa27cf8);
+    HH (b, c, d, a, x[ 2], 23, 0xc4ac5665);
+
+
+    II (a, b, c, d, x[ 0], 6, 0xf4292244);
+    II (d, a, b, c, x[ 7], 10, 0x432aff97);
+    II (c, d, a, b, x[14], 15, 0xab9423a7);
+    II (b, c, d, a, x[ 5], 21, 0xfc93a039);
+    II (a, b, c, d, x[12], 6, 0x655b59c3);
+    II (d, a, b, c, x[ 3], 10, 0x8f0ccc92);
+    II (c, d, a, b, x[10], 15, 0xffeff47d);
+    II (b, c, d, a, x[ 1], 21, 0x85845dd1);
+    II (a, b, c, d, x[ 8], 6, 0x6fa87e4f);
+    II (d, a, b, c, x[15], 10, 0xfe2ce6e0);
+    II (c, d, a, b, x[ 6], 15, 0xa3014314);
+    II (b, c, d, a, x[13], 21, 0x4e0811a1);
+    II (a, b, c, d, x[ 4], 6, 0xf7537e82);
+    II (d, a, b, c, x[11], 10, 0xbd3af235);
+    II (c, d, a, b, x[ 2], 15, 0x2ad7d2bb);
+    II (b, c, d, a, x[ 9], 21, 0xeb86d391);
+
+    m_state[0] += a;
+    m_state[1] += b;
+    m_state[2] += c;
+    m_state[3] += d;
+
+    memset ( static_cast<void *>(x), 0, sizeof(x) );
+}
+
+inline Q_UINT32 KMD5::rotate_left (Q_UINT32 x, Q_UINT32 n)
+{
+    return (x << n) | (x >> (32-n)) ;
+}
+
+inline Q_UINT32 KMD5::F (Q_UINT32 x, Q_UINT32 y, Q_UINT32 z)
+{
+    return (x & y) | (~x & z);
+}
+
+inline Q_UINT32 KMD5::G (Q_UINT32 x, Q_UINT32 y, Q_UINT32 z)
+{
+    return (x & z) | (y & ~z);
+}
+
+inline Q_UINT32 KMD5::H (Q_UINT32 x, Q_UINT32 y, Q_UINT32 z)
+{
+    return x ^ y ^ z;
+}
+
+inline Q_UINT32 KMD5::I (Q_UINT32 x, Q_UINT32 y, Q_UINT32 z)
+{
+    return y ^ (x | ~z);
+}
+
+void KMD5::FF ( Q_UINT32& a, Q_UINT32 b, Q_UINT32 c, Q_UINT32 d,
+                       Q_UINT32 x, Q_UINT32 s, Q_UINT32 ac )
+{
+    a += F(b, c, d) + x + ac;
+    a = rotate_left (a, s) +b;
+}
+
+void KMD5::GG ( Q_UINT32& a, Q_UINT32 b, Q_UINT32 c, Q_UINT32 d,
+                 Q_UINT32 x, Q_UINT32 s, Q_UINT32 ac)
+{
+    a += G(b, c, d) + x + ac;
+    a = rotate_left (a, s) +b;
+}
+
+void KMD5::HH ( Q_UINT32& a, Q_UINT32 b, Q_UINT32 c, Q_UINT32 d,
+                 Q_UINT32 x, Q_UINT32 s, Q_UINT32 ac )
+{
+    a += H(b, c, d) + x + ac;
+    a = rotate_left (a, s) +b;
+}
+
+void KMD5::II ( Q_UINT32& a, Q_UINT32 b, Q_UINT32 c, Q_UINT32 d,
+                 Q_UINT32 x, Q_UINT32 s, Q_UINT32 ac )
+{
+    a += I(b, c, d) + x + ac;
+    a = rotate_left (a, s) +b;
+}
+
+
+void KMD5::encode ( unsigned char* output, Q_UINT32 *in, Q_UINT32 len )
+{
+
+    memcpy(output, in, len);
+}
+
+
+
+void KMD5::decode (Q_UINT32 *output, const unsigned char* in, Q_UINT32 len)
+{
+
+    memcpy(output, in, len);
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C"
+
+int mkstemps(char *, int);
+extern "C"
+
+unsigned long strlcat(char*, const char*, unsigned long);
+
+
+
+
+
+
+extern "C"
+
+unsigned long strlcpy(char*, const char*, unsigned long);
+
+
+
+
+enum SymbolKeys {
+      S_SOCKSinit = 0,
+      S_connect = 1,
+      S_read = 2,
+      S_write = 3,
+      S_recvfrom = 4,
+      S_sendto = 5,
+      S_recv = 6,
+      S_send = 7,
+      S_getsockname = 8,
+      S_getpeername = 9,
+      S_accept = 10,
+      S_select = 11,
+      S_listen = 12,
+      S_bind = 13
+     };
+
+
+extern "C" {
+
+static int (*F_SOCKSinit) (char *) = 0L;
+static int (*F_connect) (int, const struct sockaddr *, ksocklen_t) = 0L;
+static signed long int (*F_read) (int, void *, unsigned long int) = 0L;
+static signed long int (*F_write) (int, const void *, unsigned long int) = 0L;
+static int (*F_recvfrom) (int, void *, unsigned long int, int, struct sockaddr *,
+                                 ksocklen_t *) = 0L;
+static int (*F_sendto) (int, const void *, unsigned long int, int,
+                                 const struct sockaddr *, ksocklen_t) = 0L;
+static int (*F_recv) (int, void *, unsigned long int, int) = 0L;
+static int (*F_send) (int, const void *, unsigned long int, int) = 0L;
+static int (*F_getsockname) (int, struct sockaddr *, ksocklen_t *) = 0L;
+static int (*F_getpeername) (int, struct sockaddr *, ksocklen_t *) = 0L;
+static int (*F_accept) (int, struct sockaddr *, ksocklen_t *) = 0L;
+static int (*F_select) (int, fd_set *, fd_set *, fd_set *,
+                                                     struct timeval *) = 0L;
+static int (*F_listen) (int, int) = 0L;
+static int (*F_bind) (int, const struct sockaddr *, ksocklen_t) = 0L;
+}
+
+
+class KSocksTable {
+ public:
+   KSocksTable();
+
+
+   QMap<SymbolKeys,QString> symbols;
+
+   QString myname;
+   bool hasWorkingAsyncConnect;
+};
+
+
+KSocksTable::KSocksTable() : myname("Unknown"), hasWorkingAsyncConnect(true) {
+}
+class KNECSocksTable : public KSocksTable {
+  public:
+    KNECSocksTable();
+    virtual ~KNECSocksTable();
+};
+
+
+KNECSocksTable::KNECSocksTable() : KSocksTable() {
+  myname = i18n("NEC SOCKS client");
+  symbols.insert(S_SOCKSinit, "SOCKSinit");
+  symbols.insert(S_connect, "connect");
+  symbols.insert(S_read, "read");
+  symbols.insert(S_write, "write");
+  symbols.insert(S_recvfrom, "recvfrom");
+  symbols.insert(S_sendto, "sendto");
+  symbols.insert(S_recv, "recv");
+  symbols.insert(S_send, "send");
+  symbols.insert(S_getsockname, "getsockname");
+  symbols.insert(S_getpeername, "getpeername");
+  symbols.insert(S_accept, "accept");
+  symbols.insert(S_select, "select");
+  symbols.insert(S_listen, "listen");
+  symbols.insert(S_bind, "bind");
+}
+
+KNECSocksTable::~KNECSocksTable() {
+}
+class KDanteSocksTable : public KSocksTable {
+  public:
+    KDanteSocksTable();
+    virtual ~KDanteSocksTable();
+};
+
+KDanteSocksTable::KDanteSocksTable() : KSocksTable() {
+  hasWorkingAsyncConnect = false;
+  myname = i18n("Dante SOCKS client");
+  symbols.insert(S_SOCKSinit, "SOCKSinit");
+  symbols.insert(S_connect, "Rconnect");
+  symbols.insert(S_read, "Rread");
+  symbols.insert(S_write, "Rwrite");
+  symbols.insert(S_recvfrom, "Rrecvfrom");
+  symbols.insert(S_sendto, "Rsendto");
+  symbols.insert(S_recv, "Rrecv");
+  symbols.insert(S_send, "Rsend");
+  symbols.insert(S_getsockname, "Rgetsockname");
+  symbols.insert(S_getpeername, "Rgetpeername");
+  symbols.insert(S_accept, "Raccept");
+  symbols.insert(S_select, "Rselect");
+  symbols.insert(S_listen, "Rlisten");
+  symbols.insert(S_bind, "Rbind");
+}
+
+
+KDanteSocksTable::~KDanteSocksTable() {
+}
+KSocks *KSocks::_me = 0;
+bool KSocks::_disabled = false;
+
+void KSocks::disable()
+{
+   if (!_me)
+      _disabled = true;
+}
+
+KSocks *KSocks::self() {
+
+  if (!_me) {
+     if (KApplication::kApplication()) {
+        KConfigGroup cfg(KApplication::kApplication()->config(), "Socks");
+        _me = new KSocks(&cfg);
+     } else {
+        _disabled = true;
+        _me = new KSocks(0);
+     }
+  }
+  return _me;
+}
+
+void KSocks::setConfig(KConfigBase *config)
+{
+
+
+  if (_me && _disabled) {
+     delete _me;
+     _me = 0;
+     _disabled = false;
+  }
+  if (!_me)
+    _me = new KSocks(config);
+}
+
+bool KSocks::activated() { return (_me != 0L); }
+
+
+KSocks::KSocks(KConfigBase *config) : _socksLib(0L), _st(0L) {
+   _hasSocks = false;
+   _useSocks = false;
+
+   if (!config)
+      return;
+
+   if (!(config->readBoolEntry("SOCKS_enable", false))) {
+      _disabled = true;
+   }
+
+   if (_disabled)
+      return;
+
+   _libPaths << ""
+             << "/usr/lib/"
+             << "/usr/local/lib/"
+             << "/usr/local/socks5/lib/"
+             << "/opt/socks5/lib/";
+   _libNames << "libsocks.so"
+             << "libsocks5.so"
+             << "libsocks5_sh.so";
+
+
+   QStringList newlibs = config->readListEntry("SOCKS_lib_path");
+
+   for (QStringList::Iterator it = newlibs.begin();
+                              it != newlibs.end();
+                              ++it) {
+      QString thisone = *it;
+      if (thisone[thisone.length()-1] != '/') thisone += "/";
+      _libPaths << thisone;
+      kdDebug(171) << "KSocks added a new library path: " << thisone << endl;
+   }
+
+
+   KLibLoader *ll = KLibLoader::self();
+
+
+   int _meth = config->readNumEntry("SOCKS_method", 1);
+
+
+
+
+
+   if (_meth == 4) {
+      _socksLib = ll->library(config->readPathEntry("SOCKS_lib").latin1());
+      if (_socksLib && _socksLib->symbol("Rconnect")) {
+         _st = new KDanteSocksTable;
+         _useSocks = true;
+         _hasSocks = true;
+      } else if (_socksLib && _socksLib->symbol("connect")) {
+         _st = new KNECSocksTable;
+         _useSocks = true;
+         _hasSocks = true;
+      } else if (_socksLib) {
+         _socksLib->unload();
+         _socksLib = 0L;
+      }
+   } else
+   for (QStringList::Iterator pit = _libPaths.begin();
+                              !_hasSocks && pit != _libPaths.end();
+                              ++pit)
+   for (QStringList::Iterator it = _libNames.begin();
+                              it != _libNames.end();
+                              ++it) {
+      _socksLib = ll->library((*pit + *it).latin1());
+      if (_socksLib) {
+         if ((_meth == 1 || _meth == 2) &&
+             _socksLib->symbol("S5LogShowThreadIDS") != 0L) {
+            kdDebug(171) << "Found NEC SOCKS" << endl;
+            _st = new KNECSocksTable;
+            _useSocks = true;
+            _hasSocks = true;
+            break;
+         } else if ((_meth == 1 || _meth == 3) &&
+                    _socksLib->symbol("sockaddr2ruleaddress") != 0L) {
+            kdDebug(171) << "Found Dante SOCKS" << endl;
+            _st = new KDanteSocksTable;
+            _useSocks = true;
+            _hasSocks = true;
+            break;
+         } else {
+           _socksLib->unload();
+           _socksLib = 0L;
+         }
+      }
+   }
+
+
+   if (_st) {
+      for (QMap<SymbolKeys,QString>::Iterator it = _st->symbols.begin();
+                                              it != _st->symbols.end();
+                                              ++it) {
+         switch(it.key()) {
+         case S_SOCKSinit:
+           F_SOCKSinit = (int (*)(char *))
+                         _socksLib->symbol(it.data().latin1());
+          break;
+         case S_connect:
+           F_connect = (int (*)(int, const struct sockaddr *, ksocklen_t))
+                       _socksLib->symbol(it.data().latin1());
+          break;
+         case S_read:
+           F_read = (signed long int (*)(int, void *, unsigned long int))
+                    _socksLib->symbol(it.data().latin1());
+          break;
+         case S_write:
+           F_write = (signed long int (*)(int, const void *, unsigned long int))
+                     _socksLib->symbol(it.data().latin1());
+          break;
+         case S_recvfrom:
+           F_recvfrom = (int (*)(int, void *, unsigned long int, int,
+                                 struct sockaddr *, ksocklen_t *))
+                        _socksLib->symbol(it.data().latin1());
+          break;
+         case S_sendto:
+           F_sendto = (int (*)(int, const void *, unsigned long int, int,
+                               const struct sockaddr *, ksocklen_t))
+                      _socksLib->symbol(it.data().latin1());
+          break;
+         case S_recv:
+           F_recv = (int (*)(int, void *, unsigned long int, int))
+                    _socksLib->symbol(it.data().latin1());
+          break;
+         case S_send:
+           F_send = (int (*)(int, const void *, unsigned long int, int))
+                    _socksLib->symbol(it.data().latin1());
+          break;
+         case S_getsockname:
+           F_getsockname = (int (*)(int, struct sockaddr *, ksocklen_t *))
+                           _socksLib->symbol(it.data().latin1());
+          break;
+         case S_getpeername:
+           F_getpeername = (int (*)(int, struct sockaddr *, ksocklen_t *))
+                           _socksLib->symbol(it.data().latin1());
+          break;
+         case S_accept:
+           F_accept = (int (*)(int, struct sockaddr *, ksocklen_t *))
+                      _socksLib->symbol(it.data().latin1());
+          break;
+         case S_select:
+           F_select = (int (*)(int, fd_set *, fd_set *, fd_set *, struct timeval *))
+                      _socksLib->symbol(it.data().latin1());
+          break;
+         case S_listen:
+           F_listen = (int (*)(int, int))
+                      _socksLib->symbol(it.data().latin1());
+          break;
+         case S_bind:
+           F_bind = (int (*)(int, const struct sockaddr *, ksocklen_t))
+                    _socksLib->symbol(it.data().latin1());
+          break;
+         default:
+          kdDebug(171) << "KSocks got a symbol it doesn't know about!" << endl;
+          break;
+         }
+      }
+
+
+      if (F_SOCKSinit) {
+         int rc = (*F_SOCKSinit)((char *)"KDE");
+         if (rc != 0)
+            stopSocks();
+         else kdDebug(171) << "SOCKS has been activated!" << endl;
+      } else {
+         stopSocks();
+      }
+   }
+}
+
+
+KSocks::~KSocks() {
+   stopSocks();
+   _me = 0;
+}
+
+void KSocks::die() {
+   if (_me == this) {
+      _me = 0;
+      delete this;
+   }
+}
+
+void KSocks::stopSocks() {
+   if (_hasSocks) {
+
+
+      _useSocks = false;
+      _hasSocks = false;
+      if (_socksLib) {
+         _socksLib->unload();
+         _socksLib = 0L;
+      }
+      delete _st;
+      _st = 0L;
+   }
+}
+
+
+bool KSocks::usingSocks() {
+   return _useSocks;
+}
+
+
+bool KSocks::hasSocks() {
+   return _hasSocks;
+}
+
+
+void KSocks::disableSocks() {
+   _useSocks = false;
+}
+
+
+void KSocks::enableSocks() {
+   if (_hasSocks)
+      _useSocks = true;
+}
+
+bool KSocks::hasWorkingAsyncConnect()
+{
+   return (_useSocks && _st) ? _st->hasWorkingAsyncConnect : true;
+}
+
+
+
+
+
+
+
+int KSocks::connect (int sockfd, const sockaddr *serv_addr,
+                                                   ksocklen_t addrlen) {
+   if (_useSocks && F_connect)
+      return (*F_connect)(sockfd, serv_addr, addrlen);
+   else return ::connect(sockfd, (sockaddr*) serv_addr, (socklen_t)addrlen);
+}
+
+
+signed long int KSocks::read (int fd, void *buf, unsigned long int count) {
+   if (_useSocks && F_read)
+      return (*F_read)(fd, buf, count);
+   else return ::read(fd, buf, count);
+}
+
+
+signed long int KSocks::write (int fd, const void *buf, unsigned long int count) {
+   if (_useSocks && F_write)
+      return (*F_write)(fd, buf, count);
+   else return ::write(fd, buf, count);
+}
+
+
+int KSocks::recvfrom (int s, void *buf, unsigned long int len, int flags,
+                                sockaddr *from, ksocklen_t *fromlen) {
+   if (_useSocks && F_recvfrom) {
+      return (*F_recvfrom)(s, buf, len, flags, from, fromlen);
+   } else {
+      socklen_t casted_len = (socklen_t) *fromlen;
+      int rc = ::recvfrom(s, (char*) buf, len, flags, from, &casted_len);
+      *fromlen = casted_len;
+      return rc;
+   }
+}
+
+
+int KSocks::sendto (int s, const void *msg, unsigned long int len, int flags,
+                             const sockaddr *to, ksocklen_t tolen) {
+   if (_useSocks && F_sendto)
+      return (*F_sendto)(s, msg, len, flags, to, tolen);
+   else return ::sendto(s, (char*) msg, len, flags, to, (socklen_t)tolen);
+}
+
+
+int KSocks::recv (int s, void *buf, unsigned long int len, int flags) {
+   if (_useSocks && F_recv)
+      return (*F_recv)(s, buf, len, flags);
+   else return ::recv(s, (char*) buf, len, flags);
+}
+
+
+int KSocks::send (int s, const void *msg, unsigned long int len, int flags) {
+   if (_useSocks && F_send)
+      return (*F_send)(s, msg, len, flags);
+   else return ::send(s, (char*) msg, len, flags);
+}
+
+
+int KSocks::getsockname (int s, sockaddr *name, ksocklen_t *namelen) {
+   if (_useSocks && F_getsockname) {
+      return (*F_getsockname)(s, name, namelen);
+   } else {
+     socklen_t casted_len = *namelen;
+     int rc = ::getsockname(s, name, &casted_len);
+     *namelen = casted_len;
+     return rc;
+   }
+}
+
+
+int KSocks::getpeername (int s, sockaddr *name, ksocklen_t *namelen) {
+   if (_useSocks && F_getpeername) {
+      return (*F_getpeername)(s, name, namelen);
+   } else {
+      socklen_t casted_len = *namelen;
+      int rc = ::getpeername(s, name, &casted_len);
+      *namelen = casted_len;
+      return rc;
+   }
+}
+
+
+int KSocks::accept (int s, sockaddr *addr, ksocklen_t *addrlen) {
+   if (_useSocks && F_accept) {
+     return (*F_accept)(s, addr, addrlen);
+   } else {
+      socklen_t casted_len = *addrlen;
+      int rc = ::accept(s, addr, &casted_len);
+      *addrlen = casted_len;
+      return rc;
+   }
+}
+
+
+int KSocks::select (int n, fd_set *readfds, fd_set *writefds,
+                                fd_set *exceptfds, struct timeval *timeout) {
+   if (_useSocks && F_select)
+      return (*F_select)(n, readfds, writefds, exceptfds, timeout);
+   else return ::select(n, readfds, writefds, exceptfds, timeout);
+}
+
+
+int KSocks::listen (int s, int backlog) {
+   if (_useSocks && F_listen)
+      return (*F_listen)(s, backlog);
+   else return ::listen(s, backlog);
+}
+
+
+int KSocks::bind (int sockfd, const sockaddr *my_addr, ksocklen_t addrlen) {
+   if (_useSocks && F_bind)
+      return (*F_bind)(sockfd, my_addr, addrlen);
+   else return ::bind(sockfd, my_addr, (socklen_t)addrlen);
+}
+
+int KSocks::bind (int sockfd, sockaddr *my_addr, ksocklen_t addrlen) {
+   if (_useSocks && F_bind)
+      return (*F_bind)(sockfd, my_addr, addrlen);
+   else return ::bind(sockfd, my_addr, (socklen_t)addrlen);
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C"
+
+int mkstemps(char *, int);
+extern "C"
+
+unsigned long strlcat(char*, const char*, unsigned long);
+
+
+
+
+
+
+extern "C"
+
+unsigned long strlcpy(char*, const char*, unsigned long);
+
+
+
+
+
+
+
+
+
+
+
+class QDataStream;
+class KSycocaPrivate;
+class KSycocaFactory;
+class KSycocaFactoryList;
+
+
+
+
+
+
+
+
+
+
+
+class KSycoca : public QObject, public DCOPObject
+{
+  public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+  public: virtual bool process(const QCString &fun, const QByteArray &data, QCString& replyType, QByteArray &replyData); QCStringList functions(); QCStringList interfaces(); private:
+
+protected:
+
+
+
+
+   KSycoca( bool );
+
+public:
+
+
+
+
+   KSycoca();
+
+
+
+
+   static KSycoca *self();
+
+   virtual ~KSycoca();
+
+   static int version();
+
+
+
+
+
+   QDataStream *findEntry(int offset, KSycocaType &type);
+
+
+
+   QDataStream *findFactory( KSycocaFactoryId id);
+
+
+
+   QString kfsstnd_prefixes();
+
+
+
+   QString language();
+
+
+
+
+
+
+
+   Q_UINT32 timeStamp();
+   Q_UINT32 updateSignature();
+
+
+
+
+
+   QStringList allResourceDirs();
+
+
+
+
+   void addFactory( KSycocaFactory * );
+
+
+
+
+
+   virtual bool isBuilding() { return false; }
+
+
+
+
+   void disableAutoRebuild();
+
+
+
+
+   static QString determineRelativePath( const QString & _fullpath, const char *_resource );
+
+
+
+
+
+
+   static bool isChanged(const char *type);
+
+
+
+
+   static void flagError();
+
+
+
+
+   static bool readError();
+
+public:
+
+
+
+   void notifyDatabaseChanged(const QStringList &);
+
+protected:
+
+
+
+
+   void databaseChanged();
+
+protected:
+   bool checkVersion(bool abortOnError=true);
+   bool openDatabase(bool openDummyIfNotFound=true);
+   void closeDatabase();
+   KSycocaFactoryList *m_lstFactories;
+   QDataStream *m_str;
+   bool bNoDatabase;
+   size_t m_sycoca_size;
+   const char *m_sycoca_mmap;
+   Q_UINT32 m_timeStamp;
+
+public:
+   static KSycoca *_self;
+
+protected:
+  virtual void virtual_hook( int id, void* data );
+private:
+   KSycocaPrivate *d;
+};
+
+
+
+
+
+
+
+class KSycoca;
+class QStringList;
+class QString;
+class KSycocaDict;
+class KSycocaResourceList;
+
+typedef QDict<KSycocaEntry::Ptr> KSycocaEntryDict;
+
+
+
+
+
+class KSycocaFactory
+{
+public:
+   virtual KSycocaFactoryId factoryId() const = 0;
+
+protected:
+
+
+
+
+   KSycocaFactory( KSycocaFactoryId factory_id );
+
+public:
+   virtual ~KSycocaFactory();
+
+
+
+
+   int offset() { return mOffset; }
+
+
+
+
+   KSycocaEntryDict * entryDict() { return m_entryDict; }
+
+
+
+
+
+   virtual KSycocaEntry *createEntry(const QString &file, const char *resource) = 0;
+
+
+
+
+   virtual void addEntry(KSycocaEntry *newEntry, const char *resource);
+
+
+
+
+   virtual KSycocaEntry *createEntry(int offset)=0;
+
+
+
+
+   KSycocaEntry::List allEntries();
+   virtual void save(QDataStream &str);
+   virtual void saveHeader(QDataStream &str);
+
+
+
+
+   virtual const KSycocaResourceList * resourceList() const { return m_resourceList; }
+
+private:
+   int mOffset;
+
+protected:
+   int m_sycocaDictOffset;
+   int m_beginEntryOffset;
+   int m_endEntryOffset;
+   QDataStream *m_str;
+
+   KSycocaResourceList *m_resourceList;
+   KSycocaEntryDict *m_entryDict;
+   KSycocaDict *m_sycocaDict;
+protected:
+   virtual void virtual_hook( int id, void* data );
+};
+
+
+
+
+class KSycocaFactoryList : public QPtrList<KSycocaFactory>
+{
+public:
+   KSycocaFactoryList() { }
+};
+
+
+
+
+
+
+
+
+
+
+class QBuffer : public QIODevice
+{
+public:
+    QBuffer();
+    QBuffer( QByteArray );
+   ~QBuffer();
+
+    QByteArray buffer() const;
+    bool setBuffer( QByteArray );
+
+    bool open( int );
+    void close();
+    void flush();
+
+    Offset size() const;
+    Offset at() const;
+    bool at( Offset );
+
+    Q_LONG readBlock( char *p, Q_ULONG );
+    Q_LONG writeBlock( const char *p, Q_ULONG );
+    Q_LONG writeBlock( const QByteArray& data )
+              { return QIODevice::writeBlock(data); }
+    Q_LONG readLine( char *p, Q_ULONG );
+
+    int getch();
+    int putch( int );
+    int ungetch( int );
+
+protected:
+    QByteArray a;
+
+private:
+    uint a_len;
+    uint a_inc;
+
+private:
+
+    QBuffer( const QBuffer & );
+    QBuffer &operator=( const QBuffer & );
+
+};
+
+
+inline QByteArray QBuffer::buffer() const
+{ return a; }
+
+inline QIODevice::Offset QBuffer::size() const
+{ return (Offset)a.size(); }
+
+inline QIODevice::Offset QBuffer::at() const
+{ return ioIndex; }
+
+
+
+
+
+
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (__const char *__assertion, __const char *__file,
+                           unsigned int __line, __const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, __const char *__file,
+                                  unsigned int __line,
+                                  __const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+
+
+template class QPtrList<KSycocaFactory>;
+struct KSycocaPrivate {
+    KSycocaPrivate() {
+        database = 0;
+        readError = false;
+        updateSig = 0;
+        autoRebuild = true;
+    }
+    QFile *database;
+    QStringList changeList;
+    QString language;
+    bool readError;
+    bool autoRebuild;
+    Q_UINT32 updateSig;
+    QStringList allResourceDirs;
+};
+
+int KSycoca::version()
+{
+   return 68;
+}
+
+
+KSycoca::KSycoca()
+  : DCOPObject("ksycoca"), m_lstFactories(0), m_str(0), bNoDatabase(false),
+    m_sycoca_size(0), m_sycoca_mmap(0), m_timeStamp(0)
+{
+   d = new KSycocaPrivate;
+
+   if (KApplication::kApplication() && !KApplication::kApplication()->dcopClient()->isAttached())
+   {
+      KApplication::kApplication()->dcopClient()->attach();
+   }
+
+
+
+
+   openDatabase();
+   _self = this;
+}
+
+bool KSycoca::openDatabase( bool openDummyIfNotFound )
+{
+   bool result = true;
+
+   m_sycoca_mmap = 0;
+   m_str = 0;
+   QString path;
+   QCString ksycoca_env = getenv("KDESYCOCA");
+   if (ksycoca_env.isEmpty())
+      path = KGlobal::dirs()->saveLocation("cache") + "ksycoca";
+   else
+      path = QFile::decodeName(ksycoca_env);
+
+   kdDebug(7011) << "Trying to open ksycoca from " << path << endl;
+   QFile *database = new QFile(path);
+   bool bOpen = database->open( 0x0001 );
+   if (!bOpen)
+   {
+     path = locate("services", "ksycoca");
+     if (!path.isEmpty())
+     {
+       kdDebug(7011) << "Trying to open global ksycoca from " << path << endl;
+       delete database;
+       database = new QFile(path);
+       bOpen = database->open( 0x0001 );
+     }
+   }
+
+   if (bOpen)
+   {
+     fcntl(database->handle(), 2, 1);
+     m_sycoca_size = database->size();
+
+     m_sycoca_mmap = (const char *) mmap(0, m_sycoca_size,
+                                0x1, 0x01,
+                                database->handle(), 0);
+
+
+     if (m_sycoca_mmap == (const char*) ((void *) -1) || m_sycoca_mmap == 0)
+     {
+        kdDebug(7011) << "mmap failed. (length = " << m_sycoca_size << ")" << endl;
+
+        m_str = new QDataStream(database);
+
+     }
+     else
+     {
+        QByteArray b_array;
+        b_array.setRawData(m_sycoca_mmap, m_sycoca_size);
+        QBuffer *buffer = new QBuffer( b_array );
+        buffer->open(0x0003);
+        m_str = new QDataStream( buffer);
+     }
+
+     bNoDatabase = false;
+   }
+   else
+   {
+     kdDebug(7011) << "Could not open ksycoca" << endl;
+
+
+     delete database;
+     database = 0;
+
+     bNoDatabase = true;
+     if (openDummyIfNotFound)
+     {
+
+
+        QBuffer *buffer = new QBuffer( QByteArray() );
+        buffer->open(0x0003);
+        m_str = new QDataStream( buffer);
+        (*m_str) << (Q_INT32) 68;
+        (*m_str) << (Q_INT32) 0;
+     }
+     else
+     {
+        result = false;
+     }
+   }
+   m_lstFactories = new KSycocaFactoryList();
+   m_lstFactories->setAutoDelete( true );
+   d->database = database;
+   return result;
+}
+
+
+KSycoca::KSycoca( bool )
+  : DCOPObject("ksycoca_building"), m_lstFactories(0), m_str(0), bNoDatabase(false),
+    m_sycoca_size(0), m_sycoca_mmap(0)
+{
+   d = new KSycocaPrivate;
+   m_lstFactories = new KSycocaFactoryList();
+   m_lstFactories->setAutoDelete( true );
+   _self = this;
+}
+
+static void delete_ksycoca_self() {
+  delete KSycoca::_self;
+}
+
+KSycoca * KSycoca::self()
+{
+    if (!_self) {
+        qAddPostRoutine(delete_ksycoca_self);
+        _self = new KSycoca();
+    }
+  return _self;
+}
+
+KSycoca::~KSycoca()
+{
+   closeDatabase();
+   delete d;
+   _self = 0L;
+}
+
+void KSycoca::closeDatabase()
+{
+   QIODevice *device = 0;
+   if (m_str)
+      device = m_str->device();
+
+   if (device && m_sycoca_mmap)
+   {
+      QBuffer *buf = (QBuffer *) device;
+      buf->buffer().resetRawData(m_sycoca_mmap, m_sycoca_size);
+
+
+      munmap((char*) m_sycoca_mmap, m_sycoca_size);
+      m_sycoca_mmap = 0;
+   }
+
+
+   delete m_str;
+   m_str = 0;
+   delete device;
+   if (d->database != device)
+      delete d->database;
+   device = 0;
+   d->database = 0;
+
+
+   delete m_lstFactories;
+   m_lstFactories = 0L;
+}
+
+void KSycoca::addFactory( KSycocaFactory *factory )
+{
+   (static_cast<void> ((m_lstFactories) ? 0 : (__assert_fail ("m_lstFactories", "/coolo/prod/kdelibs/kdecore/ksycoca.cpp", 248, __PRETTY_FUNCTION__), 0)));
+   m_lstFactories->append(factory);
+}
+
+bool KSycoca::isChanged(const char *type)
+{
+    return self()->d->changeList.contains(type);
+}
+
+void KSycoca::notifyDatabaseChanged(const QStringList &changeList)
+{
+    d->changeList = changeList;
+
+
+
+
+
+    closeDatabase();
+
+
+    databaseChanged();
+}
+
+QDataStream * KSycoca::findEntry(int offset, KSycocaType &type)
+{
+   if ( !m_str )
+      openDatabase();
+
+   m_str->device()->at(offset);
+   Q_INT32 aType;
+   (*m_str) >> aType;
+   type = (KSycocaType) aType;
+
+   return m_str;
+}
+
+bool KSycoca::checkVersion(bool abortOnError)
+{
+   if ( !m_str )
+   {
+      if( !openDatabase(false ) )
+        return false;
+
+
+      (static_cast<void> ((m_str) ? 0 : (__assert_fail ("m_str", "/coolo/prod/kdelibs/kdecore/ksycoca.cpp", 292, __PRETTY_FUNCTION__), 0)));
+   }
+   m_str->device()->at(0);
+   Q_INT32 aVersion;
+   (*m_str) >> aVersion;
+   if ( aVersion < 68 )
+   {
+      kdWarning(7011) << "Found version " << aVersion << ", expecting version " << 68 << " or higher." << endl;
+      if (!abortOnError) return false;
+      kdError(7011) << "Outdated database ! Stop kded and restart it !" << endl;
+      abort();
+   }
+   return true;
+}
+
+QDataStream * KSycoca::findFactory(KSycocaFactoryId id)
+{
+
+   if (bNoDatabase)
+   {
+      closeDatabase();
+
+      if ( !openDatabase(false ) )
+      {
+         static bool triedLaunchingKdeinit = false;
+         if (!triedLaunchingKdeinit)
+         {
+           triedLaunchingKdeinit = true;
+           kdDebug(7011) << "findFactory: we have no database.... launching kdeinit" << endl;
+           KApplication::startKdeinit();
+
+         }
+         if (!openDatabase(false))
+            return 0L;
+      }
+   }
+
+   if (!checkVersion(false))
+   {
+     kdWarning(7011) << "Outdated database found" << endl;
+     return 0L;
+   }
+   Q_INT32 aId;
+   Q_INT32 aOffset;
+   while(true)
+   {
+      (*m_str) >> aId;
+
+      if (aId == 0)
+      {
+         kdError(7011) << "Error, KSycocaFactory (id = " << int(id) << ") not found!" << endl;
+         break;
+      }
+      (*m_str) >> aOffset;
+      if (aId == id)
+      {
+
+         m_str->device()->at(aOffset);
+         return m_str;
+      }
+   }
+   return 0;
+}
+
+QString KSycoca::kfsstnd_prefixes()
+{
+   if (bNoDatabase) return "";
+   if (!checkVersion(false)) return "";
+   Q_INT32 aId;
+   Q_INT32 aOffset;
+
+   while(true)
+   {
+      (*m_str) >> aId;
+      if ( aId )
+        (*m_str) >> aOffset;
+      else
+        break;
+   }
+
+   QString prefixes;
+   KSycocaEntry::read(*m_str, prefixes);
+   (*m_str) >> m_timeStamp;
+   KSycocaEntry::read(*m_str, d->language);
+   (*m_str) >> d->updateSig;
+   KSycocaEntry::read(*m_str, d->allResourceDirs);
+   return prefixes;
+}
+
+Q_UINT32 KSycoca::timeStamp()
+{
+   if (!m_timeStamp)
+      (void) kfsstnd_prefixes();
+   return m_timeStamp;
+}
+
+Q_UINT32 KSycoca::updateSignature()
+{
+   if (!m_timeStamp)
+      (void) kfsstnd_prefixes();
+   return d->updateSig;
+}
+
+QString KSycoca::language()
+{
+   if (d->language.isEmpty())
+      (void) kfsstnd_prefixes();
+   return d->language;
+}
+
+QStringList KSycoca::allResourceDirs()
+{
+   if (!m_timeStamp)
+      (void) kfsstnd_prefixes();
+   return d->allResourceDirs;
+}
+
+QString KSycoca::determineRelativePath( const QString & _fullpath, const char *_resource )
+{
+  QString sRelativeFilePath;
+  QStringList dirs = KGlobal::dirs()->resourceDirs( _resource );
+  QStringList::ConstIterator dirsit = dirs.begin();
+  for ( ; dirsit != dirs.end() && sRelativeFilePath.isEmpty(); ++dirsit ) {
+
+    if ( _fullpath.find( *dirsit ) == 0 )
+      sRelativeFilePath = _fullpath.mid( (*dirsit).length() );
+  }
+  if ( sRelativeFilePath.isEmpty() )
+    kdFatal(7011) << QString("Couldn't find %1 in any %2 dir !!!").arg( _fullpath ).arg( _resource) << endl;
+
+
+
+  return sRelativeFilePath;
+}
+
+KSycoca * KSycoca::_self = 0L;
+
+void KSycoca::flagError()
+{
+   qWarning("ERROR: KSycoca database corruption!");
+   if (_self)
+   {
+      if (_self->d->readError)
+         return;
+      _self->d->readError = true;
+      if (_self->d->autoRebuild)
+         system("kbuildsycoca");
+   }
+}
+
+void KSycoca::disableAutoRebuild()
+{
+   d->autoRebuild = false;
+}
+
+bool KSycoca::readError()
+{
+   bool b = false;
+   if (_self)
+   {
+      b = _self->d->readError;
+      _self->d->readError = false;
+   }
+   return b;
+}
+
+void KSycocaEntry::read( QDataStream &s, QString &str )
+{
+  Q_UINT32 bytes;
+  s >> bytes;
+  if ( bytes > 8192 ) {
+      if (bytes != 0xffffffff)
+         KSycoca::flagError();
+      str = QString::null;
+  }
+  else if ( bytes > 0 ) {
+      int bt = bytes/2;
+      str.setLength( bt );
+      QChar* ch = (QChar *) str.unicode();
+      char t[8192];
+      char *b = t;
+      s.readRawBytes( b, bytes );
+      while ( bt-- ) {
+          *ch++ = (ushort) (((ushort)b[0])<<8) | (uchar)b[1];
+          b += 2;
+      }
+  } else {
+      str = "";
+  }
+}
+
+void KSycocaEntry::read( QDataStream &s, QStringList &list )
+{
+  list.clear();
+  Q_UINT32 count;
+  s >> count;
+  if (count >= 1024)
+  {
+     KSycoca::flagError();
+     return;
+  }
+  for(Q_UINT32 i = 0; i < count; i++)
+  {
+     QString str;
+     read(s, str);
+     list.append( str );
+     if (s.atEnd())
+     {
+        KSycoca::flagError();
+        return;
+     }
+  }
+}
+
+void KSycoca::virtual_hook( int id, void* data )
+{ DCOPObject::virtual_hook( id, data ); }
+
+void KSycocaEntry::virtual_hook( int, void* )
+{ }
+
+const char *KSycoca::className() const
+{
+    return "KSycoca";
+}
+
+QMetaObject *KSycoca::metaObj = 0;
+static QMetaObjectCleanUp cleanUp_KSycoca( "KSycoca", &KSycoca::staticMetaObject );
+QMetaObject* KSycoca::staticMetaObject()
+{
+    if ( metaObj )
+        return metaObj;
+    QMetaObject* parentObject = QObject::staticMetaObject();
+    static const QUMethod signal_0 = {"databaseChanged", 0, 0 };
+    static const QMetaData signal_tbl[] = {
+        { "databaseChanged()", &signal_0, QMetaData::Public }
+    };
+    metaObj = QMetaObject::new_metaobject(
+        "KSycoca", parentObject,
+        0, 0,
+        signal_tbl, 1,
+
+        0, 0,
+        0, 0,
+
+        0, 0 );
+    cleanUp_KSycoca.setMetaObject( metaObj );
+    return metaObj;
+}
+
+void* KSycoca::qt_cast( const char* clname )
+{
+    if ( !qstrcmp( clname, "KSycoca" ) )
+        return this;
+    if ( !qstrcmp( clname, "DCOPObject" ) )
+        return (DCOPObject*)this;
+    return QObject::qt_cast( clname );
+}
+
+
+void KSycoca::databaseChanged()
+{
+    activate_signal( staticMetaObject()->signalOffset() + 0 );
+}
+
+bool KSycoca::qt_invoke( int _id, QUObject* _o )
+{
+    return QObject::qt_invoke(_id,_o);
+}
+
+bool KSycoca::qt_emit( int _id, QUObject* _o )
+{
+    switch ( _id - staticMetaObject()->signalOffset() ) {
+    case 0: databaseChanged(); break;
+    default:
+        return QObject::qt_emit(_id,_o);
+    }
+    return TRUE;
+}
+
+
+bool KSycoca::qt_property( int id, int f, QVariant* v)
+{
+    return QObject::qt_property( id, f, v);
+}
+
+bool KSycoca::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; }
+
+
+
+
+
+class KSycocaEntry;
+class KSycocaDictStringList;
+
+
+
+
+
+class KSycocaDict
+{
+public:
+
+
+
+   KSycocaDict();
+
+
+
+   KSycocaDict(QDataStream *str, int offset);
+
+   ~KSycocaDict();
+
+
+
+
+
+
+
+   void add(const QString &key, KSycocaEntry *payload);
+   int find_string(const QString &key );
+
+
+
+
+
+
+   uint count();
+
+
+
+
+
+
+   void clear();
+   void save(QDataStream &str);
+
+protected:
+   Q_UINT32 hashKey( const QString &);
+private:
+   KSycocaDictStringList *d;
+   QDataStream *mStr;
+   Q_INT32 mOffset;
+   Q_UINT32 mHashTableSize;
+   QValueList<Q_INT32> mHashList;
+};
+struct string_entry {
+  string_entry(QString _key, KSycocaEntry *_payload)
+  { keyStr = _key; key = keyStr.unicode(); length = keyStr.length(); payload = _payload; hash = 0; }
+  uint hash;
+  int length;
+  const QChar *key;
+  QString keyStr;
+  KSycocaEntry *payload;
+};
+
+template class QPtrList<string_entry>;
+
+class KSycocaDictStringList : public QPtrList<string_entry>
+{
+public:
+   KSycocaDictStringList();
+};
+
+KSycocaDictStringList::KSycocaDictStringList()
+{
+   setAutoDelete(true);
+}
+
+KSycocaDict::KSycocaDict()
+  : d(0), mStr(0), mOffset(0)
+{
+}
+
+KSycocaDict::KSycocaDict(QDataStream *str, int offset)
+  : d(0), mStr(str), mOffset(offset)
+{
+   Q_UINT32 test1, test2;
+   str->device()->at(offset);
+   (*str) >> test1 >> test2;
+   if ((test1 > 0x000fffff) || (test2 > 1024))
+   {
+       KSycoca::flagError();
+       mHashTableSize = 0;
+       mOffset = 0;
+       return;
+   }
+
+   str->device()->at(offset);
+   (*str) >> mHashTableSize;
+   (*str) >> mHashList;
+   mOffset = str->device()->at();
+}
+
+KSycocaDict::~KSycocaDict()
+{
+   delete d;
+}
+
+void
+KSycocaDict::add(const QString &key, KSycocaEntry *payload)
+{
+   if (key.isEmpty()) return;
+   if (!payload) return;
+   if (!d)
+   {
+       d = new KSycocaDictStringList();
+   }
+
+   string_entry *entry= new string_entry(key, payload);
+   d->append(entry);
+}
+
+int
+KSycocaDict::find_string(const QString &key )
+{
+
+
+   if (!mStr || !mOffset)
+   {
+      kdError(7011) << "No database available!" << endl;
+      return 0;
+   }
+
+   if (mHashTableSize == 0)
+      return 0;
+
+
+   uint hash = hashKey(key) % mHashTableSize;
+
+
+   uint off = mOffset+sizeof(Q_INT32)*hash;
+
+   mStr->device()->at( off );
+
+   Q_INT32 offset;
+   (*mStr) >> offset;
+
+
+   if (offset == 0)
+      return 0;
+
+   if (offset > 0)
+      return offset;
+
+
+   offset = -offset;
+
+   mStr->device()->at(offset);
+
+
+   while(true)
+   {
+       (*mStr) >> offset;
+       if (offset == 0) break;
+       QString dupkey;
+       (*mStr) >> dupkey;
+
+       if (dupkey == key) return offset;
+   }
+
+
+   return 0;
+}
+
+uint
+KSycocaDict::count()
+{
+   if (!d) return 0;
+
+   return d->count();
+}
+
+void
+KSycocaDict::clear()
+{
+   delete d;
+   d = 0;
+}
+
+uint
+KSycocaDict::hashKey( const QString &key)
+{
+   int l = key.length();
+   register uint h = 0;
+
+   for(uint i = 0; i < mHashList.count(); i++)
+   {
+      int pos = mHashList[i];
+      if (pos < 0)
+      {
+         pos = -pos-1;
+         if (pos < l)
+            h = ((h * 13) + (key[l-pos].cell() % 29)) & 0x3ffffff;
+      }
+      else
+      {
+         pos = pos-1;
+         if (pos < l)
+            h = ((h * 13) + (key[pos].cell() % 29)) & 0x3ffffff;
+      }
+   }
+   return h;
+}
+
+
+
+static int
+calcDiversity(KSycocaDictStringList *d, int pos, int sz)
+{
+   if (pos == 0) return 0;
+   bool *matrix = (bool *) calloc(sz, sizeof(bool));
+   uint usz = sz;
+
+   if (pos < 0)
+   {
+      pos = -pos-1;
+      for(string_entry *entry=d->first(); entry; entry = d->next())
+      {
+        register int l = entry->length;
+         if (pos < l && pos != 0)
+         {
+           register uint hash = ((entry->hash * 13) + (entry->key[l-pos].cell() % 29)) & 0x3ffffff;
+           matrix[ hash % usz ] = true;
+         }
+      }
+   }
+   else
+   {
+      pos = pos-1;
+      for(string_entry *entry=d->first(); entry; entry = d->next())
+      {
+         if (pos < entry->length)
+         {
+            register uint hash = ((entry->hash * 13) + (entry->key[pos].cell() % 29)) & 0x3ffffff;
+            matrix[ hash % usz ] = true;
+         }
+      }
+   }
+   int diversity = 0;
+   for(int i=0;i< sz;i++)
+      if (matrix[i]) diversity++;
+
+   free((void *) matrix);
+
+   return diversity;
+}
+
+
+
+static void
+addDiversity(KSycocaDictStringList *d, int pos)
+{
+   if (pos == 0) return;
+   if (pos < 0)
+   {
+      pos = -pos-1;
+      for(string_entry *entry=d->first(); entry; entry = d->next())
+      {
+         register int l = entry->length;
+         if (pos < l)
+            entry->hash = ((entry->hash * 13) + (entry->key[l-pos].cell() % 29)) & 0x3fffffff;
+      }
+   }
+   else
+   {
+      pos = pos - 1;
+      for(string_entry *entry=d->first(); entry; entry = d->next())
+      {
+         if (pos < entry->length)
+            entry->hash = ((entry->hash * 13) + (entry->key[pos].cell() % 29)) & 0x3fffffff;
+      }
+   }
+}
+
+
+void
+KSycocaDict::save(QDataStream &str)
+{
+   if (count() == 0)
+   {
+      mHashTableSize = 0;
+      mHashList.clear();
+      str << mHashTableSize;
+      str << mHashList;
+      return;
+   }
+
+   mOffset = str.device()->at();
+
+
+
+
+
+   int maxLength = 0;
+
+   for(string_entry *entry=d->first(); entry; entry = d->next())
+   {
+      entry->hash = 0;
+      if (entry->length > maxLength)
+         maxLength = entry->length;
+   }
+
+
+
+
+
+
+   register unsigned int sz = count()*4 + 1;
+   while(!(((sz % 3) && (sz % 5) && (sz % 7) && (sz % 11) && (sz % 13)))) sz+=2;
+
+   int maxDiv = 0;
+   int maxPos = 0;
+   int lastDiv = 0;
+
+   mHashList.clear();
+
+
+
+   int *oldvec=new int[maxLength*2+1];
+   for (int i=0; i<(maxLength*2+1); i++) oldvec[i]=0;
+   int mindiv=0;
+
+   while(true)
+   {
+      int divsum=0,divnum=0;
+
+      maxDiv = 0;
+      maxPos = 0;
+      for(int pos=-maxLength; pos <= maxLength; pos++)
+      {
+
+         if (oldvec[pos+maxLength]<mindiv)
+         { oldvec[pos+maxLength]=0; continue; }
+
+         int diversity = calcDiversity(d, pos, sz);
+         if (diversity > maxDiv)
+         {
+            maxDiv = diversity;
+            maxPos = pos;
+         }
+         oldvec[pos+maxLength]=diversity;
+         divsum+=diversity; divnum++;
+      }
+
+      if (divnum)
+         mindiv=(3*divsum)/(4*divnum);
+
+      if (maxDiv <= lastDiv)
+         break;
+
+      lastDiv = maxDiv;
+      addDiversity(d, maxPos);
+      mHashList.append(maxPos);
+   }
+
+   delete [] oldvec;
+
+   for(string_entry *entry=d->first(); entry; entry = d->next())
+   {
+      entry->hash = hashKey(entry->keyStr);
+   }
+
+
+   mHashTableSize = sz;
+
+   struct hashtable_entry {
+      string_entry *entry;
+      QPtrList<string_entry> *duplicates;
+      int duplicate_offset;
+   };
+
+   hashtable_entry *hashTable = new hashtable_entry[ sz ];
+
+
+   for (unsigned int i=0; i < sz; i++)
+   {
+      hashTable[i].entry = 0;
+      hashTable[i].duplicates = 0;
+   }
+
+
+   for(string_entry *entry=d->first(); entry; entry = d->next())
+   {
+      int hash = entry->hash % sz;
+      if (!hashTable[hash].entry)
+      {
+         hashTable[hash].entry = entry;
+      }
+      else
+      {
+         if (!hashTable[hash].duplicates)
+         {
+            hashTable[hash].duplicates = new QPtrList<string_entry>();
+            hashTable[hash].duplicates->append(hashTable[hash].entry);
+            hashTable[hash].duplicate_offset = 0;
+         }
+         hashTable[hash].duplicates->append(entry);
+      }
+   }
+
+   str << mHashTableSize;
+   str << mHashList;
+
+   mOffset = str.device()->at();
+
+
+   for(int pass = 1; pass <= 2; pass++)
+   {
+      str.device()->at(mOffset);
+
+      for(uint i=0; i < mHashTableSize; i++)
+      {
+         Q_INT32 tmpid;
+         if (!hashTable[i].entry)
+            tmpid = (Q_INT32) 0;
+         else if (!hashTable[i].duplicates)
+            tmpid = (Q_INT32) hashTable[i].entry->payload->offset();
+         else
+            tmpid = (Q_INT32) -hashTable[i].duplicate_offset;
+         str << tmpid;
+
+      }
+
+
+
+      for(uint i=0; i < mHashTableSize; i++)
+      {
+         if (hashTable[i].duplicates)
+         {
+            QPtrList<string_entry> *dups = hashTable[i].duplicates;
+            hashTable[i].duplicate_offset = str.device()->at();
+
+
+
+            for(string_entry *dup = dups->first(); dup; dup=dups->next())
+            {
+               str << (Q_INT32) dup->payload->offset();
+               str << dup->keyStr;
+            }
+            str << (Q_INT32) 0;
+         }
+      }
+
+   }
+
+
+   for(uint i=0; i < mHashTableSize; i++)
+   {
+      delete hashTable[i].duplicates;
+   }
+   delete [] hashTable;
+}
+template class QDict<KSycocaEntry>;
+template class QDict<KSharedPtr<KSycocaEntry> >;
+
+KSycocaFactory::KSycocaFactory(KSycocaFactoryId factory_id)
+ : m_resourceList(0), m_entryDict(0), m_sycocaDict(0)
+{
+  if (!KSycoca::self()->isBuilding())
+  {
+      m_str = KSycoca::self()->findFactory( factory_id );
+
+      if (m_str)
+      {
+
+          Q_INT32 i;
+          (*m_str) >> i;
+          m_sycocaDictOffset = i;
+          (*m_str) >> i;
+          m_beginEntryOffset = i;
+          (*m_str) >> i;
+          m_endEntryOffset = i;
+
+          int saveOffset = m_str->device()->at();
+
+          m_sycocaDict = new KSycocaDict(m_str, m_sycocaDictOffset);
+          saveOffset = m_str->device()->at(saveOffset);
+      }
+   }
+   else
+   {
+
+      m_str = 0;
+      m_resourceList = 0;
+      m_entryDict = new KSycocaEntryDict(977);
+      m_entryDict->setAutoDelete(true);
+      m_sycocaDict = new KSycocaDict();
+      m_beginEntryOffset = 0;
+      m_endEntryOffset = 0;
+
+
+   }
+   KSycoca::self()->addFactory(this);
+}
+
+KSycocaFactory::~KSycocaFactory()
+{
+   delete m_entryDict;
+   delete m_sycocaDict;
+}
+
+void
+KSycocaFactory::saveHeader(QDataStream &str)
+{
+
+   str.device()->at(mOffset);
+   str << (Q_INT32) m_sycocaDictOffset;
+   str << (Q_INT32) m_beginEntryOffset;
+   str << (Q_INT32) m_endEntryOffset;
+}
+
+void
+KSycocaFactory::save(QDataStream &str)
+{
+   if (!m_entryDict) return;
+
+   if (!m_sycocaDict) return;
+
+   mOffset = str.device()->at();
+   m_sycocaDictOffset = 0;
+
+
+   saveHeader(str);
+
+   m_beginEntryOffset = str.device()->at();
+
+
+   int entryCount = 0;
+   for(QDictIterator<KSycocaEntry::Ptr> it ( *m_entryDict );
+       it.current();
+       ++it)
+   {
+      KSycocaEntry *entry = (*it.current());
+      entry->save(str);
+      entryCount++;
+   }
+
+   m_endEntryOffset = str.device()->at();
+
+
+
+   str << (Q_INT32) entryCount;
+   for(QDictIterator<KSycocaEntry::Ptr> it ( *m_entryDict );
+       it.current();
+       ++it)
+   {
+      KSycocaEntry *entry = (*it.current());
+      str << (Q_INT32) entry->offset();
+   }
+
+
+   m_sycocaDictOffset = str.device()->at();
+   m_sycocaDict->save(str);
+
+   int endOfFactoryData = str.device()->at();
+
+
+   saveHeader(str);
+
+
+   str.device()->at(endOfFactoryData);
+}
+
+void
+KSycocaFactory::addEntry(KSycocaEntry *newEntry, const char *)
+{
+   if (!m_entryDict) return;
+
+
+   if (!m_sycocaDict) return;
+
+   QString name = newEntry->name();
+   m_entryDict->insert( name, new KSycocaEntry::Ptr(newEntry) );
+   m_sycocaDict->add( name, newEntry );
+}
+
+KSycocaEntry::List KSycocaFactory::allEntries()
+{
+   KSycocaEntry::List list;
+   if (!m_str) return list;
+
+
+
+   m_str->device()->at(m_endEntryOffset);
+   Q_INT32 entryCount;
+   (*m_str) >> entryCount;
+
+   if (entryCount > 8192)
+   {
+      KSycoca::flagError();
+      return list;
+   }
+
+   Q_INT32 *offsetList = new Q_INT32[entryCount];
+   for(int i = 0; i < entryCount; i++)
+   {
+      (*m_str) >> offsetList[i];
+   }
+
+   for(int i = 0; i < entryCount; i++)
+   {
+      KSycocaEntry *newEntry = createEntry(offsetList[i]);
+      if (newEntry)
+      {
+         list.append( KSycocaEntry::Ptr( newEntry ) );
+      }
+   }
+   delete [] offsetList;
+   return list;
+}
+
+void KSycocaFactory::virtual_hook( int, void* )
+{ }
+
+
+
+
+
+
+
+class QString;
+
+class KXMessagesPrivate;
+class KXMessages
+    : public QWidget
+    {
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+    public:
+        KXMessages( const char* accept_broadcast = __null, QWidget* parent = __null );
+        virtual ~KXMessages();
+        void sendMessage( WId w, const char* msg_type, const QString& message );
+
+
+
+
+
+        void broadcastMessage( const char* msg_type, const QString& message );
+        static bool sendMessageX( Display* disp, WId w, const char* msg_type,
+            const QString& message );
+        static bool broadcastMessageX( Display* disp, const char* msg_type,
+            const QString& message );
+    protected:
+
+
+
+
+        void gotMessage( const QString& message );
+    protected:
+
+
+
+        virtual bool x11Event( XEvent* ev );
+    private:
+        static void send_message_internal( WId w_P, const QString& msg_P, long mask_P,
+            Display* disp, Atom atom_P, Window handle_P );
+        QWidget* handle;
+        Atom cached_atom;
+        QCString cached_atom_name;
+        Atom accept_atom;
+        QMap< WId, QCString > incoming_messages;
+        KXMessagesPrivate* d;
+    };
+const long BROADCAST_MASK = (1L<<22);
+
+
+KXMessages::KXMessages( const char* accept_broadcast_P, QWidget* parent_P )
+    : QWidget( parent_P )
+    {
+    if( accept_broadcast_P != __null )
+        {
+        ( void ) KApplication::kApplication()->desktop();
+        KApplication::kApplication()->installX11EventFilter( this );
+        accept_atom = XInternAtom( qt_xdisplay(), accept_broadcast_P, false );
+        cached_atom_name = accept_broadcast_P;
+        cached_atom = accept_atom;
+        }
+    else
+        {
+        accept_atom = None;
+        cached_atom_name = "";
+        }
+    handle = new QWidget( this );
+    }
+
+KXMessages::~KXMessages()
+    {
+
+    }
+
+void KXMessages::broadcastMessage( const char* msg_type_P, const QString& message_P )
+    {
+    if( cached_atom_name != msg_type_P )
+        {
+        cached_atom = XInternAtom( qt_xdisplay(), msg_type_P, false );
+        cached_atom_name = msg_type_P;
+        }
+    send_message_internal( qt_xrootwin(), message_P, BROADCAST_MASK, qt_xdisplay(),
+        cached_atom, handle->winId());
+    }
+
+void KXMessages::sendMessage( WId w_P, const char* msg_type_P, const QString& message_P )
+    {
+    if( cached_atom_name != msg_type_P )
+        {
+        cached_atom = XInternAtom( qt_xdisplay(), msg_type_P, false );
+        cached_atom_name = msg_type_P;
+        }
+    send_message_internal( w_P, message_P, 0, qt_xdisplay(), cached_atom, handle->winId());
+    }
+
+bool KXMessages::broadcastMessageX( Display* disp, const char* msg_type_P,
+    const QString& message_P )
+    {
+    if( disp == __null )
+        return false;
+    Atom atom = XInternAtom( disp, msg_type_P, false );
+    Window win = XCreateSimpleWindow( disp, ((&((_XPrivDisplay)disp)->screens[(((_XPrivDisplay)disp)->default_screen)])->root), 0, 0, 1, 1,
+        0, (((&((_XPrivDisplay)disp)->screens[(((_XPrivDisplay)disp)->default_screen)]))->black_pixel),
+        (((&((_XPrivDisplay)disp)->screens[(((_XPrivDisplay)disp)->default_screen)]))->black_pixel));
+    send_message_internal( ((&((_XPrivDisplay)disp)->screens[(((_XPrivDisplay)disp)->default_screen)])->root), message_P, BROADCAST_MASK, disp,
+        atom, win );
+    XDestroyWindow( disp, win );
+    return true;
+    }
+
+bool KXMessages::sendMessageX( Display* disp, WId w_P, const char* msg_type_P,
+    const QString& message_P )
+    {
+    if( disp == __null )
+        return false;
+    Atom atom = XInternAtom( disp, msg_type_P, false );
+    Window win = XCreateSimpleWindow( disp, ((&((_XPrivDisplay)disp)->screens[(((_XPrivDisplay)disp)->default_screen)])->root), 0, 0, 1, 1,
+        0, (((&((_XPrivDisplay)disp)->screens[(((_XPrivDisplay)disp)->default_screen)]))->black_pixel),
+        (((&((_XPrivDisplay)disp)->screens[(((_XPrivDisplay)disp)->default_screen)]))->black_pixel));
+    send_message_internal( w_P, message_P, 0, disp, atom, win );
+    XDestroyWindow( disp, win );
+    return true;
+    }
+
+void KXMessages::send_message_internal( WId w_P, const QString& msg_P, long mask_P,
+    Display* disp, Atom atom_P, Window handle_P )
+    {
+    unsigned int pos = 0;
+    QCString msg = msg_P.utf8();
+    unsigned int len = strlen( msg );
+    XEvent e;
+    e.xclient.type = 33;
+    e.xclient.message_type = atom_P;
+    e.xclient.display = disp;
+    e.xclient.window = handle_P;
+    e.xclient.format = 8;
+    do
+        {
+        unsigned int i;
+        for( i = 0;
+             i < 20 && i + pos <= len;
+             ++i )
+            e.xclient.data.b[ i ] = msg[ i + pos ];
+        XSendEvent( disp, w_P, false, mask_P, &e );
+        pos += i;
+        } while( pos <= len );
+    XFlush( disp );
+    }
+
+bool KXMessages::x11Event( XEvent* ev_P )
+    {
+    if( ev_P->type != 33 || ev_P->xclient.message_type != accept_atom
+        || ev_P->xclient.format != 8 )
+        return QWidget::x11Event( ev_P );
+    char buf[ 21 ];
+    int i;
+    for( i = 0;
+         i < 20 && ev_P->xclient.data.b[ i ] != '\0';
+         ++i )
+        buf[ i ] = ev_P->xclient.data.b[ i ];
+    buf[ i ] = '\0';
+    if( incoming_messages.contains( ev_P->xclient.window ))
+        incoming_messages[ ev_P->xclient.window ] += buf;
+    else
+        incoming_messages[ ev_P->xclient.window ] = buf;
+    if( i < 20 )
+        {
+        gotMessage( QString::fromUtf8( incoming_messages[ ev_P->xclient.window ] ));
+        incoming_messages.remove( ev_P->xclient.window );
+        }
+    return false;
+    }
+
+const char *KXMessages::className() const
+{
+    return "KXMessages";
+}
+
+QMetaObject *KXMessages::metaObj = 0;
+static QMetaObjectCleanUp cleanUp_KXMessages( "KXMessages", &KXMessages::staticMetaObject );
+QMetaObject* KXMessages::staticMetaObject()
+{
+    if ( metaObj )
+        return metaObj;
+    QMetaObject* parentObject = QWidget::staticMetaObject();
+    static const QUParameter param_signal_0[] = {
+        { "message", &static_QUType_QString, 0, QUParameter::In }
+    };
+    static const QUMethod signal_0 = {"gotMessage", 1, param_signal_0 };
+    static const QMetaData signal_tbl[] = {
+        { "gotMessage(const QString&)", &signal_0, QMetaData::Public }
+    };
+    metaObj = QMetaObject::new_metaobject(
+        "KXMessages", parentObject,
+        0, 0,
+        signal_tbl, 1,
+
+        0, 0,
+        0, 0,
+
+        0, 0 );
+    cleanUp_KXMessages.setMetaObject( metaObj );
+    return metaObj;
+}
+
+void* KXMessages::qt_cast( const char* clname )
+{
+    if ( !qstrcmp( clname, "KXMessages" ) )
+        return this;
+    return QWidget::qt_cast( clname );
+}
+
+
+void KXMessages::gotMessage( const QString& t0 )
+{
+    activate_signal( staticMetaObject()->signalOffset() + 0, t0 );
+}
+
+bool KXMessages::qt_invoke( int _id, QUObject* _o )
+{
+    return QWidget::qt_invoke(_id,_o);
+}
+
+bool KXMessages::qt_emit( int _id, QUObject* _o )
+{
+    switch ( _id - staticMetaObject()->signalOffset() ) {
+    case 0: gotMessage((const QString&)static_QUType_QString.get(_o+1)); break;
+    default:
+        return QWidget::qt_emit(_id,_o);
+    }
+    return TRUE;
+}
+
+
+bool KXMessages::qt_property( int id, int f, QVariant* v)
+{
+    return QWidget::qt_property( id, f, v);
+}
+
+bool KXMessages::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C"
+
+int mkstemps(char *, int);
+extern "C"
+
+unsigned long strlcat(char*, const char*, unsigned long);
+
+
+
+
+
+
+extern "C"
+
+unsigned long strlcpy(char*, const char*, unsigned long);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C"
+
+int mkstemps(char *, int);
+extern "C"
+
+unsigned long strlcat(char*, const char*, unsigned long);
+
+
+
+
+
+
+extern "C"
+
+unsigned long strlcpy(char*, const char*, unsigned long);
+
+
+
+
+static const char* const KDE_STARTUP_INFO = "_KDE_STARTUP_INFO";
+static const char* const KDE_STARTUP_ID = "_KDE_STARTUP_ID";
+
+static const char* const KDE_STARTUP_ENV = "KDE_STARTUP_ENV";
+
+
+static const char* const KDE_STARTUP_INFO_2 = "KDE_STARTUP_INFO";
+static const char* const KDE_STARTUP_ID_2 = "KDE_STARTUP_ID";
+
+static long get_num( const QString& item_P );
+static unsigned long get_unum( const QString& item_P );
+static QString get_str( const QString& item_P );
+static QCString get_cstr( const QString& item_P );
+static QStringList get_fields( const QString& txt_P );
+static QString escape_str( const QString& str_P );
+
+class KStartupInfo::Data
+    : public KStartupInfoData
+    {
+    public:
+        Data() {};
+        Data( const QString& txt_P )
+            : KStartupInfoData( txt_P ), age( 0 ) {};
+        unsigned int age;
+    };
+
+struct KStartupInfoPrivate
+    {
+    public:
+        QMap< KStartupInfoId, KStartupInfo::Data > startups;
+
+        QMap< KStartupInfoId, KStartupInfo::Data > silent_startups;
+
+        KWinModule* wm_module;
+        KXMessages msgs;
+        KXMessages msgs_2;
+
+        QTimer* cleanup;
+        int flags;
+        KStartupInfoPrivate( int flags_P )
+            :
+
+            msgs( KDE_STARTUP_INFO ), msgs_2( KDE_STARTUP_INFO_2 ),
+
+              flags( flags_P ) {}
+    };
+
+KStartupInfo::KStartupInfo( int flags_P, QObject* parent_P, const char* name_P )
+    : QObject( parent_P, name_P ),
+        timeout( 60 ), d( __null )
+    {
+    init( flags_P );
+    }
+
+KStartupInfo::KStartupInfo( bool clean_on_cantdetect_P, QObject* parent_P, const char* name_P )
+    : QObject( parent_P, name_P ),
+        timeout( 60 ), d( __null )
+    {
+    init( clean_on_cantdetect_P ? CleanOnCantDetect : 0 );
+    }
+
+void KStartupInfo::init( int flags_P )
+    {
+
+    if (!KApplication::kApplication()) return;
+    if (!KApplication::kApplication()->getDisplay()) return;
+
+    d = new KStartupInfoPrivate( flags_P );
+
+    if( !( d->flags & DisableKWinModule ))
+        {
+        d->wm_module = new KWinModule( this );
+        connect( d->wm_module, "2""windowAdded( WId )", "1""slot_window_added( WId )");
+        connect( d->wm_module, "2""systemTrayWindowAdded( WId )", "1""slot_window_added( WId )");
+        }
+    else
+        d->wm_module = __null;
+    connect( &d->msgs, "2""gotMessage( const QString& )", "1""got_message( const QString& )");
+    connect( &d->msgs_2, "2""gotMessage( const QString& )", "1""got_message( const QString& )");
+
+    d->cleanup = new QTimer( this );
+    connect( d->cleanup, "2""timeout()", "1""startups_cleanup()");
+    }
+
+KStartupInfo::~KStartupInfo()
+    {
+    delete d;
+    }
+
+void KStartupInfo::got_message( const QString& msg_P )
+    {
+    kdDebug( 172 ) << "got:" << msg_P << endl;
+    QString msg = msg_P.stripWhiteSpace();
+    if( msg.startsWith( "new:" ))
+        got_startup_info( msg.mid( 4 ), false );
+    else if( msg.startsWith( "change:" ))
+        got_startup_info( msg.mid( 7 ), true );
+    else if( msg.startsWith( "remove:" ))
+        got_remove_startup_info( msg.mid( 7 ));
+    }
+
+
+
+
+
+
+namespace
+{
+class DelayedWindowEvent
+    : public QCustomEvent
+    {
+    public:
+        DelayedWindowEvent( WId w_P )
+            : QCustomEvent( QEvent::User + 15 ), w( w_P ) {}
+        Window w;
+    };
+}
+
+void KStartupInfo::slot_window_added( WId w_P )
+    {
+    KApplication::kApplication()->postEvent( this, new DelayedWindowEvent( w_P ));
+    }
+
+void KStartupInfo::customEvent( QCustomEvent* e_P )
+    {
+    if( e_P->type() == QEvent::User + 15 )
+        window_added( static_cast< DelayedWindowEvent* >( e_P )->w );
+    else
+        QObject::customEvent( e_P );
+    }
+
+void KStartupInfo::window_added( WId w_P )
+    {
+    KStartupInfoId id;
+    KStartupInfoData data;
+    startup_t ret = check_startup_internal( w_P, &id, &data, false );
+    switch( ret )
+        {
+        case Match:
+            kdDebug( 172 ) << "new window match" << endl;
+
+
+
+
+            if( data.silent() != KStartupInfoData::Yes )
+                remove_startup_info_internal( id );
+          break;
+        case NoMatch:
+          break;
+        case CantDetect:
+            if( d->flags & CleanOnCantDetect )
+                clean_all_noncompliant();
+          break;
+        }
+    }
+
+void KStartupInfo::got_startup_info( const QString& msg_P, bool update_only_P )
+    {
+    KStartupInfoId id( msg_P );
+    if( id.none())
+        return;
+    KStartupInfo::Data data( msg_P );
+    new_startup_info_internal( id, data, update_only_P );
+    }
+
+void KStartupInfo::new_startup_info_internal( const KStartupInfoId& id_P,
+    Data& data_P, bool update_only_P )
+    {
+    if (!d) return;
+    if( id_P.none())
+        return;
+    if( d->startups.contains( id_P ))
+        {
+        d->startups[ id_P ].update( data_P );
+        d->startups[ id_P ].age = 0;
+        kdDebug( 172 ) << "updating" << endl;
+        if( d->startups[ id_P ].silent() == Data::Yes
+            && !( d->flags & AnnounceSilenceChanges ))
+            {
+            d->silent_startups[ id_P ] = d->startups[ id_P ];
+            d->startups.remove( id_P );
+            gotRemoveStartup( id_P, d->silent_startups[ id_P ] );
+            return;
+            }
+        gotStartupChange( id_P, d->startups[ id_P ] );
+        return;
+        }
+    if( d->silent_startups.contains( id_P ))
+        {
+        d->silent_startups[ id_P ].update( data_P );
+        d->silent_startups[ id_P ].age = 0;
+        kdDebug( 172 ) << "updating silenced" << endl;
+        if( d->silent_startups[ id_P ].silent() != Data::Yes )
+            {
+            d->startups[ id_P ] = d->silent_startups[ id_P ];
+            d->silent_startups.remove( id_P );
+            gotNewStartup( id_P, d->startups[ id_P ] );
+            return;
+            }
+        gotStartupChange( id_P, d->startups[ id_P ] );
+        return;
+        }
+    if( update_only_P )
+        return;
+    if( data_P.silent() != Data::Yes || d->flags & AnnounceSilenceChanges )
+        {
+        kdDebug( 172 ) << "adding" << endl;
+        d->startups.insert( id_P, data_P );
+        gotNewStartup( id_P, data_P );
+        }
+    else
+        {
+        kdDebug( 172 ) << "adding silent" << endl;
+        d->silent_startups.insert( id_P, data_P );
+        }
+    d->cleanup->start( 1000 );
+    }
+
+void KStartupInfo::got_remove_startup_info( const QString& msg_P )
+    {
+    KStartupInfoId id( msg_P );
+    KStartupInfoData data( msg_P );
+    if( data.pids().count() > 0 )
+        {
+        if( !id.none())
+            remove_startup_pids( id, data );
+        else
+            remove_startup_pids( data );
+        return;
+        }
+    remove_startup_info_internal( id );
+    }
+
+void KStartupInfo::remove_startup_info_internal( const KStartupInfoId& id_P )
+    {
+    if (!d) return;
+    if( d->startups.contains( id_P ))
+        {
+        kdDebug( 172 ) << "removing" << endl;
+        gotRemoveStartup( id_P, d->startups[ id_P ]);
+        d->startups.remove( id_P );
+        }
+    else if( d->silent_startups.contains( id_P ))
+        {
+        kdDebug( 172 ) << "removing silent" << endl;
+        d->silent_startups.remove( id_P );
+        }
+    return;
+    }
+
+void KStartupInfo::remove_startup_pids( const KStartupInfoData& data_P )
+    {
+    if (!d) return;
+    for( QMap< KStartupInfoId, Data >::Iterator it = d->startups.begin();
+         it != d->startups.end();
+         ++it )
+        {
+        if( ( *it ).hostname() != data_P.hostname())
+            continue;
+        if( !( *it ).is_pid( data_P.pids().first()))
+            continue;
+        remove_startup_pids( it.key(), data_P );
+        break;
+        }
+    }
+
+void KStartupInfo::remove_startup_pids( const KStartupInfoId& id_P,
+    const KStartupInfoData& data_P )
+    {
+    if (!d) return;
+    kdFatal( data_P.pids().count() == 0, 172 );
+    Data* data = __null;
+    if( d->startups.contains( id_P ))
+        data = &d->startups[ id_P ];
+    else if( d->silent_startups.contains( id_P ))
+        data = &d->silent_startups[ id_P ];
+    else
+        return;
+    for( QValueList< pid_t >::ConstIterator it2 = data_P.pids().begin();
+         it2 != data_P.pids().end();
+         ++it2 )
+        data->remove_pid( *it2 );
+    if( data->pids().count() == 0 )
+        remove_startup_info_internal( id_P );
+    }
+
+bool KStartupInfo::sendStartup( const KStartupInfoId& id_P, const KStartupInfoData& data_P )
+    {
+    if( id_P.none())
+        return false;
+    KXMessages msgs;
+    QString msg = QString::fromLatin1( "new: %1 %2" )
+        .arg( id_P.to_text()).arg( data_P.to_text());
+    kdDebug( 172 ) << "sending " << msg << endl;
+    msgs.broadcastMessage( KDE_STARTUP_INFO, msg );
+    return true;
+    }
+
+bool KStartupInfo::sendStartupX( Display* disp_P, const KStartupInfoId& id_P,
+    const KStartupInfoData& data_P )
+    {
+    if( id_P.none())
+        return false;
+    QString msg = QString::fromLatin1( "new: %1 %2" )
+        .arg( id_P.to_text()).arg( data_P.to_text());
+
+
+
+    return KXMessages::broadcastMessageX( disp_P, KDE_STARTUP_INFO, msg );
+    }
+
+bool KStartupInfo::sendChange( const KStartupInfoId& id_P, const KStartupInfoData& data_P )
+    {
+    if( id_P.none())
+        return false;
+    KXMessages msgs;
+    QString msg = QString::fromLatin1( "change: %1 %2" )
+        .arg( id_P.to_text()).arg( data_P.to_text());
+    kdDebug( 172 ) << "sending " << msg << endl;
+    msgs.broadcastMessage( KDE_STARTUP_INFO, msg );
+    return true;
+    }
+
+bool KStartupInfo::sendChangeX( Display* disp_P, const KStartupInfoId& id_P,
+    const KStartupInfoData& data_P )
+    {
+    if( id_P.none())
+        return false;
+    QString msg = QString::fromLatin1( "change: %1 %2" )
+        .arg( id_P.to_text()).arg( data_P.to_text());
+
+
+
+    return KXMessages::broadcastMessageX( disp_P, KDE_STARTUP_INFO, msg );
+    }
+
+bool KStartupInfo::sendFinish( const KStartupInfoId& id_P )
+    {
+    if( id_P.none())
+        return false;
+    KXMessages msgs;
+    QString msg = QString::fromLatin1( "remove: %1" ).arg( id_P.to_text());
+    kdDebug( 172 ) << "sending " << msg << endl;
+    msgs.broadcastMessage( KDE_STARTUP_INFO, msg );
+    return true;
+    }
+
+bool KStartupInfo::sendFinishX( Display* disp_P, const KStartupInfoId& id_P )
+    {
+    if( id_P.none())
+        return false;
+    QString msg = QString::fromLatin1( "remove: %1" ).arg( id_P.to_text());
+
+
+
+    return KXMessages::broadcastMessageX( disp_P, KDE_STARTUP_INFO, msg );
+    }
+
+bool KStartupInfo::sendFinish( const KStartupInfoId& id_P, const KStartupInfoData& data_P )
+    {
+
+
+    KXMessages msgs;
+    QString msg = QString::fromLatin1( "remove: %1 %2" )
+        .arg( id_P.to_text()).arg( data_P.to_text());
+    kdDebug( 172 ) << "sending " << msg << endl;
+    msgs.broadcastMessage( KDE_STARTUP_INFO, msg );
+    return true;
+    }
+
+bool KStartupInfo::sendFinishX( Display* disp_P, const KStartupInfoId& id_P,
+    const KStartupInfoData& data_P )
+    {
+
+
+    QString msg = QString::fromLatin1( "remove: %1 %2" )
+        .arg( id_P.to_text()).arg( data_P.to_text());
+
+
+
+    return KXMessages::broadcastMessageX( disp_P, KDE_STARTUP_INFO, msg );
+    }
+
+void KStartupInfo::appStarted()
+    {
+    if( KApplication::kApplication() != __null )
+        {
+        KStartupInfoId id;
+        id.initId( KApplication::kApplication()->startupId());
+        if( !id.none())
+            KStartupInfo::sendFinish( id );
+        }
+    else if( getenv( "DISPLAY" ) != __null )
+        {
+        KStartupInfoId id = KStartupInfo::currentStartupIdEnv();
+        if( !id.none())
+            {
+
+            Display* disp = XOpenDisplay( __null );
+            if( disp != __null )
+                {
+                KStartupInfo::sendFinishX( disp, id );
+                XCloseDisplay( disp );
+                }
+
+            }
+        }
+    }
+
+KStartupInfo::startup_t KStartupInfo::checkStartup( WId w_P, KStartupInfoId& id_O,
+    KStartupInfoData& data_O )
+    {
+    return check_startup_internal( w_P, &id_O, &data_O, true );
+    }
+
+KStartupInfo::startup_t KStartupInfo::checkStartup( WId w_P, KStartupInfoId& id_O )
+    {
+    return check_startup_internal( w_P, &id_O, __null, true );
+    }
+
+KStartupInfo::startup_t KStartupInfo::checkStartup( WId w_P, KStartupInfoData& data_O )
+    {
+    return check_startup_internal( w_P, __null, &data_O, true );
+    }
+
+KStartupInfo::startup_t KStartupInfo::checkStartup( WId w_P )
+    {
+    return check_startup_internal( w_P, __null, __null, true );
+    }
+
+KStartupInfo::startup_t KStartupInfo::check_startup_internal( WId w_P, KStartupInfoId* id_O,
+    KStartupInfoData* data_O, bool remove_P )
+    {
+    if (!d) return NoMatch;
+    if( d->startups.count() == 0 )
+        return NoMatch;
+
+    NETWinInfo info( qt_xdisplay(), w_P, qt_xrootwin(),
+        NET::WMWindowType | NET::WMPid | NET::WMState );
+
+    NET::WindowType type = info.windowType( NET::NormalMask | NET::DesktopMask
+        | NET::DockMask | NET::ToolbarMask | NET::MenuMask | NET::DialogMask
+        | NET::OverrideMask | NET::TopMenuMask | NET::UtilityMask | NET::SplashMask );
+    if( type != NET::Normal
+        && type != NET::Override
+        && type != NET::Unknown
+        && type != NET::Dialog
+        && type != NET::Utility )
+
+        return NoMatch;
+
+    Window transient_for;
+    if( XGetTransientForHint( qt_xdisplay(), static_cast< Window >( w_P ), &transient_for )
+        && static_cast< WId >( transient_for ) != qt_xrootwin()
+        && transient_for != None )
+        return NoMatch;
+    kdDebug( 172 ) << "check_startup" << endl;
+    QCString id = windowStartupId( w_P );
+    if( !id.isNull())
+        {
+        if( id.isEmpty() || id == "0" )
+            {
+            kdDebug( 172 ) << "ignore" << endl;
+            return NoMatch;
+            }
+        return find_id( id, id_O, data_O, remove_P ) ? Match : NoMatch;
+        }
+
+
+    pid_t pid = info.pid();
+    if( pid > 0 )
+        {
+        QCString hostname = get_window_hostname( w_P );
+        if( !hostname.isEmpty()
+            && find_pid( pid, hostname, id_O, data_O, remove_P ))
+            return Match;
+
+        }
+
+    XClassHint hint;
+    if( XGetClassHint( qt_xdisplay(), w_P, &hint ) != 0 )
+        {
+        if( find_wclass( hint.res_name, hint.res_class, id_O, data_O, remove_P ))
+            return Match;
+        }
+
+    kdDebug( 172 ) << "check_startup:cantdetect" << endl;
+    return CantDetect;
+    }
+
+bool KStartupInfo::find_id( const QCString& id_P, KStartupInfoId* id_O,
+    KStartupInfoData* data_O, bool remove_P )
+    {
+    if (!d) return false;
+    kdDebug( 172 ) << "find_id:" << id_P << endl;
+    KStartupInfoId id;
+    id.initId( id_P );
+    if( d->startups.contains( id ))
+        {
+        if( id_O != __null )
+            *id_O = id;
+        if( data_O != __null )
+            *data_O = d->startups[ id ];
+        if( remove_P
+            && d->startups[ id ].silent() != Data::Yes )
+            d->startups.remove( id );
+        kdDebug( 172 ) << "check_startup_id:match" << endl;
+        return true;
+        }
+    return false;
+    }
+
+bool KStartupInfo::find_pid( pid_t pid_P, const QCString& hostname_P,
+    KStartupInfoId* id_O, KStartupInfoData* data_O, bool remove_P )
+    {
+    if (!d) return false;
+    kdDebug( 172 ) << "find_pid:" << pid_P << endl;
+    for( QMap< KStartupInfoId, Data >::Iterator it = d->startups.begin();
+         it != d->startups.end();
+         ++it )
+        {
+        if( ( *it ).is_pid( pid_P ) && ( *it ).hostname() == hostname_P )
+            {
+            if( id_O != __null )
+                *id_O = it.key();
+            if( data_O != __null )
+                *data_O = *it;
+            if( remove_P
+                && ( *it ).silent() != Data::Yes )
+                d->startups.remove( it );
+            kdDebug( 172 ) << "check_startup_pid:match" << endl;
+            return true;
+            }
+        }
+    return false;
+    }
+
+bool KStartupInfo::find_wclass( QCString res_name, QCString res_class,
+    KStartupInfoId* id_O, KStartupInfoData* data_O, bool remove_P )
+    {
+    if (!d) return false;
+    res_name = res_name.lower();
+    res_class = res_class.lower();
+    kdDebug( 172 ) << "find_wclass:" << res_name << ":" << res_class << endl;
+    for( QMap< KStartupInfoId, Data >::Iterator it = d->startups.begin();
+         it != d->startups.end();
+         ++it )
+        {
+        const QCString wmclass = ( *it ).findWMClass();
+        if( wmclass.lower() == res_name || wmclass.lower() == res_class )
+            {
+            if( id_O != __null )
+                *id_O = it.key();
+            if( data_O != __null )
+                *data_O = *it;
+            if( remove_P
+                && ( *it ).silent() != Data::Yes )
+                d->startups.remove( it );
+            kdDebug( 172 ) << "check_startup_wclass:match" << endl;
+            return true;
+            }
+        }
+    return false;
+    }
+
+
+static Atom kde_startup_atom = None;
+static Atom kde_startup_atom_2 = None;
+
+
+QCString KStartupInfo::windowStartupId( WId w_P )
+    {
+
+    if( kde_startup_atom == None )
+        kde_startup_atom = XInternAtom( qt_xdisplay(), KDE_STARTUP_ID, 0 );
+    if( kde_startup_atom_2 == None )
+        kde_startup_atom_2 = XInternAtom( qt_xdisplay(), KDE_STARTUP_ID_2, 0 );
+    unsigned char *name_ret;
+    QCString ret;
+    Atom type_ret;
+    int format_ret;
+    unsigned long nitems_ret = 0, after_ret = 0;
+    if( XGetWindowProperty( qt_xdisplay(), w_P, kde_startup_atom, 0l, 4096,
+            0, ((Atom) 31), &type_ret, &format_ret, &nitems_ret, &after_ret, &name_ret )
+            == Success )
+        {
+        if( type_ret == ((Atom) 31) && format_ret == 8 && name_ret != __null )
+            ret = reinterpret_cast< char* >( name_ret );
+        if ( name_ret != __null )
+            XFree( name_ret );
+        }
+    if( ret.isNull() && XGetWindowProperty( qt_xdisplay(), w_P, kde_startup_atom_2, 0l, 4096,
+            0, ((Atom) 31), &type_ret, &format_ret, &nitems_ret, &after_ret, &name_ret )
+            == Success )
+        {
+        if( type_ret == ((Atom) 31) && format_ret == 8 && name_ret != __null )
+            ret = reinterpret_cast< char* >( name_ret );
+        if ( name_ret != __null )
+            XFree( name_ret );
+        }
+    return ret;
+
+
+
+    }
+
+void KStartupInfo::setWindowStartupId( WId w_P, const QCString& id_P )
+    {
+
+    if( id_P.isNull())
+        return;
+    if( kde_startup_atom == None )
+        kde_startup_atom = XInternAtom( qt_xdisplay(), KDE_STARTUP_ID, 0 );
+    XChangeProperty( qt_xdisplay(), w_P, kde_startup_atom, ((Atom) 31), 8,
+        0, reinterpret_cast< unsigned char* >( id_P.data()), id_P.length());
+
+    }
+
+QCString KStartupInfo::get_window_hostname( WId w_P )
+    {
+
+    XTextProperty tp;
+    char** hh;
+    int cnt;
+    if( XGetWMClientMachine( qt_xdisplay(), w_P, &tp ) != 0
+        && XTextPropertyToStringList( &tp, &hh, &cnt ) != 0 )
+        {
+        if( cnt == 1 )
+            {
+            QCString hostname = hh[ 0 ];
+            XFreeStringList( hh );
+            return hostname;
+            }
+        XFreeStringList( hh );
+        }
+
+
+    return QCString();
+    }
+
+void KStartupInfo::setTimeout( unsigned int secs_P )
+    {
+    timeout = secs_P;
+
+    QTimer::singleShot( 0, this, "1""startups_cleanup_no_age()");
+    }
+
+void KStartupInfo::startups_cleanup_no_age()
+    {
+    startups_cleanup_internal( false );
+    }
+
+void KStartupInfo::startups_cleanup()
+    {
+    if (!d) return;
+    if( d->startups.count() == 0 && d->silent_startups.count() == 0 )
+        {
+        d->cleanup->stop();
+        return;
+        }
+    startups_cleanup_internal( true );
+    }
+
+void KStartupInfo::startups_cleanup_internal( bool age_P )
+    {
+    if (!d) return;
+    for( QMap< KStartupInfoId, Data >::Iterator it = d->startups.begin();
+         it != d->startups.end();
+         )
+        {
+        if( age_P )
+            ( *it ).age++;
+        int tout = timeout;
+        if( ( *it ).silent() == Data::Yes )
+            tout *= 20;
+        if( ( *it ).age >= timeout )
+            {
+            const KStartupInfoId& key = it.key();
+            ++it;
+            kdDebug( 172 ) << "entry timeout:" << key.id() << endl;
+            remove_startup_info_internal( key );
+            }
+        else
+            ++it;
+        }
+    for( QMap< KStartupInfoId, Data >::Iterator it = d->silent_startups.begin();
+         it != d->silent_startups.end();
+         )
+        {
+        if( age_P )
+            ( *it ).age++;
+        int tout = timeout;
+        if( ( *it ).silent() == Data::Yes )
+            tout *= 20;
+        if( ( *it ).age >= timeout )
+            {
+            const KStartupInfoId& key = it.key();
+            ++it;
+            kdDebug( 172 ) << "entry timeout:" << key.id() << endl;
+            remove_startup_info_internal( key );
+            }
+        else
+            ++it;
+        }
+    }
+
+void KStartupInfo::clean_all_noncompliant()
+    {
+    if (!d) return;
+    for( QMap< KStartupInfoId, Data >::Iterator it = d->startups.begin();
+         it != d->startups.end();
+         )
+        {
+        if( ( *it ).WMClass() != "0" )
+            {
+            ++it;
+            continue;
+            }
+        const KStartupInfoId& key = it.key();
+        ++it;
+        kdDebug( 172 ) << "entry cleaning:" << key.id() << endl;
+        remove_startup_info_internal( key );
+        }
+    }
+
+struct KStartupInfoIdPrivate
+    {
+    KStartupInfoIdPrivate() : id( "" ) {};
+    QCString id;
+    };
+
+const QCString& KStartupInfoId::id() const
+    {
+    return d->id;
+    }
+
+
+QString KStartupInfoId::to_text() const
+    {
+    return QString::fromLatin1( " ID=\"%1\" " ).arg( escape_str( id()));
+    }
+
+KStartupInfoId::KStartupInfoId( const QString& txt_P )
+    {
+    d = new KStartupInfoIdPrivate;
+    QStringList items = get_fields( txt_P );
+    const QString id_str = QString::fromLatin1( "ID=" );
+    for( QStringList::Iterator it = items.begin();
+         it != items.end();
+         ++it )
+        {
+        if( ( *it ).startsWith( id_str ))
+            d->id = get_cstr( *it );
+        }
+    }
+
+void KStartupInfoId::initId( const QCString& id_P )
+    {
+    if( !id_P.isEmpty())
+        {
+        d->id = id_P;
+
+
+
+        return;
+        }
+    const char* startup_env = getenv( KDE_STARTUP_ENV );
+    if( startup_env != __null && *startup_env != '\0' )
+        {
+        d->id = startup_env;
+
+
+
+        return;
+        }
+
+
+
+    struct timeval tm;
+    gettimeofday( &tm, __null );
+    char hostname[ 256 ];
+    hostname[ 0 ] = '\0';
+    if (!gethostname( hostname, 255 ))
+        hostname[sizeof(hostname)-1] = '\0';
+    d->id = QString( "%1;%2;%3;%4" ).arg( hostname ).arg( tm.tv_sec )
+        .arg( tm.tv_usec ).arg( getpid()).latin1();
+
+
+
+    }
+
+bool KStartupInfoId::setupStartupEnv() const
+    {
+    if( id().isEmpty())
+        {
+        unsetenv( KDE_STARTUP_ENV );
+        return false;
+        }
+    return setenv( KDE_STARTUP_ENV, id(), true ) == 0;
+    }
+
+KStartupInfoId KStartupInfo::currentStartupIdEnv()
+    {
+    const char* startup_env = getenv( KDE_STARTUP_ENV );
+    KStartupInfoId id;
+    if( startup_env != __null && *startup_env != '\0' )
+        id.d->id = startup_env;
+    else
+        id.d->id = "0";
+    return id;
+    }
+
+void KStartupInfo::resetStartupEnv()
+    {
+    unsetenv( KDE_STARTUP_ENV );
+    }
+
+KStartupInfoId::KStartupInfoId()
+    {
+    d = new KStartupInfoIdPrivate;
+    }
+
+KStartupInfoId::~KStartupInfoId()
+    {
+    delete d;
+    }
+
+KStartupInfoId::KStartupInfoId( const KStartupInfoId& id_P )
+    {
+    d = new KStartupInfoIdPrivate( *id_P.d );
+    }
+
+KStartupInfoId& KStartupInfoId::operator=( const KStartupInfoId& id_P )
+    {
+    if( &id_P == this )
+        return *this;
+    delete d;
+    d = new KStartupInfoIdPrivate( *id_P.d );
+    return *this;
+    }
+
+bool KStartupInfoId::operator==( const KStartupInfoId& id_P ) const
+    {
+    return id() == id_P.id();
+    }
+
+bool KStartupInfoId::operator!=( const KStartupInfoId& id_P ) const
+    {
+    return !(*this == id_P );
+    }
+
+
+bool KStartupInfoId::operator<( const KStartupInfoId& id_P ) const
+    {
+    return id() < id_P.id();
+    }
+
+bool KStartupInfoId::none() const
+    {
+    return d->id.isEmpty() || d->id == "0";
+    }
+
+struct KStartupInfoDataPrivate
+    {
+    KStartupInfoDataPrivate() : desktop( 0 ), wmclass( "" ), hostname( "" ),
+        silent( KStartupInfoData::Unknown ), timestamp( -1U ) {};
+    QString bin;
+    QString name;
+    QString icon;
+    int desktop;
+    QValueList< pid_t > pids;
+    QCString wmclass;
+    QCString hostname;
+    KStartupInfoData::TriState silent;
+    unsigned long timestamp;
+    };
+
+QString KStartupInfoData::to_text() const
+    {
+    QString ret = "";
+    if( !d->bin.isEmpty())
+        ret += QString::fromLatin1( " BIN=\"%1\"" ).arg( escape_str( d->bin ));
+    if( !d->name.isEmpty())
+        ret += QString::fromLatin1( " NAME=\"%1\"" ).arg( escape_str( d->name ));
+    if( !d->icon.isEmpty())
+        ret += QString::fromLatin1( " ICON=%1" ).arg( d->icon );
+    if( d->desktop != 0 )
+        ret += QString::fromLatin1( " DESKTOP=%1" ).arg( d->desktop );
+    if( !d->wmclass.isEmpty())
+        ret += QString::fromLatin1( " WMCLASS=%1" ).arg( d->wmclass );
+    if( !d->hostname.isEmpty())
+        ret += QString::fromLatin1( " HOSTNAME=%1" ).arg( d->hostname );
+    for( QValueList< pid_t >::ConstIterator it = d->pids.begin();
+         it != d->pids.end();
+         ++it )
+        ret += QString::fromLatin1( " PID=%1" ).arg( *it );
+    if( d->silent != Unknown )
+        ret += QString::fromLatin1( " SILENT=%1" ).arg( d->silent == Yes ? 1 : 0 );
+    if( d->timestamp != -1U )
+        ret += QString::fromLatin1( " TIMESTAMP=%1" ).arg( d->timestamp );
+    return ret;
+    }
+
+KStartupInfoData::KStartupInfoData( const QString& txt_P )
+    {
+    d = new KStartupInfoDataPrivate;
+    QStringList items = get_fields( txt_P );
+    const QString bin_str = QString::fromLatin1( "BIN=" );
+    const QString name_str = QString::fromLatin1( "NAME=" );
+    const QString icon_str = QString::fromLatin1( "ICON=" );
+    const QString desktop_str = QString::fromLatin1( "DESKTOP=" );
+    const QString wmclass_str = QString::fromLatin1( "WMCLASS=" );
+    const QString hostname_str = QString::fromLatin1( "HOSTNAME=" );
+    const QString pid_str = QString::fromLatin1( "PID=" );
+    const QString silent_str = QString::fromLatin1( "SILENT=" );
+    const QString timestamp_str = QString::fromLatin1( "TIMESTAMP=" );
+    for( QStringList::Iterator it = items.begin();
+         it != items.end();
+         ++it )
+        {
+        if( ( *it ).startsWith( bin_str ))
+            d->bin = get_str( *it );
+        else if( ( *it ).startsWith( name_str ))
+            d->name = get_str( *it );
+        else if( ( *it ).startsWith( icon_str ))
+            d->icon = get_str( *it );
+        else if( ( *it ).startsWith( desktop_str ))
+            d->desktop = get_num( *it );
+        else if( ( *it ).startsWith( wmclass_str ))
+            d->wmclass = get_cstr( *it );
+        else if( ( *it ).startsWith( hostname_str ))
+            d->hostname = get_cstr( *it );
+        else if( ( *it ).startsWith( pid_str ))
+            addPid( get_num( *it ));
+        else if( ( *it ).startsWith( silent_str ))
+            d->silent = get_num( *it ) != 0 ? Yes : No;
+        else if( ( *it ).startsWith( timestamp_str ))
+            d->timestamp = get_unum( *it );
+        }
+    }
+
+KStartupInfoData::KStartupInfoData( const KStartupInfoData& data )
+{
+    d = new KStartupInfoDataPrivate( *data.d );
+}
+
+KStartupInfoData& KStartupInfoData::operator=( const KStartupInfoData& data )
+{
+    if( &data == this )
+        return *this;
+    delete d;
+    d = new KStartupInfoDataPrivate( *data.d );
+    return *this;
+}
+
+void KStartupInfoData::update( const KStartupInfoData& data_P )
+    {
+    if( !data_P.bin().isEmpty())
+        d->bin = data_P.bin();
+    if( !data_P.name().isEmpty() && name().isEmpty())
+        d->name = data_P.name();
+    if( !data_P.icon().isEmpty() && icon().isEmpty())
+        d->icon = data_P.icon();
+    if( data_P.desktop() != 0 && desktop() == 0 )
+        d->desktop = data_P.desktop();
+    if( !data_P.d->wmclass.isEmpty())
+        d->wmclass = data_P.d->wmclass;
+    if( !data_P.d->hostname.isEmpty())
+        d->hostname = data_P.d->hostname;
+    for( QValueList< pid_t >::ConstIterator it = data_P.d->pids.begin();
+         it != data_P.d->pids.end();
+         ++it )
+        addPid( *it );
+    if( data_P.silent() != Unknown )
+        d->silent = data_P.silent();
+    if( data_P.timestamp() != -1U && timestamp() == -1U )
+        d->timestamp = data_P.timestamp();
+    }
+
+KStartupInfoData::KStartupInfoData()
+{
+    d = new KStartupInfoDataPrivate;
+}
+
+KStartupInfoData::~KStartupInfoData()
+{
+    delete d;
+}
+
+void KStartupInfoData::setBin( const QString& bin_P )
+    {
+    d->bin = bin_P;
+    }
+
+const QString& KStartupInfoData::bin() const
+    {
+    return d->bin;
+    }
+
+void KStartupInfoData::setName( const QString& name_P )
+    {
+    d->name = name_P;
+    }
+
+const QString& KStartupInfoData::findName() const
+    {
+    if( !name().isEmpty())
+        return name();
+    return bin();
+    }
+
+const QString& KStartupInfoData::name() const
+    {
+    return d->name;
+    }
+
+void KStartupInfoData::setIcon( const QString& icon_P )
+    {
+    d->icon = icon_P;
+    }
+
+const QString& KStartupInfoData::findIcon() const
+    {
+    if( !icon().isEmpty())
+        return icon();
+    return bin();
+    }
+
+const QString& KStartupInfoData::icon() const
+    {
+    return d->icon;
+    }
+
+void KStartupInfoData::setDesktop( int desktop_P )
+    {
+    d->desktop = desktop_P;
+    }
+
+int KStartupInfoData::desktop() const
+    {
+    return d->desktop;
+    }
+
+void KStartupInfoData::setWMClass( const QCString& wmclass_P )
+    {
+    d->wmclass = wmclass_P;
+    }
+
+const QCString KStartupInfoData::findWMClass() const
+    {
+    if( !WMClass().isEmpty() && WMClass() != "0" )
+        return WMClass();
+    return bin().latin1();
+    }
+
+const QCString& KStartupInfoData::WMClass() const
+    {
+    return d->wmclass;
+    }
+
+void KStartupInfoData::setHostname( const QCString& hostname_P )
+    {
+    if( !hostname_P.isNull())
+        d->hostname = hostname_P;
+    else
+        {
+        char tmp[ 256 ];
+        tmp[ 0 ] = '\0';
+        if (!gethostname( tmp, 255 ))
+            tmp[sizeof(tmp)-1] = '\0';
+        d->hostname = tmp;
+        }
+    }
+
+const QCString& KStartupInfoData::hostname() const
+    {
+    return d->hostname;
+    }
+
+void KStartupInfoData::addPid( pid_t pid_P )
+    {
+    if( !d->pids.contains( pid_P ))
+        d->pids.append( pid_P );
+    }
+
+void KStartupInfoData::remove_pid( pid_t pid_P )
+    {
+    d->pids.remove( pid_P );
+    }
+
+const QValueList< pid_t >& KStartupInfoData::pids() const
+    {
+    return d->pids;
+    }
+
+bool KStartupInfoData::is_pid( pid_t pid_P ) const
+    {
+    return d->pids.contains( pid_P );
+    }
+
+void KStartupInfoData::setSilent( TriState state_P )
+    {
+    d->silent = state_P;
+    }
+
+KStartupInfoData::TriState KStartupInfoData::silent() const
+    {
+    return d->silent;
+    }
+
+void KStartupInfoData::setTimestamp( unsigned long time )
+    {
+    d->timestamp = time;
+    }
+
+unsigned long KStartupInfoData::timestamp() const
+    {
+    return d->timestamp;
+    }
+
+static
+long get_num( const QString& item_P )
+    {
+    unsigned int pos = item_P.find( '=' );
+    return item_P.mid( pos + 1 ).toLong();
+    }
+
+static
+unsigned long get_unum( const QString& item_P )
+    {
+    unsigned int pos = item_P.find( '=' );
+    return item_P.mid( pos + 1 ).toULong();
+    }
+
+static
+QString get_str( const QString& item_P )
+    {
+    unsigned int pos = item_P.find( '=' );
+    if( item_P.length() > pos + 2 && item_P[ pos + 1 ] == '\"' )
+        {
+        int pos2 = item_P.left( pos + 2 ).find( '\"' );
+        if( pos2 < 0 )
+            return QString::null;
+        return item_P.mid( pos + 2, pos2 - 2 - pos );
+        }
+    return item_P.mid( pos + 1 );
+    }
+
+static
+QCString get_cstr( const QString& item_P )
+    {
+    return get_str( item_P ).latin1();
+    }
+
+static
+QStringList get_fields( const QString& txt_P )
+    {
+    QString txt = txt_P.simplifyWhiteSpace();
+    QStringList ret;
+    QString item = "";
+    bool in = false;
+    bool escape = false;
+    for( unsigned int pos = 0;
+         pos < txt.length();
+         ++pos )
+        {
+        if( escape )
+            {
+            item += txt[ pos ];
+            escape = false;
+            }
+        else if( txt[ pos ] == '\\' )
+            escape = true;
+        else if( txt[ pos ] == '\"' )
+            in = !in;
+        else if( txt[ pos ] == ' ' && !in )
+            {
+            ret.append( item );
+            item = "";
+            }
+        else
+            item += txt[ pos ];
+        }
+    ret.append( item );
+    return ret;
+    }
+
+static QString escape_str( const QString& str_P )
+    {
+    QString ret = "";
+    for( unsigned int pos = 0;
+         pos < str_P.length();
+         ++pos )
+        {
+        if( str_P[ pos ] == '\\'
+            || str_P[ pos ] == '"' )
+            ret += '\\';
+        ret += str_P[ pos ];
+        }
+    return ret;
+    }
+
+const char *KStartupInfo::className() const
+{
+    return "KStartupInfo";
+}
+
+QMetaObject *KStartupInfo::metaObj = 0;
+static QMetaObjectCleanUp cleanUp_KStartupInfo( "KStartupInfo", &KStartupInfo::staticMetaObject );
+QMetaObject* KStartupInfo::staticMetaObject()
+{
+    if ( metaObj )
+        return metaObj;
+    QMetaObject* parentObject = QObject::staticMetaObject();
+    static const QUMethod slot_0 = {"startups_cleanup", 0, 0 };
+    static const QUMethod slot_1 = {"startups_cleanup_no_age", 0, 0 };
+    static const QUParameter param_slot_2[] = {
+        { "msg", &static_QUType_QString, 0, QUParameter::In }
+    };
+    static const QUMethod slot_2 = {"got_message", 1, param_slot_2 };
+    static const QUParameter param_slot_3[] = {
+        { "w", &static_QUType_ptr, "WId", QUParameter::In }
+    };
+    static const QUMethod slot_3 = {"window_added", 1, param_slot_3 };
+    static const QUParameter param_slot_4[] = {
+        { "w", &static_QUType_ptr, "WId", QUParameter::In }
+    };
+    static const QUMethod slot_4 = {"slot_window_added", 1, param_slot_4 };
+    static const QMetaData slot_tbl[] = {
+        { "startups_cleanup()", &slot_0, QMetaData::Private },
+        { "startups_cleanup_no_age()", &slot_1, QMetaData::Private },
+        { "got_message(const QString&)", &slot_2, QMetaData::Private },
+        { "window_added(WId)", &slot_3, QMetaData::Private },
+        { "slot_window_added(WId)", &slot_4, QMetaData::Private }
+    };
+    static const QUParameter param_signal_0[] = {
+        { "id", &static_QUType_ptr, "KStartupInfoId", QUParameter::In },
+        { "data", &static_QUType_ptr, "KStartupInfoData", QUParameter::In }
+    };
+    static const QUMethod signal_0 = {"gotNewStartup", 2, param_signal_0 };
+    static const QUParameter param_signal_1[] = {
+        { "id", &static_QUType_ptr, "KStartupInfoId", QUParameter::In },
+        { "data", &static_QUType_ptr, "KStartupInfoData", QUParameter::In }
+    };
+    static const QUMethod signal_1 = {"gotStartupChange", 2, param_signal_1 };
+    static const QUParameter param_signal_2[] = {
+        { "id", &static_QUType_ptr, "KStartupInfoId", QUParameter::In },
+        { "data", &static_QUType_ptr, "KStartupInfoData", QUParameter::In }
+    };
+    static const QUMethod signal_2 = {"gotRemoveStartup", 2, param_signal_2 };
+    static const QMetaData signal_tbl[] = {
+        { "gotNewStartup(const KStartupInfoId&,const KStartupInfoData&)", &signal_0, QMetaData::Public },
+        { "gotStartupChange(const KStartupInfoId&,const KStartupInfoData&)", &signal_1, QMetaData::Public },
+        { "gotRemoveStartup(const KStartupInfoId&,const KStartupInfoData&)", &signal_2, QMetaData::Public }
+    };
+    metaObj = QMetaObject::new_metaobject(
+        "KStartupInfo", parentObject,
+        slot_tbl, 5,
+        signal_tbl, 3,
+
+        0, 0,
+        0, 0,
+
+        0, 0 );
+    cleanUp_KStartupInfo.setMetaObject( metaObj );
+    return metaObj;
+}
+
+void* KStartupInfo::qt_cast( const char* clname )
+{
+    if ( !qstrcmp( clname, "KStartupInfo" ) )
+        return this;
+    return QObject::qt_cast( clname );
+}
+
+
+
+
+
+void KStartupInfo::gotNewStartup( const KStartupInfoId& t0, const KStartupInfoData& t1 )
+{
+    if ( signalsBlocked() )
+        return;
+    QConnectionList *clist = receivers( staticMetaObject()->signalOffset() + 0 );
+    if ( !clist )
+        return;
+    QUObject o[3];
+    static_QUType_ptr.set(o+1,&t0);
+    static_QUType_ptr.set(o+2,&t1);
+    activate_signal( clist, o );
+}
+
+
+void KStartupInfo::gotStartupChange( const KStartupInfoId& t0, const KStartupInfoData& t1 )
+{
+    if ( signalsBlocked() )
+        return;
+    QConnectionList *clist = receivers( staticMetaObject()->signalOffset() + 1 );
+    if ( !clist )
+        return;
+    QUObject o[3];
+    static_QUType_ptr.set(o+1,&t0);
+    static_QUType_ptr.set(o+2,&t1);
+    activate_signal( clist, o );
+}
+
+
+void KStartupInfo::gotRemoveStartup( const KStartupInfoId& t0, const KStartupInfoData& t1 )
+{
+    if ( signalsBlocked() )
+        return;
+    QConnectionList *clist = receivers( staticMetaObject()->signalOffset() + 2 );
+    if ( !clist )
+        return;
+    QUObject o[3];
+    static_QUType_ptr.set(o+1,&t0);
+    static_QUType_ptr.set(o+2,&t1);
+    activate_signal( clist, o );
+}
+
+bool KStartupInfo::qt_invoke( int _id, QUObject* _o )
+{
+    switch ( _id - staticMetaObject()->slotOffset() ) {
+    case 0: startups_cleanup(); break;
+    case 1: startups_cleanup_no_age(); break;
+    case 2: got_message((const QString&)static_QUType_QString.get(_o+1)); break;
+    case 3: window_added((WId)(*((WId*)static_QUType_ptr.get(_o+1)))); break;
+    case 4: slot_window_added((WId)(*((WId*)static_QUType_ptr.get(_o+1)))); break;
+    default:
+        return QObject::qt_invoke( _id, _o );
+    }
+    return TRUE;
+}
+
+bool KStartupInfo::qt_emit( int _id, QUObject* _o )
+{
+    switch ( _id - staticMetaObject()->signalOffset() ) {
+    case 0: gotNewStartup((const KStartupInfoId&)*((const KStartupInfoId*)static_QUType_ptr.get(_o+1)),(const KStartupInfoData&)*((const KStartupInfoData*)static_QUType_ptr.get(_o+2))); break;
+    case 1: gotStartupChange((const KStartupInfoId&)*((const KStartupInfoId*)static_QUType_ptr.get(_o+1)),(const KStartupInfoData&)*((const KStartupInfoData*)static_QUType_ptr.get(_o+2))); break;
+    case 2: gotRemoveStartup((const KStartupInfoId&)*((const KStartupInfoId*)static_QUType_ptr.get(_o+1)),(const KStartupInfoData&)*((const KStartupInfoData*)static_QUType_ptr.get(_o+2))); break;
+    default:
+        return QObject::qt_emit(_id,_o);
+    }
+    return TRUE;
+}
+
+
+bool KStartupInfo::qt_property( int id, int f, QVariant* v)
+{
+    return QObject::qt_property( id, f, v);
+}
+
+bool KStartupInfo::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C"
+
+int mkstemps(char *, int);
+extern "C"
+
+unsigned long strlcat(char*, const char*, unsigned long);
+
+
+
+
+
+
+extern "C"
+
+unsigned long strlcpy(char*, const char*, unsigned long);
+
+
+
+
+
+
+
+
+
+
+
+char *k_nl_find_msg(struct kde_loaded_l10nfile *domain_file,
+               const char *msgid);
+void k_nl_unload_domain (struct loaded_domain *domain);
+class KCataloguePrivate
+{
+public:
+  QString name;
+
+  kde_loaded_l10nfile domain;
+};
+
+KCatalogue::KCatalogue(const QString & name)
+  : d( new KCataloguePrivate )
+{
+  d->name = name;
+}
+
+KCatalogue::KCatalogue(const KCatalogue & rhs)
+  : d( new KCataloguePrivate )
+{
+  *this = rhs;
+}
+
+KCatalogue & KCatalogue::operator=(const KCatalogue & rhs)
+{
+  d->name = rhs.d->name;
+  setFileName( rhs.fileName() );
+
+  return *this;
+}
+
+KCatalogue::~KCatalogue()
+{
+  doUnload();
+
+  delete d;
+}
+
+QString KCatalogue::name() const
+{
+  return d->name;
+}
+
+void KCatalogue::setFileName( const QString & fileName )
+{
+
+  if ( this->fileName() == fileName ) return;
+
+  doUnload();
+
+  QCString newFileName = QFile::encodeName( fileName );
+
+  if ( !fileName.isEmpty() )
+    {
+
+      char *filename = new char[ newFileName.length() + 1 ];
+      ::qstrcpy( filename, newFileName );
+      d->domain.filename = filename;
+    }
+}
+
+QString KCatalogue::fileName() const
+{
+  return QFile::decodeName( d->domain.filename );
+}
+
+const char * KCatalogue::translate(const char * msgid) const
+{
+  return ::k_nl_find_msg( &d->domain, msgid );
+}
+
+void KCatalogue::doUnload()
+{
+
+  if ( d->domain.data )
+    ::k_nl_unload_domain( (struct loaded_domain *)d->domain.data );
+  d->domain.data = 0;
+
+
+  delete [] const_cast<char *>(d->domain.filename);
+  d->domain.filename = 0;
+
+  d->domain.decided = 0;
+}
+void KAsyncIO::virtual_hook( int, void* )
+{ }
+
+const char *KAsyncIO::className() const
+{
+    return "KAsyncIO";
+}
+
+QMetaObject *KAsyncIO::metaObj = 0;
+static QMetaObjectCleanUp cleanUp_KAsyncIO( "KAsyncIO", &KAsyncIO::staticMetaObject );
+QMetaObject* KAsyncIO::staticMetaObject()
+{
+    if ( metaObj )
+        return metaObj;
+    QMetaObject* parentObject = QObject::staticMetaObject();
+    static const QUMethod signal_0 = {"readyRead", 0, 0 };
+    static const QUMethod signal_1 = {"readyWrite", 0, 0 };
+    static const QMetaData signal_tbl[] = {
+        { "readyRead()", &signal_0, QMetaData::Public },
+        { "readyWrite()", &signal_1, QMetaData::Public }
+    };
+    metaObj = QMetaObject::new_metaobject(
+        "KAsyncIO", parentObject,
+        0, 0,
+        signal_tbl, 2,
+
+        0, 0,
+        0, 0,
+
+        0, 0 );
+    cleanUp_KAsyncIO.setMetaObject( metaObj );
+    return metaObj;
+}
+
+void* KAsyncIO::qt_cast( const char* clname )
+{
+    if ( !qstrcmp( clname, "KAsyncIO" ) )
+        return this;
+    if ( !qstrcmp( clname, "QIODevice" ) )
+        return (QIODevice*)this;
+    return QObject::qt_cast( clname );
+}
+
+
+void KAsyncIO::readyRead()
+{
+    activate_signal( staticMetaObject()->signalOffset() + 0 );
+}
+
+
+void KAsyncIO::readyWrite()
+{
+    activate_signal( staticMetaObject()->signalOffset() + 1 );
+}
+
+bool KAsyncIO::qt_invoke( int _id, QUObject* _o )
+{
+    return QObject::qt_invoke(_id,_o);
+}
+
+bool KAsyncIO::qt_emit( int _id, QUObject* _o )
+{
+    switch ( _id - staticMetaObject()->signalOffset() ) {
+    case 0: readyRead(); break;
+    case 1: readyWrite(); break;
+    default:
+        return QObject::qt_emit(_id,_o);
+    }
+    return TRUE;
+}
+
+
+bool KAsyncIO::qt_property( int id, int f, QVariant* v)
+{
+    return QObject::qt_property( id, f, v);
+}
+
+bool KAsyncIO::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; }
+
+
+
+
+
+
+class KMultipleDragPrivate;
+class KMultipleDrag : public QDragObject
+{
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+
+public:
+
+
+
+
+
+
+    KMultipleDrag( QWidget *dragSource = 0L, const char *name = 0L );
+    void addDragObject( QDragObject *dragObject );
+
+protected:
+
+
+
+
+
+
+    virtual QByteArray encodedData( const char *mime ) const;
+
+
+
+
+
+
+    virtual const char* format( int i ) const;
+
+    QPtrList<QDragObject> m_dragObjects;
+    QValueList<int> m_numberFormats;
+protected:
+    virtual void virtual_hook( int id, void* data );
+private:
+    KMultipleDragPrivate* d;
+};
+
+
+
+
+KMultipleDrag::KMultipleDrag( QWidget *dragSource, const char *name )
+    : QDragObject( dragSource, name )
+{
+    m_dragObjects.setAutoDelete( true );
+}
+
+void KMultipleDrag::addDragObject( QDragObject *dragObject )
+{
+
+    m_dragObjects.append( dragObject );
+
+    int i = 0;
+    while ( dragObject->format( i ) )
+        ++i;
+    m_numberFormats.append( i );
+}
+
+QByteArray KMultipleDrag::encodedData( const char *mime ) const
+{
+
+
+    QPtrListIterator<QDragObject> it( m_dragObjects );
+    for ( ; it.current(); ++it )
+    {
+        for ( int i = 0; it.current()->format( i ); ++i )
+        {
+            if ( ::qstrcmp( it.current()->format( i ), mime ) == 0 )
+                return it.current()->encodedData( mime );
+        }
+    }
+    return QByteArray();
+}
+
+const char* KMultipleDrag::format( int i ) const
+{
+
+
+
+
+
+
+
+    QValueList<int>::ConstIterator nit = m_numberFormats.begin();
+    QValueList<int>::ConstIterator nend = m_numberFormats.end();
+    QPtrListIterator<QDragObject> it( m_dragObjects );
+    for ( ; nit != nend && i >= *nit ; ++nit, ++it )
+        i -= *nit;
+    if ( it.current() )
+        return it.current()->format( i );
+    return 0;
+}
+
+void KMultipleDrag::virtual_hook( int, void* )
+{ }
+
+const char *KMultipleDrag::className() const
+{
+    return "KMultipleDrag";
+}
+
+QMetaObject *KMultipleDrag::metaObj = 0;
+static QMetaObjectCleanUp cleanUp_KMultipleDrag( "KMultipleDrag", &KMultipleDrag::staticMetaObject );
+QMetaObject* KMultipleDrag::staticMetaObject()
+{
+    if ( metaObj )
+        return metaObj;
+    QMetaObject* parentObject = QDragObject::staticMetaObject();
+    metaObj = QMetaObject::new_metaobject(
+        "KMultipleDrag", parentObject,
+        0, 0,
+        0, 0,
+
+        0, 0,
+        0, 0,
+
+        0, 0 );
+    cleanUp_KMultipleDrag.setMetaObject( metaObj );
+    return metaObj;
+}
+
+void* KMultipleDrag::qt_cast( const char* clname )
+{
+    if ( !qstrcmp( clname, "KMultipleDrag" ) )
+        return this;
+    return QDragObject::qt_cast( clname );
+}
+
+bool KMultipleDrag::qt_invoke( int _id, QUObject* _o )
+{
+    return QDragObject::qt_invoke(_id,_o);
+}
+
+bool KMultipleDrag::qt_emit( int _id, QUObject* _o )
+{
+    return QDragObject::qt_emit(_id,_o);
+}
+
+
+bool KMultipleDrag::qt_property( int id, int f, QVariant* v)
+{
+    return QDragObject::qt_property( id, f, v);
+}
+
+bool KMultipleDrag::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; }
+
+
+
+
+
+
+void KStaticDeleterBase::destructObject()
+{
+}
+KAppDCOPInterface::KAppDCOPInterface(KApplication * theKApp)
+        : DCOPObject( "MainApplication-Interface")
+{
+        m_KApplication = theKApp;
+}
+
+KAppDCOPInterface::~KAppDCOPInterface()
+{
+}
+
+void KAppDCOPInterface::disableSessionManagement()
+{
+
+}
+
+QCString KAppDCOPInterface::startupId()
+{
+        return "";
+}
+
+QCString KAppDCOPInterface::caption()
+{
+        return "";
+}
+
+void KAppDCOPInterface::quit()
+{
+        m_KApplication->quit();
+}
+class KClipboardSynchronizer::MimeSource : public QMimeSource
+{
+public:
+    MimeSource( const QMimeSource * src )
+        : QMimeSource(),
+          m_formats( true )
+    {
+        m_formats.setAutoDelete( true );
+        m_data.setAutoDelete( true );
+
+        if ( src )
+        {
+            QByteArray *byteArray;
+            const char *format;
+            int i = 0;
+            while ( (format = src->format( i++ )) )
+            {
+                byteArray = new QByteArray();
+                *byteArray = src->encodedData( format ).copy();
+                m_data.append( byteArray );
+                m_formats.append( format );
+            }
+        }
+    }
+
+    ~MimeSource() {}
+
+    virtual const char *format( int i ) const {
+        if ( i < (int) m_formats.count() )
+            return m_formats.at( i );
+        else
+            return 0L;
+    }
+    virtual bool provides( const char *mimeType ) const {
+        return ( m_formats.find( mimeType ) > -1 );
+    }
+    virtual QByteArray encodedData( const char *format ) const
+    {
+        int index = m_formats.find( format );
+        if ( index > -1 )
+            return *(m_data.at( index ));
+
+        return QByteArray();
+    }
+
+private:
+    mutable QStrList m_formats;
+    mutable QPtrList<QByteArray> m_data;
+};
+
+
+KClipboardSynchronizer * KClipboardSynchronizer::s_self = 0L;
+bool KClipboardSynchronizer::s_sync = false;
+bool KClipboardSynchronizer::s_reverse_sync = false;
+bool KClipboardSynchronizer::s_blocked = false;
+
+KClipboardSynchronizer * KClipboardSynchronizer::self()
+{
+    if ( !s_self )
+        s_self = new KClipboardSynchronizer( KApplication::kApplication(), "KDE Clipboard" );
+
+    return s_self;
+}
+
+KClipboardSynchronizer::KClipboardSynchronizer( QObject *parent, const char *name )
+    : QObject( parent, name )
+{
+    s_self = this;
+
+    KConfigGroup config( KGlobal::config(), "General" );
+    s_sync = config.readBoolEntry( "SynchronizeClipboardAndSelection", s_sync);
+    s_reverse_sync = config.readBoolEntry( "ClipboardSetSelection",
+                                                s_reverse_sync );
+
+    setupSignals();
+}
+
+KClipboardSynchronizer::~KClipboardSynchronizer()
+{
+    if ( s_self == this )
+        s_self = 0L;
+}
+
+void KClipboardSynchronizer::setupSignals()
+{
+    QClipboard *clip = QApplication::clipboard();
+    disconnect( clip, __null, this, __null );
+    if( s_sync )
+        connect( clip, "2""selectionChanged()",
+                 "1""slotSelectionChanged()");
+    if( s_reverse_sync )
+        connect( clip, "2""dataChanged()",
+                 "1""slotClipboardChanged()");
+}
+
+void KClipboardSynchronizer::slotSelectionChanged()
+{
+    QClipboard *clip = QApplication::clipboard();
+
+
+    if ( s_blocked || !clip->ownsSelection() )
+        return;
+
+    setClipboard( new MimeSource( clip->data( QClipboard::Selection) ),
+                  QClipboard::Clipboard );
+}
+
+void KClipboardSynchronizer::slotClipboardChanged()
+{
+    QClipboard *clip = QApplication::clipboard();
+
+
+    if ( s_blocked || !clip->ownsClipboard() )
+        return;
+
+    setClipboard( new MimeSource( clip->data( QClipboard::Clipboard ) ),
+                  QClipboard::Selection );
+}
+
+void KClipboardSynchronizer::setClipboard( QMimeSource *data, QClipboard::Mode mode )
+{
+
+
+    QClipboard *clip = QApplication::clipboard();
+
+    s_blocked = true;
+
+    if ( mode == QClipboard::Clipboard )
+    {
+        clip->setData( data, QClipboard::Clipboard );
+    }
+    else if ( mode == QClipboard::Selection )
+    {
+        clip->setData( data, QClipboard::Selection );
+    }
+
+    s_blocked = false;
+}
+
+void KClipboardSynchronizer::setSynchronizing( bool sync )
+{
+    s_sync = sync;
+    self()->setupSignals();
+}
+
+void KClipboardSynchronizer::setReverseSynchronizing( bool enable )
+{
+    s_reverse_sync = enable;
+    self()->setupSignals();
+}
+
+
+void KClipboardSynchronizer::newConfiguration( int config )
+{
+    s_sync = (config & Synchronize);
+    self()->setupSignals();
+}
+
+const char *KClipboardSynchronizer::className() const
+{
+    return "KClipboardSynchronizer";
+}
+
+QMetaObject *KClipboardSynchronizer::metaObj = 0;
+static QMetaObjectCleanUp cleanUp_KClipboardSynchronizer( "KClipboardSynchronizer", &KClipboardSynchronizer::staticMetaObject );
+QMetaObject* KClipboardSynchronizer::staticMetaObject()
+{
+    if ( metaObj )
+        return metaObj;
+    QMetaObject* parentObject = QObject::staticMetaObject();
+    static const QUMethod slot_0 = {"slotSelectionChanged", 0, 0 };
+    static const QUMethod slot_1 = {"slotClipboardChanged", 0, 0 };
+    static const QMetaData slot_tbl[] = {
+        { "slotSelectionChanged()", &slot_0, QMetaData::Private },
+        { "slotClipboardChanged()", &slot_1, QMetaData::Private }
+    };
+    metaObj = QMetaObject::new_metaobject(
+        "KClipboardSynchronizer", parentObject,
+        slot_tbl, 2,
+        0, 0,
+
+        0, 0,
+        0, 0,
+
+        0, 0 );
+    cleanUp_KClipboardSynchronizer.setMetaObject( metaObj );
+    return metaObj;
+}
+
+void* KClipboardSynchronizer::qt_cast( const char* clname )
+{
+    if ( !qstrcmp( clname, "KClipboardSynchronizer" ) )
+        return this;
+    return QObject::qt_cast( clname );
+}
+
+bool KClipboardSynchronizer::qt_invoke( int _id, QUObject* _o )
+{
+    switch ( _id - staticMetaObject()->slotOffset() ) {
+    case 0: slotSelectionChanged(); break;
+    case 1: slotClipboardChanged(); break;
+    default:
+        return QObject::qt_invoke( _id, _o );
+    }
+    return TRUE;
+}
+
+bool KClipboardSynchronizer::qt_emit( int _id, QUObject* _o )
+{
+    return QObject::qt_emit(_id,_o);
+}
+
+
+bool KClipboardSynchronizer::qt_property( int id, int f, QVariant* v)
+{
+    return QObject::qt_property( id, f, v);
+}
+
+bool KClipboardSynchronizer::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C"
+
+int mkstemps(char *, int);
+extern "C"
+
+unsigned long strlcat(char*, const char*, unsigned long);
+
+
+
+
+
+
+extern "C"
+
+unsigned long strlcpy(char*, const char*, unsigned long);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+static const int QLAYOUTSIZE_MAX = 2147483647/256/16;
+
+class QGridLayoutBox;
+class QGridLayoutData;
+class QLayout;
+class QLayoutItem;
+struct QLayoutData;
+class QMenuBar;
+class QSpacerItem;
+class QWidget;
+
+class QGLayoutIterator : public QShared
+{
+public:
+    virtual ~QGLayoutIterator();
+    virtual QLayoutItem *next() = 0;
+    virtual QLayoutItem *current() = 0;
+    virtual QLayoutItem *takeCurrent() = 0;
+};
+
+class QLayoutIterator
+{
+public:
+    QLayoutIterator( QGLayoutIterator *i ) : it( i ) { }
+    QLayoutIterator( const QLayoutIterator &i ) : it( i.it ) {
+        if ( it )
+            it->ref();
+    }
+    ~QLayoutIterator() { if ( it && it->deref() ) delete it; }
+    QLayoutIterator &operator=( const QLayoutIterator &i ) {
+        if ( i.it )
+            i.it->ref();
+        if ( it && it->deref() )
+            delete it;
+        it = i.it;
+        return *this;
+    }
+    QLayoutItem *operator++() { return it ? it->next() : 0; }
+    QLayoutItem *current() { return it ? it->current() : 0; }
+    QLayoutItem *takeCurrent() { return it ? it->takeCurrent() : 0; }
+    void deleteCurrent();
+
+private:
+    QGLayoutIterator *it;
+};
+
+class QLayoutItem
+{
+public:
+    QLayoutItem( int alignment = 0 ) : align( alignment ) { }
+    virtual ~QLayoutItem();
+    virtual QSize sizeHint() const = 0;
+    virtual QSize minimumSize() const = 0;
+    virtual QSize maximumSize() const = 0;
+    virtual QSizePolicy::ExpandData expanding() const = 0;
+    virtual void setGeometry( const QRect& ) = 0;
+    virtual QRect geometry() const = 0;
+    virtual bool isEmpty() const = 0;
+    virtual bool hasHeightForWidth() const;
+    virtual int heightForWidth( int ) const;
+
+    virtual void invalidate();
+
+    virtual QWidget *widget();
+    virtual QLayoutIterator iterator();
+    virtual QLayout *layout();
+    virtual QSpacerItem *spacerItem();
+
+    int alignment() const { return align; }
+    virtual void setAlignment( int a );
+
+protected:
+    int align;
+};
+
+class QSpacerItem : public QLayoutItem
+{
+public:
+    QSpacerItem( int w, int h,
+                 QSizePolicy::SizeType hData = QSizePolicy::Minimum,
+                 QSizePolicy::SizeType vData = QSizePolicy::Minimum )
+        : width( w ), height( h ), sizeP( hData, vData ) { }
+    void changeSize( int w, int h,
+                     QSizePolicy::SizeType hData = QSizePolicy::Minimum,
+                     QSizePolicy::SizeType vData = QSizePolicy::Minimum );
+    QSize sizeHint() const;
+    QSize minimumSize() const;
+    QSize maximumSize() const;
+    QSizePolicy::ExpandData expanding() const;
+    bool isEmpty() const;
+    void setGeometry( const QRect& );
+    QRect geometry() const;
+    QSpacerItem *spacerItem();
+
+private:
+    int width;
+    int height;
+    QSizePolicy sizeP;
+    QRect rect;
+};
+
+class QWidgetItem : public QLayoutItem
+{
+public:
+    QWidgetItem( QWidget *w ) : wid( w ) { }
+    QSize sizeHint() const;
+    QSize minimumSize() const;
+    QSize maximumSize() const;
+    QSizePolicy::ExpandData expanding() const;
+    bool isEmpty() const;
+    void setGeometry( const QRect& );
+    QRect geometry() const;
+    virtual QWidget *widget();
+
+    bool hasHeightForWidth() const;
+    int heightForWidth( int ) const;
+
+private:
+    QWidget *wid;
+};
+
+class QLayout : public QObject, public QLayoutItem
+{
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+   
+   
+   
+   
+
+public:
+
+    enum ResizeMode { FreeResize, Minimum, Fixed, Auto };
+
+    QLayout( QWidget *parent, int margin = 0, int spacing = -1,
+             const char *name = 0 );
+    QLayout( QLayout *parentLayout, int spacing = -1, const char *name = 0 );
+    QLayout( int spacing = -1, const char *name = 0 );
+    ~QLayout();
+
+    int margin() const { return outsideBorder; }
+    int spacing() const { return insideSpacing; }
+
+    virtual void setMargin( int );
+    virtual void setSpacing( int );
+
+    int defaultBorder() const { return insideSpacing; }
+    void freeze( int w, int h );
+    void freeze() { setResizeMode( Fixed ); }
+
+    void setResizeMode( ResizeMode );
+    ResizeMode resizeMode() const;
+
+
+    virtual void setMenuBar( QMenuBar *w );
+    QMenuBar *menuBar() const { return menubar; }
+
+
+    QWidget *mainWidget();
+    bool isTopLevel() const { return topLevel; }
+
+    virtual void setAutoAdd( bool );
+    bool autoAdd() const { return autoNewChild; }
+
+    void invalidate();
+    QRect geometry() const;
+    bool activate();
+
+    void add( QWidget *w ) { addItem( new QWidgetItem(w) ); }
+    virtual void addItem( QLayoutItem * ) = 0;
+
+    void remove( QWidget *w );
+    void removeItem( QLayoutItem * );
+
+    QSizePolicy::ExpandData expanding() const;
+    QSize minimumSize() const;
+    QSize maximumSize() const;
+    void setGeometry( const QRect& ) = 0;
+    QLayoutIterator iterator() = 0;
+    bool isEmpty() const;
+
+    int totalHeightForWidth( int w ) const;
+    QSize totalMinimumSize() const;
+    QSize totalMaximumSize() const;
+    QSize totalSizeHint() const;
+    QLayout *layout();
+
+    bool supportsMargin() const { return marginImpl; }
+
+    void setEnabled( bool );
+    bool isEnabled() const;
+
+protected:
+    bool eventFilter( QObject *, QEvent * );
+    void childEvent( QChildEvent *e );
+    void addChildLayout( QLayout *l );
+    void deleteAllItems();
+
+    void setSupportsMargin( bool );
+    QRect alignmentRect( const QRect& ) const;
+
+private:
+    void setWidgetLayout( QWidget *, QLayout * );
+    void init();
+    int insideSpacing;
+    int outsideBorder;
+    uint topLevel : 1;
+    uint enabled : 1;
+    uint autoNewChild : 1;
+    uint frozen : 1;
+    uint activated : 1;
+    uint marginImpl : 1;
+    uint autoMinimum : 1;
+    uint autoResizeMode : 1;
+    QRect rect;
+    QLayoutData *extraData;
+
+    QMenuBar *menubar;
+
+
+private:
+
+    QLayout( const QLayout & );
+    QLayout &operator=( const QLayout & );
+
+
+    static void propagateSpacing( QLayout *layout );
+};
+
+inline void QLayoutIterator::deleteCurrent()
+{
+    delete takeCurrent();
+}
+
+class QGridLayout : public QLayout
+{
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+public:
+    QGridLayout( QWidget *parent, int nRows = 1, int nCols = 1, int border = 0,
+                 int spacing = -1, const char *name = 0 );
+    QGridLayout( int nRows = 1, int nCols = 1, int spacing = -1,
+                 const char *name = 0 );
+    QGridLayout( QLayout *parentLayout, int nRows = 1, int nCols = 1,
+                 int spacing = -1, const char *name = 0 );
+    ~QGridLayout();
+
+    QSize sizeHint() const;
+    QSize minimumSize() const;
+    QSize maximumSize() const;
+
+
+    virtual void setRowStretch( int row, int stretch );
+    virtual void setColStretch( int col, int stretch );
+    int rowStretch( int row ) const;
+    int colStretch( int col ) const;
+
+    void setRowSpacing( int row, int minSize );
+    void setColSpacing( int col, int minSize );
+    int rowSpacing( int row ) const;
+    int colSpacing( int col ) const;
+
+    int numRows() const;
+    int numCols() const;
+    QRect cellGeometry( int row, int col ) const;
+
+    bool hasHeightForWidth() const;
+    int heightForWidth( int ) const;
+    int minimumHeightForWidth( int ) const;
+
+    QSizePolicy::ExpandData expanding() const;
+    void invalidate();
+
+    void addItem( QLayoutItem * );
+    void addItem( QLayoutItem *item, int row, int col );
+    void addMultiCell( QLayoutItem *, int fromRow, int toRow,
+                               int fromCol, int toCol, int align = 0 );
+
+    void addWidget( QWidget *, int row, int col, int align = 0 );
+    void addMultiCellWidget( QWidget *, int fromRow, int toRow,
+                             int fromCol, int toCol, int align = 0 );
+    void addLayout( QLayout *layout, int row, int col);
+    void addMultiCellLayout( QLayout *layout, int fromRow, int toRow,
+                             int fromCol, int toCol, int align = 0 );
+    void addRowSpacing( int row, int minsize );
+    void addColSpacing( int col, int minsize );
+
+    void expand( int rows, int cols );
+
+    enum Corner { TopLeft, TopRight, BottomLeft, BottomRight };
+    void setOrigin( Corner );
+    Corner origin() const;
+    QLayoutIterator iterator();
+    void setGeometry( const QRect& );
+
+protected:
+    bool findWidget( QWidget* w, int *r, int *c );
+    void add( QLayoutItem*, int row, int col );
+
+private:
+
+    QGridLayout( const QGridLayout & );
+    QGridLayout &operator=( const QGridLayout & );
+
+
+    void init( int rows, int cols );
+    QGridLayoutData *data;
+};
+
+class QBoxLayoutData;
+class QDockWindow;
+
+class QBoxLayout : public QLayout
+{
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+public:
+    enum Direction { LeftToRight, RightToLeft, TopToBottom, BottomToTop,
+                     Down = TopToBottom, Up = BottomToTop };
+
+    QBoxLayout( QWidget *parent, Direction, int border = 0, int spacing = -1,
+                const char *name = 0 );
+    QBoxLayout( QLayout *parentLayout, Direction, int spacing = -1,
+                const char *name = 0 );
+    QBoxLayout( Direction, int spacing = -1, const char *name = 0 );
+    ~QBoxLayout();
+
+    void addItem( QLayoutItem * );
+
+    Direction direction() const { return dir; }
+    void setDirection( Direction );
+
+    void addSpacing( int size );
+    void addStretch( int stretch = 0 );
+    void addWidget( QWidget *, int stretch = 0, int alignment = 0 );
+    void addLayout( QLayout *layout, int stretch = 0 );
+    void addStrut( int );
+
+    void insertSpacing( int index, int size );
+    void insertStretch( int index, int stretch = 0 );
+    void insertWidget( int index, QWidget *widget, int stretch = 0,
+                       int alignment = 0 );
+    void insertLayout( int index, QLayout *layout, int stretch = 0 );
+
+    bool setStretchFactor( QWidget*, int stretch );
+    bool setStretchFactor( QLayout *l, int stretch );
+
+    QSize sizeHint() const;
+    QSize minimumSize() const;
+    QSize maximumSize() const;
+
+    bool hasHeightForWidth() const;
+    int heightForWidth( int ) const;
+    int minimumHeightForWidth( int ) const;
+
+    QSizePolicy::ExpandData expanding() const;
+    void invalidate();
+    QLayoutIterator iterator();
+    void setGeometry( const QRect& );
+
+    int findWidget( QWidget* w );
+
+protected:
+    void insertItem( int index, QLayoutItem * );
+
+private:
+    friend class QDockWindow;
+
+    QBoxLayout( const QBoxLayout & );
+    QBoxLayout &operator=( const QBoxLayout & );
+
+
+    void setupGeom();
+    void calcHfw( int );
+    QBoxLayoutData *data;
+    Direction dir;
+    QBoxLayout *createTmpCopy();
+};
+
+class QHBoxLayout : public QBoxLayout
+{
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+public:
+    QHBoxLayout( QWidget *parent, int border = 0,
+                 int spacing = -1, const char *name = 0 );
+    QHBoxLayout( QLayout *parentLayout,
+                 int spacing = -1, const char *name = 0 );
+    QHBoxLayout( int spacing = -1, const char *name = 0 );
+
+    ~QHBoxLayout();
+
+private:
+
+    QHBoxLayout( const QHBoxLayout & );
+    QHBoxLayout &operator=( const QHBoxLayout & );
+
+};
+
+class QVBoxLayout : public QBoxLayout
+{
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+public:
+    QVBoxLayout( QWidget *parent, int border = 0,
+                 int spacing = -1, const char *name = 0 );
+    QVBoxLayout( QLayout *parentLayout,
+                 int spacing = -1, const char *name = 0 );
+    QVBoxLayout( int spacing = -1, const char *name = 0 );
+
+    ~QVBoxLayout();
+
+private:
+
+    QVBoxLayout( const QVBoxLayout & );
+    QVBoxLayout &operator=( const QVBoxLayout & );
+
+};
+
+
+
+
+
+
+
+class QTextView : public QTextEdit
+{
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+   
+   
+   
+   
+   
+
+public:
+    QTextView( const QString& text, const QString& context = QString::null,
+               QWidget* parent=0, const char* name=0);
+    QTextView( QWidget* parent=0, const char* name=0 );
+
+    virtual ~QTextView();
+
+private:
+
+    QTextView( const QTextView & );
+    QTextView &operator=( const QTextView & );
+
+};
+
+
+
+
+
+class QButtonGroup;
+class QToolBar;
+class QButtonData;
+
+class QButton : public QWidget
+{
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+
+public:
+    QButton( QWidget* parent=0, const char* name=0, WFlags f=0 );
+    ~QButton();
+
+    QString text() const;
+    virtual void setText( const QString &);
+    const QPixmap *pixmap() const;
+    virtual void setPixmap( const QPixmap & );
+
+
+    QKeySequence accel() const;
+    virtual void setAccel( const QKeySequence& );
+
+
+    bool isToggleButton() const;
+
+    enum ToggleType { SingleShot, Toggle, Tristate };
+    ToggleType toggleType() const;
+
+    virtual void setDown( bool );
+    bool isDown() const;
+
+    bool isOn() const;
+
+    enum ToggleState { Off, NoChange, On };
+    ToggleState state() const;
+
+
+    bool autoResize() const;
+    void setAutoResize( bool );
+
+
+    bool autoRepeat() const;
+    virtual void setAutoRepeat( bool );
+    bool isExclusiveToggle() const;
+
+    QButtonGroup *group() const;
+
+public :
+    void animateClick();
+    void toggle();
+
+protected:
+    void pressed();
+    void released();
+    void clicked();
+    void toggled( bool );
+    void stateChanged( int );
+
+protected:
+    void setToggleButton( bool );
+    virtual void setToggleType( ToggleType );
+    void setOn( bool );
+    virtual void setState( ToggleState );
+
+    virtual bool hitButton( const QPoint &pos ) const;
+    virtual void drawButton( QPainter * );
+    virtual void drawButtonLabel( QPainter * );
+
+    void keyPressEvent( QKeyEvent *);
+    void keyReleaseEvent( QKeyEvent *);
+    void mousePressEvent( QMouseEvent * );
+    void mouseReleaseEvent( QMouseEvent * );
+    void mouseMoveEvent( QMouseEvent * );
+    void paintEvent( QPaintEvent * );
+    void focusInEvent( QFocusEvent * );
+    void focusOutEvent( QFocusEvent * );
+
+    void enabledChange( bool );
+
+private :
+    void animateTimeout();
+    void autoRepeatTimeout();
+    void emulateClick();
+
+private:
+    QString btext;
+    QPixmap *bpixmap;
+    uint toggleTyp : 2;
+    uint buttonDown : 1;
+    uint stat : 2;
+    uint mlbDown : 1;
+    uint autoresize : 1;
+    uint animation : 1;
+    uint repeat : 1;
+    QButtonData *d;
+
+    friend class QButtonGroup;
+    friend class QToolBar;
+    void ensureData();
+    virtual void setGroup( QButtonGroup* );
+    QTimer *timer();
+    void nextState();
+
+private:
+
+    QButton( const QButton & );
+    QButton &operator=( const QButton & );
+
+};
+
+
+inline QString QButton::text() const
+{
+    return btext;
+}
+
+inline const QPixmap *QButton::pixmap() const
+{
+    return bpixmap;
+}
+
+inline bool QButton::isToggleButton() const
+{
+    return toggleTyp != SingleShot;
+}
+
+inline bool QButton::isDown() const
+{
+    return buttonDown;
+}
+
+inline bool QButton::isOn() const
+{
+    return stat != Off;
+}
+
+
+inline bool QButton::autoResize() const
+{
+    return autoresize;
+}
+
+
+inline bool QButton::autoRepeat() const
+{
+    return repeat;
+}
+
+inline QButton::ToggleState QButton::state() const
+{
+    return ToggleState(stat);
+}
+
+inline void QButton::setToggleButton( bool b )
+{
+    setToggleType( b ? Toggle : SingleShot );
+}
+
+inline void QButton::setOn( bool y )
+{
+    setState( y ? On : Off );
+}
+
+inline QButton::ToggleType QButton::toggleType() const
+{
+    return ToggleType(toggleTyp);
+}
+
+
+
+
+class QPushButtonPrivate;
+class QPopupMenu;
+
+class QPushButton : public QButton
+{
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+
+   
+   
+   
+   
+   
+   
+   
+   
+
+public:
+    QPushButton( QWidget *parent, const char* name=0 );
+    QPushButton( const QString &text, QWidget *parent, const char* name=0 );
+
+    QPushButton( const QIconSet& icon, const QString &text, QWidget *parent, const char* name=0 );
+
+    ~QPushButton();
+
+    QSize sizeHint() const;
+
+    void move( int x, int y );
+    void move( const QPoint &p );
+    void resize( int w, int h );
+    void resize( const QSize & );
+    void setGeometry( int x, int y, int w, int h );
+
+    void setGeometry( const QRect & );
+
+    void setToggleButton( bool );
+
+    bool autoDefault() const { return autoDefButton; }
+    virtual void setAutoDefault( bool autoDef );
+    bool isDefault() const { return defButton; }
+    virtual void setDefault( bool def );
+
+    virtual void setIsMenuButton( bool enable ) {
+        if ( (bool)hasMenuArrow == enable )
+            return;
+        hasMenuArrow = enable ? 1 : 0;
+        update();
+        updateGeometry();
+    }
+    bool isMenuButton() const { return hasMenuArrow; }
+
+
+    void setPopup( QPopupMenu* popup );
+    QPopupMenu* popup() const;
+
+
+    void setIconSet( const QIconSet& );
+    QIconSet* iconSet() const;
+
+    void setFlat( bool );
+    bool isFlat() const;
+
+public :
+    virtual void setOn( bool );
+
+protected:
+    void drawButton( QPainter * );
+    void drawButtonLabel( QPainter * );
+    void focusInEvent( QFocusEvent * );
+    void focusOutEvent( QFocusEvent * );
+    void resizeEvent( QResizeEvent * );
+    void updateMask();
+private :
+
+    void popupPressed();
+
+private:
+    void init();
+
+    uint autoDefButton : 1;
+    uint defButton : 1;
+    uint flt : 1;
+    uint reserved : 1;
+    uint lastEnabled : 1;
+    uint hasMenuArrow : 1;
+
+    QPushButtonPrivate* d;
+
+    friend class QDialog;
+
+private:
+
+    QPushButton( const QPushButton & );
+    QPushButton &operator=( const QPushButton & );
+
+};
+
+
+
+
+
+
+
+
+class QCheckBox : public QButton
+{
+    public: virtual QMetaObject *metaObject() const { return staticMetaObject(); } virtual const char *className() const; virtual void* qt_cast( const char* ); virtual bool qt_invoke( int, QUObject* ); virtual bool qt_emit( int, QUObject* ); virtual bool qt_property( int id, int f, QVariant* v); static bool qt_static_property( QObject* , int, int, QVariant* ); static QMetaObject* staticMetaObject(); QObject* qObject() { return (QObject*)this; } static QString tr( const char *, const char * = 0 ); static QString trUtf8( const char *, const char * = 0 ); private: static QMetaObject *metaObj;
+   
+   
+   
+
+public:
+    QCheckBox( QWidget *parent, const char* name=0 );
+    QCheckBox( const QString &text, QWidget *parent, const char* name=0 );
+
+    bool isChecked() const;
+
+    void setNoChange();
+
+    void setTristate(bool y=TRUE);
+    bool isTristate() const;
+
+    QSize sizeHint() const;
+
+public :
+    void setChecked( bool check );
+
+protected:
+    void resizeEvent( QResizeEvent* );
+    void drawButton( QPainter * );
+    void drawButtonLabel( QPainter * );
+    void updateMask();
+    bool hitButton( const QPoint &pos ) const;
+private:
+
+    QCheckBox( const QCheckBox & );
+    QCheckBox &operator=( const QCheckBox & );
+
+};
+
+
+inline bool QCheckBox::isChecked() const
+{ return isOn(); }
+
+inline void QCheckBox::setChecked( bool check )
+{ setOn( check ); }
+KCheckAccelerators::KCheckAccelerators( QObject* parent )
+    : QObject( parent, "kapp_accel_filter" ), block( false ), drklash(0)
+{
+    parent->installEventFilter( this );
+    KConfigGroupSaver saver( KGlobal::config(), "Development" );
+    QString sKey = KGlobal::config()->readEntry( "CheckAccelerators", "F12" ).stripWhiteSpace();
+    if( !sKey.isEmpty() ) {
+      KShortcut cuts( sKey );
+      if( cuts.count() > 0 )
+        key = int(cuts.seq(0).qt());
+    }
+    alwaysShow = KGlobal::config()->readBoolEntry( "AlwaysShowCheckAccelerators", true );
+    autoCheck = KGlobal::config()->readBoolEntry( "AutoCheckAccelerators", true );
+    connect( &autoCheckTimer, "2""timeout()", "1""autoCheckSlot()");
+}
+
+bool KCheckAccelerators::eventFilter( QObject * , QEvent * e) {
+    if ( block )
+        return false;
+    if ( e->type() == QEvent::Accel ) {
+        if ( static_cast<QKeyEvent *>(e)->key() == key ) {
+            block = true;
+            checkAccelerators( false );
+            block = false;
+            static_cast<QKeyEvent *>(e)->accept();
+            return true;
+        }
+    }
+    if( autoCheck
+        && ( e->type() == QEvent::ChildInserted ||
+             e->type() == QEvent::ChildRemoved ))
+    {
+        autoCheckTimer.start( 100, true );
+    }
+    return false;
+}
+
+void KCheckAccelerators::autoCheckSlot()
+{
+    if( block || QWidget::mouseGrabber() ||
+        QWidget::keyboardGrabber() ||
+        QApplication::activePopupWidget())
+    {
+        autoCheckTimer.start( 100, true );
+        return;
+    }
+    block = true;
+    checkAccelerators( true );
+    block = false;
+}
+
+void KCheckAccelerators::createDialog(QWidget *actWin, bool automatic)
+{
+    if ( drklash )
+        return;
+
+    drklash = new QDialog( actWin, "kapp_accel_check_dlg", false, Qt::WDestructiveClose);
+    drklash->setCaption( i18n( "Dr. Klash' Accelerator Diagnosis" ));
+    drklash->resize( 500, 460 );
+    QVBoxLayout* layout = new QVBoxLayout( drklash, 11, 6 );
+    layout->setAutoAdd( TRUE );
+    drklash_view = new QTextView( drklash );
+    QCheckBox* disableAutoCheck = __null;
+    if( automatic ) {
+        disableAutoCheck = new QCheckBox( i18n( "&Disable automatic checking" ), drklash );
+        connect(disableAutoCheck, "2""toggled(bool)", "1""slotDisableCheck(bool)");
+    }
+    QPushButton* btnClose = new QPushButton( i18n( "&Close" ), drklash );
+    btnClose->setDefault( true );
+    connect( btnClose, "2""clicked()", drklash, "1""close()" );
+    if (disableAutoCheck)
+        disableAutoCheck->setFocus();
+    else
+        drklash_view->setFocus();
+}
+
+void KCheckAccelerators::slotDisableCheck(bool on)
+{
+    autoCheck = !on;
+    if (!on)
+        autoCheckSlot();
+}
+
+void KCheckAccelerators::checkAccelerators( bool automatic ) {
+    QWidget* actWin = qApp->activeWindow();
+    if ( !actWin )
+        return;
+
+    KAcceleratorManager::manage(actWin);
+    QString a, c, r;
+    KAcceleratorManager::last_manage(a, c, r);
+    if (c.isEmpty() && r.isEmpty() && (automatic || a.isEmpty()))
+        return;
+
+    QString s;
+
+    if ( ! c.isEmpty() ) {
+        s += i18n("<h2>Accelerators changed</h2>");
+        s += "<table border><tr><th><b>Old Text</b></th><th><b>New Text</b></th></tr>"
+             + c + "</table>";
+    }
+
+    if ( ! r.isEmpty() ) {
+        s += i18n("<h2>Accelerators removed</h2>");
+        s += "<table border><tr><th><b>Old Text</b></th></tr>" + r + "</table>";
+    }
+
+    if ( ! a.isEmpty() ) {
+        s += i18n("<h2>Accelerators added (just for your info)</h2>");
+        s += "<table border><tr><th><b>New Text</b></th></tr>" + a + "</table>";
+    }
+
+    createDialog(actWin, automatic);
+    drklash_view->setText(s);
+    drklash->show();
+    drklash->raise();
+
+
+}
+
+const char *KCheckAccelerators::className() const
+{
+    return "KCheckAccelerators";
+}
+
+QMetaObject *KCheckAccelerators::metaObj = 0;
+static QMetaObjectCleanUp cleanUp_KCheckAccelerators( "KCheckAccelerators", &KCheckAccelerators::staticMetaObject );
+QMetaObject* KCheckAccelerators::staticMetaObject()
+{
+    if ( metaObj )
+        return metaObj;
+    QMetaObject* parentObject = QObject::staticMetaObject();
+    static const QUMethod slot_0 = {"autoCheckSlot", 0, 0 };
+    static const QUParameter param_slot_1[] = {
+        { 0, &static_QUType_bool, 0, QUParameter::In }
+    };
+    static const QUMethod slot_1 = {"slotDisableCheck", 1, param_slot_1 };
+    static const QMetaData slot_tbl[] = {
+        { "autoCheckSlot()", &slot_0, QMetaData::Private },
+        { "slotDisableCheck(bool)", &slot_1, QMetaData::Private }
+    };
+    metaObj = QMetaObject::new_metaobject(
+        "KCheckAccelerators", parentObject,
+        slot_tbl, 2,
+        0, 0,
+
+        0, 0,
+        0, 0,
+
+        0, 0 );
+    cleanUp_KCheckAccelerators.setMetaObject( metaObj );
+    return metaObj;
+}
+
+void* KCheckAccelerators::qt_cast( const char* clname )
+{
+    if ( !qstrcmp( clname, "KCheckAccelerators" ) )
+        return this;
+    return QObject::qt_cast( clname );
+}
+
+bool KCheckAccelerators::qt_invoke( int _id, QUObject* _o )
+{
+    switch ( _id - staticMetaObject()->slotOffset() ) {
+    case 0: autoCheckSlot(); break;
+    case 1: slotDisableCheck((bool)static_QUType_bool.get(_o+1)); break;
+    default:
+        return QObject::qt_invoke( _id, _o );
+    }
+    return TRUE;
+}
+
+bool KCheckAccelerators::qt_emit( int _id, QUObject* _o )
+{
+    return QObject::qt_emit(_id,_o);
+}
+
+
+bool KCheckAccelerators::qt_property( int id, int f, QVariant* v)
+{
+    return QObject::qt_property( id, f, v);
+}
+
+bool KCheckAccelerators::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; }
+unsigned int KDE::version()
+{
+    return (((3) << 16) | ((1) << 8) | (90));
+}
+
+unsigned int KDE::versionMajor()
+{
+    return 3;
+}
+
+unsigned int KDE::versionMinor()
+{
+    return 1;
+}
+
+unsigned int KDE::versionRelease()
+{
+    return 90;
+}
+
+const char *KDE::versionString()
+{
+    return "3.1.90 (CVS >= 20030827)";
+}
+KDebugDCOPIface::KDebugDCOPIface() : DCOPObject("KDebug")
+{
+}
+
+KDebugDCOPIface::~KDebugDCOPIface()
+{
+}
+
+void KDebugDCOPIface::notifyKDebugConfigChanged()
+{
+ kdClearDebugConfig();
+}
+class KCalendarSystemPrivate
+{
+public:
+  const KLocale * locale;
+};
+
+KCalendarSystem::KCalendarSystem(const KLocale * locale)
+  : d(new KCalendarSystemPrivate)
+{
+  d->locale = locale;
+}
+
+KCalendarSystem::~KCalendarSystem()
+{
+  delete d;
+}
+
+const KLocale * KCalendarSystem::locale() const
+{
+  if ( d->locale )
+    return d->locale;
+
+  return KGlobal::locale();
+}
+
+QString KCalendarSystem::dayString(const QDate & pDate, bool bShort) const
+{
+  QString sResult;
+
+  sResult.setNum(day(pDate));
+  if (!bShort && sResult.length() == 1 )
+    sResult.prepend('0');
+
+  return sResult;
+}
+
+QString KCalendarSystem::monthString(const QDate & pDate, bool bShort) const
+{
+  QString sResult;
+
+  sResult.setNum(month(pDate));
+  if (!bShort && sResult.length() == 1 )
+    sResult.prepend('0');
+
+  return sResult;
+}
+
+QString KCalendarSystem::yearString(const QDate & pDate, bool bShort) const
+{
+  QString sResult;
+
+  sResult.setNum(year(pDate));
+  if (!bShort && sResult.length() == 1 )
+    sResult.prepend('0');
+
+  return sResult;
+}
+
+static int stringToInteger(const QString & sNum, int & iLength)
+{
+  int iPos = 0;
+
+  int result = 0;
+  for (; sNum.length() > iPos && sNum.at(iPos).isDigit(); iPos++)
+    {
+      result *= 10;
+      result += sNum.at(iPos).digitValue();
+    }
+
+  iLength = iPos;
+  return result;
+}
+
+
+int KCalendarSystem::dayStringToInteger(const QString & sNum, int & iLength) const
+{
+  return stringToInteger(sNum, iLength);
+}
+
+int KCalendarSystem::monthStringToInteger(const QString & sNum, int & iLength) const
+{
+  return stringToInteger(sNum, iLength);
+}
+
+int KCalendarSystem::yearStringToInteger(const QString & sNum, int & iLength) const
+{
+  return stringToInteger(sNum, iLength);
+}
+
+
+
+
+
+
+class KCalendarSystemGregorianPrivate;
+class KCalendarSystemGregorian: public KCalendarSystem
+{
+public:
+  KCalendarSystemGregorian (const KLocale * locale = 0);
+  virtual ~KCalendarSystemGregorian ();
+
+  virtual int year (const QDate & date) const;
+  virtual int month (const QDate & date) const;
+  virtual int day (const QDate & date) const;
+  virtual int dayOfWeek (const QDate & date) const;
+  virtual int dayOfYear (const QDate & date) const;
+
+  virtual bool setYMD(QDate & date, int y, int m, int d) const;
+
+  virtual QDate addYears(const QDate & date, int nyears) const;
+  virtual QDate addMonths(const QDate & date, int nmonths) const;
+  virtual QDate addDays(const QDate & date, int ndays) const;
+
+  virtual int monthsInYear (const QDate & date) const;
+
+  virtual int daysInYear (const QDate & date) const;
+  virtual int daysInMonth (const QDate & date) const;
+  virtual int weeksInYear(int year) const;
+  virtual int weekNumber(const QDate& date, int * yearNum = 0) const;
+
+  virtual int yearStringToInteger(const QString & sNum, int & iLength) const;
+
+  virtual QString yearLiteral (int year) const;
+  virtual QString yearLiteral (const QDate & date) const;
+  virtual QString monthName (int month, int year, bool shortName = false) const;
+  virtual QString monthName (const QDate & date, bool shortName = false ) const;
+  virtual QString monthNamePossessive(int month, int year, bool shortName = false) const;
+  virtual QString monthNamePossessive(const QDate & date, bool shortName = false ) const;
+  virtual QString weekDayName (int weekDay, bool shortName = false) const;
+  virtual QString weekDayName (const QDate & date, bool shortName = false) const;
+
+  virtual int minValidYear () const;
+  virtual int maxValidYear () const;
+  virtual int weekDayOfPray () const;
+
+  virtual QString calendarName() const;
+
+  virtual bool isLunar() const;
+  virtual bool isLunisolar() const;
+  virtual bool isSolar() const;
+
+private:
+  KCalendarSystemGregorianPrivate * d;
+};
+
+KCalendarSystemGregorian::KCalendarSystemGregorian(const KLocale * locale)
+  : KCalendarSystem(locale)
+{
+  kdDebug(5400) << "\nCreated gregorian calendar" << endl;
+}
+
+KCalendarSystemGregorian::~KCalendarSystemGregorian()
+{
+}
+
+int KCalendarSystemGregorian::year(const QDate& date) const
+{
+  kdDebug(5400) << "Gregorian year..." << endl;
+  return date.year();
+}
+
+int KCalendarSystemGregorian::monthsInYear( const QDate & date ) const
+{
+  (void)date;
+
+  kdDebug(5400) << "Gregorian monthsInYear" << endl;
+
+  return 12;
+}
+
+int KCalendarSystemGregorian::weeksInYear(int year) const
+{
+  QDate temp;
+  temp.setYMD(year, 12, 31);
+
+
+
+  if ( temp.weekNumber() == 1 )
+    temp = temp.addDays(-7);
+
+  return temp.weekNumber();
+}
+
+int KCalendarSystemGregorian::weekNumber(const QDate& date,
+                                         int * yearNum) const
+{
+  return date.weekNumber(yearNum);
+}
+
+QString KCalendarSystemGregorian::monthName(const QDate& date,
+                                            bool shortName) const
+{
+  return monthName(month(date), shortName);
+}
+
+QString KCalendarSystemGregorian::monthNamePossessive(const QDate& date, bool shortName) const
+{
+  return monthNamePossessive(month(date), shortName);
+}
+
+QString KCalendarSystemGregorian::monthName(int month, int year, bool shortName) const
+{
+  kdDebug(5400) << "Gregorian getMonthName" << endl;
+  (void)year;;
+
+  if ( shortName )
+    switch ( month )
+      {
+      case 1:
+        return locale()->translate("January", "Jan");
+      case 2:
+        return locale()->translate("February", "Feb");
+      case 3:
+        return locale()->translate("March", "Mar");
+      case 4:
+        return locale()->translate("April", "Apr");
+      case 5:
+        return locale()->translate("May short", "May");
+      case 6:
+        return locale()->translate("June", "Jun");
+      case 7:
+        return locale()->translate("July", "Jul");
+      case 8:
+        return locale()->translate("August", "Aug");
+      case 9:
+        return locale()->translate("September", "Sep");
+      case 10:
+        return locale()->translate("October", "Oct");
+      case 11:
+        return locale()->translate("November", "Nov");
+      case 12:
+        return locale()->translate("December", "Dec");
+      }
+  else
+    switch ( month )
+      {
+      case 1:
+        return locale()->translate("January");
+      case 2:
+        return locale()->translate("February");
+      case 3:
+        return locale()->translate("March");
+      case 4:
+        return locale()->translate("April");
+      case 5:
+        return locale()->translate("May long", "May");
+      case 6:
+        return locale()->translate("June");
+      case 7:
+        return locale()->translate("July");
+      case 8:
+        return locale()->translate("August");
+      case 9:
+        return locale()->translate("September");
+      case 10:
+        return locale()->translate("October");
+      case 11:
+        return locale()->translate("November");
+      case 12:
+        return locale()->translate("December");
+      }
+
+  return QString::null;
+}
+
+QString KCalendarSystemGregorian::monthNamePossessive(int month, int year,
+                                                      bool shortName) const
+{
+  kdDebug(5400) << "Gregorian getMonthName" << endl;
+  (void)year;;
+
+  if ( shortName )
+    switch ( month )
+      {
+      case 1:
+        return locale()->translate("of January", "of Jan");
+      case 2:
+        return locale()->translate("of February", "of Feb");
+      case 3:
+        return locale()->translate("of March", "of Mar");
+      case 4:
+        return locale()->translate("of April", "of Apr");
+      case 5:
+        return locale()->translate("of May short", "of May");
+      case 6:
+        return locale()->translate("of June", "of Jun");
+      case 7:
+        return locale()->translate("of July", "of Jul");
+      case 8:
+        return locale()->translate("of August", "of Aug");
+      case 9:
+        return locale()->translate("of September", "of Sep");
+      case 10:
+        return locale()->translate("of October", "of Oct");
+      case 11:
+       return locale()->translate("of November", "of Nov");
+      case 12:
+        return locale()->translate("of December", "of Dec");
+      }
+  else
+    switch ( month )
+      {
+      case 1:
+        return locale()->translate("of January");
+      case 2:
+        return locale()->translate("of February");
+      case 3:
+        return locale()->translate("of March");
+      case 4:
+        return locale()->translate("of April");
+      case 5:
+        return locale()->translate("of May long", "of May");
+      case 6:
+        return locale()->translate("of June");
+      case 7:
+        return locale()->translate("of July");
+      case 8:
+        return locale()->translate("of August");
+      case 9:
+        return locale()->translate("of September");
+      case 10:
+        return locale()->translate("of October");
+      case 11:
+        return locale()->translate("of November");
+      case 12:
+        return locale()->translate("of December");
+      }
+
+  return QString::null;
+}
+
+bool KCalendarSystemGregorian::setYMD(QDate & date, int y, int m, int d) const
+{
+
+  if ( y >= 0 && y <= 99 )
+    return false;
+
+
+  return date.setYMD(y, m, d);
+}
+
+QDate KCalendarSystemGregorian::addYears(const QDate & date, int nyears) const
+{
+  return date.addYears(nyears);
+}
+
+QDate KCalendarSystemGregorian::addMonths(const QDate & date, int nmonths) const
+{
+  return date.addMonths(nmonths);
+}
+
+QDate KCalendarSystemGregorian::addDays(const QDate & date, int ndays) const
+{
+  return date.addDays(ndays);
+}
+
+QString KCalendarSystemGregorian::weekDayName(int col, bool shortName) const
+{
+
+
+
+
+  return locale()->weekDayName(col, shortName);
+}
+
+QString KCalendarSystemGregorian::weekDayName(const QDate& date, bool shortName) const
+{
+  return weekDayName(dayOfWeek(date), shortName);
+}
+
+
+int KCalendarSystemGregorian::dayOfWeek(const QDate& date) const
+{
+  return date.dayOfWeek();
+}
+
+int KCalendarSystemGregorian::dayOfYear(const QDate & date) const
+{
+  return date.dayOfYear();
+}
+
+int KCalendarSystemGregorian::daysInMonth(const QDate& date) const
+{
+  kdDebug(5400) << "Gregorian daysInMonth" << endl;
+  return date.daysInMonth();
+}
+
+int KCalendarSystemGregorian::minValidYear() const
+{
+  return 1753;
+}
+
+int KCalendarSystemGregorian::maxValidYear() const
+{
+  return 8000;
+}
+
+int KCalendarSystemGregorian::day(const QDate& date) const
+{
+  return date.day();
+}
+
+int KCalendarSystemGregorian::month(const QDate& date) const
+{
+  return date.month();
+}
+
+int KCalendarSystemGregorian::daysInYear(const QDate& date) const
+{
+  return date.daysInYear();
+}
+
+int KCalendarSystemGregorian::weekDayOfPray() const
+{
+  return 7;
+}
+
+QString KCalendarSystemGregorian::calendarName() const
+{
+  return QString::fromLatin1("gregorian");
+}
+
+bool KCalendarSystemGregorian::isLunar() const
+{
+  return false;
+}
+
+bool KCalendarSystemGregorian::isLunisolar() const
+{
+  return false;
+}
+
+bool KCalendarSystemGregorian::isSolar() const
+{
+  return true;
+}
+
+QString KCalendarSystemGregorian::yearLiteral (int year) const
+{
+   return QString::number(year);
+}
+
+QString KCalendarSystemGregorian::yearLiteral (const QDate & date) const
+{
+   return QString::number(date.year());
+}
+
+
+int KCalendarSystemGregorian::yearStringToInteger(const QString & sNum, int & iLength) const
+{
+  int iYear;
+  iYear = KCalendarSystem::yearStringToInteger(sNum, iLength);
+
+
+
+  if (iYear < 69)
+    iYear += 2000;
+  else if (iYear < 100)
+    iYear += 1900;
+
+  return iYear;
+}
+
+
+
+
+
+
+class KCalendarSystemHijriPrivate;
+class KCalendarSystemHijri : public KCalendarSystem
+{
+public:
+  KCalendarSystemHijri(const KLocale * locale = 0);
+  virtual ~KCalendarSystemHijri();
+
+  virtual int year (const QDate & date) const;
+  virtual int month (const QDate & date) const;
+  virtual int day (const QDate & date) const;
+  virtual int dayOfWeek (const QDate & date) const;
+  virtual int dayOfYear (const QDate & date) const;
+
+  virtual bool setYMD(QDate & date, int y, int m, int d) const;
+
+  virtual QDate addYears(const QDate & date, int nyears) const;
+  virtual QDate addMonths(const QDate & date, int nmonths) const;
+  virtual QDate addDays(const QDate & date, int ndays) const;
+
+  virtual int monthsInYear (const QDate & date) const;
+  virtual int daysInYear (const QDate & date) const;
+  virtual int daysInMonth (const QDate & date) const;
+  virtual int weeksInYear(int year) const;
+  virtual int weekNumber(const QDate& date, int * yearNum = 0) const;
+
+  virtual QString yearLiteral (int year) const;
+  virtual QString yearLiteral (const QDate & date) const;
+  virtual QString monthName (int month, int year, bool shortName = false) const;
+  virtual QString monthName (const QDate & date, bool shortName = false ) const;
+  virtual QString monthNamePossessive(int month, int year, bool shortName = false) const;
+  virtual QString monthNamePossessive(const QDate & date, bool shortName = false ) const;
+  virtual QString weekDayName (int weekDay, bool shortName = false) const;
+  virtual QString weekDayName (const QDate & date, bool shortName = false) const;
+
+  virtual int minValidYear () const;
+  virtual int maxValidYear () const;
+  virtual int weekDayOfPray () const;
+
+  virtual QString calendarName() const;
+
+  virtual bool isLunar() const;
+  virtual bool isLunisolar() const;
+  virtual bool isSolar() const;
+
+  private:
+
+
+
+
+
+
+
+  int hndays(int month, int year) const;
+
+  KCalendarSystemHijriPrivate * d;
+};
+static int lastDayOfGregorianMonth(int month, int year) {
+
+
+  switch (month) {
+  case 2:
+    if ((((year % 4) == 0) && ((year % 100) != 0))
+        || ((year % 400) == 0))
+      return 29;
+    else
+      return 28;
+  case 4:
+  case 6:
+  case 9:
+  case 11: return 30;
+  default: return 31;
+  }
+}
+
+class GregorianDate {
+private:
+  int year;
+  int month;
+  int day;
+
+public:
+  GregorianDate(int m, int d, int y) { month = m; day = d; year = y; }
+
+  GregorianDate(int d) {
+
+
+    year = d/366;
+    while (d >= GregorianDate(1,1,year+1))
+      year++;
+
+    month = 1;
+    while (d > GregorianDate(month, lastDayOfGregorianMonth(month,year), year))
+      month++;
+    day = d - GregorianDate(month,1,year) + 1;
+  }
+
+  operator int() {
+    int N = day;
+    for (int m = month - 1; m > 0; m--)
+      N = N + lastDayOfGregorianMonth(m, year);
+    return
+      (N
+       + 365 * (year - 1)
+       + (year - 1)/4
+       - (year - 1)/100
+       + (year - 1)/400);
+  }
+
+  int getMonth() { return month; }
+  int getDay() { return day; }
+  int getYear() { return year; }
+
+};
+
+static int IslamicLeapYear(int year) {
+
+
+  if ((((11 * year) + 14) % 30) < 11)
+    return 1;
+  else
+    return 0;
+}
+
+static const int IslamicEpoch = 227014;
+
+
+static int lastDayOfIslamicMonth(int month, int year) {
+
+
+  if (((month % 2) == 1) || ((month == 12) && IslamicLeapYear(year)))
+    return 30;
+  else
+    return 29;
+}
+
+class IslamicDate {
+private:
+  int year;
+  int month;
+  int day;
+
+public:
+  IslamicDate(int m, int d, int y) { month = m; day = d; year = y; }
+
+  IslamicDate(int d) {
+    if (d <= IslamicEpoch) {
+      month = 0;
+      day = 0;
+      year = 0;
+    }
+    else {
+
+      year = (d - IslamicEpoch) / 355;
+      while (d >= IslamicDate(1,1,year+1))
+        year++;
+
+      month = 1;
+      while (d > IslamicDate(month, lastDayOfIslamicMonth(month,year), year))
+        month++;
+      day = d - IslamicDate(month,1,year) + 1;
+    }
+  }
+
+  operator int() {
+    return (day
+            + 29 * (month - 1)
+            + month/2
+            + 354 * (year - 1)
+            + (3 + (11 * year)) / 30
+            + IslamicEpoch);
+  }
+
+  int getMonth() { return month; }
+  int getDay() { return day; }
+  int getYear() { return year; }
+
+};
+
+static void gregorianToHijri(const QDate & date, int * pYear, int * pMonth,
+   int * pDay)
+{
+  GregorianDate gregorian(date.month(),date.day(),date.year());
+  int absolute = gregorian;
+
+  IslamicDate islamic(absolute);
+
+  if (pYear)
+    *pYear = islamic.getYear();
+  if (pMonth)
+    *pMonth = islamic.getMonth();
+  if (pDay)
+    *pDay = islamic.getDay();
+}
+
+KCalendarSystemHijri::KCalendarSystemHijri(const KLocale * locale)
+  : KCalendarSystem(locale)
+{
+}
+
+KCalendarSystemHijri::~KCalendarSystemHijri()
+{
+}
+
+int KCalendarSystemHijri::year(const QDate& date) const
+{
+  int y;
+  gregorianToHijri(date, &y, 0, 0);
+  return y;
+}
+
+int KCalendarSystemHijri::month(const QDate& date) const
+{
+  int m;
+  gregorianToHijri(date, 0, &m, 0);
+  return m;
+}
+
+int KCalendarSystemHijri::day(const QDate& date) const
+{
+  int d;
+  gregorianToHijri(date, 0, 0, &d);
+  return d;
+}
+
+int KCalendarSystemHijri::monthsInYear( const QDate & date ) const
+{
+  (void)date;
+
+  return 12;
+}
+
+int KCalendarSystemHijri::weeksInYear(int year) const
+{
+  QDate temp;
+  setYMD(temp, year, 12, lastDayOfIslamicMonth(12, year));
+
+
+
+  if ( weekNumber(temp) == 1 )
+    temp = addDays(temp, -7);
+
+  return weekNumber(temp);
+}
+
+int KCalendarSystemHijri::weekNumber(const QDate& date, int * yearNum) const
+{
+  QDate firstDayWeek1, lastDayOfYear;
+  int y = year(date);
+  int week;
+  int weekDay1, dayOfWeek1InYear;
+
+
+  setYMD(firstDayWeek1, y, 1, 1);
+  weekDay1 = dayOfWeek(firstDayWeek1);
+
+
+
+  if (weekDay1 > 4 )
+    firstDayWeek1 = addDays(firstDayWeek1 , 7 - weekDay1 + 1);
+
+  dayOfWeek1InYear = dayOfYear(firstDayWeek1);
+
+  if ( dayOfYear(date) < dayOfWeek1InYear )
+  {
+    if ( yearNum )
+      *yearNum = y - 1;
+    return weeksInYear(y - 1);
+  }
+
+
+  setYMD(lastDayOfYear, y, 12, lastDayOfIslamicMonth(12, y));
+  if ( (dayOfYear(date) >= daysInYear(date) - dayOfWeek(lastDayOfYear) + 1)
+
+       && dayOfWeek(lastDayOfYear) < 4)
+    {
+      if ( yearNum )
+        *yearNum = y + 1;
+      week = 1;
+    }
+  else
+  {
+    if ( weekDay1 < 5 )
+      firstDayWeek1 = addDays(firstDayWeek1, - (weekDay1 - 1));
+
+    week = firstDayWeek1.daysTo(date) / 7 + 1;
+  }
+
+  return week;
+}
+
+QString KCalendarSystemHijri::monthName(const QDate& date,
+                                        bool shortName) const
+{
+  return monthName(month(date), shortName);
+}
+
+QString KCalendarSystemHijri::monthNamePossessive(const QDate& date,
+                                                  bool shortName) const
+{
+  return monthNamePossessive(month(date), shortName);
+}
+
+QString KCalendarSystemHijri::monthName(int month, int year, bool shortName)
+  const {
+
+  (void)year;;
+
+  if (shortName)
+    switch ( month )
+      {
+      case 1:
+        return locale()->translate("Muharram");
+      case 2:
+        return locale()->translate("Safar");
+      case 3:
+        return locale()->translate("R. Awal");
+      case 4:
+        return locale()->translate("R. Thaani");
+      case 5:
+        return locale()->translate("J. Awal");
+      case 6:
+        return locale()->translate("J. Thaani");
+      case 7:
+        return locale()->translate("Rajab");
+      case 8:
+        return locale()->translate("Sha`ban");
+      case 9:
+        return locale()->translate("Ramadan");
+      case 10:
+        return locale()->translate("Shawwal");
+      case 11:
+        return locale()->translate("Qi`dah");
+      case 12:
+        return locale()->translate("Hijjah");
+    }
+  else
+    switch ( month )
+      {
+      case 1:
+        return locale()->translate("Muharram");
+      case 2:
+        return locale()->translate("Safar");
+      case 3:
+        return locale()->translate("Rabi` al-Awal");
+      case 4:
+        return locale()->translate("Rabi` al-Thaani");
+      case 5:
+        return locale()->translate("Jumaada al-Awal");
+      case 6:
+        return locale()->translate("Jumaada al-Thaani");
+      case 7:
+        return locale()->translate("Rajab");
+      case 8:
+        return locale()->translate("Sha`ban");
+      case 9:
+        return locale()->translate("Ramadan");
+      case 10:
+        return locale()->translate("Shawwal");
+      case 11:
+        return locale()->translate("Thu al-Qi`dah");
+      case 12:
+        return locale()->translate("Thu al-Hijjah");
+      }
+
+  return QString::null;
+}
+
+QString KCalendarSystemHijri::monthNamePossessive(int month, int year,
+                                                  bool shortName) const
+{
+  (void)year;;
+
+  if (shortName)
+    switch ( month )
+      {
+      case 1:
+        return locale()->translate("of Muharram");
+      case 2:
+        return locale()->translate("of Safar");
+      case 3:
+        return locale()->translate("of R. Awal");
+      case 4:
+        return locale()->translate("of R. Thaani");
+      case 5:
+        return locale()->translate("of J. Awal");
+      case 6:
+        return locale()->translate("of J. Thaani");
+      case 7:
+        return locale()->translate("of Rajab");
+      case 8:
+        return locale()->translate("of Sha`ban");
+      case 9:
+        return locale()->translate("of Ramadan");
+      case 10:
+        return locale()->translate("of Shawwal");
+      case 11:
+        return locale()->translate("of Qi`dah");
+      case 12:
+        return locale()->translate("of Hijjah");
+    }
+  else
+    switch ( month )
+      {
+      case 1:
+        return locale()->translate("of Muharram");
+      case 2:
+        return locale()->translate("of Safar");
+      case 3:
+        return locale()->translate("of Rabi` al-Awal");
+      case 4:
+        return locale()->translate("of Rabi` al-Thaani");
+      case 5:
+        return locale()->translate("of Jumaada al-Awal");
+      case 6:
+        return locale()->translate("of Jumaada al-Thaani");
+      case 7:
+        return locale()->translate("of Rajab");
+      case 8:
+        return locale()->translate("of Sha`ban");
+      case 9:
+        return locale()->translate("of Ramadan");
+      case 10:
+        return locale()->translate("of Shawwal");
+      case 11:
+        return locale()->translate("of Thu al-Qi`dah");
+      case 12:
+        return locale()->translate("of Thu al-Hijjah");
+      }
+
+  return QString::null;
+}
+
+bool KCalendarSystemHijri::setYMD(QDate & date, int y, int m, int d) const
+{
+
+  if ( y < minValidYear() || y > maxValidYear() )
+    return false;
+
+  if ( m < 1 || m > 12 )
+    return false;
+
+  if ( d < 1 || d > lastDayOfIslamicMonth(m, y) )
+    return false;
+
+  IslamicDate islamic (m, d, y);
+  int absolute = islamic;
+  GregorianDate gregorian(absolute);
+
+  return date.setYMD(gregorian.getYear(), gregorian.getMonth(),
+    gregorian.getDay());
+}
+
+QString KCalendarSystemHijri::weekDayName(int day, bool shortName) const
+{
+  if ( shortName )
+    switch (day)
+      {
+      case 1:
+        return locale()->translate("Ith");
+      case 2:
+        return locale()->translate("Thl");
+      case 3:
+        return locale()->translate("Arb");
+      case 4:
+        return locale()->translate("Kha");
+      case 5:
+        return locale()->translate("Jum");
+      case 6:
+        return locale()->translate("Sab");
+      case 7:
+        return locale()->translate("Ahd");
+      }
+  else
+    switch ( day )
+      {
+      case 1:
+        return locale()->translate("Yaum al-Ithnain");
+      case 2:
+        return locale()->translate("Yau al-Thulatha");
+      case 3:
+        return locale()->translate("Yaum al-Arbi'a");
+      case 4:
+        return locale()->translate("Yaum al-Khamees");
+      case 5:
+        return locale()->translate("Yaum al-Jumma");
+      case 6:
+        return locale()->translate("Yaum al-Sabt");
+      case 7:
+        return locale()->translate("Yaum al-Ahad");
+      }
+
+  return QString::null;
+}
+
+QString KCalendarSystemHijri::weekDayName(const QDate& date,
+                                          bool shortName) const
+{
+  return weekDayName(dayOfWeek(date), shortName);
+}
+
+int KCalendarSystemHijri::dayOfWeek(const QDate& date) const
+{
+  return date.dayOfWeek();
+}
+
+int KCalendarSystemHijri::dayOfYear(const QDate & date) const
+{
+  QDate first;
+  setYMD(first, year(date), 1, 1);
+
+  return first.daysTo(date) + 1;
+
+  return 100;
+}
+
+int KCalendarSystemHijri::daysInMonth(const QDate& date) const
+{
+  int y, m;
+  gregorianToHijri(date, &y, &m, 0);
+
+  return lastDayOfIslamicMonth(m, y);
+}
+
+
+int KCalendarSystemHijri::minValidYear() const
+{
+  QDate date(1753, 1, 1);
+
+  return year(date);
+}
+
+
+int KCalendarSystemHijri::maxValidYear() const
+{
+  QDate date(8000, 1, 1);
+
+  return year(date);
+}
+
+int KCalendarSystemHijri::daysInYear(const QDate & date) const
+{
+  QDate first, last;
+  setYMD(first, year(date), 1, 1);
+  setYMD(last, year(date) + 1, 1, 1);
+
+  return first.daysTo(last);
+}
+
+int KCalendarSystemHijri::weekDayOfPray() const
+{
+  return 5;
+}
+
+QDate KCalendarSystemHijri::addDays( const QDate & date, int ndays ) const
+{
+  return date.addDays( ndays );
+}
+
+QDate KCalendarSystemHijri::addMonths( const QDate & date, int nmonths ) const
+{
+  QDate result = date;
+  int m = month(date);
+  int y = year(date);
+
+  if ( nmonths < 0 )
+  {
+    m += 12;
+    y -= 1;
+  }
+
+  --m;
+  m += nmonths;
+  y += m / 12;
+  m %= 12;
+  ++m;
+
+  setYMD( result, y, m, day(date) );
+
+  return result;
+}
+
+QDate KCalendarSystemHijri::addYears( const QDate & date, int nyears ) const
+{
+  QDate result = date;
+  int y = year(date) + nyears;
+
+  setYMD( result, y, month(date), day(date) );
+
+  return result;
+}
+
+QString KCalendarSystemHijri::calendarName() const
+{
+  return QString::fromLatin1("hijri");
+}
+
+bool KCalendarSystemHijri::isLunar() const
+{
+  return true;
+}
+
+bool KCalendarSystemHijri::isLunisolar() const
+{
+  return false;
+}
+
+bool KCalendarSystemHijri::isSolar() const
+{
+  return false;
+}
+
+QString KCalendarSystemHijri::yearLiteral (int year) const
+{
+   return QString::number(year);
+}
+
+QString KCalendarSystemHijri::yearLiteral (const QDate & date) const
+{
+   return yearLiteral(year(date));
+}
+
+
+
+
+
+
+class KCalendarSystemHebrewPrivate;
+class KCalendarSystemHebrew : public KCalendarSystem
+{
+public:
+  KCalendarSystemHebrew(const KLocale * locale = 0);
+  virtual ~KCalendarSystemHebrew();
+
+  virtual int year (const QDate & date) const;
+  virtual int month (const QDate & date) const;
+  virtual int day (const QDate & date) const;
+  virtual int dayOfWeek (const QDate & date) const;
+  virtual int dayOfYear (const QDate & date) const;
+
+  virtual bool setYMD(QDate & date, int y, int m, int d) const;
+
+  virtual QDate addYears(const QDate & date, int nyears) const;
+  virtual QDate addMonths(const QDate & date, int nmonths) const;
+  virtual QDate addDays(const QDate & date, int ndays) const;
+
+  virtual int monthsInYear (const QDate & date) const;
+  virtual int daysInYear (const QDate & date) const;
+  virtual int daysInMonth (const QDate & date) const;
+  virtual int weeksInYear(int year) const;
+  virtual int weekNumber(const QDate& date, int * yearNum = 0) const;
+
+  virtual QString yearLiteral (int year) const;
+  virtual QString yearLiteral (const QDate & date) const;
+  virtual QString monthName (int month, int year, bool shortName = false) const;
+  virtual QString monthName (const QDate & date, bool shortName = false ) const;
+  virtual QString monthNamePossessive(int month, int year, bool shortName = false) const;
+  virtual QString monthNamePossessive(const QDate & date, bool shortName = false ) const;
+  virtual QString weekDayName (int weekDay, bool shortName = false) const;
+  virtual QString weekDayName (const QDate & date, bool shortName = false) const;
+
+  virtual QString dayString(const QDate & pDate, bool bShort) const;
+  virtual QString yearString(const QDate & pDate, bool bShort) const;
+  virtual int dayStringToInteger(const QString & sNum, int & iLength) const;
+  virtual int yearStringToInteger(const QString & sNum, int & iLength) const;
+
+  virtual int minValidYear () const;
+  virtual int maxValidYear () const;
+  virtual int weekDayOfPray () const;
+
+  virtual QString calendarName() const;
+
+  virtual bool isLunar() const;
+  virtual bool isLunisolar() const;
+  virtual bool isSolar() const;
+
+private:
+
+
+
+
+
+
+
+  int hndays(int year, int mon) const;
+
+  KCalendarSystemHebrewPrivate * d;
+};
+
+static int hebrewDaysInYear(int y);
+static QString num2heb(int num, bool includeMillenium);
+
+class h_date
+{
+public:
+  int hd_day;
+  int hd_mon;
+  int hd_year;
+  int hd_dw;
+  int hd_flg;
+};
+
+
+
+
+static class h_date * hebrewToGregorian(int y, int m, int d)
+{
+  static class h_date h;
+  int s;
+
+  y -= 3744;
+  s = hebrewDaysInYear(y);
+  d += s;
+  s = hebrewDaysInYear(y + 1) - s;
+
+  if (s > 365 && m > 6 )
+  {
+    --m;
+    d += 30;
+  }
+  d += (59 * (m - 1) + 1) / 2;
+
+  if (s % 10 > 4 && m > 2)
+    d++;
+  if (s % 10 < 4 && m > 3)
+    d--;
+
+
+
+  d -= 6002;
+
+  y = (d + 36525) * 4 / 146097 - 1;
+  d -= y / 4 * 146097 + (y % 4) * 36524;
+  y *= 100;
+
+
+  s = (d + 366)*4/1461-1;
+  d -= s/4*1461 + (s % 4)*365;
+  y += s;
+
+  m = (d + 245)*12/367-7;
+  d -= m*367/12-30;
+  if (++m >= 12) {
+    m -= 12;
+    y++;
+  }
+  h.hd_day = d;
+  h.hd_mon = m;
+  h.hd_year = y;
+  return(&h);
+}
+
+
+
+
+static class h_date * gregorianToHebrew(int y, int m, int d)
+{
+  static class h_date h;
+  int s;
+
+  if ((m -= 2) <= 0) {
+    m += 12;
+    y--;
+  }
+
+  d += 365*y + y/4 + 367*m/12 + 5968;
+
+  d -= y/100-y/400-2;
+  h.hd_dw = (d + 1) % 7;
+
+
+  y += 16;
+  s = hebrewDaysInYear(y);
+  m = hebrewDaysInYear(y + 1);
+  while(d >= m) {
+    s = m;
+    y++;
+    m = hebrewDaysInYear(y + 1);
+  }
+  d -= s;
+  s = m-s;
+  y += 3744;
+
+  h.hd_flg = s % 10-4;
+
+
+  if (d >= s-236) {
+    d -= s-236;
+    m = d*2/59;
+    d -= (m*59 + 1)/2;
+    m += 4;
+    if (s > 365 && m <= 5)
+      m += 8;
+  } else {
+
+    s = 114 + s % 10;
+    m = d * 4 / s;
+    d -= (m * s + 3) / 4;
+  }
+
+  h.hd_day = d;
+  h.hd_mon = m;
+  h.hd_year = y;
+  return(&h);
+}
+
+static QString num2heb(int num, bool includeMillenium)
+{
+  const QChar decade[] = {0x05D8, 0x05D9, 0x05DB, 0x05DC, 0x05DE,
+                          0x05E0, 0x05E1, 0x05E2, 0x05E4, 0x05E6};
+  QString result;
+
+  if (num < 1 || num > 9999)
+    return QString::number(num);
+
+  if (num >= 1000) {
+    if (includeMillenium || num % 1000 == 0)
+      result += QChar(0x05D0 - 1 + num / 1000);
+    num %= 1000;
+  }
+  if (num >= 100) {
+    while (num >= 500) {
+      result += QChar(0x05EA);
+      num -= 400;
+    }
+    result += QChar(0x05E7 - 1 + num / 100);
+    num %= 100;
+  }
+  if (num >= 10) {
+    if (num == 15 || num == 16)
+      num -= 9;
+    result += decade[num / 10];
+    num %= 10;
+  }
+  if (num > 0)
+    result += QChar(0x05D0 - 1 + num);
+
+  if (result.length() == 1)
+    result += "'";
+  else
+    result.insert(result.length() - 1, '\"');
+
+  return result;
+}
+
+
+static const int HOUR = 1080;
+static const int DAY = 24*HOUR;
+static const int WEEK = 7*DAY;
+
+
+
+
+
+static int hebrewDaysInYear(int y)
+{
+  int m, nm, dw, s, l;
+
+  l = y * 7 + 1;
+  m = y*12+l/19;
+  l %= 19;
+  nm = m*(DAY+((12)*HOUR+793))+((1+6)*HOUR+779);
+  s = m*28+nm/DAY-2;
+
+  nm %= WEEK;
+  dw = nm/DAY;
+  nm %= DAY;
+
+
+  if (l < 12 && dw == 3 && nm >= ((9 + 6)*HOUR+204) ||
+   l < 7 && dw == 2 && nm>=((15+6)*HOUR+589))
+    s++,dw++;
+
+  if (dw == 1 || dw == 4 || dw == 6)
+    s++;
+  return s;
+}
+
+
+
+
+
+static int long_cheshvan(int year)
+{
+  return ((hebrewDaysInYear(year) % 10) == 5);
+}
+
+
+
+
+
+static int short_kislev(int year)
+{
+  return ((hebrewDaysInYear(year) % 10) == 3);
+}
+
+static bool is_leap_year(int year)
+{
+  return ((((7 * year) + 1) % 19) < 7);
+}
+
+
+KCalendarSystemHebrew::KCalendarSystemHebrew(const KLocale * locale)
+  : KCalendarSystem(locale)
+{
+}
+
+
+KCalendarSystemHebrew::~KCalendarSystemHebrew()
+{
+}
+
+
+static class h_date * toHebrew(const QDate & date)
+{
+  class h_date *sd;
+  sd = gregorianToHebrew(date.year(), date.month(), date.day());
+  ++sd->hd_mon;
+  ++sd->hd_day;
+  return sd;
+}
+
+
+int KCalendarSystemHebrew::year(const QDate& date) const
+{
+  class h_date *sd = toHebrew(date);
+  return sd->hd_year;
+}
+
+
+int KCalendarSystemHebrew::monthsInYear( const QDate & date ) const
+{
+  if ( is_leap_year( year(date) ) )
+    return 13;
+  else
+    return 12;
+}
+
+
+int KCalendarSystemHebrew::weeksInYear(int year) const
+{
+  QDate temp;
+  setYMD(temp, year, monthsInYear(temp), hndays(monthsInYear(temp), year) );
+
+  int nWeekNumber = weekNumber(temp);
+  if(nWeekNumber == 1)
+  {
+    temp = temp.addDays(-7);
+    nWeekNumber = weekNumber(temp);
+  }
+
+  return nWeekNumber;
+}
+
+int KCalendarSystemHebrew::weekNumber(const QDate& date, int * yearNum) const
+{
+  QDate firstDayWeek1, lastDayOfYear;
+  int y = year(date);
+  int week;
+  int weekDay1, dayOfWeek1InYear;
+
+
+  setYMD(firstDayWeek1, y, 1, 1);
+  weekDay1 = dayOfWeek(firstDayWeek1);
+
+
+
+  if (weekDay1 > 4 )
+    firstDayWeek1 = addDays(firstDayWeek1 , 7 - weekDay1 + 1);
+
+  dayOfWeek1InYear = dayOfYear(firstDayWeek1);
+
+  if ( dayOfYear(date) < dayOfWeek1InYear )
+  {
+    if ( yearNum )
+      *yearNum = y - 1;
+    return weeksInYear(y - 1);
+  }
+
+
+  setYMD(lastDayOfYear, y + 1, 1, 1);
+  lastDayOfYear = addDays(lastDayOfYear, -1);
+  if ( (dayOfYear(date) >= daysInYear(date) - dayOfWeek(lastDayOfYear) + 1)
+
+       && dayOfWeek(lastDayOfYear) < 4)
+    {
+      if ( yearNum )
+        *yearNum = y + 1;
+      week = 1;
+    }
+  else
+  {
+   if( weekDay1 < 5 )
+
+      firstDayWeek1 = addDays( firstDayWeek1, -( weekDay1 - 1));
+
+   week = firstDayWeek1.daysTo(date) / 7 + 1;
+  }
+
+  return week;
+}
+
+
+QString KCalendarSystemHebrew::monthName(const QDate& date,
+                                        bool shortName) const
+{
+  return monthName(month(date), year(date), shortName);
+}
+
+
+QString KCalendarSystemHebrew::monthNamePossessive(const QDate& date,
+                                                  bool shortName) const
+{
+  return monthNamePossessive(month(date), year(date), shortName);
+}
+
+
+QString KCalendarSystemHebrew::monthName(int month, int year, bool ) const
+{
+  if ( month < 1 )
+    return QString::null;
+  if ( is_leap_year(year) )
+  {
+    if ( month > 13 )
+      return QString::null;
+  }
+  else if ( month > 12 )
+      return QString::null;
+
+
+  if( month == 6 && is_leap_year(year) )
+    month = 13;
+  else if ( month == 7 && is_leap_year(year) )
+    month = 14;
+  else if ( month > 7 && is_leap_year(year) )
+    month--;
+
+  switch(month)
+  {
+  case 1:
+    return locale()->translate("Tishrey");
+  case 2:
+    return locale()->translate("Heshvan");
+  case 3:
+    return locale()->translate("Kislev");
+  case 4:
+    return locale()->translate("Tevet");
+  case 5:
+    return locale()->translate("Shvat");
+  case 6:
+    return locale()->translate("Adar");
+  case 7:
+    return locale()->translate("Nisan");
+  case 8:
+    return locale()->translate("Iyar");
+  case 9:
+    return locale()->translate("Sivan");
+  case 10:
+    return locale()->translate("Tamuz");
+  case 11:
+    return locale()->translate("Av");
+  case 12:
+    return locale()->translate("Elul");
+  case 13:
+    return locale()->translate("Adar I");
+  case 14:
+    return locale()->translate("Adar II");
+  default:
+    break;
+  }
+
+  return QString::null;
+}
+
+
+QString KCalendarSystemHebrew::monthNamePossessive(int month, int year,
+                                                  bool shortName) const
+{
+  return "of " + monthName(month, year, shortName);
+}
+
+bool KCalendarSystemHebrew::setYMD(QDate & date, int y, int m, int d) const
+{
+
+  class h_date * gd = hebrewToGregorian( y, m, d );
+
+  if( y < minValidYear() || y > maxValidYear() )
+    return false;
+  if( m < 1 || m > (is_leap_year(y) ? 13 : 12) )
+    return false;
+  if( d < 1 || d > hndays(m,y) )
+    return false;
+
+  return date.setYMD(gd->hd_year, gd->hd_mon + 1, gd->hd_day + 1);
+}
+
+QString KCalendarSystemHebrew::weekDayName(int day, bool shortName) const
+{
+  if ( day == 6 )
+  {
+    if (shortName)
+      return locale()->translate("Hebrew Calendar WeekDay 6 Short", "Sab");
+    else
+      return locale()->translate("Hebrew Calendar WeekDay 6 Long", "Sabbath");
+  }
+
+  return locale()->weekDayName(day, shortName);
+}
+
+
+QString KCalendarSystemHebrew::weekDayName(const QDate& date,
+                                          bool shortName) const
+{
+  return weekDayName(dayOfWeek(date), shortName);
+}
+
+
+int KCalendarSystemHebrew::dayOfWeek(const QDate& date) const
+{
+  class h_date *sd = toHebrew(date);
+  if ( sd->hd_dw == 0 )
+    return 7;
+  else
+    return (sd->hd_dw);
+}
+
+
+int KCalendarSystemHebrew::dayOfYear(const QDate & date) const
+{
+  QDate first;
+  setYMD(first, year(date), 1, 1);
+
+  return first.daysTo(date) + 1;
+}
+
+int KCalendarSystemHebrew::daysInMonth(const QDate& date) const
+{
+  class h_date *sd = toHebrew(date);
+  return hndays(sd->hd_mon, sd->hd_year);
+}
+
+
+int KCalendarSystemHebrew::hndays(int mon, int year) const
+{
+  if ( is_leap_year(year) )
+    if ( mon == 6 )
+      mon = 13;
+    else if ( mon == 7 )
+      mon = 14;
+    else
+      --mon;
+
+  if( mon == 8 || mon == 10 ||
+    mon == 12 || mon == 4 ||
+    mon == 14 ||
+    ( mon == 13 && !is_leap_year(year)) ||
+    (mon == 2 && !long_cheshvan(year)) ||
+    (mon == 3 && short_kislev(year)))
+    return 29;
+  else
+    return 30;
+}
+
+
+
+int KCalendarSystemHebrew::minValidYear() const
+{
+  QDate date(1753, 1, 1);
+
+  return year(date);
+}
+
+
+
+int KCalendarSystemHebrew::maxValidYear() const
+{
+  QDate date(8000, 1, 1);
+
+  return year(date);
+}
+
+
+int KCalendarSystemHebrew::day(const QDate& date) const
+{
+  class h_date *sd = toHebrew(date);
+
+  return sd->hd_day;
+}
+
+
+int KCalendarSystemHebrew::month(const QDate& date) const
+{
+  class h_date *sd = toHebrew(date);
+
+  int month = sd->hd_mon;
+  if ( is_leap_year( sd->hd_year ) )
+  {
+    if( month == 13 )
+       month = 6;
+    else if( month == 14 )
+       month = 7;
+    else if ( month > 6 && month < 13 )
+      ++month;
+  }
+
+  return month;
+}
+
+
+int KCalendarSystemHebrew::daysInYear(const QDate & date) const
+{
+  QDate first, last;
+  setYMD(first, year(date), 1, 1);
+  setYMD(last, year(date) + 1, 1, 1);
+
+  return first.daysTo(last);
+}
+
+
+int KCalendarSystemHebrew::weekDayOfPray() const
+{
+  return 6;
+}
+
+
+QDate KCalendarSystemHebrew::addDays( const QDate & date, int ndays ) const
+{
+  return date.addDays( ndays );
+}
+
+
+QDate KCalendarSystemHebrew::addMonths( const QDate & date, int nmonths ) const
+{
+  QDate result = date;
+
+  while ( nmonths > 0 )
+  {
+    result = addDays(result, daysInMonth(result));
+    --nmonths;
+  }
+
+  while ( nmonths < 0 )
+  {
+
+
+    int nDaysInMonth = daysInMonth(addDays(result, -day(result)));
+    result = addDays(result, -nDaysInMonth);
+    ++nmonths;
+  }
+
+  return result;
+}
+
+
+QDate KCalendarSystemHebrew::addYears( const QDate & date, int nyears ) const
+{
+  QDate result = date;
+  int y = year(date) + nyears;
+
+  setYMD( result, y, month(date), day(date) );
+
+  return result;
+}
+
+
+QString KCalendarSystemHebrew::calendarName() const
+{
+  return QString::fromLatin1("hebrew");
+}
+
+
+bool KCalendarSystemHebrew::isLunar() const
+{
+  return false;
+}
+
+
+bool KCalendarSystemHebrew::isLunisolar() const
+{
+  return true;
+}
+
+
+bool KCalendarSystemHebrew::isSolar() const
+{
+  return false;
+}
+
+QString KCalendarSystemHebrew::yearLiteral (int year) const
+{
+   return QString::number(year);
+}
+QString KCalendarSystemHebrew::yearLiteral (const QDate & date) const
+{
+   return yearLiteral(year(date));
+}
+
+QString KCalendarSystemHebrew::dayString(const QDate & pDate, bool bShort) const
+{
+  QString sResult;
+
+
+  if (locale()->language() == QString::fromLatin1("he"))
+    sResult = num2heb(day(pDate), false);
+  else
+    sResult = KCalendarSystem::dayString(pDate, bShort);
+
+  return sResult;
+}
+
+QString KCalendarSystemHebrew::yearString(const QDate & pDate, bool bShort) const
+{
+  QString sResult;
+
+
+  if (locale()->language() == QString::fromLatin1("he"))
+    sResult = num2heb(year(pDate), !bShort);
+  else
+    sResult = KCalendarSystem::yearString(pDate, bShort);
+
+  return sResult;
+}
+
+static int heb2num(const QString& str, int & iLength) {
+  QChar c;
+  QString s = str;
+  int result = 0;
+  s.remove("\'");
+  s.remove("\"");
+
+  uint i;
+  for (i = 0 ; i < s.length() ; i++)
+  {
+    c = s[i];
+    if (c == QChar(0x05D0) || c == QChar(0x05D1) || c == QChar(0x05D2) ||
+        c == QChar(0x05D3) || c == QChar(0x05D4) || c == QChar(0x05D5) ||
+        c == QChar(0x05D6) || c == QChar(0x05D7))
+    {
+      if (s.length() > i && s[i + 1] >= QChar(0x05D0) && s[i + 1] <= QChar(0x05EA))
+        result += (c.unicode() - 0x05D0 + 1) * 1000;
+      else
+        result += c.unicode() - 0x05D0 + 1;
+    }
+    else if (c == QChar(0x05D8))
+    {
+      if (s.length() > i && s[i + 1] == QChar(0x05D5))
+        result += 15;
+      else if (s.length() > i && s[i + 1] == QChar(0x05D6))
+        result += 16;
+      else if (s.length() > i && s[i + 1] >= QChar(0x05D0) && s[i + 1] <= QChar(0x05EA))
+        result += 9000;
+      else
+        result += 9;
+    }
+    else if (c == QChar(0x05D9))
+    {
+      if (s.length() > i && s[i + 1] >= QChar(0x05D9))
+        return -1;
+      else
+        result += 10;
+    }
+    else if (c == QChar(0x05DA) || c == QChar(0x05DB))
+    {
+      if (s.length() > i && s[i + 1] >= QChar(0x05D9))
+        return -1;
+      else
+        result += 20;
+    }
+    else if (c == QChar(0x05DC))
+    {
+      if (s.length() > i && s[i + 1] >= QChar(0x05D9))
+        return -1;
+      else
+        result += 30;
+    }
+    else if (c == QChar(0x05DD) || c == QChar(0x05DE))
+    {
+      if (s.length() > i && s[i + 1] >= QChar(0x05D9))
+        return -1;
+      else
+        result += 40;
+    }
+    else if (c == QChar(0x05DF) || c == QChar(0x05E0))
+    {
+      if (s.length() > i && s[i + 1] >= QChar(0x05D9))
+        return -1;
+      else
+        result += 50;
+    }
+    else if (c == QChar(0x05E1))
+    {
+      if (s.length() > i && s[i + 1] >= QChar(0x05D9))
+        return -1;
+      else
+        result += 60;
+    }
+    else if (c == QChar(0x05E2))
+    {
+      if (s.length() > i && s[i + 1] >= QChar(0x05D9))
+        return -1;
+      else
+        result += 70;
+    }
+    else if (c == QChar(0x05E3) || c == QChar(0x05E4))
+    {
+      if (s.length() > i && s[i + 1] >= QChar(0x05D9))
+        return -1;
+      else
+        result += 80;
+    }
+    else if (c == QChar(0x05E5) || c == QChar(0x05E6))
+    {
+      if (s.length() > i && s[i + 1] >= QChar(0x05D9))
+        return -1;
+      else
+        result += 90;
+    }
+    else if (c == QChar(0x05E7) || c == QChar(0x05E8) ||
+             c == QChar(0x05E9) || c == QChar(0x05EA))
+   {
+        result += (c.unicode() - 0x05E7 + 1) * 100;
+   }
+   else
+   {
+     break;
+   }
+  }
+
+  iLength = i;
+
+  return result;
+}
+
+int KCalendarSystemHebrew::dayStringToInteger(const QString & sNum, int & iLength) const
+{
+  int iResult;
+  if (locale()->language() == "he")
+    iResult= heb2num(sNum, iLength);
+  else
+    iResult = KCalendarSystem::yearStringToInteger(sNum, iLength);
+
+  kdDebug() << "KCalendarSystemHebrew::dayStringToInteger: Not implemnted" << endl;
+
+  return iResult;
+}
+
+int KCalendarSystemHebrew::yearStringToInteger(const QString & sNum, int & iLength) const
+{
+  int iResult;
+  if (locale()->language() == "he")
+    iResult = heb2num(sNum, iLength);
+  else
+    iResult = KCalendarSystem::yearStringToInteger(sNum, iLength);
+
+  if (iResult < 1000)
+    iResult += 5000;
+
+  kdDebug() << "KCalendarSystemHebrew::yearStringToInteger: Not implemnted" << endl;
+
+  return iResult;
+}
+
+class KCalendarSystemJalaliPrivate;
+
+
+
+class KCalendarSystemJalali : public KCalendarSystem
+{
+public:
+  KCalendarSystemJalali(const KLocale * locale = 0);
+  virtual ~KCalendarSystemJalali();
+
+
+
+  virtual int year (const QDate & date) const;
+  virtual int month (const QDate & date) const;
+  virtual int day (const QDate & date) const;
+  virtual int dayOfWeek (const QDate & date) const;
+  virtual int dayOfYear (const QDate & date) const;
+
+  virtual bool setYMD(QDate & date, int y, int m, int d) const;
+
+  virtual QDate addYears(const QDate & date, int nyears) const;
+  virtual QDate addMonths(const QDate & date, int nmonths) const;
+  virtual QDate addDays(const QDate & date, int ndays) const;
+
+  virtual int monthsInYear (const QDate & date) const;
+
+  virtual int daysInYear (const QDate & date) const;
+  virtual int daysInMonth (const QDate & date) const;
+  virtual int weeksInYear(int year) const;
+  virtual int weekNumber(const QDate& date, int * yearNum = 0) const;
+
+  virtual QString monthName (const QDate & date, bool shortName = false ) const;
+  virtual QString monthNamePossessive(const QDate & date, bool shortName = false ) const;
+  virtual QString weekDayName (int weekDay, bool shortName = false) const;
+  virtual QString weekDayName (const QDate & date, bool shortName = false) const;
+  virtual QString yearLiteral(int anInt) const;
+  virtual QString yearLiteral(const QDate &) const;
+  virtual QString monthNamePossessive(int m, int y, bool = false) const;
+  virtual QString monthName(int, int, bool = false) const;
+  virtual int minValidYear () const;
+  virtual int maxValidYear () const;
+  virtual int weekDayOfPray () const;
+
+  virtual QString calendarName() const;
+
+  virtual bool isLunar() const;
+  virtual bool isLunisolar() const;
+  virtual bool isSolar() const;
+
+};
+
+KCalendarSystemFactory::KCalendarSystemFactory()
+{
+  kdDebug(5400) << "Created factory calendar" << endl;
+}
+
+KCalendarSystemFactory::~KCalendarSystemFactory()
+{
+}
+
+KCalendarSystem *KCalendarSystemFactory::create( const QString &calType,
+                                                 const KLocale * locale )
+{
+  if ( calType == "hebrew" )
+    return new KCalendarSystemHebrew(locale);
+  if ( calType == "hijri" )
+    return new KCalendarSystemHijri(locale);
+  if ( calType == "gregorian" )
+    return new KCalendarSystemGregorian(locale);
+  if ( calType == "jalali" )
+    return new KCalendarSystemJalali(locale);
+
+  kdDebug(5400) << "Calendar " << calType << " not found, defaulting to gregorian" << endl;
+
+
+  return new KCalendarSystemGregorian(locale);
+}
+
+QStringList KCalendarSystemFactory::calendarSystems()
+{
+   QStringList lst;
+   lst.append("hebrew");
+   lst.append("hijri");
+   lst.append("gregorian");
+   lst.append("jalali");
+
+   return lst;
+}
+
+
+
+
+
+
+template<class T>
+class QValueStack : public QValueList<T>
+{
+public:
+    QValueStack() {}
+   ~QValueStack() {}
+    void push( const T& d ) { this->append(d); }
+    T pop()
+    {
+        T elem( this->last() );
+        if ( !this->isEmpty() )
+            this->remove( this->fromLast() );
+        return elem;
+    }
+    T& top() { return this->last(); }
+    const T& top() const { return this->last(); }
+};
+
+
+KMacroExpanderBase::KMacroExpanderBase( QChar c )
+{
+    escapechar = c;
+}
+
+KMacroExpanderBase::~KMacroExpanderBase()
+{
+}
+
+void
+KMacroExpanderBase::setEscapeChar( QChar c )
+{
+    escapechar = c;
+}
+
+QChar
+KMacroExpanderBase::escapeChar() const
+{
+    return escapechar;
+}
+
+void KMacroExpanderBase::expandMacros( QString &str )
+{
+    uint pos;
+    int len;
+    QChar ec( escapechar );
+    QStringList rst;
+    QString rsts;
+
+    for (pos = 0; pos < str.length(); ) {
+        if (ec != (char)0) {
+            if (str.unicode()[pos] != ec)
+                goto nohit;
+            if (!(len = expandEscapedMacro( str, pos, rst )))
+                goto nohit;
+        } else {
+            if (!(len = expandPlainMacro( str, pos, rst )))
+                goto nohit;
+        }
+            if (len < 0) {
+                pos -= len;
+                continue;
+            }
+            rsts = rst.join( " " );
+            rst.clear();
+            str.replace( pos, len, rsts );
+            pos += rsts.length();
+            continue;
+      nohit:
+        pos++;
+    }
+}
+
+
+namespace KMacroExpander {
+
+    enum Quoting { noquote, singlequote, doublequote, dollarquote,
+                   paren, subst, group, math };
+    typedef struct {
+        Quoting current;
+        bool dquote;
+    } State;
+    typedef struct {
+        QString str;
+        uint pos;
+    } Save;
+
+}
+
+using namespace KMacroExpander;
+
+bool KMacroExpanderBase::expandMacrosShellQuote( QString &str, uint &pos )
+{
+    int len;
+    uint pos2;
+    QChar ec( escapechar );
+    State state = { noquote, false };
+    QValueStack<State> sstack;
+    QValueStack<Save> ostack;
+    QStringList rst;
+    QString rsts;
+
+    while (pos < str.length()) {
+        QChar cc( str.unicode()[pos] );
+        if (ec != (char)0) {
+            if (cc != ec)
+                goto nohit;
+            if (!(len = expandEscapedMacro( str, pos, rst )))
+                goto nohit;
+        } else {
+            if (!(len = expandPlainMacro( str, pos, rst )))
+                goto nohit;
+        }
+            if (len < 0) {
+                pos -= len;
+                continue;
+            }
+            if (state.dquote) {
+                rsts = rst.join( " " );
+                rsts.replace( QRegExp("([$`\"\\\\])"), "\\\\1" );
+            } else if (state.current == dollarquote) {
+                rsts = rst.join( " " );
+                rsts.replace( QRegExp("(['\\\\])"), "\\\\1" );
+            } else if (state.current == singlequote) {
+                rsts = rst.join( " " );
+                rsts.replace( '\'', "'\\''");
+            } else {
+                if (rst.isEmpty()) {
+                    str.remove( pos, len );
+                    continue;
+                } else {
+                    rsts = "'";
+
+
+
+
+
+                    for (QStringList::ConstIterator it = rst.begin(); it != rst.end(); ++it) {
+                        if (it != rst.begin())
+                            rsts += "' '";
+                        QString trsts( *it );
+                        trsts.replace( '\'', "'\\''" );
+                        rsts += trsts;
+                    }
+
+                    rsts += "'";
+                }
+            }
+            rst.clear();
+            str.replace( pos, len, rsts );
+            pos += rsts.length();
+            continue;
+      nohit:
+        if (state.current == singlequote) {
+            if (cc == '\'')
+                state = sstack.pop();
+        } else if (cc == '\\') {
+
+            pos += 2;
+            continue;
+        } else if (state.current == dollarquote) {
+            if (cc == '\'')
+                state = sstack.pop();
+        } else if (cc == '$') {
+            cc = str[++pos];
+            if (cc == '(') {
+                sstack.push( state );
+                if (str[pos + 1] == '(') {
+                    Save sav = { str, pos + 2 };
+                    ostack.push( sav );
+                    state.current = math;
+                    pos += 2;
+                    continue;
+                } else {
+                    state.current = paren;
+                    state.dquote = false;
+                }
+            } else if (cc == '{') {
+                sstack.push( state );
+                state.current = subst;
+            } else if (!state.dquote) {
+                if (cc == '\'') {
+                    sstack.push( state );
+                    state.current = dollarquote;
+                } else if (cc == '"') {
+                    sstack.push( state );
+                    state.current = doublequote;
+                    state.dquote = true;
+                }
+            }
+
+        } else if (cc == '`') {
+            str.replace( pos, 1, "$( " );
+            pos2 = pos += 3;
+            for (;;) {
+                if (pos2 >= str.length()) {
+                    pos = pos2;
+                    return false;
+                }
+                cc = str.unicode()[pos2];
+                if (cc == '`')
+                    break;
+                if (cc == '\\') {
+                    cc = str[++pos2];
+                    if (cc == '$' || cc == '`' || cc == '\\' ||
+                        (cc == '"' && state.dquote))
+                    {
+                        str.remove( pos2 - 1, 1 );
+                        continue;
+                    }
+                }
+                pos2++;
+            }
+            str[pos2] = ')';
+            sstack.push( state );
+            state.current = paren;
+            state.dquote = false;
+            continue;
+        } else if (state.current == doublequote) {
+            if (cc == '"')
+                state = sstack.pop();
+        } else if (cc == '\'') {
+            if (!state.dquote) {
+                sstack.push( state );
+                state.current = singlequote;
+            }
+        } else if (cc == '"') {
+            if (!state.dquote) {
+                sstack.push( state );
+                state.current = doublequote;
+                state.dquote = true;
+            }
+        } else if (state.current == subst) {
+            if (cc == '}')
+                state = sstack.pop();
+        } else if (cc == ')') {
+            if (state.current == math) {
+                if (str[pos + 1] == ')') {
+                    state = sstack.pop();
+                    pos += 2;
+                } else {
+
+
+                    pos = ostack.top().pos;
+                    str = ostack.top().str;
+                    ostack.pop();
+                    state.current = paren;
+                    state.dquote = false;
+                    sstack.push( state );
+                }
+                continue;
+            } else if (state.current == paren)
+                state = sstack.pop();
+            else
+                break;
+        } else if (cc == '}') {
+            if (state.current == KMacroExpander::group)
+                state = sstack.pop();
+            else
+                break;
+        } else if (cc == '(') {
+            sstack.push( state );
+            state.current = paren;
+        } else if (cc == '{') {
+            sstack.push( state );
+            state.current = KMacroExpander::group;
+        }
+        pos++;
+    }
+    return sstack.empty();
+}
+
+bool KMacroExpanderBase::expandMacrosShellQuote( QString &str )
+{
+  uint pos = 0;
+  return expandMacrosShellQuote( str, pos ) && pos == str.length();
+}
+
+int KMacroExpanderBase::expandPlainMacro( const QString &, uint, QStringList & )
+{ qFatal( "KMacroExpanderBase::expandPlainMacro called!" ); return 0; }
+
+int KMacroExpanderBase::expandEscapedMacro( const QString &, uint, QStringList & )
+{ qFatal( "KMacroExpanderBase::expandEscapedMacro called!" ); return 0; }
+
+
+
+
+template<class KT,class VT>
+class KMacroMapExpander : public KMacroExpanderBase {
+
+public:
+    KMacroMapExpander( const QMap<KT,VT> &map, QChar c = '%' ) :
+        KMacroExpanderBase( c ), macromap( map ) {}
+
+protected:
+    virtual int expandPlainMacro( const QString &str, uint pos, QStringList &ret );
+    virtual int expandEscapedMacro( const QString &str, uint pos, QStringList &ret );
+
+private:
+    QMap<KT,VT> macromap;
+};
+
+static QStringList &operator+=( QStringList &s, const QString &n) { s << n; return s; }
+
+
+
+template<class VT>
+class KMacroMapExpander<QChar,VT> : public KMacroExpanderBase {
+
+public:
+    KMacroMapExpander( const QMap<QChar,VT> &map, QChar c = '%' ) :
+        KMacroExpanderBase( c ), macromap( map ) {}
+
+protected:
+    virtual int expandPlainMacro( const QString &str, uint pos, QStringList &ret );
+    virtual int expandEscapedMacro( const QString &str, uint pos, QStringList &ret );
+
+private:
+    QMap<QChar,VT> macromap;
+};
+
+template<class VT>
+int
+KMacroMapExpander<QChar,VT>::expandPlainMacro( const QString &str, uint pos, QStringList &ret )
+{
+    QMapConstIterator<QChar,VT> it = macromap.find(str[pos]);
+    if (it != macromap.end()) {
+       ret += it.data();
+       return 1;
+    }
+    return 0;
+}
+
+template<class VT>
+int
+KMacroMapExpander<QChar,VT>::expandEscapedMacro( const QString &str, uint pos, QStringList &ret )
+{
+    if (str[pos + 1] == escapeChar()) {
+        ret += QString( escapeChar() );
+        return 2;
+    }
+
+    QMapConstIterator<QChar,VT> it = macromap.find(str[pos+1]);
+    if (it != macromap.end()) {
+       ret += it.data();
+       return 2;
+    }
+    return false;
+}
+
+template<class VT>
+class KMacroMapExpander<QString,VT> : public KMacroExpanderBase {
+
+public:
+    KMacroMapExpander( const QMap<QString,VT> &map, QChar c = '%' ) :
+        KMacroExpanderBase( c ), macromap( map ) {}
+
+protected:
+    virtual int expandPlainMacro( const QString &str, uint pos, QStringList &ret );
+    virtual int expandEscapedMacro( const QString &str, uint pos, QStringList &ret );
+
+private:
+    bool isIdentifier(uint c) { return c == '_' || (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9'); }
+    QMap<QString,VT> macromap;
+};
+
+template<class VT>
+int
+KMacroMapExpander<QString,VT>::expandPlainMacro( const QString &str, uint pos, QStringList &ret )
+{
+    if (isIdentifier( str[pos - 1].unicode() ))
+        return 0;
+    uint sl;
+    for (sl = 0; isIdentifier( str[pos + sl].unicode() ); sl++);
+    if (!sl)
+        return 0;
+    QMapConstIterator<QString,VT> it =
+        macromap.find( QConstString( str.unicode() + pos, sl ).string() );
+    if (it != macromap.end()) {
+        ret += it.data();
+        return sl;
+    }
+    return false;
+}
+
+template<class VT>
+int
+KMacroMapExpander<QString,VT>::expandEscapedMacro( const QString &str, uint pos, QStringList &ret )
+{
+    if (str[pos + 1] == escapeChar()) {
+        ret += QString( escapeChar() );
+        return 2;
+    }
+    uint sl, rsl, rpos;
+    if (str[pos + 1] == '{') {
+        rpos = pos + 2;
+        for (sl = 0; str[rpos + sl] != '}'; sl++);
+        rsl = sl + 3;
+    } else {
+        rpos = pos + 1;
+        for (sl = 0; isIdentifier( str[rpos + sl].unicode() ); sl++);
+        rsl = sl + 1;
+    }
+    if (!sl)
+        return 0;
+    QMapConstIterator<QString,VT> it =
+        macromap.find( QConstString( str.unicode() + rpos, sl ).string() );
+    if (it != macromap.end()) {
+        ret += it.data();
+        return rsl;
+    }
+    return false;
+}
+
+
+
+template<class KT,class VT>
+inline QString
+TexpandMacros( const QString &ostr, const QMap<KT,VT> &map, QChar c )
+{
+    QString str( ostr );
+    KMacroMapExpander<KT,VT> kmx( map, c );
+    kmx.expandMacros( str );
+    return str;
+}
+
+template<class KT,class VT>
+inline QString
+TexpandMacrosShellQuote( const QString &ostr, const QMap<KT,VT> &map, QChar c )
+{
+    QString str( ostr );
+    KMacroMapExpander<KT,VT> kmx( map, c );
+    if (!kmx.expandMacrosShellQuote( str ))
+        return QString::null;
+    return str;
+}
+
+
+namespace KMacroExpander {
+
+  QString expandMacros( const QString &ostr, const QMap<QChar,QString> &map, QChar c ) { return TexpandMacros( ostr, map, c ); }
+  QString expandMacrosShellQuote( const QString &ostr, const QMap<QChar,QString> &map, QChar c ) { return TexpandMacrosShellQuote( ostr, map, c ); }
+  QString expandMacros( const QString &ostr, const QMap<QString,QString> &map, QChar c ) { return TexpandMacros( ostr, map, c ); }
+  QString expandMacrosShellQuote( const QString &ostr, const QMap<QString,QString> &map, QChar c ) { return TexpandMacrosShellQuote( ostr, map, c ); }
+  QString expandMacros( const QString &ostr, const QMap<QChar,QStringList> &map, QChar c ) { return TexpandMacros( ostr, map, c ); }
+  QString expandMacrosShellQuote( const QString &ostr, const QMap<QChar,QStringList> &map, QChar c ) { return TexpandMacrosShellQuote( ostr, map, c ); }
+  QString expandMacros( const QString &ostr, const QMap<QString,QStringList> &map, QChar c ) { return TexpandMacros( ostr, map, c ); }
+  QString expandMacrosShellQuote( const QString &ostr, const QMap<QString,QStringList> &map, QChar c ) { return TexpandMacrosShellQuote( ostr, map, c ); }
+
+}
+
+static lt_dlhandle KIDNA_lib;
+static bool KIDNA_lib_load_failed;
+
+typedef int (*KIDNA_utf8_to_ace_t)(const char *, char **);
+typedef int (*KIDNA_utf8ace_to_utf8_t)(const char *, char **);
+
+static KIDNA_utf8_to_ace_t KIDNA_utf8_to_ace;
+static KIDNA_utf8ace_to_utf8_t KIDNA_utf8ace_to_utf8;
+
+static void KIDNA_load_lib()
+{
+   KIDNA_lib_load_failed = true;
+   KIDNA_lib = lt_dlopen("/usr/local/lib/libidn.la");
+   if (!KIDNA_lib)
+   {
+      KIDNA_lib = lt_dlopen("/usr/lib/libidn.la");
+   }
+
+   if (!KIDNA_lib)
+      return;
+
+   KIDNA_utf8_to_ace = (KIDNA_utf8_to_ace_t) lt_dlsym(KIDNA_lib, "idna_utf8_to_ace");
+   if (!KIDNA_utf8_to_ace)
+   {
+      kdWarning() << "Symbol idna_utf8_to_ace not found." << endl;
+      return;
+   }
+
+   KIDNA_utf8ace_to_utf8 = (KIDNA_utf8ace_to_utf8_t) lt_dlsym(KIDNA_lib, "idna_utf8ace_to_utf8");
+   if (!KIDNA_utf8ace_to_utf8)
+   {
+      kdWarning() << "Symbol idna_utf8ace_to_utf8 not found." << endl;
+      return;
+   }
+   KIDNA_lib_load_failed = false;
+}
+
+QCString KIDNA::toAsciiCString(const QString &idna)
+{
+   int l = idna.length();
+   const QChar *u = idna.unicode();
+   bool needConversion = false;
+   for(;l--;)
+   {
+      if ((*u++).unicode() > 127)
+      {
+          needConversion = true;
+          break;
+      }
+   }
+   if (!needConversion)
+      return idna.lower().latin1();
+
+   if (!KIDNA_lib && !KIDNA_lib_load_failed)
+   {
+      KIDNA_load_lib();
+   }
+
+   if (KIDNA_lib_load_failed)
+   {
+      return 0;
+   }
+   else
+   {
+
+
+      bool bStartsWithDot = (idna[0] == '.');
+      char *pOutput;
+      if ((*KIDNA_utf8_to_ace)(idna.utf8().data()+(bStartsWithDot ? 1: 0), &pOutput) == 0)
+      {
+         QCString result = pOutput;
+         free(pOutput);
+         if (bStartsWithDot)
+            return "."+result;
+         return result;
+      }
+      else
+      {
+         return 0;
+      }
+   }
+}
+
+QString KIDNA::toAscii(const QString &idna)
+{
+   int l = idna.length();
+   const QChar *u = idna.unicode();
+   bool needConversion = false;
+   for(;l--;)
+   {
+      if ((*u++).unicode() > 127)
+      {
+          needConversion = true;
+          break;
+      }
+   }
+   if (!needConversion)
+      return idna.lower();
+
+   if (!KIDNA_lib && !KIDNA_lib_load_failed)
+   {
+      KIDNA_load_lib();
+   }
+
+   if (KIDNA_lib_load_failed)
+   {
+      return QString::null;
+   }
+   else
+   {
+
+
+      bool bStartsWithDot = (idna[0] == '.');
+      char *pOutput;
+      if ((*KIDNA_utf8_to_ace)(idna.utf8().data()+(bStartsWithDot ? 1: 0), &pOutput) == 0)
+      {
+         QString result(pOutput);
+         free(pOutput);
+         if (bStartsWithDot)
+            return "."+result;
+         return result;
+      }
+      else
+      {
+         return QString::null;
+      }
+   }
+}
+
+QString KIDNA::toUnicode(const QString &idna)
+{
+   if (!KIDNA_lib && !KIDNA_lib_load_failed)
+   {
+      KIDNA_load_lib();
+   }
+
+   if (KIDNA_lib_load_failed)
+   {
+      return idna.lower();
+   }
+   else
+   {
+      char *pOutput;
+      if ((*KIDNA_utf8ace_to_utf8)(idna.utf8(), &pOutput) == 0)
+      {
+         QString result = QString::fromUtf8(pOutput);
+         free(pOutput);
+         return result;
+      }
+      else
+      {
+         return idna.lower();
+      }
+   }
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C"
+
+int mkstemps(char *, int);
+extern "C"
+
+unsigned long strlcat(char*, const char*, unsigned long);
+
+
+
+
+
+
+extern "C"
+
+unsigned long strlcpy(char*, const char*, unsigned long);
+
+
+
+
+
+
+
+
+class QDir;
+class KTempDirPrivate;
+class KTempDir
+{
+public:
+   KTempDir(QString directoryPrefix=QString::null,
+             int mode = 0700 );
+
+
+
+
+
+   ~KTempDir();
+
+
+
+
+
+
+   void setAutoDelete(bool autoDelete) { bAutoDelete = autoDelete; }
+   int status() const;
+
+
+
+
+
+
+   QString name() const;
+
+
+
+
+
+
+
+   QDir *qDir();
+
+
+
+
+   void unlink();
+
+
+
+
+   bool existing() const;
+
+protected:
+
+   bool create(const QString &directoryPrefix, int mode);
+
+   void setError(int error) { mError = error; }
+
+private:
+   int mError;
+   QString mTmpName;
+   bool bExisting;
+   bool bAutoDelete;
+
+   KTempDirPrivate *d;
+};
+
+
+
+
+KTempDir::KTempDir(QString directoryPrefix, int mode)
+{
+   bAutoDelete = false;
+   bExisting = false;
+   mError=0;
+   if (directoryPrefix.isEmpty())
+   {
+      directoryPrefix = locateLocal("tmp", KGlobal::instance()->instanceName());
+   }
+   (void) create(directoryPrefix , mode);
+}
+
+bool
+KTempDir::create(const QString &directoryPrefix, int mode)
+{
+
+   (void) KApplication::random();
+
+   QCString nme = QFile::encodeName(directoryPrefix) + "XXXXXX";
+   char *realName;
+   if((realName=mkdtemp(nme.data())) == 0)
+   {
+
+       QCString nme = QFile::encodeName(directoryPrefix) + "XXXXXX";
+       qWarning("KTempDir: Error trying to create %s: %s", nme.data(), strerror((*__errno_location ())));
+       mError = (*__errno_location ());
+       mTmpName = QString::null;
+       return false;
+   }
+
+
+   QCString realNameStr(realName);
+   mTmpName = QFile::decodeName(realNameStr)+"/";
+   kdDebug()<<"KTempDir: Temporary directory created :"<<realNameStr<<endl;
+   kdDebug()<<"KTempDir: Temporary directory created :"<<mTmpName<<endl;
+   mode_t tmp = 0;
+   mode_t umsk = umask(tmp);
+   umask(umsk);
+   chmod(nme, mode&(~umsk));
+
+
+   bExisting = true;
+
+
+   chown(nme, getuid(), getgid());
+   return true;
+}
+
+KTempDir::~KTempDir()
+{
+   if (bAutoDelete)
+      unlink();
+}
+
+int
+KTempDir::status() const
+{
+   return mError;
+}
+
+QString
+KTempDir::name() const
+{
+   return mTmpName;
+}
+
+bool
+KTempDir::existing() const
+{
+   return bExisting;
+}
+
+QDir *
+KTempDir::qDir()
+{
+   if (bExisting) return new QDir(mTmpName);
+   return 0;
+}
+
+void
+KTempDir::unlink()
+{
+   if (!bExisting) return;
+   QString rmstr("/bin/rm -rf ");
+   rmstr += KProcess::quote(mTmpName);
+   ::system( QFile::encodeName(rmstr) );
+
+   bExisting=false;
+   mError=0;
+}
+static int fromHex( QChar c )
+{
+    if (c >= '0' && c <= '9')
+        return c - '0';
+    else if (c >= 'A' && c <= 'F')
+        return c - 'A' + 10;
+    else if (c >= 'a' && c <= 'f')
+        return c - 'a' + 10;
+    return -1;
+}
+
+inline static bool isQuoteMeta( uint c )
+{
+    return c == '\\' || c == '\'' || c == '"' || c == '$';
+
+}
+
+inline static bool isMeta( uint c )
+{
+    static const uchar iqm[] = {
+        0x00, 0x00, 0x00, 0x00, 0xdc, 0x07, 0x00, 0xd8,
+        0x00, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x38
+    };
+
+    return (c < sizeof(iqm) * 8) && (iqm[c / 8] & (1 << (c & 7)));
+}
+
+QStringList KShell::splitArgs( const QString &args, int flags, int *err )
+{
+    QStringList ret;
+    bool firstword = flags & AbortOnMeta;
+
+    for (uint pos = 0; ; ) {
+        QChar c;
+        do {
+            if (pos >= args.length())
+                goto okret;
+            c = args.unicode()[pos++];
+        } while (c.isSpace());
+        QString cret;
+        if ((flags & TildeExpand) && c == '~') {
+            uint opos = pos;
+            for (; ; pos++) {
+                if (pos >= args.length())
+                    break;
+                c = args.unicode()[pos];
+                if (c == '/' || c.isSpace())
+                    break;
+                if (isQuoteMeta( c )) {
+                    pos = opos;
+                    c = '~';
+                    goto notilde;
+                }
+                if ((flags & AbortOnMeta) && isMeta( c ))
+                    goto metaerr;
+            }
+            QString ccret = homeDir( QConstString( args.unicode() + opos, pos - opos ).string() );
+            if (ccret.isEmpty()) {
+                pos = opos;
+                c = '~';
+                goto notilde;
+            }
+            if (pos >= args.length()) {
+                ret += ccret;
+                goto okret;
+            }
+            pos++;
+            if (c.isSpace()) {
+                ret += ccret;
+                firstword = false;
+                continue;
+            }
+            cret = ccret;
+        }
+
+        if (firstword) {
+            if (c == '_' || (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z')) {
+                uint pos2 = pos;
+                QChar cc;
+                do
+                  cc = args[pos2++];
+                while (cc == '_' || (cc >= 'A' && cc <= 'Z') ||
+                       (cc >= 'a' && cc <= 'z') || (cc >= '0' && cc <= '9'));
+                if (cc == '=')
+                    goto metaerr;
+            }
+        }
+      notilde:
+        do {
+            if (c == '\'') {
+                uint spos = pos;
+                do {
+                    if (pos >= args.length())
+                        goto quoteerr;
+                    c = args.unicode()[pos++];
+                } while (c != '\'');
+                cret += QConstString( args.unicode() + spos, pos - spos - 1 ).string();
+            } else if (c == '"') {
+                for (;;) {
+                    if (pos >= args.length())
+                        goto quoteerr;
+                    c = args.unicode()[pos++];
+                    if (c == '"')
+                        break;
+                    if (c == '\\') {
+                        if (pos >= args.length())
+                            goto quoteerr;
+                        c = args.unicode()[pos++];
+                        if (c != '"' && c != '\\' &&
+                            !((flags & AbortOnMeta) && (c == '$' || c == '`')))
+                            cret += '\\';
+                    } else if ((flags & AbortOnMeta) && (c == '$' || c == '`'))
+                        goto metaerr;
+                    cret += c;
+                }
+            } else if (c == '$' && args[pos] == '\'') {
+                pos++;
+                for (;;) {
+                    if (pos >= args.length())
+                        goto quoteerr;
+                    c = args.unicode()[pos++];
+                    if (c == '\'')
+                        break;
+                    if (c == '\\') {
+                        if (pos >= args.length())
+                            goto quoteerr;
+                        c = args.unicode()[pos++];
+                        switch (c) {
+                        case 'a': cret += '\a'; break;
+                        case 'b': cret += '\b'; break;
+                        case 'e': cret += '\033'; break;
+                        case 'f': cret += '\f'; break;
+                        case 'n': cret += '\n'; break;
+                        case 'r': cret += '\r'; break;
+                        case 't': cret += '\t'; break;
+                        case '\\': cret += '\\'; break;
+                        case '\'': cret += '\''; break;
+                        case 'c': cret += args[pos++] & 31; break;
+                        case 'x':
+                          {
+                            int hv = fromHex( args[pos] );
+                            if (hv < 0) {
+                                cret += "\\x";
+                            } else {
+                                int hhv = fromHex( args[++pos] );
+                                if (hhv > 0) {
+                                    hv = hv * 16 + hhv;
+                                    pos++;
+                                }
+                                cret += QChar( hv );
+                            }
+                            break;
+                          }
+                        default:
+                            if (c >= '0' && c <= '7') {
+                                int hv = c - '0';
+                                for (int i = 0; i < 2; i++) {
+                                    c = args[pos];
+                                    if (c < '0' || c > '7')
+                                        break;
+                                    hv = hv * 8 + (c - '0');
+                                    pos++;
+                                }
+                                cret += QChar( hv );
+                            } else {
+                                cret += '\\';
+                                cret += c;
+                            }
+                            break;
+                        }
+                    } else
+                        cret += c;
+                }
+            } else {
+                if (c == '\\') {
+                    if (pos >= args.length())
+                        goto quoteerr;
+                    c = args.unicode()[pos++];
+                    if (!c.isSpace() &&
+                        !((flags & AbortOnMeta) ? isMeta( c ) : isQuoteMeta( c )))
+                        cret += '\\';
+                } else if ((flags & AbortOnMeta) && isMeta( c ))
+                    goto metaerr;
+                cret += c;
+            }
+            if (pos >= args.length())
+                break;
+            c = args.unicode()[pos++];
+        } while (!c.isSpace());
+        ret += cret;
+        firstword = false;
+    }
+
+  okret:
+    if (err)
+        *err = NoError;
+    return ret;
+
+  quoteerr:
+   if (err)
+       *err = BadQuoting;
+   return QStringList();
+
+  metaerr:
+   if (err)
+       *err = FoundMeta;
+   return QStringList();
+}
+
+inline static bool isSpecial( uint c )
+{
+    static const uchar iqm[] = {
+        0xff, 0xff, 0xff, 0xff, 0xdd, 0x07, 0x00, 0xd8,
+        0x00, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x38
+    };
+
+    return (c < sizeof(iqm) * 8) && (iqm[c / 8] & (1 << (c & 7)));
+}
+
+QString KShell::joinArgs( const QStringList &args )
+{
+    QChar q( '\'' );
+    QString ret;
+    for (QStringList::ConstIterator it = args.begin(); it != args.end(); ++it) {
+        if (!ret.isEmpty())
+            ret += ' ';
+        if (!(*it).length())
+            ret.append( q ).append( q );
+        else {
+            for (uint i = 0; i < (*it).length(); i++)
+                if (isSpecial((*it).unicode()[i])) {
+                    QString tmp(*it);
+                    tmp.replace( q, "'\\''" );
+                    ret += q;
+                    tmp += q;
+                    ret += tmp;
+                    goto ex;
+                }
+            ret += *it;
+          ex: ;
+        }
+    }
+    return ret;
+}
+
+QString KShell::joinArgs( const char * const *args, int nargs )
+{
+    if (!args)
+        return QString::null;
+    QChar q( '\'' );
+    QString ret;
+    for (const char * const *argp = args; nargs && *argp; argp++, nargs--) {
+        if (!ret.isEmpty())
+            ret += ' ';
+        if (!**argp)
+            ret.append( q ).append( q );
+        else {
+            QString tmp( QFile::decodeName( *argp ) );
+            for (uint i = 0; i < tmp.length(); i++)
+                if (isSpecial(tmp.unicode()[i])) {
+                    tmp.replace( q, "'\\''" );
+                    ret += q;
+                    tmp += q;
+                    ret += tmp;
+                    goto ex;
+                }
+            ret += tmp;
+          ex: ;
+       }
+    }
+    return ret;
+}
+
+QString KShell::joinArgsDQ( const QStringList &args )
+{
+    QChar q( '\'' ), sp( ' ' ), bs( '\\' );
+    QString ret;
+    for (QStringList::ConstIterator it = args.begin(); it != args.end(); ++it) {
+        if (!ret.isEmpty())
+            ret += sp;
+        if (!(*it).length())
+            ret.append( q ).append( q );
+        else {
+            for (uint i = 0; i < (*it).length(); i++)
+                if (isSpecial((*it).unicode()[i])) {
+                    ret.append( '$' ).append( q );
+                    for (uint pos = 0; pos < (*it).length(); pos++) {
+                        int c = (*it).unicode()[pos];
+                        if (c < 32) {
+                            ret += bs;
+                            switch (c) {
+                            case '\a': ret += 'a'; break;
+                            case '\b': ret += 'b'; break;
+                            case '\033': ret += 'e'; break;
+                            case '\f': ret += 'f'; break;
+                            case '\n': ret += 'n'; break;
+                            case '\r': ret += 'r'; break;
+                            case '\t': ret += 't'; break;
+                            case '\034': ret += 'c'; ret += '|'; break;
+                            default: ret += 'c'; ret += c + '@'; break;
+                            }
+                        } else {
+                            if (c == '\'' || c == '\\')
+                                ret += bs;
+                            ret += c;
+                        }
+                    }
+                    ret.append( q );
+                    goto ex;
+                }
+            ret += *it;
+          ex: ;
+        }
+    }
+    return ret;
+}
+
+QString KShell::tildeExpand( const QString &fname )
+{
+    if (fname[0] == '~') {
+        int pos = fname.find( '/' );
+        if (pos < 0)
+            return homeDir( QConstString( fname.unicode() + 1, fname.length() - 1 ).string() );
+        QString ret = homeDir( QConstString( fname.unicode() + 1, pos - 1 ).string() );
+        if (!ret.isNull())
+            ret += QConstString( fname.unicode() + pos, fname.length() - pos ).string();
+        return ret;
+    }
+    return fname;
+}
+
+QString KShell::homeDir( const QString &user )
+{
+    if (user.isEmpty())
+        return QFile::decodeName( getenv( "HOME" ) );
+    struct passwd *pw = getpwnam( QFile::encodeName( user ).data() );
+    if (!pw)
+        return QString::null;
+    return QFile::decodeName( pw->pw_dir );
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C"
+
+int mkstemps(char *, int);
+extern "C"
+
+unsigned long strlcat(char*, const char*, unsigned long);
+
+
+
+
+
+
+extern "C"
+
+unsigned long strlcpy(char*, const char*, unsigned long);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+extern "C" {
+
+
+struct mntent
+  {
+    char *mnt_fsname;
+    char *mnt_dir;
+    char *mnt_type;
+    char *mnt_opts;
+    int mnt_freq;
+    int mnt_passno;
+  };
+
+
+
+
+extern FILE *setmntent (__const char *__file, __const char *__mode) throw ();
+
+
+
+
+extern struct mntent *getmntent (FILE *__stream) throw ();
+
+
+
+extern struct mntent *getmntent_r (FILE *__restrict __stream,
+                                   struct mntent *__restrict __result,
+                                   char *__restrict __buffer,
+                                   int __bufsize) throw ();
+
+
+
+
+extern int addmntent (FILE *__restrict __stream,
+                      __const struct mntent *__restrict __mnt) throw ();
+
+
+extern int endmntent (FILE *__stream) throw ();
+
+
+
+extern char *hasmntopt (__const struct mntent *__mnt,
+                        __const char *__opt) throw ();
+
+
+}
+
+
+
+
+
+
+
+
+enum
+{
+  MS_RDONLY = 1,
+  MS_NOSUID = 2,
+  MS_NODEV = 4,
+  MS_NOEXEC = 8,
+  MS_SYNCHRONOUS = 16,
+  MS_REMOUNT = 32,
+  MS_MANDLOCK = 64,
+  S_WRITE = 128,
+  S_APPEND = 256,
+  S_IMMUTABLE = 512,
+  MS_NOATIME = 1024,
+  MS_NODIRATIME = 2048,
+  MS_BIND = 4096,
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+enum
+{
+  MNT_FORCE = 1
+};
+
+
+extern "C" {
+
+
+extern int mount (__const char *__special_file, __const char *__dir,
+                  __const char *__fstype, unsigned long int __rwflag,
+                  __const void *__data) throw ();
+
+
+extern int umount (__const char *__special_file) throw ();
+
+
+extern int umount2 (__const char *__special_file, int __flags) throw ();
+
+}
+
+
+
+
+
+struct fstab
+  {
+    char *fs_spec;
+    char *fs_file;
+    char *fs_vfstype;
+    char *fs_mntops;
+    const char *fs_type;
+    int fs_freq;
+    int fs_passno;
+  };
+
+
+extern "C" {
+
+extern struct fstab *getfsent (void) throw ();
+extern struct fstab *getfsspec (__const char *__name) throw ();
+extern struct fstab *getfsfile (__const char *__name) throw ();
+extern int setfsent (void) throw ();
+extern void endfsent (void) throw ();
+
+}
+
+
+
+
+KMountPoint::KMountPoint()
+{
+}
+
+KMountPoint::~KMountPoint()
+{
+}
+
+
+KMountPoint::List KMountPoint::possibleMountPoints(int infoNeeded)
+{
+  KMountPoint::List result;
+
+
+   FILE * fstab;
+   if ((fstab = setmntent("/etc/fstab", "r")) == 0)
+      return result;
+
+   struct mntent * fe;
+   while (((fe = getmntent(fstab)) != 0))
+   {
+      KMountPoint *mp = new KMountPoint();
+      mp->m_mountedFrom = QFile::decodeName(fe->mnt_fsname);
+
+      mp->m_mountPoint = QFile::decodeName(fe->mnt_dir);
+      mp->m_mountType = QFile::decodeName(fe->mnt_type);
+      if (infoNeeded & NeedMountOptions)
+      {
+         QString options = QFile::decodeName(fe->mnt_opts);
+         mp->m_mountOptions = QStringList::split(',', options);
+      }
+
+      if (infoNeeded & NeedRealDeviceName)
+      {
+         if (mp->m_mountedFrom.startsWith("/"))
+            mp->m_device = KStandardDirs::realPath(mp->m_mountedFrom);
+      }
+
+      result.append(mp);
+   }
+   endmntent(fstab);
+   return result;
+}
+
+KMountPoint::List KMountPoint::currentMountPoints(int infoNeeded)
+{
+  KMountPoint::List result;
+   FILE * mnttab;
+   if ((mnttab = setmntent("/etc/mtab", "r")) == 0)
+      return result;
+
+   struct mntent * fe;
+   while (((fe = getmntent(mnttab)) != 0))
+   {
+      KMountPoint *mp = new KMountPoint();
+      mp->m_mountedFrom = QFile::decodeName(fe->mnt_fsname);
+
+      mp->m_mountPoint = QFile::decodeName(fe->mnt_dir);
+      mp->m_mountType = QFile::decodeName(fe->mnt_type);
+      if (infoNeeded & NeedMountOptions)
+      {
+         QString options = QFile::decodeName(fe->mnt_opts);
+         mp->m_mountOptions = QStringList::split(',', options);
+      }
+
+      if (infoNeeded & NeedRealDeviceName)
+      {
+         if (mp->m_mountedFrom.startsWith("/"))
+            mp->m_device = KStandardDirs::realPath(mp->m_mountedFrom);
+      }
+
+      result.append(mp);
+   }
+   endmntent(mnttab);
+
+   return result;
+}
+static const int gMonthDay[2][13]={
+        {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},
+        {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},
+};
+
+static const int jMonthDay[2][13] = {
+        {0, 31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29},
+        {0, 31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 30},
+};
+
+typedef struct {
+        int day;
+        int mon;
+        int year;
+        } SDATE;
+
+
+static int Ceil(float number)
+{
+    int ret;
+    if(number>0)
+        number += 0.5;
+    ret =(int) number;
+    return ret;
+}
+
+static long jalali_jdn(int year, int month, int day)
+{
+    const long PERSIAN_EPOCH = 1948321;
+    int epbase;
+    long epyear;
+    long mdays;
+    long jdn;
+    epbase = year - 474;
+    epyear = 474 + (epbase % 2820);
+    if (month <= 7)
+        mdays = (month - 1) * 31;
+    else
+        mdays = (month - 1) * 30 + 6;
+    jdn = day + mdays ;
+    jdn += (((epyear * 682) - 110) / 2816) ;
+    jdn += (epyear - 1) * 365;
+    jdn += (epbase / 2820) * 1029983 ;
+    jdn += (PERSIAN_EPOCH - 1);
+    return jdn;
+}
+
+
+static SDATE jdn_jalali(long jdn)
+{
+    static SDATE ret;
+    int day, month, year;
+    int iYear, iMonth, iDay;
+    int depoch;
+    int cycle;
+    int cyear;
+    int ycycle;
+    int aux1, aux2;
+    int yday;
+    day = 1;
+    month = 1;
+    year = 475;
+    depoch = jdn - jalali_jdn(year,month, day);
+    cycle = (int) (depoch / 1029983);
+    cyear = depoch % 1029983;
+    if( cyear == 1029982)
+        ycycle = 2820;
+    else{
+        aux1 = cyear / 366;
+        aux2 = cyear % 366;
+        ycycle = (((2134 * aux1) + (2816 * aux2) + 2815) / 1028522) + aux1 + 1;
+    }
+    iYear = ycycle + (2820 * cycle) + 474;
+    if (iYear <= 0)
+        iYear = iYear - 1;
+    year = iYear;
+    yday = (jdn - jalali_jdn(year, month, day)) + 1;
+    if(yday <= 186 )
+        iMonth = Ceil((yday-1) / 31);
+    else
+        iMonth = Ceil((yday - 7) / 30);
+    iMonth++;
+    month = iMonth;
+    iDay = (jdn - jalali_jdn(year, month, day)) + 1;
+    ret.day = iDay;
+    ret.mon = iMonth;
+    ret.year = iYear;
+    return ret;
+}
+
+
+
+static long civil_jdn(int year, int month, int day)
+{
+    long jdn = ((1461 * (year + 4800 + ((month - 14) / 12))) / 4)
+        + ((367 * (month - 2 - 12 * (((month - 14) / 12)))) / 12)
+        - ((3 * (((year + 4900 + ((month - 14) / 12)) / 100))) / 4)
+        + day - 32075;
+    return jdn;
+}
+
+static SDATE jdn_civil(long jdn)
+{
+    long l, n, i, j;
+    static SDATE ret;
+    int iday, imonth, iyear;
+    l = jdn + 68569;
+    n = ((4 * l) / 146097);
+    l = l - ((146097 * n + 3) / 4);
+    i = ((4000 * (l + 1)) / 1461001);
+    l = l - ((1461 * i) / 4) + 31;
+    j = ((80 * l) / 2447);
+    iday = l - ((2447 * j) / 80);
+    l = (j / 11);
+    imonth = j + 2 - 12 * l;
+    iyear = 100 * (n - 49) + i + l;
+    ret.day = iday;
+    ret.mon = imonth;
+    ret.year = iyear;
+    return (ret);
+}
+
+static SDATE *jalaliToGregorian(int y,int m,int d)
+{
+static SDATE sd;
+long jday = jalali_jdn(y,m,d);
+sd= jdn_civil(jday);
+return (&sd);
+}
+static SDATE *gregorianToJalali(int y,int m, int d)
+{
+    static SDATE sd;
+    long jdn = civil_jdn(y,m,d);
+    sd = jdn_jalali(jdn);
+    return(&sd);
+}
+static void gregorianToJalali(const QDate & date, int * pYear, int * pMonth,
+                               int * pDay)
+{
+  SDATE *sd;
+  sd = gregorianToJalali(date.year(), date.month(), date.day());
+  if (pYear)
+    *pYear = sd->year;
+  if (pMonth)
+    *pMonth = sd->mon;
+  if (pDay)
+    *pDay = sd->day;
+
+}
+
+
+
+static int isJalaliLeap(int year)
+{
+ int tmp;
+ tmp = year % 33;
+ if (tmp == 1 || tmp == 5||tmp==9||tmp==13||tmp==17||tmp==22||tmp==26||tmp==30)
+     return 1;
+else
+     return 0;
+}
+static int hndays(int m,int y)
+{
+  return jMonthDay[isJalaliLeap(y)][m];
+}
+
+
+KCalendarSystemJalali::KCalendarSystemJalali(const KLocale * locale)
+  : KCalendarSystem(locale)
+{
+}
+
+KCalendarSystemJalali::~KCalendarSystemJalali()
+{
+}
+
+int KCalendarSystemJalali::year(const QDate& date) const
+
+{
+  kdDebug(5400) << "Jalali year..." << endl;
+int y;
+  gregorianToJalali(date, &y, 0, 0);
+  return y;
+}
+
+int KCalendarSystemJalali::month (const QDate& date) const
+
+{
+  kdDebug(5400) << "Jalali month..." << endl;
+int m;
+  gregorianToJalali(date, 0 , &m, 0);
+  return m;
+}
+
+int KCalendarSystemJalali::day(const QDate& date) const
+
+{
+  kdDebug(5400) << "Jalali day..." << endl;
+int d;
+  gregorianToJalali(date, 0, 0, &d);
+  return d;
+}
+
+int KCalendarSystemJalali::dayOfWeek(const QDate& date) const
+{
+
+  return date.dayOfWeek();
+
+}
+
+
+int KCalendarSystemJalali::dayOfYear(const QDate & date) const
+{
+  QDate first;
+  setYMD(first, year(date), 1, 1);
+
+  return first.daysTo(date) + 1;
+}
+
+
+bool KCalendarSystemJalali::setYMD(QDate & date, int y, int m, int d) const
+{
+
+  if ( y < minValidYear() || y > maxValidYear() )
+    return false;
+
+  if ( m < 1 || m > 12 )
+    return false;
+
+  if ( d < 1 || d > hndays(m, y) )
+    return false;
+
+  SDATE *gd =jalaliToGregorian( y, m, d);
+
+  return date.setYMD(gd->year, gd->mon, gd->day);
+}
+
+QDate KCalendarSystemJalali::addYears( const QDate & date, int nyears ) const
+{
+  QDate result = date;
+  int y = year(date) + nyears;
+  setYMD( result, y, month(date), day(date) );
+
+  return result;
+}
+
+QDate KCalendarSystemJalali::addMonths( const QDate & date, int nmonths ) const
+{
+  QDate result = date;
+  int m = month(date);
+  int y = year(date);
+
+  if ( nmonths < 0 )
+  {
+    m += 12;
+    y -= 1;
+  }
+
+  --m;
+  m += nmonths;
+  y += m / 12;
+  m %= 12;
+  ++m;
+
+  setYMD( result, y, m, day(date) );
+
+  return result;
+}
+
+QDate KCalendarSystemJalali::addDays( const QDate & date, int ndays ) const
+{
+  return date.addDays( ndays );
+}
+
+int KCalendarSystemJalali::monthsInYear( const QDate & date ) const
+{
+  (void)date;
+
+  return 12;
+}
+
+int KCalendarSystemJalali::daysInYear(const QDate & date) const
+{
+(void)date;;
+int result;
+
+
+        result=366;
+
+
+return result;
+}
+
+int KCalendarSystemJalali::daysInMonth(const QDate & date) const
+{
+SDATE *sd = gregorianToJalali(date.year(),date.month(),date.day());
+return hndays(sd->mon,sd->year);
+}
+
+int KCalendarSystemJalali::weeksInYear(int year) const
+
+{
+  (void)year;;
+
+return 52;
+}
+
+int KCalendarSystemJalali::weekNumber(const QDate& date, int * yearNum) const
+{
+  QDate firstDayWeek1, lastDayOfYear;
+  int y = year(date);
+  int week;
+  int weekDay1, dayOfWeek1InYear;
+
+
+  setYMD(firstDayWeek1, y, 1, 1);
+  weekDay1 = dayOfWeek(firstDayWeek1);
+
+
+
+  if (weekDay1 > 4 )
+    firstDayWeek1 = addDays(firstDayWeek1 , 7 - weekDay1 + 1);
+
+  dayOfWeek1InYear = dayOfYear(firstDayWeek1);
+
+  if ( dayOfYear(date) < dayOfWeek1InYear )
+  {
+    if ( yearNum )
+      *yearNum = y - 1;
+    return weeksInYear(y - 1);
+  }
+
+  setYMD(lastDayOfYear, y, 12, hndays(12, y));
+  if ( (dayOfYear(date) >= daysInYear(date) - dayOfWeek(lastDayOfYear) + 1)
+
+       && dayOfWeek(lastDayOfYear) < 4)
+    {
+      if ( yearNum )
+        *yearNum = y + 1;
+      week = 1;
+    }
+  else
+    week = firstDayWeek1.daysTo(date) / 7 + 1;
+
+  return week;
+}
+QString KCalendarSystemJalali::yearLiteral (int year) const
+{
+
+
+
+   return QString::number(year);
+}
+
+QString KCalendarSystemJalali::yearLiteral (const QDate & date) const
+{
+
+
+
+
+
+ SDATE *sd= gregorianToJalali(date.year(),date.month(),date.day());
+  return yearLiteral(sd->year);
+}
+
+QString KCalendarSystemJalali::monthName(int month, int year, bool shortName)
+  const
+{
+  (void)year;;
+
+  if (shortName)
+    switch ( month )
+      {
+      case 1:
+        return locale()->translate("Far");
+      case 2:
+        return locale()->translate("Ord");
+      case 3:
+        return locale()->translate("Kho");
+      case 4:
+        return locale()->translate("Tir");
+      case 5:
+        return locale()->translate("Mor");
+      case 6:
+        return locale()->translate("Sha");
+      case 7:
+        return locale()->translate("Meh");
+      case 8:
+        return locale()->translate("Aba");
+      case 9:
+        return locale()->translate("Aza");
+      case 10:
+        return locale()->translate("Dei");
+      case 11:
+        return locale()->translate("Bah");
+      case 12:
+        return locale()->translate("Esf");
+    }
+  else
+    switch ( month )
+      {
+      case 1:
+        return locale()->translate("Farvardin");
+      case 2:
+        return locale()->translate("Ordibehesht");
+      case 3:
+        return locale()->translate("Khordad");
+      case 4:
+        return locale()->translate("Tir");
+      case 5:
+        return locale()->translate("Mordad");
+      case 6:
+        return locale()->translate("Shahrivar");
+      case 7:
+        return locale()->translate("Mehr");
+      case 8:
+        return locale()->translate("Aban");
+      case 9:
+        return locale()->translate("Azar");
+      case 10:
+        return locale()->translate("Dei");
+      case 11:
+        return locale()->translate("Bahman");
+      case 12:
+        return locale()->translate("Esfand");
+      }
+
+  return QString::null;
+}
+
+QString KCalendarSystemJalali::monthName(const QDate& date, bool shortName)
+  const
+{
+int mon;
+gregorianToJalali(date,0,&mon,0);
+
+  return (monthName(mon,shortName));
+}
+
+QString KCalendarSystemJalali::monthNamePossessive(const QDate& date,
+                                                     bool shortName ) const
+{
+  return monthName(date,shortName);
+}
+
+QString KCalendarSystemJalali::monthNamePossessive(int month, int year,
+                                                     bool shortName ) const
+{
+  return monthName(month,year,shortName);
+}
+
+
+QString KCalendarSystemJalali::weekDayName(int day, bool shortName) const
+{
+  if ( shortName )
+    switch (day)
+      {
+      case 1:
+        return locale()->translate("2sh");
+      case 2:
+        return locale()->translate("3sh");
+      case 3:
+        return locale()->translate("4sh");
+      case 4:
+        return locale()->translate("5sh");
+      case 5:
+        return locale()->translate("Jom");
+      case 6:
+        return locale()->translate("shn");
+      case 7:
+        return locale()->translate("1sh");
+      }
+  else
+    switch ( day )
+      {
+      case 1:
+        return locale()->translate("Do shanbe");
+      case 2:
+        return locale()->translate("Se shanbe");
+      case 3:
+        return locale()->translate("Chahar shanbe");
+      case 4:
+        return locale()->translate("Panj shanbe");
+      case 5:
+        return locale()->translate("Jumee");
+      case 6:
+        return locale()->translate("Shanbe");
+      case 7:
+        return locale()->translate("Yek-shanbe");
+      }
+
+  return QString::null;
+}
+
+QString KCalendarSystemJalali::weekDayName(const QDate &date,bool shortName)
+  const
+{
+ return weekDayName(dayOfWeek(date), shortName);
+}
+
+
+int KCalendarSystemJalali::minValidYear() const
+{
+  QDate date(1753, 1, 1);
+
+  return year(date);
+}
+
+
+int KCalendarSystemJalali::maxValidYear() const
+{
+
+
+
+
+
+
+
+  return 10000;
+}
+int KCalendarSystemJalali::weekDayOfPray() const
+{
+  return 5;
+}
+QString KCalendarSystemJalali::calendarName() const
+{
+  return QString::fromLatin1("jalali");
+}
+
+bool KCalendarSystemJalali::isLunar() const
+{
+  return false;
+}
+
+bool KCalendarSystemJalali::isLunisolar() const
+{
+  return false;
+}
+
+bool KCalendarSystemJalali::isSolar() const
+{
+  return true;
+}
+class KProtocolInfoPrivate;
+class KProtocolInfoFactory : public KSycocaFactory
+{
+  public: virtual KSycocaFactoryId factoryId() const { return KST_KProtocolInfoFactory; } private:
+public:
+
+
+
+
+  static KProtocolInfoFactory* self()
+  { if ( !_self) new KProtocolInfoFactory(); return _self; }
+
+  KProtocolInfoFactory();
+  virtual ~KProtocolInfoFactory();
+  KProtocolInfo *findProtocol(const QString &protocol);
+
+
+
+
+
+  QStringList protocols();
+protected:
+
+
+
+
+  virtual KSycocaEntry *createEntry(const QString &, const char *)
+    { return 0; }
+
+
+
+
+  virtual KProtocolInfo *createEntry(int offset);
+
+protected:
+  static KProtocolInfoFactory *_self;
+
+  QString m_lastProtocol;
+  KProtocolInfo::Ptr m_lastInfo;
+protected:
+  virtual void virtual_hook( int id, void* data );
+private:
+  class KProtocolInfoFactoryPrivate* d;
+};
+class KProtocolInfo::KProtocolInfoPrivate
+{
+public:
+  QString docPath;
+  QString protClass;
+  KProtocolInfo::ExtraFieldList extraFields;
+};
+
+
+
+
+KProtocolInfo::KProtocolInfo(const QString &path)
+ : KSycocaEntry(path)
+{
+  d = new KProtocolInfoPrivate;
+  QString fullPath = locate("services", path);
+
+  KSimpleConfig config( fullPath, true );
+  config.setGroup( "Protocol" );
+
+  m_name = config.readEntry( "protocol" );
+  m_exec = config.readPathEntry( "exec" );
+  m_isSourceProtocol = config.readBoolEntry( "source", true );
+  m_isHelperProtocol = config.readBoolEntry( "helper", false );
+  m_supportsReading = config.readBoolEntry( "reading", false );
+  m_supportsWriting = config.readBoolEntry( "writing", false );
+  m_supportsMakeDir = config.readBoolEntry( "makedir", false );
+  m_supportsDeleting = config.readBoolEntry( "deleting", false );
+  m_supportsLinking = config.readBoolEntry( "linking", false );
+  m_supportsMoving = config.readBoolEntry( "moving", false );
+  m_canCopyFromFile = config.readBoolEntry( "copyFromFile", false );
+  m_canCopyToFile = config.readBoolEntry( "copyToFile", false );
+  m_listing = config.readListEntry( "listing" );
+
+  if ( m_listing.count() == 1 && m_listing.first() == "false" )
+    m_listing.clear();
+  m_supportsListing = ( m_listing.count() > 0 );
+  m_defaultMimetype = config.readEntry( "defaultMimetype" );
+  m_determineMimetypeFromExtension = config.readBoolEntry( "determineMimetypeFromExtension", true );
+  m_icon = config.readEntry( "Icon", "mime_empty" );
+  m_config = config.readEntry( "config", m_name );
+  m_maxSlaves = config.readNumEntry( "maxInstances", 1);
+
+  QString tmp = config.readEntry( "input" );
+  if ( tmp == "filesystem" )
+    m_inputType = KProtocolInfo::T_FILESYSTEM;
+  else if ( tmp == "stream" )
+    m_inputType = KProtocolInfo::T_STREAM;
+  else
+    m_inputType = KProtocolInfo::T_NONE;
+
+  tmp = config.readEntry( "output" );
+  if ( tmp == "filesystem" )
+    m_outputType = KProtocolInfo::T_FILESYSTEM;
+  else if ( tmp == "stream" )
+    m_outputType = KProtocolInfo::T_STREAM;
+  else
+    m_outputType = KProtocolInfo::T_NONE;
+
+  d->docPath = config.readPathEntry( "DocPath" );
+  d->protClass = config.readEntry( "Class" ).lower();
+  if (!d->protClass.startsWith(":"))
+     d->protClass.prepend(':');
+
+  QStringList extraNames = config.readListEntry( "ExtraNames" );
+  QStringList extraTypes = config.readListEntry( "ExtraTypes" );
+  QStringList::Iterator it = extraNames.begin();
+  QStringList::Iterator typeit = extraTypes.begin();
+  for( ; it != extraNames.end() && typeit != extraTypes.end(); ++it, ++typeit ) {
+      d->extraFields.append( ExtraField( *it, *typeit ) );
+  }
+}
+
+KProtocolInfo::KProtocolInfo( QDataStream& _str, int offset) :
+        KSycocaEntry( _str, offset)
+{
+   d = new KProtocolInfoPrivate;
+   load( _str );
+}
+
+KProtocolInfo::~KProtocolInfo()
+{
+   delete d;
+}
+
+void
+KProtocolInfo::load( QDataStream& _str)
+{
+   Q_INT32 i_inputType, i_outputType;
+   Q_INT8 i_isSourceProtocol, i_isHelperProtocol,
+          i_supportsListing, i_supportsReading,
+          i_supportsWriting, i_supportsMakeDir,
+          i_supportsDeleting, i_supportsLinking,
+          i_supportsMoving, i_determineMimetypeFromExtension,
+          i_canCopyFromFile, i_canCopyToFile;
+   _str >> m_name >> m_exec >> m_listing >> m_defaultMimetype
+        >> i_determineMimetypeFromExtension
+        >> m_icon
+        >> i_inputType >> i_outputType
+        >> i_isSourceProtocol >> i_isHelperProtocol
+        >> i_supportsListing >> i_supportsReading
+        >> i_supportsWriting >> i_supportsMakeDir
+        >> i_supportsDeleting >> i_supportsLinking
+        >> i_supportsMoving
+        >> i_canCopyFromFile >> i_canCopyToFile
+        >> m_config >> m_maxSlaves >> d->docPath >> d->protClass >> d->extraFields;
+   m_inputType = (Type) i_inputType;
+   m_outputType = (Type) i_outputType;
+   m_isSourceProtocol = (i_isSourceProtocol != 0);
+   m_isHelperProtocol = (i_isHelperProtocol != 0);
+   m_supportsListing = (i_supportsListing != 0);
+   m_supportsReading = (i_supportsReading != 0);
+   m_supportsWriting = (i_supportsWriting != 0);
+   m_supportsMakeDir = (i_supportsMakeDir != 0);
+   m_supportsDeleting = (i_supportsDeleting != 0);
+   m_supportsLinking = (i_supportsLinking != 0);
+   m_supportsMoving = (i_supportsMoving != 0);
+   m_canCopyFromFile = (i_canCopyFromFile != 0);
+   m_canCopyToFile = (i_canCopyToFile != 0);
+   m_determineMimetypeFromExtension = (i_determineMimetypeFromExtension != 0);
+}
+
+void
+KProtocolInfo::save( QDataStream& _str)
+{
+   KSycocaEntry::save( _str );
+
+   Q_INT32 i_inputType, i_outputType;
+   Q_INT8 i_isSourceProtocol, i_isHelperProtocol,
+          i_supportsListing, i_supportsReading,
+          i_supportsWriting, i_supportsMakeDir,
+          i_supportsDeleting, i_supportsLinking,
+          i_supportsMoving, i_determineMimetypeFromExtension,
+          i_canCopyFromFile, i_canCopyToFile;
+
+   i_inputType = (Q_INT32) m_inputType;
+   i_outputType = (Q_INT32) m_outputType;
+   i_isSourceProtocol = m_isSourceProtocol ? 1 : 0;
+   i_isHelperProtocol = m_isHelperProtocol ? 1 : 0;
+   i_supportsListing = m_supportsListing ? 1 : 0;
+   i_supportsReading = m_supportsReading ? 1 : 0;
+   i_supportsWriting = m_supportsWriting ? 1 : 0;
+   i_supportsMakeDir = m_supportsMakeDir ? 1 : 0;
+   i_supportsDeleting = m_supportsDeleting ? 1 : 0;
+   i_supportsLinking = m_supportsLinking ? 1 : 0;
+   i_supportsMoving = m_supportsMoving ? 1 : 0;
+   i_canCopyFromFile = m_canCopyFromFile ? 1 : 0;
+   i_canCopyToFile = m_canCopyToFile ? 1 : 0;
+   i_determineMimetypeFromExtension = m_determineMimetypeFromExtension ? 1 : 0;
+
+
+   _str << m_name << m_exec << m_listing << m_defaultMimetype
+        << i_determineMimetypeFromExtension
+        << m_icon
+        << i_inputType << i_outputType
+        << i_isSourceProtocol << i_isHelperProtocol
+        << i_supportsListing << i_supportsReading
+        << i_supportsWriting << i_supportsMakeDir
+        << i_supportsDeleting << i_supportsLinking
+        << i_supportsMoving
+        << i_canCopyFromFile << i_canCopyToFile
+        << m_config << m_maxSlaves << d->docPath << d->protClass << d->extraFields;
+}
+
+
+
+
+
+
+QStringList KProtocolInfo::protocols()
+{
+  return KProtocolInfoFactory::self()->protocols();
+}
+
+bool KProtocolInfo::isSourceProtocol( const QString& _protocol )
+{
+  KProtocolInfo::Ptr prot = KProtocolInfoFactory::self()->findProtocol(_protocol);
+  if ( !prot )
+    return false;
+
+  return prot->m_isSourceProtocol;
+}
+
+bool KProtocolInfo::isFilterProtocol( const QString& _protocol )
+{
+  KProtocolInfo::Ptr prot = KProtocolInfoFactory::self()->findProtocol(_protocol);
+  if ( !prot )
+    return false;
+
+  return !prot->m_isSourceProtocol;
+}
+
+bool KProtocolInfo::isHelperProtocol( const QString& _protocol )
+{
+  KProtocolInfo::Ptr prot = KProtocolInfoFactory::self()->findProtocol(_protocol);
+  if ( !prot )
+    return false;
+
+  return prot->m_isHelperProtocol;
+}
+
+bool KProtocolInfo::isKnownProtocol( const QString& _protocol )
+{
+  KProtocolInfo::Ptr prot = KProtocolInfoFactory::self()->findProtocol(_protocol);
+  return ( prot != 0);
+}
+
+bool KProtocolInfo::supportsListing( const QString& _protocol )
+{
+  KProtocolInfo::Ptr prot = KProtocolInfoFactory::self()->findProtocol(_protocol);
+  if ( !prot )
+    return false;
+
+  return prot->m_supportsListing;
+}
+
+QStringList KProtocolInfo::listing( const QString& _protocol )
+{
+  KProtocolInfo::Ptr prot = KProtocolInfoFactory::self()->findProtocol(_protocol);
+  if ( !prot )
+    return QStringList();
+
+  return prot->m_listing;
+}
+
+bool KProtocolInfo::supportsReading( const QString& _protocol )
+{
+  KProtocolInfo::Ptr prot = KProtocolInfoFactory::self()->findProtocol(_protocol);
+  if ( !prot )
+    return false;
+
+  return prot->m_supportsReading;
+}
+
+bool KProtocolInfo::supportsWriting( const QString& _protocol )
+{
+  KProtocolInfo::Ptr prot = KProtocolInfoFactory::self()->findProtocol(_protocol);
+  if ( !prot )
+    return false;
+
+  return prot->m_supportsWriting;
+}
+
+bool KProtocolInfo::supportsMakeDir( const QString& _protocol )
+{
+  KProtocolInfo::Ptr prot = KProtocolInfoFactory::self()->findProtocol(_protocol);
+  if ( !prot )
+    return false;
+
+  return prot->m_supportsMakeDir;
+}
+
+bool KProtocolInfo::supportsDeleting( const QString& _protocol )
+{
+  KProtocolInfo::Ptr prot = KProtocolInfoFactory::self()->findProtocol(_protocol);
+  if ( !prot )
+    return false;
+
+  return prot->m_supportsDeleting;
+}
+
+bool KProtocolInfo::supportsLinking( const QString& _protocol )
+{
+  KProtocolInfo::Ptr prot = KProtocolInfoFactory::self()->findProtocol(_protocol);
+  if ( !prot )
+    return false;
+
+  return prot->m_supportsLinking;
+}
+
+bool KProtocolInfo::supportsMoving( const QString& _protocol )
+{
+  KProtocolInfo::Ptr prot = KProtocolInfoFactory::self()->findProtocol(_protocol);
+  if ( !prot )
+    return false;
+
+  return prot->m_supportsMoving;
+}
+
+bool KProtocolInfo::canCopyFromFile( const QString& _protocol )
+{
+  KProtocolInfo::Ptr prot = KProtocolInfoFactory::self()->findProtocol(_protocol);
+  if ( !prot )
+    return false;
+
+  return prot->m_canCopyFromFile;
+}
+
+
+bool KProtocolInfo::canCopyToFile( const QString& _protocol )
+{
+  KProtocolInfo::Ptr prot = KProtocolInfoFactory::self()->findProtocol(_protocol);
+  if ( !prot )
+    return false;
+
+  return prot->m_canCopyToFile;
+}
+
+QString KProtocolInfo::icon( const QString& _protocol )
+{
+  KProtocolInfo::Ptr prot = KProtocolInfoFactory::self()->findProtocol(_protocol);
+  if ( !prot )
+    return QString::fromLatin1("mime_empty");
+
+  return prot->m_icon;
+}
+
+QString KProtocolInfo::config( const QString& _protocol )
+{
+  KProtocolInfo::Ptr prot = KProtocolInfoFactory::self()->findProtocol(_protocol);
+  if ( !prot )
+    return QString::null;
+
+  return QString("kio_%1rc").arg(prot->m_config);
+}
+
+int KProtocolInfo::maxSlaves( const QString& _protocol )
+{
+  KProtocolInfo::Ptr prot = KProtocolInfoFactory::self()->findProtocol(_protocol);
+  if ( !prot )
+    return 1;
+
+  return prot->m_maxSlaves;
+}
+
+QString KProtocolInfo::defaultMimetype( const QString& _protocol )
+{
+  KProtocolInfo::Ptr prot = KProtocolInfoFactory::self()->findProtocol(_protocol);
+  if ( !prot )
+    return QString::null;
+
+  return prot->m_defaultMimetype;
+}
+
+bool KProtocolInfo::determineMimetypeFromExtension( const QString &_protocol )
+{
+  KProtocolInfo::Ptr prot = KProtocolInfoFactory::self()->findProtocol( _protocol );
+  if ( !prot )
+    return true;
+
+  return prot->m_determineMimetypeFromExtension;
+}
+
+QString KProtocolInfo::exec( const QString& _protocol )
+{
+  KProtocolInfo::Ptr prot = KProtocolInfoFactory::self()->findProtocol(_protocol);
+  if ( !prot )
+    return QString::null;
+
+  return prot->m_exec;
+}
+
+KProtocolInfo::Type KProtocolInfo::inputType( const QString& _protocol )
+{
+  KProtocolInfo::Ptr prot = KProtocolInfoFactory::self()->findProtocol(_protocol);
+  if ( !prot )
+    return T_NONE;
+
+  return prot->m_inputType;
+}
+
+KProtocolInfo::Type KProtocolInfo::outputType( const QString& _protocol )
+{
+  KProtocolInfo::Ptr prot = KProtocolInfoFactory::self()->findProtocol(_protocol);
+  if ( !prot )
+    return T_NONE;
+
+  return prot->m_outputType;
+}
+
+KProtocolInfo::ExtraFieldList KProtocolInfo::extraFields( const KURL &url )
+{
+  KProtocolInfo::Ptr prot = KProtocolInfoFactory::self()->findProtocol(url.protocol());
+  if ( !prot )
+    return ExtraFieldList();
+
+  return prot->d->extraFields;
+}
+
+QString KProtocolInfo::docPath( const QString& _protocol )
+{
+  KProtocolInfo::Ptr prot = KProtocolInfoFactory::self()->findProtocol(_protocol);
+  if ( !prot )
+    return QString::null;
+
+  return prot->d->docPath;
+}
+
+QString KProtocolInfo::protocolClass( const QString& _protocol )
+{
+  KProtocolInfo::Ptr prot = KProtocolInfoFactory::self()->findProtocol(_protocol);
+  if ( !prot )
+    return QString::null;
+
+  return prot->d->protClass;
+}
+
+QDataStream& operator>>( QDataStream& s, KProtocolInfo::ExtraField& field ) {
+  s >> field.name;
+  s >> field.type;
+  return s;
+}
+
+QDataStream& operator<<( QDataStream& s, const KProtocolInfo::ExtraField& field ) {
+  s << field.name;
+  s << field.type;
+  return s;
+}
+
+
+
+void KProtocolInfo::virtual_hook( int id, void* data )
+{ KSycocaEntry::virtual_hook( id, data ); }
+KProtocolInfoFactory* KProtocolInfoFactory::_self = 0;
+
+KProtocolInfoFactory::KProtocolInfoFactory() : KSycocaFactory( KST_KProtocolInfoFactory )
+{
+  _self = this;
+}
+
+KProtocolInfoFactory::~KProtocolInfoFactory()
+{
+  _self = 0;
+}
+
+
+KProtocolInfo*
+KProtocolInfoFactory::createEntry(int offset)
+{
+   KProtocolInfo *info = 0;
+   KSycocaType type;
+   QDataStream *str = KSycoca::self()->findEntry(offset, type);
+   switch (type)
+   {
+     case KST_KProtocolInfo:
+       info = new KProtocolInfo(*str, offset);
+       break;
+     default:
+       return 0;
+   }
+   if (!info->isValid())
+   {
+      delete info;
+      info = 0;
+   }
+   return info;
+}
+
+
+QStringList KProtocolInfoFactory::protocols()
+{
+  QStringList res;
+
+  KSycocaEntry::List list = allEntries();
+  for( KSycocaEntry::List::Iterator it = list.begin();
+       it != list.end();
+       ++it)
+  {
+     KSycocaEntry *entry = (*it).data();
+     KProtocolInfo *info = static_cast<KProtocolInfo *>(entry);
+
+     res.append( info->name() );
+  }
+
+  return res;
+}
+
+KProtocolInfo *
+KProtocolInfoFactory::findProtocol(const QString &protocol)
+{
+  if (!m_sycocaDict) return 0;
+
+  if (protocol == m_lastProtocol) return m_lastInfo;
+
+  int offset;
+
+  offset = m_sycocaDict->find_string( protocol );
+
+  if (!offset) return 0;
+
+  KProtocolInfo *info = createEntry(offset);
+
+  if (info && (info->name() != protocol))
+  {
+
+     delete info;
+     info = 0;
+  }
+  m_lastProtocol = protocol;
+  m_lastInfo = info;
+  return info;
+}
+
+void KProtocolInfoFactory::virtual_hook( int id, void* data )
+{ KSycocaFactory::virtual_hook( id, data ); }
+
+
+
+
+
+
+
+
+
+extern "C" {
+
+
+extern void __assert_fail (__const char *__assertion, __const char *__file,
+                           unsigned int __line, __const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, __const char *__file,
+                                  unsigned int __line,
+                                  __const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+
+
+
+
+
+
+
+KXErrorHandler** KXErrorHandler::handlers = __null;
+int KXErrorHandler::pos = 0;
+int KXErrorHandler::size = 0;
+
+KXErrorHandler::KXErrorHandler( Display* dpy )
+    : user_handler1( __null ),
+        user_handler2( __null ),
+        old_handler( XSetErrorHandler( handler_wrapper )),
+        first_request( XNextRequest( dpy )),
+        display( dpy ),
+        was_error( false )
+    {
+    addHandler();
+    }
+
+KXErrorHandler::KXErrorHandler( bool (*handler)( int request, int error_code, unsigned long resource_id ), Display* dpy )
+    : user_handler1( handler ),
+        user_handler2( __null ),
+        old_handler( XSetErrorHandler( handler_wrapper )),
+        first_request( XNextRequest( dpy )),
+        display( dpy ),
+        was_error( false )
+    {
+    addHandler();
+    }
+
+KXErrorHandler::KXErrorHandler( int (*handler)( Display*, XErrorEvent* ), Display* dpy )
+    : user_handler1( __null ),
+        user_handler2( handler ),
+        old_handler( XSetErrorHandler( handler_wrapper )),
+        first_request( XNextRequest( dpy )),
+        display( dpy ),
+        was_error( false )
+    {
+    addHandler();
+    }
+
+KXErrorHandler::~KXErrorHandler()
+    {
+    XSetErrorHandler( old_handler );
+    (static_cast<void> ((this == handlers[ pos - 1 ]) ? 0 : (__assert_fail ("this == handlers[ pos - 1 ]", "/coolo/prod/kdelibs/kdecore/kxerrorhandler.cpp", 72, __PRETTY_FUNCTION__), 0)));
+    --pos;
+    }
+
+void KXErrorHandler::addHandler()
+    {
+    if( size == pos )
+        {
+        size += 16;
+        handlers = static_cast< KXErrorHandler** >( realloc( handlers, size * sizeof( KXErrorHandler* )));
+        }
+    handlers[ pos++ ] = this;
+    }
+
+bool KXErrorHandler::error( bool sync ) const
+    {
+    if( sync )
+        XSync( display, 0 );
+    return was_error;
+    }
+
+int KXErrorHandler::handler_wrapper( Display* dpy, XErrorEvent* e )
+    {
+    --pos;
+    int ret = handlers[ pos ]->handle( dpy, e );
+    ++pos;
+    return ret;
+    }
+
+int KXErrorHandler::handle( Display* dpy, XErrorEvent* e )
+    {
+    if( dpy == display
+        && e->serial - first_request < 1000000000 )
+        {
+
+        if( user_handler1 != __null )
+            was_error |= user_handler1( e->request_code, e->error_code, e->resourceid );
+        else if( user_handler2 != __null )
+            was_error |= ( user_handler2( dpy, e ) != 0 );
+        else
+            was_error = true;
+        return 0;
+        }
+
+    return old_handler( dpy, e );
+    }
+static const char* const KSycoca_ftable[2][3] = {
+    { "void", "notifyDatabaseChanged(QStringList)", "notifyDatabaseChanged(QStringList)" },
+    { 0, 0, 0 }
+};
+static const int KSycoca_ftable_hiddens[1] = {
+    0,
+};
+
+bool KSycoca::process(const QCString &fun, const QByteArray &data, QCString& replyType, QByteArray &replyData)
+{
+    if ( fun == KSycoca_ftable[0][1] ) {
+        QStringList arg0;
+        QDataStream arg( data, 0x0001 );
+        arg >> arg0;
+        replyType = KSycoca_ftable[0][0];
+        notifyDatabaseChanged(arg0 );
+    } else {
+        return DCOPObject::process( fun, data, replyType, replyData );
+    }
+    return TRUE;
+}
+
+QCStringList KSycoca::interfaces()
+{
+    QCStringList ifaces = DCOPObject::interfaces();
+    ifaces += "KSycoca";
+    return ifaces;
+}
+
+QCStringList KSycoca::functions()
+{
+    QCStringList funcs = DCOPObject::functions();
+    for ( int i = 0; KSycoca_ftable[i][2]; i++ ) {
+        if (KSycoca_ftable_hiddens[i])
+            continue;
+        QCString func = KSycoca_ftable[i][0];
+        func += ' ';
+        func += KSycoca_ftable[i][2];
+        funcs << func;
+    }
+    return funcs;
+}
+static const char* const KAppDCOPInterface_ftable[5][3] = {
+    { "void", "disableSessionManagement()", "disableSessionManagement()" },
+    { "QCString", "startupId()", "startupId()" },
+    { "QCString", "caption()", "caption()" },
+    { "void", "quit()", "quit()" },
+    { 0, 0, 0 }
+};
+static const int KAppDCOPInterface_ftable_hiddens[4] = {
+    0,
+    0,
+    0,
+    0,
+};
+
+bool KAppDCOPInterface::process(const QCString &fun, const QByteArray &data, QCString& replyType, QByteArray &replyData)
+{
+    if ( fun == KAppDCOPInterface_ftable[0][1] ) {
+        replyType = KAppDCOPInterface_ftable[0][0];
+        disableSessionManagement( );
+    } else if ( fun == KAppDCOPInterface_ftable[1][1] ) {
+        replyType = KAppDCOPInterface_ftable[1][0];
+        QDataStream _replyStream( replyData, 0x0002 );
+        _replyStream << startupId( );
+    } else if ( fun == KAppDCOPInterface_ftable[2][1] ) {
+        replyType = KAppDCOPInterface_ftable[2][0];
+        QDataStream _replyStream( replyData, 0x0002 );
+        _replyStream << caption( );
+    } else if ( fun == KAppDCOPInterface_ftable[3][1] ) {
+        replyType = KAppDCOPInterface_ftable[3][0];
+        quit( );
+    } else {
+        return DCOPObject::process( fun, data, replyType, replyData );
+    }
+    return TRUE;
+}
+
+QCStringList KAppDCOPInterface::interfaces()
+{
+    QCStringList ifaces = DCOPObject::interfaces();
+    ifaces += "KAppDCOPInterface";
+    return ifaces;
+}
+
+QCStringList KAppDCOPInterface::functions()
+{
+    QCStringList funcs = DCOPObject::functions();
+    for ( int i = 0; KAppDCOPInterface_ftable[i][2]; i++ ) {
+        if (KAppDCOPInterface_ftable_hiddens[i])
+            continue;
+        QCString func = KAppDCOPInterface_ftable[i][0];
+        func += ' ';
+        func += KAppDCOPInterface_ftable[i][2];
+        funcs << func;
+    }
+    return funcs;
+}
+static const char* const KDebugDCOPIface_ftable[2][3] = {
+    { "void", "notifyKDebugConfigChanged()", "notifyKDebugConfigChanged()" },
+    { 0, 0, 0 }
+};
+static const int KDebugDCOPIface_ftable_hiddens[1] = {
+    0,
+};
+
+bool KDebugDCOPIface::process(const QCString &fun, const QByteArray &data, QCString& replyType, QByteArray &replyData)
+{
+    if ( fun == KDebugDCOPIface_ftable[0][1] ) {
+        replyType = KDebugDCOPIface_ftable[0][0];
+        notifyKDebugConfigChanged( );
+    } else {
+        return DCOPObject::process( fun, data, replyType, replyData );
+    }
+    return TRUE;
+}
+
+QCStringList KDebugDCOPIface::interfaces()
+{
+    QCStringList ifaces = DCOPObject::interfaces();
+    ifaces += "KDebugDCOPIface";
+    return ifaces;
+}
+
+QCStringList KDebugDCOPIface::functions()
+{
+    QCStringList funcs = DCOPObject::functions();
+    for ( int i = 0; KDebugDCOPIface_ftable[i][2]; i++ ) {
+        if (KDebugDCOPIface_ftable_hiddens[i])
+            continue;
+        QCString func = KDebugDCOPIface_ftable[i][0];
+        func += ' ';
+        func += KDebugDCOPIface_ftable[i][2];
+        funcs << func;
+    }
+    return funcs;
+}
diff --git a/gcc/testsuite/g++.dg/wrappers/NOT_FOR_UPSTREAM/pr83902-unreduced.C b/gcc/testsuite/g++.dg/wrappers/NOT_FOR_UPSTREAM/pr83902-unreduced.C
new file mode 100644
index 0000000..67c6b61
--- /dev/null
+++ b/gcc/testsuite/g++.dg/wrappers/NOT_FOR_UPSTREAM/pr83902-unreduced.C
@@ -0,0 +1,13363 @@
+// { dg-do compile { target c++11 } }
+// { dg-options "-Wno-pedantic -Wno-register" }
+
+namespace std
+{
+  typedef long unsigned int size_t;
+  typedef long int ptrdiff_t;
+
+
+  typedef decltype(nullptr) nullptr_t;
+
+}
+namespace std
+{
+  inline namespace __cxx11 __attribute__((__abi_tag__ ("cxx11"))) { }
+}
+namespace __gnu_cxx
+{
+  inline namespace __cxx11 __attribute__((__abi_tag__ ("cxx11"))) { }
+}
+
+
+
+
+
+
+
+typedef long unsigned int size_t;
+
+extern "C" {
+
+
+
+
+
+typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__TC__)));
+typedef __float128 _Float128;
+
+
+typedef struct
+  {
+    int quot;
+    int rem;
+  } div_t;
+
+
+
+typedef struct
+  {
+    long int quot;
+    long int rem;
+  } ldiv_t;
+
+
+
+
+
+__extension__ typedef struct
+  {
+    long long int quot;
+    long long int rem;
+  } lldiv_t;
+extern size_t __ctype_get_mb_cur_max (void) throw () __attribute__ ((__warn_unused_result__));
+
+
+
+extern double atof (const char *__nptr)
+     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
+
+extern int atoi (const char *__nptr)
+     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
+
+extern long int atol (const char *__nptr)
+     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
+
+
+
+__extension__ extern long long int atoll (const char *__nptr)
+     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
+
+
+
+extern double strtod (const char *__restrict __nptr,
+        char **__restrict __endptr)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+extern float strtof (const char *__restrict __nptr,
+       char **__restrict __endptr) throw () __attribute__ ((__nonnull__ (1)));
+
+extern long double strtold (const char *__restrict __nptr,
+       char **__restrict __endptr)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+
+extern _Float128 strtof128 (const char *__restrict __nptr,
+        char **__restrict __endptr)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+extern long int strtol (const char *__restrict __nptr,
+   char **__restrict __endptr, int __base)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+extern unsigned long int strtoul (const char *__restrict __nptr,
+      char **__restrict __endptr, int __base)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+__extension__
+extern long long int strtoq (const char *__restrict __nptr,
+        char **__restrict __endptr, int __base)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+__extension__
+extern unsigned long long int strtouq (const char *__restrict __nptr,
+           char **__restrict __endptr, int __base)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+
+__extension__
+extern long long int strtoll (const char *__restrict __nptr,
+         char **__restrict __endptr, int __base)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+__extension__
+extern unsigned long long int strtoull (const char *__restrict __nptr,
+     char **__restrict __endptr, int __base)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+
+extern int strfromd (char *__dest, size_t __size, const char *__format,
+       double __f)
+     throw () __attribute__ ((__nonnull__ (3)));
+
+extern int strfromf (char *__dest, size_t __size, const char *__format,
+       float __f)
+     throw () __attribute__ ((__nonnull__ (3)));
+
+extern int strfroml (char *__dest, size_t __size, const char *__format,
+       long double __f)
+     throw () __attribute__ ((__nonnull__ (3)));
+
+
+
+extern int strfromf128 (char *__dest, size_t __size, const char * __format,
+   _Float128 __f)
+     throw () __attribute__ ((__nonnull__ (3)));
+
+
+
+
+
+
+
+struct __locale_struct
+{
+
+  struct __locale_data *__locales[13];
+
+
+  const unsigned short int *__ctype_b;
+  const int *__ctype_tolower;
+  const int *__ctype_toupper;
+
+
+  const char *__names[13];
+};
+
+typedef struct __locale_struct *__locale_t;
+
+typedef __locale_t locale_t;
+
+extern long int strtol_l (const char *__restrict __nptr,
+     char **__restrict __endptr, int __base,
+     locale_t __loc) throw () __attribute__ ((__nonnull__ (1, 4)));
+
+extern unsigned long int strtoul_l (const char *__restrict __nptr,
+        char **__restrict __endptr,
+        int __base, locale_t __loc)
+     throw () __attribute__ ((__nonnull__ (1, 4)));
+
+__extension__
+extern long long int strtoll_l (const char *__restrict __nptr,
+    char **__restrict __endptr, int __base,
+    locale_t __loc)
+     throw () __attribute__ ((__nonnull__ (1, 4)));
+
+__extension__
+extern unsigned long long int strtoull_l (const char *__restrict __nptr,
+       char **__restrict __endptr,
+       int __base, locale_t __loc)
+     throw () __attribute__ ((__nonnull__ (1, 4)));
+
+extern double strtod_l (const char *__restrict __nptr,
+   char **__restrict __endptr, locale_t __loc)
+     throw () __attribute__ ((__nonnull__ (1, 3)));
+
+extern float strtof_l (const char *__restrict __nptr,
+         char **__restrict __endptr, locale_t __loc)
+     throw () __attribute__ ((__nonnull__ (1, 3)));
+
+extern long double strtold_l (const char *__restrict __nptr,
+         char **__restrict __endptr,
+         locale_t __loc)
+     throw () __attribute__ ((__nonnull__ (1, 3)));
+
+
+extern _Float128 strtof128_l (const char *__restrict __nptr,
+         char **__restrict __endptr,
+         locale_t __loc)
+     throw () __attribute__ ((__nonnull__ (1, 3)));
+
+
+
+
+
+extern __inline __attribute__ ((__gnu_inline__)) int
+__attribute__ ((__leaf__)) atoi (const char *__nptr) throw ()
+{
+  return (int) strtol (__nptr, (char **) __null, 10);
+}
+extern __inline __attribute__ ((__gnu_inline__)) long int
+__attribute__ ((__leaf__)) atol (const char *__nptr) throw ()
+{
+  return strtol (__nptr, (char **) __null, 10);
+}
+
+
+__extension__ extern __inline __attribute__ ((__gnu_inline__)) long long int
+__attribute__ ((__leaf__)) atoll (const char *__nptr) throw ()
+{
+  return strtoll (__nptr, (char **) __null, 10);
+}
+extern char *l64a (long int __n) throw () __attribute__ ((__warn_unused_result__));
+
+
+extern long int a64l (const char *__s)
+     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
+
+
+
+
+extern "C" {
+
+
+
+typedef unsigned char __u_char;
+typedef unsigned short int __u_short;
+typedef unsigned int __u_int;
+typedef unsigned long int __u_long;
+
+
+typedef signed char __int8_t;
+typedef unsigned char __uint8_t;
+typedef signed short int __int16_t;
+typedef unsigned short int __uint16_t;
+typedef signed int __int32_t;
+typedef unsigned int __uint32_t;
+
+typedef signed long int __int64_t;
+typedef unsigned long int __uint64_t;
+
+
+
+
+
+
+
+typedef long int __quad_t;
+typedef unsigned long int __u_quad_t;
+
+
+
+
+
+
+
+typedef long int __intmax_t;
+typedef unsigned long int __uintmax_t;
+
+
+typedef unsigned long int __dev_t;
+typedef unsigned int __uid_t;
+typedef unsigned int __gid_t;
+typedef unsigned long int __ino_t;
+typedef unsigned long int __ino64_t;
+typedef unsigned int __mode_t;
+typedef unsigned long int __nlink_t;
+typedef long int __off_t;
+typedef long int __off64_t;
+typedef int __pid_t;
+typedef struct { int __val[2]; } __fsid_t;
+typedef long int __clock_t;
+typedef unsigned long int __rlim_t;
+typedef unsigned long int __rlim64_t;
+typedef unsigned int __id_t;
+typedef long int __time_t;
+typedef unsigned int __useconds_t;
+typedef long int __suseconds_t;
+
+typedef int __daddr_t;
+typedef int __key_t;
+
+
+typedef int __clockid_t;
+
+
+typedef void * __timer_t;
+
+
+typedef long int __blksize_t;
+
+
+
+
+typedef long int __blkcnt_t;
+typedef long int __blkcnt64_t;
+
+
+typedef unsigned long int __fsblkcnt_t;
+typedef unsigned long int __fsblkcnt64_t;
+
+
+typedef unsigned long int __fsfilcnt_t;
+typedef unsigned long int __fsfilcnt64_t;
+
+
+typedef long int __fsword_t;
+
+typedef long int __ssize_t;
+
+
+typedef long int __syscall_slong_t;
+
+typedef unsigned long int __syscall_ulong_t;
+
+
+
+typedef __off64_t __loff_t;
+typedef __quad_t *__qaddr_t;
+typedef char *__caddr_t;
+
+
+typedef long int __intptr_t;
+
+
+typedef unsigned int __socklen_t;
+
+
+
+
+typedef int __sig_atomic_t;
+
+
+
+typedef __u_char u_char;
+typedef __u_short u_short;
+typedef __u_int u_int;
+typedef __u_long u_long;
+typedef __quad_t quad_t;
+typedef __u_quad_t u_quad_t;
+typedef __fsid_t fsid_t;
+
+
+
+
+typedef __loff_t loff_t;
+
+
+
+typedef __ino_t ino_t;
+
+
+
+
+
+
+typedef __ino64_t ino64_t;
+
+
+
+
+typedef __dev_t dev_t;
+
+
+
+
+typedef __gid_t gid_t;
+
+
+
+
+typedef __mode_t mode_t;
+
+
+
+
+typedef __nlink_t nlink_t;
+
+
+
+
+typedef __uid_t uid_t;
+
+
+
+
+
+typedef __off_t off_t;
+
+
+
+
+
+
+typedef __off64_t off64_t;
+
+
+
+
+typedef __pid_t pid_t;
+
+
+
+
+
+typedef __id_t id_t;
+
+
+
+
+typedef __ssize_t ssize_t;
+
+
+
+
+
+typedef __daddr_t daddr_t;
+typedef __caddr_t caddr_t;
+
+
+
+
+
+typedef __key_t key_t;
+
+
+
+
+
+
+
+
+
+
+typedef __clock_t clock_t;
+
+
+
+
+
+
+
+typedef __clockid_t clockid_t;
+
+
+
+
+
+
+typedef __time_t time_t;
+
+
+
+
+
+
+typedef __timer_t timer_t;
+
+
+
+typedef __useconds_t useconds_t;
+
+
+
+typedef __suseconds_t suseconds_t;
+
+
+
+
+
+
+
+
+typedef unsigned long int ulong;
+typedef unsigned short int ushort;
+typedef unsigned int uint;
+
+
+
+
+typedef __int8_t int8_t;
+typedef __int16_t int16_t;
+typedef __int32_t int32_t;
+typedef __int64_t int64_t;
+typedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__)));
+typedef unsigned int u_int16_t __attribute__ ((__mode__ (__HI__)));
+typedef unsigned int u_int32_t __attribute__ ((__mode__ (__SI__)));
+typedef unsigned int u_int64_t __attribute__ ((__mode__ (__DI__)));
+
+typedef int register_t __attribute__ ((__mode__ (__word__)));
+
+
+
+
+
+
+static __inline unsigned int
+__bswap_32 (unsigned int __bsx)
+{
+  return __builtin_bswap32 (__bsx);
+}
+static __inline __uint64_t
+__bswap_64 (__uint64_t __bsx)
+{
+  return __builtin_bswap64 (__bsx);
+}
+static __inline __uint16_t
+__uint16_identity (__uint16_t __x)
+{
+  return __x;
+}
+
+static __inline __uint32_t
+__uint32_identity (__uint32_t __x)
+{
+  return __x;
+}
+
+static __inline __uint64_t
+__uint64_identity (__uint64_t __x)
+{
+  return __x;
+}
+
+
+
+
+
+
+
+
+
+
+
+typedef struct
+{
+  unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
+} __sigset_t;
+
+
+typedef __sigset_t sigset_t;
+
+
+
+
+
+
+
+
+
+
+struct timeval
+{
+  __time_t tv_sec;
+  __suseconds_t tv_usec;
+};
+
+
+
+
+
+
+
+
+struct timespec
+{
+  __time_t tv_sec;
+  __syscall_slong_t tv_nsec;
+};
+typedef long int __fd_mask;
+typedef struct
+  {
+
+
+
+    __fd_mask fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];
+
+
+
+
+
+  } fd_set;
+
+
+
+
+
+
+typedef __fd_mask fd_mask;
+extern "C" {
+extern int select (int __nfds, fd_set *__restrict __readfds,
+     fd_set *__restrict __writefds,
+     fd_set *__restrict __exceptfds,
+     struct timeval *__restrict __timeout);
+extern int pselect (int __nfds, fd_set *__restrict __readfds,
+      fd_set *__restrict __writefds,
+      fd_set *__restrict __exceptfds,
+      const struct timespec *__restrict __timeout,
+      const __sigset_t *__restrict __sigmask);
+
+
+
+
+
+extern long int __fdelt_chk (long int __d);
+extern long int __fdelt_warn (long int __d)
+  __attribute__((__warning__ ("bit outside of fd_set selected")));
+
+
+}
+
+
+
+
+
+
+
+extern "C" {
+
+extern unsigned int gnu_dev_major (__dev_t __dev) throw () __attribute__ ((__const__));
+extern unsigned int gnu_dev_minor (__dev_t __dev) throw () __attribute__ ((__const__));
+extern __dev_t gnu_dev_makedev (unsigned int __major, unsigned int __minor) throw () __attribute__ ((__const__));
+
+
+
+__extension__ extern __inline __attribute__ ((__gnu_inline__)) __attribute__ ((__const__)) unsigned int __attribute__ ((__leaf__)) gnu_dev_major (__dev_t __dev) throw () { unsigned int __major; __major = ((__dev & (__dev_t) 0x00000000000fff00u) >> 8); __major |= ((__dev & (__dev_t) 0xfffff00000000000u) >> 32); return __major; }
+__extension__ extern __inline __attribute__ ((__gnu_inline__)) __attribute__ ((__const__)) unsigned int __attribute__ ((__leaf__)) gnu_dev_minor (__dev_t __dev) throw () { unsigned int __minor; __minor = ((__dev & (__dev_t) 0x00000000000000ffu) >> 0); __minor |= ((__dev & (__dev_t) 0x00000ffffff00000u) >> 12); return __minor; }
+__extension__ extern __inline __attribute__ ((__gnu_inline__)) __attribute__ ((__const__)) __dev_t __attribute__ ((__leaf__)) gnu_dev_makedev (unsigned int __major, unsigned int __minor) throw () { __dev_t __dev; __dev = (((__dev_t) (__major & 0x00000fffu)) << 8); __dev |= (((__dev_t) (__major & 0xfffff000u)) << 32); __dev |= (((__dev_t) (__minor & 0x000000ffu)) << 0); __dev |= (((__dev_t) (__minor & 0xffffff00u)) << 12); return __dev; }
+
+
+
+}
+
+
+
+
+
+
+typedef __blksize_t blksize_t;
+
+
+
+
+
+
+typedef __blkcnt_t blkcnt_t;
+
+
+
+typedef __fsblkcnt_t fsblkcnt_t;
+
+
+
+typedef __fsfilcnt_t fsfilcnt_t;
+typedef __blkcnt64_t blkcnt64_t;
+typedef __fsblkcnt64_t fsblkcnt64_t;
+typedef __fsfilcnt64_t fsfilcnt64_t;
+
+
+
+
+
+struct __pthread_rwlock_arch_t
+{
+  unsigned int __readers;
+  unsigned int __writers;
+  unsigned int __wrphase_futex;
+  unsigned int __writers_futex;
+  unsigned int __pad3;
+  unsigned int __pad4;
+
+  int __cur_writer;
+  int __shared;
+  signed char __rwelision;
+
+
+
+
+  unsigned char __pad1[7];
+
+
+  unsigned long int __pad2;
+
+
+  unsigned int __flags;
+};
+
+
+
+
+typedef struct __pthread_internal_list
+{
+  struct __pthread_internal_list *__prev;
+  struct __pthread_internal_list *__next;
+} __pthread_list_t;
+struct __pthread_mutex_s
+{
+  int __lock ;
+  unsigned int __count;
+  int __owner;
+
+  unsigned int __nusers;
+
+
+
+  int __kind;
+ 
+
+
+
+
+  short __spins; short __elision;
+  __pthread_list_t __list;
+ 
+};
+
+
+
+
+struct __pthread_cond_s
+{
+  __extension__ union
+  {
+    __extension__ unsigned long long int __wseq;
+    struct
+    {
+      unsigned int __low;
+      unsigned int __high;
+    } __wseq32;
+  };
+  __extension__ union
+  {
+    __extension__ unsigned long long int __g1_start;
+    struct
+    {
+      unsigned int __low;
+      unsigned int __high;
+    } __g1_start32;
+  };
+  unsigned int __g_refs[2] ;
+  unsigned int __g_size[2];
+  unsigned int __g1_orig_size;
+  unsigned int __wrefs;
+  unsigned int __g_signals[2];
+};
+
+
+
+typedef unsigned long int pthread_t;
+
+
+
+
+typedef union
+{
+  char __size[4];
+  int __align;
+} pthread_mutexattr_t;
+
+
+
+
+typedef union
+{
+  char __size[4];
+  int __align;
+} pthread_condattr_t;
+
+
+
+typedef unsigned int pthread_key_t;
+
+
+
+typedef int pthread_once_t;
+
+
+union pthread_attr_t
+{
+  char __size[56];
+  long int __align;
+};
+
+typedef union pthread_attr_t pthread_attr_t;
+
+
+
+
+typedef union
+{
+  struct __pthread_mutex_s __data;
+  char __size[40];
+  long int __align;
+} pthread_mutex_t;
+
+
+typedef union
+{
+  struct __pthread_cond_s __data;
+  char __size[48];
+  __extension__ long long int __align;
+} pthread_cond_t;
+
+
+
+
+
+typedef union
+{
+  struct __pthread_rwlock_arch_t __data;
+  char __size[56];
+  long int __align;
+} pthread_rwlock_t;
+
+typedef union
+{
+  char __size[8];
+  long int __align;
+} pthread_rwlockattr_t;
+
+
+
+
+
+typedef volatile int pthread_spinlock_t;
+
+
+
+
+typedef union
+{
+  char __size[32];
+  long int __align;
+} pthread_barrier_t;
+
+typedef union
+{
+  char __size[4];
+  int __align;
+} pthread_barrierattr_t;
+
+
+}
+
+
+
+
+
+
+extern long int random (void) throw ();
+
+
+extern void srandom (unsigned int __seed) throw ();
+
+
+
+
+
+extern char *initstate (unsigned int __seed, char *__statebuf,
+   size_t __statelen) throw () __attribute__ ((__nonnull__ (2)));
+
+
+
+extern char *setstate (char *__statebuf) throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+
+
+
+
+struct random_data
+  {
+    int32_t *fptr;
+    int32_t *rptr;
+    int32_t *state;
+    int rand_type;
+    int rand_deg;
+    int rand_sep;
+    int32_t *end_ptr;
+  };
+
+extern int random_r (struct random_data *__restrict __buf,
+       int32_t *__restrict __result) throw () __attribute__ ((__nonnull__ (1, 2)));
+
+extern int srandom_r (unsigned int __seed, struct random_data *__buf)
+     throw () __attribute__ ((__nonnull__ (2)));
+
+extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
+   size_t __statelen,
+   struct random_data *__restrict __buf)
+     throw () __attribute__ ((__nonnull__ (2, 4)));
+
+extern int setstate_r (char *__restrict __statebuf,
+         struct random_data *__restrict __buf)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+
+
+
+extern int rand (void) throw ();
+
+extern void srand (unsigned int __seed) throw ();
+
+
+
+extern int rand_r (unsigned int *__seed) throw ();
+
+
+
+
+
+
+
+extern double drand48 (void) throw ();
+extern double erand48 (unsigned short int __xsubi[3]) throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern long int lrand48 (void) throw ();
+extern long int nrand48 (unsigned short int __xsubi[3])
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern long int mrand48 (void) throw ();
+extern long int jrand48 (unsigned short int __xsubi[3])
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern void srand48 (long int __seedval) throw ();
+extern unsigned short int *seed48 (unsigned short int __seed16v[3])
+     throw () __attribute__ ((__nonnull__ (1)));
+extern void lcong48 (unsigned short int __param[7]) throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+
+
+struct drand48_data
+  {
+    unsigned short int __x[3];
+    unsigned short int __old_x[3];
+    unsigned short int __c;
+    unsigned short int __init;
+    __extension__ unsigned long long int __a;
+
+  };
+
+
+extern int drand48_r (struct drand48_data *__restrict __buffer,
+        double *__restrict __result) throw () __attribute__ ((__nonnull__ (1, 2)));
+extern int erand48_r (unsigned short int __xsubi[3],
+        struct drand48_data *__restrict __buffer,
+        double *__restrict __result) throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern int lrand48_r (struct drand48_data *__restrict __buffer,
+        long int *__restrict __result)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+extern int nrand48_r (unsigned short int __xsubi[3],
+        struct drand48_data *__restrict __buffer,
+        long int *__restrict __result)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern int mrand48_r (struct drand48_data *__restrict __buffer,
+        long int *__restrict __result)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+extern int jrand48_r (unsigned short int __xsubi[3],
+        struct drand48_data *__restrict __buffer,
+        long int *__restrict __result)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
+     throw () __attribute__ ((__nonnull__ (2)));
+
+extern int seed48_r (unsigned short int __seed16v[3],
+       struct drand48_data *__buffer) throw () __attribute__ ((__nonnull__ (1, 2)));
+
+extern int lcong48_r (unsigned short int __param[7],
+        struct drand48_data *__buffer)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+
+
+extern void *malloc (size_t __size) throw () __attribute__ ((__malloc__)) __attribute__ ((__warn_unused_result__));
+
+extern void *calloc (size_t __nmemb, size_t __size)
+     throw () __attribute__ ((__malloc__)) __attribute__ ((__warn_unused_result__));
+
+
+
+
+
+
+extern void *realloc (void *__ptr, size_t __size)
+     throw () __attribute__ ((__warn_unused_result__));
+
+
+
+
+
+
+
+extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
+     throw () __attribute__ ((__warn_unused_result__));
+
+
+
+extern void free (void *__ptr) throw ();
+
+
+
+extern "C" {
+
+
+
+
+
+extern void *alloca (size_t __size) throw ();
+
+
+
+
+
+}
+
+
+
+
+
+extern void *valloc (size_t __size) throw () __attribute__ ((__malloc__)) __attribute__ ((__warn_unused_result__));
+
+
+
+
+extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
+     throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
+
+
+
+
+extern void *aligned_alloc (size_t __alignment, size_t __size)
+     throw () __attribute__ ((__malloc__)) __attribute__ ((__alloc_size__ (2))) __attribute__ ((__warn_unused_result__));
+
+
+
+extern void abort (void) throw () __attribute__ ((__noreturn__));
+
+
+
+extern int atexit (void (*__func) (void)) throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+
+extern "C++" int at_quick_exit (void (*__func) (void))
+     throw () __asm ("at_quick_exit") __attribute__ ((__nonnull__ (1)));
+extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
+     throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+
+
+extern void exit (int __status) throw () __attribute__ ((__noreturn__));
+
+
+
+
+
+extern void quick_exit (int __status) throw () __attribute__ ((__noreturn__));
+
+
+
+
+
+extern void _Exit (int __status) throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern char *getenv (const char *__name) throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
+
+
+
+
+extern char *secure_getenv (const char *__name)
+     throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
+
+
+
+
+
+
+extern int putenv (char *__string) throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+
+
+extern int setenv (const char *__name, const char *__value, int __replace)
+     throw () __attribute__ ((__nonnull__ (2)));
+
+
+extern int unsetenv (const char *__name) throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+
+
+
+extern int clearenv (void) throw ();
+extern char *mktemp (char *__template) throw () __attribute__ ((__nonnull__ (1)));
+extern int mkstemp (char *__template) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
+extern int mkstemp64 (char *__template) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
+extern int mkstemps (char *__template, int __suffixlen) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
+extern int mkstemps64 (char *__template, int __suffixlen)
+     __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
+extern char *mkdtemp (char *__template) throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
+extern int mkostemp (char *__template, int __flags) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
+extern int mkostemp64 (char *__template, int __flags) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
+extern int mkostemps (char *__template, int __suffixlen, int __flags)
+     __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
+extern int mkostemps64 (char *__template, int __suffixlen, int __flags)
+     __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
+extern int system (const char *__command) __attribute__ ((__warn_unused_result__));
+
+
+
+
+
+extern char *canonicalize_file_name (const char *__name)
+     throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
+extern char *realpath (const char *__restrict __name,
+         char *__restrict __resolved) throw () __attribute__ ((__warn_unused_result__));
+
+
+
+
+
+
+typedef int (*__compar_fn_t) (const void *, const void *);
+
+
+typedef __compar_fn_t comparison_fn_t;
+
+
+
+typedef int (*__compar_d_fn_t) (const void *, const void *, void *);
+
+
+
+
+extern void *bsearch (const void *__key, const void *__base,
+        size_t __nmemb, size_t __size, __compar_fn_t __compar)
+     __attribute__ ((__nonnull__ (1, 2, 5))) __attribute__ ((__warn_unused_result__));
+
+
+extern __inline __attribute__ ((__gnu_inline__)) void *
+bsearch (const void *__key, const void *__base, size_t __nmemb, size_t __size,
+  __compar_fn_t __compar)
+{
+  size_t __l, __u, __idx;
+  const void *__p;
+  int __comparison;
+
+  __l = 0;
+  __u = __nmemb;
+  while (__l < __u)
+    {
+      __idx = (__l + __u) / 2;
+      __p = (void *) (((const char *) __base) + (__idx * __size));
+      __comparison = (*__compar) (__key, __p);
+      if (__comparison < 0)
+ __u = __idx;
+      else if (__comparison > 0)
+ __l = __idx + 1;
+      else
+ return (void *) __p;
+    }
+
+  return __null;
+}
+
+
+
+
+extern void qsort (void *__base, size_t __nmemb, size_t __size,
+     __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));
+
+extern void qsort_r (void *__base, size_t __nmemb, size_t __size,
+       __compar_d_fn_t __compar, void *__arg)
+  __attribute__ ((__nonnull__ (1, 4)));
+
+
+
+
+extern int abs (int __x) throw () __attribute__ ((__const__)) __attribute__ ((__warn_unused_result__));
+extern long int labs (long int __x) throw () __attribute__ ((__const__)) __attribute__ ((__warn_unused_result__));
+
+
+__extension__ extern long long int llabs (long long int __x)
+     throw () __attribute__ ((__const__)) __attribute__ ((__warn_unused_result__));
+
+
+
+
+
+
+extern div_t div (int __numer, int __denom)
+     throw () __attribute__ ((__const__)) __attribute__ ((__warn_unused_result__));
+extern ldiv_t ldiv (long int __numer, long int __denom)
+     throw () __attribute__ ((__const__)) __attribute__ ((__warn_unused_result__));
+
+
+__extension__ extern lldiv_t lldiv (long long int __numer,
+        long long int __denom)
+     throw () __attribute__ ((__const__)) __attribute__ ((__warn_unused_result__));
+extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
+     int *__restrict __sign) throw () __attribute__ ((__nonnull__ (3, 4))) __attribute__ ((__warn_unused_result__));
+
+
+
+
+extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
+     int *__restrict __sign) throw () __attribute__ ((__nonnull__ (3, 4))) __attribute__ ((__warn_unused_result__));
+
+
+
+
+extern char *gcvt (double __value, int __ndigit, char *__buf)
+     throw () __attribute__ ((__nonnull__ (3))) __attribute__ ((__warn_unused_result__));
+
+
+
+
+extern char *qecvt (long double __value, int __ndigit,
+      int *__restrict __decpt, int *__restrict __sign)
+     throw () __attribute__ ((__nonnull__ (3, 4))) __attribute__ ((__warn_unused_result__));
+extern char *qfcvt (long double __value, int __ndigit,
+      int *__restrict __decpt, int *__restrict __sign)
+     throw () __attribute__ ((__nonnull__ (3, 4))) __attribute__ ((__warn_unused_result__));
+extern char *qgcvt (long double __value, int __ndigit, char *__buf)
+     throw () __attribute__ ((__nonnull__ (3))) __attribute__ ((__warn_unused_result__));
+
+
+
+
+extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
+     int *__restrict __sign, char *__restrict __buf,
+     size_t __len) throw () __attribute__ ((__nonnull__ (3, 4, 5)));
+extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
+     int *__restrict __sign, char *__restrict __buf,
+     size_t __len) throw () __attribute__ ((__nonnull__ (3, 4, 5)));
+
+extern int qecvt_r (long double __value, int __ndigit,
+      int *__restrict __decpt, int *__restrict __sign,
+      char *__restrict __buf, size_t __len)
+     throw () __attribute__ ((__nonnull__ (3, 4, 5)));
+extern int qfcvt_r (long double __value, int __ndigit,
+      int *__restrict __decpt, int *__restrict __sign,
+      char *__restrict __buf, size_t __len)
+     throw () __attribute__ ((__nonnull__ (3, 4, 5)));
+
+
+
+
+
+extern int mblen (const char *__s, size_t __n) throw ();
+
+
+extern int mbtowc (wchar_t *__restrict __pwc,
+     const char *__restrict __s, size_t __n) throw ();
+
+
+extern int wctomb (char *__s, wchar_t __wchar) throw ();
+
+
+
+extern size_t mbstowcs (wchar_t *__restrict __pwcs,
+   const char *__restrict __s, size_t __n) throw ();
+
+extern size_t wcstombs (char *__restrict __s,
+   const wchar_t *__restrict __pwcs, size_t __n)
+     throw ();
+
+
+
+
+
+
+
+extern int rpmatch (const char *__response) throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
+extern int getsubopt (char **__restrict __optionp,
+        char *const *__restrict __tokens,
+        char **__restrict __valuep)
+     throw () __attribute__ ((__nonnull__ (1, 2, 3))) __attribute__ ((__warn_unused_result__));
+
+
+
+
+
+extern void setkey (const char *__key) throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+
+
+
+
+extern int posix_openpt (int __oflag) __attribute__ ((__warn_unused_result__));
+
+
+
+
+
+
+
+extern int grantpt (int __fd) throw ();
+
+
+
+extern int unlockpt (int __fd) throw ();
+
+
+
+
+extern char *ptsname (int __fd) throw () __attribute__ ((__warn_unused_result__));
+
+
+
+
+
+
+extern int ptsname_r (int __fd, char *__buf, size_t __buflen)
+     throw () __attribute__ ((__nonnull__ (2)));
+
+
+extern int getpt (void);
+
+
+
+
+
+
+extern int getloadavg (double __loadavg[], int __nelem)
+     throw () __attribute__ ((__nonnull__ (1)));
+extern __inline __attribute__ ((__gnu_inline__)) double
+__attribute__ ((__leaf__)) atof (const char *__nptr) throw ()
+{
+  return strtod (__nptr, (char **) __null);
+}
+
+
+
+extern char *__realpath_chk (const char *__restrict __name,
+        char *__restrict __resolved,
+        size_t __resolvedlen) throw () __attribute__ ((__warn_unused_result__));
+extern char *__realpath_alias (const char *__restrict __name, char *__restrict __resolved) throw () __asm__ ("" "realpath")
+
+                                                 __attribute__ ((__warn_unused_result__));
+extern char *__realpath_chk_warn (const char *__restrict __name, char *__restrict __resolved, size_t __resolvedlen) throw () __asm__ ("" "__realpath_chk")
+
+
+                                                __attribute__ ((__warn_unused_result__))
+     __attribute__((__warning__ ("second argument of realpath must be either NULL or at " "least PATH_MAX bytes long buffer")))
+                                      ;
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) __attribute__ ((__warn_unused_result__)) char *
+__attribute__ ((__leaf__)) realpath (const char *__restrict __name, char *__restrict __resolved) throw ()
+{
+  if (__builtin_object_size (__resolved, 2 > 1) != (size_t) -1)
+    {
+
+
+
+
+      return __realpath_chk (__name, __resolved, __builtin_object_size (__resolved, 2 > 1));
+    }
+
+  return __realpath_alias (__name, __resolved);
+}
+
+
+extern int __ptsname_r_chk (int __fd, char *__buf, size_t __buflen,
+       size_t __nreal) throw () __attribute__ ((__nonnull__ (2)));
+extern int __ptsname_r_alias (int __fd, char *__buf, size_t __buflen) throw () __asm__ ("" "ptsname_r")
+
+     __attribute__ ((__nonnull__ (2)));
+extern int __ptsname_r_chk_warn (int __fd, char *__buf, size_t __buflen, size_t __nreal) throw () __asm__ ("" "__ptsname_r_chk")
+
+
+     __attribute__ ((__nonnull__ (2))) __attribute__((__warning__ ("ptsname_r called with buflen bigger than " "size of buf")))
+                   ;
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) int
+__attribute__ ((__leaf__)) ptsname_r (int __fd, char *__buf, size_t __buflen) throw ()
+{
+  if (__builtin_object_size (__buf, 2 > 1) != (size_t) -1)
+    {
+      if (!__builtin_constant_p (__buflen))
+ return __ptsname_r_chk (__fd, __buf, __buflen, __builtin_object_size (__buf, 2 > 1));
+      if (__buflen > __builtin_object_size (__buf, 2 > 1))
+ return __ptsname_r_chk_warn (__fd, __buf, __buflen, __builtin_object_size (__buf, 2 > 1));
+    }
+  return __ptsname_r_alias (__fd, __buf, __buflen);
+}
+
+
+extern int __wctomb_chk (char *__s, wchar_t __wchar, size_t __buflen)
+  throw () __attribute__ ((__warn_unused_result__));
+extern int __wctomb_alias (char *__s, wchar_t __wchar) throw () __asm__ ("" "wctomb")
+              __attribute__ ((__warn_unused_result__));
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) __attribute__ ((__warn_unused_result__)) int
+__attribute__ ((__leaf__)) wctomb (char *__s, wchar_t __wchar) throw ()
+{
+
+
+
+
+
+
+
+  if (__builtin_object_size (__s, 2 > 1) != (size_t) -1 && 16 > __builtin_object_size (__s, 2 > 1))
+    return __wctomb_chk (__s, __wchar, __builtin_object_size (__s, 2 > 1));
+  return __wctomb_alias (__s, __wchar);
+}
+
+
+extern size_t __mbstowcs_chk (wchar_t *__restrict __dst,
+         const char *__restrict __src,
+         size_t __len, size_t __dstlen) throw ();
+extern size_t __mbstowcs_alias (wchar_t *__restrict __dst, const char *__restrict __src, size_t __len) throw () __asm__ ("" "mbstowcs")
+
+
+                                  ;
+extern size_t __mbstowcs_chk_warn (wchar_t *__restrict __dst, const char *__restrict __src, size_t __len, size_t __dstlen) throw () __asm__ ("" "__mbstowcs_chk")
+
+
+
+     __attribute__((__warning__ ("mbstowcs called with dst buffer smaller than len " "* sizeof (wchar_t)")))
+                        ;
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) size_t
+__attribute__ ((__leaf__)) mbstowcs (wchar_t *__restrict __dst, const char *__restrict __src, size_t __len) throw ()
+
+{
+  if (__builtin_object_size (__dst, 2 > 1) != (size_t) -1)
+    {
+      if (!__builtin_constant_p (__len))
+ return __mbstowcs_chk (__dst, __src, __len,
+          __builtin_object_size (__dst, 2 > 1) / sizeof (wchar_t));
+
+      if (__len > __builtin_object_size (__dst, 2 > 1) / sizeof (wchar_t))
+ return __mbstowcs_chk_warn (__dst, __src, __len,
+         __builtin_object_size (__dst, 2 > 1) / sizeof (wchar_t));
+    }
+  return __mbstowcs_alias (__dst, __src, __len);
+}
+
+
+extern size_t __wcstombs_chk (char *__restrict __dst,
+         const wchar_t *__restrict __src,
+         size_t __len, size_t __dstlen) throw ();
+extern size_t __wcstombs_alias (char *__restrict __dst, const wchar_t *__restrict __src, size_t __len) throw () __asm__ ("" "wcstombs")
+
+
+                                  ;
+extern size_t __wcstombs_chk_warn (char *__restrict __dst, const wchar_t *__restrict __src, size_t __len, size_t __dstlen) throw () __asm__ ("" "__wcstombs_chk")
+
+
+
+     __attribute__((__warning__ ("wcstombs called with dst buffer smaller than len")));
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) size_t
+__attribute__ ((__leaf__)) wcstombs (char *__restrict __dst, const wchar_t *__restrict __src, size_t __len) throw ()
+
+{
+  if (__builtin_object_size (__dst, 2 > 1) != (size_t) -1)
+    {
+      if (!__builtin_constant_p (__len))
+ return __wcstombs_chk (__dst, __src, __len, __builtin_object_size (__dst, 2 > 1));
+      if (__len > __builtin_object_size (__dst, 2 > 1))
+ return __wcstombs_chk_warn (__dst, __src, __len, __builtin_object_size (__dst, 2 > 1));
+    }
+  return __wcstombs_alias (__dst, __src, __len);
+}
+
+
+
+
+
+}
+
+       
+extern "C++"
+{
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+  using ::abs;
+
+
+  inline long
+  abs(long __i) { return __builtin_labs(__i); }
+
+
+
+  inline long long
+  abs(long long __x) { return __builtin_llabs (__x); }
+
+
+
+
+
+
+
+  inline constexpr double
+  abs(double __x)
+  { return __builtin_fabs(__x); }
+
+  inline constexpr float
+  abs(float __x)
+  { return __builtin_fabsf(__x); }
+
+  inline constexpr long double
+  abs(long double __x)
+  { return __builtin_fabsl(__x); }
+
+
+
+  inline constexpr __int128
+  abs(__int128 __x) { return __x >= 0 ? __x : -__x; }
+  inline constexpr
+  __float128
+  abs(__float128 __x)
+  { return __x < 0 ? -__x : __x; }
+
+
+
+}
+}
+extern "C++"
+{
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+  using ::div_t;
+  using ::ldiv_t;
+
+  using ::abort;
+  using ::atexit;
+
+
+  using ::at_quick_exit;
+
+
+  using ::atof;
+  using ::atoi;
+  using ::atol;
+  using ::bsearch;
+  using ::calloc;
+  using ::div;
+  using ::exit;
+  using ::free;
+  using ::getenv;
+  using ::labs;
+  using ::ldiv;
+  using ::malloc;
+
+  using ::mblen;
+  using ::mbstowcs;
+  using ::mbtowc;
+
+  using ::qsort;
+
+
+  using ::quick_exit;
+
+
+  using ::rand;
+  using ::realloc;
+  using ::srand;
+  using ::strtod;
+  using ::strtol;
+  using ::strtoul;
+  using ::system;
+
+  using ::wcstombs;
+  using ::wctomb;
+
+
+
+  inline ldiv_t
+  div(long __i, long __j) { return ldiv(__i, __j); }
+
+
+
+
+}
+namespace __gnu_cxx __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+  using ::lldiv_t;
+
+
+
+
+
+  using ::_Exit;
+
+
+
+  using ::llabs;
+
+  inline lldiv_t
+  div(long long __n, long long __d)
+  { lldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; }
+
+  using ::lldiv;
+  using ::atoll;
+  using ::strtoll;
+  using ::strtoull;
+
+  using ::strtof;
+  using ::strtold;
+
+
+}
+
+namespace std
+{
+
+  using ::__gnu_cxx::lldiv_t;
+
+  using ::__gnu_cxx::_Exit;
+
+  using ::__gnu_cxx::llabs;
+  using ::__gnu_cxx::div;
+  using ::__gnu_cxx::lldiv;
+
+  using ::__gnu_cxx::atoll;
+  using ::__gnu_cxx::strtof;
+  using ::__gnu_cxx::strtoll;
+  using ::__gnu_cxx::strtoull;
+  using ::__gnu_cxx::strtold;
+}
+
+
+
+}
+
+using std::abort;
+using std::atexit;
+using std::exit;
+
+
+  using std::at_quick_exit;
+
+
+  using std::quick_exit;
+
+
+
+
+using std::div_t;
+using std::ldiv_t;
+
+using std::abs;
+using std::atof;
+using std::atoi;
+using std::atol;
+using std::bsearch;
+using std::calloc;
+using std::div;
+using std::free;
+using std::getenv;
+using std::labs;
+using std::ldiv;
+using std::malloc;
+
+using std::mblen;
+using std::mbstowcs;
+using std::mbtowc;
+
+using std::qsort;
+using std::rand;
+using std::realloc;
+using std::srand;
+using std::strtod;
+using std::strtol;
+using std::strtoul;
+using std::system;
+
+using std::wcstombs;
+using std::wctomb;
+
+extern "C" {
+
+
+
+
+extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
+       size_t __n) throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern void *memmove (void *__dest, const void *__src, size_t __n)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+
+
+
+extern void *memccpy (void *__restrict __dest, const void *__restrict __src,
+        int __c, size_t __n)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+
+
+extern void *memset (void *__s, int __c, size_t __n) throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern int memcmp (const void *__s1, const void *__s2, size_t __n)
+     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
+
+
+
+extern "C++"
+{
+extern void *memchr (void *__s, int __c, size_t __n)
+      throw () __asm ("memchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
+extern const void *memchr (const void *__s, int __c, size_t __n)
+      throw () __asm ("memchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
+
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) void *
+memchr (void *__s, int __c, size_t __n) throw ()
+{
+  return __builtin_memchr (__s, __c, __n);
+}
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) const void *
+memchr (const void *__s, int __c, size_t __n) throw ()
+{
+  return __builtin_memchr (__s, __c, __n);
+}
+
+}
+extern "C++" void *rawmemchr (void *__s, int __c)
+     throw () __asm ("rawmemchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
+extern "C++" const void *rawmemchr (const void *__s, int __c)
+     throw () __asm ("rawmemchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
+
+
+
+
+
+
+
+extern "C++" void *memrchr (void *__s, int __c, size_t __n)
+      throw () __asm ("memrchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
+extern "C++" const void *memrchr (const void *__s, int __c, size_t __n)
+      throw () __asm ("memrchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
+extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+extern char *strncpy (char *__restrict __dest,
+        const char *__restrict __src, size_t __n)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern char *strcat (char *__restrict __dest, const char *__restrict __src)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+extern char *strncat (char *__restrict __dest, const char *__restrict __src,
+        size_t __n) throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern int strcmp (const char *__s1, const char *__s2)
+     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
+
+extern int strncmp (const char *__s1, const char *__s2, size_t __n)
+     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern int strcoll (const char *__s1, const char *__s2)
+     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
+
+extern size_t strxfrm (char *__restrict __dest,
+         const char *__restrict __src, size_t __n)
+     throw () __attribute__ ((__nonnull__ (2)));
+
+
+
+
+
+
+extern int strcoll_l (const char *__s1, const char *__s2, locale_t __l)
+     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));
+
+
+extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,
+    locale_t __l) throw () __attribute__ ((__nonnull__ (2, 4)));
+
+
+
+
+
+extern char *strdup (const char *__s)
+     throw () __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
+
+
+
+
+
+
+extern char *strndup (const char *__string, size_t __n)
+     throw () __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
+extern "C++"
+{
+extern char *strchr (char *__s, int __c)
+     throw () __asm ("strchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
+extern const char *strchr (const char *__s, int __c)
+     throw () __asm ("strchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
+
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) char *
+strchr (char *__s, int __c) throw ()
+{
+  return __builtin_strchr (__s, __c);
+}
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) const char *
+strchr (const char *__s, int __c) throw ()
+{
+  return __builtin_strchr (__s, __c);
+}
+
+}
+
+
+
+
+
+
+extern "C++"
+{
+extern char *strrchr (char *__s, int __c)
+     throw () __asm ("strrchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
+extern const char *strrchr (const char *__s, int __c)
+     throw () __asm ("strrchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
+
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) char *
+strrchr (char *__s, int __c) throw ()
+{
+  return __builtin_strrchr (__s, __c);
+}
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) const char *
+strrchr (const char *__s, int __c) throw ()
+{
+  return __builtin_strrchr (__s, __c);
+}
+
+}
+extern "C++" char *strchrnul (char *__s, int __c)
+     throw () __asm ("strchrnul") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
+extern "C++" const char *strchrnul (const char *__s, int __c)
+     throw () __asm ("strchrnul") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
+extern size_t strcspn (const char *__s, const char *__reject)
+     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern size_t strspn (const char *__s, const char *__accept)
+     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern "C++"
+{
+extern char *strpbrk (char *__s, const char *__accept)
+     throw () __asm ("strpbrk") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
+extern const char *strpbrk (const char *__s, const char *__accept)
+     throw () __asm ("strpbrk") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) char *
+strpbrk (char *__s, const char *__accept) throw ()
+{
+  return __builtin_strpbrk (__s, __accept);
+}
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) const char *
+strpbrk (const char *__s, const char *__accept) throw ()
+{
+  return __builtin_strpbrk (__s, __accept);
+}
+
+}
+
+
+
+
+
+
+extern "C++"
+{
+extern char *strstr (char *__haystack, const char *__needle)
+     throw () __asm ("strstr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
+extern const char *strstr (const char *__haystack, const char *__needle)
+     throw () __asm ("strstr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) char *
+strstr (char *__haystack, const char *__needle) throw ()
+{
+  return __builtin_strstr (__haystack, __needle);
+}
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) const char *
+strstr (const char *__haystack, const char *__needle) throw ()
+{
+  return __builtin_strstr (__haystack, __needle);
+}
+
+}
+
+
+
+
+
+
+
+extern char *strtok (char *__restrict __s, const char *__restrict __delim)
+     throw () __attribute__ ((__nonnull__ (2)));
+
+
+
+extern char *__strtok_r (char *__restrict __s,
+    const char *__restrict __delim,
+    char **__restrict __save_ptr)
+     throw () __attribute__ ((__nonnull__ (2, 3)));
+
+extern char *strtok_r (char *__restrict __s, const char *__restrict __delim,
+         char **__restrict __save_ptr)
+     throw () __attribute__ ((__nonnull__ (2, 3)));
+
+
+
+
+
+extern "C++" char *strcasestr (char *__haystack, const char *__needle)
+     throw () __asm ("strcasestr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
+extern "C++" const char *strcasestr (const char *__haystack,
+         const char *__needle)
+     throw () __asm ("strcasestr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
+extern void *memmem (const void *__haystack, size_t __haystacklen,
+       const void *__needle, size_t __needlelen)
+     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 3)));
+
+
+
+extern void *__mempcpy (void *__restrict __dest,
+   const void *__restrict __src, size_t __n)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+extern void *mempcpy (void *__restrict __dest,
+        const void *__restrict __src, size_t __n)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+
+
+extern size_t strlen (const char *__s)
+     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
+
+
+
+
+extern size_t strnlen (const char *__string, size_t __maxlen)
+     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
+
+
+
+
+extern char *strerror (int __errnum) throw ();
+extern char *strerror_r (int __errnum, char *__buf, size_t __buflen)
+     throw () __attribute__ ((__nonnull__ (2))) __attribute__ ((__warn_unused_result__));
+
+
+
+
+
+extern char *strerror_l (int __errnum, locale_t __l) throw ();
+
+
+
+
+
+
+
+
+
+extern "C" {
+
+
+
+extern int bcmp (const void *__s1, const void *__s2, size_t __n)
+     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern void bcopy (const void *__src, void *__dest, size_t __n)
+  throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern void bzero (void *__s, size_t __n) throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+extern "C++"
+{
+extern char *index (char *__s, int __c)
+     throw () __asm ("index") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
+extern const char *index (const char *__s, int __c)
+     throw () __asm ("index") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
+
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) char *
+index (char *__s, int __c) throw ()
+{
+  return __builtin_index (__s, __c);
+}
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) const char *
+index (const char *__s, int __c) throw ()
+{
+  return __builtin_index (__s, __c);
+}
+
+}
+
+
+
+
+
+
+
+extern "C++"
+{
+extern char *rindex (char *__s, int __c)
+     throw () __asm ("rindex") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
+extern const char *rindex (const char *__s, int __c)
+     throw () __asm ("rindex") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
+
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) char *
+rindex (char *__s, int __c) throw ()
+{
+  return __builtin_rindex (__s, __c);
+}
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) const char *
+rindex (const char *__s, int __c) throw ()
+{
+  return __builtin_rindex (__s, __c);
+}
+
+}
+extern int ffs (int __i) throw () __attribute__ ((__const__));
+
+
+
+
+
+extern int ffsl (long int __l) throw () __attribute__ ((__const__));
+__extension__ extern int ffsll (long long int __ll)
+     throw () __attribute__ ((__const__));
+
+
+
+extern int strcasecmp (const char *__s1, const char *__s2)
+     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern int strncasecmp (const char *__s1, const char *__s2, size_t __n)
+     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
+
+
+
+
+
+
+extern int strcasecmp_l (const char *__s1, const char *__s2, locale_t __loc)
+     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));
+
+
+
+extern int strncasecmp_l (const char *__s1, const char *__s2,
+     size_t __n, locale_t __loc)
+     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 4)));
+
+
+}
+
+
+
+
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) void
+__attribute__ ((__leaf__)) bcopy (const void *__src, void *__dest, size_t __len) throw ()
+{
+  (void) __builtin___memmove_chk (__dest, __src, __len, __builtin_object_size (__dest, 0));
+}
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) void
+__attribute__ ((__leaf__)) bzero (void *__dest, size_t __len) throw ()
+{
+  (void) __builtin___memset_chk (__dest, '\0', __len, __builtin_object_size (__dest, 0));
+}
+
+
+
+extern void explicit_bzero (void *__s, size_t __n) throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+extern char *strsep (char **__restrict __stringp,
+       const char *__restrict __delim)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+
+
+extern char *strsignal (int __sig) throw ();
+
+
+extern char *__stpcpy (char *__restrict __dest, const char *__restrict __src)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+extern char *stpcpy (char *__restrict __dest, const char *__restrict __src)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+
+extern char *__stpncpy (char *__restrict __dest,
+   const char *__restrict __src, size_t __n)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+extern char *stpncpy (char *__restrict __dest,
+        const char *__restrict __src, size_t __n)
+     throw () __attribute__ ((__nonnull__ (1, 2)));
+
+
+
+
+extern int strverscmp (const char *__s1, const char *__s2)
+     throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
+
+
+extern char *strfry (char *__string) throw () __attribute__ ((__nonnull__ (1)));
+
+
+extern void *memfrob (void *__s, size_t __n) throw () __attribute__ ((__nonnull__ (1)));
+
+
+
+
+
+
+
+extern "C++" char *basename (char *__filename)
+     throw () __asm ("basename") __attribute__ ((__nonnull__ (1)));
+extern "C++" const char *basename (const char *__filename)
+     throw () __asm ("basename") __attribute__ ((__nonnull__ (1)));
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) void *
+__attribute__ ((__leaf__)) memcpy (void *__restrict __dest, const void *__restrict __src, size_t __len) throw ()
+
+{
+  return __builtin___memcpy_chk (__dest, __src, __len, __builtin_object_size (__dest, 0));
+}
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) void *
+__attribute__ ((__leaf__)) memmove (void *__dest, const void *__src, size_t __len) throw ()
+{
+  return __builtin___memmove_chk (__dest, __src, __len, __builtin_object_size (__dest, 0));
+}
+
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) void *
+__attribute__ ((__leaf__)) mempcpy (void *__restrict __dest, const void *__restrict __src, size_t __len) throw ()
+
+{
+  return __builtin___mempcpy_chk (__dest, __src, __len, __builtin_object_size (__dest, 0));
+}
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) void *
+__attribute__ ((__leaf__)) memset (void *__dest, int __ch, size_t __len) throw ()
+{
+  return __builtin___memset_chk (__dest, __ch, __len, __builtin_object_size (__dest, 0));
+}
+
+
+
+
+void __explicit_bzero_chk (void *__dest, size_t __len, size_t __destlen)
+  throw () __attribute__ ((__nonnull__ (1)));
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) void
+__attribute__ ((__leaf__)) explicit_bzero (void *__dest, size_t __len) throw ()
+{
+  __explicit_bzero_chk (__dest, __len, __builtin_object_size (__dest, 0));
+}
+
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) char *
+__attribute__ ((__leaf__)) strcpy (char *__restrict __dest, const char *__restrict __src) throw ()
+{
+  return __builtin___strcpy_chk (__dest, __src, __builtin_object_size (__dest, 2 > 1));
+}
+
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) char *
+__attribute__ ((__leaf__)) stpcpy (char *__restrict __dest, const char *__restrict __src) throw ()
+{
+  return __builtin___stpcpy_chk (__dest, __src, __builtin_object_size (__dest, 2 > 1));
+}
+
+
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) char *
+__attribute__ ((__leaf__)) strncpy (char *__restrict __dest, const char *__restrict __src, size_t __len) throw ()
+
+{
+  return __builtin___strncpy_chk (__dest, __src, __len, __builtin_object_size (__dest, 2 > 1));
+}
+
+
+extern char *__stpncpy_chk (char *__dest, const char *__src, size_t __n,
+       size_t __destlen) throw ();
+extern char *__stpncpy_alias (char *__dest, const char *__src, size_t __n) throw () __asm__ ("" "stpncpy")
+                                 ;
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) char *
+__attribute__ ((__leaf__)) stpncpy (char *__dest, const char *__src, size_t __n) throw ()
+{
+  if (__builtin_object_size (__dest, 2 > 1) != (size_t) -1
+      && (!__builtin_constant_p (__n) || __n > __builtin_object_size (__dest, 2 > 1)))
+    return __stpncpy_chk (__dest, __src, __n, __builtin_object_size (__dest, 2 > 1));
+  return __stpncpy_alias (__dest, __src, __n);
+}
+
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) char *
+__attribute__ ((__leaf__)) strcat (char *__restrict __dest, const char *__restrict __src) throw ()
+{
+  return __builtin___strcat_chk (__dest, __src, __builtin_object_size (__dest, 2 > 1));
+}
+
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) char *
+__attribute__ ((__leaf__)) strncat (char *__restrict __dest, const char *__restrict __src, size_t __len) throw ()
+
+{
+  return __builtin___strncat_chk (__dest, __src, __len, __builtin_object_size (__dest, 2 > 1));
+}
+
+
+
+}
+
+       
+
+
+       
+extern "C++" {
+
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+  struct __true_type { };
+  struct __false_type { };
+
+  template<bool>
+    struct __truth_type
+    { typedef __false_type __type; };
+
+  template<>
+    struct __truth_type<true>
+    { typedef __true_type __type; };
+
+
+
+  template<class _Sp, class _Tp>
+    struct __traitor
+    {
+      enum { __value = bool(_Sp::__value) || bool(_Tp::__value) };
+      typedef typename __truth_type<__value>::__type __type;
+    };
+
+
+  template<typename, typename>
+    struct __are_same
+    {
+      enum { __value = 0 };
+      typedef __false_type __type;
+    };
+
+  template<typename _Tp>
+    struct __are_same<_Tp, _Tp>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+
+  template<typename _Tp>
+    struct __is_void
+    {
+      enum { __value = 0 };
+      typedef __false_type __type;
+    };
+
+  template<>
+    struct __is_void<void>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+
+
+
+  template<typename _Tp>
+    struct __is_integer
+    {
+      enum { __value = 0 };
+      typedef __false_type __type;
+    };
+
+
+
+
+
+  template<>
+    struct __is_integer<bool>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_integer<char>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_integer<signed char>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_integer<unsigned char>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+
+  template<>
+    struct __is_integer<wchar_t>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+
+
+  template<>
+    struct __is_integer<char16_t>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_integer<char32_t>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+
+  template<>
+    struct __is_integer<short>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_integer<unsigned short>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_integer<int>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_integer<unsigned int>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_integer<long>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_integer<unsigned long>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_integer<long long>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_integer<unsigned long long>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+template<> struct __is_integer<__int128> { enum { __value = 1 }; typedef __true_type __type; }; template<> struct __is_integer<unsigned __int128> { enum { __value = 1 }; typedef __true_type __type; };
+  template<typename _Tp>
+    struct __is_floating
+    {
+      enum { __value = 0 };
+      typedef __false_type __type;
+    };
+
+
+  template<>
+    struct __is_floating<float>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_floating<double>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_floating<long double>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+
+
+
+  template<typename _Tp>
+    struct __is_pointer
+    {
+      enum { __value = 0 };
+      typedef __false_type __type;
+    };
+
+  template<typename _Tp>
+    struct __is_pointer<_Tp*>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+
+
+
+  template<typename _Tp>
+    struct __is_arithmetic
+    : public __traitor<__is_integer<_Tp>, __is_floating<_Tp> >
+    { };
+
+
+
+
+  template<typename _Tp>
+    struct __is_scalar
+    : public __traitor<__is_arithmetic<_Tp>, __is_pointer<_Tp> >
+    { };
+
+
+
+
+  template<typename _Tp>
+    struct __is_char
+    {
+      enum { __value = 0 };
+      typedef __false_type __type;
+    };
+
+  template<>
+    struct __is_char<char>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+
+  template<>
+    struct __is_char<wchar_t>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+
+  template<typename _Tp>
+    struct __is_byte
+    {
+      enum { __value = 0 };
+      typedef __false_type __type;
+    };
+
+  template<>
+    struct __is_byte<char>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_byte<signed char>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+  template<>
+    struct __is_byte<unsigned char>
+    {
+      enum { __value = 1 };
+      typedef __true_type __type;
+    };
+
+
+
+
+  template<typename _Tp>
+    struct __is_move_iterator
+    {
+      enum { __value = 0 };
+      typedef __false_type __type;
+    };
+
+
+
+  template<typename _Iterator>
+    inline _Iterator
+    __miter_base(_Iterator __it)
+    { return __it; }
+
+
+}
+}
+       
+
+
+
+
+extern "C++" {
+
+namespace __gnu_cxx __attribute__ ((__visibility__ ("default")))
+{
+
+
+
+  template<bool, typename>
+    struct __enable_if
+    { };
+
+  template<typename _Tp>
+    struct __enable_if<true, _Tp>
+    { typedef _Tp __type; };
+
+
+
+  template<bool _Cond, typename _Iftrue, typename _Iffalse>
+    struct __conditional_type
+    { typedef _Iftrue __type; };
+
+  template<typename _Iftrue, typename _Iffalse>
+    struct __conditional_type<false, _Iftrue, _Iffalse>
+    { typedef _Iffalse __type; };
+
+
+
+  template<typename _Tp>
+    struct __add_unsigned
+    {
+    private:
+      typedef __enable_if<std::__is_integer<_Tp>::__value, _Tp> __if_type;
+
+    public:
+      typedef typename __if_type::__type __type;
+    };
+
+  template<>
+    struct __add_unsigned<char>
+    { typedef unsigned char __type; };
+
+  template<>
+    struct __add_unsigned<signed char>
+    { typedef unsigned char __type; };
+
+  template<>
+    struct __add_unsigned<short>
+    { typedef unsigned short __type; };
+
+  template<>
+    struct __add_unsigned<int>
+    { typedef unsigned int __type; };
+
+  template<>
+    struct __add_unsigned<long>
+    { typedef unsigned long __type; };
+
+  template<>
+    struct __add_unsigned<long long>
+    { typedef unsigned long long __type; };
+
+
+  template<>
+    struct __add_unsigned<bool>;
+
+  template<>
+    struct __add_unsigned<wchar_t>;
+
+
+
+  template<typename _Tp>
+    struct __remove_unsigned
+    {
+    private:
+      typedef __enable_if<std::__is_integer<_Tp>::__value, _Tp> __if_type;
+
+    public:
+      typedef typename __if_type::__type __type;
+    };
+
+  template<>
+    struct __remove_unsigned<char>
+    { typedef signed char __type; };
+
+  template<>
+    struct __remove_unsigned<unsigned char>
+    { typedef signed char __type; };
+
+  template<>
+    struct __remove_unsigned<unsigned short>
+    { typedef short __type; };
+
+  template<>
+    struct __remove_unsigned<unsigned int>
+    { typedef int __type; };
+
+  template<>
+    struct __remove_unsigned<unsigned long>
+    { typedef long __type; };
+
+  template<>
+    struct __remove_unsigned<unsigned long long>
+    { typedef long long __type; };
+
+
+  template<>
+    struct __remove_unsigned<bool>;
+
+  template<>
+    struct __remove_unsigned<wchar_t>;
+
+
+
+  template<typename _Type>
+    inline bool
+    __is_null_pointer(_Type* __ptr)
+    { return __ptr == 0; }
+
+  template<typename _Type>
+    inline bool
+    __is_null_pointer(_Type)
+    { return false; }
+
+
+  inline bool
+  __is_null_pointer(std::nullptr_t)
+  { return true; }
+
+
+
+  template<typename _Tp, bool = std::__is_integer<_Tp>::__value>
+    struct __promote
+    { typedef double __type; };
+
+
+
+
+  template<typename _Tp>
+    struct __promote<_Tp, false>
+    { };
+
+  template<>
+    struct __promote<long double>
+    { typedef long double __type; };
+
+  template<>
+    struct __promote<double>
+    { typedef double __type; };
+
+  template<>
+    struct __promote<float>
+    { typedef float __type; };
+
+  template<typename _Tp, typename _Up,
+           typename _Tp2 = typename __promote<_Tp>::__type,
+           typename _Up2 = typename __promote<_Up>::__type>
+    struct __promote_2
+    {
+      typedef __typeof__(_Tp2() + _Up2()) __type;
+    };
+
+  template<typename _Tp, typename _Up, typename _Vp,
+           typename _Tp2 = typename __promote<_Tp>::__type,
+           typename _Up2 = typename __promote<_Up>::__type,
+           typename _Vp2 = typename __promote<_Vp>::__type>
+    struct __promote_3
+    {
+      typedef __typeof__(_Tp2() + _Up2() + _Vp2()) __type;
+    };
+
+  template<typename _Tp, typename _Up, typename _Vp, typename _Wp,
+           typename _Tp2 = typename __promote<_Tp>::__type,
+           typename _Up2 = typename __promote<_Up>::__type,
+           typename _Vp2 = typename __promote<_Vp>::__type,
+           typename _Wp2 = typename __promote<_Wp>::__type>
+    struct __promote_4
+    {
+      typedef __typeof__(_Tp2() + _Up2() + _Vp2() + _Wp2()) __type;
+    };
+
+
+}
+}
+
+
+extern "C" {
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+typedef float float_t;
+typedef double double_t;
+
+
+
+enum
+  {
+    FP_INT_UPWARD =
+
+      0,
+    FP_INT_DOWNWARD =
+
+      1,
+    FP_INT_TOWARDZERO =
+
+      2,
+    FP_INT_TONEARESTFROMZERO =
+
+      3,
+    FP_INT_TONEAREST =
+
+      4,
+  };
+extern int __fpclassify (double __value) throw ()
+     __attribute__ ((__const__));
+
+
+extern int __signbit (double __value) throw ()
+     __attribute__ ((__const__));
+
+
+
+extern int __isinf (double __value) throw () __attribute__ ((__const__));
+
+
+extern int __finite (double __value) throw () __attribute__ ((__const__));
+
+
+extern int __isnan (double __value) throw () __attribute__ ((__const__));
+
+
+extern int __iseqsig (double __x, double __y) throw ();
+
+
+extern int __issignaling (double __value) throw ()
+     __attribute__ ((__const__));
+extern double acos (double __x) throw (); extern double __acos (double __x) throw ();
+
+extern double asin (double __x) throw (); extern double __asin (double __x) throw ();
+
+extern double atan (double __x) throw (); extern double __atan (double __x) throw ();
+
+extern double atan2 (double __y, double __x) throw (); extern double __atan2 (double __y, double __x) throw ();
+
+
+ extern double cos (double __x) throw (); extern double __cos (double __x) throw ();
+
+ extern double sin (double __x) throw (); extern double __sin (double __x) throw ();
+
+extern double tan (double __x) throw (); extern double __tan (double __x) throw ();
+
+
+
+
+extern double cosh (double __x) throw (); extern double __cosh (double __x) throw ();
+
+extern double sinh (double __x) throw (); extern double __sinh (double __x) throw ();
+
+extern double tanh (double __x) throw (); extern double __tanh (double __x) throw ();
+
+
+
+ extern void sincos (double __x, double *__sinx, double *__cosx) throw (); extern void __sincos (double __x, double *__sinx, double *__cosx) throw ()
+                                                        ;
+
+
+
+
+extern double acosh (double __x) throw (); extern double __acosh (double __x) throw ();
+
+extern double asinh (double __x) throw (); extern double __asinh (double __x) throw ();
+
+extern double atanh (double __x) throw (); extern double __atanh (double __x) throw ();
+
+
+
+
+
+ extern double exp (double __x) throw (); extern double __exp (double __x) throw ();
+
+
+extern double frexp (double __x, int *__exponent) throw (); extern double __frexp (double __x, int *__exponent) throw ();
+
+
+extern double ldexp (double __x, int __exponent) throw (); extern double __ldexp (double __x, int __exponent) throw ();
+
+
+ extern double log (double __x) throw (); extern double __log (double __x) throw ();
+
+
+extern double log10 (double __x) throw (); extern double __log10 (double __x) throw ();
+
+
+extern double modf (double __x, double *__iptr) throw (); extern double __modf (double __x, double *__iptr) throw () __attribute__ ((__nonnull__ (2)));
+
+
+
+extern double exp10 (double __x) throw (); extern double __exp10 (double __x) throw ();
+
+
+
+
+extern double pow10 (double __x) throw (); extern double __pow10 (double __x) throw ();
+
+
+
+
+
+extern double expm1 (double __x) throw (); extern double __expm1 (double __x) throw ();
+
+
+extern double log1p (double __x) throw (); extern double __log1p (double __x) throw ();
+
+
+extern double logb (double __x) throw (); extern double __logb (double __x) throw ();
+
+
+
+
+extern double exp2 (double __x) throw (); extern double __exp2 (double __x) throw ();
+
+
+extern double log2 (double __x) throw (); extern double __log2 (double __x) throw ();
+
+
+
+
+
+
+ extern double pow (double __x, double __y) throw (); extern double __pow (double __x, double __y) throw ();
+
+
+extern double sqrt (double __x) throw (); extern double __sqrt (double __x) throw ();
+
+
+
+extern double hypot (double __x, double __y) throw (); extern double __hypot (double __x, double __y) throw ();
+
+
+
+
+extern double cbrt (double __x) throw (); extern double __cbrt (double __x) throw ();
+
+
+
+
+
+
+extern double ceil (double __x) throw () __attribute__ ((__const__)); extern double __ceil (double __x) throw () __attribute__ ((__const__));
+
+
+extern double fabs (double __x) throw () __attribute__ ((__const__)); extern double __fabs (double __x) throw () __attribute__ ((__const__));
+
+
+extern double floor (double __x) throw () __attribute__ ((__const__)); extern double __floor (double __x) throw () __attribute__ ((__const__));
+
+
+extern double fmod (double __x, double __y) throw (); extern double __fmod (double __x, double __y) throw ();
+extern int finite (double __value) throw () __attribute__ ((__const__));
+
+
+extern double drem (double __x, double __y) throw (); extern double __drem (double __x, double __y) throw ();
+
+
+
+extern double significand (double __x) throw (); extern double __significand (double __x) throw ();
+
+
+
+
+
+
+extern double copysign (double __x, double __y) throw () __attribute__ ((__const__)); extern double __copysign (double __x, double __y) throw () __attribute__ ((__const__));
+
+
+
+
+extern double nan (const char *__tagb) throw () __attribute__ ((__const__)); extern double __nan (const char *__tagb) throw () __attribute__ ((__const__));
+extern double j0 (double) throw (); extern double __j0 (double) throw ();
+extern double j1 (double) throw (); extern double __j1 (double) throw ();
+extern double jn (int, double) throw (); extern double __jn (int, double) throw ();
+extern double y0 (double) throw (); extern double __y0 (double) throw ();
+extern double y1 (double) throw (); extern double __y1 (double) throw ();
+extern double yn (int, double) throw (); extern double __yn (int, double) throw ();
+
+
+
+
+
+extern double erf (double) throw (); extern double __erf (double) throw ();
+extern double erfc (double) throw (); extern double __erfc (double) throw ();
+extern double lgamma (double) throw (); extern double __lgamma (double) throw ();
+
+
+
+
+extern double tgamma (double) throw (); extern double __tgamma (double) throw ();
+
+
+
+
+
+extern double gamma (double) throw (); extern double __gamma (double) throw ();
+
+
+
+
+
+
+
+extern double lgamma_r (double, int *__signgamp) throw (); extern double __lgamma_r (double, int *__signgamp) throw ();
+
+
+
+
+
+
+extern double rint (double __x) throw (); extern double __rint (double __x) throw ();
+
+
+extern double nextafter (double __x, double __y) throw () __attribute__ ((__const__)); extern double __nextafter (double __x, double __y) throw () __attribute__ ((__const__));
+
+extern double nexttoward (double __x, long double __y) throw () __attribute__ ((__const__)); extern double __nexttoward (double __x, long double __y) throw () __attribute__ ((__const__));
+
+
+
+
+extern double nextdown (double __x) throw (); extern double __nextdown (double __x) throw ();
+
+extern double nextup (double __x) throw (); extern double __nextup (double __x) throw ();
+
+
+
+extern double remainder (double __x, double __y) throw (); extern double __remainder (double __x, double __y) throw ();
+
+
+
+extern double scalbn (double __x, int __n) throw (); extern double __scalbn (double __x, int __n) throw ();
+
+
+
+extern int ilogb (double __x) throw (); extern int __ilogb (double __x) throw ();
+
+
+
+
+extern long int llogb (double __x) throw (); extern long int __llogb (double __x) throw ();
+
+
+
+
+extern double scalbln (double __x, long int __n) throw (); extern double __scalbln (double __x, long int __n) throw ();
+
+
+
+extern double nearbyint (double __x) throw (); extern double __nearbyint (double __x) throw ();
+
+
+
+extern double round (double __x) throw () __attribute__ ((__const__)); extern double __round (double __x) throw () __attribute__ ((__const__));
+
+
+
+extern double trunc (double __x) throw () __attribute__ ((__const__)); extern double __trunc (double __x) throw () __attribute__ ((__const__));
+
+
+
+
+extern double remquo (double __x, double __y, int *__quo) throw (); extern double __remquo (double __x, double __y, int *__quo) throw ();
+
+
+
+
+
+
+extern long int lrint (double __x) throw (); extern long int __lrint (double __x) throw ();
+__extension__
+extern long long int llrint (double __x) throw (); extern long long int __llrint (double __x) throw ();
+
+
+
+extern long int lround (double __x) throw (); extern long int __lround (double __x) throw ();
+__extension__
+extern long long int llround (double __x) throw (); extern long long int __llround (double __x) throw ();
+
+
+
+extern double fdim (double __x, double __y) throw (); extern double __fdim (double __x, double __y) throw ();
+
+
+extern double fmax (double __x, double __y) throw () __attribute__ ((__const__)); extern double __fmax (double __x, double __y) throw () __attribute__ ((__const__));
+
+
+extern double fmin (double __x, double __y) throw () __attribute__ ((__const__)); extern double __fmin (double __x, double __y) throw () __attribute__ ((__const__));
+
+
+extern double fma (double __x, double __y, double __z) throw (); extern double __fma (double __x, double __y, double __z) throw ();
+
+
+
+
+extern double roundeven (double __x) throw () __attribute__ ((__const__)); extern double __roundeven (double __x) throw () __attribute__ ((__const__));
+
+
+
+extern __intmax_t fromfp (double __x, int __round, unsigned int __width) throw (); extern __intmax_t __fromfp (double __x, int __round, unsigned int __width) throw ()
+                            ;
+
+
+
+extern __uintmax_t ufromfp (double __x, int __round, unsigned int __width) throw (); extern __uintmax_t __ufromfp (double __x, int __round, unsigned int __width) throw ()
+                              ;
+
+
+
+
+extern __intmax_t fromfpx (double __x, int __round, unsigned int __width) throw (); extern __intmax_t __fromfpx (double __x, int __round, unsigned int __width) throw ()
+                             ;
+
+
+
+
+extern __uintmax_t ufromfpx (double __x, int __round, unsigned int __width) throw (); extern __uintmax_t __ufromfpx (double __x, int __round, unsigned int __width) throw ()
+                               ;
+
+
+extern double fmaxmag (double __x, double __y) throw () __attribute__ ((__const__)); extern double __fmaxmag (double __x, double __y) throw () __attribute__ ((__const__));
+
+
+extern double fminmag (double __x, double __y) throw () __attribute__ ((__const__)); extern double __fminmag (double __x, double __y) throw () __attribute__ ((__const__));
+
+
+extern int totalorder (double __x, double __y) throw ()
+     __attribute__ ((__const__));
+
+
+extern int totalordermag (double __x, double __y) throw ()
+     __attribute__ ((__const__));
+
+
+extern int canonicalize (double *__cx, const double *__x) throw ();
+
+
+extern double getpayload (const double *__x) throw (); extern double __getpayload (const double *__x) throw ();
+
+
+extern int setpayload (double *__x, double __payload) throw ();
+
+
+extern int setpayloadsig (double *__x, double __payload) throw ();
+
+
+
+
+
+
+
+extern double scalb (double __x, double __n) throw (); extern double __scalb (double __x, double __n) throw ();
+extern int __fpclassifyf (float __value) throw ()
+     __attribute__ ((__const__));
+
+
+extern int __signbitf (float __value) throw ()
+     __attribute__ ((__const__));
+
+
+
+extern int __isinff (float __value) throw () __attribute__ ((__const__));
+
+
+extern int __finitef (float __value) throw () __attribute__ ((__const__));
+
+
+extern int __isnanf (float __value) throw () __attribute__ ((__const__));
+
+
+extern int __iseqsigf (float __x, float __y) throw ();
+
+
+extern int __issignalingf (float __value) throw ()
+     __attribute__ ((__const__));
+extern float acosf (float __x) throw (); extern float __acosf (float __x) throw ();
+
+extern float asinf (float __x) throw (); extern float __asinf (float __x) throw ();
+
+extern float atanf (float __x) throw (); extern float __atanf (float __x) throw ();
+
+extern float atan2f (float __y, float __x) throw (); extern float __atan2f (float __y, float __x) throw ();
+
+
+ extern float cosf (float __x) throw (); extern float __cosf (float __x) throw ();
+
+ extern float sinf (float __x) throw (); extern float __sinf (float __x) throw ();
+
+extern float tanf (float __x) throw (); extern float __tanf (float __x) throw ();
+
+
+
+
+extern float coshf (float __x) throw (); extern float __coshf (float __x) throw ();
+
+extern float sinhf (float __x) throw (); extern float __sinhf (float __x) throw ();
+
+extern float tanhf (float __x) throw (); extern float __tanhf (float __x) throw ();
+
+
+
+ extern void sincosf (float __x, float *__sinx, float *__cosx) throw (); extern void __sincosf (float __x, float *__sinx, float *__cosx) throw ()
+                                                        ;
+
+
+
+
+extern float acoshf (float __x) throw (); extern float __acoshf (float __x) throw ();
+
+extern float asinhf (float __x) throw (); extern float __asinhf (float __x) throw ();
+
+extern float atanhf (float __x) throw (); extern float __atanhf (float __x) throw ();
+
+
+
+
+
+ extern float expf (float __x) throw (); extern float __expf (float __x) throw ();
+
+
+extern float frexpf (float __x, int *__exponent) throw (); extern float __frexpf (float __x, int *__exponent) throw ();
+
+
+extern float ldexpf (float __x, int __exponent) throw (); extern float __ldexpf (float __x, int __exponent) throw ();
+
+
+ extern float logf (float __x) throw (); extern float __logf (float __x) throw ();
+
+
+extern float log10f (float __x) throw (); extern float __log10f (float __x) throw ();
+
+
+extern float modff (float __x, float *__iptr) throw (); extern float __modff (float __x, float *__iptr) throw () __attribute__ ((__nonnull__ (2)));
+
+
+
+extern float exp10f (float __x) throw (); extern float __exp10f (float __x) throw ();
+
+
+
+
+extern float pow10f (float __x) throw (); extern float __pow10f (float __x) throw ();
+
+
+
+
+
+extern float expm1f (float __x) throw (); extern float __expm1f (float __x) throw ();
+
+
+extern float log1pf (float __x) throw (); extern float __log1pf (float __x) throw ();
+
+
+extern float logbf (float __x) throw (); extern float __logbf (float __x) throw ();
+
+
+
+
+extern float exp2f (float __x) throw (); extern float __exp2f (float __x) throw ();
+
+
+extern float log2f (float __x) throw (); extern float __log2f (float __x) throw ();
+
+
+
+
+
+
+ extern float powf (float __x, float __y) throw (); extern float __powf (float __x, float __y) throw ();
+
+
+extern float sqrtf (float __x) throw (); extern float __sqrtf (float __x) throw ();
+
+
+
+extern float hypotf (float __x, float __y) throw (); extern float __hypotf (float __x, float __y) throw ();
+
+
+
+
+extern float cbrtf (float __x) throw (); extern float __cbrtf (float __x) throw ();
+
+
+
+
+
+
+extern float ceilf (float __x) throw () __attribute__ ((__const__)); extern float __ceilf (float __x) throw () __attribute__ ((__const__));
+
+
+extern float fabsf (float __x) throw () __attribute__ ((__const__)); extern float __fabsf (float __x) throw () __attribute__ ((__const__));
+
+
+extern float floorf (float __x) throw () __attribute__ ((__const__)); extern float __floorf (float __x) throw () __attribute__ ((__const__));
+
+
+extern float fmodf (float __x, float __y) throw (); extern float __fmodf (float __x, float __y) throw ();
+extern int isinff (float __value) throw () __attribute__ ((__const__));
+
+
+
+
+extern int finitef (float __value) throw () __attribute__ ((__const__));
+
+
+extern float dremf (float __x, float __y) throw (); extern float __dremf (float __x, float __y) throw ();
+
+
+
+extern float significandf (float __x) throw (); extern float __significandf (float __x) throw ();
+
+
+
+
+
+
+extern float copysignf (float __x, float __y) throw () __attribute__ ((__const__)); extern float __copysignf (float __x, float __y) throw () __attribute__ ((__const__));
+
+
+
+
+extern float nanf (const char *__tagb) throw () __attribute__ ((__const__)); extern float __nanf (const char *__tagb) throw () __attribute__ ((__const__));
+extern int isnanf (float __value) throw () __attribute__ ((__const__));
+
+
+
+
+
+extern float j0f (float) throw (); extern float __j0f (float) throw ();
+extern float j1f (float) throw (); extern float __j1f (float) throw ();
+extern float jnf (int, float) throw (); extern float __jnf (int, float) throw ();
+extern float y0f (float) throw (); extern float __y0f (float) throw ();
+extern float y1f (float) throw (); extern float __y1f (float) throw ();
+extern float ynf (int, float) throw (); extern float __ynf (int, float) throw ();
+
+
+
+
+
+extern float erff (float) throw (); extern float __erff (float) throw ();
+extern float erfcf (float) throw (); extern float __erfcf (float) throw ();
+extern float lgammaf (float) throw (); extern float __lgammaf (float) throw ();
+
+
+
+
+extern float tgammaf (float) throw (); extern float __tgammaf (float) throw ();
+
+
+
+
+
+extern float gammaf (float) throw (); extern float __gammaf (float) throw ();
+
+
+
+
+
+
+
+extern float lgammaf_r (float, int *__signgamp) throw (); extern float __lgammaf_r (float, int *__signgamp) throw ();
+
+
+
+
+
+
+extern float rintf (float __x) throw (); extern float __rintf (float __x) throw ();
+
+
+extern float nextafterf (float __x, float __y) throw () __attribute__ ((__const__)); extern float __nextafterf (float __x, float __y) throw () __attribute__ ((__const__));
+
+extern float nexttowardf (float __x, long double __y) throw () __attribute__ ((__const__)); extern float __nexttowardf (float __x, long double __y) throw () __attribute__ ((__const__));
+
+
+
+
+extern float nextdownf (float __x) throw (); extern float __nextdownf (float __x) throw ();
+
+extern float nextupf (float __x) throw (); extern float __nextupf (float __x) throw ();
+
+
+
+extern float remainderf (float __x, float __y) throw (); extern float __remainderf (float __x, float __y) throw ();
+
+
+
+extern float scalbnf (float __x, int __n) throw (); extern float __scalbnf (float __x, int __n) throw ();
+
+
+
+extern int ilogbf (float __x) throw (); extern int __ilogbf (float __x) throw ();
+
+
+
+
+extern long int llogbf (float __x) throw (); extern long int __llogbf (float __x) throw ();
+
+
+
+
+extern float scalblnf (float __x, long int __n) throw (); extern float __scalblnf (float __x, long int __n) throw ();
+
+
+
+extern float nearbyintf (float __x) throw (); extern float __nearbyintf (float __x) throw ();
+
+
+
+extern float roundf (float __x) throw () __attribute__ ((__const__)); extern float __roundf (float __x) throw () __attribute__ ((__const__));
+
+
+
+extern float truncf (float __x) throw () __attribute__ ((__const__)); extern float __truncf (float __x) throw () __attribute__ ((__const__));
+
+
+
+
+extern float remquof (float __x, float __y, int *__quo) throw (); extern float __remquof (float __x, float __y, int *__quo) throw ();
+
+
+
+
+
+
+extern long int lrintf (float __x) throw (); extern long int __lrintf (float __x) throw ();
+__extension__
+extern long long int llrintf (float __x) throw (); extern long long int __llrintf (float __x) throw ();
+
+
+
+extern long int lroundf (float __x) throw (); extern long int __lroundf (float __x) throw ();
+__extension__
+extern long long int llroundf (float __x) throw (); extern long long int __llroundf (float __x) throw ();
+
+
+
+extern float fdimf (float __x, float __y) throw (); extern float __fdimf (float __x, float __y) throw ();
+
+
+extern float fmaxf (float __x, float __y) throw () __attribute__ ((__const__)); extern float __fmaxf (float __x, float __y) throw () __attribute__ ((__const__));
+
+
+extern float fminf (float __x, float __y) throw () __attribute__ ((__const__)); extern float __fminf (float __x, float __y) throw () __attribute__ ((__const__));
+
+
+extern float fmaf (float __x, float __y, float __z) throw (); extern float __fmaf (float __x, float __y, float __z) throw ();
+
+
+
+
+extern float roundevenf (float __x) throw () __attribute__ ((__const__)); extern float __roundevenf (float __x) throw () __attribute__ ((__const__));
+
+
+
+extern __intmax_t fromfpf (float __x, int __round, unsigned int __width) throw (); extern __intmax_t __fromfpf (float __x, int __round, unsigned int __width) throw ()
+                            ;
+
+
+
+extern __uintmax_t ufromfpf (float __x, int __round, unsigned int __width) throw (); extern __uintmax_t __ufromfpf (float __x, int __round, unsigned int __width) throw ()
+                              ;
+
+
+
+
+extern __intmax_t fromfpxf (float __x, int __round, unsigned int __width) throw (); extern __intmax_t __fromfpxf (float __x, int __round, unsigned int __width) throw ()
+                             ;
+
+
+
+
+extern __uintmax_t ufromfpxf (float __x, int __round, unsigned int __width) throw (); extern __uintmax_t __ufromfpxf (float __x, int __round, unsigned int __width) throw ()
+                               ;
+
+
+extern float fmaxmagf (float __x, float __y) throw () __attribute__ ((__const__)); extern float __fmaxmagf (float __x, float __y) throw () __attribute__ ((__const__));
+
+
+extern float fminmagf (float __x, float __y) throw () __attribute__ ((__const__)); extern float __fminmagf (float __x, float __y) throw () __attribute__ ((__const__));
+
+
+extern int totalorderf (float __x, float __y) throw ()
+     __attribute__ ((__const__));
+
+
+extern int totalordermagf (float __x, float __y) throw ()
+     __attribute__ ((__const__));
+
+
+extern int canonicalizef (float *__cx, const float *__x) throw ();
+
+
+extern float getpayloadf (const float *__x) throw (); extern float __getpayloadf (const float *__x) throw ();
+
+
+extern int setpayloadf (float *__x, float __payload) throw ();
+
+
+extern int setpayloadsigf (float *__x, float __payload) throw ();
+
+
+
+
+
+
+
+extern float scalbf (float __x, float __n) throw (); extern float __scalbf (float __x, float __n) throw ();
+extern int __fpclassifyl (long double __value) throw ()
+     __attribute__ ((__const__));
+
+
+extern int __signbitl (long double __value) throw ()
+     __attribute__ ((__const__));
+
+
+
+extern int __isinfl (long double __value) throw () __attribute__ ((__const__));
+
+
+extern int __finitel (long double __value) throw () __attribute__ ((__const__));
+
+
+extern int __isnanl (long double __value) throw () __attribute__ ((__const__));
+
+
+extern int __iseqsigl (long double __x, long double __y) throw ();
+
+
+extern int __issignalingl (long double __value) throw ()
+     __attribute__ ((__const__));
+extern long double acosl (long double __x) throw (); extern long double __acosl (long double __x) throw ();
+
+extern long double asinl (long double __x) throw (); extern long double __asinl (long double __x) throw ();
+
+extern long double atanl (long double __x) throw (); extern long double __atanl (long double __x) throw ();
+
+extern long double atan2l (long double __y, long double __x) throw (); extern long double __atan2l (long double __y, long double __x) throw ();
+
+
+ extern long double cosl (long double __x) throw (); extern long double __cosl (long double __x) throw ();
+
+ extern long double sinl (long double __x) throw (); extern long double __sinl (long double __x) throw ();
+
+extern long double tanl (long double __x) throw (); extern long double __tanl (long double __x) throw ();
+
+
+
+
+extern long double coshl (long double __x) throw (); extern long double __coshl (long double __x) throw ();
+
+extern long double sinhl (long double __x) throw (); extern long double __sinhl (long double __x) throw ();
+
+extern long double tanhl (long double __x) throw (); extern long double __tanhl (long double __x) throw ();
+
+
+
+ extern void sincosl (long double __x, long double *__sinx, long double *__cosx) throw (); extern void __sincosl (long double __x, long double *__sinx, long double *__cosx) throw ()
+                                                        ;
+
+
+
+
+extern long double acoshl (long double __x) throw (); extern long double __acoshl (long double __x) throw ();
+
+extern long double asinhl (long double __x) throw (); extern long double __asinhl (long double __x) throw ();
+
+extern long double atanhl (long double __x) throw (); extern long double __atanhl (long double __x) throw ();
+
+
+
+
+
+ extern long double expl (long double __x) throw (); extern long double __expl (long double __x) throw ();
+
+
+extern long double frexpl (long double __x, int *__exponent) throw (); extern long double __frexpl (long double __x, int *__exponent) throw ();
+
+
+extern long double ldexpl (long double __x, int __exponent) throw (); extern long double __ldexpl (long double __x, int __exponent) throw ();
+
+
+ extern long double logl (long double __x) throw (); extern long double __logl (long double __x) throw ();
+
+
+extern long double log10l (long double __x) throw (); extern long double __log10l (long double __x) throw ();
+
+
+extern long double modfl (long double __x, long double *__iptr) throw (); extern long double __modfl (long double __x, long double *__iptr) throw () __attribute__ ((__nonnull__ (2)));
+
+
+
+extern long double exp10l (long double __x) throw (); extern long double __exp10l (long double __x) throw ();
+
+
+
+
+extern long double pow10l (long double __x) throw (); extern long double __pow10l (long double __x) throw ();
+
+
+
+
+
+extern long double expm1l (long double __x) throw (); extern long double __expm1l (long double __x) throw ();
+
+
+extern long double log1pl (long double __x) throw (); extern long double __log1pl (long double __x) throw ();
+
+
+extern long double logbl (long double __x) throw (); extern long double __logbl (long double __x) throw ();
+
+
+
+
+extern long double exp2l (long double __x) throw (); extern long double __exp2l (long double __x) throw ();
+
+
+extern long double log2l (long double __x) throw (); extern long double __log2l (long double __x) throw ();
+
+
+
+
+
+
+ extern long double powl (long double __x, long double __y) throw (); extern long double __powl (long double __x, long double __y) throw ();
+
+
+extern long double sqrtl (long double __x) throw (); extern long double __sqrtl (long double __x) throw ();
+
+
+
+extern long double hypotl (long double __x, long double __y) throw (); extern long double __hypotl (long double __x, long double __y) throw ();
+
+
+
+
+extern long double cbrtl (long double __x) throw (); extern long double __cbrtl (long double __x) throw ();
+
+
+
+
+
+
+extern long double ceill (long double __x) throw () __attribute__ ((__const__)); extern long double __ceill (long double __x) throw () __attribute__ ((__const__));
+
+
+extern long double fabsl (long double __x) throw () __attribute__ ((__const__)); extern long double __fabsl (long double __x) throw () __attribute__ ((__const__));
+
+
+extern long double floorl (long double __x) throw () __attribute__ ((__const__)); extern long double __floorl (long double __x) throw () __attribute__ ((__const__));
+
+
+extern long double fmodl (long double __x, long double __y) throw (); extern long double __fmodl (long double __x, long double __y) throw ();
+extern int isinfl (long double __value) throw () __attribute__ ((__const__));
+
+
+
+
+extern int finitel (long double __value) throw () __attribute__ ((__const__));
+
+
+extern long double dreml (long double __x, long double __y) throw (); extern long double __dreml (long double __x, long double __y) throw ();
+
+
+
+extern long double significandl (long double __x) throw (); extern long double __significandl (long double __x) throw ();
+
+
+
+
+
+
+extern long double copysignl (long double __x, long double __y) throw () __attribute__ ((__const__)); extern long double __copysignl (long double __x, long double __y) throw () __attribute__ ((__const__));
+
+
+
+
+extern long double nanl (const char *__tagb) throw () __attribute__ ((__const__)); extern long double __nanl (const char *__tagb) throw () __attribute__ ((__const__));
+extern int isnanl (long double __value) throw () __attribute__ ((__const__));
+
+
+
+
+
+extern long double j0l (long double) throw (); extern long double __j0l (long double) throw ();
+extern long double j1l (long double) throw (); extern long double __j1l (long double) throw ();
+extern long double jnl (int, long double) throw (); extern long double __jnl (int, long double) throw ();
+extern long double y0l (long double) throw (); extern long double __y0l (long double) throw ();
+extern long double y1l (long double) throw (); extern long double __y1l (long double) throw ();
+extern long double ynl (int, long double) throw (); extern long double __ynl (int, long double) throw ();
+
+
+
+
+
+extern long double erfl (long double) throw (); extern long double __erfl (long double) throw ();
+extern long double erfcl (long double) throw (); extern long double __erfcl (long double) throw ();
+extern long double lgammal (long double) throw (); extern long double __lgammal (long double) throw ();
+
+
+
+
+extern long double tgammal (long double) throw (); extern long double __tgammal (long double) throw ();
+
+
+
+
+
+extern long double gammal (long double) throw (); extern long double __gammal (long double) throw ();
+
+
+
+
+
+
+
+extern long double lgammal_r (long double, int *__signgamp) throw (); extern long double __lgammal_r (long double, int *__signgamp) throw ();
+
+
+
+
+
+
+extern long double rintl (long double __x) throw (); extern long double __rintl (long double __x) throw ();
+
+
+extern long double nextafterl (long double __x, long double __y) throw () __attribute__ ((__const__)); extern long double __nextafterl (long double __x, long double __y) throw () __attribute__ ((__const__));
+
+extern long double nexttowardl (long double __x, long double __y) throw () __attribute__ ((__const__)); extern long double __nexttowardl (long double __x, long double __y) throw () __attribute__ ((__const__));
+
+
+
+
+extern long double nextdownl (long double __x) throw (); extern long double __nextdownl (long double __x) throw ();
+
+extern long double nextupl (long double __x) throw (); extern long double __nextupl (long double __x) throw ();
+
+
+
+extern long double remainderl (long double __x, long double __y) throw (); extern long double __remainderl (long double __x, long double __y) throw ();
+
+
+
+extern long double scalbnl (long double __x, int __n) throw (); extern long double __scalbnl (long double __x, int __n) throw ();
+
+
+
+extern int ilogbl (long double __x) throw (); extern int __ilogbl (long double __x) throw ();
+
+
+
+
+extern long int llogbl (long double __x) throw (); extern long int __llogbl (long double __x) throw ();
+
+
+
+
+extern long double scalblnl (long double __x, long int __n) throw (); extern long double __scalblnl (long double __x, long int __n) throw ();
+
+
+
+extern long double nearbyintl (long double __x) throw (); extern long double __nearbyintl (long double __x) throw ();
+
+
+
+extern long double roundl (long double __x) throw () __attribute__ ((__const__)); extern long double __roundl (long double __x) throw () __attribute__ ((__const__));
+
+
+
+extern long double truncl (long double __x) throw () __attribute__ ((__const__)); extern long double __truncl (long double __x) throw () __attribute__ ((__const__));
+
+
+
+
+extern long double remquol (long double __x, long double __y, int *__quo) throw (); extern long double __remquol (long double __x, long double __y, int *__quo) throw ();
+
+
+
+
+
+
+extern long int lrintl (long double __x) throw (); extern long int __lrintl (long double __x) throw ();
+__extension__
+extern long long int llrintl (long double __x) throw (); extern long long int __llrintl (long double __x) throw ();
+
+
+
+extern long int lroundl (long double __x) throw (); extern long int __lroundl (long double __x) throw ();
+__extension__
+extern long long int llroundl (long double __x) throw (); extern long long int __llroundl (long double __x) throw ();
+
+
+
+extern long double fdiml (long double __x, long double __y) throw (); extern long double __fdiml (long double __x, long double __y) throw ();
+
+
+extern long double fmaxl (long double __x, long double __y) throw () __attribute__ ((__const__)); extern long double __fmaxl (long double __x, long double __y) throw () __attribute__ ((__const__));
+
+
+extern long double fminl (long double __x, long double __y) throw () __attribute__ ((__const__)); extern long double __fminl (long double __x, long double __y) throw () __attribute__ ((__const__));
+
+
+extern long double fmal (long double __x, long double __y, long double __z) throw (); extern long double __fmal (long double __x, long double __y, long double __z) throw ();
+
+
+
+
+extern long double roundevenl (long double __x) throw () __attribute__ ((__const__)); extern long double __roundevenl (long double __x) throw () __attribute__ ((__const__));
+
+
+
+extern __intmax_t fromfpl (long double __x, int __round, unsigned int __width) throw (); extern __intmax_t __fromfpl (long double __x, int __round, unsigned int __width) throw ()
+                            ;
+
+
+
+extern __uintmax_t ufromfpl (long double __x, int __round, unsigned int __width) throw (); extern __uintmax_t __ufromfpl (long double __x, int __round, unsigned int __width) throw ()
+                              ;
+
+
+
+
+extern __intmax_t fromfpxl (long double __x, int __round, unsigned int __width) throw (); extern __intmax_t __fromfpxl (long double __x, int __round, unsigned int __width) throw ()
+                             ;
+
+
+
+
+extern __uintmax_t ufromfpxl (long double __x, int __round, unsigned int __width) throw (); extern __uintmax_t __ufromfpxl (long double __x, int __round, unsigned int __width) throw ()
+                               ;
+
+
+extern long double fmaxmagl (long double __x, long double __y) throw () __attribute__ ((__const__)); extern long double __fmaxmagl (long double __x, long double __y) throw () __attribute__ ((__const__));
+
+
+extern long double fminmagl (long double __x, long double __y) throw () __attribute__ ((__const__)); extern long double __fminmagl (long double __x, long double __y) throw () __attribute__ ((__const__));
+
+
+extern int totalorderl (long double __x, long double __y) throw ()
+     __attribute__ ((__const__));
+
+
+extern int totalordermagl (long double __x, long double __y) throw ()
+     __attribute__ ((__const__));
+
+
+extern int canonicalizel (long double *__cx, const long double *__x) throw ();
+
+
+extern long double getpayloadl (const long double *__x) throw (); extern long double __getpayloadl (const long double *__x) throw ();
+
+
+extern int setpayloadl (long double *__x, long double __payload) throw ();
+
+
+extern int setpayloadsigl (long double *__x, long double __payload) throw ();
+
+
+
+
+
+
+
+extern long double scalbl (long double __x, long double __n) throw (); extern long double __scalbl (long double __x, long double __n) throw ();
+extern int __fpclassifyf128 (_Float128 __value) throw ()
+     __attribute__ ((__const__));
+
+
+extern int __signbitf128 (_Float128 __value) throw ()
+     __attribute__ ((__const__));
+
+
+
+extern int __isinff128 (_Float128 __value) throw () __attribute__ ((__const__));
+
+
+extern int __finitef128 (_Float128 __value) throw () __attribute__ ((__const__));
+
+
+extern int __isnanf128 (_Float128 __value) throw () __attribute__ ((__const__));
+
+
+extern int __iseqsigf128 (_Float128 __x, _Float128 __y) throw ();
+
+
+extern int __issignalingf128 (_Float128 __value) throw ()
+     __attribute__ ((__const__));
+
+
+extern _Float128 acosf128 (_Float128 __x) throw (); extern _Float128 __acosf128 (_Float128 __x) throw ();
+
+extern _Float128 asinf128 (_Float128 __x) throw (); extern _Float128 __asinf128 (_Float128 __x) throw ();
+
+extern _Float128 atanf128 (_Float128 __x) throw (); extern _Float128 __atanf128 (_Float128 __x) throw ();
+
+extern _Float128 atan2f128 (_Float128 __y, _Float128 __x) throw (); extern _Float128 __atan2f128 (_Float128 __y, _Float128 __x) throw ();
+
+
+ extern _Float128 cosf128 (_Float128 __x) throw (); extern _Float128 __cosf128 (_Float128 __x) throw ();
+
+ extern _Float128 sinf128 (_Float128 __x) throw (); extern _Float128 __sinf128 (_Float128 __x) throw ();
+
+extern _Float128 tanf128 (_Float128 __x) throw (); extern _Float128 __tanf128 (_Float128 __x) throw ();
+
+
+
+
+extern _Float128 coshf128 (_Float128 __x) throw (); extern _Float128 __coshf128 (_Float128 __x) throw ();
+
+extern _Float128 sinhf128 (_Float128 __x) throw (); extern _Float128 __sinhf128 (_Float128 __x) throw ();
+
+extern _Float128 tanhf128 (_Float128 __x) throw (); extern _Float128 __tanhf128 (_Float128 __x) throw ();
+
+
+
+ extern void sincosf128 (_Float128 __x, _Float128 *__sinx, _Float128 *__cosx) throw (); extern void __sincosf128 (_Float128 __x, _Float128 *__sinx, _Float128 *__cosx) throw ()
+                                                        ;
+
+
+
+
+extern _Float128 acoshf128 (_Float128 __x) throw (); extern _Float128 __acoshf128 (_Float128 __x) throw ();
+
+extern _Float128 asinhf128 (_Float128 __x) throw (); extern _Float128 __asinhf128 (_Float128 __x) throw ();
+
+extern _Float128 atanhf128 (_Float128 __x) throw (); extern _Float128 __atanhf128 (_Float128 __x) throw ();
+
+
+
+
+
+ extern _Float128 expf128 (_Float128 __x) throw (); extern _Float128 __expf128 (_Float128 __x) throw ();
+
+
+extern _Float128 frexpf128 (_Float128 __x, int *__exponent) throw (); extern _Float128 __frexpf128 (_Float128 __x, int *__exponent) throw ();
+
+
+extern _Float128 ldexpf128 (_Float128 __x, int __exponent) throw (); extern _Float128 __ldexpf128 (_Float128 __x, int __exponent) throw ();
+
+
+ extern _Float128 logf128 (_Float128 __x) throw (); extern _Float128 __logf128 (_Float128 __x) throw ();
+
+
+extern _Float128 log10f128 (_Float128 __x) throw (); extern _Float128 __log10f128 (_Float128 __x) throw ();
+
+
+extern _Float128 modff128 (_Float128 __x, _Float128 *__iptr) throw (); extern _Float128 __modff128 (_Float128 __x, _Float128 *__iptr) throw () __attribute__ ((__nonnull__ (2)));
+
+
+
+extern _Float128 exp10f128 (_Float128 __x) throw (); extern _Float128 __exp10f128 (_Float128 __x) throw ();
+extern _Float128 expm1f128 (_Float128 __x) throw (); extern _Float128 __expm1f128 (_Float128 __x) throw ();
+
+
+extern _Float128 log1pf128 (_Float128 __x) throw (); extern _Float128 __log1pf128 (_Float128 __x) throw ();
+
+
+extern _Float128 logbf128 (_Float128 __x) throw (); extern _Float128 __logbf128 (_Float128 __x) throw ();
+
+
+
+
+extern _Float128 exp2f128 (_Float128 __x) throw (); extern _Float128 __exp2f128 (_Float128 __x) throw ();
+
+
+extern _Float128 log2f128 (_Float128 __x) throw (); extern _Float128 __log2f128 (_Float128 __x) throw ();
+
+
+
+
+
+
+ extern _Float128 powf128 (_Float128 __x, _Float128 __y) throw (); extern _Float128 __powf128 (_Float128 __x, _Float128 __y) throw ();
+
+
+extern _Float128 sqrtf128 (_Float128 __x) throw (); extern _Float128 __sqrtf128 (_Float128 __x) throw ();
+
+
+
+extern _Float128 hypotf128 (_Float128 __x, _Float128 __y) throw (); extern _Float128 __hypotf128 (_Float128 __x, _Float128 __y) throw ();
+
+
+
+
+extern _Float128 cbrtf128 (_Float128 __x) throw (); extern _Float128 __cbrtf128 (_Float128 __x) throw ();
+
+
+
+
+
+
+extern _Float128 ceilf128 (_Float128 __x) throw () __attribute__ ((__const__)); extern _Float128 __ceilf128 (_Float128 __x) throw () __attribute__ ((__const__));
+
+
+extern _Float128 fabsf128 (_Float128 __x) throw () __attribute__ ((__const__)); extern _Float128 __fabsf128 (_Float128 __x) throw () __attribute__ ((__const__));
+
+
+extern _Float128 floorf128 (_Float128 __x) throw () __attribute__ ((__const__)); extern _Float128 __floorf128 (_Float128 __x) throw () __attribute__ ((__const__));
+
+
+extern _Float128 fmodf128 (_Float128 __x, _Float128 __y) throw (); extern _Float128 __fmodf128 (_Float128 __x, _Float128 __y) throw ();
+extern _Float128 copysignf128 (_Float128 __x, _Float128 __y) throw () __attribute__ ((__const__)); extern _Float128 __copysignf128 (_Float128 __x, _Float128 __y) throw () __attribute__ ((__const__));
+
+
+
+
+extern _Float128 nanf128 (const char *__tagb) throw () __attribute__ ((__const__)); extern _Float128 __nanf128 (const char *__tagb) throw () __attribute__ ((__const__));
+extern _Float128 j0f128 (_Float128) throw (); extern _Float128 __j0f128 (_Float128) throw ();
+extern _Float128 j1f128 (_Float128) throw (); extern _Float128 __j1f128 (_Float128) throw ();
+extern _Float128 jnf128 (int, _Float128) throw (); extern _Float128 __jnf128 (int, _Float128) throw ();
+extern _Float128 y0f128 (_Float128) throw (); extern _Float128 __y0f128 (_Float128) throw ();
+extern _Float128 y1f128 (_Float128) throw (); extern _Float128 __y1f128 (_Float128) throw ();
+extern _Float128 ynf128 (int, _Float128) throw (); extern _Float128 __ynf128 (int, _Float128) throw ();
+
+
+
+
+
+extern _Float128 erff128 (_Float128) throw (); extern _Float128 __erff128 (_Float128) throw ();
+extern _Float128 erfcf128 (_Float128) throw (); extern _Float128 __erfcf128 (_Float128) throw ();
+extern _Float128 lgammaf128 (_Float128) throw (); extern _Float128 __lgammaf128 (_Float128) throw ();
+
+
+
+
+extern _Float128 tgammaf128 (_Float128) throw (); extern _Float128 __tgammaf128 (_Float128) throw ();
+extern _Float128 lgammaf128_r (_Float128, int *__signgamp) throw (); extern _Float128 __lgammaf128_r (_Float128, int *__signgamp) throw ();
+
+
+
+
+
+
+extern _Float128 rintf128 (_Float128 __x) throw (); extern _Float128 __rintf128 (_Float128 __x) throw ();
+
+
+extern _Float128 nextafterf128 (_Float128 __x, _Float128 __y) throw () __attribute__ ((__const__)); extern _Float128 __nextafterf128 (_Float128 __x, _Float128 __y) throw () __attribute__ ((__const__));
+
+
+
+
+
+
+extern _Float128 nextdownf128 (_Float128 __x) throw (); extern _Float128 __nextdownf128 (_Float128 __x) throw ();
+
+extern _Float128 nextupf128 (_Float128 __x) throw (); extern _Float128 __nextupf128 (_Float128 __x) throw ();
+
+
+
+extern _Float128 remainderf128 (_Float128 __x, _Float128 __y) throw (); extern _Float128 __remainderf128 (_Float128 __x, _Float128 __y) throw ();
+
+
+
+extern _Float128 scalbnf128 (_Float128 __x, int __n) throw (); extern _Float128 __scalbnf128 (_Float128 __x, int __n) throw ();
+
+
+
+extern int ilogbf128 (_Float128 __x) throw (); extern int __ilogbf128 (_Float128 __x) throw ();
+
+
+
+
+extern long int llogbf128 (_Float128 __x) throw (); extern long int __llogbf128 (_Float128 __x) throw ();
+
+
+
+
+extern _Float128 scalblnf128 (_Float128 __x, long int __n) throw (); extern _Float128 __scalblnf128 (_Float128 __x, long int __n) throw ();
+
+
+
+extern _Float128 nearbyintf128 (_Float128 __x) throw (); extern _Float128 __nearbyintf128 (_Float128 __x) throw ();
+
+
+
+extern _Float128 roundf128 (_Float128 __x) throw () __attribute__ ((__const__)); extern _Float128 __roundf128 (_Float128 __x) throw () __attribute__ ((__const__));
+
+
+
+extern _Float128 truncf128 (_Float128 __x) throw () __attribute__ ((__const__)); extern _Float128 __truncf128 (_Float128 __x) throw () __attribute__ ((__const__));
+
+
+
+
+extern _Float128 remquof128 (_Float128 __x, _Float128 __y, int *__quo) throw (); extern _Float128 __remquof128 (_Float128 __x, _Float128 __y, int *__quo) throw ();
+
+
+
+
+
+
+extern long int lrintf128 (_Float128 __x) throw (); extern long int __lrintf128 (_Float128 __x) throw ();
+__extension__
+extern long long int llrintf128 (_Float128 __x) throw (); extern long long int __llrintf128 (_Float128 __x) throw ();
+
+
+
+extern long int lroundf128 (_Float128 __x) throw (); extern long int __lroundf128 (_Float128 __x) throw ();
+__extension__
+extern long long int llroundf128 (_Float128 __x) throw (); extern long long int __llroundf128 (_Float128 __x) throw ();
+
+
+
+extern _Float128 fdimf128 (_Float128 __x, _Float128 __y) throw (); extern _Float128 __fdimf128 (_Float128 __x, _Float128 __y) throw ();
+
+
+extern _Float128 fmaxf128 (_Float128 __x, _Float128 __y) throw () __attribute__ ((__const__)); extern _Float128 __fmaxf128 (_Float128 __x, _Float128 __y) throw () __attribute__ ((__const__));
+
+
+extern _Float128 fminf128 (_Float128 __x, _Float128 __y) throw () __attribute__ ((__const__)); extern _Float128 __fminf128 (_Float128 __x, _Float128 __y) throw () __attribute__ ((__const__));
+
+
+extern _Float128 fmaf128 (_Float128 __x, _Float128 __y, _Float128 __z) throw (); extern _Float128 __fmaf128 (_Float128 __x, _Float128 __y, _Float128 __z) throw ();
+
+
+
+
+extern _Float128 roundevenf128 (_Float128 __x) throw () __attribute__ ((__const__)); extern _Float128 __roundevenf128 (_Float128 __x) throw () __attribute__ ((__const__));
+
+
+
+extern __intmax_t fromfpf128 (_Float128 __x, int __round, unsigned int __width) throw (); extern __intmax_t __fromfpf128 (_Float128 __x, int __round, unsigned int __width) throw ()
+                            ;
+
+
+
+extern __uintmax_t ufromfpf128 (_Float128 __x, int __round, unsigned int __width) throw (); extern __uintmax_t __ufromfpf128 (_Float128 __x, int __round, unsigned int __width) throw ()
+                              ;
+
+
+
+
+extern __intmax_t fromfpxf128 (_Float128 __x, int __round, unsigned int __width) throw (); extern __intmax_t __fromfpxf128 (_Float128 __x, int __round, unsigned int __width) throw ()
+                             ;
+
+
+
+
+extern __uintmax_t ufromfpxf128 (_Float128 __x, int __round, unsigned int __width) throw (); extern __uintmax_t __ufromfpxf128 (_Float128 __x, int __round, unsigned int __width) throw ()
+                               ;
+
+
+extern _Float128 fmaxmagf128 (_Float128 __x, _Float128 __y) throw () __attribute__ ((__const__)); extern _Float128 __fmaxmagf128 (_Float128 __x, _Float128 __y) throw () __attribute__ ((__const__));
+
+
+extern _Float128 fminmagf128 (_Float128 __x, _Float128 __y) throw () __attribute__ ((__const__)); extern _Float128 __fminmagf128 (_Float128 __x, _Float128 __y) throw () __attribute__ ((__const__));
+
+
+extern int totalorderf128 (_Float128 __x, _Float128 __y) throw ()
+     __attribute__ ((__const__));
+
+
+extern int totalordermagf128 (_Float128 __x, _Float128 __y) throw ()
+     __attribute__ ((__const__));
+
+
+extern int canonicalizef128 (_Float128 *__cx, const _Float128 *__x) throw ();
+
+
+extern _Float128 getpayloadf128 (const _Float128 *__x) throw (); extern _Float128 __getpayloadf128 (const _Float128 *__x) throw ();
+
+
+extern int setpayloadf128 (_Float128 *__x, _Float128 __payload) throw ();
+
+
+extern int setpayloadsigf128 (_Float128 *__x, _Float128 __payload) throw ();
+extern int signgam;
+enum
+  {
+    FP_NAN =
+
+      0,
+    FP_INFINITE =
+
+      1,
+    FP_ZERO =
+
+      2,
+    FP_SUBNORMAL =
+
+      3,
+    FP_NORMAL =
+
+      4
+  };
+extern int __iscanonicall (long double __x)
+     throw () __attribute__ ((__const__));
+extern "C++" {
+inline int iscanonical (float __val) { return ((void) (__typeof (__val)) (__val), 1); }
+inline int iscanonical (double __val) { return ((void) (__typeof (__val)) (__val), 1); }
+inline int iscanonical (long double __val) { return __iscanonicall (__val); }
+
+inline int iscanonical (_Float128 __val) { return ((void) (__typeof (__val)) (__val), 1); }
+
+}
+extern "C++" {
+inline int issignaling (float __val) { return __issignalingf (__val); }
+inline int issignaling (double __val) { return __issignaling (__val); }
+inline int
+issignaling (long double __val)
+{
+
+
+
+  return __issignalingl (__val);
+
+}
+
+inline int issignaling (_Float128 __val) { return __issignalingf128 (__val); }
+
+}
+extern "C++" {
+template <class __T> inline bool
+iszero (__T __val)
+{
+  return __val == 0;
+}
+
+}
+
+
+
+
+
+typedef enum
+{
+  _IEEE_ = -1,
+  _SVID_,
+  _XOPEN_,
+  _POSIX_,
+  _ISOC_
+} _LIB_VERSION_TYPE;
+
+
+
+
+extern _LIB_VERSION_TYPE _LIB_VERSION;
+struct __exception
+
+
+
+  {
+    int type;
+    char *name;
+    double arg1;
+    double arg2;
+    double retval;
+  };
+
+
+extern int matherr (struct __exception *__exc) throw ();
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) int
+__attribute__ ((__leaf__)) __signbitf (float __x) throw ()
+{
+
+  int __m;
+  __asm ("pmovmskb %1, %0" : "=r" (__m) : "x" (__x));
+  return (__m & 0x8) != 0;
+
+
+
+
+}
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) int
+__attribute__ ((__leaf__)) __signbit (double __x) throw ()
+{
+
+  int __m;
+  __asm ("pmovmskb %1, %0" : "=r" (__m) : "x" (__x));
+  return (__m & 0x80) != 0;
+
+
+
+
+}
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) int
+__attribute__ ((__leaf__)) __signbitl (long double __x) throw ()
+{
+  __extension__ union { long double __l; int __i[3]; } __u = { __l: __x };
+  return (__u.__i[2] & 0x8000) != 0;
+}
+}
+extern "C++"
+{
+namespace std __attribute__ ((__visibility__ ("default")))
+{
+
+
+  using ::acos;
+
+
+  inline constexpr float
+  acos(float __x)
+  { return __builtin_acosf(__x); }
+
+  inline constexpr long double
+  acos(long double __x)
+  { return __builtin_acosl(__x); }
+
+
+  template<typename _Tp>
+    inline constexpr
+    typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                    double>::__type
+    acos(_Tp __x)
+    { return __builtin_acos(__x); }
+
+  using ::asin;
+
+
+  inline constexpr float
+  asin(float __x)
+  { return __builtin_asinf(__x); }
+
+  inline constexpr long double
+  asin(long double __x)
+  { return __builtin_asinl(__x); }
+
+
+  template<typename _Tp>
+    inline constexpr
+    typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                    double>::__type
+    asin(_Tp __x)
+    { return __builtin_asin(__x); }
+
+  using ::atan;
+
+
+  inline constexpr float
+  atan(float __x)
+  { return __builtin_atanf(__x); }
+
+  inline constexpr long double
+  atan(long double __x)
+  { return __builtin_atanl(__x); }
+
+
+  template<typename _Tp>
+    inline constexpr
+    typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                    double>::__type
+    atan(_Tp __x)
+    { return __builtin_atan(__x); }
+
+  using ::atan2;
+
+
+  inline constexpr float
+  atan2(float __y, float __x)
+  { return __builtin_atan2f(__y, __x); }
+
+  inline constexpr long double
+  atan2(long double __y, long double __x)
+  { return __builtin_atan2l(__y, __x); }
+
+
+  template<typename _Tp, typename _Up>
+    inline constexpr
+    typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
+    atan2(_Tp __y, _Up __x)
+    {
+      typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+      return atan2(__type(__y), __type(__x));
+    }
+
+  using ::ceil;
+
+
+  inline constexpr float
+  ceil(float __x)
+  { return __builtin_ceilf(__x); }
+
+  inline constexpr long double
+  ceil(long double __x)
+  { return __builtin_ceill(__x); }
+
+
+  template<typename _Tp>
+    inline constexpr
+    typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                    double>::__type
+    ceil(_Tp __x)
+    { return __builtin_ceil(__x); }
+
+  using ::cos;
+
+
+  inline constexpr float
+  cos(float __x)
+  { return __builtin_cosf(__x); }
+
+  inline constexpr long double
+  cos(long double __x)
+  { return __builtin_cosl(__x); }
+
+
+  template<typename _Tp>
+    inline constexpr
+    typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                    double>::__type
+    cos(_Tp __x)
+    { return __builtin_cos(__x); }
+
+  using ::cosh;
+
+
+  inline constexpr float
+  cosh(float __x)
+  { return __builtin_coshf(__x); }
+
+  inline constexpr long double
+  cosh(long double __x)
+  { return __builtin_coshl(__x); }
+
+
+  template<typename _Tp>
+    inline constexpr
+    typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                    double>::__type
+    cosh(_Tp __x)
+    { return __builtin_cosh(__x); }
+
+  using ::exp;
+
+
+  inline constexpr float
+  exp(float __x)
+  { return __builtin_expf(__x); }
+
+  inline constexpr long double
+  exp(long double __x)
+  { return __builtin_expl(__x); }
+
+
+  template<typename _Tp>
+    inline constexpr
+    typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                    double>::__type
+    exp(_Tp __x)
+    { return __builtin_exp(__x); }
+
+  using ::fabs;
+
+
+  inline constexpr float
+  fabs(float __x)
+  { return __builtin_fabsf(__x); }
+
+  inline constexpr long double
+  fabs(long double __x)
+  { return __builtin_fabsl(__x); }
+
+
+  template<typename _Tp>
+    inline constexpr
+    typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                    double>::__type
+    fabs(_Tp __x)
+    { return __builtin_fabs(__x); }
+
+  using ::floor;
+
+
+  inline constexpr float
+  floor(float __x)
+  { return __builtin_floorf(__x); }
+
+  inline constexpr long double
+  floor(long double __x)
+  { return __builtin_floorl(__x); }
+
+
+  template<typename _Tp>
+    inline constexpr
+    typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                    double>::__type
+    floor(_Tp __x)
+    { return __builtin_floor(__x); }
+
+  using ::fmod;
+
+
+  inline constexpr float
+  fmod(float __x, float __y)
+  { return __builtin_fmodf(__x, __y); }
+
+  inline constexpr long double
+  fmod(long double __x, long double __y)
+  { return __builtin_fmodl(__x, __y); }
+
+
+  template<typename _Tp, typename _Up>
+    inline constexpr
+    typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
+    fmod(_Tp __x, _Up __y)
+    {
+      typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+      return fmod(__type(__x), __type(__y));
+    }
+
+  using ::frexp;
+
+
+  inline float
+  frexp(float __x, int* __exp)
+  { return __builtin_frexpf(__x, __exp); }
+
+  inline long double
+  frexp(long double __x, int* __exp)
+  { return __builtin_frexpl(__x, __exp); }
+
+
+  template<typename _Tp>
+    inline constexpr
+    typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                    double>::__type
+    frexp(_Tp __x, int* __exp)
+    { return __builtin_frexp(__x, __exp); }
+
+  using ::ldexp;
+
+
+  inline constexpr float
+  ldexp(float __x, int __exp)
+  { return __builtin_ldexpf(__x, __exp); }
+
+  inline constexpr long double
+  ldexp(long double __x, int __exp)
+  { return __builtin_ldexpl(__x, __exp); }
+
+
+  template<typename _Tp>
+    inline constexpr
+    typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                    double>::__type
+    ldexp(_Tp __x, int __exp)
+    { return __builtin_ldexp(__x, __exp); }
+
+  using ::log;
+
+
+  inline constexpr float
+  log(float __x)
+  { return __builtin_logf(__x); }
+
+  inline constexpr long double
+  log(long double __x)
+  { return __builtin_logl(__x); }
+
+
+  template<typename _Tp>
+    inline constexpr
+    typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                    double>::__type
+    log(_Tp __x)
+    { return __builtin_log(__x); }
+
+  using ::log10;
+
+
+  inline constexpr float
+  log10(float __x)
+  { return __builtin_log10f(__x); }
+
+  inline constexpr long double
+  log10(long double __x)
+  { return __builtin_log10l(__x); }
+
+
+  template<typename _Tp>
+    inline constexpr
+    typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                    double>::__type
+    log10(_Tp __x)
+    { return __builtin_log10(__x); }
+
+  using ::modf;
+
+
+  inline float
+  modf(float __x, float* __iptr)
+  { return __builtin_modff(__x, __iptr); }
+
+  inline long double
+  modf(long double __x, long double* __iptr)
+  { return __builtin_modfl(__x, __iptr); }
+
+
+  using ::pow;
+
+
+  inline constexpr float
+  pow(float __x, float __y)
+  { return __builtin_powf(__x, __y); }
+
+  inline constexpr long double
+  pow(long double __x, long double __y)
+  { return __builtin_powl(__x, __y); }
+  template<typename _Tp, typename _Up>
+    inline constexpr
+    typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
+    pow(_Tp __x, _Up __y)
+    {
+      typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+      return pow(__type(__x), __type(__y));
+    }
+
+  using ::sin;
+
+
+  inline constexpr float
+  sin(float __x)
+  { return __builtin_sinf(__x); }
+
+  inline constexpr long double
+  sin(long double __x)
+  { return __builtin_sinl(__x); }
+
+
+  template<typename _Tp>
+    inline constexpr
+    typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                    double>::__type
+    sin(_Tp __x)
+    { return __builtin_sin(__x); }
+
+  using ::sinh;
+
+
+  inline constexpr float
+  sinh(float __x)
+  { return __builtin_sinhf(__x); }
+
+  inline constexpr long double
+  sinh(long double __x)
+  { return __builtin_sinhl(__x); }
+
+
+  template<typename _Tp>
+    inline constexpr
+    typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                    double>::__type
+    sinh(_Tp __x)
+    { return __builtin_sinh(__x); }
+
+  using ::sqrt;
+
+
+  inline constexpr float
+  sqrt(float __x)
+  { return __builtin_sqrtf(__x); }
+
+  inline constexpr long double
+  sqrt(long double __x)
+  { return __builtin_sqrtl(__x); }
+
+
+  template<typename _Tp>
+    inline constexpr
+    typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                    double>::__type
+    sqrt(_Tp __x)
+    { return __builtin_sqrt(__x); }
+
+  using ::tan;
+
+
+  inline constexpr float
+  tan(float __x)
+  { return __builtin_tanf(__x); }
+
+  inline constexpr long double
+  tan(long double __x)
+  { return __builtin_tanl(__x); }
+
+
+  template<typename _Tp>
+    inline constexpr
+    typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                    double>::__type
+    tan(_Tp __x)
+    { return __builtin_tan(__x); }
+
+  using ::tanh;
+
+
+  inline constexpr float
+  tanh(float __x)
+  { return __builtin_tanhf(__x); }
+
+  inline constexpr long double
+  tanh(long double __x)
+  { return __builtin_tanhl(__x); }
+
+
+  template<typename _Tp>
+    inline constexpr
+    typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                    double>::__type
+    tanh(_Tp __x)
+    { return __builtin_tanh(__x); }
+  constexpr int
+  fpclassify(float __x)
+  { return __builtin_fpclassify(0, 1, 4,
+    3, 2, __x); }
+
+  constexpr int
+  fpclassify(double __x)
+  { return __builtin_fpclassify(0, 1, 4,
+    3, 2, __x); }
+
+  constexpr int
+  fpclassify(long double __x)
+  { return __builtin_fpclassify(0, 1, 4,
+    3, 2, __x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              int>::__type
+    fpclassify(_Tp __x)
+    { return __x != 0 ? 4 : 2; }
+
+
+
+  constexpr bool
+  isfinite(float __x)
+  { return __builtin_isfinite(__x); }
+
+  constexpr bool
+  isfinite(double __x)
+  { return __builtin_isfinite(__x); }
+
+  constexpr bool
+  isfinite(long double __x)
+  { return __builtin_isfinite(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              bool>::__type
+    isfinite(_Tp __x)
+    { return true; }
+
+
+
+  constexpr bool
+  isinf(float __x)
+  { return __builtin_isinf(__x); }
+
+
+
+
+
+  constexpr bool
+  isinf(double __x)
+  { return __builtin_isinf(__x); }
+
+
+  constexpr bool
+  isinf(long double __x)
+  { return __builtin_isinf(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              bool>::__type
+    isinf(_Tp __x)
+    { return false; }
+
+
+
+  constexpr bool
+  isnan(float __x)
+  { return __builtin_isnan(__x); }
+
+
+
+
+
+  constexpr bool
+  isnan(double __x)
+  { return __builtin_isnan(__x); }
+
+
+  constexpr bool
+  isnan(long double __x)
+  { return __builtin_isnan(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              bool>::__type
+    isnan(_Tp __x)
+    { return false; }
+
+
+
+  constexpr bool
+  isnormal(float __x)
+  { return __builtin_isnormal(__x); }
+
+  constexpr bool
+  isnormal(double __x)
+  { return __builtin_isnormal(__x); }
+
+  constexpr bool
+  isnormal(long double __x)
+  { return __builtin_isnormal(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              bool>::__type
+    isnormal(_Tp __x)
+    { return __x != 0 ? true : false; }
+
+
+
+
+  constexpr bool
+  signbit(float __x)
+  { return __builtin_signbit(__x); }
+
+  constexpr bool
+  signbit(double __x)
+  { return __builtin_signbit(__x); }
+
+  constexpr bool
+  signbit(long double __x)
+  { return __builtin_signbit(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              bool>::__type
+    signbit(_Tp __x)
+    { return __x < 0 ? true : false; }
+
+
+
+  constexpr bool
+  isgreater(float __x, float __y)
+  { return __builtin_isgreater(__x, __y); }
+
+  constexpr bool
+  isgreater(double __x, double __y)
+  { return __builtin_isgreater(__x, __y); }
+
+  constexpr bool
+  isgreater(long double __x, long double __y)
+  { return __builtin_isgreater(__x, __y); }
+
+
+
+  template<typename _Tp, typename _Up>
+    constexpr typename
+    __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value
+       && __is_arithmetic<_Up>::__value), bool>::__type
+    isgreater(_Tp __x, _Up __y)
+    {
+      typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+      return __builtin_isgreater(__type(__x), __type(__y));
+    }
+
+
+
+  constexpr bool
+  isgreaterequal(float __x, float __y)
+  { return __builtin_isgreaterequal(__x, __y); }
+
+  constexpr bool
+  isgreaterequal(double __x, double __y)
+  { return __builtin_isgreaterequal(__x, __y); }
+
+  constexpr bool
+  isgreaterequal(long double __x, long double __y)
+  { return __builtin_isgreaterequal(__x, __y); }
+
+
+
+  template<typename _Tp, typename _Up>
+    constexpr typename
+    __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value
+       && __is_arithmetic<_Up>::__value), bool>::__type
+    isgreaterequal(_Tp __x, _Up __y)
+    {
+      typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+      return __builtin_isgreaterequal(__type(__x), __type(__y));
+    }
+
+
+
+  constexpr bool
+  isless(float __x, float __y)
+  { return __builtin_isless(__x, __y); }
+
+  constexpr bool
+  isless(double __x, double __y)
+  { return __builtin_isless(__x, __y); }
+
+  constexpr bool
+  isless(long double __x, long double __y)
+  { return __builtin_isless(__x, __y); }
+
+
+
+  template<typename _Tp, typename _Up>
+    constexpr typename
+    __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value
+       && __is_arithmetic<_Up>::__value), bool>::__type
+    isless(_Tp __x, _Up __y)
+    {
+      typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+      return __builtin_isless(__type(__x), __type(__y));
+    }
+
+
+
+  constexpr bool
+  islessequal(float __x, float __y)
+  { return __builtin_islessequal(__x, __y); }
+
+  constexpr bool
+  islessequal(double __x, double __y)
+  { return __builtin_islessequal(__x, __y); }
+
+  constexpr bool
+  islessequal(long double __x, long double __y)
+  { return __builtin_islessequal(__x, __y); }
+
+
+
+  template<typename _Tp, typename _Up>
+    constexpr typename
+    __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value
+       && __is_arithmetic<_Up>::__value), bool>::__type
+    islessequal(_Tp __x, _Up __y)
+    {
+      typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+      return __builtin_islessequal(__type(__x), __type(__y));
+    }
+
+
+
+  constexpr bool
+  islessgreater(float __x, float __y)
+  { return __builtin_islessgreater(__x, __y); }
+
+  constexpr bool
+  islessgreater(double __x, double __y)
+  { return __builtin_islessgreater(__x, __y); }
+
+  constexpr bool
+  islessgreater(long double __x, long double __y)
+  { return __builtin_islessgreater(__x, __y); }
+
+
+
+  template<typename _Tp, typename _Up>
+    constexpr typename
+    __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value
+       && __is_arithmetic<_Up>::__value), bool>::__type
+    islessgreater(_Tp __x, _Up __y)
+    {
+      typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+      return __builtin_islessgreater(__type(__x), __type(__y));
+    }
+
+
+
+  constexpr bool
+  isunordered(float __x, float __y)
+  { return __builtin_isunordered(__x, __y); }
+
+  constexpr bool
+  isunordered(double __x, double __y)
+  { return __builtin_isunordered(__x, __y); }
+
+  constexpr bool
+  isunordered(long double __x, long double __y)
+  { return __builtin_isunordered(__x, __y); }
+
+
+
+  template<typename _Tp, typename _Up>
+    constexpr typename
+    __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value
+       && __is_arithmetic<_Up>::__value), bool>::__type
+    isunordered(_Tp __x, _Up __y)
+    {
+      typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+      return __builtin_isunordered(__type(__x), __type(__y));
+    }
+  using ::double_t;
+  using ::float_t;
+
+
+  using ::acosh;
+  using ::acoshf;
+  using ::acoshl;
+
+  using ::asinh;
+  using ::asinhf;
+  using ::asinhl;
+
+  using ::atanh;
+  using ::atanhf;
+  using ::atanhl;
+
+  using ::cbrt;
+  using ::cbrtf;
+  using ::cbrtl;
+
+  using ::copysign;
+  using ::copysignf;
+  using ::copysignl;
+
+  using ::erf;
+  using ::erff;
+  using ::erfl;
+
+  using ::erfc;
+  using ::erfcf;
+  using ::erfcl;
+
+  using ::exp2;
+  using ::exp2f;
+  using ::exp2l;
+
+  using ::expm1;
+  using ::expm1f;
+  using ::expm1l;
+
+  using ::fdim;
+  using ::fdimf;
+  using ::fdiml;
+
+  using ::fma;
+  using ::fmaf;
+  using ::fmal;
+
+  using ::fmax;
+  using ::fmaxf;
+  using ::fmaxl;
+
+  using ::fmin;
+  using ::fminf;
+  using ::fminl;
+
+  using ::hypot;
+  using ::hypotf;
+  using ::hypotl;
+
+  using ::ilogb;
+  using ::ilogbf;
+  using ::ilogbl;
+
+  using ::lgamma;
+  using ::lgammaf;
+  using ::lgammal;
+
+
+  using ::llrint;
+  using ::llrintf;
+  using ::llrintl;
+
+  using ::llround;
+  using ::llroundf;
+  using ::llroundl;
+
+
+  using ::log1p;
+  using ::log1pf;
+  using ::log1pl;
+
+  using ::log2;
+  using ::log2f;
+  using ::log2l;
+
+  using ::logb;
+  using ::logbf;
+  using ::logbl;
+
+  using ::lrint;
+  using ::lrintf;
+  using ::lrintl;
+
+  using ::lround;
+  using ::lroundf;
+  using ::lroundl;
+
+  using ::nan;
+  using ::nanf;
+  using ::nanl;
+
+  using ::nearbyint;
+  using ::nearbyintf;
+  using ::nearbyintl;
+
+  using ::nextafter;
+  using ::nextafterf;
+  using ::nextafterl;
+
+  using ::nexttoward;
+  using ::nexttowardf;
+  using ::nexttowardl;
+
+  using ::remainder;
+  using ::remainderf;
+  using ::remainderl;
+
+  using ::remquo;
+  using ::remquof;
+  using ::remquol;
+
+  using ::rint;
+  using ::rintf;
+  using ::rintl;
+
+  using ::round;
+  using ::roundf;
+  using ::roundl;
+
+  using ::scalbln;
+  using ::scalblnf;
+  using ::scalblnl;
+
+  using ::scalbn;
+  using ::scalbnf;
+  using ::scalbnl;
+
+  using ::tgamma;
+  using ::tgammaf;
+  using ::tgammal;
+
+  using ::trunc;
+  using ::truncf;
+  using ::truncl;
+
+
+
+  constexpr float
+  acosh(float __x)
+  { return __builtin_acoshf(__x); }
+
+  constexpr long double
+  acosh(long double __x)
+  { return __builtin_acoshl(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              double>::__type
+    acosh(_Tp __x)
+    { return __builtin_acosh(__x); }
+
+
+
+  constexpr float
+  asinh(float __x)
+  { return __builtin_asinhf(__x); }
+
+  constexpr long double
+  asinh(long double __x)
+  { return __builtin_asinhl(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              double>::__type
+    asinh(_Tp __x)
+    { return __builtin_asinh(__x); }
+
+
+
+  constexpr float
+  atanh(float __x)
+  { return __builtin_atanhf(__x); }
+
+  constexpr long double
+  atanh(long double __x)
+  { return __builtin_atanhl(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              double>::__type
+    atanh(_Tp __x)
+    { return __builtin_atanh(__x); }
+
+
+
+  constexpr float
+  cbrt(float __x)
+  { return __builtin_cbrtf(__x); }
+
+  constexpr long double
+  cbrt(long double __x)
+  { return __builtin_cbrtl(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              double>::__type
+    cbrt(_Tp __x)
+    { return __builtin_cbrt(__x); }
+
+
+
+  constexpr float
+  copysign(float __x, float __y)
+  { return __builtin_copysignf(__x, __y); }
+
+  constexpr long double
+  copysign(long double __x, long double __y)
+  { return __builtin_copysignl(__x, __y); }
+
+
+
+  template<typename _Tp, typename _Up>
+    constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
+    copysign(_Tp __x, _Up __y)
+    {
+      typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+      return copysign(__type(__x), __type(__y));
+    }
+
+
+
+  constexpr float
+  erf(float __x)
+  { return __builtin_erff(__x); }
+
+  constexpr long double
+  erf(long double __x)
+  { return __builtin_erfl(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              double>::__type
+    erf(_Tp __x)
+    { return __builtin_erf(__x); }
+
+
+
+  constexpr float
+  erfc(float __x)
+  { return __builtin_erfcf(__x); }
+
+  constexpr long double
+  erfc(long double __x)
+  { return __builtin_erfcl(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              double>::__type
+    erfc(_Tp __x)
+    { return __builtin_erfc(__x); }
+
+
+
+  constexpr float
+  exp2(float __x)
+  { return __builtin_exp2f(__x); }
+
+  constexpr long double
+  exp2(long double __x)
+  { return __builtin_exp2l(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              double>::__type
+    exp2(_Tp __x)
+    { return __builtin_exp2(__x); }
+
+
+
+  constexpr float
+  expm1(float __x)
+  { return __builtin_expm1f(__x); }
+
+  constexpr long double
+  expm1(long double __x)
+  { return __builtin_expm1l(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              double>::__type
+    expm1(_Tp __x)
+    { return __builtin_expm1(__x); }
+
+
+
+  constexpr float
+  fdim(float __x, float __y)
+  { return __builtin_fdimf(__x, __y); }
+
+  constexpr long double
+  fdim(long double __x, long double __y)
+  { return __builtin_fdiml(__x, __y); }
+
+
+
+  template<typename _Tp, typename _Up>
+    constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
+    fdim(_Tp __x, _Up __y)
+    {
+      typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+      return fdim(__type(__x), __type(__y));
+    }
+
+
+
+  constexpr float
+  fma(float __x, float __y, float __z)
+  { return __builtin_fmaf(__x, __y, __z); }
+
+  constexpr long double
+  fma(long double __x, long double __y, long double __z)
+  { return __builtin_fmal(__x, __y, __z); }
+
+
+
+  template<typename _Tp, typename _Up, typename _Vp>
+    constexpr typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type
+    fma(_Tp __x, _Up __y, _Vp __z)
+    {
+      typedef typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type __type;
+      return fma(__type(__x), __type(__y), __type(__z));
+    }
+
+
+
+  constexpr float
+  fmax(float __x, float __y)
+  { return __builtin_fmaxf(__x, __y); }
+
+  constexpr long double
+  fmax(long double __x, long double __y)
+  { return __builtin_fmaxl(__x, __y); }
+
+
+
+  template<typename _Tp, typename _Up>
+    constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
+    fmax(_Tp __x, _Up __y)
+    {
+      typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+      return fmax(__type(__x), __type(__y));
+    }
+
+
+
+  constexpr float
+  fmin(float __x, float __y)
+  { return __builtin_fminf(__x, __y); }
+
+  constexpr long double
+  fmin(long double __x, long double __y)
+  { return __builtin_fminl(__x, __y); }
+
+
+
+  template<typename _Tp, typename _Up>
+    constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
+    fmin(_Tp __x, _Up __y)
+    {
+      typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+      return fmin(__type(__x), __type(__y));
+    }
+
+
+
+  constexpr float
+  hypot(float __x, float __y)
+  { return __builtin_hypotf(__x, __y); }
+
+  constexpr long double
+  hypot(long double __x, long double __y)
+  { return __builtin_hypotl(__x, __y); }
+
+
+
+  template<typename _Tp, typename _Up>
+    constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
+    hypot(_Tp __x, _Up __y)
+    {
+      typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+      return hypot(__type(__x), __type(__y));
+    }
+
+
+
+  constexpr int
+  ilogb(float __x)
+  { return __builtin_ilogbf(__x); }
+
+  constexpr int
+  ilogb(long double __x)
+  { return __builtin_ilogbl(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr
+    typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                    int>::__type
+    ilogb(_Tp __x)
+    { return __builtin_ilogb(__x); }
+
+
+
+  constexpr float
+  lgamma(float __x)
+  { return __builtin_lgammaf(__x); }
+
+  constexpr long double
+  lgamma(long double __x)
+  { return __builtin_lgammal(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              double>::__type
+    lgamma(_Tp __x)
+    { return __builtin_lgamma(__x); }
+
+
+
+  constexpr long long
+  llrint(float __x)
+  { return __builtin_llrintf(__x); }
+
+  constexpr long long
+  llrint(long double __x)
+  { return __builtin_llrintl(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              long long>::__type
+    llrint(_Tp __x)
+    { return __builtin_llrint(__x); }
+
+
+
+  constexpr long long
+  llround(float __x)
+  { return __builtin_llroundf(__x); }
+
+  constexpr long long
+  llround(long double __x)
+  { return __builtin_llroundl(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              long long>::__type
+    llround(_Tp __x)
+    { return __builtin_llround(__x); }
+
+
+
+  constexpr float
+  log1p(float __x)
+  { return __builtin_log1pf(__x); }
+
+  constexpr long double
+  log1p(long double __x)
+  { return __builtin_log1pl(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              double>::__type
+    log1p(_Tp __x)
+    { return __builtin_log1p(__x); }
+
+
+
+
+  constexpr float
+  log2(float __x)
+  { return __builtin_log2f(__x); }
+
+  constexpr long double
+  log2(long double __x)
+  { return __builtin_log2l(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              double>::__type
+    log2(_Tp __x)
+    { return __builtin_log2(__x); }
+
+
+
+  constexpr float
+  logb(float __x)
+  { return __builtin_logbf(__x); }
+
+  constexpr long double
+  logb(long double __x)
+  { return __builtin_logbl(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              double>::__type
+    logb(_Tp __x)
+    { return __builtin_logb(__x); }
+
+
+
+  constexpr long
+  lrint(float __x)
+  { return __builtin_lrintf(__x); }
+
+  constexpr long
+  lrint(long double __x)
+  { return __builtin_lrintl(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              long>::__type
+    lrint(_Tp __x)
+    { return __builtin_lrint(__x); }
+
+
+
+  constexpr long
+  lround(float __x)
+  { return __builtin_lroundf(__x); }
+
+  constexpr long
+  lround(long double __x)
+  { return __builtin_lroundl(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              long>::__type
+    lround(_Tp __x)
+    { return __builtin_lround(__x); }
+
+
+
+  constexpr float
+  nearbyint(float __x)
+  { return __builtin_nearbyintf(__x); }
+
+  constexpr long double
+  nearbyint(long double __x)
+  { return __builtin_nearbyintl(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              double>::__type
+    nearbyint(_Tp __x)
+    { return __builtin_nearbyint(__x); }
+
+
+
+  constexpr float
+  nextafter(float __x, float __y)
+  { return __builtin_nextafterf(__x, __y); }
+
+  constexpr long double
+  nextafter(long double __x, long double __y)
+  { return __builtin_nextafterl(__x, __y); }
+
+
+
+  template<typename _Tp, typename _Up>
+    constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
+    nextafter(_Tp __x, _Up __y)
+    {
+      typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+      return nextafter(__type(__x), __type(__y));
+    }
+
+
+
+  constexpr float
+  nexttoward(float __x, long double __y)
+  { return __builtin_nexttowardf(__x, __y); }
+
+  constexpr long double
+  nexttoward(long double __x, long double __y)
+  { return __builtin_nexttowardl(__x, __y); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              double>::__type
+    nexttoward(_Tp __x, long double __y)
+    { return __builtin_nexttoward(__x, __y); }
+
+
+
+  constexpr float
+  remainder(float __x, float __y)
+  { return __builtin_remainderf(__x, __y); }
+
+  constexpr long double
+  remainder(long double __x, long double __y)
+  { return __builtin_remainderl(__x, __y); }
+
+
+
+  template<typename _Tp, typename _Up>
+    constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
+    remainder(_Tp __x, _Up __y)
+    {
+      typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+      return remainder(__type(__x), __type(__y));
+    }
+
+
+
+  inline float
+  remquo(float __x, float __y, int* __pquo)
+  { return __builtin_remquof(__x, __y, __pquo); }
+
+  inline long double
+  remquo(long double __x, long double __y, int* __pquo)
+  { return __builtin_remquol(__x, __y, __pquo); }
+
+
+
+  template<typename _Tp, typename _Up>
+    inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
+    remquo(_Tp __x, _Up __y, int* __pquo)
+    {
+      typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
+      return remquo(__type(__x), __type(__y), __pquo);
+    }
+
+
+
+  constexpr float
+  rint(float __x)
+  { return __builtin_rintf(__x); }
+
+  constexpr long double
+  rint(long double __x)
+  { return __builtin_rintl(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              double>::__type
+    rint(_Tp __x)
+    { return __builtin_rint(__x); }
+
+
+
+  constexpr float
+  round(float __x)
+  { return __builtin_roundf(__x); }
+
+  constexpr long double
+  round(long double __x)
+  { return __builtin_roundl(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              double>::__type
+    round(_Tp __x)
+    { return __builtin_round(__x); }
+
+
+
+  constexpr float
+  scalbln(float __x, long __ex)
+  { return __builtin_scalblnf(__x, __ex); }
+
+  constexpr long double
+  scalbln(long double __x, long __ex)
+  { return __builtin_scalblnl(__x, __ex); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              double>::__type
+    scalbln(_Tp __x, long __ex)
+    { return __builtin_scalbln(__x, __ex); }
+
+
+
+  constexpr float
+  scalbn(float __x, int __ex)
+  { return __builtin_scalbnf(__x, __ex); }
+
+  constexpr long double
+  scalbn(long double __x, int __ex)
+  { return __builtin_scalbnl(__x, __ex); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              double>::__type
+    scalbn(_Tp __x, int __ex)
+    { return __builtin_scalbn(__x, __ex); }
+
+
+
+  constexpr float
+  tgamma(float __x)
+  { return __builtin_tgammaf(__x); }
+
+  constexpr long double
+  tgamma(long double __x)
+  { return __builtin_tgammal(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              double>::__type
+    tgamma(_Tp __x)
+    { return __builtin_tgamma(__x); }
+
+
+
+  constexpr float
+  trunc(float __x)
+  { return __builtin_truncf(__x); }
+
+  constexpr long double
+  trunc(long double __x)
+  { return __builtin_truncl(__x); }
+
+
+
+  template<typename _Tp>
+    constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
+                                              double>::__type
+    trunc(_Tp __x)
+    { return __builtin_trunc(__x); }
+
+}
+
+
+
+
+
+}
+
+using std::abs;
+using std::acos;
+using std::asin;
+using std::atan;
+using std::atan2;
+using std::cos;
+using std::sin;
+using std::tan;
+using std::cosh;
+using std::sinh;
+using std::tanh;
+using std::exp;
+using std::frexp;
+using std::ldexp;
+using std::log;
+using std::log10;
+using std::modf;
+using std::pow;
+using std::sqrt;
+using std::ceil;
+using std::fabs;
+using std::floor;
+using std::fmod;
+
+
+using std::fpclassify;
+using std::isfinite;
+using std::isinf;
+using std::isnan;
+using std::isnormal;
+using std::signbit;
+using std::isgreater;
+using std::isgreaterequal;
+using std::isless;
+using std::islessequal;
+using std::islessgreater;
+using std::isunordered;
+
+
+
+using std::acosh;
+using std::asinh;
+using std::atanh;
+using std::cbrt;
+using std::copysign;
+using std::erf;
+using std::erfc;
+using std::exp2;
+using std::expm1;
+using std::fdim;
+using std::fma;
+using std::fmax;
+using std::fmin;
+using std::hypot;
+using std::ilogb;
+using std::lgamma;
+using std::llrint;
+using std::llround;
+using std::log1p;
+using std::log2;
+using std::logb;
+using std::lrint;
+using std::lround;
+using std::nearbyint;
+using std::nextafter;
+using std::nexttoward;
+using std::remainder;
+using std::remquo;
+using std::rint;
+using std::round;
+using std::scalbln;
+using std::scalbn;
+using std::tgamma;
+using std::trunc;
+
+extern "C" {
+
+
+extern void __assert_fail (const char *__assertion, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+extern void __assert_perror_fail (int __errnum, const char *__file,
+      unsigned int __line, const char *__function)
+     throw () __attribute__ ((__noreturn__));
+
+
+
+
+extern void __assert (const char *__assertion, const char *__file, int __line)
+     throw () __attribute__ ((__noreturn__));
+
+
+}
+
+extern "C" {
+
+
+
+
+
+
+
+
+struct _IO_FILE;
+typedef struct _IO_FILE __FILE;
+
+
+
+struct _IO_FILE;
+
+
+typedef struct _IO_FILE FILE;
+
+
+
+
+typedef struct
+{
+  int __count;
+  union
+  {
+    unsigned int __wch;
+    char __wchb[4];
+  } __value;
+} __mbstate_t;
+
+
+
+
+typedef struct
+{
+  __off_t __pos;
+  __mbstate_t __state;
+} _G_fpos_t;
+typedef struct
+{
+  __off64_t __pos;
+  __mbstate_t __state;
+} _G_fpos64_t;
+typedef __builtin_va_list __gnuc_va_list;
+struct _IO_jump_t; struct _IO_FILE;
+
+
+
+
+typedef void _IO_lock_t;
+
+
+
+
+
+struct _IO_marker {
+  struct _IO_marker *_next;
+  struct _IO_FILE *_sbuf;
+
+
+
+  int _pos;
+};
+
+
+enum __codecvt_result
+{
+  __codecvt_ok,
+  __codecvt_partial,
+  __codecvt_error,
+  __codecvt_noconv
+};
+struct _IO_FILE {
+  int _flags;
+
+
+
+
+  char* _IO_read_ptr;
+  char* _IO_read_end;
+  char* _IO_read_base;
+  char* _IO_write_base;
+  char* _IO_write_ptr;
+  char* _IO_write_end;
+  char* _IO_buf_base;
+  char* _IO_buf_end;
+
+  char *_IO_save_base;
+  char *_IO_backup_base;
+  char *_IO_save_end;
+
+  struct _IO_marker *_markers;
+
+  struct _IO_FILE *_chain;
+
+  int _fileno;
+
+
+
+  int _flags2;
+
+  __off_t _old_offset;
+
+
+
+  unsigned short _cur_column;
+  signed char _vtable_offset;
+  char _shortbuf[1];
+
+
+
+  _IO_lock_t *_lock;
+  __off64_t _offset;
+
+
+
+
+
+
+
+  void *__pad1;
+  void *__pad2;
+  void *__pad3;
+  void *__pad4;
+
+  size_t __pad5;
+  int _mode;
+
+  char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
+
+};
+
+
+
+
+
+struct _IO_FILE_plus;
+
+extern struct _IO_FILE_plus _IO_2_1_stdin_;
+extern struct _IO_FILE_plus _IO_2_1_stdout_;
+extern struct _IO_FILE_plus _IO_2_1_stderr_;
+typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes);
+
+
+
+
+
+
+
+typedef __ssize_t __io_write_fn (void *__cookie, const char *__buf,
+     size_t __n);
+
+
+
+
+
+
+
+typedef int __io_seek_fn (void *__cookie, __off64_t *__pos, int __w);
+
+
+typedef int __io_close_fn (void *__cookie);
+
+
+
+
+typedef __io_read_fn cookie_read_function_t;
+typedef __io_write_fn cookie_write_function_t;
+typedef __io_seek_fn cookie_seek_function_t;
+typedef __io_close_fn cookie_close_function_t;
+
+
+typedef struct
+{
+  __io_read_fn *read;
+  __io_write_fn *write;
+  __io_seek_fn *seek;
+  __io_close_fn *close;
+} _IO_cookie_io_functions_t;
+typedef _IO_cookie_io_functions_t cookie_io_functions_t;
+
+struct _IO_cookie_file;
+
+
+extern void _IO_cookie_init (struct _IO_cookie_file *__cfile, int __read_write,
+        void *__cookie, _IO_cookie_io_functions_t __fns);
+
+
+
+
+extern "C" {
+
+
+extern int __underflow (_IO_FILE *);
+extern int __uflow (_IO_FILE *);
+extern int __overflow (_IO_FILE *, int);
+extern int _IO_getc (_IO_FILE *__fp);
+extern int _IO_putc (int __c, _IO_FILE *__fp);
+extern int _IO_feof (_IO_FILE *__fp) throw ();
+extern int _IO_ferror (_IO_FILE *__fp) throw ();
+
+extern int _IO_peekc_locked (_IO_FILE *__fp);
+
+
+
+
+
+extern void _IO_flockfile (_IO_FILE *) throw ();
+extern void _IO_funlockfile (_IO_FILE *) throw ();
+extern int _IO_ftrylockfile (_IO_FILE *) throw ();
+extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict,
+   __gnuc_va_list, int *__restrict);
+extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict,
+    __gnuc_va_list);
+extern __ssize_t _IO_padn (_IO_FILE *, int, __ssize_t);
+extern size_t _IO_sgetn (_IO_FILE *, void *, size_t);
+
+extern __off64_t _IO_seekoff (_IO_FILE *, __off64_t, int, int);
+extern __off64_t _IO_seekpos (_IO_FILE *, __off64_t, int);
+
+extern void _IO_free_backup_area (_IO_FILE *) throw ();
+}
+
+
+
+
+typedef __gnuc_va_list va_list;
+typedef _G_fpos_t fpos_t;
+
+
+
+
+typedef _G_fpos64_t fpos64_t;
+
+
+
+extern struct _IO_FILE *stdin;
+extern struct _IO_FILE *stdout;
+extern struct _IO_FILE *stderr;
+
+
+
+
+
+
+extern int remove (const char *__filename) throw ();
+
+extern int rename (const char *__old, const char *__new) throw ();
+
+
+
+extern int renameat (int __oldfd, const char *__old, int __newfd,
+       const char *__new) throw ();
+
+
+
+
+
+
+
+extern FILE *tmpfile (void) __attribute__ ((__warn_unused_result__));
+extern FILE *tmpfile64 (void) __attribute__ ((__warn_unused_result__));
+
+
+
+extern char *tmpnam (char *__s) throw () __attribute__ ((__warn_unused_result__));
+
+
+
+
+extern char *tmpnam_r (char *__s) throw () __attribute__ ((__warn_unused_result__));
+extern char *tempnam (const char *__dir, const char *__pfx)
+     throw () __attribute__ ((__malloc__)) __attribute__ ((__warn_unused_result__));
+
+
+
+
+
+
+
+extern int fclose (FILE *__stream);
+
+
+
+
+extern int fflush (FILE *__stream);
+extern int fflush_unlocked (FILE *__stream);
+extern int fcloseall (void);
+extern FILE *fopen (const char *__restrict __filename,
+      const char *__restrict __modes) __attribute__ ((__warn_unused_result__));
+
+
+
+
+extern FILE *freopen (const char *__restrict __filename,
+        const char *__restrict __modes,
+        FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
+extern FILE *fopen64 (const char *__restrict __filename,
+        const char *__restrict __modes) __attribute__ ((__warn_unused_result__));
+extern FILE *freopen64 (const char *__restrict __filename,
+   const char *__restrict __modes,
+   FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
+
+
+
+
+extern FILE *fdopen (int __fd, const char *__modes) throw () __attribute__ ((__warn_unused_result__));
+
+
+
+
+
+extern FILE *fopencookie (void *__restrict __magic_cookie,
+     const char *__restrict __modes,
+     _IO_cookie_io_functions_t __io_funcs) throw () __attribute__ ((__warn_unused_result__));
+
+
+
+
+extern FILE *fmemopen (void *__s, size_t __len, const char *__modes)
+  throw () __attribute__ ((__warn_unused_result__));
+
+
+
+
+extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) throw () __attribute__ ((__warn_unused_result__));
+
+
+
+
+
+extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) throw ();
+
+
+
+extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
+      int __modes, size_t __n) throw ();
+
+
+
+
+extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
+         size_t __size) throw ();
+
+
+extern void setlinebuf (FILE *__stream) throw ();
+
+
+
+
+
+
+
+extern int fprintf (FILE *__restrict __stream,
+      const char *__restrict __format, ...);
+
+
+
+
+extern int printf (const char *__restrict __format, ...);
+
+extern int sprintf (char *__restrict __s,
+      const char *__restrict __format, ...) throw ();
+
+
+
+
+
+extern int vfprintf (FILE *__restrict __s, const char *__restrict __format,
+       __gnuc_va_list __arg);
+
+
+
+
+extern int vprintf (const char *__restrict __format, __gnuc_va_list __arg);
+
+extern int vsprintf (char *__restrict __s, const char *__restrict __format,
+       __gnuc_va_list __arg) throw ();
+
+
+
+extern int snprintf (char *__restrict __s, size_t __maxlen,
+       const char *__restrict __format, ...)
+     throw () __attribute__ ((__format__ (__printf__, 3, 4)));
+
+extern int vsnprintf (char *__restrict __s, size_t __maxlen,
+        const char *__restrict __format, __gnuc_va_list __arg)
+     throw () __attribute__ ((__format__ (__printf__, 3, 0)));
+
+
+
+
+
+extern int vasprintf (char **__restrict __ptr, const char *__restrict __f,
+        __gnuc_va_list __arg)
+     throw () __attribute__ ((__format__ (__printf__, 2, 0))) __attribute__ ((__warn_unused_result__));
+extern int __asprintf (char **__restrict __ptr,
+         const char *__restrict __fmt, ...)
+     throw () __attribute__ ((__format__ (__printf__, 2, 3))) __attribute__ ((__warn_unused_result__));
+extern int asprintf (char **__restrict __ptr,
+       const char *__restrict __fmt, ...)
+     throw () __attribute__ ((__format__ (__printf__, 2, 3))) __attribute__ ((__warn_unused_result__));
+
+
+
+
+extern int vdprintf (int __fd, const char *__restrict __fmt,
+       __gnuc_va_list __arg)
+     __attribute__ ((__format__ (__printf__, 2, 0)));
+extern int dprintf (int __fd, const char *__restrict __fmt, ...)
+     __attribute__ ((__format__ (__printf__, 2, 3)));
+
+
+
+
+
+
+
+extern int fscanf (FILE *__restrict __stream,
+     const char *__restrict __format, ...) __attribute__ ((__warn_unused_result__));
+
+
+
+
+extern int scanf (const char *__restrict __format, ...) __attribute__ ((__warn_unused_result__));
+
+extern int sscanf (const char *__restrict __s,
+     const char *__restrict __format, ...) throw ();
+extern int vfscanf (FILE *__restrict __s, const char *__restrict __format,
+      __gnuc_va_list __arg)
+     __attribute__ ((__format__ (__scanf__, 2, 0))) __attribute__ ((__warn_unused_result__));
+
+
+
+
+
+extern int vscanf (const char *__restrict __format, __gnuc_va_list __arg)
+     __attribute__ ((__format__ (__scanf__, 1, 0))) __attribute__ ((__warn_unused_result__));
+
+
+extern int vsscanf (const char *__restrict __s,
+      const char *__restrict __format, __gnuc_va_list __arg)
+     throw () __attribute__ ((__format__ (__scanf__, 2, 0)));
+extern int fgetc (FILE *__stream);
+extern int getc (FILE *__stream);
+
+
+
+
+
+extern int getchar (void);
+extern int getc_unlocked (FILE *__stream);
+extern int getchar_unlocked (void);
+extern int fgetc_unlocked (FILE *__stream);
+extern int fputc (int __c, FILE *__stream);
+extern int putc (int __c, FILE *__stream);
+
+
+
+
+
+extern int putchar (int __c);
+extern int fputc_unlocked (int __c, FILE *__stream);
+
+
+
+
+
+
+
+extern int putc_unlocked (int __c, FILE *__stream);
+extern int putchar_unlocked (int __c);
+
+
+
+
+
+
+extern int getw (FILE *__stream);
+
+
+extern int putw (int __w, FILE *__stream);
+
+
+
+
+
+
+
+extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
+     __attribute__ ((__warn_unused_result__));
+extern char *fgets_unlocked (char *__restrict __s, int __n,
+        FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
+extern __ssize_t __getdelim (char **__restrict __lineptr,
+          size_t *__restrict __n, int __delimiter,
+          FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
+extern __ssize_t getdelim (char **__restrict __lineptr,
+        size_t *__restrict __n, int __delimiter,
+        FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
+
+
+
+
+
+
+
+extern __ssize_t getline (char **__restrict __lineptr,
+       size_t *__restrict __n,
+       FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
+
+
+
+
+
+
+
+extern int fputs (const char *__restrict __s, FILE *__restrict __stream);
+
+
+
+
+
+extern int puts (const char *__s);
+
+
+
+
+
+
+extern int ungetc (int __c, FILE *__stream);
+
+
+
+
+
+
+extern size_t fread (void *__restrict __ptr, size_t __size,
+       size_t __n, FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
+
+
+
+
+extern size_t fwrite (const void *__restrict __ptr, size_t __size,
+        size_t __n, FILE *__restrict __s);
+extern int fputs_unlocked (const char *__restrict __s,
+      FILE *__restrict __stream);
+extern size_t fread_unlocked (void *__restrict __ptr, size_t __size,
+         size_t __n, FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
+extern size_t fwrite_unlocked (const void *__restrict __ptr, size_t __size,
+          size_t __n, FILE *__restrict __stream);
+
+
+
+
+
+
+
+extern int fseek (FILE *__stream, long int __off, int __whence);
+
+
+
+
+extern long int ftell (FILE *__stream) __attribute__ ((__warn_unused_result__));
+
+
+
+
+extern void rewind (FILE *__stream);
+extern int fseeko (FILE *__stream, __off_t __off, int __whence);
+
+
+
+
+extern __off_t ftello (FILE *__stream) __attribute__ ((__warn_unused_result__));
+extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos);
+
+
+
+
+extern int fsetpos (FILE *__stream, const fpos_t *__pos);
+extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
+extern __off64_t ftello64 (FILE *__stream) __attribute__ ((__warn_unused_result__));
+extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos);
+extern int fsetpos64 (FILE *__stream, const fpos64_t *__pos);
+
+
+
+extern void clearerr (FILE *__stream) throw ();
+
+extern int feof (FILE *__stream) throw () __attribute__ ((__warn_unused_result__));
+
+extern int ferror (FILE *__stream) throw () __attribute__ ((__warn_unused_result__));
+
+
+
+extern void clearerr_unlocked (FILE *__stream) throw ();
+extern int feof_unlocked (FILE *__stream) throw () __attribute__ ((__warn_unused_result__));
+extern int ferror_unlocked (FILE *__stream) throw () __attribute__ ((__warn_unused_result__));
+
+
+
+
+
+
+
+extern void perror (const char *__s);
+
+
+
+
+
+extern int sys_nerr;
+extern const char *const sys_errlist[];
+
+
+extern int _sys_nerr;
+extern const char *const _sys_errlist[];
+
+
+
+
+extern int fileno (FILE *__stream) throw () __attribute__ ((__warn_unused_result__));
+
+
+
+
+extern int fileno_unlocked (FILE *__stream) throw () __attribute__ ((__warn_unused_result__));
+extern FILE *popen (const char *__command, const char *__modes) __attribute__ ((__warn_unused_result__));
+
+
+
+
+
+extern int pclose (FILE *__stream);
+
+
+
+
+
+extern char *ctermid (char *__s) throw ();
+
+
+
+
+
+extern char *cuserid (char *__s);
+
+
+
+
+struct obstack;
+
+
+extern int obstack_printf (struct obstack *__restrict __obstack,
+      const char *__restrict __format, ...)
+     throw () __attribute__ ((__format__ (__printf__, 2, 3)));
+extern int obstack_vprintf (struct obstack *__restrict __obstack,
+       const char *__restrict __format,
+       __gnuc_va_list __args)
+     throw () __attribute__ ((__format__ (__printf__, 2, 0)));
+
+
+
+
+
+
+
+extern void flockfile (FILE *__stream) throw ();
+
+
+
+extern int ftrylockfile (FILE *__stream) throw () __attribute__ ((__warn_unused_result__));
+
+
+extern void funlockfile (FILE *__stream) throw ();
+extern __inline __attribute__ ((__gnu_inline__)) int
+getchar (void)
+{
+  return _IO_getc (stdin);
+}
+
+
+
+
+extern __inline __attribute__ ((__gnu_inline__)) int
+fgetc_unlocked (FILE *__fp)
+{
+  return (__builtin_expect (((__fp)->_IO_read_ptr >= (__fp)->_IO_read_end), 0) ? __uflow (__fp) : *(unsigned char *) (__fp)->_IO_read_ptr++);
+}
+
+
+
+
+
+extern __inline __attribute__ ((__gnu_inline__)) int
+getc_unlocked (FILE *__fp)
+{
+  return (__builtin_expect (((__fp)->_IO_read_ptr >= (__fp)->_IO_read_end), 0) ? __uflow (__fp) : *(unsigned char *) (__fp)->_IO_read_ptr++);
+}
+
+
+extern __inline __attribute__ ((__gnu_inline__)) int
+getchar_unlocked (void)
+{
+  return (__builtin_expect (((stdin)->_IO_read_ptr >= (stdin)->_IO_read_end), 0) ? __uflow (stdin) : *(unsigned char *) (stdin)->_IO_read_ptr++);
+}
+
+
+
+
+extern __inline __attribute__ ((__gnu_inline__)) int
+putchar (int __c)
+{
+  return _IO_putc (__c, stdout);
+}
+
+
+
+
+extern __inline __attribute__ ((__gnu_inline__)) int
+fputc_unlocked (int __c, FILE *__stream)
+{
+  return (__builtin_expect (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c)));
+}
+
+
+
+
+
+extern __inline __attribute__ ((__gnu_inline__)) int
+putc_unlocked (int __c, FILE *__stream)
+{
+  return (__builtin_expect (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c)));
+}
+
+
+extern __inline __attribute__ ((__gnu_inline__)) int
+putchar_unlocked (int __c)
+{
+  return (__builtin_expect (((stdout)->_IO_write_ptr >= (stdout)->_IO_write_end), 0) ? __overflow (stdout, (unsigned char) (__c)) : (unsigned char) (*(stdout)->_IO_write_ptr++ = (__c)));
+}
+
+
+
+
+
+extern __inline __attribute__ ((__gnu_inline__)) __ssize_t
+getline (char **__lineptr, size_t *__n, FILE *__stream)
+{
+  return __getdelim (__lineptr, __n, '\n', __stream);
+}
+
+
+
+
+
+extern __inline __attribute__ ((__gnu_inline__)) int
+__attribute__ ((__leaf__)) feof_unlocked (FILE *__stream) throw ()
+{
+  return (((__stream)->_flags & 0x10) != 0);
+}
+
+
+extern __inline __attribute__ ((__gnu_inline__)) int
+__attribute__ ((__leaf__)) ferror_unlocked (FILE *__stream) throw ()
+{
+  return (((__stream)->_flags & 0x20) != 0);
+}
+
+
+extern int __sprintf_chk (char *__restrict __s, int __flag, size_t __slen,
+     const char *__restrict __format, ...) throw ();
+extern int __vsprintf_chk (char *__restrict __s, int __flag, size_t __slen,
+      const char *__restrict __format,
+      __gnuc_va_list __ap) throw ();
+
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) int
+__attribute__ ((__leaf__)) sprintf (char *__restrict __s, const char *__restrict __fmt, ...) throw ()
+{
+  return __builtin___sprintf_chk (__s, 2 - 1,
+      __builtin_object_size (__s, 2 > 1), __fmt, __builtin_va_arg_pack ());
+}
+
+
+
+
+
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) int
+__attribute__ ((__leaf__)) vsprintf (char *__restrict __s, const char *__restrict __fmt, __gnuc_va_list __ap) throw ()
+
+{
+  return __builtin___vsprintf_chk (__s, 2 - 1,
+       __builtin_object_size (__s, 2 > 1), __fmt, __ap);
+}
+
+
+
+extern int __snprintf_chk (char *__restrict __s, size_t __n, int __flag,
+      size_t __slen, const char *__restrict __format,
+      ...) throw ();
+extern int __vsnprintf_chk (char *__restrict __s, size_t __n, int __flag,
+       size_t __slen, const char *__restrict __format,
+       __gnuc_va_list __ap) throw ();
+
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) int
+__attribute__ ((__leaf__)) snprintf (char *__restrict __s, size_t __n, const char *__restrict __fmt, ...) throw ()
+
+{
+  return __builtin___snprintf_chk (__s, __n, 2 - 1,
+       __builtin_object_size (__s, 2 > 1), __fmt, __builtin_va_arg_pack ());
+}
+
+
+
+
+
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) int
+__attribute__ ((__leaf__)) vsnprintf (char *__restrict __s, size_t __n, const char *__restrict __fmt, __gnuc_va_list __ap) throw ()
+
+{
+  return __builtin___vsnprintf_chk (__s, __n, 2 - 1,
+        __builtin_object_size (__s, 2 > 1), __fmt, __ap);
+}
+
+
+
+
+
+extern int __fprintf_chk (FILE *__restrict __stream, int __flag,
+     const char *__restrict __format, ...);
+extern int __printf_chk (int __flag, const char *__restrict __format, ...);
+extern int __vfprintf_chk (FILE *__restrict __stream, int __flag,
+      const char *__restrict __format, __gnuc_va_list __ap);
+extern int __vprintf_chk (int __flag, const char *__restrict __format,
+     __gnuc_va_list __ap);
+
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) int
+fprintf (FILE *__restrict __stream, const char *__restrict __fmt, ...)
+{
+  return __fprintf_chk (__stream, 2 - 1, __fmt,
+   __builtin_va_arg_pack ());
+}
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) int
+printf (const char *__restrict __fmt, ...)
+{
+  return __printf_chk (2 - 1, __fmt, __builtin_va_arg_pack ());
+}
+
+
+
+
+
+
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) int
+vprintf (const char *__restrict __fmt, __gnuc_va_list __ap)
+{
+
+  return __vfprintf_chk (stdout, 2 - 1, __fmt, __ap);
+
+
+
+}
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) int
+vfprintf (FILE *__restrict __stream,
+   const char *__restrict __fmt, __gnuc_va_list __ap)
+{
+  return __vfprintf_chk (__stream, 2 - 1, __fmt, __ap);
+}
+
+
+extern int __dprintf_chk (int __fd, int __flag, const char *__restrict __fmt,
+     ...) __attribute__ ((__format__ (__printf__, 3, 4)));
+extern int __vdprintf_chk (int __fd, int __flag,
+      const char *__restrict __fmt, __gnuc_va_list __arg)
+     __attribute__ ((__format__ (__printf__, 3, 0)));
+
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) int
+dprintf (int __fd, const char *__restrict __fmt, ...)
+{
+  return __dprintf_chk (__fd, 2 - 1, __fmt,
+   __builtin_va_arg_pack ());
+}
+
+
+
+
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) int
+vdprintf (int __fd, const char *__restrict __fmt, __gnuc_va_list __ap)
+{
+  return __vdprintf_chk (__fd, 2 - 1, __fmt, __ap);
+}
+
+
+
+
+extern int __asprintf_chk (char **__restrict __ptr, int __flag,
+      const char *__restrict __fmt, ...)
+     throw () __attribute__ ((__format__ (__printf__, 3, 4))) __attribute__ ((__warn_unused_result__));
+extern int __vasprintf_chk (char **__restrict __ptr, int __flag,
+       const char *__restrict __fmt, __gnuc_va_list __arg)
+     throw () __attribute__ ((__format__ (__printf__, 3, 0))) __attribute__ ((__warn_unused_result__));
+extern int __obstack_printf_chk (struct obstack *__restrict __obstack,
+     int __flag, const char *__restrict __format,
+     ...)
+     throw () __attribute__ ((__format__ (__printf__, 3, 4)));
+extern int __obstack_vprintf_chk (struct obstack *__restrict __obstack,
+      int __flag,
+      const char *__restrict __format,
+      __gnuc_va_list __args)
+     throw () __attribute__ ((__format__ (__printf__, 3, 0)));
+
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) int
+__attribute__ ((__leaf__)) asprintf (char **__restrict __ptr, const char *__restrict __fmt, ...) throw ()
+{
+  return __asprintf_chk (__ptr, 2 - 1, __fmt,
+    __builtin_va_arg_pack ());
+}
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) int
+__attribute__ ((__leaf__)) __asprintf (char **__restrict __ptr, const char *__restrict __fmt, ...) throw ()
+
+{
+  return __asprintf_chk (__ptr, 2 - 1, __fmt,
+    __builtin_va_arg_pack ());
+}
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) int
+__attribute__ ((__leaf__)) obstack_printf (struct obstack *__restrict __obstack, const char *__restrict __fmt, ...) throw ()
+
+{
+  return __obstack_printf_chk (__obstack, 2 - 1, __fmt,
+          __builtin_va_arg_pack ());
+}
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) int
+__attribute__ ((__leaf__)) vasprintf (char **__restrict __ptr, const char *__restrict __fmt, __gnuc_va_list __ap) throw ()
+
+{
+  return __vasprintf_chk (__ptr, 2 - 1, __fmt, __ap);
+}
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) int
+__attribute__ ((__leaf__)) obstack_vprintf (struct obstack *__restrict __obstack, const char *__restrict __fmt, __gnuc_va_list __ap) throw ()
+
+{
+  return __obstack_vprintf_chk (__obstack, 2 - 1, __fmt,
+    __ap);
+}
+extern char *__fgets_chk (char *__restrict __s, size_t __size, int __n,
+     FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
+extern char *__fgets_alias (char *__restrict __s, int __n, FILE *__restrict __stream) __asm__ ("" "fgets")
+
+                                        __attribute__ ((__warn_unused_result__));
+extern char *__fgets_chk_warn (char *__restrict __s, size_t __size, int __n, FILE *__restrict __stream) __asm__ ("" "__fgets_chk")
+
+
+     __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("fgets called with bigger size than length " "of destination buffer")))
+                                 ;
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) __attribute__ ((__warn_unused_result__)) char *
+fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
+{
+  if (__builtin_object_size (__s, 2 > 1) != (size_t) -1)
+    {
+      if (!__builtin_constant_p (__n) || __n <= 0)
+ return __fgets_chk (__s, __builtin_object_size (__s, 2 > 1), __n, __stream);
+
+      if ((size_t) __n > __builtin_object_size (__s, 2 > 1))
+ return __fgets_chk_warn (__s, __builtin_object_size (__s, 2 > 1), __n, __stream);
+    }
+  return __fgets_alias (__s, __n, __stream);
+}
+
+extern size_t __fread_chk (void *__restrict __ptr, size_t __ptrlen,
+      size_t __size, size_t __n,
+      FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
+extern size_t __fread_alias (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) __asm__ ("" "fread")
+
+
+            __attribute__ ((__warn_unused_result__));
+extern size_t __fread_chk_warn (void *__restrict __ptr, size_t __ptrlen, size_t __size, size_t __n, FILE *__restrict __stream) __asm__ ("" "__fread_chk")
+
+
+
+
+     __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("fread called with bigger size * nmemb than length " "of destination buffer")))
+                                 ;
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) __attribute__ ((__warn_unused_result__)) size_t
+fread (void *__restrict __ptr, size_t __size, size_t __n,
+       FILE *__restrict __stream)
+{
+  if (__builtin_object_size (__ptr, 0) != (size_t) -1)
+    {
+      if (!__builtin_constant_p (__size)
+   || !__builtin_constant_p (__n)
+   || (__size | __n) >= (((size_t) 1) << (8 * sizeof (size_t) / 2)))
+ return __fread_chk (__ptr, __builtin_object_size (__ptr, 0), __size, __n, __stream);
+
+      if (__size * __n > __builtin_object_size (__ptr, 0))
+ return __fread_chk_warn (__ptr, __builtin_object_size (__ptr, 0), __size, __n, __stream);
+    }
+  return __fread_alias (__ptr, __size, __n, __stream);
+}
+
+
+extern char *__fgets_unlocked_chk (char *__restrict __s, size_t __size,
+       int __n, FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
+extern char *__fgets_unlocked_alias (char *__restrict __s, int __n, FILE *__restrict __stream) __asm__ ("" "fgets_unlocked")
+
+                                                 __attribute__ ((__warn_unused_result__));
+extern char *__fgets_unlocked_chk_warn (char *__restrict __s, size_t __size, int __n, FILE *__restrict __stream) __asm__ ("" "__fgets_unlocked_chk")
+
+
+     __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("fgets_unlocked called with bigger size than length " "of destination buffer")))
+                                 ;
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) __attribute__ ((__warn_unused_result__)) char *
+fgets_unlocked (char *__restrict __s, int __n, FILE *__restrict __stream)
+{
+  if (__builtin_object_size (__s, 2 > 1) != (size_t) -1)
+    {
+      if (!__builtin_constant_p (__n) || __n <= 0)
+ return __fgets_unlocked_chk (__s, __builtin_object_size (__s, 2 > 1), __n, __stream);
+
+      if ((size_t) __n > __builtin_object_size (__s, 2 > 1))
+ return __fgets_unlocked_chk_warn (__s, __builtin_object_size (__s, 2 > 1), __n, __stream);
+    }
+  return __fgets_unlocked_alias (__s, __n, __stream);
+}
+
+
+
+
+extern size_t __fread_unlocked_chk (void *__restrict __ptr, size_t __ptrlen,
+        size_t __size, size_t __n,
+        FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
+extern size_t __fread_unlocked_alias (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) __asm__ ("" "fread_unlocked")
+
+
+                     __attribute__ ((__warn_unused_result__));
+extern size_t __fread_unlocked_chk_warn (void *__restrict __ptr, size_t __ptrlen, size_t __size, size_t __n, FILE *__restrict __stream) __asm__ ("" "__fread_unlocked_chk")
+
+
+
+
+     __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("fread_unlocked called with bigger size * nmemb than " "length of destination buffer")))
+                                        ;
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) __attribute__ ((__warn_unused_result__)) size_t
+fread_unlocked (void *__restrict __ptr, size_t __size, size_t __n,
+  FILE *__restrict __stream)
+{
+  if (__builtin_object_size (__ptr, 0) != (size_t) -1)
+    {
+      if (!__builtin_constant_p (__size)
+   || !__builtin_constant_p (__n)
+   || (__size | __n) >= (((size_t) 1) << (8 * sizeof (size_t) / 2)))
+ return __fread_unlocked_chk (__ptr, __builtin_object_size (__ptr, 0), __size, __n,
+         __stream);
+
+      if (__size * __n > __builtin_object_size (__ptr, 0))
+ return __fread_unlocked_chk_warn (__ptr, __builtin_object_size (__ptr, 0), __size, __n,
+       __stream);
+    }
+
+
+  if (__builtin_constant_p (__size)
+      && __builtin_constant_p (__n)
+      && (__size | __n) < (((size_t) 1) << (8 * sizeof (size_t) / 2))
+      && __size * __n <= 8)
+    {
+      size_t __cnt = __size * __n;
+      char *__cptr = (char *) __ptr;
+      if (__cnt == 0)
+ return 0;
+
+      for (; __cnt > 0; --__cnt)
+ {
+   int __c = (__builtin_expect (((__stream)->_IO_read_ptr >= (__stream)->_IO_read_end), 0) ? __uflow (__stream) : *(unsigned char *) (__stream)->_IO_read_ptr++);
+   if (__c == (-1))
+     break;
+   *__cptr++ = __c;
+ }
+      return (__cptr - (char *) __ptr) / __size;
+    }
+
+  return __fread_unlocked_alias (__ptr, __size, __n, __stream);
+}
+
+
+
+
+
+}
+
+extern "C" {
+typedef float LADSPA_Data;
+typedef int LADSPA_Properties;
+typedef int LADSPA_PortDescriptor;
+typedef int LADSPA_PortRangeHintDescriptor;
+typedef struct _LADSPA_PortRangeHint {
+
+
+  LADSPA_PortRangeHintDescriptor HintDescriptor;
+
+
+
+
+  LADSPA_Data LowerBound;
+
+
+
+
+  LADSPA_Data UpperBound;
+
+} LADSPA_PortRangeHint;
+typedef void * LADSPA_Handle;
+typedef struct _LADSPA_Descriptor {
+
+
+
+
+
+  unsigned long UniqueID;
+
+
+
+
+
+
+  const char * Label;
+
+
+  LADSPA_Properties Properties;
+
+
+
+  const char * Name;
+
+
+
+  const char * Maker;
+
+
+
+
+  const char * Copyright;
+
+
+
+  unsigned long PortCount;
+
+
+
+  const LADSPA_PortDescriptor * PortDescriptors;
+
+
+
+
+  const char * const * PortNames;
+
+
+
+  const LADSPA_PortRangeHint * PortRangeHints;
+
+
+
+
+
+
+  void * ImplementationData;
+  LADSPA_Handle (*instantiate)(const struct _LADSPA_Descriptor * Descriptor,
+                               unsigned long SampleRate);
+   void (*connect_port)(LADSPA_Handle Instance,
+                        unsigned long Port,
+                        LADSPA_Data * DataLocation);
+  void (*activate)(LADSPA_Handle Instance);
+  void (*run)(LADSPA_Handle Instance,
+              unsigned long SampleCount);
+  void (*run_adding)(LADSPA_Handle Instance,
+                     unsigned long SampleCount);
+  void (*set_run_adding_gain)(LADSPA_Handle Instance,
+                              LADSPA_Data Gain);
+  void (*deactivate)(LADSPA_Handle Instance);
+  void (*cleanup)(LADSPA_Handle Instance);
+
+} LADSPA_Descriptor;
+const LADSPA_Descriptor * ladspa_descriptor(unsigned long Index);
+
+
+typedef const LADSPA_Descriptor *
+(*LADSPA_Descriptor_Function)(unsigned long Index);
+
+
+
+
+}
+
+
+typedef __int8_t int8;
+typedef __uint8_t uint8;
+typedef __int16_t int16;
+typedef __uint16_t uint16;
+typedef __int32_t int32;
+typedef __uint32_t uint32;
+typedef __int64_t int64;
+typedef __uint64_t uint64;
+typedef struct {
+ const char * name;
+ LADSPA_PortDescriptor descriptor;
+ LADSPA_PortRangeHint range;
+ const char * meta;
+} PortInfo;
+
+typedef LADSPA_Data sample_t;
+typedef unsigned int uint;
+typedef unsigned long ulong;
+
+
+typedef sample_t (*clip_func_t) (sample_t);
+
+
+template <class X, class Y> X min (X x, Y y) { return x < (X)y ? x : (X)y; }
+template <class X, class Y> X max (X x, Y y) { return x > (X)y ? x : (X)y; }
+
+
+template <class T>
+T clamp (T value, T lower, T upper)
+{
+ if (value < lower) return lower;
+ if (value > upper) return upper;
+ return value;
+}
+
+static inline float frandom() { return (float) random() / (float) 
+                                                                 2147483647
+                                                                         ; }
+
+
+inline bool
+is_denormal (float & f)
+{
+ int32 i = *((int32 *) &f);
+ return ((i & 0x7f800000) == 0);
+}
+
+
+inline bool
+is_denormal (double & f)
+{
+ int64 i = *((int64 *) &f);
+ return ((i & 0x7fe0000000000000ll) == 0);
+}
+
+
+
+
+inline uint
+next_power_of_2 (uint n)
+{
+ 
+(static_cast <bool> (
+n <= 0x40000000
+) ? void (0) : __assert_fail (
+"n <= 0x40000000"
+, "basics.h", 151, __extension__ __PRETTY_FUNCTION__))
+                        ;
+
+ --n;
+ n |= n >> 1;
+ n |= n >> 2;
+ n |= n >> 4;
+ n |= n >> 8;
+ n |= n >> 16;
+
+ return ++n;
+}
+
+inline double db2lin (double db) { return pow(10, .05*db); }
+inline double lin2db (double lin) { return 20*log10(lin); }
+class Plugin
+{
+ public:
+  float fs, over_fs;
+  float adding_gain;
+
+  int first_run;
+  sample_t normal;
+
+  sample_t ** ports;
+  LADSPA_PortRangeHint * ranges;
+
+ public:
+
+  inline sample_t getport_unclamped (int i)
+   {
+    sample_t v = *ports[i];
+    return (isinf (v) || isnan(v)) ? 0 : v;
+   }
+
+
+  inline sample_t getport (int i)
+   {
+    LADSPA_PortRangeHint & r = ranges[i];
+    sample_t v = getport_unclamped (i);
+    return clamp (v, r.LowerBound, r.UpperBound);
+   }
+};
+
+namespace DSP {
+
+class complex
+{
+ public:
+  double re, im;
+
+    complex() { }
+
+    complex (double r, double i=0) { re = r; im = i; }
+  void operator = (double r) { re = r; im = 0; }
+
+  double abs() { return sqrt(_squared()); }
+  double _squared() { return re*re + im*im; }
+
+  static inline complex polar (double phi, double mag=1)
+   { return complex (mag*cos(phi), mag*sin(phi)); }
+
+  inline complex exp()
+   {
+    double r = ::exp(re);
+    return complex (r*cos(im), r*sin(im));
+   }
+  inline complex conj()
+   { return complex (re,-im); }
+};
+
+inline complex
+operator * (double a, complex z)
+{
+ z.re *= a;
+ z.im *= a;
+
+ return z;
+}
+
+inline complex
+operator * (complex z1, complex z2)
+{
+ return complex (
+   z1.re * z2.re - z1.im * z2.im,
+   z1.re * z2.im + z1.im * z2.re);
+}
+
+inline complex
+operator / (complex z1, complex z2)
+{
+ double m = z2.re * z2.re + z2.im * z2.im;
+ return complex (
+   ((z1.re * z2.re) + (z1.im * z2.im)) / m,
+   ((z1.re * z2.im) - (z1.im * z2.re)) / m);
+}
+
+inline complex
+operator / (complex z, double a)
+{
+ z.re /= a;
+ z.im /= a;
+
+ return z;
+}
+
+inline void
+operator /= (complex &z, double a)
+{
+ z = z / a;
+}
+
+inline complex
+operator + (complex z1, complex z2)
+{
+ z1.re += z2.re;
+ z1.im += z2.im;
+
+ return z1;
+}
+
+inline complex
+operator - (complex z1, complex z2)
+{
+ z1.re -= z2.re;
+ z1.im -= z2.im;
+
+ return z1;
+}
+
+inline complex
+operator - (complex z)
+{
+ return 0.0 - z;
+}
+
+
+inline complex
+expj (double theta)
+{
+ return complex (cos (theta), sin (theta));
+}
+
+inline double
+hypot (complex z)
+{
+ return ::hypot (z.im, z.re);
+}
+
+}
+
+namespace DSP {
+
+template <class T>
+class IIR2
+{
+ public:
+
+  T a[5], * b;
+
+
+  int h;
+  T x[2], y[2];
+
+  IIR2()
+   {
+    b = a + 2;
+    unity();
+    reset();
+   }
+
+  void unity()
+   {
+    a[0] = 1;
+    a[1] = a[2] = b[1] = b[2] = 0;
+   }
+
+  double gain (double f)
+   {
+    complex w1 = complex::polar(2*
+                                 3.14159265358979323846
+                                     *f);
+    complex w2 = w1*w1;
+    complex n = a[0]*w2 + a[1]*w1 + a[2];
+    complex d = w2 - b[1]*w1 - b[2];
+    return (n/d).abs();
+   }
+
+
+  void scale (double f, double g)
+   {
+    double is = gain(f);
+    if (!is)
+     return;
+    g /= is;
+    a[0] *= g;
+    a[1] *= g;
+    a[2] *= g;
+   }
+
+  void dump()
+   {
+
+
+
+
+   }
+
+  void reset()
+   {
+    h = 0;
+
+    x[0] = x[1] =
+    y[0] = y[1] = 0.;
+   }
+
+
+  void flush_0()
+   {
+    for (int i = 0; i < 2; ++i)
+     if (is_denormal (y[i]))
+      y[i] = 0;
+   }
+
+  inline T process (T s)
+   {
+    register int z = h;
+
+    register T r = s * a[0];
+
+    r += a[1] * x[z];
+    r += b[1] * y[z];
+
+    z ^= 1;
+    r += a[2] * x[z];
+    r += b[2] * y[z];
+
+    y[z] = r;
+    x[z] = s;
+
+    h = z;
+
+    return r;
+   }
+
+  inline T process_bp (T s)
+   {
+    register int z = h;
+
+    register T r = s * a[0];
+
+    r += b[1] * y[z];
+
+    z ^= 1;
+    r += a[2] * x[z];
+    r += b[2] * y[z];
+
+    y[z] = r;
+    x[z] = s;
+
+    h = z;
+
+    return r;
+   }
+
+
+
+
+  inline T process_0_1()
+   {
+    register int z = h;
+
+    register T r = 0;
+
+    r += a[1] * x[z];
+    r += b[1] * y[z];
+
+    z ^= 1;
+    r += a[2] * x[z];
+    r += b[2] * y[z];
+
+    y[z] = r;
+    x[z] = 0;
+
+    h = z;
+
+    return r;
+   }
+
+  inline T process_0_2()
+   {
+    register int z = h;
+
+    register T r = 0;
+
+    r += b[1] * y[z];
+
+    z ^= 1;
+    r += a[2] * x[z];
+    r += b[2] * y[z];
+
+    y[z] = r;
+    x[z] = 0;
+
+    h = z;
+
+    return r;
+   }
+
+  inline T process_0_3()
+   {
+    register int z = h;
+
+    register T r = 0;
+
+    r += b[1] * y[z];
+
+    z ^= 1;
+    r += b[2] * y[z];
+
+    y[z] = r;
+    x[z] = 0;
+
+    h = z;
+
+    return r;
+   }
+};
+
+}
+
+namespace DSP {
+namespace RBJ {
+
+
+class RBJ
+{
+ public:
+  double Q, alpha, sin, cos;
+  double a[3], b[3];
+
+ public:
+  RBJ (double f, double _Q)
+   {
+    Q = _Q;
+
+    double w = 2 * 
+                  3.14159265358979323846 
+                       * f;
+
+    sin = ::sin (w);
+    cos = ::cos (w);
+
+    alpha = sin / (2 * Q);
+   }
+
+
+
+  template <class T>
+  void make_direct_I (T * ca, T * cb)
+   {
+    double a0i = 1 / a[0];
+
+    ca[0] = b[0] * a0i;
+    ca[1] = b[1] * a0i;
+    ca[2] = b[2] * a0i;
+
+
+
+    a0i = -a0i;
+
+    cb[1] = a[1] * a0i;
+    cb[2] = a[2] * a0i;
+   }
+};
+
+
+
+
+class LP
+: public RBJ
+{
+ public:
+  template <class T>
+  LP (double f, double Q, T& filter) : RBJ (f, Q)
+   { ab (filter.a, filter.b); }
+
+  template <class T>
+  void ab (T * ca, T * cb)
+   {
+    b[0] = (1 - cos) * .5;
+    b[1] = (1 - cos);
+    b[2] = (1 - cos) * .5;
+
+    a[0] = 1 + alpha;
+    a[1] = -2 * cos;
+    a[2] = 1 - alpha;
+
+    make_direct_I (ca, cb);
+   }
+};
+
+class BP
+: public RBJ
+{
+ public:
+  template <class T>
+  BP (double f, double Q, T& filter) : RBJ (f, Q)
+   { ab (filter.a, filter.b); }
+
+  template <class T>
+  void ab (T * ca, T * cb)
+   {
+    b[0] = Q * alpha;
+    b[1] = 0;
+    b[2] = -Q * alpha;
+
+    a[0] = 1 + alpha;
+    a[1] = -2 * cos;
+    a[2] = 1 - alpha;
+
+    make_direct_I (ca, cb);
+   }
+};
+
+class HP
+: public RBJ
+{
+ public:
+  template <class T>
+  HP (double f, double Q, T& filter) : RBJ (f, Q)
+   { ab (filter.a, filter.b); }
+
+  template <class T>
+  void ab (T * ca, T * cb)
+   {
+    b[0] = (1 + cos) * .5;
+    b[1] = -(1 + cos);
+    b[2] = (1 + cos) * .5;
+
+    a[0] = 1 + alpha;
+    a[1] = -2 * cos;
+    a[2] = 1 - alpha;
+
+    make_direct_I (ca, cb);
+   }
+};
+
+class Notch
+: public RBJ
+{
+ public:
+  template <class T>
+  Notch (double f, double Q, T& filter) : RBJ (f, Q)
+   { ab (filter.a, filter.b); }
+
+  template <class T>
+  void ab (T * ca, T * cb)
+   {
+    b[0] = 1;
+    b[1] = -2 * cos;
+    b[2] = 1;
+
+    a[0] = 1 + alpha;
+    a[1] = -2 * cos;
+    a[2] = 1 - alpha;
+
+    make_direct_I (ca, cb);
+   }
+};
+
+class AllPass
+: public RBJ
+{
+ public:
+  template <class T>
+  AllPass (double f, double Q, T& filter) : RBJ (f, Q)
+   { ab (filter.a, filter.b); }
+
+  template <class T>
+  void ab (T * ca, T * cb)
+   {
+    b[0] = 1 - alpha;
+    b[1] = -2 * cos;
+    b[2] = 1 + alpha;
+
+    a[0] = 1 + alpha;
+    a[1] = -2 * cos;
+    a[2] = 1 - alpha;
+
+    make_direct_I (ca, cb);
+   }
+};
+
+
+
+
+class PeakShelve
+: public RBJ
+{
+ public:
+  double A, beta;
+
+ public:
+  PeakShelve (double f, double Q, double dB)
+   : RBJ (f, Q)
+   {
+    A = pow (10, dB * .025);
+    double S = Q;
+    beta = sqrt ((A*A + 1)/S - (A-1)*(A-1));
+   }
+};
+
+class LoShelve
+: public PeakShelve
+{
+ public:
+  template <class T>
+  LoShelve (double f, double Q, double dB, T& filter)
+   : PeakShelve (f, Q, dB)
+   { ab (filter.a, filter.b); }
+
+  template <class T>
+  void ab (T * ca, T * cb)
+   {
+    double Ap1 = A+1, Am1 = A-1;
+    double beta = 2*sqrt(A)*alpha;
+
+    b[0] = A*(Ap1 - Am1*cos + beta);
+    b[1] = 2*A*(Am1 - Ap1*cos);
+    b[2] = A*(Ap1 - Am1*cos - beta);
+
+    a[0] = Ap1 + Am1*cos + beta;
+    a[1] = -2 * (Am1 + Ap1*cos);
+    a[2] = Ap1 + Am1*cos - beta;
+
+    make_direct_I (ca, cb);
+   }
+};
+
+class PeakingEQ
+: public PeakShelve
+{
+ public:
+  template <class T>
+  PeakingEQ (double f, double Q, double dB, T& filter)
+   : PeakShelve (f, Q, dB)
+   { ab (filter.a, filter.b); }
+
+  template <class T>
+  void ab (T * ca, T * cb)
+   {
+    b[0] = 1 + alpha * A;
+    b[1] = -2 * cos;
+    b[2] = 1 - alpha * A;
+
+    a[0] = 1 + alpha / A;
+    a[1] = -2 * cos;
+    a[2] = 1 - alpha / A;
+
+    make_direct_I (ca, cb);
+   }
+};
+
+class HiShelve
+: public PeakShelve
+{
+ public:
+  template <class T>
+  HiShelve (double f, double Q, double dB, T& filter)
+   : PeakShelve (f, Q, dB)
+   { ab (filter.a, filter.b); }
+
+  template <class T>
+  void ab (T * ca, T * cb)
+   {
+    double Ap1 = A + 1, Am1 = A - 1;
+    double beta = 2*sqrt(A)*alpha;
+
+    b[0] = A * (Ap1 + Am1 * cos + beta);
+    b[1] = -2 * A * (Am1 + Ap1 * cos);
+    b[2] = A * (Ap1 + Am1 * cos - beta);
+
+    a[0] = Ap1 - Am1 * cos + beta;
+    a[1] = 2 * (Am1 - Ap1 * cos);
+    a[2] = Ap1 - Am1 * cos - beta;
+
+    make_direct_I (ca, cb);
+   }
+};
+
+}
+}
+namespace DSP {
+
+inline float pow2 (float x) { return x * x; }
+inline float pow3 (float x) { return x * pow2(x); }
+inline float pow4 (float x) { return pow2 (pow2(x)); }
+inline float pow5 (float x) { return x * pow4(x); }
+inline float pow6 (float x) { return pow3 (pow2(x)); }
+inline float pow7 (float x) { return x * (pow6 (x)); }
+inline float pow8 (float x) { return pow2 (pow4 (x)); }
+
+inline float
+sgn (float x)
+{
+ union { float f; uint32 i; } u;
+ u.f = x;
+ u.i &= 0x80000000;
+ u.i |= 0x3F800000;
+ return u.f;
+}
+
+inline bool
+isprime (int v)
+{
+ if (v <= 3)
+  return true;
+
+ if (!(v & 1))
+  return false;
+
+ for (int i = 3; i < (int) sqrt (v) + 1; i += 2)
+  if ((v % i) == 0)
+   return false;
+
+ return true;
+}
+
+}
+
+namespace DSP {
+
+
+
+
+class FIR
+{
+ public:
+
+  uint n, m;
+
+
+  sample_t * c, * x;
+
+
+  int h;
+
+  FIR() { c = x = 0; }
+  ~FIR() { free(c); free(x); }
+
+  void init (uint N)
+   {
+    n = N;
+
+
+
+    m = next_power_of_2 (n);
+
+    c = (sample_t *) malloc (n * sizeof (sample_t));
+    x = (sample_t *) malloc (m * sizeof (sample_t));
+
+    m -= 1;
+
+    reset();
+   }
+
+  void reset()
+   {
+    h = 0;
+    memset (x, 0, n * sizeof (sample_t));
+   }
+
+  inline sample_t process (sample_t s)
+   {
+    x[h] = s;
+
+    s *= c[0];
+
+    for (uint Z = 1, z = h - 1; Z < n; --z, ++Z)
+     s += c[Z] * x[z & m];
+
+    h = (h + 1) & m;
+
+    return s;
+   }
+
+
+
+
+
+  template <uint Z, uint OVER>
+  inline sample_t upsample (sample_t s)
+   {
+    x[h] = s;
+
+    s = 0;
+
+
+
+
+    for (uint j = Z, z = h - Z; j < n; --z, j += OVER)
+     s += c[j] * x[z & m];
+
+    h = (h + 1) & m;
+
+    return s;
+   }
+
+
+  inline void store (sample_t s)
+   {
+    x[h] = s;
+    h = (h + 1) & m;
+   }
+};
+
+
+template <int N, int Oversample>
+class FIRUpsampler
+{
+ public:
+  uint m;
+  int h;
+
+  sample_t * c, * x;
+
+  FIRUpsampler()
+   {
+    c = x = 0;
+    init();
+   }
+
+  ~FIRUpsampler()
+   {
+    if (c) free (c);
+    if (x) free (x);
+   }
+
+  void init()
+   {
+
+    
+   (static_cast <bool> (
+   N % Oversample == 0
+   ) ? void (0) : __assert_fail (
+   "N % Oversample == 0"
+   , "dsp/FIR.h", 152, __extension__ __PRETTY_FUNCTION__))
+                               ;
+
+
+
+    m = next_power_of_2 ((N + Oversample - 1) / Oversample);
+
+    c = (sample_t *) malloc (N * sizeof (sample_t));
+    x = (sample_t *) malloc (m * sizeof (sample_t));
+
+    m -= 1;
+
+    reset();
+   }
+
+  void reset()
+   {
+    h = 0;
+    memset (x, 0, (m + 1) * sizeof (sample_t));
+   }
+
+
+  inline sample_t upsample (sample_t s)
+   {
+    x[h] = s;
+
+    s = 0;
+
+    for (uint Z = 0, z = h; Z < N; --z, Z += Oversample)
+     s += c[Z] * x[z & m];
+
+    h = (h + 1) & m;
+
+    return s;
+   }
+
+
+
+  inline sample_t pad (uint Z)
+   {
+    sample_t s = 0;
+
+    for (uint z = h-1; Z < N; --z, Z += Oversample)
+     s += c[Z] * x[z & m];
+
+    return s;
+   }
+
+};
+
+
+
+template <int N>
+class FIRn
+{
+ public:
+
+  uint m;
+
+
+  sample_t c[N], x[N];
+
+
+  int h;
+
+  FIRn()
+   {
+
+
+    m = next_power_of_2 (N) - 1;
+
+    reset();
+   }
+
+  void reset()
+   {
+    h = 0;
+    memset (x, 0, N * sizeof (sample_t));
+   }
+
+  inline sample_t process (sample_t s)
+   {
+    x[h] = s;
+
+    s *= c[0];
+
+    for (uint Z = 1, z = h - 1; Z < N; --z, ++Z)
+     s += c[Z] * x[z & m];
+
+    h = (h + 1) & m;
+
+    return s;
+   }
+
+
+  inline void store (sample_t s)
+   {
+    x[h] = s;
+    h = (h + 1) & m;
+   }
+};
+
+}
+namespace DSP {
+
+class Sine
+{
+ public:
+  int z;
+  double y[2];
+  double b;
+
+ public:
+  Sine()
+   {
+    b = 0;
+    y[0] = y[1] = 0;
+    z = 0;
+   }
+
+  Sine (double f, double fs, double phase)
+   {
+    set_f (f, fs, phase);
+   }
+
+  Sine (double w, double phase = 0.)
+   {
+    set_f (w, phase);
+   }
+
+  inline void set_f (double f, double fs, double phase)
+   {
+    set_f (f*2*
+              3.14159265358979323846
+                  /fs, phase);
+   }
+
+  inline void set_f (double w, double phase)
+   {
+    b = 2*cos(w);
+    y[0] = sin (phase - w);
+    y[1] = sin (phase - 2*w);
+    z = 0;
+   }
+
+
+  inline double get()
+   {
+    register double s = b*y[z];
+    z ^= 1;
+    s -= y[z];
+    return y[z] = s;
+   }
+
+  double get_phase()
+   {
+    double x0 = y[z], x1 = b*y[z] - y[z^1];
+    double phi = asin(x0);
+
+
+    return x1 < x0 ? 
+                    3.14159265358979323846 
+                         - phi : phi;
+   }
+};
+
+
+class DampedSine
+: public Sine
+{
+ public:
+  double d;
+
+ public:
+  DampedSine()
+   { d = 1; }
+
+  inline double get()
+   {
+    register double s = b * y[z];
+    z ^= 1;
+    s -= d * y[z];
+    return y[z] = d * s;
+   }
+};
+
+}
+
+namespace DSP {
+
+
+
+inline void
+sinc (double omega, sample_t * s, int n)
+{
+
+ double phi = (n / 2) * -omega;
+
+ Sine sine (omega, phi);
+
+ for (int i = 0; i < n; ++i, phi += omega)
+ {
+  double sin_phi = sine.get();
+
+  if (fabs (phi) < 0.000000001)
+   s[i] = 1.;
+  else
+   s[i] = sin_phi / phi;
+ }
+}
+
+}
+namespace DSP {
+
+
+typedef void (*window_sample_func_t) (sample_t &, sample_t);
+
+
+inline void
+store_sample (sample_t & d, sample_t s)
+{
+ d = s;
+}
+
+inline void
+apply_window (sample_t &d, sample_t s)
+{
+ d *= s;
+}
+
+template <window_sample_func_t F>
+void
+hann (sample_t * s, int n, double step = 1)
+{
+ step = step / n;
+
+ for (int i = 0; i < n; ++i)
+ {
+  register double f = i * step;
+  F (s[i], .5 - .5 * cos (2 * 
+                             3.14159265358979323846 
+                                  * f));
+ }
+}
+
+template <window_sample_func_t F>
+void
+hamming (sample_t * s, int n)
+{
+ register float in = 1. / n;
+
+ for (int i = 0; i < n; ++i)
+ {
+  register double f = i * in;
+  F (s[i], .54 - .46 * cos (2 * 
+                               3.14159265358979323846 
+                                    * f));
+ }
+}
+
+template <window_sample_func_t F>
+void
+blackman (sample_t * s, int n)
+{
+ register float in = 1. / n;
+
+ for (int i = 0; i < n; ++i)
+ {
+  register float f = (float) i;
+
+  register double b = .42f -
+      .5f * cos (2.f * f * 
+                          3.14159265358979323846 
+                               * in) +
+      .08 * cos (4.f * f * 
+                          3.14159265358979323846 
+                               * in);
+
+  F (s[i], b);
+ }
+}
+
+template <window_sample_func_t F>
+void
+blackman_harris (sample_t * s, int n)
+{
+ register double w1 = 2.f * 
+                           3.14159265358979323846 
+                                / (n - 1);
+ register double w2 = 2.f * w1;
+ register double w3 = 3.f * w1;
+
+ for (int i = 0; i < n; ++i)
+ {
+  register double f = (double) i;
+
+  register double bh = .35875f -
+    .48829f * cos (w1 * f) +
+    .14128f * cos (w2 * f) -
+    .01168f * cos (w3 * f);
+
+  F (s[i], bh);
+ }
+}
+
+
+inline double
+besseli (double x)
+{
+ double ax, ans;
+ double y;
+
+ if ((ax = fabs (x)) < 3.75)
+ {
+  y = x / 3.75;
+  y *= y;
+  ans = (1.0 + y * (3.5156229 +
+   y * (3.0899424 +
+    y * (1.2067492 +
+     y * (0.2659732 +
+      y * (0.360768e-1 +
+       y * 0.45813e-2))))));
+ }
+ else
+ {
+  y = 3.75 / ax;
+  ans = ((exp (ax) / sqrt (ax))
+   * (0.39894228 +
+    y * (0.1328592e-1 +
+     y * (0.225319e-2 +
+      y * (-0.157565e-2 +
+       y * (0.916281e-2 +
+        y * (-0.2057706e-1 +
+         y * (0.2635537e-1 +
+          y * (-0.1647633e-1 +
+           y * 0.392377e-2)))))))));
+ }
+
+ return ans;
+}
+
+
+template <window_sample_func_t F>
+void
+kaiser (sample_t * s, int n, double beta, double step = 1)
+{
+ double bb = besseli (beta);
+ int si = 0;
+
+ for (double i = -n / 2 + .1; si < n; ++si, i += step)
+ {
+  double k = besseli ((beta * sqrt (1 - pow ((2 * i / (n - 1)), 2)))) / bb;
+
+
+  if (!finite (k) || isnan(k))
+   k = 0;
+
+  F (s[si], k);
+ }
+}
+
+template <window_sample_func_t F>
+void
+xfade (sample_t * s, int n, int dir)
+{
+ DSP::Sine cos(.5*
+                 3.14159265358979323846
+                     /n, 0);
+ if (dir > 0)
+  for (int i=0; i<n; ++i)
+   s[i] *= cos.get();
+ else
+  for (int i=n; --i>=0; )
+   s[i] *= cos.get();
+}
+
+}
+
+namespace DSP {
+
+
+
+class NoOversampler
+{
+ public:
+  enum { Ratio = 1 };
+  sample_t downsample (sample_t x) { return x; }
+  sample_t upsample (sample_t x) { return x; }
+  void downstore (sample_t x) { }
+  sample_t uppad (uint z) { return 0; }
+};
+
+template <int Oversample, int FIRSize>
+class Oversampler
+{
+ public:
+  enum { Ratio = Oversample };
+
+  struct {
+   DSP::FIRUpsampler<FIRSize, Oversample> up;
+   DSP::FIRn<FIRSize> down;
+  } fir;
+
+  Oversampler()
+   { init(); }
+
+  void init (float fc = .5)
+   {
+    double f = fc * 
+                   3.14159265358979323846 
+                        / Oversample;
+
+
+    DSP::sinc (f, fir.up.c, FIRSize);
+    DSP::kaiser<DSP::apply_window> (fir.up.c, FIRSize, 6.4);
+
+
+    double s = 0;
+    for (uint i = 0; i < FIRSize; ++i)
+     fir.down.c[i] = fir.up.c[i],
+     s += fir.up.c[i];
+
+
+    s = 1/s;
+    for (uint i = 0; i < FIRSize; ++i)
+     fir.down.c[i] *= s;
+
+
+    s *= Oversample;
+    for (uint i = 0; i < FIRSize; ++i)
+     fir.up.c[i] *= s;
+   }
+
+  void reset()
+   {
+    fir.up.reset();
+    fir.down.reset();
+   }
+
+  inline sample_t upsample(sample_t x)
+   { return fir.up.upsample(x); }
+  inline sample_t uppad(uint z)
+   { return fir.up.pad(z); }
+
+  inline sample_t downsample(sample_t x)
+   { return fir.down.process(x); }
+  inline void downstore(sample_t x)
+   { fir.down.store(x); }
+};
+
+}
+
+typedef int __m64 __attribute__ ((__vector_size__ (8), __may_alias__));
+
+
+typedef int __m64_u __attribute__ ((__vector_size__ (8), __may_alias__, __aligned__ (1)));
+
+
+typedef int __v2si __attribute__ ((__vector_size__ (8)));
+typedef short __v4hi __attribute__ ((__vector_size__ (8)));
+typedef char __v8qi __attribute__ ((__vector_size__ (8)));
+typedef long long __v1di __attribute__ ((__vector_size__ (8)));
+typedef float __v2sf __attribute__ ((__vector_size__ (8)));
+
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_empty (void)
+{
+  __builtin_ia32_emms ();
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_empty (void)
+{
+  _mm_empty ();
+}
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtsi32_si64 (int __i)
+{
+  return (__m64) __builtin_ia32_vec_init_v2si (__i, 0);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_from_int (int __i)
+{
+  return _mm_cvtsi32_si64 (__i);
+}
+
+
+
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_from_int64 (long long __i)
+{
+  return (__m64) __i;
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtsi64_m64 (long long __i)
+{
+  return (__m64) __i;
+}
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtsi64x_si64 (long long __i)
+{
+  return (__m64) __i;
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_set_pi64x (long long __i)
+{
+  return (__m64) __i;
+}
+
+
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtsi64_si32 (__m64 __i)
+{
+  return __builtin_ia32_vec_ext_v2si ((__v2si)__i, 0);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_to_int (__m64 __i)
+{
+  return _mm_cvtsi64_si32 (__i);
+}
+
+
+
+
+
+extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_to_int64 (__m64 __i)
+{
+  return (long long)__i;
+}
+
+extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtm64_si64 (__m64 __i)
+{
+  return (long long)__i;
+}
+
+
+extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtsi64_si64x (__m64 __i)
+{
+  return (long long)__i;
+}
+
+
+
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_packs_pi16 (__m64 __m1, __m64 __m2)
+{
+  return (__m64) __builtin_ia32_packsswb ((__v4hi)__m1, (__v4hi)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_packsswb (__m64 __m1, __m64 __m2)
+{
+  return _mm_packs_pi16 (__m1, __m2);
+}
+
+
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_packs_pi32 (__m64 __m1, __m64 __m2)
+{
+  return (__m64) __builtin_ia32_packssdw ((__v2si)__m1, (__v2si)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_packssdw (__m64 __m1, __m64 __m2)
+{
+  return _mm_packs_pi32 (__m1, __m2);
+}
+
+
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_packs_pu16 (__m64 __m1, __m64 __m2)
+{
+  return (__m64) __builtin_ia32_packuswb ((__v4hi)__m1, (__v4hi)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_packuswb (__m64 __m1, __m64 __m2)
+{
+  return _mm_packs_pu16 (__m1, __m2);
+}
+
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_unpackhi_pi8 (__m64 __m1, __m64 __m2)
+{
+  return (__m64) __builtin_ia32_punpckhbw ((__v8qi)__m1, (__v8qi)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_punpckhbw (__m64 __m1, __m64 __m2)
+{
+  return _mm_unpackhi_pi8 (__m1, __m2);
+}
+
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_unpackhi_pi16 (__m64 __m1, __m64 __m2)
+{
+  return (__m64) __builtin_ia32_punpckhwd ((__v4hi)__m1, (__v4hi)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_punpckhwd (__m64 __m1, __m64 __m2)
+{
+  return _mm_unpackhi_pi16 (__m1, __m2);
+}
+
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_unpackhi_pi32 (__m64 __m1, __m64 __m2)
+{
+  return (__m64) __builtin_ia32_punpckhdq ((__v2si)__m1, (__v2si)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_punpckhdq (__m64 __m1, __m64 __m2)
+{
+  return _mm_unpackhi_pi32 (__m1, __m2);
+}
+
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_unpacklo_pi8 (__m64 __m1, __m64 __m2)
+{
+  return (__m64) __builtin_ia32_punpcklbw ((__v8qi)__m1, (__v8qi)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_punpcklbw (__m64 __m1, __m64 __m2)
+{
+  return _mm_unpacklo_pi8 (__m1, __m2);
+}
+
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_unpacklo_pi16 (__m64 __m1, __m64 __m2)
+{
+  return (__m64) __builtin_ia32_punpcklwd ((__v4hi)__m1, (__v4hi)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_punpcklwd (__m64 __m1, __m64 __m2)
+{
+  return _mm_unpacklo_pi16 (__m1, __m2);
+}
+
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_unpacklo_pi32 (__m64 __m1, __m64 __m2)
+{
+  return (__m64) __builtin_ia32_punpckldq ((__v2si)__m1, (__v2si)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_punpckldq (__m64 __m1, __m64 __m2)
+{
+  return _mm_unpacklo_pi32 (__m1, __m2);
+}
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_add_pi8 (__m64 __m1, __m64 __m2)
+{
+  return (__m64) __builtin_ia32_paddb ((__v8qi)__m1, (__v8qi)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_paddb (__m64 __m1, __m64 __m2)
+{
+  return _mm_add_pi8 (__m1, __m2);
+}
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_add_pi16 (__m64 __m1, __m64 __m2)
+{
+  return (__m64) __builtin_ia32_paddw ((__v4hi)__m1, (__v4hi)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_paddw (__m64 __m1, __m64 __m2)
+{
+  return _mm_add_pi16 (__m1, __m2);
+}
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_add_pi32 (__m64 __m1, __m64 __m2)
+{
+  return (__m64) __builtin_ia32_paddd ((__v2si)__m1, (__v2si)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_paddd (__m64 __m1, __m64 __m2)
+{
+  return _mm_add_pi32 (__m1, __m2);
+}
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_add_si64 (__m64 __m1, __m64 __m2)
+{
+  return (__m64) __builtin_ia32_paddq ((__v1di)__m1, (__v1di)__m2);
+}
+
+
+
+
+
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_adds_pi8 (__m64 __m1, __m64 __m2)
+{
+  return (__m64) __builtin_ia32_paddsb ((__v8qi)__m1, (__v8qi)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_paddsb (__m64 __m1, __m64 __m2)
+{
+  return _mm_adds_pi8 (__m1, __m2);
+}
+
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_adds_pi16 (__m64 __m1, __m64 __m2)
+{
+  return (__m64) __builtin_ia32_paddsw ((__v4hi)__m1, (__v4hi)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_paddsw (__m64 __m1, __m64 __m2)
+{
+  return _mm_adds_pi16 (__m1, __m2);
+}
+
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_adds_pu8 (__m64 __m1, __m64 __m2)
+{
+  return (__m64) __builtin_ia32_paddusb ((__v8qi)__m1, (__v8qi)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_paddusb (__m64 __m1, __m64 __m2)
+{
+  return _mm_adds_pu8 (__m1, __m2);
+}
+
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_adds_pu16 (__m64 __m1, __m64 __m2)
+{
+  return (__m64) __builtin_ia32_paddusw ((__v4hi)__m1, (__v4hi)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_paddusw (__m64 __m1, __m64 __m2)
+{
+  return _mm_adds_pu16 (__m1, __m2);
+}
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sub_pi8 (__m64 __m1, __m64 __m2)
+{
+  return (__m64) __builtin_ia32_psubb ((__v8qi)__m1, (__v8qi)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_psubb (__m64 __m1, __m64 __m2)
+{
+  return _mm_sub_pi8 (__m1, __m2);
+}
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sub_pi16 (__m64 __m1, __m64 __m2)
+{
+  return (__m64) __builtin_ia32_psubw ((__v4hi)__m1, (__v4hi)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_psubw (__m64 __m1, __m64 __m2)
+{
+  return _mm_sub_pi16 (__m1, __m2);
+}
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sub_pi32 (__m64 __m1, __m64 __m2)
+{
+  return (__m64) __builtin_ia32_psubd ((__v2si)__m1, (__v2si)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_psubd (__m64 __m1, __m64 __m2)
+{
+  return _mm_sub_pi32 (__m1, __m2);
+}
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sub_si64 (__m64 __m1, __m64 __m2)
+{
+  return (__m64) __builtin_ia32_psubq ((__v1di)__m1, (__v1di)__m2);
+}
+
+
+
+
+
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_subs_pi8 (__m64 __m1, __m64 __m2)
+{
+  return (__m64) __builtin_ia32_psubsb ((__v8qi)__m1, (__v8qi)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_psubsb (__m64 __m1, __m64 __m2)
+{
+  return _mm_subs_pi8 (__m1, __m2);
+}
+
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_subs_pi16 (__m64 __m1, __m64 __m2)
+{
+  return (__m64) __builtin_ia32_psubsw ((__v4hi)__m1, (__v4hi)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_psubsw (__m64 __m1, __m64 __m2)
+{
+  return _mm_subs_pi16 (__m1, __m2);
+}
+
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_subs_pu8 (__m64 __m1, __m64 __m2)
+{
+  return (__m64) __builtin_ia32_psubusb ((__v8qi)__m1, (__v8qi)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_psubusb (__m64 __m1, __m64 __m2)
+{
+  return _mm_subs_pu8 (__m1, __m2);
+}
+
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_subs_pu16 (__m64 __m1, __m64 __m2)
+{
+  return (__m64) __builtin_ia32_psubusw ((__v4hi)__m1, (__v4hi)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_psubusw (__m64 __m1, __m64 __m2)
+{
+  return _mm_subs_pu16 (__m1, __m2);
+}
+
+
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_madd_pi16 (__m64 __m1, __m64 __m2)
+{
+  return (__m64) __builtin_ia32_pmaddwd ((__v4hi)__m1, (__v4hi)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pmaddwd (__m64 __m1, __m64 __m2)
+{
+  return _mm_madd_pi16 (__m1, __m2);
+}
+
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_mulhi_pi16 (__m64 __m1, __m64 __m2)
+{
+  return (__m64) __builtin_ia32_pmulhw ((__v4hi)__m1, (__v4hi)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pmulhw (__m64 __m1, __m64 __m2)
+{
+  return _mm_mulhi_pi16 (__m1, __m2);
+}
+
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_mullo_pi16 (__m64 __m1, __m64 __m2)
+{
+  return (__m64) __builtin_ia32_pmullw ((__v4hi)__m1, (__v4hi)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pmullw (__m64 __m1, __m64 __m2)
+{
+  return _mm_mullo_pi16 (__m1, __m2);
+}
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sll_pi16 (__m64 __m, __m64 __count)
+{
+  return (__m64) __builtin_ia32_psllw ((__v4hi)__m, (__v4hi)__count);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_psllw (__m64 __m, __m64 __count)
+{
+  return _mm_sll_pi16 (__m, __count);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_slli_pi16 (__m64 __m, int __count)
+{
+  return (__m64) __builtin_ia32_psllwi ((__v4hi)__m, __count);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_psllwi (__m64 __m, int __count)
+{
+  return _mm_slli_pi16 (__m, __count);
+}
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sll_pi32 (__m64 __m, __m64 __count)
+{
+  return (__m64) __builtin_ia32_pslld ((__v2si)__m, (__v2si)__count);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pslld (__m64 __m, __m64 __count)
+{
+  return _mm_sll_pi32 (__m, __count);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_slli_pi32 (__m64 __m, int __count)
+{
+  return (__m64) __builtin_ia32_pslldi ((__v2si)__m, __count);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pslldi (__m64 __m, int __count)
+{
+  return _mm_slli_pi32 (__m, __count);
+}
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sll_si64 (__m64 __m, __m64 __count)
+{
+  return (__m64) __builtin_ia32_psllq ((__v1di)__m, (__v1di)__count);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_psllq (__m64 __m, __m64 __count)
+{
+  return _mm_sll_si64 (__m, __count);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_slli_si64 (__m64 __m, int __count)
+{
+  return (__m64) __builtin_ia32_psllqi ((__v1di)__m, __count);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_psllqi (__m64 __m, int __count)
+{
+  return _mm_slli_si64 (__m, __count);
+}
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sra_pi16 (__m64 __m, __m64 __count)
+{
+  return (__m64) __builtin_ia32_psraw ((__v4hi)__m, (__v4hi)__count);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_psraw (__m64 __m, __m64 __count)
+{
+  return _mm_sra_pi16 (__m, __count);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_srai_pi16 (__m64 __m, int __count)
+{
+  return (__m64) __builtin_ia32_psrawi ((__v4hi)__m, __count);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_psrawi (__m64 __m, int __count)
+{
+  return _mm_srai_pi16 (__m, __count);
+}
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sra_pi32 (__m64 __m, __m64 __count)
+{
+  return (__m64) __builtin_ia32_psrad ((__v2si)__m, (__v2si)__count);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_psrad (__m64 __m, __m64 __count)
+{
+  return _mm_sra_pi32 (__m, __count);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_srai_pi32 (__m64 __m, int __count)
+{
+  return (__m64) __builtin_ia32_psradi ((__v2si)__m, __count);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_psradi (__m64 __m, int __count)
+{
+  return _mm_srai_pi32 (__m, __count);
+}
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_srl_pi16 (__m64 __m, __m64 __count)
+{
+  return (__m64) __builtin_ia32_psrlw ((__v4hi)__m, (__v4hi)__count);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_psrlw (__m64 __m, __m64 __count)
+{
+  return _mm_srl_pi16 (__m, __count);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_srli_pi16 (__m64 __m, int __count)
+{
+  return (__m64) __builtin_ia32_psrlwi ((__v4hi)__m, __count);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_psrlwi (__m64 __m, int __count)
+{
+  return _mm_srli_pi16 (__m, __count);
+}
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_srl_pi32 (__m64 __m, __m64 __count)
+{
+  return (__m64) __builtin_ia32_psrld ((__v2si)__m, (__v2si)__count);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_psrld (__m64 __m, __m64 __count)
+{
+  return _mm_srl_pi32 (__m, __count);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_srli_pi32 (__m64 __m, int __count)
+{
+  return (__m64) __builtin_ia32_psrldi ((__v2si)__m, __count);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_psrldi (__m64 __m, int __count)
+{
+  return _mm_srli_pi32 (__m, __count);
+}
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_srl_si64 (__m64 __m, __m64 __count)
+{
+  return (__m64) __builtin_ia32_psrlq ((__v1di)__m, (__v1di)__count);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_psrlq (__m64 __m, __m64 __count)
+{
+  return _mm_srl_si64 (__m, __count);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_srli_si64 (__m64 __m, int __count)
+{
+  return (__m64) __builtin_ia32_psrlqi ((__v1di)__m, __count);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_psrlqi (__m64 __m, int __count)
+{
+  return _mm_srli_si64 (__m, __count);
+}
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_and_si64 (__m64 __m1, __m64 __m2)
+{
+  return __builtin_ia32_pand (__m1, __m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pand (__m64 __m1, __m64 __m2)
+{
+  return _mm_and_si64 (__m1, __m2);
+}
+
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_andnot_si64 (__m64 __m1, __m64 __m2)
+{
+  return __builtin_ia32_pandn (__m1, __m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pandn (__m64 __m1, __m64 __m2)
+{
+  return _mm_andnot_si64 (__m1, __m2);
+}
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_or_si64 (__m64 __m1, __m64 __m2)
+{
+  return __builtin_ia32_por (__m1, __m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_por (__m64 __m1, __m64 __m2)
+{
+  return _mm_or_si64 (__m1, __m2);
+}
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_xor_si64 (__m64 __m1, __m64 __m2)
+{
+  return __builtin_ia32_pxor (__m1, __m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pxor (__m64 __m1, __m64 __m2)
+{
+  return _mm_xor_si64 (__m1, __m2);
+}
+
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpeq_pi8 (__m64 __m1, __m64 __m2)
+{
+  return (__m64) __builtin_ia32_pcmpeqb ((__v8qi)__m1, (__v8qi)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pcmpeqb (__m64 __m1, __m64 __m2)
+{
+  return _mm_cmpeq_pi8 (__m1, __m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpgt_pi8 (__m64 __m1, __m64 __m2)
+{
+  return (__m64) __builtin_ia32_pcmpgtb ((__v8qi)__m1, (__v8qi)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pcmpgtb (__m64 __m1, __m64 __m2)
+{
+  return _mm_cmpgt_pi8 (__m1, __m2);
+}
+
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpeq_pi16 (__m64 __m1, __m64 __m2)
+{
+  return (__m64) __builtin_ia32_pcmpeqw ((__v4hi)__m1, (__v4hi)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pcmpeqw (__m64 __m1, __m64 __m2)
+{
+  return _mm_cmpeq_pi16 (__m1, __m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpgt_pi16 (__m64 __m1, __m64 __m2)
+{
+  return (__m64) __builtin_ia32_pcmpgtw ((__v4hi)__m1, (__v4hi)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pcmpgtw (__m64 __m1, __m64 __m2)
+{
+  return _mm_cmpgt_pi16 (__m1, __m2);
+}
+
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpeq_pi32 (__m64 __m1, __m64 __m2)
+{
+  return (__m64) __builtin_ia32_pcmpeqd ((__v2si)__m1, (__v2si)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pcmpeqd (__m64 __m1, __m64 __m2)
+{
+  return _mm_cmpeq_pi32 (__m1, __m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpgt_pi32 (__m64 __m1, __m64 __m2)
+{
+  return (__m64) __builtin_ia32_pcmpgtd ((__v2si)__m1, (__v2si)__m2);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pcmpgtd (__m64 __m1, __m64 __m2)
+{
+  return _mm_cmpgt_pi32 (__m1, __m2);
+}
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_setzero_si64 (void)
+{
+  return (__m64)0LL;
+}
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_set_pi32 (int __i1, int __i0)
+{
+  return (__m64) __builtin_ia32_vec_init_v2si (__i0, __i1);
+}
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_set_pi16 (short __w3, short __w2, short __w1, short __w0)
+{
+  return (__m64) __builtin_ia32_vec_init_v4hi (__w0, __w1, __w2, __w3);
+}
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_set_pi8 (char __b7, char __b6, char __b5, char __b4,
+      char __b3, char __b2, char __b1, char __b0)
+{
+  return (__m64) __builtin_ia32_vec_init_v8qi (__b0, __b1, __b2, __b3,
+            __b4, __b5, __b6, __b7);
+}
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_setr_pi32 (int __i0, int __i1)
+{
+  return _mm_set_pi32 (__i1, __i0);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_setr_pi16 (short __w0, short __w1, short __w2, short __w3)
+{
+  return _mm_set_pi16 (__w3, __w2, __w1, __w0);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_setr_pi8 (char __b0, char __b1, char __b2, char __b3,
+       char __b4, char __b5, char __b6, char __b7)
+{
+  return _mm_set_pi8 (__b7, __b6, __b5, __b4, __b3, __b2, __b1, __b0);
+}
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_set1_pi32 (int __i)
+{
+  return _mm_set_pi32 (__i, __i);
+}
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_set1_pi16 (short __w)
+{
+  return _mm_set_pi16 (__w, __w, __w, __w);
+}
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_set1_pi8 (char __b)
+{
+  return _mm_set_pi8 (__b, __b, __b, __b, __b, __b, __b, __b);
+}
+
+
+
+
+
+
+
+
+extern "C" int posix_memalign (void **, size_t, size_t) throw ();
+
+
+static __inline void *
+_mm_malloc (size_t __size, size_t __alignment)
+{
+  void *__ptr;
+  if (__alignment == 1)
+    return malloc (__size);
+  if (__alignment == 2 || (sizeof (void *) == 8 && __alignment == 4))
+    __alignment = sizeof (void *);
+  if (posix_memalign (&__ptr, __alignment, __size) == 0)
+    return __ptr;
+  else
+    return __null;
+}
+
+static __inline void
+_mm_free (void *__ptr)
+{
+  free (__ptr);
+}
+
+
+enum _mm_hint
+{
+
+  _MM_HINT_ET0 = 7,
+  _MM_HINT_ET1 = 6,
+  _MM_HINT_T0 = 3,
+  _MM_HINT_T1 = 2,
+  _MM_HINT_T2 = 1,
+  _MM_HINT_NTA = 0
+};
+
+
+
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_prefetch (const void *__P, enum _mm_hint __I)
+{
+  __builtin_prefetch (__P, (__I & 0x4) >> 2, __I & 0x3);
+}
+typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__));
+
+
+typedef float __m128_u __attribute__ ((__vector_size__ (16), __may_alias__, __aligned__ (1)));
+
+
+typedef float __v4sf __attribute__ ((__vector_size__ (16)));
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_undefined_ps (void)
+{
+  __m128 __Y = __Y;
+  return __Y;
+}
+
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_setzero_ps (void)
+{
+  return __extension__ (__m128){ 0.0f, 0.0f, 0.0f, 0.0f };
+}
+
+
+
+
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_add_ss (__m128 __A, __m128 __B)
+{
+  return (__m128) __builtin_ia32_addss ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sub_ss (__m128 __A, __m128 __B)
+{
+  return (__m128) __builtin_ia32_subss ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_mul_ss (__m128 __A, __m128 __B)
+{
+  return (__m128) __builtin_ia32_mulss ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_div_ss (__m128 __A, __m128 __B)
+{
+  return (__m128) __builtin_ia32_divss ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sqrt_ss (__m128 __A)
+{
+  return (__m128) __builtin_ia32_sqrtss ((__v4sf)__A);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_rcp_ss (__m128 __A)
+{
+  return (__m128) __builtin_ia32_rcpss ((__v4sf)__A);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_rsqrt_ss (__m128 __A)
+{
+  return (__m128) __builtin_ia32_rsqrtss ((__v4sf)__A);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_min_ss (__m128 __A, __m128 __B)
+{
+  return (__m128) __builtin_ia32_minss ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_max_ss (__m128 __A, __m128 __B)
+{
+  return (__m128) __builtin_ia32_maxss ((__v4sf)__A, (__v4sf)__B);
+}
+
+
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_add_ps (__m128 __A, __m128 __B)
+{
+  return (__m128) ((__v4sf)__A + (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sub_ps (__m128 __A, __m128 __B)
+{
+  return (__m128) ((__v4sf)__A - (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_mul_ps (__m128 __A, __m128 __B)
+{
+  return (__m128) ((__v4sf)__A * (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_div_ps (__m128 __A, __m128 __B)
+{
+  return (__m128) ((__v4sf)__A / (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sqrt_ps (__m128 __A)
+{
+  return (__m128) __builtin_ia32_sqrtps ((__v4sf)__A);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_rcp_ps (__m128 __A)
+{
+  return (__m128) __builtin_ia32_rcpps ((__v4sf)__A);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_rsqrt_ps (__m128 __A)
+{
+  return (__m128) __builtin_ia32_rsqrtps ((__v4sf)__A);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_min_ps (__m128 __A, __m128 __B)
+{
+  return (__m128) __builtin_ia32_minps ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_max_ps (__m128 __A, __m128 __B)
+{
+  return (__m128) __builtin_ia32_maxps ((__v4sf)__A, (__v4sf)__B);
+}
+
+
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_and_ps (__m128 __A, __m128 __B)
+{
+  return __builtin_ia32_andps (__A, __B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_andnot_ps (__m128 __A, __m128 __B)
+{
+  return __builtin_ia32_andnps (__A, __B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_or_ps (__m128 __A, __m128 __B)
+{
+  return __builtin_ia32_orps (__A, __B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_xor_ps (__m128 __A, __m128 __B)
+{
+  return __builtin_ia32_xorps (__A, __B);
+}
+
+
+
+
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpeq_ss (__m128 __A, __m128 __B)
+{
+  return (__m128) __builtin_ia32_cmpeqss ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmplt_ss (__m128 __A, __m128 __B)
+{
+  return (__m128) __builtin_ia32_cmpltss ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmple_ss (__m128 __A, __m128 __B)
+{
+  return (__m128) __builtin_ia32_cmpless ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpgt_ss (__m128 __A, __m128 __B)
+{
+  return (__m128) __builtin_ia32_movss ((__v4sf) __A,
+     (__v4sf)
+     __builtin_ia32_cmpltss ((__v4sf) __B,
+        (__v4sf)
+        __A));
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpge_ss (__m128 __A, __m128 __B)
+{
+  return (__m128) __builtin_ia32_movss ((__v4sf) __A,
+     (__v4sf)
+     __builtin_ia32_cmpless ((__v4sf) __B,
+        (__v4sf)
+        __A));
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpneq_ss (__m128 __A, __m128 __B)
+{
+  return (__m128) __builtin_ia32_cmpneqss ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpnlt_ss (__m128 __A, __m128 __B)
+{
+  return (__m128) __builtin_ia32_cmpnltss ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpnle_ss (__m128 __A, __m128 __B)
+{
+  return (__m128) __builtin_ia32_cmpnless ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpngt_ss (__m128 __A, __m128 __B)
+{
+  return (__m128) __builtin_ia32_movss ((__v4sf) __A,
+     (__v4sf)
+     __builtin_ia32_cmpnltss ((__v4sf) __B,
+         (__v4sf)
+         __A));
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpnge_ss (__m128 __A, __m128 __B)
+{
+  return (__m128) __builtin_ia32_movss ((__v4sf) __A,
+     (__v4sf)
+     __builtin_ia32_cmpnless ((__v4sf) __B,
+         (__v4sf)
+         __A));
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpord_ss (__m128 __A, __m128 __B)
+{
+  return (__m128) __builtin_ia32_cmpordss ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpunord_ss (__m128 __A, __m128 __B)
+{
+  return (__m128) __builtin_ia32_cmpunordss ((__v4sf)__A, (__v4sf)__B);
+}
+
+
+
+
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpeq_ps (__m128 __A, __m128 __B)
+{
+  return (__m128) __builtin_ia32_cmpeqps ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmplt_ps (__m128 __A, __m128 __B)
+{
+  return (__m128) __builtin_ia32_cmpltps ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmple_ps (__m128 __A, __m128 __B)
+{
+  return (__m128) __builtin_ia32_cmpleps ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpgt_ps (__m128 __A, __m128 __B)
+{
+  return (__m128) __builtin_ia32_cmpgtps ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpge_ps (__m128 __A, __m128 __B)
+{
+  return (__m128) __builtin_ia32_cmpgeps ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpneq_ps (__m128 __A, __m128 __B)
+{
+  return (__m128) __builtin_ia32_cmpneqps ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpnlt_ps (__m128 __A, __m128 __B)
+{
+  return (__m128) __builtin_ia32_cmpnltps ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpnle_ps (__m128 __A, __m128 __B)
+{
+  return (__m128) __builtin_ia32_cmpnleps ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpngt_ps (__m128 __A, __m128 __B)
+{
+  return (__m128) __builtin_ia32_cmpngtps ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpnge_ps (__m128 __A, __m128 __B)
+{
+  return (__m128) __builtin_ia32_cmpngeps ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpord_ps (__m128 __A, __m128 __B)
+{
+  return (__m128) __builtin_ia32_cmpordps ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpunord_ps (__m128 __A, __m128 __B)
+{
+  return (__m128) __builtin_ia32_cmpunordps ((__v4sf)__A, (__v4sf)__B);
+}
+
+
+
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comieq_ss (__m128 __A, __m128 __B)
+{
+  return __builtin_ia32_comieq ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comilt_ss (__m128 __A, __m128 __B)
+{
+  return __builtin_ia32_comilt ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comile_ss (__m128 __A, __m128 __B)
+{
+  return __builtin_ia32_comile ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comigt_ss (__m128 __A, __m128 __B)
+{
+  return __builtin_ia32_comigt ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comige_ss (__m128 __A, __m128 __B)
+{
+  return __builtin_ia32_comige ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comineq_ss (__m128 __A, __m128 __B)
+{
+  return __builtin_ia32_comineq ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_ucomieq_ss (__m128 __A, __m128 __B)
+{
+  return __builtin_ia32_ucomieq ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_ucomilt_ss (__m128 __A, __m128 __B)
+{
+  return __builtin_ia32_ucomilt ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_ucomile_ss (__m128 __A, __m128 __B)
+{
+  return __builtin_ia32_ucomile ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_ucomigt_ss (__m128 __A, __m128 __B)
+{
+  return __builtin_ia32_ucomigt ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_ucomige_ss (__m128 __A, __m128 __B)
+{
+  return __builtin_ia32_ucomige ((__v4sf)__A, (__v4sf)__B);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_ucomineq_ss (__m128 __A, __m128 __B)
+{
+  return __builtin_ia32_ucomineq ((__v4sf)__A, (__v4sf)__B);
+}
+
+
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtss_si32 (__m128 __A)
+{
+  return __builtin_ia32_cvtss2si ((__v4sf) __A);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvt_ss2si (__m128 __A)
+{
+  return _mm_cvtss_si32 (__A);
+}
+
+
+
+
+
+
+extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtss_si64 (__m128 __A)
+{
+  return __builtin_ia32_cvtss2si64 ((__v4sf) __A);
+}
+
+
+extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtss_si64x (__m128 __A)
+{
+  return __builtin_ia32_cvtss2si64 ((__v4sf) __A);
+}
+
+
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtps_pi32 (__m128 __A)
+{
+  return (__m64) __builtin_ia32_cvtps2pi ((__v4sf) __A);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvt_ps2pi (__m128 __A)
+{
+  return _mm_cvtps_pi32 (__A);
+}
+
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvttss_si32 (__m128 __A)
+{
+  return __builtin_ia32_cvttss2si ((__v4sf) __A);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtt_ss2si (__m128 __A)
+{
+  return _mm_cvttss_si32 (__A);
+}
+
+
+
+
+
+extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvttss_si64 (__m128 __A)
+{
+  return __builtin_ia32_cvttss2si64 ((__v4sf) __A);
+}
+
+
+extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvttss_si64x (__m128 __A)
+{
+  return __builtin_ia32_cvttss2si64 ((__v4sf) __A);
+}
+
+
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvttps_pi32 (__m128 __A)
+{
+  return (__m64) __builtin_ia32_cvttps2pi ((__v4sf) __A);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtt_ps2pi (__m128 __A)
+{
+  return _mm_cvttps_pi32 (__A);
+}
+
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtsi32_ss (__m128 __A, int __B)
+{
+  return (__m128) __builtin_ia32_cvtsi2ss ((__v4sf) __A, __B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvt_si2ss (__m128 __A, int __B)
+{
+  return _mm_cvtsi32_ss (__A, __B);
+}
+
+
+
+
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtsi64_ss (__m128 __A, long long __B)
+{
+  return (__m128) __builtin_ia32_cvtsi642ss ((__v4sf) __A, __B);
+}
+
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtsi64x_ss (__m128 __A, long long __B)
+{
+  return (__m128) __builtin_ia32_cvtsi642ss ((__v4sf) __A, __B);
+}
+
+
+
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtpi32_ps (__m128 __A, __m64 __B)
+{
+  return (__m128) __builtin_ia32_cvtpi2ps ((__v4sf) __A, (__v2si)__B);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvt_pi2ps (__m128 __A, __m64 __B)
+{
+  return _mm_cvtpi32_ps (__A, __B);
+}
+
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtpi16_ps (__m64 __A)
+{
+  __v4hi __sign;
+  __v2si __hisi, __losi;
+  __v4sf __zero, __ra, __rb;
+
+
+
+
+  __sign = __builtin_ia32_pcmpgtw ((__v4hi)0LL, (__v4hi)__A);
+
+
+  __losi = (__v2si) __builtin_ia32_punpcklwd ((__v4hi)__A, __sign);
+  __hisi = (__v2si) __builtin_ia32_punpckhwd ((__v4hi)__A, __sign);
+
+
+  __zero = (__v4sf) _mm_setzero_ps ();
+  __ra = __builtin_ia32_cvtpi2ps (__zero, __losi);
+  __rb = __builtin_ia32_cvtpi2ps (__ra, __hisi);
+
+  return (__m128) __builtin_ia32_movlhps (__ra, __rb);
+}
+
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtpu16_ps (__m64 __A)
+{
+  __v2si __hisi, __losi;
+  __v4sf __zero, __ra, __rb;
+
+
+  __losi = (__v2si) __builtin_ia32_punpcklwd ((__v4hi)__A, (__v4hi)0LL);
+  __hisi = (__v2si) __builtin_ia32_punpckhwd ((__v4hi)__A, (__v4hi)0LL);
+
+
+  __zero = (__v4sf) _mm_setzero_ps ();
+  __ra = __builtin_ia32_cvtpi2ps (__zero, __losi);
+  __rb = __builtin_ia32_cvtpi2ps (__ra, __hisi);
+
+  return (__m128) __builtin_ia32_movlhps (__ra, __rb);
+}
+
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtpi8_ps (__m64 __A)
+{
+  __v8qi __sign;
+
+
+
+
+  __sign = __builtin_ia32_pcmpgtb ((__v8qi)0LL, (__v8qi)__A);
+
+
+  __A = (__m64) __builtin_ia32_punpcklbw ((__v8qi)__A, __sign);
+
+  return _mm_cvtpi16_ps(__A);
+}
+
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtpu8_ps(__m64 __A)
+{
+  __A = (__m64) __builtin_ia32_punpcklbw ((__v8qi)__A, (__v8qi)0LL);
+  return _mm_cvtpu16_ps(__A);
+}
+
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtpi32x2_ps(__m64 __A, __m64 __B)
+{
+  __v4sf __zero = (__v4sf) _mm_setzero_ps ();
+  __v4sf __sfa = __builtin_ia32_cvtpi2ps (__zero, (__v2si)__A);
+  __v4sf __sfb = __builtin_ia32_cvtpi2ps (__sfa, (__v2si)__B);
+  return (__m128) __builtin_ia32_movlhps (__sfa, __sfb);
+}
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtps_pi16(__m128 __A)
+{
+  __v4sf __hisf = (__v4sf)__A;
+  __v4sf __losf = __builtin_ia32_movhlps (__hisf, __hisf);
+  __v2si __hisi = __builtin_ia32_cvtps2pi (__hisf);
+  __v2si __losi = __builtin_ia32_cvtps2pi (__losf);
+  return (__m64) __builtin_ia32_packssdw (__hisi, __losi);
+}
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtps_pi8(__m128 __A)
+{
+  __v4hi __tmp = (__v4hi) _mm_cvtps_pi16 (__A);
+  return (__m64) __builtin_ia32_packsswb (__tmp, (__v4hi)0LL);
+}
+
+
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_shuffle_ps (__m128 __A, __m128 __B, int const __mask)
+{
+  return (__m128) __builtin_ia32_shufps ((__v4sf)__A, (__v4sf)__B, __mask);
+}
+
+
+
+
+
+
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_unpackhi_ps (__m128 __A, __m128 __B)
+{
+  return (__m128) __builtin_ia32_unpckhps ((__v4sf)__A, (__v4sf)__B);
+}
+
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_unpacklo_ps (__m128 __A, __m128 __B)
+{
+  return (__m128) __builtin_ia32_unpcklps ((__v4sf)__A, (__v4sf)__B);
+}
+
+
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_loadh_pi (__m128 __A, __m64 const *__P)
+{
+  return (__m128) __builtin_ia32_loadhps ((__v4sf)__A, (const __v2sf *)__P);
+}
+
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_storeh_pi (__m64 *__P, __m128 __A)
+{
+  __builtin_ia32_storehps ((__v2sf *)__P, (__v4sf)__A);
+}
+
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_movehl_ps (__m128 __A, __m128 __B)
+{
+  return (__m128) __builtin_ia32_movhlps ((__v4sf)__A, (__v4sf)__B);
+}
+
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_movelh_ps (__m128 __A, __m128 __B)
+{
+  return (__m128) __builtin_ia32_movlhps ((__v4sf)__A, (__v4sf)__B);
+}
+
+
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_loadl_pi (__m128 __A, __m64 const *__P)
+{
+  return (__m128) __builtin_ia32_loadlps ((__v4sf)__A, (const __v2sf *)__P);
+}
+
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_storel_pi (__m64 *__P, __m128 __A)
+{
+  __builtin_ia32_storelps ((__v2sf *)__P, (__v4sf)__A);
+}
+
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_movemask_ps (__m128 __A)
+{
+  return __builtin_ia32_movmskps ((__v4sf)__A);
+}
+
+
+extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_getcsr (void)
+{
+  return __builtin_ia32_stmxcsr ();
+}
+
+
+extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_MM_GET_EXCEPTION_STATE (void)
+{
+  return _mm_getcsr() & 0x003f;
+}
+
+extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_MM_GET_EXCEPTION_MASK (void)
+{
+  return _mm_getcsr() & 0x1f80;
+}
+
+extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_MM_GET_ROUNDING_MODE (void)
+{
+  return _mm_getcsr() & 0x6000;
+}
+
+extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_MM_GET_FLUSH_ZERO_MODE (void)
+{
+  return _mm_getcsr() & 0x8000;
+}
+
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_setcsr (unsigned int __I)
+{
+  __builtin_ia32_ldmxcsr (__I);
+}
+
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_MM_SET_EXCEPTION_STATE(unsigned int __mask)
+{
+  _mm_setcsr((_mm_getcsr() & ~0x003f) | __mask);
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_MM_SET_EXCEPTION_MASK (unsigned int __mask)
+{
+  _mm_setcsr((_mm_getcsr() & ~0x1f80) | __mask);
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_MM_SET_ROUNDING_MODE (unsigned int __mode)
+{
+  _mm_setcsr((_mm_getcsr() & ~0x6000) | __mode);
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_MM_SET_FLUSH_ZERO_MODE (unsigned int __mode)
+{
+  _mm_setcsr((_mm_getcsr() & ~0x8000) | __mode);
+}
+
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_set_ss (float __F)
+{
+  return __extension__ (__m128)(__v4sf){ __F, 0.0f, 0.0f, 0.0f };
+}
+
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_set1_ps (float __F)
+{
+  return __extension__ (__m128)(__v4sf){ __F, __F, __F, __F };
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_set_ps1 (float __F)
+{
+  return _mm_set1_ps (__F);
+}
+
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_load_ss (float const *__P)
+{
+  return _mm_set_ss (*__P);
+}
+
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_load1_ps (float const *__P)
+{
+  return _mm_set1_ps (*__P);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_load_ps1 (float const *__P)
+{
+  return _mm_load1_ps (__P);
+}
+
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_load_ps (float const *__P)
+{
+  return *(__m128 *)__P;
+}
+
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_loadu_ps (float const *__P)
+{
+  return *(__m128_u *)__P;
+}
+
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_loadr_ps (float const *__P)
+{
+  __v4sf __tmp = *(__v4sf *)__P;
+  return (__m128) __builtin_ia32_shufps (__tmp, __tmp, (((0) << 6) | ((1) << 4) | ((2) << 2) | (3)));
+}
+
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_set_ps (const float __Z, const float __Y, const float __X, const float __W)
+{
+  return __extension__ (__m128)(__v4sf){ __W, __X, __Y, __Z };
+}
+
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_setr_ps (float __Z, float __Y, float __X, float __W)
+{
+  return __extension__ (__m128)(__v4sf){ __Z, __Y, __X, __W };
+}
+
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_store_ss (float *__P, __m128 __A)
+{
+  *__P = ((__v4sf)__A)[0];
+}
+
+extern __inline float __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtss_f32 (__m128 __A)
+{
+  return ((__v4sf)__A)[0];
+}
+
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_store_ps (float *__P, __m128 __A)
+{
+  *(__m128 *)__P = __A;
+}
+
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_storeu_ps (float *__P, __m128 __A)
+{
+  *(__m128_u *)__P = __A;
+}
+
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_store1_ps (float *__P, __m128 __A)
+{
+  __v4sf __va = (__v4sf)__A;
+  __v4sf __tmp = __builtin_ia32_shufps (__va, __va, (((0) << 6) | ((0) << 4) | ((0) << 2) | (0)));
+  _mm_storeu_ps (__P, __tmp);
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_store_ps1 (float *__P, __m128 __A)
+{
+  _mm_store1_ps (__P, __A);
+}
+
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_storer_ps (float *__P, __m128 __A)
+{
+  __v4sf __va = (__v4sf)__A;
+  __v4sf __tmp = __builtin_ia32_shufps (__va, __va, (((0) << 6) | ((1) << 4) | ((2) << 2) | (3)));
+  _mm_store_ps (__P, __tmp);
+}
+
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_move_ss (__m128 __A, __m128 __B)
+{
+  return (__m128) __builtin_ia32_movss ((__v4sf)__A, (__v4sf)__B);
+}
+
+
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_extract_pi16 (__m64 const __A, int const __N)
+{
+  return __builtin_ia32_vec_ext_v4hi ((__v4hi)__A, __N);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pextrw (__m64 const __A, int const __N)
+{
+  return _mm_extract_pi16 (__A, __N);
+}
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_insert_pi16 (__m64 const __A, int const __D, int const __N)
+{
+  return (__m64) __builtin_ia32_vec_set_v4hi ((__v4hi)__A, __D, __N);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pinsrw (__m64 const __A, int const __D, int const __N)
+{
+  return _mm_insert_pi16 (__A, __D, __N);
+}
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_max_pi16 (__m64 __A, __m64 __B)
+{
+  return (__m64) __builtin_ia32_pmaxsw ((__v4hi)__A, (__v4hi)__B);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pmaxsw (__m64 __A, __m64 __B)
+{
+  return _mm_max_pi16 (__A, __B);
+}
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_max_pu8 (__m64 __A, __m64 __B)
+{
+  return (__m64) __builtin_ia32_pmaxub ((__v8qi)__A, (__v8qi)__B);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pmaxub (__m64 __A, __m64 __B)
+{
+  return _mm_max_pu8 (__A, __B);
+}
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_min_pi16 (__m64 __A, __m64 __B)
+{
+  return (__m64) __builtin_ia32_pminsw ((__v4hi)__A, (__v4hi)__B);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pminsw (__m64 __A, __m64 __B)
+{
+  return _mm_min_pi16 (__A, __B);
+}
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_min_pu8 (__m64 __A, __m64 __B)
+{
+  return (__m64) __builtin_ia32_pminub ((__v8qi)__A, (__v8qi)__B);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pminub (__m64 __A, __m64 __B)
+{
+  return _mm_min_pu8 (__A, __B);
+}
+
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_movemask_pi8 (__m64 __A)
+{
+  return __builtin_ia32_pmovmskb ((__v8qi)__A);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pmovmskb (__m64 __A)
+{
+  return _mm_movemask_pi8 (__A);
+}
+
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_mulhi_pu16 (__m64 __A, __m64 __B)
+{
+  return (__m64) __builtin_ia32_pmulhuw ((__v4hi)__A, (__v4hi)__B);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pmulhuw (__m64 __A, __m64 __B)
+{
+  return _mm_mulhi_pu16 (__A, __B);
+}
+
+
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_shuffle_pi16 (__m64 __A, int const __N)
+{
+  return (__m64) __builtin_ia32_pshufw ((__v4hi)__A, __N);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pshufw (__m64 __A, int const __N)
+{
+  return _mm_shuffle_pi16 (__A, __N);
+}
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_maskmove_si64 (__m64 __A, __m64 __N, char *__P)
+{
+  __builtin_ia32_maskmovq ((__v8qi)__A, (__v8qi)__N, __P);
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_maskmovq (__m64 __A, __m64 __N, char *__P)
+{
+  _mm_maskmove_si64 (__A, __N, __P);
+}
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_avg_pu8 (__m64 __A, __m64 __B)
+{
+  return (__m64) __builtin_ia32_pavgb ((__v8qi)__A, (__v8qi)__B);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pavgb (__m64 __A, __m64 __B)
+{
+  return _mm_avg_pu8 (__A, __B);
+}
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_avg_pu16 (__m64 __A, __m64 __B)
+{
+  return (__m64) __builtin_ia32_pavgw ((__v4hi)__A, (__v4hi)__B);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_pavgw (__m64 __A, __m64 __B)
+{
+  return _mm_avg_pu16 (__A, __B);
+}
+
+
+
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sad_pu8 (__m64 __A, __m64 __B)
+{
+  return (__m64) __builtin_ia32_psadbw ((__v8qi)__A, (__v8qi)__B);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_m_psadbw (__m64 __A, __m64 __B)
+{
+  return _mm_sad_pu8 (__A, __B);
+}
+
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_stream_pi (__m64 *__P, __m64 __A)
+{
+  __builtin_ia32_movntq ((unsigned long long *)__P, (unsigned long long)__A);
+}
+
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_stream_ps (float *__P, __m128 __A)
+{
+  __builtin_ia32_movntps (__P, (__v4sf)__A);
+}
+
+
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sfence (void)
+{
+  __builtin_ia32_sfence ();
+}
+typedef double __v2df __attribute__ ((__vector_size__ (16)));
+typedef long long __v2di __attribute__ ((__vector_size__ (16)));
+typedef unsigned long long __v2du __attribute__ ((__vector_size__ (16)));
+typedef int __v4si __attribute__ ((__vector_size__ (16)));
+typedef unsigned int __v4su __attribute__ ((__vector_size__ (16)));
+typedef short __v8hi __attribute__ ((__vector_size__ (16)));
+typedef unsigned short __v8hu __attribute__ ((__vector_size__ (16)));
+typedef char __v16qi __attribute__ ((__vector_size__ (16)));
+typedef unsigned char __v16qu __attribute__ ((__vector_size__ (16)));
+
+
+
+typedef long long __m128i __attribute__ ((__vector_size__ (16), __may_alias__));
+typedef double __m128d __attribute__ ((__vector_size__ (16), __may_alias__));
+
+
+typedef long long __m128i_u __attribute__ ((__vector_size__ (16), __may_alias__, __aligned__ (1)));
+typedef double __m128d_u __attribute__ ((__vector_size__ (16), __may_alias__, __aligned__ (1)));
+
+
+
+
+
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_set_sd (double __F)
+{
+  return __extension__ (__m128d){ __F, 0.0 };
+}
+
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_set1_pd (double __F)
+{
+  return __extension__ (__m128d){ __F, __F };
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_set_pd1 (double __F)
+{
+  return _mm_set1_pd (__F);
+}
+
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_set_pd (double __W, double __X)
+{
+  return __extension__ (__m128d){ __X, __W };
+}
+
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_setr_pd (double __W, double __X)
+{
+  return __extension__ (__m128d){ __W, __X };
+}
+
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_undefined_pd (void)
+{
+  __m128d __Y = __Y;
+  return __Y;
+}
+
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_setzero_pd (void)
+{
+  return __extension__ (__m128d){ 0.0, 0.0 };
+}
+
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_move_sd (__m128d __A, __m128d __B)
+{
+  return (__m128d) __builtin_ia32_movsd ((__v2df)__A, (__v2df)__B);
+}
+
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_load_pd (double const *__P)
+{
+  return *(__m128d *)__P;
+}
+
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_loadu_pd (double const *__P)
+{
+  return *(__m128d_u *)__P;
+}
+
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_load1_pd (double const *__P)
+{
+  return _mm_set1_pd (*__P);
+}
+
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_load_sd (double const *__P)
+{
+  return _mm_set_sd (*__P);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_load_pd1 (double const *__P)
+{
+  return _mm_load1_pd (__P);
+}
+
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_loadr_pd (double const *__P)
+{
+  __m128d __tmp = _mm_load_pd (__P);
+  return __builtin_ia32_shufpd (__tmp, __tmp, (((0) << 1) | (1)));
+}
+
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_store_pd (double *__P, __m128d __A)
+{
+  *(__m128d *)__P = __A;
+}
+
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_storeu_pd (double *__P, __m128d __A)
+{
+  *(__m128d_u *)__P = __A;
+}
+
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_store_sd (double *__P, __m128d __A)
+{
+  *__P = ((__v2df)__A)[0];
+}
+
+extern __inline double __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtsd_f64 (__m128d __A)
+{
+  return ((__v2df)__A)[0];
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_storel_pd (double *__P, __m128d __A)
+{
+  _mm_store_sd (__P, __A);
+}
+
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_storeh_pd (double *__P, __m128d __A)
+{
+  *__P = ((__v2df)__A)[1];
+}
+
+
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_store1_pd (double *__P, __m128d __A)
+{
+  _mm_store_pd (__P, __builtin_ia32_shufpd (__A, __A, (((0) << 1) | (0))));
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_store_pd1 (double *__P, __m128d __A)
+{
+  _mm_store1_pd (__P, __A);
+}
+
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_storer_pd (double *__P, __m128d __A)
+{
+  _mm_store_pd (__P, __builtin_ia32_shufpd (__A, __A, (((0) << 1) | (1))));
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtsi128_si32 (__m128i __A)
+{
+  return __builtin_ia32_vec_ext_v4si ((__v4si)__A, 0);
+}
+
+
+
+extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtsi128_si64 (__m128i __A)
+{
+  return ((__v2di)__A)[0];
+}
+
+
+extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtsi128_si64x (__m128i __A)
+{
+  return ((__v2di)__A)[0];
+}
+
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_add_pd (__m128d __A, __m128d __B)
+{
+  return (__m128d) ((__v2df)__A + (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_add_sd (__m128d __A, __m128d __B)
+{
+  return (__m128d)__builtin_ia32_addsd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sub_pd (__m128d __A, __m128d __B)
+{
+  return (__m128d) ((__v2df)__A - (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sub_sd (__m128d __A, __m128d __B)
+{
+  return (__m128d)__builtin_ia32_subsd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_mul_pd (__m128d __A, __m128d __B)
+{
+  return (__m128d) ((__v2df)__A * (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_mul_sd (__m128d __A, __m128d __B)
+{
+  return (__m128d)__builtin_ia32_mulsd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_div_pd (__m128d __A, __m128d __B)
+{
+  return (__m128d) ((__v2df)__A / (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_div_sd (__m128d __A, __m128d __B)
+{
+  return (__m128d)__builtin_ia32_divsd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sqrt_pd (__m128d __A)
+{
+  return (__m128d)__builtin_ia32_sqrtpd ((__v2df)__A);
+}
+
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sqrt_sd (__m128d __A, __m128d __B)
+{
+  __v2df __tmp = __builtin_ia32_movsd ((__v2df)__A, (__v2df)__B);
+  return (__m128d)__builtin_ia32_sqrtsd ((__v2df)__tmp);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_min_pd (__m128d __A, __m128d __B)
+{
+  return (__m128d)__builtin_ia32_minpd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_min_sd (__m128d __A, __m128d __B)
+{
+  return (__m128d)__builtin_ia32_minsd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_max_pd (__m128d __A, __m128d __B)
+{
+  return (__m128d)__builtin_ia32_maxpd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_max_sd (__m128d __A, __m128d __B)
+{
+  return (__m128d)__builtin_ia32_maxsd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_and_pd (__m128d __A, __m128d __B)
+{
+  return (__m128d)__builtin_ia32_andpd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_andnot_pd (__m128d __A, __m128d __B)
+{
+  return (__m128d)__builtin_ia32_andnpd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_or_pd (__m128d __A, __m128d __B)
+{
+  return (__m128d)__builtin_ia32_orpd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_xor_pd (__m128d __A, __m128d __B)
+{
+  return (__m128d)__builtin_ia32_xorpd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpeq_pd (__m128d __A, __m128d __B)
+{
+  return (__m128d)__builtin_ia32_cmpeqpd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmplt_pd (__m128d __A, __m128d __B)
+{
+  return (__m128d)__builtin_ia32_cmpltpd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmple_pd (__m128d __A, __m128d __B)
+{
+  return (__m128d)__builtin_ia32_cmplepd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpgt_pd (__m128d __A, __m128d __B)
+{
+  return (__m128d)__builtin_ia32_cmpgtpd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpge_pd (__m128d __A, __m128d __B)
+{
+  return (__m128d)__builtin_ia32_cmpgepd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpneq_pd (__m128d __A, __m128d __B)
+{
+  return (__m128d)__builtin_ia32_cmpneqpd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpnlt_pd (__m128d __A, __m128d __B)
+{
+  return (__m128d)__builtin_ia32_cmpnltpd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpnle_pd (__m128d __A, __m128d __B)
+{
+  return (__m128d)__builtin_ia32_cmpnlepd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpngt_pd (__m128d __A, __m128d __B)
+{
+  return (__m128d)__builtin_ia32_cmpngtpd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpnge_pd (__m128d __A, __m128d __B)
+{
+  return (__m128d)__builtin_ia32_cmpngepd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpord_pd (__m128d __A, __m128d __B)
+{
+  return (__m128d)__builtin_ia32_cmpordpd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpunord_pd (__m128d __A, __m128d __B)
+{
+  return (__m128d)__builtin_ia32_cmpunordpd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpeq_sd (__m128d __A, __m128d __B)
+{
+  return (__m128d)__builtin_ia32_cmpeqsd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmplt_sd (__m128d __A, __m128d __B)
+{
+  return (__m128d)__builtin_ia32_cmpltsd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmple_sd (__m128d __A, __m128d __B)
+{
+  return (__m128d)__builtin_ia32_cmplesd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpgt_sd (__m128d __A, __m128d __B)
+{
+  return (__m128d) __builtin_ia32_movsd ((__v2df) __A,
+      (__v2df)
+      __builtin_ia32_cmpltsd ((__v2df) __B,
+         (__v2df)
+         __A));
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpge_sd (__m128d __A, __m128d __B)
+{
+  return (__m128d) __builtin_ia32_movsd ((__v2df) __A,
+      (__v2df)
+      __builtin_ia32_cmplesd ((__v2df) __B,
+         (__v2df)
+         __A));
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpneq_sd (__m128d __A, __m128d __B)
+{
+  return (__m128d)__builtin_ia32_cmpneqsd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpnlt_sd (__m128d __A, __m128d __B)
+{
+  return (__m128d)__builtin_ia32_cmpnltsd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpnle_sd (__m128d __A, __m128d __B)
+{
+  return (__m128d)__builtin_ia32_cmpnlesd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpngt_sd (__m128d __A, __m128d __B)
+{
+  return (__m128d) __builtin_ia32_movsd ((__v2df) __A,
+      (__v2df)
+      __builtin_ia32_cmpnltsd ((__v2df) __B,
+          (__v2df)
+          __A));
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpnge_sd (__m128d __A, __m128d __B)
+{
+  return (__m128d) __builtin_ia32_movsd ((__v2df) __A,
+      (__v2df)
+      __builtin_ia32_cmpnlesd ((__v2df) __B,
+          (__v2df)
+          __A));
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpord_sd (__m128d __A, __m128d __B)
+{
+  return (__m128d)__builtin_ia32_cmpordsd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpunord_sd (__m128d __A, __m128d __B)
+{
+  return (__m128d)__builtin_ia32_cmpunordsd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comieq_sd (__m128d __A, __m128d __B)
+{
+  return __builtin_ia32_comisdeq ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comilt_sd (__m128d __A, __m128d __B)
+{
+  return __builtin_ia32_comisdlt ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comile_sd (__m128d __A, __m128d __B)
+{
+  return __builtin_ia32_comisdle ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comigt_sd (__m128d __A, __m128d __B)
+{
+  return __builtin_ia32_comisdgt ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comige_sd (__m128d __A, __m128d __B)
+{
+  return __builtin_ia32_comisdge ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_comineq_sd (__m128d __A, __m128d __B)
+{
+  return __builtin_ia32_comisdneq ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_ucomieq_sd (__m128d __A, __m128d __B)
+{
+  return __builtin_ia32_ucomisdeq ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_ucomilt_sd (__m128d __A, __m128d __B)
+{
+  return __builtin_ia32_ucomisdlt ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_ucomile_sd (__m128d __A, __m128d __B)
+{
+  return __builtin_ia32_ucomisdle ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_ucomigt_sd (__m128d __A, __m128d __B)
+{
+  return __builtin_ia32_ucomisdgt ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_ucomige_sd (__m128d __A, __m128d __B)
+{
+  return __builtin_ia32_ucomisdge ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_ucomineq_sd (__m128d __A, __m128d __B)
+{
+  return __builtin_ia32_ucomisdneq ((__v2df)__A, (__v2df)__B);
+}
+
+
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_set_epi64x (long long __q1, long long __q0)
+{
+  return __extension__ (__m128i)(__v2di){ __q0, __q1 };
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_set_epi64 (__m64 __q1, __m64 __q0)
+{
+  return _mm_set_epi64x ((long long)__q1, (long long)__q0);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_set_epi32 (int __q3, int __q2, int __q1, int __q0)
+{
+  return __extension__ (__m128i)(__v4si){ __q0, __q1, __q2, __q3 };
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_set_epi16 (short __q7, short __q6, short __q5, short __q4,
+        short __q3, short __q2, short __q1, short __q0)
+{
+  return __extension__ (__m128i)(__v8hi){
+    __q0, __q1, __q2, __q3, __q4, __q5, __q6, __q7 };
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_set_epi8 (char __q15, char __q14, char __q13, char __q12,
+       char __q11, char __q10, char __q09, char __q08,
+       char __q07, char __q06, char __q05, char __q04,
+       char __q03, char __q02, char __q01, char __q00)
+{
+  return __extension__ (__m128i)(__v16qi){
+    __q00, __q01, __q02, __q03, __q04, __q05, __q06, __q07,
+    __q08, __q09, __q10, __q11, __q12, __q13, __q14, __q15
+  };
+}
+
+
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_set1_epi64x (long long __A)
+{
+  return _mm_set_epi64x (__A, __A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_set1_epi64 (__m64 __A)
+{
+  return _mm_set_epi64 (__A, __A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_set1_epi32 (int __A)
+{
+  return _mm_set_epi32 (__A, __A, __A, __A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_set1_epi16 (short __A)
+{
+  return _mm_set_epi16 (__A, __A, __A, __A, __A, __A, __A, __A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_set1_epi8 (char __A)
+{
+  return _mm_set_epi8 (__A, __A, __A, __A, __A, __A, __A, __A,
+         __A, __A, __A, __A, __A, __A, __A, __A);
+}
+
+
+
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_setr_epi64 (__m64 __q0, __m64 __q1)
+{
+  return _mm_set_epi64 (__q1, __q0);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_setr_epi32 (int __q0, int __q1, int __q2, int __q3)
+{
+  return _mm_set_epi32 (__q3, __q2, __q1, __q0);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_setr_epi16 (short __q0, short __q1, short __q2, short __q3,
+         short __q4, short __q5, short __q6, short __q7)
+{
+  return _mm_set_epi16 (__q7, __q6, __q5, __q4, __q3, __q2, __q1, __q0);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_setr_epi8 (char __q00, char __q01, char __q02, char __q03,
+        char __q04, char __q05, char __q06, char __q07,
+        char __q08, char __q09, char __q10, char __q11,
+        char __q12, char __q13, char __q14, char __q15)
+{
+  return _mm_set_epi8 (__q15, __q14, __q13, __q12, __q11, __q10, __q09, __q08,
+         __q07, __q06, __q05, __q04, __q03, __q02, __q01, __q00);
+}
+
+
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_load_si128 (__m128i const *__P)
+{
+  return *__P;
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_loadu_si128 (__m128i_u const *__P)
+{
+  return *__P;
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_loadl_epi64 (__m128i_u const *__P)
+{
+  return _mm_set_epi64 ((__m64)0LL, *(__m64_u *)__P);
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_store_si128 (__m128i *__P, __m128i __B)
+{
+  *__P = __B;
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_storeu_si128 (__m128i_u *__P, __m128i __B)
+{
+  *__P = __B;
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_storel_epi64 (__m128i_u *__P, __m128i __B)
+{
+  *(__m64_u *)__P = (__m64) ((__v2di)__B)[0];
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_movepi64_pi64 (__m128i __B)
+{
+  return (__m64) ((__v2di)__B)[0];
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_movpi64_epi64 (__m64 __A)
+{
+  return _mm_set_epi64 ((__m64)0LL, __A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_move_epi64 (__m128i __A)
+{
+  return (__m128i)__builtin_ia32_movq128 ((__v2di) __A);
+}
+
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_undefined_si128 (void)
+{
+  __m128i __Y = __Y;
+  return __Y;
+}
+
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_setzero_si128 (void)
+{
+  return __extension__ (__m128i)(__v4si){ 0, 0, 0, 0 };
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtepi32_pd (__m128i __A)
+{
+  return (__m128d)__builtin_ia32_cvtdq2pd ((__v4si) __A);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtepi32_ps (__m128i __A)
+{
+  return (__m128)__builtin_ia32_cvtdq2ps ((__v4si) __A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtpd_epi32 (__m128d __A)
+{
+  return (__m128i)__builtin_ia32_cvtpd2dq ((__v2df) __A);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtpd_pi32 (__m128d __A)
+{
+  return (__m64)__builtin_ia32_cvtpd2pi ((__v2df) __A);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtpd_ps (__m128d __A)
+{
+  return (__m128)__builtin_ia32_cvtpd2ps ((__v2df) __A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvttpd_epi32 (__m128d __A)
+{
+  return (__m128i)__builtin_ia32_cvttpd2dq ((__v2df) __A);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvttpd_pi32 (__m128d __A)
+{
+  return (__m64)__builtin_ia32_cvttpd2pi ((__v2df) __A);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtpi32_pd (__m64 __A)
+{
+  return (__m128d)__builtin_ia32_cvtpi2pd ((__v2si) __A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtps_epi32 (__m128 __A)
+{
+  return (__m128i)__builtin_ia32_cvtps2dq ((__v4sf) __A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvttps_epi32 (__m128 __A)
+{
+  return (__m128i)__builtin_ia32_cvttps2dq ((__v4sf) __A);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtps_pd (__m128 __A)
+{
+  return (__m128d)__builtin_ia32_cvtps2pd ((__v4sf) __A);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtsd_si32 (__m128d __A)
+{
+  return __builtin_ia32_cvtsd2si ((__v2df) __A);
+}
+
+
+
+extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtsd_si64 (__m128d __A)
+{
+  return __builtin_ia32_cvtsd2si64 ((__v2df) __A);
+}
+
+
+extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtsd_si64x (__m128d __A)
+{
+  return __builtin_ia32_cvtsd2si64 ((__v2df) __A);
+}
+
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvttsd_si32 (__m128d __A)
+{
+  return __builtin_ia32_cvttsd2si ((__v2df) __A);
+}
+
+
+
+extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvttsd_si64 (__m128d __A)
+{
+  return __builtin_ia32_cvttsd2si64 ((__v2df) __A);
+}
+
+
+extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvttsd_si64x (__m128d __A)
+{
+  return __builtin_ia32_cvttsd2si64 ((__v2df) __A);
+}
+
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtsd_ss (__m128 __A, __m128d __B)
+{
+  return (__m128)__builtin_ia32_cvtsd2ss ((__v4sf) __A, (__v2df) __B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtsi32_sd (__m128d __A, int __B)
+{
+  return (__m128d)__builtin_ia32_cvtsi2sd ((__v2df) __A, __B);
+}
+
+
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtsi64_sd (__m128d __A, long long __B)
+{
+  return (__m128d)__builtin_ia32_cvtsi642sd ((__v2df) __A, __B);
+}
+
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtsi64x_sd (__m128d __A, long long __B)
+{
+  return (__m128d)__builtin_ia32_cvtsi642sd ((__v2df) __A, __B);
+}
+
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtss_sd (__m128d __A, __m128 __B)
+{
+  return (__m128d)__builtin_ia32_cvtss2sd ((__v2df) __A, (__v4sf)__B);
+}
+
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_shuffle_pd(__m128d __A, __m128d __B, const int __mask)
+{
+  return (__m128d)__builtin_ia32_shufpd ((__v2df)__A, (__v2df)__B, __mask);
+}
+
+
+
+
+
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_unpackhi_pd (__m128d __A, __m128d __B)
+{
+  return (__m128d)__builtin_ia32_unpckhpd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_unpacklo_pd (__m128d __A, __m128d __B)
+{
+  return (__m128d)__builtin_ia32_unpcklpd ((__v2df)__A, (__v2df)__B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_loadh_pd (__m128d __A, double const *__B)
+{
+  return (__m128d)__builtin_ia32_loadhpd ((__v2df)__A, __B);
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_loadl_pd (__m128d __A, double const *__B)
+{
+  return (__m128d)__builtin_ia32_loadlpd ((__v2df)__A, __B);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_movemask_pd (__m128d __A)
+{
+  return __builtin_ia32_movmskpd ((__v2df)__A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_packs_epi16 (__m128i __A, __m128i __B)
+{
+  return (__m128i)__builtin_ia32_packsswb128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_packs_epi32 (__m128i __A, __m128i __B)
+{
+  return (__m128i)__builtin_ia32_packssdw128 ((__v4si)__A, (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_packus_epi16 (__m128i __A, __m128i __B)
+{
+  return (__m128i)__builtin_ia32_packuswb128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_unpackhi_epi8 (__m128i __A, __m128i __B)
+{
+  return (__m128i)__builtin_ia32_punpckhbw128 ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_unpackhi_epi16 (__m128i __A, __m128i __B)
+{
+  return (__m128i)__builtin_ia32_punpckhwd128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_unpackhi_epi32 (__m128i __A, __m128i __B)
+{
+  return (__m128i)__builtin_ia32_punpckhdq128 ((__v4si)__A, (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_unpackhi_epi64 (__m128i __A, __m128i __B)
+{
+  return (__m128i)__builtin_ia32_punpckhqdq128 ((__v2di)__A, (__v2di)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_unpacklo_epi8 (__m128i __A, __m128i __B)
+{
+  return (__m128i)__builtin_ia32_punpcklbw128 ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_unpacklo_epi16 (__m128i __A, __m128i __B)
+{
+  return (__m128i)__builtin_ia32_punpcklwd128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_unpacklo_epi32 (__m128i __A, __m128i __B)
+{
+  return (__m128i)__builtin_ia32_punpckldq128 ((__v4si)__A, (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_unpacklo_epi64 (__m128i __A, __m128i __B)
+{
+  return (__m128i)__builtin_ia32_punpcklqdq128 ((__v2di)__A, (__v2di)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_add_epi8 (__m128i __A, __m128i __B)
+{
+  return (__m128i) ((__v16qu)__A + (__v16qu)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_add_epi16 (__m128i __A, __m128i __B)
+{
+  return (__m128i) ((__v8hu)__A + (__v8hu)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_add_epi32 (__m128i __A, __m128i __B)
+{
+  return (__m128i) ((__v4su)__A + (__v4su)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_add_epi64 (__m128i __A, __m128i __B)
+{
+  return (__m128i) ((__v2du)__A + (__v2du)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_adds_epi8 (__m128i __A, __m128i __B)
+{
+  return (__m128i)__builtin_ia32_paddsb128 ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_adds_epi16 (__m128i __A, __m128i __B)
+{
+  return (__m128i)__builtin_ia32_paddsw128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_adds_epu8 (__m128i __A, __m128i __B)
+{
+  return (__m128i)__builtin_ia32_paddusb128 ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_adds_epu16 (__m128i __A, __m128i __B)
+{
+  return (__m128i)__builtin_ia32_paddusw128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sub_epi8 (__m128i __A, __m128i __B)
+{
+  return (__m128i) ((__v16qu)__A - (__v16qu)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sub_epi16 (__m128i __A, __m128i __B)
+{
+  return (__m128i) ((__v8hu)__A - (__v8hu)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sub_epi32 (__m128i __A, __m128i __B)
+{
+  return (__m128i) ((__v4su)__A - (__v4su)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sub_epi64 (__m128i __A, __m128i __B)
+{
+  return (__m128i) ((__v2du)__A - (__v2du)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_subs_epi8 (__m128i __A, __m128i __B)
+{
+  return (__m128i)__builtin_ia32_psubsb128 ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_subs_epi16 (__m128i __A, __m128i __B)
+{
+  return (__m128i)__builtin_ia32_psubsw128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_subs_epu8 (__m128i __A, __m128i __B)
+{
+  return (__m128i)__builtin_ia32_psubusb128 ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_subs_epu16 (__m128i __A, __m128i __B)
+{
+  return (__m128i)__builtin_ia32_psubusw128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_madd_epi16 (__m128i __A, __m128i __B)
+{
+  return (__m128i)__builtin_ia32_pmaddwd128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_mulhi_epi16 (__m128i __A, __m128i __B)
+{
+  return (__m128i)__builtin_ia32_pmulhw128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_mullo_epi16 (__m128i __A, __m128i __B)
+{
+  return (__m128i) ((__v8hu)__A * (__v8hu)__B);
+}
+
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_mul_su32 (__m64 __A, __m64 __B)
+{
+  return (__m64)__builtin_ia32_pmuludq ((__v2si)__A, (__v2si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_mul_epu32 (__m128i __A, __m128i __B)
+{
+  return (__m128i)__builtin_ia32_pmuludq128 ((__v4si)__A, (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_slli_epi16 (__m128i __A, int __B)
+{
+  return (__m128i)__builtin_ia32_psllwi128 ((__v8hi)__A, __B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_slli_epi32 (__m128i __A, int __B)
+{
+  return (__m128i)__builtin_ia32_pslldi128 ((__v4si)__A, __B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_slli_epi64 (__m128i __A, int __B)
+{
+  return (__m128i)__builtin_ia32_psllqi128 ((__v2di)__A, __B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_srai_epi16 (__m128i __A, int __B)
+{
+  return (__m128i)__builtin_ia32_psrawi128 ((__v8hi)__A, __B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_srai_epi32 (__m128i __A, int __B)
+{
+  return (__m128i)__builtin_ia32_psradi128 ((__v4si)__A, __B);
+}
+
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_bsrli_si128 (__m128i __A, const int __N)
+{
+  return (__m128i)__builtin_ia32_psrldqi128 (__A, __N * 8);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_bslli_si128 (__m128i __A, const int __N)
+{
+  return (__m128i)__builtin_ia32_pslldqi128 (__A, __N * 8);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_srli_si128 (__m128i __A, const int __N)
+{
+  return (__m128i)__builtin_ia32_psrldqi128 (__A, __N * 8);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_slli_si128 (__m128i __A, const int __N)
+{
+  return (__m128i)__builtin_ia32_pslldqi128 (__A, __N * 8);
+}
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_srli_epi16 (__m128i __A, int __B)
+{
+  return (__m128i)__builtin_ia32_psrlwi128 ((__v8hi)__A, __B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_srli_epi32 (__m128i __A, int __B)
+{
+  return (__m128i)__builtin_ia32_psrldi128 ((__v4si)__A, __B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_srli_epi64 (__m128i __A, int __B)
+{
+  return (__m128i)__builtin_ia32_psrlqi128 ((__v2di)__A, __B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sll_epi16 (__m128i __A, __m128i __B)
+{
+  return (__m128i)__builtin_ia32_psllw128((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sll_epi32 (__m128i __A, __m128i __B)
+{
+  return (__m128i)__builtin_ia32_pslld128((__v4si)__A, (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sll_epi64 (__m128i __A, __m128i __B)
+{
+  return (__m128i)__builtin_ia32_psllq128((__v2di)__A, (__v2di)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sra_epi16 (__m128i __A, __m128i __B)
+{
+  return (__m128i)__builtin_ia32_psraw128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sra_epi32 (__m128i __A, __m128i __B)
+{
+  return (__m128i)__builtin_ia32_psrad128 ((__v4si)__A, (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_srl_epi16 (__m128i __A, __m128i __B)
+{
+  return (__m128i)__builtin_ia32_psrlw128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_srl_epi32 (__m128i __A, __m128i __B)
+{
+  return (__m128i)__builtin_ia32_psrld128 ((__v4si)__A, (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_srl_epi64 (__m128i __A, __m128i __B)
+{
+  return (__m128i)__builtin_ia32_psrlq128 ((__v2di)__A, (__v2di)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_and_si128 (__m128i __A, __m128i __B)
+{
+  return (__m128i) ((__v2du)__A & (__v2du)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_andnot_si128 (__m128i __A, __m128i __B)
+{
+  return (__m128i)__builtin_ia32_pandn128 ((__v2di)__A, (__v2di)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_or_si128 (__m128i __A, __m128i __B)
+{
+  return (__m128i) ((__v2du)__A | (__v2du)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_xor_si128 (__m128i __A, __m128i __B)
+{
+  return (__m128i) ((__v2du)__A ^ (__v2du)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpeq_epi8 (__m128i __A, __m128i __B)
+{
+  return (__m128i) ((__v16qi)__A == (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpeq_epi16 (__m128i __A, __m128i __B)
+{
+  return (__m128i) ((__v8hi)__A == (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpeq_epi32 (__m128i __A, __m128i __B)
+{
+  return (__m128i) ((__v4si)__A == (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmplt_epi8 (__m128i __A, __m128i __B)
+{
+  return (__m128i) ((__v16qi)__A < (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmplt_epi16 (__m128i __A, __m128i __B)
+{
+  return (__m128i) ((__v8hi)__A < (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmplt_epi32 (__m128i __A, __m128i __B)
+{
+  return (__m128i) ((__v4si)__A < (__v4si)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpgt_epi8 (__m128i __A, __m128i __B)
+{
+  return (__m128i) ((__v16qi)__A > (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpgt_epi16 (__m128i __A, __m128i __B)
+{
+  return (__m128i) ((__v8hi)__A > (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpgt_epi32 (__m128i __A, __m128i __B)
+{
+  return (__m128i) ((__v4si)__A > (__v4si)__B);
+}
+
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_extract_epi16 (__m128i const __A, int const __N)
+{
+  return (unsigned short) __builtin_ia32_vec_ext_v8hi ((__v8hi)__A, __N);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_insert_epi16 (__m128i const __A, int const __D, int const __N)
+{
+  return (__m128i) __builtin_ia32_vec_set_v8hi ((__v8hi)__A, __D, __N);
+}
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_max_epi16 (__m128i __A, __m128i __B)
+{
+  return (__m128i)__builtin_ia32_pmaxsw128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_max_epu8 (__m128i __A, __m128i __B)
+{
+  return (__m128i)__builtin_ia32_pmaxub128 ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_min_epi16 (__m128i __A, __m128i __B)
+{
+  return (__m128i)__builtin_ia32_pminsw128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_min_epu8 (__m128i __A, __m128i __B)
+{
+  return (__m128i)__builtin_ia32_pminub128 ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_movemask_epi8 (__m128i __A)
+{
+  return __builtin_ia32_pmovmskb128 ((__v16qi)__A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_mulhi_epu16 (__m128i __A, __m128i __B)
+{
+  return (__m128i)__builtin_ia32_pmulhuw128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_shufflehi_epi16 (__m128i __A, const int __mask)
+{
+  return (__m128i)__builtin_ia32_pshufhw ((__v8hi)__A, __mask);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_shufflelo_epi16 (__m128i __A, const int __mask)
+{
+  return (__m128i)__builtin_ia32_pshuflw ((__v8hi)__A, __mask);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_shuffle_epi32 (__m128i __A, const int __mask)
+{
+  return (__m128i)__builtin_ia32_pshufd ((__v4si)__A, __mask);
+}
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_maskmoveu_si128 (__m128i __A, __m128i __B, char *__C)
+{
+  __builtin_ia32_maskmovdqu ((__v16qi)__A, (__v16qi)__B, __C);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_avg_epu8 (__m128i __A, __m128i __B)
+{
+  return (__m128i)__builtin_ia32_pavgb128 ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_avg_epu16 (__m128i __A, __m128i __B)
+{
+  return (__m128i)__builtin_ia32_pavgw128 ((__v8hi)__A, (__v8hi)__B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_sad_epu8 (__m128i __A, __m128i __B)
+{
+  return (__m128i)__builtin_ia32_psadbw128 ((__v16qi)__A, (__v16qi)__B);
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_stream_si32 (int *__A, int __B)
+{
+  __builtin_ia32_movnti (__A, __B);
+}
+
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_stream_si64 (long long int *__A, long long int __B)
+{
+  __builtin_ia32_movnti64 (__A, __B);
+}
+
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_stream_si128 (__m128i *__A, __m128i __B)
+{
+  __builtin_ia32_movntdq ((__v2di *)__A, (__v2di)__B);
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_stream_pd (double *__A, __m128d __B)
+{
+  __builtin_ia32_movntpd (__A, (__v2df)__B);
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_clflush (void const *__A)
+{
+  __builtin_ia32_clflush (__A);
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_lfence (void)
+{
+  __builtin_ia32_lfence ();
+}
+
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_mfence (void)
+{
+  __builtin_ia32_mfence ();
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtsi32_si128 (int __A)
+{
+  return _mm_set_epi32 (0, 0, 0, __A);
+}
+
+
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtsi64_si128 (long long __A)
+{
+  return _mm_set_epi64x (0, __A);
+}
+
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cvtsi64x_si128 (long long __A)
+{
+  return _mm_set_epi64x (0, __A);
+}
+
+
+
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_castpd_ps(__m128d __A)
+{
+  return (__m128) __A;
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_castpd_si128(__m128d __A)
+{
+  return (__m128i) __A;
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_castps_pd(__m128 __A)
+{
+  return (__m128d) __A;
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_castps_si128(__m128 __A)
+{
+  return (__m128i) __A;
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_castsi128_ps(__m128i __A)
+{
+  return (__m128) __A;
+}
+
+extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_castsi128_pd(__m128i __A)
+{
+  return (__m128d) __A;
+}
+extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_pause (void)
+{
+  __builtin_ia32_pause ();
+}
+
+
+
+
+typedef float v4f_t __attribute__ ((vector_size (16), aligned(16)));
+
+inline v4f_t v4f (float x)
+ { v4f_t v = {x,x,x,x}; return v; }
+inline v4f_t v4f (float x0, float x1, float x2, float x3)
+ { v4f_t v = {x0,x1,x2,x3}; return v; }
+inline v4f_t v4f (float *x)
+ { v4f_t v = {x[0],x[1],x[2],x[3]}; return v; }
+inline float v4f_sum (v4f_t v)
+{
+ float * f = (float *) &v;
+ return f[0]+f[1]+f[2]+f[3];
+}
+
+
+typedef float (*f2f_fn) (float f);
+
+template <f2f_fn fn>
+v4f_t v4f_map (v4f_t x)
+{
+ v4f_t y;
+ float * s = (float *) &x;
+ float * d = (float *) &y;
+ for (uint i = 0; i < 4; ++i)
+  d[i] = fn(s[i]);
+ return y;
+}
+template <int N>
+class V4fArray
+{
+ private:
+
+  char _data [(N+1) * sizeof(v4f_t)];
+
+ public:
+  v4f_t * v;
+
+  V4fArray()
+   {
+    uint64 p = (uint64) ((uint64) _data + 16) & ~15ll;
+    v = (v4f_t*) p;
+   }
+
+  void reset() { memset (_data, 0, sizeof (_data)); }
+
+  v4f_t & operator [] (int i) {return v[i];}
+};
+
+class V4fData
+{
+ private:
+  void * _data;
+
+ public:
+  v4f_t * v;
+
+  V4fData() {_data = 0;}
+  ~V4fData() {free(_data);}
+
+  operator v4f_t * () {return v;}
+  operator void * () {return (void *) v;}
+
+  void init (int N)
+   {
+    _data = calloc(N+1, sizeof(v4f_t));
+    uint64 p = (16 + (uint64) _data) & ~15ll;
+    v = (v4f_t*) p;
+   }
+};
+
+
+class Sin4f
+{
+ public:
+  char _data [4 * sizeof (v4f_t)];
+  int z;
+
+ public:
+
+  inline v4f_t * data()
+   {
+    uint64 p = ((uint64) _data + 16) & ~15ll;
+    return (v4f_t *) p;
+   }
+
+  inline void set_f (v4f_t f)
+   {
+    v4f_t *y = data();
+    v4f_t w = -((v4f_t) {
+              3.14159265358979323846
+              , 
+              3.14159265358979323846
+              , 
+              3.14159265358979323846
+              , 
+              3.14159265358979323846
+              }) * f;
+    y[0] = v4f_map<__builtin_sinf> (w);
+    y[1] = v4f_map<__builtin_sinf> (((v4f_t) {2, 2, 2, 2}) * w);
+
+    y[2] = ((v4f_t) {2, 2, 2, 2}) * v4f_map<__builtin_cosf> (w);
+    z = 0;
+   }
+
+  inline v4f_t get()
+   {
+    v4f_t *y = data();
+    register v4f_t s = y[2] * y[z];
+    z ^= 1;
+    s -= y[z];
+    return y[z] = s;
+   }
+};
+
+namespace DSP {
+
+
+template <int N>
+class FIRv4
+{
+ public:
+  enum {
+   DataSize = 5 * (N/4) * sizeof (v4f_t)
+  };
+  char _data [DataSize + sizeof (v4f_t)];
+
+  int h;
+
+ public:
+  FIRv4()
+   {
+    h = 0;
+    reset();
+   }
+
+  v4f_t process (float s)
+   {
+    v4f_t * c = data();
+
+
+    v4f_t * x = c+N/4;
+
+    int j = h&3;
+    int i = N*j + (h&~3);
+    for ( ; j < 4; ++j, i += N+1)
+     ((float *) x) [i] = s;
+    i -= 4*N - 4;
+    if (h > N-4) i -= N;
+    for (j = (h&3); j > 0; --j, i += N+1)
+     ((float *) x) [i] = s;
+
+    x += (N/4) * (h&3);
+    i = h>>2;
+    v4f_t a = ((v4f_t) {0, 0, 0, 0});
+    for (j = 0; i >= 0; ++j, --i)
+     a += c[j] * x[i];
+    i = N/4-1;
+    for ( ; j < N/4; ++j, --i)
+     a += c[j] * x[i];
+
+
+    h = (h+1) & (N-1);
+
+    return a;
+   }
+
+
+  inline v4f_t * data()
+   {
+    uint64 p = ((uint64) _data + 16) & ~15ll;
+    return (v4f_t *) p;
+   }
+  void set_kernel (float * f, int n = N)
+   {
+    float * c = (float *) data();
+    int i = 0;
+    for ( ; i < n; ++i)
+     c[i] = f[i];
+    for ( ; i < N; ++i)
+     c[i] = 0;
+   }
+
+  void reset()
+   {
+
+    memset (data() + N/4, 0, 4*N * sizeof (float));
+   }
+};
+
+}
+namespace DSP {
+
+
+
+
+
+class RBJv4
+{
+ public:
+  v4f_t sin, cos, alpha;
+
+  RBJv4 (v4f_t f, v4f_t Q)
+   {
+    v4f_t w = ((v4f_t) {2*
+             3.14159265358979323846
+             , 2*
+             3.14159265358979323846
+             , 2*
+             3.14159265358979323846
+             , 2*
+             3.14159265358979323846
+             }) * f;
+
+    sin = v4f_map<__builtin_sinf> (w);
+    cos = v4f_map<__builtin_cosf> (w);
+
+    alpha = sin / (((v4f_t) {2, 2, 2, 2}) * Q);
+   }
+};
+
+
+class IIR2v4
+{
+ public:
+
+  char __data [10 * sizeof (v4f_t)];
+  v4f_t * _data;
+  inline v4f_t * data() { return _data; }
+
+  int h;
+
+  IIR2v4()
+   {
+    h = 0;
+    _data = (v4f_t *) (((uint64)__data + 16) & ~15ll);
+    unity();
+    reset();
+   }
+
+
+  void operator = (IIR2v4 & b)
+   {
+    h = b.h;
+    memcpy (data(), b.data(), 9 * sizeof (v4f_t));
+   }
+
+  void unity()
+   {
+    v4f_t *a = data(), *b = a+2;
+    a[0] = ((v4f_t) {1, 1, 1, 1});
+    a[1] = a[2] = b[1] = b[2] = ((v4f_t) {0, 0, 0, 0});
+   }
+  void reset()
+   {
+    v4f_t *x = data() + 5, *y = x + 2;
+    x[0] = x[1] =
+    y[0] = y[1] = (v4f_t) {0,0,0,0};
+   }
+
+
+  void set_bp (v4f_t f, v4f_t Q)
+   {
+    RBJv4 p (f, Q);
+    v4f_t a[3], b[3];
+
+    b[0] = Q * p.alpha;
+    b[1] = ((v4f_t) {0, 0, 0, 0});
+    b[2] = -b[0];
+
+    a[0] = ((v4f_t) {1, 1, 1, 1}) + p.alpha;
+    a[1] = -((v4f_t) {2, 2, 2, 2}) * p.cos;
+    a[2] = ((v4f_t) {1, 1, 1, 1}) - p.alpha;
+
+    make_direct_I (a, b);
+   }
+
+  void set_lp (v4f_t f, v4f_t Q)
+   {
+    RBJv4 p (f, Q);
+    v4f_t a[3], b[3];
+
+    b[1] = ((v4f_t) {1, 1, 1, 1}) - p.cos;
+    b[0] = b[2] = b[1] * ((v4f_t) {.5, .5, .5, .5});
+
+    a[0] = ((v4f_t) {1, 1, 1, 1}) + p.alpha;
+    a[1] = -((v4f_t) {2, 2, 2, 2}) * p.cos;
+    a[2] = ((v4f_t) {1, 1, 1, 1}) - p.alpha;
+
+    make_direct_I (a, b);
+   }
+
+  void set_eq (v4f_t f, v4f_t Q, v4f_t gain)
+   {
+
+    v4f_t A = (v4f_t) {.025,.025,.025,.025};
+    A *= gain;
+    A = v4f_map<pow10f> (A);
+
+    RBJv4 p (f, Q);
+
+    v4f_t atA = p.alpha * A;
+    v4f_t aoA = p.alpha / A;
+
+    v4f_t a[3], b[3];
+
+    a[1] = b[1] = -((v4f_t) {2, 2, 2, 2}) * p.cos;
+
+    b[0] = ((v4f_t) {1, 1, 1, 1}) + atA;
+    b[2] = ((v4f_t) {1, 1, 1, 1}) - atA;
+
+    a[0] = ((v4f_t) {1, 1, 1, 1}) + aoA;
+    a[2] = ((v4f_t) {1, 1, 1, 1}) - aoA;
+
+    make_direct_I (a, b);
+   }
+
+  void make_direct_I (v4f_t * ha, v4f_t * hb)
+   {
+    v4f_t *a = data(), *b = a + 2;
+
+    v4f_t ha0i = ((v4f_t) {1, 1, 1, 1}) / ha[0];
+
+    a[0] = hb[0] * ha0i;
+    a[1] = hb[1] * ha0i;
+    a[2] = hb[2] * ha0i;
+
+    ha0i = -ha0i;
+    b[1] = ha[1] * ha0i;
+    b[2] = ha[2] * ha0i;
+   }
+
+
+  inline v4f_t _process (v4f_t s)
+   {
+    v4f_t *a = data(), *b = a + 2, *x = a + 5, *y = a + 7;
+
+    register v4f_t r = s * a[0];
+
+    r += a[1] * x[h];
+    r += b[1] * y[h];
+
+    h ^= 1;
+    r += a[2] * x[h];
+    r += b[2] * y[h];
+
+    y[h] = r;
+    x[h] = s;
+
+    return r;
+   }
+
+
+  inline v4f_t process (register v4f_t s)
+   {
+    v4f_t *a = data();
+
+    register v4f_t r = s * a[0];
+
+    r += a[1] * a[5+h];
+    r += a[2+1] * a[7+h];
+
+    h ^= 1;
+    r += a[2] * a[5+h];
+    r += a[2+2] * a[7+h];
+
+    a[5+h] = s;
+    a[7+h] = r;
+
+    return r;
+   }
+
+
+
+  inline v4f_t process_no_a1 (v4f_t s)
+   {
+    v4f_t *a = data();
+
+    register v4f_t r = s * a[0];
+
+    r += a[2+1] * a[7+h];
+
+    h ^= 1;
+    r += a[2] * a[5+h];
+    r += a[2+2] * a[7+h];
+
+    a[5+h] = s;
+    a[7+h] = r;
+
+    return r;
+   }
+
+
+
+  inline float seriesprocess (float x)
+   {
+    v4f_t *a = data();
+    v4f_t s = a[7+h];
+    s = _mm_shuffle_ps(s,s,((2)<<6|(1)<<4|(0)<<2|0));
+    ((float *) &s)[0] = x;
+    s = process(s);
+    return ((float *) &s)[3];
+   }
+
+
+  void set_ab (int i, float * ca, float * cb)
+   {
+
+    v4f_t *a = data(), *b = a+2;
+
+    for (int j=0; j<3; ++j)
+     ((float *) &(a[j]))[i] = ca[j];
+    for (int j=1; j<3; ++j)
+     ((float *) &(b[j]))[i] = cb[j];
+   }
+};
+
+
+template <uint N>
+class IIR2v4Bank
+{
+ public:
+  enum { DataSize = (2 + 7*N) * sizeof (v4f_t) };
+
+
+  char __data [DataSize + sizeof (v4f_t)];
+  v4f_t * _data;
+  inline v4f_t * data() {return _data;}
+  int h1;
+
+  IIR2v4Bank()
+   {
+    _data = (v4f_t*) (((uint64) __data + 16) & ~15ll);
+    memset (data(), 0, DataSize);
+    h1 = 0;
+   }
+
+  void reset()
+   {
+    v4f_t *x = data();
+    x[0] = x[1] = ((v4f_t) {0, 0, 0, 0});
+
+    x += 2 + 5;
+    for (uint i = 0; i < N; ++i, x += 7)
+     x[0] = x[1] = ((v4f_t) {0, 0, 0, 0});
+   }
+
+  void unity()
+   {
+    v4f_t *a = data();
+    memset (a, 0, DataSize);
+    a += 2;
+    for (uint i = 0; i < N; ++i, a += 7)
+     a[0] = ((v4f_t) {1, 1, 1, 1});
+   }
+  inline v4f_t process (v4f_t s, uint n = N)
+   {
+    v4f_t *x = data(), *a = x + 2;
+
+    v4f_t acc = ((v4f_t) {0, 0, 0, 0});
+
+    register uint h2 = h1 ^ 1;
+    for (uint i = 0; i < n; ++i, a += 7)
+    {
+     register v4f_t r = s * a[0];
+
+     r += a[1] * x[h1];
+     r += a[2+1] * a[5+h1];
+
+     r += a[2] * x[h2];
+     r += a[2+2] * a[5+h2];
+
+     a[5+h2] = r;
+     acc += r;
+    }
+
+    x[h2] = s;
+    h1 = h2;
+
+    return acc;
+   }
+
+  inline v4f_t process_no_a0 (v4f_t s)
+   {
+    v4f_t *x = data(), *a = x + 2;
+
+    v4f_t acc = ((v4f_t) {0, 0, 0, 0});
+
+    register uint h2 = h1 ^ 1;
+    for (uint i = 0; i < N; ++i, a += 7)
+    {
+     register v4f_t r;
+
+     r = a[1] * x[h1];
+     r += a[2+1] * a[5+h1];
+
+     r += a[2] * x[h2];
+     r += a[2+2] * a[5+h2];
+
+     a[5+h2] = r;
+     acc += r;
+    }
+
+    x[h2] = s;
+    h1 = h2;
+
+    return acc;
+   }
+
+  inline v4f_t process_bp (v4f_t s, uint n = N)
+   {
+    v4f_t *x = data(), *a = x + 2;
+
+    v4f_t acc = ((v4f_t) {0, 0, 0, 0});
+
+    register uint h2 = h1 ^ 1;
+    for (uint i = 0; i < n; ++i, a += 7)
+    {
+     register v4f_t r = s * a[0];
+
+     r += a[2+1] * a[5+h1];
+
+     r += a[2] * x[h2];
+     r += a[2+2] * a[5+h2];
+
+     a[5+h2] = r;
+     acc += r;
+    }
+
+    x[h2] = s;
+    h1 = h2;
+
+    return acc;
+   }
+
+
+
+  void set_bp (v4f_t * f, v4f_t * Q, v4f_t * gain = 0)
+   {
+    v4f_t * a = data() + 2;
+    for (uint i = 0; i < N; ++i, a += 7)
+    {
+     RBJv4 p (f[i], Q[i]);
+     v4f_t ha[3], hb[3];
+
+     hb[0] = Q[i] * p.alpha;
+     hb[1] = ((v4f_t) {0, 0, 0, 0});
+     hb[2] = -hb[0];
+
+     ha[0] = ((v4f_t) {1, 1, 1, 1}) + p.alpha;
+     ha[1] = -((v4f_t) {2, 2, 2, 2}) * p.cos;
+     ha[2] = ((v4f_t) {1, 1, 1, 1}) - p.alpha;
+
+     make_direct_I (a, ha, hb);
+
+     if (gain) a[0] *= gain[i];
+    }
+   }
+
+  void set_eq (v4f_t *f, v4f_t *Q, v4f_t *gain)
+   {
+    v4f_t * a = data() + 2;
+    for (uint i = 0; i < N; ++i, a += 7)
+    {
+
+     v4f_t A = (v4f_t) {.025,.025,.025,.025};
+     A *= gain[i];
+     A = v4f_map<pow10f> (A);
+
+     RBJv4 p (f[i], Q[i]);
+
+     v4f_t atA = p.alpha * A;
+     v4f_t aoA = p.alpha / A;
+
+     v4f_t ha[3], hb[3];
+
+     ha[1] = hb[1] = -((v4f_t) {2, 2, 2, 2}) * p.cos;
+
+     hb[0] = ((v4f_t) {1, 1, 1, 1}) + atA;
+     hb[2] = ((v4f_t) {1, 1, 1, 1}) - atA;
+
+     ha[0] = ((v4f_t) {1, 1, 1, 1}) + aoA;
+     ha[2] = ((v4f_t) {1, 1, 1, 1}) - aoA;
+
+     make_direct_I (a, ha, hb);
+    }
+   }
+
+
+  void make_direct_I (v4f_t * a, v4f_t * ha, v4f_t * hb)
+   {
+    v4f_t *b = a + 2;
+
+    v4f_t ha0i = ((v4f_t) {1, 1, 1, 1}) / ha[0];
+
+    a[0] = hb[0] * ha0i;
+    a[1] = hb[1] * ha0i;
+    a[2] = hb[2] * ha0i;
+
+    ha0i = -ha0i;
+    b[1] = ha[1] * ha0i;
+    b[2] = ha[2] * ha0i;
+   }
+
+  void set_a (uint k, float *c, uint n = N)
+   {
+
+    v4f_t * a = data() + 2 + k;
+    for (uint i = 0; i < n; ++i, a += 7, c += 4)
+     *a = (v4f_t) {c[0],c[1],c[2],c[3]};
+   }
+
+  void set_b (uint k, float *c, uint n = N) { set_a (k+2, c, n); }
+
+
+  void set_ab (uint n, v4f_t *a0, v4f_t *a1, v4f_t *a2, v4f_t *b1, v4f_t *b2)
+   {
+    v4f_t * a = data() + 2;
+    for (uint i = 0; i < n; ++i, a += 7)
+    {
+     a[0] = a0[i];
+     a[1] = a1[i];
+     a[2] = a2[i];
+
+     a[2+1] = b1[i];
+     a[2+2] = b2[i];
+    }
+   }
+
+
+  void set_ab (int i, float * ca, float * cb)
+   {
+
+    int base = i >> 2; i &= 3;
+    v4f_t *a = data()+2+base, *b = a+2;
+
+    for (int j=0; j<3; ++j) ((float *) &(a[j]))[i] = ca[j];
+    for (int j=1; j<3; ++j) ((float *) &(b[j]))[i] = cb[j];
+   }
+
+};
+
+
+template <int ItemSize>
+class v4fState
+{
+ public:
+  char * _state;
+  v4f_t * state;
+  v4fState() {_state = 0;}
+  ~v4fState() {if (_state) free (_state);}
+
+  void init (int n)
+   {
+    size_t size = (n*ItemSize + 1) * sizeof(v4f_t);
+    _state = (char *) malloc (size);
+    memset (_state,0,size);
+    state = (v4f_t*) (((uint64) _state + 16) & ~15ll);
+   }
+
+  inline operator v4f_t * () { return state; }
+  inline v4f_t & operator [] (int i) { return state[i]; }
+};
+
+
+class Resonator4fBank
+{
+ public:
+  int N;
+
+
+
+  enum {Item = 6};
+  v4fState<Item> state;
+  int h1;
+
+  void init (int n)
+   {
+    N = n;
+    state.init (n);
+    h1 = 0;
+   }
+
+  void init (int i, v4f_t f, v4f_t r, v4f_t gain)
+   {
+    v4f_t * a = state + i*Item;
+    f *= ((v4f_t) {2*
+        3.14159265358979323846
+        , 2*
+        3.14159265358979323846
+        , 2*
+        3.14159265358979323846
+        , 2*
+        3.14159265358979323846
+        });
+    a[0] = v4f_map<__builtin_sinf> (f);
+    a[0] *= gain;
+    a[5] = v4f_map<__builtin_cosf> (f);
+    set_r (i, r);
+   }
+  void set_r (int i, v4f_t r)
+   {
+    v4f_t * a = state + i*Item;
+    v4f_t b = r;
+    b *= ((v4f_t) {2, 2, 2, 2});
+    b *= a[5];
+    a[1] = b;
+    r *= r;
+    a[2] = -r;
+   }
+
+  void reset()
+   {
+    v4f_t *y = state + 3;
+
+    for (int i = 0; i < N; ++i, y += Item)
+     y[0] = y[1] = ((v4f_t) {0, 0, 0, 0});
+   }
+
+ public:
+  inline v4f_t process (int i, sample_t x)
+   {
+    return process (i, (v4f_t) {x,x,x,x});
+   }
+
+  inline v4f_t process (int i, v4f_t x)
+   {
+    v4f_t *a = state + i*Item;
+
+    register uint h2 = h1 ^ 1;
+    x = x * a[0];
+
+    x += a[1] * a[3+h1];
+    x += a[2] * a[3+h2];
+
+    a[3+h2] = x;
+    return x;
+   }
+
+  inline v4f_t y1(int i)
+   {
+    return *((v4f_t*) state + i*Item + 3 + h1);
+   }
+
+
+  inline v4f_t processplus (int i, sample_t x)
+   {
+    v4f_t *a = state + i*Item;
+
+    v4f_t s = (v4f_t) {x,x,x,x};
+
+    register uint h2 = h1 ^ 1;
+    register v4f_t r = s * a[0];
+
+    r += a[1] * a[3+h1];
+    r += a[2] * a[3+h2];
+
+    a[3+h2] = r;
+
+    static v4f_t scale2nd = v4f(.1);
+    s = r;
+    r *= scale2nd;
+    r *= r;
+    s += r;
+
+    return s;
+   }
+
+  inline void step() { h1 ^= 1; }
+};
+
+
+class MREqv4
+{
+ public:
+
+  char __data [10 * sizeof (v4f_t)];
+  v4f_t * _data;
+  inline v4f_t * data() { return _data; }
+
+  MREqv4()
+   {
+    _data = (v4f_t *) (((uint64)__data + 16) & ~15ll);
+    unity();
+    reset();
+   }
+
+
+  void operator = (MREqv4 & b)
+   { memcpy (data(), b.data(), 9 * sizeof (v4f_t)); }
+
+  void unity()
+   {
+    v4f_t *a = data();
+    a[0] = ((v4f_t) {0, 0, 0, 0});
+   }
+
+  void reset()
+   {
+    v4f_t *z = data() + 3;
+    z[0] = z[1] = z[2] = ((v4f_t) {0, 0, 0, 0});
+   }
+
+
+  void set (v4f_t f, v4f_t bw, v4f_t gain)
+   {
+    v4f_t *a = data(), *s = a + 1;
+
+    s[0] = -v4f_map<cosf>(((v4f_t) {2*
+                         3.14159265358979323846
+                         , 2*
+                         3.14159265358979323846
+                         , 2*
+                         3.14159265358979323846
+                         , 2*
+                         3.14159265358979323846
+                         })*f);
+        a[0] = ((v4f_t) {.5, .5, .5, .5})*(gain - ((v4f_t) {1, 1, 1, 1}));
+    bw *= v4f(7,7,7,7)*f / v4f_map<sqrtf>(gain);
+    s[1] = (((v4f_t) {1, 1, 1, 1}) - bw) / (((v4f_t) {1, 1, 1, 1}) + bw);
+   }
+
+  void set (int i, float f, float bw, float gain)
+   {
+    float *a = (float*) data(), *s0 = (float*) (data() + 1), *s1 = (float*) (data() + 2);
+
+    s0[i] = -cosf(2*
+                   3.14159265358979323846
+                       *f);
+    a[i] = .5*(gain - 1);
+    bw *= 7*f / sqrtf(gain);
+    s1[i] = (1-bw) / (1+bw);
+   }
+  void unity(int i)
+   {
+    float *a = (float*) data(), *s0 = (float*) (data() + 1), *s1 = (float*) (data() + 2);
+    s0[i] = s1[i] = a[i] = 0;
+   }
+
+  inline v4f_t _process (v4f_t x)
+   {
+    v4f_t *a = data(), *s = a + 1, *z = a + 3;
+
+    v4f_t y = x - s[1]*z[1];
+    x -= a[0]*(z[1] + s[1]*y - x);
+    y -= s[0]*z[0];
+    z[2] = x;
+    z[1] = z[0] + s[0]*y;
+    z[0] = y;
+    return x;
+   }
+
+  inline v4f_t process (v4f_t x)
+   {
+    v4f_t *a = data();
+
+    v4f_t y = x - a[2]*a[4];
+    x -= a[0]*(a[4] + a[2]*y - x);
+    y -= a[1]*a[3];
+    a[5] = x;
+    a[4] = a[3] + a[1]*y;
+    a[3] = y;
+    return x;
+   }
+
+
+  inline float seriesprocess (float a)
+   {
+    v4f_t *c = data();
+    v4f_t x = _mm_shuffle_ps(c[5],c[5],((2)<<6|(1)<<4|(0)<<2|0));
+    ((float *) &x)[0] = a;
+    v4f_t y = x - c[2]*c[4];
+    x -= c[0]*(c[4] + c[2]*y - x);
+    y -= c[1]*c[3];
+    c[5] = x;
+    c[4] = c[3] + c[1]*y;
+    c[3] = y;
+    return ((float *) &x)[3];
+   }
+};
+
+}
+
+typedef double cabinet_float;
+
+typedef struct {
+ sample_t gain;
+ cabinet_float a[32], b[32];
+} Model32;
+
+class CabinetIII
+: public Plugin
+{
+ public:
+  sample_t gain;
+
+  static Model32 allmodels[];
+
+  Model32 * models;
+  int model;
+  void switch_model (int m);
+
+  int h;
+  cabinet_float * a, * b;
+  cabinet_float x[32], y[32];
+
+  void cycle (uint frames);
+
+ public:
+  static PortInfo port_info [];
+
+  void init();
+  void activate();
+};
+
+
+
+template <uint N, uint FIR>
+class ParModel {
+ public:
+  float gain;
+  float a1[4*N], a2[4*N], b1[4*N], b2[4*N];
+  float fir[FIR];
+};
+
+class CabinetIV
+: public Plugin
+{
+ public:
+  uint remain;
+
+  int over;
+  DSP::Oversampler<2,32> over2;
+  DSP::Oversampler<4,64> over4;
+
+  int model;
+  void switch_model (int m);
+
+  enum {
+   N = 64/4,
+   FIR = 128
+  };
+  DSP::IIR2v4Bank<N> bank;
+  DSP::FIRv4<FIR> fir;
+
+  double gain;
+
+  void cycle (uint frames);
+  template <class O, int Ratio> void subcycle (uint frames, O & Over);
+
+ public:
+  static PortInfo port_info [];
+
+  void init();
+  void activate();
+};
+inline void
+processor_specific_denormal_measures()
+{
+
+
+
+
+
+
+
+ _MM_SET_FLUSH_ZERO_MODE (
+                         0x8000
+                                          );
+
+}
+
+
+
+
+class DescriptorStub
+: public LADSPA_Descriptor
+{
+ public:
+  DescriptorStub() { memset(this,0,sizeof(*this)); }
+
+  ~DescriptorStub()
+   {
+    if (PortCount)
+    {
+     delete [] PortNames;
+     delete [] PortDescriptors;
+     delete [] PortRangeHints;
+    }
+   }
+};
+
+template <class T>
+class Descriptor
+: public DescriptorStub
+{
+ public:
+  LADSPA_PortRangeHint * ranges;
+
+ public:
+  Descriptor (uint id) { UniqueID = id; setup(); }
+
+  void setup();
+
+
+
+  void autogen()
+   {
+    Properties = 
+                0x4
+                       ;
+    PortCount = (sizeof (T::port_info) / sizeof (PortInfo));
+
+    ImplementationData = T::port_info;
+
+
+    const char ** names = new const char * [PortCount];
+    PortNames = names;
+
+    LADSPA_PortDescriptor * desc = new LADSPA_PortDescriptor[PortCount];
+    PortDescriptors = desc;
+
+    ranges = new LADSPA_PortRangeHint [PortCount];
+    PortRangeHints = ranges;
+
+    for (int i = 0; i < (int) PortCount; ++i)
+    {
+     names[i] = T::port_info[i].name;
+     desc[i] = T::port_info[i].descriptor;
+     ranges[i] = T::port_info[i].range;
+     if (desc[i] & 
+                  0x1
+                       )
+      ranges[i].HintDescriptor |= (
+                                 0x1 
+                                 | 
+                                 0x2
+                                 );
+    }
+
+
+    instantiate = _instantiate;
+    connect_port = _connect_port;
+    activate = _activate;
+    run = _run;
+    cleanup = _cleanup;
+   }
+
+  static LADSPA_Handle _instantiate (
+    const struct _LADSPA_Descriptor * d, ulong fs)
+   {
+    T * plugin = new T();
+
+    LADSPA_PortRangeHint * ranges = ((Descriptor *) d)->ranges;
+    plugin->ranges = ranges;
+
+    int n = (int) d->PortCount;
+    plugin->ports = new sample_t * [n];
+
+    for (int i = 0; i < n; ++i)
+     plugin->ports[i] = &(ranges[i].LowerBound);
+
+    plugin->fs = fs;
+    plugin->over_fs = 1./fs;
+    plugin->normal = 1e-20;
+    plugin->init();
+
+    return plugin;
+   }
+
+  static void _connect_port (LADSPA_Handle h, ulong i, LADSPA_Data * p)
+   {
+    ((T *) h)->ports[i] = p;
+   }
+
+  static void _activate (LADSPA_Handle h)
+   {
+    Plugin * plugin = (Plugin *) h;
+
+    plugin->first_run = 1;
+   }
+
+  static void _run (LADSPA_Handle h, ulong n)
+   {
+    if (!n) return;
+
+    T * plugin = (T *) h;
+
+
+
+    if (plugin->first_run)
+    {
+     plugin->activate();
+     plugin->first_run = 0;
+    }
+
+    plugin->cycle (n);
+    plugin->normal = -plugin->normal;
+   }
+
+  static void _cleanup (LADSPA_Handle h)
+   {
+    Plugin * plugin = (Plugin *) h;
+
+    delete [] plugin->ports;
+    delete plugin;
+   }
+};
+
+Model32
+CabinetIII::allmodels[] =
+{
+
+ {
+  1.000000,
+  {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
+  {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
+ },
+ {
+  0.297964,
+  {0.0278346166015,0.0848194352761,-0.0953075112981,0.0400599511643,-0.0241677661597,-0.0120347700071,-0.0105021056765,-0.00631847906313,0.0142808849172,-0.00975694728286,-0.0086835411626,-0.0101143521865,0.0418824932343,-0.027149857207,0.0323595121531,0.00806643298997,-0.0225102286873,-0.00940228428314,-0.00848439890007,0.00307815046102,-0.0100345753997,0.0116577363984,-0.0246590919263,0.034138303662,-0.00370643311065,0.00297211357181,0.00414092674394,-0.00718102425539,0.00269270176152,-0.0165821532816,0.00290028387549,-0.00549787118151},
+  {-1.0,3.85855562664,-6.56415173422,6.23510637035,-3.22507666806,0.480079693515,0.144896740451,0.530217103611,-0.8020754909,0.395595698101,0.100038946511,-0.742234999313,1.49060062695,-1.67596136257,0.951821544636,0.381632080747,-1.39833594348,1.27532002921,-0.345878122053,-0.309804613435,-0.0411168032813,1.27534888306,-2.36749016557,2.27255376901,-1.22640057901,0.324252969463,-0.0497051461709,0.0907647867953,-0.078428076678,-0.0179189827774,0.0541184085853,-0.0199074749777}
+ },
+ {
+  0.324089,
+  {0.0415171384811,0.134360012085,-0.105446832146,0.0232827107318,-0.0371629856884,-0.029693292348,-0.00828994357036,-0.007646662263,-0.0382464871043,0.0185069748207,-0.00187819574864,0.0443369508539,0.0212304579412,-0.00859312798725,-0.00951195942302,-0.00548289405317,-0.0260155420687,-0.00441738317252,-0.0209096850275,0.0149914050128,0.00710699120652,0.0197297319054,0.0111272763064,-0.00959805483123,0.00214388473172,0.00316023886343,-0.00975831288926,-0.00600358584987,0.00764147823913,-0.019124167339,0.0180197449987,-0.00723768660329},
+  {-1.0,3.12465587931,-4.19656843424,3.52662402657,-2.39523876289,1.06759646245,0.150518199604,-0.0260594262901,-1.15166728634,1.90488075056,-1.88335746388,1.32603540448,-0.488012085645,0.130297810791,-0.489779679734,1.08579349063,-1.47966752488,1.33358532838,-0.765029702279,0.389940895742,-0.386125417754,0.446752952441,-0.525354277138,0.576700256906,-0.348840284246,-0.0113121004823,0.153951983114,-0.159109958543,0.183877241665,-0.133437127876,0.0173165960317,0.0162427114845}
+ },
+ {
+  0.329318,
+  {0.0422962754965,0.116994719141,-0.125644772208,0.073598933118,-0.0803803572158,0.0292035038888,-0.0349795151569,0.0208136447416,-0.0179647570901,-0.0100669790949,0.0167386389215,0.0173735093815,0.0167713509135,-0.0244084981983,0.00432068064363,-0.020781875919,0.0119333111019,-0.0396539744438,0.0353306314,-0.045286155383,0.0174704718921,-0.00587113971255,0.0232439985001,-0.00224128702745,0.00386142310404,0.00901083519063,-0.0141397120573,0.0190555373552,-0.0308016636247,0.0141803968654,-0.0233487908568,0.0040565808435},
+  {-1.0,3.4148934207,-5.22579778766,5.02680812224,-3.78821988747,2.37698406169,-1.15165814089,0.620213062012,-0.349541861569,-0.114305643389,0.0914336141532,0.625388551381,-1.45690807409,1.99429747327,-1.73619288887,0.747822316507,0.241420988084,-0.987093593248,1.46294732807,-1.3295211108,0.775515509482,-0.295579137932,-0.114662387756,0.476640043418,-0.670823609381,0.739611547173,-0.662632557607,0.409323419079,-0.14797199574,0.00695035566391,0.0303398204249,-0.0161614198712}
+ },
+ {
+  0.308208,
+  {0.0567150339484,0.0862529126422,-0.104488031689,0.00870294410145,-0.065008842559,0.0240028729306,-0.0252076785236,0.00445751643631,0.00448801400403,0.029139018892,-0.0151661634356,0.0247882870752,-0.00998311520916,-0.0131166490144,0.0337185158825,-0.0194690601436,0.000373284051976,-0.0461948503346,-0.00263170723995,0.0087391618231,0.0123469077677,0.00420640140511,0.0286647379282,-0.0109617190276,-0.0018592481626,0.0080433919558,-0.0300917678306,0.0110236949511,0.00408101918602,0.00671229154972,-0.00374368469903,-0.00658205895128},
+  {-1.0,3.57244137202,-5.69481614454,5.64029649883,-4.11811724948,2.51707774357,-1.6095833501,1.35501693319,-1.43361475646,1.55111698965,-1.36499888422,0.73511443103,0.460482481484,-1.899860115,2.58501344122,-2.20342428809,1.52671562376,-1.08935718278,0.793222447831,-0.430586230915,0.121392786852,-0.180348936219,0.365582776142,-0.0793475632648,-0.699279700597,1.37552231311,-1.43610084247,0.962951095871,-0.368371630783,-0.0208393827203,0.0928657287639,-0.0281178742415}
+ },
+ {
+  0.308023,
+  {0.0319609567523,0.0766048503978,-0.0834799987584,0.0641687999269,-0.0502583655055,0.0343282065711,-0.0344061925794,0.0233287287476,-0.0461912755058,0.0172214886387,-0.0119838960587,-0.00813777174589,-0.00543911779947,-0.00503343673981,-0.0145269661188,0.0117326929196,0.0131024434199,-0.000644788156196,0.013599557416,-0.0147163668928,0.0109460567533,-0.000292411894631,0.00527225713667,-0.0144728353026,0.00963063410954,-0.0183556313846,0.0104100124394,-0.00771896711119,0.00108958732484,-0.00264500143915,-0.0054441124077,0.00346325131443},
+  {-1.0,3.64608167975,-5.88846504086,5.69461601423,-4.30094904787,3.58199912063,-3.42562759694,3.4656373407,-3.74228944525,3.54141833475,-2.39992865242,1.23829956407,-0.9106749997,1.27375666831,-1.72832558657,1.69004113574,-1.19206495848,0.784390357548,-0.500093382319,0.123325062084,0.0240097510815,0.0444156751002,0.324072950966,-1.00425770399,1.28367169782,-1.24369248861,1.20429351855,-0.87892333308,0.231424289965,0.184639179021,-0.165289836904,0.0384474694686}
+ },
+ {
+  0.359358,
+  {0.0190042480826,0.0897675642301,-0.0804086070009,0.0377925367694,-0.0295853992674,0.0194095233341,-0.0453399420659,0.0199810606247,-0.0037696310194,-0.0170956279881,0.031617048041,-0.0280758843077,0.0248633208745,-0.021773039829,0.0247262627408,-0.0341387769363,0.0100084194017,0.0108816252884,-0.0182515182884,-0.00486526074953,0.000591909872312,0.00704968492764,-0.0186070380409,0.0213286540683,-0.00149964104223,0.0012220970362,-0.00640330430029,0.00235308377072,-0.000882630761367,-0.00138600139137,-0.000462631723554,-0.00752227668701},
+  {-1.0,4.29324084693,-9.13487584298,12.964120664,-14.1897015411,13.5279508117,-12.5053356478,11.5587063195,-10.020933903,7.30372667216,-3.48780646551,-0.691114679925,4.08468071729,-5.93380114329,6.50159512956,-6.44706394463,5.90550277842,-4.52694609905,2.45072425308,-0.416398024124,-1.07289015135,2.09695694046,-2.84878640643,3.29480772742,-3.33568176103,3.05061639728,-2.58698840471,1.9289922448,-1.11973311273,0.44742226953,-0.104452027272,0.00781708682996}
+ },
+ {
+  0.314517,
+  {0.0344249196351,0.0797957248373,-0.0678511902545,0.0347065516092,-0.0863649776308,0.0828863800441,-0.0537533301902,0.0441489919572,-0.0572582129913,0.0106543564337,-0.0043829851854,0.0239323469433,0.00334726894483,-0.0109464906822,-0.00883482345855,-0.00653099758416,0.00185717388328,0.00935862834652,0.00228173355247,-0.0055150768621,-0.0234423595727,-0.00531151838704,0.0176501790409,-0.000195627352985,0.0107901389843,-0.00835440879464,-0.000231825400666,0.0011683704874,0.00961998468864,-0.00740702759267,-0.00742421308883,-0.0135061214485},
+  {-1.0,3.84708042246,-7.14614547585,9.31853521271,-10.7849705832,11.7958855103,-11.2584673568,9.02381063948,-6.4433602052,4.27597661413,-2.17984483696,0.230625402378,0.959873392289,-1.33858336147,1.53389915601,-1.67142239291,1.34834517292,-0.732541090604,0.305245715218,0.0773195065231,-0.469114524739,0.380218475304,0.147804233613,-0.499203886787,0.473080064261,-0.319670293136,0.115582251037,0.174661918908,-0.417648105618,0.448043142732,-0.273737871317,0.0761476390111}
+ },
+ {
+  0.322221,
+  {0.0557462386787,0.199000674182,-0.0945173574265,0.021465846647,-0.115490456855,-0.0580339437486,-0.0207939221364,0.0141453368581,0.00100195685568,0.0438253192495,0.0158693520151,0.0402170363874,-0.00458527925237,-0.0378026583019,-0.0470156175361,-0.0275984994955,-0.0137668689487,0.0157085995741,0.00442331500001,0.038589012906,-0.0244029484172,0.0194267074269,0.00324357172213,-0.0208227729065,0.0176805109506,0.000660308911331,0.0214351754372,-0.0310266325308,-0.00554771050575,-0.0114860889457,0.00675873118395,-0.000636905435237},
+  {-1.0,2.7463259832,-3.29470519245,2.60205730694,-1.75471167871,1.17705685206,-1.16131534069,1.49115846798,-1.64006629191,1.36006662573,-0.820335807248,0.643992154588,-0.81837180616,0.841614479559,-0.592707797775,0.30525550444,-0.0642753019632,0.163843332102,-0.718052010757,1.28812073116,-1.53005644745,1.2365913632,-0.590659469528,0.142256527991,-0.0611187645244,0.162420234609,-0.134099643801,-0.0591723887005,0.136902343232,-0.16779075808,0.180977351298,-0.0773146795199}
+ },
+ {
+  0.367744,
+  {0.03793502599,0.154727620399,-0.0286236985568,0.125864767062,-0.121480270829,0.053493734898,-0.12637280613,0.0239879412843,-0.0908453580039,0.0324396810594,-0.0592105558846,0.0335906359692,-0.0588970095936,0.0434764051901,-0.0289199014462,0.0500710687139,-0.0351479684529,0.0267573169718,-0.0308911305379,0.0233094489737,0.00781323897793,0.0398598414598,0.0215694302252,-0.00278469562828,0.00870138084984,-0.051406976077,0.0177526994787,-0.0358979075121,0.0131687908485,-0.0118921955427,-0.0104357633702,-0.0200735827425},
+  {-1.0,3.05615405185,-5.04894894179,6.40097409574,-7.01754862592,7.08663522233,-6.71999014097,6.10438913784,-5.55641690689,5.29422454655,-5.13097733132,5.13167769918,-5.40837371459,5.59267623557,-5.55890096112,5.43736751994,-5.22732166864,4.88140625617,-4.42101909786,3.93825155661,-3.59896868262,3.23975790835,-2.66550020635,2.02710777387,-1.35834062171,0.718733221941,-0.326814760005,0.25712323727,-0.324213484911,0.322407447183,-0.181104455927,0.0451536011222}
+ },
+ {
+  0.336933,
+  {0.0486002378166,0.137913866638,-0.126956139744,0.0343440220471,-0.0512008493055,-0.0430975887385,0.0477147802263,-0.0289541218874,-0.015451153119,0.0300745444554,0.0267729388133,-0.00801800544566,0.00691058781321,-0.0382891133947,-0.0409594818537,0.0049625930889,0.00919927792713,0.0128613183754,0.0168573450249,-0.0133344589157,0.00518516293661,-0.0154809180061,-0.000678567281429,0.0183607158673,0.00158209368268,0.0204093984489,-0.034834610107,0.0319542805183,-0.0182020477211,0.0197891272445,-0.0153744487774,-0.0245055727801},
+  {-1.0,3.19579380913,-4.43863990309,3.72209878762,-2.08078841242,0.18159320185,1.20381137174,-1.10905446066,0.114131043793,0.417287677774,-0.180916451391,-0.342937225826,0.768863753298,-0.625369968229,-0.0061834492926,0.366838921235,-0.193707024916,-0.198564290609,0.585570823077,-0.667572129611,0.29137019032,0.234737344638,-0.637604749342,0.747757704552,-0.574303960019,0.601361850468,-1.05141030217,1.42829870934,-1.501686944,1.32683005621,-0.79236308637,0.212296987712}
+ },
+ {
+  0.337571,
+  {0.0645253956318,0.15191071968,-0.147356112101,-0.0020884213643,-0.0336726595518,-0.035220159535,-0.0126209859901,-0.00697985879664,0.022032599724,0.0514466708624,0.0180080050018,-0.0236265081338,-0.00711071145998,-0.00909921162731,-0.0585473918842,0.0182905392628,0.00901100663319,0.0272243441401,0.00156177646218,0.00038020624146,-0.0143902564653,0.0202765420394,-0.0125073444801,-0.0180994671541,-0.000146719456577,0.0273216220304,-0.0174309744669,0.0130499065471,0.000103550470795,-0.0249963047183,0.0151568087434,-0.0208432962292},
+  {-1.0,2.96126718857,-3.45821344231,1.9886734421,-0.562075616502,-0.172407181364,0.862731740457,-1.38375442074,1.19484499659,-0.652791545414,0.565541536528,-0.755574968388,0.405436518064,0.584185750207,-1.32676645664,1.32100543632,-1.05255460425,0.754681298898,-0.276678718751,-0.0353380941049,-0.0537708955546,0.226734422117,-0.220780759716,0.174141319892,-0.341911674216,0.568003825905,-0.57268431707,0.37233272692,-0.100237622902,-0.0596732432978,0.0389533706966,0.00429996259289}
+ },
+ {
+  0.326472,
+  {0.0352369174361,0.0990866593386,-0.0867160236808,0.0370713211417,-0.0316807265848,0.00475739401955,-0.0318911640487,0.017066360352,-0.0423909852827,0.00365337384176,0.0194515701626,-0.00073952210658,0.0187508659465,0.0144005765064,-0.0264454440799,0.0104400332806,-0.00631991676892,-0.0131901650597,-0.0238143426299,0.00282253991291,-0.0242964721753,0.0224843693994,0.0277528760719,-0.000125078873862,-0.00563736853266,0.0127312200877,0.00947056402382,-0.0203962807834,-0.00265820184968,-0.00807241892968,-0.0029614800021,-0.00859523710436},
+  {-1.0,3.52706658227,-5.51719859072,4.9848836109,-2.65053799169,0.361627476138,0.458907425164,0.617729950321,-1.97428610003,1.60876809729,0.103976958977,-1.4057515974,1.11955298382,0.712380791303,-2.45310536406,2.42331271148,-0.867765053543,-0.531316911039,0.585862975715,0.57985480157,-1.86230088819,1.97555360161,-0.796866780802,-0.374696399183,0.392478731566,0.461135741265,-1.10894621775,1.0416333808,-0.562359688344,0.146578456671,0.00751754685458,-0.00855433589129}
+ },
+ {
+  0.348142,
+  {0.056293245405,0.151811342348,-0.107149064271,0.0871964008404,-0.118859965761,0.0401551850541,-0.0583121334964,0.0459887816232,-0.053185386141,0.00720871062564,-0.0317168228042,0.0247965593967,0.0125779813303,-0.00142914784686,0.00653623892318,-0.0035345661272,-0.0285245356239,0.0035080169519,-0.0282455660499,0.00143082853199,-0.0280711266922,0.0146700124573,0.0295186904254,0.0181321096052,0.00665832022864,0.0135823830134,-0.0133089961773,0.00294134744847,0.0119329745518,-0.0482594070179,0.00175344870875,-0.022560516512},
+  {-1.0,3.02530960783,-4.2635017331,4.18790337823,-3.89830217251,3.45542230875,-2.57228147415,1.84473812285,-1.18207176474,0.426096741799,-0.143156983854,0.0685339329089,0.289874293557,-0.329411109138,-0.124464720133,0.657754214498,-1.18334308523,1.54836169129,-1.57658313933,1.63232925673,-1.61156697646,1.08268356399,-0.601760679662,0.616126274644,-0.699570892184,0.666735846987,-0.604260762574,0.287847030567,0.216186561792,-0.405280471265,0.23211109001,-0.0519295690926}
+ },
+ {
+  0.342963,
+  {0.0636743158102,0.262007856948,-0.140663902623,-0.0612527476563,-0.0210354380765,-0.071233099139,0.0373292784193,-0.11043869161,0.044365121117,0.065989108338,-0.015054834878,0.049579772912,-0.0794968237547,-0.00335787600012,-0.00952941881786,-0.0518376915842,0.111773969086,0.00820948285191,-0.0133931773931,-0.0338445536298,-0.0593999373905,0.0187296082489,-0.0255415973334,0.00314235781516,0.0177091958286,0.0371307476827,0.0446094781406,0.0165655412512,-0.0369492884125,-0.0141722237182,-0.00946664750867,-0.0298338263778},
+  {-1.0,2.56814774087,-2.71214610847,1.7834071396,-1.37627865695,1.12490492369,-0.218113055482,-0.420791127814,0.0592110041818,0.422530367905,-0.374414235473,0.405715588043,-0.854359411713,1.22066275696,-1.13561688526,0.826933178603,-0.585191042038,0.295059940918,0.177456637116,-0.212836102358,-0.332931614583,0.623702510429,-0.380057347404,0.309012257932,-0.562950254894,0.534354682926,-0.425087162088,0.667059812279,-0.862836182324,0.63440943683,-0.264608219471,0.0538218094236}
+ },
+ {
+  0.343892,
+  {0.026286015287,0.0907600580728,-0.0834758404272,0.0773681577442,-0.0627093838038,0.0139372716433,0.0224433832524,-0.0466137693061,0.0501306110122,-0.0534222739157,0.0156224362785,-0.000390186637714,-0.0323237095133,0.0143224446662,-0.0287387322484,0.0155821975304,-0.00285930343908,0.00185521965317,-0.000251808206545,-0.00435837522963,-0.0171453773541,0.0103575026706,-0.010541769426,0.0220792242276,-0.0142339959925,0.006085388315,-0.00372061064905,-0.00944170429588,0.0109893544261,-0.00696813289816,0.00617150002068,-0.00282952020276},
+  {-1.0,4.27203311074,-9.4219667949,14.254237169,-16.1484087166,13.6520709904,-7.57964432449,0.110659656516,6.60137420619,-10.5598928994,10.695746696,-7.42196628789,2.25372681403,2.81348190908,-6.08549031446,7.01318085141,-5.93630364881,3.72721086513,-1.62790382607,0.54935328498,-0.646746413498,1.61124236447,-2.87306445743,3.82067539228,-4.05604021283,3.36157062865,-1.91000595478,0.418944831231,0.452577693678,-0.605197786365,0.345573569391,-0.0850505081638}
+ },
+ {
+  0.287925,
+  {0.0553567223251,0.108944645884,-0.167486225245,0.0659313669447,-0.101516160149,0.0407242608874,0.0364266447341,-0.020235265008,-0.0424023449895,0.0209802321019,-0.0097433818907,0.0753488200735,-0.0363073062533,0.0405032778471,-0.0742814714057,0.0203823314999,-0.0127054552363,-0.020815864624,0.0347327394802,-0.0158946502788,5.08820371009e-06,0.0224923254439,-0.0242644556343,0.0193490923077,0.0260102234874,-0.0331929196278,0.0101483350319,-0.0301249314684,0.013390467519,0.00602228331321,0.00501064003586,-0.00585752164308},
+  {-1.0,3.33652354675,-4.67206995684,4.01745236218,-2.81152187353,1.43979531041,-0.0910790485494,-0.381082604706,-0.212712928465,1.35285480591,-2.21281806416,2.60837578964,-2.89171558742,2.79120328982,-2.0246695785,0.977198823747,0.012593020977,-0.706813852886,0.687512532801,0.140542218361,-1.17712864461,1.67688808802,-1.40449287296,0.594776075722,0.283736752873,-0.757092951284,0.679742981441,-0.3018857026,0.0239028443565,0.0142871793469,0.0108867295064,-0.00520813730442}
+ },
+
+
+ {
+  1.000000,
+  {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
+  {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
+ },
+ {
+  0.315285,
+  {0.0280945673585,0.104049704633,-0.0992504206968,0.0305535866313,-0.0197077743193,-0.0235026900687,-0.00760171596063,-0.00499583493171,0.0196381160874,-0.0231699963634,-0.0191015143213,0.0444533017164,-0.00935705876968,0.0254842317103,0.01443174703,-0.0311348258072,-0.0148954094538,-0.00647796888484,-0.00821619565165,0.00965378492733,-0.0195561820615,0.0182593938014,0.0201784008831,-0.0138520246996,0.0157087801864,-0.00849850936313,0.00150725734818,-0.0176917251784,-0.00217355067089,-0.00364632520696,-0.00108824267139,-0.000296770567039},
+  {-1.0,3.74803072913,-6.30017372298,6.03100499285,-3.12760364239,0.0631940639625,1.20867641433,-0.805282339315,0.0998244471421,0.400126632964,-1.1996917332,1.99361608166,-1.95429848315,1.09957712783,0.110631815191,-1.0117489652,0.97214414492,-0.0423049075549,-1.25001586224,2.2826692669,-2.34373229634,1.25230472504,0.135668288332,-0.879083189975,0.879295999345,-0.54435189937,0.221937091305,0.010685657883,-0.189773454508,0.238726032279,-0.13399901736,0.0287326736952}
+ },
+ {
+  0.342093,
+  {0.0417681150138,0.156476453479,-0.113925536443,0.00578800779355,-0.0290618198362,-0.0389060230608,0.0125695705598,-0.0391959274955,-0.0145834119721,0.0222690593631,0.026993579784,0.0404858219244,-0.0334554141904,-0.00648373062688,-0.0079821349869,-0.00996660015294,-0.00420761127468,-0.018590275465,0.0157764373566,0.0169900158284,0.012178801658,-0.0205826564994,0.0066290495229,0.0031935246776,-0.00628065563096,0.0137066722522,0.00291985407983,-0.0149928461304,0.0167813001539,-0.00679997652787,-0.0157351796644,-0.00831035539088},
+  {-1.0,3.01921887537,-3.83727915797,2.97078937174,-2.02886715337,1.04716943592,0.511008092791,-1.40168723414,0.831638191657,0.157060394377,-0.905246881326,1.52885984261,-1.55714620961,0.848730376428,-0.057232274639,-0.470521138003,0.666003110427,-0.340500731821,-0.20843081182,0.445177312791,-0.384768635053,0.17405324808,0.222755170071,-0.555085792755,0.481669827598,-0.245484045179,0.174836118667,-0.0843035338587,-0.161824943942,0.292977700986,-0.190179741011,0.0513898859896}
+ },
+ {
+  0.344986,
+  {0.0437820143998,0.139531711619,-0.127103563396,0.0457744720806,-0.0552707039423,0.00223376511818,0.00189543115494,-0.00944207156066,-0.01580130316,-0.0116636656109,0.040732435983,0.0146263947352,-0.0119980542548,-0.0263728946517,0.00856071191126,-0.0275151219501,0.0189927357088,-0.0101162052988,-0.0215420313039,-0.000490223270253,0.03100178709,-0.0133674602195,0.00763431047179,0.0039846814804,0.00312094121566,0.00260912716631,-0.00642708729308,-0.00726726138514,-0.0100013787577,-0.00682140837256,0.00487960852482,-0.0105360892904},
+  {-1.0,3.27861084591,-4.77123070971,4.28244420787,-3.04281796603,1.79239782991,-0.513640393101,-0.0512030474569,0.0184724020718,-0.45852635318,1.16698820289,-1.54319360187,1.77661116503,-1.57915568801,0.853395005336,-0.347931493612,0.0844025482544,0.45392535283,-0.789695608789,0.514309177106,-0.147129085196,0.00351496830405,-0.0299847004476,0.18928543243,-0.255346303014,0.0732922599619,0.156440309656,-0.312874970598,0.408692135627,-0.350892053274,0.164781455355,-0.0314806520822}
+ },
+ {
+  0.311001,
+  {0.058318156749,0.127607332145,-0.122186650857,-0.0161615890153,-0.0580943748622,-0.00155755534642,-0.00519386874954,-0.00661561549124,0.0376785727692,0.00570959578938,0.0162567397227,0.0043646825103,-0.0297630953991,0.0348714573369,-0.0161653172837,-0.0193045305812,-0.0439040549845,0.0013253058251,0.0134035242078,0.00924925289529,0.029911284582,0.0100992347455,-0.0124366888576,0.0117512811251,-0.0327085427297,-0.00488197142677,0.027789492259,-0.00928344003499,0.0100312640546,-0.0147337095774,-0.00174390794614,-0.0047420701833},
+  {-1.0,3.35229613767,-4.94509243403,4.41020756688,-2.58908351056,0.656264973531,0.570503785602,-0.92817498379,0.645616830936,-0.0175799251366,-0.594894007676,1.31205690754,-2.02341769308,2.01047185931,-1.24296334404,0.497929619582,-0.214896028964,0.319583458035,-0.397260516936,0.156897571684,0.0273052952349,0.221232252694,-0.682638414852,0.887076322125,-0.558680529626,-0.124271156544,0.787128805672,-1.13694173218,1.01177267471,-0.601277713143,0.235457119508,-0.047376359197}
+ },
+ {
+  0.318253,
+  {0.0328027568758,0.097731563376,-0.0891769675666,0.0471637083398,-0.0249008818126,0.0179653736496,-0.0277859043669,0.000727259843442,-0.0289050107673,0.0252157855949,-0.0362028897875,0.00178521228859,-0.0111209706342,-0.0114208007778,0.0165781580121,0.0061661306704,0.00719132190557,-0.000442040307733,-0.00964515245733,0.0122792136304,0.00759256436545,-0.0162019561412,0.00892139785508,-0.00680610648461,0.00712771077934,-0.00958026308563,0.00088309247527,-0.00385305925474,0.00272621568559,-0.00130244770661,0.000209196417944,-0.0177018377569},
+  {-1.0,3.49741144969,-5.28808745943,4.37142455921,-2.34261037571,1.52338452655,-1.51689553734,1.31809960709,-1.53506444922,2.47967904213,-2.93917785921,2.22292429928,-1.04192941451,0.237956220462,-0.0445472088669,0.164526806484,-0.160528167045,0.154191457596,-0.465356008604,0.567050446426,0.105364574904,-0.801837650163,0.662793667215,-0.279422150708,0.400043959678,-0.48215979042,-0.0396828997455,0.515443796338,-0.310129095451,-0.0935470092136,0.156971715933,-0.0449306999625}
+ },
+ {
+  0.365289,
+  {0.0196054838598,0.122277316047,-0.0668235499195,0.00182972560887,0.00191239456974,-0.0151886873028,-0.0345597370657,0.0191202281163,-0.0290278249911,0.0268582284418,-0.00629570944418,0.0028244025948,0.00638254066275,0.0046992569752,-0.0377492323257,0.0103148618298,0.0104675165835,-0.0205562013301,-0.00834579907236,0.00906532823913,-0.00472332068176,0.00247703222006,0.00926873536523,-0.00201579600835,0.00477821937185,-0.00445789783686,-0.00522457214847,0.00369695570142,-0.0020305744953,-0.0184580622727,0.00563297104294,-0.00808056201994},
+  {-1.0,3.87658694466,-7.46816470847,9.52549438441,-9.1829301439,7.59276338149,-6.45228043941,6.51635645355,-7.50198314794,8.79339270963,-9.70357364902,9.53677441151,-8.25530971599,6.83558800635,-6.2167957872,6.32966739075,-6.34386579238,5.86048525563,-5.14170733222,4.43572583598,-3.71212065025,3.03934226564,-2.64766962632,2.5523627568,-2.48403177887,2.19234429029,-1.75002325814,1.38662472421,-1.0828159115,0.709628709178,-0.318997654283,0.0706244975525}
+ },
+ {
+  0.326832,
+  {0.03464275226,0.11001485404,-0.0812538255456,0.0124599783973,-0.0706347794136,0.09449740463,-0.0643424291234,0.0369528668351,-0.0805619634623,0.0530576520335,-0.0116510402059,0.0368623687518,-0.0422713196941,0.0091281132503,-0.0139546006896,0.0125908141756,0.00848433756367,0.0011299842446,-0.0236780535289,-0.0280292001671,0.0275628298268,0.00681964496917,0.00426912357836,-0.00886809847108,-0.00333178622976,0.00577948642528,0.00729728954949,-0.0140508750454,-0.0162549627392,-0.0106048389112,0.0103609422123,-0.00217520310752},
+  {-1.0,3.62197936874,-6.18186939201,7.21375633526,-7.88488270953,9.30333902109,-10.2766271873,9.65058456729,-8.31309793031,7.49476462787,-6.86674836811,5.69800711244,-4.2965946117,3.46522157073,-3.05030821495,2.30161301279,-1.34310492392,0.878598546562,-0.618011077573,-0.114621435303,0.840274095202,-0.801309565608,0.310803960474,-0.0731085425924,0.0566042384429,0.131827764786,-0.449771522182,0.569535316077,-0.377253112676,0.0840241989377,0.0482245657333,-0.0262460551803}
+ },
+ {
+  0.345228,
+  {0.0558865703642,0.216856581451,-0.135190485698,0.0272854955006,-0.15096300331,0.0039286966471,-0.00785944138835,-0.0246787351683,0.0285005015478,0.0227847938955,0.0487700850417,0.00937843104342,-0.0434943900951,-0.0416011750268,-0.0318905939186,-0.0038771245921,0.0164174086376,0.00628298040469,0.0200980086631,-0.0219764959322,0.032505766629,-0.0209349941542,0.0425583916193,-0.014064752799,0.0217036764566,-0.0318905930993,-0.0136440165827,0.00295747442186,0.00181294623449,-0.0108998166966,-0.0247516772807,0.0259336711206},
+  {-1.0,2.81558979161,-3.53523814269,2.97015110113,-2.1502540075,1.30480575764,-0.543734220907,0.246111825349,-0.540975807946,0.971375922246,-0.883540442918,0.490534994815,-0.324718902858,0.471980628523,-0.644032655253,0.87321745175,-1.08151399234,0.957272036645,-0.516591061715,-0.0878166257405,0.571090648363,-0.799776896639,0.864747485823,-0.731983099915,0.503222456961,-0.316459541382,0.113352777609,-0.0850058835877,0.267147480716,-0.320685634324,0.174889950483,-0.0388740695666}
+ },
+ {
+  0.374207,
+  {0.0392791554332,0.195267047794,0.0123069561678,0.119243200454,-0.0847928158579,-0.000174506467018,-0.124517331888,0.00575457727875,-0.0765106321545,0.0509892752549,-0.0607760295438,0.00381192532687,-0.0790139680297,0.00011207945643,-0.0318169550053,0.0246598673999,0.000716487122319,0.020139149137,0.0176149505594,0.0523132356609,0.0500158453523,0.0130310294118,0.0185702532303,-0.0283774292442,0.0107829579914,-0.0128418451269,0.00243044901123,0.00698117606704,-0.0206044185851,-0.0473587435657,-0.0341107026614,-0.0670437332375},
+  {-1.0,2.70265768224,-4.01059425591,4.59350436186,-4.53255184779,4.35070490173,-4.30484609436,4.20313545256,-4.03430096328,4.02397794661,-3.81169031219,3.42163322037,-3.1095119937,2.82304183072,-2.61466626657,2.42201819623,-2.17217075888,1.98483839435,-1.94919016449,1.73497306843,-1.33092915145,0.971920491322,-0.744751487358,0.651643707835,-0.689621577082,0.862337130807,-1.10569939533,1.17024926998,-0.798207280593,0.38156887291,-0.142706046628,0.0348213596838}
+ },
+ {
+  0.345872,
+  {0.0498846136034,0.15339331614,-0.181429447237,0.079513854912,-0.0936531465984,0.0408423064611,-0.0155707794524,-0.0238533739377,0.023923818389,0.0244094457768,0.00342936527077,-0.00396792361376,-0.0434472988914,-0.0334981638128,-0.00279651327079,0.0291786244305,0.00891714261244,-0.0133261325983,0.0141622258541,-0.00419195642853,0.00827032445594,0.00982054025308,-0.0179936967069,0.00226501612227,-0.0132538986545,0.0378707800394,-0.00688992115794,0.0111456129937,-0.0273419433978,0.00872578616182,0.00717947556427,-0.0374044457192},
+  {-1.0,3.37089394253,-5.15333644831,5.14536267716,-4.33107788239,3.24409832424,-1.72361753859,0.427378040676,-0.0512596154251,0.31097749561,-0.678361642005,1.02920903854,-1.05097349619,0.726333135324,-0.589488091684,0.715381386209,-0.697946485373,0.610488298041,-0.713053457725,0.790022780234,-0.705214670903,0.634220904674,-0.495299068869,0.315537000476,-0.48835828659,0.817654014281,-0.910925009656,0.928943449239,-0.966258107958,0.809711931099,-0.43608089268,0.112957243583}
+ },
+ {
+  0.343298,
+  {0.0674554035068,0.173853897146,-0.190367328842,0.0085766800113,-0.0362408310668,-0.0344590253772,0.0128993872883,0.0090186446939,0.0216906482266,0.0526586573573,-0.0301123625897,-0.0167065766584,-0.030645306509,-0.0435668208454,0.0429456395194,0.0235224862389,-0.00608330559965,-0.00849192171666,0.000431880417087,0.00750113101949,0.0076487237502,-0.00980802851758,-0.00779085308771,0.0177135080685,-0.0201191052118,0.023400075497,-0.0156595997953,-0.0212109914638,0.0130985258166,0.00367464067579,-0.00456928441199,-0.0166285401274},
+  {-1.0,3.04218379857,-3.77708727323,2.50853899492,-1.20710044581,0.760313142708,-0.484310865719,0.136751407887,-0.0923864104563,0.432689273295,-0.708695463146,0.551579252495,0.0739872464931,-0.741575610092,0.888168414486,-0.585160958443,0.318044721782,-0.164564138889,-0.00915073024011,0.167484452794,-0.242147098285,0.26493116484,-0.298181064615,0.341886465159,-0.422148140217,0.413877725334,-0.128543042603,-0.117424005164,-0.0859717398993,0.392306512545,-0.329952270786,0.0991633408107}
+ },
+ {
+  0.347590,
+  {0.0356429517269,0.114664940029,-0.0996221254047,0.0474223445081,-0.054493571966,0.0182188583147,-0.0334377646895,0.00667856755707,-0.0562529960078,0.0465141629295,-0.0284384634532,0.0356366790974,-0.00661222691683,-0.0150371925945,0.0044423676192,-0.00149065455487,-0.0154778025158,-0.0124280060125,-0.00728826131358,0.00306045135204,0.0392782805064,-0.00102375240912,-0.0109535694024,0.0134482192913,0.01041517667,-0.000333748337446,-0.0205624553457,0.00311112722721,-0.010388256855,0.00214655490338,-0.00499339188307,-0.00115561865998},
+  {-1.0,3.56476080851,-5.92650569124,6.3437762761,-5.11735165629,3.07163715178,-0.983506246633,0.317494270275,-1.45834037917,2.91222238777,-3.43915984435,2.74285930764,-0.90702728274,-1.01602314183,1.71922720485,-1.05688136905,-0.155072866771,1.1521043093,-1.48485854039,0.929361650748,0.106979297432,-0.67914082381,0.293687286007,0.553809280568,-1.26291378098,1.75754481691,-2.00288239568,1.87459352605,-1.52330419045,1.08766890004,-0.567020376197,0.149416204601}
+ },
+ {
+  0.356462,
+  {0.0591350719333,0.188834224461,-0.110103587246,0.0485099222026,-0.0986117831709,-0.00646202955451,-0.0180746227735,-0.00268951432163,-0.0398040193285,0.0117977516248,-0.00668702668617,0.0364224767044,-0.017788722936,0.010315989934,-0.0119623467197,-0.0169025195171,0.000277087198409,-0.0282380172841,-0.0146539275351,-0.00963944771848,0.0402906039624,0.0355058877894,0.00298589574328,0.0184286465315,-0.0209071725321,0.0138145009696,3.91884512311e-05,-0.0679331450887,0.0104304093444,-0.0123089201893,0.00248924698137,-0.00159173416449},
+  {-1.0,2.83999526574,-3.59667158468,2.93932120941,-2.3653851791,2.14757793293,-1.64648753307,1.36497793848,-1.4056938196,1.1127810719,-0.824313520261,0.991920787609,-0.970039605687,0.59253355964,-0.265796821334,-0.0340676405762,0.309875722045,-0.239738290398,0.147615987989,-0.372986007447,0.300746038755,0.211796118065,-0.523065931395,0.547159146163,-0.591772609984,0.401172504427,0.210014632958,-0.624153315574,0.395354256505,0.0447401511345,-0.176556072242,0.0697522386378}
+ },
+ {
+  0.360461,
+  {0.0646681115031,0.28877348351,-0.224761212198,-0.0355966340878,-0.0234687637422,-0.0175639424127,-0.019760710441,-0.0822026741831,0.114751646039,-0.000809618231681,-0.0213435022819,-0.0629633018586,0.0275072268495,0.0155924008778,-0.0421240683324,0.130551698905,-0.0177723591786,-0.0735551158674,-0.0382425779115,-0.00988787339238,0.03675172554,-0.0259340691631,0.00648399674334,0.0542174817004,0.0265246792025,-0.00888042173163,-0.053558013001,0.0300234887403,-0.00925278863944,-0.0166501506442,0.029668250203,-0.0488332719051},
+  {-1.0,2.65776078764,-2.90802241759,1.83204209369,-1.38337093417,1.70188512425,-1.32919952408,0.384504912207,-0.224089513221,0.934504600347,-1.16673958209,0.469736896625,0.0866489841793,0.124978602433,-0.463430893402,0.323403520166,-0.055987835103,0.415656538413,-0.968039171067,0.685616296343,0.125177586584,-0.233786165931,-0.301142319974,0.357001670134,-0.0710409045623,0.312464366422,-0.848971019752,0.858948039707,-0.426420194347,0.103072980273,-0.0171537509268,0.0137894428053}
+ },
+ {
+  0.346870,
+  {0.027287658304,0.121131119748,-0.106057553324,0.109076864875,-0.109235349448,0.0761838981049,-0.0449689979972,0.0199711186079,-0.021318925124,-0.00911252522638,0.00411423219964,-0.0177847725842,-0.0190067525985,-0.000320503528839,-0.0113056542017,0.017423656678,-0.00849583500871,-0.00320936166863,-0.0135428378985,-0.020296926537,0.01286958181,-0.0123004251539,0.0196373036656,-0.0237519331668,0.0161073420318,-0.0290528211401,0.0221487720088,-0.0103982222082,0.00506928894893,-0.000545602287835,0.00736960113,0.0110030289608},
+  {-1.0,4.16247053877,-9.32005905553,15.092576254,-19.6856463706,21.6052079631,-20.7138011964,17.9285737316,-13.9885727447,9.66766083561,-5.76452066414,2.78972370735,-1.03551838584,0.630784571594,-1.17708849846,2.15411166976,-3.16881653169,3.76203551963,-3.57820072088,2.70862936877,-1.37899345387,-0.204583382278,1.79700650009,-3.27178252805,4.53816419218,-5.22226251677,4.98751419758,-3.93280630933,2.45801100277,-1.14429798174,0.362437931178,-0.0652454212825}
+ },
+ {
+  0.298113,
+  {0.0567538999021,0.121907137429,-0.200088805888,0.0943425970383,-0.135668593734,0.10737250017,-0.024394010503,-0.00953803323669,-0.0610851614693,0.0815055297527,-0.0240674955287,0.0390354075174,0.00720460116134,-0.0497322432165,0.0338639632801,-0.0558422134941,0.00493075352548,0.0223037854159,-0.00325178324098,0.0110034123712,-0.00884150249387,-0.0079441966229,0.0364410690247,-0.00602504172372,-0.0210176294269,0.00554470785618,-0.0220435339778,0.0350113281306,-0.00854090491893,-0.0116893948249,0.00328729358729,-0.0071568291508},
+  {-1.0,3.42559865729,-5.07788984119,4.87462873365,-4.1886826727,3.41866830144,-2.37535556405,1.49642726044,-1.08365410753,1.19077059888,-1.15960221634,0.35512909413,0.494403736308,-0.745806625051,0.764375341619,-0.494595923544,-0.29652000072,1.07683939125,-1.29006953568,0.950912540233,-0.426547261763,0.110487490402,-0.126184145166,0.408716048242,-0.912352414522,1.41015812894,-1.49745850278,1.05672083203,-0.402589080111,-0.0341072701312,0.105813238542,-0.0299478314567}
+ },
+
+};
+
+void
+CabinetIII::init()
+{
+ models = fs > 46000 ? allmodels : allmodels + 17;
+
+ h = 0;
+ model = -1;
+}
+
+void
+CabinetIII::switch_model (int m)
+{
+ model = m;
+ if (fs > 46000) m += 17;
+
+ m %= (2*17);
+ a = models[m].a;
+ b = models[m].b;
+ gain = models[m].gain*db2lin(getport(2));
+
+ memset(x, 0, sizeof(x));
+ memset(y, 0, sizeof(y));
+}
+
+void
+CabinetIII::activate()
+{
+
+ model = -1;
+}
+
+void
+CabinetIII::cycle (uint frames)
+{
+ int m = (int) getport(0) + 17*((int) getport(1));
+ if (m != model) switch_model (m);
+
+ sample_t g = models[model].gain*db2lin (getport(2));
+ double gf = pow (g/gain, 1/(double) frames);
+
+ sample_t * s = ports[3];
+ sample_t * d = ports[4];
+
+ for (uint i = 0; i < frames; ++i)
+ {
+  register cabinet_float acc = s[i] + normal;
+
+  x[h] = acc;
+  acc *= a[0];
+  for(int j=1, z=h-1; j<32; --z,++j)
+  {
+   z &= 31;
+   acc += a[j]*x[z];
+   acc += b[j]*y[z];
+  }
+  y[h] = acc;
+  d[i] = gain*acc;
+
+  h = (h+1) & 31;
+  gain *= gf;
+ }
+}
+
+
+
+PortInfo
+CabinetIII::port_info [] =
+{
+ { "model", 
+           0x4
+           |
+           0x1
+                  , {
+                     0x20 
+                             | 
+                               0x240
+                                        , 0, 17 -1}, "{0:\"off\",1:\"twin\",2:\"wookie\",3:\"blue\",4:\"indigo\",5:\"supra\",6:\"tweedie\",7:\"basswoman\",8:\"martial\",9:\"poser\",10:\"cabby\",11:\"angel\",12:\"matched\",13:\"yellow\",14:\"piquey\",15:\"paladin\",16:\"turtle\"}" },
+ { "alt", 
+         0x4
+         |
+         0x1
+                , {
+                   0x20 
+                           | 
+                             0x200
+                                      , 0, 1}, "{0:'off',1:'on',}" },
+ { "gain (dB)", 
+               0x4
+               |
+               0x1 
+                       | (
+                         0x8
+                         <<1), {
+                                 0x200
+                                          , -24, 24} },
+
+ { "in", 
+        0x1 
+              | 
+                0x8 
+                      },
+ { "out", 
+         0x2 
+                | 
+                  0x8 
+                        }
+};
+
+
+
+template <> void
+Descriptor<CabinetIII>::setup()
+{
+ Label = "CabinetIII";
+
+ Name = "C* " "CabinetIII - Simplistic loudspeaker cabinet emulation";
+ Maker = "Tim Goetze <tim@quitte.de>";
+ Copyright = "2002-14";
+
+
+ autogen();
+}
diff --git a/gcc/testsuite/g++.dg/wrappers/NOT_FOR_UPSTREAM/reduced-x86-tune-sched-bd.ii b/gcc/testsuite/g++.dg/wrappers/NOT_FOR_UPSTREAM/reduced-x86-tune-sched-bd.ii
new file mode 100644
index 0000000..5cc93a1
--- /dev/null
+++ b/gcc/testsuite/g++.dg/wrappers/NOT_FOR_UPSTREAM/reduced-x86-tune-sched-bd.ii
@@ -0,0 +1,20 @@
+enum dispatch_group {
+  disp_no_group = 0,
+  disp_load,
+  disp_store,
+  disp_load_store,
+  disp_prefetch,
+  disp_imm,
+  disp_imm_32,
+  disp_imm_64,
+  disp_branch,
+  disp_cmp,
+  disp_jcc,
+  disp_last
+};
+
+char group_name[disp_last + 1][16] = {
+  "disp_no_group", "disp_load", "disp_store",  "disp_load_store",
+  "disp_prefetch", "disp_imm",  "disp_imm_32", "disp_imm_64",
+  "disp_branch",   "disp_cmp",  "disp_jcc",    "disp_last"
+};
diff --git a/gcc/testsuite/g++.dg/wrappers/NOT_FOR_UPSTREAM/test-const-char-ptr.C b/gcc/testsuite/g++.dg/wrappers/NOT_FOR_UPSTREAM/test-const-char-ptr.C
new file mode 100644
index 0000000..2ca2330
--- /dev/null
+++ b/gcc/testsuite/g++.dg/wrappers/NOT_FOR_UPSTREAM/test-const-char-ptr.C
@@ -0,0 +1,7 @@
+extern void f (char *);
+
+void g (void)
+{
+  f (""); // { dg-error "forbids converting a string constant to" "" { target { c++11 } } }
+  // { dg-warning "deprecated conversion from string constant to" "" { target { c++98_only } } .-1 }
+}
diff --git a/gcc/testsuite/g++.dg/wrappers/NOT_FOR_UPSTREAM/test-refs.C b/gcc/testsuite/g++.dg/wrappers/NOT_FOR_UPSTREAM/test-refs.C
new file mode 100644
index 0000000..64f0562
--- /dev/null
+++ b/gcc/testsuite/g++.dg/wrappers/NOT_FOR_UPSTREAM/test-refs.C
@@ -0,0 +1,6 @@
+extern void f (int &);
+
+void g (int a)
+{
+  f (a);
+}
-- 
1.8.5.3

